Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question
0

Polynomials over number fields

asked 7 years ago

coreyharris gravatar image

updated 2 years ago

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.

var('x')
# 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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 7 years ago

vdelecroix gravatar image

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)
Preview: (hide)
link

Comments

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

coreyharris gravatar imagecoreyharris ( 7 years ago )

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 ( 7 years ago )

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

var('x')
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()
try:
    mins = M.minors(4)
except TypeError:
    print "...got 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 ( 7 years ago )

@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 ( 7 years ago )

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 ( 7 years ago )

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

Stats

Asked: 7 years ago

Seen: 481 times

Last updated: Jul 24 '17