iqm.benchmarks.entanglement.ghz.get_cx_map

Contents

iqm.benchmarks.entanglement.ghz.get_cx_map#

iqm.benchmarks.entanglement.ghz.get_cx_map(qubit_layout: List[int], graph: Graph) list[list[int]]#

Calculate the cx_map based on participating qubits and the 2QB gate fidelities between them.

Uses networkx graph algorithms to calculate the minimal spanning tree of the subgraph defined by qubit_layout. The weights are -log(CZ fidelity) for each edge. Then, finds the qubit in the most central position by calculating the distances between all qubits. Next, adds CX applications to the list, starting from the central qubit, such that the smallest number of layers is executed (most parallel).

Parameters:
  • qubit_layout (List[int]) – List[int] The subset of system-qubits used in the protocol, indexed from 0

  • graph (Graph) – networkx.Graph The connectivity graph with edge weight given by CZ fidelities

Returns:

List[List[int]]

A list of CX gates for the GHZ generation circuit, starting from the first gate to be applied

Return type:

cx_map