Skip to content

Commit

Permalink
Correct typo in stop criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulaGarciaMolina authored Jan 17, 2024
1 parent 26e5770 commit aa963b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/seemps/optimization/descent.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def energy_and_variance(state: MPS) -> tuple[MPS, float, float, float]:
variances.append(variance)
if E < best_energy:
best_energy, best_vector, _ = E, state, variance
E_mean: float = np.mean(energies[(-max(-k_mean - 1, len(energies))) : -1]) # type: ignore
E_mean: float = np.mean(energies[(-min(k_mean, len(energies)-1))-1 : -1]) # type: ignore
if E_mean - last_E_mean >= abs(tol) or E_mean - last_E_mean >= -abs(tol):
message = f"Energy converged within tolerance {tol}"
converged = True
Expand Down

0 comments on commit aa963b1

Please sign in to comment.