Skip to content

Commit

Permalink
typo in default maxfev
Browse files Browse the repository at this point in the history
  • Loading branch information
gsuarezr committed Oct 25, 2024
1 parent b126e97 commit 12a6969
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion qutip/core/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions qutip/tests/core/test_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand Down

0 comments on commit 12a6969

Please sign in to comment.