Advice on adopting Sage in undergrad teaching?

24 views
Skip to first unread message

Colin Macdonald

unread,
Nov 15, 2009, 6:12:42 PM11/15/09
to sage...@googlegroups.com
Hi,

I'm looking for success stories from people who have used Sage in
their undergraduate teaching, particularly at the lower years.

Also, any advice in convincing one's peers and institution that Sage
is an appropriate path to take? In particular, in switching away from
a proprietary product.

My department is moving away from Maple as a component in our first
year teaching, and I may be in a position to influence what we start
using next September. I haven't looked over the ciriculum of the
current course but it might include calculus, linear algebra,
differential equations and various pure maths.

thanks,
Colin

--
Colin Macdonald
University Lecturer in Numerical Analysis
Tutorial Fellow at Oriel College
University of Oxford

David Joyner

unread,
Nov 15, 2009, 7:49:42 PM11/15/09
to sage...@googlegroups.com
On Sun, Nov 15, 2009 at 6:12 PM, Colin Macdonald
<macd...@maths.ox.ac.uk> wrote:
>
> Hi,
>
> I'm looking for success stories from people who have used Sage in
> their undergraduate teaching, particularly at the lower years.


Some info is here:
http://www.sagemath.org/library-books.html
http://wiki.sagemath.org/Teaching_with_SAGE
http://sage.math.washington.edu/home/wdj/teaching/index.html
http://linear.ups.edu/sage-fcla.html


>
> Also, any advice in convincing one's peers and institution that Sage
> is an appropriate path to take?  In particular, in switching away from
> a proprietary product.
>
> My department is moving away from Maple as a component in our first
> year teaching, and I may be in a position to influence what we start
> using next September.  I haven't looked over the ciriculum of the
> current course but it might include calculus, linear algebra,
> differential equations and various pure maths.


It depends how much money your dept really needs to save and
if they believe their students can learn the Sage syntax. Sage syntax
is not that much different than Maple or Mma syntax but a lot of the
students' success depends on how much work they put into it.

I would emphasize that the students who have internet access do not need to
install Sage since they can use it via a Sage server you can set up at your
university. See www.sagenb.org (which has several thousand users, so
I suggest you install one locally behind a firewall for your students
to use themselves).

Hope that helps some.

Rob Beezer

unread,
Nov 16, 2009, 12:40:00 AM11/16/09
to sage-edu
I've found Sage a great complement to my abstract algebra course.
Based on last fall's course (2008) I created a primer of Sage commands
useful for learning group theory.

http://abstract.ups.edu/sage-aata.html

I'll likely update it after this fall's course ends and then expand it
this spring when I teach rings, fields, etc. I'll greatly expand my
use of Sage in my linear algebra course which I will teach again this
spring after a bit of a break. I've also found Sage's 3D plots
extremely useful for teaching multivariate calculus.

One important feature to realize about Sage is that it can often
represent mathematical objects exactly. For example, the null space
(kernel) of a matrix is a *vector space*, not just a pile of basis
vectors. Then you can do many of the things you might do with a
vector space, like asking for its dimension, or intersecting it with
another vector space. I find this a valuable feature when using Sage
with students.

Rob

mhampton

unread,
Nov 16, 2009, 7:41:39 AM11/16/09
to sage-edu
As David Joyner mentioned, I think its important to set up a server
locally so that students don't have to install Sage themselves.
Sagenb is under pretty heavy load these days, so a local server can be
faster and perhaps more reliable (you can always use sagenb as a
backup).

I'm not sure how to convince people to switch from a proprietary
product they know well. I haven't had too much luck with that,
although lately I think I've made a little progress. Putting together
a good demo to show faculty helps.

In my experience students don't have any more trouble learning and
using Sage than they do with Mathematica.

If you reach students early enough some will probably advocate for you
- e.g. they might ask later professors if they can do their homework
in Sage, or show their friends.

