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.
- Heisenberg chain — spin-½ Heisenberg model, U(1) and SU(2) symmetry.
- Free fermion — spinless tight-binding chain.
- Hubbard model — spinful Hubbard chain with U(1)×SU(2) symmetry.
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, andS. - 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 Zcomparison. - 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.
- Custom geometry — define a new lattice type.
- Custom local space — define a new physical Hilbert space.
- Custom model — define a new Hamiltonian model.