Galois quantum systems, irreducible polynomials and Riemann surfaces