Skip to content

Commit 862197a

Browse files
authored
Fix warning about invalid escape sequence (#377)
I noticed a warning about `\p` being an invalid escape sequence when running unit tests locally and found it came from the way the docstrings in the squin ops were being defined. This should get rid of the warning as well as fix the rendering on the docs page, which has some incorrect rendering: <img width="334" height="70" alt="Screenshot 2025-07-15 at 08 04 23" src="https://github.com/user-attachments/assets/c644dbf4-ff58-4bcd-bf33-640c32a6c8c6" /> <img width="185" height="77" alt="Screenshot 2025-07-15 at 08 04 32" src="https://github.com/user-attachments/assets/10d2791b-7dcb-47af-850a-0d6ddf4ce111" />
1 parent d89584d commit 862197a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/bloqade/squin/op/stmts.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class U3(PrimitiveOp):
103103
Note that we use the convention from the QASM2 specification, namely
104104
105105
$$
106-
U_3(\theta, \phi, \lambda) = R_z(\phi) R_y(\theta) R_z(\lambda)
106+
U_3(\\theta, \\phi, \\lambda) = R_z(\\phi) R_y(\\theta) R_z(\\lambda)
107107
$$
108108
"""
109109

@@ -119,7 +119,7 @@ class PhaseOp(PrimitiveOp):
119119
A phase operator.
120120
121121
$$
122-
PhaseOp(\theta) = e^{i \theta} I
122+
\\text{PhaseOp}(\\theta) = e^{i \\theta} I
123123
$$
124124
"""
125125

@@ -133,7 +133,7 @@ class ShiftOp(PrimitiveOp):
133133
A phase shift operator.
134134
135135
$$
136-
Shift(\theta) = \\begin{bmatrix} 1 & 0 \\\\ 0 & e^{i \\theta} \\end{bmatrix}
136+
\\text{Shift}(\\theta) = \\begin{bmatrix} 1 & 0 \\\\ 0 & e^{i \\theta} \\end{bmatrix}
137137
$$
138138
"""
139139

@@ -144,7 +144,7 @@ class ShiftOp(PrimitiveOp):
144144
@statement(dialect=dialect)
145145
class Reset(PrimitiveOp):
146146
"""
147-
Reset operator for qubits or wires.
147+
Reset operator for qubits and wires.
148148
"""
149149

150150
traits = frozenset({ir.Pure(), lowering.FromPythonCall(), FixedSites(1)})

0 commit comments

Comments
 (0)