[sage-support] Re: Problems with 3d plotting

2010-01-18 Thread Michael Madison
I needed to install icetea from a terminal window run:

sudo apt-get install icedtea6-plugin

On Jan 18, 7:23 pm, William Cauchois  wrote:
> I'm running Ubuntu 9.10. I installed the package "sun-java6-plugin"
> and it works for me.
>
> On Jan 18, 8:35 am, Jack Fearnley  wrote:
>
>
>
> > I have just compiled sage-4.3 running under ubuntu 9.04 on an IBM
> > pentium machine. The sage directory is in its own partition under /tools.
>
> > I have no real need for 3d plotting but I was running through the sage
> > tutorial and thought I would check it out.
>
> > The plot3d command works silently producing no visible output and no
> > error messages.
>
> > I found that my system lacked java so I downloaded the standard ubuntu
> > version using synaptic. This had no effect on plotting.
>
> > Any thoughts?
>
> > Best wishes,
> >                     Jack Fearnley- Hide quoted text -
>
> - Show quoted text -
-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Problems with 3d plotting

2010-01-18 Thread William Cauchois
I'm running Ubuntu 9.10. I installed the package "sun-java6-plugin"
and it works for me.

On Jan 18, 8:35 am, Jack Fearnley  wrote:
> I have just compiled sage-4.3 running under ubuntu 9.04 on an IBM
> pentium machine. The sage directory is in its own partition under /tools.
>
> I have no real need for 3d plotting but I was running through the sage
> tutorial and thought I would check it out.
>
> The plot3d command works silently producing no visible output and no
> error messages.
>
> I found that my system lacked java so I downloaded the standard ubuntu
> version using synaptic. This had no effect on plotting.
>
> Any thoughts?
>
> Best wishes,
>                     Jack Fearnley
-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] SAGE install problem

2010-01-18 Thread William Stein
On Mon, Jan 18, 2010 at 2:04 PM, Valter Sorana  wrote:
> I have tried to install SAGE from both binary and source and I failed - with
> the problem ultimately being a complaint that " sage-ipython "$@" -i " is an
> illegal instruction.
>
> I describe the details below and attach the install.log file (in a
> compressed archive form).
>
> Any help is appreciated.
>
> Thanks,
> Valter.
>
> 1) I downloaded the SAGE binary for my Ubuntu distribution (9.10 Karmic)
> running on a five-year old Dell Dimension 8300;
>
> 2) I extracted the archive and copied to a new directory /usr/bin/sagemath;
>
> 3) I tried to run sage, but it would not start because
>
> "The following processor
> flags were on the build machine but are not on this computer:
>
> pni"
>
> 4) following some search, I found someone else had already had this problem
> and William Stein in response had suggested to try ./sage -f mpir-1.2.p4; I
> did that, but it did not work either, probably because the mpir package had
> changed name; so I tried ./sage -f mpir-1.2.2 and that stopped with the
> error msg
>
> "checking for suitable m4... configure: error: No usable m4 in $PATH or
> /usr/5bin (see config.log for reasons).
> Failed to configure."
>
> 5) following someone else's suggestion in the same thread of sage-devel
> group, I tried "sage -b main" and "sage -ba" which ran smoothly, but did not
> seem to change anything.
>
> 5) I decided to try my luck, delete the sage-flags.txt file anyway and try
> the sage command again; this is what I got:
>
> "r...@valter-desktop:/usr/bin/sagemath/sage-4.3-linux-Ubuntu_9.10-i686-Linux#
> sage
> --
> | Sage Version 4.3, Release Date: 2009-12-24 |
> | Type notebook() for the GUI, and license() for information.    |
> --
> /usr/bin/sagemath/sage-4.3-linux-Ubuntu_9.10-i686-Linux/local/bin/sage-sage:
> line 206: 15352 Illegal instruction sage-ipython "$@" -i
> "
>
> 6) I restarted from scratch, downloaded the source code and built it
> following the instructions to the letter (including installing m4 and the
> other prerequisite packages) and I still get the same complaint about the
> illegality of "sage-ipython "$@" -i"

I don't believe that.  It should be completely impossible to
completely install Sage from source and get that error.

(1) *Precisely* what file did you download when you write "source code"?
(2) What did you type to build from source?
(3) How long did building from source take?
(4) Exactly what did you type to run Sage after building from source?
   Can you send an exact log

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


Re: [sage-support] SAGE install problem

