On Sep 28, 5:51 am, Aidan <aidan....@gmail.com> wrote: > Hi, > > This may be a repeat question, but is there a function to simplify > complex expressions in sage? For example, the input > > M = matrix([[e^(2*pi*I*i*j/3) for i in [0..2]] for j in [0..2]]); > M.eigenvalues() > > outputs > > [-1/2*(-10/9*I*sqrt(3) + 2*I)^(1/3)*(I*sqrt(3) + 1) + 1/3*(I*sqrt(3) - > 1)/(-10/9*I*sqrt(3) + 2*I)^(1/3) + 1/3*I*sqrt(3), > -1/2*(-10/9*I*sqrt(3) + 2*I)^(1/3)*(-I*sqrt(3) + 1) + 1/3*(-I*sqrt(3) > - 1)/(-10/9*I*sqrt(3) + 2*I)^(1/3) + 1/3*I*sqrt(3), (-10/9*I*sqrt(3) + > 2*I)^(1/3) + 2/3/(-10/9*I*sqrt(3) + 2*I)^(1/3) + 1/3*I*sqrt(3)] > > What I'd really like is an output like > > [sqrt(3), I*sqrt(3), -sqrt(3)] > > Neither "simplify" nor "simplify_full" seemed to help. Thanks in > advance, > > Aidan Roy
The easiest way to get the answer right is the following one, but it's a bit of cheating... sage: (M/sqrt(3)).eigenvalues() [I, 1, -1] Yann -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org