bloqade-circuit 0.4.1__tar.gz → 0.4.2__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.4.1 → bloqade_circuit-0.4.2}/PKG-INFO +1 -1
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/pyproject.toml +1 -1
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/parse/lowering.py +67 -73
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/pyqrack/squin/test_noise.py +1 -1
- bloqade_circuit-0.4.2/test/qasm2/test_lowering.py +165 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/uv.lock +1 -1
- bloqade_circuit-0.4.1/test/qasm2/test_lowering.py +0 -79
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/.github/dependabot.yml +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/.github/workflows/ci.yml +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/.github/workflows/isort.yml +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/.github/workflows/lint.yml +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/.github/workflows/release.yml +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/.gitignore +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/.pre-commit-config.yaml +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/LICENSE +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/README.md +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/_typos.toml +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/justfile +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/analysis/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/analysis/address/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/analysis/address/analysis.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/analysis/address/impls.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/analysis/address/lattice.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/analysis/fidelity/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/analysis/fidelity/analysis.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/device.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/base.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/device.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/noise/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/noise/native.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/qasm2/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/qasm2/core.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/qasm2/glob.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/qasm2/parallel.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/qasm2/uop.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/reg.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/squin/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/squin/noise/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/squin/noise/native.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/squin/op.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/squin/qubit.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/squin/runtime.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/squin/wire.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/target.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/pyqrack/task.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/_qasm_loading.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/_wrappers.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/core/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/core/_dialect.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/core/_emit.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/core/_typeinfer.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/core/address.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/core/stmts.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/expr/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/expr/_dialect.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/expr/_emit.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/expr/_from_python.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/expr/_interp.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/expr/stmts.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/glob.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/indexing.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/inline.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/noise/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/noise/_dialect.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/noise/fidelity.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/noise/model.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/noise/stmts.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/parallel.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/uop/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/uop/_dialect.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/uop/_emit.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/uop/schedule.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/uop/stmts.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/emit/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/emit/base.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/emit/gate.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/emit/impls/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/emit/impls/noise.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/emit/main.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/emit/target.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/glob.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/groups.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/noise.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/parallel.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/parse/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/parse/ast.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/parse/build.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/parse/parser.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/parse/print.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/parse/qasm2.lark +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/parse/visitor.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/parse/visitor.pyi +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/passes/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/passes/fold.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/passes/glob.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/passes/lift_qubits.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/passes/noise.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/passes/parallel.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/passes/py2qasm.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/passes/qasm2py.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/passes/unroll_if.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/rewrite/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/rewrite/desugar.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/rewrite/glob.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/rewrite/insert_qubits.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/rewrite/native_gates.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/rewrite/noise/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/rewrite/noise/heuristic_noise.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/rewrite/noise/remove_noise.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/rewrite/parallel_to_uop.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/rewrite/register.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/rewrite/split_ifs.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/rewrite/uop_to_parallel.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/types.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qbraid/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qbraid/lowering.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qbraid/schema.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qbraid/simulation_result.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qbraid/target.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/analysis/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/analysis/nsites/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/analysis/nsites/analysis.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/analysis/nsites/impls.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/analysis/nsites/lattice.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/analysis/schedule.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/cirq/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/cirq/lowering.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/groups.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/lowering.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/noise/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/noise/_dialect.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/noise/_wrapper.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/noise/rewrite.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/noise/stmts.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/op/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/op/_dialect.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/op/_wrapper.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/op/number.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/op/rewrite.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/op/stdlib.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/op/stmts.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/op/traits.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/op/types.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/passes/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/passes/stim.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/qubit.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/rewrite/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/rewrite/desugar.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/rewrite/qubit_to_stim.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/rewrite/squin_measure.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/rewrite/stim_rewrite_util.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/rewrite/wire_identity_elimination.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/rewrite/wire_to_stim.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/rewrite/wrap_analysis.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/squin/wire.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/_wrappers.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/auxiliary/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/auxiliary/_dialect.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/auxiliary/emit.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/auxiliary/interp.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/auxiliary/lowering.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/auxiliary/stmts/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/auxiliary/stmts/annotate.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/auxiliary/stmts/const.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/auxiliary/types.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/collapse/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/collapse/_dialect.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/collapse/emit_str.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/collapse/stmts/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/collapse/stmts/measure.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/collapse/stmts/pp_measure.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/collapse/stmts/reset.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/gate/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/gate/_dialect.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/gate/emit.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/gate/stmts/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/gate/stmts/base.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/gate/stmts/clifford_1q.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/gate/stmts/clifford_2q.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/gate/stmts/control_2q.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/gate/stmts/pp.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/noise/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/noise/_dialect.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/noise/emit.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/dialects/noise/stmts.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/emit/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/emit/stim_str.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/groups.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/parse/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/stim/parse/lowering.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/task.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/test_utils.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/types.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/visual/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/visual/animation/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/visual/animation/animate.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/visual/animation/base.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/visual/animation/gate_event.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/visual/animation/runtime/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/visual/animation/runtime/aod.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/visual/animation/runtime/atoms.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/visual/animation/runtime/ppoly.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/visual/animation/runtime/qpustate.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/visual/animation/runtime/utils.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/analysis/address/test_analysis.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/analysis/address/test_lattice.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/analysis/fidelity/test_fidelity.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/pyqrack/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/pyqrack/runtime/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/pyqrack/runtime/noise/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/pyqrack/runtime/noise/qasm2/test_loss.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/pyqrack/runtime/noise/qasm2/test_pauli.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/pyqrack/runtime/test_dyn_memory.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/pyqrack/runtime/test_qrack.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/pyqrack/squin/test_kernel.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/pyqrack/test_target.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/analysis/test_dag.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/emit/test_extended.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/emit/test_extended_noise.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/emit/test_qasm2.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/emit/test_qasm2_emit.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/invalid_programs/invalid_if.qasm +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/programs/README.md +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/programs/global.qasm +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/programs/iqft1.qasm +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/programs/main.qasm +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/programs/noise.qasm +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/programs/para.qasm +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/programs/process_tomo.qasm +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/programs/qelib1.inc +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/programs/qft.qasm +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/programs/qft2.qasm +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/programs/rb.qasm +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/programs/rep_code.qasm +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/programs/ripple_carry_adder.qasm +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/programs/tele.qasm +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/programs/valid_if.qasm +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/test_ast.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/parse/test_roundtrip.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/passes/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/passes/test_global_to_parallel.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/passes/test_global_to_uop.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/passes/test_heuristic_noise.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/passes/test_parallel_to_uop.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/passes/test_qasm2py.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/passes/test_unroll_if.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/passes/test_uop_to_parallel.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/test_count.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/test_inline.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/test_native.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qasm2/test_two2one.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qbraid/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qbraid/test_clean_circuit.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qbraid/test_lowering.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/qbraid/test_target.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/sample/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/sample/test_noise_model.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/squin/analysis/test_nsites_analysis.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/squin/cirq/test_cirq_to_squin.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/squin/op/test_reset.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/squin/stim/test_stim.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/squin/test_constprop.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/squin/test_mult_rewrite.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/squin/test_sugar.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/dialects/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/dialects/stim/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/dialects/stim/emit/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/dialects/stim/emit/base.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/dialects/stim/emit/test_stim_1q.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/dialects/stim/emit/test_stim_ctrl.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/dialects/stim/emit/test_stim_detector.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/dialects/stim/emit/test_stim_meas.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/dialects/stim/emit/test_stim_noise.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/dialects/stim/emit/test_stim_obs_inc.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/dialects/stim/emit/test_stim_ppmeas.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/dialects/stim/emit/test_stim_qubit_coords.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/dialects/stim/emit/test_stim_spp.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/dialects/stim/test_stim_circuits.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/dialects/stim/test_stim_const.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/parse/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/parse/base.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/parse/test_parse.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/parse/test_parse_clifford.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/parse/test_parse_control.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/parse/test_parse_custom.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/parse/test_parse_noise.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/parse/test_parse_spp.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/wrapper/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/stim/wrapper/test_wrapper.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/test_serialization.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/test_zone_model.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/visual/__init__.py +0 -0
- {bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/test/visual/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bloqade-circuit
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
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
|
|
@@ -2,9 +2,9 @@ from typing import Any
|
|
|
2
2
|
from dataclasses import field, dataclass
|
|
3
3
|
|
|
4
4
|
from kirin import ir, types, lowering
|
|
5
|
-
from kirin.dialects import cf, func, ilist
|
|
5
|
+
from kirin.dialects import cf, scf, func, ilist
|
|
6
6
|
|
|
7
|
-
from bloqade.qasm2.types import CRegType, QRegType
|
|
7
|
+
from bloqade.qasm2.types import CRegType, QRegType, QubitType
|
|
8
8
|
from bloqade.qasm2.dialects import uop, core, expr, glob, noise, parallel
|
|
9
9
|
|
|
10
10
|
from . import ast
|
|
@@ -101,6 +101,13 @@ class QASM2(lowering.LoweringABC[ast.Node]):
|
|
|
101
101
|
def lower_global(
|
|
102
102
|
self, state: lowering.State[ast.Node], node: ast.Node
|
|
103
103
|
) -> lowering.LoweringABC.Result:
|
|
104
|
+
if isinstance(node, ast.Name):
|
|
105
|
+
# NOTE: might be a lookup for a gate function invoke
|
|
106
|
+
try:
|
|
107
|
+
return lowering.LoweringABC.Result(state.current_frame.globals[node.id])
|
|
108
|
+
except KeyError:
|
|
109
|
+
pass
|
|
110
|
+
|
|
104
111
|
raise lowering.BuildError("Global variables are not supported in QASM 2.0")
|
|
105
112
|
|
|
106
113
|
def visit_MainProgram(self, state: lowering.State[ast.Node], node: ast.MainProgram):
|
|
@@ -171,7 +178,6 @@ class QASM2(lowering.LoweringABC[ast.Node]):
|
|
|
171
178
|
def visit_Reset(self, state: lowering.State[ast.Node], node: ast.Reset):
|
|
172
179
|
state.current_frame.push(core.Reset(qarg=state.lower(node.qarg).expect_one()))
|
|
173
180
|
|
|
174
|
-
# TODO: clean this up? copied from cf dialect with a small modification
|
|
175
181
|
def visit_IfStmt(self, state: lowering.State[ast.Node], node: ast.IfStmt):
|
|
176
182
|
cond_stmt = core.CRegEq(
|
|
177
183
|
lhs=state.lower(node.cond.lhs).expect_one(),
|
|
@@ -179,84 +185,23 @@ class QASM2(lowering.LoweringABC[ast.Node]):
|
|
|
179
185
|
)
|
|
180
186
|
cond = state.current_frame.push(cond_stmt).result
|
|
181
187
|
frame = state.current_frame
|
|
182
|
-
before_block = frame.curr_block
|
|
183
188
|
|
|
184
|
-
with state.frame(node.body
|
|
189
|
+
with state.frame(node.body) as if_frame:
|
|
185
190
|
true_cond = if_frame.entr_block.args.append_from(types.Bool, cond.name)
|
|
186
191
|
if cond.name:
|
|
187
192
|
if_frame.defs[cond.name] = true_cond
|
|
188
193
|
|
|
194
|
+
# NOTE: pass in definitions from outer scope (usually just for the qreg)
|
|
195
|
+
if_frame.defs.update(frame.defs)
|
|
196
|
+
|
|
189
197
|
if_frame.exhaust()
|
|
190
|
-
self.branch_next_if_not_terminated(if_frame)
|
|
191
198
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
if cond.name:
|
|
195
|
-
else_frame.defs[cond.name] = true_cond
|
|
196
|
-
else_frame.exhaust()
|
|
197
|
-
self.branch_next_if_not_terminated(else_frame)
|
|
198
|
-
|
|
199
|
-
with state.frame(frame.stream.split(), region=frame.curr_region) as after_frame:
|
|
200
|
-
after_frame.defs.update(frame.defs)
|
|
201
|
-
phi: set[str] = set()
|
|
202
|
-
for name in if_frame.defs.keys():
|
|
203
|
-
if frame.get(name):
|
|
204
|
-
phi.add(name)
|
|
205
|
-
elif name in else_frame.defs:
|
|
206
|
-
phi.add(name)
|
|
207
|
-
|
|
208
|
-
for name in else_frame.defs.keys():
|
|
209
|
-
if frame.get(name): # not defined in if_frame
|
|
210
|
-
phi.add(name)
|
|
211
|
-
|
|
212
|
-
for name in phi:
|
|
213
|
-
after_frame.defs[name] = after_frame.entr_block.args.append_from(
|
|
214
|
-
types.Any, name
|
|
215
|
-
)
|
|
199
|
+
# NOTE: qasm2 can never yield anything from if
|
|
200
|
+
if_frame.push(scf.Yield())
|
|
216
201
|
|
|
217
|
-
|
|
218
|
-
self.branch_next_if_not_terminated(after_frame)
|
|
219
|
-
after_frame.next_block.stmts.append(
|
|
220
|
-
cf.Branch(arguments=(), successor=frame.next_block)
|
|
221
|
-
)
|
|
202
|
+
then_body = if_frame.curr_region
|
|
222
203
|
|
|
223
|
-
|
|
224
|
-
for name in phi:
|
|
225
|
-
if value := if_frame.get(name):
|
|
226
|
-
if_args.append(value)
|
|
227
|
-
else:
|
|
228
|
-
raise lowering.BuildError(f"undefined variable {name} in if branch")
|
|
229
|
-
|
|
230
|
-
else_args = []
|
|
231
|
-
for name in phi:
|
|
232
|
-
if value := else_frame.get(name):
|
|
233
|
-
else_args.append(value)
|
|
234
|
-
else:
|
|
235
|
-
raise lowering.BuildError(f"undefined variable {name} in else branch")
|
|
236
|
-
|
|
237
|
-
if_frame.next_block.stmts.append(
|
|
238
|
-
cf.Branch(
|
|
239
|
-
arguments=tuple(if_args),
|
|
240
|
-
successor=after_frame.entr_block,
|
|
241
|
-
)
|
|
242
|
-
)
|
|
243
|
-
else_frame.next_block.stmts.append(
|
|
244
|
-
cf.Branch(
|
|
245
|
-
arguments=tuple(else_args),
|
|
246
|
-
successor=after_frame.entr_block,
|
|
247
|
-
)
|
|
248
|
-
)
|
|
249
|
-
before_block.stmts.append(
|
|
250
|
-
cf.ConditionalBranch(
|
|
251
|
-
cond=cond,
|
|
252
|
-
then_arguments=(cond,),
|
|
253
|
-
then_successor=if_frame.entr_block,
|
|
254
|
-
else_arguments=(cond,),
|
|
255
|
-
else_successor=else_frame.entr_block,
|
|
256
|
-
)
|
|
257
|
-
)
|
|
258
|
-
frame.defs.update(after_frame.defs)
|
|
259
|
-
frame.jump_next_block()
|
|
204
|
+
state.current_frame.push(scf.IfElse(cond, then_body=then_body))
|
|
260
205
|
|
|
261
206
|
def branch_next_if_not_terminated(self, frame: lowering.Frame):
|
|
262
207
|
"""Branch to the next block if the current block is not terminated.
|
|
@@ -430,7 +375,56 @@ class QASM2(lowering.LoweringABC[ast.Node]):
|
|
|
430
375
|
raise lowering.BuildError(f"Include {node.filename} not found")
|
|
431
376
|
|
|
432
377
|
def visit_Gate(self, state: lowering.State[ast.Node], node: ast.Gate):
|
|
433
|
-
|
|
378
|
+
arg_names = node.cparams + node.qparams
|
|
379
|
+
arg_types = [types.Float for _ in node.cparams] + [
|
|
380
|
+
QubitType for _ in node.qparams
|
|
381
|
+
]
|
|
382
|
+
|
|
383
|
+
with state.frame(
|
|
384
|
+
stmts=node.body,
|
|
385
|
+
finalize_next=False,
|
|
386
|
+
) as body_frame:
|
|
387
|
+
# NOTE: insert _self as arg
|
|
388
|
+
body_frame.curr_block.args.append_from(
|
|
389
|
+
types.Generic(
|
|
390
|
+
ir.Method, types.Tuple.where(tuple(arg_types)), types.NoneType
|
|
391
|
+
),
|
|
392
|
+
name=node.name + "_self",
|
|
393
|
+
)
|
|
394
|
+
|
|
395
|
+
for arg_type, arg_name in zip(arg_types, arg_names):
|
|
396
|
+
# NOTE: append args as block arguments
|
|
397
|
+
block_arg = body_frame.curr_block.args.append_from(
|
|
398
|
+
arg_type, name=arg_name
|
|
399
|
+
)
|
|
400
|
+
|
|
401
|
+
# NOTE: add arguments as definitions to frame
|
|
402
|
+
body_frame.defs[arg_name] = block_arg
|
|
403
|
+
|
|
404
|
+
body_frame.exhaust()
|
|
405
|
+
|
|
406
|
+
# NOTE: append none as return value
|
|
407
|
+
return_val = func.ConstantNone()
|
|
408
|
+
body_frame.push(return_val)
|
|
409
|
+
body_frame.push(func.Return(return_val))
|
|
410
|
+
|
|
411
|
+
body = body_frame.curr_region
|
|
412
|
+
|
|
413
|
+
gate_func = expr.GateFunction(
|
|
414
|
+
sym_name=node.name,
|
|
415
|
+
signature=func.Signature(inputs=tuple(arg_types), output=types.NoneType),
|
|
416
|
+
body=body,
|
|
417
|
+
)
|
|
418
|
+
|
|
419
|
+
mt = ir.Method(
|
|
420
|
+
mod=None,
|
|
421
|
+
py_func=None,
|
|
422
|
+
sym_name=node.name,
|
|
423
|
+
dialects=self.dialects,
|
|
424
|
+
arg_names=[*node.cparams, *node.qparams],
|
|
425
|
+
code=gate_func,
|
|
426
|
+
)
|
|
427
|
+
state.current_frame.globals[node.name] = mt
|
|
434
428
|
|
|
435
429
|
def visit_Instruction(self, state: lowering.State[ast.Node], node: ast.Instruction):
|
|
436
430
|
params = [state.lower(param).expect_one() for param in node.params]
|
|
@@ -137,7 +137,7 @@ def test_pp_error():
|
|
|
137
137
|
zero_avg /= len(result)
|
|
138
138
|
|
|
139
139
|
# should be approximately 10% since that is the bit flip error probability in the kernel above
|
|
140
|
-
assert 0.
|
|
140
|
+
assert 0.0 < zero_avg < 0.25
|
|
141
141
|
|
|
142
142
|
|
|
143
143
|
def test_depolarize():
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import math
|
|
2
|
+
import pathlib
|
|
3
|
+
import tempfile
|
|
4
|
+
import textwrap
|
|
5
|
+
|
|
6
|
+
from kirin import ir, types
|
|
7
|
+
from kirin.dialects import func
|
|
8
|
+
|
|
9
|
+
from bloqade import qasm2
|
|
10
|
+
from bloqade.qasm2.parse.lowering import QASM2
|
|
11
|
+
|
|
12
|
+
lines = textwrap.dedent(
|
|
13
|
+
"""
|
|
14
|
+
OPENQASM 2.0;
|
|
15
|
+
|
|
16
|
+
qreg q[2];
|
|
17
|
+
creg c[2];
|
|
18
|
+
|
|
19
|
+
h q[0];
|
|
20
|
+
CX q[0], q[1];
|
|
21
|
+
barrier q[0], q[1];
|
|
22
|
+
CX q[0], q[1];
|
|
23
|
+
rx(pi/2) q[0];
|
|
24
|
+
"""
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def test_run_lowering():
|
|
29
|
+
ast = qasm2.parse.loads(lines)
|
|
30
|
+
code = QASM2(qasm2.main).run(ast)
|
|
31
|
+
code.print()
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def test_loadfile():
|
|
35
|
+
|
|
36
|
+
with tempfile.TemporaryDirectory() as tmp_dir:
|
|
37
|
+
with open(f"{tmp_dir}/test.qasm", "w") as f:
|
|
38
|
+
f.write(lines)
|
|
39
|
+
|
|
40
|
+
file = pathlib.Path(f"{tmp_dir}/test.qasm")
|
|
41
|
+
qasm2.loadfile(file)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def test_negative_lowering():
|
|
45
|
+
|
|
46
|
+
mwe = """
|
|
47
|
+
OPENQASM 2.0;
|
|
48
|
+
include "qelib1.inc";
|
|
49
|
+
qreg q[1];
|
|
50
|
+
rz(-0.2) q[0];
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
entry = qasm2.loads(mwe)
|
|
54
|
+
|
|
55
|
+
body = ir.Region(
|
|
56
|
+
ir.Block(
|
|
57
|
+
[
|
|
58
|
+
(size := qasm2.expr.ConstInt(value=1)),
|
|
59
|
+
(qreg := qasm2.core.QRegNew(n_qubits=size.result)),
|
|
60
|
+
(phi := qasm2.expr.ConstFloat(value=0.2)),
|
|
61
|
+
(theta := qasm2.expr.Neg(phi.result)),
|
|
62
|
+
(idx := qasm2.expr.ConstInt(value=0)),
|
|
63
|
+
(qubit := qasm2.core.QRegGet(qreg.result, idx.result)),
|
|
64
|
+
(qasm2.uop.RZ(qubit.result, theta.result)),
|
|
65
|
+
(none := func.ConstantNone()),
|
|
66
|
+
(func.Return(none.result)),
|
|
67
|
+
]
|
|
68
|
+
)
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
code = func.Function(
|
|
72
|
+
sym_name="main",
|
|
73
|
+
signature=func.Signature((), types.NoneType),
|
|
74
|
+
body=body,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
code.print()
|
|
78
|
+
entry.print()
|
|
79
|
+
|
|
80
|
+
assert entry.code.is_structurally_equal(code)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def test_gate():
|
|
84
|
+
qasm2_prog = textwrap.dedent(
|
|
85
|
+
"""
|
|
86
|
+
OPENQASM 2.0;
|
|
87
|
+
include "qelib1.inc";
|
|
88
|
+
qreg q[2];
|
|
89
|
+
gate custom_gate q1, q2 {
|
|
90
|
+
cx q1, q2;
|
|
91
|
+
}
|
|
92
|
+
h q[0];
|
|
93
|
+
custom_gate q[0], q[1];
|
|
94
|
+
"""
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
main = qasm2.loads(qasm2_prog, compactify=False)
|
|
98
|
+
|
|
99
|
+
main.print()
|
|
100
|
+
|
|
101
|
+
from bloqade.pyqrack import StackMemorySimulator
|
|
102
|
+
|
|
103
|
+
target = StackMemorySimulator(min_qubits=2)
|
|
104
|
+
ket = target.state_vector(main)
|
|
105
|
+
|
|
106
|
+
assert ket[1] == ket[2] == 0
|
|
107
|
+
assert math.isclose(abs(ket[0]) ** 2, 0.5, abs_tol=1e-6)
|
|
108
|
+
assert math.isclose(abs(ket[3]) ** 2, 0.5, abs_tol=1e-6)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def test_gate_with_params():
|
|
112
|
+
qasm2_prog = textwrap.dedent(
|
|
113
|
+
"""
|
|
114
|
+
OPENQASM 2.0;
|
|
115
|
+
include "qelib1.inc";
|
|
116
|
+
qreg q[2];
|
|
117
|
+
h q[1];
|
|
118
|
+
gate custom_gate(theta) q1, q2 {
|
|
119
|
+
u(theta, 0, 0) q1;
|
|
120
|
+
cx q1, q2;
|
|
121
|
+
}
|
|
122
|
+
h q[1];
|
|
123
|
+
custom_gate(1.5707963267948966) q[0], q[1];
|
|
124
|
+
"""
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
main = qasm2.loads(qasm2_prog, compactify=False)
|
|
128
|
+
|
|
129
|
+
main.print()
|
|
130
|
+
|
|
131
|
+
from bloqade.pyqrack import StackMemorySimulator
|
|
132
|
+
|
|
133
|
+
target = StackMemorySimulator(min_qubits=2)
|
|
134
|
+
ket = target.state_vector(main)
|
|
135
|
+
|
|
136
|
+
assert ket[1] == ket[2] == 0
|
|
137
|
+
assert math.isclose(abs(ket[0]) ** 2, 0.5, abs_tol=1e-6)
|
|
138
|
+
assert math.isclose(abs(ket[3]) ** 2, 0.5, abs_tol=1e-6)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def test_if_lowering():
|
|
142
|
+
|
|
143
|
+
qasm2_prog = textwrap.dedent(
|
|
144
|
+
"""
|
|
145
|
+
OPENQASM 2.0;
|
|
146
|
+
include "qelib1.inc";
|
|
147
|
+
qreg q[1];
|
|
148
|
+
creg c[1];
|
|
149
|
+
if(c == 1) x q[0];
|
|
150
|
+
"""
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
main = qasm2.loads(qasm2_prog)
|
|
154
|
+
|
|
155
|
+
main.print()
|
|
156
|
+
|
|
157
|
+
@qasm2.main
|
|
158
|
+
def main2():
|
|
159
|
+
q = qasm2.qreg(1)
|
|
160
|
+
c = qasm2.creg(1)
|
|
161
|
+
|
|
162
|
+
if c == 1:
|
|
163
|
+
qasm2.x(q[0])
|
|
164
|
+
|
|
165
|
+
main2.print()
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import pathlib
|
|
2
|
-
import tempfile
|
|
3
|
-
import textwrap
|
|
4
|
-
|
|
5
|
-
from kirin import ir, types
|
|
6
|
-
from kirin.dialects import func
|
|
7
|
-
|
|
8
|
-
from bloqade import qasm2
|
|
9
|
-
from bloqade.qasm2.parse.lowering import QASM2
|
|
10
|
-
|
|
11
|
-
lines = textwrap.dedent(
|
|
12
|
-
"""
|
|
13
|
-
OPENQASM 2.0;
|
|
14
|
-
|
|
15
|
-
qreg q[2];
|
|
16
|
-
creg c[2];
|
|
17
|
-
|
|
18
|
-
h q[0];
|
|
19
|
-
CX q[0], q[1];
|
|
20
|
-
barrier q[0], q[1];
|
|
21
|
-
CX q[0], q[1];
|
|
22
|
-
rx(pi/2) q[0];
|
|
23
|
-
"""
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def test_run_lowering():
|
|
28
|
-
ast = qasm2.parse.loads(lines)
|
|
29
|
-
code = QASM2(qasm2.main).run(ast)
|
|
30
|
-
code.print()
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def test_loadfile():
|
|
34
|
-
|
|
35
|
-
with tempfile.TemporaryDirectory() as tmp_dir:
|
|
36
|
-
with open(f"{tmp_dir}/test.qasm", "w") as f:
|
|
37
|
-
f.write(lines)
|
|
38
|
-
|
|
39
|
-
file = pathlib.Path(f"{tmp_dir}/test.qasm")
|
|
40
|
-
qasm2.loadfile(file)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def test_negative_lowering():
|
|
44
|
-
|
|
45
|
-
mwe = """
|
|
46
|
-
OPENQASM 2.0;
|
|
47
|
-
include "qelib1.inc";
|
|
48
|
-
qreg q[1];
|
|
49
|
-
rz(-0.2) q[0];
|
|
50
|
-
"""
|
|
51
|
-
|
|
52
|
-
entry = qasm2.loads(mwe)
|
|
53
|
-
|
|
54
|
-
body = ir.Region(
|
|
55
|
-
ir.Block(
|
|
56
|
-
[
|
|
57
|
-
(size := qasm2.expr.ConstInt(value=1)),
|
|
58
|
-
(qreg := qasm2.core.QRegNew(n_qubits=size.result)),
|
|
59
|
-
(phi := qasm2.expr.ConstFloat(value=0.2)),
|
|
60
|
-
(theta := qasm2.expr.Neg(phi.result)),
|
|
61
|
-
(idx := qasm2.expr.ConstInt(value=0)),
|
|
62
|
-
(qubit := qasm2.core.QRegGet(qreg.result, idx.result)),
|
|
63
|
-
(qasm2.uop.RZ(qubit.result, theta.result)),
|
|
64
|
-
(none := func.ConstantNone()),
|
|
65
|
-
(func.Return(none.result)),
|
|
66
|
-
]
|
|
67
|
-
)
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
code = func.Function(
|
|
71
|
-
sym_name="main",
|
|
72
|
-
signature=func.Signature((), types.NoneType),
|
|
73
|
-
body=body,
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
code.print()
|
|
77
|
-
entry.print()
|
|
78
|
-
|
|
79
|
-
assert entry.code.is_structurally_equal(code)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/core/_typeinfer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/expr/_from_python.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/noise/__init__.py
RENAMED
|
File without changes
|
{bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/noise/_dialect.py
RENAMED
|
File without changes
|
{bloqade_circuit-0.4.1 → bloqade_circuit-0.4.2}/src/bloqade/qasm2/dialects/noise/fidelity.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|