fix use np.array.all() instead of Python all()#176
Open
pablogventura wants to merge 1 commit intorigetti:masterfrom
Open
fix use np.array.all() instead of Python all()#176pablogventura wants to merge 1 commit intorigetti:masterfrom
pablogventura wants to merge 1 commit intorigetti:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix this error using Numpy when i call to is_constant in deutsch jozsa:
`/usr/local/lib/python2.7/dist-packages/grove/deutsch_jozsa/deutsch_jozsa.pyc in is_constant(self, cxn, bitstring_map)
57 # We are only running a single shot, so we are only interested in the first element.
58 bitstring = np.array(returned_bitstring, dtype=int)
---> 59 constant = all([bit == 0 for bit in bitstring])
60 return constant
61
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
`
Now it uses all function from Numpy instead of builtin all function.