Skip to content

Examples

While we present core functionality in the User Guide, we here provide several examples along with XDiag to demonstrate how we can build more advanced applications from these basic building blocks. The examples are provided in the directory examples in the C++ source code directory, and can be compiled using CMake.

cmake -S . -B build -D BUILD_EXAMPLES=On
cmake --build build

The executables are then available in the directory build/examples. Most examples are also provided as a Julia script, and visualization scripts for the results are available.

Ground states

  • Ground state energy


    Computes the ground state energy of a simple Heisenberg spin \(S=1/2\) chain

    source

  • Ground state correlators


    Computes ground state correlators of a simple Heisenberg spin \(S=1/2\) chain with the help of symmetries.

    source

  • Entanglement entropy ground state


    Computes ground state entanglement entropy of an XXZ spin \(S=1/2\) chain.

    Image title

    source

  • CDW in attractive Hubbard model


    Computes charge correlations in the ground state of the attractive 2D Hubbard model.

    Image title

    source

  • Kitaev-Heisenberg honeycomb model


    Computes the ground state of the Heisenberg-Kitaev model throughout its phase diagram

    Image title

    source

Full exact diagonalization

  • Specific heat random t-J model


    Computes the specific heat of the random t-J model via full ED over multiple disorder realizations.

    Image title

    source

  • Specific heat triangular t-J model


    Computes the specific heat of the triangular t-J model via full ED.

    Specific Heat Triangular t-J

    source

  • Spin chain level statistics


    Demonstrates Poissonian and Wigner-Dyson level statistics of integrable and non-integrable spin chains, respectively.

    Level statistics

    source

  • Many-body localization


    Studies hallmark diagonstics of a many-body localized system.

    Level statistics

    source

Tower of States

  • TOS \(\alpha \text{XX}\) chain


    Performs a tower of states analysis for the \(\alpha \text{XX}\) chain.

    Image title

    source

  • Heisenberg chain momentum resolved


    Performs a (momentum) tower of states analysis for the antiferromagnetic chain.

    Tower of States

    source

  • Square lattice Heisenberg model


    Performs a tower of states analysis for the Heisenberg model in the square lattice.

    Image title

    source

  • \(J_1 - J_2\) model triangular lattice


    Performs a tower of states analysis for the \(J_1 - J_2\) model in the triangular lattice.

    Image title

    source

  • \(J_1 - J_2 - J_3\) Model in the kagome lattice


    Performs a tower of states analysis for an extended kagome lattice Heisenberg antiferromagnet.

    Image title

    source

  • Attractive Hubbard model


    Performs a tower of states analysis for the superconducting state in the attractive Hubbard model. Image title

    source

Dynamical spectral functions

  • Spin structure factor


    Computes the dynamical spin structure factor of a spin \(S=1/2\) chain

    Image title

    source

  • Green's function


    Computes the Green's function in a 2D Hubbard model

    Image title

    source


  • Optical conductivity


    Computes the optical conductivity of one hole in a t-J model.

    Image title

    source

Time Evolution

  • Domain wall dynamics


    Demonstrates the time evolution of a domain wall in the \(S=1/2\) XXZ chain. Dynamics of a domain wall

    source

  • Slow quench


    Demonstrates the implementation of slow quench in the \(S=1/2\) Ising chain.

    Magnetization vs hz

    source

  • Hubbard interaction quench


    Demonstrates the implementation of an interaction quench in the 2D Hubbard model.

    Magnetization vs hz

    source

Thermodynamics

  • Specific heat Shastry-Sutherland


    Computes the specific heat using the TPQ states (finite temperature Lanczos method) for the Shastry Sutherland model.

    Image title

    source

  • Wilson ratio \(J_1\)-\(J_2\) square lattice


    Computes the Wilson ratio using the TPQ states (finite temperature Lanczos method) for the \(J_1\)-\(J_2\) model on the square lattice

    Image title

    source