In this paper we give a randomness-efficient sampler for matrix-valued functions. Specifically, we show that a random walk on an expander approximates the recent Chernoff-like bound for matrix-valued functions of Ahlswede and Winter [1], in a manner which depends optimally on the spectral gap. The proof uses perturbation theory, and is a generalization of Gillman?s and Lezaud?s analyses of the Ajtai-Komlos-Szemeredi sampler for realvalued functions [11, 21, 2].
Derandomizing our sampler gives a few applications, yielding deterministic polynomial time algorithms for problems in which derandomizing independent sampling gives only quasi-polynomial time deterministic algorithms. The first (which was our original motivation) is to a polynomialtime derandomization of the Alon-Roichmantheorem [4, 20, 22]: given a group of size n, find O(log n) elements which generate it as an expander. This implies a second application efficiently constructing a randomness-optimal homomorphism tester, significantly improving the previous result of Shpilka and Wigderson [29]. A third application, which derandomizes a generalization of the set cover problem, is deferred to the full version of this paper.