Skip to content
Snippets Groups Projects
Commit f6f2d996 authored by Rafal Skolasinski's avatar Rafal Skolasinski Committed by Joseph Weston
Browse files

improve test for double substitutions in 'continuum.discretize'

Previously, only onsite matrix elements were tested, whereas the
test should have also tested the hopping elements.
parent 5977f1fa
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -395,7 +395,7 @@ def test_numeric_functions_basic_string():
@pytest.mark.parametrize('e_to_subs, e, subs', [
('A * k_x + V', '(A + B) * k_x + A + B', {'A': 'A + B', 'V': 'A + B'}),
('A * k_x + A', '(A + B) * k_x + A + B', {'A': 'A + B'}),
])
def test_numeric_functions_with_subs(e_to_subs, e, subs):
p = {'A': 1, 'B': 2}
......@@ -405,6 +405,10 @@ def test_numeric_functions_with_subs(e_to_subs, e, subs):
lat = next(iter(builder_direct.sites()))[0]
assert builder_direct[lat(0)](None, **p) == builder_subs[lat(0)](None, **p)
hop_direct = builder_direct[lat(0), lat(1)](None, None, **p)
hop_subs = builder_subs[lat(0), lat(1)](None, None, **p)
assert hop_direct == hop_subs
def test_numeric_functions_advance():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment