Hi,
Say I want to compute the centralizer of a matrix.
sage: P.<a,b,c,d>=PolynomialRing(QQ)
sage: A=matrix(P,2,2,[2,1,1,1])
sage: B=matrix(P,2,2,[a,b,c,d])
sage: C=A*B-B*A
sage: C
[ -b + c -a + b + d]
[ a - c - d b - c]
sage: var('a b c d')
(a, b, c, d)
sage: solve([-b + c==0,-a + b + d==0,a - c - d==0,b - c==0],[a,b,c,d])
[[a == r2 + r1, b == r2, c == r2, d == r1]]
Here I had to manually copy the entries of C into solve, which is a
problem for larger matrices. Ideally, something like
solve(C==0,[a,b,c,d])
should work, but of course it doesn't. Is there any way of doing this?
Mladen
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---