bloqade-circuit 0.3.0__py3-none-any.whl → 0.4.0__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.

Files changed (59) hide show
  1. bloqade/analysis/address/impls.py +3 -16
  2. bloqade/pyqrack/noise/native.py +8 -8
  3. bloqade/pyqrack/squin/op.py +7 -0
  4. bloqade/pyqrack/squin/qubit.py +0 -29
  5. bloqade/pyqrack/squin/runtime.py +18 -0
  6. bloqade/pyqrack/squin/wire.py +0 -36
  7. bloqade/{noise/native → qasm2/dialects/noise}/__init__.py +1 -7
  8. bloqade/qasm2/dialects/noise/_dialect.py +3 -0
  9. bloqade/{noise → qasm2/dialects/noise}/fidelity.py +2 -2
  10. bloqade/qasm2/dialects/noise/model.py +278 -0
  11. bloqade/qasm2/emit/impls/__init__.py +1 -1
  12. bloqade/qasm2/emit/impls/{noise_native.py → noise.py} +11 -11
  13. bloqade/qasm2/emit/main.py +2 -4
  14. bloqade/qasm2/emit/target.py +3 -3
  15. bloqade/qasm2/groups.py +0 -2
  16. bloqade/{noise/native/_wrappers.py → qasm2/noise.py} +9 -5
  17. bloqade/qasm2/passes/glob.py +12 -8
  18. bloqade/qasm2/passes/noise.py +5 -14
  19. bloqade/qasm2/rewrite/__init__.py +2 -0
  20. bloqade/qasm2/rewrite/noise/__init__.py +0 -0
  21. bloqade/qasm2/rewrite/{heuristic_noise.py → noise/heuristic_noise.py} +31 -53
  22. bloqade/{noise/native/rewrite.py → qasm2/rewrite/noise/remove_noise.py} +2 -2
  23. bloqade/qbraid/lowering.py +8 -8
  24. bloqade/squin/__init__.py +7 -1
  25. bloqade/squin/analysis/nsites/impls.py +0 -9
  26. bloqade/squin/groups.py +4 -4
  27. bloqade/squin/lowering.py +27 -0
  28. bloqade/squin/op/__init__.py +1 -0
  29. bloqade/squin/op/_wrapper.py +4 -0
  30. bloqade/squin/op/stmts.py +10 -0
  31. bloqade/squin/qubit.py +32 -37
  32. bloqade/squin/rewrite/desugar.py +65 -0
  33. bloqade/squin/rewrite/qubit_to_stim.py +0 -23
  34. bloqade/squin/rewrite/squin_measure.py +2 -27
  35. bloqade/squin/rewrite/stim_rewrite_util.py +3 -8
  36. bloqade/squin/rewrite/wire_to_stim.py +0 -21
  37. bloqade/squin/wire.py +4 -9
  38. bloqade/stim/__init__.py +2 -1
  39. bloqade/stim/_wrappers.py +4 -0
  40. bloqade/stim/dialects/auxiliary/__init__.py +1 -0
  41. bloqade/stim/dialects/auxiliary/emit.py +17 -2
  42. bloqade/stim/dialects/auxiliary/stmts/__init__.py +1 -0
  43. bloqade/stim/dialects/auxiliary/stmts/annotate.py +8 -0
  44. bloqade/stim/dialects/collapse/emit_str.py +3 -1
  45. bloqade/stim/dialects/gate/emit.py +9 -2
  46. bloqade/stim/dialects/noise/emit.py +32 -1
  47. bloqade/stim/dialects/noise/stmts.py +29 -0
  48. bloqade/stim/parse/__init__.py +1 -0
  49. bloqade/stim/parse/lowering.py +686 -0
  50. {bloqade_circuit-0.3.0.dist-info → bloqade_circuit-0.4.0.dist-info}/METADATA +3 -1
  51. {bloqade_circuit-0.3.0.dist-info → bloqade_circuit-0.4.0.dist-info}/RECORD +54 -52
  52. bloqade/noise/__init__.py +0 -2
  53. bloqade/noise/native/_dialect.py +0 -3
  54. bloqade/noise/native/model.py +0 -346
  55. bloqade/qasm2/dialects/noise.py +0 -48
  56. bloqade/squin/rewrite/measure_desugar.py +0 -33
  57. /bloqade/{noise/native → qasm2/dialects/noise}/stmts.py +0 -0
  58. {bloqade_circuit-0.3.0.dist-info → bloqade_circuit-0.4.0.dist-info}/WHEEL +0 -0
  59. {bloqade_circuit-0.3.0.dist-info → bloqade_circuit-0.4.0.dist-info}/licenses/LICENSE +0 -0
@@ -5,18 +5,10 @@ bloqade/types.py,sha256=qmuryGmkKGGyxLCDI9niXEhwVrcdzy71myxDHnxqBws,447
5
5
  bloqade/analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  bloqade/analysis/address/__init__.py,sha256=ed_05tCQgeCQsvC8O-2LVlpSiiYz2ebixr4xyxD-wRE,321
7
7
  bloqade/analysis/address/analysis.py,sha256=u0acWZApnuH8ueO-_mHnNuyKCWglCcAajinCgz2-dt0,1872
8
- bloqade/analysis/address/impls.py,sha256=Hlt0OtXXBSlxhUAqoRQkdzHyp82E015Sep-sihrp9Xs,7260
8
+ bloqade/analysis/address/impls.py,sha256=c3FMF2LLkV_fwWaolIRTV7ueXC9qwAR6PUW9kDQVd5w,6779
9
9
  bloqade/analysis/address/lattice.py,sha256=dUq999feqPoBYkqEXe1hjHOn4TP_bkvKip8fyWQ-2-8,1755
10
10
  bloqade/analysis/fidelity/__init__.py,sha256=iJkhoHvCMU9bKxQqgxIWKQWvpqNFRgNBI5DK8-4RAB8,59
11
11
  bloqade/analysis/fidelity/analysis.py,sha256=G6JEYc8eeWJ9mwsbUAIzXuU2nrnTU4te41c04xE71gM,3218
12
- bloqade/noise/__init__.py,sha256=sD0VwzGsSo7eP1A7D7kJkiNqD-YwPWM21Aly0X8NYgw,86
13
- bloqade/noise/fidelity.py,sha256=nE-sm_863UINat3HRZStF-UNVhrEz4L8qDWfwxjB2M8,1637
14
- bloqade/noise/native/__init__.py,sha256=XMhfZZCzxjsPWSuQRaDaSb9f8MtmhHXHWtOC0_A6sr0,692
15
- bloqade/noise/native/_dialect.py,sha256=0QbyCJlDjQN6t4v-XVSJmT-3KP0GwA2D2bcCfihBE-0,59
16
- bloqade/noise/native/_wrappers.py,sha256=S8pjgfcTPNx8KLG_AiJKmamuGXNUVPfBl83ykbL99FU,1939
17
- bloqade/noise/native/model.py,sha256=x8j_J4kVYh9dlA1mBD8LopOKVsyuslZYwkIMhlQ3Imw,16541
18
- bloqade/noise/native/rewrite.py,sha256=UhwdIXZx9utmoWcPRtM7uGaNwrfEKPue_PQkY1tP97Y,1063
19
- bloqade/noise/native/stmts.py,sha256=G2zHBIBxpJigh9IMy7_Cj3rJRB1m0Hqf9h3i7h-8X_4,2351
20
12
  bloqade/pyqrack/__init__.py,sha256=_EQJ4blQxqS1_Z6OTjmgSquFo1R_9rEjECRg4fH97hQ,794
21
13
  bloqade/pyqrack/base.py,sha256=9z61PaaAFqCBBwkgsDZSr-qr9IQ5OJ_JUvltmJ7Bgls,4407
22
14
  bloqade/pyqrack/device.py,sha256=cOdyT1k0b73QbOsEIu5KqxHW2OAWP86fi_3XGPhaWGA,7134
