diff --git a/qutip/core/environment.py b/qutip/core/environment.py index fe10c838e0..17a1b6dce0 100644 --- a/qutip/core/environment.py +++ b/qutip/core/environment.py @@ -574,7 +574,7 @@ def approx_by_sd_fit( self, wlist: ArrayLike, Nk: int = 1, target_rsme: float = 5e-6, Nmax: int = 10, guess: list[float] = None, lower: list[float] = None, upper: list[float] = None, tag: Any = None, combine: bool = True, - sigma: float = 1e-4, maxfev: int = 1e-6 + sigma: float = 1e-4, maxfev: int = 100_000 ) -> tuple[ExponentialBosonicEnvironment, dict[str, Any]]: r""" Generates an approximation to this environment by fitting its spectral diff --git a/qutip/tests/core/test_environment.py b/qutip/tests/core/test_environment.py index dff626face..cb59190175 100644 --- a/qutip/tests/core/test_environment.py +++ b/qutip/tests/core/test_environment.py @@ -123,7 +123,7 @@ def test_approx_by_cf_fit(self, params): bb5 = BosonicEnvironment.from_correlation_function( corr[k], t, T=T[k]) bb6, finfo = bb5.approx_by_cf_fit( - t, target_rsme=None, Nr_max=2, Ni_max=1) + t, target_rsme=None, Nr_max=2, Ni_max=1,sigma=1e-2) assert np.isclose(bb6.correlation_function(t), corr[k], atol=5*comtol).all() assert np.isclose(bb6.power_spectrum(w2), power( @@ -136,7 +136,7 @@ def test_approx_by_sd_fit(self, params): for k in range(len(lam)): sd = spectral_density(t, gamma[k], w0[k], lam[k]) bb5 = BosonicEnvironment.from_spectral_density(sd, t, T=T[k]) - bb6, finfo = bb5.approx_by_sd_fit(w, Nmax=1, Nk=10) + bb6, finfo = bb5.approx_by_sd_fit(w, Nmax=1, Nk=10,sigma=1) # asking for more precision that the Bosonic enviroment has may # violate this (due to the interpolation and it's easily fixed # using a denser range). I could have set N=1 but thought this was