Showing interacts in class (some examples at http://wiki.sagemath.org/interact)
can be a good way to show students what sage is capable of, and you
can use them as opportunities to give minor programming/usage tips. I
find that many small doses is much better than bombarding them with
lots of help before they need it.

That's it off the top of my head.

-Marshall Hampton

kcrisman

unread,
Nov 16, 2009, 8:50:32 AM11/16/09
to sage-edu
Hi Colin,

I just want to emphasize what the others said in terms of making it
easy for students with a local Sage server. Be sure not to have them
all using it simultaneously in one class, though! But if you allocate
enough GB to memory, it should be able to handle a reasonable class,
or many more.

The way I have used Sage most effectively is to introduce it without
them needing to know commands. That means either making worksheets
where the commands are there, ready for them to change the input, or
by creating interacts, where they only need to know how to click and
drag, or perhaps type in a number to change a number. Later on, of
course, you can have more advanced things possible.

But syntactically etc. Sage is no worse, and in many ways better, than
the other options. My only concern would be if you send a large
number of students to graduate school in a specific discipline where
there is a defacto standard (i.e. Matlab in engineering, at least in
the US), you may encounter resistance or grad schools may not look on
it as kindly - in which case your students will just have to be even
better at Sage! But if Maple was your old choice, I don't see that as
being an obstacle.

Also, one thing in your favor is that you can easily use the Sage
notebook in different ways for different courses. If Octave is most
appropriate for a linear algebra course, they can use that through the
notebook, and if numpy makes more sense elsewhere, you can use python
and import numpy - but all from the same interface, all from the same
server. So specialized things can be done very easily.

Please ask more questions, and let us know how things go. Good luck.

- kcrisman

calc...@aol.com

unread,
Nov 16, 2009, 9:35:15 AM11/16/09
to sage...@googlegroups.com

Well, if MATLAB is the issue, you can install Octave and still use a
SAGE notebook!

HTH,
A. Jorge Garcia
http://calcpage.tripod.com

Teacher & Professor
Applied Mathematics, Physics & Computer Science
Baldwin Senior High School & Nassau Community College

kcrisman

unread,
Nov 16, 2009, 10:04:27 AM11/16/09
to sage-edu


On Nov 16, 9:35 am, calcp...@aol.com wrote:
> Well, if MATLAB is the issue, you can install Octave and still use a
> SAGE notebook!
>

You'd think so, wouldn't you? But I've been assured by our
engineering head that there are enough syntax differences (however
minor) and the issue of many, many drivers being available for Matlab,
and not for Octave, that he's not interested in Octave. From his
point of view (which I respect), it's all about making students
optimally prepared for getting the best job, or best grad program, or
whatever. In math, this is not the same kind of issue.

Not trying to pick a fight, just reporting what I've been told - I
have no independent knowledge of this other than anecdotal. If there
is a significant segment of the engineering community that uses Octave
in day-to-day operations, that would be very interesting to know.

- kcrisman

Jason Grout

unread,
Nov 16, 2009, 12:55:48 PM11/16/09
to sage...@googlegroups.com

Does anyone know the status of the matlab<->Sage interface? I don't
have a copy of matlab handy, so I can't test it.

Thanks,

Jason

William Stein

unread,
Nov 16, 2009, 1:02:41 PM11/16/09
to sage...@googlegroups.com

Matlab is installed on sage.math. It passes its test suite:

wstein@sage:~/build/sage-4.2.1$ ./sage -t --optional
devel/sage/sage/interfaces/matlab.py
sage -t --optional "devel/sage/sage/interfaces/matlab.py"
[4.4 s]

----------------------------------------------------------------------
All tests passed!
Total time for all tests: 4.4 seconds
wstein@sage:~/build/sage-4.2.1$


william

Edgar Jasso

unread,
Nov 16, 2009, 2:15:03 PM11/16/09
to sage...@googlegroups.com
 Getting back to what kcrisman wrote, I had my own experience in my first approach to a 4-year school (UW) for the transferability of a class we are (were?) planning to develop (I teach at a Community College). Their point was that the Engineering School at this university requires matlab on DAY 1, so a student who had a sage-based class would be in disadvantage with his peers because of the learning curve the first weeks.

 So pretty much the option is to have a MATLAB based class, or no transferability (the exact words were not that, but that was the point).

 The reaction at my College? Ok, lets get it done with matlab then.

 I have problems with that decision and the whole thing has been on freeze for the last few months.


 Edgar
--

kcrisman

unread,
Nov 17, 2009, 9:04:45 AM11/17/09
to sage-edu


On Nov 16, 2:15 pm, Edgar Jasso <edgar.ja...@gmail.com> wrote:
>  Getting back to what kcrisman wrote, I had my own experience in my first
> approach to a 4-year school (UW) for the transferability of a class we are
> (were?) planning to develop (I teach at a Community College). Their point
> was that the Engineering School at this university *requires* matlab on DAY
> 1, so a student who had a sage-based class would be in disadvantage with his
> peers because of the learning curve the first weeks.
>
>  So pretty much the option is to have a MATLAB based class, or no
> transferability (the exact words were not that, but that was the point).
>

Yes, that is exactly what I have heard as well. Which in some sense
is a problem, but (again, from my limited understanding) is really
more about there being a default standard in engineering, and you can
hardly blame someone for wanting their students to get transfer
credit! So it's more like the problem Apple used to have, or
(presumably) Linux still does, that there was nowhere near the variety
of applications available for Mac as there were for Windows; no
drivers, no Labview, no reason to switch.

- kcrisman

Francois Maltey

unread,
Nov 17, 2009, 1:52:58 PM11/17/09
to sage...@googlegroups.com
Dear all,

> I'm looking for success stories from people who have used Sage in
> their undergraduate teaching, particularly at the lower years.
>
> Also, any advice in convincing one's peers and institution that Sage
> is an appropriate path to take? In particular, in switching away from
> a proprietary product.
>
> My department is moving away from Maple as a component in our first
> year teaching, and I may be in a position to influence what we start
> using next September. I haven't looked over the ciriculum of the
> current course but it might include calculus, linear algebra,
> differential equations and various pure maths.
>
In my French class I must use maple for tests... But I can use an other
system for few exercices and my students could use an other system, for
nicer plot or better mathematics.

A colleague uses alive system on an usb keys or a cdrom when there isn't
the right program on the computer in his classroom. A sage for ubuntu
may be useful.

The other PC are 2 or 3 old year PC with windows xp. One time the
install is done, we don't change any program, it takes time to update 40 PC.

This year I don't promote Sage in my school because I don't know it
enough, and I can't do the standard exercices I make with maple. I learn
! I'll see next year...

I'm not sure that other teachers will quickly change from maple to sage
for their own calculus because today I see 4 mains difference between
maple and sage :

1/ Syntax object.method, mathematics writes function(object)
2/ Sage forces to declare symbolic variables, Maple not
3/ Object in Sage are finest than Maple way as 0*aMatrix
4/ The sage lists aren't the usual lisp-list
5/ Some "basis" mathematics are missing in sage. [I don't yet have the
complete list]

The 2 first points are the most important.

Computer|Sage|Python players don't imagine how some people dislike to
change their own use of any system.

A initial input file with a more or less maple syntax may help a lot.

var('a b c d f g h j k l m n o p q r s t u v w')

def rhs (eq) : eq.rhs() # and about 10 or 20 mains functions

The last point isn't a problem because a fine use of list means that the
user like computer science. The other uses of lists don't separate
sage-list and lisp-list. And maple-lists aren't so clear.


Francois

kcrisman

unread,
Nov 17, 2009, 2:16:01 PM11/17/09
to sage-edu

>
> I'm not sure that other teachers will quickly change from maple to sage
> for their own calculus because today I see 4 mains difference between
> maple and sage :
>
> 1/ Syntax object.method, mathematics writes function(object)

As you've noted, this is possible to get around. Also, if there is
something which SHOULD be in the global namespace, you should ask
about it on sage-support or sage-devel - likely we just forgot to do
it thus far.

> 2/ Sage forces to declare symbolic variables, Maple not

Yes, though as you noted this is easy to overcome with a custom file
(not sure how it would work with a server). Don't forget y and z!

> 3/ Object in Sage are finest than Maple way as 0*aMatrix

Can you expand on what you mean by "finest"?

> 4/ The sage lists aren't the usual lisp-list

Perhaps rhs and lhs should be imported in global namespace? Maybe
this would be a bad idea though. Certainly many computer users today
are not used to lisp lists, at any rate.

> 5/ Some "basis" mathematics are missing in sage. [I don't yet have the
> complete list]

Please let us know what basic math is not in Sage - it would be very
important to rectify this as soon as possible. It *is* definitely
possible that some of what you are looking for is there, but not
optimally wrapped.


> Computer|Sage|Python players don't imagine how some people dislike to
> change their own use of any system.

Hmm, this is just the human condition :)

