[sage-devel] Implementing numerator and denominator for multivariate polynomials [with patch]

2009-07-09 Thread luisfe

Hi,

Some days ago I sent a bug report using the notebook link to the
google docs
form. I am unable to find that bug report on the web.

Anyway as the thing is trivial I wrote a patch myself.

The problem is that multivariate polynomials do not admit numerator
and
denominator

sage: K.=QQ['x,y']
sage: f=x+y
sage: numerator(f)
---
AttributeErrorTraceback (most recent call
last)

/home/luisfe/.sage/temp/mychabol/5681/
_home_luisfe__sage_init_sage_0.py in
()

/opt/SAGE/sage/local/lib/python2.5/site-packages/sage/misc/
functional.pyc in
numerator(x)
686 if isinstance(x, (int, long)):
687 return x
--> 688 return x.numerator()
689
690 def numerical_approx(x, prec=None, digits=None):

AttributeError: 'sage.rings.polynomial.multi_polynomial_libsingular'
object
has no attribute 'numerator'


Although numerator and denominator are expectoed for rational
functions only
they might be needed, once would like to write an algorithm valid for
both
polynomials and rational functions, for example the following code in
the same
session:

sage: g=y
sage: h=1-y
sage: (f/(g)).numerator()
x + y
sage: (f/(g+h)).denominator()
---
AttributeErrorTraceback (most recent call
last)

/home/luisfe/.sage/temp/mychabol/5681/
_home_luisfe__sage_init_sage_0.py in
()

AttributeError: 'sage.rings.polynomial.multi_polynomial_libsingular'
object
has no attribute 'denominator'

In the first case, the fraction is created and the numerator has a
meaning. In
the second the fraction is never created and the code fails.

I have writen a trivial patch for the class MPolynomial. I am not sure
if
denominator should return 1 or self.parent(one) I write 1 because it
seems
inoffensive to me

diff -r 2e793d2a0e12 sage/rings/polynomial/multi_polynomial.pyx
--- a/sage/rings/polynomial/multi_polynomial.pyxThu Jun 18
23:52:34
2009 -0700
+++ b/sage/rings/polynomial/multi_polynomial.pyxThu Jul 09
00:05:29
2009 -0700
@@ -980,6 +980,28 @@
 from sage.structure.factorization import Factorization
 return Factorization(v, unit)

+def numerator(self):
+"""
+Numerator of a polynomial
+
+EXAMPLES:
+sage: K. = QQ['x,y']
+sage: f = x + y
+sage: f.numerator()
+x + y
+"""
+return self
+
+def denominator(self):
+"""
+Denominator of a polynomial
+EXAMPLES:
+sage: K. = QQ['x,y']
+sage: f = x + y
+sage: f.denominator()
+1
+"""
+return 1


 cdef remove_from_tuple(e, int ind):

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



[sage-devel] Re: sage-4.1.rc1

2009-07-09 Thread Pat LeSmithe

Minh Nguyen wrote:
> Note that I have already deleted the experimental repository sage-exp,
> but the documentation build script (I think) still links to or uses
> that deleted repository. This might be due to ticket #5350
> 
> http://trac.sagemath.org/sage_trac/ticket/5350
> 
> but I may be wrong here. I don't get the above problem if I make
> clones of the main repository and don't delete them. But that eats up
> a lot of disk space, even though /scratch on sage.math is pretty large
> in terms of storage. And sometimes I remove repositories because I
> don't need them any more.

Thanks for noting this.  This is one of the problems we're trying to
eliminate at

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

I will try to update the current patches so that the builder does not
throw an error, if an auto-generated .rst file is missing.

Out of curiosity (and ignorance):  Do we have a "build" monoid?

http://en.wikipedia.org/wiki/Monoid

Perhaps two, one each for the regular and documentation build systems?


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



[sage-devel] Re: What are *DIS*advantages of Sage compared to the 3 M's ?

2009-07-09 Thread Dr. David Kirkby

William Stein wrote:

>> Whilst I personally think a paid support contract, with the money
>> donated to the Sage project is preferable, agreeing to offer free advice
>> in confidence would go some way to increasing its accepantace in
>> commerical environments.
> 
> In point of fact I already do devote nontrivial time to doing exactly
> what you suggest above (and sometimes in person, not just email).  I
> just don't put a specific statement on the website.
> 
> This is definitely worth discussing further.
> 
>  -- william

Perhaps at some point, a new thread related to just the issue. Though 
actually to me there seems two related issues.

1) Commercial users

Commercial users who might have *many* reasons for requiring 'official 
support' - to satisfy IT departments, satisfy their managers, 
confidentiality etc. For some government bodies, there might even be 
legal reasons too.

Some research into finding out the criteria for permitting software use 
in different companies would be useful.

2) Confidentiality issues alone.

Often non-commercial groups, including universities have confidentiality 
issues. I've done post-doc work in a university funded by commercial 
companies. In my particular case, the company concerned would not have 
cared what software I used, but would have cared if I was discussing the 
nature of the work on public mailing lists.

Wolfram Research have now introduced the Mathematica Home Edition, which 
could attract those who have retired or just enjoy maths as a hobby. 
They might well want to keep some information confidential if they are 
hoping to solve some things. There is only 30 days of support for such 
users, as they could *not* get the 'Premier Service'.

Dave




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



[sage-devel] Re: Quaternion Algebra on Q(i) and Cocompact/Uniform Lattices in SL2(Z[i])

2009-07-09 Thread John Cremona

It's clear what your algebra is:  over the base field K=Q(i) it's the
quaternion algebra with parameters 2,5.

I think that sage-nt would be a better forum for this than sage-devel.
 Ask to join (at http://groups.google.co.uk/group/sage-nt).

John

2009/7/9 Leonard Foret :
>
> The problem is about finding co-compact lattices in SL(2, C) by using
> quaternion algebras.
>
> The example we are working out now is based on the Quaternion algebra
> over Q(i) defined by the quadratic extension Q(i)[X]/(X^2 - 2) and
> additional (non-commutative) relation s^2  = 5.
>
> We need the algebra to be over Q(i) - that's important for the
> construction  of the lattice.
>
> The lattice is constructed by collecting the elements of the algebra
> of reduced norm 1 with and with coefficients in the ring of Gaussian
> integers. The reduced norm is defined by using the left multiplication
> by an element on the algebra.
>
> It is possible to figure out how long I should compute before getting
> all the generators of the lattice, but the idea is to avoid the use of
> the corresponding theory for this example, and try to work out an
> approach for any particular case.
>
> Finding the elements of norm one is related to solving Diophantine
> equations over Z. Do you know if there is a software for finding
> generators of groups (like the one we are dealing with in our
> example)?
>
> On Jul 7, 9:41 pm, William Stein  wrote:
>> On Sat, Jul 4, 2009 at 8:39 PM, Leonard Foret wrote:
>>
>> > Hello all,
>>
>> > This is my first time in sage-devel.  I have a project with a
>> > professor til the end of August to construct cocompact/uniform
>> > lattices on SL2(Z[i]) basically by quaternion algebras.
>>
>> What is a "lattice on SL2(Z[i])"?
>>
>> >   I figure that
>> > since I'm writing code using python and sage, I might as well do it
>> > right and incorporate it into sage.
>>
>> Yes, definitely.
>>
>> >  The two contributions I could
>> > make to sage would be 1) to redo a polished version of the code which
>> > computes the generators of elements of reduced norm one within a
>> > certain radius for an explicit example (hopefully extend it to a
>> > general skew field/quaternion algebra)
>>
>> Good.
>>
>> >  and 2) functionality for
>> > quaternion algebras over the field Q(i) rather than Q.
>>
>> What functionality do you want to add?
>>
>> > What I have right now are some python/sage code which looks at the
>> > quaternion algebra over Q(i) given by the field extension Q(i)(sqrt
>> > (2)) over Q(i)  and the added relation j^2 = 5, (similar to the
>> > construction that's already implemented over Q).
>>
>> As a non-commutative ring, isn't that precisely exactly the same thing as
>> the quaternion algebra
>>
>> sage: R. = QuaternionAlgebra(-1,5)
>> sage: R
>> Quaternion Algebra (-1, 5) with base ring Rational Field
>>
>> already in Sage?  Is the point just that you're viewing it differently
>> as a quadratic
>> extension of Q(i)?
>>
>> >  The resulting algebra
>> > produces a lattice which will be cocompact/uniform and I've
>> > implemented the following algorithms:
>>
>> Which lattice?  In what space?
>>
>> > 1) compute the elements of reduced norm one within a ball.
>>
>> elements in what?
>>
>> > 2) compute left multiplication by an element
>>
>> left multiplication on what?
>>
>> > 3) compute a norm for these elements (that is, by a norm for the
>> > matrix computed in 2)
>>
>> > When the elements of reduced norm one are considered with
>> > multiplication, they form a group and the following algorithm is
>> > applicable:
>> > 4) compute generators for the elements of reduced norm one.
>>
>> > The trouble with algorithm 4 and 1, is that it's by complete brute
>> > force to the point where the algorithm works but I don't know how long
>> > it would take to find all of them (for 1 there's infinitely many).
>>
>> Since you seem to be doing this for exactly the 1 single ring
>> Q(i)(sqrt(2)), shouldn't you know?
>>
>>
>>
>> > As for adding functionality to Quaternion Algebra I would like to work
>> > on the following:
>> > 1)  extend .is_division_algebra()  to the base field Q(i).
>> > 2) .is_anisotropic()
>> > 3) and any others.
>>
>> > I'm a beginning graduate student at the Florida International
>> > University and am working closely with a professor there.  If anyone
>> > is interested or can offer any advice (books, articles to read, ideas
>> > for the algorithms, etc), it would be well received and I'll implement
>> > them immediately.
>>
>> > Thanks in advance!
>> > Leonard Foret
>>
>> --
>> William Stein
>> Associate Professor of Mathematics
>> University of Washingtonhttp://wstein.org
> >
>

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

[sage-devel] Re: Implementing numerator and denominator for multivariate polynomials [with patch]

2009-07-09 Thread John Cremona

I can see another problem here.One could argue that the
denominator of (x+y)/2 was 2 while you code gives 1.  So the
documentation needs to be very clear, stating that the denominator of
ever polynomial in any number of variables over a field is always 1.

John

2009/7/9 luisfe :
>
> Hi,
>
> Some days ago I sent a bug report using the notebook link to the
> google docs
> form. I am unable to find that bug report on the web.
>
> Anyway as the thing is trivial I wrote a patch myself.
>
> The problem is that multivariate polynomials do not admit numerator
> and
> denominator
>
> sage: K.=QQ['x,y']
> sage: f=x+y
> sage: numerator(f)
> ---
> AttributeErrorTraceback (most recent call
> last)
>
> /home/luisfe/.sage/temp/mychabol/5681/
> _home_luisfe__sage_init_sage_0.py in
> ()
>
> /opt/SAGE/sage/local/lib/python2.5/site-packages/sage/misc/
> functional.pyc in
> numerator(x)
>686 if isinstance(x, (int, long)):
>687 return x
> --> 688 return x.numerator()
>689
>690 def numerical_approx(x, prec=None, digits=None):
>
> AttributeError: 'sage.rings.polynomial.multi_polynomial_libsingular'
> object
> has no attribute 'numerator'
>
>
> Although numerator and denominator are expectoed for rational
> functions only
> they might be needed, once would like to write an algorithm valid for
> both
> polynomials and rational functions, for example the following code in
> the same
> session:
>
> sage: g=y
> sage: h=1-y
> sage: (f/(g)).numerator()
> x + y
> sage: (f/(g+h)).denominator()
> ---
> AttributeErrorTraceback (most recent call
> last)
>
> /home/luisfe/.sage/temp/mychabol/5681/
> _home_luisfe__sage_init_sage_0.py in
> ()
>
> AttributeError: 'sage.rings.polynomial.multi_polynomial_libsingular'
> object
> has no attribute 'denominator'
>
> In the first case, the fraction is created and the numerator has a
> meaning. In
> the second the fraction is never created and the code fails.
>
> I have writen a trivial patch for the class MPolynomial. I am not sure
> if
> denominator should return 1 or self.parent(one) I write 1 because it
> seems
> inoffensive to me
>
> diff -r 2e793d2a0e12 sage/rings/polynomial/multi_polynomial.pyx
> --- a/sage/rings/polynomial/multi_polynomial.pyxThu Jun 18
> 23:52:34
> 2009 -0700
> +++ b/sage/rings/polynomial/multi_polynomial.pyxThu Jul 09
> 00:05:29
> 2009 -0700
> @@ -980,6 +980,28 @@
> from sage.structure.factorization import Factorization
> return Factorization(v, unit)
>
> +def numerator(self):
> +"""
> +Numerator of a polynomial
> +
> +EXAMPLES:
> +sage: K. = QQ['x,y']
> +sage: f = x + y
> +sage: f.numerator()
> +x + y
> +"""
> +return self
> +
> +def denominator(self):
> +"""
> +Denominator of a polynomial
> +EXAMPLES:
> +sage: K. = QQ['x,y']
> +sage: f = x + y
> +sage: f.denominator()
> +1
> +"""
> +return 1
>
>
>  cdef remove_from_tuple(e, int ind):
>
> >
>

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



[sage-devel] Re: Implementing numerator and denominator for multivariate polynomials [with patch]

2009-07-09 Thread Minh Nguyen

Hi,

On Thu, Jul 9, 2009 at 5:24 PM, luisfe wrote:
>
> Hi,
>
> Some days ago I sent a bug report using the notebook link to the
> google docs
> form. I am unable to find that bug report on the web.
>
> Anyway as the thing is trivial I wrote a patch myself.
>
> The problem is that multivariate polynomials do not admit numerator
> and
> denominator
>
> sage: K.=QQ['x,y']
> sage: f=x+y
> sage: numerator(f)
> ---
> AttributeErrorTraceback (most recent call
> last)
>
> /home/luisfe/.sage/temp/mychabol/5681/
> _home_luisfe__sage_init_sage_0.py in
> ()
>
> /opt/SAGE/sage/local/lib/python2.5/site-packages/sage/misc/
> functional.pyc in
> numerator(x)
>686 if isinstance(x, (int, long)):
>687 return x
> --> 688 return x.numerator()
>689
>690 def numerical_approx(x, prec=None, digits=None):
>
> AttributeError: 'sage.rings.polynomial.multi_polynomial_libsingular'
> object
> has no attribute 'numerator'
>
>
> Although numerator and denominator are expectoed for rational
> functions only
> they might be needed, once would like to write an algorithm valid for
> both
> polynomials and rational functions, for example the following code in
> the same
> session:
>
> sage: g=y
> sage: h=1-y
> sage: (f/(g)).numerator()
> x + y
> sage: (f/(g+h)).denominator()
> ---
> AttributeErrorTraceback (most recent call
> last)
>
> /home/luisfe/.sage/temp/mychabol/5681/
> _home_luisfe__sage_init_sage_0.py in
> ()
>
> AttributeError: 'sage.rings.polynomial.multi_polynomial_libsingular'
> object
> has no attribute 'denominator'
>
> In the first case, the fraction is created and the numerator has a
> meaning. In
> the second the fraction is never created and the code fails.
>
> I have writen a trivial patch for the class MPolynomial. I am not sure
> if
> denominator should return 1 or self.parent(one) I write 1 because it
> seems
> inoffensive to me
>
> diff -r 2e793d2a0e12 sage/rings/polynomial/multi_polynomial.pyx
> --- a/sage/rings/polynomial/multi_polynomial.pyxThu Jun 18
> 23:52:34
> 2009 -0700
> +++ b/sage/rings/polynomial/multi_polynomial.pyxThu Jul 09
> 00:05:29
> 2009 -0700
> @@ -980,6 +980,28 @@
> from sage.structure.factorization import Factorization
> return Factorization(v, unit)
>
> +def numerator(self):
> +"""
> +Numerator of a polynomial
> +
> +EXAMPLES:
> +sage: K. = QQ['x,y']
> +sage: f = x + y
> +sage: f.numerator()
> +x + y
> +"""
> +return self
> +
> +def denominator(self):
> +"""
> +Denominator of a polynomial
> +EXAMPLES:
> +sage: K. = QQ['x,y']
> +sage: f = x + y
> +sage: f.denominator()
> +1
> +"""
> +return 1
>
>
>  cdef remove_from_tuple(e, int ind):

Thank you for reporting this. You can track this issue at ticket #6496

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

-- 
Regards
Minh Van Nguyen

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



[sage-devel] Re: Cython and C++, Classes and subclasses

2009-07-09 Thread Robert Bradshaw

On Jul 8, 2009, at 6:36 AM, Nathann Cohen wrote:

>
> Hello !
>
> I have a library with a C++ function I try to interface with SAGE, and
> two classes are defined :
>
> CoinPackedVector and CoinPackedVectorBase
>
> I only use CoinPackedVector, but one of its functions is defined in
> the header files as appendRow( CoinPackedVectorBase )
>
> CoinPackedVectorBase being an abstract class of which CoinPackedVector
> in a subclass. The thing is that Cython does not know that, and it
> believes I am using incorrectly the function by giving it an argument
> of incorrect type. How can I make it think otherwise ?

Cast it.

> On another point : how is it possible to call a function which want as
> an argument a reference to an instance of a class ?
> I only have pointers to instances in my Cython code, how can I build a
> reference from that ?

Unfortunately, you can't (yet). Perhaps passing in the dereferenced  
pointer would be good enough, otherwise you'd have to write a stub in  
C++ to do that for you.

Right now (literally as I type) Danilo Freitas is making all of this  
much easier.

- Robert

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



[sage-devel] Re: Categories restart

2009-07-09 Thread Robert Bradshaw

On Jul 8, 2009, at 11:17 AM, Nicolas M. Thiery wrote:

>
> On Wed, Jul 08, 2009 at 11:03:21AM -0700, Craig Citro wrote:
>>
>>> What's the status on this one? I though that the bottom line of the
>>> discussion at SD15 for this one (not to be mixed up with #5986)  
>>> was that:
>>>
>>>  - Apart from importing the cPickle sources into the Sage tree, the
>>>   patch was essentially trivial (a 5 lines change to the cPickle
>>>   code) and therefore easy to review
>>>  - It had some reasonable chances to be merged into Python at  
>>> some point.
>>>  - Craig was going to push this upstream
>>>  - There were no simple alternatives
>>>
>>> And that in view of all this it was good to go in Sage, and would  
>>> get
>>> a positive review shortly. Which did not occur.

No one who had looked at it was comfortable giving it a positive  
review, but I said I'd take a look and expected to give it a positive  
review. I wasn't comfortable with the idea of shipping our own,  
separate copy of cpickle either, so that's where it sat.

The change was fine, and given that we're trying to push this  
upstream a better place seems to be as a patch to the Python spkg,  
which Craig Citro posted to the ticket just today.

- Robert


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



[sage-devel] Re: Categories restart

2009-07-09 Thread Robert Bradshaw

On Jul 8, 2009, at 4:46 PM, David Roe wrote:

> Discussion: we currently have CategoryObject._base as a C attribute  
> because some elements want fast access to a "base."  Is  
> CategoryObject the right place to put this?  Maybe we should  
> generalize the examples of sage.rings.integer_mod.NativeIntStruct  
> and sage.rings.padics.pow_computer.PowComputer_class?

I think it may be useful to have an extra object field for stuff like  
NativeIntStruct and PowComputer_class. However, base is so common  
that we might as well stick it there and make it easy to access.
>
>
> * Currently ParentGens.__init__ does not call  
> ParentWithBase.__init__.  This should presumably change at some point.

I believe both of those should simply go away when everything's moved  
to the new coercion model.

- Robert


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



[sage-devel] prime_pi for large parallel machines

2009-07-09 Thread Dr. David Kirkby

There was some discussion a month or two back about different algorithms 
for prime_pi. IIRC, Mathematica's was the fastest, Sage's was second 
fastest and Maple's method was dumb and just counted them like a 10 year 
old could do.

I pointed out a link to those with accounts on sage.math.users of a 
discussion on the newsgroup comp.unix.solaris about how to get maximum 
performance from a Sun T5240 (the same machine as 't2'). It was quite a 
technical discussion about why old machines can be faster or slower, 
depending how the program is written. Someone wrote a program which 
computed the primes under 10,000 in C, and compared the speed of his old 
machine to his high spec Sun T5240 and showed the old machine was quicker.

(BTW, 't2' has 16 cores and 128 virtual processors)

A Sun employee, Andrew Gabriel, who I happen to know, then re-wrote the 
program for him in a way to exploit the Sun T5240 properly. William 
re-run the program yesterday and found the time drop from 21 seconds to 
0.6 seconds when he used 128 threads.

It then occurred to me that perhaps Maple's dumb method of computing 
number of primes under n might be silly on most machines, but might if 
re-written to use a parallel machine properly, it could be the most 
sensible way to do it.

But I've no idea how the dumb method compares with the Sage 
implementation or Mathematica. Obviously if the dumb method is 3 orders 
of magnitude slower, then I doubt much could be done with it, for now at 
least, though I can see machines with 1000 virtual processors wont be 
long, and might actually exist now.

It would be very interesting to see if Mathematica could do anything 
very quick on t2. Clearly the hardware is capable of high performance - 
it's just we are not getting it because most of the programs we are 
using on t2 at the minute don't exploit the machine properly. Perhaps 
Mathematica might switch to a better method on parallel machines.

For those interested, the link is here.

http://groups.google.co.uk/group/comp.unix.solaris/browse_thread/thread/7041af61bab6cfd/718b4fb647765119?hl=en&ie=UTF-8&q=Single-threaded+T5240+performance&pli=1

You might want to try the program on your dual and quad processor 
machines, but you are not likely to get the speeds possible on t2.

Dave


PS
Mathematica 6 failed to determine the number of CPUs the machine had on 
Solaris SPARC and always assumed one. I found the reason for this, and 
posted the details to sci.math.symbolic someone from  which WRI thanked 
me for,

http://groups.google.cl/group/sci.math.symbolic/browse_thread/thread/c07a8230fbf01bc1/837b00dfbaaa31aa



PPS
sci.math.symoblic is a much quicker way to get help on MMA issues than 
the Mathematica newsgroup, as the latter is moderated with only one 
moderator. Even Wolfram Research employees can't post to that without 
his approval !




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



[sage-devel] Python spkg for OSX framework build

2009-07-09 Thread Prabhu Ramachandran

Hi,

I've made an SPKG of a framework Python build -- it was really easy. 
The modified spkg-install is on bsd.math.washington.edu as is the spkg, 
they are here:

/Users/Prabhu/spkg-install.python
/Users/Prabhu/python-2.6.2.p2.spkg

I'm not going to be available tomorrow (I leave in half an hour) but if 
someone wants to try these out please feel free to do so.  I will make a 
VTK spkg this weekend for the framework build and then look at the 
offscreen support.

cheers,
-- 
Prabhu Ramachandran http://www.aero.iitb.ac.in/~prabhu

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




[sage-devel] Re: sage installation

2009-07-09 Thread Ralf Hemmecke

William, thanks for this hint.

But I still have a little comment.

I've just started

 > ./sage -f mpir-1.2.p4

and actually I really was wondering how this can work if I only have the 
binary version of sage. But as a surprise to me the log said... (see 
below)...

1) That command should be shown together with the warning message of the 
compiler flags. So that I can go on without having to ask on a mailing 
list. (I believe that at google you first have to create an account to 
post a message -- looks like an unnecessary burden.)

2) On the download page I would have expected to see posted a few 
differences of the binary and the source distribution of sage.
The design with 'sage -f' and your hint of how I can recompile is great, 
but without asking I would certainly have downloaded the complete source 
distribution and recompiled from scratch. That's certainly a waste 
bandwidth and time.
So I would suggest to add a few lines to the download pages and 
explaining to people for which purposes they would need the source 
distribution and when a binary distribution is certainly enough even for 
development.

As for 2) maybe I haven't looked carefully enough and this information 
is actually there, but consider me as a person who just wants to try our 
sage and maybe later add a few things to sage myself. I have the choice 
between a source and a binary distribution. And I would certainly choose 
the source one, since I would think that the binary distribution doesn't 
let me change Sage (or at least the parts I am interested in). The 
source distribution is certainly not wrong, but maybe I get more than I 
actually need and waste bandwidth and compilation time.
Do you see the dilemma?

So it should be made clear that sage happily connects to a server at 
compile time and downloads missing sources on demand. I consider that a 
feature. Make it more visible.

Ralf

=== first few lines of log of ./sage -f mpir-1.2.p4 
Force installing mpir-1.2.p4
Calling sage-spkg on mpir-1.2.p4
You must set the SAGE_ROOT environment variable or
run this script from the SAGE_ROOT or
SAGE_ROOT/local/bin/ directory.
mpir-1.2.p4
Machine:
Linux woodpecker 2.6.28-13-generic #45-Ubuntu SMP Tue Jun 30 19:49:51 
UTC 2009 i686 GNU/Linux
Deleting directories from past builds of previous/current versions of 
mpir-1.2.p4
Extracting package 
/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/spkg/standard/mpir-1.2.p4.spkg
 
...
-rw--- 1 hemmecke hemmecke 107 2009-06-19 19:41 
/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/spkg/standard/mpir-1.2.p4.spkg
tar: This does not look like a tar archive
tar: Error exit delayed from previous errors
Finished extraction
sage: After decompressing the directory mpir-1.2.p4 does not exist
This means that the corresponding .spkg needs to be downloaded
again.
http://www.sagemath.org//packages/optional/mpir-1.2.p4.spkg --> 
mpir-1.2.p4.spkg
[ ]
http://www.sagemath.org//packages/standard/mpir-1.2.p4.spkg --> 
mpir-1.2.p4.spkg
[..]

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



[sage-devel] Re: sage installation

2009-07-09 Thread Ralf Hemmecke

I seem to be out of luck. But maybe I did something wrong.

Here my steps.

I downloaded and extracted 
sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux.tar.gz.

cd sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux
./sage -combinat install
./sage # fails becaus of binaries being not for my computer
# I recompiled...
> ./sage -f mpir-1.2.p4
> ./sage -f atlas-3.8.3.p3
# ... and started sage (see below...)

Now, maybe I have to reinstall sage-combinat or is the error I got not 
connected to sage-combinat?

But ...
/devel>ls -l
total 16
drwx-- 4 hemmecke hemmecke 4096 2009-07-09 00:35 .
drwx-- 8 hemmecke hemmecke 4096 2009-07-09 11:24 ..
lrwxrwxrwx 1 hemmecke hemmecke   13 2009-07-09 00:35 sage -> sage-combinat
drwx-- 7 hemmecke hemmecke 4096 2009-07-09 00:35 sage-combinat
drwx-- 7 hemmecke hemmecke 4096 2009-06-19 16:33 sage-main

So I probably should not simply remove the sage-combinat directory.
And where did the mpir and atlas stuff go? Would I have to recompile 
them after 'sage -b main'?

Any hint is appreciated.

Ralf

=

 >./sage
-- 

| Sage Version 4.0.2, Release Date: 2009-06-18   | 

| Type notebook() for the GUI, and license() for information.| 

-- 

--- 

ImportError   Traceback (most recent call 
last)

/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/IPython/ipmaker.pyc
 
in force_import(modname)
  64 reload(sys.modules[modname]) 

  65 else: 

---> 66 __import__(modname) 

  67 

  68 


/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/bin/ipy_profile_sage.py
 
in ()
   5 preparser(True) 

   6 

> 7 import sage.all_cmdline 

   8 sage.all_cmdline._init_cmdline(globals()) 

   9 


/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/all_cmdline.py
 
in ()
  12 try: 

  13 

---> 14 from sage.all import * 

  15 from sage.calculus.predefined import x 

  16 preparser(on=True) 


/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/all.py
 
in ()
  98 

  99 from sage.server.all import * 

--> 100 import sage.tests.all as tests 

 101 

 102 try: 


/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/tests/all.py
 
in ()
   2 """ 

   3 from sage.modular.modsym.tests import Test as modsym 

> 4 from sage.tests.arxiv_0812_2725 import * 

   5 

   6 


/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/tests/arxiv_0812_2725.py
 
in ()
  38 
#* 

  39 

---> 40 from sage.combinat.set_partition import SetPartitions as 
SetPartitions
  41 

  42 def CompleteMatchings(n): 


/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/combinat/set_partition.py
 
in ()
  66 

  67 from sage.sets.set import Set, EnumeratedSet, is_Set, 
Set_object_enumerated
---> 68 import sage.combinat.partition as partition 

  69 import sage.rings.integer 

  70 import __builtin__ 


/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/combinat/partition.py
 
in ()
 237 from cartesian_product import CartesianProduct 

 238 from integer_list import IntegerListsLex 

--> 239 from sage.combinat.root_system.weyl_group import WeylGroup 

 240 

 241 def Partition(l=None, exp=None, core_and_quotient=None): 


/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/combinat/root_system/__init__.py
 
in ()
   1
> 2 # Makes sage.combinat.root_system? equivalent to 
sage.combinat.root_system.root_system?
   3 from root_system import __doc__
   4
   5 # currently needed to activate the backward compatibility 
register_unpickle_override
   6 import type_A

/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/combinat/root_system/root_system.py
 
in ()
  43 from sage.rings.all import ZZ, QQ
  44 from sage.misc.all import cached_method
---> 45 from root_space import RootSpace
  46 from weight_space import WeightSpace
  47

/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Li

[sage-devel] Re: sage installation

2009-07-09 Thread Minh Nguyen

Hi Ralf,

On Thu, Jul 9, 2009 at 8:00 PM, Ralf Hemmecke wrote:
>
> I seem to be out of luck. But maybe I did something wrong.
>
> Here my steps.
>
> I downloaded and extracted
> sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux.tar.gz.
>
> cd sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux
> ./sage -combinat install
> ./sage # fails becaus of binaries being not for my computer
> # I recompiled...
>> ./sage -f mpir-1.2.p4
>> ./sage -f atlas-3.8.3.p3
> # ... and started sage (see below...)
>
> Now, maybe I have to reinstall sage-combinat or is the error I got not
> connected to sage-combinat?

Just my 2-cent: There's a Ubuntu binary at

ftp://ftp.fu-berlin.de/unix/misc/sage/linux/32bit/sage-4.0.2-linux-Ubuntu_9.04-i686-Linux.tar.gz

In your previous post, I see this line:

Linux woodpecker 2.6.28-13-generic #45-Ubuntu SMP Tue Jun 30 19:49:51

which suggests that your system is Ubuntu.

Anyway, after you've downloaded and uncompressed the binary, you
should then cd to SAGE_ROOT and do

./sage

to start Sage for the first time.

-- 
Regards
Minh Van Nguyen

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



[sage-devel] Re: sage installation

2009-07-09 Thread Minh Nguyen

Hi Ralf,

On Thu, Jul 9, 2009 at 7:40 PM, Ralf Hemmecke wrote:
>
> William, thanks for this hint.
>
> But I still have a little comment.
>
> I've just started
>
>  > ./sage -f mpir-1.2.p4
>
> and actually I really was wondering how this can work if I only have the
> binary version of sage. But as a surprise to me the log said... (see
> below)...
>
> 1) That command should be shown together with the warning message of the
> compiler flags. So that I can go on without having to ask on a mailing
> list. (I believe that at google you first have to create an account to
> post a message -- looks like an unnecessary burden.)
>
> 2) On the download page I would have expected to see posted a few
> differences of the binary and the source distribution of sage.
> The design with 'sage -f' and your hint of how I can recompile is great,
> but without asking I would certainly have downloaded the complete source
> distribution and recompiled from scratch. That's certainly a waste
> bandwidth and time.
> So I would suggest to add a few lines to the download pages and
> explaining to people for which purposes they would need the source
> distribution and when a binary distribution is certainly enough even for
> development.

Thank you for this. Yes, you're right. Both the binary and source
distributions can be used for development. The complete Sage source is
contained in any binary distribution of Sage. So in a sense, that's a
bit weird, because one would think that a binary is an executable blob
without source code. I appreciate that you've raised this point, as it
helps Harald Schilly (the primary Sage webmaster) and myself in making
the Sage website (and the download pages) more usable.


> As for 2) maybe I haven't looked carefully enough and this information
> is actually there, but consider me as a person who just wants to try our
> sage and maybe later add a few things to sage myself. I have the choice
> between a source and a binary distribution. And I would certainly choose
> the source one, since I would think that the binary distribution doesn't
> let me change Sage (or at least the parts I am interested in). The
> source distribution is certainly not wrong, but maybe I get more than I
> actually need and waste bandwidth and compilation time.
> Do you see the dilemma?

Yes, I can see that. Anyway, you are encouraged to use a mirror
closest to you for downloading. The Sage download pages recently went
through a redesign. The new design now clearly (I hope it should be
clear; please tell me if it's not so) highlights various Sage mirrors
for downloading. This is to encourage people to download from a Sage
mirror closest to them. Before the redesign of the download pages, the
master mirror was one of the main server from which people downloaded
Sage (binary and source), which made the server itself slow. After the
redesign, we saw a decrease in traffic on the master server. So that's
a good indication that people have been using the various mirrors
around the world.


> So it should be made clear that sage happily connects to a server at
> compile time and downloads missing sources on demand. I consider that a
> feature. Make it more visible.

Thank you for your constructive criticism. Looks like Harald and
myself need to consider how to make that more visible...

-- 
Regards
Minh Van Nguyen

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



[sage-devel] Re: Sage and numerics

2009-07-09 Thread Robert Bradshaw

On Jul 7, 2009, at 6:32 PM, William Stein wrote:

>
> On Sun, Jul 5, 2009 at 3:15 AM, Dag Sverre
> Seljebotn wrote:
>>
>> Jason Grout wrote:
>>> Dag Sverre Seljebotn wrote:
 1) I must be able to use NumPy together with the preparser (it's  
 just
 too much hassle to turn it on and off, and it kind of defeats the
 purpose.). That is, with the preparser on, I should be able to  
 run most
 NumPy-using code without changes. (I don't think is a difficult to
 achieve, but certainly didn't look at it in detail.)

 One example is:

 sage: np.arange(4)
 array([0, 1, 2, 3], dtype=object)

 This is not what I want, and I can never remember to pass in
 dtype=np.int64. I don't think it makes sense either -- passing in
 np.arange(int(4)) gives the desired behaviour, and a Python int  
 and a
 Sage Integer are equally far from an np.int64 anyway.


 I think that's all, actually -- this would stop Sage from  
 getting in my
 way. But this is on my strongly wanted-list too:

>>>
>>>
>>> I asked on the numpy list a while ago about why numpy was not  
>>> calling
>>> the conventional .__complex__() to automatically convert sage  
>>> complex
>>> numbers to python complex numbers.  The answer I received  
>>> indicated that
>>> it would be very difficult for numpy to use the standard python
>>> convention of calling .__complex__() to get a complex  
>>> representation of
>>> a number.  That indicated to me that the problem was probably  
>>> hard-coded
>>> in numpy!
>>>
>>> See
>>> http://thread.gmane.org/gmane.comp.python.numeric.general/25251/ 
>>> focus=25273
>>>
>>> "The reason is that PyArray_ISCOMPLEX is used in various places, and
>>> this is a
>>> hard-coded macro.  There is no way to extend numpy's complex  
>>> behavior to
>>> support user added types.  I wish
>>> there was."
>>>
>>> However, I haven't looked at it beyond that.  So, pay no  
>>> attention to
>>> the complainers and whiners; just do it!
>>
>> That's what I'm thinking too -- even if a change isn't accepted
>> upstream, Sage could patch it's own version of NumPy.

The fix below didn't take long at all to find. Here they're talking  
about using a user-defined type as a complex. This would be nice, but  
even being able to cast a user-defined type to a complex is the most  
important part. I believe this has been resolved in 2.6 (see below).

 2) sin, sqrt etc. should understand, act on, and return NumPy  
 arrays
 (probably by calling corresponding functions in numpy)

Not even the builtin math.sin does this. To bad numpy arrays don't  
have a sin method, or it would already work. It shouldn't be to hard  
to support (generically), though for speed reasons we avoid importing  
numpy unless we want to use it.

Hopefully http://trac.sagemath.org/sage_trac/ticket/6497 isn't too  
hackish.

 3) It would be nice with better plotting support for NumPy  
 arrays, so
 that I don't have to use pylab directly, but haven't given any  
 thought
 to what I want here.

Sure.

 4) Not sure if this can be done in a reasonable way, but: I'd  
 like to
 not have to use Python ints/floats at all, it's just nicer to  
 know that
 I have a Sage element. So ideally

 sage: a=np.arange(5, dtype=np.uint8)
 sage: a[2]/a[4]
 1/2

This really doesn't make sense--a[2] and a[4] are np.uint8 scalars.  
We'd really have to hack numpy to get Integers back. However, this  
would be like changing range.


 5) #4571 (cimport numpy in notebook), obviously.

+1. Thanks for fixing numpy.pxd.

 6) One of the things drawing me towards using Sage is the "attach"
 feature. However, it is too limited for my use (and so makes me
 frustrated, so that it is better not to use it at all).  
 Something being
 a combination for an "attach" and a pure Python "import" is what  
 I want;
 that is, "import" with automatically calling "reload" on change.  
 (The
 recent work in pyximport may come into play here; if the sources  
 are in
 Cython.)

 7) Make NumPy dtypes for all Sage rings. I think that NumPy is  
 quite
 extensible in this respect and that it shouldn't be too  
 difficult to
 have arrays over Sage rings.

 sage: a = np.arange(10, dtype=ZZ.numpy()) # or dtype=ZZ if possible
>>>
>>> If this is possible, doesn't it take care of item (1) and (4)?
>>
>> Not necesarrily (4), no, although they may be linked somewhat in the
>> API, I didn't check that.
>>
>> Which dtype is used is at least conceptually somewhat independent of
>> what Python object is used to represent its elements. E.g. both  
>> arrays
>> with uint8 and int64 would convert to/from a Python int on a  
>> Python access.
>>
>> Regarding (1), what I meant was to have ZZ elements input to arange
>> result in an array of int64 (on a 64-bit system), like if the  
>> preparser
>> wasn't in eff

[sage-devel] Re: sage installation

2009-07-09 Thread Robert Bradshaw

On Jul 9, 2009, at 3:00 AM, Ralf Hemmecke wrote:

>
> I seem to be out of luck. But maybe I did something wrong.
>
> Here my steps.
>
> I downloaded and extracted
> sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux.tar.gz.
>
> cd sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux
> ./sage -combinat install
> ./sage # fails becaus of binaries being not for my computer
> # I recompiled...
>> ./sage -f mpir-1.2.p4
>> ./sage -f atlas-3.8.3.p3
> # ... and started sage (see below...)
>
> Now, maybe I have to reinstall sage-combinat or is the error I got not
> connected to sage-combinat?
>
> But ...
> /devel>ls -l
> total 16
> drwx-- 4 hemmecke hemmecke 4096 2009-07-09 00:35 .
> drwx-- 8 hemmecke hemmecke 4096 2009-07-09 11:24 ..
> lrwxrwxrwx 1 hemmecke hemmecke   13 2009-07-09 00:35 sage -> sage- 
> combinat
> drwx-- 7 hemmecke hemmecke 4096 2009-07-09 00:35 sage-combinat
> drwx-- 7 hemmecke hemmecke 4096 2009-06-19 16:33 sage-main
>
> So I probably should not simply remove the sage-combinat directory.
> And where did the mpir and atlas stuff go? Would I have to recompile
> them after 'sage -b main'?
>
> Any hint is appreciated.

I'd try

sage -b main
sage -ba

>
> Ralf
>
> =
>
>> ./sage
> --
>
> | Sage Version 4.0.2, Release Date: 2009-06-18   |
>
> | Type notebook() for the GUI, and license() for information.|
>
> --
>
> -- 
> -
>
> ImportError   Traceback (most recent call
> last)
>
> /home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny- 
> i686-Linux/local/lib/python2.5/site-packages/IPython/ipmaker.pyc
> in force_import(modname)
>   64 reload(sys.modules[modname])
>
>   65 else:
>
> ---> 66 __import__(modname)
>
>   67
>
>   68
>
>
> /home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny- 
> i686-Linux/local/bin/ipy_profile_sage.py
> in ()
>5 preparser(True)
>
>6
>
> > 7 import sage.all_cmdline
>
>8 sage.all_cmdline._init_cmdline(globals())
>
>9
>
>
> /home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny- 
> i686-Linux/local/lib/python2.5/site-packages/sage/all_cmdline.py
> in ()
>   12 try:
>
>   13
>
> ---> 14 from sage.all import *
>
>   15 from sage.calculus.predefined import x
>
>   16 preparser(on=True)
>
>
> /home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny- 
> i686-Linux/local/lib/python2.5/site-packages/sage/all.py
> in ()
>   98
>
>   99 from sage.server.all import *
>
> --> 100 import sage.tests.all as tests
>
>  101
>
>  102 try:
>
>
> /home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny- 
> i686-Linux/local/lib/python2.5/site-packages/sage/tests/all.py
> in ()
>2 """
>
>3 from sage.modular.modsym.tests import Test as modsym
>
> > 4 from sage.tests.arxiv_0812_2725 import *
>
>5
>
>6
>
>
> /home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny- 
> i686-Linux/local/lib/python2.5/site-packages/sage/tests/ 
> arxiv_0812_2725.py
> in ()
>   38
> #* 
> 
>
>   39
>
> ---> 40 from sage.combinat.set_partition import SetPartitions as
> SetPartitions
>   41
>
>   42 def CompleteMatchings(n):
>
>
> /home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny- 
> i686-Linux/local/lib/python2.5/site-packages/sage/combinat/ 
> set_partition.py
> in ()
>   66
>
>   67 from sage.sets.set import Set, EnumeratedSet, is_Set,
> Set_object_enumerated
> ---> 68 import sage.combinat.partition as partition
>
>   69 import sage.rings.integer
>
>   70 import __builtin__
>
>
> /home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny- 
> i686-Linux/local/lib/python2.5/site-packages/sage/combinat/ 
> partition.py
> in ()
>  237 from cartesian_product import CartesianProduct
>
>  238 from integer_list import IntegerListsLex
>
> --> 239 from sage.combinat.root_system.weyl_group import WeylGroup
>
>  240
>
>  241 def Partition(l=None, exp=None, core_and_quotient=None):
>
>
> /home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny- 
> i686-Linux/local/lib/python2.5/site-packages/sage/combinat/ 
> root_system/__init__.py
> in ()
>1
> > 2 # Makes sage.combinat.root_system? equivalent to
> sage.combinat.root_system.root_system?
>3 from root_system import __doc__
>4
>5 # currently needed to activate the backward compatibility
> register_unpickle_override
>6 import type_A
>
> /home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny- 
> i686

[sage-devel] Re: prime_pi for large parallel machines

2009-07-09 Thread Robert Bradshaw

On Jul 9, 2009, at 2:32 AM, Dr. David Kirkby wrote:

> There was some discussion a month or two back about different  
> algorithms
> for prime_pi. IIRC, Mathematica's was the fastest, Sage's was second
> fastest and Maple's method was dumb and just counted them like a 10  
> year
> old could do.

I believe the fastest was some code sitting on Victor Miller's  
laptop, which blew Mathematica away, but I don't think that's hit  
Sage (or production) anywhere yet.

> I pointed out a link to those with accounts on sage.math.users of a
> discussion on the newsgroup comp.unix.solaris about how to get maximum
> performance from a Sun T5240 (the same machine as 't2'). It was  
> quite a
> technical discussion about why old machines can be faster or slower,
> depending how the program is written. Someone wrote a program which
> computed the primes under 10,000 in C, and compared the speed of  
> his old
> machine to his high spec Sun T5240 and showed the old machine was  
> quicker.
>
> (BTW, 't2' has 16 cores and 128 virtual processors)
>
> A Sun employee, Andrew Gabriel, who I happen to know, then re-wrote  
> the
> program for him in a way to exploit the Sun T5240 properly. William
> re-run the program yesterday and found the time drop from 21  
> seconds to
> 0.6 seconds when he used 128 threads.

Yes, that was quite surprising.

> It then occurred to me that perhaps Maple's dumb method of computing
> number of primes under n might be silly on most machines, but might if
> re-written to use a parallel machine properly, it could be the most
> sensible way to do it.

Actually, the clever algorithm is very parallelizable, so you could  
have the best of both worlds.

- Robert


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



[sage-devel] Re: sage installation

2009-07-09 Thread Ralf Hemmecke

> The complete Sage source is contained in any binary distribution of Sage.

I would argue that this statement is wrong unless you defind what 
'complete sage source' actually means.

(1) It means all the python and cython code including the makefiles and 
possibly a few scripts.

(2) It means (1) plus all the source code of the packages that get 
included by default in sage, i.e. maxima, singular, gpm, mpir, atlas, etc.

I'm somewhat sure that 'complete sage source' only means that under (1), 
i.e. basically that what is in the HG repository that comes with every 
Sage distribution. But where is that written?

Speaking in pictures. Sage is "sold" as the car (which refers to (2)) 
and not only the bolts and clue and a few gadgets (which refers to (1)) 
that are needed to make the car from the parts (i.e. 
parts=mpir+atlas+maxima+...).

Thinking of this, a person must get confused with the term 'complete 
sage source'. No?

Thanks for considering this issue in the future.

Ralf

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



[sage-devel] Re: sage installation

2009-07-09 Thread Minh Nguyen

Hi Ralf,

On Thu, Jul 9, 2009 at 9:33 PM, Ralf Hemmecke wrote:
>
>> The complete Sage source is contained in any binary distribution of Sage.
>
> I would argue that this statement is wrong unless you defind what
> 'complete sage source' actually means.

I think I was using the wrong phrase. What I meant was "the complete
Mercurial revision history". This allows people to make patches for
Sage even though they have a binary distro.

-- 
Regards
Minh Van Nguyen

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



[sage-devel] Some bug for conversion from list to polynomial elements?

2009-07-09 Thread Martin Raum

Hi sage-devel,

I just encounted the following strange behaviour:
sage: P = ZZ[x]
sage: l = [randint(-10^4, 10^4) for i in xrange(10^4)]
sage: %timeit h = P(l)
1000 loops, best of 3: 1.43 ms per loop

Now putting zeros at the end :
sage: l += [0 for i in xrange(10^4)]
sage: %timeit h = P(l)
10 loops, best of 3: 326 ms per loop

Using some other list of same length without zeros everything behaves
normally :
sage: l = [randint(-10^4, 10^4) for i in xrange(2*10^4)]
sage: %timeit h = P(l)
100 loops, best of 3: 2.87 ms per loop

This is almost 110 times slower!

Copying the list and removing the trailing zeros doesn't cost much
time :
sage: l = [randint(-10^4, 10^4) for i in xrange(10^4)]
sage: l += [0 for i in xrange(10^4)]
sage: %timeit h = l[:]
1000 loops, best of 3: 243 µs per loop
sage: %time while h[-1] == 0 : del h[-1]
CPU times: user 0.03 s, sys: 0.00 s, total: 0.03 s
Wall time: 0.03 s

I don't know much about the implementation of polynomials in SAGE. So
I'm asking for any comments on this.

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



[sage-devel] Re: sage installation

2009-07-09 Thread Ralf Hemmecke

> Anyway, you are encouraged to use a mirror closest to you for downloading.

But this is not my problem. Of course I used the Berlin mirror.

The problem is the destinction between source and binary distributions 
and what they are good for.

Ralf

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



[sage-devel] Re: prime_pi for large parallel machines

2009-07-09 Thread Dr. David Kirkby

Robert Bradshaw wrote:


> Actually, the clever algorithm is very parallelizable, so you could  
> have the best of both worlds.
> 
> - Robert

That would be interesting. The Mathematica does have some arbitrary 
limit on the maximum size it will handle. I forget what it is, but it 
would be good if Sage could be quicker and work for larger numbers.

Dave

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



[sage-devel] sources

2009-07-09 Thread Ralf Hemmecke

H... looking at
ftp://ftp.fu-berlin.de/unix/misc/sage/src/index.html
I wonder why these files are not zipped.
Shouldn't gzip, bzip2, 7zip be just fine?

What is the rationale behind distributing unzipped tar files?

Just curious...

Ralf

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



[sage-devel] Re: sources

2009-07-09 Thread Minh Nguyen

Hi Ralf,

On Thu, Jul 9, 2009 at 11:12 PM, Ralf Hemmecke wrote:
>
> H... looking at
> ftp://ftp.fu-berlin.de/unix/misc/sage/src/index.html
> I wonder why these files are not zipped.
> Shouldn't gzip, bzip2, 7zip be just fine?
>
> What is the rationale behind distributing unzipped tar files?

Yes, Sage source distributions are tar files:

[mv...@sage mvngu]$ file sage-4.0.2.tar
sage-4.0.2.tar: POSIX tar archive (GNU)

The components that will be compiled live in

SAGE_ROOT/spkg/standard

which is the directory for standard components (or standard Sage
packages). Sage packages or SPKG's have the file extension ".spkg".
These are usually compressed using tar and bzip2 so you can uncompress
using the command "tar -jxf ":

[mv...@sage sage-4.0.2]$ cd spkg/standard/
[mv...@sage standard]$ file cython-0.11.1.p0.spkg
cython-0.11.1.p0.spkg: bzip2 compressed data, block size = 900k
[mv...@sage standard]$ tar -jxf cython-0.11.1.p0.spkg

Further information can be found in the following file:

SAGE_ROOT/spkg/README.txt

-- 
Regards
Minh Van Nguyen

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



[sage-devel] Re: sage installation

2009-07-09 Thread Ralf Hemmecke

> sage -b main
> sage -ba

Thank you for that. That seemed to work and sage starts without throwing 
any error message at me?

I then removed devel/sage-combinat and again did.

./sage -combinat install

Compilation seemed to be ok, but after that, running './sage' results 
in...(see below)

Hmmm, sage-combinat doesn't like me. I give up.

Ralf

==

 >./sage
-- 

| Sage Version 4.0.2, Release Date: 2009-06-18   | 

| Type notebook() for the GUI, and license() for information.| 

-- 

--- 

ImportError   Traceback (most recent call 
last)

/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/IPython/ipmaker.pyc
 
in force_import(modname)
  64 reload(sys.modules[modname]) 

  65 else: 

---> 66 __import__(modname) 

  67 

  68 


/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/bin/ipy_profile_sage.py
 
in ()
   5 preparser(True) 

   6 

> 7 import sage.all_cmdline 

   8 sage.all_cmdline._init_cmdline(globals()) 

   9 


/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/all_cmdline.py
 
in ()
  12 try: 

  13 

---> 14 from sage.all import * 

  15 from sage.calculus.predefined import x 

  16 preparser(on=True) 


/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/all.py
 
in ()
  98 

  99 from sage.server.all import * 

--> 100 import sage.tests.all as tests 

 101 

 102 try: 


/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/tests/all.py
 
