Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

(1) Let me add some notation to the question. (To see if i get it right.)

Let $A,B$ be two square matrices of shape $n\times n$, $n>0$ natural number, $A,B\in M_{n}(\mathbb Z)$.

We know there is an invertible matrix $S\in M_{n}(\mathbb Q)$ with: $$ A = SBS^{-1}\ . $$

The question is - if i am interpreting it right - if we can do the above with $S$ even in $M_{n}(\mathbb Z)$.

Yes, if $S$ has entries with denominators, build the common denominator (lcm of all denominators of the entries) $d$ and use $dS$ instead of $S$.

(2) Let us fix ideas and use a specific number field $K$:

sage: K.<a> = QuadraticField( -46 )
sage: ClK   = K.class_group()
sage: ClK
Class group of order 4 with structure C4 of Number Field in a with defining polynomial x^2 + 46
sage: for c in ClK:
....:     print c
....:     
Trivial principal fractional ideal class
Fractional ideal class (5, a + 3)
Fractional ideal class (2, a)
Fractional ideal class (5, a + 2)
sage: c = ClK[3]
sage: c
Fractional ideal class (5, a + 2)
sage: c.ideal()
Fractional ideal (5, a + 2)
sage: c.ideal().integral_basis()
[5, a + 2]

(From the class $c$, we have to go first to its ideal, c.ideal(), first, then we can apply the method integral_basis.)

Conversely, let us suppose we have the above two elements $5$, and $a+2$, and want to associate (in the given setting):

  • the ideal $J$ in $\mathcal O_K$ generated by these two elements, and
  • the ideal class in the class group, which is $J$ modulo principal ideals.

Now i am finally in position to answer (by sample code) the question:

sage: J = K.ideal( [5, a+2] )
sage: J == c.ideal()
True
sage: ClK(J)
Fractional ideal class (5, a + 2)
sage: ClK(J) == c
True

In words, the constructor to be applied on the list is K.ideal.

We have got a (fractional) ideal in (the ring of integers of) $K$, called J. (Ideals and fractional ideals are sometimes hard to separate in sage.) In order to pass with it modulo principal ideals, we simply convert it via ClK( J ) to an object inClK. So far, things are coherent in a natural way. To break slightly the perfect picture, note that...

sage: J
Fractional ideal (5, a + 2)
sage: J.parent()
Monoid of ideals of Number Field in a with defining polynomial x^2 + 46
sage: c.parent()
Class group of order 4 with structure C4 of Number Field in a with defining polynomial x^2 + 46
sage: J == c 
True

(The true boolean eval of J == c is maybe unexpected.)

Note: The above also works in more complicated number fields. For instance:

sage: R.<x> = PolynomialRing(QQ)
sage: K.<a> = NumberField( x^3 - x - 2017 )
sage: a.minpoly()
x^3 - x - 2017
sage: ClK = K.class_group()
sage: ClK
Class group of order 6 with structure C6 of Number Field in a with defining polynomial x^3 - x - 2017
sage: c = ClK.list()[-1]
sage: c.order()
6
sage: c
Fractional ideal class (119, a + 9)

sage: J = K.ideal( [ 119, a+9 ] )
sage: J == c.ideal()
True
sage: ClK(J) == c
True

sage: J*J
Fractional ideal (14161, a + 2865)
sage: c*c
Fractional ideal class (103, a - 33)
sage: J == c
True

sage: c.parent()
Class group of order 6 with structure C6 of Number Field in a with defining polynomial x^3 - x - 2017
sage: J.parent()
Monoid of ideals of Number Field in a with defining polynomial x^3 - x - 2017

sage: J^6
Fractional ideal (2839760855281, a - 688711041646)
sage: c^6
Trivial principal fractional ideal class
sage: ClK( J^6 )
Trivial principal fractional ideal class
sage: J^6 == c^6
False

So care should be taken, e.g. $J^6$ is not $c^6$, although...