-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Static CustomOp with lowering to regular custom Op (#1387)
**Context:** Currently, the classical parameters of quantum gates are compiled dynamically even if they are known at compile time. We would like the IR to be extended to support literal values as opposed to SSA Values for such static parameters. **Description of the Change:** This is achieved by adding a new type of gate called StaticCustomOp which is similar to CustomOp except that it uses a DenseF64ArrayAttr which lists all the literal values for parameters in square bracket. For example the following IR: ``` %c = llvm.mlir.constant(2.000000e-01 : f64) %result = quantum.custom "RX"(%c) %qubit ``` would change to: ``` %result = quantum.static_custom "RX" [2.000000e-01] %qubit ``` The static custom ops are then lowered to the regular custom ops after apply-transform-sequence pass for the rest of the compilation process. Currently we have **not** supported Multirz, and GlobalShift. **Benefits:** More flexibility in case there is a lack of support for dynamic quantum circuits. **Possible Drawbacks:** **Related GitHub Issues:** Static parameters [sc-73581] --------- Co-authored-by: Erick Ochoa Lopez <erick.ochoalopez@xanadu.ai>
- Loading branch information
1 parent
11e4e4f
commit 48edd02
Showing
30 changed files
with
587 additions
and
74 deletions.
There are no files selected for viewing
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
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
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
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.