Let X = {x 1 , . . . , x N } ⊂ T d ∼ = [0, 1] d be a set of N points in the d−dimensional torus that we want to arrange as regularly possible. The purpose of this paper is to introduce the energy functionaland to suggest that moving a set X into the direction −∇E(X) may have the effect of increasing regularity of the set in the sense of decreasing discrepancy. We numerically demonstrate the effect for Halton, Hammersley, Kronecker, Niederreiter and Sobol sets. Lattices in d = 2 are critical points of the energy functional, some (possibly all) are strict local minima.2010 Mathematics Subject Classification. 11L03, 42B05, 82C22.