2010-01-18 Thread William Stein
On Mon, Jan 18, 2010 at 2:04 PM, Valter Sorana  wrote:
> I have tried to install SAGE from both binary and source and I failed - with
> the problem ultimately being a complaint that " sage-ipython "$@" -i " is an
> illegal instruction.
>
> I describe the details below and attach the install.log file (in a
> compressed archive form).
>
> Any help is appreciated.
>
> Thanks,
> Valter.
>
> 1) I downloaded the SAGE binary for my Ubuntu distribution (9.10 Karmic)
> running on a five-year old Dell Dimension 8300;
>
> 2) I extracted the archive and copied to a new directory /usr/bin/sagemath;
>
> 3) I tried to run sage, but it would not start because
>
> "The following processor
> flags were on the build machine but are not on this computer:
>
> pni"
>
> 4) following some search, I found someone else had already had this problem
> and William Stein in response had suggested to try ./sage -f mpir-1.2.p4; I
> did that, but it did not work either, probably because the mpir package had
> changed name; so I tried ./sage -f mpir-1.2.2 and that stopped with the
> error msg
>
> "checking for suitable m4... configure: error: No usable m4 in $PATH or
> /usr/5bin (see config.log for reasons).
> Failed to configure."
>
> 5) following someone else's suggestion in the same thread of sage-devel
> group, I tried "sage -b main" and "sage -ba" which ran smoothly, but did not
> seem to change anything.
>
> 5) I decided to try my luck, delete the sage-flags.txt file anyway and try
> the sage command again; this is what I got:
>
> "r...@valter-desktop:/usr/bin/sagemath/sage-4.3-linux-Ubuntu_9.10-i686-Linux#
> sage
> --
> | Sage Version 4.3, Release Date: 2009-12-24 |
> | Type notebook() for the GUI, and license() for information.    |
> --
> /usr/bin/sagemath/sage-4.3-linux-Ubuntu_9.10-i686-Linux/local/bin/sage-sage:
> line 206: 15352 Illegal instruction sage-ipython "$@" -i
> "
>
> 6) I restarted from scratch, downloaded the source code and built it
> following the instructions to the letter (including installing m4 and the
> other prerequisite packages) and I still get the same complaint about the
> illegality of "sage-ipython "$@" -i"

I don't believe that.  It should be completely impossible to
completely install Sage from source and get that error.

(1) *Precisely* what file did you download when you write "source code"?
(2) What did you type to build from source?
(3) How long did building from source take?
(4) Exactly what did you type to run Sage after building from source?
   Can you send an exact log of you doing this?

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


[sage-support] Problems with 3d plotting

2010-01-18 Thread Jack Fearnley
I have just compiled sage-4.3 running under ubuntu 9.04 on an IBM 
pentium machine. The sage directory is in its own partition under /tools.


I have no real need for 3d plotting but I was running through the sage 
tutorial and thought I would check it out.


The plot3d command works silently producing no visible output and no 
error messages.


I found that my system lacked java so I downloaded the standard ubuntu 
version using synaptic. This had no effect on plotting.


Any thoughts?

Best wishes,
   Jack Fearnley

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


[sage-support] Re: Plotting functions without scaling the y-axis?

2010-01-18 Thread Jason Grout

Jason Grout wrote:

William Stein wrote:
On Mon, Jan 18, 2010 at 12:14 AM, Simon King  
wrote:

Hi!

On Jan 17, 10:57 pm, William Stein  wrote:
[...]
Is there a way to *fix* the y-axis to the range [-2, 3.5] in the 
above example?

Do this:

It's pretty annoying that the input you give above doesn't work.

Do what?


He asked to fix the y-axis.  The input he gave *should* have fixed the
y-axis, but it doesn't.   This is a bug.



This is now:

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


I posted a patch which fixes this problem and the more general issue of 
show options not being passed through to .save() commands.


The patch just needs to be reviewed now.

Thanks,

Jason

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


[sage-support] Fwd: [Sage Bug Report]

2010-01-18 Thread William Stein
Hi Jonas,

I'm forwarding your email to sage-support.


-- Forwarded message --
From: Jonas Hägglund 
Date: 2010/1/18
Subject: [Sage Bug Report]
To: wst...@gmail.com


Dear Professor Stein,
I found the following bug in graphs/graph.py:
g = Graph('Shc?GC@@g...@?@?...@k?op@?aa?a...@?')
g.girth() for this returns 6, but the girth of the graph is 5.
The problem can be found here:
    def girth(self):
        """
        ...
        """
        n = self.num_verts()
        best = n+1
        for i in self.vertex_iterator():
            span = set([i])
            depth = 1
            thisList = set([i])
            while 2*depth <= best and 3 < best:
                nextList = set()
                for v in thisList:
                    for u in self.neighbors(v):
                        if not u in span:
                            span.add(u)
                            nextList.add(u)
                        else:
                            if u in thisList:
                                best = depth*2-1
                                break
                            if u in nextList:
                                best = depth*2  ### OBS this can
