Skip to content

Fix #14: add all standard OpenQASM gates - #15

Open
thierry-martinez wants to merge 36 commits into
TeamGraphix:mainfrom
thierry-martinez:add_openqasm_gates
Open

Fix #14: add all standard OpenQASM gates#15
thierry-martinez wants to merge 36 commits into
TeamGraphix:mainfrom
thierry-martinez:add_openqasm_gates

Conversation

@thierry-martinez

Copy link
Copy Markdown
Collaborator

This commit adds support for all the gates specified by the OpenQASM 3.0 specification that were previously missing: SDG, T, TDG, SX, SXDG, CY, P, U, CP, CRX, CRY, CRZ, CU, CSWAP, and GPHASE.

These gates are also added natively in Graphix in TeamGraphix/graphix#592, eliminating the need for translation.

The gates u1, u2, and u3, which are retained for compatibility with OpenQASM 2.0, are translated.

This commit adds support for all the gates specified by the OpenQASM
3.0 specification that were previously missing: SDG, T, TDG, SX, SXDG,
CY, P, U, CP, CRX, CRY, CRZ, CU, CSWAP, and GPHASE.

These gates are also added natively in Graphix in
TeamGraphix/graphix#592, eliminating the need for translation.

The gates u1, u2, and u3, which are retained for compatibility
with OpenQASM 2.0, are translated.

@matulni matulni left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix ! I made some comments, but it's mostly for my understanding.

Comment thread graphix_qasm_parser/parser.py
Comment thread graphix_qasm_parser/parser.py
Comment thread tests/test_parser.py Outdated
Comment thread tests/test_parser.py Outdated
Comment thread tests/test_parser.py Outdated
Comment thread tests/test_parser.py Outdated
Comment thread tests/test_parser.py Outdated

@matulni matulni left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

thierry-martinez added a commit to thierry-martinez/graphix that referenced this pull request Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants