diff --git a/src/dmrg/mps.hpp b/src/dmrg/mps.hpp index c6e5753b..3a27cecc 100644 --- a/src/dmrg/mps.hpp +++ b/src/dmrg/mps.hpp @@ -667,9 +667,9 @@ template struct MPSInfo { } ubond_t get_max_bond_dimension() const { total_bond_t max_bdim = 0; - for (int i = 0; i <= n_sites; i++) + for (int i = 0; i < n_sites; i++) max_bdim = max(left_dims[i]->n_states_total, max_bdim); - for (int i = n_sites; i >= 0; i--) + for (int i = n_sites; i > 0; i--) max_bdim = max(right_dims[i]->n_states_total, max_bdim); return (ubond_t)min((uint64_t)max_bdim, (uint64_t)numeric_limits::max());