Skip to content

Commit 615a30b

Browse files
committed
revise tests
1 parent 30b8a97 commit 615a30b

File tree

2 files changed

+7
-27
lines changed

2 files changed

+7
-27
lines changed

src/bloqade/squin/rewrite/stim.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
from bloqade.analysis.address import Address, AddressWire, AddressQubit, AddressTuple
1212
from bloqade.squin.analysis.nsites import Sites, NumberSites
1313

14-
# Probably best to move these attributes to a
15-
# separate file? Keep here for now
16-
# to get things working first
17-
1814

1915
@wire.dialect.register
2016
@dataclass
@@ -448,9 +444,6 @@ def rewrite_MeasureAndReset(
448444
stim.MZ(tuple[SSAvals for ints])
449445
stim.RZ(tuple[SSAvals for ints])
450446
451-
Stim does have MRZ, might be more reflective of what we want/
452-
lines up the semantics better
453-
454447
"""
455448

456449
if isinstance(meas_and_reset_stmt, qubit.MeasureAndReset):

test/squin/stim/stim.py

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def test_wire_1q():
7979
constructed_method.print()
8080

8181

82-
def test_parallel_wire_1q_application():
82+
def test_broadcast_wire_1q_application():
8383

8484
stmts: list[ir.Statement] = [
8585
# Create qubit register
@@ -102,7 +102,7 @@ def test_parallel_wire_1q_application():
102102
# Apply with stim semantics
103103
(h_op := squin.op.stmts.H()),
104104
(
105-
app_res := squin.wire.Apply(
105+
app_res := squin.wire.Broadcast(
106106
h_op.result, w0.result, w1.result, w2.result, w3.result
107107
)
108108
),
@@ -125,7 +125,7 @@ def test_parallel_wire_1q_application():
125125
constructed_method.print()
126126

127127

128-
def test_parallel_qubit_1q_application():
128+
def test_broadcast_qubit_1q_application():
129129

130130
stmts: list[ir.Statement] = [
131131
# Create qubit register
@@ -144,9 +144,9 @@ def test_parallel_qubit_1q_application():
144144
(q_list := ilist.New(values=(q0.result, q1.result, q2.result, q3.result))),
145145
# Apply with stim semantics
146146
(h_op := squin.op.stmts.H()),
147-
(app_res := squin.qubit.Apply(h_op.result, q_list.result)), # noqa: F841
147+
(app_res := squin.qubit.Broadcast(h_op.result, q_list.result)), # noqa: F841
148148
# Measure everything out
149-
(meas_res := squin.qubit.Measure(q_list.result)), # noqa: F841
149+
(meas_res := squin.qubit.MeasureQubitList(q_list.result)), # noqa: F841
150150
(ret_none := func.ConstantNone()),
151151
(func.Return(ret_none)),
152152
]
@@ -161,7 +161,7 @@ def test_parallel_qubit_1q_application():
161161
constructed_method.print()
162162

163163

164-
def test_parallel_control_gate_wire_application():
164+
def test_broadcast_control_gate_wire_application():
165165

166166
stmts: list[ir.Statement] = [
167167
# Create qubit register
@@ -405,7 +405,7 @@ def test_wire_apply_site_verification():
405405
# set up control gate
406406
(op1 := squin.op.stmts.X()),
407407
(cx := squin.op.stmts.Control(op1.result, n_controls=1)),
408-
# improper application, dangling qubit that verification should catch!
408+
# improper application, cx should only support 2 sites
409409
(app := squin.wire.Apply(cx.result, w0.result, w1.result, w2.result)),
410410
# wrap things back
411411
(squin.wire.Wrap(wire=app.results[0], qubit=q0.result)),
@@ -422,16 +422,3 @@ def test_wire_apply_site_verification():
422422

423423
with pytest.raises(ValueError):
424424
squin_to_stim(constructed_method)
425-
426-
427-
test_wire_measure()
428-
429-
# test_wire_measure_and_reset()
430-
# test_qubit_measure_and_reset()
431-
# test_wire_reset()
432-
433-
# test_parallel_qubit_1q_application()
434-
# test_parallel_wire_1q_application()
435-
# test_parallel_control_gate_wire_application()
436-
437-
# test_wire_apply_site_verification()

0 commit comments

Comments
 (0)