  Random quantum circuits are proficient information scramblers and efficient
generators of randomness, rapidly approximating moments of the unitary group.
We study the convergence of local random quantum circuits to unitary
$k$-designs. Employing a statistical mechanical mapping, we give an exact
expression of the distance to forming an approximate design as a lattice
partition function. In the statistical mechanics model, the approach to
randomness has a simple interpretation in terms of domain walls extending
through the circuit. We analytically compute the second moment, showing that
random circuits acting on $n$ qudits form approximate 2-designs in $O(n)$
depth, as is known. Furthermore, we argue that random circuits form approximate
unitary $k$-designs in $O(nk)$ depth and are thus essentially optimal in both
$n$ and $k$. We can show this in the limit of large local dimension, but more
generally rely on a conjecture about the dominance of certain domain wall
configurations.
