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, runs it and computes the expectation value.

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

  • graph (networkx 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:

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

Return type:

callable