Skip to content

Commit

Permalink
Fix incorrect TeX (backport #11599) (#11615)
Browse files Browse the repository at this point in the history
* Fix incorrect TeX (#11599)

* fix tex

* use aligned instead of align*

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
(cherry picked from commit 30bf727)

# Conflicts:
#	qiskit/pulse/library/symbolic_pulses.py

* Fix merge conflict

---------

Co-authored-by: Kevin J. Sung <kevjsung@umich.edu>
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
  • Loading branch information
3 people committed Jan 22, 2024
1 parent 341ad69 commit 7048db9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
2 changes: 2 additions & 0 deletions qiskit/circuit/library/standard_gates/u3.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ class CU3Gate(ControlledGate):
.. math::
\newcommand{\rotationangle}{\frac{\theta}{2}}
CU3(\theta, \phi, \lambda)\ q_1, q_0 =
|0\rangle\langle 0| \otimes I +
|1\rangle\langle 1| \otimes U3(\theta,\phi,\lambda) =
Expand Down
24 changes: 21 additions & 3 deletions qiskit/pulse/library/symbolic_pulses.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,10 @@ class Gaussian(metaclass=_PulseType):
.. math::
\begin{aligned}
f'(x) &= \exp\Bigl( -\frac12 \frac{{(x - \text{duration}/2)}^2}{\text{sigma}^2} \Bigr)\\
f(x) &= \text{A} \times \frac{f'(x) - f'(-1)}{1-f'(-1)}, \quad 0 \le x < \text{duration}
\end{aligned}
where :math:`f'(x)` is the gaussian waveform without lifting or amplitude scaling, and
:math:`\text{A} = \text{amp} \times \exp\left(i\times\text{angle}\right)`.
Expand Down Expand Up @@ -802,8 +804,10 @@ class GaussianSquare(metaclass=_PulseType):
.. math::
\\text{risefall} &= \\text{risefall_sigma_ratio} \\times \\text{sigma}\\\\
\\begin{aligned}
\\text{risefall} &= \\text{risefall\\_sigma\\_ratio} \\times \\text{sigma}\\\\
\\text{width} &= \\text{duration} - 2 \\times \\text{risefall}
\\end{aligned}
If ``width`` is not None and ``risefall_sigma_ratio`` is None:
Expand All @@ -813,6 +817,7 @@ class GaussianSquare(metaclass=_PulseType):
.. math::
\\begin{aligned}
f'(x) &= \\begin{cases}\
\\exp\\biggl(-\\frac12 \\frac{(x - \\text{risefall})^2}{\\text{sigma}^2}\\biggr)\
& x < \\text{risefall}\\\\
Expand All @@ -826,6 +831,7 @@ class GaussianSquare(metaclass=_PulseType):
\\end{cases}\\\\
f(x) &= \\text{A} \\times \\frac{f'(x) - f'(-1)}{1-f'(-1)},\
\\quad 0 \\le x < \\text{duration}
\\end{aligned}
where :math:`f'(x)` is the gaussian square waveform without lifting or amplitude scaling, and
:math:`\\text{A} = \\text{amp} \\times \\exp\\left(i\\times\\text{angle}\\right)`.
Expand Down Expand Up @@ -948,8 +954,10 @@ def GaussianSquareDrag(
.. math::
\\text{risefall} &= \\text{risefall_sigma_ratio} \\times \\text{sigma}\\\\
\\begin{aligned}
\\text{risefall} &= \\text{risefall\\_sigma\\_ratio} \\times \\text{sigma}\\\\
\\text{width} &= \\text{duration} - 2 \\times \\text{risefall}
\\end{aligned}
If ``width`` is not None and ``risefall_sigma_ratio`` is None:
Expand All @@ -960,8 +968,10 @@ def GaussianSquareDrag(
.. math::
\\begin{aligned}
g(x, c, σ) &= \\exp\\Bigl(-\\frac12 \\frac{(x - c)^2}{σ^2}\\Bigr)\\\\
g'(x, c, σ) &= \\frac{g(x, c, σ)-g(-1, c, σ)}{1-g(-1, c, σ)}
\\end{aligned}
From these, the lifted DRAG curve :math:`d'(x, c, σ, β)` can be written as
Expand All @@ -974,6 +984,7 @@ def GaussianSquareDrag(
.. math::
\\begin{aligned}
f'(x) &= \\begin{cases}\
\\text{A} \\times d'(x, \\text{risefall}, \\text{sigma}, \\text{beta})\
& x < \\text{risefall}\\\\
Expand All @@ -987,6 +998,7 @@ def GaussianSquareDrag(
)\
& \\text{risefall} + \\text{width} \\le x\
\\end{cases}\\\\
\\end{aligned}
where :math:`\\text{A} = \\text{amp} \\times
\\exp\\left(i\\times\\text{angle}\\right)`.
Expand Down Expand Up @@ -1093,12 +1105,14 @@ def gaussian_square_echo(
.. math::
\\begin{aligned}
g_e(x) &= \\begin{cases}\
f_{\\text{active}} + f_{\\text{echo}}(x)\
& x < \\frac{\\text{duration}}{2}\\\\
f_{\\text{active}} - f_{\\text{echo}}(x)\
& \\frac{\\text{duration}}{2} < x\
\\end{cases}\\\\
\\end{aligned}
One case where this pulse can be used is when implementing a direct CNOT gate with
a cross-resonance superconducting qubit architecture. When applying this pulse to
Expand All @@ -1111,8 +1125,10 @@ def gaussian_square_echo(
.. math::
\\text{risefall} &= \\text{risefall_sigma_ratio} \\times \\text{sigma}\\\\
\\begin{aligned}
\\text{risefall} &= \\text{risefall\\_sigma\\_ratio} \\times \\text{sigma}\\\\
\\text{width} &= \\text{duration} - 2 \\times \\text{risefall}
\\end{aligned}
If ``width`` is not None and ``risefall_sigma_ratio`` is None:
Expand Down Expand Up @@ -1347,11 +1363,13 @@ class Drag(metaclass=_PulseType):
.. math::
\\begin{aligned}
g(x) &= \\exp\\Bigl(-\\frac12 \\frac{(x - \\text{duration}/2)^2}{\\text{sigma}^2}\\Bigr)\\\\
g'(x) &= \\text{A}\\times\\frac{g(x)-g(-1)}{1-g(-1)}\\\\
f(x) &= g'(x) \\times \\Bigl(1 + 1j \\times \\text{beta} \\times\
\\Bigl(-\\frac{x - \\text{duration}/2}{\\text{sigma}^2}\\Bigr) \\Bigr),
\\quad 0 \\le x < \\text{duration}
\\end{aligned}
where :math:`g(x)` is a standard unlifted Gaussian waveform, :math:`g'(x)` is the lifted
:class:`~qiskit.pulse.library.Gaussian` waveform, and
Expand Down
8 changes: 5 additions & 3 deletions qiskit/quantum_info/operators/measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def process_fidelity(
require_tp (bool): check if input and target channels are
trace-preserving and if non-TP log warning
containing negative eigenvalues of partial
Choi-matrix :math:`Tr_{\mbox{out}}[\mathcal{E}] - I`
Choi-matrix :math:`Tr_{\text{out}}[\mathcal{E}] - I`
[Default: True].
Returns:
Expand Down Expand Up @@ -154,10 +154,12 @@ def average_gate_fidelity(
The average gate fidelity :math:`F_{\text{ave}}` is given by
.. math::
\begin{aligned}
F_{\text{ave}}(\mathcal{E}, U)
&= \int d\psi \langle\psi|U^\dagger
\mathcal{E}(|\psi\rangle\!\langle\psi|)U|\psi\rangle \\
&= \frac{d F_{\text{pro}}(\mathcal{E}, U) + 1}{d + 1}
\end{aligned}
where :math:`F_{\text{pro}}(\mathcal{E}, U)` is the
:meth:`~qiskit.quantum_info.process_fidelity` of the input quantum
Expand All @@ -175,7 +177,7 @@ def average_gate_fidelity(
require_tp (bool): check if input and target channels are
trace-preserving and if non-TP log warning
containing negative eigenvalues of partial
Choi-matrix :math:`Tr_{\mbox{out}}[\mathcal{E}] - I`
Choi-matrix :math:`Tr_{\text{out}}[\mathcal{E}] - I`
[Default: True].
Returns:
Expand Down Expand Up @@ -232,7 +234,7 @@ def gate_error(
require_tp (bool): check if input and target channels are
trace-preserving and if non-TP log warning
containing negative eigenvalues of partial
Choi-matrix :math:`Tr_{\mbox{out}}[\mathcal{E}] - I`
Choi-matrix :math:`Tr_{\text{out}}[\mathcal{E}] - I`
[Default: True].
Returns:
Expand Down
2 changes: 2 additions & 0 deletions qiskit/quantum_info/operators/symplectic/pauli.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ class initialization (``Pauli('-iXYZ')``). A ``Pauli`` object can be
.. math::
\begin{aligned}
P &= P_{n-1} \otimes ... \otimes P_{0} \\
P_k &= (-i)^{z[k] * x[k]} Z^{z[k]}\cdot X^{x[k]}
\end{aligned}
where ``z[k] = P.z[k]``, ``x[k] = P.x[k]`` respectively.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(
kak_basis_gate (Gate): Basis gate for KAK decomposition.
force_consolidate (bool): Force block consolidation.
basis_gates (List(str)): Basis gates from which to choose a KAK gate.
approximation_degree (float): a float between $[0.0, 1.0]$. Lower approximates more.
approximation_degree (float): a float between :math:`[0.0, 1.0]`. Lower approximates more.
target (Target): The target object for the compilation target backend.
"""
super().__init__()
Expand Down

0 comments on commit 7048db9

Please sign in to comment.