Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the wrong definition of avnorm in applyExp #315

Open
wants to merge 3 commits into
base: v3
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions itensor/iterativesolvers.h
Original file line number Diff line number Diff line change
Expand Up @@ -988,15 +988,14 @@ applyExp(BigMatrixT const& H, ITensor& phi,
auto nmatvec = 0;

double beta = 0;
// Matrix-vector multiplication
if(debug_level >= 0)
nmatvec++;
H.product(v1, w);
for (int iter=0; iter < max_iter; ++iter)
{
int tmat_size=iter+1;
// Matrix-vector multiplication
if(debug_level >= 0)
nmatvec++;
H.product(v1, w);

double avnorm = norm(w);

double alpha = real(eltC(dag(w) * v1));
bigTmat(iter, iter) = alpha;
w -= alpha * v1;
Expand All @@ -1022,6 +1021,11 @@ applyExp(BigMatrixT const& H, ITensor& phi,
lanczos_vectors.push_back(v1);
bigTmat(iter+1, iter) = beta;
bigTmat(iter, iter+1) = beta;

if(debug_level >= 0)
nmatvec++;
H.product(v1, w);
double avnorm = norm(w);

// Convergence check
if (iter > 0)
Expand Down Expand Up @@ -1081,4 +1085,3 @@ applyExp(BigMatrixT const& H, ITensor& phi,
} //namespace itensor

#endif