Skip to content

Commit

Permalink
Merge pull request #59 from Schoyen/fix-td-tests
Browse files Browse the repository at this point in the history
Fix the time-dependent tests
  • Loading branch information
Schoyen committed Mar 26, 2021
2 parents db1d556 + fa090a6 commit 5166fb0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/test_oatdccd.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ def test_oatdccd_helium():

td_energies[i] = oatdccd.compute_energy(r.t, r.y)
dip_z[i] = oatdccd.compute_one_body_expectation_value(
r.t, r.y, system.dipole_moment[2]
r.t, r.y, system.position[2]
)

i += 1
r.integrate(time_points[i])

td_energies[i] = oatdccd.compute_energy(r.t, r.y)
dip_z[i] = oatdccd.compute_one_body_expectation_value(
r.t, r.y, system.dipole_moment[2]
r.t, r.y, system.position[2]
)

np.testing.assert_allclose(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_tdccsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def test_tdccsd():

td_energies[i] = tdccsd.compute_energy(r.t, r.y)
dip_z[i] = tdccsd.compute_one_body_expectation_value(
r.t, r.y, system.dipole_moment[2]
r.t, r.y, system.position[2]
).real
td_overlap[i] = tdccsd.compute_overlap(r.t, y0, r.y)

Expand All @@ -271,7 +271,7 @@ def test_tdccsd():

td_energies[i] = tdccsd.compute_energy(r.t, r.y)
dip_z[i] = tdccsd.compute_one_body_expectation_value(
r.t, r.y, system.dipole_moment[2]
r.t, r.y, system.position[2]
).real
td_overlap[i] = tdccsd.compute_overlap(r.t, y0, r.y)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_tdrccsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_tdrccsd_vs_tdccsd():
dip_z[0] = tdrccsd.compute_one_body_expectation_value(
r.t,
r.y,
system.dipole_moment[polarization_direction],
system.position[polarization_direction],
make_hermitian=False,
)
tau0[0] = t[0][0]
Expand All @@ -129,7 +129,7 @@ def test_tdrccsd_vs_tdccsd():
dip_z[i + 1] = tdrccsd.compute_one_body_expectation_value(
r.t,
r.y,
system.dipole_moment[polarization_direction],
system.position[polarization_direction],
make_hermitian=False,
)
tau0[i + 1] = t[0][0]
Expand Down

0 comments on commit 5166fb0

Please sign in to comment.