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 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