QuantumToolbox.jl
QuantumToolbox.jl copied to clipboard
Lanczos-based `spectrum` method
Checklist
Thank you for contributing to QuantumToolbox.jl! Please make sure you have finished the following tasks before opening the PR.
- [x] Please read Contributing to Quantum Toolbox in Julia.
- [x] Any code changes were done in a way that does not break public API.
- [x] Appropriate tests were added and tested locally by running:
make test. - [ ] Any code changes should be
juliaformatted by running:make format. - [x] All documents (in
docs/folder) related to code changes were updated and able to build locally by running:make docs. - [ ] (If necessary) the
CHANGELOG.mdshould be updated (regarding to the code changes) and built by running:make changelog.
Request for a review after you have completed all the tasks. If you have not finished them all, you can also open a Draft Pull Request to let the others know this on-going work.
Description
Lanczos-based spectrum method.
Related issues or PRs
Resolves #463.
Additional context
This PR implements the non-symmetric variant of the Hermitian Lanczos method described in Koch2011.
The pseudo-code for the non-symmetric Lanczos algorithm can be found in Algorithm 6.6 of Saad2011, with the difference that this implementation works directly with row/col vectors (i.e. bras & kets) instead of col vectors only.
At each step, the running estimate for the result is updated via a Wallis-Euler recursion to avoid recomputing the whole continued fraction each time, and the convergence is evaluated accordingly.