[sage-support] Re: associativity of addition on ell. curves

2008-01-15 Thread achrzesz

Dear Carl,
I like your code; it is elegant and realy quick
but it seems that finishing your code
with Paul Zimmermann's approach

I2 = singular(I).groebner()
#print I.reduce(n12);
print singular.reduce((n12), I2)

(althout less elegant)
is a little bit faster
(0.06 - 0.05 on my comp. :)

I want also add a question to David Harvey questions

In experimenting with Lenstra factorization method one needs
multiplication on ell.curv over the Ring Z_(p*q). GP-Pari allows
for that so I'm  doing it using gp interface. Is it difficult to
implement
a similar functionality in Sage?

Andrzej Chrzeszczyk

On 15 Sty, 03:28, David Harvey [EMAIL PROTECTED] wrote:
 On Jan 14, 2008, at 10:09 PM, Carl Witty wrote:



  Here is a more idiomatic way to do this computation in Sage.  We work
  in the fraction field of a multivariate polynomial ring; this means
  that our polynomial arithmetic is handled by libSingular instead of by
  maxima, and that we can get the numerator directly with numerator,
  since fraction field elements are always normalized.  Also, we use
  Sage's wrapper of ideals and Groebner bases (which I believe is
  implemented with libSingular), rather than calling Singular.
  (Avoiding the call to factor(s1-s2) means that this version is much
  faster.)

  sage: R.x1,y1,x2,y2,x3,y3,a,b = QQ[]
  sage: eq1 = y1^2 -(x1^3+a*x1+b)
  sage: eq2 = y2^2 -(x2^3+a*x2+b)
  sage: eq3 = y3^2 -(x3^3+a*x3+b)
  sage: lambda12 = (y1 - y2)/(x1 - x2)
  sage: x4   = (lambda12*lambda12 - x1 - x2)
  sage: nu12 = (y1 - lambda12*x1)
  sage: y4   = (-lambda12*x4 - nu12)
  sage: lambda23 = ((y2 - y3)/(x2 - x3))
  sage: x5   = (lambda23*lambda23 - x2 - x3)
  sage: nu23 = (y2 - lambda23*x2)
  sage: y5   = (-lambda23*x5 - nu23)
  sage: s1 =(x1 - x5)*(x1 - x5)*((y3 - y4)*(y3-y4) - (x3+x4)*(x3-x4)*
  (x3-
  x4))
  sage: s2 =(x3 - x4)*(x3 - x4)*((y1 - y5)*(y1-y5) - (x1+x5)*(x1-x5)*
  (x1-
  x5))
  sage: n12 = numerator(s1-s2)
  sage: I = ideal([eq1,eq2,eq3])
  sage: I.reduce(n12)
  0

 What would be *really* nice is if we could work directly in the
 fraction field of the quotient of R.x1,y1,x2,y2,x3,y3,a,b by the
 appropriate ideal. (Does that even make sense? Is the ideal prime?) I
 tried to do this but Sage gave up pretty quickly on me. A nice encore
 would be to do this using Sage's elliptic curve class to do the
 actual arithmetic. After all EllipticCurves can be defined over any
 field

 Here's my dream session:

 sage: R.x1,y1,x2,y2,x3,y3,a,b = QQ[]
 sage: I = R.ideal(y1^2 - x1^3 - a*x1 - b, y2^2 - x2^3 - a*x2 - b,
 y3^2 - x3^3 - a*x3 - b)
 sage: S = FractionField(R.quotient(I)) # currently barfs
 sage: E = EllipticCurve(S, [a, b])
 sage: P1 = E(x1, y1)
 sage: P2 = E(x2, y2)
 sage: P3 = E(x3, y3)
 sage: (P1 + P2) + P3 == P1 + (P2 + P3)
 True

 Here's the traceback in the FractionField line:

 /Users/david/sage-2.9/local/lib/python2.5/site-packages/sage/rings/
 fraction_field.py in FractionField(R, names)
  104 if not ring.is_Ring(R):
  105 raise TypeError, R must be a ring
 -- 106 if not R.is_integral_domain():
  107 raise TypeError, R must be an integral domain.
  108 return R.fraction_field()

 /Users/david/sage-2.9/local/lib/python2.5/site-packages/sage/rings/
 quotient_ring.py in is_integral_domain(self)
  226
  227 
 -- 228 return self.defining_ideal().is_prime()
  229
  230 def cover_ring(self):

 /Users/david/sage-2.9/local/lib/python2.5/site-packages/sage/rings/
 ideal.py in is_prime(self)
  275
  276 def is_prime(self):
 -- 277 raise NotImplementedError
  278
  279 def is_principal(self):

 This suggests maybe the only barrier here is checking primality of
 the ideal? After that, the fraction field magic should just work
 right? But surely there is code somewhere to check primality, isn't
 this in singular or something? I don't know anything about the
 implementation of multivariate polynomial rings, maybe someone else
 can help out here.

 david
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: GAP small groups library missing