overwrite the best value ###
                thisList = nextList
                depth += 1
        if best == n+1:
            from sage.rings.infinity import Infinity
            return Infinity
        return best
My recommendation is that 'if u in nextList:' is changed to 'if u in
nextList and best > 2*depth:' which should fix the problem.

Thanks for a great software project,
Jonas Hägglund. PhD-student in Mathematics, Umeå University, Sweden


-- 
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 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Plotting functions without scaling the y-axis?

2010-01-18 Thread Jason Grout

William Stein wrote:

On Mon, Jan 18, 2010 at 12:14 AM, Simon King  wrote:

Hi!

On Jan 17, 10:57 pm, William Stein  wrote:
[...]

Is there a way to *fix* the y-axis to the range [-2, 3.5] in the above example?

Do this:

It's pretty annoying that the input you give above doesn't work.

Do what?


He asked to fix the y-axis.  The input he gave *should* have fixed the
y-axis, but it doesn't.   This is a bug.



This is now:

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

Thanks,

Jason

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


[sage-support] Re: Plotting functions without scaling the y-axis?

2010-01-18 Thread Marshall Hampton
This appears to be a workaround (giving animate the ymin, ymax instead
of plot):

var('t')
damped_oscillator = 41/311*sqrt(311)*e^(-3/8*t)*sin(1/8*sqrt(311)*t) +
3*e^(-3/8*t)*cos(1/8*sqrt(311)*t)
ps = [plot(lambda x: damped_oscillator( t = x + k ), -1/2, 3*pi,
ymin=-2, ymax=3.5) for k in srange( 0, pi, 0.3)]
animate(ps,ymin=-2, ymax=3.5, xmin = -.5, xmax = 3*pi).show()

-Marshall Hampton

On Jan 18, 2:34 am, William Stein  wrote:
> On Mon, Jan 18, 2010 at 12:14 AM, Simon King  wrote:
> > Hi!
>
> > On Jan 17, 10:57 pm, William Stein  wrote:
> > [...]
> >> > Is there a way to *fix* the y-axis to the range [-2, 3.5] in the above 
> >> > example?
>
> >> Do this:
>
> >> It's pretty annoying that the input you give above doesn't work.
>
> > Do what?
>
> He asked to fix the y-axis.  The input he gave *should* have fixed the
> y-axis, but it doesn't.   This is a bug.
>
> William
-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: bug in Sage calculation of variety?

2010-01-18 Thread Jeff Stroomer
Simon, et al.,

The script is working for you but not for me.  The answer you get for
the variety is

{y: 5, z: 7, u: 5, x: 1}
{y: 7, z: 8, u: 6, x: 3}
{y: 8, z: 1, u: 5, x: 3}
{y: 2, z: 5, u: 4, x: 4}

This is correct, which is why you see zeros.  But when I run the
script, the answer I get for the variety is

{y: 5, z: 7, u: 5, x: 1}
{y: 7, z: 8, u: 6, x: 3}
{y: 8, z: 1, u: 5, x: 3}
{y: 2, z: 5, u: 4, x: 4}
{y: 13, z: -72, u: -7, x: 4} # Bad
{y: 10, z: -28, u: 0, x: 1}  # Bad

Here's a bad output line that I see when I run the script:

z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91({y: 13, z: -72, u: -7, x:
4}): 5852

I ran my script using the following console command line:

j...@stroomer-imac-2 ~/grobner_experiments
$ sage bugcase.sage

Here's my sage version:

$ sage --version
Sage Version 4.1.1, Release Date: 2009-08-14

I am running on an iMac, OS X 10.6.2, 2.16 Intel Core 2 Duo.

Jeff

