bloqade-circuit 0.7.12__py3-none-any.whl → 0.7.13__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of bloqade-circuit might be problematic. Click here for more details.

@@ -3,7 +3,6 @@ from kirin.rewrite.abc import RewriteRule, RewriteResult
3
3
 
4
4
  from bloqade.squin import op, noise, qubit
5
5
  from bloqade.squin.rewrite import AddressAttribute
6
- from bloqade.stim.dialects import gate
7
6
  from bloqade.stim.rewrite.util import (
8
7
  SQUIN_STIM_OP_MAPPING,
9
8
  rewrite_Control,
@@ -40,20 +39,24 @@ class SquinQubitToStim(RewriteRule):
40
39
 
41
40
  assert isinstance(applied_op, op.stmts.Operator)
42
41
 
42
+ # Handle controlled gates with a separate procedure
43
43
  if isinstance(applied_op, op.stmts.Control):
44
44
  return rewrite_Control(stmt)
45
45
 
46
- # need to handle Control through separate means
47
-
48
46
  # check if its adjoint, assume its canonicalized so no nested adjoints.
49
47
  is_conj = False
50
48
  if isinstance(applied_op, op.stmts.Adjoint):
51
- if not applied_op.is_unitary:
49
+ # By default the Adjoint has is_unitary = False, so we need to check
50
+ # the inner applied operator to make sure its not just unitary,
51
+ # but something that has an equivalent stim representation with *_DAG format.
52
+ if isinstance(
53
+ applied_op.op.owner, (op.stmts.SqrtX, op.stmts.SqrtY, op.stmts.S)
54
+ ):
55
+ is_conj = True
56
+ applied_op = applied_op.op.owner
57
+ else:
52
58
  return RewriteResult()
53
59
 
54
- is_conj = True
55
- applied_op = applied_op.op.owner
56
-
57
60
  stim_1q_op = SQUIN_STIM_OP_MAPPING.get(type(applied_op))
58
61
  if stim_1q_op is None:
59
62
  return RewriteResult()
@@ -71,13 +74,14 @@ class SquinQubitToStim(RewriteRule):
71
74
  if qubit_idx_ssas is None:
72
75
  return RewriteResult()
73
76
 
74
- if isinstance(stim_1q_op, gate.stmts.Gate):
77
+ # At this point, we know for certain stim_1q_op must be SQRT_X, SQRT_Y, or S
78
+ # and has the option to set the dagger attribute. If is_conj is false,
79
+ # the rewrite would have terminated early so we know anything else has to be
80
+ # a non 1Q gate operation.
81
+ if is_conj:
75
82
  stim_1q_stmt = stim_1q_op(targets=tuple(qubit_idx_ssas), dagger=is_conj)
76
83
  else:
77
84
  stim_1q_stmt = stim_1q_op(targets=tuple(qubit_idx_ssas))
78
85
  stmt.replace_by(stim_1q_stmt)
79
86
 
80
87
  return RewriteResult(has_done_something=True)
81
-
82
-
83
- # put rewrites for measure statements in separate rule, then just have to dispatch
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bloqade-circuit
3
- Version: 0.7.12
3
+ Version: 0.7.13
4
4
  Summary: The software development toolkit for neutral atom arrays.
5
5
  Author-email: Roger-luo <rluo@quera.com>, kaihsin <khwu@quera.com>, weinbe58 <pweinberg@quera.com>, johnzl-777 <jlong@quera.com>
6
6
  License-File: LICENSE
7
7
  Requires-Python: >=3.10
8
- Requires-Dist: kirin-toolchain~=0.17.23
8
+ Requires-Dist: kirin-toolchain~=0.17.26
9
9
  Requires-Dist: numpy>=1.22.0
10
10
  Requires-Dist: pandas>=2.2.3
11
11
  Requires-Dist: pydantic<2.11.0,>=1.3.0
@@ -224,7 +224,7 @@ bloqade/stim/passes/squin_to_stim.py,sha256=mqCspofBJ60YUU5dl7AdxmctmHygk1yeRr4u
224
224
  bloqade/stim/rewrite/__init__.py,sha256=zL5G73JEsXkehN7gCtUgGnmC2BJ3vKihOd1ohVwM68E,480
225
225
  bloqade/stim/rewrite/ifs_to_stim.py,sha256=A3SndoGinZHLul17zXWyQrK_1Hy5I4qvuOskLIeDRMU,6942
226
226
  bloqade/stim/rewrite/py_constant_to_stim.py,sha256=PV8bHvn759-d_0JW4akaGSORW_oxigrlUBhAC51PJAU,1354
227
- bloqade/stim/rewrite/qubit_to_stim.py,sha256=vdTjzVJyzslp6BbXz5219DjF1pUJF9kvNWwUtQ_MP0g,2627
227
+ bloqade/stim/rewrite/qubit_to_stim.py,sha256=Kf_56IU6v7Fv_2x7Ce5Wv2wE8yfC-UDBG90aA_6nRIw,3112
228
228
  bloqade/stim/rewrite/squin_measure.py,sha256=1zuILosGACN7rPYA87MYVwv0M4pPTala1YTe9owbhkw,2519
229
229
  bloqade/stim/rewrite/squin_noise.py,sha256=P-54e3lH9L2irsknRQ7u9UkCmUOQZFDra_yHlLlClDk,6379
230
230
  bloqade/stim/rewrite/util.py,sha256=o96hA-h03vpwsB0jVe_q0hCmTVINaMaZKn1IYWM6DtM,7751
@@ -243,7 +243,7 @@ bloqade/visual/animation/runtime/atoms.py,sha256=EmjxhujLiHHPS_HtH_B-7TiqeHgvW5u
243
243
  bloqade/visual/animation/runtime/ppoly.py,sha256=JB9IP53N1w6adBJEue6J5Nmj818Id9JvrlgrmiQTU1I,1385
244
244
  bloqade/visual/animation/runtime/qpustate.py,sha256=rlmxQeJSvaohXrTpXQL5y-NJcpvfW33xPaYM1slv7cc,4270
245
245
  bloqade/visual/animation/runtime/utils.py,sha256=ju9IzOWX-vKwfpqUjlUKu3Ssr_UFPFFq-tzH_Nqyo_c,1212
246
- bloqade_circuit-0.7.12.dist-info/METADATA,sha256=vd0O1K5RlBH7OgQCkSl2jUnRjgMT6H-L7hPQP-GHMGI,3725
247
- bloqade_circuit-0.7.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
248
- bloqade_circuit-0.7.12.dist-info/licenses/LICENSE,sha256=S5GIJwR6QCixPA9wryYb44ZEek0Nz4rt_zLUqP05UbU,13160
249
- bloqade_circuit-0.7.12.dist-info/RECORD,,
246
+ bloqade_circuit-0.7.13.dist-info/METADATA,sha256=iAJe2OcOsiezdNzRler8zZvQXrxfT3oh-14PAB5Pz-k,3725
247
+ bloqade_circuit-0.7.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
248
+ bloqade_circuit-0.7.13.dist-info/licenses/LICENSE,sha256=S5GIJwR6QCixPA9wryYb44ZEek0Nz4rt_zLUqP05UbU,13160
249
+ bloqade_circuit-0.7.13.dist-info/RECORD,,