@@ -24,29 +16,29 @@ bloqade/pyqrack/reg.py,sha256=uTL07CT1R0xUsInLmwU9YuuNdV6lV0lCs1zhdUz1qIs,1660
24
16
  bloqade/pyqrack/target.py,sha256=c78VtLWAiDNp_0sXwvVzhaEoeFsr1fUVsupxWuo6p3s,3661
25
17
  bloqade/pyqrack/task.py,sha256=ydVso4wZQ1iIzgSBG0lDxClPTLcsZfkbnZk_1qFV95o,991
26
18
  bloqade/pyqrack/noise/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
- bloqade/pyqrack/noise/native.py,sha256=7AbRl20Mv0HbY2cE-g1GBP_2HVPWsg46Y-lBoDfkN2A,2750
19
+ bloqade/pyqrack/noise/native.py,sha256=BmRlRzqCzvSgfSsDlIjuB8L0gx4uaPqmPyfJ5-Ole6M,2751
28
20
  bloqade/pyqrack/qasm2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
21
  bloqade/pyqrack/qasm2/core.py,sha256=bHtHc8VTB0OUPoCRIQuPDug5UMOqZHY0FJZEHd77eBo,3245
30
22
  bloqade/pyqrack/qasm2/glob.py,sha256=EGe7sh9SuvpRW4V4rFcX6Gf7ot8iyThYbsdPeEBKzYM,865
31
23
  bloqade/pyqrack/qasm2/parallel.py,sha256=ITetuXOH2KUDpDOBuFnJoz2DhduvyBC72cOAOOixTaM,1606
32
24
  bloqade/pyqrack/qasm2/uop.py,sha256=bLZONsEK15ymFGIQwy7muQv-TX0mvLrECuMp1Y3XTfA,8612
33
25
  bloqade/pyqrack/squin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
- bloqade/pyqrack/squin/op.py,sha256=TK4PsZUawovk3ro4xnHgIf-myvn0c37RjjgNXG5HI_4,4732
35
- bloqade/pyqrack/squin/qubit.py,sha256=KDRMOGiai-cHSQ475MDjseucW1QY5BSlfVn0zTxA8js,3117
36
- bloqade/pyqrack/squin/runtime.py,sha256=2T80_O7h_Dn2emISgqSDcKgXkqJV9m-_56o1RjD5PjU,14897
37
- bloqade/pyqrack/squin/wire.py,sha256=75zwXNgHqqDLmFeBDsAy09kEgMcMQVPGmEnqCK4KCNA,2627
26
+ bloqade/pyqrack/squin/op.py,sha256=CY2qTYqFPwEceWt-iSiax6i_Bs2i9hQhzGR8ni_PmmA,4952
27
+ bloqade/pyqrack/squin/qubit.py,sha256=svQMbsLxv3yjiFMSRc4C7QGllzjtmlSWOsMY1mjTI8Q,2223
28
+ bloqade/pyqrack/squin/runtime.py,sha256=806S23bJKbh2xBuZ0yPAgjs7ZxDHB-zqQtNeA--x9fw,15349
29
+ bloqade/pyqrack/squin/wire.py,sha256=rqlAeU-r_EHOwJMqHrEAxpZ_rKsvUpwGG7MP4BW75Nw,1658
38
30
  bloqade/qasm2/__init__.py,sha256=W9dR4Qnvigc7e7Ay7puSJHAIuiQk8vWqY-W64SMu5oU,515
39
31
  bloqade/qasm2/_qasm_loading.py,sha256=1EFTt1YDkL8fsoSgSuqD1QcKO4EMFIGuBTX9HCnb6S0,4724
40
32
  bloqade/qasm2/_wrappers.py,sha256=4x3fldC4sV2K_XZ0FPZOorQKAbs_7pualListXtak4A,11148
41
33
  bloqade/qasm2/glob.py,sha256=dDZW2KYXi9e0JmEbpVJIJvQytVEr86G7eism9ghlABM,579
42
- bloqade/qasm2/groups.py,sha256=l6m-zvVw1o8a638SdsSdi1YIwZ7pyIB22IdBp-eBKQY,2584
34
+ bloqade/qasm2/groups.py,sha256=3-BGCVqJm6ZDgQeDapac65OLedoskJMVHX78YBKV7jY,2531
35
+ bloqade/qasm2/noise.py,sha256=YXx-23eFHfGdae9C41dptUvlnu2pK7odT3_eaw3EvBc,2034
43
36
  bloqade/qasm2/parallel.py,sha256=pBRCdhivu9CBADhKP46QMtnomOsFMA79J8OyMvqEu74,1169
44
37
  bloqade/qasm2/types.py,sha256=bL_Hmo3ut9Cc6--ufyGu8pEZb3j9ZN_RnYuTY1UGSVc,837
45
38
  bloqade/qasm2/dialects/__init__.py,sha256=wX99UBwncm0K0Q6yxbAtubXsj2RvAynJYH_5RAt_d54,182
46
39
  bloqade/qasm2/dialects/glob.py,sha256=l1up9Hgw_1Ust4VPDoTh85WaasB4Y7_sAEpJLsva0GE,1615
47
40
  bloqade/qasm2/dialects/indexing.py,sha256=yp5xNbfad_MSJmpQGqC_5cNak9PPeoTLckiL9NsIF9k,2350
48
41
  bloqade/qasm2/dialects/inline.py,sha256=tJPhG0gVy8wxR2K4fBeSNuQtaeS1ORB81gGauogQAf0,2527
49
- bloqade/qasm2/dialects/noise.py,sha256=QmdvSagA-8XPZpP9TX0R4lZ31ngJrmd2g9t5__Svrkk,1338
50
42
  bloqade/qasm2/dialects/parallel.py,sha256=5Fi15i05iLb-S0_74Aj4yWDhUolLIWFb-3iOho8x7cE,3681
51
43
  bloqade/qasm2/dialects/core/__init__.py,sha256=rzYkYvHd-z0CU_Kabac2T9B0TI1-ZxdyS8WVT6JXP7E,301
52
44
  bloqade/qasm2/dialects/core/_dialect.py,sha256=KYguYHVdyIjPjAyM4GApBUk4slMXmRTMPNfE0lEE7rc,57
@@ -60,6 +52,11 @@ bloqade/qasm2/dialects/expr/_emit.py,sha256=GlT1ZuunltKh0wjfevNu5hig74jwxW8JFoI-
60
52
  bloqade/qasm2/dialects/expr/_from_python.py,sha256=4wB9J0gMRZq1HnMzAjn6sk6qVpS2gWTlIrTZKKGOMQ8,3432
61
53
  bloqade/qasm2/dialects/expr/_interp.py,sha256=dQLDcWABpo107BtC6d18L5NmXYlRPPedGtGqlezRWJw,2395
62
54
  bloqade/qasm2/dialects/expr/stmts.py,sha256=bAsT4iT-L5I-NvwdWYxquoSHPy6XsDboo-xCtek8v5g,8582
55
+ bloqade/qasm2/dialects/noise/__init__.py,sha256=4YSXTFjt7TiQd0jqMZy2k6pfKbLyTamQlQ--jPTziLQ,512
56
+ bloqade/qasm2/dialects/noise/_dialect.py,sha256=onK6l3wbM0IHwf3WMiWy7pDRQG0DyLTOzplBuj56psA,58
57
+ bloqade/qasm2/dialects/noise/fidelity.py,sha256=Ft-Benmg1mvWYTPE_DkjMZP5-JfmiotIU_WfAWq8sCw,1632
58
+ bloqade/qasm2/dialects/noise/model.py,sha256=mHfVqig-pzbyXU4HjKSqPxZULvZQcedzY8WIruH1tr8,12867
59
+ bloqade/qasm2/dialects/noise/stmts.py,sha256=G2zHBIBxpJigh9IMy7_Cj3rJRB1m0Hqf9h3i7h-8X_4,2351
63
60
  bloqade/qasm2/dialects/uop/__init__.py,sha256=M2jpSIExxlgKX0l08-KzvRKeVBUuFPlyLmmWosHWIdk,735
