1: \begin{abstract}
2: In this paper, we show the application of the Quantum Metropolis Sampling (QMS) algorithm to a toy gauge theory
3: with discrete non-Abelian gauge group $D_4$ in (2+1)-dimensions,
4: discussing in general how some components of hybrid quantum-classical algorithms
5: should be adapted in the case of gauge theories.
6: In particular, we discuss the construction of random unitary operators which preserve gauge invariance and act transitively on the physical Hilbert space,
7: constituting an ergodic set of quantum Metropolis moves between gauge invariant eigenspaces,
8: and introduce a protocol for gauge invariant measurements.
9: Furthermore, we show how a finite resolution in the energy measurements
10: distorts the energy and plaquette distribution measured via QMS,
11: and propose a heuristic model that takes into account part of the deviations
12: between numerical results and exact analytical results,
13: whose discrepancy tends to vanish by increasing the number of qubits used for the energy measurements.
14: \end{abstract}
15: