-
Notifications
You must be signed in to change notification settings - Fork 1
Support measuring registers in pyqrack #174
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
Changes from 2 commits
f110fe7
39dfff7
0cf41fd
28bc50d
6c14f4d
47375ed
bd040ed
0b1a721
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,9 +46,9 @@ class Measure(ir.Statement): | |
|
|
||
| name = "measure" | ||
| traits = frozenset({lowering.FromPythonCall()}) | ||
| qarg: ir.SSAValue = info.argument(QubitType) | ||
| qarg: ir.SSAValue = info.argument(QubitType | QRegType) | ||
| """qarg (Qubit): The qubit to measure.""" | ||
|
||
| carg: ir.SSAValue = info.argument(BitType) | ||
| carg: ir.SSAValue = info.argument(BitType | CRegType) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you need to add a
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the type check test. FWIW, mixing the types would have already triggered a
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be better to have the error at compile time compared to run time since in some cases you might not run the function with the simulator for awhile if at all. |
||
| """carg (Bit): The bit to store the result in.""" | ||
|
|
||
|
|
||
|
|
||
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.
so you can fix the type hinting by adding the following separately
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.
this is what it looks like in IDE
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.
@Roger-luo I had already done that following your message on slack. I just forgot to push the commit yesterday 😅