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

Fixing a bug in Unitttest SECTION("arnoldi (multiple eigenvectors)") #422

Open
TensorNetwork18 opened this issue Aug 24, 2023 · 1 comment

Comments

@TensorNetwork18
Copy link
Contributor

TensorNetwork18 commented Aug 24, 2023

Dear ITensor,

In file unittest/iterativesolvers_test.cc, some parts of the codes were broken and commented out.
The reason is the obtained left/right eigenvectors of the second dominant eigenvalue appear incorrect.

To fix this, I propose to change the following lines (from L387 to L391)

    auto v2r = randomITensor(i);
    auto lambda2r = arnoldi(ITensorMap(A-lambda1r*prime(v1r)*v1l),v2r,{"ErrGoal=",1E-14,"MaxIter=",20,"MaxRestart=",5});

    auto v2l = randomITensor(i);
    auto lambda2l = arnoldi(ITensorMap(swapPrime(A,0,1)-lambda1l*prime(v1l)*v1r),v2r,{"ErrGoal=",1E-14,"MaxIter=",20,"MaxRestart=",5});

to

    auto s1 = eltC(v1r*v1l);
    auto v2r = randomITensor(i);
    auto lambda2r = arnoldi(ITensorMap(A-(lambda1r/s1)*prime(v1r)*v1l),v2r,{"ErrGoal=",1E-14,"MaxIter=",20,"MaxRestart=",5});

    auto v2l = randomITensor(i);
    auto lambda2l = arnoldi(ITensorMap(swapPrime(A,0,1)-(lambda1l/s1)*prime(v1l)*v1r),v2l,{"ErrGoal=",1E-14,"MaxIter=",20,"MaxRestart=",5});
@mtfishman
Copy link
Member

Thanks, I think that makes sense. Could you make a pull request?

TensorNetwork18 added a commit to TensorNetwork18/ITensor that referenced this issue Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants