iqm.qrisp_iqm.passes.routing.core.vf2pp.qc_to_interaction_graph

iqm.qrisp_iqm.passes.routing.core.vf2pp.qc_to_interaction_graph#

iqm.qrisp_iqm.passes.routing.core.vf2pp.qc_to_interaction_graph(qc: QuantumCircuit) → tuple[ndarray, ndarray]#

Extract the qubit-interaction graph of a quantum circuit.

Builds an undirected graph with one node per circuit qubit, where edges represent two-qubit interactions in the circuit. Single-qubit gates, barriers, and measurements are ignored.

Parameters:

qc (QuantumCircuit) – The quantum circuit to extract the interaction graph from.

Returns:

  • CSR index pointer array of the interaction graph

  • CSR indices array of the interaction graph

Return type:

tuple[ndarray, ndarray]