Thanks for your detailed feedback! And good luck learning more about
how Sage does what *you* need it to do.

- kcrisman

john_perry_usm

unread,
Nov 17, 2009, 2:17:04 PM11/17/09
to sage-edu
Hi.

> I'm looking for success stories from people who have used Sage
> in their undergraduate teaching, particularly at the lower years.

I think this counts as a "success story". I've used Sage in two
classes now: Honors Calc I, and MAT 305, a class our department calls
"Mathematical Computing", where we basically teach majors who have
completed the Calculus sequence some programming. In the past we used
Maple. The class was originally designed under three NSF grants, and
uses the Springer-Verlag textbook, "Mathematical Computing" by
Betounes and Redfern, the professors who designed the course.

It had become clear to me that the textbook was no longer appropriate.
Maple has changed, and some examples don't work anymore, or if they
do, don't work the way the book says. I recall that there's an fsolve
() example in our text that gives a different root than the one the
book reports, so I guess Maple changed some internals that affect
that. I could have looked for a new book that did more or less the
same thing, but since I've been using Sage exclusively for the last
year and a half, I thought I'd try it with MAT 305. This course for us
is not like what people from some universities have to face, where
someone expects the students to use what they learn in an engineering
or other math course. So I didn't even ask permission; I just went
ahead and did it. ;-)

It worked out very, *very* well. I switched the textbook to Zelle's
"Python Programming" and assigned only the chapters appropriate for
Sage (1, 2, 4, 6--8, 13), making adjustments to some exercises as
necessary. For example: my students have used the notebook interface
more or less exclusively this semester, and the notebook doesn't work
well with Python's "input" command, so I had to work around that.

Some students installed Sage from their laptops, but most work from
the server I run in my office. It's a Dell desktop hand-me-down with
512 MB of RAM, powered by an Intel Pentium 4, running a recent Ubuntu
Linux. As someone observed, it can run pretty slow during class time,
but it does run. Every now and then it'll hiccup and I have to restart
it, but aside from that students have more difficulty with the
computers in our labs than with the server. The load on the computer
is relatively small: there are 18-19 students in the class, and they
pair up on the computers in the lab. Since some use their own laptops,
I'd guess there are about 12-15 people running on that server at any
one time.

I didn't ask for permission; I just went ahead and did it. This might
not be a good idea in general. One of the other professors who teaches
the course spoke to me after a faculty meeting and said, "I notice
you're using Sage for Math Computing. I was thinking of that; how is
it working out?" He'll use Maple again next semester, but he's very
interested in switching in the long-term. To my knowledge, no students
have complained, even though Sage and Windows don't play as easily as
(say) Maple and Windows. To the contrary, the students seem to
*really* *like* it; the closest thing to a complain I've had was a
question last week along the lines of, "I really like this system, and
I'd like to use it in the high school classroom, but how easy is it to
install and move files from my home computer to my school computer?"
etc. Some students were sold, I think, on the fact that they were
learning Python programming as a bonus.

I mentioned Honors Calculus: I gave them a basic introduction, then
assigned occasional worksheets that required Calculus to solve a
problem. It could be done by hand, but doing it with Sage was
encouraged (and would have left them sane). Most of them responded to
it okay, some even loved it, while others just saw it as make-work.

I haven't (yet) tried to convince my department on switching
completely to Sage, but at least one colleague has switched, and
another apparently plans to. The main attractions for us have been
cost, open source, and using a fairly standard programming language.
The students like the worksheet interface, including the HTML editing
for text cells (TinyMCE?). But you do have to be completely honest
with the department that running Sage on Linux is easy, while running
Sage on Windows machines is non-trivial. It's not hard, but it's not
as straightforward as running it on Windows.

Hope something in all of that is useful.

regards
john perry

On Nov 15, 5:12 pm, Colin Macdonald <macdon...@maths.ox.ac.uk> wrote:

William Stein

unread,
Nov 17, 2009, 2:18:16 PM11/17/09
to sage...@googlegroups.com, Mike Hansen, Robert Bradshaw
Robert Bradshaw and Mike Hansen have both pointed out before that the
first 2 points could probably easily be changed (via a non-default
mode) in Sage. This would involve evaluating each input block of
code, catching NameErrors, making uncalled names into symbolic
variables and making called ones into formal method calls. It would
probably be easy, and just a few lines of code, and would just totally
solve 1, 2 for people who prefer that behavior (not me). I may try a
mockup of this later today, since it comes up a lot.

William

>
> Computer|Sage|Python players don't imagine how some people dislike to
> change their own use of any system.
>
> A initial input file with a more or less maple syntax may help a lot.
>
> var('a b c d f g h j k l m n o p q r s t u v w')
>
> def rhs (eq) : eq.rhs()  # and about 10 or 20 mains functions
>
> The last point isn't a problem because a fine use of list means that the
> user like computer science. The other uses of lists don't separate
> sage-list and lisp-list. And maple-lists aren't so clear.
>
>
> Francois
>
> >
>



--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

