From 98981842d57fc89ab2305d6e34b1117d381dfd5a Mon Sep 17 00:00:00 2001 From: AlexisRalli Date: Tue, 17 Oct 2023 10:19:08 -0400 Subject: [PATCH] changed or statement in is_noncontextual --- symmer/operators/base.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/symmer/operators/base.py b/symmer/operators/base.py index ba144337..3c853d4d 100644 --- a/symmer/operators/base.py +++ b/symmer/operators/base.py @@ -1130,11 +1130,12 @@ def is_noncontextual(self) -> bool: # check for overlap (array of ones == no overlap) return np.all(np.sum(clique_mask, axis=0) == 1) else: + gens = self.generators + if check_adjmat_noncontextual(gens.adjacency_matrix): + return True from symmer.utils import get_generators_including_xz_products gens_xyz = get_generators_including_xz_products(self) - gens = self.generators - return check_adjmat_noncontextual(gens.adjacency_matrix) or check_adjmat_noncontextual( - gens_xyz.adjacency_matrix) + return check_adjmat_noncontextual(gens_xyz.adjacency_matrix)