On Jan 18, 1:47 am, William Stein  wrote:
> On Mon, Jan 18, 2010 at 12:32 AM, Minh Nguyen  wrote:
> > Hi Jeff,
>
> > On Mon, Jan 18, 2010 at 3:27 PM, Jeff Stroomer  
> > wrote:
>
> > 
>
> >> #! /usr/bin/env sage
>
> > This line caught my attention. Is your code meant to be put in a
> > separate Python script (with extension ".py") or in a Sage script
> > (with extension ".sage")? For example, I created a Python script with
> > your code and gave it execute permission:
>
> > [mv...@mod mvngu]$ ls -g variety.py
> > -rwxr-xr-x 1 mvngu 579 2010-01-18 00:20 variety.py
> > [mv...@mod mvngu]$ cat variety.py
> > #! /usr/bin/env sage
>
> > import sys, os
> > from sage.all import *
>
> > R = PolynomialRing(QQ, 4, names = 'u,z,y,x', order = 'lex')
> > u,z,y,x = R.gens()
>
> > G = [
> >  x^2 + 6/91*z + 6/13*y - 409/91*x + 66/91,
> >  y*x - 6/91*z - 45/13*y - 410/91*x + 1572/91,
> >  y^2 + 66/91*z - 129/13*y - 222/91*x + 2000/91,
> >  z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91,
> >  z*y - 53/7*z - 5*y - 12/7*x + 313/7,
> >  z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91,
> >  u - 17/91*z - 4/13*y - 9/91*x - 187/91,
> > ]
>
> > I = ideal(G)
> > V = I.variety()
>
> > for v in V:
> >    print v
> >    for g in G:
> >        print '  %s(%s): %s' % (g, v, g.subs(v))
>
> > Running it as a Python script doesn't work:
>
> > [mv...@mod mvngu]$ sage -python variety.py
> > Traceback (most recent call last):
> >  File "variety.py", line 10, in 
> >    x^2 + 6/91*z + 6/13*y - 409/91*x + 66/91,
> >  File "element.pyx", line 532, in
> > sage.structure.element.Element.__xor__ (sage/structure/element.c:4528)
> > RuntimeError: Use ** for exponentiation, not '^', which means xor
> > in Python, and has the wrong precedence.
> > [mv...@mod mvngu]$ sage variety.py
> > Traceback (most recent call last):
> >  File "variety.py", line 10, in 
> >    x^2 + 6/91*z + 6/13*y - 409/91*x + 66/91,
> >  File "element.pyx", line 532, in
> > sage.structure.element.Element.__xor__ (sage/structure/element.c:4528)
> > RuntimeError: Use ** for exponentiation, not '^', which means xor
> > in Python, and has the wrong precedence.
>
> > Now I renamed "variety.py" to "variety.sage" (with same code, but
> > different file extension). Running "variety.sage" as a Sage script
> > works fine with Sage 4.3:
>
> > [mv...@mod mvngu]$ cat variety.sage
> > #! /usr/bin/env sage
>
> > import sys, os
> > from sage.all import *
>
> > R = PolynomialRing(QQ, 4, names = 'u,z,y,x', order = 'lex')
> > u,z,y,x = R.gens()
>
> > G = [
> >  x^2 + 6/91*z + 6/13*y - 409/91*x + 66/91,
> >  y*x - 6/91*z - 45/13*y - 410/91*x + 1572/91,
> >  y^2 + 66/91*z - 129/13*y - 222/91*x + 2000/91,
> >  z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91,
> >  z*y - 53/7*z - 5*y - 12/7*x + 313/7,
> >  z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91,
> >  u - 17/91*z - 4/13*y - 9/91*x - 187/91,
> > ]
>
> > I = ideal(G)
> > V = I.variety()
>
> > for v in V:
> >    print v
> >    for g in G:
> >        print '  %s(%s): %s' % (g, v, g.subs(v))
>
> > [mv...@mod mvngu]$ sage variety.sage
>
> The whole point of putting
>
> #! /usr/bin/env sage
>
> at the top of the file is so that one can type
>
>  [mv...@mod mvngu]$ ./variety.sage
>
> after say doing
>
>  [mv...@mod mvngu]$ chmod +x variety.sage
>
> William
>
>
>
> > {y: 5, z: 7, u: 5, x: 1}
> >  6/91*z + 6/13*y + x^2 - 409/91*x + 66/91({y: 5, z: 7, u: 5, x: 1}): 0
> >  -6/91*z + y*x - 45/13*y - 410/91*x + 1572/91({y: 5, z: 7, u: 5, x: 1}): 0
> >  66/91*z + y^2 - 129/13*y - 222/91*x + 2000/91({y: 5, z: 7, u: 5, x: 1}): 0
> >  z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91({y: 5, z: 7, u: 5, x: 1}): 0
> >  z*y - 53/7*z - 5*y - 12/7*x + 313/7({y: 5, z: 7, u: 5, x: 1}): 0
> >  z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91({y: 5, z: 7, u: 5, x: 1}): 0
> >  u - 17/91*z - 4/13*y - 9/91*x - 187/91({y: 5, z: 7, u: 5, x: 1}): 0
> > {y: 7, z: 8, u: 6, x: 3}
> >  6/91*z + 6/13*y + x^2 - 409/91*x + 66/91({y: 7, z: 8, u: 6, x: 3}): 0
> >  -6/91*z + y*x - 45/13*y - 410/91*x + 1572/91({y: 7, z: 8, u: 6, x: 3}): 0
> >  66/91*z + y^2 - 129/13*y - 222/91*x + 2000/91({y: 7, z: 8, u: 6, x: 3}): 0
> >  

Re: [sage-support] bug in Sage calculation of variety?