2008-01-15 Thread David Joyner

On Jan 15, 2008 2:51 AM, esdc [EMAIL PROTECTED] wrote:

 Hi all,
 I was trying to run a GAP session inside sage, with gap_console() and
 when the Smallgroups library is needed, I obtain an error:

 Error, the Small Groups library is required but not installed called
 from
 function( arguments ) called from read-eval-loop
 Entering break read-eval-print loop ...
 you can 'quit;' to quit to outer loop, or
 you can 'return;' to continue


 The Small Groups library is suposed to be instaled by default in GAP,

This is incorrect. In fact, the authors of that library decided to use a
distribution license which is not GPL-compatible, so I think it should be
distributed separately, for legal reasons. To install it (and some other
libraries), type

sage -i database_gap-4.4.10

 but apparently it isn't, I don't know wether it actually is installed
 but Sage does not detect it (which I doubt) or it is missing (which
 surprises me).

 Can anyone help finding this library or installing it?

 Thanks in advance

 E.
 


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Computations with Lie algebras?

2008-01-15 Thread [EMAIL PROTECTED]



On Jan 14, 1:33 pm, David Joyner [EMAIL PROTECTED] wrote:
 On Jan 14, 2008 9:31 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:



  Does SAGE currently include any functionality for manipulating Lie
  algebras? (I only need reductive Lie algebras, because I'm using them
  to study compact Lie groups.) For instance, I'd like to be able to
  manipulate irreducibles (encoded by their highest weights), so that I
  can form a tensor product and decompose it into irreducibles.

 GAP has this:http://www.gap-system.org/Manuals/doc/htm/ref/CHAP061.htm
 AFAIK, nothing is wrapped.

 On Jan 14, 2008 1:09 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:



  I just looked at the GAP docs, and I don't quite see how to do what I
  want (decomposing some random thing into irreducibles, or at least
  getting the multiplicity of the trivial representation), but I'm sure
  it's possible.

 I don't know how you want to specify some random thing. As a
 tensor product of a list of irreducibles determined by their
 highest weight?

In my case, I start with a single representation (given by the list of
highest weights of its irreducible components, specified with
multiplicities) and I want the multiplicity of the trivial
representation in some  tensor power of that. (I might generate that
initial representation by tensoring together some irreducibles, again
indicated by their highest weights.)

With Willem de Graaf's assistance, I have now Magma code that does
exactly this. (One has to be a bit careful, since there are two ways
to compute this. If you actually try to construct the tensor power and
then decompose it, you get hosed. Instead, you only construct it as
a list of highest weights, using some combinatorial method for
computing pairwise tensor product multiplicities.)

Ultimately I might need GAP after all, though, because I'm interested
in compact Lie groups which occasionally are not connected. In that
case, I'll need characters of finite groups too.

Anyway, I'm hoping to get together with Mike Hansen at MSRI next week
to discuss how things should look in SAGE. (I'll also be at SAGE Days
7 two weeks later.)

Kiran

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] LaurentSeries expansion

2008-01-15 Thread Martin Albrecht

Hi everybody,

in a nutshell I want to compute something like this MAGMA session in Sage:

%magma
Pa,b,c,d := PolynomialRing(GF(127),4);
I := idealP|c^3-b*d^2,b*c-a*d,b^3-a^2*c,a*c^2-b^2*d;
St := HilbertSeries(I);
S;
Lu := LaurentSeriesRing(IntegerRing());
L ! S;

The first part is quite easy as I wrapped the appropriate Singular function 
(singular.hilb(I,1)/(1-t^n)). It is the second part that gives me trouble, 
i.e. I need the first n Laurent series terms for the rational function which 
describes the Hilbert series.

