Skip to content

Commit

Permalink
fix RVGate doc (#11857)
Browse files Browse the repository at this point in the history
* fix rvgate doc

* lint

* fix factor of 2 and add explicit norm definition
  • Loading branch information
kevinsung committed Mar 24, 2024
1 parent 88b5193 commit 5649831
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions qiskit/circuit/library/generalized_gates/rv.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


class RVGate(Gate):
r"""Rotation around arbitrary rotation axis :math:`v` where :math:`|v|` is
r"""Rotation around arbitrary rotation axis :math:`\vec{v}` where :math:`\|\vec{v}\|_2` is
angle of rotation in radians.
Can be applied to a :class:`~qiskit.circuit.QuantumCircuit`
Expand All @@ -36,14 +36,17 @@ class RVGate(Gate):
.. math::
\newcommand{\rotationangle}{|\vec{v}|}
\newcommand{\sinc}{\text{sinc}}
R(\vec{v}) = e^{-i \vec{v}\cdot\vec{\sigma}} =
\newcommand{\rotationangle}{\frac{\|\vec{v}\|_2}{2}}
R(\vec{v}) = e^{-i \vec{v}\cdot\vec{\sigma} / 2} =
\begin{pmatrix}
\cos\left(\rotationangle\right) -i v_z \sinc\left(\rotationangle\right)
& -(i v_x + v_y) \sinc\left(\rotationangle\right) \\
-(i v_x - v_y) \sinc\left(\rotationangle\right)
& \cos\left(\rotationangle\right) + i v_z \sinc\left(\rotationangle\right)
\cos\left(\rotationangle\right)
-i \frac{v_z}{\|\vec{v}\|_2} \sin\left(\rotationangle\right)
& -(i \frac{v_x}{\|\vec{v}\|_2}
+ \frac{v_y}{\|\vec{v}\|_2}) \sin\left(\rotationangle\right) \\
-(i \frac{v_x}{\|\vec{v}\|_2}
- \frac{v_y}{\|\vec{v}\|_2}) \sin\left(\rotationangle\right)
& \cos\left(\rotationangle\right)
+ i \frac{v_z}{\|\vec{v}\|_2} \sin\left(\rotationangle\right)
\end{pmatrix}
"""

Expand Down

0 comments on commit 5649831

Please sign in to comment.