2010-01-18 Thread William Stein
On Mon, Jan 18, 2010 at 12:32 AM, Minh Nguyen  wrote:
> Hi Jeff,
>
> On Mon, Jan 18, 2010 at 3:27 PM, Jeff Stroomer  wrote:
>
> 
>
>> #! /usr/bin/env sage
>
> This line caught my attention. Is your code meant to be put in a
> separate Python script (with extension ".py") or in a Sage script
> (with extension ".sage")? For example, I created a Python script with
> your code and gave it execute permission:
>
> [mv...@mod mvngu]$ ls -g variety.py
> -rwxr-xr-x 1 mvngu 579 2010-01-18 00:20 variety.py
> [mv...@mod mvngu]$ cat variety.py
> #! /usr/bin/env sage
>
> import sys, os
> from sage.all import *
>
> R = PolynomialRing(QQ, 4, names = 'u,z,y,x', order = 'lex')
> u,z,y,x = R.gens()
>
> G = [
>  x^2 + 6/91*z + 6/13*y - 409/91*x + 66/91,
>  y*x - 6/91*z - 45/13*y - 410/91*x + 1572/91,
>  y^2 + 66/91*z - 129/13*y - 222/91*x + 2000/91,
>  z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91,
>  z*y - 53/7*z - 5*y - 12/7*x + 313/7,
>  z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91,
>  u - 17/91*z - 4/13*y - 9/91*x - 187/91,
> ]
>
> I = ideal(G)
> V = I.variety()
>
> for v in V:
>    print v
>    for g in G:
>        print '  %s(%s): %s' % (g, v, g.subs(v))
>
>
> Running it as a Python script doesn't work:
>
> [mv...@mod mvngu]$ sage -python variety.py
> Traceback (most recent call last):
>  File "variety.py", line 10, in 
>    x^2 + 6/91*z + 6/13*y - 409/91*x + 66/91,
>  File "element.pyx", line 532, in
> sage.structure.element.Element.__xor__ (sage/structure/element.c:4528)
> RuntimeError: Use ** for exponentiation, not '^', which means xor
> in Python, and has the wrong precedence.
> [mv...@mod mvngu]$ sage variety.py
> Traceback (most recent call last):
>  File "variety.py", line 10, in 
>    x^2 + 6/91*z + 6/13*y - 409/91*x + 66/91,
>  File "element.pyx", line 532, in
> sage.structure.element.Element.__xor__ (sage/structure/element.c:4528)
> RuntimeError: Use ** for exponentiation, not '^', which means xor
> in Python, and has the wrong precedence.
>
>
> Now I renamed "variety.py" to "variety.sage" (with same code, but
> different file extension). Running "variety.sage" as a Sage script
> works fine with Sage 4.3:
>
> [mv...@mod mvngu]$ cat variety.sage
> #! /usr/bin/env sage
>
> import sys, os
> from sage.all import *
>
> R = PolynomialRing(QQ, 4, names = 'u,z,y,x', order = 'lex')
> u,z,y,x = R.gens()
>
> G = [
>  x^2 + 6/91*z + 6/13*y - 409/91*x + 66/91,
>  y*x - 6/91*z - 45/13*y - 410/91*x + 1572/91,
>  y^2 + 66/91*z - 129/13*y - 222/91*x + 2000/91,
>  z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91,
>  z*y - 53/7*z - 5*y - 12/7*x + 313/7,
>  z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91,
>  u - 17/91*z - 4/13*y - 9/91*x - 187/91,
> ]
>
> I = ideal(G)
> V = I.variety()
>
> for v in V:
>    print v
>    for g in G:
>        print '  %s(%s): %s' % (g, v, g.subs(v))
>
> [mv...@mod mvngu]$ sage variety.sage

The whole point of putting

#! /usr/bin/env sage

at the top of the file is so that one can type

 [mv...@mod mvngu]$ ./variety.sage

after say doing

 [mv...@mod mvngu]$ chmod +x variety.sage

William





