[sage-devel] Re: Making a mayavi2.spkg (SAGE package)

2008-01-16 Thread legout

Hi Jaap,

thanks for you fast reply, but i still can not build mayavi. I think
its because enthought.tvtk couldn't be downloaded.

Link to http://code.enthought.com/enstaller/eggs/source ***BLOCKED***
by --allow-hosts

Link to http://pypi.python.org/simple/enthought.tvtk/ ***BLOCKED*** by
--allow-hosts

Couldn't find index page for 'enthought.tvtk' (maybe misspelled?)
Scanning index of all packages (this may take a while)

Link to http://pypi.python.org/simple/ ***BLOCKED*** by --allow-hosts

No local packages or download links found for
enthought.tvtk[plugin,wx]>=2.0.0b2.dev,<3.0a
error: Could not find suitable distribution for
Requirement.parse('enthought.tvtk[plugin,wx]>=2.0.0b2.dev,<3.0a')

Any ideas, whats wrong on my system?

Legout

On Jan 16, 10:07 pm, Jaap Spies <[EMAIL PROTECTED]> wrote:
> Carl Witty wrote:
>
> > Actually, I think I managed to install mayavi2 without installing
> > pyrex.
>
> Good you found out! I reproduced this on sage-2.10.alpha3.
>
> Jaap
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Fwd: typo in tutorial

2008-01-16 Thread William Stein

-- Forwarded message --
From: Matthew Moelter <[EMAIL PROTECTED]>
Date: Wed, 16 Jan 2008 22:16:00 -0800
Subject: typo in tutorial
To: [EMAIL PROTECTED]

on this page
http://www.sagemath.org/doc/html/tut/node20.html

line 6 (not counting code) is

Type p.show(axes=false) to see this without any ases.

last word should be "axes".

Matt



Matthew Moelter, Assoc Prof
Department of Physics
Calif. Polytechnic State Univ.
San Luis Obispo, CA 93407

805.756.2065 (office)
805.756.2435 (fax)
[EMAIL PROTECTED]





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

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



[sage-devel] Re: Multiple return values

2008-01-16 Thread William Stein

On Jan 16, 2008 12:34 PM, John Cremona <[EMAIL PROTECTED]> wrote:
> William is right that with Python there is no need to have variable
> numbers of return variables (for Python functions, I don't mean
> Magma).  In situations like is_isomorphic() we can always return a
> tuple of 2 values, either (true, i) with i an isomorphism or (false,
> None).  So the calling program can unpack the tuple into 2 values and
> only look at the second if the first is true.  However that breaks
> code which looks correct if written simply as
> if E2.is_isomorphic(E2):
>   do something

Hmm.  I think it should be that

E1.is_isomorphic(E2)

always returns one boolean.   If you want the map too, you have write
something explicit, e.g.,

   t, phi = E1.is_isomorphic(E2, with_map=True)

where phi will be None they aren't isomorphic.   As long as there are examples
and documentation this is easy to use and very easy to read.

Justin says:
> Trying to unwind code that relies
> on this will be a headache, and we should be considering
> maintainability as we go.  It's always tough to start tackling a
> large code base long after the original developers have moved on, and
> this kind of trickery won't help a bit.

In any case, we have to make it possible to use things in Magma from
Sage that people want to use.  Just not doing so isn't an option.

> Still on this specific subthread, I think there must be many
> situations where as well as David's comment that computing one iso is
> not much more work than checking if one exists, one can compute *all*
> isos in not much more time than computing one.  In that case I would
> want to implement E1.isomorphisms_to(E2) [note the "s"!]  which
> returns a possibly empty list of all iso's from E1 to E2.  Then
> E1.is_isomorphic_to(E2) can be *literally* synonymous with
> E1.isomorphisms_to(E2) thanks to Pythons convention that a list is
> "true" if and only if not empty (you can see that I have been reading
> up on Python!).  And then E1.isomorphism_to(E2) can return
> E1.isomorphisms_to(E2)[0] with suitable error-catching if the list was
> empty.  And finally, E1.isomorphisms_to(E1) would return the set of
> automorphisms of E1.

I don't think I like that.  Shouldn't a function named
is_something(...) return True
or False by default?   Taking this further, what would you do with n.is_prime()
for n an integer?   Or with something like x.is_zero_divisor()?

> All the above is certainly good for the case of ellitpic curves which
> have finite automorphsm groups (and almost always of size 2) so the
> above lists are mainly of length 0 or 2.  But maybe elsewhere too?
>
> John
>

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



[sage-devel] Sage 2.10.alpha4 released

2008-01-16 Thread mabshoff

Hi,

Sage 10.2.alpha4 is out. This is mostly fixes all over the
map, the big spkg update push didn't happen since I got
distracted by real world issues for some part of the day.
This release is the basis for tomorrow's Doc Day 1, so I
figured it is a good thing to release so that people can
build over night.

Tarball [200MB] is the usual place at

http://sage.math.washington.edu/home/mabshoff/release-cycles-2.10/sage-2.10.alpha4.tar

Cheers,

Michael

Known Problems:

#1744: FLINT 1.05 "make check" failure on Linux/Itanium with
   gcc 4.2.2 [tracked down to a gcc issue on that platform]
#1485: David Joyner, Simon King: wrapper for invariant_ring and
   invariant_algebra_reynolds in Singular: this caused
   doctest hangs in plot/plot3d/transform.pyx which went
   away when testing that file with the verbose flag. So I
   reverted the patch and reopened the ticket until somebody
   can sort this out. Looking at the patch it is unclear
   to me why this would cause trouble.

Reviews by [incomplete list]:

  * Michael Abshoff
  * Martin Albrecht
  * Mike Hansen
  * David Kohel
  * William Stein
  * Carl Witty

Merged in alpha4:

#1266: Mike Hansen: sage.functions.piecewise is missing from
   reference manual
#1640: Alex Ghitza: missing documentation Elliptic Curve for
   heegner_discriminants
#1727: Mike Hansen: truth value of inequalities not as expected
#1734: Robert Bradshaw, William Stein: variable jmol translucency
#1736: Alex Ghitza: sturm_bound() not working on spaces of cusp
   forms
#1745: William Stein: bug in point enumeration mod p.
#1747: Martin Albrecht: speed improvement for
   mq.SR.polynomial_system
#1774: Bill Allombert: potential very serious problems with
   SEA and PARI-2.3.3
#1783: Mike Hansen: fix latex errors with fraction field elements
#1786: Mike Hansen: coercion error with fraction field of
   multivariate polynomials
#1788: Robert Bradshaw: cython annotation in notebook
#1790: Michael Abshoff: numerical noise doctest failure with
   gcc 4.2.2/x86-64
#1791: Michael Abshoff: numerical noise doctest failure with
   gcc 4.2.2/x86
#1797: Mike Hansen: add another doctest for expansion of
   elementary symmetric functions

Merged in alpha3:

#1428: Mike Hansen: add SVD method to matrix_complex_double_dense
#1570: Francis Clarke: typo in rings/number_field/number_field.py
#1571: Minh Nguyen, Michael Abshoff: corrections for tut.tex
#1657: Ted Kosan: make a build-from-source version of jmol spkg
   [the spkg has been put in the optional spkg repo]
#1668: Burcin Erocal: fix polybori's variable names [BSD issue]
#1679: Mike Hansen: two documentation typos
#1682: Robert Bradshaw: make enabling implicit multiplication
   easy
#1691: Craig Citro: old bug in pari.gen __setitem__ code
#1716: Paul Zimmermann: add function log1p in mpfr interface
#1732: Robert Bradshaw: block matrix construction
#1735: Michael Abshoff: do not mark a spkg as installed if
   sage-check fails
#1743: Michael Abshoff: implausibly old time stamp in optional
   package gap_packages-4.4.10_2.spkg
#1759: Michael Abshoff: Various files still mention GPL V2 only
#1769: Craig Citro: Fast Pari <--> Sage p-adic capped relative
   element conversions
#1771: Peter Jipsen: latex bug with symbolics
#1776: William Stein: symbolic function preparser bug
#1778: Bobby Moretti, William Stein: plot() does not follow the
   same interval range conventions as plot3d()
#1779: Bobby Moretti: setup.py computes the cache of some
   irrelevent files
#1780: Michael Abshoff: add 64 bit MacIntel build support to
   mpfr, fix stack smashing issue

Merged in alpha2:

#511: Michael Abshoff: consider changing python to UCS4
#1091: Willem Jan Palenstijn, Michael Abshoff: small memleaks
   exposed by doctesting ntl_mat_GF2E.pyx
#1685: restructuring symmetric functions and misc. combinatorics
   updates.
#1712: Burcin Erocal: logic error in coercion
#1739: Robert Miller, Michael Abshoff: Use of uninitialised value
   of size 8" in binary_code.pyx
#1749: Michael Abshoff: rings/polynomial/polynomial_element.pyx
   numerical noise doctest failure on FC7/x86
#1752: Michael Abshoff: sage make install bug

Merged in alpha1:

#975: Jason Grout: work around Library incompatibilities when
  launching external applications
#1073: Martin Albrecht: print out some useful information right
   after "sage -pkg" creates a package
#1669: Josh Kantor: remove bogus recommendation to set SAGE_ATLAS
   when numpy fails
#1693: Martin Albrecht: jmol stubles over browser caching
#1709: Robert Miller: Make experimental jmol graph plotting work
#1717: Alex Ghitza, David Harvey: trivial fixes in the
   programming guide (mostly typos)
#1720: Josh Kantor, Michael Abshoff: update numpy to 1.0.4, also
   fix silent build problems with gfortran
#1725: Jaap Spies: Experimental package for wxPython
   [linux only for now]
#1726: Jaap Spies: Experimental 

[sage-devel] Re: [SAGE] #1485: [with bundle, with negative review] wrapper for invariant_ring and invariant_algebra_reynolds in Singular

2008-01-16 Thread mabshoff



On Jan 17, 2:42 am, "David Joyner" <[EMAIL PROTECTED]> wrote:

Hi David,

> I don't understand what is going on with this patch. I'm wondering if
> it would be worthwhile creating a new patch based on a different version of
> SAGE? If so, should I use sage-2.10.alpha* or ...?

I am as surprised as you are that this patch causes problems. What
happens is that when doctesting plot/plot3d/transform.pyx it just
hangs. I actually left a testall session open of alpha4 which I had
planned to release and two hours later the doctest still hung. The
really odd thing is that everything is fine when running that
particular doctest with the -verbose flag. I initially suspected some
other patch to interfere with the plotting system, but alpha3 + your
bundle made the issue appear while reverting your patch from alpha4
made the problem go away. I also reverted by extracting the only
changeset from the bundle and applying with with gnu patch using the
reverse option. The patch itself did get applied correctly and I don't
see how it could interfere, but it does. Since maxima is involved in
this doctest I will leave this for somebody else who is more familiar
with that subsystem to debug.

Cheers,

Michael

> +
>
> On Jan 16, 2008 5:17 PM, SAGE <[EMAIL PROTECTED]> wrote:
>
> > #1485: [with bundle, with negative review] wrapper for invariant_ring and
> > invariant_algebra_reynolds in Singular
> > -+--
> >  Reporter:  wdj  |Owner:  malb
> >  Type:  enhancement  |   Status:  reopened
> >  Priority:  major|Milestone:  sage-2.10
> > Component:  commutative algebra  |   Resolution:
> >  Keywords:   |
> > -+--
> > Changes (by mabshoff):
>
> >   * summary:  [with bundle, with positive review] wrapper for
> >   invariant_ring and invariant_algebra_reynolds
> >   in Singular => [with bundle, with negative
> >   review] wrapper for invariant_ring and
> >   invariant_algebra_reynolds in Singular
>
> > Comment:
>
> >  While somebody is at it: please attach single commit change sets as patch
> >  in the future.
>
> >  Cheers,
>
> >  Michael
>
> > --
> > Ticket URL: 
> > 
> > SAGE 
> > Sage - Open Source Mathematical Software: Building the Car Instead of 
> > Reinventing the Wheel
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Bug Day 9: January 19th, 2008, 9AM PST until ?

2008-01-16 Thread mabshoff

Hello folks,

Bug Day 9 will happen this Saturday and start around 9 AM PST. The
usual rules apply, see

  http://wiki.sagemath.org/bug9

for details. Please add yourself to the list if you plan to
participate. The basis will be Sage 2.10.alpha5 or 6, depending how
Doc Day 1 goes and how much time I have on Saturday.

Cheers,

Michael


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



[sage-devel] Re: First Sage Screencast

2008-01-16 Thread Benjamin



On Jan 6, 11:11 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
> On Jan 6, 2008 11:07 AM, Ted Kosan <[EMAIL PROTECTED]> wrote:
>
>
>
> > Timothy wrote:
>
> > > GHOP (Google Highly Open Participation Contest) contestant Benjamin
> > > Peterson created a 20 minutescreencastintroducing Sage. He followed
> > > my guidelines to a tea, 
> > > seehttp://code.google.com/p/google-highly-open-participation-psf/issues/
> > > Currently the best quality version released so far is at
> > >http://sage.math.washington.edu/home/tclemans/video/ghop/sage-screenc
>
> > Thescreencastwas excellent!  I am going to use it immediately by
> > making it available on my University's network and then sending out a
> > mass email about it.
>
> I will put it on the sagemath.org website.  Any recommendations as to where?
Perhaps, under screencasts?
>
> William

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



[sage-devel] Re: implicit differentiation and implicit plotting

2008-01-16 Thread root

The Axiom draw function does implicit plots. -- Tim 

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



[sage-devel] Re: [sage-trac] Re: [SAGE] #1485: [with bundle, with negative review] wrapper for invariant_ring and invariant_algebra_reynolds in Singular

2008-01-16 Thread David Joyner

I don't understand what is going on with this patch. I'm wondering if
it would be worthwhile creating a new patch based on a different version of
SAGE? If so, should I use sage-2.10.alpha* or ...?

+

On Jan 16, 2008 5:17 PM, SAGE <[EMAIL PROTECTED]> wrote:
> #1485: [with bundle, with negative review] wrapper for invariant_ring and
> invariant_algebra_reynolds in Singular
> -+--
>  Reporter:  wdj  |Owner:  malb
>  Type:  enhancement  |   Status:  reopened
>  Priority:  major|Milestone:  sage-2.10
> Component:  commutative algebra  |   Resolution:
>  Keywords:   |
> -+--
> Changes (by mabshoff):
>
>   * summary:  [with bundle, with positive review] wrapper for
>   invariant_ring and invariant_algebra_reynolds
>   in Singular => [with bundle, with negative
>   review] wrapper for invariant_ring and
>   invariant_algebra_reynolds in Singular
>
> Comment:
>
>  While somebody is at it: please attach single commit change sets as patch
>  in the future.
>
>  Cheers,
>
>  Michael
>
> --
> Ticket URL: 
> 
> SAGE 
> Sage - Open Source Mathematical Software: Building the Car Instead of 
> Reinventing the Wheel
> >
>

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



[sage-devel] Re: implicit differentiation and implicit plotting

2008-01-16 Thread Ondrej Certik

2008/1/16 David Joyner <[EMAIL PROTECTED]>:
> Thanks for these great comments.
>
> Here is roughly how to do what you did but in SAGE, in
> an example
>
> sage: x = var("x")
> sage: y = function("y",x)
> sage: F = x^2 + y^2 - 4*x - 1
> sage: F.diff(x)
> 2*y(x)*diff(y(x), x, 1) + 2*x - 4
> sage: solve(F.diff(x) == 0, diff(y(x), x, 1))
> [diff(y(x), x, 1) == (2 - x)/y(x)]

Thanks, that's what I was looking for. It's actually really simple in Sage.

> It seems sympy has some nice symbolic functionality that is missing
> in SAGE but this type of example is all I really need. Thanks again.

Yes, but Sage.calculus is more robust, SymPy still needs more testing.

Ondrej

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



[sage-devel] Re: notebook/inotebook password

2008-01-16 Thread gri6507


On Jan 16, 1:17 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
> On Jan 16, 2008 9:18 AM, Robert Bradshaw <[EMAIL PROTECTED]> wrote:
>
> On a multiuser system using inotebook is stupid.  Any other user
> on the system can trivially login to your notebook server and delete
> or change any of your files, etc.   I use inotebook all the time ON MY
> LAPTOP, but would never use it on a multiuser system.
>