in ()
   2 """ 

   3 from sage.modular.modsym.tests import Test as modsym 

> 4 from sage.tests.arxiv_0812_2725 import * 

   5 

   6 


/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/tests/arxiv_0812_2725.py
 
in ()
  38 
#* 

  39 

---> 40 from sage.combinat.set_partition import SetPartitions as 
SetPartitions
  41 

  42 def CompleteMatchings(n): 


/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/combinat/set_partition.py
 
in ()
  66 

  67 from sage.sets.set import Set, EnumeratedSet, is_Set, 
Set_object_enumerated
---> 68 import sage.combinat.partition as partition 

  69 import sage.rings.integer 

  70 import __builtin__ 


/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/combinat/partition.pyc
 
in ()
 237 from cartesian_product import CartesianProduct 

 238 from integer_list import IntegerListsLex 

--> 239 from sage.combinat.root_system.weyl_group import WeylGroup 

 240 

 241 def Partition(l=None, exp=None, core_and_quotient=None): 


/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/combinat/root_system/__init__.py
 
in ()
   1
> 2 # Makes sage.combinat.root_system? equivalent to 
sage.combinat.root_system.root_system?
   3 from root_system import __doc__
   4
   5 # currently needed to activate the backward compatibility 
register_unpickle_override
   6 import type_A

/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/combinat/root_system/root_system.py
 
in ()
  43 from sage.rings.all import ZZ, QQ
  44 from sage.misc.all import cached_method
---> 45 from root_space import RootSpace
  46 from weight_space import WeightSpace
  47

/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/combinat/root_system/root_space.py
 
in ()
   9 
#*
  10
---> 11 from sage.combinat.free_module import CombinatorialFreeModule, 
CombinatorialFreeModuleElement
  12 from root_lattice_realization import RootLatticeRealization, 
RootLatticeRealizationElement
  13 from sage.misc.cachefunc import ClearCacheOnPickle

/home/hemmecke/scratch/sage-4.0.2-linux-Debian_GNU_Linux_5.0_lenny-i686-Linux/local/lib/python2.5/site-packages/sage/combinat/free_module.py
 
in ()
  30 from sage.combinat.combinat import CombinatorialClass
  31 from sage.combinat.cartesian_product import C

[sage-devel] Re: sources

2009-07-09 Thread Willem Jan Palenstijn

On Thu, Jul 09, 2009 at 03:12:27PM +0200, Ralf Hemmecke wrote:
> 
> H... looking at
> ftp://ftp.fu-berlin.de/unix/misc/sage/src/index.html
> I wonder why these files are not zipped.
> Shouldn't gzip, bzip2, 7zip be just fine?
> 
> What is the rationale behind distributing unzipped tar files?

The source tarball is basically a collection of .spkg files, which are
actually .tar.bz2 files. Since all the large files inside the tarball
are already compressed, compressing the main tarball would not shrink it
much, if at all.

-Willem Jan

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



[sage-devel] Re: sources

2009-07-09 Thread Ralf Hemmecke

Thanks. That makes sense.

But as you see, some people (me) ask why these .tar files are not 
zipped. I guess, a small note on the webpage would clarify that.

"""
The .tar files below contain collections of .spkg files (which are 
basically .tar.bz2 files).
"""

Or you put somewhere on that page a link to a .txt file that lists the 
contents of the .tar file. Some project add a manifest.txt file to the 
distribution.

Just my 1/2 cents.

Ralf

On 07/09/2009 03:27 PM, Willem Jan Palenstijn wrote:
> On Thu, Jul 09, 2009 at 03:12:27PM +0200, Ralf Hemmecke wrote:
>> H... looking at
>> ftp://ftp.fu-berlin.de/unix/misc/sage/src/index.html
>> I wonder why these files are not zipped.
>> Shouldn't gzip, bzip2, 7zip be just fine?
>>
>> What is the rationale behind distributing unzipped tar files?
> 
> The source tarball is basically a collection of .spkg files, which are
> actually .tar.bz2 files. Since all the large files inside the tarball
> are already compressed, compressing the main tarball would not shrink it
> much, if at all.
> 
> -Willem Jan

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



[sage-devel] Re: sage-4.1.rc1

2009-07-09 Thread davidloeffler


On Jul 9, 9:02 am, Pat LeSmithe  wrote:
> Minh Nguyen wrote:
> > Note that I have already deleted the experimental repository sage-exp,
> > but the documentation build script (I think) still links to or uses
> > that deleted repository. This might be due to ticket #5350
>
> >http://trac.sagemath.org/sage_trac/ticket/5350
>
> > but I may be wrong here. I don't get the above problem if I make
> > clones of the main repository and don't delete them. But that eats up
> > a lot of disk space, even though /scratch on sage.math is pretty large
> > in terms of storage. And sometimes I remove repositories because I
> > don't need them any more.
>
> Thanks for noting this.  This is one of the problems we're trying to
> eliminate at
>
> http://trac.sagemath.org/sage_trac/ticket/6187
>
> I will try to update the current patches so that the builder does not
> throw an error, if an auto-generated .rst file is missing.
>

I'm seeing a possibly related problem. I have a branch X, in which I
have done a patch that adds lots of files to the reference manual. If
I build docs in branch X, then switch to a different branch Y and try
and build docs there, I get loads of warnings about bad formatting in
the relevant files, since somehow the ReST parser can still see them,
and sees the un-edited versions with non-ReSTified docstrings -- even
though they're not linked into the reference manual in branch Y! How
on earth can this happen?

(In fact the problem is even more severe than that: I can't now build
docs in any other branch except X, because in branch X I added sage/
structure/category_object.pyx to the manual; and without some (minor)
editing that file crashes the documentation builder, due to a slightly
bizarre Cython class that overrides the __doc__ attribute.)

David

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



[sage-devel] Re: sage-4.1.rc1

2009-07-09 Thread Minh Nguyen

On Thu, Jul 9, 2009 at 11:51 PM, davidloeffler wrote:



>> Thanks for noting this.  This is one of the problems we're trying to
>> eliminate at
>>
>> http://trac.sagemath.org/sage_trac/ticket/6187
>>
>> I will try to update the current patches so that the builder does not
>> throw an error, if an auto-generated .rst file is missing.
>>
>
> I'm seeing a possibly related problem. I have a branch X, in which I
> have done a patch that adds lots of files to the reference manual. If
> I build docs in branch X, then switch to a different branch Y and try
> and build docs there, I get loads of warnings about bad formatting in
> the relevant files, since somehow the ReST parser can still see them,
> and sees the un-edited versions with non-ReSTified docstrings -- even
> though they're not linked into the reference manual in branch Y! How
> on earth can this happen?

I'm getting a similar problem with a cloned repository. I'm working on
Cythonizing a Sage library module written in Python. After converting
that module to Cython, I also added some extra documentation to the
docstring of the module. I did create a .pxd file containing relevant
declarations, and have added this new Cythonized module to the list of
Cython modules in the file module_list.py. I don't see a need to touch
the relevant .rst file under doc/en/reference, since I've only changed
the file extension from .py to .pyx. The Cythonized module compiled OK
and all doctests passed. Immediately after making a clone repository
in which to do this Cythonization, I built the reference manual. After
Cythonizing the module, compiled it, and ran all doctests, I rebuilt
the reference manual. However, when I viewed the relevant HTML page of
the reference manual, the extra documentation that I added to the
Cythonized module didn't show up. In fact, that page is the same as it
was prior to the Cythonization.

-- 
Regards
Minh Van Nguyen

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



[sage-devel] Re: sources

2009-07-09 Thread Dr. David Kirkby

Ralf Hemmecke wrote:
> Thanks. That makes sense.
> 
> But as you see, some people (me) ask why these .tar files are not 
> zipped. I guess, a small note on the webpage would clarify that.
> 
> """
> The .tar files below contain collections of .spkg files (which are 
> basically .tar.bz2 files).
> """
> 
> Or you put somewhere on that page a link to a .txt file that lists the 
> contents of the .tar file. Some project add a manifest.txt file to the 
> distribution.
> 
> Just my 1/2 cents.
> 
> Ralf

I would agree with Ralf. The fact the file is already compressed is not 
obvious. In fact, since some of it is not compressed, and each .spkg 
must have some overhead in compression, has anyone ever tried 
compressing the tar file? It might save a few bytes, and reduce 
confusion. (I'm aware it could also increase the size by compressing 
compressed files.) No I have not tried it myself - perhaps I will later.



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



[sage-devel] Re: sources

2009-07-09 Thread Kevin Horton


On 9 Jul 2009, at 10:32, Dr. David Kirkby wrote:

>
> Ralf Hemmecke wrote:
>> Thanks. That makes sense.
>>
>> But as you see, some people (me) ask why these .tar files are not
>> zipped. I guess, a small note on the webpage would clarify that.
>>
>> """
>> The .tar files below contain collections of .spkg files (which are
>> basically .tar.bz2 files).
>> """
>>
>> Or you put somewhere on that page a link to a .txt file that lists  
>> the
>> contents of the .tar file. Some project add a manifest.txt file to  
>> the
>> distribution.
>>
>> Just my 1/2 cents.
>>
>> Ralf
>
> I would agree with Ralf. The fact the file is already compressed is  
> not
> obvious. In fact, since some of it is not compressed, and each .spkg
> must have some overhead in compression, has anyone ever tried
> compressing the tar file? It might save a few bytes, and reduce
> confusion. (I'm aware it could also increase the size by compressing
> compressed files.) No I have not tried it myself - perhaps I will  
> later.
>

I have tried compressing the sage.*.tar files using gzip and bzip2.   
The compression is insignificant, at least when using the default  
compression levels.

  % ls -l *tar*
-rw-r--r--   1 XXX   staff  215244800 Jun 19 08:46 sage-4.0.2.tar
-rw-r--r--   1 XXX   staff  214183786 Jun 19 08:46 sage-4.0.2.tar.gz
-rw-r--r--   1 XXX   staff  215169684 Jun 19 08:46 sage-4.0.2.tar.bz2

But, there is the big advantage that if you have a compressed file you  
are alerted right away if the file is corrupt.  I have had more than  
one occurrence where the tar file was bad, and only found there was a  
problem after several hours of compilation attempt ended in failure.

I would prefer that the tar ball was compressed with gzip, so I can  
know right away whether it is good or bad.  gzip is a better choice  
than bzip2, as it results in slightly smaller file sizes, and it is  
much, much quicker to compress the file, at least on my ancient PPC  
machine.

--
Kevin Horton
Ottawa, Canada




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



[sage-devel] Re: sources

2009-07-09 Thread Harald Schilly

On Jul 9, 5:20 pm, Kevin Horton  wrote:
> I have tried compressing the sage.*.tar files using gzip and bzip2.  
> The compression is insignificant, at least when using the default  
> compression levels.
>
>   % ls -l *tar*
> -rw-r--r--   1 XXX   staff  215244800 Jun 19 08:46 sage-4.0.2.tar
> -rw-r--r--   1 XXX   staff  214183786 Jun 19 08:46 sage-4.0.2.tar.gz
> -rw-r--r--   1 XXX   staff  215169684 Jun 19 08:46 sage-4.0.2.tar.bz2
>

Out of curiosity I tried to use lzma with "7z" in ubuntu linux to
shrink the included spkgs smaller:

in $SAGE/spkg/standard/

for i in *.spkg; do
  echo $i
  tar xjf $i
  7z  a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on $i.7z ${i%\.spkg}
  rm -rf ${i%\.spkg}
done

result:
["insgesamt" = total]

$ du -csh *.spkg | grep insges
205Minsgesamt
$ du -csh *.7z | grep insges
159Minsgesamt
$ echo "159/205" | bc -l
.77560975609756097560

but 7z not installed by default and we would have to include the 7z
sources, compile them, and then do the extraction.

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



[sage-devel] Re: firefox 3.5 and jsmath

2009-07-09 Thread Jason Grout

Davide P. Cervone wrote:
 > OK, I installed Ubuntu linux in a Parallels partition on my Mac, and 
was able to test the problem (it doesn't occur in Windows or Mac 
versions of Firefox).  It appears that Firefox 3.5 no longer handles TTF 
fonts with non-standard encodings.  I have made new versions of the 
fonts that pretends that it uses a standard encoding, and these seem to 
work properly.  I've attached an archive; will you try it out and see if 
they work for you?  If so, I will add them to the font download page.
 >




Wow, that was quick!  It seems to work; I've attached a screenshot of 
the test page so you can see all of the characters.  It looked like the 
correct page, but I didn't compare it character for character.

Thanks again,

Jason


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



[sage-devel] Re: sources

2009-07-09 Thread Dr. David Kirkby

Harald Schilly wrote:
> On Jul 9, 5:20 pm, Kevin Horton  wrote:
>> I have tried compressing the sage.*.tar files using gzip and bzip2.  
>> The compression is insignificant, at least when using the default  
>> compression levels.
>>
>>   % ls -l *tar*
>> -rw-r--r--   1 XXX   staff  215244800 Jun 19 08:46 sage-4.0.2.tar
>> -rw-r--r--   1 XXX   staff  214183786 Jun 19 08:46 sage-4.0.2.tar.gz
>> -rw-r--r--   1 XXX   staff  215169684 Jun 19 08:46 sage-4.0.2.tar.bz2
>>
> 
> Out of curiosity I tried to use lzma with "7z" in ubuntu linux to
> shrink the included spkgs smaller:
> 
> in $SAGE/spkg/standard/
> 
> for i in *.spkg; do
>   echo $i
>   tar xjf $i
>   7z  a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on $i.7z ${i%\.spkg}
>   rm -rf ${i%\.spkg}
> done
> 
> result:
> ["insgesamt" = total]
> 
> $ du -csh *.spkg | grep insges
> 205Minsgesamt
> $ du -csh *.7z | grep insges
> 159Minsgesamt
> $ echo "159/205" | bc -l
> .77560975609756097560
> 
> but 7z not installed by default and we would have to include the 7z
> sources, compile them, and then do the extraction.
> 
> h

A 22% saving in disk space and download time is pretty significant on a 
file as big as the Sage one.

Is the extraction much slower than bz2 ? I know there have been 
competitions to make the best compressor of files, and I recall one 
winning such a competition, but it took a week to do the compression.

I've certainly added things to the .spkg files, then compressed them and 
they are smaller than the oringal ones, simply because I used the -9 
option to bzip2. I don't know if there is a way of getting that directly 
into GNU tar, so it would avoid having to do it in two stages.



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



[sage-devel] Who wants to try the first version of Coin-Or for SAGE ?!

2009-07-09 Thread Nathann Cohen

Hello everybody !!!

After a discussion from a few days ago where I asked for people
interested in a LP Solver in SAGE, I began to write what I could of
it. I have now what seems to be a "minimal" interface between SAGE and
Clp/Cbc( the Coin-or LP Solver and Branch and Bound solver,
respectively ). It uses CBC to solve Linear programs with or without
integer values, and it is now for me the easiest way to use a LP
solver, as I had to generate Cplex or MPS files before to use GLPK or
Cbc...

There are probably a lot of errors, of mistakes, of necessary
modifications which would improve the code. I have never been writing
code for anyone else except myself, so there is bound to be a lot of
things to criticize. I would also like those of you who are interested
in a good implementation of a LP solver in SAGE to try this code,
because I will continue to implement the interface by addings features
to it and it would be better if I avoid now a big mistake I did not
see which would have to be corrected later ;-)

You will find two TRAC tickets for this, the first being a SPKG for
CBC :
http://trac.sagemath.org/sage_trac/ticket/6501

and the second the patch needed to use it :
http://trac.sagemath.org/sage_trac/ticket/6502

Once you will have the two installed, you can try to solve a simple
"maximal independant set problem" with those lines :

g=graphs.RandomGNP(10,.5)

p=MIP(max=True)

obj={}
for i in g.vertices():
obj["V"+str(i)]=1
p.setinteger("V"+str(i))
p.setobj(Constraint(obj,obj=True))
for (a,b,c) in g.edges():
obj={}
obj["V"+str(a)]=1
obj["V"+str(b)]=1
p.addconstraint(Constraint(obj,lt=1))
p.solve()

I hope those who already used LP solvers will find the notations
natural.

Thank you !!! ;-)

Nathann

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



[sage-devel] Re: sources

2009-07-09 Thread Marshall Hampton

Seems like it might be worth it to save 65 MB!  The 7z source is small
and looks pretty portable.

-M. Hampton

On Jul 9, 9:37 am, Harald Schilly  wrote:
> On Jul 9, 5:20 pm, Kevin Horton  wrote:
>
> > I have tried compressing the sage.*.tar files using gzip and bzip2.
> > The compression is insignificant, at least when using the default
> > compression levels.
>
> >   % ls -l *tar*
> > -rw-r--r--   1 XXX   staff  215244800 Jun 19 08:46 sage-4.0.2.tar
> > -rw-r--r--   1 XXX   staff  214183786 Jun 19 08:46 sage-4.0.2.tar.gz
> > -rw-r--r--   1 XXX   staff  215169684 Jun 19 08:46 sage-4.0.2.tar.bz2
>
> Out of curiosity I tried to use lzma with "7z" in ubuntu linux to
> shrink the included spkgs smaller:
>
> in $SAGE/spkg/standard/
>
> for i in *.spkg; do
>   echo $i
>   tar xjf $i
>   7z  a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on $i.7z ${i%\.spkg}
>   rm -rf ${i%\.spkg}
> done
>
> result:
> ["insgesamt" = total]
>
> $ du -csh *.spkg | grep insges
> 205Minsgesamt
> $ du -csh *.7z | grep insges
> 159Minsgesamt
> $ echo "159/205" | bc -l
> .77560975609756097560
>
> but 7z not installed by default and we would have to include the 7z
> sources, compile them, and then do the extraction.
>
> h
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: notebook as a separate project

2009-07-09 Thread kcrisman



>
> > Together with this:
>
> >http://googleblog.blogspot.com/2009/07/introducing-google-chrome-os.html
>
> > it all makes perfect sense to me to be able to do *everything* in the 
> > notebook.
>
> :-)
>
> William

Probably a dumb question, but I assume Sage won't have any problems
running on this as well (as opposed to in the cloud)?  Linux + new
windowing system sounds ok, but figured I'd ask...

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



[sage-devel] Shared libraries - please don't hard-code -shared, -soname, --whole-archive or --no-whole-archive

2009-07-09 Thread Dr. David Kirkby

If you are editing code that creates shared libraries, please be aware 
that the options -shared, -soname, --whole-archive and 
--no-whole-archive will NOT be acceptable on Solaris IF the Sun linker 
is used, but WILL be if the GNU linker is used.


People use both linkers on Solaris, so different options must be used 
when creating shared libraries.

The GNU linker options -shared, -soname, --whole-archive and 
--no-whole-archive  would need to be changed if the Sun linker is used 
on Solaris to -G, -h, -zallextract and -zdefaultextract respectively.

One line of code I looked at recently has this:

$(LINK_CXX) -fPIC -shared -Wl,-soname,lib`cat DIRNAME`.so -o lib`cat 
DIRNAME`.so $(OBJ) $(GMP_LIBDIR) $(GMP_LIB)


The -Wl, option to gcc or g++ passes whatever follows the comma directly 
to the linker. So in the above case, -soname gets passed to the linker, 
which will fail if the OS is Solaris AND the linker is the Sun one.

In scripts, it's easy to create an exception for Solaris with the Sun 
linker, by first checking if the  OS is Solaris (uname returns 'SunOS') 
and checking if the linker (ld) outputs 'GNU' if called with the option 
'--version'

The following is one bit of example code, changes the -soname option to 
a -h using sed.

Obviously different things are appropriate in shell scrips, make files 
and python scripts. But if you can try to create variable names for the 
options it would help.

If you build a package which creates shared   libraries, perhaps you 
make me aware of it, then I see if it breaks on Solaris.

Dave



if [ `uname` = "Darwin" ]; then
echo "64 bit MacIntel"
CFLAGS="-O3 -g -m64 -fPIC -L."; export CFLAGS
LDFLAGS="-m64 "; export LDFLAGS
cp patches/makemakefile.py src/makemakefile.py
elif [ `uname` = "SunOS" -a "`ld  --version  2>&1  | grep GNU`" = ""  ]; 
then
# Change -soname to -h if the Sun linker is used.
sed 's/-soname/-h/g' src/makemakefile.py > /tmp/makemakefile.py.$$
mv /tmp/makemakefile.py.$$ src/makemakefile.py
CFLAGS="-fPIC -O3 -L."; export CFLAGS
LDFLAGS=""; export LDFLAGS
else
CFLAGS="-fPIC -O3 -L."; export CFLAGS
LDFLAGS=""; export LDFLAGS
fi

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



[sage-devel] Re: 64-bit OS X Sage

2009-07-09 Thread Tim Lahey


On Jul 9, 2009, at 2:20 PM, William Stein wrote:

>
> On Wed, Jul 8, 2009 at 9:51 PM, William Stein wrote:
>> Hi,
>>
>> In case anybody wants to try out 64-bit Sage on OS X, I posted a  
>> binary here:
>>
>>   
>> http://wstein.org/home/wstein/binaries/sage-4.1-OSX-10.5-Intel-64bit-i386-Darwin.dmg
>>
>> Sage almost builds out of the box on 64-bit OS X, except scipy and
>> ratpoints both fail, and
>> one has to install a fortran spkg that supports 64bit.  See
>>
>>   http://trac.sagemath.org/sage_trac/ticket/6493
>>
>> (I've fixed both scipy and ratpoints, but refereeing is needed.)
>>
>> 64-bit Sage on OS X is *much* faster than 32-bit in many cases,
>> especially code that relies on MPIR (where a 3-times speedup is not
>> unusual).
>>
>>  -- William
>
> Moreover, I just tried and the full test suite passes too.  Yeah!
>
> The only thing that is in the way of making 64-bit the standard for OS
> X Sage is:
>  (1) auto-downloading the gfortran spkg or something
>  (2) getting the above two spkg's positively reviewed and into Sage.
>
> Even the notebook works fine now, since we upgraded to python 2.6.x
> (this was a problem before).
>
> If you're an intel OS X user and you haven't got excited about 64-bit
> Sage, why not?!?!
>
>  -- William


I've been looking forward to it for some time. I'm currently running  
the test
suite before I start using it as my regular Sage version.

Thanks!

Is there anything specific we need to do for python extensions to get  
them
to build in 64-bit if we want to include them in our Sage scripts?

Cheers,

Tim.


---
Tim Lahey
PhD Candidate, Systems Design Engineering
University of Waterloo
http://www.linkedin.com/in/timlahey


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



[sage-devel] Re: 64-bit OS X Sage

2009-07-09 Thread William Stein

On Wed, Jul 8, 2009 at 9:51 PM, William Stein wrote:
> Hi,
>
> In case anybody wants to try out 64-bit Sage on OS X, I posted a binary here:
>
>   
> http://wstein.org/home/wstein/binaries/sage-4.1-OSX-10.5-Intel-64bit-i386-Darwin.dmg
>
> Sage almost builds out of the box on 64-bit OS X, except scipy and
> ratpoints both fail, and
> one has to install a fortran spkg that supports 64bit.  See
>
>   http://trac.sagemath.org/sage_trac/ticket/6493
>
> (I've fixed both scipy and ratpoints, but refereeing is needed.)
>
> 64-bit Sage on OS X is *much* faster than 32-bit in many cases,
> especially code that relies on MPIR (where a 3-times speedup is not
> unusual).
>
>  -- William

Moreover, I just tried and the full test suite passes too.  Yeah!

The only thing that is in the way of making 64-bit the standard for OS
X Sage is:
  (1) auto-downloading the gfortran spkg or something
  (2) getting the above two spkg's positively reviewed and into Sage.

Even the notebook works fine now, since we upgraded to python 2.6.x
(this was a problem before).

If you're an intel OS X user and you haven't got excited about 64-bit
Sage, why not?!?!

  -- William

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



[sage-devel] Re: 64-bit OS X Sage

2009-07-09 Thread William Stein

On Thu, Jul 9, 2009 at 11:27 AM, Tim Lahey wrote:
>
>
> On Jul 9, 2009, at 2:20 PM, William Stein wrote:
>
>>
>> On Wed, Jul 8, 2009 at 9:51 PM, William Stein wrote:
>>> Hi,
>>>
>>> In case anybody wants to try out 64-bit Sage on OS X, I posted a
>>> binary here:
>>>
>>>   
>>> http://wstein.org/home/wstein/binaries/sage-4.1-OSX-10.5-Intel-64bit-i386-Darwin.dmg
>>>
>>> Sage almost builds out of the box on 64-bit OS X, except scipy and
>>> ratpoints both fail, and
>>> one has to install a fortran spkg that supports 64bit.  See
>>>
>>>   http://trac.sagemath.org/sage_trac/ticket/6493
>>>
>>> (I've fixed both scipy and ratpoints, but refereeing is needed.)
>>>
>>> 64-bit Sage on OS X is *much* faster than 32-bit in many cases,
>>> especially code that relies on MPIR (where a 3-times speedup is not
>>> unusual).
>>>
>>>  -- William
>>
>> Moreover, I just tried and the full test suite passes too.  Yeah!
>>
>> The only thing that is in the way of making 64-bit the standard for OS
>> X Sage is:
>>  (1) auto-downloading the gfortran spkg or something
>>  (2) getting the above two spkg's positively reviewed and into Sage.
>>
>> Even the notebook works fine now, since we upgraded to python 2.6.x
>> (this was a problem before).
>>
>> If you're an intel OS X user and you haven't got excited about 64-bit
>> Sage, why not?!?!
>>
>>  -- William
>
>
> I've been looking forward to it for some time. I'm currently running
> the test
> suite before I start using it as my regular Sage version.
>
> Thanks!
>
> Is there anything specific we need to do for python extensions to get
> them
> to build in 64-bit if we want to include them in our Sage scripts?
>

I think it should "just work", because of the magic of distutils.  If
you have any trouble, let me know.   You should see "-m64" as an
option to gcc when extensions are being built.

William

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



[sage-devel] Re: 64-bit OS X Sage

2009-07-09 Thread Nick Alexander

>  (2) getting the above two spkg's positively reviewed and into Sage.

I have downloaded it and will develop some 64-bit code with it (Drew  
Sutherland's smalljac, for those interested; see #965).  I'll take a  
look at those spkg reviews if I can squeeze some time out of this  
conference.

Nick

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



[sage-devel] Re: Python spkg for OSX framework build

2009-07-09 Thread William Stein

On Thu, Jul 9, 2009 at 2:40 AM, Prabhu
Ramachandran wrote:
>
> Hi,
>
> I've made an SPKG of a framework Python build -- it was really easy.
> The modified spkg-install is on bsd.math.washington.edu as is the spkg,
> they are here:
>
> /Users/Prabhu/spkg-install.python
> /Users/Prabhu/python-2.6.2.p2.spkg
>
> I'm not going to be available tomorrow (I leave in half an hour) but if
> someone wants to try these out please feel free to do so.  I will make a
> VTK spkg this weekend for the framework build and then look at the
> offscreen support.
>

Thanks.  Please see

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

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



[sage-devel] Re: Implementing numerator and denominator for multivariate polynomials [with patch]

2009-07-09 Thread William Stein

On Thu, Jul 9, 2009 at 1:34 AM, John Cremona wrote:
>
> I can see another problem here.    One could argue that the
> denominator of (x+y)/2 was 2 while you code gives 1.  So the
> documentation needs to be very clear, stating that the denominator of
> ever polynomial in any number of variables over a field is always 1.
>
> John

John raises an extremely important and subtle point.  This is a
*MAJOR* problem since currently we have
{{{
sage: R. = QQ[]
sage: denominator(x/2)
2
}}}
however you're proposing making it so
{{{
sage: R. = QQ[]
sage: denominator(x/2)
1
}}}

That's very worrisome, simply because it is inconsistent.  Either you
change the existing code for univariate polynomials, hence break
backwards compatible that can possibly result in subtle errors all
over the place (in the sage library and in random user code "out
there"), or you change the semantics of denominator for multivariate
polynomials to be consistent with the semantics for univariate
polynomials.

For the record, Magma has a Denominator function that is defined for
about 15-20 different types, but does not apply to multivariate
polynomials.


>
> 2009/7/9 luisfe :
>>
>> Hi,
>>
>> Some days ago I sent a bug report using the notebook link to the
>> google docs
>> form. I am unable to find that bug report on the web.
>>
>> Anyway as the thing is trivial I wrote a patch myself.
>>
>> The problem is that multivariate polynomials do not admit numerator
>> and
>> denominator
>>
>> sage: K.=QQ['x,y']
>> sage: f=x+y
>> sage: numerator(f)
>> ---
>> AttributeError                            Traceback (most recent call
>> last)
>>
>> /home/luisfe/.sage/temp/mychabol/5681/
>> _home_luisfe__sage_init_sage_0.py in
>> ()
>>
>> /opt/SAGE/sage/local/lib/python2.5/site-packages/sage/misc/
>> functional.pyc in
>> numerator(x)
>>    686     if isinstance(x, (int, long)):
>>    687         return x
>> --> 688     return x.numerator()
>>    689
>>    690 def numerical_approx(x, prec=None, digits=None):
>>
>> AttributeError: 'sage.rings.polynomial.multi_polynomial_libsingular'
>> object
>> has no attribute 'numerator'
>>
>>
>> Although numerator and denominator are expectoed for rational
>> functions only
>> they might be needed, once would like to write an algorithm valid for
>> both
>> polynomials and rational functions, for example the following code in
>> the same
>> session:
>>
>> sage: g=y
>> sage: h=1-y
>> sage: (f/(g)).numerator()
>> x + y
>> sage: (f/(g+h)).denominator()
>> ---
>> AttributeError                            Traceback (most recent call
>> last)
>>
>> /home/luisfe/.sage/temp/mychabol/5681/
>> _home_luisfe__sage_init_sage_0.py in
>> ()
>>
>> AttributeError: 'sage.rings.polynomial.multi_polynomial_libsingular'
>> object
>> has no attribute 'denominator'
>>
>> In the first case, the fraction is created and the numerator has a
>> meaning. In
>> the second the fraction is never created and the code fails.
>>
>> I have writen a trivial patch for the class MPolynomial. I am not sure
>> if
>> denominator should return 1 or self.parent(one) I write 1 because it
>> seems
>> inoffensive to me
>>
>> diff -r 2e793d2a0e12 sage/rings/polynomial/multi_polynomial.pyx
>> --- a/sage/rings/polynomial/multi_polynomial.pyx        Thu Jun 18
>> 23:52:34
>> 2009 -0700
>> +++ b/sage/rings/polynomial/multi_polynomial.pyx        Thu Jul 09
>> 00:05:29
>> 2009 -0700
>> @@ -980,6 +980,28 @@
>>         from sage.structure.factorization import Factorization
>>         return Factorization(v, unit)
>>
>> +    def numerator(self):
>> +        """
>> +        Numerator of a polynomial
>> +
>> +        EXAMPLES:
>> +        sage: K. = QQ['x,y']
>> +        sage: f = x + y
>> +        sage: f.numerator()
>> +        x + y
>> +        """
>> +        return self
>> +
>> +    def denominator(self):
>> +        """
>> +        Denominator of a polynomial
>> +        EXAMPLES:
>> +        sage: K. = QQ['x,y']
>> +        sage: f = x + y
>> +        sage: f.denominator()
>> +        1
>> +        """
>> +        return 1
>>
>>
>>  cdef remove_from_tuple(e, int ind):
>>
>> >
>>
>
> >
>



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



[sage-devel] Re: SPKG computing modular cohomology rings of finite p-groups

2009-07-09 Thread William Stein

On Wed, Jul 8, 2009 at 6:52 PM, Simon King wrote:
>
> Dear Sage-Devel,
>
> I'd like to announce our Sage package for the computation of
> cohomology rings with coefficients in GF(p) for finite p-groups.
>
> The trac ticket is at http://trac.sagemath.org/sage_trac/ticket/6491
> and the documentation at 
> http://sage.math.washington.edu/home/SimonKing/Cohomology/

I added the spkg to experimental right off, so people can just do

   sage -i p_group_cohomology-1.0

It would be very useful if you could post on the ticket *PRECISELY*
what you think a person should do to referee it and sign off on it
being officially added to the optional package repo.
I.e.,

  1. Install on the following hardware/OS combos as follows.

  2. Run the following commands (and here is what should happen).

  3. Look in the spkg and read the following, checking for ...:

Whether or not the referee will agree that this is enough testing is
up to them.   However, it will be tremendously helpful to get them
going.

> Let me draw your attention to the fact that with this package we were
> able to compute the cohomology rings for all groups of order 128 and
> for all but six groups of order 243. These data are available on
> sage.math, and the package is able to download them. The result for
> the groups of order 64 are included in the package.
>
> Note that these computations for order 128 and 243 seemed to be far
> beyond the realm of possibilities. As much as I know, Sage is
> currently the only CAS that can do those things (only with the
> package, of course).
>
> Since it depends on the SmallGroups library being installed, the
> package can only be an optional package. Actually I don't know the
> inclusion procedure for new packages, but I am sure you will tell
> me...
>
> Cheers,
>    Simon
>
> >
>



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



[sage-devel] Test failures in mpfr - now I know why, and it is VERY ODD.

2009-07-09 Thread Dr. David Kirkby
Some time back I reported some test failures to the mpfr list, which 
occurred on one Solaris 10 machine (a Sun T5240 called 't2') but not on 
another, which is my own personal machine called 'kestrel'

I showed the results of the test failures compiled with different levels 
of opimisation.

t2  -O2 20
t2  -O1  20
t2none0
kestrel -O2 0
kestrel -O1  untested
kestrel   none  0


Vincent Lefevre, and MPFR developer wrote:


 > Dear David,
 >
 > On 2009-07-01 13:18:23 +0200, david.kir...@onetel.net wrote:
 >> Machine  Optimiation Failures
 >>
 >> t2  -O2 20
 >> t2  -O1  20
 >> t2none0
 >> kestrel -O2 0
 >> kestrel -O1  untested
 >> kestrel   none  0
 >>
 >> (kestrel runs Solaris 10 update 6)
 >> (t2 runs Solaris 10 update 4)
 >
 > If I understand correctly, the failures come from an optimization
 > bug in Solaris 10 update 4.
 >

I believe I have got to the bottom of this.

It would appear that MPFR decides to use gcc from /usr/sfw/bin, despite 
the fact that is NOT the first compiler in the path. I would have 
thought it normal for a configure script to use the first version of gcc 
in the path, unless another is specifically stated, but this is not the 
case.

There are at least two version of gcc on this machine.

1) /usr/sfw/bin/gcc comes with Solaris.

kir...@t2:[/tmppool/kirkby] $ /usr/sfw/bin/gcc --version
gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath


2) /usr/local/gcc-4.4.0-sun-linker/bin/gcc
which I built

kir...@t2:[/tmppool/kirkby] $ /usr/local/gcc-4.4.0-sun-linker/bin/gcc 
--version
gcc (GCC) 4.4.0


Now look at my PATH

kir...@t2:[/tmppool/kirkby] $ echo $PATH
/usr/local/gcc-4.4.0-sun-linker/bin:/usr/local/bin2:/usr/bin:/usr/ccs/bin:/usr/local/bin:/usr/sfw/bin:/bin:/usr/sbin
kir...@t2:[/tmppool/kirkby] $


- /usr/local/gcc-4.4.0-sun-linker/bin is *BEFORE* /usr/sfw/bin. So I 
would expect that if I type 'which gcc' it would report the one in 
/usr/local/gcc-4.4.0-sun-linker/bin, and the version as 4.4.0 right?


kir...@t2:[/tmppool/kirkby] $ which gcc
/usr/local/gcc-4.4.0-sun-linker/bin/gcc
kir...@t2:[/tmppool/kirkby] $ gcc --version
gcc (GCC) 4.4.0


So far so good. Now see what happens when I run the mpfr configure 
script after an rm -rf and fresh extraction of the tar.gz file

kir...@t2:[/tmppool/kirkby] $ rm -rf mpfr-2.4.1
kir...@t2:[/tmppool/kirkby] $ tar xfz $HOME/mpfr-2.4.1.tar.gz
kir...@t2:[/tmppool/kirkby] $ cd mpfr-2.4.1
kir...@t2:[/tmppool/kirkby/mpfr-2.4.1] $ echo $PATH
/usr/local/gcc-4.4.0-sun-linker/bin:/usr/local/bin2:/usr/bin:/usr/ccs/bin:/usr/local/bin:/usr/sfw/bin:/bin:/usr/sbin
kir...@t2:[/tmppool/kirkby/mpfr-2.4.1] $ echo $CC

kir...@t2:[/tmppool/kirkby/mpfr-2.4.1] $ which gcc
/usr/local/gcc-4.4.0-sun-linker/bin/gcc
kir...@t2:[/tmppool/kirkby/mpfr-2.4.1] $ ./configure
checking for a BSD-compatible install... ./install-sh -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking whether to disable maintainer-specific portions of Makefiles... yes
checking build system type... sparc-sun-solaris2.10
checking host system type... sparc-sun-solaris2.10
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/sfw/bin/ggrep
checking for egrep... /usr/sfw/bin/ggrep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for CC and CFLAGS in gmp.h... yes CC=/usr/sfw/bin/gcc 
CFLAGS=-m32 -O2 -pedantic -Wa,-xarch=v8plus -mcpu=ultrasparc
checking for CC=/usr/sfw/bin/gcc and CFLAGS=-m32 -O2 -pedantic 
-Wa,-xarch=v8plus -mcpu=ultrasparc... yes
checking for ICC... no
checking whether /usr/sfw/bin/gcc and cc understand -c and -o 
together... yes
checking for function prototypes... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes

This implies gmp.h has been read, and the variable CC picked up from 
there. Why would a header file have CC or CFLAGS in them? I've never 
come across a header file like that, but there is always a first time.

Anyway, looking at how the compiler was built.

kir...@t2:[/tmppool/kirkby] $ gcc -v
Using built-in specs.
Target: sparc-sun-solaris2.10
Configured with: /home/kirk

[sage-devel] Re: 64-bit OS X Sage

2009-07-09 Thread Tim Lahey


On Jul 9, 2009, at 2:20 PM, William Stein wrote:

>
> Moreover, I just tried and the full test suite passes too.  Yeah!
>


I had two failures,

sage -t  "devel/sage/doc/en/bordeaux_2008/birds_other.rst"
A mysterious error (perhaps a memory error?) occurred, which may have  
crashed doctest.
 [121.0 s]
sage -t  "devel/sage/sage/modules/vector_double_dense.pyx"
/Users/tjlahey/sage/local/lib/python/site-packages/scipy/stats/ 
mstats.py:3: DeprecationWarning: functions overriding  
warnings.showwarning() must support the 'line' argument
   from mstats_basic import *
**
File "/Users/tjlahey/sage/devel/sage/sage/modules/ 
vector_double_dense.pyx", line 656:
 sage: v.stats_kurtosis()
Expected:
 -1.23
Got:
 doctest:106: SyntaxWarning: assertion is always true, perhaps  
remove parentheses?
 -1.23
**
1 items had failures:
1 of   6 in __main__.example_29
***Test Failed*** 1 failures.
For whitespace errors, see the file /Users/tjlahey/sage/ 
tmp/.doctest_vector_double_dense.py
 [4.9 s]

However, both passed on the second time when run in isolation.

Cheers,

Tim.

---
Tim Lahey
PhD Candidate, Systems Design Engineering
University of Waterloo
http://www.linkedin.com/in/timlahey


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



[sage-devel] Re: sources

2009-07-09 Thread Dr. David Kirkby

Harald Schilly wrote:
> On Jul 9, 6:48 pm, Marshall Hampton  wrote:
>> Seems like it might be worth it to save 65 MB!  The 7z source is small
>> and looks pretty portable.
>>
>> -M. Hampton
> 
> I don't know about other linux distributions besides ubuntu, mac osx
> or solaris, but if it is everywhere available as a package, we could
> use it directly.
> p7zip is cross platform for all posix systems (and in windows, there
> is already 7-zip.org)
> so, http://p7zip.sourceforge.net/ might be what we need?

I'll find out about Solaris. It is in Solaris 10 update 6, but I'm not 
so sure if it will be in the earlier releases of Solaris 10.


I have a feeling it might just be missing in some of the earlier ones. 
I'll find out.

dave



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



[sage-devel] Re: sources

2009-07-09 Thread Harald Schilly

On Jul 9, 6:48 pm, Marshall Hampton  wrote:
> Seems like it might be worth it to save 65 MB!  The 7z source is small
> and looks pretty portable.
>
> -M. Hampton

I don't know about other linux distributions besides ubuntu, mac osx
or solaris, but if it is everywhere available as a package, we could
use it directly.
p7zip is cross platform for all posix systems (and in windows, there
is already 7-zip.org)
so, http://p7zip.sourceforge.net/ might be what we need?

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



[sage-devel] Re: sources

2009-07-09 Thread Dr. David Kirkby

Harald Schilly wrote:
> On Jul 9, 6:48 pm, Marshall Hampton  wrote:
>> Seems like it might be worth it to save 65 MB!  The 7z source is small
>> and looks pretty portable.
>>
>> -M. Hampton
> 
> I don't know about other linux distributions besides ubuntu, mac osx
> or solaris, but if it is everywhere available as a package, we could
> use it directly.
> p7zip is cross platform for all posix systems (and in windows, there
> is already 7-zip.org)
> so, http://p7zip.sourceforge.net/ might be what we need?

I've found out that was not introduced into Solaris until the May 2008 
edition, so its existance can not be assumed on Solaris and therefore 
the sources would need to be included.

There's a hint about the problem here.

http://sunsolve.sun.com/search/document.do?assetkey=1-9-250526-1

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



[sage-devel] Re: [MPFR] Test failures in mpfr - now I know why, and it is VERY ODD.

2009-07-09 Thread Paul Zimmermann

   Dear David,

as Vincent Lefèvre said, the fact that MPFR uses the same CC/CFLAGS as GMP 
(by reading them in gmp.h) is a new feature that solves many problems.

However in your case it seems the Solaris compiler (which was used to compile
GMP) fails to correctly compile MPFR.

Either you can try to investigate more the errors produced with the Solaris
compiler (but this is an old version of gcc, and more likely they are bugs
fixed either in gcc or in the Solaris port).

Or you can configure MPFR with CC=/usr/local/gcc-4.4.0-sun-linker/bin/gcc
to force the use of gcc 4.4.0.

You can also recompile GMP with gcc 4.4.0. Then MPFR will automatically pick
the right compiler.

Paul Zimmermann

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



[sage-devel] Re: [MPFR] Test failures in mpfr - now I know why, and it is VERY ODD.

2009-07-09 Thread Dr. David Kirkby

Paul Zimmermann wrote:
>Dear David,
> 
> as Vincent Lefèvre said, the fact that MPFR uses the same CC/CFLAGS as GMP 
> (by reading them in gmp.h) is a new feature that solves many problems.
> 
> However in your case it seems the Solaris compiler (which was used to compile
> GMP) fails to correctly compile MPFR.

I started with gcc 3.4.3 in /usr/sfw/bin and used that to build both gmp 
and mpfr. Both passed all tests.

I then built gcc 4.4.0.

When building mpfr with gcc 4.4.0 on one machine it works fine, on the 
other there are 20 test failures.

> Either you can try to investigate more the errors produced with the Solaris
> compiler (but this is an old version of gcc, and more likely they are bugs
> fixed either in gcc or in the Solaris port).

The older compiler actually compiles mpfr ok. It's gcc 4.4.0 which does 
not. But it does on another SPARC machine.

Since I built gmp, mpfr and gcc 4.4.0 in an almost identical fashion on 
the two machines, I'm puzzled one works and the other does not.

> Or you can configure MPFR with CC=/usr/local/gcc-4.4.0-sun-linker/bin/gcc
> to force the use of gcc 4.4.0.

Done that, and it still fails.

> You can also recompile GMP with gcc 4.4.0. Then MPFR will automatically pick
> the right compiler.

I'm beginning to suspect gcc 4.4.0 now. But as I say, that compiler is 
fine on my own machine. I built both compilers from source myself. Both 
use the Sun linker and assembler. Both were built with the same version 
of gcc in /usr/sfw/bin.

And despite compiling 100's of MB's of code in Sage, MPFR is the only 
one I know to be causing problems.



> Paul Zimmermann
> 


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



[sage-devel] Re: [MPFR] Test failures in mpfr - now I know why, and it is VERY ODD.

2009-07-09 Thread Dr. David Kirkby

Vincent Lefevre wrote:
> On 2009-07-09 22:30:35 +0100, Dr. David Kirkby wrote:
>> It would appear that MPFR decides to use gcc from /usr/sfw/bin,
>> despite the fact that is NOT the first compiler in the path. I would
>> have thought it normal for a configure script to use the first
>> version of gcc in the path, unless another is specifically stated,
>> but this is not the case.
> 
> As of version 2.4.0, MPFR uses by default the same compiler as the one
> used to build GMP (value of __GMP_CC from gmp.h), if this information
> is available. This is in the NEWS file:
> 
> - Get default $CC and $CFLAGS from gmp.h (__GMP_CC / __GMP_CFLAGS,
>   which are available as of GMP 4.2.3).
> 
> The reason is that the GMP configure script doesn't necessarily
> selects the default compiler (as chosen by autoconf), and if the
> compiler doesn't match, the MPFR build can fail (in the past, we
> had many bug reports because of that, even though this wasn't
> MPFR's fault). You can override that by setting CC:
> 
>   ./configure ... CC=gcc
> 

Was it at the build stage, or during testing?

This works fine on my Blade 2000 (Solaris 10 update 4), but I still get 
20 failures on the T5240. The latter machine has been updated from 
Solaris 10 update 4 to Solaris 10 update 7 in the last day or so.

Both machines have the same version of gcc (4.4.0), configured with the 
same version versions of gmp (4.3.1) and mpfr (2.4.1).



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



[sage-devel] Re: Quaternion Algebra on Q(i) and Cocompact/Uniform Lattices in SL2(Z[i])

2009-07-09 Thread Leonard Foret

Excellent, will do.  That was my original idea, but I was thrown off a
bit by the request for membership.  Anyway, the request went through
so I'll re-post this there.

Thanks,
Lenny

On Jul 9, 4:24 am, John Cremona  wrote:
> It's clear what your algebra is:  over the base field K=Q(i) it's the
> quaternion algebra with parameters 2,5.
>
> I think that sage-nt would be a better forum for this than sage-devel.
>  Ask to join (athttp://groups.google.co.uk/group/sage-nt).
>
> John
>
> 2009/7/9 Leonard Foret :
>
>
>
> > The problem is about finding co-compact lattices in SL(2, C) by using
> > quaternion algebras.
>
> > The example we are working out now is based on the Quaternion algebra
> > over Q(i) defined by the quadratic extension Q(i)[X]/(X^2 - 2) and
> > additional (non-commutative) relation s^2  = 5.
>
> > We need the algebra to be over Q(i) - that's important for the
> > construction  of the lattice.
>
> > The lattice is constructed by collecting the elements of the algebra
> > of reduced norm 1 with and with coefficients in the ring of Gaussian
> > integers. The reduced norm is defined by using the left multiplication
> > by an element on the algebra.
>
> > It is possible to figure out how long I should compute before getting
> > all the generators of the lattice, but the idea is to avoid the use of
> > the corresponding theory for this example, and try to work out an
> > approach for any particular case.
>
> > Finding the elements of norm one is related to solving Diophantine
> > equations over Z. Do you know if there is a software for finding
> > generators of groups (like the one we are dealing with in our
> > example)?
>
> > On Jul 7, 9:41 pm, William Stein  wrote:
> >> On Sat, Jul 4, 2009 at 8:39 PM, Leonard Foret wrote:
>
> >> > Hello all,
>
> >> > This is my first time in sage-devel.  I have a project with a
> >> > professor til the end of August to construct cocompact/uniform
> >> > lattices on SL2(Z[i]) basically by quaternion algebras.
>
> >> What is a "lattice on SL2(Z[i])"?
>
> >> >   I figure that
> >> > since I'm writing code using python and sage, I might as well do it
> >> > right and incorporate it into sage.
>
> >> Yes, definitely.
>
> >> >  The two contributions I could
> >> > make to sage would be 1) to redo a polished version of the code which
> >> > computes the generators of elements of reduced norm one within a
> >> > certain radius for an explicit example (hopefully extend it to a
> >> > general skew field/quaternion algebra)
>
> >> Good.
>
> >> >  and 2) functionality for
> >> > quaternion algebras over the field Q(i) rather than Q.
>
> >> What functionality do you want to add?
>
> >> > What I have right now are some python/sage code which looks at the
> >> > quaternion algebra over Q(i) given by the field extension Q(i)(sqrt
> >> > (2)) over Q(i)  and the added relation j^2 = 5, (similar to the
> >> > construction that's already implemented over Q).
>
> >> As a non-commutative ring, isn't that precisely exactly the same thing as
> >> the quaternion algebra
>
> >> sage: R. = QuaternionAlgebra(-1,5)
> >> sage: R
> >> Quaternion Algebra (-1, 5) with base ring Rational Field
>
> >> already in Sage?  Is the point just that you're viewing it differently
> >> as a quadratic
> >> extension of Q(i)?
>
> >> >  The resulting algebra
> >> > produces a lattice which will be cocompact/uniform and I've
> >> > implemented the following algorithms:
>
> >> Which lattice?  In what space?
>
> >> > 1) compute the elements of reduced norm one within a ball.
>
> >> elements in what?
>
> >> > 2) compute left multiplication by an element
>
> >> left multiplication on what?
>
> >> > 3) compute a norm for these elements (that is, by a norm for the
> >> > matrix computed in 2)
>
> >> > When the elements of reduced norm one are considered with
> >> > multiplication, they form a group and the following algorithm is
> >> > applicable:
> >> > 4) compute generators for the elements of reduced norm one.
>
> >> > The trouble with algorithm 4 and 1, is that it's by complete brute
> >> > force to the point where the algorithm works but I don't know how long
> >> > it would take to find all of them (for 1 there's infinitely many).
>
> >> Since you seem to be doing this for exactly the 1 single ring
> >> Q(i)(sqrt(2)), shouldn't you know?
>
> >> > As for adding functionality to Quaternion Algebra I would like to work
> >> > on the following:
> >> > 1)  extend .is_division_algebra()  to the base field Q(i).
> >> > 2) .is_anisotropic()
> >> > 3) and any others.
>
> >> > I'm a beginning graduate student at the Florida International
> >> > University and am working closely with a professor there.  If anyone
> >> > is interested or can offer any advice (books, articles to read, ideas
> >> > for the algorithms, etc), it would be well received and I'll implement
> >> > them immediately.
>
> >> > Thanks in advance!
> >> > Leonard Foret
>
> >> --
> >> William Stein
> >> Associate Professor of Mathematics
> >> University

[sage-devel] Re: Quaternion Algebra on Q(i) and Cocompact/Uniform Lattices in SL2(Z[i])

2009-07-09 Thread Leonard Foret

Is possible to change the name of this discussion?  I made a mistake,
the lattice is in SL(2, CC) and not SL(2, Z[i]).

Lenny

On Jul 9, 8:02 pm, Leonard Foret  wrote:
> Excellent, will do.  That was my original idea, but I was thrown off a
> bit by the request for membership.  Anyway, the request went through
> so I'll re-post this there.
>
> Thanks,
> Lenny
>
> On Jul 9, 4:24 am, John Cremona  wrote:
>
> > It's clear what your algebra is:  over the base field K=Q(i) it's the
> > quaternion algebra with parameters 2,5.
>
> > I think that sage-nt would be a better forum for this than sage-devel.
> >  Ask to join (athttp://groups.google.co.uk/group/sage-nt).
>
> > John
>
> > 2009/7/9 Leonard Foret :
>
> > > The problem is about finding co-compact lattices in SL(2, C) by using
> > > quaternion algebras.
>
> > > The example we are working out now is based on the Quaternion algebra
> > > over Q(i) defined by the quadratic extension Q(i)[X]/(X^2 - 2) and
> > > additional (non-commutative) relation s^2  = 5.
>
> > > We need the algebra to be over Q(i) - that's important for the
> > > construction  of the lattice.
>
> > > The lattice is constructed by collecting the elements of the algebra
> > > of reduced norm 1 with and with coefficients in the ring of Gaussian
> > > integers. The reduced norm is defined by using the left multiplication
> > > by an element on the algebra.
>
> > > It is possible to figure out how long I should compute before getting
> > > all the generators of the lattice, but the idea is to avoid the use of
> > > the corresponding theory for this example, and try to work out an
> > > approach for any particular case.
>
> > > Finding the elements of norm one is related to solving Diophantine
> > > equations over Z. Do you know if there is a software for finding
> > > generators of groups (like the one we are dealing with in our
> > > example)?
>
> > > On Jul 7, 9:41 pm, William Stein  wrote:
> > >> On Sat, Jul 4, 2009 at 8:39 PM, Leonard Foret wrote:
>
> > >> > Hello all,
>
> > >> > This is my first time in sage-devel.  I have a project with a
> > >> > professor til the end of August to construct cocompact/uniform
> > >> > lattices on SL2(Z[i]) basically by quaternion algebras.
>
> > >> What is a "lattice on SL2(Z[i])"?
>
> > >> >   I figure that
> > >> > since I'm writing code using python and sage, I might as well do it
> > >> > right and incorporate it into sage.
>
> > >> Yes, definitely.
>
> > >> >  The two contributions I could
> > >> > make to sage would be 1) to redo a polished version of the code which
> > >> > computes the generators of elements of reduced norm one within a
> > >> > certain radius for an explicit example (hopefully extend it to a
> > >> > general skew field/quaternion algebra)
>
> > >> Good.
>
> > >> >  and 2) functionality for
> > >> > quaternion algebras over the field Q(i) rather than Q.
>
> > >> What functionality do you want to add?
>
> > >> > What I have right now are some python/sage code which looks at the
> > >> > quaternion algebra over Q(i) given by the field extension Q(i)(sqrt
> > >> > (2)) over Q(i)  and the added relation j^2 = 5, (similar to the
> > >> > construction that's already implemented over Q).
>
> > >> As a non-commutative ring, isn't that precisely exactly the same thing as
> > >> the quaternion algebra
>
> > >> sage: R. = QuaternionAlgebra(-1,5)
> > >> sage: R
> > >> Quaternion Algebra (-1, 5) with base ring Rational Field
>
> > >> already in Sage?  Is the point just that you're viewing it differently
> > >> as a quadratic
> > >> extension of Q(i)?
>
> > >> >  The resulting algebra
> > >> > produces a lattice which will be cocompact/uniform and I've
> > >> > implemented the following algorithms:
>
> > >> Which lattice?  In what space?
>
> > >> > 1) compute the elements of reduced norm one within a ball.
>
> > >> elements in what?
>
> > >> > 2) compute left multiplication by an element
>
> > >> left multiplication on what?
>
> > >> > 3) compute a norm for these elements (that is, by a norm for the
> > >> > matrix computed in 2)
>
> > >> > When the elements of reduced norm one are considered with
> > >> > multiplication, they form a group and the following algorithm is
> > >> > applicable:
> > >> > 4) compute generators for the elements of reduced norm one.
>
> > >> > The trouble with algorithm 4 and 1, is that it's by complete brute
> > >> > force to the point where the algorithm works but I don't know how long
> > >> > it would take to find all of them (for 1 there's infinitely many).
>
> > >> Since you seem to be doing this for exactly the 1 single ring
> > >> Q(i)(sqrt(2)), shouldn't you know?
>
> > >> > As for adding functionality to Quaternion Algebra I would like to work
> > >> > on the following:
> > >> > 1)  extend .is_division_algebra()  to the base field Q(i).
> > >> > 2) .is_anisotropic()
> > >> > 3) and any others.
>
> > >> > I'm a beginning graduate student at the Florida International
> > >> > University and am working closely wi

[sage-devel] Fwd: reference to SAGE

2009-07-09 Thread William Stein

Harald,

Another paper that cites Sage!  The abstract begins "We show that the
generating function of electrically charged 1/2-BPS states in N=4
supersymmetric CHL Z_N orbifolds of the heterotic string on T^6 are
given by multiplicative eta-products. [...]"  It's a good thing David
Loeffler added eta products to Sage...

 -- William


-- Forwarded message --
From: Suresh Govindarajan 
Date: Thu, Jul 9, 2009 at 5:10 PM
Subject: reference to SAGE
To: William Stein 


Dear Prof. Stein,

In my recent paper:http://arxiv.org/abs/0907.1410 , we have referred
to SAGE. I would like to thank you as well as other contributors to
SAGE.
With best wishes,
Suresh

--
Suresh Govindarajan




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



[sage-devel] Fwd: reference to SAGE

2009-07-09 Thread William Stein

-- Forwarded message --
From: Suresh Govindarajan 
Date: Thu, Jul 9, 2009 at 5:35 PM
Subject: Re: reference to SAGE
To: William Stein 


As I don't use SAGE a lot, I was unaware of the fact that you folks
had added eta products to SAGE! I will, of course, take a look at it
now. However, I found a lot of practical use especially with regard to
weight two Eisenstein series at various levels.
Suresh

2009/7/10 William Stein 
>
> Harald,
>
> Another paper that cites Sage!  The abstract begins "We show that the
> generating function of electrically charged 1/2-BPS states in N=4
> supersymmetric CHL Z_N orbifolds of the heterotic string on T^6 are
> given by multiplicative eta-products. [...]"  It's a good thing David
> Loeffler added eta products to Sage...
>
>  -- William
>
>
> -- Forwarded message --
> From: Suresh Govindarajan 
> Date: Thu, Jul 9, 2009 at 5:10 PM
> Subject: reference to SAGE
> To: William Stein 
>
>
> Dear Prof. Stein,
>
> In my recent paper:http://arxiv.org/abs/0907.1410 , we have referred
> to SAGE. I would like to thank you as well as other contributors to
> SAGE.
> With best wishes,
> Suresh
>
> --
> Suresh Govindarajan
>
>
>
>
> --
> William Stein
> Associate Professor of Mathematics
> University of Washington
> http://wstein.org



--
Suresh Govindarajan



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



[sage-devel] Re: Fwd: reference to SAGE

2009-07-09 Thread Dr. David Kirkby

William Stein wrote:
> Harald,
> 
> Another paper that cites Sage!  The abstract begins "We show that the
> generating function of electrically charged 1/2-BPS states in N=4
> supersymmetric CHL Z_N orbifolds of the heterotic string on T^6 are
> given by multiplicative eta-products. [...]"  It's a good thing David
> Loeffler added eta products to Sage...
> 
>  -- William


I think it is particularly good that this is not a maths paper. Examples 
of Sage in other fields would be particularly useful I think to stick on 
Wikipedia.


Wolfram Research make quite a big thing about how Mathematica is used in 
numerous different fields. Note the right had side of this page

http://www.wolfram.com/products/mathematica/index.html

with lists of the industries its used in.


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



[sage-devel] Should alpah/beta/rc releases note this at runtime?

2009-07-09 Thread Dr. David Kirkby

I just noticed an old thread, where a user had problems on squite, 
making his own version of some packages with an alpha, heta or rc 
release of Sage.

It would be good if alpha/beta/rc releases always showed a message that 
they were pre-release versions for developers and not considered stable.

If there was some automatic way of making this happen, it would avoid 
the risk of someone forgetting to add or delete a file.


Dave

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



[sage-devel] Looking for reviewer for patch which adds -fPIC on Solaris

2009-07-09 Thread Dr. David Kirkby

I had a problem on Solaris which was traced to not having the compiler 
flag -fPIC when building a shared library. So I submitted a patch to add 
that.

Someone had tried to do it before, but had no succeeded, so I removed 
their failed attempt, and stuck mine which actually does add the needed 
flag.

http://sagetrac.org/sage_trac/ticket/6445

If someone could look at that it would be useful, As you can see, it is 
only applied on Solaris. It's possible it should be applied on FreeBSD 
too, but I don't know. I'm aware one of the FreeBSD develoopers had to 
add -fPIC to some bit of code.


Dave

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



[sage-devel] Re: Should alpah/beta/rc releases note this at runtime?

2009-07-09 Thread John H Palmieri

On Jul 9, 6:06 pm, "Dr. David Kirkby"  wrote:
> I just noticed an old thread, where a user had problems on squite,
> making his own version of some packages with an alpha, heta or rc
> release of Sage.
>
> It would be good if alpha/beta/rc releases always showed a message that
> they were pre-release versions for developers and not considered stable.
>
> If there was some automatic way of making this happen, it would avoid
> the risk of someone forgetting to add or delete a file.

See < http://trac.sagemath.org/sage_trac/ticket/6505>.  How does that
look?

  John

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



[sage-devel] Re: Should alpah/beta/rc releases note this at runtime?

2009-07-09 Thread Minh Nguyen

On Fri, Jul 10, 2009 at 11:06 AM, Dr. David
Kirkby wrote:
>
> I just noticed an old thread, where a user had problems on squite,
> making his own version of some packages with an alpha, heta or rc
> release of Sage.
>
> It would be good if alpha/beta/rc releases always showed a message that
> they were pre-release versions for developers and not considered stable.
>
> If there was some automatic way of making this happen, it would avoid
> the risk of someone forgetting to add or delete a file.

Here's a thread relevant to the problem you're describing:

http://groups.google.com/group/sage-devel/browse_thread/thread/793fe7cf630c8800

The querant was using a pre-release version of Sage 4.1 and had
trouble building sqlite.

-- 
Regards
Minh Van Nguyen

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



[sage-devel] Re: Should alpah/beta/rc releases note this at runtime?

2009-07-09 Thread Dr. David Kirkby

Minh Nguyen wrote:
> On Fri, Jul 10, 2009 at 11:06 AM, Dr. David
> Kirkby wrote:
>> I just noticed an old thread, where a user had problems on squite,
>> making his own version of some packages with an alpha, heta or rc
>> release of Sage.
>>
>> It would be good if alpha/beta/rc releases always showed a message that
>> they were pre-release versions for developers and not considered stable.
>>
>> If there was some automatic way of making this happen, it would avoid
>> the risk of someone forgetting to add or delete a file.
> 
> Here's a thread relevant to the problem you're describing:
> 
> http://groups.google.com/group/sage-devel/browse_thread/thread/793fe7cf630c8800
> 
> The querant was using a pre-release version of Sage 4.1 and had
> trouble building sqlite.
> 

Yes, that is the one I see.

A warning such builds could be unstable is useful.


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



[sage-devel] Re: Should alpah/beta/rc releases note this at runtime?

2009-07-09 Thread John H Palmieri

On Jul 9, 8:11 pm, "Dr. David Kirkby"  wrote:
> John H Palmieri wrote:
> > On Jul 9, 6:06 pm, "Dr. David Kirkby"  wrote:
> >> I just noticed an old thread, where a user had problems on squite,
> >> making his own version of some packages with an alpha, heta or rc
> >> release of Sage.
>
> >> It would be good if alpha/beta/rc releases always showed a message that
> >> they were pre-release versions for developers and not considered stable.
>
> >> If there was some automatic way of making this happen, it would avoid
> >> the risk of someone forgetting to add or delete a file.
>
> > See .  How does that
> > look?
>
> >   John
>
> Personally I would have made the message 'louder' i.e. instead of
>
> Note: this is a prerelease version, and it may be unstable.
>
> I would have used:
>
> WARNING: This is a pre-release version of Sage for developers and is
> WARNING: not intended for end users. It may well be unstable.

Check the new patch.

  John


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



[sage-devel] Re: Should alpah/beta/rc releases note this at runtime?

2009-07-09 Thread Dr. David Kirkby

John H Palmieri wrote:
> On Jul 9, 6:06 pm, "Dr. David Kirkby"  wrote:
>> I just noticed an old thread, where a user had problems on squite,
>> making his own version of some packages with an alpha, heta or rc
>> release of Sage.
>>
>> It would be good if alpha/beta/rc releases always showed a message that
>> they were pre-release versions for developers and not considered stable.
>>
>> If there was some automatic way of making this happen, it would avoid
>> the risk of someone forgetting to add or delete a file.
> 
> See < http://trac.sagemath.org/sage_trac/ticket/6505>.  How does that
> look?
> 
>   John


Personally I would have made the message 'louder' i.e. instead of

Note: this is a prerelease version, and it may be unstable.

I would have used:


WARNING: This is a pre-release version of Sage for developers and is
WARNING: not intended for end users. It may well be unstable.







Dave

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



[sage-devel] Re: Should alpah/beta/rc releases note this at runtime?

2009-07-09 Thread Minh Nguyen

On Fri, Jul 10, 2009 at 1:11 PM, Dr. David
Kirkby wrote:
>
> John H Palmieri wrote:
>> On Jul 9, 6:06 pm, "Dr. David Kirkby"  wrote:
>>> I just noticed an old thread, where a user had problems on squite,
>>> making his own version of some packages with an alpha, heta or rc
>>> release of Sage.
>>>
>>> It would be good if alpha/beta/rc releases always showed a message that
>>> they were pre-release versions for developers and not considered stable.
>>>
>>> If there was some automatic way of making this happen, it would avoid
>>> the risk of someone forgetting to add or delete a file.
>>
>> See < http://trac.sagemath.org/sage_trac/ticket/6505>.  How does that
>> look?
>>
>>   John
>
>
> Personally I would have made the message 'louder' i.e. instead of
>
> Note: this is a prerelease version, and it may be unstable.
>
> I would have used:
>
>
> WARNING: This is a pre-release version of Sage for developers and is
> WARNING: not intended for end users. It may well be unstable.

Argh!!! You're hurting my ears :-)

-- 
Regards
Minh Van Nguyen

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



[sage-devel] Re: Should alpah/beta/rc releases note this at runtime?

2009-07-09 Thread Dr. David Kirkby

John H Palmieri wrote:
> On Jul 9, 8:11 pm, "Dr. David Kirkby"  wrote:
>> John H Palmieri wrote:
>>> On Jul 9, 6:06 pm, "Dr. David Kirkby"  wrote:
 I just noticed an old thread, where a user had problems on squite,
 making his own version of some packages with an alpha, heta or rc
 release of Sage.
 It would be good if alpha/beta/rc releases always showed a message that
 they were pre-release versions for developers and not considered stable.
 If there was some automatic way of making this happen, it would avoid
 the risk of someone forgetting to add or delete a file.
>>> See .  How does that
>>> look?
>>>   John
>> Personally I would have made the message 'louder' i.e. instead of
>>
>> Note: this is a prerelease version, and it may be unstable.
>>
>> I would have used:
>>
>> WARNING: This is a pre-release version of Sage for developers and is
>> WARNING: not intended for end users. It may well be unstable.
> 
> Check the new patch.
> 
>   John

It's better I feel. It makes the point a bit more.

I don't feel able to review it, as I don't know python much at all, but 
hopefully you can find a reviewer. It might save some problems in future.

Dave

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



[sage-devel] Trac # 6399 - incorporated, but marked as needing review.

2009-07-09 Thread Dr. David Kirkby

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

was a ticket of mine to allow atlas to build with the Sun or GNU linker 
on Solaris. It is marked as '[with patch, needs review]' but has in fact 
been incorporated into sage-4.1.rc1


Dave

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



[sage-devel] Re: Fwd: reference to SAGE

2009-07-09 Thread Minh Nguyen

Hi Suresh,

On Fri, Jul 10, 2009 at 10:26 AM, William Stein wrote:
>
> Harald,
>
> Another paper that cites Sage!  The abstract begins "We show that the
> generating function of electrically charged 1/2-BPS states in N=4
> supersymmetric CHL Z_N orbifolds of the heterotic string on T^6 are
> given by multiplicative eta-products. [...]"  It's a good thing David
> Loeffler added eta products to Sage...
>
>  -- William
>
>
> -- Forwarded message --
> From: Suresh Govindarajan 
> Date: Thu, Jul 9, 2009 at 5:10 PM
> Subject: reference to SAGE
> To: William Stein 
>
>
> Dear Prof. Stein,
>
> In my recent paper:http://arxiv.org/abs/0907.1410 , we have referred
> to SAGE. I would like to thank you as well as other contributors to
> SAGE.
> With best wishes,
> Suresh
>
> --
> Suresh Govindarajan

Your paper has been added to the list of publications that cite Sage.
This updated list is available from

http://www.sagemath.org/library/publications.html

-- 
Regards
Minh Van Nguyen

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



[sage-devel] Re: [Cython] "object" keyword in cython

2009-07-09 Thread Robert Bradshaw

On Jul 8, 2009, at 12:37 PM, David Simmons-Duffin wrote:

> I didn't realize that Sage could do Lie algebra manipulations.   
> What are the pros and cons for writing an interface to LiE as  
> opposed to simply extending Sage's existing functionality?  Is LiE  
> faster, or has it implemented some tricky algorithms that people  
> don't want to write in sage?

I'm not sure, probably someone else on the sage list wold know the  
relative merits better than I. I'd imagine Sage's existing  
functionality is relatively generic, and not as optimized as LiE.

> I'd be happy to donate my code to Sage, although I don't know if it  
> will have the right organization or be of the right quality  
> standards.  I haven't used Sage, but it looks like it has some kind  
> of system for dealing with general mathematical objects, for  
> instance keeping track of whether something is a group or ring  
> element, or in a vector space over some field.  I made some  
> decisions about what kind of classes to include in my interface  
> based on trying to achieve the simplest code for my particular  
> applications, and not with an eye towards conforming to some  
> general math system.  For instance, whereas LiE uses a polynomial  
> to stand for a representaion, I have a Rep object that wraps a  
> polynomial and a group, where multiplication on Rep's is defined as  
> tensor product.  If I were writing a sage extension, I imagine I  
> would have to somehow also encode that Rep is a type of ring over  
> the integers, etc..
>
> Would my code be useful even without conforming to sage's math  
> conventions? I'd be interested in learning how to write a sage  
> extension at some point, but I need my code for a physics project  
> I'm actively working on now, and I'm not sure I have very much time  
> to spend on programming.

I'm not sure exactly what you mean by "sage's math conventions" but  
I'm sure others would find it useful. Writing Sage extensions is even  
easier than just plain Cython, as it handles all the setup.py,  
dependancies, and linking for you.

- Robert



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