This is probably very easy but can't figure it out. How can I compute the determininant of a matrix with indeterminate entries in it?
gap> a:=X(Rationals);
x_1
gap> m:=[[a,0],[0,a]];
[ [ x_1, 0 ], [ 0, x_1 ] ]
gap> DeterminantMat(m);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 1st choice method found for `DeterminantMat' on 1 arguments at /usr/src/gap-4.10.2/lib/methsel2.g:250 called from
<function "HANDLE_METHOD_NOT_FOUND">( <arguments> )
called from read-eval loop at *stdin*:23
type 'quit;' to quit to outer loop
brk>
I would have expected the answer to be
x_1^2.
Needless to say that DeterminantMat(m) works as expected when there are no indeterminates in m as does
gap> RootsOfPolynomial(a^2+2*a+1);
[ -1, -1 ]
a:=X(Rationals)toa:=X(Integers)to no avail. Why doesn't that work or, to put it differently, over what ring would a matrix like[[1,0],[0,1]]be? – diffset Mar 19 '20 at 13:10x_1as a polynomial although you clearly said so in your answer. I had the notion of it being a variable. So is it then the right way to state the problem of a parameter dependent determinant of a matrix? – diffset Mar 19 '20 at 13:47DeterminantMatDivFreeworks forX(Integers)- there is a suggestion about it in the manual entry forDeterminantMat- enter?DeterminantMatin GAP to see it. – Olexandr Konovalov Mar 19 '20 at 17:00DeterminantMatDivFreein the first version of my answer that I never submitted). Also,X(Integers)is identical toX(Rationals). – Max Horn Mar 19 '20 at 17:02DeterminantMatDivFreedoes work forX(Integers)in the example above. But thanks for pointing out thatX(Integers)is identical toX(Rationals)- that explains why it actually works. – Olexandr Konovalov Mar 19 '20 at 17:13DeterminantMatDivFreedoes not work forX(Integers)here…a:=X(Integers);; m:=[[a,0],[0,a]];;DeterminantMatDivFree(m);results in the same error as above. – diffset Mar 20 '20 at 07:13One(a);- but thenDeterminantMatworks too, so it does not make a difference... – Olexandr Konovalov Mar 20 '20 at 08:17