I understand the concern about security. However, running "sage -
notebook" prompts for the user password on the STDIN. This is the same
problem that I am trying to avoid with the initial Admin password
query. However, if this is the functionality that will be new in 2.10
(as per Robert Bradshaw's earlier message), then all I have to worry
about is just the initial Admin password issue.  I'll submit a Trac
ticket for the enhancement to programmatically enter it.
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Making a mayavi2.spkg (SAGE package)

2008-01-16 Thread Jaap Spies

Carl Witty wrote:

> 
> Actually, I think I managed to install mayavi2 without installing
> pyrex.
> 
Good you found out! I reproduced this on sage-2.10.alpha3.

Jaap


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



[sage-devel] Re: Making a mayavi2.spkg (SAGE package)

2008-01-16 Thread Jaap Spies

I wrote:

> legout wrote:
>> I can't build the mayavi. This is what i've did:
>> 
>> sage -i mayavi-linux_2.0.20080106.spkg
>> 
>> It start compiling, but it breaks some time later. This is the error:
>> 
> 
> I'll try it on a fresh sage-2.10.alpha3 install and come back to you.
> 

Did that:

installed in sage-2.10.alpha3: wxPython, cmake, vtk and setuptools, no pyrex!

grabbed mayavi2 from the experimental spkgs:
./sage -i mayavi-linux_2.0.20080106.spkg

and:
./sage -sh

made a start_script:

#!/usr/bin/env python
import IPython
IPython.Shell.IPShellWX().mainloop()

chmod +x start_script

Sage subshell$ ./start_script
sage: from enthought.mayavi.tools import mlab as M
Set Envisage to use the workbench UI: True
Set Envisage to use the workbench UI: True
sage: M.
M.axes   M.gcfM.roll   
M.test_imshowM.test_simple_surf
M.clfM.get_mayavi M.savefig
M.test_mesh  M.test_surf
M.colorbar   M.imshow M.scalarbar  
M.test_mesh_sphere   M.title
M.contour3d  M.mesh   M.surf   
M.test_molecule  M.vectorbar
M.contour_surf   M.outlineM.test_contour3d 
M.test_plot3dM.view
M.draw   M.plot3d M.test_contour_surf  
M.test_points3d  M.xlabel
M.figure M.points3d   M.test_fancy_mesh
M.test_quiver3d  M.ylabel
M.flow   M.quiver3d   M.test_flow  
M.test_quiver3d_2d_data  M.zlabel
sage: M.


It just worked!

Jaap


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



[sage-devel] Re: implicit differentiation and implicit plotting

2008-01-16 Thread David Joyner
Thanks for these great comments.

Here is roughly how to do what you did but in SAGE, in
an example

sage: x = var("x")
sage: y = function("y",x)
sage: F = x^2 + y^2 - 4*x - 1
sage: F.diff(x)
2*y(x)*diff(y(x), x, 1) + 2*x - 4
sage: solve(F.diff(x) == 0, diff(y(x), x, 1))
[diff(y(x), x, 1) == (2 - x)/y(x)]

It seems sympy has some nice symbolic functionality that is missing
in SAGE but this type of example is all I really need. Thanks again.


On Jan 16, 2008 2:14 PM, Ondrej Certik <[EMAIL PROTECTED]> wrote:
> On Jan 16, 2008 7:00 PM, David Joyner <[EMAIL PROTECTED]> wrote:
> >
> > Hi:
> >
> > I don't remember this topic coming up before but at some point
> > it must be faced since it arises in Calculus 1. AFAIK, SAGE has no routines 
> > for
> > (1) computing the "implicit derivative" y' if y is defined implicitly
> > by F(x,y)=0,
> > (2) plotting (x,y) subject to F(x,y)=0.
> >
> > (1): This is easy for SAGE to compute: y' = - F_x(x,y)/F_y(x,y).
> > The problem is that it just isn't implemented yet to my knowledge.
> > How should this be implemented? implicit_derivative(F(x,y),x) or something??
> > Suggestions?
>
> Is there a need for a special function? I would suggest to use regular
> differentiation means.
>
> For inspiration, I just tried this in sympy:
>
> In [1]: g = Function("g")
>
> In [2]: f(g(x), x)
> Out[2]: f(g(x), x)
>
> In [3]: e=f(g(x), x)
>
> In [4]: e
> Out[4]: f(g(x), x)
>
> In [7]: e.args
> Out[7]: (g(x), x)
>
> In [8]: e.diff(x)
> Out[8]:
>   d   d  d
> ─(f(g(x), x))*──(g(x)) + ──(f(g(x), x))
> dg(x) dx dx
>
> In [9]: Basic.set_repr_level(1)
> Out[9]: 2
>
> In [10]: e.diff(x)
> Out[10]: D(f(g(x), x), g(x))*D(g(x), x) + D(f(g(x), x), x)
>
>
> (you need to use fixed width fonts to see [8], otherwise you'll just see a 
> mess)
> But I am not satisfied with the output, especially with
>
> D(f(g(x), x), x)
>
> since it is not clear if it means the total derivative, or just with
> respect to the second parameter. Or do you mean something like this:
>
> In [4]: e=f(x)**2+f(x)*x**3-3*f(x)
>
> In [5]: e.diff(x)
> Out[5]:
> d   3 d d 2
> - 3*──(f(x)) + x *──(f(x)) + 2*f(x)*──(f(x)) + 3*x *f(x)
> dxdxdx
>
> In [6]: Basic.set_repr_level(1)
> Out[6]: 2
>
> In [7]: e.diff(x)
> Out[7]: -3*D(f(x), x) + x**3*D(f(x), x) + 2*f(x)*D(f(x), x) + 3*x**2*f(x)
>
> In [9]: solve(e.diff(x).subs(f(x).diff(x), y) == 0, [y])
> Out[9]: [3*x**2/(3 - x**3 - 2*f(x))*f(x)]
>
> in [7] I differentiate the implicit definition of f(x), in [9] I solve
> for the D(f(x), x) by substituting it for "y" and solving for y.
>
> I cannot now figure out how to do this in Sage, but I am not sure what
> the best interface to all of this is. But I think the less functions
> (idioms) one needs to remember to do any calculus stuff in Sage, the
> better.
>
> Ondrej
>
> >
>

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



[sage-devel] Re: Multiple return values

2008-01-16 Thread John Cremona

William is right that with Python there is no need to have variable
numbers of return variables (for Python functions, I don't mean
Magma).  In situations like is_isomorphic() we can always return a
tuple of 2 values, either (true, i) with i an isomorphism or (false,
None).  So the calling program can unpack the tuple into 2 values and
only look at the second if the first is true.  However that breaks
code which looks correct if written simply as
if E2.is_isomorphic(E2):
  do something

Still on this specific subthread, I think there must be many
situations where as well as David's comment that computing one iso is
not much more work than checking if one exists, one can compute *all*
isos in not much more time than computing one.  In that case I would
want to implement E1.isomorphisms_to(E2) [note the "s"!]  which
returns a possibly empty list of all iso's from E1 to E2.  Then
E1.is_isomorphic_to(E2) can be *literally* synonymous with
E1.isomorphisms_to(E2) thanks to Pythons convention that a list is
"true" if and only if not empty (you can see that I have been reading
up on Python!).  And then E1.isomorphism_to(E2) can return
E1.isomorphisms_to(E2)[0] with suitable error-catching if the list was
empty.  And finally, E1.isomorphisms_to(E1) would return the set of
automorphisms of E1.

All the above is certainly good for the case of ellitpic curves which
have finite automorphsm groups (and almost always of size 2) so the
above lists are mainly of length 0 or 2.  But maybe elsewhere too?

John

On 16/01/2008, Justin C. Walker <[EMAIL PROTECTED]> wrote:
>
>
> On Jan 16, 2008, at 10:31 AM, William Stein wrote:
>
> >
> > On Jan 16, 2008 9:26 AM, Robert Bradshaw
> > <[EMAIL PROTECTED]> wrote:
> >>
> >> There is no way in python to detect how many arguments a function
> >> result will be assigned to, and I'm not a fan of magma's way of doing
> >> it. WIth variable length tuples one has to check the length of a
> >> tuple before unpacking it.
> >
> > I'll just come out and say it -- It's a _terrible_ design in Magma.
>
> +1.
>
> I think this is really bad design.  Trying to unwind code that relies
> on this will be a headache, and we should be considering
> maintainability as we go.  It's always tough to start tackling a
> large code base long after the original developers have moved on, and
> this kind of trickery won't help a bit.
>
> Justin
>
> --
> Justin C. Walker, Curmudgeon-At-Large
> Institute for the Absorption of Federal Funds
> 
> Some people have a mental horizon of radius zero, and
> call it their point of view.
>-- David Hilbert
> 
>
>
>
> >
>


-- 
John Cremona

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



[sage-devel] Re: implicit differentiation and implicit plotting

2008-01-16 Thread David Joyner

On Jan 16, 2008 3:11 PM, Jason Grout <[EMAIL PROTECTED]> wrote:
>
>
> David Joyner wrote:
> > Hi:
> >
> > I don't remember this topic coming up before but at some point
> > it must be faced since it arises in Calculus 1. AFAIK, SAGE has no routines 
> > for
> > (1) computing the "implicit derivative" y' if y is defined implicitly
> > by F(x,y)=0,
> > (2) plotting (x,y) subject to F(x,y)=0.
> >
> > (1): This is easy for SAGE to compute: y' = - F_x(x,y)/F_y(x,y).
> > The problem is that it just isn't implemented yet to my knowledge.
> > How should this be implemented? implicit_derivative(F(x,y),x) or something??
> > Suggestions?
> >
> > (2) In the 2d case, it might be possible to tweek matplotlib's
> > contourplot. It might also be possible to plot the solution to
> > the 1st order DE y' = - F_x(x,y)/F_y(x,y). Suggestions?
>
>
> It appears that Maxima has an implicit_plot command:
>
> http://maxima.sourceforge.net/docs/manual/en/maxima_55.html
>
> The example seems to work for me with sage -maxima.

That calls gnuplot though. The option [plot_format,openmath]
(which calls the open source tk/tcl plotter openmath) seems not to
be allowed for implicit_plot.

>
> Jason
>
>
>
> >
>

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



[sage-devel] Re: Doc Day 1 announcement: January 17th, 2008, 9am-5pm PST

2008-01-16 Thread Robert Bradshaw

On Jan 16, 2008, at 11:51 AM, David Roe wrote:

> Of course, it'd be nice if every function had ample documentation,
> but I'd rather have 100% coverage on all user-accessible functions in
> two files, than 100% coverage in one file for def/cpdef and cdef
> functions. Also, often the "inderect" tests for cdef functions seem
> to be redundant with the doctests exposed functions.
>
> The indirect doctests are sometimes reduntant.  But sometimes they  
> are things like _add_c_impl, which won't necessarily get doctested  
> elsewhere.

I'm not advocating that no cdef functions should have doctests,  
certainly things like _add_c_impl should.

- Robert

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



[sage-devel] Re: Integer points on Conics

2008-01-16 Thread John Cremona

Here the references which I know:

1. Elkies ANTS paper:
\bibitem{Elkies}
N. D. Elkies.
\newblock Rational points near curves and small nonzero $|x^3 - y^2|$
via lattice reduction.
\newblock In ANTS IV proceedings (W.~Bosma, ed.), LNCS
  {\bf1838}. Springer-Verlag,
2000, pages 33--63.

2. Notes by Mark Watkins for a talk given by Michael Stoll at a
meeting in Bremen summer 2005:
http://www.maths.bris.ac.uk/~mamjw/papers/padic.ps

3. PhD thesis of Rachel Long, 2006 (not available online) (only treats
quadric intersections in P^3):
\bibitem{Long}
R. Long.
\newblock The algorithmic solution of simultaneous Diophantine equations.
\newblock PhD thesis, Oxford Brookes University, 2006.

4. PhD thesis of David Roberts (Nottingham 2007), mainly about the
function field analogue, not yet online as it is being revised after a
successful viva;  but the relevant part is in:

5. J E Cremona and D A Roberts,  "Applications of polynomial lattices
to point-finding over rational function fields", progress report &
draft preprint.

I'll send you the latter off-list as it is not ready for distribution;
 it is my attempts to understand and make rigorous most of the
preceding, and is only for curves and only has full details when the
ambient space is of dimensions 2 or 3.

It is also worth looking at the magma source
 /home/src/magma/package/Geometry/Arith/locsol.m which is much more
general, and written by Nils Bruin who reads sage-devel, so probably
makes all the preceding redundant.  Nils, do you have a version of
that which you could legally donate to Sage?

John

On 16/01/2008, D. Benjamin Antieau <[EMAIL PROTECTED]> wrote:
> John,
>
> Do you have a reference for p-adic Elkies? I would be interested in looking
> at that, and possibly implementing it in as much generality as possible in
> sage.
>
> Ben
>
>
> On Jan 16, 2008 3:15 AM, John Cremona < [EMAIL PROTECTED]> wrote:
> >
> > I assumed that Enrique wanted *all* integral points (in some sense
> > when there are infinitely many).
> >
> > For listing rational (or integral) points up to some height bound
> > there are methods which are vastly more efficient than the one being
> > proposed here, which does not even use a quadratic sieve.  Optimal
> > (for any kind of variety, not just curves, not just plane curves, not
> > just conics) are the p-adic lattice reduction methods (sometimes known
> > as "p-adic Elkies" by analogy with the real -- as opposed to p-adic--
> > version first proposed by Elkies around 2000.
> >
> > Implementing this in Sage should be put onto our
> > useful-projects-for-students list.
> >
> > John
> >
> >
> >
> >
> > On 16/01/2008, D. Benjamin Antieau <[EMAIL PROTECTED]> wrote:
> > > Enrique,
> > >
> > > This can easily be done at the moment, assuming that you want to count
> > > integral points up to a certain height N. If you are looking for all of
> the
> > > points of something you know has only finitely many, I am not so sure.
> > >
> > > I hope the following ramble helps.
> > >
> > > sage: A,B,C,D,E,F=[1,0,0,0,0,-1] # integers
> > > sage: R.=PolynomialRing(ZZ,2)
> > >  sage: f=A*x^2+B*x*y+C*y^2+D*x+E*y+F # C:f=0
> > > sage: X=AffineSpace(ZZ,2)
> > >  sage: Y=X.subscheme(f)
> > > sage: bound=100
> > >  sage: points=Y.rational_points(ZZ,bound)
> > > sage: len(points)
> > >  402
> > >
> > > This uses sage's internal method. However, depending on what you need it
> > > for, the following might work better.
> > >
> > >
> > > The function lazy_rational_points() simply goes through all possible
> values
> > > a of x, and factors f(a,y) to get the points. Then,
> > > it does the same for the bounded values of y. Note that while this
> > > guarantees enumeration of all of the points of bounded height,
> > >
> > > there may be points of greater height in the return.
> > >
> > > sage: def lazy_rational_points(f,bound):
> > > ... r'''
> > > ... Given a polynomial in two variables over ZZ, returns all points
> > > ... of bound less <= bound, and the possibly some more points.
> > >
> > > ... '''
> > > ... points=[]
> > > ... for a in [(-bound)..(bound)]:
> > > ...
> > >
> xroots=R(f(a,y)).univariate_polynomial().roots(multiplicities=False)
> > > ... for b in xroots:
> > > ... if
> > > points.count([a,b]) < 1:
> > > ... points.append([a,b])
> > > ...
> > >
> yroots=R(f(x,a)).univariate_polynomial().roots(multiplicities=False)
> > > ... for c in yroots:
> > > ... if points.count
> > > ([c,a]) < 1:
> > > ... points.append([c,a])
> > > ... return points
> > >
> > > The new version is quite fast, comparatively.
> > > sage: f
> > > x^2 - 1
> > >
> > >
> > > sage: %time
> > > sage: c=lazy_rational_points(f,200)
> > > sage: len(c)
> > > 802
> > > CPU time: 0.59 s, Wall time: 0.62 s
> > >
> > > sage: %time
> > > sage: bound=200
> > > sage: points=Y.rational_points(ZZ,bound)
> > > sage: len(points)
> > >
> > > 802
> > > CPU time: 42.85 s, Wall time: 51.11 s
> > >
> > > Even up to a thousand, quite quickly. I didn't feel like seeing about
> the
> > > old ver

[sage-devel] Re: implicit differentiation and implicit plotting

2008-01-16 Thread Jason Grout

David Joyner wrote:
> Hi:
> 
> I don't remember this topic coming up before but at some point
> it must be faced since it arises in Calculus 1. AFAIK, SAGE has no routines 
> for
> (1) computing the "implicit derivative" y' if y is defined implicitly
> by F(x,y)=0,
> (2) plotting (x,y) subject to F(x,y)=0.
> 
> (1): This is easy for SAGE to compute: y' = - F_x(x,y)/F_y(x,y).
> The problem is that it just isn't implemented yet to my knowledge.
> How should this be implemented? implicit_derivative(F(x,y),x) or something??
> Suggestions?
> 
> (2) In the 2d case, it might be possible to tweek matplotlib's
> contourplot. It might also be possible to plot the solution to
> the 1st order DE y' = - F_x(x,y)/F_y(x,y). Suggestions?


It appears that Maxima has an implicit_plot command:

http://maxima.sourceforge.net/docs/manual/en/maxima_55.html

The example seems to work for me with sage -maxima.

Jason


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



[sage-devel] Re: Multiple return values

2008-01-16 Thread Justin C. Walker


On Jan 16, 2008, at 10:31 AM, William Stein wrote:

>
> On Jan 16, 2008 9:26 AM, Robert Bradshaw  
> <[EMAIL PROTECTED]> wrote:
>>
>> There is no way in python to detect how many arguments a function
>> result will be assigned to, and I'm not a fan of magma's way of doing
>> it. WIth variable length tuples one has to check the length of a
>> tuple before unpacking it.
>
> I'll just come out and say it -- It's a _terrible_ design in Magma.

+1.

I think this is really bad design.  Trying to unwind code that relies  
on this will be a headache, and we should be considering  
maintainability as we go.  It's always tough to start tackling a  
large code base long after the original developers have moved on, and  
this kind of trickery won't help a bit.

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Absorption of Federal Funds

Some people have a mental horizon of radius zero, and
call it their point of view.
   -- David Hilbert




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



[sage-devel] Re: Doc Day 1 announcement: January 17th, 2008, 9am-5pm PST

2008-01-16 Thread David Roe
With the modifications, our overall coverage is at 33.1%.
David

On Jan 16, 2008 2:56 PM, mabshoff <
[EMAIL PROTECTED]> wrote:

>
>
>
> On Jan 16, 8:51 pm, "David Roe" <[EMAIL PROTECTED]> wrote:
> > > Of course, it'd be nice if every function had ample documentation,
> > > but I'd rather have 100% coverage on all user-accessible functions in
> > > two files, than 100% coverage in one file for def/cpdef and cdef
> > > functions. Also, often the "inderect" tests for cdef functions seem
> > > to be redundant with the doctests exposed functions.
> >
> > The indirect doctests are sometimes reduntant.  But sometimes they are
> > things like _add_c_impl, which won't necessarily get doctested
> elsewhere.
> > David
>
> I think it can't hurt to test those. When I need to debug some odd
> crash on an experimental platforms with very abstract, high level code
> it would greatly help to narrow down the issue if those functions
> would also be doctested and exposed when I run -testall on the build.
> While it certainly is a lot of effort it would still be worth it. The
> only negative impact I would see is that our percentage of -
> coverageall would probably do drop quite a bit.
>
> Cheers,
>
> Michael
> >
>

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



[sage-devel] Re: Doc Day 1 announcement: January 17th, 2008, 9am-5pm PST

2008-01-16 Thread mabshoff



On Jan 16, 8:51 pm, "David Roe" <[EMAIL PROTECTED]> wrote:
> > Of course, it'd be nice if every function had ample documentation,
> > but I'd rather have 100% coverage on all user-accessible functions in
> > two files, than 100% coverage in one file for def/cpdef and cdef
> > functions. Also, often the "inderect" tests for cdef functions seem
> > to be redundant with the doctests exposed functions.
>
> The indirect doctests are sometimes reduntant.  But sometimes they are
> things like _add_c_impl, which won't necessarily get doctested elsewhere.
> David

I think it can't hurt to test those. When I need to debug some odd
crash on an experimental platforms with very abstract, high level code
it would greatly help to narrow down the issue if those functions
would also be doctested and exposed when I run -testall on the build.
While it certainly is a lot of effort it would still be worth it. The
only negative impact I would see is that our percentage of -
coverageall would probably do drop quite a bit.

Cheers,

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



[sage-devel] Re: Doc Day 1 announcement: January 17th, 2008, 9am-5pm PST

2008-01-16 Thread David Roe
> Of course, it'd be nice if every function had ample documentation,
> but I'd rather have 100% coverage on all user-accessible functions in
> two files, than 100% coverage in one file for def/cpdef and cdef
> functions. Also, often the "inderect" tests for cdef functions seem
> to be redundant with the doctests exposed functions.


The indirect doctests are sometimes reduntant.  But sometimes they are
things like _add_c_impl, which won't necessarily get doctested elsewhere.
David

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



[sage-devel] Re: Doc Day 1 announcement: January 17th, 2008, 9am-5pm PST

2008-01-16 Thread Robert Bradshaw

On Jan 16, 2008, at 11:24 AM, Nick Alexander wrote:

> On 16-Jan-08, at 11:17 AM, Robert Bradshaw wrote:
>
>>
>> Sounds like a good idea--I'll be able to participate in the morning
>> at least. Do we want to require all cdef functions to have doctests?
>> Also, how to test them?
>
> I vote to require.  Presumably all cdef functions are exercised by
> some part of the python accessible code (otherwise, why are they
> present?).  Doctests in cdef docstrings are found by the doctesting
> architecture and executed.  So they will be tested, just not in the
> most straightforward way :)

Of course, it'd be nice if every function had ample documentation,  
but I'd rather have 100% coverage on all user-accessible functions in  
two files, than 100% coverage in one file for def/cpdef and cdef  
functions. Also, often the "inderect" tests for cdef functions seem  
to be redundant with the doctests exposed functions.

- Robert

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



[sage-devel] Re: Making a mayavi2.spkg (SAGE package)

2008-01-16 Thread Jaap Spies

legout wrote:
> I can't build the mayavi. This is what i've did:
> 
> sage -i mayavi-linux_2.0.20080106.spkg
> 
> It start compiling, but it breaks some time later. This is the error:
> 

I'll try it on a fresh sage-2.10.alpha3 install and come back to you.

Jaap


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



[sage-devel] Re: FLINT 1.05 "make check" failure on Linux/Itanium

2008-01-16 Thread mabshoff



On Jan 10, 7:50 am, mabshoff <[EMAIL PROTECTED]
dortmund.de> wrote:

Hi Kate,


>
> FYI: This is now #1744.

To do some followup: Bill Hart has tracked this down to an issue in
gcc 4.2.2 on Itanium. More details on the ticket. You might want to
add your email as CC over there, too.

> Cheers,
>
> Michael

Cheers,

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



[sage-devel] Re: Doc Day 1 announcement: January 17th, 2008, 9am-5pm PST

2008-01-16 Thread mabshoff



On Jan 16, 8:32 pm, "David Roe" <[EMAIL PROTECTED]> wrote:
> My modification to sage-coverage checks to see that doctests are present in
> the docstring of a cdef'd function but doesn't check that the function name
> is there (because it usually won't be).
> David

Nice. Robert, can you review that ticket, too? I would like to merge
it for alpha4 which should be the basis for the Doc Day IMHO.

On a side note: I was under the impression that we would also work on
documentation, while everybody else is talking about doctests ;).

Cheers,

Michael

> On Jan 16, 2008 2:24 PM, Nick Alexander <[EMAIL PROTECTED]> wrote:
>
>
>
> > On 16-Jan-08, at 11:17 AM, Robert Bradshaw wrote:
>
> > > Sounds like a good idea--I'll be able to participate in the morning
> > > at least. Do we want to require all cdef functions to have doctests?
> > > Also, how to test them?
>
> > I vote to require.  Presumably all cdef functions are exercised by
> > some part of the python accessible code (otherwise, why are they
> > present?).  Doctests in cdef docstrings are found by the doctesting
> > architecture and executed.  So they will be tested, just not in the
> > most straightforward way :)
>
> > Nick
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Doc Day 1 announcement: January 17th, 2008, 9am-5pm PST

