Re: [sage-devel] Two issues with random_prime()

2010-11-15 Thread William Stein
On Mon, Nov 15, 2010 at 5:45 PM, Dr. David Kirkby
wrote:

> I've noticed two issues with random_prime() in Sage.
>
> 1) Whilst Sage's random_prime() looks as though it will work for numbers to
> at least 10^1, if one specifies a lower bound, then the upper bound
> reduces to 2^40, which is about 10^12.
>
> This situation does *not* change if one specifies one only wants a pseudo
> prime.
>
> sage: random_prime(10^13,proof=False, lbound=12)
> 
> NotImplementedError: computation of prime_pi() greater 2**40 not
> implemented
>
> http://trac.sagemath.org/sage_trac/ticket/10277
>
> Mathematica 7.0.1 has no such limitation. One can set a lower bound, and
> still have an upper bound to at least 10^1
>

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

sage:  random_prime(10^13,proof=False, lbound=12)
7461989010461

I do not get NotImplementedError.Moreover, reading the source for
random_prime in sage-4.6, this function doesn't even call prime_pi.


>
> 2) The Sage implementation is incredibly slow compared to Mathematica.
>
> On my machine (a 3.33 GHz Sun with !OpenSolaris) using a 32-bit build of
> Sage, it took 1455 seconds to generate a random prime up to 10^1000.


> Mathematica 7.01 does this in 7 seconds.
>
> http://trac.sagemath.org/sage_trac/ticket/10278


For me Sage is 10 times faster than Mathematica:

sage: time p = random_prime(10^1000,proof=False)
CPU times: user 0.98 s, sys: 0.00 s, total: 0.99 s
Wall time: 0.99 s

sage: time p = random_prime(10^1000,proof=False)
CPU times: user 0.98 s, sys: 0.00 s, total: 0.99 s
Wall time: 0.99 s
sage: !math
Mathematica 7.0 for Mac OS X x86 (64-bit)
Copyright 1988-2009 Wolfram Research, Inc.

In[1]:=  Timing[RandomPrime[10^1000]]

