bloqade-circuit 0.7.13__tar.gz → 0.8.0__tar.gz
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.
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/.github/workflows/ci.yml +3 -3
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/.github/workflows/release.yml +5 -5
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/.pre-commit-config.yaml +3 -3
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/PKG-INFO +2 -2
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/pyproject.toml +5 -2
- bloqade_circuit-0.8.0/src/bloqade/analysis/address/__init__.py +15 -0
- bloqade_circuit-0.8.0/src/bloqade/analysis/address/analysis.py +150 -0
- bloqade_circuit-0.8.0/src/bloqade/analysis/address/impls.py +381 -0
- bloqade_circuit-0.8.0/src/bloqade/analysis/address/lattice.py +270 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/analysis/fidelity/analysis.py +2 -2
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/analysis/measure_id/impls.py +3 -27
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/cirq_utils/__init__.py +3 -1
- bloqade_circuit-0.8.0/src/bloqade/cirq_utils/emit/__init__.py +3 -0
- bloqade_circuit-0.8.0/src/bloqade/cirq_utils/emit/base.py +243 -0
- bloqade_circuit-0.8.0/src/bloqade/cirq_utils/emit/gate.py +104 -0
- bloqade_circuit-0.8.0/src/bloqade/cirq_utils/emit/noise.py +90 -0
- bloqade_circuit-0.8.0/src/bloqade/cirq_utils/emit/qubit.py +35 -0
- bloqade_circuit-0.8.0/src/bloqade/cirq_utils/lowering.py +664 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/native/__init__.py +0 -1
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/native/_prelude.py +3 -3
- bloqade_circuit-0.8.0/src/bloqade/native/dialects/gate/__init__.py +2 -0
- bloqade_circuit-0.8.0/src/bloqade/native/dialects/gate/_dialect.py +3 -0
- {bloqade_circuit-0.7.13/src/bloqade/native/dialects/gates → bloqade_circuit-0.8.0/src/bloqade/native/dialects/gate}/_interface.py +5 -5
- {bloqade_circuit-0.7.13/src/bloqade/native/dialects/gates → bloqade_circuit-0.8.0/src/bloqade/native/dialects/gate}/stmts.py +5 -5
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/native/stdlib/broadcast.py +19 -19
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/native/stdlib/simple.py +14 -13
- bloqade_circuit-0.8.0/src/bloqade/native/upstream/__init__.py +5 -0
- bloqade_circuit-0.8.0/src/bloqade/native/upstream/squin2native.py +136 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/pyqrack/__init__.py +1 -2
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/pyqrack/device.py +6 -17
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/pyqrack/native.py +17 -17
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/pyqrack/reg.py +1 -6
- bloqade_circuit-0.8.0/src/bloqade/pyqrack/squin/gate/__init__.py +1 -0
- bloqade_circuit-0.8.0/src/bloqade/pyqrack/squin/gate/gate.py +136 -0
- bloqade_circuit-0.8.0/src/bloqade/pyqrack/squin/noise/native.py +138 -0
- bloqade_circuit-0.8.0/src/bloqade/pyqrack/squin/qubit.py +66 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/pyqrack/target.py +2 -2
- bloqade_circuit-0.8.0/src/bloqade/qasm2/dialects/core/address.py +47 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/noise/fidelity.py +2 -6
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/noise/model.py +2 -1
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/passes/parallel.py +3 -1
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/rewrite/__init__.py +0 -1
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/rewrite/noise/heuristic_noise.py +7 -17
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/rewrite/parallel_to_glob.py +28 -15
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/rewrite/parallel_to_uop.py +2 -8
- bloqade_circuit-0.8.0/src/bloqade/qubit/__init__.py +12 -0
- bloqade_circuit-0.8.0/src/bloqade/qubit/_dialect.py +3 -0
- bloqade_circuit-0.8.0/src/bloqade/qubit/_interface.py +49 -0
- bloqade_circuit-0.8.0/src/bloqade/qubit/_prelude.py +45 -0
- bloqade_circuit-0.8.0/src/bloqade/qubit/analysis/address_impl.py +40 -0
- bloqade_circuit-0.8.0/src/bloqade/qubit/stdlib/__init__.py +2 -0
- bloqade_circuit-0.8.0/src/bloqade/qubit/stdlib/_new.py +34 -0
- bloqade_circuit-0.8.0/src/bloqade/qubit/stdlib/broadcast.py +62 -0
- bloqade_circuit-0.8.0/src/bloqade/qubit/stdlib/simple.py +59 -0
- bloqade_circuit-0.8.0/src/bloqade/qubit/stmts.py +60 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/rewrite/passes/aggressive_unroll.py +2 -1
- bloqade_circuit-0.8.0/src/bloqade/squin/__init__.py +51 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/squin/analysis/schedule.py +2 -2
- bloqade_circuit-0.8.0/src/bloqade/squin/gate/__init__.py +2 -0
- bloqade_circuit-0.8.0/src/bloqade/squin/gate/_dialect.py +3 -0
- bloqade_circuit-0.8.0/src/bloqade/squin/gate/_interface.py +98 -0
- bloqade_circuit-0.8.0/src/bloqade/squin/gate/stmts.py +119 -0
- bloqade_circuit-0.8.0/src/bloqade/squin/groups.py +29 -0
- bloqade_circuit-0.8.0/src/bloqade/squin/noise/__init__.py +2 -0
- bloqade_circuit-0.8.0/src/bloqade/squin/noise/_dialect.py +3 -0
- bloqade_circuit-0.8.0/src/bloqade/squin/noise/_interface.py +45 -0
- bloqade_circuit-0.8.0/src/bloqade/squin/noise/stmts.py +111 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/squin/rewrite/U3_to_clifford.py +70 -51
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/squin/rewrite/__init__.py +0 -2
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/squin/rewrite/remove_dangling_qubits.py +2 -2
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/squin/rewrite/wrap_analysis.py +4 -35
- bloqade_circuit-0.8.0/src/bloqade/squin/stdlib/broadcast/__init__.py +34 -0
- bloqade_circuit-0.8.0/src/bloqade/squin/stdlib/broadcast/_qubit.py +4 -0
- bloqade_circuit-0.8.0/src/bloqade/squin/stdlib/broadcast/gate.py +260 -0
- bloqade_circuit-0.8.0/src/bloqade/squin/stdlib/broadcast/noise.py +144 -0
- bloqade_circuit-0.8.0/src/bloqade/squin/stdlib/simple/__init__.py +33 -0
- bloqade_circuit-0.8.0/src/bloqade/squin/stdlib/simple/gate.py +242 -0
- bloqade_circuit-0.8.0/src/bloqade/squin/stdlib/simple/noise.py +126 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/__init__.py +1 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/_wrappers.py +6 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/noise/emit.py +6 -1
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/noise/stmts.py +5 -3
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/emit/stim_str.py +2 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/parse/lowering.py +12 -17
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/passes/__init__.py +0 -1
- bloqade_circuit-0.8.0/src/bloqade/stim/passes/flatten.py +26 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/passes/simplify_ifs.py +6 -1
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/passes/squin_to_stim.py +4 -70
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/rewrite/__init__.py +0 -4
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/rewrite/ifs_to_stim.py +23 -29
- bloqade_circuit-0.8.0/src/bloqade/stim/rewrite/qubit_to_stim.py +132 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/rewrite/squin_measure.py +9 -18
- bloqade_circuit-0.8.0/src/bloqade/stim/rewrite/squin_noise.py +201 -0
- bloqade_circuit-0.8.0/src/bloqade/stim/rewrite/util.py +35 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/types.py +10 -0
- bloqade_circuit-0.8.0/test/analysis/address/test_qubit_analysis.py +266 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/analysis/address/util.py +5 -1
- bloqade_circuit-0.8.0/test/analysis/measure_id/test_measure_id.py +280 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/cirq_utils/noise/test_noise_models.py +2 -9
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/cirq_utils/noise/test_noisy_ghz.py +2 -4
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/cirq_utils/noise/test_one_zone_correlated_noise.py +2 -5
- {bloqade_circuit-0.7.13/test/squin/cirq → bloqade_circuit-0.8.0/test/cirq_utils}/test_cirq_to_squin.py +88 -57
- bloqade_circuit-0.8.0/test/cirq_utils/test_clifford_to_cirq.py +319 -0
- bloqade_circuit-0.8.0/test/cirq_utils/test_squin_noise_to_cirq.py +46 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/native/test_stdlib.py +4 -5
- bloqade_circuit-0.8.0/test/native/upstream/test_squin2native.py +50 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/pyqrack/runtime/test_qrack.py +34 -28
- bloqade_circuit-0.8.0/test/pyqrack/squin/test_kernel.py +230 -0
- bloqade_circuit-0.8.0/test/pyqrack/squin/test_noise.py +104 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/passes/test_heuristic_noise.py +4 -4
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/passes/test_parallel_to_global.py +23 -15
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/test_count.py +13 -15
- bloqade_circuit-0.8.0/test/squin/clifford/test_stdlib_clifford.py +186 -0
- bloqade_circuit-0.8.0/test/squin/noise/test_stdlib_noise.py +92 -0
- bloqade_circuit-0.8.0/test/squin/rewrite/test_U3_to_clifford.py +525 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/squin/test_qubit.py +7 -7
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/squin/test_stdlib_shorthands.py +22 -64
- bloqade_circuit-0.8.0/test/squin/test_typeinfer.py +73 -0
- bloqade_circuit-0.8.0/test/stim/dialects/stim/emit/test_stim_noise.py +97 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/dialects/stim/test_stim_circuits.py +15 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/parse/test_parse_custom.py +1 -1
- bloqade_circuit-0.8.0/test/stim/passes/stim_reference_programs/noise/broadcast_depolarize2.stim +1 -0
- bloqade_circuit-0.8.0/test/stim/passes/stim_reference_programs/noise/broadcast_pauli_channel_1.stim +1 -0
- bloqade_circuit-0.8.0/test/stim/passes/stim_reference_programs/noise/broadcast_pauli_channel_1_reuse.stim +3 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/noise/broadcast_pauli_channel_2.stim +1 -1
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/noise/broadcast_pauli_channel_2_reuse_on_4_qubits.stim → bloqade_circuit-0.8.0/test/stim/passes/stim_reference_programs/noise/broadcast_pauli_channel_2_reuse.stim +2 -2
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/qubit/qubit.stim +1 -1
- bloqade_circuit-0.8.0/test/stim/passes/stim_reference_programs/qubit/rep_code.stim +13 -0
- bloqade_circuit-0.8.0/test/stim/passes/stim_reference_programs/qubit/u3_gates.stim +5 -0
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/wire/wire_measure.stim → bloqade_circuit-0.8.0/test/stim/passes/stim_reference_programs/qubit/u3_to_clifford.stim +1 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/test_squin_meas_to_stim.py +43 -44
- bloqade_circuit-0.8.0/test/stim/passes/test_squin_noise_to_stim.py +328 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/test_squin_qubit_to_stim.py +137 -89
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/test_measure_id_analysis.py +4 -3
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/wrapper/test_wrapper.py +15 -1
- bloqade_circuit-0.8.0/test/visual/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/uv.lock +923 -776
- bloqade_circuit-0.7.13/src/bloqade/analysis/address/__init__.py +0 -11
- bloqade_circuit-0.7.13/src/bloqade/analysis/address/analysis.py +0 -60
- bloqade_circuit-0.7.13/src/bloqade/analysis/address/impls.py +0 -178
- bloqade_circuit-0.7.13/src/bloqade/analysis/address/lattice.py +0 -85
- bloqade_circuit-0.7.13/src/bloqade/native/dialects/gates/__init__.py +0 -3
- bloqade_circuit-0.7.13/src/bloqade/native/dialects/gates/_dialect.py +0 -3
- bloqade_circuit-0.7.13/src/bloqade/pyqrack/squin/noise/native.py +0 -72
- bloqade_circuit-0.7.13/src/bloqade/pyqrack/squin/op.py +0 -180
- bloqade_circuit-0.7.13/src/bloqade/pyqrack/squin/qubit.py +0 -82
- bloqade_circuit-0.7.13/src/bloqade/pyqrack/squin/runtime.py +0 -543
- bloqade_circuit-0.7.13/src/bloqade/pyqrack/squin/wire.py +0 -51
- bloqade_circuit-0.7.13/src/bloqade/qasm2/dialects/core/address.py +0 -38
- bloqade_circuit-0.7.13/src/bloqade/squin/__init__.py +0 -24
- bloqade_circuit-0.7.13/src/bloqade/squin/_typeinfer.py +0 -20
- bloqade_circuit-0.7.13/src/bloqade/squin/analysis/address_impl.py +0 -71
- bloqade_circuit-0.7.13/src/bloqade/squin/analysis/nsites/__init__.py +0 -9
- bloqade_circuit-0.7.13/src/bloqade/squin/analysis/nsites/analysis.py +0 -50
- bloqade_circuit-0.7.13/src/bloqade/squin/analysis/nsites/impls.py +0 -99
- bloqade_circuit-0.7.13/src/bloqade/squin/analysis/nsites/lattice.py +0 -49
- bloqade_circuit-0.7.13/src/bloqade/squin/cirq/__init__.py +0 -306
- bloqade_circuit-0.7.13/src/bloqade/squin/cirq/emit/emit_circuit.py +0 -129
- bloqade_circuit-0.7.13/src/bloqade/squin/cirq/emit/noise.py +0 -49
- bloqade_circuit-0.7.13/src/bloqade/squin/cirq/emit/op.py +0 -176
- bloqade_circuit-0.7.13/src/bloqade/squin/cirq/emit/qubit.py +0 -58
- bloqade_circuit-0.7.13/src/bloqade/squin/cirq/emit/runtime.py +0 -242
- bloqade_circuit-0.7.13/src/bloqade/squin/cirq/lowering.py +0 -439
- bloqade_circuit-0.7.13/src/bloqade/squin/groups.py +0 -46
- bloqade_circuit-0.7.13/src/bloqade/squin/lowering.py +0 -80
- bloqade_circuit-0.7.13/src/bloqade/squin/noise/__init__.py +0 -10
- bloqade_circuit-0.7.13/src/bloqade/squin/noise/_dialect.py +0 -3
- bloqade_circuit-0.7.13/src/bloqade/squin/noise/_wrapper.py +0 -36
- bloqade_circuit-0.7.13/src/bloqade/squin/noise/rewrite.py +0 -129
- bloqade_circuit-0.7.13/src/bloqade/squin/noise/stmts.py +0 -75
- bloqade_circuit-0.7.13/src/bloqade/squin/op/__init__.py +0 -41
- bloqade_circuit-0.7.13/src/bloqade/squin/op/_dialect.py +0 -3
- bloqade_circuit-0.7.13/src/bloqade/squin/op/_wrapper.py +0 -121
- bloqade_circuit-0.7.13/src/bloqade/squin/op/number.py +0 -5
- bloqade_circuit-0.7.13/src/bloqade/squin/op/rewrite.py +0 -46
- bloqade_circuit-0.7.13/src/bloqade/squin/op/stdlib.py +0 -62
- bloqade_circuit-0.7.13/src/bloqade/squin/op/stmts.py +0 -300
- bloqade_circuit-0.7.13/src/bloqade/squin/op/traits.py +0 -43
- bloqade_circuit-0.7.13/src/bloqade/squin/op/types.py +0 -128
- bloqade_circuit-0.7.13/src/bloqade/squin/parallel.py +0 -200
- bloqade_circuit-0.7.13/src/bloqade/squin/qubit.py +0 -194
- bloqade_circuit-0.7.13/src/bloqade/squin/rewrite/canonicalize.py +0 -60
- bloqade_circuit-0.7.13/src/bloqade/squin/rewrite/desugar.py +0 -102
- bloqade_circuit-0.7.13/src/bloqade/squin/stdlib/channel.py +0 -86
- bloqade_circuit-0.7.13/src/bloqade/squin/stdlib/gate.py +0 -201
- bloqade_circuit-0.7.13/src/bloqade/squin/types.py +0 -8
- bloqade_circuit-0.7.13/src/bloqade/squin/wire.py +0 -201
- bloqade_circuit-0.7.13/src/bloqade/stim/rewrite/qubit_to_stim.py +0 -87
- bloqade_circuit-0.7.13/src/bloqade/stim/rewrite/squin_noise.py +0 -177
- bloqade_circuit-0.7.13/src/bloqade/stim/rewrite/util.py +0 -234
- bloqade_circuit-0.7.13/src/bloqade/stim/rewrite/wire_identity_elimination.py +0 -24
- bloqade_circuit-0.7.13/src/bloqade/stim/rewrite/wire_to_stim.py +0 -57
- bloqade_circuit-0.7.13/test/analysis/address/test_qubit_analysis.py +0 -128
- bloqade_circuit-0.7.13/test/analysis/address/test_wire_analysis.py +0 -253
- bloqade_circuit-0.7.13/test/analysis/measure_id/test_measure_id.py +0 -224
- bloqade_circuit-0.7.13/test/pyqrack/squin/test_kernel.py +0 -562
- bloqade_circuit-0.7.13/test/pyqrack/squin/test_noise.py +0 -201
- bloqade_circuit-0.7.13/test/squin/analysis/test_nsites_analysis.py +0 -266
- bloqade_circuit-0.7.13/test/squin/cirq/test_squin_noise_to_cirq.py +0 -88
- bloqade_circuit-0.7.13/test/squin/cirq/test_squin_to_cirq.py +0 -469
- bloqade_circuit-0.7.13/test/squin/op/test_reset.py +0 -58
- bloqade_circuit-0.7.13/test/squin/rewrite/test_U3_to_clifford.py +0 -611
- bloqade_circuit-0.7.13/test/squin/rewrite/test_canonicalize.py +0 -54
- bloqade_circuit-0.7.13/test/squin/rewrite/test_desugar.py +0 -53
- bloqade_circuit-0.7.13/test/squin/rewrite/test_mult_rewrite.py +0 -166
- bloqade_circuit-0.7.13/test/squin/test_constprop.py +0 -109
- bloqade_circuit-0.7.13/test/squin/test_sugar.py +0 -161
- bloqade_circuit-0.7.13/test/squin/test_typeinfer.py +0 -175
- bloqade_circuit-0.7.13/test/squin/wire/test_check.py +0 -28
- bloqade_circuit-0.7.13/test/stim/dialects/stim/emit/test_stim_noise.py +0 -36
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/noise/broadcast_depolarize2.stim +0 -1
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/noise/broadcast_iid_bit_flip_channel.stim +0 -1
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/noise/broadcast_iid_phase_flip_channel.stim +0 -1
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/noise/broadcast_iid_y_flip_channel.stim +0 -1
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/noise/broadcast_pauli_channel_1.stim +0 -1
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/noise/broadcast_pauli_channel_1_many_qubits.stim +0 -1
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/noise/broadcast_pauli_channel_1_reuse.stim +0 -3
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/noise/wire_apply_pauli_channel_1.stim +0 -1
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/qubit/adjoint_rewrite.stim +0 -4
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/qubit/u3_to_clifford.stim +0 -12
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/wire/wire.stim +0 -3
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/wire/wire_apply.stim +0 -2
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/wire/wire_apply_control.stim +0 -2
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/wire/wire_broadcast.stim +0 -2
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/wire/wire_broadcast_control.stim +0 -6
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/wire/wire_multiple_apply.stim +0 -5
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/wire/wire_qubit_loss.stim +0 -8
- bloqade_circuit-0.7.13/test/stim/passes/stim_reference_programs/wire/wire_reset.stim +0 -3
- bloqade_circuit-0.7.13/test/stim/passes/test_squin_noise_to_stim.py +0 -408
- bloqade_circuit-0.7.13/test/stim/passes/test_squin_wire_to_stim.py +0 -384
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/.github/dependabot.yml +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/.github/workflows/isort.yml +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/.github/workflows/lint.yml +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/.gitignore +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/LICENSE +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/README.md +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/_typos.toml +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/justfile +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/analysis/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/analysis/fidelity/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/analysis/measure_id/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/analysis/measure_id/analysis.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/analysis/measure_id/lattice.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/cirq_utils/lineprog.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/cirq_utils/noise/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/cirq_utils/noise/_two_zone_utils.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/cirq_utils/noise/conflict_graph.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/cirq_utils/noise/model.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/cirq_utils/noise/transform.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/cirq_utils/parallelize.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/device.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/native/dialects/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/native/stdlib/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/pyqrack/base.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/pyqrack/noise/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/pyqrack/noise/native.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/pyqrack/qasm2/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/pyqrack/qasm2/core.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/pyqrack/qasm2/glob.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/pyqrack/qasm2/parallel.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/pyqrack/qasm2/uop.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/pyqrack/squin/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/pyqrack/squin/noise/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/pyqrack/task.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/_qasm_loading.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/_wrappers.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/core/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/core/_dialect.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/core/_emit.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/core/_typeinfer.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/core/stmts.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/expr/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/expr/_dialect.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/expr/_emit.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/expr/_from_python.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/expr/_interp.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/expr/stmts.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/glob.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/indexing.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/inline.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/noise/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/noise/_dialect.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/noise/stmts.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/parallel.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/uop/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/uop/_dialect.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/uop/_emit.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/uop/schedule.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/dialects/uop/stmts.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/emit/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/emit/base.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/emit/gate.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/emit/impls/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/emit/impls/noise.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/emit/main.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/emit/target.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/glob.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/groups.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/noise.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/parallel.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/parse/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/parse/ast.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/parse/build.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/parse/lowering.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/parse/parser.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/parse/print.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/parse/qasm2.lark +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/parse/visitor.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/parse/visitor.pyi +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/passes/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/passes/fold.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/passes/glob.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/passes/lift_qubits.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/passes/noise.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/passes/py2qasm.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/passes/qasm2py.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/passes/unroll_if.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/rewrite/desugar.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/rewrite/glob.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/rewrite/insert_qubits.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/rewrite/native_gates.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/rewrite/noise/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/rewrite/noise/remove_noise.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/rewrite/register.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/rewrite/uop_to_parallel.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qasm2/types.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qbraid/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qbraid/lowering.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qbraid/schema.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qbraid/simulation_result.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/qbraid/target.py +0 -0
- {bloqade_circuit-0.7.13/src/bloqade/squin → bloqade_circuit-0.8.0/src/bloqade/qubit}/analysis/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/rewrite/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/rewrite/passes/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/rewrite/passes/canonicalize_ilist.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/rewrite/rules/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/rewrite/rules/split_ifs.py +0 -0
- {bloqade_circuit-0.7.13/src/bloqade/squin/stdlib → bloqade_circuit-0.8.0/src/bloqade/squin/analysis}/__init__.py +0 -0
- {bloqade_circuit-0.7.13/src/bloqade/visual/animation → bloqade_circuit-0.8.0/src/bloqade/squin/stdlib}/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/auxiliary/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/auxiliary/_dialect.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/auxiliary/emit.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/auxiliary/interp.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/auxiliary/lowering.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/auxiliary/stmts/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/auxiliary/stmts/annotate.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/auxiliary/stmts/const.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/auxiliary/types.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/collapse/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/collapse/_dialect.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/collapse/emit_str.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/collapse/stmts/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/collapse/stmts/measure.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/collapse/stmts/pp_measure.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/collapse/stmts/reset.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/gate/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/gate/_dialect.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/gate/emit.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/gate/stmts/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/gate/stmts/base.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/gate/stmts/clifford_1q.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/gate/stmts/clifford_2q.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/gate/stmts/control_2q.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/gate/stmts/pp.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/noise/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/dialects/noise/_dialect.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/emit/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/emit/impls.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/groups.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/parse/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/rewrite/py_constant_to_stim.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/upstream/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/stim/upstream/from_squin.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/task.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/test_utils.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/visual/__init__.py +0 -0
- {bloqade_circuit-0.7.13/src/bloqade/visual/animation/runtime → bloqade_circuit-0.8.0/src/bloqade/visual/animation}/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/visual/animation/animate.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/visual/animation/base.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/visual/animation/gate_event.py +0 -0
- {bloqade_circuit-0.7.13/test → bloqade_circuit-0.8.0/src/bloqade/visual/animation/runtime}/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/visual/animation/runtime/aod.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/visual/animation/runtime/atoms.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/visual/animation/runtime/ppoly.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/visual/animation/runtime/qpustate.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/src/bloqade/visual/animation/runtime/utils.py +0 -0
- {bloqade_circuit-0.7.13/test/native → bloqade_circuit-0.8.0/test}/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/analysis/fidelity/test_fidelity.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/cirq_utils/test_lpsolvers.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/cirq_utils/test_parallelize.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/cirq_utils/test_transpile.py +0 -0
- {bloqade_circuit-0.7.13/test/pyqrack → bloqade_circuit-0.8.0/test/native}/__init__.py +0 -0
- {bloqade_circuit-0.7.13/test/pyqrack/runtime → bloqade_circuit-0.8.0/test/native/upstream}/__init__.py +0 -0
- {bloqade_circuit-0.7.13/test/pyqrack/runtime/noise → bloqade_circuit-0.8.0/test/pyqrack}/__init__.py +0 -0
- {bloqade_circuit-0.7.13/test/qasm2 → bloqade_circuit-0.8.0/test/pyqrack/runtime}/__init__.py +0 -0
- {bloqade_circuit-0.7.13/test/qasm2/parse → bloqade_circuit-0.8.0/test/pyqrack/runtime/noise}/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/pyqrack/runtime/noise/qasm2/test_loss.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/pyqrack/runtime/noise/qasm2/test_pauli.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/pyqrack/runtime/test_dyn_memory.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/pyqrack/test_target.py +0 -0
- {bloqade_circuit-0.7.13/test/qasm2/passes → bloqade_circuit-0.8.0/test/qasm2}/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/analysis/test_dag.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/emit/test_extended.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/emit/test_extended_noise.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/emit/test_qasm2.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/emit/test_qasm2_emit.py +0 -0
- {bloqade_circuit-0.7.13/test/qbraid → bloqade_circuit-0.8.0/test/qasm2/parse}/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/invalid_programs/invalid_if.qasm +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/programs/README.md +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/programs/global.qasm +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/programs/iqft1.qasm +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/programs/main.qasm +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/programs/noise.qasm +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/programs/para.qasm +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/programs/process_tomo.qasm +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/programs/qelib1.inc +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/programs/qft.qasm +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/programs/qft2.qasm +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/programs/rb.qasm +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/programs/rep_code.qasm +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/programs/ripple_carry_adder.qasm +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/programs/tele.qasm +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/programs/valid_if.qasm +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/test_ast.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/parse/test_roundtrip.py +0 -0
- {bloqade_circuit-0.7.13/test/sample → bloqade_circuit-0.8.0/test/qasm2/passes}/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/passes/test_global_to_parallel.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/passes/test_global_to_uop.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/passes/test_parallel_to_uop.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/passes/test_qasm2py.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/passes/test_unroll_if.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/passes/test_uop_to_parallel.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/test_inline.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/test_lowering.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/test_native.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qasm2/test_two2one.py +0 -0
- {bloqade_circuit-0.7.13/test/squin/wire → bloqade_circuit-0.8.0/test/qbraid}/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qbraid/test_clean_circuit.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qbraid/test_lowering.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/qbraid/test_target.py +0 -0
- {bloqade_circuit-0.7.13/test/stim → bloqade_circuit-0.8.0/test/sample}/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/sample/test_noise_model.py +0 -0
- {bloqade_circuit-0.7.13/test/stim/dialects → bloqade_circuit-0.8.0/test/stim}/__init__.py +0 -0
- {bloqade_circuit-0.7.13/test/stim/dialects/stim → bloqade_circuit-0.8.0/test/stim/dialects}/__init__.py +0 -0
- {bloqade_circuit-0.7.13/test/stim/dialects/stim/emit → bloqade_circuit-0.8.0/test/stim/dialects/stim}/__init__.py +0 -0
- {bloqade_circuit-0.7.13/test/stim/parse → bloqade_circuit-0.8.0/test/stim/dialects/stim/emit}/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/dialects/stim/emit/base.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/dialects/stim/emit/test_stim_1q.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/dialects/stim/emit/test_stim_ctrl.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/dialects/stim/emit/test_stim_debug.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/dialects/stim/emit/test_stim_detector.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/dialects/stim/emit/test_stim_meas.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/dialects/stim/emit/test_stim_obs_inc.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/dialects/stim/emit/test_stim_ppmeas.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/dialects/stim/emit/test_stim_qubit_coords.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/dialects/stim/emit/test_stim_spp.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/dialects/stim/test_stim_const.py +0 -0
- {bloqade_circuit-0.7.13/test/stim/passes → bloqade_circuit-0.8.0/test/stim/parse}/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/parse/base.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/parse/test_parse.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/parse/test_parse_clifford.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/parse/test_parse_control.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/parse/test_parse_noise.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/parse/test_parse_spp.py +0 -0
- {bloqade_circuit-0.7.13/test/stim/wrapper → bloqade_circuit-0.8.0/test/stim/passes}/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/noise/apply_depolarize1.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/noise/apply_loss.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/noise/apply_pauli_channel_1.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/noise/broadcast_depolarize1.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/pure_squin_rewrite.txt +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/qubit/addition_assignment_measure.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/qubit/alias_with_measure_list.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/qubit/complex_storage_index_order.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/qubit/for_loop_nontrivial_index.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/qubit/measure_desugar.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/qubit/nested_for_loop.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/qubit/nested_list.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/qubit/non_pure_loop_iterator.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/qubit/pick_if_else.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/qubit/qubit_broadcast.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/qubit/qubit_loss.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/qubit/qubit_reset.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/qubit/record_index_order.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/stim_reference_programs/qubit/simple_if_rewrite.stim +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/stim/passes/test_squin_debug_to_stim.py +0 -0
- {bloqade_circuit-0.7.13/test/visual → bloqade_circuit-0.8.0/test/stim/wrapper}/__init__.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/test_serialization.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/test_zone_model.py +0 -0
- {bloqade_circuit-0.7.13 → bloqade_circuit-0.8.0}/test/visual/test_utils.py +0 -0
|
@@ -21,7 +21,7 @@ jobs:
|
|
|
21
21
|
steps:
|
|
22
22
|
- uses: actions/checkout@v5
|
|
23
23
|
- name: Install uv
|
|
24
|
-
uses: astral-sh/setup-uv@
|
|
24
|
+
uses: astral-sh/setup-uv@v7
|
|
25
25
|
with:
|
|
26
26
|
# Install a specific version of uv.
|
|
27
27
|
version: "0.8.4"
|
|
@@ -43,7 +43,7 @@ jobs:
|
|
|
43
43
|
token: ${{ secrets.CODECOV_TOKEN }} # required
|
|
44
44
|
- name: Archive code coverage results
|
|
45
45
|
if: matrix.python-version == '3.12'
|
|
46
|
-
uses: actions/upload-artifact@
|
|
46
|
+
uses: actions/upload-artifact@v5
|
|
47
47
|
with:
|
|
48
48
|
name: code-coverage-report
|
|
49
49
|
path: coverage.xml
|
|
@@ -55,7 +55,7 @@ jobs:
|
|
|
55
55
|
steps:
|
|
56
56
|
- uses: actions/checkout@v5
|
|
57
57
|
- name: download covearge
|
|
58
|
-
uses: actions/download-artifact@
|
|
58
|
+
uses: actions/download-artifact@v6
|
|
59
59
|
with:
|
|
60
60
|
name: code-coverage-report
|
|
61
61
|
- name: check coverage
|
|
@@ -10,7 +10,7 @@ jobs:
|
|
|
10
10
|
steps:
|
|
11
11
|
- uses: actions/checkout@v5
|
|
12
12
|
- name: Install uv
|
|
13
|
-
uses: astral-sh/setup-uv@
|
|
13
|
+
uses: astral-sh/setup-uv@v7
|
|
14
14
|
with:
|
|
15
15
|
# Install a specific version of uv.
|
|
16
16
|
version: "0.5.5"
|
|
@@ -19,7 +19,7 @@ jobs:
|
|
|
19
19
|
- name: Build distribution 📦
|
|
20
20
|
run: uv build
|
|
21
21
|
- name: Store the distribution packages
|
|
22
|
-
uses: actions/upload-artifact@
|
|
22
|
+
uses: actions/upload-artifact@v5
|
|
23
23
|
with:
|
|
24
24
|
name: python-package-distributions
|
|
25
25
|
path: dist/
|
|
@@ -39,7 +39,7 @@ jobs:
|
|
|
39
39
|
|
|
40
40
|
steps:
|
|
41
41
|
- name: Download all the dists
|
|
42
|
-
uses: actions/download-artifact@
|
|
42
|
+
uses: actions/download-artifact@v6
|
|
43
43
|
with:
|
|
44
44
|
name: python-package-distributions
|
|
45
45
|
path: dist/
|
|
@@ -60,12 +60,12 @@ jobs:
|
|
|
60
60
|
|
|
61
61
|
steps:
|
|
62
62
|
- name: Download all the dists
|
|
63
|
-
uses: actions/download-artifact@
|
|
63
|
+
uses: actions/download-artifact@v6
|
|
64
64
|
with:
|
|
65
65
|
name: python-package-distributions
|
|
66
66
|
path: dist/
|
|
67
67
|
- name: Sign the dists with Sigstore
|
|
68
|
-
uses: sigstore/gh-action-sigstore-python@v3.0
|
|
68
|
+
uses: sigstore/gh-action-sigstore-python@v3.1.0
|
|
69
69
|
with:
|
|
70
70
|
inputs: >-
|
|
71
71
|
./dist/*.tar.gz
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# See https://pre-commit.com/hooks.html for more hooks
|
|
3
3
|
repos:
|
|
4
4
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
-
rev:
|
|
5
|
+
rev: v6.0.0
|
|
6
6
|
hooks:
|
|
7
7
|
- id: check-yaml
|
|
8
8
|
args: ['--unsafe']
|
|
@@ -14,12 +14,12 @@ repos:
|
|
|
14
14
|
- id: isort
|
|
15
15
|
name: isort (python)
|
|
16
16
|
- repo: https://github.com/psf/black
|
|
17
|
-
rev: 25.
|
|
17
|
+
rev: 25.9.0
|
|
18
18
|
hooks:
|
|
19
19
|
- id: black
|
|
20
20
|
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
|
21
21
|
# Ruff version.
|
|
22
|
-
rev: "v0.
|
|
22
|
+
rev: "v0.13.2"
|
|
23
23
|
hooks:
|
|
24
24
|
- id: ruff
|
|
25
25
|
- repo: https://github.com/crate-ci/typos
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bloqade-circuit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
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.
|
|
8
|
+
Requires-Dist: kirin-toolchain~=0.17.30
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "bloqade-circuit"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.8.0"
|
|
4
4
|
description = "The software development toolkit for neutral atom arrays."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -13,7 +13,7 @@ requires-python = ">=3.10"
|
|
|
13
13
|
dependencies = [
|
|
14
14
|
"numpy>=1.22.0",
|
|
15
15
|
"scipy>=1.13.1",
|
|
16
|
-
"kirin-toolchain~=0.17.
|
|
16
|
+
"kirin-toolchain~=0.17.30",
|
|
17
17
|
"rich>=13.9.4",
|
|
18
18
|
"pydantic>=1.3.0,<2.11.0",
|
|
19
19
|
"pandas>=2.2.3",
|
|
@@ -118,3 +118,6 @@ include = ["src/bloqade/*"]
|
|
|
118
118
|
|
|
119
119
|
[tool.pytest.ini_options]
|
|
120
120
|
testpaths = "test/"
|
|
121
|
+
filterwarnings = [
|
|
122
|
+
"ignore:In cirq 1.6 the default value of `use_repetition_ids`:FutureWarning:cirq.circuits.circuit_operation",
|
|
123
|
+
]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from . import impls as impls
|
|
2
|
+
from .lattice import (
|
|
3
|
+
Bottom as Bottom,
|
|
4
|
+
Address as Address,
|
|
5
|
+
Unknown as Unknown,
|
|
6
|
+
AddressReg as AddressReg,
|
|
7
|
+
UnknownReg as UnknownReg,
|
|
8
|
+
ConstResult as ConstResult,
|
|
9
|
+
AddressQubit as AddressQubit,
|
|
10
|
+
PartialIList as PartialIList,
|
|
11
|
+
PartialTuple as PartialTuple,
|
|
12
|
+
UnknownQubit as UnknownQubit,
|
|
13
|
+
PartialLambda as PartialLambda,
|
|
14
|
+
)
|
|
15
|
+
from .analysis import AddressAnalysis as AddressAnalysis
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
from typing import Any, Type, TypeVar
|
|
2
|
+
from dataclasses import field
|
|
3
|
+
|
|
4
|
+
from kirin import ir, types, interp
|
|
5
|
+
from kirin.analysis import Forward, const
|
|
6
|
+
from kirin.dialects.ilist import IList
|
|
7
|
+
from kirin.analysis.forward import ForwardFrame
|
|
8
|
+
from kirin.analysis.const.lattice import PartialLambda
|
|
9
|
+
|
|
10
|
+
from .lattice import Address, AddressReg, ConstResult, PartialIList, PartialTuple
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AddressAnalysis(Forward[Address]):
|
|
14
|
+
"""
|
|
15
|
+
This analysis pass can be used to track the global addresses of qubits and wires.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
keys = ["qubit.address"]
|
|
19
|
+
_const_prop: const.Propagate
|
|
20
|
+
lattice = Address
|
|
21
|
+
next_address: int = field(init=False)
|
|
22
|
+
|
|
23
|
+
def initialize(self):
|
|
24
|
+
super().initialize()
|
|
25
|
+
self.next_address: int = 0
|
|
26
|
+
self._const_prop = const.Propagate(self.dialects)
|
|
27
|
+
self._const_prop.initialize()
|
|
28
|
+
return self
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def qubit_count(self) -> int:
|
|
32
|
+
"""Total number of qubits found by the analysis."""
|
|
33
|
+
return self.next_address
|
|
34
|
+
|
|
35
|
+
T = TypeVar("T")
|
|
36
|
+
|
|
37
|
+
def to_address(self, result: const.Result):
|
|
38
|
+
return ConstResult(result)
|
|
39
|
+
|
|
40
|
+
def try_eval_const_prop(
|
|
41
|
+
self,
|
|
42
|
+
frame: ForwardFrame[Address],
|
|
43
|
+
stmt: ir.Statement,
|
|
44
|
+
args: tuple[ConstResult, ...],
|
|
45
|
+
) -> interp.StatementResult[Address]:
|
|
46
|
+
_frame = self._const_prop.initialize_frame(frame.code)
|
|
47
|
+
_frame.set_values(stmt.args, tuple(x.result for x in args))
|
|
48
|
+
result = self._const_prop.eval_stmt(_frame, stmt)
|
|
49
|
+
|
|
50
|
+
match result:
|
|
51
|
+
case interp.ReturnValue(constant_ret):
|
|
52
|
+
return interp.ReturnValue(self.to_address(constant_ret))
|
|
53
|
+
case interp.YieldValue(constant_values):
|
|
54
|
+
return interp.YieldValue(tuple(map(self.to_address, constant_values)))
|
|
55
|
+
case interp.Successor(block, block_args):
|
|
56
|
+
return interp.Successor(block, *map(self.to_address, block_args))
|
|
57
|
+
case tuple():
|
|
58
|
+
return tuple(map(self.to_address, result))
|
|
59
|
+
case _:
|
|
60
|
+
return result
|
|
61
|
+
|
|
62
|
+
def unpack_iterable(self, iterable: Address):
|
|
63
|
+
"""Extract the values of a container lattice element.
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
iterable: The lattice element representing a container.
|
|
67
|
+
|
|
68
|
+
Returns:
|
|
69
|
+
A tuple of the container type and the contained values.
|
|
70
|
+
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
def from_constant(constant: const.Result) -> Address:
|
|
74
|
+
return ConstResult(constant)
|
|
75
|
+
|
|
76
|
+
def from_literal(literal: Any) -> Address:
|
|
77
|
+
return ConstResult(const.Value(literal))
|
|
78
|
+
|
|
79
|
+
match iterable:
|
|
80
|
+
case PartialIList(data):
|
|
81
|
+
return PartialIList, data
|
|
82
|
+
case PartialTuple(data):
|
|
83
|
+
return PartialTuple, data
|
|
84
|
+
case AddressReg():
|
|
85
|
+
return PartialIList, iterable.qubits
|
|
86
|
+
case ConstResult(const.Value(IList() as data)):
|
|
87
|
+
return PartialIList, tuple(map(from_literal, data))
|
|
88
|
+
case ConstResult(const.Value(tuple() as data)):
|
|
89
|
+
return PartialTuple, tuple(map(from_literal, data))
|
|
90
|
+
case ConstResult(const.PartialTuple(data)):
|
|
91
|
+
return PartialTuple, tuple(map(from_constant, data))
|
|
92
|
+
case _:
|
|
93
|
+
return None, ()
|
|
94
|
+
|
|
95
|
+
def run_lattice(
|
|
96
|
+
self,
|
|
97
|
+
callee: Address,
|
|
98
|
+
inputs: tuple[Address, ...],
|
|
99
|
+
kwargs: tuple[str, ...],
|
|
100
|
+
) -> Address:
|
|
101
|
+
"""Run a callable lattice element with the given inputs and keyword arguments.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
callee (Address): The lattice element representing the callable.
|
|
105
|
+
inputs (tuple[Address, ...]): The input lattice elements.
|
|
106
|
+
kwargs (tuple[str, ...]): The keyword argument names.
|
|
107
|
+
|
|
108
|
+
Returns:
|
|
109
|
+
Address: The resulting lattice element after invoking the callable.
|
|
110
|
+
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
match callee:
|
|
114
|
+
case PartialLambda(code=code, argnames=argnames):
|
|
115
|
+
_, ret = self.run_callable(
|
|
116
|
+
code, (callee,) + self.permute_values(argnames, inputs, kwargs)
|
|
117
|
+
)
|
|
118
|
+
return ret
|
|
119
|
+
case ConstResult(const.Value(ir.Method() as method)):
|
|
120
|
+
_, ret = self.run_method(
|
|
121
|
+
method,
|
|
122
|
+
self.permute_values(method.arg_names, inputs, kwargs),
|
|
123
|
+
)
|
|
124
|
+
return ret
|
|
125
|
+
case _:
|
|
126
|
+
return Address.top()
|
|
127
|
+
|
|
128
|
+
def get_const_value(self, addr: Address, typ: Type[T]) -> T | None:
|
|
129
|
+
if not isinstance(addr, ConstResult):
|
|
130
|
+
return None
|
|
131
|
+
|
|
132
|
+
if not isinstance(result := addr.result, const.Value):
|
|
133
|
+
return None
|
|
134
|
+
|
|
135
|
+
if not isinstance(value := result.data, typ):
|
|
136
|
+
return None
|
|
137
|
+
|
|
138
|
+
return value
|
|
139
|
+
|
|
140
|
+
def eval_stmt_fallback(self, frame: ForwardFrame[Address], stmt: ir.Statement):
|
|
141
|
+
args = frame.get_values(stmt.args)
|
|
142
|
+
if types.is_tuple_of(args, ConstResult):
|
|
143
|
+
return self.try_eval_const_prop(frame, stmt, args)
|
|
144
|
+
|
|
145
|
+
return tuple(Address.from_type(result.type) for result in stmt.results)
|
|
146
|
+
|
|
147
|
+
def run_method(self, method: ir.Method, args: tuple[Address, ...]):
|
|
148
|
+
# NOTE: we do not support dynamic calls here, thus no need to propagate method object
|
|
149
|
+
self_mt = ConstResult(const.Value(method))
|
|
150
|
+
return self.run_callable(method.code, (self_mt,) + args)
|
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
"""
|
|
2
|
+
qubit.address method table for a few builtin dialects.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from itertools import chain
|
|
6
|
+
|
|
7
|
+
from kirin import ir, interp
|
|
8
|
+
from kirin.analysis import ForwardFrame, const
|
|
9
|
+
from kirin.dialects import cf, py, scf, func, ilist
|
|
10
|
+
|
|
11
|
+
from .lattice import (
|
|
12
|
+
Address,
|
|
13
|
+
ConstResult,
|
|
14
|
+
PartialIList,
|
|
15
|
+
PartialTuple,
|
|
16
|
+
PartialLambda,
|
|
17
|
+
)
|
|
18
|
+
from .analysis import AddressAnalysis
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@py.constant.dialect.register(key="qubit.address")
|
|
22
|
+
class PyConstant(interp.MethodTable):
|
|
23
|
+
@interp.impl(py.Constant)
|
|
24
|
+
def constant(
|
|
25
|
+
self,
|
|
26
|
+
interp_: AddressAnalysis,
|
|
27
|
+
frame: ForwardFrame[Address],
|
|
28
|
+
stmt: py.Constant,
|
|
29
|
+
):
|
|
30
|
+
return (ConstResult(const.Value(stmt.value.unwrap())),)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@py.binop.dialect.register(key="qubit.address")
|
|
34
|
+
class PyBinOp(interp.MethodTable):
|
|
35
|
+
@interp.impl(py.Add)
|
|
36
|
+
def add(
|
|
37
|
+
self,
|
|
38
|
+
interp_: AddressAnalysis,
|
|
39
|
+
frame: ForwardFrame[Address],
|
|
40
|
+
stmt: py.Add,
|
|
41
|
+
):
|
|
42
|
+
lhs = frame.get(stmt.lhs)
|
|
43
|
+
rhs = frame.get(stmt.rhs)
|
|
44
|
+
|
|
45
|
+
lhs_type, lhs_values = interp_.unpack_iterable(lhs)
|
|
46
|
+
rhs_type, rhs_values = interp_.unpack_iterable(rhs)
|
|
47
|
+
|
|
48
|
+
if lhs_type is None or rhs_type is None:
|
|
49
|
+
return (Address.top(),)
|
|
50
|
+
|
|
51
|
+
if lhs_type is not rhs_type:
|
|
52
|
+
return (Address.bottom(),)
|
|
53
|
+
|
|
54
|
+
return (lhs_type(tuple(chain(lhs_values, rhs_values))),)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
@py.tuple.dialect.register(key="qubit.address")
|
|
58
|
+
class PyTuple(interp.MethodTable):
|
|
59
|
+
@interp.impl(py.tuple.New)
|
|
60
|
+
def new_tuple(
|
|
61
|
+
self,
|
|
62
|
+
interp_: AddressAnalysis,
|
|
63
|
+
frame: ForwardFrame[Address],
|
|
64
|
+
stmt: py.tuple.New,
|
|
65
|
+
):
|
|
66
|
+
return (PartialTuple(frame.get_values(stmt.args)),)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
@ilist.dialect.register(key="qubit.address")
|
|
70
|
+
class IListMethods(interp.MethodTable):
|
|
71
|
+
@interp.impl(ilist.New)
|
|
72
|
+
def new_ilist(
|
|
73
|
+
self,
|
|
74
|
+
interp_: AddressAnalysis,
|
|
75
|
+
frame: ForwardFrame[Address],
|
|
76
|
+
stmt: ilist.New,
|
|
77
|
+
):
|
|
78
|
+
return (PartialIList(frame.get_values(stmt.args)),)
|
|
79
|
+
|
|
80
|
+
@interp.impl(ilist.ForEach)
|
|
81
|
+
@interp.impl(ilist.Map)
|
|
82
|
+
def map_(
|
|
83
|
+
self,
|
|
84
|
+
interp_: AddressAnalysis,
|
|
85
|
+
frame: ForwardFrame[Address],
|
|
86
|
+
stmt: ilist.Map | ilist.ForEach,
|
|
87
|
+
):
|
|
88
|
+
fn = frame.get(stmt.fn)
|
|
89
|
+
collection = frame.get(stmt.collection)
|
|
90
|
+
collection_type, values = interp_.unpack_iterable(collection)
|
|
91
|
+
|
|
92
|
+
if collection_type is None:
|
|
93
|
+
return (Address.top(),)
|
|
94
|
+
|
|
95
|
+
if collection_type is not PartialIList:
|
|
96
|
+
return (Address.bottom(),)
|
|
97
|
+
|
|
98
|
+
results = []
|
|
99
|
+
for ele in values:
|
|
100
|
+
ret = interp_.run_lattice(fn, (ele,), ())
|
|
101
|
+
results.append(ret)
|
|
102
|
+
|
|
103
|
+
if isinstance(stmt, ilist.Map):
|
|
104
|
+
return (PartialIList(tuple(results)),)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
@py.len.dialect.register(key="qubit.address")
|
|
108
|
+
class PyLen(interp.MethodTable):
|
|
109
|
+
@interp.impl(py.Len)
|
|
110
|
+
def len_(
|
|
111
|
+
self, interp_: AddressAnalysis, frame: ForwardFrame[Address], stmt: py.Len
|
|
112
|
+
):
|
|
113
|
+
obj = frame.get(stmt.value)
|
|
114
|
+
_, values = interp_.unpack_iterable(obj)
|
|
115
|
+
|
|
116
|
+
if values is None:
|
|
117
|
+
return (Address.top(),)
|
|
118
|
+
|
|
119
|
+
return (ConstResult(const.Value(len(values))),)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
@py.indexing.dialect.register(key="qubit.address")
|
|
123
|
+
class PyIndexing(interp.MethodTable):
|
|
124
|
+
@interp.impl(py.GetItem)
|
|
125
|
+
def getitem(
|
|
126
|
+
self,
|
|
127
|
+
interp_: AddressAnalysis,
|
|
128
|
+
frame: ForwardFrame[Address],
|
|
129
|
+
stmt: py.GetItem,
|
|
130
|
+
):
|
|
131
|
+
# determine if the index is an int constant
|
|
132
|
+
# or a slice
|
|
133
|
+
obj = frame.get(stmt.obj)
|
|
134
|
+
index = frame.get(stmt.index)
|
|
135
|
+
|
|
136
|
+
typ, values = interp_.unpack_iterable(obj)
|
|
137
|
+
if typ is None:
|
|
138
|
+
return (Address.top(),)
|
|
139
|
+
|
|
140
|
+
int_index = interp_.get_const_value(index, int)
|
|
141
|
+
if int_index is not None:
|
|
142
|
+
return (values[int_index],)
|
|
143
|
+
|
|
144
|
+
slice_index = interp_.get_const_value(index, slice)
|
|
145
|
+
if slice_index is not None:
|
|
146
|
+
return (typ(values[slice_index]),)
|
|
147
|
+
|
|
148
|
+
return (Address.top(),)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
@py.assign.dialect.register(key="qubit.address")
|
|
152
|
+
class PyAssign(interp.MethodTable):
|
|
153
|
+
@interp.impl(py.Alias)
|
|
154
|
+
def alias(
|
|
155
|
+
self,
|
|
156
|
+
interp: AddressAnalysis,
|
|
157
|
+
frame: ForwardFrame[Address],
|
|
158
|
+
stmt: py.Alias,
|
|
159
|
+
):
|
|
160
|
+
return (frame.get(stmt.value),)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
# TODO: look for abstract method table for func.
|
|
164
|
+
@func.dialect.register(key="qubit.address")
|
|
165
|
+
class Func(interp.MethodTable):
|
|
166
|
+
@interp.impl(func.Return)
|
|
167
|
+
def return_(
|
|
168
|
+
self,
|
|
169
|
+
_: AddressAnalysis,
|
|
170
|
+
frame: ForwardFrame[Address],
|
|
171
|
+
stmt: func.Return,
|
|
172
|
+
):
|
|
173
|
+
return interp.ReturnValue(frame.get(stmt.value))
|
|
174
|
+
|
|
175
|
+
# TODO: replace with the generic implementation
|
|
176
|
+
@interp.impl(func.Invoke)
|
|
177
|
+
def invoke(
|
|
178
|
+
self,
|
|
179
|
+
interp_: AddressAnalysis,
|
|
180
|
+
frame: ForwardFrame[Address],
|
|
181
|
+
stmt: func.Invoke,
|
|
182
|
+
):
|
|
183
|
+
|
|
184
|
+
args = interp_.permute_values(
|
|
185
|
+
stmt.callee.arg_names, frame.get_values(stmt.inputs), stmt.kwargs
|
|
186
|
+
)
|
|
187
|
+
_, ret = interp_.run_method(
|
|
188
|
+
stmt.callee,
|
|
189
|
+
args,
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
return (ret,)
|
|
193
|
+
|
|
194
|
+
@interp.impl(func.Lambda)
|
|
195
|
+
def lambda_(
|
|
196
|
+
self,
|
|
197
|
+
inter_: AddressAnalysis,
|
|
198
|
+
frame: ForwardFrame[Address],
|
|
199
|
+
stmt: func.Lambda,
|
|
200
|
+
):
|
|
201
|
+
arg_names = [
|
|
202
|
+
arg.name or str(idx) for idx, arg in enumerate(stmt.body.blocks[0].args)
|
|
203
|
+
]
|
|
204
|
+
return (
|
|
205
|
+
PartialLambda(
|
|
206
|
+
arg_names,
|
|
207
|
+
stmt,
|
|
208
|
+
frame.get_values(stmt.captured),
|
|
209
|
+
),
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
@interp.impl(func.Call)
|
|
213
|
+
def call(
|
|
214
|
+
self,
|
|
215
|
+
interp_: AddressAnalysis,
|
|
216
|
+
frame: ForwardFrame[Address],
|
|
217
|
+
stmt: func.Call,
|
|
218
|
+
):
|
|
219
|
+
result = interp_.run_lattice(
|
|
220
|
+
frame.get(stmt.callee),
|
|
221
|
+
frame.get_values(stmt.inputs),
|
|
222
|
+
stmt.kwargs,
|
|
223
|
+
)
|
|
224
|
+
return (result,)
|
|
225
|
+
|
|
226
|
+
@interp.impl(func.GetField)
|
|
227
|
+
def get_field(
|
|
228
|
+
self,
|
|
229
|
+
interp_: AddressAnalysis,
|
|
230
|
+
frame: ForwardFrame[Address],
|
|
231
|
+
stmt: func.GetField,
|
|
232
|
+
):
|
|
233
|
+
self_mt = frame.get(stmt.obj)
|
|
234
|
+
match self_mt:
|
|
235
|
+
case PartialLambda(captured=captured):
|
|
236
|
+
return (captured[stmt.field],)
|
|
237
|
+
case ConstResult(const.Value(ir.Method() as mt)):
|
|
238
|
+
return (ConstResult(const.Value(mt.fields[stmt.field])),)
|
|
239
|
+
|
|
240
|
+
return (Address.top(),)
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
@cf.dialect.register(key="qubit.address")
|
|
244
|
+
class Cf(interp.MethodTable):
|
|
245
|
+
|
|
246
|
+
@interp.impl(cf.Branch)
|
|
247
|
+
def branch(
|
|
248
|
+
self,
|
|
249
|
+
interp_: AddressAnalysis,
|
|
250
|
+
frame: ForwardFrame[Address],
|
|
251
|
+
stmt: cf.Branch,
|
|
252
|
+
):
|
|
253
|
+
frame.worklist.append(
|
|
254
|
+
interp.Successor(stmt.successor, *frame.get_values(stmt.arguments))
|
|
255
|
+
)
|
|
256
|
+
return ()
|
|
257
|
+
|
|
258
|
+
@interp.impl(cf.ConditionalBranch)
|
|
259
|
+
def conditional_branch(
|
|
260
|
+
self,
|
|
261
|
+
interp_: const.Propagate,
|
|
262
|
+
frame: ForwardFrame[Address],
|
|
263
|
+
stmt: cf.ConditionalBranch,
|
|
264
|
+
):
|
|
265
|
+
address_cond = frame.get(stmt.cond)
|
|
266
|
+
|
|
267
|
+
if isinstance(address_cond, ConstResult) and isinstance(
|
|
268
|
+
cond := address_cond.result, const.Value
|
|
269
|
+
):
|
|
270
|
+
else_successor = interp.Successor(
|
|
271
|
+
stmt.else_successor, *frame.get_values(stmt.else_arguments)
|
|
272
|
+
)
|
|
273
|
+
then_successor = interp.Successor(
|
|
274
|
+
stmt.then_successor, *frame.get_values(stmt.then_arguments)
|
|
275
|
+
)
|
|
276
|
+
if cond.data:
|
|
277
|
+
frame.worklist.append(then_successor)
|
|
278
|
+
else:
|
|
279
|
+
frame.worklist.append(else_successor)
|
|
280
|
+
else:
|
|
281
|
+
frame.entries[stmt.cond] = ConstResult(const.Value(True))
|
|
282
|
+
then_successor = interp.Successor(
|
|
283
|
+
stmt.then_successor, *frame.get_values(stmt.then_arguments)
|
|
284
|
+
)
|
|
285
|
+
frame.worklist.append(then_successor)
|
|
286
|
+
|
|
287
|
+
frame.entries[stmt.cond] = ConstResult(const.Value(False))
|
|
288
|
+
else_successor = interp.Successor(
|
|
289
|
+
stmt.else_successor, *frame.get_values(stmt.else_arguments)
|
|
290
|
+
)
|
|
291
|
+
frame.worklist.append(else_successor)
|
|
292
|
+
|
|
293
|
+
frame.entries[stmt.cond] = address_cond
|
|
294
|
+
return ()
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
@scf.dialect.register(key="qubit.address")
|
|
298
|
+
class Scf(interp.MethodTable):
|
|
299
|
+
@interp.impl(scf.Yield)
|
|
300
|
+
def yield_(
|
|
301
|
+
self,
|
|
302
|
+
interp_: AddressAnalysis,
|
|
303
|
+
frame: ForwardFrame[Address],
|
|
304
|
+
stmt: scf.Yield,
|
|
305
|
+
):
|
|
306
|
+
return interp.YieldValue(frame.get_values(stmt.values))
|
|
307
|
+
|
|
308
|
+
@interp.impl(scf.IfElse)
|
|
309
|
+
def ifelse(
|
|
310
|
+
self,
|
|
311
|
+
interp_: AddressAnalysis,
|
|
312
|
+
frame: ForwardFrame[Address],
|
|
313
|
+
stmt: scf.IfElse,
|
|
314
|
+
):
|
|
315
|
+
address_cond = frame.get(stmt.cond)
|
|
316
|
+
# run specific branch
|
|
317
|
+
if isinstance(address_cond, ConstResult) and isinstance(
|
|
318
|
+
const_cond := address_cond.result, const.Value
|
|
319
|
+
):
|
|
320
|
+
body = stmt.then_body if const_cond.data else stmt.else_body
|
|
321
|
+
with interp_.new_frame(stmt, has_parent_access=True) as body_frame:
|
|
322
|
+
ret = interp_.run_ssacfg_region(body_frame, body, (address_cond,))
|
|
323
|
+
# interp_.set_values(frame, body_frame.entries.keys(), body_frame.entries.values())
|
|
324
|
+
return ret
|
|
325
|
+
else:
|
|
326
|
+
# run both branches
|
|
327
|
+
with interp_.new_frame(stmt, has_parent_access=True) as then_frame:
|
|
328
|
+
then_results = interp_.run_ssacfg_region(
|
|
329
|
+
then_frame, stmt.then_body, (address_cond,)
|
|
330
|
+
)
|
|
331
|
+
interp_.set_values(
|
|
332
|
+
frame, then_frame.entries.keys(), then_frame.entries.values()
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
with interp_.new_frame(stmt, has_parent_access=True) as else_frame:
|
|
336
|
+
else_results = interp_.run_ssacfg_region(
|
|
337
|
+
else_frame, stmt.else_body, (address_cond,)
|
|
338
|
+
)
|
|
339
|
+
interp_.set_values(
|
|
340
|
+
frame, else_frame.entries.keys(), else_frame.entries.values()
|
|
341
|
+
)
|
|
342
|
+
# TODO: pick the non-return value
|
|
343
|
+
if isinstance(then_results, interp.ReturnValue) and isinstance(
|
|
344
|
+
else_results, interp.ReturnValue
|
|
345
|
+
):
|
|
346
|
+
return interp.ReturnValue(then_results.value.join(else_results.value))
|
|
347
|
+
elif isinstance(then_results, interp.ReturnValue):
|
|
348
|
+
ret = else_results
|
|
349
|
+
elif isinstance(else_results, interp.ReturnValue):
|
|
350
|
+
ret = then_results
|
|
351
|
+
else:
|
|
352
|
+
ret = interp_.join_results(then_results, else_results)
|
|
353
|
+
|
|
354
|
+
return ret
|
|
355
|
+
|
|
356
|
+
@interp.impl(scf.For)
|
|
357
|
+
def for_loop(
|
|
358
|
+
self,
|
|
359
|
+
interp_: AddressAnalysis,
|
|
360
|
+
frame: ForwardFrame[Address],
|
|
361
|
+
stmt: scf.For,
|
|
362
|
+
):
|
|
363
|
+
loop_vars = frame.get_values(stmt.initializers)
|
|
364
|
+
iter_type, iterable = interp_.unpack_iterable(frame.get(stmt.iterable))
|
|
365
|
+
|
|
366
|
+
if iter_type is None:
|
|
367
|
+
return interp_.eval_stmt_fallback(frame, stmt)
|
|
368
|
+
|
|
369
|
+
for value in iterable:
|
|
370
|
+
with interp_.new_frame(stmt, has_parent_access=True) as body_frame:
|
|
371
|
+
loop_vars = interp_.run_ssacfg_region(
|
|
372
|
+
body_frame, stmt.body, (value,) + loop_vars
|
|
373
|
+
)
|
|
374
|
+
|
|
375
|
+
if loop_vars is None:
|
|
376
|
+
loop_vars = ()
|
|
377
|
+
|
|
378
|
+
elif isinstance(loop_vars, interp.ReturnValue):
|
|
379
|
+
return loop_vars
|
|
380
|
+
|
|
381
|
+
return loop_vars
|