I am not sure how to find the class group with a given discriminant d. First, we need to find the set of all primitive positive definite forms. Then we reduce all of them to split them into equivalence classes which is the class group.
I am not sure how to find the set of all primitive positive definite forms. Say $(a,b,c)$ is a form, then we know $b^2-4ac=d$ and $a,b,c$ don't have a common divisor other than 1. In theory, there could be infinitely many forms since there are no other restrictions...
Any help will be very appreciated!
$(a,b,c)$ is equivalent to a unique reduced form, say $(a,b,c)$. In that form, $|b|\le a$, so that $b^2\le a^2$, and $a\le c$, so that the discriminant $D<0$ satisfies $-D = 4ac-b^2 \ge 4a^2-a^2 = 3a^2$. It follows that $a\le \sqrt{\frac{-D}{3}}$. This puts a bound on $a$, and therefore on $b$. Further, you know that $b\equiv D\mod{2}$. So there are only a finite number, and you can find them by trying the various cases.