> {y: 5, z: 7, u: 5, x: 1}
>  6/91*z + 6/13*y + x^2 - 409/91*x + 66/91({y: 5, z: 7, u: 5, x: 1}): 0
>  -6/91*z + y*x - 45/13*y - 410/91*x + 1572/91({y: 5, z: 7, u: 5, x: 1}): 0
>  66/91*z + y^2 - 129/13*y - 222/91*x + 2000/91({y: 5, z: 7, u: 5, x: 1}): 0
>  z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91({y: 5, z: 7, u: 5, x: 1}): 0
>  z*y - 53/7*z - 5*y - 12/7*x + 313/7({y: 5, z: 7, u: 5, x: 1}): 0
>  z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91({y: 5, z: 7, u: 5, x: 1}): 0
>  u - 17/91*z - 4/13*y - 9/91*x - 187/91({y: 5, z: 7, u: 5, x: 1}): 0
> {y: 7, z: 8, u: 6, x: 3}
>  6/91*z + 6/13*y + x^2 - 409/91*x + 66/91({y: 7, z: 8, u: 6, x: 3}): 0
>  -6/91*z + y*x - 45/13*y - 410/91*x + 1572/91({y: 7, z: 8, u: 6, x: 3}): 0
>  66/91*z + y^2 - 129/13*y - 222/91*x + 2000/91({y: 7, z: 8, u: 6, x: 3}): 0
>  z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91({y: 7, z: 8, u: 6, x: 3}): 0
>  z*y - 53/7*z - 5*y - 12/7*x + 313/7({y: 7, z: 8, u: 6, x: 3}): 0
>  z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91({y: 7, z: 8, u: 6, x: 3}): 0
>  u - 17/91*z - 4/13*y - 9/91*x - 187/91({y: 7, z: 8, u: 6, x: 3}): 0
> {y: 8, z: 1, u: 5, x: 3}
>  6/91*z + 6/13*y + x^2 - 409/91*x + 66/91({y: 8, z: 1, u: 5, x: 3}): 0
>  -6/91*z + y*x - 45/13*y - 410/91*x + 1572/91({y: 8, z: 1, u: 5, x: 3}): 0
>  66/91*z + y^2 - 129/13*y - 222/91*x + 2000/91({y: 8, z: 1, u: 5, x: 3}): 0
>  z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91({y: 8, z: 1, u: 5, x: 3}): 0
>  z*y - 53/7*z - 5*y - 12/7*x + 313/7({y: 8, z: 1, u: 5, x: 3}): 0
>  z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91({y: 8, z: 1, u: 5, x: 3}): 0
>  u - 17/91*z - 4/13*y - 9/91*x - 187/91({y: 8, z: 1, u: 5, x: 3}): 0
> {y: 2, z: 5, u: 4, x: 4}
>  6/91*z + 6/13*y + x^2 - 409/91*x + 66/91({y: 2, z: 5, u: 4, x: 4}): 0
>  -6/91*z + y*x - 45/13*y - 410/91*x + 1572/91({y: 2, z: 5, u: 4, x: 4}): 0
>  66/91*z + y^2 - 129/13*y - 222/91*x + 2000/91({y: 2, z: 5, u: 4, x: 4}): 0
>  z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91({y:

Re: [sage-support] Re: Plotting functions without scaling the y-axis?

2010-01-18 Thread William Stein
On Mon, Jan 18, 2010 at 12:14 AM, Simon King  wrote:
> Hi!
>
> On Jan 17, 10:57 pm, William Stein  wrote:
> [...]
>> > Is there a way to *fix* the y-axis to the range [-2, 3.5] in the above 
>> > example?
>>
>> Do this:
>>
>> It's pretty annoying that the input you give above doesn't work.
>
> Do what?

He asked to fix the y-axis.  The input he gave *should* have fixed the
y-axis, but it doesn't.   This is a bug.

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


Re: [sage-support] bug in Sage calculation of variety?

2010-01-18 Thread Minh Nguyen
Hi Jeff,

On Mon, Jan 18, 2010 at 3:27 PM, Jeff Stroomer  wrote:



> #! /usr/bin/env sage

This line caught my attention. Is your code meant to be put in a
separate Python script (with extension ".py") or in a Sage script
(with extension ".sage")? For example, I created a Python script with
your code and gave it execute permission:

[mv...@mod mvngu]$ ls -g variety.py
-rwxr-xr-x 1 mvngu 579 2010-01-18 00:20 variety.py
[mv...@mod mvngu]$ cat variety.py
#! /usr/bin/env sage

import sys, os
from sage.all import *

R = PolynomialRing(QQ, 4, names = 'u,z,y,x', order = 'lex')
u,z,y,x = R.gens()

G = [
 x^2 + 6/91*z + 6/13*y - 409/91*x + 66/91,
 y*x - 6/91*z - 45/13*y - 410/91*x + 1572/91,
 y^2 + 66/91*z - 129/13*y - 222/91*x + 2000/91,
 z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91,
 z*y - 53/7*z - 5*y - 12/7*x + 313/7,
 z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91,
 u - 17/91*z - 4/13*y - 9/91*x - 187/91,
]

I = ideal(G)
V = I.variety()

for v in V:
print v
for g in G:
print '  %s(%s): %s' % (g, v, g.subs(v))


Running it as a Python script doesn't work:

[mv...@mod mvngu]$ sage -python variety.py
Traceback (most recent call last):
  File "variety.py", line 10, in 
x^2 + 6/91*z + 6/13*y - 409/91*x + 66/91,
  File "element.pyx", line 532, in
sage.structure.element.Element.__xor__ (sage/structure/element.c:4528)
RuntimeError: Use ** for exponentiation, not '^', which means xor
in Python, and has the wrong precedence.
[mv...@mod mvngu]$ sage variety.py
Traceback (most recent call last):
  File "variety.py", line 10, in 
x^2 + 6/91*z + 6/13*y - 409/91*x + 66/91,
  File "element.pyx", line 532, in
sage.structure.element.Element.__xor__ (sage/structure/element.c:4528)
RuntimeError: Use ** for exponentiation, not '^', which means xor
in Python, and has the wrong precedence.


Now I renamed "variety.py" to "variety.sage" (with same code, but
different file extension). Running "variety.sage" as a Sage script
works fine with Sage 4.3:

[mv...@mod mvngu]$ cat variety.sage
#! /usr/bin/env sage

import sys, os
from sage.all import *

R = PolynomialRing(QQ, 4, names = 'u,z,y,x', order = 'lex')
u,z,y,x = R.gens()

G = [
 x^2 + 6/91*z + 6/13*y - 409/91*x + 66/91,
 y*x - 6/91*z - 45/13*y - 410/91*x + 1572/91,
 y^2 + 66/91*z - 129/13*y - 222/91*x + 2000/91,
 z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91,
 z*y - 53/7*z - 5*y - 12/7*x + 313/7,
 z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91,
 u - 17/91*z - 4/13*y - 9/91*x - 187/91,
]

I = ideal(G)
V = I.variety()

for v in V:
print v
for g in G:
print '  %s(%s): %s' % (g, v, g.subs(v))

[mv...@mod mvngu]$ sage variety.sage
{y: 5, z: 7, u: 5, x: 1}
  6/91*z + 6/13*y + x^2 - 409/91*x + 66/91({y: 5, z: 7, u: 5, x: 1}): 0
  -6/91*z + y*x - 45/13*y - 410/91*x + 1572/91({y: 5, z: 7, u: 5, x: 1}): 0
  66/91*z + y^2 - 129/13*y - 222/91*x + 2000/91({y: 5, z: 7, u: 5, x: 1}): 0
  z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91({y: 5, z: 7, u: 5, x: 1}): 0
  z*y - 53/7*z - 5*y - 12/7*x + 313/7({y: 5, z: 7, u: 5, x: 1}): 0
  z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91({y: 5, z: 7, u: 5, x: 1}): 0
  u - 17/91*z - 4/13*y - 9/91*x - 187/91({y: 5, z: 7, u: 5, x: 1}): 0
{y: 7, z: 8, u: 6, x: 3}
  6/91*z + 6/13*y + x^2 - 409/91*x + 66/91({y: 7, z: 8, u: 6, x: 3}): 0
  -6/91*z + y*x - 45/13*y - 410/91*x + 1572/91({y: 7, z: 8, u: 6, x: 3}): 0
  66/91*z + y^2 - 129/13*y - 222/91*x + 2000/91({y: 7, z: 8, u: 6, x: 3}): 0
  z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91({y: 7, z: 8, u: 6, x: 3}): 0
  z*y - 53/7*z - 5*y - 12/7*x + 313/7({y: 7, z: 8, u: 6, x: 3}): 0
  z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91({y: 7, z: 8, u: 6, x: 3}): 0
  u - 17/91*z - 4/13*y - 9/91*x - 187/91({y: 7, z: 8, u: 6, x: 3}): 0
{y: 8, z: 1, u: 5, x: 3}
  6/91*z + 6/13*y + x^2 - 409/91*x + 66/91({y: 8, z: 1, u: 5, x: 3}): 0
  -6/91*z + y*x - 45/13*y - 410/91*x + 1572/91({y: 8, z: 1, u: 5, x: 3}): 0
  66/91*z + y^2 - 129/13*y - 222/91*x + 2000/91({y: 8, z: 1, u: 5, x: 3}): 0
  z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91({y: 8, z: 1, u: 5, x: 3}): 0
  z*y - 53/7*z - 5*y - 12/7*x + 313/7({y: 8, z: 1, u: 5, x: 3}): 0
  z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91({y: 8, z: 1, u: 5, x: 3}): 0
  u - 17/91*z - 4/13*y - 9/91*x - 187/91({y: 8, z: 1, u: 5, x: 3}): 0
{y: 2, z: 5, u: 4, x: 4}
  6/91*z + 6/13*y + x^2 - 409/91*x + 66/91({y: 2, z: 5, u: 4, x: 4}): 0
  -6/91*z + y*x - 45/13*y - 410/91*x + 1572/91({y: 2, z: 5, u: 4, x: 4}): 0
  66/91*z + y^2 - 129/13*y - 222/91*x + 2000/91({y: 2, z: 5, u: 4, x: 4}): 0
  z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91({y: 2, z: 5, u: 4, x: 4}): 0
  z*y - 53/7*z - 5*y - 12/7*x + 313/7({y: 2, z: 5, u: 4, x: 4}): 0
  z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91({y: 2, z: 5, u: 4, x: 4}): 0
  u - 17/91*z - 4/13*y - 9/91*x - 187/91({y: 2, z: 5, u: 4, x: 4}): 0

-- 
Regards
Minh Van Nguyen
-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visi

[sage-support] Re: bug in Sage calculation of variety?

2010-01-18 Thread Simon King
Hi Jeff!

It works for me. The output of your code is:

{y: 5, z: 7, u: 5, x: 1}
  6/91*z + 6/13*y + x^2 - 409/91*x + 66/91({y: 5, z: 7, u: 5, x: 1}):
0
  -6/91*z + y*x - 45/13*y - 410/91*x + 1572/91({y: 5, z: 7, u: 5, x:
1}): 0
  66/91*z + y^2 - 129/13*y - 222/91*x + 2000/91({y: 5, z: 7, u: 5, x:
1}): 0
  z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91({y: 5, z: 7, u: 5, x:
1}): 0
  z*y - 53/7*z - 5*y - 12/7*x + 313/7({y: 5, z: 7, u: 5, x: 1}): 0
  z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91({y: 5, z: 7, u: 5, x:
1}): 0
  u - 17/91*z - 4/13*y - 9/91*x - 187/91({y: 5, z: 7, u: 5, x: 1}): 0
{y: 7, z: 8, u: 6, x: 3}
  6/91*z + 6/13*y + x^2 - 409/91*x + 66/91({y: 7, z: 8, u: 6, x: 3}):
0
  -6/91*z + y*x - 45/13*y - 410/91*x + 1572/91({y: 7, z: 8, u: 6, x:
3}): 0
  66/91*z + y^2 - 129/13*y - 222/91*x + 2000/91({y: 7, z: 8, u: 6, x:
3}): 0
  z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91({y: 7, z: 8, u: 6, x:
3}): 0
  z*y - 53/7*z - 5*y - 12/7*x + 313/7({y: 7, z: 8, u: 6, x: 3}): 0
  z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91({y: 7, z: 8, u: 6, x:
3}): 0
  u - 17/91*z - 4/13*y - 9/91*x - 187/91({y: 7, z: 8, u: 6, x: 3}): 0
{y: 8, z: 1, u: 5, x: 3}
  6/91*z + 6/13*y + x^2 - 409/91*x + 66/91({y: 8, z: 1, u: 5, x: 3}):
0
  -6/91*z + y*x - 45/13*y - 410/91*x + 1572/91({y: 8, z: 1, u: 5, x:
3}): 0
  66/91*z + y^2 - 129/13*y - 222/91*x + 2000/91({y: 8, z: 1, u: 5, x:
3}): 0
  z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91({y: 8, z: 1, u: 5, x:
3}): 0
  z*y - 53/7*z - 5*y - 12/7*x + 313/7({y: 8, z: 1, u: 5, x: 3}): 0
  z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91({y: 8, z: 1, u: 5, x:
3}): 0
  u - 17/91*z - 4/13*y - 9/91*x - 187/91({y: 8, z: 1, u: 5, x: 3}): 0
{y: 2, z: 5, u: 4, x: 4}
  6/91*z + 6/13*y + x^2 - 409/91*x + 66/91({y: 2, z: 5, u: 4, x: 4}):
0
  -6/91*z + y*x - 45/13*y - 410/91*x + 1572/91({y: 2, z: 5, u: 4, x:
4}): 0
  66/91*z + y^2 - 129/13*y - 222/91*x + 2000/91({y: 2, z: 5, u: 4, x:
4}): 0
  z*x - 277/91*z - 4/13*y - 607/91*x + 2049/91({y: 2, z: 5, u: 4, x:
4}): 0
  z*y - 53/7*z - 5*y - 12/7*x + 313/7({y: 2, z: 5, u: 4, x: 4}): 0
  z^2 - 849/91*z - 30/13*y - 48/91*x + 2582/91({y: 2, z: 5, u: 4, x:
4}): 0
  u - 17/91*z - 4/13*y - 9/91*x - 187/91({y: 2, z: 5, u: 4, x: 4}): 0

So, everything is zero.

What version of Sage are you using, and on what computer?

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


[sage-support] Re: Plotting functions without scaling the y-axis?

2010-01-18 Thread Simon King
Hi!

On Jan 17, 10:57 pm, William Stein  wrote:
[...]
> > Is there a way to *fix* the y-axis to the range [-2, 3.5] in the above 
> > example?
>
> Do this:
>
> It's pretty annoying that the input you give above doesn't work.

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