iqm.benchmarks.optimization.qscore.create_objective_function

iqm.benchmarks.optimization.qscore.create_objective_function#

iqm.benchmarks.optimization.qscore.create_objective_function(counts: dict[str, int], graph: Graph, qubit_to_node: dict[int, int], virtual_nodes: list[tuple[int, int]]) Callable#

Creates a function that maps the parameters to the parametrized circuit and returns exp values.

Parameters:
  • counts (dict[str, int]) – The dictionary of bitstring counts.

  • graph (Graph) – The MaxCut problem graph.

  • qubit_to_node (dict[int, int]) – Mapping of qubit to nodes of the graph

  • virtual_nodes (list[tuple[int, int]]) – List of virtual nodes in the graph

Returns:

Callable function that gives expectation value of the cut edges from counts sampled from the ansatz

Return type:

Callable