From 7048db90d54c13d323ecbdca30a514f0467db8a7 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 17:04:17 -0500 Subject: [PATCH] Fix incorrect TeX (backport #11599) (#11615) * 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 30bf727eb95a024c0c27962b8992ec1f3a0b70db) # Conflicts: # qiskit/pulse/library/symbolic_pulses.py * Fix merge conflict --------- Co-authored-by: Kevin J. Sung Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com> --- qiskit/circuit/library/standard_gates/u3.py | 2 ++ qiskit/pulse/library/symbolic_pulses.py | 24 ++++++++++++++++--- qiskit/quantum_info/operators/measures.py | 8 ++++--- .../operators/symplectic/pauli.py | 2 ++ .../passes/optimization/consolidate_blocks.py | 2 +- 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/qiskit/circuit/library/standard_gates/u3.py b/qiskit/circuit/library/standard_gates/u3.py index cae5f905a3f4..c26c761fc333 100644 --- a/qiskit/circuit/library/standard_gates/u3.py +++ b/qiskit/circuit/library/standard_gates/u3.py @@ -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) = diff --git a/qiskit/pulse/library/symbolic_pulses.py b/qiskit/pulse/library/symbolic_pulses.py index 84a202f6af6d..dbe1f8e8fd78 100644 --- a/qiskit/pulse/library/symbolic_pulses.py +++ b/qiskit/pulse/library/symbolic_pulses.py @@ -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)`. @@ -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: @@ -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}\\\\ @@ -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)`. @@ -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: @@ -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 @@ -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}\\\\ @@ -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)`. @@ -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 @@ -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: @@ -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 diff --git a/qiskit/quantum_info/operators/measures.py b/qiskit/quantum_info/operators/measures.py index 6cb0ea97edde..b9fd7fadea0d 100644 --- a/qiskit/quantum_info/operators/measures.py +++ b/qiskit/quantum_info/operators/measures.py @@ -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: @@ -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 @@ -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: @@ -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: diff --git a/qiskit/quantum_info/operators/symplectic/pauli.py b/qiskit/quantum_info/operators/symplectic/pauli.py index 4fa35411007f..2f68eef7d904 100644 --- a/qiskit/quantum_info/operators/symplectic/pauli.py +++ b/qiskit/quantum_info/operators/symplectic/pauli.py @@ -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. diff --git a/qiskit/transpiler/passes/optimization/consolidate_blocks.py b/qiskit/transpiler/passes/optimization/consolidate_blocks.py index 71065113bb5a..c640a156f331 100644 --- a/qiskit/transpiler/passes/optimization/consolidate_blocks.py +++ b/qiskit/transpiler/passes/optimization/consolidate_blocks.py @@ -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__()