ITensors.jl icon indicating copy to clipboard operation
ITensors.jl copied to clipboard

[ITensors] Expose new `KrylovKit.realeigsolve` features to `dmrg`

Open corbett5 opened this issue 1 year ago • 6 comments

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.
  • [x] I have performed a self-review of my own code.
  • [x] I have commented my code, particularly in hard-to-understand areas.
  • [ ] I have added tests that verify the behavior of the changes I made.
  • [x] I have made corresponding changes to the documentation.
  • [ ] My changes generate no new warnings.
  • [x] Any dependent changes have been merged and published in downstream modules.

corbett5 avatar Oct 17 '24 20:10 corbett5

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 avatar Oct 17 '24 22:10 mtfishman

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

corbett5 avatar Oct 18 '24 17:10 corbett5

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.

mtfishman avatar Oct 18 '24 23:10 mtfishman

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.

corbett5 avatar Oct 19 '24 03:10 corbett5

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.

mtfishman avatar Oct 19 '24 15:10 mtfishman

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? https://github.com/ITensor/ITensorMPS.jl/issues/40

corbett5 avatar Oct 21 '24 17:10 corbett5

@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 avatar Oct 28 '24 18:10 mtfishman

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

mtfishman avatar Nov 19 '24 22:11 mtfishman