Rotation Gates
Rotation gates are parameterized single-qubit gates that perform rotations around the X, Y, or Z axes of the Bloch sphere by an angle θ. These gates are fundamental for variational quantum algorithms and quantum control.RX Gate (X-Rotation)
The RX gate performs a rotation around the X-axis of the Bloch sphere by angle θ.Mathematical Definition
Matrix Representation
Implementation
Fromquantum_computer.py:947-961:
Usage Example
Special Cases
- Rx(0) = I (identity)
- Rx(π) = -iX (equivalent to Pauli-X up to global phase)
- Rx(π/2) = (I - iX)/√2 (quarter rotation)
RY Gate (Y-Rotation)
The RY gate performs a rotation around the Y-axis of the Bloch sphere by angle θ.Mathematical Definition
Matrix Representation
Implementation
Fromquantum_computer.py:963-977:
Usage Example
Special Cases
- Ry(0) = I (identity)
- Ry(π) = -iY (equivalent to Pauli-Y up to global phase)
- Ry(π/2) = (|0⟩ + |1⟩)/√2 (creates equal superposition, similar to Hadamard)
RZ Gate (Z-Rotation)
The RZ gate performs a rotation around the Z-axis of the Bloch sphere by angle θ, applying a phase shift.Mathematical Definition
Matrix Representation
Implementation
Fromquantum_computer.py:979-994:
Usage Example
Special Cases
- Rz(0) = I (identity)
- Rz(π) = -iZ (equivalent to Pauli-Z up to global phase)
- Rz(π/2) = S gate (phase gate)
- Rz(π/4) = T gate
Parameter Passing
Rotation gates require thetheta parameter to be passed via the params dictionary:
Parameterized Circuit Example
Rotation gates are essential for variational quantum algorithms:Relationship to Pauli Gates
Rotation gates generalize the Pauli gates:Bloch Sphere Interpretation
Each rotation gate moves a qubit state on the Bloch sphere:- RX(θ): Rotates around the X-axis (left-right)
- RY(θ): Rotates around the Y-axis (front-back)
- RZ(θ): Rotates around the Z-axis (vertical)
Example: Creating an arbitrary state
Gate Registry
Rotation gates are registered in_GATE_REGISTRY (quantum_computer.py:1157-1174):
Technical Notes
Angle Convention
All rotation gates use the half-angle convention:- Matrix elements use θ/2, not θ
- This matches the standard quantum computing convention
- A rotation of θ = 2π returns to the original state
Continuous Parameters
Unlike discrete gates (H, X, Y, Z), rotation gates accept continuous angle parameters:Default Parameter Value
Iftheta is not provided in params, it defaults to 0.0 (identity operation):
See Also
- Single-Qubit Gates - Fixed gates (H, X, Y, Z)
- Two-Qubit Gates - CNOT, CZ, SWAP
- Variational quantum algorithms (VQE, QAOA) that use parameterized circuits