Skip to content

Update deutsch_jozsa.py#146

Open
dawidkopczyk wants to merge 1 commit intorigetti:masterfrom
dawidkopczyk:patch-1
Open

Update deutsch_jozsa.py#146
dawidkopczyk wants to merge 1 commit intorigetti:masterfrom
dawidkopczyk:patch-1

Conversation

@dawidkopczyk
Copy link

In Python 3.6, the lines:
bitstring = np.array(returned_bitstring, dtype=int)
constant = all([bit == 0 for bit in bitstring])
produce an error:

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

due to the nested list (converting to numpy array does not fix the problem, the list must be extracted by indexing).

In Python 3.6, the lines:
bitstring = np.array(returned_bitstring, dtype=int) 
constant = all([bit == 0 for bit in bitstring])
produce an error.
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.

2 participants

Comments