-
Notifications
You must be signed in to change notification settings - Fork 41
Fix #253: add classes BaseCommand and BaseInstruction
#406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix #253: add classes BaseCommand and BaseInstruction
#406
Conversation
This commit introduces the classes `BaseCommand` and `BaseInstruction`, and removes the unused instructions `_XC` and `_ZC`. These classes can be used for type checking. They contrast with the type aliases `Command` and `Instruction`: - `BaseCommand` and `BaseInstruction` are open types and the user can define new subclasses. For instance, Veriphix introduces blind preparation commands and measurements. - `Command` and `Instruction` are closed types that contain exactly the commands of the measurement calculus (`N | M | E | C | X | Z | S | T`) and the instructions supported by the transpiler.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #406 +/- ##
==========================================
+ Coverage 84.87% 84.90% +0.02%
==========================================
Files 46 46
Lines 6639 6625 -14
==========================================
- Hits 5635 5625 -10
+ Misses 1004 1000 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
matulni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, proposal is elegant and nice! I made a small comment only, otherwise looks good.
|
Thanks! And good idea to generalize to the circuit instructions too. This might come in handy in veriphix. |
emlynsg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This commit introduces the classes
BaseCommandandBaseInstruction, and removes the unused instructions_XCand_ZC. These classes can be used for type checking. They contrast with the type aliasesCommandandInstruction:BaseCommandandBaseInstructionare open types and the user can define new subclasses. For instance, Veriphix introduces blind preparation commands and measurements.CommandandInstructionare closed types that contain exactly the commands of the measurement calculus (N | M | E | C | X | Z | S | T) and the instructions supported by the transpiler.