Out[1]= {8.14694, 593...


However, note that this algorithm will have *highly* nondeterministic
runtime!

sage: time p = random_prime(10^1000,proof=False)
CPU times: user 4.19 s, sys: 0.00 s, total: 4.20 s
Wall time: 4.20 s
sage: time p = random_prime(10^1000,proof=False)
CPU times: user 7.79 s, sys: 0.01 s, total: 7.80 s
Wall time: 7.80 s

OH, I see, you mean that you get slow results with proof=True.   That I
could believe, since proving numbers are prime quickly is really hard.




> If Mathematica does use a pseudo prime test, it is not documented.
>
> http://reference.wolfram.com/mathematica/ref/RandomPrime.html


It is completely clear from the documentation above Mathematica *only* uses
a pseudo prime test.  It says right there "gives a pseudorandom prime number
in the range".

William


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



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

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


Re: [sage-devel] Fwd: Mathematica Version 8--now available

2010-11-15 Thread Tom Boothby
l...@reviews by WRI bigwigs

On Mon, Nov 15, 2010 at 11:28 AM, Dr. David Kirkby
 wrote:
> I thought this might interest some.
>
> dave
>
>  Original Message 
> Subject: Mathematica Version 8--now available
> Date: Mon, 15 Nov 2010 13:23:02 -0600
> From: Jennifer Peterson  
> To: david.kir...@onetel.net
>
>
> Wolfram is pleased to inform you that the latest version of its
> flagship computation, development, and deployment platform,
> Mathematica 8, is now available.
>
> What makes Mathematica unique is its integration of the world's
> most powerful computation engine into comprehensive workflows,
> taking ideas all the way to deployed solutions within one single
> tool. Version 8 adds a new entry point into these workflows by
> introducing the unique concept of free-form linguistic input.
> This allows users to enter plain English and get immediate
> results without the need for syntax, dramatically improving ease
> of use.
>
> Other notable additions, among more than 500 new features:
> * Statistics: the broadest statistical distributions and data
> visualization capabilities available today
> * Software development: built-in GPU programming support, high
> performance C code generation, SymbolicC support, and expanded
> parallel processing
> * Engineering/R&D: integrated control systems and wavelets
> functions
> * Finance: built-in option pricing solvers, financial indicators,
> and charts
> * Image processing: enhanced image analysis capabilities, such as
> feature detection
>
> For more information, to schedule a briefing and/or a short demo,
> or to request a review copy, please contact me at
> +1-217-372-3132.
>
> Best regards,
>
>
> Jennifer
> 
> Jennifer Peterson
> Wolfram Research, Inc.
> pr...@wolfram.com
> +1-217-372-3132
> 
>
> Wolfram Research Introduces Unique Concept of Linguistically
> Controlled Computing
>
> New Mathematica 8 Integrates Wolfram|Alpha - One of More Than 500
> New Features
>
> November 15, 2010--Wolfram Research today announced the release
> of Mathematica 8, the latest version of its flagship computation,
> development, and deployment platform that introduces the
> breakthrough concept of linguistically controlled computing.
> Integrating technology of Wolfram|Alpha, the Mathematica-powered
> computational knowledge engine, makes it possible to enter math
> or data calculations in plain English and get immediate answers
> or start an extensive analysis.
>
> "Traditionally, getting computers to perform tasks requires
> speaking their language or using point-and-click interfaces. One
> requires learning syntax, the other limits scope of accessible
> functions," said Stephen Wolfram, CEO and Founder of Wolfram
> Research. "Free-form linguistics understands human language and
> translates it into syntax-a breakthrough in usability.
> Mathematica 8 is the start of this initiative, but already it is
> making a real difference to user productivity."
>
> Free-form input is a new entry point into the Mathematica
> idea-to-deployment workflow, but Mathematica 8 adds a major new
> endpoint too: generation of C code and standalone executables.
> Using Mathematica, organizations no longer have to rely on
> separate tools for prototyping and deployment, but can complete
> the entire workflow with one integrated tool.
>
> "It's amazing that you can start with free-form linguistic input,
> model or prototype, and end up with a high-performance standalone
> program or library...all within Mathematica 8's comprehensive
> workflow," said Tom Wickham-Jones, Director of Kernel Technology
> at Wolfram Research.
>
> Even with these major enhancements at either end of the workflow,
> the most significant additions in Mathematica 8 are the more than
> 500 new functions in many new and extended application areas,
> including:
>
> * Probability and statistics: largest collection of statistical
> distributions and automatic high-level solvers including
> parameter estimation
> * Software development: built-in GPU support, automatic code
> generation and linking, multicore parallelism, and standalone
> code deployment
> * Engineering: integrated control systems and wavelet analysis
> * Graphs and networks: extensive built-in support for the new
> science of networks
> * Finance: built-in option pricing solvers, financial indicators,
> and charts
> * Image processing: enhanced image analysis capabilities, such as
> feature detection
>
> "In all of these domains, you will find dramatic depth of
> coverage," stated Roger Germundsson, Director of Research &
> Development at Wolfram Research. "The functions are designed to
> work together seamlessly across different domains which allows
> combining them in new and innovative ways."
>
> "Rather than build individual spikes of functionality provided by
> traditional specialist tools, Mathematica's concept is based on
> building up the complete mountain range," said Conrad Wolfram,
> Director of Strateg

Re: [sage-devel] Re: "Why Sage?" Website Section

2010-11-15 Thread Tim Daly



On 11/15/2010 8:54 PM, Robert Bradshaw wrote:

On Sun, Nov 14, 2010 at 11:45 AM, Dr. David Kirkby
  wrote:

On 11/14/10 07:00 PM, Tim Daly wrote:

I find it amusing that mathematicians are being told that
a math-specific language is a liability. Mathematics is,
after all, a specialized language that took me years to
learn.

Creating, learning, and maintaining a math-specific language is not
free, and perhaps one of the few strands of consensus in this thread
is that it's very difficult to do right. The marginal advantages over
using a (suitable) general purpose language is, IMHO, not worth the
cost. Using a general purpose language has several advantages, most of
which have been discussed to death already.

Actually, I do not believe that the current way we do mathematics
by computers is correct but that discussion takes us WAY off thread
and this isn't the forum for that anyway.


Was the adoption of the special(er) purpose Spad language helpful in
attracting users and/or developers for Axiom?

No, I'm sure that it did not attract more users. What it did do was
make the language much closer to the mathematics. Spad is a general
purpose programming language, uses indentation like Python, and is quite
similar to python syntax and semantics. In fact, it allows things
quite beyond python, like nested list comprehensions, full multiline
closures, general argument destructuring, etc. If you are a python
programmer you would find Spad to be "python 4.0". It also compiles
to exceptionally efficient code without needing Cython.

I do think that python is not actually the "language" of Sage.
I think the Sage language is unnamed at the moment. I've been a paid
professional python programmer and I still struggle with Sage (which
I build occasionlly to cross-check Axiom). The Sage language has a
lot of things like QQ which is nowhere in the python language. Saying
that Sage is written in python seems like saying that mathematics is
written in english (there I go with those analogies again...). Most
english speakers cannot read or write mathematics and most python
programmers cannot read or write sage programs.

Maple is a very C-like language, which has a much larger audience
than python. I am not sure that this attracted more users to Maple.

I am not sure that attracting users to CAS systems has anything to
do with the language. Generally you don't reach the language issue
until you've used a CAS as a fancy calculator for a while.

In any case, my original point was that in becoming a computational
mathematician the CAS language is the least of your problems.

Tim Daly

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


Re: [sage-devel] sage-4.6.1.alpha2 failed to build on Ubuntu 10.10

2010-11-15 Thread Mitesh Patel
On 11/15/2010 08:54 PM, François Bissey wrote:
> Ross Kyprianou wrote:
>> Thought you might like to know that sage-4.6.1.alpha1 built with no
>> probs but
>> alpha2 failed to build on Ubuntu 10.10 (linux 2.6.35-23-generic)
>> (PC = 2GB Ram, Intel Pentium 4 CPU 3.2GHz)
>>
>> Error was...
>> make[2]: *** [all] Error 2
>> make[2]: Leaving directory `/home/kyprir/sage-4.6.1.alpha2/spkg/build/
>> ecm-6.3.p1/src'
>> Error building GMP-ECM.
>>
>> real0m40.318s
>> user0m19.521s
>> sys 0m6.124s
>> sage: An error occurred while installing ecm-6.3.p1
> 
> Does it look like http://trac.sagemath.org/sage_trac/ticket/10252 ?
> In any case we would need a little more details than what you have posted
> to form an opinion.

Jeroen, what do you prefer that we do about problems with unreleased
Sage versions, i.e., those not yet announced on sage-release but
available under

http://sage.math.washington.edu/home/release

These could well change daily before your announcement.

(I had started naming pre-releases differently, e.g., 4.6.alphaXpreY,
and putting a note in /home/release/sage-4.6.alphaX/ asking for comments
on the relevant tickets.  But with unique names for source archives with
different MD5 sums, we could reduce potential later confusion in mailing
list discussions.)

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


[sage-devel] Re: sage -bdist (i.e $SAGE_ROOT/local/bin/sage-bdist)

2010-11-15 Thread John H Palmieri
On Nov 15, 3:06 am, "Dr. David Kirkby" 
wrote:
> There are to my knowledge a few problems with making binaries with Sage
>
> 1) It is slow
>
> 2) It fails to work on Solaris, unless on installs the GNU binutils and uses a
> GNU version of 'cp'
>
> 3) A minor point, but this bit of code
>
> TARGET=`echo $TARGET | sed -e 's/ //'`     #no blank spaces
>
> will only remove the first blank space, so if there are multiple ones, it will
> fail.
>
> 4) It could be simplified somewhat. I'm really not sure of the point of code 
> like:
>
> if [ -d "$TMP" ]; then
>     rm -rf "$TMP"
> fi

Couldn't we in fact

   if [ ! -d "$CUR/tmp" ]; then
  mkdir "$CUR/tmp"
   fi

   if [ -d "$TMP" ]; then
  rm -rf "$TMP"
   fi

   mkdir "$TMP"

with

   rm -rf "$TMP"
   mkdir -p "TMP"

(and then perhaps check the error status)?

> Solutions.
>
> 1) Currently a tar file is created, then that file is extracted, in order to
> copy files from A to B. But it would be better to copy the standard output of
> one tar process to stdin of the other, saving a lot of disk I/O.

I don't see where the tar file is extracted.  But at the beginning,
commands like "cp -pPR ..." could perhaps be replaced with "tar
cf ..." (creating a tar file, not just sent to standard out and then
extracted), and then later files could be added to the tar file with
"tar rf ...".  Then at the end we could compress it.

> 2) There's no need to use 'cp -a'. tar can be used.
>
> 3) Replace with TARGET=`echo $TARGET | sed -e 's/ //g'`  #no blank spaces

Okay.

> Also, personally I think it would be good if one could use different 
> compression
> formats. *Recent* version of GNU tar support lzma and xz, but we can't 
> guarantee
> people will have that. Recent versions of Solaris support .7z.
>
> The newer compression algorithms make a huge difference. I know on Solaris, a
> binary is 500 MB with gz, but drops to 300 MB with .7z.

How does bzip2 fare?


>
> How would having sage-bdist taking an option for the compression algorithm 
> sound?
>
> Default to gzip as now, but allow bz2, lzma, xz & 7z too?

I think it's easy enough for anyone to gunzip the tar file and then
recompress it how they want, so this doesn't seem that important to
me.  But it doesn't seem like a bad idea.

--
John

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


Re: [sage-devel] sage-4.6.1.alpha2 failed to build on Ubuntu 10.10

2010-11-15 Thread François Bissey
> Thought you might like to know that sage-4.6.1.alpha1 built with no
> probs but
> alpha2 failed to build on Ubuntu 10.10 (linux 2.6.35-23-generic)
> (PC = 2GB Ram, Intel Pentium 4 CPU 3.2GHz)
> 
> Error was...
> make[2]: *** [all] Error 2
> make[2]: Leaving directory `/home/kyprir/sage-4.6.1.alpha2/spkg/build/
> ecm-6.3.p1/src'
> Error building GMP-ECM.
> 
> real0m40.318s
> user0m19.521s
> sys 0m6.124s
> sage: An error occurred while installing ecm-6.3.p1
Does it look like http://trac.sagemath.org/sage_trac/ticket/10252 ?
In any case we would need a little more details than what you have posted
to form an opinion.

Francois

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


[sage-devel] sage-4.6.1.alpha2 failed to build on Ubuntu 10.10

2010-11-15 Thread Ross Kyprianou
Thought you might like to know that sage-4.6.1.alpha1 built with no
probs but
alpha2 failed to build on Ubuntu 10.10 (linux 2.6.35-23-generic)
(PC = 2GB Ram, Intel Pentium 4 CPU 3.2GHz)

Error was...
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/kyprir/sage-4.6.1.alpha2/spkg/build/
ecm-6.3.p1/src'
Error building GMP-ECM.

real0m40.318s
user0m19.521s
sys 0m6.124s
sage: An error occurred while installing ecm-6.3.p1

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


Re: [sage-devel] Re: sage -bdist (i.e $SAGE_ROOT/local/bin/sage-bdist)

2010-11-15 Thread Mitesh Patel
On 11/15/2010 07:55 PM, Dr. David Kirkby wrote:
> Thank you John. I forgot that had been fixed. I noticed that the
> buildbot failed on t2 to build a binary

Are you referring to fulvia's binary builder 'SunOS 5.10-32 bin
(fulvia)'?  This fails to build ATLAS with SAGE_FAT_BINARY=yes.  Do you
have any thoughts on how to fix this?

http://build.sagemath.org/sage/waterfall?category=binary

(Other categories are 'full', 'upgrade', 'misc', and 'test'.  Buildbot
doesn't yet allow assigning multiple categories to builders.)

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


Re: [sage-devel] Re: sage -bdist (i.e $SAGE_ROOT/local/bin/sage-bdist)

2010-11-15 Thread Dr. David Kirkby

On 11/15/10 07:03 PM, John H Palmieri wrote:

On Nov 15, 3:06 am, "Dr. David Kirkby"
wrote:

There are to my knowledge a few problems with making binaries with Sage

1) It is slow

2) It fails to work on Solaris, unless on installs the GNU binutils and uses a
GNU version of 'cp'


