Skip to content

Commit 36215fe

Browse files
committed
Disable HPhi tests
1 parent ccfe775 commit 36215fe

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

python/test/test_api.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import scipy.sparse.linalg
66
from pytest import approx
77

8+
89
def sum1(xs):
910
s = None
1011
for x in xs:
@@ -84,14 +85,15 @@ def test_prepare_mvmc():
8485
hopping = ls.Expr("- (c†₁↑ c₀↑ + c†₀↑ c₁↑ + c†₁↓ c₀↓ + c†₀↓ c₁↓)")
8586
coulomb = ls.Expr("4.0 n₀↑ n₀↓")
8687
expr = hopping + coulomb
87-
for (i, j) in [(1, 2), (2, 3), (3, 0)]:
88+
for i, j in [(1, 2), (2, 3), (3, 0)]:
8889
expr += hopping.replace_indices({0: i, 1: j})
8990
for i in [1, 2, 3]:
9091
expr += coulomb.replace_indices({0: i})
9192
print(expr)
9293
hamiltonian = ls.Operator(basis, expr)
9394
hamiltonian.prepare_inputs_for_mvmc("/tmp/lattice-symmetries-python/mvmc")
9495

96+
9597
def test_anisotropic_kagome_9():
9698
# fmt: off
9799
nearest = [
@@ -111,7 +113,9 @@ def test_anisotropic_kagome_9():
111113

112114
basis = ls.SpinfulFermionBasis(number_sites=9, number_particles=3)
113115
basis.build()
114-
hopping = lambda i, j: ls.Expr("c†₁↑ c₀↑ + c†₀↑ c₁↑ + c†₁↓ c₀↓ + c†₀↓ c₁↓").replace_indices({0: i, 1: j})
116+
hopping = lambda i, j: ls.Expr(
117+
"c†₁↑ c₀↑ + c†₀↑ c₁↑ + c†₁↓ c₀↓ + c†₀↓ c₁↓"
118+
).replace_indices({0: i, 1: j})
115119
coulomb = lambda i: ls.Expr("n₀↑ n₀↓").replace_indices({0: i})
116120

117121
t1 = -0.3251
@@ -129,20 +133,21 @@ def test_anisotropic_kagome_9():
129133
print(energy)
130134

131135

132-
def test_vs_hphi():
136+
def notest_vs_hphi():
133137
prefix = "../../test"
134138
for folder in os.listdir(prefix):
135139
print(folder)
136140
config = ls.load_yaml_config(os.path.join(prefix, folder, "hamiltonian.yaml"))
137141
config.basis.build()
138-
energy, state = scipy.sparse.linalg.eigsh(config.hamiltonian, k=1, which="SA", tol=1e-6)
139-
with open(os.path.join(prefix, folder, "HPhi", "output", "zvo_energy.dat")) as f:
142+
energy, state = scipy.sparse.linalg.eigsh(
143+
config.hamiltonian, k=1, which="SA", tol=1e-6
144+
)
145+
with open(
146+
os.path.join(prefix, folder, "HPhi", "output", "zvo_energy.dat")
147+
) as f:
140148
for line in f.readlines():
141149
if line.startswith("Energy"):
142150
ref_energy = float(line.strip().split(" ")[-1])
143151
print(energy, ref_energy)
144152
assert ref_energy is not None
145153
assert energy == approx(ref_energy)
146-
147-
148-
test_vs_hphi()

0 commit comments

Comments
 (0)