-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Gate Extensions and ♻️ QASM Parser Refactor (#280)
This (rather large) PR builds on cda-tum/dd_package#144 and extends the capabilities of the QFR by **_eight_** more gates: - `DCX` (double CNOT) - `ECR` (cross-resonance) - `RZZ(\theta)` (ZZ rotation gate) - `RXX(\theta)` (XX rotation gate) - `RYY(\theta)` (YY rotation gate) - `RZX(\theta)` (ZX rotation gate) - `XXMinusYY(\theta, \beta)` (XX-YY rotation gate) - `XXPlusYY(\theta, \beta)` (XX+YY rotation gate) It also includes initial support for the OpenQASM 3.0 `gphase` global phase gate. The addition of these new gates made it clear, that our QASM parser needs some major refactors to remain extendable and performant. This PR performs such a refactoring, with the following key take-aways: - 🐛 All gates that are natively supported by the QFR are now directly read in instead of recursing down until `U` and `CX`. This fixes the long-outstanding bug outlined in #275. - 🚸 Handling of gates and definitions is unified much more than before. The number of tokens has been reduced and lots of duplicate code and unnecessary special case handling has been removed. - ⚡ The default `qelib1.inc` has been reduced to a minimum due to most gates being natively supported now. This should speed up parsing of every single QASM file. - 🔥 The number of gate parameters is no longer fixed to a maximum of three. Over the course of this refactor, a breaking change was introduced regarding the parameter order in `U3` and `U2` gates, in order to align our definition with the one Qiskit uses. This requires calls to `.u3(...)`, `.u2(...)`, and constructions of the respective gates to be updated correspondingly. - 🚸 Implements #276
- Loading branch information
Showing
33 changed files
with
1,715 additions
and
1,826 deletions.
There are no files selected for viewing
Submodule dd_package
updated
6 files
+1 −1 | .github/workflows/ci.yml | |
+2 −2 | .pre-commit-config.yaml | |
+100 −0 | include/dd/GateMatrixDefinitions.hpp | |
+222 −5 | include/dd/Package.hpp | |
+44 −25 | include/dd/UniqueTable.hpp | |
+269 −1 | test/test_package.cpp |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 file contains 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 file contains 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
Oops, something went wrong.