64
61
  bloqade/qasm2/dialects/uop/_dialect.py,sha256=mns7toJRMnx38Q5IpScFMUZyA3MwSuEJkV003zudsJA,56
65
62
  bloqade/qasm2/dialects/uop/_emit.py,sha256=Bknauu187WkoHNOMePYQm3WckKBFigmufsv0eWqGahk,7992
@@ -68,10 +65,10 @@ bloqade/qasm2/dialects/uop/stmts.py,sha256=T22mDA9TgPpHnxh9E3lKv5MGihgyAQ6ontDQ1
68
65
  bloqade/qasm2/emit/__init__.py,sha256=Fl9WWMoSyAt3UGAsvCPwnbelhPiPdWDjTpkr8XAJTHc,35
69
66
  bloqade/qasm2/emit/base.py,sha256=Ln7gwnstszmrdAe4SmI5_7hnSgaSRgDwSYZbpI4l3Dg,2342
70
67
  bloqade/qasm2/emit/gate.py,sha256=zVxVQEf_M8pzfbQ1kMEn3e5PiDQAQvEp6CSsFBHRr0w,2684
71
- bloqade/qasm2/emit/main.py,sha256=ASGZIAsSuU_NluocFOlQuWBofzeCdL1dqd1GTiAJQao,4369
72
- bloqade/qasm2/emit/target.py,sha256=ko0ZQ0TjUf1vCWVjzXa0TjjJnDpxe8ufKdxxNmWryE0,6072
73
- bloqade/qasm2/emit/impls/__init__.py,sha256=q5QKcRn_0ifal4Tk9PcpTqdXgGBnJuuSz9_1yl6KV-c,43
74
- bloqade/qasm2/emit/impls/noise_native.py,sha256=xHUTcUqHdjhFyqOOxaIaQQc8ZTgdqyId_Oa1IS2s4HQ,2781
68
+ bloqade/qasm2/emit/main.py,sha256=OGfOWnBEmd3vwoQYpx8iRGyqJchd-cLZXmYPhhd2xl8,4325
69
+ bloqade/qasm2/emit/target.py,sha256=V4GXYixErdXnls7yTQy4xX7ygD259yTFhcV0EGgQKrU,6081
70
+ bloqade/qasm2/emit/impls/__init__.py,sha256=ynptLB_449irP9_9u2h3KXmOqF8YvH_NH08NnVoc7zQ,46
71
+ bloqade/qasm2/emit/impls/noise.py,sha256=-N9PmCbz8MwC6xtd55GOpjDoWMyJPJBMVDWT3G83Ads,2779
75
72
  bloqade/qasm2/parse/__init__.py,sha256=01tlLfrR015nAAPWw3i_Cs9IXsShpXMnJMagcJ_Vuik,986
76
73
  bloqade/qasm2/parse/ast.py,sha256=a48ssf0D_xaE-27PsyeBD5lBvwN2Dojj-RWIBhy7jJE,2904
77
74
  bloqade/qasm2/parse/build.py,sha256=2CibD1ZRX3_aknmhb5XvFQcI2sBOn97DlQHomb9CMEw,10621
@@ -83,84 +80,87 @@ bloqade/qasm2/parse/visitor.py,sha256=W4NUkBw97e3Z4Y1ek6jVNn-5lLVd3A5HXxc-FYTGYb
83
80
  bloqade/qasm2/parse/visitor.pyi,sha256=JafCo1QztL6fvmWtJXu4dlqwbTJ6iLVrSa8L-Zd72t4,1851
84
81
  bloqade/qasm2/passes/__init__.py,sha256=9vz9F9Mgb5OFgnPWqw8pOJ-7r-tShoa7XevJ41ZmPXM,262
85
82
  bloqade/qasm2/passes/fold.py,sha256=NMT9MVpc7eWtqmdCztcztrfVewk5SCz5OTDMjSNPGaE,3046
86
- bloqade/qasm2/passes/glob.py,sha256=IClgFNvcYEdwz87xQUDfA8-kqyI524LKmlrEb5mZ5F8,3429
83
+ bloqade/qasm2/passes/glob.py,sha256=qGmUTJSvDPf6qatapg4U69bTRKOAwZEHcFdts3mRxjI,3563
87
84
  bloqade/qasm2/passes/lift_qubits.py,sha256=VgIuqaZecozA3cwGAq8Nzqdv8IqQlzyQv2XlaqY4H4g,759
88
- bloqade/qasm2/passes/noise.py,sha256=zmXBJkd5_uKxO0P_gummA7OYyQLMfAD6ktYaKxXTR8A,3004
85
+ bloqade/qasm2/passes/noise.py,sha256=w7U91jOAabcCZZXm8uPxojsVRtcIkxtpZS2hwEDsDN0,2709
89
86
  bloqade/qasm2/passes/parallel.py,sha256=nvlCxu8LbIBez5LGXVVuKSa6KTC3DzK1mYUI3-kGSLk,5174
90
87
  bloqade/qasm2/passes/py2qasm.py,sha256=PmdIrViQ_4PEYBKE5XEk4oqFO2sLF2s_2Etz6R9CBoQ,2167
91
88
  bloqade/qasm2/passes/qasm2py.py,sha256=beocXUoO2iM6sX85ML1eK8hp9_s5oupw8tqHWV1cDCo,2138
92
89
  bloqade/qasm2/passes/unroll_if.py,sha256=NBqgOcOJ4bEo9Osb2K-UATZVb77ckSgcWFpKlSkAnxI,771
93
- bloqade/qasm2/rewrite/__init__.py,sha256=-AY7-wimaZZxg7eAiV3xfkUulmB6HplWxVMVJ_1g7xg,551
90
+ bloqade/qasm2/rewrite/__init__.py,sha256=2_3_FdYa5bzZ5YPnbaz9xQE2A8CfgFivufW6D0PukRc,690
94
91
  bloqade/qasm2/rewrite/desugar.py,sha256=ABri2ubImrgYUWtuFj0EEh5FcICqjtKUSS2Ue4WlMdA,1007
95
92
  bloqade/qasm2/rewrite/glob.py,sha256=JzGDIY8ME9ZhNQ0g4d0FTpJuJlPu6G19myzo4zb6f_M,3119
96
- bloqade/qasm2/rewrite/heuristic_noise.py,sha256=ZzB8jE225DFvE6UmXHbuugEk5FVg68p9kN-XcC1y_Og,8663
97
93
  bloqade/qasm2/rewrite/insert_qubits.py,sha256=PpYNlJAl-TVtC1MJxIzOQWDetgW8OPXe6cLN1SMg2w0,1187
98
94
  bloqade/qasm2/rewrite/native_gates.py,sha256=GVutT1jf_gv9qaR5fLqjcmxcqCfMZTiQyg4Fq-TlmFM,18684
99
95
  bloqade/qasm2/rewrite/parallel_to_uop.py,sha256=_banEox20L_qU1GTvKjSSDBkFg49UlSE-POuTCKnrzY,2351
100
96
  bloqade/qasm2/rewrite/register.py,sha256=sghKMBlsls9YLO6baXZ_m692aNpWgMdxZhinNznQDks,1541
101
97
  bloqade/qasm2/rewrite/split_ifs.py,sha256=7MTDFREG0hSSNBzU8Gpc9S-D-vHlBHcE6Zw2Zr7auY0,2053
102
98
  bloqade/qasm2/rewrite/uop_to_parallel.py,sha256=E3nME3UFaJjFQvU-xtK_BKRMfFK2kAJ3U1zwtT4PUJk,13014
99
+ bloqade/qasm2/rewrite/noise/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
100
+ bloqade/qasm2/rewrite/noise/heuristic_noise.py,sha256=7C7yYC66HLZPlTynXwfZ5lKnJkLnDGLT7lVWxREozuc,7851
101
+ bloqade/qasm2/rewrite/noise/remove_noise.py,sha256=rnalZ1igiTpCFJ9Z3PRdzcx-qnkkALv6iQO-_yz39kM,1097
103
102
  bloqade/qbraid/__init__.py,sha256=V-Co_nhH03UCV4c5MGkBnhHcVwJ2Ngrl6KZnSwo91b8,80
