From 923ba27f5680b13dbe5606a7262eb5b263e23093 Mon Sep 17 00:00:00 2001 From: Pablo Ventura Date: Fri, 10 Aug 2018 08:52:38 -0300 Subject: [PATCH] fix use np.array.all() instead of Python all() --- grove/deutsch_jozsa/deutsch_jozsa.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grove/deutsch_jozsa/deutsch_jozsa.py b/grove/deutsch_jozsa/deutsch_jozsa.py index 51c962c..1b21910 100644 --- a/grove/deutsch_jozsa/deutsch_jozsa.py +++ b/grove/deutsch_jozsa/deutsch_jozsa.py @@ -56,8 +56,8 @@ def is_constant(self, cxn, 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) - constant = all([bit == 0 for bit in bitstring]) - return constant + constant = np.array([bit == 0 for bit in bitstring]) + return constant.all() def _init_attr(self, bitstring_map): """