-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] Add quantum reference product type (#2254)
* Start on pure quantum struct usage in kernels Signed-off-by: Alex McCaskey <[email protected]> * Update the python bindings with new qstruct restrictions Signed-off-by: Alex McCaskey <[email protected]> * Enable default parenthesis constructor Signed-off-by: Alex McCaskey <[email protected]> * disallow recursive quantum struct Signed-off-by: Alex McCaskey <[email protected]> * Implement error handling for various cases in python Signed-off-by: Alex McCaskey <[email protected]> * spell fixes Signed-off-by: Alex McCaskey <[email protected]> * forgot to filter out __qpu__ methods on structs, those are allowed Signed-off-by: Alex McCaskey <[email protected]> * Add new quantum reference type, !quake.struq, and a couple of new operations: quake.make_struq and quake.get_member. These add the utility of having a product quantum reference type (to logically group together sets of qubits) but keep the classical and quantum dialects distinct. Update the tests, python ast bridge, C++ bridge, add codegen patterns, etc. * Whackamole games with the CI. Add roundtrip test on new type and ops. Update the python tests. Also change test to eliminate deprecation warnings. Add invlid IR checks for new operations. Add sanity checks. We do not want to allow a quantum struct that holds anything but non-owning references to qubits or qubit collections. Remove unused folder pattern. Workaround for overly assertive compiler warning. Reenable the hash-and-cache of extract_ref ops in the C++ bridge. This is a dubious optimization that we may actually want to take out at some point, but that should be part of a distinct/different PR. Update test to work around that pytest output can be shuffled. Add case to python for quake.struq type. Another python fix. Add explicit checks to utils.py. Stab in the dark. --------- Signed-off-by: Alex McCaskey <[email protected]> Co-authored-by: Alex McCaskey <[email protected]>
- Loading branch information
1 parent
f3907a3
commit e21a32b
Showing
29 changed files
with
1,242 additions
and
138 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
Oops, something went wrong.