Skip to content

Commit

Permalink
removed blank spaces, corrected tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gsuarezr committed Sep 18, 2024
1 parent 370645b commit 313f837
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
1 change: 0 additions & 1 deletion qutip/solver/heom/bofin_baths.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,6 @@ def __new__(
return BosonicBath.from_environment(matsubara_approx, Q)



class FermionicBath(Bath):
"""
A helper class for constructing a fermionic bath from the expansion
Expand Down
30 changes: 1 addition & 29 deletions qutip/tests/core/test_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,6 @@
comtol = 1e-2


def spectral_density(w, lam, wc):
return lam*w*np.exp(-np.abs(w)/wc)


def power(w, lam, wc, T):
zero_mask = (w == 0)
nonzero_mask = np.invert(zero_mask)

S = np.zeros_like(w)
S[zero_mask] = 2 * T * spectral_density(1e-16, lam, wc) / 1e-16
S[nonzero_mask] = 2*np.sign(w[nonzero_mask])*spectral_density(
np.abs(w[nonzero_mask]), lam, wc)*(
n_thermal(w[nonzero_mask], T)+1)
return S


def correlation(t, lam, wc, T):
def integrand(w, t):
return spectral_density(w, lam, wc) / np.pi * (
(2 * n_thermal(w, T) + 1) * np.cos(w * t)
- 1j * np.sin(w * t)
)

result = quad_vec(lambda w: integrand(w, t), 0,
np.inf, epsabs=inttol, epsrel=inttol)
return result[0]


@pytest.fixture()
def params():
N = 3
Expand Down Expand Up @@ -83,7 +55,7 @@ def integrand(w, t):
)

result = quad_vec(lambda w: integrand(w, t), 0,
np.Inf, epsabs=1e-3, epsrel=1e-3)
np.inf, epsabs=1e-3, epsrel=1e-3)
return result[0]


Expand Down

0 comments on commit 313f837

Please sign in to comment.