Is this still true? For a while now, sage-bdist has used "cp -pPr",
not "cp -a".  Maybe it should use tar instead, but does it really fail
on Solaris?  I'm pretty sure I used sage-bdist successfully on t2 a
few months ago, for example.  When I just now tried sage-bdist on
hawk, it prints some warning messages, but it does produce a tar.gz
file which seems to unpack successfully.  I haven't run all tests yet,
but it looks okay right now.

--
John


Thank you John. I forgot that had been fixed. I noticed that the buildbot failed 
on t2 to build a binary


It is still very verbose, it must be said. I don't think we need the 'v' option 
on tar. Jeroen remarked, the log file 12 MB. Much of that is probably due to the 
'v' option on tar.


Dave

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


Re: [sage-devel] Re: "Why Sage?" Website Section

2010-11-15 Thread Robert Bradshaw
On Sun, Nov 14, 2010 at 11:45 AM, Dr. David Kirkby
 wrote:
> On 11/14/10 07:00 PM, Tim Daly wrote:
>>
>> I find it amusing that mathematicians are being told that
>> a math-specific language is a liability. Mathematics is,
>> after all, a specialized language that took me years to
>> learn.

Creating, learning, and maintaining a math-specific language is not
free, and perhaps one of the few strands of consensus in this thread
is that it's very difficult to do right. The marginal advantages over
using a (suitable) general purpose language is, IMHO, not worth the
cost. Using a general purpose language has several advantages, most of
which have been discussed to death already.

Was the adoption of the special(er) purpose Spad language helpful in
attracting users and/or developers for Axiom?

> I asked RJF what languge he thought the interface should be. As 10 options I
> consider might be viable choises where
>
>  1) Create an entirely new language.
>  2) Python
>  3) Maxima
>  4) A Mathematica like interface
>  5) A MATLAB like interface
>  6) A Maple-like interface
>  7) A Magma-like interface
>  8) Lisp
>  9) Q - see
> http://en.wikipedia.org/wiki/Q_%28equational_programming_language%29
>  10) Pure http://code.google.com/p/pure-lang/ is another possibility,
> but that did not exist until 2008, but is based on  Q, which existed
> prior to Sage
>
> He failed to response. (He would rather tell me on the Maxima list that I
> can create an infinite set of integers to do some testing.) But that is to
> be expected from Richard - a signal to noise ratio of about -30 dB.
>
> But what do you think is the ideal language for a user interface? There have
> been endless attempts at cleating new languages (#1 above). I've even done
> it myself, to the extent of writing a couple of hundred lines of code for
> lex and yacc. But it's a very difficult problem to get right, and quite
> honestly requires a set of sills I don't think a single Sage developer
> processes.

I think that some (definitely a small minority) of the people here
have the skills, but it was a deliberate design decision not to.

> "Pure" seems an interesting language to me. It is headed by someone with
> both a a maths and a computer science background. But the number of
> developers can be counted on one hand I think.
>
> I agree with William, the best language does depend on the problem. I use
> both Mathematica and MATLAB and its pretty clear to me that they have their
> strengths and weaknesses, and one language is more suited to some problems
> than the other. There are some mathematical tasks that I think are best done
> with Labview - something totally different to Sage, Axiom, Mathematica,
> Maple, MATLAB and I assume Magma too, though I have never used Magma.
>
> The "glue" language is another issue altogether.
>
> The biggest benefit for Python has seemed to be the number of developers. I
> simply don't think that would exist if using Lisp, Pure or something else a
> bit more obscure.

There's the question of potential developers as well. There are few
languages that, in my limited experience, are as easy to pick up as
Python. I've seen people become useful with it in a matter of
hours--the same cannot be said of C or Lisp. In all fairness, I don't
expect everyone to be a good programmer, no matter what the language,
but that's not in most peoples jon descriptions, and arguably most of
Sage's audience is not future software developers. This is an argument
for using Python as the interface, rather than implementation,
language, but in all the barriers to scaling that Sage has hit so far,
the fact that Python is the main language (of the code we wrote,
rather than incorporated) has yet to be one of them.

- Robert

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


[sage-devel] Re: simplify_rational and Pynac

2010-11-15 Thread kcrisman


On Nov 15, 6:40 pm, John H Palmieri  wrote:
> On Nov 13, 6:45 pm, kcrisman  wrote:
>
> > Maxima has a very large number of very specific types of
> > simplifications/expansions.  It allows for quite a bit of control.
> > That said, the main reason our Maxima stuff is slow is because we use
> > 'pexpect' to communicate with it. Nils Bruin has a patch allowing us
> > to "turn on" a library interface (which is now already built inside
> > Sage) to Maxima instead; it would be great if someone who knew enough
> > about Lisp and whatever else needed would give it a positive review,
> > so that we could check such things at the library level.
>
> This is , right?

Yes.

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


[sage-devel] Two issues with random_prime()

2010-11-15 Thread Dr. David Kirkby

I've noticed two issues with random_prime() in Sage.

1) Whilst Sage's random_prime() looks as though it will work for numbers to at 
least 10^1, if one specifies a lower bound, then the upper bound reduces 
to 2^40, which is about 10^12.


