Ask Your Question

Revision history [back]

Note that in this particular case, OK can be defined directly:

sage: E = EisensteinIntegers()
sage: E
Eisenstein Integers in Number Field in omega with defining polynomial x^2 + x + 1
sage: E.gens()
(1, omega)

If needed, define the generator:

sage: omega = E.gen(1)
sage: omega
omega
sage: omega^2
-omega - 1

(We don't need it for what follows.)

Since the goal is to get information about an ideal, give it a name:

sage: J = E.ideal(9)
sage: J
sage: J
Fractional ideal (9)

Then it becomes easy to access information about this ideal.

Indeed, we can use the <TAB> key and type:

sage: J.<TAB>

to see all the methods that exist for J. Then it's a matter of trying out some of these methods with promising names, seeing what results we get, and reading their documentation.

Apply Euler phi to the ideal:

sage: J.euler_phi()
54

Get the documentation for euler_phi:

sage: J.euler_phi?
Signature:      J.euler_phi()
Docstring:
   Returns the Euler varphi-function of this integral ideal.

   This is the order of the multiplicative group of the quotient
   modulo the ideal.

   An error is raised if the ideal is not integral.

   EXAMPLES:

      sage: K.<i>=NumberField(x^2+1)
      sage: I = K.ideal(2+i)
      sage: [r for r in I.residues() if I.is_coprime(r)]
      [-2*i, -i, i, 2*i]
      sage: I.euler_phi()
      4
      sage: J = I^3
      sage: J.euler_phi()
      100
      sage: len([r for r in J.residues() if J.is_coprime(r)])
      100
      sage: J = K.ideal(3-2*i)
      sage: I.is_coprime(J)
      True
      sage: I.euler_phi()*J.euler_phi() == (I*J).euler_phi()
      True
      sage: L.<b> = K.extension(x^2 - 7)
      sage: L.ideal(3).euler_phi()
      64
Init docstring: Initialize self.  See help(type(self)) for accurate signature.
File:           /opt/s/sage/local/lib/python3.7/site-packages/sage/rings/number_field/number_field_ideal.py
Type:           method

The following may also be of interest:

sage: J.idealstar()
Multiplicative Abelian group isomorphic to C6 x C3 x C3
sage: J.idealstar?
...

sage: J.residues()
...
sage: list(J.residues())
...
sage: len(J.residues())
81

sage: J.invertible_residues()
...
sage: list(J.invertible_residues())
...
sage: len(J.invertible_residues())
54

One take-away from this is that a lot of the information about the quotient modulo this ideal can be accessed using methods defined on the ideal, rather than on the quotient. Note how in all the above we never defined the quotient!