Francois Maltey

unread,
Nov 17, 2009, 3:23:40 PM11/17/09
to sage...@googlegroups.com
kcrisman wrote :

>> 3/ Object in Sage are finest than Maple way as 0*aMatrix
>>
>
> Can you expand on what you mean by "finest"?
>
This calculus is maple-right but is user-discourteous.

M = matrix ([[a,b],[c,d]])
0*M = 0 with maple, and all other systems answer matrix([[0,0],[0,0]])

Even if you explain that for maple syntax, it's normal to get 0*A = 0
because the right way is "evalm(0*M)", I repeat : "everyone thinks that
0*M = matrix 0, not number 0". This 0*XYZ=0 rule isn't fine.
Only(?) an object language (as python) can treat this "multi-sens" of zero.

I have an other question : how can you easily verify this theorem in
sage ?

M = matrix([[a,b],[c,d]]) # or an nxn matrix with any parameters...
P = det (M - x*matrix ONE) # Call Cayley-Hamilton therem in France
eval (P with x=M) answers matrix([[0,0],[0,0]]).

I can't evaluate matrix inside expressions.

It was easy to do it with mupad, The choice of the right type gives the
right result in Axiom/Fricas.

>> 5/ Some "basis" mathematics are missing in sage. [I don't yet have the
>> complete list]
>>
>
> Please let us know what basic math is not in Sage - it would be very
> important to rectify this as soon as possible. It *is* definitely
> possible that some of what you are looking for is there, but not
> optimally wrapped.
>

The two first methods I don't find in sage was :

1/ Sum as sum(q^k, k=0..N)=(1-q^(n+1))/(1-q) and sum(x^k/k!, k=0..+oo)=e^x

2/ kernel over matrix is right, but I don't find the maple intbasis and
sumbasis which build a basis for F cap G and F+G where the F and G
subspaces are described by a list of vectors.

But I don't implore to have all (not so) simple(?) functions as soon as
possible. It's also important to take time to choose the right way or
the right syntax at the first time, because it's harder to change after !


F.

kcrisman

unread,
Nov 17, 2009, 4:07:44 PM11/17/09
to sage-edu
> This calculus is maple-right but is user-discourteous.
>
> M = matrix ([[a,b],[c,d]])
> 0*M = 0 with maple, and all other systems answer matrix([[0,0],[0,0]])
>
> Even if you explain that for maple syntax, it's normal to get 0*A = 0
> because the right way is "evalm(0*M)", I repeat : "everyone thinks that
> 0*M = matrix 0, not number 0". This 0*XYZ=0 rule isn't fine.
> Only(?) an object language (as python) can treat this "multi-sens" of zero.

Yes, this is right in Sage :)

>
> I have an other question : how can you easily verify this  theorem in
> sage ?
>
> M = matrix([[a,b],[c,d]])    # or an nxn matrix with any parameters...
> P = det (M - x*matrix ONE) # Call Cayley-Hamilton therem in France
> eval (P with x=M) answers matrix([[0,0],[0,0]]).
>

The problem is that symbolic ring doesn't allow matrices as
substitution:
sage: f(x)=x
sage: M

[a b]
[c d]
sage: f(M)
---------------------------------------------------------------------------
TypeError
sage: f.subs(x=M)
---------------------------------------------------------------------------
TypeError
TypeError: no canonical coercion from Full MatrixSpace of 2 by 2 dense
matrices over Symbolic Ring to Callable function ring with arguments
(x,)

I presume this is something which could be fixed fairly easily.

> I can't evaluate matrix inside expressions.
>
> It was easy to do it with mupad, The choice of the right type gives the
> right result in Axiom/Fricas.
>
> >> 5/ Some "basis" mathematics are missing in sage. [I don't yet have the
> >> complete list]
>
> > Please let us know what basic math is not in Sage - it would be very
> > important to rectify this as soon as possible.  It *is* definitely
> > possible that some of what you are looking for is there, but not
> > optimally wrapped.
>
> The two first methods I don't find in sage was :
>
> 1/ Sum as sum(q^k, k=0..N)=(1-q^(n+1))/(1-q) and sum(x^k/k!, k=0..+oo)=e^x
>

This has been waiting for review for months, as whuss has a nice
wrapper of the (fairly good) Maxima functionality on this. You are
right that it is fairly basic and missing currently.

For the second one I use .row_space().matrix().rows() and .column_space
().matrix().rows(), or whatever is appropriate. I agree that is
cludgy. It would also be nice to have an automatic "orthogonal
complement" or "perp" function, e.g. for getting the perp of a kernel
without resorting to row/column spaces...

Thanks!

- kcrisman

jason...@creativetrax.com

unread,
Nov 17, 2009, 4:25:49 PM11/17/09
to sage...@googlegroups.com
kcrisman wrote:
> For the second one I use .row_space().matrix().rows() and .column_space
> ().matrix().rows(), or whatever is appropriate. I agree that is
> cludgy. It would also be nice to have an automatic "orthogonal
> complement" or "perp" function, e.g. for getting the perp of a kernel
> without resorting to row/column spaces...
>
>

I wrote an orthogonal complement function a long time ago; I'm surprised
to not be able to find it in Sage now. I thought it was merged in at
least a year ago.


To answer the question about intersection and adding subspaces, is this
what you mean?


sage: M=matrix(4,range(16))
sage: a=M.right_kernel()
sage: a

Free module of degree 4 and rank 2 over Integer Ring
Echelon basis matrix:
[ 1 0 -3 2]
[ 0 1 -2 1]
sage: N=matrix(4,[1,2,1,-1, 2,4,2,-2, 4,3,2,1,1,2,3,5])
sage: b=N.kernel()
sage: b

Free module of degree 4 and rank 1 over Integer Ring
Echelon basis matrix:
[ 2 -1 0 0]
sage: a.intersection(b)

Free module of degree 4 and rank 0 over Integer Ring
Echelon basis matrix:
[]
sage: a+b

