Gauss sums and quantum mechanics