This situation does *not* change if one specifies one only wants a pseudo prime.

sage: random_prime(10^13,proof=False, lbound=12)

NotImplementedError: computation of prime_pi() greater 2**40 not implemented

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

Mathematica 7.0.1 has no such limitation. One can set a lower bound, and still 
have an upper bound to at least 10^1



2) The Sage implementation is incredibly slow compared to Mathematica.

On my machine (a 3.33 GHz Sun with !OpenSolaris) using a 32-bit build of Sage, 
it took 1455 seconds to generate a random prime up to 10^1000.


Mathematica 7.01 does this in 7 seconds.

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

If Mathematica does use a pseudo prime test, it is not documented.

http://reference.wolfram.com/mathematica/ref/RandomPrime.html


Dave

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


[sage-devel] Re: simplify_rational and Pynac

2010-11-15 Thread John H Palmieri
On Nov 13, 6:45 pm, kcrisman  wrote:
> Maxima has a very large number of very specific types of
> simplifications/expansions.  It allows for quite a bit of control.
> That said, the main reason our Maxima stuff is slow is because we use
> 'pexpect' to communicate with it. Nils Bruin has a patch allowing us
> to "turn on" a library interface (which is now already built inside
> Sage) to Maxima instead; it would be great if someone who knew enough
> about Lisp and whatever else needed would give it a positive review,
> so that we could check such things at the library level.

This is , right?

--
John

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


[sage-devel] Re: matrix output strangeness

2010-11-15 Thread John H Palmieri


