# confusion with calculating the ideal class group of a quadratic field

I am a bit confused with the procedure of calculating the ideal class group of a quadratic field.

From what I understood the computation starts by finding the Minkowski's bound say $n$. Then we list all the primes up to $n$ and we claim that every ideal class in the class group will be represented by a prime ideal whose norm is a prime of our list. Then we find all of those and multiply them to figure out the multiplication table and we are done. What I don't like about that is the following:

Minkowski's bound tells us that in each class there is an integral ideal with norm less than $n$. However is not clear that in a given class there will be a prime ideal that will have norm less than $n$.

I am aware that every class contains prime ideals but I don't know what we can say about their norm and the method I described above makes sense to me only if we can always find a prime ideal with norm less than $n$.

So either I misunderstood something or given an integral ideal of norm less than $n$ I can always find a prime ideal in the same ideal class with norm less than $n$ so that it indeed suffices to just consider the prime ideals. Can anyone please clarify?

Edit: I have just read a post of calculating the ideal class group of $\mathbb{Q}(\sqrt{-103})$ (Ideal class group of $\mathbb{Q}(\sqrt{-103})$). Here OP starts as I say by remarking that it suffices to do the calculation just by considering prime ideals of norm $< n = 6$. Then he figures out that the only prime ideals with that property are $P = \left(2, \frac{2 + \sqrt{-103}}{2}\right)$ and its conjugate.He then proceeds to calculate $P^k$ and this turns out to be non trivial for $k<5$. But for me this contradicts the initial assumption that it suffices to do the calculation just for prime ideals. That is because for example we have $[P^2]\neq [P]$(or [$\bar P$]) but norm$(P^2) = 4$. Hence $P^2$ is an integral ideal that dosen't have in it's class a prime ideal with norm less than $n=6$. So as long as I am concerned there might also be an integral (not prime) ideal $I$ of norm say $2$ such that $I$ is not principal and $[I]\neq[P]$. The situation I just described wouldn't happen if we could assume that for each class of ideals there is a prime ideal of norm less than $n=6$. But the example I discussed above with $P^2$ shows that this result does not hold. So what is going on I am getting really confused about this stuff?

After some thinking I thing I realized what is going on.The result I am talking about that in every ideal class there is a representative that is prime ideal of norm less than $n$ does not hold. The reason we only consider prime ideals of norm less than $n$(therefore of norm $1<p<n$ where $p$ prime) for the computation of the class group must be the following. We know that in every class there is an integral ideal $I$ of norm less than $n$ and we know that this ideal can be written uniquely as a product of prime ideals and since the norm is multiplicative the prime ideals in the factoraisation of $I$ will have norm less than $n$. Therefore $[I]$ is just the product of prime ideal of norm less than $n$. Since $I$ was arbitary, it means every ideal class in the class group can be written as a product of ideals of norm less than $n$. In the example of $\mathbb{Q}(\sqrt{-103})$ we have established that the only prime ideals of norm less than $n=6$ are were just $P$ and $\bar{P}$ who both had norm $2$. Now since every ideal class in the class group contains an integral ideal of norm less than $n=6$ and this can be factored as product of prime ideals it must be that the class group contains at most the following 5 elements $[P],[P^2],[\bar{P}],[\bar{P^2}],e$ then one has to prove those are distinct and non trivial but that is not hard so we are done.