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

[ITensorMPS] Expose new KrylovKit.realeigsolve features to dmrg #1546

Closed
wants to merge 1 commit into from

Conversation

corbett5
Copy link
Contributor

@corbett5 corbett5 commented Oct 17, 2024

Description

As of v0.8 KrylovKit supports finding the eigenvectors of real non-symmetric operators with real eigenvalues. This eliminates the need for complex arithmetic. For my problem it produces the same results as the standard hermitian=false algorithm.

I added an option to specify an early return from the eigensolve. I haven't tested this out but the documentation suggests it could significantly improve performance when the initial guess is very good, which I think could be a common case in later sweeps of DMRG so worth trying out.

I also forwarded the eigsolve_verbosity on to eigensolve. Previously this argument was ignored.

How Has This Been Tested?

It has not.

Checklist:

  • My code follows the style guidelines of this project. Please run using JuliaFormatter; format(".") in the base directory of the repository (~/.julia/dev/ITensors) to format your code according to our style guidelines.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that verify the behavior of the changes I made.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.

@mtfishman mtfishman changed the title Exposed new KrylovKit::eigsolve features to dmrg. Exposed new KrylovKit.eigsolve features to dmrg Oct 17, 2024
@mtfishman
Copy link
Member

I didn't know about KrylovKit.realeigsolve, that's really cool! That's something I've wanted in multiple projects and wasn't even sure if it was possible/practical to do. @JoeyT1994 this is something we were discussing.

I'll take a look at this PR when I get a chance.

@mtfishman mtfishman changed the title Exposed new KrylovKit.eigsolve features to dmrg [ITensors] Expose new KrylovKit.realeigsolve features to dmrg Oct 17, 2024
@corbett5
Copy link
Contributor Author

I measured the impact of eigsolve_eager and it is small but noticeable. The following is with eigensolve_krylovdim=10 and eigensolve_maxiter=10 with an already well converged MPS (what I imagine the optimal conditions to measure the impact is). For eight sweeps eigensolve_eager=false took 3726.6s ± 10s and with eigensolve_eager=true took 3592.8s ± 55s

@mtfishman
Copy link
Member

I measured the impact of eigsolve_eager and it is small but noticeable. The following is with eigensolve_krylovdim=10 and eigensolve_maxiter=10 with an already well converged MPS (what I imagine the optimal conditions to measure the impact is). For eight sweeps eigensolve_eager=false took 3726.6s ± 10s and with eigensolve_eager=true took 3592.8s ± 55s

The difference should get larger as you make eigsolve_krylovdim larger.

@corbett5
Copy link
Contributor Author

The difference should get larger as you make eigsolve_krylovdim larger.

That's what I expect as well, but 10 with 10 iterations is already 33x larger than ITensors` default.

@mtfishman
Copy link
Member

The difference should get larger as you make eigsolve_krylovdim larger.

That's what I expect as well, but 10 with 10 iterations is already 33x larger than ITensors` default.

eager only relates to the number of Krylov states per iteration/restart, not the number of iterations/restarts. So it won't reach maxiter even if eager=false if it is converged to tol by the end of an earlier iteration/restart.

@corbett5
Copy link
Contributor Author

eager only relates to the number of Krylov states per iteration/restart, not the number of iterations/restarts. So it won't reach maxiter even if eager=false if it is converged to tol by the end of an earlier iteration/restart.

Gotcha, that makes sense. This is the what slowed down tdvp too right? ITensor/ITensorMPS.jl#40

@mtfishman mtfishman changed the title [ITensors] Expose new KrylovKit.realeigsolve features to dmrg [ITensorMPS] Expose new KrylovKit.realeigsolve features to dmrg Oct 28, 2024
@mtfishman
Copy link
Member

@corbett5 could you move this PR over to https://github.com/ITensor/ITensorMPS.jl? All of the MPS/MPO code is over there now.

@mtfishman
Copy link
Member

I'll close this PR since it needs to be moved to the ITensorMPS.jl repository.

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

Successfully merging this pull request may close these issues.

2 participants