On Nov 15, 1:01 pm, John H Palmieri  wrote:
> On Nov 14, 11:42 pm, William Stein  wrote:
>
>
>
>
>
> > On Sun, Nov 14, 2010 at 6:26 AM, John Cremona  
> > wrote:
> > > Something is not quite right in the cleverness used to output matrices:
>
> > > sage: M
> > > 76 x 58 dense matrix over Integer Ring (type 'print M.str()' to see
> > > all of the entries)
> > > sage: M.hermite_form()
> > > 76 x 58 dense matrix over Integer Ring (type 'print
> > > hnf-True-False.str()' to see all of the entries)
>
> > > John
>
> > This is caused by trac 5174:
>
> >      http://trac.sagemath.org/sage_trac/ticket/5174
>
> > Maybe one of the contributors to that ticket has an idea.  The
> > relevant code is the __repr__ method in matrix/matrix0.pyx.
>
> It seems to me that the methods which cache information (like
> hermite_form and adjoint) cause this issue, while those which don't
> cache info (like transpose) print the expected way:
>
> sage: M = random_matrix(ZZ, 58, 58)
> sage: M.hermite_form()
> 58 x 58 dense matrix over Integer Ring (type 'print hnf-True-
> False.str()' to see all of the entries)
> sage: M.adjoint()
> 58 x 58 dense matrix over Integer Ring (type 'print adjoint.str()' to
> see all of the entries)
> sage: M.transpose()
> 58 x 58 dense matrix over Integer Ring

When the function 'sage_getvariablenames' searches through the objects
which refer to M.hermite_form(), it finds the cached entry and returns
the key for that.  So one way to fix this has two parts:

 - make sure that sage_getvariablenames only returns strings which are
valid Python identifiers, and
 - when caching information with matrices, make sure that the keys are
not valid Python identifiers, say by appending "$" to them.

See .

--
John

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


Re: [sage-devel] Re: bug in factoring univariate polynomial over number field?

2010-11-15 Thread Jeroen Demeyer
On 2010-11-15 17:23, Dr. David Kirkby wrote:
> But surely if a bug is found, it should be on trac.

Should a PARI bug be on the Sage Trac?  What's the point if it already
was reported to PARI?

Anyway, if you want you can go ahead and make the ticket but there is
not much we can do anyway besides waiting for PARI to fix the problem...


Jeroen.

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


[sage-devel] Re: simplify_rational and Pynac

2010-11-15 Thread Ben Goodrich
On Nov 15, 10:56 am, Ben Goodrich  wrote:
> Thanks for the tip, which seems to have worked. I opened a ticket
> (10268), attached my patch, and uploaded a benchmark.

Now I have a un-minimal example of using GiNaC's normal function that
finishes in about 1 minute when done directly in the GiNaC shell. But
doing it via patched sage / Pynac is taking hours and still not
finishing. Can someone try my patch and help me figure out why there
is such a disparity? Everything is attached at

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

Thanks,
Ben

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


[sage-devel] Re: matrix output strangeness

2010-11-15 Thread John H Palmieri
On Nov 14, 11:42 pm, William Stein  wrote:
> On Sun, Nov 14, 2010 at 6:26 AM, John Cremona  wrote:
> > Something is not quite right in the cleverness used to output matrices:
>
> > sage: M
> > 76 x 58 dense matrix over Integer Ring (type 'print M.str()' to see
> > all of the entries)
> > sage: M.hermite_form()
> > 76 x 58 dense matrix over Integer Ring (type 'print
> > hnf-True-False.str()' to see all of the entries)
>
> > John
>
> This is caused by trac 5174:
>
>      http://trac.sagemath.org/sage_trac/ticket/5174
>
> Maybe one of the contributors to that ticket has an idea.  The
> relevant code is the __repr__ method in matrix/matrix0.pyx.

It seems to me that the methods which cache information (like
hermite_form and adjoint) cause this issue, while those which don't
cache info (like transpose) print the expected way:

sage: M = random_matrix(ZZ, 58, 58)
sage: M.hermite_form()
58 x 58 dense matrix over Integer Ring (type 'print hnf-True-
False.str()' to see all of the entries)
sage: M.adjoint()
58 x 58 dense matrix over Integer Ring (type 'print adjoint.str()' to
see all of the entries)
sage: M.transpose()
58 x 58 dense matrix over Integer Ring

I'm not sure why, yet.

--
John

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


[sage-devel] Fwd: Mathematica Version 8--now available

2010-11-15 Thread Dr. David Kirkby

I thought this might interest some.

dave

 Original Message 
Subject: Mathematica Version 8--now available
Date: Mon, 15 Nov 2010 13:23:02 -0600
From: Jennifer Peterson  
To: david.kir...@onetel.net


Wolfram is pleased to inform you that the latest version of its
flagship computation, development, and deployment platform,
Mathematica 8, is now available.

What makes Mathematica unique is its integration of the world's
most powerful computation engine into comprehensive workflows,
taking ideas all the way to deployed solutions within one single
tool. Version 8 adds a new entry point into these workflows by
introducing the unique concept of free-form linguistic input.
This allows users to enter plain English and get immediate
results without the need for syntax, dramatically improving ease
of use.

Other notable additions, among more than 500 new features:
* Statistics: the broadest statistical distributions and data
visualization capabilities available today
* Software development: built-in GPU programming support, high
performance C code generation, SymbolicC support, and expanded
parallel processing
* Engineering/R&D: integrated control systems and wavelets
functions
* Finance: built-in option pricing solvers, financial indicators,
and charts
* Image processing: enhanced image analysis capabilities, such as
feature detection

For more information, to schedule a briefing and/or a short demo,
or to request a review copy, please contact me at
+1-217-372-3132.

Best regards,


Jennifer

Jennifer Peterson
Wolfram Research, Inc.
pr...@wolfram.com
+1-217-372-3132


Wolfram Research Introduces Unique Concept of Linguistically
Controlled Computing

New Mathematica 8 Integrates Wolfram|Alpha - One of More Than 500
New Features

November 15, 2010--Wolfram Research today announced the release
of Mathematica 8, the latest version of its flagship computation,
development, and deployment platform that introduces the
breakthrough concept of linguistically controlled computing.
Integrating technology of Wolfram|Alpha, the Mathematica-powered
computational knowledge engine, makes it possible to enter math
or data calculations in plain English and get immediate answers
or start an extensive analysis.

"Traditionally, getting computers to perform tasks requires
speaking their language or using point-and-click interfaces. One
requires learning syntax, the other limits scope of accessible
functions," said Stephen Wolfram, CEO and Founder of Wolfram
Research. "Free-form linguistics understands human language and
translates it into syntax-a breakthrough in usability.
Mathematica 8 is the start of this initiative, but already it is
making a real difference to user productivity."

Free-form input is a new entry point into the Mathematica
idea-to-deployment workflow, but Mathematica 8 adds a major new
endpoint too: generation of C code and standalone executables.
Using Mathematica, organizations no longer have to rely on
separate tools for prototyping and deployment, but can complete
the entire workflow with one integrated tool.

"It's amazing that you can start with free-form linguistic input,
model or prototype, and end up with a high-performance standalone
program or library...all within Mathematica 8's comprehensive
workflow," said Tom Wickham-Jones, Director of Kernel Technology
at Wolfram Research.

Even with these major enhancements at either end of the workflow,
the most significant additions in Mathematica 8 are the more than
500 new functions in many new and extended application areas,
including:

* Probability and statistics: largest collection of statistical
distributions and automatic high-level solvers including
parameter estimation
* Software development: built-in GPU support, automatic code
generation and linking, multicore parallelism, and standalone
code deployment
* Engineering: integrated control systems and wavelet analysis
* Graphs and networks: extensive built-in support for the new
science of networks
* Finance: built-in option pricing solvers, financial indicators,
and charts
* Image processing: enhanced image analysis capabilities, such as
feature detection

"In all of these domains, you will find dramatic depth of
coverage," stated Roger Germundsson, Director of Research &
Development at Wolfram Research. "The functions are designed to
work together seamlessly across different domains which allows
combining them in new and innovative ways."

"Rather than build individual spikes of functionality provided by
traditional specialist tools, Mathematica's concept is based on
building up the complete mountain range," said Conrad Wolfram,
Director of Strategic Development at Wolfram Research. "It's this
broad functionality across a wide area that enabled us to build
state-of-the-art application areas such as statistics and
probability so quickly for Mathematica 8."

Availability

Mathematica 8 is available immediately for Windows XP/Vista/7,
Mac OS X, Lin

[sage-devel] Re: sage -bdist (i.e $SAGE_ROOT/local/bin/sage-bdist)

2010-11-15 Thread John H Palmieri
On Nov 15, 3:06 am, "Dr. David Kirkby" 
wrote:
> There are to my knowledge a few problems with making binaries with Sage
>
> 1) It is slow
>
> 2) It fails to work on Solaris, unless on installs the GNU binutils and uses a
> GNU version of 'cp'

Is this still true? For a while now, sage-bdist has used "cp -pPr",
not "cp -a".  Maybe it should use tar instead, but does it really fail
on Solaris?  I'm pretty sure I used sage-bdist successfully on t2 a
few months ago, for example.  When I just now tried sage-bdist on
hawk, it prints some warning messages, but it does produce a tar.gz
file which seems to unpack successfully.  I haven't run all tests yet,
but it looks okay right now.

--
John

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


Re: [sage-devel] sage -bdist (i.e $SAGE_ROOT/local/bin/sage-bdist)

2010-11-15 Thread Dr. David Kirkby

On 11/15/10 12:01 PM, Jeroen Demeyer wrote:

On 2010-11-15 12:06, Dr. David Kirkby wrote:

There are to my knowledge a few problems with making binaries with Sage


5) It is way too verbose.  I have a log file of sage -bdist which is
12MB in size!


I suspect a lot of that is due to tar being used with the 'v' option.


I agree with all your points, except perhaps about the compression
programs.  I think the most sensible thing would be to have an option
creating an *uncompressed* tar file, then the user can apply whatever
compression he wants afterwards.  No need to complicate sage-bdist with
all possible existing compression programs.

Jeroen.


That would break the current behavior, it if was left as a tar file.

It *might* also mean the amount of disk space needed to create the binary 
increases - though I'm far from certain about that.



What do others think? I don't have any strong views myself, but then I'm not the 
one creating the binaries. But we should be able to automate all this.


Dave

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


Re: [sage-devel] Re: bug in factoring univariate polynomial over number field?

2010-11-15 Thread Dr. David Kirkby

On 11/15/10 04:03 PM, Jeroen Demeyer wrote:

On 2010-11-15 16:48, luisfe wrote:

About this problem. Should one open a new ticket or reopen 7097 for
this problem?


I would say: let's wait and see what upstream says (I will keep an eye
on the PARI bug).

Jeroen.



But surely if a bug is found, it should be on trac.


Dave

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


[sage-devel] Re: Question about solving equations involving the absolute value

2010-11-15 Thread kcrisman


On Nov 15, 7:03 am, vgermrk  wrote:
> Hi,
>
> i'm using sage in a course and we came up with some problems
> concerning the absolute value and the solve-function.
> We started to solving the equation abs(abs(x-2)-1)==4 for real x.
> But even easier equations makes problems:
>
> solve(abs(x)==5,x)
>
> Is there a reason why sage isn't able to give a useful answer to this?
> And even using abs_symbolic gives no result.
>
> How can i reformulate my equation, so that sage is able to solve it?
>
> What i found out myself: if i use sqrt(x^2) as a substitute for the
> absolute value, it works.
> But it would be much nicer if one could use just abs (without further
> thinking).

Sage uses Maxima behind the scenes for such things, so it depends on
how well we wrap it. In this case, because using options sometimes
yields non-exact answers (due to Maxima's different set of
assumptions), the following is necessary.


sage: solve(abs(x)==5,x,to_poly_solve=True)
[x == -5, x == 5]

You might have noticed the documentation for

sage: solve?

but there isn't a good enough link to the documentation for solving
single-variable guys, which you would find at

sage: F = abs(x)==5
sage: F.solve?

Maybe we should make that clearer... it's likely my fault when I
updated documentation that I didn't make it really clear how to do it.

