iqm.qrisp_iqm.passes.routing.core.graph_processing_tools.prune_dag

Contents

iqm.qrisp_iqm.passes.routing.core.graph_processing_tools.prune_dag#

iqm.qrisp_iqm.passes.routing.core.graph_processing_tools.prune_dag(circuit_dag: CircuitDAG, pruning_threshold: int) → CircuitDAG#

Prune instructions below a threshold from an instruction DAG.

All instructions below the given threshold are removed.

Parameters:
  • circuit_dag (CircuitDAG) – Quantum circuit as a DAG.

  • pruning_threshold (int) – Any node that has an instruction index less than this number will be removed.

Returns:

The pruned quantum circuit DAG. Note that the indices array can still contain nodes that are pruned, however these indices are negative, which is considered to be “invalid”

Return type:

CircuitDAG