mimiqcircuits.operations.gates.generalized.rpauli¶
Pauli rotation gate (RPauli).
Classes
|
Apply a Pauli string rotation gate of the form: |
- class mimiqcircuits.operations.gates.generalized.rpauli.RPauli(pauli, theta)[source]¶
Bases:
GateApply a Pauli string rotation gate of the form:
\[e^{-i \frac{\theta}{2} (P_1 \otimes P_2 \otimes \dots)}\]where each \(P_i\) is a Pauli operator from
"I","X","Y", or"Z", acting on a separate qubit.This gate represents the time evolution under a tensor product of Pauli operators, which is useful for simulating Hamiltonian dynamics, variational ansätze, and Trotter steps.
Identity-only strings or zero rotation angles are optimized away as no-ops.
- Parameters:
pauli (PauliString) – A tensor product of Pauli operators such as
"X","ZIZ", or"IXY".theta (float or symengine.Basic) – The rotation angle.
Note
The operator acts on all qubits where the Pauli string is non-identity. It decomposes into native gates including Hadamards, RZs, and CNOTs.
Examples:
>>> from mimiqcircuits import * >>> from symengine import pi >>> RPauli(PauliString("X"), pi/2) R("X", (1/2)*pi)
>>> RPauli(PauliString("ZIZ"), 2.0) R("ZIZ", 2.0)
>>> c = Circuit() >>> c.push(RPauli(PauliString("YXI"), 2.0), 1, 2, 3) 4-qubit circuit with 1 instruction: └── R("YXI", 2.0) @ q[1:3]
>>> c.push(RPauli(PauliString("III"), pi), 1, 2, 3) 4-qubit circuit with 2 instructions: ├── R("YXI", 2.0) @ q[1:3] └── R("III", pi) @ q[1:3]
>>> c.push(RPauli(PauliString("IXY"), pi), 1, 2, 3) 4-qubit circuit with 3 instructions: ├── R("YXI", 2.0) @ q[1:3] ├── R("III", pi) @ q[1:3] └── R("IXY", pi) @ q[1:3]
See also
PauliString,GateRZ- isunitary()[source]¶
Check if the object is unitary.
By default, this method returns False unless explicitly overridden in a subclass.
- iswrapper()[source]¶
Check if the operator is a wrapper around another operator.
This method should be overridden in subclasses to return True if the operator is acting as a wrapper around another operation or object, and False otherwise.
- Returns:
Always returns False in the base class. Subclasses should override this method to provide the appropriate logic.
- Return type:
- matrix()[source]¶
Compute the matrix representation of the operator.
This method returns a symengine Matrix object representing the operator. It simplifies the matrix expression and evaluates it to a floating-point precision.
- Returns:
The matrix representation of the operator.
- Return type:
symengine.Matrix