forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
Rename qiskit gates whose names are OQ3 hardware qubit identifiers #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
Closed
jlapeyre
wants to merge
9
commits into
jakelishman:qasm3/symbol-table
from
jlapeyre:symbol-table-fix-hw-qubit-gate
Closed
Rename qiskit gates whose names are OQ3 hardware qubit identifiers #25
jlapeyre
wants to merge
9
commits into
jakelishman:qasm3/symbol-table
from
jlapeyre:symbol-table-fix-hw-qubit-gate
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
This rewrites the symbol handling of the OpenQASM 3 exporter to decouple object identities from the necessary object identifiers. As part of this, we use the same trick of standard-gate reparametrisation to produce gate-definition sources for Qiskit built-ins, which fixes many cases of bad parametrisation of gates like `rzx`. This kind of rewrite was necessary to fix the now-bad assumption within the OQ3 exporter that "gate identity" is always static within a circuit. Since standard gate `Gate` instances are now only generated on demand, there is no guarantee of stability of them. The fix to the definition source for these makes them independent of object identity. User-defined gates can still use the identity, as these are still guaranteed static. This commit fixes almost all of the "bad parametrisation" tests in the test suite. There are several other changes in the test suite necessary: * since the uniqueness of the identifier is now independent of how the lookup of a Qiskit object works, there is no need to include the highly non-deterministic `id` in the generated symbols for user gates. Several tests changed to use the new, simple count-based unique names. * the escaping and uniqueness rules now apply uniformly to all gate definitions, fixing several bad test cases that previously were testing invalid OpenQASM 3. * the escaping rules changed slightly for naming collisions with keywords, making them slightly more consistent with how other renaming rules worked.
…iskit#12772) * Optimization for the MCX Recursive Gate Change the recursive method for the Lemma 9 of arXiv:1501.06911, first shown in Lemma 7.3 of https://link.aps.org/doi/10.1103/PhysRevA.52.3457 Co-Authored-By: Rafaella Vale <26910380+rafaella-vale@users.noreply.github.com> Co-Authored-By: Jefferson Deyvis <67497412+jeffersondeyvis@users.noreply.github.com> * Revert "Optimization for the MCX Recursive Gate" This reverts commit 507d5b3. Co-Authored-By: Rafaella Vale <26910380+rafaella-vale@users.noreply.github.com> Co-Authored-By: Jefferson Deyvis <67497412+jeffersondeyvis@users.noreply.github.com> * Revert "Revert "Optimization for the MCX Recursive Gate"" This reverts commit 4671b7e. * Optimization for MCX Recursive Fixing co-authors Co-Authored-By: Rafaella Vale <26910380+rafaella-vale@users.noreply.github.com> Co-Authored-By: Jefferson Deyvis <67497412+jeffersondeyvis@users.noreply.github.com> Co-Authored-By: Adenilton Silva <7927558+adjs@users.noreply.github.com> * Optimization of MCX Recursive Now with fixed co-authors Co-Authored-By: Rafaella Vale <26910380+rafaella-vale@users.noreply.github.com> Co-Authored-By: Jefferson Deyvis <67497412+jeffersondeyvis@users.noreply.github.com> Co-Authored-By: Adenilton Silva <7927558+adjs@users.noreply.github.com> * refactored MCXRecursive and unused method deleted * fixed qasm string for mcx test with variants * remove draw * fix qasm file in test_circuit_qasm_with_mcx_gate_variants * update the MCXRecursive class docstring * add a test of the upper bound limit of the number of CX gates * fix failing qasm test * fix qasm file in test_export in qasm2 tests * fix format lint errors in qasm strings * add release notes * update references format * update release notes after review --------- Co-authored-by: Thiago Melo <thiagomdazevedo@hotmail.com> Co-authored-by: Rafaella Vale <26910380+rafaella-vale@users.noreply.github.com> Co-authored-by: Jefferson Deyvis <67497412+jeffersondeyvis@users.noreply.github.com> Co-authored-by: Adenilton Silva <7927558+adjs@users.noreply.github.com>
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.62 to 1.0.63. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](dtolnay/thiserror@1.0.62...1.0.63) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
) * riverlane paper * docs * improvement * empty * fix linting and add abs * Update qiskit/primitives/backend_estimator_v2.py Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com> * CR * Update qiskit/primitives/backend_estimator_v2.py Co-authored-by: Ian Hincks <ian.hincks@gmail.com> * CR * indent * Update releasenotes/notes/backend-estimator-v2-variance-905c953415ad0e29.yaml Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com> --------- Co-authored-by: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com> Co-authored-by: Ian Hincks <ian.hincks@gmail.com>
* added circuit functions * updated circuits functions * added qasm files * added benchmarking metrics * cleaning up circuits * updated tests * updated tests * formatting * removed unused import * clifford synthesis circ test * lint test
If a custom qiskit gate is given a name that is a valid identifer for a hardware qubit in OQ3, then, before this commit, the name would not be escaped when writing the OQ3 gate definition. This commit fixes this by escaping the leading dollar sign as it would be in any other position in the name. That is, the dollar sign is replaced by underscore.
74802fd
to
b51386f
Compare
Merged as 598fae3. |
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.
If a custom qiskit gate is given a name that is a valid identifier for a hardware qubit in OQ3, then, before this commit, the name would not be escaped when writing the OQ3 gate definition.
This commit fixes this by escaping the leading dollar sign as it would be in any other position in the name. That is, the dollar sign is replaced by underscore.