-
Notifications
You must be signed in to change notification settings - Fork 342
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
Conversation
@@ -212,7 +212,7 @@ def run_and_measure(self, program: Program, trials: int) -> Dict[int, np.ndarray | |||
into a 2d numpy array of bitstrings, consider:: | |||
|
|||
bitstrings = qc.run_and_measure(...) | |||
bitstring_array = np.vstack(bitstrings[q] for q in sorted(qc.qubits())).T | |||
bitstring_array = np.vstack(bitstrings[q] for q in qc.qubits()).T |
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
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
fixes #652
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
include implicit declaration of readout in len()
@@ -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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
👍
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.
Looks fine to me.
Some of these changes remind me to ask: how many "you're using the old memory syntax style!" warnings does the test suite still throw?
lots! |
see diff