On 1/18/11 7:12 PM, Dima Pasechnik wrote:


On Jan 19, 5:04 am, Rob Beezer<goo...@beezer.cotse.net>  wrote:
I am working nearly full-time on a big project to add detailed
explanations to my introductory linear algebra textbook about how to
use Sage to study linear algebra.  At every turn, this work suggests
additions or modifications to the Sage library.  At a minimum, I think
the final product will be a very good demonstration of how useful and
comprehensive Sage can be in teaching undergraduate mathematics
courses.  You can view the suggested patches, and a work-in-progress
version of the textbook at:http://wiki.sagemath.org/devel/LatexToWorksheet

There are several goals to these modifications of the Sage code:

(a) Simply conversions between vectors and matrices.  For example, a
patch allows for augmenting a matrix with a vector, rather than the
previous behavior which required three steps: converting the vector to
a 1-row matrix, then transposing it to a 1-column matrix, and then
augmenting with the column matrix.  (Dan Drake's "basic moves.")

(b) Allied with (a), make it as easy to take a column-oriented view of
linear algebra as a row-oriented view.  This has been much easier than
I suspected it would be, while still allowing for Sage's preference
for rows to dominate.

(c) Plan ahead for more advanced topics in matrix algebra which
naturally occur over the complex numbers.  Adding a "Hermitian inner
product" (name suggested by Dima P.) should not be controversial, I
hope.  From there, Sage needs a convenient way to take a conjugate
transpose of a matrix or a vector (yes, the transpose is irrelevant
for a Sage vector),

Transpose of a vector is a duality between the underlying vectorspace
and its dual.
IMHO for teaching purposes it's important to see the distinction
between row and column vectors.
(Ideally, I think, one would have a "student mode" of Sage, where if
A*v is valid for a square matrix A and a vector v, then v*A is not.)

With a patch going in soon or already in, you can "specify" an orientation for a vector by using .row() or .column() (really this just returns a single column or single row matrix).

A*v.column() would work, but v.column()*A would not work. Likewise, v.row()*A would work, but A*v.row() would not work.

It's not exactly what you want because vectors aren't exactly just single-row matrices or single-column matrices in Sage (i.e., they can have different methods, etc.). I can imagine in the future having a flag in the vector class which specifies an orientation, defaulting to None (for the current behavior). Then v.row() could return a new vector exactly like v, except with the flag set to "row", for example.

Right now, v.transpose() does what kind of what you want. v.transpose() returns a single-column matrix, so indeed v.transpose()*A does not work, but A*v.transpose() does.


Jason

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to