On Hilbert Class Polynomial Is there any open source software  which computes Hilbert Class polynomial of an imaginary quadratic fields?
Thank you in advance 
 A: Sage supports this function, i.e.

hilbert_class_polynomial(-71);

You can try this online for free: https://sagecell.sagemath.org/
The algorithm of Sage, written in pseudo-code, goes as follows

In general, one computes
$$H_D(X)=\prod_{i=1}^h (X- j (\mathfrak{a}_i))$$
where $\mathfrak{a}_i$ ranges over the representatives of the class group. In the quadratic case, there is an easy way to find a set of representatives for the class group. This approach makes use of the theory of primitive reduced quadratic forms and the bijection between the ideal class group and form class group (see Cox §2 and §7). The above equation then becomes
$$H_D(X) = \prod_{[a,b,c] \in Cl(D)} \left( X- j\left(\frac{-b+i \sqrt{d}}{2a}\right) \right)$$
where $Cl(D)$ is the set of all reduced quadratic forms of discriminant $D$. The degree of $H_D(X)$ equals the class number. By iterating through all reduced forms of discriminant $D$, and computing a numerical value of the corresponding $j$-value, we get a simple method for constructing the polynomial $H_D(X)$. However, when calculating the $j$-value there might be a computational error. But since the polynomial has integer coefficients, this small error can be "recovered" by rounding to the nearest integers.
