This repository contains a single self-contained notebook, Extension.ipynb, that trains four neural-quantum-state (NQS) architectures by variational Monte Carlo + stochastic reconfiguration on the 1D spin-
Pauli-normalised XXZ Hamiltonian with periodic boundary conditions, sector
| range of |
phase |
|---|---|
| gapped ferromagnet | |
| gapless XY / Luttinger liquid | |
| BKT (isotropic Heisenberg) | |
| gapped Ising-like AFM |
Three numerical anchors: Lanczos at
| ansatz | structure |
|
|---|---|---|
| Jastrow | 506 | |
| RBM |
|
528 |
| RBMSymm | RBM with translation weight-tying, |
24 |
| FFNN-1L | one dense complex layer |
1012 |
| FFNN-2L | two dense layers |
1012 |
All four reach the Lanczos energy at
-
PauliStringsJaxHamiltonian. Built directly from Pauli strings, avoiding the slowerLocalOperatorpath used in the tutorial. -
Marshall–Peierls sign rule (Marshall 1955) applied on the bipartite even-
$L$ chain,$\sigma^{x,y}\to-\sigma^{x,y}$ on the$B$ sublattice. The eigenvalues are unchanged but$\tilde H$ is stoquastic in the$\sigma^z$ basis (Bravyi–DiVincenzo–Oliveira–Terhal 2008), so the ground state is real-positive and VMC converges with the same hyperparameters across the entire$\Delta$ range. Observables are translated back as needed:\langle\sigma^x_0\sigma^x_r\rangle = (-1)^r\,\langle\sigma^x_0\sigma^x_r\rangle_{\tilde H}. -
Warm-start across the
$\Delta$ scan: parameters trained at one$\Delta$ initialise the next. First point uses 400–500 iterations, subsequent points 200–250. -
Batched observables. The connected ZZ correlator at fixed displacement
$r$ is built as a singlePauliStringssumming$L$ pairs with weight$1/L$ , cutting$L\cdot L/2$ MC passes down to$L/2$ — ~22× speedup for the$C^{zz}$ measurement at$L=22$ . -
Disk-cached results. Trained variational parameters are saved to
.mpack, observable summaries to.pkl, and the Lanczos reference to.pkl. Re-running the notebook hits the cache.
End-to-end run on a regular laptop, full
Energy errors vs Lanczos at
Variance separation by phase:
-
$\Delta=0$ (free fermions): all ansätze$\sigma_E^2 \le 0.03$ ; Jastrow saturates at$0.000$ . -
$\Delta=1$ (Heisenberg): RBMSymm 0.114 < Jastrow 0.195 ≈ RBM 0.209. -
$\Delta=2.5$ (Ising-AFM): FFNN-2L 0.92 ≪ RBM 1.34 < RBMSymm 3.55 ≈ Jastrow 3.43.
Néel order parameter from
Luttinger exponents from log-log fit of
.
├── Extension.ipynb # main deliverable: notebook with all simulations
├── _build_notebook.py # builds Extension.ipynb from a list of cells
├── Assignment/ # the project brief PDF (Aalto, 2026)
├── results/
│ ├── heisenberg/ # logs / parameters from the L=22 Delta=1 reproduction
│ ├── xxz/ # per-ansatz Delta-scan: *.log, *.mpack, *.pkl
│ └── jax_cache/ # JAX persistent compilation cache
├── pyproject.toml # uv project file
├── uv.lock
└── README.md
This project uses uv for dependency management.
uv sync # install Python 3.12 + locked deps
uv run jupyter lab Extension.ipynb # open the notebookOr with an existing Python 3.12 virtualenv:
pip install "netket==3.21.*" "jax>=0.7,<0.8" "flax<0.12.7" \
numpy scipy matplotlib jupyter
jupyter lab Extension.ipynbRun the notebook top-to-bottom. First run does the full sweep (≈15–25 min on a laptop CPU); re-runs hit the on-disk cache and complete in seconds.
- Setup, persistent JAX cache, results directory.
-
§1 XXZ Hamiltonian built via
PauliStringsJaxwith the Marshall sign rule. -
§2 Bethe-ansatz reference (Cloizeaux–Pearson, Hulthén, Yang–Yang) in Pauli normalisation, validated against Lanczos to within
$\sim 1/L^2$ . -
§3 Lanczos at
$L=22,\ \Delta=1$ →$E_0 \simeq -39.1475$ . -
§4 Four NQS ansätze trained at the Heisenberg point with
VMC_SR, each followed by a trace plot. Final summary table of (params,$E_\text{final}$ , relative error). -
§5 Δ-scan extension: observable builders (staggered structure factor,
$C^x(r)$ , batched$C^{zz}(r)$ ),sweep(...)driver with warm-start and pickle cache, runs at$L\in\{16,22,28\}$ for RBMSymm and at$L=22$ for the other ansätze, deeper FFNN at four representative$\Delta$ , Lanczos reference curve. -
§6 Plots:
$E_0/L$ vs$\Delta$ vs Bethe / Lanczos / four ansätze,$S_\text{AFM}(\pi)/L$ for three sizes,$\log|C^x(r)|$ vs$\log r$ at three$\Delta$ ,$\sigma_E^2$ vs$\Delta$ . - §7 Discussion: BKT location at finite size, phase hallmarks tied to actual measured values, ansatz hierarchy tied back to Levine et al.
The full numbered reference list lives inside Extension.ipynb, §7. Headline sources:
- Y. Levine, O. Sharir, N. Cohen, A. Shashua, Quantum entanglement in deep learning architectures, Phys. Rev. Lett. 122, 065301 (2019), arXiv:1803.09780.
- G. Carleo, M. Troyer, Solving the quantum many-body problem with artificial neural networks, Science 355, 602 (2017).
- C. N. Yang, C. P. Yang, One-dimensional chain of anisotropic spin-spin interactions. II, Phys. Rev. 150, 327 (1966).
- I. Affleck, Exact correlation amplitude for the
$S=\tfrac12$ Heisenberg antiferromagnetic chain, J. Phys. A 31, 4573 (1998), cond-mat/9802045. - F. Vicentini et al., NetKet 3: machine learning toolbox for many-body quantum systems, SciPost Phys. Codebases 7 (2022).
- NetKet tutorial: Ground-State: Heisenberg model.
- Assignment and tutorial scaffolding by Anouar Moustaj (Aalto University, Department of Applied Physics).
- The NetKet
Jastrow,RBM,RBMSymm, and FFNN code patterns follow the official NetKet Ground-State: Heisenberg tutorial.