grove icon indicating copy to clipboard operation
grove copied to clipboard

Update deutsch_jozsa.py

Open dawidkopczyk opened this issue 6 years ago • 0 comments

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).

dawidkopczyk avatar Mar 31 '18 16:03 dawidkopczyk