Forgive me if this is too obvious.  I'm still evaluating/learning the
basics of SAGE

Just how compatible is SAGE with Python?  By which I mean, should I be
able to just "drop-in" an existing/working python script and have it
run, or should I expect some modifications will be required?  And if
so, what's the major things I need to keep an eye out for?

I've looked in the documents, particularly "Coding in Python for Sage"

http://www.sagemath.org/doc/prog/node15.html

I'll illustrate by example.  I found a Python script that does a
physics calculation (band structure of silicon)

http://www.wag.caltech.edu/home/rpm/projects/tight-binding/harrison.py

or see here for a discussion of the script:

http://www.wag.caltech.edu/home/rpm/projects/tight-binding/

I've successfully run harrison.py (without modification) using both
linux and windows-based python installations.  But under SAGE (I've
installed the latest vmware version) required a little diddling to get
it (mostly) running.

Two points. 1) This script calls for modules "Numeric" and
"LinearAlgebra"

from Numeric import *        # Make sure that NumPy is in your
from LinearAlgebra import eigenvalues

both of which failed in SAGE.  A couple minor modifications and I got
past those points.  I suspect these are deprecated, but still the
Python installations handled the script without mods.

2) The other thing that failed was the system call to gnuplot at the
end of the script.  I can imagine that would be hard make work in a
SAGE-notebook environment, and I haven't managed that.

Now, my point here is not that I need that script to run,
particularly.  My question is about compatibility.  Have I missed
something about how to execute a Python script with the minimum of
modifications?

Thanks for your time.  BTW, SAGE is really impressive.

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