104
- bloqade/qbraid/lowering.py,sha256=Ul4nPxzOR7q28VS5vLPoEjlN2NwWGwxhfmcPP2cpw8M,12027
103
+ bloqade/qbraid/lowering.py,sha256=84RsPONWeQ_2beyOWBNoJbGFKuaMhsWtRiPivTCZ-Q0,11985
105
104
  bloqade/qbraid/schema.py,sha256=dTPexUFOiBNBnFv0GEbGh6jpIbMIFHk4hFXmXbeihxA,7854
106
105
  bloqade/qbraid/simulation_result.py,sha256=zdCJcAdbQkEDzFFuC2q3gqOFTOLAXHk4wh8RRDB6cgc,3956
107
106
  bloqade/qbraid/target.py,sha256=LcFHHyLe74yBmrHI9251xHgLN_nUz35lN8RPNwrT6mI,3149
108
- bloqade/squin/__init__.py,sha256=O7ZoaPxQr8VxeeJfseIISc3IzyMXmnN5c3QHB8mT-Oo,122
109
- bloqade/squin/groups.py,sha256=8M5cw8aafYV6i3tnbvdvoeRY2j3dkD6D99rMIY3n2b4,1266
110
- bloqade/squin/qubit.py,sha256=CjQyA1Jxr5f0W49eCVxtbhxfot5gW0clKTtpeVeJZK0,5215
111
- bloqade/squin/wire.py,sha256=AMVw4MUbCvVzeYMqtqMGEeRyxcN4SeqbvpRZSVsd4Zs,3877
107
+ bloqade/squin/__init__.py,sha256=8W5Z26BFrR3XRP6yb6IWDA5tZiXMhNstevx5kP3pP5k,169
108
+ bloqade/squin/groups.py,sha256=kFS9WtDC0NDRb4XUfNP8HZdrS961uk39XAAKlufJykA,1289
109
+ bloqade/squin/lowering.py,sha256=w-GyOKYZHHKCGA2slcgWNS97Q_znQU65PeYxEIkvChM,816
110
+ bloqade/squin/qubit.py,sha256=psIZPtbQHsiToCXcT4wuuaZzEifaPVvk_SWrsgPbNwg,5067
111
+ bloqade/squin/wire.py,sha256=kRmpC7P6qIOZOsuFJHJQyeNsEWcU2Of4ZgcdsMESnKA,3746
112
112
  bloqade/squin/analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
113
113
  bloqade/squin/analysis/schedule.py,sha256=buuC4bFuLuaSDK2BZfkRkh8ZdNicz9HkEv3FAnsDViE,7880
114
114
  bloqade/squin/analysis/nsites/__init__.py,sha256=RlQg7ivczXCXG5lMeL3ipYKj2oJKC4THu8orYf5PBYs,263
115
115
  bloqade/squin/analysis/nsites/analysis.py,sha256=rIe1RU1MZRItcE2aB8DYahLrv73HfD3IHCX3E_EGQ1c,1773
116
- bloqade/squin/analysis/nsites/impls.py,sha256=4GVR4aGRV_yd01UqrBuGgNhlzK0foV4VGkn5CNtckfA,2901
116
+ bloqade/squin/analysis/nsites/impls.py,sha256=OaKuAoZ0EAorStYDZxzgc6Dk42kuj19MLkqHWG1MEQM,2592
117
117
  bloqade/squin/analysis/nsites/lattice.py,sha256=ruh0808SHtj3ecuT-C3AZTsLY2j3DRhtezGiTZvcuVs,942
118
118
  bloqade/squin/noise/__init__.py,sha256=K7wHkzUxWbLF-XQPCAlXY7izz-bS7LJXt2G3GjlkEQc,218
119
119
  bloqade/squin/noise/_dialect.py,sha256=2IR98J-lXm5Y3srP9g-FD4JC-qTq2seureM6mKKq1xg,63
120
120
  bloqade/squin/noise/_wrapper.py,sha256=fHytpR6kINTPnaTfmMa_GRn4geBQkbEGVFRE60V0Zko,474
121
121
  bloqade/squin/noise/stmts.py,sha256=0XvBdZFkjMABUkaj5Fry8oQ8QmWzoZggX1aecvWBnVk,1607
122
- bloqade/squin/op/__init__.py,sha256=g2GPc2qs481TOv9eAJ3rzgTj3DSbUIyrH_E3flbBPB8,721
122
+ bloqade/squin/op/__init__.py,sha256=5OBgT4E44Cy0DNF3yRbXGXkiB8VAJtr48x8hDQEquH4,741
123
123
  bloqade/squin/op/_dialect.py,sha256=66G1IYqmsqUEaCTyUqn2shSHmGYduiTU8GfDXcoMvw4,55
124
- bloqade/squin/op/_wrapper.py,sha256=rz_KWpZ_tQ_I8rlwDApDzeh8IxSQsrxIccSoiRmrvDo,1663
124
+ bloqade/squin/op/_wrapper.py,sha256=5pqbKGeNWoYQIPa1xkKBr8z5waxwmAm3AV4efGSRT_s,1714
125
125
  bloqade/squin/op/number.py,sha256=yujWUqLrOAr8i8OBDsiS5M882wV7t08u345NgNA6TUc,95
126
126
  bloqade/squin/op/rewrite.py,sha256=Itxz_hTAPNLyLYeLS0PCVk143J1Z558UR7N9-urbnoU,1327
127
127
  bloqade/squin/op/stdlib.py,sha256=4UFK3wKImpums2v5a9OFKuVvz2TLYbYwidg3JYYEi2o,1073
128
- bloqade/squin/op/stmts.py,sha256=uWaYByvtY-JwzmdQDGlDXMzF3xEA03yMJqrzW-HJmMA,5521
128
+ bloqade/squin/op/stmts.py,sha256=0QMB3YC_YLr9CfNQiNapSRRT7V5uU8_DVLy-u8Oq9qw,5761
129
129
  bloqade/squin/op/traits.py,sha256=jjsnzWtPtmQK7K3H_D2fvc8XiW1Y3EMBcgeyPax2sjc,1065
130
130
  bloqade/squin/op/types.py,sha256=2am1KC9FHBl__5q_87hTXrSdx1KMkcEUBeZLSrBZQEw,617
131
131
  bloqade/squin/passes/__init__.py,sha256=Bhog-wZBtToNJXfhlYa6S7tE6OoppyRibjMl5JBfY58,45
132
132
  bloqade/squin/passes/stim.py,sha256=VWv3hhfizCWz5sIwwdFt3flWHLzG428evLGIcX8E36Y,1992
133
133
  bloqade/squin/rewrite/__init__.py,sha256=0-9m1cbvFRgjZpQ700NEjW1uKvwZPPbrmUwylhgOjUw,457
134
- bloqade/squin/rewrite/measure_desugar.py,sha256=ltv4e_ceS-32vcjW0Jfk9za9vFJQHTggGhwSd3-eZM4,1005
135
- bloqade/squin/rewrite/qubit_to_stim.py,sha256=dCOrhxVL5vuUNE5zNZWlV91cdygV5tJtpKCh2s1zuTc,2822
136
- bloqade/squin/rewrite/squin_measure.py,sha256=WNmWZqk4cYoyCbXCDbKxudSqO04wrJ-jFbCJcWtOrtY,3417
137
- bloqade/squin/rewrite/stim_rewrite_util.py,sha256=vMSphcX3xhpmJwDG-lc_YLZ5m1W1G4jDvJh3xbQkaps,5213
134
+ bloqade/squin/rewrite/desugar.py,sha256=fnxchVHIbLx96cv-g_jK7NCVV8t8mo52rs00JaPG7FM,1846
135
+ bloqade/squin/rewrite/qubit_to_stim.py,sha256=fZC9voSAgjNwZv4wYdJ1Qkd55049n8rc7gpujvdQHEc,1976
136
+ bloqade/squin/rewrite/squin_measure.py,sha256=E5HVkLaBcsT-4dy1MN3BjdkOmqXzeTO4clZcwKRd66k,2494
137
+ bloqade/squin/rewrite/stim_rewrite_util.py,sha256=y6CsosZXgAXc0enWPcRUt1uwxm09LBoR6mvl2Y5bHbs,5161
138
138
  bloqade/squin/rewrite/wire_identity_elimination.py,sha256=Cscu8yaSslPuW04HvbXx4HJ3JzdUZNUMyFqcvuc4sxY,795
