forked from TeamGraphix/graphix
-
Notifications
You must be signed in to change notification settings - Fork 0
Add OpenQASM 3 exporter for circuits #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
thierry-martinez
wants to merge
9
commits into
qat-inria:master
Choose a base branch
from
thierry-martinez:qasm3_exporter
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add OpenQASM 3 exporter for circuits #25
thierry-martinez
wants to merge
9
commits into
qat-inria:master
from
thierry-martinez:qasm3_exporter
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92b8af0 to
5922ec4
Compare
Introduce the `O(N^3)` Pauli flow-finding algorithm presented in [1] which improves the previous version with `O(N^5)` complexity [2]. Since a Pauli flow in an open graph without Pauli measurements defines a gflow, this algorithm also improves the previous implementation of the gflow-finding algorithm with `O(N^4)` complexity [3]. The implementation proposed here considers the suggestion in [1] to eliminate the rows that are identically 0 in the order-demand matrix to accelerate the flow-finding routine in open graphs with nI ≠ n O. Finally, the new algorithm solves the issue discussed in qat-inria#17 , whereby the previous flow-finding functions could return a correction function containing input nodes in the codomain, which is not allowed by the definition of gflow or Pauli flow. In summary: - The core functions of the algorithm are encapsulated in the new module `graphix.find_pflow`, while `graphix.gflow` and related modules are adapted accordingly to avoid modifying the current API in this PR. - The module `graphix.linalg` has been renamed `graphix._linalg` and updated with more efficient functions for gaussian elimination, back substitution, kernel-finding and right-inverse. New implementation is GF2-specialized and, where appropriate, just-in-time compiled with numba. The dependence on `sympy` and `galois` is dropped. Tests are simplified and updated accordingly, and module is now typed. - `pytest-benchmark` is incorporated to allow for easier benchmarking between different commits (courtesy of @thierry-martinez). Additional comments --------------------- - This PR addresses the same issue as TeamGraphix#294, but is otherwise unrelated. - The module `graphix.gflow` will be restructured in a future PR. The implementation exhibits the cubic scaling as described in [1]. See https://gitlab.inria.fr/muldemol/pflow-on3-scaling.git for a benchmarking code. References ----------- [1] Mitosek and Backens, 2024 (arXiv:2410.23439) [2] Simmons, 2021 (arXiv:2109.05654) [3] Backens et al., Quantum 5, 421 (2021) --------- Co-authored-by: Thierry Martinez <[email protected]>
This commit introduces an OpenQASM 3 exporter for Graphix circuits. The functionality was originally proposed in TeamGraphix#245 but has not yet been merged. The added tests verify that a round-trip through the OpenQASM 3 representation preserves Graphix circuits, using the graphix-qasm3-parser plugin. This plugin is therefore added as a `requirements-dev.txt` dependency. CI is updated so that `pip install .` can detect the current version number of Graphix, instead of the default `0.1`: to do so, the whole history and the tags should be available. We removed the "-e" option from CI because it is useless in the CI context. In the long term the `qasm3_exporter` module will also host the pattern exporter, but that feature is intentionally omitted from this PR to keep the change focused.
a9d2236 to
1fda549
Compare
…Graphix#346) * ⬆️ Bump ruff from 0.13.2 to 0.13.3 in the python-packages group Bumps the python-packages group with 1 update: [ruff](https://github.com/astral-sh/ruff). Updates `ruff` from 0.13.2 to 0.13.3 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](astral-sh/ruff@0.13.2...0.13.3) --- updated-dependencies: - dependency-name: ruff dependency-version: 0.13.3 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python-packages ... Signed-off-by: dependabot[bot] <[email protected]> * Fix `compute_rank` result type * Remove unused `import graphix` * Revert "Fix `compute_rank` result type" This reverts commit 36e09ea. --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Thierry Martinez <[email protected]>
…Graphix#348) Bumps the python-packages group with 1 update: [ruff](https://github.com/astral-sh/ruff). Updates `ruff` from 0.13.3 to 0.14.0 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](astral-sh/ruff@0.13.3...0.14.0) --- updated-dependencies: - dependency-name: ruff dependency-version: 0.14.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: python-packages ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…eamGraphix#345) This commit restores the reverse‑dependency check against the main branch of `graphix-symbolic`. The check will become functional once the following pull request is approved and merged: TeamGraphix/graphix-symbolic#4
Bumps the python-packages group with 2 updates: [ruff](https://github.com/astral-sh/ruff) and [nox](https://github.com/wntrblm/nox). Updates `ruff` from 0.14.0 to 0.14.1 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](astral-sh/ruff@0.14.0...0.14.1) Updates `nox` from 2025.5.1 to 2025.10.16 - [Release notes](https://github.com/wntrblm/nox/releases) - [Changelog](https://github.com/wntrblm/nox/blob/main/CHANGELOG.md) - [Commits](wntrblm/nox@2025.05.01...2025.10.16) --- updated-dependencies: - dependency-name: ruff dependency-version: 0.14.1 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python-packages - dependency-name: nox dependency-version: 2025.10.16 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: python-packages ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit introduces an OpenQASM 3 exporter for Graphix circuits. The functionality was originally proposed in TeamGraphix#245 but has not yet been merged.
The added tests verify that a round-trip through the OpenQASM 3 representation preserves Graphix circuits, using the
graphix-qasm3-parserplugin. These tests are executed by CI when the reverse-dependency is checked.In the long term the
qasm3_exportermodule will also host the pattern exporter, but that feature is intentionally omitted from this PR to keep the change focused.