iqm.qrisp_iqm.passes.routing.core.graph_processing_tools.convert_qc_to_sparse_dag#
- iqm.qrisp_iqm.passes.routing.core.graph_processing_tools.convert_qc_to_sparse_dag(qc: QuantumCircuit, topo_sort: Callable | None = None) tuple[CircuitDAG, list[Instruction | None]]#
Convert a quantum circuit into a DAG.
The DAG representation used here is the permeability DAG, which allows the routing algorithms to leverage permeability-induced commutation relations for shortcuts. See the preamble of this file for a full description.
- Parameters:
qc (QuantumCircuit) – Quantum circuit that is to be converted.
topo_sort (Callable | None) – Function that performs a topological sort on the PermeabilityGraph. Must accept a networkx DiGraph and return an iterable of nodes in topological order. The node ordering determines which instructions end up in which section when sectionized routing is used (prune_dag removes nodes by index threshold). By default, nx.topological_sort is used.
- Returns:
circuit DAG
corresponding Qrisp Instruction objects
- Return type:
tuple[CircuitDAG, list[Instruction | None]]