We use the correlation matrix of the generating distribution to determine the mixing time for random walks on the torus \((\mathbb {Z}/q\mathbb {Z})^n\) . We present our method in the context of the Diaconis–Gangolli random walk on both the \(1 \times n\) and \(m \times n\) contingency tables over \(\mathbb {Z}/q\mathbb {Z}\) . In the \(1 \times n\) case, we prove that the random walk exhibits cutoff at time \(\dfrac{n q^2 \log (n)}{8 \pi ^2}\) when \(q \gg n\) ; in the \(m \times n\) case, where m and n are of the same order, we establish cutoff for the random walk at time \(\dfrac{mn q^2 \log (mn)}{16 \pi ^2}\) when \(q \gg n^2\) . Our method reveals that a general class of random walks on the torus \((\mathbb {Z}/q\mathbb {Z})^n\) has cutoff. If each coordinate of the lifted random walk onto \(\mathbb {Z}^n\) has variance \(\sigma ^2/n\) in each jump, and the between-coordinate correlations are sufficiently low, then cutoff occurs at time \(\dfrac{nq^2 \log (n)}{4\pi ^2 \sigma ^2}\) .