From e4a0cc853ea6e3c74505dc03a0ccf5936ea8e81a Mon Sep 17 00:00:00 2001 From: Huanchen Zhai Date: Mon, 23 Sep 2024 23:40:50 -0700 Subject: [PATCH] fix get_max_bond_dimension --- src/dmrg/mps.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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());