139
- bloqade/squin/rewrite/wire_to_stim.py,sha256=zeNpT_uZUZmG13BgdEGP3xSp2QZhVtdE1tFefI3XaFY,2533
139
+ bloqade/squin/rewrite/wire_to_stim.py,sha256=PbXjwaF-Z2JioXALKx76uGkYr6-xy20zZFotPeDX-lY,1699
140
140
  bloqade/squin/rewrite/wrap_analysis.py,sha256=OoKoS0zFLjfCnn4_fK4bgpQ_ueAEiHl1UmfNWhruxMc,2069
141
- bloqade/stim/__init__.py,sha256=43XmauGTQrLU6KmdSzpfOLF0pV9_NlupDENlOGLBQVg,837
142
- bloqade/stim/_wrappers.py,sha256=7X8cGedCxhAWdxqrlLKSBdm4SOQytJsg3VfMAEKfAog,3821
141
+ bloqade/stim/__init__.py,sha256=BbMeLjeIW29xuD6JB0cWG_g0qaYIy4xXbloDqvqbT7A,887
142
+ bloqade/stim/_wrappers.py,sha256=KBIIOaeYPnhR3SJSNHcEzihLMcph2tL2mRKhEH47Je8,3939
143
143
  bloqade/stim/groups.py,sha256=Fx8G698BGO7hR8OwpPXGUEYdW4uCCPwbMp_3fJAqa8M,585
144
144
  bloqade/stim/dialects/__init__.py,sha256=A1Sq0jg8wi6MjRkzmuSBnHmO3EraD0pDFWz-dO6c6v8,89
145
- bloqade/stim/dialects/auxiliary/__init__.py,sha256=Gs38V6rtkasVo422GnmcEDajaAKR6uCFoB4HcpuIKHM,650
145
+ bloqade/stim/dialects/auxiliary/__init__.py,sha256=6f57a8k2-QBtqaB0GN8FxxTBlG82oZQbVIOxxq975g4,692
146
146
  bloqade/stim/dialects/auxiliary/_dialect.py,sha256=GExjMgzF9HV7IA25Kbl1K2i5g7aJAhdifIdrIDrvBVY,55
147
- bloqade/stim/dialects/auxiliary/emit.py,sha256=WzIAT9ccwXV9YpGCPZECAKVoEmW2RV1ZIpANPHFKvGc,2814
147
+ bloqade/stim/dialects/auxiliary/emit.py,sha256=Flj5Q5jw8KkuHHrgU_LkiDSVi93DTznAtmum7A3uB6Y,3305
148
148
  bloqade/stim/dialects/auxiliary/interp.py,sha256=4CqEAxcr3ApDBbmmJ4yANSoiNR_nie2wHarCqOR-2bY,957
149
149
  bloqade/stim/dialects/auxiliary/lowering.py,sha256=4dxRZHGp_18EMVlYuZQFSzg4MIOBriF5HjexT9Px2xc,1443
150
150
  bloqade/stim/dialects/auxiliary/types.py,sha256=1l2YdJ-u9y0wpBfxh4OAlvmRAUnrmcDjDagoW2GyVaQ,314
151
- bloqade/stim/dialects/auxiliary/stmts/__init__.py,sha256=S5bCbEZ-rsQPTPLVEho3F7YkrV446KJVIPrzxknHI-s,329
152
- bloqade/stim/dialects/auxiliary/stmts/annotate.py,sha256=D1gN9eSKsrITGWZTrGsDbIwyFtmotTf4b9RcrA8YA7w,1499
151
+ bloqade/stim/dialects/auxiliary/stmts/__init__.py,sha256=VxLBnqlZngabs5vn3PiRNRXBBDueTCTmJ2wgWEertrA,371
152
+ bloqade/stim/dialects/auxiliary/stmts/annotate.py,sha256=NZT4AAW0lmwyHR31cmZI8aQNRsp5soeE36s9nBrcOmU,1759
153
153
  bloqade/stim/dialects/auxiliary/stmts/const.py,sha256=nfx2aFTPBTCfKriANbzDUWjP9wgnWC5Phkfl2aUPyXY,3296
154
154
  bloqade/stim/dialects/collapse/__init__.py,sha256=MhlEWJR_mJI3teoip1N8MlHk2C68seJELXwmyjyx_ns,305
155
155
  bloqade/stim/dialects/collapse/_dialect.py,sha256=F5uplH7WL9ZQatEp0ZMvgLWX1k9moAWW879LTNwnHH0,60
156
- bloqade/stim/dialects/collapse/emit_str.py,sha256=DsV-UsHRIjgyyp-otFMmx_uW0hfCt-B31AX77OmejH4,1825
156
+ bloqade/stim/dialects/collapse/emit_str.py,sha256=4Vlhtq8BKMMuZLQ-ayUGJTuOs4YJ1rGurPZBZxBQJcU,1879
157
157
  bloqade/stim/dialects/collapse/stmts/__init__.py,sha256=6wf-1HIdajz_hiYXh5j0QftsAtyaBtpp826d0UdYysI,189
158
158
  bloqade/stim/dialects/collapse/stmts/measure.py,sha256=hr7jGgA4AoaCy62tmVWqKUnbXol2X1jAxm_jkEjKdXs,918
159
159
  bloqade/stim/dialects/collapse/stmts/pp_measure.py,sha256=AneDEeWb0mXJRYN5LuKDqwxstkGTIW_-vhadQRIaZ4c,524
160
160
  bloqade/stim/dialects/collapse/stmts/reset.py,sha256=4fPSdM_ZiivuUn4uiZGiZQ9swolDir7Dl9lhMkZbspo,473
161
161
  bloqade/stim/dialects/gate/__init__.py,sha256=5Y0BTlLOuW-Ud4LwAC_CUuMwxa04LKj4CTKgQbiL8yg,347
162
162
  bloqade/stim/dialects/gate/_dialect.py,sha256=78_dThliFZG9xSwYhTdibxP3vefHpEDUawtZqb9X3uA,56
163
- bloqade/stim/dialects/gate/emit.py,sha256=AQbd5PJuRLymlJLvll23bqZr82O55pKfEjdfsYr3L0A,2657
163
+ bloqade/stim/dialects/gate/emit.py,sha256=HGnko9_nV6jl0kOI_dBWWNQDjySo14jAFBsg-2lTVOU,2869
164
164
  bloqade/stim/dialects/gate/stmts/__init__.py,sha256=QJgmpArJwM9TXgB95AsEvet630gITtYOwRptnhj9a8U,293
165
165
  bloqade/stim/dialects/gate/stmts/base.py,sha256=MK7Zu-Kys_64O0nXAkPzlHEnWYevBGm3FRHhJw33rrE,748
166
166
  bloqade/stim/dialects/gate/stmts/clifford_1q.py,sha256=Sj1Nf9AA_WWazGTg5kzFRTaLRIj3Edj657j0B8dybdI,896
@@ -169,10 +169,12 @@ bloqade/stim/dialects/gate/stmts/control_2q.py,sha256=gZRtkpgAkiUFqx5Led2t1YjYbl
169
169
  bloqade/stim/dialects/gate/stmts/pp.py,sha256=yUNCrkYBM7wUCvtRqwP9_HYX0HsHVt6JZR4efM05838,487
170
170
  bloqade/stim/dialects/noise/__init__.py,sha256=WoDdIZnxelk8REiIWDKcrEW79xwISdTZlqlTjURb71Q,138
