iqm.benchmarks.optimization.qscore.run_QAOA

Contents

iqm.benchmarks.optimization.qscore.run_QAOA#

iqm.benchmarks.optimization.qscore.run_QAOA(counts: Dict[str, int], graph_physical: Graph, qubit_node: Dict[int, int], use_classical_angles: bool, qaoa_layers: int, virtual_nodes: List[Tuple[int, int]]) float#

Solves the cut size of MaxCut for a graph using QAOA. The result is average value sampled from the optimized ansatz.

Parameters:
  • counts (Dict[str, int]) – key as bitstring, value as counts

  • graph_physical (Graph) – the graph to be optimized

  • qubit_node (Dict[int, int]) – the qubit to be optimized

  • use_classical_angles (bool) – whether to use classical angles

  • qaoa_layers (int) – the number of QAOA layers

  • virtual_nodes (List[Tuple[int, int]]) – the presence of virtual nodes or not

Returns:

the expectation value of the maximum cut size.

Return type:

float