How to calculate the index $|\mathcal{O_K}/ \mathfrak{a}|$ in sage

46 Views Asked by At

Let $K=\mathbb{Q}(\sqrt{2})$. I want to calculate $|\mathcal{O_K}/ \mathfrak{a}|$ in sage with $\mathfrak{a}=3\mathbb{Z}$. This code:

sage: K.<sqrt(2)>=NumberField(x^2-2)
sage:01=K.order(sqrt(2))

OK=ring_ of _ integers()

sage: O1.index_in(OK)

does not really work.

1

There are 1 best solutions below

1
On BEST ANSWER

You mean $\mathfrak{a} = (3) = 3\mathcal{O}_K$, because $3\mathbb{Z}$ is not an ideal in $\mathcal{O}_K$ (it is not closed under multiplication by $\sqrt{2}$).

This index $[\mathcal{O}_K:\mathfrak{a}] =|\mathcal{O}_K/\mathfrak{a}|$ is also called the norm of the ideal $\mathfrak{a}$:

sage: a = OK.ideal(3)
sage: a.norm()
9

Since $\mathfrak{a}=(3)$ is prime in $\mathcal{O}_K$ (hence maximal, because $\mathcal{O}_K$ is a Dedekind domain), the quotient $\mathcal{O}_K/\mathfrak{a}$ is a field called the residue field, and we can also get its order:

sage: a.is_prime()
True
sage: a.residue_field().order()
9