Skip to content
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

Merged
merged 1 commit into from
Nov 9, 2018
Merged

Sundry #674

merged 1 commit into from
Nov 9, 2018

Conversation

mpharrigan
Copy link
Contributor

see diff

@@ -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
Copy link
Contributor Author

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))
Copy link
Contributor Author

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)
Copy link
Contributor Author

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes pycharm happy

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@ecpeterson ecpeterson left a 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?

@mpharrigan
Copy link
Contributor Author

how many "you're using the old memory syntax style!" warnings does the test suite still throw?

lots!

@mpharrigan mpharrigan merged commit 7898853 into rigetti:master Nov 9, 2018
@mpharrigan mpharrigan deleted the sundry branch November 9, 2018 17:02
@msohaibalam msohaibalam mentioned this pull request Nov 16, 2018
@karalekas karalekas added this to the v2.1.0 milestone Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants