Ask Your Question

Polynomials over number fields

asked 2017-07-24 11:11:57 -0500

coreyharris gravatar image

updated 2017-07-25 10:51:13 -0500

tmonteil gravatar image

Below I define a polynomial ring K[s,t]. My goal is to compute the minors of a large matrix with entries in this ring.

# K.<t> = NumberField(x^2-2)
K.<s,t> = NumberField([x^2-2,x^2-5])
R.<p0,p1,p2,p3,p4,p5> = K[]
M = Mat(R,10,10).random_element()
mins = M.minors(2)

This code works fine, but if I replace the last line with

mins = M.minors(7)

it fails with the error message

TypeError: no conversion to a Singular ring defined

Is it possible to avoid this error?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-07-24 14:39:05 -0500

Thanks for your report, this is a bug in Sage. I opened the ticket #23535 to track the issue. Hopefully it will be corrected and fixed in later releases... In the mean time you can fallback to the generic algorithm with

sage: m = random_matrix(R,4)
sage: sage.matrix.matrix2.Matrix.determinant(m)
edit flag offensive delete link more


So this method only computes determinants? Is there an easy way to manually iterate over submatrices?

coreyharris gravatar imagecoreyharris ( 2017-07-24 14:57:09 -0500 )edit

You can take submatrices using indices

sage: m = matrix(4, range(16))
sage: m
[ 0  1  2  3]
[ 4  5  6  7]
[ 8  9 10 11]
[12 13 14 15]
sage: m[1:3, 2:4]
[ 6  7]
[10 11]

(be careful indices starts at 0)

vdelecroix gravatar imagevdelecroix ( 2017-07-24 15:05:49 -0500 )edit

The error also shows for the one $4$-minor of a random $4\times 4$-matrix over R,

K.<s,t> = NumberField([x^2-2,x^2-5])
R.<p0,p1,p2,p3,p4,p5> = K[]
M = Mat(R,4,4).random_element()
    mins = M.minors(4)
except TypeError:
    print " TypeError"

This may be relevant for the tests to fix the bug.

I tried to change the base from R to its fraction field, got no error, but also had no time to wait for that one determinant computation...

dan_fulea gravatar imagedan_fulea ( 2017-07-24 18:21:50 -0500 )edit

@dan_fulea The determinant code has special cases for size 2 and 3 reason why you do not see the bug before size 4.

vdelecroix gravatar imagevdelecroix ( 2017-07-25 03:19:25 -0500 )edit

Yes, thanks, my intention was just to give a simple instance for the error, that may serve as test case for the opened ticket... (And also to mention that the 4x4 determinant of the random matrix could not be computed in real time, so computing all 7x7 minors of a 10x10 random matrix...)

dan_fulea gravatar imagedan_fulea ( 2017-07-25 15:32:44 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-07-24 11:09:25 -0500

Seen: 171 times

Last updated: Jul 24