Skip to content

Commit

Permalink
codeclimate details
Browse files Browse the repository at this point in the history
  • Loading branch information
gsuarezr committed Jan 25, 2024
1 parent 3b45396 commit c218a89
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion qutip/solver/heom/bofin_baths.py
Original file line number Diff line number Diff line change
Expand Up @@ -1281,4 +1281,4 @@ def _calc_chi(self, Nk):
alpha_p += alpha_p.transpose()
evals = eigvalsh(alpha_p)
chi = [-2. / val for val in evals[0: Nk - 1]]
return chi
return chi
12 changes: 6 additions & 6 deletions qutip/solver/heom/bofin_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,9 @@ def get_fit(
N : optional,int
Number of underdamped oscillators to use,
if set to False it is found automatically.
Nk : optional,int
Number of exponential terms used to approximate the bath correlation
functions. Defaults to 5
Number of exponential terms used to approximate the bath
correlation functions. Defaults to 5
final_rmse : float
Desired normalized root mean squared error .
lower : list
Expand All @@ -147,7 +146,7 @@ def get_fit(
spec_n = len(params[0])
end = time()
fit_time = end - start
bath = self._generate_bath(params,Nk)
bath = self._generate_bath(params, Nk)
bath.spectral_density = self._J_fun
summary = gen_summary(
fit_time, rmse, N, "The Spectral Density", *params)
Expand Down Expand Up @@ -678,7 +677,8 @@ def _fit(
except Exception:
sigma = 1e-4
C_max = abs(max(C, key=abs))
if C_max == 0: ## When The correlation does not have imaginary or real part
if C_max == 0:
# When The correlation does not have imaginary or real part
rmse = 0
params = [0, 0, 0]
return rmse, params
Expand Down Expand Up @@ -833,4 +833,4 @@ def two_column_summary(
formatted_line1 = f"{line1:<{max_length1}} |"
formatted_line2 = f"{line2:<{max_length2}}"
full_summary += formatted_line1 + formatted_line2 + "\n"
return full_summary
return full_summary

0 comments on commit c218a89

Please sign in to comment.