# Quantum Simulation/Exact diagonalization

 Resource type: this resource contains a lecture or lecture notes.

#### The many-body problem

A common theme in all branches of quantum physics is to identify the eigenstates ${\displaystyle |\phi _{i}\rangle }$ of a Hamiltonian ${\displaystyle H}$, and the respective eigenenergies ${\displaystyle E_{i}}$. Once equipped with the eigenstates, we can relatively easily calculate many interesting aspects such as the time evolution, or its thermal properties, according to the relation

${\displaystyle \rho =Z^{-1}\exp(-\beta H)=Z^{-1}\sum \limits _{i}\exp(-\beta E_{i})|\phi _{i}\rangle \langle \phi _{i}|}$,

where ${\displaystyle Z=\mathrm {Tr} \{\exp(-\beta H)\}}$, which gives us the density operator ${\displaystyle \rho }$ at the inverse temperature ${\displaystyle \beta }$. A special case occurs at (or close to) zero temperature, as then only the ground state ${\displaystyle |\phi _{g}\rangle }$ will provide the dominant contribution. Nevertheless, the system can still undergo phase transitions if the ground state energy ${\displaystyle E_{g}}$ itself exhibits non-analytic behavior. Consequently, finding the ground state is often a crucial step to establish a thorough understanding of a quantum system.

In the following, we will mainly focus on discussing ground state properties of many-body systems containing only few local degrees of freedom. A prominent class of such many-body models are spin ${\displaystyle 1/2}$ models, which consist of two-level systems localized at the sites of some lattice. As a specific example, let us turn to the to the one-dimensional transverse field Ising model, whose Hamiltonian is given by

${\displaystyle H=g\sum \limits _{i=1}^{N}\sigma _{x}^{(i)}-\sum \limits _{i=1}^{N-1}\sigma _{z}^{(i)}\sigma _{z}^{(i+1)}.}$

Here, we have expressed the spins with the help of Pauli matrices, while ${\displaystyle g}$ can be interpreted as the strength of a field transverse to the quantization axis of the spins, and all energies are measured in the strength of the interaction between two neighboring spins. While this model is actually exactly solvable in the limit ${\displaystyle N\to \infty }$ [1], we will use it to illustrate various approaches to many-body problems.

Without going into specific details, let us consider the two possible limits of the transverse Ising model. For ${\displaystyle g\to \infty }$, we can ignore the interaction, and the problem reduces to a single spin in a magnetic field. Consequently, the ground state is given by

${\displaystyle |\phi _{g}\rangle =\prod \limits _{i=1}^{N}{\frac {1}{\sqrt {2}}}(|\uparrow \rangle _{i}-|\downarrow \rangle _{i}).}$

In the limit of zero external field, ${\displaystyle g\to 0}$, we just have to minimize the interaction energy, which leads to two distinct fully polarized ground states, ${\displaystyle |\phi _{g}^{(1)}\rangle =|\downarrow \downarrow \downarrow \cdots \rangle }$ and ${\displaystyle |\phi _{g}^{(2)}\rangle =|\uparrow \uparrow \uparrow \cdots \rangle }$. Note that the Hamiltonian does not distinguish between up and down spins (a so-called ${\displaystyle \mathbb {Z} _{2}}$ symmetry), but the two possible ground states do. This symmetry breaking is a manifestation of the system being in two different quantum phases for ${\displaystyle g\ll 1}$ (ferromagnet) and ${\displaystyle g\gg 1}$ (paramagnet)[2]. From the exact solution, it is known that the quantum phase transition occurs at a critical transverse field of ${\displaystyle g_{c}=1}$.

#### Exact and not-so-exact diagonalization

The term "exact diagonalization" is often used in a slightly misleading manner. In general, to find the eigenvalues of a ${\displaystyle d}$-dimensional Hamiltonian, one has to find the roots to the characteristic polynomial of degree ${\displaystyle d}$, for which in general no exact solution can be found for ${\displaystyle d>4}$. Of course, we can still hope to numerically approximate the eigenvalues to an arbitrary degree, but the fact that we have to work with computers operating with fixed precision numbers makes this endeavour substantially more complicated.

Keeping that aside, finding the eigenvalues by solving the characteristic polynomial is a bad idea, as finding roots of high-degree polynomials is a numerically tricky task [3]. In fact, one of the most powerful methods for finding the roots of such a polynomial is to generate a matrix that has the same characteristic polynomial and find its eigenvalues using a different algorithm! A much better strategy is to find a unitary (or orthogonal, if all matrix elements of the Hamiltonian are real) transformation that makes the Hamiltonian diagonal, i.e.,

${\displaystyle H\to U^{\dagger }HU}$

The general strategy is to construct the matrix ${\displaystyle U}$ in an iterative way,

${\displaystyle H\to U_{1}^{\dagger }HU_{1}\to U_{2}^{\dagger }U_{1}^{\dagger }HU_{1}U_{2}\to \cdots }$

until the matrix becomes diagonal. The columns of ${\displaystyle U=U_{1}U_{2}U_{3}\cdots }$ then contains the eigenvectors of ${\displaystyle H}$. There are many different algorithms for actually performing the diagonalization, and it is usually a good idea to resort to existing libraries (such as LAPACK) for this task. However, if we are only interested in finding the low-energy eigenvalues of a particular Hamiltonian, we can make a few simplifications that will allow for much faster computations.

