From 313f837c4b05dc7f7594a6f2e7cee53396c5a0da Mon Sep 17 00:00:00 2001 From: mcditooss Date: Wed, 18 Sep 2024 19:53:16 +0200 Subject: [PATCH] removed blank spaces, corrected tests --- qutip/solver/heom/bofin_baths.py | 1 - qutip/tests/core/test_environment.py | 30 +--------------------------- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/qutip/solver/heom/bofin_baths.py b/qutip/solver/heom/bofin_baths.py index 885c97c512..79468376d8 100644 --- a/qutip/solver/heom/bofin_baths.py +++ b/qutip/solver/heom/bofin_baths.py @@ -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 diff --git a/qutip/tests/core/test_environment.py b/qutip/tests/core/test_environment.py index 4d8f1299b7..dff626face 100644 --- a/qutip/tests/core/test_environment.py +++ b/qutip/tests/core/test_environment.py @@ -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 @@ -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]