Free module of degree 4 and rank 3 over Integer Ring
Echelon basis matrix:
[ 1 0 1 -1]
[ 0 1 2 -2]
[ 0 0 4 -3]


Thanks,

Jason


William Stein

unread,
Nov 17, 2009, 5:35:09 PM11/17/09
to sage...@googlegroups.com, Mike Hansen, Robert Bradshaw, sage-devel
>> The 2 first points are the most important.
>
> Robert Bradshaw and Mike Hansen have both pointed out before that the
> first 2 points could probably easily be changed (via a non-default
> mode) in Sage.   This would involve evaluating each input block of
> code, catching NameErrors, making uncalled names into symbolic
> variables and making called ones into formal method calls.   It would
> probably be easy, and just a few lines of code, and would just totally
> solve 1, 2 for people who prefer that behavior (not me).   I may try a
> mockup of this later today, since it comes up a lot.

Wow, I just did a mockup in only about 30 minutes, and it was
shockingly easy. See

http://trac.sagemath.org/sage_trac/ticket/7482

for the single half page of code, which you can paste into the Sage
notebook, and which implements a sort of mockup of 1 and 2 mentioned
above.

-- William

Alex Ghitza

unread,
Nov 17, 2009, 4:12:01 PM11/17/09
to sage...@googlegroups.com, sage-s...@googlegroups.com

On Tue, Nov 17, 2009 at 09:23:40PM +0100, Francois Maltey wrote:
> This calculus is maple-right but is user-discourteous.
>
> M = matrix ([[a,b],[c,d]])
> 0*M = 0 with maple, and all other systems answer matrix([[0,0],[0,0]])
>
> Even if you explain that for maple syntax, it's normal to get 0*A = 0
> because the right way is "evalm(0*M)", I repeat : "everyone thinks that
> 0*M = matrix 0, not number 0". This 0*XYZ=0 rule isn't fine.
> Only(?) an object language (as python) can treat this "multi-sens" of zero.

I'm not sure I understand this paragraph. Mathematically, 0*M is
always the zero matrix and never the number 0. So it seems to me that
maple screws up if it returns the number 0. In Sage:

sage: var("a b c d")
(a, b, c, d)
sage: M = matrix([[a,b],[c,d]])
sage: 0*M

[0 0]
[0 0]



> I have an other question : how can you easily verify this theorem in
> sage ?
>
> M = matrix([[a,b],[c,d]]) # or an nxn matrix with any parameters...
> P = det (M - x*matrix ONE) # Call Cayley-Hamilton therem in France
> eval (P with x=M) answers matrix([[0,0],[0,0]]).


Here is one way, I don't know if there's an easier one:

sage: var("a b c d")
(a, b, c, d)
sage: M = matrix([[a,b],[c,d]])
sage: I = M.parent()(1)
sage: P = lambda x: det(M - x*I)
sage: P(M)
0

>
> The two first methods I don't find in sage was :
>
> 1/ Sum as sum(q^k, k=0..N)=(1-q^(n+1))/(1-q) and sum(x^k/k!, k=0..+oo)=e^x

This is in the works presently, wrapping Maxima's symbolic summation.
It's ticket 3587, and might make it into sage-4.3:

http://trac.sagemath.org/sage_trac/ticket/3587


> 2/ kernel over matrix is right, but I don't find the maple intbasis and
> sumbasis which build a basis for F cap G and F+G where the F and G
> subspaces are described by a list of vectors.
>

You have to work with the objects in Sage (which in my opinion is good
because students are forced to think about subspaces rather than lists
of vectors):

sage: V = VectorSpace(QQ, 5)
sage: F = V.subspace([(0,1,2,3,4), (1,2,3,4,6), (0,1,0,1,0)])
sage: G = V.subspace([(1, 1, 0, 0, 0), (0, 1, 1, 2, 2), (5, 4, 3, 2, 1)])
sage: I = F.intersection(G)
sage: I.basis()

[
(1, 0, -1, -2, -2),
(0, 1, 1, 2, 2)
]

sage: S = F + G
sage: S.basis()

[
(1, 0, 0, -1, 0),
(0, 1, 0, 1, 0),
(0, 0, 1, 1, 0),
(0, 0, 0, 0, 1)
]


Best,
Alex


--
Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne
-- Australia -- http://www.ms.unimelb.edu.au/~aghitza/

calc...@aol.com

unread,
Nov 17, 2009, 7:56:06 PM11/17/09
to sage...@googlegroups.com
>>
I think this counts as a "success story". I've used Sage in two classes
now: Honors Calc I, and MAT 305, a class our department calls
"Mathematical Computing", where we basically teach majors who have
completed the Calculus sequence some programming. In the past we used
Maple. The class was originally designed under three NSF grants, and
uses the Springer-Verlag textbook, "Mathematical Computing" by
Betounes and Redfern, the professors who designed the course.
<<

Wow, this sounds great! I'm trying to get a "Calculus Lab" started up
at my school that sounds like your "Honor Calculus" and I'm trying to
get rid of BASIC and replace it with python in our intro to programming
class, "Computer Math," that sounds like your "Mathematical Computing."
Thanx for the reference of the texts you use. I'm wondering if you
have any other suggestions for materials I could use in these courses.
Do you have a website detailing these courses perhaps?

TIA,

jason...@creativetrax.com

unread,
Nov 17, 2009, 8:53:31 PM11/17/09
to sage...@googlegroups.com
jason...@creativetrax.com wrote:



>
> I wrote an orthogonal complement function a long time ago; I'm surprised
> to not be able to find it in Sage now. I thought it was merged in at
> least a year ago.
>
>
>

Here's a quick shot at one, using the fact that the orthogonal
complement of the row space is the right kernel.

sage: def orthogonal_complement(space):
....: if space.dimension()==0:
....: return space.ambient_vector_space()
....: else:
....: return space.basis_matrix().right_kernel()



Thanks,

Jason

chris wuthrich

