Fix typo in documentation (#10140)

* fix typos

* fix lint

* fix typo on excitation_preserving.py
This commit is contained in:
Kazuki Tsuoka 2023-05-25 02:08:28 +09:00 committed by GitHub
parent 02502b5d98
commit 558fb0ad21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 29 additions and 28 deletions

View File

@ -40,8 +40,10 @@ class RVGate(Gate):
\newcommand{\sinc}{\text{sinc}}
R(\vec{v}) = e^{-i \vec{v}\cdot\vec{\sigma}} =
\begin{pmatrix}
\cos{\th} -i v_z \sinc(\th) & -(i v_x + v_y) \sinc(\th) \\
-(i v_x - v_y) \sinc(\th) & \cos(\th) + i v_z \sinc(\th)
\cos\left(\th\right) -i v_z \sinc\left(\th\right)
& -(i v_x + v_y) \sinc\left(\th\right) \\
-(i v_x - v_y) \sinc\left(\th\right)
& \cos\left(\th\right) + i v_z \sinc\left(\th\right)
\end{pmatrix}
"""

View File

@ -33,8 +33,8 @@ class ExcitationPreserving(TwoLocal):
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & \cos(\th) & -i\sin(\th) & 0 \\
0 & -i\sin(\th) & \cos(\th) & 0 \\
0 & \cos\left(\th\right) & -i\sin\left(\th\right) & 0 \\
0 & -i\sin\left(\th\right) & \cos\left(\th\right) & 0 \\
0 & 0 & 0 & e^{-i\phi}
\end{pmatrix}

View File

@ -43,7 +43,6 @@ class GlobalPhaseGate(Gate):
super().__init__("global_phase", 0, [phase], label=label)
def _define(self):
q = QuantumRegister(0, "q")
qc = QuantumCircuit(q, name=self.name, global_phase=self.params[0])
@ -52,7 +51,7 @@ class GlobalPhaseGate(Gate):
def inverse(self):
r"""Return inverted GLobalPhaseGate gate.
:math:`\text{GlobalPhaseGate}(\lambda){\dagger} = \text{GlobalPhaseGate}(-\lambda)`
:math:`\text{GlobalPhaseGate}(\lambda)^{\dagger} = \text{GlobalPhaseGate}(-\lambda)`
"""
return GlobalPhaseGate(-self.params[0])

View File

@ -238,7 +238,7 @@ class CPhaseGate(ControlledGate):
return super().control(num_ctrl_qubits=num_ctrl_qubits, label=label, ctrl_state=ctrl_state)
def inverse(self):
r"""Return inverted CPhase gate (:math:`CPhase(\lambda){\dagger} = CPhase(-\lambda)`)"""
r"""Return inverted CPhase gate (:math:`CPhase(\lambda)^{\dagger} = CPhase(-\lambda)`)"""
return CPhaseGate(-self.params[0], ctrl_state=self.ctrl_state)
def __array__(self, dtype=None):
@ -341,5 +341,5 @@ class MCPhaseGate(ControlledGate):
return super().control(num_ctrl_qubits=num_ctrl_qubits, label=label, ctrl_state=ctrl_state)
def inverse(self):
r"""Return inverted MCU1 gate (:math:`MCU1(\lambda){\dagger} = MCU1(-\lambda)`)"""
r"""Return inverted MCU1 gate (:math:`MCU1(\lambda)^{\dagger} = MCU1(-\lambda)`)"""
return MCPhaseGate(-self.params[0], self.num_ctrl_qubits)

View File

@ -44,8 +44,8 @@ class RGate(Gate):
R(\theta, \phi) = e^{-i \th \left(\cos{\phi} x + \sin{\phi} y\right)} =
\begin{pmatrix}
\cos{\th} & -i e^{-i \phi} \sin{\th} \\
-i e^{i \phi} \sin{\th} & \cos{\th}
\cos\left(\th\right) & -i e^{-i \phi} \sin\left(\th\right) \\
-i e^{i \phi} \sin\left(\th\right) & \cos\left(\th\right)
\end{pmatrix}
"""

View File

@ -45,8 +45,8 @@ class RXGate(Gate):
RX(\theta) = \exp\left(-i \th X\right) =
\begin{pmatrix}
\cos{\th} & -i\sin{\th} \\
-i\sin{\th} & \cos{\th}
\cos\left(\th\right) & -i\sin\left(\th\right) \\
-i\sin\left(\th\right) & \cos\left(\th\right)
\end{pmatrix}
"""
@ -137,9 +137,9 @@ class CRXGate(ControlledGate):
I \otimes |0\rangle\langle 0| + RX(\theta) \otimes |1\rangle\langle 1| =
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & \cos{\th} & 0 & -i\sin{\th} \\
0 & \cos\left(\th\right) & 0 & -i\sin\left(\th\right) \\
0 & 0 & 1 & 0 \\
0 & -i\sin{\th} & 0 & \cos{\th}
0 & -i\sin\left(\th\right) & 0 & \cos\left(\th\right)
\end{pmatrix}
.. note::
@ -165,8 +165,8 @@ class CRXGate(ControlledGate):
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & \cos{\th} & -i\sin{\th} \\
0 & 0 & -i\sin{\th} & \cos{\th}
0 & 0 & \cos\left(\th\right) & -i\sin\left(\th\right) \\
0 & 0 & -i\sin\left(\th\right) & \cos\left(\th\right)
\end{pmatrix}
"""

View File

@ -44,8 +44,8 @@ class RYGate(Gate):
RY(\theta) = \exp\left(-i \th Y\right) =
\begin{pmatrix}
\cos{\th} & -\sin{\th} \\
\sin{\th} & \cos{\th}
\cos\left(\th\right) & -\sin\left(\th\right) \\
\sin\left(\th\right) & \cos\left(\th\right)
\end{pmatrix}
"""
@ -95,7 +95,7 @@ class RYGate(Gate):
def inverse(self):
r"""Return inverted RY gate.
:math:`RY(\lambda){\dagger} = RY(-\lambda)`
:math:`RY(\lambda)^{\dagger} = RY(-\lambda)`
"""
return RYGate(-self.params[0])
@ -136,9 +136,9 @@ class CRYGate(ControlledGate):
I \otimes |0\rangle\langle 0| + RY(\theta) \otimes |1\rangle\langle 1| =
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & \cos{\th} & 0 & -\sin{\th} \\
0 & \cos\left(\th\right) & 0 & -\sin\left(\th\right) \\
0 & 0 & 1 & 0 \\
0 & \sin{\th} & 0 & \cos{\th}
0 & \sin\left(\th\right) & 0 & \cos\left(\th\right)
\end{pmatrix}
.. note::
@ -164,8 +164,8 @@ class CRYGate(ControlledGate):
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & \cos{\th} & -\sin{\th} \\
0 & 0 & \sin{\th} & \cos{\th}
0 & 0 & \cos\left(\th\right) & -\sin\left(\th\right) \\
0 & 0 & \sin\left(\th\right) & \cos\left(\th\right)
\end{pmatrix}
"""

View File

@ -106,7 +106,7 @@ class RZGate(Gate):
def inverse(self):
r"""Return inverted RZ gate
:math:`RZ(\lambda){\dagger} = RZ(-\lambda)`
:math:`RZ(\lambda)^{\dagger} = RZ(-\lambda)`
"""
return RZGate(-self.params[0])

View File

@ -138,7 +138,7 @@ class U1Gate(Gate):
return gate
def inverse(self):
r"""Return inverted U1 gate (:math:`U1(\lambda){\dagger} = U1(-\lambda)`)"""
r"""Return inverted U1 gate (:math:`U1(\lambda)^{\dagger} = U1(-\lambda)`)"""
return U1Gate(-self.params[0])
def __array__(self, dtype=None):
@ -256,7 +256,7 @@ class CU1Gate(ControlledGate):
return super().control(num_ctrl_qubits=num_ctrl_qubits, label=label, ctrl_state=ctrl_state)
def inverse(self):
r"""Return inverted CU1 gate (:math:`CU1(\lambda){\dagger} = CU1(-\lambda)`)"""
r"""Return inverted CU1 gate (:math:`CU1(\lambda)^{\dagger} = CU1(-\lambda)`)"""
return CU1Gate(-self.params[0], ctrl_state=self.ctrl_state)
def __array__(self, dtype=None):
@ -365,5 +365,5 @@ class MCU1Gate(ControlledGate):
return gate
def inverse(self):
r"""Return inverted MCU1 gate (:math:`MCU1(\lambda){\dagger} = MCU1(-\lambda)`)"""
r"""Return inverted MCU1 gate (:math:`MCU1(\lambda)^{\dagger} = MCU1(-\lambda)`)"""
return MCU1Gate(-self.params[0], self.num_ctrl_qubits)

View File

@ -111,7 +111,7 @@ class YGate(Gate):
return super().control(num_ctrl_qubits=num_ctrl_qubits, label=label, ctrl_state=ctrl_state)
def inverse(self):
r"""Return inverted Y gate (:math:`Y{\dagger} = Y`)"""
r"""Return inverted Y gate (:math:`Y^{\dagger} = Y`)"""
return YGate() # self-inverse
def __array__(self, dtype=complex):