Add QASM3 export support for IonQ native gates#239
Open
dlyongemallo wants to merge 1 commit intoqiskit-community:mainfrom
Open
Add QASM3 export support for IonQ native gates#239dlyongemallo wants to merge 1 commit intoqiskit-community:mainfrom
dlyongemallo wants to merge 1 commit intoqiskit-community:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds QASM3 export support for IonQ native gates by implementing _define() methods that decompose each gate into standard Qiskit gates. This resolves issues where circuits using IonQ native gates could not be exported to QASM3 format or were producing invalid QASM3 that failed to parse.
Changes:
- Added
_define()methods to all four IonQ native gates (GPIGate, GPI2Gate, MSGate, ZZGate) providing decompositions into standard Qiskit gates - Added comprehensive tests verifying mathematical equivalence between gates and their decompositions
- Added integration tests for QASM3 export and parsing, including exact reproduction of the reported issue scenario
- Added openqasm3[parser] test dependency
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| qiskit_ionq/ionq_gates.py | Implements _define() methods for all four IonQ native gates, providing decompositions into U, RZ, RXX, and RZZ gates |
| test/ionq_gates/test_gates.py | Adds parametric tests verifying matrix equivalence of decompositions and integration tests for QASM3 export/parsing |
| requirements-test.txt | Adds openqasm3[parser] as a test dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
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.
Summary
Adds QASM3 definitions for IonQ native gates so that output of
qiskit.qasm3.dumpscan be parsed byopenqasm3.parserwithout error. Fixes #217 and #218.Details and comments
Adds
_define()methods to all four IonQ native gates (GPIGate,GPI2Gate,MSGate,ZZGate). This provides decompositions into standard Qiskit gates that QASM exporters can serialize.Gate decompositions:
GPIGate(φ)U(π, 2πφ, π - 2πφ)GPI2Gate(φ)U(π/2, 2πφ - π/2, π/2 - 2πφ)MSGate(φ0, φ1, θ)RZ+RXX+RZsequenceZZGate(θ)RZZ(2πθ)Testing:
openqasm3.parser.