unread,
Nov 18, 2009, 6:17:22 AM11/18/09
to sage-edu

I have recently used sage for teaching a 3rd year undergraduate
lecture in number theory. As part of a "teaching development cycle"
that I am required to do by the University, I also included a little
questionnaire at the end. The outcome of this may be relevant for this
discussion.

There were about 20 students and half of them were familiar with
matlab and maple.
* Most students claimed that learning the basics of sage was just as
easy as learning the basics of the other CAS'. A few said they found
it easier.
* Noone complained about python notation foo.bar()
* Some complained about the error messages. Say if one types
for n=1 to 9:
print n
one gets an error at print n. That is confusing especially in more
complicated code.
* The majority of the students thought that it is important the
University should work with free open-source software. (I did not do
any propaganda before !)
* 2/3 of the students blame themselves and 1/3 the software when
something does not work.
* They were are impressed by @interact.

From my perspective the biggest problem was that I did not allocate
enough resources to the virtual server the notebook was running on.
I was a bit disappointed with the documentation for setting up a
server etc. For instance the docstring of the notebook still contains
lines like
nb = load('./sage/sage_notebook/nb.sobj')
which do not seem to apply any longer.

Subject-specifically: The problem of creating variables did not enter,
but I like William's automatic_creation, which should be useful for
teaching calculus. I had troubles justifying
Mod(2,3) in ZZ
True
after having explained them that classes of residues are not
integers !

Chris.

john_perry_usm

unread,
Nov 18, 2009, 12:10:28 PM11/18/09
to sage-edu
On Nov 17, 6:56 pm, calcp...@aol.com wrote:
> Wow, this sounds great!  I'm trying to get a "Calculus Lab" started up
> at my school that sounds like your "Honor Calculus"  and I'm trying to
> get rid of BASIC and replace it with python in our intro to programming
> class, "Computer Math," that sounds like your "Mathematical Computing."
>   Thanx for the reference of the texts you use.  I'm wondering if you
> have any other suggestions for materials I could use in these courses.  
> Do you have a website detailing these courses perhaps?

Two different ones:

Honors Calc at http://www.math.usm.edu/sage/
(mostly calc I, and some of the lecture notes on this webpage have
embarassingly wrong typos which I haven't yet fixed because a
colleague somehow convinced me to use his own LaTeX style files
instead of beamer--bad, bad mistake...)

Mathematical Computing at http://www.math.usm.edu/perry/mat305fa09/

And let me repeat the page David Joyner mentioned:
http://wiki.sagemath.org/Teaching_with_SAGE

regards
john perry

ma...@mendelu.cz

unread,
Nov 18, 2009, 3:55:26 PM11/18/09
to sage-edu
On 18 lis, 18:10, john_perry_usm <john.pe...@usm.edu> wrote:
> On Nov 17, 6:56 pm, calcp...@aol.com wrote:
> > Do you have a website detailing these courses perhaps?
>
> Two different ones:

Some minor examples are (in czech) at http://user.mendelu.cz/marik/sage/
- worksheets are embeded into PDF files. You may be interested for
example in Riemann integral at http://user.mendelu.cz/marik/sage/integral.pdf
- in the definition we use random division into subintervals and
random points from this interval - exactly as in teh definition of
Riemann integral. This is missed in many pictures which show defnition
of this integral.

