Skip to content

Commit

Permalink
Adjust some more TeX expressions for rendering in web docs
Browse files Browse the repository at this point in the history
Avoid spurious one-character subscripts and superscripts.

Follow-up to quantumlib#6870
  • Loading branch information
pavoljuhas committed Jan 11, 2025
1 parent 5d317ba commit c470b92
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cirq-core/cirq/experiments/qubit_characterizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def pauli_error(self) -> float:
$$r_p = (1 - 1/d^2) * (1 - p),$$
where $d = 2^N_Q$ is the Hilbert space dimension and $N_Q$ is the number of qubits.
where $d = 2^{N_Q}$ is the Hilbert space dimension and $N_Q$ is the number of qubits.
"""
opt_params, _ = self._fit_exponential()
p = opt_params[2]
Expand Down
4 changes: 2 additions & 2 deletions cirq-core/cirq/ops/common_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def p(self) -> float:
"""The probability that one of the Pauli gates is applied.
Each of the Pauli gates is applied independently with probability
$p / (4^n_qubits - 1)$.
$p / (4^n - 1)$, where $n$ is `n_qubits`.
"""
return self._p

Expand Down Expand Up @@ -372,7 +372,7 @@ def depolarize(p: float, n_qubits: int = 1) -> DepolarizingChannel:
Args:
p: The probability that one of the Pauli gates is applied. Each of
the Pauli gates is applied independently with probability
$p / (4^n - 1)$.
$p / (4^n - 1)$, where $n$ is n_qubits.
n_qubits: The number of qubits.
Raises:
Expand Down
2 changes: 1 addition & 1 deletion cirq-core/cirq/ops/phased_x_z_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def from_zyz_angles(cls, z0_rad: float, y_rad: float, z1_rad: float) -> 'cirq.Ph
def from_zyz_exponents(cls, z0: float, y: float, z1: float) -> 'cirq.PhasedXZGate':
"""Create a PhasedXZGate from ZYZ exponents.
The returned gate is equivalent to $Z^z0 Y^y Z^z1$ (in time order).
The returned gate is equivalent to $Z^{z0} Y^y Z^{z1}$ (in time order).
"""
return PhasedXZGate(axis_phase_exponent=-z0 + 0.5, x_exponent=y, z_exponent=z0 + z1)

Expand Down
4 changes: 2 additions & 2 deletions cirq-core/cirq/testing/sample_gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def _matrix_for_phasing_state(num_qubits, phase_state, phase):

@dataclasses.dataclass(frozen=True)
class PhaseUsingCleanAncilla(ops.Gate):
r"""Phases the state $|phase_state>$ by $\exp(1j * \pi * \theta)$ using one clean ancilla."""
r"""Phases the state $|phase\_state>$ by $\exp(1j * \pi * \theta)$ using one clean ancilla."""

theta: float
phase_state: int = 1
Expand All @@ -56,7 +56,7 @@ def narrow_unitary(self) -> np.ndarray:

@dataclasses.dataclass(frozen=True)
class PhaseUsingDirtyAncilla(ops.Gate):
r"""Phases the state $|phase_state>$ by -1 using one dirty ancilla."""
r"""Phases the state $|phase\_state>$ by -1 using one dirty ancilla."""

phase_state: int = 1
target_bitsize: int = 1
Expand Down

0 comments on commit c470b92

Please sign in to comment.