There are intrinsics HilbertClassPolynomial and WeberClassPolynomial to compute the minimal polynomial over Q of the j-invariant associated to the imaginary quadratic order of discriminant D or the smaller (in terms of coefficient size) minimal polynomial of an associated Weber function. These are described in detail in Section Class Polynomials of the Modular Curves chapter.