Built-in Passes#

Qrisp ships with the following circuit transformation passes. Each pass is a CircuitPass that transforms a QuantumCircuit and can be used standalone or as part of a PassManager pipeline.

Pass

Description

arrange_swaps

Rearrange SWAP gates for better cancellation later

fuse_adjacents

Cancel adjacent gate–inverse-gate pairs via DAG analysis

cancel_zero_controls

Remove gates controlled on |0⟩ states

combine_single_qubit_gates

Fuse consecutive single-qubit gates into one

commute_swaps

Commute single-qubit ops past SWAP gates

convert_to_cx

Convert two-qubit gates (CZ, CY, SWAP) to CX-based form

convert_to_cz

Convert two-qubit gates (CX, CY, SWAP) to CZ-based form

convert_to_prx

Convert single-qubit gates to native PRX (Phased-RX) gates

decompose

Recursively dissolve synthesized gates into elementary gates

gray_synth_toffoli

Synthesize Toffoli gates using Gray-code decomposition

manual_layout

Re-index qubits according to a user-supplied mapping

remove_barriers

Remove barrier instructions from the circuit

resolve_swaps

Resolve SWAP gates by physically permuting qubits

reverse_parallelize

Reverse-parallelize the circuit for reuse in conjugate

visualize

Print the circuit to stdout for debugging