convert_to_prx#
- convert_to_prx(qc: QuantumCircuit) QuantumCircuit[source]#
Convert single-qubit gates to PRX (Phased-RX) gate decomposition.
This pass converts arbitrary single-qubit gates to PRX gates. When a U3 gate is already in PRX form (\(\lambda \approx -\phi\)), it is replaced by a single
PRXGate. Otherwise it is decomposed into a sequence of twoPRXGateoperations.Global phases introduced by the decompositions are accumulated and emitted as a
GPhaseGateon the zeroth qubit of the output circuit at the end of the pass.- Parameters:
- qcQuantumCircuit
The input quantum circuit.
- Returns:
- QuantumCircuit
A new circuit with single-qubit gates decomposed into PRX gates and an optional trailing global-phase gate.
Examples
>>> from qrisp import PassManager, convert_to_prx >>> pm = PassManager() >>> pm.add_pass(convert_to_prx) >>> transpiled_qc = pm.run(qc)
PRXGate#
- class PRXGate(alpha: FloatLike = 0, beta: FloatLike = 0)[source]#
PRX (Phased-RX) gate.
The PRX gate is a single-qubit gate of the form:
\[\text{PRX}(\alpha, \beta) = R_Z(\beta) \cdot R_X(\alpha) \cdot R_Z(-\beta)\]- Parameters:
- alphaFloatLike, optional
The rotation angle. The default is 0.
- betaFloatLike, optional
The phase parameter. The default is 0.