#4733: [with patch, needs review] matrix exponential for general matrices
----------------------------+-----------------------------------------------
Reporter: jason | Owner: was
Type: enhancement | Status: new
Priority: major | Milestone: sage-3.2.2
Component: linear algebra | Resolution:
Keywords: |
----------------------------+-----------------------------------------------
Comment (by jason):
I think I see what you were saying:
{{{
sage: t = var('t')
sage: A = matrix([[1,2],[3,4]])
sage: B = (t*A).exp()
sage: Bprime = matrix(map(diff,B.list())) # This is wrong...
sage: Bprime.nrows()
1
sage: Bprime = B.apply_map(diff) # This is right (and with 3.2.2, we could
just do diff(B,x) :).
sage: Bprime.nrows()
2
sage: B(1)*A == Bprime(1)
False
sage: B(1)*A == A*B(1)
False
sage: n(B(1)*A - A*B(1)) # Close to zero, should be equal to zero
[ 0.000000000000000 1.42108547152020e-14]
[5.68434188608080e-14 0.000000000000000]
sage: n(B(1)*A - Bprime(1)) # Close to zero, should be equal to zero
[ 2.13162820728030e-14 -1.27897692436818e-13]
[-4.26325641456060e-14 2.84217094304040e-14]
}}}
Everything is all right, though. "==" returning false just means that
Sage can't prove that they are equal. Let's simplify instead:
{{{
sage: (B(1)*A - A*B(1)).apply_map(lambda e: e.full_simplify())
[0 0]
[0 0]
sage: (B(1)*A - Bprime(1)).apply_map(lambda e: e.full_simplify())
[0 0]
[0 0]
}}}
Does that ease your mind? Can you review this patch now?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4733#comment:7>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
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-trac?hl=en
-~----------~----~----~----~------~----~------~--~---