Skip to content

Commit 163a087

Browse files
authored
Fix unexpected markdown syntax in docstring (#7653)
In the docstring of [ArithmeticGate.apply](https://quantumai.google/reference/python/cirq/ArithmeticGate), two exponentiation `**` accidentally combine to a bold text syntax. Here we add backtick quotes to avoid this, and also fix a few other similar instances.
1 parent 7673240 commit 163a087

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

cirq-core/cirq/ops/arithmetic_operation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ def apply(self, *register_values: int) -> int | Iterable[int]:
130130
1. The `apply` method is permitted to return values that have more bits
131131
than the registers they will be stored into. The extra bits are
132132
simply dropped. For example, if the value 5 is returned for a 2
133-
qubit register then 5 % 2**2 = 1 will be used instead. Negative
133+
qubit register then ``5 % 2**2 = 1`` will be used instead. Negative
134134
values are also permitted. For example, for a 3 qubit register the
135-
value -2 becomes -2 % 2**3 = 6.
135+
value -2 becomes ``-2 % 2**3 = 6``.
136136
2. When the value of the last `k` registers is not changed by the
137137
gate, the `apply` method is permitted to omit these values
138138
from the result. That is to say, when the length of the output is

cirq-core/cirq/ops/common_gates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ class YPowGate(eigen_gate.EigenGate):
391391
Unlike `cirq.XPowGate` and `cirq.ZPowGate`, this gate has no generalization
392392
to qudits and hence does not take the dimension argument. Ignoring the
393393
global phase all generalized Pauli operators on a d-level system may be
394-
written as X**a Z**b for a,b=0,1,...,d-1. For a qubit, there is only one
394+
written as ``X**a Z**b`` for a,b=0,1,...,d-1. For a qubit, there is only one
395395
"mixed" operator: XZ, conventionally denoted -iY. However, when d > 2 there
396396
are (d-1)*(d-1) > 1 such "mixed" operators (still ignoring the global phase).
397397
Due to this ambiguity, qudit Y gate is not well defined. The "mixed" operators

cirq-core/cirq/ops/pauli_string_phasor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ def __init__(
7373
`pauli_string` are acted upon by identity. The order of
7474
these qubits must match the order in `pauli_string`.
7575
exponent_neg: How much to phase vectors in the negative eigenspace,
76-
in the form of the t in (-1)**t = exp(i pi t).
76+
in the form of the t in ``(-1)**t = exp(i*pi*t)``.
7777
exponent_pos: How much to phase vectors in the positive eigenspace,
78-
in the form of the t in (-1)**t = exp(i pi t).
78+
in the form of the t in ``(-1)**t = exp(i*pi*t)``.
7979
8080
Raises:
8181
ValueError: If coefficient is not 1 or -1 or the qubits of

0 commit comments

Comments
 (0)