2008-01-16 Thread David Roe
My modification to sage-coverage checks to see that doctests are present in
the docstring of a cdef'd function but doesn't check that the function name
is there (because it usually won't be).
David

On Jan 16, 2008 2:24 PM, Nick Alexander <[EMAIL PROTECTED]> wrote:

>
>
> On 16-Jan-08, at 11:17 AM, Robert Bradshaw wrote:
>
> >
> > Sounds like a good idea--I'll be able to participate in the morning
> > at least. Do we want to require all cdef functions to have doctests?
> > Also, how to test them?
>
> I vote to require.  Presumably all cdef functions are exercised by
> some part of the python accessible code (otherwise, why are they
> present?).  Doctests in cdef docstrings are found by the doctesting
> architecture and executed.  So they will be tested, just not in the
> most straightforward way :)
>
> Nick
>
> >
>

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



[sage-devel] Re: show(matrix) versus matrix.show()

2008-01-16 Thread Robert Bradshaw

I believe show(x) tries to call x.show(), and if that fails, does  
some fallback code (e.g. try to get the latex representation.) As  
such, show(x) is always safer.

- Robert

On Jan 16, 2008, at 11:20 AM, Jason Grout wrote:

>
> In the sage notebook (version 2.9.3), we see:
>
> sage: a=matrix(2,[1,2,3,4]); a
> [1 2]
> [3 4]
> sage: show(a)
> < nice pretty rendering of the matrix, presumably using jsmath >
> sage: a.show()
> Traceback (most recent call last):
>File "", line 1, in 
>File "/home/grout/.sage/sage_notebook/worksheets/admin/7/code/ 
> 27.py",
> line 4, in 
>  a.show()
>File
> "/home/grout/sage/local/lib/python2.5/site-packages/sympy/plotting/",
> line 1, in 
>
> AttributeError: 'sage.matrix.matrix_integer_dense.Matrix_integer_de'
> object has no attribute 'show'
>
>
> Is show(expr) the best and most general way to get pretty output in  
> the
> notebook, as opposed to expr.show(), where expr is a general sage  
> object
> or expression?  Or are they supposed to be interchangeable, and  
> what I'm
> seeing above is a bug in the matrix code?  Or is there some other
> consistent way to get pretty output?
>
> I'm looking for something consistent for my students to use to get a
> pretty output of whatever they are doing.
>
> Thanks,
>
> Jason
>
>
> 

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



[sage-devel] Re: Doc Day 1 announcement: January 17th, 2008, 9am-5pm PST

2008-01-16 Thread Nick Alexander


On 16-Jan-08, at 11:17 AM, Robert Bradshaw wrote:

>
> Sounds like a good idea--I'll be able to participate in the morning
> at least. Do we want to require all cdef functions to have doctests?
> Also, how to test them?

I vote to require.  Presumably all cdef functions are exercised by  
some part of the python accessible code (otherwise, why are they  
present?).  Doctests in cdef docstrings are found by the doctesting  
architecture and executed.  So they will be tested, just not in the  
most straightforward way :)

Nick

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



[sage-devel] Re: Making a mayavi2.spkg (SAGE package)

2008-01-16 Thread Jaap Spies

Carl Witty wrote:
> On Jan 16, 9:11 am, Jaap Spies <[EMAIL PROTECTED]> wrote:
>> legout wrote:
>>> Whats the deps  for the exerimental mayavi-spkg?
>>> setuptools?
>>> vtk?
>>> ...?
>>> thanks so far!
>> Have a look at:
>>
>> http://sage.math.washington.edu/home/jsp/SPKGS/MayaVi2/
>>
>> Especially the README.txt for the ets spkg. For the mayavi2 package
>> you don't need swig and PIL.
>>
>>  > wxPython +
>>  > setuptools +
>>  > vtk +
>>  > swig -
>>  > pyrex +
>>  > PIL -
>>
>> Jaap
> 
> Actually, I think I managed to install mayavi2 without installing
> pyrex.
> 

Maybe, but do you have a system wide pyrex?

> Now that I've installed it, what can I do?  (At least, what are some
> tests I can run to see if it actually works?)
> 

This is rather complicated because we need IPython to run with -wxthread
option enabled. See http://sagetrac.org/sage_trac/ticket/1748

Do ./sage -sh to get a shell in the "right" environment,
create a file "start_up" or something (Fernando Perez):

>> The solution is to have Sage start ipython with the wthread option, if
>> you want full Sage support.  As a starter, you can test this. Make a
>> little file that's simply
>> 
>> #!/path/to/sage/python
>> import IPython
>> IPython.Shell.IPShellWX().mainloop()

make this file executable, run it and you are in business:

sage: from enthought.mayavi.tools import mlab as M
Set Envisage to use the workbench UI: True
Set Envisage to use the workbench UI: True
sage: M.
M.axes   M.points3d   M.test_plot3d
M.clfM.quiver3d   M.test_points3d
M.colorbar   M.roll   M.test_quiver3d
M.contour3d  M.savefigM.test_quiver3d_2d_data
M.contour_surf   M.scalarbar  M.test_simple_surf
M.draw   M.surf   M.test_surf
M.figure M.test_contour3d M.title
M.flow   M.test_contour_surf  M.vectorbar
M.gcfM.test_fancy_meshM.view
M.get_mayavi M.test_flow  M.xlabel
M.imshow M.test_imshowM.ylabel
M.mesh   M.test_mesh  M.zlabel
M.outlineM.test_mesh_sphere
M.plot3d M.test_molecule


Try the M.test_*() functions, see my webalbum:
http://picasaweb.google.nl/j.spies88/Mayavi2FromSage

Or run mayavi2 as a stand alone program from this shell.

Jaap


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



[sage-devel] show(matrix) versus matrix.show()

2008-01-16 Thread Jason Grout

In the sage notebook (version 2.9.3), we see:

sage: a=matrix(2,[1,2,3,4]); a
[1 2]
[3 4]
sage: show(a)
< nice pretty rendering of the matrix, presumably using jsmath >
sage: a.show()
Traceback (most recent call last):
   File "", line 1, in 
   File "/home/grout/.sage/sage_notebook/worksheets/admin/7/code/27.py", 
line 4, in 
 a.show()
   File 
"/home/grout/sage/local/lib/python2.5/site-packages/sympy/plotting/", 
line 1, in 

AttributeError: 'sage.matrix.matrix_integer_dense.Matrix_integer_de' 
object has no attribute 'show'


Is show(expr) the best and most general way to get pretty output in the 
notebook, as opposed to expr.show(), where expr is a general sage object 
or expression?  Or are they supposed to be interchangeable, and what I'm 
seeing above is a bug in the matrix code?  Or is there some other 
consistent way to get pretty output?

I'm looking for something consistent for my students to use to get a 
pretty output of whatever they are doing.

Thanks,

Jason


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



[sage-devel] Re: Doc Day 1 announcement: January 17th, 2008, 9am-5pm PST

2008-01-16 Thread Robert Bradshaw

Sounds like a good idea--I'll be able to participate in the morning  
at least. Do we want to require all cdef functions to have doctests?  
Also, how to test them?

- Robert


On Jan 16, 2008, at 11:09 AM, David Roe wrote:

> Note that I just put up a ticket with patch (1795) that fixes sage- 
> coverage so that it checks cdef'd and cpdef'd functions and classes.
> David
>
> On Jan 16, 2008 12:00 PM, Martin Albrecht < [EMAIL PROTECTED] 
> bremen.de> wrote:
>
> On Wednesday 16 January 2008, mabshoff wrote:
> > Hello folks,
> >
> > after doing 8 Bug Days the time has come to spend some more time on
> > the documentation, which also needs a lot of work. So after some
> > discussion in IRC we decided to get together in IRC at the above  
> date
> > and time and work on the documentation. Since we have never done  
> a doc
> > day it isn't 100% clear to me how the whole thing will go down,  
> but I
> > assume we will just go with the flow.
> >
> > Thoughts? Suggestions?
>
> Suggestion: each participant goes through a file of his/her own  
> choice and
> makes sure it has 100% doctest coverage. Reading the source of the  
> possibly
> unfamiliar file is also encouraged.
>
> Martin
>
>
> --
> name: Martin Albrecht
> _pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
> _www: http://www.informatik.uni-bremen.de/~malb
> _jab: [EMAIL PROTECTED]
>
>
>
> >


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



[sage-devel] Re: implicit differentiation and implicit plotting