- kcrisman

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


Re: [sage-devel] Re: bug in factoring univariate polynomial over number field?

2010-11-15 Thread Jeroen Demeyer
On 2010-11-15 16:48, luisfe wrote:
> About this problem. Should one open a new ticket or reopen 7097 for
> this problem?

I would say: let's wait and see what upstream says (I will keep an eye
on the PARI bug).

Jeroen.

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


Re: [sage-devel] Re: bug in factoring univariate polynomial over number field?

2010-11-15 Thread Dr. David Kirkby

On 11/15/10 03:48 PM, luisfe wrote:

About this problem. Should one open a new ticket or reopen 7097 for
this problem?



Open a new one. This is closed an apparently fixed - don't reopen it. But put a 
link to the other ticket if that seem appropiate



--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Dave

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


[sage-devel] Re: simplify_rational and Pynac

2010-11-15 Thread Ben Goodrich
On Nov 13, 9:45 pm, kcrisman  wrote:
> That's a little orthogonal to your main question, which I should know
> the answer to, but have forgotten off hand.  Might this be in sage/
> libs/ginac/ ?

Thanks for the tip, which seems to have worked. I opened a ticket
(10268), attached my patch, and uploaded a benchmark. The new GiNaC
option is about 10x faster than the default. It would be interesting
to benchmark it again when Maxima can be used as a library. Then
again, my benchmark was not too clever. Is there something else out
there that I should analyze?

Thanks,
Ben

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


[sage-devel] Re: Strategies for integrating new library into Sage notebook

2010-11-15 Thread Nick Alexander
> However, I'd like to be able to intelligently detect when Sage is running in 
> the notebook vs. interactively on the console and only auto-create PNG files 
> in notebook mode.  Is there a standard technique for this?

I think the following works.  Try:

sage: import sage.server.support
sage: sage.server.support.EMBEDDED_MODE
True

in the notebook.  Does anyone object?

Nick

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


[sage-devel] Re: bug in factoring univariate polynomial over number field?

2010-11-15 Thread luisfe
About this problem. Should one open a new ticket or reopen 7097 for
this problem?

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


[sage-devel] Strategies for integrating new library into Sage notebook

2010-11-15 Thread Stanley Seibert
Hi,

I've been tinkering with integrating the ROOT library from CERN into Sage.  So 
far things work fairly well, and I'll be learning the Sage packaging system to 
make the library installable via the normal channels.

ROOT has its own plotting system which I would like to have work seamlessly 
with the Sage notebook.  After some searching, I see now that the interface to 
get 2D plots into the notebook is simply the local filesystem itself.  If I 
change the ROOT code to create a PNG on disk whenever its internal canvas 
object updates, then I see ROOT plots in the notebook.  (Kudos to whoever came 
up with this simple, yet powerful idea!)

However, I'd like to be able to intelligently detect when Sage is running in 
the notebook vs. interactively on the console and only auto-create PNG files in 
notebook mode.  Is there a standard technique for this?

Also, ROOT can produce 3D plots and has its own viewer in interactive mode.  
How should Sage libraries pass their 3D information to Jmol in the notebook?

One last question: PyROOT, the Python bindings for ROOT classes, is having some 
trouble dealing with integers in Sage because they are not one of the usual 
Python integer types.  It reports a problem in the CPython source file 
longobject.c whenever I pass a Sage integer to a wrapped C++ method expecting 
an integer parameter.  Has anyone else bumped into a weird longobject.c error 
when porting other libraries?  I'm still chasing things down on the PyROOT 
side, but I suspect this might be some compiled code calling a Python C API 
function to convert an object to a C integer which is not as flexible as the 
Python-level int() function.  Is there a standard work-around for this kind of 
problem that people have used in other libraries?

Thanks for any help you can provide!

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


[sage-devel] Re: bug in factoring univariate polynomial over number field?

2010-11-15 Thread luisfe


On Nov 15, 3:21 pm, John Cremona  wrote:
>
> According to Karim, one of these is now obsolete and should not be
> used.  But I can never remember which
>
> John


According to the notes in:

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

factornf uses Trager's trick and is deprecated in favor of nffactor,
which does not need any more nfinit structures to work.

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


Re: [sage-devel] Re: bug in factoring univariate polynomial over number field?

2010-11-15 Thread John Cremona
On Mon, Nov 15, 2010 at 1:59 PM, Jeroen Demeyer  wrote:
> On 2010-11-15 14:46, luisfe wrote:
>> gp: poly = t^3 + (-4*a^3 + 2*a)*t^2 - 11/3*a^2*t + 2/3*a^3 - 4/3*a
>> t^3 + (-4*a^3 + 2*a)*t^2 - 11/3*a^2*t + (2/3*a^3 - 4/3*a)
>> gp: factornf(poly, a^4 - a^2 +1)
>>
>> [t + Mod(-2*a^3 + a, a^4 - a^2 + 1) 1]
>>
>> [t + Mod(-4/3*a^3 + 2/3*a, a^4 - a^2 + 1) 1]
>>
>> [t + Mod(-2/3*a^3 + 1/3*a, a^4 - a^2 + 1) 1]
>>
>> Which is the correct answer.
>
> True.  I never understood why there exists nffactor() and factornf()
> which do the same thing (but apparently with different implementations!)

According to Karim, one of these is now obsolete and should not be
used.  But I can never remember which

John


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

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


Re: [sage-devel] Re: bug in factoring univariate polynomial over number field?

2010-11-15 Thread Jeroen Demeyer
On 2010-11-15 14:46, luisfe wrote:
> gp: poly = t^3 + (-4*a^3 + 2*a)*t^2 - 11/3*a^2*t + 2/3*a^3 - 4/3*a
> t^3 + (-4*a^3 + 2*a)*t^2 - 11/3*a^2*t + (2/3*a^3 - 4/3*a)
> gp: factornf(poly, a^4 - a^2 +1)
> 
> [t + Mod(-2*a^3 + a, a^4 - a^2 + 1) 1]
> 
> [t + Mod(-4/3*a^3 + 2/3*a, a^4 - a^2 + 1) 1]
> 
> [t + Mod(-2/3*a^3 + 1/3*a, a^4 - a^2 + 1) 1]
> 
> Which is the correct answer.

True.  I never understood why there exists nffactor() and factornf()
which do the same thing (but apparently with different implementations!)

Jeroen.

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


[sage-devel] Re: bug in factoring univariate polynomial over number field?

2010-11-15 Thread luisfe


On Nov 15, 2:38 pm, Jeroen Demeyer  wrote:
> On 2010-11-15 13:53, Niels wrote:
>
> > Hi,
>
> > I think the following is a bug (only complete factorization after 2 steps):
>
> Yes, it is a bug.  The problem is with the upstream package PARI/GP.

Yes, it is a bug in pari. Note also the following:

gp: poly = t^3 + (-4*a^3 + 2*a)*t^2 - 11/3*a^2*t + 2/3*a^3 - 4/3*a
t^3 + (-4*a^3 + 2*a)*t^2 - 11/3*a^2*t + (2/3*a^3 - 4/3*a)
gp: factornf(poly, a^4 - a^2 +1)

[t + Mod(-2*a^3 + a, a^4 - a^2 + 1) 1]

[t + Mod(-4/3*a^3 + 2/3*a, a^4 - a^2 + 1) 1]

[t + Mod(-2/3*a^3 + 1/3*a, a^4 - a^2 + 1) 1]

Which is the correct answer.

Note that with the new pari, it is not needed nfinit any more. We
should avoid calling R.nfinit in self.factor() and only use the
nffactor command if the nf structure is already computed and cached.
This is another issue that would not solve the problem though.

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


Re: [sage-devel] bug in factoring univariate polynomial over number field?

2010-11-15 Thread Jeroen Demeyer
On 2010-11-15 13:53, Niels wrote:
> Hi,
> 
> I think the following is a bug (only complete factorization after 2 steps):

Yes, it is a bug.  The problem is with the upstream package PARI/GP.

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


[sage-devel] nffactor() returns reducible factor

2010-11-15 Thread Jeroen Demeyer
Package: pari
Version: 2.4.4 (development svn-12706M)

This was reported by Niels Lubbes as Sage bug on
sage-devel@googlegroups.com:

gp> t; nf = nfinit(a^4 - a^2 + 1);
gp> poly = t^3 + (-4*a^3 + 2*a)*t^2 - 11/3*a^2*t + 2/3*a^3 - 4/3*a
%1 = t^3 + (-4*a^3 + 2*a)*t^2 - 11/3*a^2*t + (2/3*a^3 - 4/3*a)
gp> F = nffactor(nf, poly)
%2 =
[t + Mod(-2*a^3 + a, a^4 - a^2 + 1) 1]

[t^2 + Mod(-2*a^3 + a, a^4 - a^2 + 1)*t + Mod(-2/3*a^2, a^4 - a^2 + 1) 1]

However, the second factor is reducible:
gp> nffactor(nf, F[2,1])
%3 =
[t + Mod(-4/3*a^3 + 2/3*a, a^4 - a^2 + 1) 1]

[t + Mod(-2/3*a^3 + 1/3*a, a^4 - a^2 + 1) 1]


Cheers,
Jeroen.

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


[sage-devel] bug in factoring univariate polynomial over number field?

2010-11-15 Thread Niels
Hi,

I think the following is a bug (only complete factorization after 2 steps):

sage: R = PolynomialRing( QQ, var( 't' ), order = 'lex' )
sage: t = R.gens()[0]
sage: f = t^4 - t^2 + 1
sage: T = NumberFieldTower( [f], 'a0' )
sage: R1 = R.change_ring( T )
sage: a0 = T.gens()[0]
sage: t = R1.gens()[0]
sage: poly = t^3 + (-4*a0^3 + 2*a0)*t^2 - 11/3*a0^2*t + 2/3*a0^3 - 4/3*a0
sage: poly.factor()
(t - 2*a0^3 + a0) * (t^2 + (-2*a0^3 + a0)*t - 2/3*a0^2)
sage: fact = poly.factor()[1][0]
sage: fact.factor()
(t - 4/3*a0^3 + 2/3*a0) * (t - 2/3*a0^3 + 1/3*a0)

Kind regards,

Niels

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


[sage-devel] Please review #10156 (rename top-level makefile to Makefile)

2010-11-15 Thread Jeroen Demeyer
This was merged in sage-4.6.1.alpha0 with an update in sage-4.6.1.alpha1
but still needs review.

See http://trac.sagemath.org/sage_trac/ticket/10156


Thanks,
Jeroen.

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


[sage-devel] Re: self.sum() method on vector made of int is not defined

2010-11-15 Thread Jason Grout

On 11/13/10 11:51 PM, William Stein wrote:



Other comments:

Jason Grout:

If we're now making a convention for the global sum function (i.e., try
calling the .sum() method first), I'm curious how many other objects
have a .sum() method?  Will this break things?


If you type "sum??" and read you'll find out that the sum method
already calls ".sum()" first:

 if hasattr(expression, 'sum'):
 return expression.sum(*args, **kwds)

I had to use __builtin__ above to get the genuine builtin Python sum
function, which is dog slow. The sum in Sage's global namespace
overrides the builtin python one and calls sum on the input object.
This has little overhead if the actual summing dominates:


I didn't realize (or had forgotten) that the sum already tries to call 
the .sum() method.  In that case, my comment about calling ._sum_sage 
still stands (i.e., it's less likely to break 3rd party libraries), but 
is tempered by people not complaining already and breaking backwards 
compatibility at this point.





sage: v = vector(RDF,range(10^5))
sage: timeit('v.sum()', number=10^3)
1000 loops, best of 3: 116 盜 per loop
sage: timeit('sum(v)', number=10^3)
1000 loops, best of 3: 122 盜 per loop

If you try vectors with a smaller number of entries, e.g., a more
realistic maybe 20, then the time of doing the sum
in all cases is dominated by stupid overhead.  In the case of Sage's
RDF vector, the time is still pretty bad, since in fact the sum is
done by converting to numpy, and the numpy sum is itself very slow
(which may be surprising to people, but is true):



Actually, with RDF, the vector is stored as a numpy array, so there is 
no conversion.  The overhead on our side (beyond the numpy overhead) is

in converting the numpy sum result back to an RDF element.

In numpy, the array is also stored as a C array of floats (doubles, 
actually), so I'm not sure where the extra numpy overhead is coming in. 
 It would be interesting to peek at the numpy source and see.


Thanks,

Jason




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


Re: [sage-devel] Re: ask.sagemath.org

2010-11-15 Thread v_2e
  Hello!

On Mon, 15 Nov 2010 03:27:48 -0800 (PST)
pang  wrote:

> On 14 nov, 22:14, v...@ukr.net wrote:
> >   Hello!
> >   Please excuse me if I'm asking a question that has already been
> > answered somewhere. :)
> >   Does this service exist for asking the questions on certain
> > specific problems and algorithms or for some kind of generic questions?
> 
> Why don't you ask this is in http://ask.sagemath.org? More people
> might have the same doubt, and search for an answer there.
> 
  Well, interesting idea. But to be honest, I don't think people will
look for the answer to such question among the questions asked there.
As for me, I usually look for some kind of FAQ or Rules before asking a
question in a new place. Maybe, other people do the same? And if so, it
would be very convenient for such people to see something like "Here
you can ask anything you want about working with Sage" somewhere at the
top of the page (with a huge huge letters :) ) or somewhere in the
FAQs. In such situation people wouldn't eve have a need to "look for"
this answer. They would just see it. :)

Regards,
Vladimir.

- 
 

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


Re: [sage-devel] Anyone able to test new Maxima ?

2010-11-15 Thread Jeroen Demeyer
On 2010-11-15 12:10, Dr. David Kirkby wrote:
> There's a ticket to update Maxima, which also needs an update to ECL.
> (These *must* be done together) and also a library patch needs to be
> added to make the doctests pass.
> 
> If anyone can test out
> 
> http://trac.sagemath.org/sage_trac/ticket/10187
> 
> it would be good to know of any problems.
> 
> It's been tested on Fedora 14, sage-on-gentoo and OpenSolaris, but not
> yet on Solaris, or OS X to my knowledge. I'm tied up today, and don't
> have time to test this out on other systems.
> 
> But getting some more test on Linux systems would be helpful too, though
> OS X and Solaris especially so.

