[sage-devel] Re: Conway's nimber field

2007-03-22 Thread Michel

The reference is Chapter 6 of ONAG (in particular Thm 49). The
terminology
of nimbers appears in  Winning ways for your mathematical plays.

Michel

On Mar 20, 8:11 am, Michel [EMAIL PROTECTED] wrote:
 Yes the basic reference is ONAG. I will put a more precise
 reference in the source (but I need to go to the library
 to fetch ONAG). Basically the two rules for multiplying
 nimbers are

 (1) The product of any number of distinct Fermat powers
 is the ordinary product.
 (2) If f is a Fermat power then f^2=3f/2 (where 3f/2 is
 computed for the ordinary product).

 Basically (1)(2) say that if f_n is the n't Fermat power then

 f_n^2=f_n+f_{n-1}f_{n-2}...f_0

 This realizes the nimber field as a tower of quadratic extensions.

 To compute in the nimber field we write  nimbers  f^2 (f a Fermat
 power) as l*f+r with l,rf and work recursively.

 Michel

 On 19 mrt, 21:29, David Joyner [EMAIL PROTECTED] wrote:

  Are you using ONAG for the main reference? In any case, I would appreciate
  a precise reference to a book or article on nimbers.

  On 3/19/07, Michel [EMAIL PROTECTED] wrote:

   Hi,

   To acquant myself with sage's inner workings I have implemented
   Conway's nimber field.
   See

  http://alpha.uhasselt.be/Research/Algebra/Members/nimbers/

   Recall that the nimbers form a field whose underlying set is the
   natural numbers. The addition is bitwise exclusive or but the
   multiplication is complicated.  GF(2^(2^n)) is isomorphic to the
   nimbers that are less than 2^(2^n). Thus the full nimber field is
   isomorphic to the union of GF(2^(2^n)) for all n.

   Although my implenentation is still in pure python it seems to be not
   much slower
   than the standard finite fields GF(2^(2^n)) that one can create in
   sage. However I didn't
   do extensive testing. The basic arithmetic should be trivial to
   rewrite in pyrex.

   This is still a prototype. The most glaring ommission is that
   coercions from and to
   standard Galois fields are missing. Nevertheless if there are remarks/
   comments I would
   appreciate it very much.

   Regards,
   Michel


--~--~-~--~~~---~--~~
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: polynomial quo_rem coercion

2007-03-22 Thread David Harvey


On Mar 22, 2007, at 1:42 PM, Joel B. Mohler wrote:


 This feels just a bit pedantic to me, but I think it might be a bug  
 from some
 viewpoint.

 I'm looking at the polynomial function quo_rem and I see that it  
 does it's own
 coercion manually.  This feels a little wrong to me.  I think it  
 should go
 through the standard coercion routines.  Here's a bug that results:

 sage: x=ZZ['x'].0
 sage: y=QQ['x'].0
 sage: (y+1).quo_rem(1/2*x)
 (2, 1)
 sage: (x+1).quo_rem(1/2*y)
 ...
 type 'exceptions.TypeError': no coercion of this rational to integer

 The bug is that I don't see why these two things are treated  
 substantially
 differently.  The reason I found this is because the simple  
 TypeError
 exception did not provide the usual message about parents being
 mis-matched -- I think this is a bug in itself.

 Any comments?

Exactly which quo_rem() method are you talking about? Which class?

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: polynomial quo_rem coercion

2007-03-22 Thread Joel B. Mohler

On Thursday 22 March 2007 13:48, David Harvey wrote:
  This feels just a bit pedantic to me, but I think it might be a bug  
  from some
  viewpoint.
 
  I'm looking at the polynomial function quo_rem and I see that it  
  does it's own
  coercion manually.  This feels a little wrong to me.  I think it  
  should go
  through the standard coercion routines.  Here's a bug that results:
 
  sage: x=ZZ['x'].0
  sage: y=QQ['x'].0
  sage: (y+1).quo_rem(1/2*x)
  (2, 1)
  sage: (x+1).quo_rem(1/2*y)
  ...
  type 'exceptions.TypeError': no coercion of this rational to integer
 
  The bug is that I don't see why these two things are treated  
  substantially
  differently.  The reason I found this is because the simple  
  TypeError
  exception did not provide the usual message about parents being
  mis-matched -- I think this is a bug in itself.
 
  Any comments?

 Exactly which quo_rem() method are you talking about? Which class?

Hmm, yes, I was thinking of including that information -- I see I didn't.  I 
think that any of them in polynomial_element_generic.py exhibit analogous 
behaviour.  The one around line 897 is one specific instance.

--
Joel

--~--~-~--~~~---~--~~
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: polynomial quo_rem coercion

2007-03-22 Thread Nick Alexander

Bug +1.

Nick

On Mar 22, 10:42 am, Joel B. Mohler [EMAIL PROTECTED] wrote:
 This feels just a bit pedantic to me, but I think it might be a bug from some
 viewpoint.

 I'm looking at the polynomial function quo_rem and I see that it does it's own
 coercion manually.  This feels a little wrong to me.  I think it should go
 through the standard coercion routines.  Here's a bug that results:

 sage: x=ZZ['x'].0
 sage: y=QQ['x'].0
 sage: (y+1).quo_rem(1/2*x)
 (2, 1)
 sage: (x+1).quo_rem(1/2*y)
 ...
 type 'exceptions.TypeError': no coercion of this rational to integer

 The bug is that I don't see why these two things are treated substantially
 differently.  The reason I found this is because the simple TypeError
 exception did not provide the usual message about parents being
 mis-matched -- I think this is a bug in itself.

 Any comments?

 --
 Joel


--~--~-~--~~~---~--~~
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: polynomial quo_rem coercion

2007-03-22 Thread William Stein

 On Mar 22, 10:42 am, Joel B. Mohler [EMAIL PROTECTED] wrote:
  This feels just a bit pedantic to me, but I think it might be a bug from 
  some
  viewpoint.
 
  I'm looking at the polynomial function quo_rem and I see that it does it's 
  own
  coercion manually.  This feels a little wrong to me.  I think it should go
  through the standard coercion routines.  Here's a bug that results:
 
  sage: x=ZZ['x'].0
  sage: y=QQ['x'].0
  sage: (y+1).quo_rem(1/2*x)
  (2, 1)
  sage: (x+1).quo_rem(1/2*y)
  ...
  type 'exceptions.TypeError': no coercion of this rational to integer
 
  The bug is that I don't see why these two things are treated substantially
  differently.  The reason I found this is because the simple TypeError
  exception did not provide the usual message about parents being
  mis-matched -- I think this is a bug in itself.
 
  Any comments?

quo_rem was written long before there was any standard coercion
system.  It makes sense to rewrite it now to use the canonical
coercion model. Feel free to do so, or at least add something to
trac.

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: Biopython package

2007-03-22 Thread Hamptonio

Stupid of me not to try that - i.e. the 'http://'.  Ah well.  I have
written to the biopython dev list to let them know of the SAGE-
biopython connection.