171
171
  bloqade/stim/dialects/noise/_dialect.py,sha256=SVUjAqBoGnxo13JlAlsxulIMo1QzfJb4SMSrFaCnfP4,57
172
- bloqade/stim/dialects/noise/emit.py,sha256=U8OQC49On_Bh8ESLfvo4zT_JaBuN_KsCUtC9zkCbQco,1976
173
- bloqade/stim/dialects/noise/stmts.py,sha256=VbsLQN709NJd6JaUJ7rsDsfcdruBKIEvseB-9e8bOWA,2704
172
+ bloqade/stim/dialects/noise/emit.py,sha256=V44Xs6Z-64ZLB-6hhjRYjqlQeqpXPsiZS6eHkargipM,2909
173
+ bloqade/stim/dialects/noise/stmts.py,sha256=0CV9aHUPo8ASdQmcpf8Lv0fGnEMl2xSr4f64DjiYPKQ,3582
174
174
  bloqade/stim/emit/__init__.py,sha256=N2dPQY7OyqPwHAStDeOgYg2yfxqxMOz-N7pD5Z4JwlI,73
175
175
  bloqade/stim/emit/stim_str.py,sha256=JyEBoIhLQASogZcUWHI9tMD4JoXYrEqUr2qaZ30gZdc,1491
176
+ bloqade/stim/parse/__init__.py,sha256=l2DjReB2KkgrDjP_4nP6RnoziiOewoSeZfTno1sVYTw,59
177
+ bloqade/stim/parse/lowering.py,sha256=L-IcR_exlxsTVv4SQ0bhzIF4_L82P-GEdK6qRd6B86Y,23723
176
178
  bloqade/visual/__init__.py,sha256=Y7d0YgovKhUFzjMeDvt0wGRUZ3re3SY6iO3e8xHXrr4,37
177
179
  bloqade/visual/animation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
178
180
  bloqade/visual/animation/animate.py,sha256=NSKs3YDWgTZH2-Tpx3cP1bBcIEWTEPqK5UFkY_IF_3k,8927
@@ -184,7 +186,7 @@ bloqade/visual/animation/runtime/atoms.py,sha256=EmjxhujLiHHPS_HtH_B-7TiqeHgvW5u
184
186
  bloqade/visual/animation/runtime/ppoly.py,sha256=JB9IP53N1w6adBJEue6J5Nmj818Id9JvrlgrmiQTU1I,1385
185
187
  bloqade/visual/animation/runtime/qpustate.py,sha256=rlmxQeJSvaohXrTpXQL5y-NJcpvfW33xPaYM1slv7cc,4270
186
188
  bloqade/visual/animation/runtime/utils.py,sha256=ju9IzOWX-vKwfpqUjlUKu3Ssr_UFPFFq-tzH_Nqyo_c,1212
