-
Notifications
You must be signed in to change notification settings - Fork 347
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
Sundry #674
Sundry #674
Changes from all commits
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 |
---|---|---|
|
@@ -351,7 +351,7 @@ def while_do(self, classical_reg, q_program): | |
label_start = LabelPlaceholder("START") | ||
label_end = LabelPlaceholder("END") | ||
self.inst(JumpTarget(label_start)) | ||
self.inst(JumpUnless(target=label_end, condition=Addr(classical_reg))) | ||
self.inst(JumpUnless(target=label_end, condition=classical_reg)) | ||
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. fixes #652 |
||
self.inst(q_program) | ||
self.inst(Jump(label_start)) | ||
self.inst(JumpTarget(label_end)) | ||
|
@@ -632,7 +632,7 @@ def __ne__(self, other): | |
return not self.__eq__(other) | ||
|
||
def __len__(self): | ||
return len(self._instructions) | ||
return len(self.instructions) | ||
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. include implicit declaration of readout in |
||
|
||
def __str__(self): | ||
""" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -304,6 +304,7 @@ class JumpConditional(AbstractInstruction): | |
""" | ||
Abstract representation of an conditional jump instruction. | ||
""" | ||
op = NotImplemented | ||
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. makes pycharm happy 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. 👍 |
||
|
||
def __init__(self, target, condition): | ||
if not isinstance(target, (Label, LabelPlaceholder)): | ||
|
@@ -400,6 +401,7 @@ class LogicalBinaryOp(AbstractInstruction): | |
""" | ||
The abstract class for binary logical classical instructions. | ||
""" | ||
op = NotImplemented | ||
|
||
def __init__(self, left, right): | ||
if not isinstance(left, MemoryReference): | ||
|
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.
sorted()
unnecessary. qc.qubits() guarantees sorting