2008-01-16 Thread Ondrej Certik
On Jan 16, 2008 8:14 PM, Ondrej Certik <[EMAIL PROTECTED]> wrote:
> On Jan 16, 2008 7:00 PM, David Joyner <[EMAIL PROTECTED]> wrote:
> >
> > Hi:
> >
> > I don't remember this topic coming up before but at some point
> > it must be faced since it arises in Calculus 1. AFAIK, SAGE has no routines 
> > for
> > (1) computing the "implicit derivative" y' if y is defined implicitly
> > by F(x,y)=0,
> > (2) plotting (x,y) subject to F(x,y)=0.
> >
> > (1): This is easy for SAGE to compute: y' = - F_x(x,y)/F_y(x,y).
> > The problem is that it just isn't implemented yet to my knowledge.
> > How should this be implemented? implicit_derivative(F(x,y),x) or something??
> > Suggestions?
>
> Is there a need for a special function? I would suggest to use regular
> differentiation means.
>
> For inspiration, I just tried this in sympy:
>
> In [1]: g = Function("g")
>
> In [2]: f(g(x), x)
> Out[2]: f(g(x), x)
>
> In [3]: e=f(g(x), x)
>
> In [4]: e
> Out[4]: f(g(x), x)
>
> In [7]: e.args
> Out[7]: (g(x), x)
>
> In [8]: e.diff(x)
> Out[8]:
>   d   d  d
> ─(f(g(x), x))*──(g(x)) + ──(f(g(x), x))
> dg(x) dx dx
>
> In [9]: Basic.set_repr_level(1)
> Out[9]: 2
>
> In [10]: e.diff(x)
> Out[10]: D(f(g(x), x), g(x))*D(g(x), x) + D(f(g(x), x), x)
>
>
> (you need to use fixed width fonts to see [8], otherwise you'll just see a 
> mess)
> But I am not satisfied with the output, especially with
>
> D(f(g(x), x), x)
>
> since it is not clear if it means the total derivative, or just with
> respect to the second parameter. Or do you mean something like this:
>
> In [4]: e=f(x)**2+f(x)*x**3-3*f(x)
>
> In [5]: e.diff(x)
> Out[5]:
> d   3 d d 2
> - 3*──(f(x)) + x *──(f(x)) + 2*f(x)*──(f(x)) + 3*x *f(x)
> dxdxdx
>
> In [6]: Basic.set_repr_level(1)
> Out[6]: 2
>
> In [7]: e.diff(x)
> Out[7]: -3*D(f(x), x) + x**3*D(f(x), x) + 2*f(x)*D(f(x), x) + 3*x**2*f(x)
>
> In [9]: solve(e.diff(x).subs(f(x).diff(x), y) == 0, [y])
> Out[9]: [3*x**2/(3 - x**3 - 2*f(x))*f(x)]
>
> in [7] I differentiate the implicit definition of f(x), in [9] I solve
> for the D(f(x), x) by substituting it for "y" and solving for y.
>
> I cannot now figure out how to do this in Sage, but I am not sure what
> the best interface to all of this is. But I think the less functions
> (idioms) one needs to remember to do any calculus stuff in Sage, the
> better.

To make myself more clear, I'd suggest:

def implicit_derivative(eq, f)
x = f.args[0]
return solve(eq.diff(x), f)

or something like this. At least the goal of the calculus in Sage
should be to support this imho.

Ondrej

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



[sage-devel] Re: implicit differentiation and implicit plotting

2008-01-16 Thread Ondrej Certik
On Jan 16, 2008 7:00 PM, David Joyner <[EMAIL PROTECTED]> wrote:
>
> Hi:
>
> I don't remember this topic coming up before but at some point
> it must be faced since it arises in Calculus 1. AFAIK, SAGE has no routines 
> for
> (1) computing the "implicit derivative" y' if y is defined implicitly
> by F(x,y)=0,
> (2) plotting (x,y) subject to F(x,y)=0.
>
> (1): This is easy for SAGE to compute: y' = - F_x(x,y)/F_y(x,y).
> The problem is that it just isn't implemented yet to my knowledge.
> How should this be implemented? implicit_derivative(F(x,y),x) or something??
> Suggestions?

Is there a need for a special function? I would suggest to use regular
differentiation means.

For inspiration, I just tried this in sympy:

In [1]: g = Function("g")

In [2]: f(g(x), x)
Out[2]: f(g(x), x)

In [3]: e=f(g(x), x)

In [4]: e
Out[4]: f(g(x), x)

In [7]: e.args
Out[7]: (g(x), x)

In [8]: e.diff(x)
Out[8]:
  d   d  d
─(f(g(x), x))*──(g(x)) + ──(f(g(x), x))
dg(x) dx dx

In [9]: Basic.set_repr_level(1)
Out[9]: 2

In [10]: e.diff(x)
Out[10]: D(f(g(x), x), g(x))*D(g(x), x) + D(f(g(x), x), x)