187
- bloqade_circuit-0.3.0.dist-info/METADATA,sha256=v5tKgk6E3NALygSJVObM-CZ1vQCr_5cxTCIZDhMcPmk,3617
188
- bloqade_circuit-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
189
- bloqade_circuit-0.3.0.dist-info/licenses/LICENSE,sha256=S5GIJwR6QCixPA9wryYb44ZEek0Nz4rt_zLUqP05UbU,13160
190
- bloqade_circuit-0.3.0.dist-info/RECORD,,
189
+ bloqade_circuit-0.4.0.dist-info/METADATA,sha256=3CjbxNGvQkBKgscX6HpdRqxkGyiAmDLgkgsAYovRvZc,3683
190
+ bloqade_circuit-0.4.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
191
+ bloqade_circuit-0.4.0.dist-info/licenses/LICENSE,sha256=S5GIJwR6QCixPA9wryYb44ZEek0Nz4rt_zLUqP05UbU,13160
192
+ bloqade_circuit-0.4.0.dist-info/RECORD,,
bloqade/noise/__init__.py DELETED
@@ -1,2 +0,0 @@
1
- # NOTE: just to register methods
2
- from . import native as native, fidelity as fidelity
@@ -1,3 +0,0 @@
1
- from kirin import ir
2
-
3
- dialect = ir.Dialect("noise.native")
@@ -1,346 +0,0 @@
1
- import abc
2
- import math
3
- from typing import Dict, List, Tuple
4
- from dataclasses import field, dataclass
5
- from collections.abc import Sequence
6
-
7
-
8
- @dataclass(frozen=True)
9
- class GateNoiseParams:
10
- """Parameters for gate noise."""
11
-
12
- local_px: float = field(default=1e-3, kw_only=True)
13
- """The error probability for a Pauli-X error during a local single qubit gate operation."""
14
- local_py: float = field(default=1e-3, kw_only=True)
15
- """The error probability for a Pauli-Y error during a local single qubit gate operation."""
16
- local_pz: float = field(default=1e-3, kw_only=True)
17
- """The error probability for a Pauli-Z error during a local single qubit gate operation."""
18
- local_loss_prob: float = field(default=1e-4, kw_only=True)
19
- """The error probability for a loss during a local single qubit gate operation."""
20
-
21
- global_px: float = field(default=1e-3, kw_only=True)
22
- """The error probability for a Pauli-X error during a global single qubit gate operation."""
23
- global_py: float = field(default=1e-3, kw_only=True)
24
- """The error probability for a Pauli-Y error during a global single qubit gate operation."""
25
- global_pz: float = field(default=1e-3, kw_only=True)
26
- """The error probability for a Pauli-Z error during a global single qubit gate operation."""
27
- global_loss_prob: float = field(default=1e-3, kw_only=True)
28
- """The error probability for a loss during a global single qubit gate operation."""
29
-
30
- cz_paired_gate_px: float = field(default=1e-3, kw_only=True)
31
- """The error probability for a Pauli-X error during CZ gate operation when two qubits are within blockade radius."""
32
- cz_paired_gate_py: float = field(default=1e-3, kw_only=True)
33
- """The error probability for a Pauli-Y error during CZ gate operation when two qubits are within blockade radius."""
34
- cz_paired_gate_pz: float = field(default=1e-3, kw_only=True)
35
- """The error probability for a Pauli-Z error during CZ gate operation when two qubits are within blockade radius."""
36
- cz_gate_loss_prob: float = field(default=1e-3, kw_only=True)
37
- """The error probability for a loss during CZ gate operation when two qubits are within blockade radius."""
38
-
39
- cz_unpaired_gate_px: float = field(default=1e-3, kw_only=True)
40
- """The error probability for Pauli-X error during CZ gate operation when another qubit is not within blockade radius."""
41
- cz_unpaired_gate_py: float = field(default=1e-3, kw_only=True)
42
- """The error probability for Pauli-Y error during CZ gate operation when another qubit is not within blockade radius."""
43
- cz_unpaired_gate_pz: float = field(default=1e-3, kw_only=True)
44
- """The error probability for Pauli-Z error during CZ gate operation when another qubit is not within blockade radius."""
45
- cz_unpaired_loss_prob: float = field(default=1e-3, kw_only=True)
46
- """The error probability for a loss during CZ gate operation when another qubit is not within blockade radius."""
47
-
48
-
49
- @dataclass(frozen=True)
50
- class MoveNoiseParams:
51
- idle_px_rate: float = field(default=1e-6, kw_only=True)
52
- """The error rate (prob/microsecond) for a Pauli-X error during an idle operation."""
53
- idle_py_rate: float = field(default=1e-6, kw_only=True)
54
- """The error rate (prob/microsecond) for a Pauli-Y error during an idle operation."""
55
- idle_pz_rate: float = field(default=1e-6, kw_only=True)
56
- """The error rate (prob/microsecond) for a Pauli-Z error during an idle operation."""
57
- idle_loss_rate: float = field(default=1e-6, kw_only=True)
58
- """The error rate (prob/microsecond) for a loss during an idle operation."""
59
-
60
- move_px_rate: float = field(default=1e-6, kw_only=True)
61
- """The error rate (prob/microsecond) for a Pauli-X error during a move operation."""
62
- move_py_rate: float = field(default=1e-6, kw_only=True)
63
- """The error rate e (prob/microsecond) for a Pauli-Y error during a move operation."""
64
- move_pz_rate: float = field(default=1e-6, kw_only=True)
65
- """The error rate e (prob/microsecond) for a Pauli-Z error during a move operation."""
66
- move_loss_rate: float = field(default=1e-6, kw_only=True)
67
- """The error rate e (prob/microsecond) for a loss during a move operation."""
68
-
69
- pick_px: float = field(default=1e-3, kw_only=True)
70
- """The error rate (prob per pick operation) for a Pauli-X error during a pick operation."""
71
- pick_py: float = field(default=1e-3, kw_only=True)
72
- """The error rate (prob per pick operation) for a Pauli-Y error during a pick operation."""
73
- pick_pz: float = field(default=1e-3, kw_only=True)
74
- """The error rate (prob per pick operation) for a Pauli-Z error during a pick operation."""
75
- pick_loss_prob: float = field(default=1e-4, kw_only=True)
76
- """The error rate for a loss during a pick operation."""
77
-
78
- move_speed: float = field(default=5e-1, kw_only=True)
79
- """Maximum speed of the qubits during a move operation."""
80
- storage_spacing: float = field(default=4.0, kw_only=True)
81
- """Spacing between the qubits in the storage zone."""
82
-
83
-
84
- @dataclass
85
- class MoveNoiseModelABC(abc.ABC):
86
- """Abstract base class for noise based on atom movement.
87
-
88
- This class defines the interface for a noise model. The gate noise is calculated form the parameters
89
- provided in this dataclass which can be updated when inheriting from this class. The move error is
90
- calculated by implementing the parallel_cz_errors method which takes a set of ctrl and qarg qubits
91
- and returns a noise model for all the qubits. The noise model is a dictionary with the keys being the
92
- error rates for the qubits and the values being the list of qubits that the error rate applies to.
93
-
94
- Once implemented the class can be used with the NoisePass to analyze a circuit and apply the noise
95
- model to the circuit.
96
-
97
- NOTE: This model is not guaranteed to be supported long-term in bloqade. We will be
98
- moving towards a more general approach to noise modeling in the future.
99
-
100
- """
101
-
102
- params: MoveNoiseParams = field(default_factory=MoveNoiseParams)
103
- """Parameters for calculating move noise."""
104
-
105
- @abc.abstractmethod
106
- def parallel_cz_errors(
107
- self, ctrls: List[int], qargs: List[int], rest: List[int]
108
- ) -> Dict[Tuple[float, float, float, float], List[int]]:
109
- """Takes a set of ctrls and qargs and returns a noise model for all qubits."""
110
- pass
111
-
112
- @staticmethod
113
- def poisson_pauli_prob(rate: float, duration: float) -> float:
114
- """Calculate the number of noise events and their probabilities for a given rate and duration."""
115
- assert duration >= 0, "Duration must be non-negative"
116
- assert rate >= 0, "Rate must be non-negative"
117
- return 0.5 * (1 - math.exp(-2 * rate * duration))
118
-
119
- @classmethod
120
- def join_binary_probs(cls, p1: float, *args: float) -> float:
121
- """Merge the probabilities of an event happening if the event can only happen once.
122
-
123
- For example, finding the effective probability of losing an atom from multiple sources, since
124
- a qubit can only happen once. This is done by using the formula:
125
-
126
- p = p1 * (1 - p2) + p2 * (1 - p1)
127
-
128
- applied recursively to all the probabilities in the list.
129
-
130
- Args:
131
- p1 (float): The probability of the event happening.
132
- arg (float): The probabilities of the event happening from other sources.
133
-
134
- Returns:
135
- float: The effective probability of the event happening.
136
-
137
- """
138
- if len(args) == 0:
139
- return p1
140
- else:
141
- p2 = cls.join_binary_probs(*args)
142
- return p1 * (1 - p2) + p2 * (1 - p1)
143
-
144
-
145
- @dataclass
146
- class TwoRowZoneModel(MoveNoiseModelABC):
147
- """This model assumes that the qubits are arranged in a single storage row with a row corresponding to a gate zone below it.
148
-
149
- The CZ gate noise is calculated using the following heuristic: The idle error is calculated by the total duration require
150
- to do the move and entable the qubits. Not every pair can be entangled at the same time, so we first deconflict the qargs
151
- assuming by finding subsets in which both the ctrl and the qarg qubits are in ascending order. This breaks the pairs into
152
- groups that can be moved and entangled separately. We then take each group and assign each pair to a gate zone slot. The
153
- slots are allocated by starting from the middle of the atoms and moving outwards making sure to keep the ctrl qubits in
154
- ascending order. The time to move a group is calculated by finding the maximum travel distance of the qarg and ctrl qubits
155
- and dviding by the move speed. The total move time is the sum of all the group move times. The error rate for all the qubits
156
- is then calculated by using the poisson_pauli_prob function. An additional error for the pick operation is calculated by
157
- joining the binary probabilities of the pick operation and the move operation.
158
-
159
- """
160
-
161
- gate_zone_y_offset: float = 20.0
162
- gate_spacing: float = 20.0
163
-
164
- def deconflict(
165
- self, ctrls: List[int], qargs: List[int]
166
- ) -> List[Tuple[Tuple[int, ...], Tuple[int, ...]]]:
167
- """Return a list of groups of ctrl and qarg qubits that can be moved and entangled separately."""
168
- # sort by ctrl qubit first to guarantee that they will be in ascending order
169
- sorted_pairs = sorted(zip(ctrls, qargs))
170
-
171
- groups = []
172
- # group by qarg only putting it in a group if the qarg is greater than the last qarg in the group
173
- # thus ensuring that the qargs are in ascending order
174
- while len(sorted_pairs) > 0:
175
- ctrl, qarg = sorted_pairs.pop(0)
176
-
177
- found = False
178
- for group in groups:
179
- if group[-1][1] < qarg:
180
- group.append((ctrl, qarg))
181
- found = True
182
- break
183
- if not found:
184
- groups.append([(ctrl, qarg)])
185
-
186
- return [tuple(zip(*group)) for group in groups]
187
-
188
- def assign_gate_slots(
189
- self, ctrls: Sequence[int], qargs: Sequence[int]
190
- ) -> Dict[int, Tuple[int, int]]:
191
- """Allocate slots for the qubits to move to. start from middle of atoms and move outwards
192
- making sure to keep the ctrl qubits in ascending order.
193
-
194
- Note that we can do this because the move strategy is to move the ctrl qubits separately
195
- from the qarg qubits, thus we don't have to worry about qarg qubits crossing the ctrl qubits
196
- and vice versa. We pick the median of all the atoms because it distributes the qubits
197
- as evenly as possible over the gate zone.
198
-
199
- """
200
- assert len(ctrls) == len(qargs), "Number of ctrls and qargs must be equal"
201
- addr_pairs = sorted(zip(ctrls, qargs), key=lambda x: x[0])
202
- # sort by the distance between the ctrl and qarg qubits
203
-
204
- ctrls, qargs = list(zip(*addr_pairs))
205
-
206
- n_ctrls = len(ctrls)
207
-
208
- ctrl_median = (
209
- ctrls[n_ctrls // 2]
210
- if n_ctrls % 2 == 1
211
- else (ctrls[n_ctrls // 2 - 1] + ctrls[n_ctrls // 2]) / 2
212
- )
213
-
214
- all_addr = sorted(ctrls + qargs)
215
- spatial_median = self.params.storage_spacing * (all_addr[0] + all_addr[-1]) / 2
216
-
217
- addr_pairs.sort(key=lambda x: abs(x[0] - ctrl_median))
218
-
219
- slots = {}
220
- med_slot = round(spatial_median / self.gate_spacing)
221
-
222
- left_slot = med_slot
223
- right_slot = med_slot
224
- slots[med_slot] = addr_pairs.pop(0)
225
- while addr_pairs:
226
- ctrl, qarg = addr_pairs.pop(0)
227
-
228
- if ctrl < ctrl_median:
229
- slots[left_slot := left_slot - 1] = (ctrl, qarg)
230
- else:
231
- slots[right_slot := right_slot + 1] = (ctrl, qarg)
232
-
233
- return slots
234
-
235
- def calculate_move_duration(self, slots: Dict[int, Tuple[int, int]]) -> float:
236
- """Calculate the time it takes to move the qubits from the ctrl to the qarg qubits."""
237
-
238
- qarg_x_distance = float("-inf")
239
- ctrl_x_distance = float("-inf")
240
-
241
- for slot, (ctrl, qarg) in slots.items():
242
- qarg_x_distance = max(
243
- qarg_x_distance,
244
- abs(qarg * self.params.storage_spacing - slot * self.gate_spacing),
245
- )
246
- ctrl_x_distance = max(
247
- ctrl_x_distance,
248
- abs(ctrl * self.params.storage_spacing - slot * self.gate_spacing),
249
- )
250
-
251
- qarg_max_distance = math.sqrt(qarg_x_distance**2 + self.gate_zone_y_offset**2)
252
- ctrl_max_distance = math.sqrt(
253
- ctrl_x_distance**2 + (self.gate_zone_y_offset - 3) ** 2
254
- )
255
-
256
- return (qarg_max_distance + ctrl_max_distance) / self.params.move_speed
257
-
258
- def parallel_cz_errors(
259
- self, ctrls: List[int], qargs: List[int], rest: List[int]
260
- ) -> Dict[Tuple[float, float, float, float], List[int]]:
261
- """Apply parallel gates by moving ctrl qubits to qarg qubits."""
262
- groups = self.deconflict(ctrls, qargs)
263
- slots = [self.assign_gate_slots(*group) for group in groups]
264
-
265
- move_duration = sum(map(self.calculate_move_duration, slots))
266
-
267
- px_time = self.poisson_pauli_prob(self.params.move_px_rate, move_duration)
268
- py_time = self.poisson_pauli_prob(self.params.move_py_rate, move_duration)
269
- px_time = self.poisson_pauli_prob(self.params.move_pz_rate, move_duration)
270
- move_p_loss_time = self.poisson_pauli_prob(
271
- self.params.move_loss_rate, move_duration
272
- )
273
-
274
- errors = {(px_time, py_time, px_time, move_p_loss_time): rest}
275
-
276
- px_moved = self.join_binary_probs(self.params.pick_px, px_time)
277
- py_moved = self.join_binary_probs(self.params.pick_py, py_time)
278
- pz_moved = self.join_binary_probs(self.params.pick_pz, px_time)
279
- p_loss_moved = self.join_binary_probs(
280
- self.params.pick_loss_prob, move_p_loss_time
281
- )
282
-
283
- errors[(px_moved, py_moved, pz_moved, p_loss_moved)] = sorted(ctrls + qargs)
284
-
285
- return errors
286
-
287
-
288
- @dataclass
289
- class SingleZoneLayoutABC(MoveNoiseModelABC):
290
- gate_noise_params: GateNoiseParams = field(
291
- default_factory=GateNoiseParams, kw_only=True
292
- )
293
-
294
- @abc.abstractmethod
295
- def calculate_move_duration(self, ctrls: List[int], qargs: List[int]) -> float:
296
- """Calculate the time it takes to reconfigure the atom for executing the CZ gates."""
297
-
298
- def parallel_cz_errors(
299
- self, ctrls: List[int], qargs: List[int], rest: List[int]
300
- ) -> Dict[Tuple[float, float, float, float], List[int]]:
301
- """Apply parallel gates by moving ctrl qubits to qarg qubits."""
302
-
303
- move_duration = self.calculate_move_duration(ctrls, qargs)
304
-
305
- # idle errors during atom moves
306
- idle_px_time = self.poisson_pauli_prob(self.params.idle_px_rate, move_duration)
307
- idle_py_time = self.poisson_pauli_prob(self.params.idle_py_rate, move_duration)
308
- idle_pz_time = self.poisson_pauli_prob(self.params.idle_pz_rate, move_duration)
309
- idle_p_loss_time = self.poisson_pauli_prob(
310
- self.params.idle_loss_rate, move_duration
311
- )
312
-
313
- # even qubits not involved in the gate can still experience unpaired errors
314
- idle_px = self.join_binary_probs(
315
- self.gate_noise_params.cz_unpaired_gate_px, idle_px_time
316
- )
317
- idle_py = self.join_binary_probs(
318
- self.gate_noise_params.cz_unpaired_gate_py, idle_py_time
319
- )
320
- idle_pz = self.join_binary_probs(
321
- self.gate_noise_params.cz_unpaired_gate_pz, idle_pz_time
322
- )
323
- idle_p_loss = self.join_binary_probs(
324
- self.gate_noise_params.cz_unpaired_loss_prob, idle_p_loss_time
325
- )
326
-
327
- errors = {(idle_px, idle_py, idle_pz, idle_p_loss): rest}
328
-
329
- # error during the move
330
- move_px_time = self.poisson_pauli_prob(self.params.move_px_rate, move_duration)
331
- move_py_time = self.poisson_pauli_prob(self.params.move_py_rate, move_duration)
332
- move_pz_time = self.poisson_pauli_prob(self.params.move_pz_rate, move_duration)
333
- move_p_loss_time = self.poisson_pauli_prob(
334
- self.params.move_loss_rate, move_duration
335
- )
336
- # error coming from picking up the qubits
337
- px_moved = self.join_binary_probs(self.params.pick_px, move_px_time)
338
- py_moved = self.join_binary_probs(self.params.pick_py, move_py_time)
339
- pz_moved = self.join_binary_probs(self.params.pick_pz, move_pz_time)
340
- p_loss_moved = self.join_binary_probs(
341
- self.params.pick_loss_prob, move_p_loss_time
342
- )
343
-
344
- errors[(px_moved, py_moved, pz_moved, p_loss_moved)] = sorted(ctrls + qargs)
345
-
346
- return errors
@@ -1,48 +0,0 @@
1
- from kirin import ir, types, interp, lowering
2
- from kirin.decl import info, statement
3
-
4
- from bloqade.qasm2.parse import ast
5
- from bloqade.qasm2.types import QubitType
6
- from bloqade.qasm2.emit.gate import EmitQASM2Gate, EmitQASM2Frame
7
-
8
- dialect = ir.Dialect("qasm2.noise")
9
-
10
-
11
- @statement(dialect=dialect)
12
- class Pauli1(ir.Statement):
13
- name = "pauli_1"
14
- traits = frozenset({lowering.FromPythonCall()})
15
- px: ir.SSAValue = info.argument(types.Float)
16
- py: ir.SSAValue = info.argument(types.Float)
17
- pz: ir.SSAValue = info.argument(types.Float)
18
- qarg: ir.SSAValue = info.argument(QubitType)
19
-
20
-
21
- @dialect.register(key="emit.qasm2.gate")
22
- class NoiseEmit(interp.MethodTable):
23
-
24
- @interp.impl(Pauli1)
25
- def emit_pauli(
26
- self,
27
- emit: EmitQASM2Gate,
28
- frame: EmitQASM2Frame,
29
- stmt: Pauli1,
30
- ):
31
-
32
- px: ast.Number = frame.get(stmt.px)
33
- py: ast.Number = frame.get(stmt.py)
34
- pz: ast.Number = frame.get(stmt.pz)
35
- qarg: ast.Bit | ast.Name = frame.get(stmt.qarg)
36
-
37
- qarg_str = (
38
- f"{qarg.name.id}[{qarg.addr}]"
39
- if isinstance(qarg, ast.Bit)
40
- else f"{qarg.id}"
41
- )
42
-
43
- frame.body.append(
44
- ast.Comment(
45
- text=f"noise.Pauli1({px.value}, {py.value}, {pz.value}) {qarg_str}]"
46
- )
47
- )
48
- return ()