In the third one, try using the polynomial quotient ring with modulus
x^2 + x + 1; the reason you aren't getting the output you expect is
because x^3 - 1 is reducible over QQ, and QQ[x] / (x^3 - 1) isn't an
integral domain. See below.

(Or you could use number field arithmetic; Sage has a special
optimised set of routines specifically for doing linear algebra over
cyclotomic fields.)

sage: R.<x> = QQ[]
sage: S.<y> = R.quotient(x^2 + x + 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 - 1]
[     1 -y - 1      y]
sage: N = M.matrix_from_rows([0,2,1])
sage: M * N

[3 0 0]
[0 3 0]
[0 0 3]

David

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to