btw: I have bad experiences when I show sagelets and interact on
lectures - it seems that my Sage installation detects, if I access
from my office or from the lecture hall: sagelets do not run at
lectures and when I return to my office, everything is O.K. again :
( If you want to present some sagelet on lecture, I strongly suggest
to have also a noninteractive version.

Robert.

Jason Grout

unread,
Nov 18, 2009, 4:31:41 PM11/18/09
to sage...@googlegroups.com
Are these running on a local server or on sagenb.org? I've had pretty
bad luck with running sagelets for live classroom demonstrations on
sagenb.org (usually it's extremely slow). I now run my in-class stuff
on my desktop computer or a laptop, but then copy the worksheet to
sagenb.org so students can access it too.

Jason


David Joyner

unread,
Nov 18, 2009, 6:15:52 PM11/18/09
to sage...@googlegroups.com
On Wed, Nov 18, 2009 at 12:10 PM, john_perry_usm <john....@usm.edu> wrote:
...

> Two different ones:
>
> Honors Calc at http://www.math.usm.edu/sage/
> (mostly calc I, and some of the lecture notes on this webpage have
> embarassingly wrong typos which I haven't yet fixed because a
> colleague somehow convinced me to use his own LaTeX style files
> instead of beamer--bad, bad mistake...)
>
> Mathematical Computing at http://www.math.usm.edu/perry/mat305fa09/


IMHO you are a really, really good writer/teacher, if these are a
representative example.

Are these lecture notes (a) available as beamer files, (b) under and open-source
license, (c) postable as latex files?

Great job!

>
> regards
> john perry
>
> --
>
> You received this message because you are subscribed to the Google Groups "sage-edu" group.
> To post to this group, send email to sage...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sage-edu?hl=.
>
>
>

ma...@mendelu.cz

unread,
Nov 19, 2009, 3:24:40 PM11/19/09
to sage-edu


On 18 lis, 22:31, Jason Grout <jason-s...@creativetrax.com> wrote:
> ma...@mendelu.cz wrote:
>
> > btw: I have bad experiences when I show sagelets and interact on
> > lectures - it seems that my Sage installation detects, if I access
> > from my office or from the lecture hall: sagelets do not run at
> > lectures and when I return to my office, everything is O.K. again :
> > ( If you want to present some sagelet on lecture, I strongly suggest
> > to have also a noninteractive version.
>
> Are these running on a local server or on sagenb.org?  I've had pretty
> bad luck with running sagelets for live classroom demonstrations on
> sagenb.org (usually it's extremely slow).  I now run my in-class stuff
> on my desktop computer or a laptop, but then copy the worksheet to
> sagenb.org so students can access it too.

I have a server for our university, with low traffic. Do not know
where is the problem and I was not able to reproduce this problem,
occurs randomly. However, I didn't try to restart worksheet yet, for
example. Perhaps this could solve the problem, but I forgot this trick
when came several times into problems :(. On the lecture I have the
same equipment as in my office (the same SunRay thin client, connected
to the same server, the same session transfered on chip card) so
everything should be the same. And I have never seen similar problems
in my office.

Robert

William Stein

unread,
Nov 19, 2009, 4:53:47 PM11/19/09
to sage...@googlegroups.com
I think it's just "Murphy's Law" (or "Sod's Law"), which is that
everything goes wrong when you give presentations. My solution to
the above problem is to install Sage on my laptop.

William

mhampton

unread,
Nov 20, 2009, 9:47:45 PM11/20/09
to sage-edu

Thanks for pointing that out. I've made ticket #7506 for that so its
not forgotten. Should be pretty easy to update that documentation.

http://trac.sagemath.org/sage_trac/ticket/7506

-M. Hampton

On Nov 18, 5:17 am, chris wuthrich <christian.wuthr...@gmail.com>
wrote:

calc...@aol.com

unread,
Nov 21, 2009, 8:32:55 AM11/21/09
to sage...@googlegroups.com
[I posted this in sage-support and thought it might be better to post
it here. Sorry for the cross posting if you see this twice....]

I'm wondering if anyone is using SAGE on a cluster. I recall something
about dSAGE a while back, is that still being supported?

I see on the tutorial there's something about using mpiPy with SAGE. If
I install SAGE on each of my compute nodes, is mpiPy already included?
Do I have to setup mpi separately?

BTW, I have 25 compute nodes networked via gigabit switched ethernet,
each node has a dualcore 2GHz AMD Athlon running 64-bit Fedora Core 11.

mhampton

unread,
Nov 21, 2009, 8:46:44 AM11/21/09
to sage-edu

Can you please start a new thread instead of adding on to existing
ones?

Thanks,
M. Hampton

On Nov 21, 7:32 am, calcp...@aol.com wrote:
> [I posted this in sage-support and thought it might be better to post
> it here. Sorry for the cross posting if you see this twice....]
>
> I'm wondering if anyone is using SAGE on a cluster. I recall something
> about dSAGE a while back, is that still being supported?
>
> I see on the tutorial there's something about using mpiPy with SAGE. If
> I install SAGE on each of my compute nodes, is mpiPy already included?
> Do I have to setup mpi separately?
>
> BTW, I have 25 compute nodes networked via gigabit switched ethernet,
> each node has a dualcore 2GHz AMD Athlon running 64-bit Fedora Core 11.
>
> TIA,
> A. Jorge Garciahttp://calcpage.tripod.com

john_perry_usm

unread,
Nov 21, 2009, 5:03:03 PM11/21/09
to sage-edu
On Nov 18, 5:15 pm, David Joyner <wdjoy...@gmail.com> wrote:
> IMHO you are a really, really good writer/teacher, if these are a
> representative example.
>
> Are these lecture notes (a) available as beamer files, (b) under and open-source
> license, (c) postable as latex files?
>
> Great job!

Thank you very, very much! I can send the source in Lyx or LaTeX
format; do you have a preference? They do use the Beamer package, and
two or three other packages I wrote (or modified) myself, so I'd send
those along too.

I hadn't put any license on them because, when I started, I didn't
think anyone would be interested. I guess I have to think about it,
but I'd be fine with other people modifying them to suit their own
needs.

regards
john perry

Bruce Cohen

unread,
Nov 21, 2009, 5:35:03 PM11/21/09
to sage...@googlegroups.com
I agree John's work is very good. My preference would be to have then
available as LaTeX files.

Thanks for making them available.

-Bruce
Bruce Cohen | e-mail: math....@gmail.com
Lowell High School | http://www.cgl.ucsf.edu/home/bic
> --
>
> You received this message because you are subscribed to the Google Groups "sage-edu" group.
> To post to this group, send email to sage...@googlegroups.com.
> To unsubscribe from this group, send email to sage-edu+u...@googlegroups.com.

David Joyner

unread,
Nov 21, 2009, 8:51:12 PM11/21/09
to sage...@googlegroups.com
On Sat, Nov 21, 2009 at 5:03 PM, john_perry_usm <john....@usm.edu> wrote:
> On Nov 18, 5:15 pm, David Joyner <wdjoy...@gmail.com> wrote:
>> IMHO you are a really, really good writer/teacher, if these are a
>> representative example.
>>
>> Are these lecture notes (a) available as beamer files, (b) under and open-source
>> license, (c) postable as latex files?
>>
>> Great job!
>
> Thank you very, very much! I can send the source in Lyx or LaTeX
> format; do you have a preference? They do use the Beamer package, and


LaTeX.


> two or three other packages I wrote (or modified) myself, so I'd send
> those along too.


Excellent, thanks!


>
> I hadn't put any license on them because, when I started, I didn't
> think anyone would be interested. I guess I have to think about it,
> but I'd be fine with other people modifying them to suit their own
> needs.


Maybe cc-by-sa or GFDL?


If you like, I can post them on my sage.math webpage, of course with full
credit to you.


>
> regards
> john perry
>
> --
>
> You received this message because you are subscribed to the Google Groups "sage-edu" group.
> To post to this group, send email to sage...@googlegroups.com.
> To unsubscribe from this group, send email to sage-edu+u...@googlegroups.com.

Matt Rissler

unread,
Nov 22, 2009, 6:19:15 PM11/22/09
to sage-edu
I've overextended some functionality to have a notebook cluster. By
exporting the directory that sage is running in (and /tmp/ since 4.2),
and using the functionality of the server_pool variable. Processes
for different notebook users are distributed to the compute nodes.
It's slowed down since 4.2, but it still works for a class of 30
students. I'm guessing that this isn't what you were asking, but it's
one way to get up to a class full of students without buying a better
machine with enough RAM and cores to handle that many students.

Best,
Matt

On Nov 21, 7:32 am, calcp...@aol.com wrote:
> [I posted this in sage-support and thought it might be better to post
> it here.  Sorry for the cross posting if you see this twice....]
>
> I'm wondering if anyone is using SAGE on a cluster. I recall something
> about dSAGE a while back, is that still being supported?
>
> I see on the tutorial there's something about using mpiPy with SAGE. If
> I install SAGE on each of my compute nodes, is mpiPy already included?
> Do I have to setup mpi separately?
>
> BTW, I have 25 compute nodes networked via gigabit switched ethernet,
> each node has a dualcore 2GHz AMD Athlon running 64-bit Fedora Core 11.
>
> TIA,
> A. Jorge Garciahttp://calcpage.tripod.com

calc...@aol.com

unread,
Nov 23, 2009, 5:16:09 PM11/23/09
to sage...@googlegroups.com
OK, this is interesting. Do you see processes migrating over the
cluster? DO you see any speed up?

TIA,
A. Jorge Garcia
http://calcpage.tripod.com

Teacher & Professor
Applied Mathematics, Physics & Computer Science
Baldwin Senior High School & Nassau Community College


Matt Rissler

unread,
Nov 24, 2009, 10:43:54 AM11/24/09
to sage-edu
Processes are pushed to the cluster. The server_pool option for the
notebook server basically (as I understand it) picks one of the ssh
logins in the pool at random. It then logins and runs a sage process
on that login with the restrictions on memory and runtime that you
set. It is currently intended to be used to have a more secure login
on a single machine that actually runs the processes for the
notebook. It works for this, but is clunky mostly because you have to
get separate machines to think they are one machine, and I'm not that
great at doing that yet.

Most of my speedup comes from the time saved in not overloading one
machines RAM and processors. I have old computers which don't have the
power or memory individually to host an entire class, but with this
they work. However, there is slowdown associated with the networked
filesystem that it's running on (especially since /tmp needed to be
mirrored), and occasionally a NFS link gets lost. I'll probably poke
around with it more after the semester is over.

Matt

On Nov 23, 4:16 pm, calcp...@aol.com wrote:
> OK, this is interesting.  Do you see processes migrating over the
> cluster?  DO you see any speed up?
>
> TIA,
> A. Jorge Garciahttp://calcpage.tripod.com
>
> Teacher & Professor
> Applied Mathematics, Physics & Computer Science
> Baldwin Senior High School & Nassau Community College
>
>
>

David Joyner

unread,
Dec 8, 2009, 2:00:15 PM12/8/09
to sage...@googlegroups.com
John Perry kindly agreed to open-source license the full source of his
excellent course notes for his class on math computation using Sage.
I posted, with his explaicit permission, the notes to
http://sage.math.washington.edu/home/wdj/teaching/perry-math-computation-and-sage/

Offray Vladimir Luna Cárdenas

unread,
Dec 31, 2009, 11:55:42 AM12/31/09
to sage...@googlegroups.com
Hi,

David Joyner escribi�:


> On Wed, Nov 18, 2009 at 12:10 PM, john_perry_usm <john....@usm.edu> wrote:
> ...
>
>
>> Two different ones:
>>
>> Honors Calc at http://www.math.usm.edu/sage/
>> (mostly calc I, and some of the lecture notes on this webpage have
>> embarassingly wrong typos which I haven't yet fixed because a
>> colleague somehow convinced me to use his own LaTeX style files
>> instead of beamer--bad, bad mistake...)
>>
>> Mathematical Computing at http://www.math.usm.edu/perry/mat305fa09/
>>
>
>
> IMHO you are a really, really good writer/teacher, if these are a
> representative example.
>
> Are these lecture notes (a) available as beamer files, (b) under and open-source
> license, (c) postable as latex files?
>
> Great job!
>
>

I join to the praises and petitions of David Joyner. Nice to have the
LyX sources and the license to change it. The picture of William in the
Introduction to Mathematical Computing is the one that you don't find in
a traditional lecture.

Cheers,

Offray

calc...@aol.com

unread,
Dec 31, 2009, 6:23:23 PM12/31/09
to sage...@googlegroups.com, calc...@aol.com
>> Mathematical Computing at http://www.math.usm.edu/perry/mat305fa09/

Wow, these sites are phenomenal!!! I wish there were more Calc II and
Calc III materials, however!

I wonder if a copy of these course materials could be mirrored on the
SageMath site along with the tutorials. If memory serves, I think I
saw the Calc I materials there already.

HTH,
A. Jorge Garcia

john_perry_usm

unread,
Jan 8, 2010, 7:48:37 PM1/8/10
to sage-edu
I'm really slow getting back to this (sorry, even my winter breaks are
insane) so apologies if this thread is considered dead, but:

On Dec 31 2009, 5:23 pm, calcp...@aol.com wrote:
> >> Honors Calc athttp://www.math.usm.edu/sage/
> >> Mathematical Computing athttp://www.math.usm.edu/perry/mat305fa09/


>
> Wow, these sites are phenomenal!!!  I wish there were more Calc II and
> Calc III materials, however!

Thank you very much! Be aware though that the Calc I lectures are
Awful (TM). For reasons it's best not to go into, they were written
using non-standard LaTeX packages and some were written in a hurry and
have some Really Sloppy Mistakes. It's my goal to move them to Beamer
and fix the mistakes sometime.

If anyone's willing to take on this Herculean task (each slide is its
own file, and as I said some of the LaTeX is non-standard) and do that
work themselves, let me know. I'd be *very* happy to see this develop,
rather than languish the way it's doing right now. To be honest, my
original goal was to have a kind of interactive web page, but I
couldn't figure out how to do that (I know the notebook should be able
to do it, but it didn't satisfy me for some reason--for example, I
think I'd like to use frames somehow).

regards
john perry

Reply all
Reply to author
Forward
0 new messages