Skip to content

Commit

Permalink
daily
Browse files Browse the repository at this point in the history
  • Loading branch information
gsuarezr committed Feb 19, 2024
1 parent dd1f104 commit adaca75
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions qutip/tests/solver/heom/test_bofin_solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ def test_parity(self):
# system: two fermions
N = 2
d_1 = fdestroy(N, 0)
d_2 = fcreate(N, 1)
d_2 = fdestroy(N, 1)
# bath params:
mu = 0. # chemical potential
Gamma = 1 # coupling strenght
Expand All @@ -1152,25 +1152,24 @@ def test_parity(self):
* d_2) + U * d_1.dag() * d_1 * d_2.dag() * d_2

L = liouvillian(H)
bath1 = LorentzianBath(
bath1 = LorentzianPadeBath(
Q=d_1, gamma=2 * Gamma, w=W, mu=mu, T=1 / beta, Nk=Nk,
tag="Lead 1")
bath2 = LorentzianBath(
bath2 = LorentzianPadeBath(
Q=d_2, gamma=2 * Gamma, w=W, mu=mu, T=1 / beta, Nk=Nk,
tag="Lead 2")
resultHEOMPade = HEOMSolver(L, [bath1, bath2], depth, odd_parity=True)
rhoss, _ = resultHEOMPade.steady_state()
rhoss = rhoss.full()
print(rhoss)
expected_odd = np.diag(
[0.68472977, -0.18472977, -0.18472977, 0.68472977])
expected = np.diag([0.39376747, 0.10623253, 0.10623253, 0.39376747])
assert np.isclose(rhoss, expected_odd).all()
expected_odd = np.diag([-0.18472, 0.68472, 0.68472, -0.18472])
expected = np.diag([0.10623, 0.39376, 0.39376, 0.10623])
assert np.isclose(rhoss, expected_odd,atol=1e-5).all()
resultHEOMPade = HEOMSolver(L, [bath1, bath2], depth, odd_parity=False)
rhoss, _ = resultHEOMPade.steady_state()
rhoss = rhoss.full()
print(rhoss)
assert np.isclose(rhoss, expected).all()
assert np.isclose(rhoss, expected,atol=1e-5).all()


class TestHeomsolveFunction:
Expand Down

0 comments on commit adaca75

Please sign in to comment.