Skip to content

Commit ebabcf4

Browse files
committed
catch some mistakes
1 parent 17c1c05 commit ebabcf4

File tree

4 files changed

+4
-24
lines changed

4 files changed

+4
-24
lines changed

src/bloqade/squin/rewrite/U3_to_clifford.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def sqrt_y_dag() -> list[ir.Statement]:
4444
(1, 1, 1): lambda: ([op.stmts.Z()], sqrt_x_dag()),
4545
(1, 1, 2): lambda: (sdag(), sqrt_x_dag()),
4646
(1, 1, 3): lambda: (sqrt_x_dag(),),
47-
(1, 2, 0): lambda: ([op.stmts.Z()], sqrt_x_dag()),
47+
(1, 2, 0): lambda: ([op.stmts.Z()], sqrt_y_dag()),
4848
(1, 2, 1): lambda: (sdag(), sqrt_y_dag()),
4949
(1, 2, 2): lambda: (sqrt_y_dag(),),
5050
(1, 2, 3): lambda: ([op.stmts.S()], sqrt_y_dag()),

test/squin/rewrite/test_U3_to_clifford.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ def test():
194194
SquinToCliffordTestPass(test.dialects)(test)
195195
filtered_stmts = filter_statements_by_type(test, (op.stmts.Operator,))
196196
expected_stmts = [op.stmts.S, op.stmts.Adjoint]
197-
assert filtered_stmts == expected_stmts
197+
# Technically a Y afterwards, just want to check the first two
198+
# stmts are S + Adjoint
199+
assert filtered_stmts[:-1] == expected_stmts
198200

199201

200202
def test_sqrt_y():
Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
11

22
H 0
3-
S 0
4-
SQRT_Y 0
5-
S 0
6-
S_DAG 0
7-
SQRT_Y 0
8-
S 0
9-
S 0
10-
SQRT_Y 0
11-
S_DAG 0
123
MZ(0.00000000) 0

test/stim/passes/test_squin_qubit_to_stim.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,6 @@ def test():
138138
q = qubit.new(n_qubits)
139139
# apply U3 rotation that can be translated to a Clifford gate
140140
squin.qubit.apply(op.u(0.25 * math.tau, 0.0 * math.tau, 0.5 * math.tau), q[0])
141-
# S @ SQRT_Y @ S = Z @ SQRT_X
142-
squin.qubit.apply(
143-
op.u(-0.25 * math.tau, -0.25 * math.tau, -0.25 * math.tau), q[0]
144-
)
145-
# S @ SQRT_Y @ S_DAG = SQRT_X_DAG
146-
squin.qubit.apply(
147-
op.u(-0.25 * math.tau, -0.25 * math.tau, 0.25 * math.tau), q[0]
148-
)
149-
# S_DAG @ SQRT_Y @ S = SQRT_X
150-
squin.qubit.apply(
151-
op.u(-0.25 * math.tau, 0.25 * math.tau, -0.25 * math.tau), q[0]
152-
)
153-
154141
# measure out
155142
squin.qubit.measure(q)
156143
return

0 commit comments

Comments
 (0)