Tips?
Martin

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x8EF0DC99
_www: http://www.informatik.uni-bremen.de/~malb
_jab: [EMAIL PROTECTED]


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: LaurentSeries expansion

2008-01-15 Thread William Stein

On Jan 15, 2008 8:46 AM, Martin Albrecht [EMAIL PROTECTED] wrote:

 Hi everybody,

 in a nutshell I want to compute something like this MAGMA session in Sage:

 %magma
 Pa,b,c,d := PolynomialRing(GF(127),4);
 I := idealP|c^3-b*d^2,b*c-a*d,b^3-a^2*c,a*c^2-b^2*d;
 St := HilbertSeries(I);
 S;
 Lu := LaurentSeriesRing(IntegerRing());
 L ! S;

 The first part is quite easy as I wrapped the appropriate Singular function
 (singular.hilb(I,1)/(1-t^n)). It is the second part that gives me trouble,
 i.e. I need the first n Laurent series terms for the rational function which
 describes the Hilbert series.

It might be a lot easier to help if you gave the rational function.  Depending
on how complicated the denominator is, you basically just have to compute the
Taylor series of the rational function, by differentiation and evaluation (using
Taylor's formula), i.e., kind of like this is doing, but over GF(p):

sage: f = (x^3 + x +1)/((x^4 + x^2 + 2)*x^3*(x^3-5))
sage: f.taylor(x, 0, 4)
-1/(10*x^3) - 1/(10*x^2) + 1/(20*x) - 7/100 + x/200 + 17*x^2/200 -
103*x^3/2000 - 23*x^4/2000



 -- William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] python question

2008-01-15 Thread William Stein

Kevin Buzzard wrote:
 I finally took the plunge and started learning python. I think it's the
 first language I've ever learnt where everything is a pointer and it was
 a big psychological shock! After my first day of messing around with it, I
 was utterly confused :-) I had a vector which I wanted to modify several
 times, and I wanted to keep track of what the vector looked like at
 various stages, so I initiated a list and then wrote a loop which, on
 every iteration, modified the vector and then appended the modified vector
 to the end of the list. Of course, when the loop had ended, the list
 contained 100 copies of the final state of the vector. I had no idea what
 to do! I asked David Loeffler and he told me about loading various modules
 and using functions like deepcopy() and it all left me feeling wholly
 bewildered! On the other hand I am kind of coming around to the idea now.

Here's the sort of thing you might want to do:

sage: v = vector(ZZ, 5)
sage: w = [v]
sage: for i in range(10):
: z = copy(w[-1]); z[0] += 1; w.append(z)
:
sage: w
[(0, 0, 0, 0, 0),
 (1, 0, 0, 0, 0),
 (2, 0, 0, 0, 0),
 (3, 0, 0, 0, 0),
 (4, 0, 0, 0, 0),
 (5, 0, 0, 0, 0),
 (6, 0, 0, 0, 0),
 (7, 0, 0, 0, 0),
 (8, 0, 0, 0, 0),
 (9, 0, 0, 0, 0),
 (10, 0, 0, 0, 0)]


This is indeed totally different than Magma which uses call by value
semantics.  Python is much closer semantically to C/C++, where most serious
programs pass around pointers.

In Magma:

 v := VectorSpace(RationalField(), 5)!0;
 w := [v,v,v];
 v[1] := 5;
 w;
[
(0 0 0 0 0),
(0 0 0 0 0),
(0 0 0 0 0)
]

In Sage/Python:

sage: v = vector(ZZ, 5)
sage: w = [v,v,v]
sage: v[1] = 5
sage: w
[(0, 5, 0, 0, 0), (0, 5, 0, 0, 0), (0, 5, 0, 0, 0)]

In Python w = [v,v,v] makes a list with 3 references to a single object.
In Magma it *tends* to make a list of 3 copies, if copying of objects
happens to be defined -- otherwise magma *still* makes a list of
3 references !!

 v := ModularSymbols(389);
 w := [v,v,v];
 v`dimension := 10;
 w[2]`dimension;
10

So Magma is just plain inconsistent, which in the long run is
more confusing than Python.  This is especially relevant when
it comes to complicated data structures (common in mathematics)
where copying is just not defined or is very expensive.


By the way the copy Python function is usually enough to copy
most Sage objects sufficiently for most purposes.   Deep copy
is needed only in certain special cases, e.g., a list of lists...

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

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Problems with standalone python/sage scripts