Since there is large demand for testing these days, I will make an
experimental Sage alpha with cvxopt, ecl, maxima, patch, sphinx updated.
 Then we can see what breaks where :-)

Jeroen.

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


[sage-devel] Question about solving equations involving the absolute value

2010-11-15 Thread vgermrk
Hi,

i'm using sage in a course and we came up with some problems
concerning the absolute value and the solve-function.
We started to solving the equation abs(abs(x-2)-1)==4 for real x.
But even easier equations makes problems:

solve(abs(x)==5,x)

Is there a reason why sage isn't able to give a useful answer to this?
And even using abs_symbolic gives no result.

How can i reformulate my equation, so that sage is able to solve it?

What i found out myself: if i use sqrt(x^2) as a substitute for the
absolute value, it works.
But it would be much nicer if one could use just abs (without further
thinking).

-MRK-

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


Re: [sage-devel] sage -bdist (i.e $SAGE_ROOT/local/bin/sage-bdist)

2010-11-15 Thread Jeroen Demeyer
On 2010-11-15 12:06, Dr. David Kirkby wrote:
> There are to my knowledge a few problems with making binaries with Sage

5) It is way too verbose.  I have a log file of sage -bdist which is
12MB in size!


I agree with all your points, except perhaps about the compression
programs.  I think the most sensible thing would be to have an option
creating an *uncompressed* tar file, then the user can apply whatever
compression he wants afterwards.  No need to complicate sage-bdist with
all possible existing compression programs.

Jeroen.

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


[sage-devel] Re: Example worksheets contest

2010-11-15 Thread mmarco
On 15 nov, 12:30, pang  wrote:
> Hola!
> Great idea: Would you sort them into categories, or mix high school
> and advanced math?

Well, for the moment, it is just an idea. But if there is enough
consensus to make it happen, i would vote for having several
categories: high school, undergrad, graduate level, best interact,
best exposure of the sage capabilities...

That way you would assure to have some variety in the content. And
also there would be a bigger set of potential participants.

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


[sage-devel] Re: Example worksheets contest

2010-11-15 Thread pang
Hola!
Great idea: Would you sort them into categories, or mix high school
and advanced math?

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


[sage-devel] Re: ask.sagemath.org

2010-11-15 Thread pang
On 14 nov, 22:14, v...@ukr.net wrote:
>   Hello!
>   Please excuse me if I'm asking a question that has already been
> answered somewhere. :)
>   Does this service exist for asking the questions on certain
> specific problems and algorithms or for some kind of generic questions?

Why don't you ask this is in http://ask.sagemath.org? More people
might have the same doubt, and search for an answer there.

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


[sage-devel] Anyone able to test new Maxima ?

2010-11-15 Thread Dr. David Kirkby
There's a ticket to update Maxima, which also needs an update to ECL. (These 
*must* be done together) and also a library patch needs to be added to make the 
doctests pass.


If anyone can test out

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

it would be good to know of any problems.

It's been tested on Fedora 14, sage-on-gentoo and OpenSolaris, but not yet on 
Solaris, or OS X to my knowledge. I'm tied up today, and don't have time to test 
this out on other systems.


But getting some more test on Linux systems would be helpful too, though OS X 
and Solaris especially so.


Dave

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


[sage-devel] sage -bdist (i.e $SAGE_ROOT/local/bin/sage-bdist)

2010-11-15 Thread Dr. David Kirkby

There are to my knowledge a few problems with making binaries with Sage

1) It is slow

2) It fails to work on Solaris, unless on installs the GNU binutils and uses a 
GNU version of 'cp'


3) A minor point, but this bit of code

TARGET=`echo $TARGET | sed -e 's/ //'` #no blank spaces

will only remove the first blank space, so if there are multiple ones, it will 
fail.


4) It could be simplified somewhat. I'm really not sure of the point of code 
like:

if [ -d "$TMP" ]; then
   rm -rf "$TMP"
fi



Solutions.

1) Currently a tar file is created, then that file is extracted, in order to 
copy files from A to B. But it would be better to copy the standard output of 
one tar process to stdin of the other, saving a lot of disk I/O.


2) There's no need to use 'cp -a'. tar can be used.

3) Replace with TARGET=`echo $TARGET | sed -e 's/ //g'`  #no blank spaces

4) Just do  rm -rf "$TMP" There's no need to test if the directory existed or 
not - the fact the -f option is given, will not result in any error message if 
it did not.


Is anyone changing that file at all? Before I waste my time on it.

Also, personally I think it would be good if one could use different compression 
formats. *Recent* version of GNU tar support lzma and xz, but we can't guarantee 
people will have that. Recent versions of Solaris support .7z.


The newer compression algorithms make a huge difference. I know on Solaris, a 
binary is 500 MB with gz, but drops to 300 MB with .7z.


How would having sage-bdist taking an option for the compression algorithm 
sound?

Default to gzip as now, but allow bz2, lzma, xz & 7z too?



Any thoughts?

Dave

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


Re: [sage-devel] Re: "Why Sage?" Website Section

2010-11-15 Thread Dr. David Kirkby

On 11/15/10 05:59 AM, rjf wrote:



On Nov 14, 11:45 am, "Dr. David Kirkby"
wrote:



I asked RJF what languge he thought the interface should be. As 10 options I
consider might be viable choises where



Whether there should be a single language for implementation
and user interface for a computer algebra system has occupied
designers
and students of such systems for about 50 years, and there are many
papers
on this topic.  And there are many papers (phd theses, too) describing
new and wonderful
user interfaces.  My advice is to look at the literature.  As they say
(more or less)
a month of programming can save an hour in the library.

RJF


Of course if there was a simple answer, there would not need to be all these PhD 
theses on the topic.


You are critical of Sage's choice of Python, but have not proposed a better 
solution.


Writing a language from scratch is not practical given the skill set of Sage 
developers. For those with CS degrees, who have studied compiler design, it 
would be, but it is no easy task - contrary to what you may think, I have looked 
at the literature on this. I even purchased this book on compiler design


http://www.amazon.com/Modern-Compiler-Design-D-Grune/dp/0471976970

and have come to the conclusion writing a new language would have been a *very* 
difficult task, even if you use something like LLVM as a back-end. (That's why I 
find Pure an interesting language. It happens to be developed by someone with 
both a CS and maths background, and uses modern tools like LLVM. But it's not a 
mainstream language)


So that leaves existing languages. One then needs to consider the developers who 
know the language and those who would be willing to learn it.


There is no doubt the syntax of Lisp is very off-putting to people, which 
explains its relative lack of popularity. I've seen your paper about why C is 
not your favorite lanaguge. But C is far more popular than Lisp.


There are the odd few Lisp patches to Maxima on the Sage trac tickets, and 
people have problems getting those reviewed, as so few know Lisp.


Dave

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