Skip to content

Conversation

@MatP1337
Copy link
Contributor

@MatP1337 MatP1337 commented Nov 13, 2025

This pull request add a complete implementation of Exact and efficient Lanczos method on a quantum computer for ground state energy estimation.

The quantum Lanczos method efficiently constructs a Krylov subspace by applying Chebyshev polynomials of the Hamiltonian to an initial state. It avoids the classical barrier of exponential cost in representing Krylov vectors.

Implements the following steps:
1. inner_lanczos: construct the circuit
2. lanczos_expvals: runs quantum Lanczos subroutine to obtain Chebyshev expectation values $\langle T_k(H)\rangle$.
3. build_S_H_from_Tk: builds overlap and Hamiltonian subspace matrices $(\mathbf{S}, \mathbf{H})$.
4. regularize_S_H: regularizes overlap matrix $\mathbf{S}$ and $\mathbf{H}$ by projecting onto the subspace with well conditioned eigenvalues.
5. lanczos_alg: utilizes all of the above to solve the generalized eigenvalue problem $\mathbf{H}\vec{v}=\epsilon\mathbf{S}\vec{v}$. Returns lowest eigenvalue $\epsilon_{\text{min}}$ as ground state energy estimate.

To-do:

MatP1337 and others added 29 commits August 6, 2025 17:42
…create the lanczos_alg function executing the subroutine, returning the ground state energy
…ring circuit) and lanczos_expvals (obtaining the expectation values). Included distinctions for jasp vs non-jasp using check_for_tracing_mode. Tk_expvals are now arrays and not dictionaries anymore.
… and JAX-traceable function for building S and H from Tk
…ional; added documentation for lanczos_expvals
…g generalized eigenvalue problem is not implemented
@renezander90 renezander90 marked this pull request as ready for review November 14, 2025 21:42
@renezander90
Copy link
Contributor

renezander90 commented Nov 14, 2025

Auxiliary methods (inner_lanczos, lanczos_expvals) are Jasp compatible and jax versions of classical post processing functions are implemented. However, solving the generalized eigenvalue problems seems to be not implemented for the corresponding jax.numpy/jax.scipy functions (at least for version 0.6). Hence, executing full Lanczos method in Jasp is currently not supported.

Update: Lanczos implementation is now fully Jasp compatible using a custom implementation for solving the generalized eigenvalue problem

($|\gamma_0|=\Omega(1/\text{poly}(n))$ for $n$ qubits) with the true ground state. The Chebyshev approach allows exact
Krylov space construction (up to sample noise) without real or imaginary time evolution.

This algorithm is motivated by the rapid convergence of the Lanczos method for estimating extremal eigenvalues,
Copy link
Contributor

@renezander90 renezander90 Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also mention the numerical instability of the generalized eigenvalue problem, and the importance of regularization (a wrong result for the energy could be returned depending on the cutoff).


This function implements the Lanczos method on a quantum computer using block-encodings of Chebyshev
polynomials $T_k(H)$, closely following the algorithm proposed in
`"Exact and efficient Lanczos method on a quantum computer" <https://quantum-journal.org/papers/q-2023-05-23-1018/>`_.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should could add some formulas for derivation of the generalized eigenvalue problem form expectation values <T_k(H)>.

@renezander90
Copy link
Contributor

In principle, we could always use the jitted versions of the post processing functions, i.e., remove the check_for_tracing_mode distinction in the Lanczos_alg function. A minor drawback would be that for Jax.jit compatibility the shapes of the regularized matrices must be static. This is addressed by returning block matrices where the "true" regularized matrices are in the upper left block, identity in the lower right block; and zeros otherwise. This can be inconvenient to work with in static mode, but additionally returning the block size of the relevant block could be helpful.
Some further testing of the jitted versions would be required.

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.

3 participants