2008-01-15 Thread Georg

Hi,
Using sage-2.9.3, on Debian Etch on a core duo machine.
According to the sage tutorial p.67 section 5.3 Standalone Python/Sage
Scripts, i tried to run such a script called BMV.sage:

#!/usr/bin/env sage -python
import sys

$ ./BMV.sage
/usr/bin/env: sage -python: file or directory not found

though
$ /usr/bin/env sage -python
brings me to the python command line, i.e. this works.

changing the file BMV.sage to:

#!/path/to/sage/sage -python
import sys

shows strange behaviour:
if i run this script, nothing happens, just the mouse pointer changes
(into a cross), clicking the mouse button (left or right) brings back
the shell command line prompt, no output at all, and the mouse
pointer turns to normal again...

runnin the script:

#!/path/to/sage/sage -python
a = Hello

outputs
./BMV.sage: line 2: a: command not found

the script from the tutorial, literally:

#!/home/georg/Daten/.System/bin/sage/sage -python
import sys
from sage.all import *
if len(sys.argv) != 2:
   print Usage: %s n%sys.argv[0]
   print Outputs the prime factorization of n.
   sys.exit(1)
print factor(sage_eval(sys.argv[1])

gives the following output, as above not before clicking one of the
mouse buttons:
$ ./BMV.sage
from: can't read /var/mail/sage.all
./BMV.sage: line 4: syntax error near unexpected token `sys.argv'
./BMV.sage: line 4: `if len(sys.argv) != 2:'

additionally there is a file called 'sys' created in the directory of
BMV.sage, this is to long to post it here, the beginning is

%!PS-Adobe-3.0
%%Creator: (ImageMagick)
%%Title: (sys)
%%CreationDate: (Tue Jan 15 18:43:48 2008)
%%BoundingBox: 0 0 897 433
%%HiResBoundingBox: 0 0 897 433
%%DocumentData: Clean7Bit
%%LanguageLevel: 1
%%Orientation: Portrait
%%PageOrder: Ascend
%%Pages: 1
%%EndComments
.

thanks for help, Georg
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: GAP small groups library missing

2008-01-15 Thread esdc

it worked, thank you :)

On Jan 15, 12:39 pm, David Joyner [EMAIL PROTECTED] wrote:
 On Jan 15, 2008 2:51 AM, esdc [EMAIL PROTECTED] wrote:



  Hi all,
  I was trying to run a GAP session inside sage, with gap_console() and
  when the Smallgroups library is needed, I obtain an error:

  Error, the Small Groups library is required but not installed called
  from
  function( arguments ) called from read-eval-loop
  Entering break read-eval-print loop ...
  you can 'quit;' to quit to outer loop, or
  you can 'return;' to continue

  The Small Groups library is suposed to be instaled by default in GAP,

 This is incorrect. In fact, the authors of that library decided to use a
 distribution license which is not GPL-compatible, so I think it should be
 distributed separately, for legal reasons. To install it (and some other
 libraries), type

 sage -i database_gap-4.4.10

  but apparently it isn't, I don't know wether it actually is installed
  but Sage does not detect it (which I doubt) or it is missing (which
  surprises me).

  Can anyone help finding this library or installing it?

  Thanks in advance

  E.
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: LaurentSeries expansion

