From 5cfa36c3ccd7225990c558095ed517d5f7a3316e Mon Sep 17 00:00:00 2001 From: dawidkopczyk <32499114+dawidkopczyk@users.noreply.github.com> Date: Sat, 31 Mar 2018 17:51:55 +0100 Subject: [PATCH] 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. --- grove/deutsch_jozsa/deutsch_jozsa.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grove/deutsch_jozsa/deutsch_jozsa.py b/grove/deutsch_jozsa/deutsch_jozsa.py index 420add5..61f7eb0 100644 --- a/grove/deutsch_jozsa/deutsch_jozsa.py +++ b/grove/deutsch_jozsa/deutsch_jozsa.py @@ -55,7 +55,7 @@ def is_constant(self, cxn, bitstring_map): self._init_attr(bitstring_map) returned_bitstring = cxn.run_and_measure(self.deutsch_jozsa_circuit, self.computational_qubits) # We are only running a single shot, so we are only interested in the first element. - bitstring = np.array(returned_bitstring, dtype=int) + bitstring = returned_bitstring[0] constant = all([bit == 0 for bit in bitstring]) return constant