(you need to use fixed width fonts to see [8], otherwise you'll just see a mess)
But I am not satisfied with the output, especially with

D(f(g(x), x), x)

since it is not clear if it means the total derivative, or just with
respect to the second parameter. Or do you mean something like this:

In [4]: e=f(x)**2+f(x)*x**3-3*f(x)

In [5]: e.diff(x)
Out[5]:
d   3 d d 2
- 3*──(f(x)) + x *──(f(x)) + 2*f(x)*──(f(x)) + 3*x *f(x)
dxdxdx

In [6]: Basic.set_repr_level(1)
Out[6]: 2

In [7]: e.diff(x)
Out[7]: -3*D(f(x), x) + x**3*D(f(x), x) + 2*f(x)*D(f(x), x) + 3*x**2*f(x)

In [9]: solve(e.diff(x).subs(f(x).diff(x), y) == 0, [y])
Out[9]: [3*x**2/(3 - x**3 - 2*f(x))*f(x)]

in [7] I differentiate the implicit definition of f(x), in [9] I solve
for the D(f(x), x) by substituting it for "y" and solving for y.

I cannot now figure out how to do this in Sage, but I am not sure what
the best interface to all of this is. But I think the less functions
(idioms) one needs to remember to do any calculus stuff in Sage, the
better.

Ondrej

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



[sage-devel] Re: Doc Day 1 announcement: January 17th, 2008, 9am-5pm PST

2008-01-16 Thread David Roe
Note that I just put up a ticket with patch (1795) that fixes sage-coverage
so that it checks cdef'd and cpdef'd functions and classes.
David

On Jan 16, 2008 12:00 PM, Martin Albrecht <[EMAIL PROTECTED]>
wrote:

>
> On Wednesday 16 January 2008, mabshoff wrote:
> > Hello folks,
> >
> > after doing 8 Bug Days the time has come to spend some more time on
> > the documentation, which also needs a lot of work. So after some
> > discussion in IRC we decided to get together in IRC at the above date
> > and time and work on the documentation. Since we have never done a doc
> > day it isn't 100% clear to me how the whole thing will go down, but I
> > assume we will just go with the flow.
> >
> > Thoughts? Suggestions?
>
> Suggestion: each participant goes through a file of his/her own choice and
> makes sure it has 100% doctest coverage. Reading the source of the
> possibly
> unfamiliar file is also encouraged.
>
> Martin
>
>
> --
> name: Martin Albrecht
> _pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
> _www: 
> http://www.informatik.uni-bremen.de/~malb
> _jab: [EMAIL PROTECTED]
>
>
> >
>

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



[sage-devel] Re: Multiple return values

2008-01-16 Thread Fernando Perez

On Jan 16, 2008 11:31 AM, William Stein <[EMAIL PROTECTED]> wrote:
>
> On Jan 16, 2008 9:26 AM, Robert Bradshaw <[EMAIL PROTECTED]> wrote:
> >
> > There is no way in python to detect how many arguments a function
> > result will be assigned to, and I'm not a fan of magma's way of doing
> > it. WIth variable length tuples one has to check the length of a
> > tuple before unpacking it.
>
> I'll just come out and say it -- It's a _terrible_ design in Magma.  I also
> found it bad when I used it.  I once overheard somebody at IHP in Paris
> talking with John Cannon about Magma and learning of variable numbers
> of return arguments (as in Magma), and just being incredulous that they
> could have actually implemented something like that. And personally
> it makes the computer scientist in me cringe.
>
> Python's solution to the multiple-return-values problem, with
> automatic tuple unpacking, is much more elegant.

And it's worth noting that for py3k they added the very nice extension:

>>> a, *b, c = range(5)
>>> a
0
>>> c
4
>>> b
[1, 2, 3]

Details here:

http://www.python.org/dev/peps/pep-3132/

Cheers,

f

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



[sage-devel] Re: Multiple return values

2008-01-16 Thread William Stein

On Jan 16, 2008 10:34 AM, Kiran Kedlaya <[EMAIL PROTECTED]> wrote:
>
> Before proceeding, let me thank William for answering my original
> question. In the case I was interested in, the number of return values
> does not vary in any funny way, so I can use nvals to get what I want
> back out.
>
> But in the example of IsIsomorphic, there seems to be a problem. If I
> start Magma and type
>
> > E := EllipticCurve([2,1]);
> > F := EllipticCurve([5,1]);
> > bool, phi := IsIsomorphic(E,F);
>
> then the identifier phi remains undefined! And in Sage, if I type
>
> sage: E = magma.EllipticCurve([2,1]);
> sage: F = magma.EllipticCurve([5,1])
> sage: bool, phi = magma.IsIsomorphic(E, F, nvals=2)
>
> this generates an error:
>
> : Error evaluation Magma code.
> IN:_sage_[9], _sage_[10] := IsIsomorphic(_sage_[4],_sage_[8]);
> OUT:
> >> _sage_[9], _sage_[10] := IsIsomorphic(_sage_[4],_sage_[8]);
> ^
> Runtime error in :=: Illegal undefined assignment for LHS index
> assignment
>
> In a perfect world, the above would run and produce bool == False, phi
> == None. Sigh.

Yet another example of the Magma semantics being a pain.
They don't even use a notion of None.  Argh.

Anyway, it might be possible to program around the above
problem via some complicated Magma trickiery.  Definitely
report it as a bug to the Sage tracer.

William

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



[sage-devel] Re: Multiple return values

2008-01-16 Thread Kiran Kedlaya

Before proceeding, let me thank William for answering my original
question. In the case I was interested in, the number of return values
does not vary in any funny way, so I can use nvals to get what I want
back out.

But in the example of IsIsomorphic, there seems to be a problem. If I
start Magma and type

> E := EllipticCurve([2,1]);
> F := EllipticCurve([5,1]);
> bool, phi := IsIsomorphic(E,F);

then the identifier phi remains undefined! And in Sage, if I type

sage: E = magma.EllipticCurve([2,1]);
sage: F = magma.EllipticCurve([5,1])
sage: bool, phi = magma.IsIsomorphic(E, F, nvals=2)

this generates an error:

: Error evaluation Magma code.
IN:_sage_[9], _sage_[10] := IsIsomorphic(_sage_[4],_sage_[8]);
OUT:
>> _sage_[9], _sage_[10] := IsIsomorphic(_sage_[4],_sage_[8]);
^
Runtime error in :=: Illegal undefined assignment for LHS index
assignment

In a perfect world, the above would run and produce bool == False, phi
== None. Sigh.

Kiran

On Jan 16, 12:26 pm, Robert Bradshaw <[EMAIL PROTECTED]>
wrote:
> There is no way in python to detect how many arguments a function
> result will be assigned to, and I'm not a fan of magma's way of doing
> it. WIth variable length tuples one has to check the length of a
> tuple before unpacking it.
>
> There is a function E1.isomorphism_to(E2) that actually computes the
> isomorphism. I think is_isomorphism should just return True or False
> (is_* has that convention). Then one can do such things as
>
> if E.is_isomporhic(F):
>  ...
>
> Perhaps an optional argument "compute" which computes and then caches
> or returns the actual isomorphism.
>
> - Robert
>
> On Jan 16, 2008, at 6:03 AM, John Cremona wrote:
>
> > What a coincidence -- the patch I am working on *will* (have the
> > capability to) return both a boolean and an isomorphism for
> > is_isomorphic() on elliptic curves.  I was wondering how to do that
> > and assumed that it would be a tuple.  Rather than make the tuple's
> > length (1 or 2) depend on the input I would always return a tuple of
> > length 2 but the second item would be None iff the first has false.
> > Isn't that a reasonable way of doing it?
>
> > I don't like requiring the trapping of errors, though I realise that
> > it is very Pythonesque to do so.  But if we allow the input line
> > sage: phi = E1.isomorphism(E2)
>
> > then we *must* raise an error when the things are not isomorphic,
> > just as
> > sage: QQ(2).nth_root(2)
> > raises as ValueError (though sqrt(2) does not as it creates a
> > symbolic sqrt(2)).
>
> > This is going beyond the original thread, I know.
>
> > On 16/01/2008, David Kohel <[EMAIL PROTECTED]> wrote:
>
> >> There was a thread on multiple return values coming from Magma,
> >> since renamed to "Integer points on conics"
>
> >> William pointed out that one can access the multiple return values
> >> using nvals:
>
> >>  x = magma.XGCD(15, 10)
> >>  x,y,z = magma.XGCD(15, 10, nvals = 3)
>
> >> The first returns an integer, while the second returns a tuple.
>
> >> Q1: Is this an acceptable general construction for Python and/or
> >> SAGE,
> >> namely to return a different type depending on the values passed into
> >> it?  Is it acceptable when it is controlled by nvals in exactly this
> >> way?
>
> >> As William pointed out, very different algorithms can be called
> >> depending on the
> >> number of arguments requested in Magma.  The following is an example:
>
> >> sage: E = magma.EllipticCurve([1,3])
> >> sage: magma.IsIsomorphic(E,E)
> >> true
> >> sage: bool, phi = magma.IsIsomorphic(E,E,nvals=2)
> >> sage: phi
> >> Elliptic curve isomorphism from: Elliptic Curve defined by y^2 =
> >> x^3 +
> >> x + 3 over Rational Field to Elliptic Curve defined by y^2 = x^3 +
> >> x +
> >> 3 over Rational Field
> >> Taking (x : y : 1) to (x : y : 1)
>
> >> Currently in SAGE we have:
>
> >> sage: E = EllipticCurve([1,3])
> >> sage: E.is_isomorphic(E)
> >> True
>
> >> Q2: Would the following be acceptable way of implementing equivalent
> >> functionality in SAGE?:
>
> >> sage: bool, phi = E.is_isomorphic(E, nvals=2)
>
> >> Note that often (in many concexts) it more expensive to return an
> >> isomorphism, but only slightly more so compared with recomputing the
> >> isomorphism test.  If the answer to my question is "no, it not
> >> acceptable SAGE/Python syntax", then how should we implement this
> >> functionality?  One possibility is:
>
> >> sage: phi = E1.isomorphism(E2)
>
> >> and to trap an error if is_isomorphic returns false.  Is this a
> >> better?
>
> > --
> > John Cremona
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Multiple return values

2008-01-16 Thread William Stein

On Jan 16, 2008 9:26 AM, Robert Bradshaw <[EMAIL PROTECTED]> wrote:
>
> There is no way in python to detect how many arguments a function
> result will be assigned to, and I'm not a fan of magma's way of doing
> it. WIth variable length tuples one has to check the length of a
> tuple before unpacking it.

I'll just come out and say it -- It's a _terrible_ design in Magma.  I also
found it bad when I used it.  I once overheard somebody at IHP in Paris
talking with John Cannon about Magma and learning of variable numbers
of return arguments (as in Magma), and just being incredulous that they
could have actually implemented something like that. And personally
it makes the computer scientist in me cringe.

Python's solution to the multiple-return-values problem, with
automatic tuple unpacking, is much more elegant.

> There is a function E1.isomorphism_to(E2) that actually computes the
> isomorphism. I think is_isomorphism should just return True or False
> (is_* has that convention). Then one can do such things as
>
> if E.is_isomporhic(F):
>  ...
>
> Perhaps an optional argument "compute" which computes and then caches
> or returns the actual isomorphism.

+1

That's explicit and clear.

William

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



[sage-devel] Re: notebook/inotebook password

2008-01-16 Thread William Stein

On Jan 16, 2008 9:18 AM, Robert Bradshaw <[EMAIL PROTECTED]> wrote:
>
> In the next release of Sage it won't be necessary to provide a
> password at all on startup, so we don't need to set one. Having a

He's talking about the step the very first time one runs the notebook,
where it prompts for a password (at the text prompt).  Your fix
I don't think addresses that.  It's in notebook.setup().

Sage doesn't support what he wants yet.  We can add something
though as soon as somebody suggests a sensible design.

> default "common" password would be a security risk (as is running
> inotebook, potentially).

On a multiuser system using inotebook is stupid.  Any other user
on the system can trivially login to your notebook server and delete
or change any of your files, etc.   I use inotebook all the time ON MY
LAPTOP, but would never use it on a multiuser system.

> Another question is about certificates--for which info is asked the
> first time Sage is started up. This could be automated too.

Yep.

>
> On Jan 16, 2008, at 5:59 AM, gri6507 wrote:
>
> > Hello,
> >
> > First, to set the context for this thread. I am wrapping up the
> > packaging of SAGE in RPM form. One of the things that I am trying to
> > do now is to create a simple menu entry (shortcut) so that users can
> > easily and conveniently start sage's notebook.
> >
> > My goal is to have the menu entry be a basic shell script like
> >
> > #!/bin/sh
> > /usr/bin/sage -inotebook &
> > sleep 4
> > www-browser localhost:8000
> >
> > However, it seems that to do so, regardless of whether the requested
> > notebook is secure or not, the user is asked for a password (Admin
> > password in the case of the inotebook). And since my shell script
> > needs to be backgrounded, the user cannot input the Admin password
> > (unless, they know how to foreground and background processes, which I
> > can't assume they do).
> >
> > At the same time, it seems like starting inotebook only asks for the
> > Admin password once and, once its set, it does not need to be set
> > again. So, at least in theory, I should be able to set the Admin
> > password during the RPM installation. Which brings me to my question.
> > Is there a way to programatically input the Admin password from the
> > command line (something like sage -c password=blahblah)? If not, then
> > I have to jump through some hoops to be able to set the password
> > initially.
> >
>
> >
>



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

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



[sage-devel] Re: Making a mayavi2.spkg (SAGE package)

2008-01-16 Thread Carl Witty

On Jan 16, 9:11 am, Jaap Spies <[EMAIL PROTECTED]> wrote:
> legout wrote:
> > Whats the deps  for the exerimental mayavi-spkg?
>
> > setuptools?
> > vtk?
> > ...?
>
> > thanks so far!
>
> Have a look at:
>
> http://sage.math.washington.edu/home/jsp/SPKGS/MayaVi2/
>
> Especially the README.txt for the ets spkg. For the mayavi2 package
> you don't need swig and PIL.
>
>  > wxPython +
>  > setuptools +
>  > vtk +
>  > swig -
>  > pyrex +
>  > PIL -
>
> Jaap

Actually, I think I managed to install mayavi2 without installing
pyrex.

Now that I've installed it, what can I do?  (At least, what are some
tests I can run to see if it actually works?)

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



[sage-devel] implicit differentiation and implicit plotting

2008-01-16 Thread David Joyner

Hi:

I don't remember this topic coming up before but at some point
it must be faced since it arises in Calculus 1. AFAIK, SAGE has no routines for
(1) computing the "implicit derivative" y' if y is defined implicitly
by F(x,y)=0,
(2) plotting (x,y) subject to F(x,y)=0.

(1): This is easy for SAGE to compute: y' = - F_x(x,y)/F_y(x,y).
The problem is that it just isn't implemented yet to my knowledge.
How should this be implemented? implicit_derivative(F(x,y),x) or something??
Suggestions?

(2) In the 2d case, it might be possible to tweek matplotlib's
contourplot. It might also be possible to plot the solution to
the 1st order DE y' = - F_x(x,y)/F_y(x,y). Suggestions?

- David Joyner

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



[sage-devel] Re: Integer points on Conics

2008-01-16 Thread D. Benjamin Antieau
John,

Do you have a reference for p-adic Elkies? I would be interested in looking
at that, and possibly implementing it in as much generality as possible in
sage.

Ben

On Jan 16, 2008 3:15 AM, John Cremona <[EMAIL PROTECTED]> wrote:

>
> I assumed that Enrique wanted *all* integral points (in some sense
> when there are infinitely many).
>
> For listing rational (or integral) points up to some height bound
> there are methods which are vastly more efficient than the one being
> proposed here, which does not even use a quadratic sieve.  Optimal
> (for any kind of variety, not just curves, not just plane curves, not
> just conics) are the p-adic lattice reduction methods (sometimes known
> as "p-adic Elkies" by analogy with the real -- as opposed to p-adic--
> version first proposed by Elkies around 2000.
>
> Implementing this in Sage should be put onto our
> useful-projects-for-students list.
>
> John
>
> On 16/01/2008, D. Benjamin Antieau <[EMAIL PROTECTED]> wrote:
> > Enrique,
> >
> > This can easily be done at the moment, assuming that you want to count
> > integral points up to a certain height N. If you are looking for all of
> the
> > points of something you know has only finitely many, I am not so sure.
> >
> > I hope the following ramble helps.
> >
> > sage: A,B,C,D,E,F=[1,0,0,0,0,-1] # integers
> > sage: R.=PolynomialRing(ZZ,2)
> >  sage: f=A*x^2+B*x*y+C*y^2+D*x+E*y+F # C:f=0
> > sage: X=AffineSpace(ZZ,2)
> >  sage: Y=X.subscheme(f)
> > sage: bound=100
> >  sage: points=Y.rational_points(ZZ,bound)
> > sage: len(points)
> >  402
> >
> > This uses sage's internal method. However, depending on what you need it
> > for, the following might work better.
> >
> >
> > The function lazy_rational_points() simply goes through all possible
> values
> > a of x, and factors f(a,y) to get the points. Then,
> > it does the same for the bounded values of y. Note that while this
> > guarantees enumeration of all of the points of bounded height,
> >
> > there may be points of greater height in the return.
> >
> > sage: def lazy_rational_points(f,bound):
> > ... r'''
> > ... Given a polynomial in two variables over ZZ, returns all points
> > ... of bound less <= bound, and the possibly some more points.
> >
> > ... '''
> > ... points=[]
> > ... for a in [(-bound)..(bound)]:
> > ...
> > xroots=R(f(a,y)).univariate_polynomial().roots(multiplicities=False)
> > ... for b in xroots:
> > ... if
> > points.count([a,b]) < 1:
> > ... points.append([a,b])
> > ...
> > yroots=R(f(x,a)).univariate_polynomial().roots(multiplicities=False)
> > ... for c in yroots:
> > ... if points.count
> > ([c,a]) < 1:
> > ... points.append([c,a])
> > ... return points
> >
> > The new version is quite fast, comparatively.
> > sage: f
> > x^2 - 1
> >
> >
> > sage: %time
> > sage: c=lazy_rational_points(f,200)
> > sage: len(c)
> > 802
> > CPU time: 0.59 s, Wall time: 0.62 s
> >
> > sage: %time
> > sage: bound=200
> > sage: points=Y.rational_points(ZZ,bound)
> > sage: len(points)
> >
> > 802
> > CPU time: 42.85 s, Wall time: 51.11 s
> >
> > Even up to a thousand, quite quickly. I didn't feel like seeing about
> the
> > old version.
> >
> > sage: %time
> > sage: c=lazy_rational_points(f,1000)
> > sage: len(c)
> >
> > 4002
> > CPU time: 5.78 s, Wall time: 7.26 s
> >
> > Now, for some random tests.
> >
> > sage: A,B,C,D,E,F=[randint(-1000,1000) for i in range(6)]
> > sage: R.=PolynomialRing(ZZ,2)
> >
> > sage: f=A*x^2+B*x*y+C*y^2+D*x+E*y+F # C:f=0
> > sage: X=AffineSpace(ZZ,2)
> > sage: Y=X.subscheme(f)
> > sage: bound=100
> >
> > sage: %time
> > sage: points=Y.rational_points(ZZ,bound)
> > sage: print f
> > sage: print len(points)
> >
> > 190*x^2 - 561*x*y - 507*y^2 - 502*x + 133*y + 21
> > 0
> > CPU time: 21.26 s, Wall time: 27.55 s
> > sage: %time
> >
> > sage: points1=lazy_rational_points(f,bound)
> > sage: print f
> > sage: len(points)
> > 190*x^2 - 561*x*y - 507*y^2 - 502*x + 133*y + 21
> >
> > 0
> > CPU time: 0.68 s, Wall time: 0.72 s
> >
> > Now, a hundred times.
> >
> > sage: %time
> > sage: bound=10
> > sage: for i in [1..100]:
> > ... A,B,C,D,E,F=[randint(-1000,1000) for j in range(6)]
> > ... R.=PolynomialRing(ZZ,2)
> >
> > ... f=A*x^2+B*x*y+C*y^2+D*x+E*y+F
> > ... points=Y.rational_points(ZZ,bound)
> > CPU time: 23.41 s, Wall time: 30.17 s
> >
> > sage: %time
> > sage: bound=10
> > sage: for i in [1..100]:
> > ... A,B,C,D,E,F=[randint(-1000,1000) for j in range(6)]
> >
> > ... R.=PolynomialRing(ZZ,2)
> > ... f=A*x^2+B*x*y+C*y^2+D*x+E*y+F
> > ... points=lazy_rational_points(f,bound)
> > CPU time: 7.23 s, Wall time: 8.86 s
> >
> >
> > Finally, here is a version that is not lazy: it checks and only returns
> > points with the correct bound.
> > sage: def new_rational_points(f,bound):
> > ... r'''
> > ... Given a polynomial in two variables over ZZ, returns all points
> > ... of bound less <= bound, and the possibly some more points.
> >
> > ... '''
> > ... points=[]
> > ... for a in [(-bound)..(bound)]:
> > ...
> > xroots=R(f(a,y)).univariat

[sage-devel] Re: Numerical noise in MPFR/MPFI?

2008-01-16 Thread Robert Bradshaw

On Jan 16, 2008, at 9:25 AM, Carl Witty wrote:

> On Jan 15, 9:23 pm, Robert Bradshaw <[EMAIL PROTECTED]>
> wrote:
>> I was under the impression that MPFR was supposed to give identical
>> answers across all platforms (unlike, say, RDF). I was wondering if
>> any experts in the area could explain the numerical noise in cases  
>> like
>>
>> http://sagetrac.org/sage_trac/ticket/1790
>>
>> Is this something to be worried about, or are MPFR results not truly
>> platform independent?
>
> Computations done only with MPFR/MPFI should definitely be platform
> independent.  However, p.roots(ring=CIF) is done by first finding the
> roots numerically (using either numpy or Pari, depending on the
> precision), and then verifying/refining the roots using MPFI.  The
> initial numpy or Pari roots may differ across platforms, so the MPFI
> refinement may also give different results.  (I believe that the
> results are always correct, though, in that the returned intervals do
> always include the real root.)
>
> I don't know how to make the results platform-independent without
> writing a lot of code (and possibly slowing down root-finding
> significantly).

Ah... This completely answers my question. Thanks.

- Robert


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



[sage-devel] Re: Multiple return values

2008-01-16 Thread Robert Bradshaw

There is no way in python to detect how many arguments a function  
result will be assigned to, and I'm not a fan of magma's way of doing  
it. WIth variable length tuples one has to check the length of a  
tuple before unpacking it.

There is a function E1.isomorphism_to(E2) that actually computes the  
isomorphism. I think is_isomorphism should just return True or False  
(is_* has that convention). Then one can do such things as

if E.is_isomporhic(F):
 ...

Perhaps an optional argument "compute" which computes and then caches  
or returns the actual isomorphism.

- Robert


On Jan 16, 2008, at 6:03 AM, John Cremona wrote:

> What a coincidence -- the patch I am working on *will* (have the
> capability to) return both a boolean and an isomorphism for
> is_isomorphic() on elliptic curves.  I was wondering how to do that
> and assumed that it would be a tuple.  Rather than make the tuple's
> length (1 or 2) depend on the input I would always return a tuple of
> length 2 but the second item would be None iff the first has false.
> Isn't that a reasonable way of doing it?
>
> I don't like requiring the trapping of errors, though I realise that
> it is very Pythonesque to do so.  But if we allow the input line
> sage: phi = E1.isomorphism(E2)
>
> then we *must* raise an error when the things are not isomorphic,  
> just as
> sage: QQ(2).nth_root(2)
> raises as ValueError (though sqrt(2) does not as it creates a  
> symbolic sqrt(2)).
>
> This is going beyond the original thread, I know.
>
> On 16/01/2008, David Kohel <[EMAIL PROTECTED]> wrote:
>>
>> There was a thread on multiple return values coming from Magma,
>> since renamed to "Integer points on conics"
>>
>> William pointed out that one can access the multiple return values
>> using nvals:
>>
>>  x = magma.XGCD(15, 10)
>>  x,y,z = magma.XGCD(15, 10, nvals = 3)
>>
>> The first returns an integer, while the second returns a tuple.
>>
>> Q1: Is this an acceptable general construction for Python and/or  
>> SAGE,
>> namely to return a different type depending on the values passed into
>> it?  Is it acceptable when it is controlled by nvals in exactly this
>> way?
>>
>> As William pointed out, very different algorithms can be called
>> depending on the
>> number of arguments requested in Magma.  The following is an example:
>>
>> sage: E = magma.EllipticCurve([1,3])
>> sage: magma.IsIsomorphic(E,E)
>> true
>> sage: bool, phi = magma.IsIsomorphic(E,E,nvals=2)
>> sage: phi
>> Elliptic curve isomorphism from: Elliptic Curve defined by y^2 =  
>> x^3 +
>> x + 3 over Rational Field to Elliptic Curve defined by y^2 = x^3 +  
>> x +
>> 3 over Rational Field
>> Taking (x : y : 1) to (x : y : 1)
>>
>> Currently in SAGE we have:
>>
>> sage: E = EllipticCurve([1,3])
>> sage: E.is_isomorphic(E)
>> True
>>
>> Q2: Would the following be acceptable way of implementing equivalent
>> functionality in SAGE?:
>>
>> sage: bool, phi = E.is_isomorphic(E, nvals=2)
>>
>> Note that often (in many concexts) it more expensive to return an
>> isomorphism, but only slightly more so compared with recomputing the
>> isomorphism test.  If the answer to my question is "no, it not
>> acceptable SAGE/Python syntax", then how should we implement this
>> functionality?  One possibility is:
>>
>> sage: phi = E1.isomorphism(E2)
>>
>> and to trap an error if is_isomorphic returns false.  Is this a
>> better?
>>
>>>
>>
>
>
> -- 
> John Cremona
>
> 

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



[sage-devel] Re: Numerical noise in MPFR/MPFI?

2008-01-16 Thread Carl Witty

On Jan 15, 9:23 pm, Robert Bradshaw <[EMAIL PROTECTED]>
wrote:
> I was under the impression that MPFR was supposed to give identical
> answers across all platforms (unlike, say, RDF). I was wondering if
> any experts in the area could explain the numerical noise in cases like
>
> http://sagetrac.org/sage_trac/ticket/1790
>
> Is this something to be worried about, or are MPFR results not truly
> platform independent?

Computations done only with MPFR/MPFI should definitely be platform
independent.  However, p.roots(ring=CIF) is done by first finding the
roots numerically (using either numpy or Pari, depending on the
precision), and then verifying/refining the roots using MPFI.  The
initial numpy or Pari roots may differ across platforms, so the MPFI
refinement may also give different results.  (I believe that the
results are always correct, though, in that the returned intervals do
always include the real root.)

I don't know how to make the results platform-independent without
writing a lot of code (and possibly slowing down root-finding
significantly).

Carl

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



[sage-devel] Re: notebook/inotebook password

2008-01-16 Thread Robert Bradshaw

In the next release of Sage it won't be necessary to provide a  
password at all on startup, so we don't need to set one. Having a  
default "common" password would be a security risk (as is running  
inotebook, potentially).

Another question is about certificates--for which info is asked the  
first time Sage is started up. This could be automated too.

- Robert


On Jan 16, 2008, at 5:59 AM, gri6507 wrote:

> Hello,
>
> First, to set the context for this thread. I am wrapping up the
> packaging of SAGE in RPM form. One of the things that I am trying to
> do now is to create a simple menu entry (shortcut) so that users can
> easily and conveniently start sage's notebook.
>
> My goal is to have the menu entry be a basic shell script like
>
> #!/bin/sh
> /usr/bin/sage -inotebook &
> sleep 4
> www-browser localhost:8000
>
> However, it seems that to do so, regardless of whether the requested
> notebook is secure or not, the user is asked for a password (Admin
> password in the case of the inotebook). And since my shell script
> needs to be backgrounded, the user cannot input the Admin password
> (unless, they know how to foreground and background processes, which I
> can't assume they do).
>
> At the same time, it seems like starting inotebook only asks for the
> Admin password once and, once its set, it does not need to be set
> again. So, at least in theory, I should be able to set the Admin
> password during the RPM installation. Which brings me to my question.
> Is there a way to programatically input the Admin password from the
> command line (something like sage -c password=blahblah)? If not, then
> I have to jump through some hoops to be able to set the password
> initially.
> 

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



[sage-devel] Re: Making a mayavi2.spkg (SAGE package)

2008-01-16 Thread Jaap Spies

legout wrote:
> Whats the deps  for the exerimental mayavi-spkg?
> 
> setuptools?
> vtk?
> ...?
> 
> thanks so far!

Have a look at:

http://sage.math.washington.edu/home/jsp/SPKGS/MayaVi2/

Especially the README.txt for the ets spkg. For the mayavi2 package
you don't need swig and PIL.

 > wxPython +
 > setuptools +
 > vtk +
 > swig -
 > pyrex +
 > PIL -

Jaap


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



[sage-devel] Re: Making a mayavi2.spkg (SAGE package)

2008-01-16 Thread legout

I can't build the mayavi. This is what i've did:

sage -i mayavi-linux_2.0.20080106.spkg

It start compiling, but it breaks some time later. This is the error:

==
Building directory: enthought.util_2.0.1b2

Executing: /opt/sage/local/bin/python setup.py release build bdist_egg
-d /opt/sage/spkg/build/mayavi-linux_2.0.20080106/mayavi_build/dist

==
Building directory: ets_2.6.0b1

Executing: /opt/sage/local/bin/python setup.py release build bdist_egg
-d /opt/sage/spkg/build/mayavi-linux_2.0.20080106/mayavi_build/dist

WARNING: Could not build egg.info files: No module named enstaller.egg
Processing enthought.mayavi_2.0.2a1
Running setup.py -q bdist_egg --dist-dir /opt/sage/spkg/build/mayavi-
linux_2.0.20080106/mayavi_build/enthought.mayavi_2.0.2a1/egg-dist-tmp-
qHx2Jr
enthought.mayavi 2.0.2a1.dev-r15239 is already the active version in
easy-install.pth
Installing mayavi2 script to /opt/sage/local/bin

Installed /opt/sage/local/lib/python2.5/site-packages/
enthought.mayavi-2.0.2a1.dev_r15239-py2.5.egg
Processing dependencies for enthought.mayavi==2.0.2a1.dev-r15239
Searching for enthought.tvtk[plugin,wx]>=2.0.0b2.dev,<3.0a

Link to http://code.enthought.com/enstaller/eggs/source ***BLOCKED***
by --allow-hosts


Link to http://pypi.python.org/simple/enthought.tvtk/ ***BLOCKED*** by
--allow-hosts

Couldn't find index page for 'enthought.tvtk' (maybe misspelled?)
Scanning index of all packages (this may take a while)

Link to http://pypi.python.org/simple/ ***BLOCKED*** by --allow-hosts

No local packages or download links found for
enthought.tvtk[plugin,wx]>=2.0.0b2.dev,<3.0a
error: Could not find suitable distribution for
Requirement.parse('enthought.tvtk[plugin,wx]>=2.0.0b2.dev,<3.0a')

Any ideas?

Thanks
legout

On Jan 16, 5:49 pm, legout <[EMAIL PROTECTED]> wrote:
> Whats the deps  for the exerimentalmayavi-spkg?
>
> setuptools?
> vtk?
> ...?
>
> thanks so far!
>
> legout
>
> On Jan 7, 1:40 am, Jaap Spies <[EMAIL PROTECTED]> wrote:
>
> > Jaap Spies wrote:
>
> > > It works for me now in sage-2.9.2
>
> > --
> > | SAGE Version 2.9.2, Release Date: 2008-01-05   |
> > | Type notebook() for the GUI, and license() for information.|
> > --
>
> > sage: import IPython
>
> > sage: IPython.Shell.IPShellWX().mainloop()
>
> > sage: from enthought.mayavi.tools import mlab as M
> > Set Envisage to use the workbench UI: True
> > Set Envisage to use the workbench UI: True
>
> > sage: M.[tab]
> > M.axes   M.__file__   M.outline
> > M.__str__M.test_points3d
> > M.__class__  M.flow   M.plot3d 
> > M.surf   M.test_quiver3d
> > M.clfM.gcfM.points3d   
> > M.test_contour3d M.test_quiver3d_2d_data
> > M.colorbar   M.__getattribute__   M.quiver3d   
> > M.test_contour_surf  M.test_simple_surf
> > M.contour3d  M.get_mayavi M.__reduce__ 
> > M.test_fancy_meshM.test_surf
> > M.contour_surf   M.__hash__   M.__reduce_ex__  
> > M.test_flow  M.title
> > M.__delattr__M.imshow M.__repr__   
> > M.test_imshowM.vectorbar
> > M.__dict__   M.__init__   M.roll   
> > M.test_mesh  M.view
> > M.__doc__M.mesh   M.savefig
> > M.test_mesh_sphere   M.xlabel
> > M.draw   M.__name__   M.scalarbar  
> > M.test_molecule  M.ylabel
> > M.figure M.__new__M.__setattr__
> > M.test_plot3dM.zlabel
>
> > sage: M.test_s
> > M.test_simple_surf  M.test_surf
>
> > sage: M.test_surf()
>
> > (sage.bin:15407): Gtk-CRITICAL **: gtk_widget_set_colormap: assertion 
> > `!GTK_WIDGET_REALIZED (widget)' failed
> > Warning: invalid value encountered in divide
> >
>
> > Works ok for me now!
>
> > Cheers,
>
> > Jaap
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Sage 2.10.alpha3 released

2008-01-16 Thread Kate

Michael,

This fixes the issue.  Thanks!

Kate

On Jan 16, 11:22 am, mabshoff <[EMAIL PROTECTED]
dortmund.de> wrote:
> On Jan 16, 5:08 pm, Kate <[EMAIL PROTECTED]> wrote:
>
> > Michael,
>
> Hi Kate,
>
> > The patch for #1790 is ok,  but after applying the patch for #1791
> > I now get
>
> I see that I missed one single digit being different. Please try
>
> http://trac.sagemath.org/sage_trac/attachment/ticket/1790/Sage-2.10.a...
>
> which should fix the issue hopefully for good.
>
>
>
> > ./sage -t devel/sage-main/sage/rings/polynomial/polynomial_element.pyx
> > sage -t  devel/sage-main/sage/rings/polynomial/
> > polynomial_element.pyx**
> > File "polynomial_element.pyx", line 2644:
> > sage: p.roots(ring=ComplexIntervalField(200))
> > Expected:
>
> 
> > --
>
> > Kate
>
> Cheers,
>
> Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Doc Day 1 announcement: January 17th, 2008, 9am-5pm PST

2008-01-16 Thread Martin Albrecht

On Wednesday 16 January 2008, mabshoff wrote:
> Hello folks,
>
> after doing 8 Bug Days the time has come to spend some more time on
> the documentation, which also needs a lot of work. So after some
> discussion in IRC we decided to get together in IRC at the above date
> and time and work on the documentation. Since we have never done a doc
> day it isn't 100% clear to me how the whole thing will go down, but I
> assume we will just go with the flow.
>
> Thoughts? Suggestions?

Suggestion: each participant goes through a file of his/her own choice and 
makes sure it has 100% doctest coverage. Reading the source of the possibly 
unfamiliar file is also encouraged.

Martin


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


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



[sage-devel] Doc Day 1 announcement: January 17th, 2008, 9am-5pm PST

2008-01-16 Thread mabshoff

Hello folks,

after doing 8 Bug Days the time has come to spend some more time on
the documentation, which also needs a lot of work. So after some
discussion in IRC we decided to get together in IRC at the above date
and time and work on the documentation. Since we have never done a doc
day it isn't 100% clear to me how the whole thing will go down, but I
assume we will just go with the flow.

Thoughts? Suggestions?

Cheers,

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



[sage-devel] Re: Making a mayavi2.spkg (SAGE package)

2008-01-16 Thread legout

Whats the deps  for the exerimental mayavi-spkg?

setuptools?
vtk?
...?

thanks so far!

legout

On Jan 7, 1:40 am, Jaap Spies <[EMAIL PROTECTED]> wrote:
> Jaap Spies wrote:
>
> > It works for me now in sage-2.9.2
>
> --
> | SAGE Version 2.9.2, Release Date: 2008-01-05   |
> | Type notebook() for the GUI, and license() for information.|
> --
>
> sage: import IPython
>
> sage: IPython.Shell.IPShellWX().mainloop()
>
> sage: from enthought.mayavi.tools import mlab as M
> Set Envisage to use the workbench UI: True
> Set Envisage to use the workbench UI: True
>
> sage: M.[tab]
> M.axes   M.__file__   M.outline
> M.__str__M.test_points3d
> M.__class__  M.flow   M.plot3d 
> M.surf   M.test_quiver3d
> M.clfM.gcfM.points3d   
> M.test_contour3d M.test_quiver3d_2d_data
> M.colorbar   M.__getattribute__   M.quiver3d   
> M.test_contour_surf  M.test_simple_surf
> M.contour3d  M.get_mayavi M.__reduce__ 
> M.test_fancy_meshM.test_surf
> M.contour_surf   M.__hash__   M.__reduce_ex__  
> M.test_flow  M.title
> M.__delattr__M.imshow M.__repr__   
> M.test_imshowM.vectorbar
> M.__dict__   M.__init__   M.roll   
> M.test_mesh  M.view
> M.__doc__M.mesh   M.savefig
> M.test_mesh_sphere   M.xlabel
> M.draw   M.__name__   M.scalarbar  
> M.test_molecule  M.ylabel
> M.figure M.__new__M.__setattr__
> M.test_plot3dM.zlabel
>
> sage: M.test_s
> M.test_simple_surf  M.test_surf
>
> sage: M.test_surf()
>
> (sage.bin:15407): Gtk-CRITICAL **: gtk_widget_set_colormap: assertion 
> `!GTK_WIDGET_REALIZED (widget)' failed
> Warning: invalid value encountered in divide
>
>
> Works ok for me now!
>
> Cheers,
>
> Jaap
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: experimental spkg for wxPython

2008-01-16 Thread mhampton

I tried to use this on an intel mac, and it seemed to build OK but I
can't launch it without having pythonw, which doesn't seem to get made
in sage.  I have another python install with its own pythonw, but then
I guess I'd have to specify the path to wxpython.  Is there a way to
build pythonw within the sage install?

-Marshall

On Dec 6 2007, 5:13 am, Joshua Kantor <[EMAIL PROTECTED]> wrote:
> Actually, don't use the spkg-install I posted. It seems to work but
> near the end of the compile there are some weird missing symbols
> problems on OSX.
> I need to play around a bit more, I'll post again when I have it
> actually working on OSX.
>
> Josh
>
> On Dec 6, 2:53 am, Joshua Kantor <[EMAIL PROTECTED]> wrote:
>
> > Wow, this pacakge is HUGE. I didn't realize it was this large. I hope
> > by cutting out extraneous stuff (docs, examples) we can make this much
> > smaller.
>
> > Marshall: if you (or anyone) want to build this on a mac
>
> > use this spkg-install
>
> >http://sage.math.washington.edu/home/jkantor/spkgs/spkg-install.wxpython
>
> > Replace the one in the spkg with this one and it will work on OSX.
>
> > If you don't know how to do that, let me know.
>
> > On Dec 5, 5:37 pm, mhampton <[EMAIL PROTECTED]> wrote:
>
> > > Any chance of getting that to work on OS X?  Or more details on what
> > > needs to be done?  I've been using wxPython quite a bit lately and it
> > > would be nice to have it integrated into sage.  I don't see how it
> > > could be used from the notebook easily but it might be complementary -
> > > an easy way to make standalone sage applets for example...
>
> > > -Marshall Hampton
>
> > > On Dec 5, 6:20 pm, Jaap Spies <[EMAIL PROTECTED]> wrote:
>
> > > > Jaap Spies wrote:
> > > > > Hi,
>
> > > > > I made an experimental wxPython-2.8.7.1.spkg.
>
> > > > > It works for me on Fedora 7 and 8.
>
> > > > On this I could build an experimental spkg for the Enthought Tool Suite
>
> > > > I have a working mayavi2 in sage-2.8.14!
>
> > > > Tomorrow I'll post a link.
>
> > > > Jaap
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: experimental spkg for wxPython

2008-01-16 Thread legout

It works now.

I've installed libgl1-mesa-dev and libglu1-mesa-dev.

Thanks



On Jan 16, 5:19 pm, legout <[EMAIL PROTECTED]> wrote:
> Running ubuntu 7.10
>
> legout
>
> On Jan 16, 3:55 pm, Jaap Spies <[EMAIL PROTECTED]> wrote:
>
> > legout wrote:
> > > I can't buildwxpython. It complains about missing opengl-headers.
> > > Is there a workaround? Am i missing something?
>
> > Which OS do you use?
>
> > Dependencies include:
>
> > glib and gtk+
> > OpenGL or the Mesa3D library
>
> > If you have mesa-libGL installed, be sure also to have mesa-libGL-devel.
>
> > Jaap
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Sage demo code

2008-01-16 Thread William Stein

On Jan 16, 2008 7:09 AM, Iftikhar Burhanuddin <[EMAIL PROTECTED]> wrote:
>
> Hi folks,
>
> I'll be giving a talk at Caltech's number theory seminar
>
> http://www.its.caltech.edu/~wambach/ntseminar.html
>
> tomorrow afternoon and I plan to do a short pitch on Sage.
>
> Can someone point me to Sage demo code which showcases Sage functionality
> via the notebook with regards to number theory (Elliptic Curves),
> combinatorics (graphs), cool plotting and graphics?
>

Check out my talk from Bristol:
http://wiki.sagemath.org/days6/talks
It's at the very bottom of the above wiki page.
Note that I didn't post it until just *now*.

William

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



[sage-devel] Re: Sage 2.10.alpha3 released

2008-01-16 Thread mabshoff



On Jan 16, 5:08 pm, Kate <[EMAIL PROTECTED]> wrote:
> Michael,

Hi Kate,

> The patch for #1790 is ok,  but after applying the patch for #1791
> I now get

I see that I missed one single digit being different. Please try

http://trac.sagemath.org/sage_trac/attachment/ticket/1790/Sage-2.10.alpha3-%231790-leftovers.patch

which should fix the issue hopefully for good.

> ./sage -t devel/sage-main/sage/rings/polynomial/polynomial_element.pyx
> sage -t  devel/sage-main/sage/rings/polynomial/
> polynomial_element.pyx**
> File "polynomial_element.pyx", line 2644:
> sage: p.roots(ring=ComplexIntervalField(200))
> Expected:
>

> --
>
> Kate

Cheers,

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



[sage-devel] Re: experimental spkg for wxPython

2008-01-16 Thread legout

Running ubuntu 7.10

legout

On Jan 16, 3:55 pm, Jaap Spies <[EMAIL PROTECTED]> wrote:
> legout wrote:
> > I can't build wxpython. It complains about missing opengl-headers.
> > Is there a workaround? Am i missing something?
>
> Which OS do you use?
>
> Dependencies include:
>
> glib and gtk+
> OpenGL or the Mesa3D library
>
> If you have mesa-libGL installed, be sure also to have mesa-libGL-devel.
>
> Jaap
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Fwd: Macaulay 2 Conference

2008-01-16 Thread William Stein

Hi,

There will be a Macaulay2 conference (like a Sage Days but for
Macaulay2) March 16--19.  See below.

I can't go because of the Arizona Winter School.  But I really
hope somebody involved in Sage is able to go.

 -- William

-- Forwarded message --
From: Michael Stillman <[EMAIL PROTECTED]>
Date: Jan 16, 2008 8:11 AM
Subject: Re: Macaulay 2 Conference
To: William Stein <[EMAIL PROTECTED]>


Dear William,

I'm sorry that you can't make it to our Macaulay 2 meeting.  We will
miss you!

If you know of other people who might be interested, please have them
email me and visit our conference webpage:

http://www.math.cornell.edu/~mike/m2conference2008.html

Best regards,

Mike

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



[sage-devel] Re: Sage 2.10.alpha3 released

2008-01-16 Thread Kate

Michael,

The patch for #1790 is ok,  but after applying the patch for #1791
I now get

./sage -t devel/sage-main/sage/rings/polynomial/polynomial_element.pyx
sage -t  devel/sage-main/sage/rings/polynomial/
polynomial_element.pyx**
File "polynomial_element.pyx", line 2644:
sage: p.roots(ring=ComplexIntervalField(200))
Expected:
 
[([1.1673039782614186842560458998548421807205603715254890391400816 ..
1.1673039782614186842560458998548421807205603715254890391400829], 1),
([0.1812326987538390180023778112063996871646618462304743773153 ..
0.1812326987538390180023778112063996871646618462304743773341] +
[1.0839541013177106684303444929807665742736402431551156543011306 ..
1.0839541013177106684303444929807665742736402431551156543011344]*I,
1),
([0.1812326987538390180023778112063996871646618462304743773153 ..
0.1812326987538390180023778112063996871646618462304743773341] -
[1.0839541013177106684303444929807665742736402431551156543011306 ..
1.0839541013177106684303444929807665742736402431551156543011344]*I,
1),
([-0.76488443360058472602982318770854173032899665194736756700777... ..
-0.76488443360058472602982318770854173032899665194736756700777...] +
[0.35247154603172624931794709140258105439420648082424733283769... ..
0.35247154603172624931794709140258105439420648082424733283769...]*I,
1),
([-0.76488443360058472602982318770854173032899665194736756700777454 ..
-0.764884433600584726029823187708541730328996651947367567007772...] -
[0.35247154603172624931794709140258105439420648082424733283769... ..
0.3524715460317262493179470914025810543942064808242473328376934...]*I,
1)]
Got:
 
[([1.1673039782614186842560458998548421807205603715254890391400816 ..
1.1673039782614186842560458998548421807205603715254890391400829], 1),
([0.1812326987538390180023778112063996871646618462304743773153 ..
0.1812326987538390180023778112063996871646618462304743773341] +
[1.0839541013177106684303444929807665742736402431551156543011306 ..
1.0839541013177106684303444929807665742736402431551156543011344]*I,
1),
([0.1812326987538390180023778112063996871646618462304743773153 ..
0.1812326987538390180023778112063996871646618462304743773341] -
[1.0839541013177106684303444929807665742736402431551156543011306 ..
1.0839541013177106684303444929807665742736402431551156543011344]*I,
1),
([-0.76488443360058472602982318770854173032899665194736756700777516 ..
-0.76488443360058472602982318770854173032899665194736756700777204] +
[0.35247154603172624931794709140258105439420648082424733283769091 ..
0.35247154603172624931794709140258105439420648082424733283769372]*I,
1),
([-0.76488443360058472602982318770854173032899665194736756700777454 ..
-0.76488443360058472602982318770854173032899665194736756700777204] -
[0.35247154603172624931794709140258105439420648082424733283769091 ..
0.35247154603172624931794709140258105439420648082424733283769372]*I,
1)]
**
1 items had failures:
   1 of 109 in __main__.example_58
***Test Failed*** 1 failures.
For whitespace errors, see the file .doctest_polynomial_element.pyx
 [6.6 s]
exit code: 256

--

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



[sage-devel] Fwd: SAGE testing?

2008-01-16 Thread William Stein

-- Forwarded message --
From: Werner Krandick <[EMAIL PROTECTED]>
Date: Jan 16, 2008 7:43 AM
Subject: SAGE testing?
To: [EMAIL PROTECTED]


Dear William,

I am currently writing on the testing of computer algebra programs and
systems. For this purpose I would like to know how you generate test
inputs for those parts of SAGE that compute mathematical results, that
is, not user interface functions and other functions.

Also in case you have any general hints about how test inputs for
computer algebra programs outside of SAGE are generated I would
appreciate those hints as well.

Thanks and best regards,

Werner



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

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



[sage-devel] Re: Integer points on Conics

2008-01-16 Thread Enrique Gonzalez Jimenez
Hello,

Sorry for my late reply.

At this moment I am teaching Number Theory at the Mathematics degree and 
a ("easy") project for  students is to read  a webpage 
(http://www.alpertron.com.ar/METODOS.HTM - Sorry, it is only in 
spanish)  where it appears an algorithm to compute integer solutions of 
conics. The students must check all the steps and then to implement the 
algorithm in Sage.

Enrique


John Cremona escribió:
> I assumed that Enrique wanted *all* integral points (in some sense
> when there are infinitely many).
>
> For listing rational (or integral) points up to some height bound
> there are methods which are vastly more efficient than the one being
> proposed here, which does not even use a quadratic sieve.  Optimal
> (for any kind of variety, not just curves, not just plane curves, not
> just conics) are the p-adic lattice reduction methods (sometimes known
> as "p-adic Elkies" by analogy with the real -- as opposed to p-adic--
> version first proposed by Elkies around 2000.
>
> Implementing this in Sage should be put onto our
> useful-projects-for-students list.
>
> John
>
> On 16/01/2008, D. Benjamin Antieau <[EMAIL PROTECTED]> wrote:
>   
>> Enrique,
>>
>> This can easily be done at the moment, assuming that you want to count
>> integral points up to a certain height N. If you are looking for all of the
>> points of something you know has only finitely many, I am not so sure.
>>
>> I hope the following ramble helps.
>>
>> sage: A,B,C,D,E,F=[1,0,0,0,0,-1] # integers
>> sage: R.=PolynomialRing(ZZ,2)
>>  sage: f=A*x^2+B*x*y+C*y^2+D*x+E*y+F # C:f=0
>> sage: X=AffineSpace(ZZ,2)
>>  sage: Y=X.subscheme(f)
>> sage: bound=100
>>  sage: points=Y.rational_points(ZZ,bound)
>> sage: len(points)
>>  402
>>
>> This uses sage's internal method. However, depending on what you need it
>> for, the following might work better.
>>
>>
>> The function lazy_rational_points() simply goes through all possible values
>> a of x, and factors f(a,y) to get the points. Then,
>> it does the same for the bounded values of y. Note that while this
>> guarantees enumeration of all of the points of bounded height,
>>
>> there may be points of greater height in the return.
>>
>> sage: def lazy_rational_points(f,bound):
>> ... r'''
>> ... Given a polynomial in two variables over ZZ, returns all points
>> ... of bound less <= bound, and the possibly some more points.
>>
>> ... '''
>> ... points=[]
>> ... for a in [(-bound)..(bound)]:
>> ...
>> xroots=R(f(a,y)).univariate_polynomial().roots(multiplicities=False)
>> ... for b in xroots:
>> ... if
>> points.count([a,b]) < 1:
>> ... points.append([a,b])
>> ...
>> yroots=R(f(x,a)).univariate_polynomial().roots(multiplicities=False)
>> ... for c in yroots:
>> ... if points.count
>> ([c,a]) < 1:
>> ... points.append([c,a])
>> ... return points
>>
>> The new version is quite fast, comparatively.
>> sage: f
>> x^2 - 1
>>
>>
>> sage: %time
>> sage: c=lazy_rational_points(f,200)
>> sage: len(c)
>> 802
>> CPU time: 0.59 s, Wall time: 0.62 s
>>
>> sage: %time
>> sage: bound=200
>> sage: points=Y.rational_points(ZZ,bound)
>> sage: len(points)
>>
>> 802
>> CPU time: 42.85 s, Wall time: 51.11 s
>>
>> Even up to a thousand, quite quickly. I didn't feel like seeing about the
>> old version.
>>
>> sage: %time
>> sage: c=lazy_rational_points(f,1000)
>> sage: len(c)
>>
>> 4002
>> CPU time: 5.78 s, Wall time: 7.26 s
>>
>> Now, for some random tests.
>>
>> sage: A,B,C,D,E,F=[randint(-1000,1000) for i in range(6)]
>> sage: R.=PolynomialRing(ZZ,2)
>>
>> sage: f=A*x^2+B*x*y+C*y^2+D*x+E*y+F # C:f=0
>> sage: X=AffineSpace(ZZ,2)
>> sage: Y=X.subscheme(f)
>> sage: bound=100
>>
>> sage: %time
>> sage: points=Y.rational_points(ZZ,bound)
>> sage: print f
>> sage: print len(points)
>>
>> 190*x^2 - 561*x*y - 507*y^2 - 502*x + 133*y + 21
>> 0
>> CPU time: 21.26 s, Wall time: 27.55 s
>> sage: %time
>>
>> sage: points1=lazy_rational_points(f,bound)
>> sage: print f
>> sage: len(points)
>> 190*x^2 - 561*x*y - 507*y^2 - 502*x + 133*y + 21
>>
>> 0
>> CPU time: 0.68 s, Wall time: 0.72 s
>>
>> Now, a hundred times.
>>
>> sage: %time
>> sage: bound=10
>> sage: for i in [1..100]:
>> ... A,B,C,D,E,F=[randint(-1000,1000) for j in range(6)]
>> ... R.=PolynomialRing(ZZ,2)
>>
>> ... f=A*x^2+B*x*y+C*y^2+D*x+E*y+F
>> ... points=Y.rational_points(ZZ,bound)
>> CPU time: 23.41 s, Wall time: 30.17 s
>>
>> sage: %time
>> sage: bound=10
>> sage: for i in [1..100]:
>> ... A,B,C,D,E,F=[randint(-1000,1000) for j in range(6)]
>>
>> ... R.=PolynomialRing(ZZ,2)
>> ... f=A*x^2+B*x*y+C*y^2+D*x+E*y+F
>> ... points=lazy_rational_points(f,bound)
>> CPU time: 7.23 s, Wall time: 8.86 s
>>
>>
>> Finally, here is a version that is not lazy: it checks and only returns
>> points with the correct bound.
>> sage: def new_rational_points(f,bound):
>> ... r'''
>> ... Given a polynomial in two variables over ZZ, returns all points
>> ... of bound less <= bound, and the possibly some more points.
>>
>> ... '''
>> ... points=[]
>> ... for a in [(-bound)..

[sage-devel] Sage demo code

2008-01-16 Thread Iftikhar Burhanuddin

Hi folks,

I'll be giving a talk at Caltech's number theory seminar 

http://www.its.caltech.edu/~wambach/ntseminar.html

tomorrow afternoon and I plan to do a short pitch on Sage.

Can someone point me to Sage demo code which showcases Sage functionality 
via the notebook with regards to number theory (Elliptic Curves), 
combinatorics (graphs), cool plotting and graphics?

Regards,
Ifti

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



[sage-devel] Re: Packaging SAGE for (re)distribution in RPM form

2008-01-16 Thread David Joyner

On Jan 15, 2008 11:50 PM, mabshoff
<[EMAIL PROTECTED]> wrote:
>
>
>
> On Jan 16, 5:23 am, gri6507 <[EMAIL PROTECTED]> wrote:
> > I've posted several thread on this topic now - mostly with question.
> > But now, with the help of several members in this forum, I finally
> > have my first release of an RPM 
> > (seehttp://www.mypclinuxos.com/forum/index.php?topic=1509.msg13310#msg13310)
> >
>
> One more thing: To quote from the above thread
>
> "On a slightly different note, one [hask/kant] of the preferred
> packages for SAGE seems to be only distributed as precompiled binaries
> despite the fact that it is open source."
>
> kash/kant is closed source as you found out yourself, but I wouldn't
> even go remotely as far as calling it "preferred". It is optional, but
> I think we should go further and add a non-free section to the spkg
> repo, just like Debian, to make it crystal clear that it is not open
> source.

I think this is a good idea too.

>
> Cheers,
>
> Michael
>
>
> >
>

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



[sage-devel] Re: experimental spkg for wxPython

2008-01-16 Thread Jaap Spies

legout wrote:
> I can't build wxpython. It complains about missing opengl-headers.
> Is there a workaround? Am i missing something?
> 

Which OS do you use?

Dependencies include:

glib and gtk+
OpenGL or the Mesa3D library

If you have mesa-libGL installed, be sure also to have mesa-libGL-devel.

Jaap


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



[sage-devel] Re: experimental spkg for wxPython

2008-01-16 Thread legout

I can't build wxpython. It complains about missing opengl-headers.
Is there a workaround? Am i missing something?

Thanks

On Dec 6 2007, 12:13 pm, Joshua Kantor <[EMAIL PROTECTED]> wrote:
> Actually, don't use the spkg-install I posted. It seems to work but
> near the end of the compile there are some weird missing symbols
> problems on OSX.
> I need to play around a bit more, I'll post again when I have it
> actually working on OSX.
>
> Josh
>
> On Dec 6, 2:53 am, Joshua Kantor <[EMAIL PROTECTED]> wrote:
>
> > Wow, this pacakge is HUGE. I didn't realize it was this large. I hope
> > by cutting out extraneous stuff (docs, examples) we can make this much
> > smaller.
>
> > Marshall: if you (or anyone) want to build this on a mac
>
> > use this spkg-install
>
> >http://sage.math.washington.edu/home/jkantor/spkgs/spkg-install.wxpython
>
> > Replace the one in the spkg with this one and it will work on OSX.
>
> > If you don't know how to do that, let me know.
>
> > On Dec 5, 5:37 pm, mhampton <[EMAIL PROTECTED]> wrote:
>
> > > Any chance of getting that to work on OS X?  Or more details on what
> > > needs to be done?  I've been using wxPython quite a bit lately and it
> > > would be nice to have it integrated into sage.  I don't see how it
> > > could be used from the notebook easily but it might be complementary -
> > > an easy way to make standalone sage applets for example...
>
> > > -Marshall Hampton
>
> > > On Dec 5, 6:20 pm, Jaap Spies <[EMAIL PROTECTED]> wrote:
>
> > > > Jaap Spies wrote:
> > > > > Hi,
>
> > > > > I made an experimental wxPython-2.8.7.1.spkg.
>
> > > > > It works for me on Fedora 7 and 8.
>
> > > > On this I could build an experimental spkg for the Enthought Tool Suite
>
> > > > I have a working mayavi2 in sage-2.8.14!
>
> > > > Tomorrow I'll post a link.
>
> > > > Jaap
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Multiple return values

2008-01-16 Thread John Cremona

What a coincidence -- the patch I am working on *will* (have the
capability to) return both a boolean and an isomorphism for
is_isomorphic() on elliptic curves.  I was wondering how to do that
and assumed that it would be a tuple.  Rather than make the tuple's
length (1 or 2) depend on the input I would always return a tuple of
length 2 but the second item would be None iff the first has false.
Isn't that a reasonable way of doing it?

I don't like requiring the trapping of errors, though I realise that
it is very Pythonesque to do so.  But if we allow the input line
sage: phi = E1.isomorphism(E2)

then we *must* raise an error when the things are not isomorphic, just as
sage: QQ(2).nth_root(2)
raises as ValueError (though sqrt(2) does not as it creates a symbolic sqrt(2)).

This is going beyond the original thread, I know.

On 16/01/2008, David Kohel <[EMAIL PROTECTED]> wrote:
>
> There was a thread on multiple return values coming from Magma,
> since renamed to "Integer points on conics"
>
> William pointed out that one can access the multiple return values
> using nvals:
>
>  x = magma.XGCD(15, 10)
>  x,y,z = magma.XGCD(15, 10, nvals = 3)
>
> The first returns an integer, while the second returns a tuple.
>
> Q1: Is this an acceptable general construction for Python and/or SAGE,
> namely to return a different type depending on the values passed into
> it?  Is it acceptable when it is controlled by nvals in exactly this
> way?
>
> As William pointed out, very different algorithms can be called
> depending on the
> number of arguments requested in Magma.  The following is an example:
>
> sage: E = magma.EllipticCurve([1,3])
> sage: magma.IsIsomorphic(E,E)
> true
> sage: bool, phi = magma.IsIsomorphic(E,E,nvals=2)
> sage: phi
> Elliptic curve isomorphism from: Elliptic Curve defined by y^2 = x^3 +
> x + 3 over Rational Field to Elliptic Curve defined by y^2 = x^3 + x +
> 3 over Rational Field
> Taking (x : y : 1) to (x : y : 1)
>
> Currently in SAGE we have:
>
> sage: E = EllipticCurve([1,3])
> sage: E.is_isomorphic(E)
> True
>
> Q2: Would the following be acceptable way of implementing equivalent
> functionality in SAGE?:
>
> sage: bool, phi = E.is_isomorphic(E, nvals=2)
>
> Note that often (in many concexts) it more expensive to return an
> isomorphism, but only slightly more so compared with recomputing the
> isomorphism test.  If the answer to my question is "no, it not
> acceptable SAGE/Python syntax", then how should we implement this
> functionality?  One possibility is:
>
> sage: phi = E1.isomorphism(E2)
>
> and to trap an error if is_isomorphic returns false.  Is this a
> better?
>
> >
>


-- 
John Cremona

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



[sage-devel] notebook/inotebook password

2008-01-16 Thread gri6507

Hello,

First, to set the context for this thread. I am wrapping up the
packaging of SAGE in RPM form. One of the things that I am trying to
do now is to create a simple menu entry (shortcut) so that users can
easily and conveniently start sage's notebook.

My goal is to have the menu entry be a basic shell script like

#!/bin/sh
/usr/bin/sage -inotebook &
sleep 4
www-browser localhost:8000

However, it seems that to do so, regardless of whether the requested
notebook is secure or not, the user is asked for a password (Admin
password in the case of the inotebook). And since my shell script
needs to be backgrounded, the user cannot input the Admin password
(unless, they know how to foreground and background processes, which I
can't assume they do).

At the same time, it seems like starting inotebook only asks for the
Admin password once and, once its set, it does not need to be set
again. So, at least in theory, I should be able to set the Admin
password during the RPM installation. Which brings me to my question.
Is there a way to programatically input the Admin password from the
command line (something like sage -c password=blahblah)? If not, then
I have to jump through some hoops to be able to set the password
initially.
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Packaging SAGE for (re)distribution in RPM form

2008-01-16 Thread gri6507

Thank you for the reply. I redistributed the .hg folders into the
devel package. As for your warning, I completely understand the origin
of the concern. I, along with the rest of the packaging community at
PCLinuxOS, will have to wrestle with this one later.
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~--~~~~--~~--~--~---



[sage-devel] Re: Sollya

2008-01-16 Thread David Joyner

It's license is "explicitly compatible with the GNU GPL":
http://www.gnu.org/philosophy/license-list.html

It's about 1M in size and has English documentation:
http://gforge.inria.fr/frs/?group_id=1015&release_id=1726

It seems to be written entirely in C and is designed for floating point
code development.
http://sollya.gforge.inria.fr/

I wonder if it could be useful for the NIST special function stuff Dan
Lozier was discussing in San Diego at the SAGE booth?


2008/1/16 David Kohel <[EMAIL PROTECTED]>:
>
> Here is another open source CAS, which is being advertised here.
> Someone might want to evaluate it to see how much is being reinvented
> and what is new.
>
> Note that it uses a particular French open source licence designed in
> response to the GPL and which supposedly addressed legal problems with
> the GPL in France.
>
> --David
>
> - Forwarded message from Sylvain Chevillard
> <[EMAIL PROTECTED]>
> -
>
> Date: Tue, 15 Jan 2008 13:01:15
> +0100
> From: Sylvain Chevillard <[EMAIL PROTECTED]
> lyon.fr>
> User-Agent: Icedove 1.5.0.10
> (X11/20070329)
> To: [EMAIL PROTECTED]
> im.fr,
> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]
> lyon.fr>
> Subject: [gdr-im] Sollya
> 1.0
>
> Bonjour,
>
> depuis un an environ, nous développons un logiciel libre appelé
> Sollya :
>
>  http://sollya.gforge.inria.fr
>
> Ce logiciel se présente sous forme d'un shell interactif avec un
> langage
> de script
> étendu.
>
> Actuellement, Sollya se veut un outil général d'aide à la synthèse
> de
> codes numériques mais comporte plusieurs fonctions utiles
> en
> elles-mêmes. Entre autres choses, Sollya permet de calculer
> (en
> précision arbitraire) la norme infinie d'une fonction, d'en calculer
> le
> meilleur approximant polynomial de degré fixé, et il est capable
> de
> produire du code C certifié pour évaluer avec une précision donnée
> un
> tel polynôme
> d'approximation.
>
> À notre connaissance, certaines fonctionnalités de calcul
> numérique
> n'étaient disponibles que dans des logiciels propriétaires de type
> Maple
> ou Matlab. Sollya a vu le jour dans le but de s'affranchir de
> cette
> dépendance ainsi que d'obtenir des résultats plus rapides et
> plus
> précis. Nous invitons ceux d'entre vous qui pourraient avoir des
> besoins
> similaires à essayer Sollya, à nous faire part de leurs remarques
> et
> besoins supplémentaires, ou même à participer au
> développement.
>
>
> Sylvain Chevillard et Christoph
> Lauter
> Équipe Arénaire - ENS
> Lyon
>
> - End forwarded message
> -
>
> >
>

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



[sage-devel] Re: some words from Joachim Neubüser

2008-01-16 Thread Harald Schilly



On Jan 16, 9:38 am, Dan Drake <[EMAIL PROTECTED]> wrote:
>
> For instance, John Stembridge has some nice Maple code for working with
> posets. But if you can't afford Maple, ..

For me, the main point is that you are actually strengthen Maple/
Mathematica/Matlab/..., if you write extensions for them. They pay you
nothing but every freely available script is a reason more to stick to
them. Quite similar to .doc/.xls files in the Office world.

A field where this works "better" is statistics with R, because many
methods get implemented using R and papers describe their methods in R
scripts - and R methods reference papers. This is from my point of
view a much better situation than in maths - and still a long way to
go for sage AND the community of mathematicans.

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



[sage-devel] Sollya

2008-01-16 Thread David Kohel

Here is another open source CAS, which is being advertised here.
Someone might want to evaluate it to see how much is being reinvented
and what is new.

Note that it uses a particular French open source licence designed in
response to the GPL and which supposedly addressed legal problems with
the GPL in France.

--David

- Forwarded message from Sylvain Chevillard
<[EMAIL PROTECTED]>
-

Date: Tue, 15 Jan 2008 13:01:15
+0100
From: Sylvain Chevillard <[EMAIL PROTECTED]
lyon.fr>
User-Agent: Icedove 1.5.0.10
(X11/20070329)
To: [EMAIL PROTECTED]
im.fr,
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]
lyon.fr>
Subject: [gdr-im] Sollya
1.0

Bonjour,

depuis un an environ, nous développons un logiciel libre appelé
Sollya :

 http://sollya.gforge.inria.fr

Ce logiciel se présente sous forme d'un shell interactif avec un
langage
de script
étendu.

Actuellement, Sollya se veut un outil général d'aide à la synthèse
de
codes numériques mais comporte plusieurs fonctions utiles
en
elles-mêmes. Entre autres choses, Sollya permet de calculer
(en
précision arbitraire) la norme infinie d'une fonction, d'en calculer
le
meilleur approximant polynomial de degré fixé, et il est capable
de
produire du code C certifié pour évaluer avec une précision donnée
un
tel polynôme
d'approximation.

À notre connaissance, certaines fonctionnalités de calcul
numérique
n'étaient disponibles que dans des logiciels propriétaires de type
Maple
ou Matlab. Sollya a vu le jour dans le but de s'affranchir de
cette
dépendance ainsi que d'obtenir des résultats plus rapides et
plus
précis. Nous invitons ceux d'entre vous qui pourraient avoir des
besoins
similaires à essayer Sollya, à nous faire part de leurs remarques
et
besoins supplémentaires, ou même à participer au
développement.


Sylvain Chevillard et Christoph
Lauter
Équipe Arénaire - ENS
Lyon

- End forwarded message
-

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



[sage-devel] Multiple return values

2008-01-16 Thread David Kohel

There was a thread on multiple return values coming from Magma,
since renamed to "Integer points on conics"

William pointed out that one can access the multiple return values
using nvals:

 x = magma.XGCD(15, 10)
 x,y,z = magma.XGCD(15, 10, nvals = 3)

The first returns an integer, while the second returns a tuple.

Q1: Is this an acceptable general construction for Python and/or SAGE,
namely to return a different type depending on the values passed into
it?  Is it acceptable when it is controlled by nvals in exactly this
way?

As William pointed out, very different algorithms can be called
depending on the
number of arguments requested in Magma.  The following is an example:

sage: E = magma.EllipticCurve([1,3])
sage: magma.IsIsomorphic(E,E)
true
sage: bool, phi = magma.IsIsomorphic(E,E,nvals=2)
sage: phi
Elliptic curve isomorphism from: Elliptic Curve defined by y^2 = x^3 +
x + 3 over Rational Field to Elliptic Curve defined by y^2 = x^3 + x +
3 over Rational Field
Taking (x : y : 1) to (x : y : 1)

Currently in SAGE we have:

sage: E = EllipticCurve([1,3])
sage: E.is_isomorphic(E)
True

Q2: Would the following be acceptable way of implementing equivalent
functionality in SAGE?:

sage: bool, phi = E.is_isomorphic(E, nvals=2)

Note that often (in many concexts) it more expensive to return an
isomorphism, but only slightly more so compared with recomputing the
isomorphism test.  If the answer to my question is "no, it not
acceptable SAGE/Python syntax", then how should we implement this
functionality?  One possibility is:

sage: phi = E1.isomorphism(E2)

and to trap an error if is_isomorphic returns false.  Is this a
better?

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



[sage-devel] Re: Integer points on Conics

2008-01-16 Thread John Cremona

I assumed that Enrique wanted *all* integral points (in some sense
when there are infinitely many).

For listing rational (or integral) points up to some height bound
there are methods which are vastly more efficient than the one being
proposed here, which does not even use a quadratic sieve.  Optimal
(for any kind of variety, not just curves, not just plane curves, not
just conics) are the p-adic lattice reduction methods (sometimes known
as "p-adic Elkies" by analogy with the real -- as opposed to p-adic--
version first proposed by Elkies around 2000.

Implementing this in Sage should be put onto our
useful-projects-for-students list.

John

On 16/01/2008, D. Benjamin Antieau <[EMAIL PROTECTED]> wrote:
> Enrique,
>
> This can easily be done at the moment, assuming that you want to count
> integral points up to a certain height N. If you are looking for all of the
> points of something you know has only finitely many, I am not so sure.
>
> I hope the following ramble helps.
>
> sage: A,B,C,D,E,F=[1,0,0,0,0,-1] # integers
> sage: R.=PolynomialRing(ZZ,2)
>  sage: f=A*x^2+B*x*y+C*y^2+D*x+E*y+F # C:f=0
> sage: X=AffineSpace(ZZ,2)
>  sage: Y=X.subscheme(f)
> sage: bound=100
>  sage: points=Y.rational_points(ZZ,bound)
> sage: len(points)
>  402
>
> This uses sage's internal method. However, depending on what you need it
> for, the following might work better.
>
>
> The function lazy_rational_points() simply goes through all possible values
> a of x, and factors f(a,y) to get the points. Then,
> it does the same for the bounded values of y. Note that while this
> guarantees enumeration of all of the points of bounded height,
>
> there may be points of greater height in the return.
>
> sage: def lazy_rational_points(f,bound):
> ... r'''
> ... Given a polynomial in two variables over ZZ, returns all points
> ... of bound less <= bound, and the possibly some more points.
>
> ... '''
> ... points=[]
> ... for a in [(-bound)..(bound)]:
> ...
> xroots=R(f(a,y)).univariate_polynomial().roots(multiplicities=False)
> ... for b in xroots:
> ... if
> points.count([a,b]) < 1:
> ... points.append([a,b])
> ...
> yroots=R(f(x,a)).univariate_polynomial().roots(multiplicities=False)
> ... for c in yroots:
> ... if points.count
> ([c,a]) < 1:
> ... points.append([c,a])
> ... return points
>
> The new version is quite fast, comparatively.
> sage: f
> x^2 - 1
>
>
> sage: %time
> sage: c=lazy_rational_points(f,200)
> sage: len(c)
> 802
> CPU time: 0.59 s, Wall time: 0.62 s
>
> sage: %time
> sage: bound=200
> sage: points=Y.rational_points(ZZ,bound)
> sage: len(points)
>
> 802
> CPU time: 42.85 s, Wall time: 51.11 s
>
> Even up to a thousand, quite quickly. I didn't feel like seeing about the
> old version.
>
> sage: %time
> sage: c=lazy_rational_points(f,1000)
> sage: len(c)
>
> 4002
> CPU time: 5.78 s, Wall time: 7.26 s
>
> Now, for some random tests.
>
> sage: A,B,C,D,E,F=[randint(-1000,1000) for i in range(6)]
> sage: R.=PolynomialRing(ZZ,2)
>
> sage: f=A*x^2+B*x*y+C*y^2+D*x+E*y+F # C:f=0
> sage: X=AffineSpace(ZZ,2)
> sage: Y=X.subscheme(f)
> sage: bound=100
>
> sage: %time
> sage: points=Y.rational_points(ZZ,bound)
> sage: print f
> sage: print len(points)
>
> 190*x^2 - 561*x*y - 507*y^2 - 502*x + 133*y + 21
> 0
> CPU time: 21.26 s, Wall time: 27.55 s
> sage: %time
>
> sage: points1=lazy_rational_points(f,bound)
> sage: print f
> sage: len(points)
> 190*x^2 - 561*x*y - 507*y^2 - 502*x + 133*y + 21
>
> 0
> CPU time: 0.68 s, Wall time: 0.72 s
>
> Now, a hundred times.
>
> sage: %time
> sage: bound=10
> sage: for i in [1..100]:
> ... A,B,C,D,E,F=[randint(-1000,1000) for j in range(6)]
> ... R.=PolynomialRing(ZZ,2)
>
> ... f=A*x^2+B*x*y+C*y^2+D*x+E*y+F
> ... points=Y.rational_points(ZZ,bound)
> CPU time: 23.41 s, Wall time: 30.17 s
>
> sage: %time
> sage: bound=10
> sage: for i in [1..100]:
> ... A,B,C,D,E,F=[randint(-1000,1000) for j in range(6)]
>
> ... R.=PolynomialRing(ZZ,2)
> ... f=A*x^2+B*x*y+C*y^2+D*x+E*y+F
> ... points=lazy_rational_points(f,bound)
> CPU time: 7.23 s, Wall time: 8.86 s
>
>
> Finally, here is a version that is not lazy: it checks and only returns
> points with the correct bound.
> sage: def new_rational_points(f,bound):
> ... r'''
> ... Given a polynomial in two variables over ZZ, returns all points
> ... of bound less <= bound, and the possibly some more points.
>
> ... '''
> ... points=[]
> ... for a in [(-bound)..(bound)]:
> ...
> xroots=R(f(a,y)).univariate_polynomial().roots(multiplicities=False)
> ... for b in xroots:
> ... if abs(b) <= bound:
>
> ... if points.count([a,b]) < 1:
> ... points.append([a,b])
> ...
> yroots=R(f(x,a)).univariate_polynomial().roots(multiplicities=False)
> ... for c in yroots:
>
> ... if abs(c) <= bound:
> ... if points.count([c,a]) < 1:
> ... points.append([c,a])
> ... return points
> More random tests, now between the two new versions. The performance is
> about the same. Thus, if you want to find points, it might be best to use
> lazy. However, if you want to study the gro

[sage-devel] Re: some words from Joachim Neubüser

2008-01-16 Thread Dan Drake
On Tue, 15 Jan 2008 at 02:15PM -0800, William Stein wrote:
> "Ceterum censeo:
> Nobody has ever paid a license fee for the proof that Sylow subgroups
> exist in every finite group, Nobody should ever pay a license fee for
> computing Sylow subgroups in a given finite group."

On a similar note, back in December I realized that there's a further
problem with closed-source math systems. The problem, ironically enough,
is with free packages written by mathematicians.

For instance, John Stembridge has some nice Maple code for working with
posets. But if you can't afford Maple, or don't have access to
it...Stembridge might as well be charging for it. 

I came up with the metaphor of a dog-whistle symphony: maybe it's a
lovely symphony, but you can't hear it! Stembridge's software may be
freely available and very useful, but without Maple you can't use it.

I wrote a bit more about this at
http://dandrake.livejournal.com/274387.html. Feel free to use it.

Dan

-- 
---  Dan Drake <[EMAIL PROTECTED]>
-  KAIST Department of Mathematical Sciences
---  http://math.kaist.ac.kr/~drake


signature.asc
Description: Digital signature