I tried to take a look at what was causing those installation
hangups.  It looks like its not the mxTextTools, but rather the
components that immediately follow - namely the lack of Reportlab
(optional, I've never used its functionality) and the compilation of
part of Bio.PDB (basically a parser for molecular structure files).  I
cut out the relevant section and pasted it below.  If I have time, I
will try to figure out a workaround for this in the installation
script.

I am now spending a great deal of time working in the SAGE notebook
environment, which should inspire me eventually to do more development
work on SAGE.

Here's the installation snippet of interest:

*** Reportlab *** is either not installed or out of date.

This package is optional, which means it is only used in a few
specialized modules in Biopython.  You probably don't need this if you
are unsure.  You can ignore this requirement, and install it later if
you see ImportErrors.
You can find Reportlab at http://www.reportlab.org/downloads.html.

Do you want to continue this installation? (Y/n)
*** Bio.KDTree *** NOT built by default

The Bio.PDB.NeighborSearch module depends on the Bio.KDTree module,
which in turn, depends on C++ code that does not compile cleanly on
all platforms. Hence, Bio.KDTree is not built by default.

Would you like to build Bio.KDTree ? (y/N)  running build

On Mar 20, 12:39 pm, William Stein [EMAIL PROTECTED] wrote:
 On Tuesday 20 March 2007 9:30 am, Hamptonio wrote:

  Just to clarify: the downloading problem isn't biopython-specific - I
  can't get anything fromwww.sagemath.orgthrough sage, only from a
  browser.  For example, 'sage -optional' fails as well.

 Sorry, you have to do this (note the http://) -- I forgot to mention
 this before -- my mistake.

 export SAGE_SERVER=http://www.sagemath.org;
 sage -optional
 ...





  -MH

  On Mar 20, 10:31 am, Hamptonio [EMAIL PROTECTED] wrote:
   Woo-hoo! Thank you!!!

   I had the same error as before on my Mac Pro - the
   '...
   in open_local_file
   raise IOError(e.errno, e.strerror, e.filename)
   IOError: [Errno 2] No such file or directory: 'www.sagemath.org/
   packages/optional/biopython-1.43.spkg'
   sage: Failed to download package biopython-1.43 fromwww.sagemath.org'

   error, so I manually downloaded the spkg fromwww.sagemath.org, and it
   installed fine apart from the weird need for 'enter'  commands that
   you warned me about.  I have tested a few of my more commonly used
   tasks and it seems to work.

   I can tell the biopython developers about this once the package
   download problems get a little sorted out.

   Thanks again,
   Marshall

   On Mar 20, 7:53 am, Hamptonio [EMAIL PROTECTED] wrote:
Great!  I am once again amazed by your speed.

I set SAGE_SERVER as you said, but my attempt at installing fails to
get the package.  The output is appended below.  I doing this on a PPC
(G4) Apple powerbook, with sage 2.0 upgraded to 2.3.

I had tried to read the documentation you suggested - I was only
volunteering to try this because it seemed relatively simple!   I've
installed biopython 1.42 on linux, apple, and windows machines, but I
haven't tried a normal install of 1.43 yet (its quite recent).  I am
not sure what mxTextTools is doing; in a python install I just do
'sudo python setup.py install' although I am not sure that the sudo is
necessary.

I'll also give this a try on the Mac Pro (Intel) in my office when I
get in.

Thanks,
Marshall

~/sage-2.0:07:43:42:./sage -i biopython-1.43
Installing biopython-1.43
Calling sage-spkg on biopython-1.43
WARNING: Using SAGE_ROOT variable that was already set to '/Users/mh/
sage-2.0'.
biopython-1.43
Machine:
Darwin medmgmt-3.tajen.edu.tw 8.8.0 Darwin Kernel Version 8.8.0: Fri
Sep  8 17:18:57 PDT 2006; root:xnu-792.12.6.obj~1/RELEASE_PPC Power
Macintosh powerpc
Deleting directories from past builds of previous/current versions of
biopython-1.43
/Users/mh/sage-2.0/local/bin/sage-spkg: file /Users/mh/sage-2.0/
biopython-1.43 does not exist
Attempting to download
it.www.sagemath.org/packages/optional/biopython-1.43.spkg--
biopython-1.43.spkg
[
Traceback (most recent call last):
  File /Users/mh/sage-2.0/local/bin/sage-download_package, line 53,
in module
if not download_file(optional/%s%F):
  File /Users/mh/sage-2.0/local/bin/sage-download_package, line 45,
in download_file
urllib.urlretrieve(url, file, reporthook)
  File /Users/mh/sage-2.0/local/lib/python2.5/urllib.py, line 89, in
urlretrieve
return _urlopener.retrieve(url, filename, reporthook, data)
  File /Users/mh/sage-2.0/local/lib/python2.5/urllib.py, line 222,
in retrieve
fp = self.open(url,