bloqade-circuit 0.3.0__py3-none-any.whl → 0.4.1__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.
- bloqade/analysis/address/impls.py +3 -16
- bloqade/pyqrack/__init__.py +1 -1
- bloqade/pyqrack/noise/native.py +8 -8
- bloqade/pyqrack/squin/noise/__init__.py +1 -0
- bloqade/pyqrack/squin/noise/native.py +72 -0
- bloqade/pyqrack/squin/op.py +7 -0
- bloqade/pyqrack/squin/qubit.py +0 -29
- bloqade/pyqrack/squin/runtime.py +18 -0
- bloqade/pyqrack/squin/wire.py +0 -36
- bloqade/{noise/native → qasm2/dialects/noise}/__init__.py +1 -7
- bloqade/qasm2/dialects/noise/_dialect.py +3 -0
- bloqade/{noise → qasm2/dialects/noise}/fidelity.py +2 -2
- bloqade/qasm2/dialects/noise/model.py +278 -0
- bloqade/qasm2/emit/impls/__init__.py +1 -1
- bloqade/qasm2/emit/impls/{noise_native.py → noise.py} +11 -11
- bloqade/qasm2/emit/main.py +2 -4
- bloqade/qasm2/emit/target.py +3 -3
- bloqade/qasm2/groups.py +0 -2
- bloqade/{noise/native/_wrappers.py → qasm2/noise.py} +9 -5
- bloqade/qasm2/passes/glob.py +12 -8
- bloqade/qasm2/passes/noise.py +5 -14
- bloqade/qasm2/rewrite/__init__.py +2 -0
- bloqade/qasm2/rewrite/noise/__init__.py +0 -0
- bloqade/qasm2/rewrite/{heuristic_noise.py → noise/heuristic_noise.py} +31 -53
- bloqade/{noise/native/rewrite.py → qasm2/rewrite/noise/remove_noise.py} +2 -2
- bloqade/qbraid/lowering.py +8 -8
- bloqade/squin/__init__.py +16 -1
- bloqade/squin/analysis/nsites/impls.py +0 -9
- bloqade/squin/cirq/__init__.py +89 -0
- bloqade/squin/cirq/lowering.py +303 -0
- bloqade/squin/groups.py +7 -7
- bloqade/squin/lowering.py +27 -0
- bloqade/squin/noise/__init__.py +3 -1
- bloqade/squin/noise/_wrapper.py +7 -3
- bloqade/squin/noise/rewrite.py +111 -0
- bloqade/squin/noise/stmts.py +21 -16
- bloqade/squin/op/__init__.py +1 -0
- bloqade/squin/op/_wrapper.py +4 -0
- bloqade/squin/op/stmts.py +10 -11
- bloqade/squin/op/types.py +2 -0
- bloqade/squin/qubit.py +32 -37
- bloqade/squin/rewrite/desugar.py +65 -0
- bloqade/squin/rewrite/qubit_to_stim.py +0 -23
- bloqade/squin/rewrite/squin_measure.py +2 -27
- bloqade/squin/rewrite/stim_rewrite_util.py +3 -8
- bloqade/squin/rewrite/wire_to_stim.py +0 -21
- bloqade/squin/wire.py +4 -9
- bloqade/stim/__init__.py +2 -1
- bloqade/stim/_wrappers.py +4 -0
- bloqade/stim/dialects/auxiliary/__init__.py +1 -0
- bloqade/stim/dialects/auxiliary/emit.py +17 -2
- bloqade/stim/dialects/auxiliary/stmts/__init__.py +1 -0
- bloqade/stim/dialects/auxiliary/stmts/annotate.py +8 -0
- bloqade/stim/dialects/collapse/emit_str.py +3 -1
- bloqade/stim/dialects/gate/emit.py +9 -2
- bloqade/stim/dialects/noise/emit.py +32 -1
- bloqade/stim/dialects/noise/stmts.py +29 -0
- bloqade/stim/parse/__init__.py +1 -0
- bloqade/stim/parse/lowering.py +686 -0
- {bloqade_circuit-0.3.0.dist-info → bloqade_circuit-0.4.1.dist-info}/METADATA +3 -1
- {bloqade_circuit-0.3.0.dist-info → bloqade_circuit-0.4.1.dist-info}/RECORD +64 -57
- bloqade/noise/__init__.py +0 -2
- bloqade/noise/native/_dialect.py +0 -3
- bloqade/noise/native/model.py +0 -346
- bloqade/qasm2/dialects/noise.py +0 -48
- bloqade/squin/rewrite/measure_desugar.py +0 -33
- /bloqade/{noise/native → qasm2/dialects/noise}/stmts.py +0 -0
- {bloqade_circuit-0.3.0.dist-info → bloqade_circuit-0.4.1.dist-info}/WHEEL +0 -0
- {bloqade_circuit-0.3.0.dist-info → bloqade_circuit-0.4.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
from kirin import ir, types
|
|
2
|
-
from kirin.dialects import ilist
|
|
3
|
-
from kirin.rewrite.abc import RewriteRule, RewriteResult
|
|
4
|
-
|
|
5
|
-
from bloqade.squin.qubit import QubitType, MeasureAny, MeasureQubit, MeasureQubitList
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class MeasureDesugarRule(RewriteRule):
|
|
9
|
-
"""
|
|
10
|
-
Desugar measure operations in the circuit.
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
def rewrite_Statement(self, node: ir.Statement) -> RewriteResult:
|
|
14
|
-
|
|
15
|
-
if not isinstance(node, MeasureAny):
|
|
16
|
-
return RewriteResult()
|
|
17
|
-
|
|
18
|
-
if node.input.type.is_subseteq(QubitType):
|
|
19
|
-
node.replace_by(
|
|
20
|
-
MeasureQubit(
|
|
21
|
-
qubit=node.input,
|
|
22
|
-
)
|
|
23
|
-
)
|
|
24
|
-
return RewriteResult(has_done_something=True)
|
|
25
|
-
elif node.input.type.is_subseteq(ilist.IListType[QubitType, types.Any]):
|
|
26
|
-
node.replace_by(
|
|
27
|
-
MeasureQubitList(
|
|
28
|
-
qubits=node.input,
|
|
29
|
-
)
|
|
30
|
-
)
|
|
31
|
-
return RewriteResult(has_done_something=True)
|
|
32
|
-
|
|
33
|
-
return RewriteResult()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|