diff --git a/qucumber/utils/data.py b/qucumber/utils/data.py index 80ca039b..302b9c16 100644 --- a/qucumber/utils/data.py +++ b/qucumber/utils/data.py @@ -58,7 +58,7 @@ def load_data(tr_samples_path, tr_psi_path=None, tr_bases_path=None, bases_path= for i in range(len(bases_data)): tmp = "" for j in range(len(bases_data[i])): - if bases_data[i][j] is not " ": + if bases_data[i][j] != " ": tmp += bases_data[i][j] bases.append(tmp) data.append(bases) diff --git a/setup.py b/setup.py index 99d06f5c..be554812 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ style_requires = [ "radon>=2.2.0", "black==18.6b4; python_version>='3.6'", - "flake8>=3.5.0", + "flake8>=3.7.5", "flake8-per-file-ignores>=0.6", "flake8-bugbear>=18.2.0", ] diff --git a/tests/grads_utils.py b/tests/grads_utils.py index 9457828c..bbda131e 100644 --- a/tests/grads_utils.py +++ b/tests/grads_utils.py @@ -131,7 +131,7 @@ def transform_bases(self, bases_data): for i in range(len(bases_data)): tmp = "" for j in range(len(bases_data[i])): - if bases_data[i][j] is not " ": + if bases_data[i][j] != " ": tmp += bases_data[i][j] bases.append(tmp) return bases @@ -151,7 +151,7 @@ def rotate_psi(self, basis, unitary_dict, vis): num_nontrivial_U = 0 nontrivial_sites = [] for j in range(N): - if basis[j] is not "Z": + if basis[j] != "Z": num_nontrivial_U += 1 nontrivial_sites.append(j) sub_state = self.nn_state.generate_hilbert_space(num_nontrivial_U) @@ -159,7 +159,7 @@ def rotate_psi(self, basis, unitary_dict, vis): for xp in range(1 << num_nontrivial_U): cnt = 0 for j in range(N): - if basis[j] is not "Z": + if basis[j] != "Z": v[j] = sub_state[xp][cnt] cnt += 1 else: