From Haar Random States to Quantum Machine Learning
A hands-on numerical tutorial on randomness, scrambling, and learning in quantum systems
Haar averaging, the Weingarten calculus and a modest amount of representation theory, developed once and applied to quantum chaos, scrambling, benchmarking protocols and the trainability of quantum machine learning, with every step checked numerically.
Start with Part 1 Browse the parts Exercises & Solutions (PDF)

Background
A recurring lesson in quantum many-body physics and quantum information is that the typical behaviour of a complex quantum system is sharply constrained, even when its microscopic details are not. Averages over the unitary group, known as the Haar measure, together with the concentration of measure that accompanies them, turn this observation into quantitative predictions. The same low-order Haar moments then reappear in settings that look, at first, unrelated.
The apparent thermality of a small subsystem follows from the entanglement of typical states. The recovery of information from an evaporating black hole is governed by the same Page-curve estimate of subsystem entropy. The protocols that certify quantum hardware, including randomized benchmarking, cross-entropy benchmarking and classical shadows, rest on second moments of the Haar measure. The trainability of variational quantum circuits, through the barren-plateau phenomenon, is fixed by the same concentration that renders typical states featureless.
The resemblance is not superficial. In each of these cases the underlying object is the same low-order average over the unitary group, evaluated in a different physical context. The technical core is correspondingly compact, consisting of Haar averaging, the Weingarten calculus and a modest amount of representation theory. This tutorial develops it once and applies it across each setting, with every step carried out explicitly and checked numerically.
Readers who want the mathematics in more depth can consult the companion lecture notes, Information Scrambling, Quantum Chaos, and Haar-Random States (arXiv:2511.14397), which these notebooks accompany.
What you’ll learn
By the end you will be able to:
- average over random unitaries by hand using the Weingarten calculus, and predict second- and fourth-moment quantities (purity, frame potentials, gradient variances);
- read the fingerprints of quantum chaos in a spectrum: level repulsion, the spectral form factor, the random-matrix universality classes;
- quantify scrambling with out-of-time-ordered correlators, Krylov complexity, and tripartite mutual information;
- use randomness as a tool: classical shadows, randomized benchmarking, and the Hayden-Preskill recovery protocol;
- explain barren plateaus and the expressivity-trainability tension in quantum machine learning, from first principles.
How the tutorial is organized
Seven short parts, each a concept page followed by runnable notebooks:
Speak the language of channels, Lie algebras, state geometry and measure theory.
14 notebooks
3 · Haar Measure & Weingarten Calculus
Average over random unitaries and derive the Page formula.
7 notebooks
Understand trainability through the same lens, then five worked examples.
12 notebooks
The parts are largely independent and each notebook stands on its own, so you can read in order or jump to what you need. The second-moment twirl worked out in Part 3 recurs in the Page formula, the classical-shadows channel, the randomized-benchmarking decay and the barren-plateau gradient variance; where a notebook reuses an earlier result, a short Connections note at its end points back to it. A companion Exercises & Solutions PDF collects analytical problems and worked solutions for every part.
Getting started
git clone https://github.com/MarcinPlodzien/quantum-chaos-and-scrambling
cd quantum-chaos-and-scrambling
pip install -r requirements.txt
jupyter lab # open any notebook under source_notebooks/Everything runs on a laptop with a standard scientific-Python stack (numpy, scipy, matplotlib). No quantum hardware, no GPUs, no special libraries.
Who this is for
Graduate students and researchers in quantum information, condensed matter, and quantum machine learning, and anyone comfortable with linear algebra and Python who wants to compute with these ideas rather than only read about them. It is meant in particular for people learning these scattered topics on their own, where hands-on, runnable material is hard to find. The mathematical prerequisites are light and built up as needed in Part 1.