#### The power method

Initially, we pick a random state ${\displaystyle |\phi _{0}\rangle }$ which has a very small but finite overlap with the ground state, i.e., ${\displaystyle \langle \phi _{0}|\phi _{g}\rangle \neq 0}$. Then, we repeatedly multiply the Hamiltonian with this initial state and normalize the result,

${\displaystyle |\phi _{n+1}\rangle ={\mathcal {N}}H|\phi _{n}\rangle }$,

where ${\displaystyle {\mathcal {N}}}$ is the normalization operation. This method will eventually converge to the eigenvector with the largest absolute eigenvalue, so by subtracting a constant energy from the Hamiltonian, we can always ensure that this will be the ground state. The key advantage is that the matrix-vector multiplications occuring at each iteration can be implemented very fast: in most cases (as for the transverse Ising model), for each column the number of nonzero entries in such a sparse Hamiltonian are much smaller than the dimension of the Hilbert space (here: ${\displaystyle N}$ vs. ${\displaystyle 2^{N}}$).

#### Lanczos algorithm

The power method can be readily improved by using not only a single state during each iteration, but employing a larger set of states which will be extended until convergence is reached. This procedure is known as Lanczos algorithm and is implemented as follows [4]:

1. Pick a random state ${\displaystyle |\phi _{0}\rangle }$ as in the Power method
2. Construct a second state ${\displaystyle |\phi _{1}\rangle }$ according to
${\displaystyle |\phi _{1}\rangle =H|\phi _{0}\rangle -{\frac {\langle \phi _{0}|H|\phi _{0}\rangle }{\langle \phi _{0}|\phi _{0}\rangle }}|\phi _{0}\rangle }$
3. Starting with ${\displaystyle n=2}$, recursively construct an orthogonal set of states given by
${\displaystyle |\phi _{n+1}\rangle =H|\phi _{n}\rangle -a_{n}|\phi _{n}\rangle -b_{n}^{2}|\phi _{n-1}\rangle ,}$
where the coefficients ${\displaystyle a_{n}}$ and ${\displaystyle b_{n}}$ are given by
${\displaystyle a_{n}={\frac {\langle \phi _{n}|H|\phi _{n}\rangle }{\langle \phi _{n}|\phi _{n}\rangle }}\;\;\;b_{n}^{2}={\frac {\langle \phi _{n}|\phi _{n}\rangle }{\langle \phi _{n-1}|\phi _{n-1}\rangle }}.}$
4. Diagonalize the matrix given by
${\displaystyle H=\left({\begin{array}{ccccc}a_{0}&b_{1}&0&0&\cdots \\b_{1}&a_{1}&b_{2}&0&\cdots \\0&b_{2}&a_{2}&b_{3}&\cdots \\0&0&b_{3}&a_{3}&\cdots \\\vdots &\vdots &\vdots &\vdots &\ddots \end{array}}\right).}$
5. If the ground state energy has not converged to the desired accuracy, proceed at step 3 by increasing ${\displaystyle n}$ by one.
Spontaneous magnetization of the ferromagnetic 1D Ising model in a transverse field for 18 spins computed using the Lanczos algorithm.

While the exact ground state is only reached when ${\displaystyle n}$ is equal to the dimension of the Hilbert space, the remarkable feature of the Lanczos algorithm is that typically only a few hundred iterations are necessary. However, there is one important caveat: due to finite-precision arithmetic, the orthogonality between the states ${\displaystyle |\phi _{n}\rangle }$ is quickly lost. For practical applications, it is therefore advisable to use an improved algorithm that re-orthogonalizes the states.

#### Some remarks on complexity

Let us briefly consider the difficulty inherent in exact diagonalization studies. On each lattice site, we have 2 degrees of freedom, refering to a spin pointing either up or down. However, for ${\displaystyle N}$ spins, we have ${\displaystyle 2^{N}}$ possible spin configurations. The consequences of this exponential scaling cannot be underestimated: if we want to store the vector corresponding to the ground state in a computer using double precision, we would need 8 TB of memory for ${\displaystyle N=40}$, and for ${\displaystyle N=300}$, the number of basis states already exceeds the number of atoms in the universe! From these considerations, we see that exact diagonalization can only work in the limit of small system sizes.

#### References

1. Sachdev, Subir (2001). Quantum phase transitions. Cambridge; New York: Cambridge University Press. ISBN 9780521004541.
2. http://iopscience.iop.org/article/10.1088/0022-3719/4/15/024/pdf
3. Press, William H; Teukolsky, Saul A; Vetterling, William T; Flannery, Brian P (1992). Numerical recipes in C Book, C version / William H. Press.. Cambridge: Cambridge Univ. Pr.. ISBN 9780521431088.
4. Dagotto, Elbio (1994-07). "Correlated electrons in high-temperature superconductors". Reviews of Modern Physics 66 (3): 763-840. doi:10.1103/RevModPhys.66.763. ISSN 1539-0756 0034-6861, 1539-0756. Retrieved 2013-04-03.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 52, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9521334171295166, "perplexity": 270.38499643442765}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-31/segments/1627046154126.73/warc/CC-MAIN-20210731203400-20210731233400-00250.warc.gz"}