Skip to content

Commit

Permalink
Angle consitency in RZ docstring (#13873) (#13875)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3aa8cc1)

Co-authored-by: Guillermo Abad López <[email protected]>
  • Loading branch information
mergify[bot] and GuillermoAbadLopez authored Feb 18, 2025
1 parent acc9cec commit 2b56910
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions qiskit/circuit/library/standard_gates/rz.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ class RZGate(Gate):
.. code-block:: text
┌───────┐
q_0: ┤ Rz(λ) ├
q_0: ┤ Rz(φ) ├
└───────┘
**Matrix Representation:**
.. math::
RZ(\lambda) = \exp\left(-i\frac{\lambda}{2}Z\right) =
RZ(\phi) = \exp\left(-i\frac{\phi}{2}Z\right) =
\begin{pmatrix}
e^{-i\frac{\lambda}{2}} & 0 \\
0 & e^{i\frac{\lambda}{2}}
e^{-i\frac{\phi}{2}} & 0 \\
0 & e^{i\frac{\phi}{2}}
\end{pmatrix}
.. seealso::
Expand All @@ -57,7 +57,7 @@ class RZGate(Gate):
.. math::
U1(\lambda) = e^{i{\lambda}/2}RZ(\lambda)
U1(\theta=\phi) = e^{i{\phi}/2}RZ(\phi)
Reference for virtual Z gate implementation:
`1612.00858 <https://arxiv.org/abs/1612.00858>`_
Expand Down Expand Up @@ -186,10 +186,10 @@ class CRZGate(ControlledGate):
.. math::
CRZ(\theta)\ q_0, q_1 =
I \otimes |0\rangle\langle 0| + RZ(\theta) \otimes |1\rangle\langle 1| =
I \otimes |0\rangle\langle 0| + RZ(\phi=\theta) \otimes |1\rangle\langle 1| =
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & e^{-i\frac{\lambda}{2}} & 0 & 0 \\
0 & e^{-i\frac{\theta}{2}} & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & e^{i\frac{\theta}{2}}
\end{pmatrix}
Expand Down

0 comments on commit 2b56910

Please sign in to comment.