Skip to content

Examples

This section provides complete, working code examples demonstrating Alice's main features.

How Examples Work

Code blocks marked with exec="1" run during the documentation build and their output is shown inline. This means the results you see are always up to date with the current version of Alice.

Blocks without exec are displayed as-is and are intended to be copied and run locally.

Sections

DMRG

Complete ground-state calculations with the three update schemes.

VUMPS

Ground states of infinite chains, on a uniform MPS with no finite-size error to extrapolate away.

  • Heisenberg chain — spin-½ Heisenberg model against 1/4 - ln 2, grown to the bond cap by the two-site scheme.
  • Majumdar-Ghosh — the J1-J2 chain at its exactly solvable point, reached to machine precision.
  • Free fermion — spinless tight-binding chain against -2/π at half filling.
  • Hubbard model — spinful chain against the Lieb–Wu exact solution, in all four band symmetries.

TDVP

Real-time evolution, each validated against an analytic reference or across symmetry groups.

  • Free fermion — Gaussian wavepacket against the exact single-particle propagator; clean dt² convergence.
  • Domain wall — many-body melting against the exact correlation matrix, with occupations and entanglement entropy.
  • Hubbard model — spinful melting at U = 0, Abelian versus SU(2), against twice the spinless result.
  • Hubbard quench — interaction quench from a DMRG ground state, in all four symmetry groups.

TgTRG

Finite-temperature thermodynamics by tangent-space cooling, on the stacked exponential-then-linear schedule.

  • Free fermion — spinless tight-binding chain against the exact log Z, u, c_V, and S.
  • Hubbard model — spinful Hubbard chain with Z(2)×SU(2) symmetry, with the direct energy measurement.

XTRG

Finite-temperature thermodynamics via exponential cooling, with the three update schemes.

  • Free fermion — spinless tight-binding chain, exact log Z comparison.
  • Hubbard model — spinful Hubbard chain with Z(2)×SU(2) symmetry.

AutoMPO from TOML

  • AutoMPO from TOML — loading TOML configs and calling build_interaction; multiple model variants.

Extensions

How to extend Alice with custom physics.