Dear support,
Here are several things I tried to "verify" the inverse of a matrix
involving roots of unity. None of them seem to give the "right"
answer, though of course numerically the first one is very very close
as makes sense, and the second and third are not wrong. Still, I
can't help but think there must be another way to do this which will
give 3*identity_matrix straight up. Any ideas?
- kcrisman
(PS - Also interesting to note is that the inversion of the last
matrix doesn't even try to divide out the rational expression, though
in this case that is good because if you did, you would get a
ZeroDivisionError, because _div_ doesn't check whether the numerator
and denominator are multiples of each other, though perhaps it is
mathematically wrong to cancel these... except it's not in this case,
because the inverse matrix should have 1/3 there.)
----------------------------------------------------------------------
| Sage Version 4.0.2, Release Date: 2009-06-18 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: M = matrix([[((CC(e^(pi*I*2/3)))^i)^j for j in range(3)] for i
in range(3)])
sage: M
[ 1.00000000000000
1.00000000000000 1.00000000000000]
[ 1.00000000000000 -0.500000000000000 +
0.866025403784439*I -0.500000000000000 - 0.866025403784438*I]
[ 1.00000000000000 -0.500000000000000 -
0.866025403784438*I -0.499999999999999 + 0.866025403784439*I]
sage: N = M.matrix_from_rows([0,2,1])
sage: M*N
[ 3.00000000000000 -1.11022302462516e-16
+ 3.33066907387547e-16*I 4.44089209850063e-16 +
5.55111512312578e-16*I]
[-1.11022302462516e-16 + 3.33066907387547e-16*I 3.00000000000000
- 1.22124532708767e-15*I -1.11022302462516e-16 +
9.99200722162641e-16*I]
[ 4.44089209850063e-16 + 5.55111512312578e-16*I -1.11022302462516e-16
+ 9.99200722162641e-16*I 3.00000000000000 -
2.44249065417534e-15*I]
sage: M = matrix([[((e^(pi*I*2/3))^i)^j for j in range(3)] for i in
range(3)])
sage: M
[ 1 1 1]
[ 1 e^(2/3*I*pi) e^(4/3*I*pi)]
[ 1 e^(4/3*I*pi) e^(8/3*I*pi)]
sage: N = M.matrix_from_rows([0,2,1])
sage: M*N
[ 3 e^(2/3*I*pi) + e^(4/3*I*pi) + 1 e^
(4/3*I*pi) + e^(8/3*I*pi) + 1]
[ e^(2/3*I*pi) + e^(4/3*I*pi) + 1 3 e^
(8/3*I*pi) + e^(10/3*I*pi) + 1]
[ e^(4/3*I*pi) + e^(8/3*I*pi) + 1 e^(8/3*I*pi) + e^(10/3*I*pi) +
1 3]
sage: R.<x> = QQ[]
sage: S = R.quotient
R.quotient R.quotient_by_principal_ideal
R.quotient_ring
sage: S = R.quotient('x^3-1')
sage: S
Univariate Quotient Polynomial Ring in xbar over Rational Field with
modulus x^3 - 1
sage: S.<y> = R.quotient('x^3-1')
sage: S
Univariate Quotient Polynomial Ring in y over Rational Field with
modulus x^3 - 1
sage: M = matrix([[(y^i)^j for j in range(3)] for i in range(3)])
sage: M
[ 1 1 1]
[ 1 y y^2]
[ 1 y^2 y]
sage: N = M.matrix_from_rows([0,2,1])
sage: M*N
[ 3 y^2 + y + 1 y^2 + y + 1]
[y^2 + y + 1 3 y^2 + y + 1]
[y^2 + y + 1 y^2 + y + 1 3]
sage: M^-1
[(-3*y^2 - 3*y + 6)/(-9*y^2 - 9*y + 18) (-3*y^2 - 3*y + 6)/(-9*y^2 -
9*y + 18) (-3*y^2 - 3*y + 6)/(-9*y^2 - 9*y + 18)]
[(-3*y^2 - 3*y + 6)/(-9*y^2 - 9*y + 18) (6*y^2 - 3*y - 3)/(-9*y^2 -
9*y + 18) (-3*y^2 + 6*y - 3)/(-9*y^2 - 9*y + 18)]
[ (-2*y^2 + y + 1)/(-6*y^2 + 3*y + 3) (y^2 + y - 2)/(-6*y^2 +
3*y + 3) (y^2 - 2*y + 1)/(-6*y^2 + 3*y + 3)]
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---