grove
grove copied to clipboard
Update deutsch_jozsa.py
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).