ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 26 Mar 2020 09:44:58 +0100Polynomials over Quaternions via Determinantshttps://ask.sagemath.org/question/50310/polynomials-over-quaternions-via-determinants/I currently trying to get polynomials over quaternions out of determinants of matrices. Example giving below:
> Q.<i,j,k> = QuaternionAlgebra(SR, -1, -1)
> A=matrix(4,4,[0,j,0,j,j,0,0,j,0,0,0,0,j,j,0,0])
> I=matrix.identity(4)
> P=(j\*A-x\*I)
> P.det()
But it doesn't work. Any idea?Fri, 20 Mar 2020 08:22:43 +0100https://ask.sagemath.org/question/50310/polynomials-over-quaternions-via-determinants/Comment by rburing for <p>I currently trying to get polynomials over quaternions out of determinants of matrices. Example giving below:</p>
<blockquote>
<p>Q.<i,j,k> = QuaternionAlgebra(SR, -1, -1)</p>
<p>A=matrix(4,4,[0,j,0,j,j,0,0,j,0,0,0,0,j,j,0,0])</p>
<p>I=matrix.identity(4)</p>
<p>P=(j*A-x*I)</p>
<p>P.det()</p>
</blockquote>
<p>But it doesn't work. Any idea?</p>
https://ask.sagemath.org/question/50310/polynomials-over-quaternions-via-determinants/?comment=50326#post-id-50326What does "determinant" mean if the matrix is defined over a noncommutative ring? In your case you are lucky that `P.change_ring(SR).det()` makes sense, but that doesn't work in general.Mon, 23 Mar 2020 12:51:23 +0100https://ask.sagemath.org/question/50310/polynomials-over-quaternions-via-determinants/?comment=50326#post-id-50326Answer by Sébastien for <p>I currently trying to get polynomials over quaternions out of determinants of matrices. Example giving below:</p>
<blockquote>
<p>Q.<i,j,k> = QuaternionAlgebra(SR, -1, -1)</p>
<p>A=matrix(4,4,[0,j,0,j,j,0,0,j,0,0,0,0,j,j,0,0])</p>
<p>I=matrix.identity(4)</p>
<p>P=(j*A-x*I)</p>
<p>P.det()</p>
</blockquote>
<p>But it doesn't work. Any idea?</p>
https://ask.sagemath.org/question/50310/polynomials-over-quaternions-via-determinants/?answer=50368#post-id-50368I do not know much about quaternion algebra, but I do know it is better to avoid involving the symbolic ring:
sage: Q.<i,j,k> = QuaternionAlgebra(QQ, -1, -1)
sage: K.<x> = Q[]
sage: K
Univariate Polynomial Ring in x over Quaternion Algebra (-1, -1) with base ring Rational Field
The variable `x` now lives in K:
sage: x.parent()
Univariate Polynomial Ring in x over Quaternion Algebra (-1, -1) with base ring Rational Field
and then:
sage: A = matrix(4,4,[0,j,0,j,j,0,0,j,0,0,0,0,j,j,0,0])
sage: I = matrix.identity(4)
sage: P = j*A - x*I
sage: P
[-x -1 0 -1]
[-1 -x 0 -1]
[ 0 0 -x 0]
[-1 -1 0 -x]
sage: P.parent()
Full MatrixSpace of 4 by 4 dense matrices over Univariate Polynomial Ring in x over Quaternion Algebra (-1, -1) with base ring Rational Field
sage: P.det()
x^4 - 3*x^2 + 2*x
Thu, 26 Mar 2020 09:44:58 +0100https://ask.sagemath.org/question/50310/polynomials-over-quaternions-via-determinants/?answer=50368#post-id-50368