qml-essentials 0.2.0__tar.gz → 0.2.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.
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/.github/workflows/docs-publish.yml +3 -3
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/.github/workflows/test-on-pr.yml +1 -1
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/CITATION.cff +2 -2
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/PKG-INFO +1 -1
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/ansaetze.ipynb +4 -1
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/benchmarks.py +43 -45
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/coefficients.ipynb +5 -3
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/coefficients.md +89 -4
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/diagrams.drawio +3 -3
- qml_essentials-0.2.2/docs/jaqsi.ipynb +549 -0
- qml_essentials-0.2.2/docs/jaqsi.md +259 -0
- qml_essentials-0.2.2/docs/pulses.ipynb +615 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/references.md +8 -8
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/training.ipynb +15 -8
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/usage.md +2 -2
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/mkdocs.yml +1 -1
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/pyproject.toml +1 -1
- qml_essentials-0.2.2/qml_essentials/coefficients.py +1788 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/qml_essentials/entanglement.py +9 -9
- qml_essentials-0.2.2/qml_essentials/evolution.py +570 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/qml_essentials/gates.py +0 -1
- qml_essentials-0.2.2/qml_essentials/jaqsi.py +167 -0
- qml_essentials-0.2.2/qml_essentials/memory.py +345 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/qml_essentials/model.py +75 -18
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/qml_essentials/operations.py +676 -120
- qml_essentials-0.2.2/qml_essentials/pauli.py +341 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/qml_essentials/pulses.py +164 -21
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/qml_essentials/qoc.py +24 -24
- qml_essentials-0.2.2/qml_essentials/script.py +627 -0
- qml_essentials-0.2.2/qml_essentials/simulation.py +377 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/qml_essentials/unitary.py +111 -30
- qml_essentials-0.2.2/qml_essentials/utils.py +13 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/tests/test_ansaetze.py +20 -20
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/tests/test_coefficients.py +473 -3
- qml_essentials-0.2.0/tests/test_yaqsi.py → qml_essentials-0.2.2/tests/test_jaqsi.py +148 -95
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/tests/test_model.py +87 -9
- qml_essentials-0.2.2/tests/test_pauli.py +212 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/tests/test_pulse_state.py +3 -3
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/tests/test_qoc.py +13 -9
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/uv.lock +32 -32
- qml_essentials-0.2.0/docs/figures/yaqsi-logo.svg +0 -2118
- qml_essentials-0.2.0/docs/pulses.ipynb +0 -587
- qml_essentials-0.2.0/docs/yaqsi.ipynb +0 -530
- qml_essentials-0.2.0/docs/yaqsi.md +0 -247
- qml_essentials-0.2.0/qml_essentials/coefficients.py +0 -1633
- qml_essentials-0.2.0/qml_essentials/utils.py +0 -420
- qml_essentials-0.2.0/qml_essentials/yaqsi.py +0 -1814
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/.github/CODEOWNERS +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/.github/ISSUE_TEMPLATE/code-health.md +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/.github/dependabot.yml +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/.github/workflows/dependabot-approve.yml +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/.github/workflows/docs.yml +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/.github/workflows/publish.yml +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/.github/workflows/quality-publish.yml +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/.github/workflows/quality.yml +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/.github/workflows/test-on-publish.yml +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/.gitignore +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/.pre-commit-config.yaml +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/CONTRIBUTING.md +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/LICENSE +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/README.md +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/ansaetze.md +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/entanglement.md +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/expressibility.md +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/bloch-sphere.svg +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuit_tikz_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuit_tikz_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_10_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_10_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_13_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_13_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_14_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_14_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_15_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_15_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_16_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_16_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_17_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_17_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_18_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_18_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_19_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_19_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_1_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_1_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_20_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_20_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_2_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_2_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_3_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_3_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_4_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_4_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_5_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_5_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_6_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_6_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_7_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_7_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_8_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_8_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_9_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Circuit_9_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/GHZ_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/GHZ_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Hardware_Efficient_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Hardware_Efficient_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/No_Ansatz_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/No_Ansatz_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/No_Entangling_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/No_Entangling_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Strongly_Entangling_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_4q/Strongly_Entangling_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_10_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_10_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_13_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_13_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_14_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_14_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_15_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_15_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_16_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_16_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_17_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_17_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_18_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_18_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_19_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_19_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_1_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_1_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_20_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_20_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_2_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_2_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_3_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_3_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_4_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_4_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_5_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_5_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_6_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_6_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_7_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_7_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_8_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_8_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_9_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Circuit_9_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/GHZ_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/GHZ_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Hardware_Efficient_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Hardware_Efficient_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/No_Ansatz_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/No_Ansatz_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/No_Entangling_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/No_Entangling_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Strongly_Entangling_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_5q/Strongly_Entangling_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_10_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_10_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_13_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_13_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_14_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_14_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_15_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_15_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_16_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_16_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_17_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_17_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_18_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_18_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_19_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_19_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_1_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_1_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_20_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_20_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_2_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_2_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_3_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_3_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_4_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_4_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_5_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_5_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_6_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_6_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_7_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_7_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_8_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_8_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_9_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Circuit_9_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/GHZ_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/GHZ_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Hardware_Efficient_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Hardware_Efficient_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/No_Ansatz_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/No_Ansatz_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/No_Entangling_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/No_Entangling_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Strongly_Entangling_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/circuits_6q/Strongly_Entangling_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/code.svg +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/fourier_fingerprint_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/fourier_fingerprint_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/fourier_series_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/fourier_series_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/fourier_series_tf_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/fourier_series_tf_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/gates_fidelities_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/gates_fidelities_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/histogram.svg +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/invert_images.sh +0 -0
- /qml_essentials-0.2.0/docs/figures/yaqsi_overview_dark.png → /qml_essentials-0.2.2/docs/figures/jaqsi_overview_dark.png +0 -0
- /qml_essentials-0.2.0/docs/figures/yaqsi_overview_light.png → /qml_essentials-0.2.2/docs/figures/jaqsi_overview_light.png +0 -0
- /qml_essentials-0.2.0/docs/figures/yaqsi_pulse_dark.png → /qml_essentials-0.2.2/docs/figures/jaqsi_pulse_dark.png +0 -0
- /qml_essentials-0.2.0/docs/figures/yaqsi_pulse_light.png → /qml_essentials-0.2.2/docs/figures/jaqsi_pulse_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/model_2d_psd_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/model_2d_psd_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/model_fct_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/model_fct_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/model_fct_spectr_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/model_fct_spectr_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/model_fct_spectr_os_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/model_fct_spectr_os_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/model_fct_spectr_ours_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/model_fct_spectr_ours_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/model_psd_an_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/model_psd_an_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/model_psd_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/model_psd_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/pulse_gates_dependencies_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/pulse_gates_dependencies_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/pulse_schedule_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/pulse_schedule_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/pulses_structure_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/pulses_structure_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/rel-entropy.svg +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/trained_series_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/trained_series_dataset_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/trained_series_dataset_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/trained_series_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/trained_series_tf_dark.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/figures/trained_series_tf_light.png +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/generate_circuits.py +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/index.md +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/javascripts/mathjax.js +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/logo.svg +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/metrics.ipynb +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/noise.md +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/pulses.md +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/slurm_benchmark.sh +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/style.css +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/training.md +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/docs/usage.ipynb +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/qml_essentials/__init__.py +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/qml_essentials/ansaetze.py +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/qml_essentials/drawing.py +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/qml_essentials/expressibility.py +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/qml_essentials/math.py +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/qml_essentials/qoc_results_drag.csv +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/qml_essentials/qoc_results_gaussian.csv +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/qml_essentials/qoc_results_square.csv +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/qml_essentials/tape.py +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/qml_essentials/topologies.py +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/tests/__init__.py +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/tests/conftest.py +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/tests/test_entanglement.py +0 -0
- {qml_essentials-0.2.0 → qml_essentials-0.2.2}/tests/test_expressiblity.py +0 -0
|
@@ -41,7 +41,7 @@ jobs:
|
|
|
41
41
|
name: github-pages
|
|
42
42
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
43
43
|
steps:
|
|
44
|
-
- uses: actions/configure-pages@
|
|
44
|
+
- uses: actions/configure-pages@v6
|
|
45
45
|
- uses: actions/checkout@v6
|
|
46
46
|
- name: Configure Git Credentials
|
|
47
47
|
run: |
|
|
@@ -70,8 +70,8 @@ jobs:
|
|
|
70
70
|
path: docs/coverage/
|
|
71
71
|
- name: Build Docs
|
|
72
72
|
run: pipx run uv run zensical build --strict --clean
|
|
73
|
-
- uses: actions/upload-pages-artifact@
|
|
73
|
+
- uses: actions/upload-pages-artifact@v5
|
|
74
74
|
with:
|
|
75
75
|
path: site
|
|
76
|
-
- uses: actions/deploy-pages@
|
|
76
|
+
- uses: actions/deploy-pages@v5
|
|
77
77
|
id: deployment
|
|
@@ -22,6 +22,6 @@ jobs:
|
|
|
22
22
|
- name: Install dependencies
|
|
23
23
|
run: pipx run uv sync --group dev
|
|
24
24
|
- name: Test with pytest (no benchmark)
|
|
25
|
-
run: pipx run uv run pytest --cov=qml_essentials --dist load -n 2 -m "not benchmark"
|
|
25
|
+
run: pipx run uv run pytest --cov=qml_essentials --dist load -n 2 -m "not benchmark" -v
|
|
26
26
|
- name: Test with pytest (benchmark)
|
|
27
27
|
run: pipx run uv run pytest --cov=qml_essentials -m "benchmark"
|
|
@@ -21,8 +21,8 @@ authors:
|
|
|
21
21
|
- family-names: "Wahl"
|
|
22
22
|
given-names: "Johannes"
|
|
23
23
|
title: "QML Essentials"
|
|
24
|
-
version: 0.2.
|
|
25
|
-
date-released: 2026-
|
|
24
|
+
version: 0.2.2
|
|
25
|
+
date-released: 2026-06-11
|
|
26
26
|
repository-code: "https://github.com/cirKITers/qml-essentials"
|
|
27
27
|
url: "https://cirkiters.github.io/qml-essentials"
|
|
28
28
|
license: MIT
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qml-essentials
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: A toolbox to make working with QML models easier.
|
|
5
5
|
Project-URL: Homepage, https://cirkiters.github.io/qml-essentials/
|
|
6
6
|
Project-URL: Repository, https://github.com/cirKITers/qml-essentials
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"from qml_essentials.gates import Gates\n",
|
|
60
60
|
"from qml_essentials.topologies import Topology, Block\n",
|
|
61
61
|
"\n",
|
|
62
|
+
"\n",
|
|
62
63
|
"class MyHardwareEfficient(Circuit):\n",
|
|
63
64
|
" @staticmethod\n",
|
|
64
65
|
" def structure():\n",
|
|
@@ -80,7 +81,8 @@
|
|
|
80
81
|
" mirror=False,\n",
|
|
81
82
|
" ),\n",
|
|
82
83
|
" )\n",
|
|
83
|
-
"
|
|
84
|
+
"\n",
|
|
85
|
+
"\n",
|
|
84
86
|
"from qml_essentials.model import Model\n",
|
|
85
87
|
"\n",
|
|
86
88
|
"model = Model(\n",
|
|
@@ -100,6 +102,7 @@
|
|
|
100
102
|
"from qml_essentials.gates import PulseInformation as pinfo\n",
|
|
101
103
|
"from typing import Optional\n",
|
|
102
104
|
"\n",
|
|
105
|
+
"\n",
|
|
103
106
|
"class MyHardwareEfficient(Circuit):\n",
|
|
104
107
|
" @staticmethod\n",
|
|
105
108
|
" def n_params_per_layer(n_qubits: int) -> int:\n",
|
|
@@ -8,10 +8,9 @@ import matplotlib.lines as mlines
|
|
|
8
8
|
import matplotlib.ticker
|
|
9
9
|
import csv
|
|
10
10
|
import numpy as np
|
|
11
|
+
import logging
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
from qml_essentials.yaqsi import (
|
|
13
|
+
from qml_essentials.jaqsi import (
|
|
15
14
|
Script,
|
|
16
15
|
)
|
|
17
16
|
from qml_essentials.operations import (
|
|
@@ -20,7 +19,7 @@ from qml_essentials.operations import (
|
|
|
20
19
|
PauliZ,
|
|
21
20
|
)
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
jax.config.update("jax_enable_x64", True)
|
|
24
23
|
|
|
25
24
|
logging.basicConfig(level=logging.INFO)
|
|
26
25
|
logger = logging.getLogger(__name__)
|
|
@@ -64,16 +63,16 @@ def var_ghz_benchmark(mode, q) -> None:
|
|
|
64
63
|
subkey, shape=(n_iters + 1, batch_size), minval=-jnp.pi, maxval=jnp.pi
|
|
65
64
|
)
|
|
66
65
|
|
|
67
|
-
logger.info("Running
|
|
66
|
+
logger.info("Running Jaqsi benchmark")
|
|
68
67
|
|
|
69
|
-
# ---
|
|
70
|
-
def
|
|
68
|
+
# --- Jaqsi ---
|
|
69
|
+
def jaqsi_circuit(phi):
|
|
71
70
|
for i in range(n_qubits):
|
|
72
71
|
H(wires=i)
|
|
73
72
|
for i in range(n_qubits):
|
|
74
73
|
CRX(phi, wires=[i, (i + 1) % n_qubits])
|
|
75
74
|
|
|
76
|
-
script = Script(f=
|
|
75
|
+
script = Script(f=jaqsi_circuit)
|
|
77
76
|
|
|
78
77
|
# do some warmup (allows pre-compilation)
|
|
79
78
|
# Note that we use a phi, which will not be part of the benchmarking later
|
|
@@ -88,22 +87,22 @@ def var_ghz_benchmark(mode, q) -> None:
|
|
|
88
87
|
# do the actual benchmarking
|
|
89
88
|
# Note that each execution uses a different phi vector, i.e. this is not
|
|
90
89
|
# just repeating the same computation!
|
|
91
|
-
|
|
90
|
+
js_times = []
|
|
92
91
|
for i in range(n_iters):
|
|
93
92
|
t0 = time.perf_counter()
|
|
94
|
-
|
|
93
|
+
res_js = script.execute(
|
|
95
94
|
type=mode,
|
|
96
95
|
obs=[PauliZ(wires=i, record=False) for i in range(n_qubits)],
|
|
97
96
|
args=(all_phis[i],),
|
|
98
97
|
in_axes=(0,),
|
|
99
98
|
)
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
js_times.append(time.perf_counter() - t0)
|
|
100
|
+
t_js = float(np.mean(js_times))
|
|
101
|
+
std_js = float(np.std(js_times))
|
|
103
102
|
|
|
104
103
|
logger.info(
|
|
105
|
-
f"
|
|
106
|
-
f"{
|
|
104
|
+
f"Jaqsi {mode} ({n_qubits}q, batch={batch_size}, avg {n_iters}): "
|
|
105
|
+
f"{t_js * 1000:.2f} ± {std_js * 1000:.2f} ms"
|
|
107
106
|
)
|
|
108
107
|
|
|
109
108
|
# Now the same thing for pennylane
|
|
@@ -140,32 +139,31 @@ def var_ghz_benchmark(mode, q) -> None:
|
|
|
140
139
|
|
|
141
140
|
logger.info(
|
|
142
141
|
f"PennyLane {mode} ({n_qubits}q, batch={batch_size}, avg {n_iters}): "
|
|
143
|
-
f"{t_pl*1000:.2f} ± {std_pl*1000:.2f} ms"
|
|
142
|
+
f"{t_pl * 1000:.2f} ± {std_pl * 1000:.2f} ms"
|
|
144
143
|
)
|
|
145
|
-
logger.info(f"Ratio pl/
|
|
144
|
+
logger.info(f"Ratio pl/jaqsi: {t_pl / t_js:.2f}x")
|
|
146
145
|
|
|
147
146
|
res_pl_arr = jnp.array(res_pl)
|
|
148
|
-
# PennyLane returns expval as (n_obs, batch) while
|
|
147
|
+
# PennyLane returns expval as (n_obs, batch) while Jaqsi returns
|
|
149
148
|
# (batch, n_obs). For other modes the shapes already agree.
|
|
150
149
|
if mode == "expval":
|
|
151
150
|
res_pl_arr = res_pl_arr.T
|
|
152
151
|
|
|
153
|
-
if not jnp.allclose(
|
|
152
|
+
if not jnp.allclose(res_js, res_pl_arr, atol=precision):
|
|
154
153
|
logger.error(
|
|
155
154
|
f"Error occured at {q} qubits for mode {mode}:\
|
|
156
|
-
Results do not match; got
|
|
155
|
+
Results do not match; got Jaqsi: {res_js}\
|
|
157
156
|
and Pennylane: {res_pl_arr}\
|
|
158
|
-
Shape is {
|
|
157
|
+
Shape is {res_js.shape} and {res_pl_arr.shape}"
|
|
159
158
|
)
|
|
160
159
|
raise RuntimeError("Results mismatch")
|
|
161
160
|
else:
|
|
162
161
|
logger.info("Results match")
|
|
163
162
|
|
|
164
|
-
return [
|
|
163
|
+
return [t_js, t_pl, std_js, std_pl]
|
|
165
164
|
|
|
166
165
|
|
|
167
|
-
|
|
168
|
-
results = {mode: {"ys": [], "pl": [], "std_ys": [], "std_pl": []} for mode in modes}
|
|
166
|
+
results = {mode: {"js": [], "pl": [], "std_js": [], "std_pl": []} for mode in modes}
|
|
169
167
|
|
|
170
168
|
if LOAD_LATEST:
|
|
171
169
|
# Find the most recent benchmarks CSV in the current directory
|
|
@@ -193,13 +191,13 @@ if LOAD_LATEST:
|
|
|
193
191
|
for row in rows:
|
|
194
192
|
mode = row["mode"]
|
|
195
193
|
if mode not in results:
|
|
196
|
-
results[mode] = {"
|
|
194
|
+
results[mode] = {"js": [], "pl": [], "std_js": [], "std_pl": []}
|
|
197
195
|
|
|
198
196
|
for mode in results:
|
|
199
197
|
mode_rows = [r for r in rows if r["mode"] == mode]
|
|
200
|
-
results[mode]["
|
|
198
|
+
results[mode]["js"] = [float(r["t_js_ms"]) for r in mode_rows]
|
|
201
199
|
results[mode]["pl"] = [float(r["t_pl_ms"]) for r in mode_rows]
|
|
202
|
-
results[mode]["
|
|
200
|
+
results[mode]["std_js"] = [float(r["std_js_ms"]) for r in mode_rows]
|
|
203
201
|
results[mode]["std_pl"] = [float(r["std_pl_ms"]) for r in mode_rows]
|
|
204
202
|
else:
|
|
205
203
|
logger.info(f"Preparing header in benchmarks-{identifier}.csv")
|
|
@@ -210,20 +208,20 @@ else:
|
|
|
210
208
|
[
|
|
211
209
|
"n_qubits",
|
|
212
210
|
"mode",
|
|
213
|
-
"
|
|
211
|
+
"t_js_ms",
|
|
214
212
|
"t_pl_ms",
|
|
215
|
-
"
|
|
213
|
+
"std_js_ms",
|
|
216
214
|
"std_pl_ms",
|
|
217
|
-
"
|
|
215
|
+
"ratio_pl_js",
|
|
218
216
|
]
|
|
219
217
|
)
|
|
220
218
|
|
|
221
219
|
for q_idx in qubit_sizes:
|
|
222
220
|
for mode in modes:
|
|
223
|
-
|
|
224
|
-
results[mode]["
|
|
221
|
+
t_js, t_pl, std_js, std_pl = var_ghz_benchmark(mode, q_idx)
|
|
222
|
+
results[mode]["js"].append(t_js * 1000) # convert to ms
|
|
225
223
|
results[mode]["pl"].append(t_pl * 1000)
|
|
226
|
-
results[mode]["
|
|
224
|
+
results[mode]["std_js"].append(std_js * 1000)
|
|
227
225
|
results[mode]["std_pl"].append(std_pl * 1000)
|
|
228
226
|
|
|
229
227
|
# --- CSV export ---
|
|
@@ -231,17 +229,17 @@ else:
|
|
|
231
229
|
with open(f"benchmarks-{identifier}.csv", "a", newline="") as f:
|
|
232
230
|
writer = csv.writer(f)
|
|
233
231
|
for mode in modes:
|
|
234
|
-
|
|
232
|
+
t_js_ms = results[mode]["js"][-1]
|
|
235
233
|
t_pl_ms = results[mode]["pl"][-1]
|
|
236
234
|
writer.writerow(
|
|
237
235
|
[
|
|
238
236
|
q_idx,
|
|
239
237
|
mode,
|
|
240
|
-
|
|
238
|
+
t_js_ms,
|
|
241
239
|
t_pl_ms,
|
|
242
|
-
results[mode]["
|
|
240
|
+
results[mode]["std_js"][-1],
|
|
243
241
|
results[mode]["std_pl"][-1],
|
|
244
|
-
t_pl_ms /
|
|
242
|
+
t_pl_ms / t_js_ms,
|
|
245
243
|
]
|
|
246
244
|
)
|
|
247
245
|
|
|
@@ -260,17 +258,17 @@ fig, ax = plt.subplots(figsize=(9, 5))
|
|
|
260
258
|
|
|
261
259
|
for mode in modes:
|
|
262
260
|
color = mode_colors[mode]
|
|
263
|
-
|
|
261
|
+
js = results[mode]["js"]
|
|
264
262
|
pl = results[mode]["pl"]
|
|
265
|
-
|
|
263
|
+
std_js = results[mode]["std_js"]
|
|
266
264
|
std_pl = results[mode]["std_pl"]
|
|
267
265
|
|
|
268
|
-
ratio = [p / y for y, p in zip(
|
|
269
|
-
# Error propagation for ratio r = pl/
|
|
270
|
-
# σ_r = r * sqrt((σ_pl/pl)² + (σ
|
|
266
|
+
ratio = [p / y for y, p in zip(js, pl)]
|
|
267
|
+
# Error propagation for ratio r = pl/js:
|
|
268
|
+
# σ_r = r * sqrt((σ_pl/pl)² + (σ_js/js)²)
|
|
271
269
|
ratio_err = [
|
|
272
270
|
r * ((sp / p) ** 2 + (sy / y) ** 2) ** 0.5
|
|
273
|
-
for r, y, p, sy, sp in zip(ratio,
|
|
271
|
+
for r, y, p, sy, sp in zip(ratio, js, pl, std_js, std_pl)
|
|
274
272
|
]
|
|
275
273
|
|
|
276
274
|
ax.errorbar(
|
|
@@ -290,9 +288,9 @@ for mode in modes:
|
|
|
290
288
|
ax.axhline(1.0, color="gray", linestyle=":", linewidth=2, label="_nolegend_")
|
|
291
289
|
|
|
292
290
|
ax.set_xlabel("Number of qubits")
|
|
293
|
-
ax.set_ylabel("Time ratio PennyLane /
|
|
291
|
+
ax.set_ylabel("Time ratio PennyLane / Jaqsi")
|
|
294
292
|
ax.set_title(
|
|
295
|
-
f"
|
|
293
|
+
f"Jaqsi vs PennyLane - Rel., Par., Avg. over {n_iters} Iters, {batch_size} Batches"
|
|
296
294
|
)
|
|
297
295
|
# ax.set_xscale("log")
|
|
298
296
|
ax.set_yscale("log")
|
|
@@ -43,12 +43,14 @@
|
|
|
43
43
|
" def __init__(self, c, f):\n",
|
|
44
44
|
" self.c = c\n",
|
|
45
45
|
" self.f = f\n",
|
|
46
|
-
" self.degree = (2*max(f)+1,)\n",
|
|
46
|
+
" self.degree = (2 * max(f) + 1,)\n",
|
|
47
47
|
" self.frequencies = f\n",
|
|
48
48
|
" self.n_input_feat = 1\n",
|
|
49
49
|
"\n",
|
|
50
50
|
" def __call__(self, inputs, **kwargs):\n",
|
|
51
|
-
" return np.sum(
|
|
51
|
+
" return np.sum(\n",
|
|
52
|
+
" [c * np.exp(-1j * inputs * f) for f, c in zip(self.f, self.c)], axis=0\n",
|
|
53
|
+
" )\n",
|
|
52
54
|
"\n",
|
|
53
55
|
"\n",
|
|
54
56
|
"freqs = [-3, -1.5, 0, 1.5, 3]\n",
|
|
@@ -219,7 +221,7 @@
|
|
|
219
221
|
" def __init__(self, c, f):\n",
|
|
220
222
|
" self.c = c\n",
|
|
221
223
|
" self.f = f\n",
|
|
222
|
-
" self.degree = (2*max(f)+1,)\n",
|
|
224
|
+
" self.degree = (2 * max(f) + 1,)\n",
|
|
223
225
|
" self.frequencies = f\n",
|
|
224
226
|
" self.rng = np.random.default_rng(1000)\n",
|
|
225
227
|
" self.n_input_feat = 1\n",
|
|
@@ -143,7 +143,7 @@ fourier_tree = FourierTree(model)
|
|
|
143
143
|
an_coeffs, an_freqs = fourier_tree.get_spectrum(force_mean=True)
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
Unlike the FFT, this gives us the precise coefficients, solely depending on the parameters.
|
|
147
147
|
We can verify this by comparing it to the previous results:
|
|
148
148
|
|
|
149
149
|

|
|
@@ -154,10 +154,88 @@ We can verify this by comparing it to the previous results:
|
|
|
154
154
|
We use an approach developed by [Nemkov et al.](https://arxiv.org/pdf/2304.03787), which was later extended by [Wiedmann et al.](https://arxiv.org/pdf/2411.03450).
|
|
155
155
|
The implementation is also inspired by the corresponding [code](https://github.com/idnm/FourierVQA) for Nemkov et al.'s paper.
|
|
156
156
|
|
|
157
|
-
In Nemkov et al.'s algorithm the first step is to separate Clifford and non-Clifford gates, such that all Clifford gates can be regarded as part of the observable, and the actual circuit only consists of Pauli rotations (cf. qml_essentials.
|
|
157
|
+
In Nemkov et al.'s algorithm the first step is to separate Clifford and non-Clifford gates, such that all Clifford gates can be regarded as part of the observable, and the actual circuit only consists of Pauli rotations (cf. `qml_essentials.pauli.PauliCircuit`).
|
|
158
158
|
The main idea is then to split each Pauli rotation into sine and cosine product terms to obtain the coefficients, which are only dependent on the parameters of the circuit.
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
The Clifford commutation and Pauli bookkeeping are implemented symbolically on a stabilizer-tableau Pauli representation (`qml_essentials.operations.PauliWord`), and the parameter-dependent coefficients are evaluated with vectorized operations.
|
|
161
|
+
This makes the tree fast to build and evaluate, and it supports multiple input features: in that case `get_spectrum` returns, per observable, the multi-dimensional frequency vectors (shape `(n_freqs, n_features)`) and their coefficients.
|
|
162
|
+
|
|
163
|
+
The symbolic core is gate-set agnostic and lives in `qml_essentials.operations`:
|
|
164
|
+
|
|
165
|
+
- `PauliWord` — an n-qubit Pauli in the symplectic $i^{\text{phase}}\,X^x Z^z$ representation, with `compose`, `commutes_with`, `conjugate_by_clifford` (Clifford tableau evolution), and a `to_matrix`/`from_matrix` bridge to dense operators.
|
|
166
|
+
- `Operation.is_clifford` — a class flag marking the standard Clifford gates ($I, X, Y, Z, H, S, \text{CX}, \text{CY}, \text{CZ}, \text{SWAP}$); `conjugate_by_clifford` uses fast symbolic rules for the common ones and an exact matrix fallback for the rest.
|
|
167
|
+
- `Operation.decompose()` — expresses composite gates (`Rot`, `CRX`/`CRY`/`CRZ`, `CZ`) in terms of Clifford + Pauli-rotation primitives.
|
|
168
|
+
|
|
169
|
+
### Custom Circuits and Input Scaling
|
|
170
|
+
|
|
171
|
+
The `FourierTree` operates on whatever circuit the model's `script` records, so a custom variational circuit can be analysed by replacing `model.script`:
|
|
172
|
+
|
|
173
|
+
```python
|
|
174
|
+
import qml_essentials.jaqsi as js
|
|
175
|
+
from qml_essentials.gates import Gates as g
|
|
176
|
+
|
|
177
|
+
def variational(params, inputs, *args, **kwargs):
|
|
178
|
+
params = params.squeeze()
|
|
179
|
+
g.PauliRot(1 * inputs, "Y", wires=[0])
|
|
180
|
+
g.PauliRot(params[0], "XZX", wires=[0, 1, 2])
|
|
181
|
+
g.PauliRot(3 * inputs, "XZ", wires=[0, 1])
|
|
182
|
+
g.PauliRot(params[1], "YY", wires=[0, 1])
|
|
183
|
+
g.PauliRot(9 * inputs, "XY", wires=[0, 1])
|
|
184
|
+
|
|
185
|
+
model = Model(n_qubits=3, n_layers=1, output_qubit=0)
|
|
186
|
+
model._params_shape = (2, 1)
|
|
187
|
+
model.initialize_params() # reallocate params for the custom shape
|
|
188
|
+
model.script = js.Script(f=variational, n_qubits=3)
|
|
189
|
+
|
|
190
|
+
coeffs, freqs = FourierTree(model).get_spectrum()
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
The tree distinguishes encoding from variational rotations **automatically**.
|
|
194
|
+
Because every canonical rotation angle is an affine function of the inputs (encodings apply $\omega_k\,x_f$; Clifford commutation only flips a generator's sign), the tree perturbs each input feature in turn and reads off, from the change in the recorded angles, which rotations depend on which feature and with what signed integer scaling $\omega_k$.
|
|
195
|
+
|
|
196
|
+
The only requirement is that each encoding rotation be **linear in a single feature**, $\omega_k\,x_f$. Heterogeneous scalings such as $(1, 3, 9)$ are then resolved to the correctly scaled frequencies (here $\{-13, -11, -7, -5, 5, 7, 11, 13\}$) instead of unit counts.
|
|
197
|
+
Non-integer scalings are rounded with a warning; a rotation depending on more than one feature raises `NotImplementedError`; and the `method="dp"` exact-support path does not support non-unit scaling.
|
|
198
|
+
|
|
199
|
+
For the numerical FFT (`Coefficients.get_spectrum`) a custom circuit additionally requires `model.degree` to be set high enough to resolve the largest frequency.
|
|
200
|
+
The sampling grid is built from `model.degree` (the number of frequencies, i.e. $2\,\omega_\text{max} + 1$), not `model.frequencies`.
|
|
201
|
+
|
|
202
|
+
## Estimating the Exact Spectrum
|
|
203
|
+
|
|
204
|
+
The number of frequencies a model can represent is, by default, estimated naively from the encoding (see `model.frequencies` / `model.degree`).
|
|
205
|
+
This estimate is an *upper bound*: as shown by Wiedmann et al., some coefficients are constrained to zero for all parameter values, so the true spectrum can be smaller.
|
|
206
|
+
|
|
207
|
+
The `FourierTree` lets us obtain the *exact* spectrum of a model via the opt-in `Model.exact_spectrum` method:
|
|
208
|
+
```python
|
|
209
|
+
model = Model(
|
|
210
|
+
n_qubits=3,
|
|
211
|
+
n_layers=1,
|
|
212
|
+
circuit_type="Circuit_19",
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
exact = model.exact_spectrum() # tuple of frequency arrays, one per input feature
|
|
216
|
+
```
|
|
217
|
+
The result is always a subset of `model.frequencies`.
|
|
218
|
+
For example, for the model above the naive estimate is `{-3, ..., 3}` while the exact spectrum is `{-2, -1, 0, 1, 2}`.
|
|
219
|
+
|
|
220
|
+
The support is derived *purely symbolically* — no parameter sampling is involved.
|
|
221
|
+
This exploits a structural property of the tree: every parameter contributes at most one sine **or** cosine factor per path, so the variational leaf factors are square-free monomials over $\{1, \cos\theta_i, i\sin\theta_i\}$, which are linearly independent.
|
|
222
|
+
A frequency is therefore absent if and only if all of its signature-grouped path weights sum to zero — an exact test, since all weights are dyadic rationals.
|
|
223
|
+
This correctly removes frequencies whose contributions cancel identically across paths, e.g. two consecutive encodings combining into a single rotation ($\langle Z \rangle = \cos(2x)$ has spectrum $\{-2, 2\}$, not $\{-2, \dots, 2\}$).
|
|
224
|
+
|
|
225
|
+
Two methods are available:
|
|
226
|
+
|
|
227
|
+
- `method="tree"` (default): fully exact, but enumerates the explicit tree, whose size can grow exponentially with circuit depth.
|
|
228
|
+
- `method="dp"`: merges tree nodes with identical (rotation index, observable) state — at most $n_\text{params} \cdot 4^{n_\text{qubits}}$ states — and tracks the achievable input sine/cosine counts per state.
|
|
229
|
+
This scales to deep circuits where the explicit tree is infeasible (e.g. a 10-layer `Strongly_Entangling` ansatz on 5 qubits takes seconds instead of being intractable).
|
|
230
|
+
It is exact per path, but cannot detect coefficients that cancel identically *across* paths with identical variational dependence (such as the repeated-encoding example above), where it returns a tight superset.
|
|
231
|
+
Currently it supports a single input feature.
|
|
232
|
+
|
|
233
|
+
```python
|
|
234
|
+
exact = model.exact_spectrum(method="dp") # for deep circuits
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Note that `exact_spectrum` requires a Clifford + Pauli-rotation ansatz (the same restriction as the `FourierTree`).
|
|
238
|
+
Also keep in mind that a *structurally present* frequency can still have an exponentially small coefficient (the leaf weights scale with $0.5^{s+c}$), so numerically thresholding an FFT spectrum may show fewer frequencies than the exact symbolic support.
|
|
161
239
|
|
|
162
240
|
|
|
163
241
|
## Multi-Dimensional Coefficients
|
|
@@ -215,7 +293,11 @@ fcc = FCC.get_fcc(
|
|
|
215
293
|
```
|
|
216
294
|
Returns `0.1442` as already in Fig. 3a of aforementioned paper.
|
|
217
295
|
|
|
218
|
-
Optionally, you can choose a different correlation `method` (currently "pearson"
|
|
296
|
+
Optionally, you can choose a different correlation `method` (currently "pearson", "complex_pearson", "spearman", and "covariance" are supported).
|
|
297
|
+
The default "pearson" method preserves the existing behavior for complex coefficients by correlating stacked real and imaginary parts.
|
|
298
|
+
The "complex_pearson" method computes a complex-valued Pearson coefficient via Hermitian normalized covariance, so the magnitude describes correlation strength and the angle describes the relative phase between coefficient vectors.
|
|
299
|
+
The "covariance" method returns the (Hermitian, for complex coefficients) sample covariance instead of a normalized correlation; unlike the correlation methods its entries are not bounded to $[0, 1]$.
|
|
300
|
+
When calculating the scalar FCC, `calculate_fcc` uses the magnitude of the fingerprint entries.
|
|
219
301
|
Similar, other methods which require specifying `n_samples` (c.f. calculation of [expressibility](expressibility.md) and [entangling capability](entanglement.md)), methods in the `FCC` class take an optional parameter `scale` (defaults to `False`), which scales the number of samples depending on the number of qubits and the number of input features as $n_\text{samples} \cdot n_\text{params} \cdot 2^{n_\text{qubits}} \cdot n_\text{features}$.
|
|
220
302
|
|
|
221
303
|
As described in our paper, the FCC is calculated as the mean of the Fourier fingerprint, which in turn can be obtained separately as follows:
|
|
@@ -237,5 +319,8 @@ This is implicitly done in `FCC.get_fourier_fingerprint` (and controlled using t
|
|
|
237
319
|
- removing symmetries inside the correlation matrix (the Fourier fingerprint), e.g. $c_{0,1} = c_{1,0}$
|
|
238
320
|
Note that `get_fcc` also (by default) trims down the fingerprint before calculating the actual FCC.
|
|
239
321
|
|
|
322
|
+
When `trim_redundant` is enabled, the frequencies returned alongside the fingerprint are a `(row_freqs, col_freqs)` tuple that labels the two (trimmed) matrix axes one-to-one, so they always match the shape of the returned correlation matrix.
|
|
323
|
+
The optional `numerical_cap` argument (passed through to `get_spectrum`) prunes negligible Fourier modes: coefficients below the cap are zeroed and, for a single input feature, the corresponding frequencies are dropped from the spectrum.
|
|
324
|
+
|
|
240
325
|
Both `get_fcc` and `get_fourier_fingerprint` support a `weight` parameter, which can be used to weight the correlation matrix, such that high-frequency components receive a lower weight.
|
|
241
326
|
Intuitively this adresses the issue, that low frequency components have a higher impact on the mean-squared error (c.f. App. D in our paper).
|
|
@@ -271,7 +271,7 @@
|
|
|
271
271
|
</root>
|
|
272
272
|
</mxGraphModel>
|
|
273
273
|
</diagram>
|
|
274
|
-
<diagram id="spa1uVqdiQQ0YvOVlW3r" name="
|
|
274
|
+
<diagram id="spa1uVqdiQQ0YvOVlW3r" name="jaqsi">
|
|
275
275
|
<mxGraphModel dx="961" dy="1112" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="0" pageScale="1" pageWidth="1654" pageHeight="1169" math="0" shadow="0">
|
|
276
276
|
<root>
|
|
277
277
|
<mxCell id="0" />
|
|
@@ -300,7 +300,7 @@
|
|
|
300
300
|
<mxCell id="vOIiD02KDP2FM9wRCSIt-23" edge="1" parent="1" source="vOIiD02KDP2FM9wRCSIt-14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;strokeWidth=2;fontSize=14;sketch=1;curveFitting=1;jiggle=2;curved=1;" target="PHgeUpY-ib7LMYt7HyUQ-1">
|
|
301
301
|
<mxGeometry relative="1" as="geometry" />
|
|
302
302
|
</mxCell>
|
|
303
|
-
<mxCell id="qWqGzGG-b71D2YMG60HP-1" parent="1" style="rounded=1;whiteSpace=wrap;html=1;verticalAlign=bottom;strokeWidth=3;fontSize=18;sketch=1;curveFitting=1;jiggle=2;spacingTop=0;spacingBottom=5;strokeColor=#E69F00;fillColor=none;" value="QuantumScript (
|
|
303
|
+
<mxCell id="qWqGzGG-b71D2YMG60HP-1" parent="1" style="rounded=1;whiteSpace=wrap;html=1;verticalAlign=bottom;strokeWidth=3;fontSize=18;sketch=1;curveFitting=1;jiggle=2;spacingTop=0;spacingBottom=5;strokeColor=#E69F00;fillColor=none;" value="QuantumScript (jaqsi.py)" vertex="1">
|
|
304
304
|
<mxGeometry height="250" width="410.12195121951225" x="724.8780487804879" y="525" as="geometry" />
|
|
305
305
|
</mxCell>
|
|
306
306
|
<mxCell id="PHgeUpY-ib7LMYt7HyUQ-2" parent="1" style="rounded=1;whiteSpace=wrap;html=1;verticalAlign=bottom;strokeWidth=3;fontSize=18;sketch=1;curveFitting=1;jiggle=2;spacingTop=0;spacingBottom=5;strokeColor=#009371;fillColor=none;" value="Operations (operations.py)" vertex="1">
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
<mxCell id="PHgeUpY-ib7LMYt7HyUQ-3" parent="1" style="rounded=1;whiteSpace=wrap;html=1;verticalAlign=bottom;strokeWidth=3;fontSize=18;sketch=1;curveFitting=1;jiggle=2;spacingTop=0;spacingBottom=5;strokeColor=#ED665A;fillColor=none;" value="Tape (tape.py)" vertex="1">
|
|
313
313
|
<mxGeometry height="140" width="410.12195121951225" x="724.8780487804879" y="825" as="geometry" />
|
|
314
314
|
</mxCell>
|
|
315
|
-
<mxCell id="PHgeUpY-ib7LMYt7HyUQ-4" parent="1" style="rounded=1;whiteSpace=wrap;html=1;verticalAlign=bottom;strokeWidth=3;fontSize=18;sketch=1;curveFitting=1;jiggle=2;spacingTop=0;spacingBottom=5;strokeColor=#009371;fillColor=none;" value="
|
|
315
|
+
<mxCell id="PHgeUpY-ib7LMYt7HyUQ-4" parent="1" style="rounded=1;whiteSpace=wrap;html=1;verticalAlign=bottom;strokeWidth=3;fontSize=18;sketch=1;curveFitting=1;jiggle=2;spacingTop=0;spacingBottom=5;strokeColor=#009371;fillColor=none;" value="Jaqsi (jaqsi.py)" vertex="1">
|
|
316
316
|
<mxGeometry height="140" width="410.12195121951225" x="250" y="825" as="geometry" />
|
|
317
317
|
</mxCell>
|
|
318
318
|
<mxCell id="vOIiD02KDP2FM9wRCSIt-14" parent="1" style="rounded=1;whiteSpace=wrap;html=1;verticalAlign=bottom;strokeWidth=3;fontSize=18;sketch=1;curveFitting=1;jiggle=2;spacingTop=0;spacingBottom=5;strokeColor=#002D4C;fillColor=none;" value="Ansaetze (ansaetze.py)" vertex="1">
|