Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Or you could use the algorithm='unimodular' option to random_matrix.

sage: random_matrix(GaussianIntegers(),2,algorithm='unimodular')

[-429*I + 54     -I - 10]
[   43*I - 1           1]
sage: random_matrix(GaussianIntegers(),2,algorithm='unimodular')

[  6*I - 7 -7*I - 12]
[    I - 1    -I - 2]
sage: random_matrix(GaussianIntegers(),2,algorithm='unimodular')

[   -6*I + 29 -221*I - 103]
[       I + 9    -74*I - 9]

You'd need to define your other rings and plop them in the right spot, of course.

Or you could use the algorithm='unimodular' option to random_matrix.

sage: random_matrix(GaussianIntegers(),2,algorithm='unimodular')

[-429*I + 54     -I - 10]
[   43*I - 1           1]
sage: random_matrix(GaussianIntegers(),2,algorithm='unimodular')

[  6*I - 7 -7*I - 12]
[    I - 1    -I - 2]
sage: random_matrix(GaussianIntegers(),2,algorithm='unimodular')

[   -6*I + 29 -221*I - 103]
[       I + 9    -74*I - 9]

You'd need to define your other rings and plop them in the right spot, of course.course. Edit: such as follows, though there are probably better ways to get this ring. In particular, be careful since the integral closure of $\mathbb{Z}[\sqrt{n}]$ isn't always equal to it, but depends on the residue class of n (mod 4), if I recall correctly.

K = NumberField(x^2 + 2, 's')
OK = K.ring_of_integers()
for n in range(3):
    show(random_matrix(OK,2,algorithm='unimodular'))