Skip to content

Commit 21b1c2f

Browse files
committed
Change comparison to ZigZagLayout
Per [comments by @pavoljuhas in review](#430 (comment)), this rewrites a couple of lines to simplify a comparisons.
1 parent 709a203 commit 21b1c2f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

recirq/fermi_hubbard/parameters.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,7 @@ def representative_parameters(self) -> 'FermiHubbardParameters':
596596
def equals_for_rescaling(self, other: 'FermiHubbardParameters') -> bool:
597597
if not isinstance(other, FermiHubbardParameters):
598598
return False
599-
if not isinstance(self.layout, type(other.layout)):
600-
return False
601-
if isinstance(self.layout, ZigZagLayout):
599+
if isinstance(self.layout, ZigZagLayout) and isinstance(other.layout, ZigZagLayout):
602600
interacting = not np.allclose(self.hamiltonian.u, 0.0)
603601
other_interacting = not np.allclose(other.hamiltonian.u, 0.0)
604602
return interacting == other_interacting

0 commit comments

Comments
 (0)