1 · Computational toolbox

The course opens with complete simulations of one particle in one dimension, where every number can be checked against an exact solution. A free Gaussian wave packet on a ring is propagated with finite differences and with the Fourier method; the harmonic oscillator is discretised, diagonalised, and propagated by spectral decomposition, by its matrix exponential and with the Runge–Kutta and Crank–Nicolson integrators. In both, the numerical error is measured against the analytic result and explained. Two further notebooks carry the same machinery into a nonlinear problem, the bright solitons of the Gross–Pitaevskii equation: their ground state by imaginary-time relaxation, their real-time motion with a split-step integrator, and their collisions.
A third single-particle problem removes the continuum altogether. Notebook 49 follows one excitation hopping on a chain of sites, whose Hamiltonian is the three-point Laplacian of notebook 00a read as an exact model rather than as an approximation. Its cosine band, its light cone and its closed-form propagator, a Bessel function, are solved on a ring and on an open chain, and the same matrix returns in the spin-chain and tensor-network chapters as a reference solution. It needs only notebook 00a and can be read directly after it. The two soliton notebooks are not needed later in the course and can be left for a second reading.
The chapter closes with the two tools used everywhere afterwards. JAX turns NumPy-style code into compiled (jit), batched (vmap), looped (lax.scan) and differentiable (grad) programs, and einsum expresses every contraction of the course in index notation, from matrix products to partial traces.
Notebooks 00a, 00b, 01 and 02 assume one semester of quantum mechanics and basic Python with NumPy and matplotlib, and no background in numerical methods or JAX; notebooks 01 and 02 do not need the single-particle notebooks, and only Section 15 of notebook 02 uses JAX. Notebook 00c builds on the periodic grid and spectral derivatives of 00a and on the potentials, eigenstates and explicit integrators of 00b, and notebook 00d takes the soliton, its conserved quantities and the split-step propagator from 00c without re-deriving them.
Notebooks in this chapter
A first quantum simulation — a free Gaussian wave packet on a ring
The very first notebook of the course: we non-dimensionalise the free Schrödinger equation, solve it exactly on paper, then solve it on a computer with finite differences and with the Fourier method, and watch the packet spread, move and interfere with itself on a ring — with animations and a full numerics-versus-analytics error analysis.
A first quantum simulation — the 1D harmonic oscillator
The second simulation, after 00a: turn the Schrödinger equation of a 1D harmonic oscillator into a matrix, diagonalise it, evolve it in time, quench the trap, and check every number against the exact analytic solution.
A mean-field argument turns the linear Schrödinger equation into the nonlinear Gross-Pitaevskii equation; we derive its bright-soliton solution in closed form, find it numerically by imaginary-time relaxation, and propagate it in real time with a split-step Fourier integrator — a wave packet that moves without spreading, with full error analysis and animations.
Two-soliton collisions — particle-like scattering in the nonlinear Schrödinger equation
Two bright solitons are launched at each other in the Gross-Pitaevskii equation; they pass through one another and re-emerge with their shapes, norms and velocities intact, leaving behind only a position shift and a phase shift that we measure and compare with the inverse-scattering prediction, and we then break integrability and watch the collisions turn inelastic.
JAX — NumPy that compiles, batches and differentiates
The JAX foundation of the course: from NumPy to JAX (jit, vmap, scan, grad, PRNG keys, precision and timing of compiled code), ending with a Rabi-oscillation mini-project.
From sums over indices to einsum, reshape/transpose, Kronecker products, partial traces, contraction cost and programmatically built einsum strings - the array language of the whole course.
A single excitation on a lattice
One excitation hopping on N sites, the smallest quantum problem in the course whose lattice is not an approximation to a continuum. Both solvable cases worked out in full — the ring by plane waves, giving the Bessel propagator \(G_n(t) = (-i)^n J_n(2wt)\); the open chain by hard-wall standing waves, giving the sine sum. The light cone, its velocity 2w, and the Airy edge. This same N×N matrix returns later as the one-magnon sector of the XX chain and as the single-particle Hamiltonian of free fermions, whose propagator supplies the exact reference for the matrix-product-state time evolution.