On Dec 3, 2007 3:42 PM, William Stein <[EMAIL PROTECTED]> wrote:

> That won't work because nobody ever implement _maple_init_ as a method
> for Sage matrices.

Hmm, I'd be interested in looking into improving this myself.

> > In any case, there's nothing syntactically tricky about matrix
> > exponentation in Maple: just use ^.
>
> There was for me -- see below.  But many many thanks for the clarification.
>
> > This is how you'd do it in Maple:
> >
> > > m := 
> > > Matrix([[1/20,-1/10,1/20],[-1/10,-37/15,47/30],[1/20,67/30,-77/60]],shape=symmetric):
>
> The input matrix actually is *not* symmetric.

Ah, sorry for that!  I didn't notice that the (2,3) and (3,2) entries
were different.

> Thanks for the clarification!  According to the maple help,
> "The time command returns the total CPU time used since the start of the Maple
>   session."

Sorry again: if the help page says CPU time, then that's what time()
gives.  I was mistaken.

[snip]
> Here's what I tried in Maple (see below).  I tried lowercase "matrix" since,
> that's what I found when googling for how to create a matrix in Maple:
> > a := matrix([[1,2],[3,4]]);
[snip]
> > a := Matrix([[1,2],[3,4]]);
[snip]
> I guess that surprises me.

This is a frequent point of confusion.  Maple has two different matrix
data structures and two different linear algebra packages, as a result
of a refactoring of linear algebra done as of Maple 6 (ca. 2000).

Lowercase-m matrices, associated with the linalg package, are the
older pre-Maple 6 form.  These are supported for reasons of backwards
compatability.   Expressions involving these matrices need to be hit
with the 'evalm' command ("evaluate matrix") to force matrix
arithmetic.  In your example if you had entered 'evalm(a^2)' you would
have gotten the result you wanted.

Uppercase-m Matrices, associated with the LinearAlgebra package (as
well as any new package written after Maple 6 which uses matrices),
are the new and recommended form.  (There is no equivalent of evalm
for these Matrices; arithmetic is performed immediately.)  Using
Matrices and LinearAlgebra is also necessary to make use of the NAG
linear algebra routines.

The Sage interface to Maple should definitely be using the newer Matrices.

Steve

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to