2008-01-15 Thread Martin Albrecht

 It might be a lot easier to help if you gave the rational function. 
 Depending on how complicated the denominator is, you basically just have to
 compute the Taylor series of the rational function, by differentiation and
 evaluation (using Taylor's formula), i.e., kind of like this is doing, but
 over GF(p):

 sage: f = (x^3 + x +1)/((x^4 + x^2 + 2)*x^3*(x^3-5))
 sage: f.taylor(x, 0, 4)
 -1/(10*x^3) - 1/(10*x^2) + 1/(20*x) - 7/100 + x/200 + 17*x^2/200 -
 103*x^3/2000 - 23*x^4/2000

Hi,

sorry for not being specific enough earlier. In my particular application 

f(t) = p(t)/(1-t)^n 

where p is a polynomial with integer coefficients. So I am not actually 
working over GF(p) and in that case the Taylor expansion seems to give me 
what I want. However as I am looking into this now, I try to come up with 
something more general. I am wondering what Magma is doing (maybe just Taylor 
as well?) and if we want this too, e.g. that

  sage: L.t = LaurentSeriesRing(IntegerRing())
  sage: L(f) 

returns the expansion? Would that make sense? Is it feasible?

Martin
-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x8EF0DC99
_www: http://www.informatik.uni-bremen.de/~malb
_jab: [EMAIL PROTECTED]


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: LaurentSeries expansion

2008-01-15 Thread William Stein

On Jan 15, 2008 10:44 AM, Martin Albrecht [EMAIL PROTECTED] wrote:

  It might be a lot easier to help if you gave the rational function.
  Depending on how complicated the denominator is, you basically just have to
  compute the Taylor series of the rational function, by differentiation and
  evaluation (using Taylor's formula), i.e., kind of like this is doing, but
  over GF(p):
 
  sage: f = (x^3 + x +1)/((x^4 + x^2 + 2)*x^3*(x^3-5))
  sage: f.taylor(x, 0, 4)
  -1/(10*x^3) - 1/(10*x^2) + 1/(20*x) - 7/100 + x/200 + 17*x^2/200 -
  103*x^3/2000 - 23*x^4/2000

 Hi,

 sorry for not being specific enough earlier. In my particular application

 f(t) = p(t)/(1-t)^n

 where p is a polynomial with integer coefficients. So I am not actually
 working over GF(p) and in that case the Taylor expansion seems to give me
 what I want. However as I am looking into this now, I try to come up with
 something more general. I am wondering what Magma is doing (maybe just Taylor
 as well?) and if we want this too, e.g. that

   sage: L.t = LaurentSeriesRing(IntegerRing())
   sage: L(f)

 returns the expansion? Would that make sense? Is it feasible?

Yes that makes sense and would be a great idea to do.

In your particular case above, you should write

p(t)/(1-t)^n  = p(t) * (1/(1-t))^n

then expand 1/(1-t) out as a geometric series, raise it to the
power of n, and multiply it by p(t).  You actually will get
a power series rather than a Laurent series, (1-t) has no pole
at 0.

William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: python question

2008-01-15 Thread William Stein

On Jan 15, 2008 10:12 AM, John Cremona [EMAIL PROTECTED] wrote:

 Kevin,

 I have been taking the same plunge (and prbably for the same reason).
 It's not clear whether knowing C++ well was a help or a hindrance.  I
 have just read the book Learning Python by Lutz, published by
 O'Reilly, and found it pretty good.  At least, I knew immediately why
 your progam did what it did and how to avoid it as there's an almost
 identical example in the book!

 Now after Learning Python at 700pp I can move on to Programming
 Python -- same author and publisher but 1500 pages.  Or maybe not

My favorite Python books are:

* Python in a Nutshell

and

   * Dive into Python: http://www.diveintopython.org/  (free!)

I learned more from Python in a Nutshell than anywhere else.

William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: python question

2008-01-15 Thread William Stein

On Jan 15, 2008 11:35 AM, John Cremona [EMAIL PROTECTED] wrote:

 Thanks for the hints.  I did look at Dive into... a while back (it
 is recommended on the Sage website after all) but for some reason did
 not get on with it (the very frist complete, working Python program
 just left me cold), so I got the basics from the online Puthon
 tutorial (which I do recommend) and then found those books on the
 shelf at the place where I work


Indeed.  I very very strongly recommend the free online Python tutorial:
http://docs.python.org/tut/
This was the first thing I just read cover-to-cover when learning Python.

William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Problems with standalone python/sage scripts

2008-01-15 Thread Robert Miller

Georg,

1. Is this a clean, from-source build of sage-2.9.3?

2. What is the output of /usr/bin/env for you? Mine (Intel OS X
10.5.1) doesn't mention sage at all, although mysteriously things are
working for me.

 #!/usr/bin/env sage -python
 import sys

For me, I get
$ ./BMV.sage
$

Also, if I add print 2+2, it works too:
$ ./BMV.sage
4

However, when I run the sage itself, it looks like it's pointing at
some weird version:
$ /usr/bin/env sage
--
| SAGE Version 2.9.2, Release Date: 2008-01-05   |
| Type notebook() for the GUI, and license() for information.|
--
Loading SAGE library. Current Mercurial branch is: demo

This isn't what I was expecting at all (I just recently started using
this particular laptop). After some digging, I discover that my /usr/
local/bin contains a script called sage, which seems to be pretty
much a copy of the main script sage, in the root directory of a
typical sage install, but the SAGE_ROOT is explicitly set to another
version of sage.

So here's what I did:

$ export PATH=/Users/rlmill/sage:$PATH
(this explicitly points to the version I want)
$ ./test
SAGE Version 2.9.3, Release Date: 2008-01-05
(hooray - this is what I was hoping for)


The contents of test are: (minus triple quotes)

#!/usr/bin/env sage -python
import sage
import sage.misc
import sage.misc.banner
from sage.misc.banner import version
print version()


Hopefully this helps, although I have a feeling this thread isn't
over...

-- Robert M
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Problems with standalone python/sage scripts

2008-01-15 Thread Georg Grafendorfer
Hi Robert,

1. Is this a clean, from-source build of sage-2.9.3?


Yes, i tried it out on two different systems now, Athlon XP, and Core Duo,
both running on Debian Etch, and both show the same behaviour

2. What is the output of /usr/bin/env for you? Mine (Intel OS X
 10.5.1) doesn't mention sage at all, although mysteriously things are
 working for me.


the  SAGE_ROOT directory is included in my path, i even defined a global
variable with this name, i.e.  SAGE_ROOT.


 #!/usr/bin/env sage -python
  import sys

 For me, I get
 $ ./BMV.sage
 $


you response encouraged me to try out some more things, and if i change the
first line to
#!/usr/bin/env sage-python
instead of
#!/usr/bin/env sage -python
(note that there is no space anymore) things work as excepted (at least
import sys and print Hello World), seems like my /usr/bin/env does not
like the space between (#!/usr/bin/env sage -python does not work either)

but however, using

#!/path/to/sage_root/sage-python
import sys

still does not work and shows the same strange mouse behaviour as
described in my original posting, on both systems!!
no idea why the second one does not work on my systems!!


However, when I run the sage itself, it looks like it's pointing at
 some weird version:
 $ /usr/bin/env sage
 --
 | SAGE Version 2.9.2, Release Date: 2008-01-05   |
 | Type notebook() for the GUI, and license() for information.|
 --
 Loading SAGE library. Current Mercurial branch is: demo


$/usr/bin/env sage

brings me to the sage prompt as expected

Hopefully this helps, although I have a feeling this thread isn't
 over...


Anyway, at least i found a partial solution to carry on with, but it seems
as there are still some things to clarify, especially the mouse thing
concerning the import sys

Thank you very much,
Georg

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Problems with standalone python/sage scripts

2008-01-15 Thread William Stein

On Jan 15, 2008 3:00 PM, Georg Grafendorfer
[EMAIL PROTECTED] wrote:
 Hi Robert,


  1. Is this a clean, from-source build of sage-2.9.3?

 Yes, i tried it out on two different systems now, Athlon XP, and Core Duo,
 both running on Debian Etch, and both show the same behaviour


  2. What is the output of /usr/bin/env for you? Mine (Intel OS X
  10.5.1) doesn't mention sage at all, although mysteriously things are
  working for me.

 the  SAGE_ROOT directory is included in my path, i even defined a global
 variable with this name, i.e.  SAGE_ROOT.


   #!/usr/bin/env sage -python
   import sys
 
  For me, I get
  $ ./BMV.sage
  $

 you response encouraged me to try out some more things, and if i change the
 first line to

 #!/usr/bin/env sage-python
 instead of

 #!/usr/bin/env sage -python
  (note that there is no space anymore) things work as excepted (at least
 import sys and print Hello World), seems like my /usr/bin/env does not
 like the space between (#!/usr/bin/env sage -python does not work either)

 but however, using

 #!/path/to/sage_root/sage-python
 import sys

 still does not work and shows the same strange mouse behaviour as
 described in my original posting, on both systems!!
  no idea why the second one does not work on my systems!!


  However, when I run the sage itself, it looks like it's pointing at
  some weird version:
  $ /usr/bin/env sage
  --
  | SAGE Version 2.9.2, Release Date: 2008-01-05   |
  | Type notebook() for the GUI, and license() for information.|
  --
  Loading SAGE library. Current Mercurial branch is: demo

 $/usr/bin/env sage

 brings me to the sage prompt as expected

  Hopefully this helps, although I have a feeling this thread isn't
  over...

 Anyway, at least i found a partial solution to carry on with, but it seems
 as there are still some things to clarify, especially the mouse thing
 concerning the import sys

 Thank you very much,
  Georg

I consider all this a bug, and it's definitely a problem on numerous _linux_
systems.  This problem doesn't happen at all on OSX.  I've made it
   http://trac.sagemath.org/sage_trac/ticket/1789

William

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Problems with standalone python/sage scripts

2008-01-15 Thread mabshoff



On Jan 16, 12:40 am, William Stein [EMAIL PROTECTED] wrote:
 On Jan 15, 2008 3:00 PM, Georg Grafendorfer



 [EMAIL PROTECTED] wrote:
  Hi Robert,

   1. Is this a clean, from-source build of sage-2.9.3?

  Yes, i tried it out on two different systems now, Athlon XP, and Core Duo,
  both running on Debian Etch, and both show the same behaviour

   2. What is the output of /usr/bin/env for you? Mine (Intel OS X
   10.5.1) doesn't mention sage at all, although mysteriously things are
   working for me.

  the  SAGE_ROOT directory is included in my path, i even defined a global
  variable with this name, i.e.  SAGE_ROOT.

#!/usr/bin/env sage -python
import sys

   For me, I get
   $ ./BMV.sage
   $

  you response encouraged me to try out some more things, and if i change the
  first line to

  #!/usr/bin/env sage-python
  instead of

  #!/usr/bin/env sage -python
   (note that there is no space anymore) things work as excepted (at least
  import sys and print Hello World), seems like my /usr/bin/env does not
  like the space between (#!/usr/bin/env sage -python does not work either)

  but however, using

  #!/path/to/sage_root/sage-python
  import sys

  still does not work and shows the same strange mouse behaviour as
  described in my original posting, on both systems!!
   no idea why the second one does not work on my systems!!

   However, when I run the sage itself, it looks like it's pointing at
   some weird version:
   $ /usr/bin/env sage
   --
   | SAGE Version 2.9.2, Release Date: 2008-01-05   |
   | Type notebook() for the GUI, and license() for information.|
   --
   Loading SAGE library. Current Mercurial branch is: demo

  $/usr/bin/env sage

  brings me to the sage prompt as expected

   Hopefully this helps, although I have a feeling this thread isn't
   over...

  Anyway, at least i found a partial solution to carry on with, but it seems
  as there are still some things to clarify, especially the mouse thing
  concerning the import sys

  Thank you very much,
   Georg

 I consider all this a bug, and it's definitely a problem on numerous _linux_
 systems.  This problem doesn't happen at all on OSX.  I've made it
http://trac.sagemath.org/sage_trac/ticket/1789

I thought I have seen this before and the issue was a buggy env, i.e.

#!/usr/bin/env sage -python

while

#!/usr/bin/env sage

should work. There was a thread about this in one of the sage-* Google
groups. It boiled down to that env should work fine with multi
arguments while some buggy env can't handle it. Maybe we can add some
script that does the equivalent of sage -python, maybe local/bin/
sage-python does that job, but I assume the env isn't set up
properly. In that case we should change the documentation since it has
been popping up over and over these days.

 William

Cheers,

Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] problem with plot3d on ubuntu 64bit

2008-01-15 Thread David Joyner

Hi:

I have an old 64 bit machine with 64bit ubuntu fiesty fawn loaded on it.
I just noticed a problem with plot3d on it (plot3d runs fine on my
intel macbook):

In sage 2.9.3:
sage: x = var(x)
sage: y = var(y)
sage: p = plot3d(x^2-y^2,(-1,1),(-1,1))
---
type 'exceptions.NameError' Traceback (most recent call last)

/mnt/drive_hda1/sagefiles/sage-2.9.alpha5/ipython console in module()

type 'exceptions.NameError': name 'plot3d' is not defined

In sage 2.10.alpha1:

sage: x = var(x)
sage: y = var(y)
sage: plot3d(x^2-y^2,(-1,1),(-1,1)).show()   ## long time but nothing happens
sage: p = plot3d(x^2-y^2,(-1,1),(-1,1))
sage: p  ## long time but nothing happens

sage: type(p)
type 'sage.plot.plot3d.parametric_surface.ParametricSurface'
sage: show(p)##  nothing happens
sage:

I'll try running sage -testall on both of these to see if something pops up.

- David Joyner

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---