On Sun, Aug 24, 2008 at 3:54 AM, David Joyner <[EMAIL PROTECTED]> wrote:
>
> On Sun, Aug 24, 2008 at 12:20 AM, Ryan <[EMAIL PROTECTED]> wrote:
>>
>> I have the symbolic complex matrix:
>>
>> M=matrix([[1/((-1)^(1/4)*(I - 1)), (1 - I)*I/((-1)^(1/4)*(-1*I-1)*(I -
>> 1))],[1/((-1)^(1/4)*(I - 1)),I/((-1)^(1/4)*(-1*I - 1))]])
>>
>> This matrix should simplify to a real matrix with all entries plus or
>> minus 1/sqrt(2), however when I use
>>
>> M.simplify()
>
> What about
>
> sage: M.apply_map(real)
>
> [-1/sqrt(2)  1/sqrt(2)]
> [-1/sqrt(2) -1/sqrt(2)]
> sage: M.apply_map(imag)
>
> [0 0]
> [0 0]
>
>
> Does that help any?

You can also use a number field, which will be very fast, but
map not be so useful for whatever else you're doing:

INPUT:
x = polygen(QQ)
K.<a> = NumberField(x^4 + 1)
I = a^2
matrix([[1/(a*(I - 1)), (1 - I)*I/(a*(-1*I-1)*(I -1))],[1/(a*(I -
1)),I/(a*(-1*I - 1))]])

OUTPUT:
[ 1/2*a^3 - 1/2*a -1/2*a^3 + 1/2*a]
[ 1/2*a^3 - 1/2*a  1/2*a^3 - 1/2*a]

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