[sage-support] n() returns symbolic expression

2010-09-15 Thread Paul Zimmermann
this is now in trac: http://trac.sagemath.org/sage_trac/ticket/9913

Paul Zimmermann

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


[sage-support] continued_fraction returns nothing

2010-09-13 Thread Paul Zimmermann
   In certain cases I get nothing from the continued_fraction function
   in the latest Sage version:

   --
   | Sage Version 4.5.3, Release Date: 2010-09-04   |
   | Type notebook() for the GUI, and license() for information.|
   --
   sage: a=sqrt(2).n()*sqrt(2)
   sage: continued_fraction(a)
   []

   In version 4.5.2 the output was

   [2, 2251799813685248]

the reason is that the 4.5.2 result was wrong, see
http://trac.sagemath.org/sage_trac/ticket/8017.

You get no partial quotient because with the default precision of 53 bits,
it is not possible to *correctly* deduce a single partial quotient, because
a is very close to 2. You have to increase the precision:

sage: continued_fraction(a, bits=100)
[2]
sage: continued_fraction(a, bits=150)
[2, 7314423575030504, 1, 83, 1, 2, 1, 108, 1, 20]

Paul Zimmermann

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


[sage-support] book in french about Sage

2010-07-09 Thread Paul Zimmermann
we have just published an electronic book in french about mathematics and Sage,
under the Creative Commons CC-by-sa license:

 http://sagebook.gforge.inria.fr/

It would be great if people on this list could help making this book known in
french-speaking countries (Canada, Belgium, Africa countries, Switzerland, ...)

Sorry for the non french-speaking members of this list. However if you are
already fluent in Sage, then the book might help you to learn french!

Alexandre Casamayou, Guillaume Connan, Thierry Dumont, Laurent Fousse,
François Maltey, Matthias Meulien, Marc Mezzarobba, Clément Pernet,
Nicolas M. Thiéry, Paul Zimmermann

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


Re: [sage-support] Difference between sage and pyhton calculations

2010-04-06 Thread Paul Zimmermann
  sage
  Sage Version 4.3.5, Release Date:
  2010-03-28
  sage: 1+1
  2
  sage: 6e-6 % 10e-6
  -4.00e-6
 
  I'm sure sage is wrong.. :(
 
  They're both the same...
 
 No they aren't.
 
 If you type
 
 sage: s = 6e-6
 sage: s.__mod__??
 
 then you can read the documentation for Sage's % on real numbers.
 Definitely the result
 
 sage: 6e-6 - 10e-6
 -4.00e-6
 
 matches what is claimed in the docstring.   The actual function calls the
 MPFR function mpfr_remainder, which is documented here:
 
http://www.mpfr.org/algorithms.pdf
 
 See Section 3.8.

exactly, MPFR follows the ISO C99 remainder function (see man remainder):
the quotient is rounded to the nearest integer, with ties to even, for example

sage: 5. % 10.
5.00
sage: 15. % 10.
-5.00

However maybe Sage could use the mpfr_fmod function instead, which rounds
its quotient towards zero. This would match the Python function for positive
quotient, but not for negative quotient, since the Python function seems to
round the quotient towards -infinity:

 (-6e-6) % 10e-6
4.0007e-06
 (6e-6) % (-10e-6)
-4.0007e-06

In C99 (and in MPFR) there is no mod/remainder function that rounds towards
-infinity.

Paul Zimmermann

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

To unsubscribe, reply using remove me as the subject.


Re: [sage-support] Difference between sage and pyhton calculations

2010-04-06 Thread Paul Zimmermann
 If one wants to have the same answer as Python does (always nonnegative),
 then function math.fmod can be used. For example,
 sage: from math import fmod
 sage: fmod(6e-6,10e-6)
 6.0002e-06 

first Python does not always give a nonnegative result:

 (6e-6) % (-10e-6)
-4.0007e-06

secondly this does not match the math.fmod function either:

sage: from math import fmod 
sage: fmod(6e-6,-10e-6) 
6.0002e-06

I would recommend that Sage % follows one of the C99 standard functions,
fmod or remainder. Maybe fmod would be better, and remainder could be provided
as a different method.

Paul Zimmermann

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

To unsubscribe, reply using remove me as the subject.


[sage-support] convert trigonometric/hyperbolic functions to exponentials

2010-03-12 Thread Paul Zimmermann
   Hi,

is there a way in Sage to convert expressions involving trigonometric or
hyperbolic functions to exponentials, like the convert/exp function of Maple?

 convert(sinh(log(t)),exp);
  1
   t/2 - ---
 2 t

 convert(cos(log(t)),exp);  
 1/2 exp(ln(t) I) + 1/2 exp(-I ln(t))

Paul Zimmermann

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


[sage-support] Re: libecm test failure in 4.2

2009-11-01 Thread Paul Zimmermann

   Hi,

about the problem reported in
http://groups.google.com/group/sage-support/t/24944e5521b9e498?hl=en,
it seems the GMP function __gmpn_add_nc is not found:

 sage/libs/libecm.so: undefined symbol: __gmpn_add_nc

This function is used in the file mpmod.c from GMP-ECM:

#ifdef HAVE___GMPN_ADD_NC
  cy = __gmpn_add_nc (rp, tp + n, xp + n, n,
  (mp_limb_t) ((xp[n - 1] | tp[n - 1]) ? 1 : 0));
#else
  cy = mpn_add_n (rp, tp + n, xp + n, n);
  cy += mpn_add_1 (rp, rp, n, (mp_limb_t) ((xp[n - 1] | tp[n - 1]) ? 1 : 0));
#endif

It seems that the #ifdef HAVE___GMPN_ADD_NC did not work as expected,
or GMP-ECM was configured on a different system where __gmpn_add_nc
was available.

Paul Zimmermann

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



[sage-support] Re: Why this numerical integral bombs?

2009-04-25 Thread Paul Zimmermann

   Michael,

 And Sage 3.4:
 
 | Sage Version 3.4, Release Date: 2009-03-11 |
 | Type notebook() for the GUI, and license() for information.|
 --
 sage: numerical_integral(sin(pi*cos(x/2)),0,2)[0]
 0.85397903781471396
 
 So I cannot reproduce this. What platform are you on and are you using
 a binary, build from source, etc?

the example that failed has 'exp' instead of 'cos'. However with Sage 3.4
it works for me:

--
| Sage Version 3.4, Release Date: 2009-03-11 |
| Type notebook() for the GUI, and license() for information.|
--
sage: numerical_integral(sin(pi*exp(x/2)),0,2)[0]
-0.43734547482524966

Paul Zimmermann

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



[sage-support] Disabled person using SAGE

2009-03-20 Thread Paul Zimmermann

   Another quick option: is there a way to get a listing of all the
   commands/functions/keywords used in SAGE (the top level not at the
   source code level)? 

try:

sage: *? enter

Hope this helps,

Paul Zimmermann

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



[sage-support] Re: sage ecm-interface

2009-03-03 Thread Paul Zimmermann

   William,

sorry to answer late:

 Paul -- does GMP-ECM have a by-design hard limit of 4095 digits?   If
 so, then we have to give an error message from Sage immediately (raise
 a ValueError).  If not, how do we get around the command line 4095
 digit limit?

no, GMP-ECM has no hard limit. I guess this limit comes either from pexpect
or from the command-line.

Paul

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



[sage-support] Factorization

2009-01-30 Thread Paul Zimmermann

 I want to collect all divisors less than 2^30 of a large positive integer N
 using Elliptic Curve Factorization Method.  How this is possible using SAGE?

William pointed out the Cython interface to GMP-ECM. However this does not
completely answer your question, since it will only find *some* factors of
N, but does not guarantee to find *all* factors less than 2^30.

What you want is a deterministic ECM method, i.e., a set of ECM curves
(with Stage 1 and 2 bounds) which guarantees to find all divisors less than
2^30. This is a nice research problem, but to my best knowledge, no solution
is known so far.

Paul Zimmermann



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



[sage-support] Floatting point LLL Revisited

2008-12-26 Thread Paul Zimmermann

   Dear Santanu,

   I am Santanu Sarkar,research fellow, from Indian Statistical
   Institute.
   I use SAGE in my research. Can you please tell me is there any
   function in SAGE by which I can reduce a lattice whose entries are
   floating point? Note that LLL algorithm
   can not be use in this case and Floatting point LLL Revisited by
   Phong Nguyen and
Damien Stehlé can be use here. If you have any soure code for this
   purpose kindly send me.

first the title Floating point LLL Revisited refers to the use of
floating-point numbers *inside* the LLL algorithm, while the inputs are
usually integers.

Now if you have floating-point *inputs*, a simple trick is to convert them to
integers, for example round(C*m[i,j]) where C is a large constant. If all
your m[i,j] are of the same order of magnitude, and of the same precision,
then C=2^k might even perform an exact conversion (don't forget to divide
your reduced vectors by C at the end).

Damien Stehlé (in cc) might add more details.

Paul Zimmermann

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



[sage-support] Arbitrary precision in cython

2008-12-24 Thread Paul Zimmermann

   Hi,

Jason Grout wrote:

 sage: pari(RealField(500)(10)).eint1().python()
 4.15696892968532427740285981027818038434629008241953313262759569712786222819608803586147163177527802101305497591041862309918139192016097135380721447598904e-6
 sage: RealField(500)(10).eint()
 2492.22897624187775913844014399852484898964710143094234538818526713774122742888744417794599665663156560488342454657568480015672868779475213684965774390
 sage:
 sage: pari(RealField(500)(-10)).eint1().python()
 -2492.22897624187775913844014399852484898964710143094234538818526713774122742888744417794599665663156560488342454657568480015672868779475213684965774390402
 sage: RealField(500)(-10).eint()
 NaN

the RealField() results correspond to the definition of eint in mpfr:

 -- Function: int mpfr_eint (mpfr_t Y, mpfr_t X, mp_rnd_t RND)
 Set Y to the exponential integral of X, rounded in the direction
 RND.  For positive X, the exponential integral is the sum of
 Euler's constant, of the logarithm of X, and of the sum for k from
 1 to infinity of X to the power k, divided by k and factorial(k).
 For negative X, the returned value is NaN.

and Carl Witty wrote:

 Actually, Sage doesn't print the entire value for floating-point
 numbers by default; it leaves a few digits off the end, so the
 potential binary-decimal conversion error above is a lot more than
 1/2 ulp.  To get the entire within-1/2-ulp decimal value, you can use:

 sage: RealField(150)(10).eint().str(truncate=False)
 '2492.2289762418777591384401439985248489896471010'

thank you Carl for pointing out that. This means that the total error is
less that 1/2 ulp on the binary value, plus 1/2 ulp on the decimal conversion
(with truncate=False), or plus 0.5005 ulp on the default printing if 3 digits
are left off (assuming rounding to nearest).

Paul Zimmermann

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



[sage-support] Arbitrary precision in cython

2008-12-23 Thread Paul Zimmermann

   Hi,

as a followup on the Arbitrary precision in cython thread, I'd like to
mention that one can directly use mpfr's implementation from within Sage:

sage: RealField(150)(10).eint()
2492.2289762418777591384401439985248489896471

It only works for real numbers, but has the advantage to guarantee correct
rounding (for the 150-bit binary result; if you are using the decimal
result above, you have to take into account the binary-decimal conversion
error, which is at most 1/2 ulp).

Paul Zimmermann

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



[sage-support] sage ecm-interface

2008-12-17 Thread Paul Zimmermann

sorry to answer late to this thread.

 Paul -- does GMP-ECM have a by-design hard limit of 4095 digits?

the answer is no, this problem is likely related to pexpect.

 The real longterm solution to this problem is to totally rewrite the...
 Thanks to Robert Miller that is already in Sage:

yes instead of the pexpect interface one should use now ecmfactor. I am myself
using it continuously and it is quite robust (unlike the pexpect interface
which runs out of ttys after a few minutes).

 Is there any reason we're still shipping the old interface?
 How can I obtain the old functionality?

I see no reason. However indeed the new interface performs only one curve.
It is easy to extend to run several curves until a factor is found:

# n is composite, returns a prime factor of n
def Ecmfactor (n):
   b1 = 100
   while True:
  p = ecmfactor (n, b1)[1]
  if is_pseudoprime(p):
 return p
  b1 = b1 + isqrt(b1)

Paul Zimmermann





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



[sage-support] [EMAIL PROTECTED]: A simple interval challenge]

2008-11-26 Thread Paul Zimmermann

   Hi,

a committee is currently being formed to propose a standard for interval
arithmetic. This standard will be IEEE P1788, as IEEE P754 for floating-point
computations.

Current discussions are on the [EMAIL PROTECTED] mailing list.
It is possible to join that list for people interested, and/or to join the
formal committee.

The following challenge was proposed by Arnold Neumaier on the 1788 list.
Since it might interest some of the Sage developers or users, I forward it
to sage-support.

A naive evaluation gives:

sage: R=RealIntervalField(53)
sage: a=R((7,9))
sage: b=R((-1,1))
sage: c=R((-1,1))
sage: w=R((-0.9,-0.6))
sage: x=R((-0.1,0.2))
sage: y=R((0.3,0.7))
sage: z=R((-0.2,0.1))
sage: f=(a*(w^2+x^2-y^2-z^2)+2*b*(x*y-w*z)+2*c*(x*z+w*y))/(w^2+x^2+y^2+z^2)
sage: f.lower()
-8.65853658536587
sage: f.upper()
21.6097560975610

Paul Zimmermann

--- Start of forwarded message ---
Date: Wed, 26 Nov 2008 11:24:17 +0100
From: Arnold Neumaier [EMAIL PROTECTED]
Organization: University of Vienna
MIME-Version: 1.0
To: interval [EMAIL PROTECTED],
1788 [EMAIL PROTECTED]
Subject: A simple interval challenge
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
List-Owner: mailto:[EMAIL PROTECTED]

In discussions with Nate Hayes, he mentioned the following test problem
(arising from a problem in computer vision) as an example for the
potential efficiency of modal interval arithmetic. With his permission,
I make the problem public, adding performance evaluation criteria
for a public contest.

Please send results directly to me at [EMAIL PROTECTED]; 
I'll post summaries when something interesting happens.


Arnold Neumaier



Challenge:
- -
Find a cheap and good enclosure for

f := (a(w^2+x^2-y^2-z^2)+2b(xy-wz)+2c(xz+wy))/(w^2+x^2+y^2+z^2)

given the following bounds on the variables a,b,c,w,x,y,z:

a in [7,9]
b in [-1,1]
c in [-1,1]
w in [-0.9,-0.6]
x in [-0.1,0.2]
y in [0.3,0.7]
z in [-0.2,0.1]

The computation together with general theoretical results must
constitute a proof that the result is a rigorously valid enclosure
of the range. (Thus, the relevant cost is that of checking that
some data provided are a certificate for the range enclosure found.)


The operation count (= cost) is in terms of effective interval
operations, defined for simplicity (and in view of potential
hardware realizations) as follows:
- - Any unary or binary operation involving an (ordinary or modal)
   interval, including taking the hull or the intersection of two
   intervals, is counted as an interval operation.
- - A purely real operation and a real compare (used in a branching
   statement) are counted each as half an interval operation.
- - Switches of rounding modes are not counted at present.

A suitable cumulative criterion to be minimized could be
 excesscost:=(width/rangewidth-1)^(dof-1)*cost,
  where dof=7 is the number of degrees of freedom and rangewidth
(approx. 10.965) is the width of the range (must perhaps be computed
to higher accuracy). This formula comes from the asymptotic
behavior of a very simple branch and bound scheme using simple
interval evaluation.



I think this is an ideal test problem for good students - please try
it out!

I'd be interested in being informed (preferably until December 3, 2008)
of resulting bounds and operation counts, together with an indication
of the techniques used, and/or a complete algorithm realizing the
enclosure (preferably in Intlab). For the sake of simplicity, you may
at present ignore rounding error issues.



Background information:
- --

The range to 4 significant digits is [-2.956,8.009].

Simple interval evaluation gives the poor enclosure [-7.4889,19.2889]
(244% of optimal width) with 21 interval operations, using savings
due to precomputing u = w^2+x^2 and v = y^2+z^2 and evaluating
f = (a*(u-v)+2*(b*(x*y-w*z)+c*(x*z+w*y)))/(u+v).
(excesscost = 1.89e+2)

Nate Hayes has a confidential algorithm which computes
the bounds [-3.2555,9.1556] (113% of optimal width) with 67.5
effective interval operations, using modal intervals.
(excesscost = 3.55e-4)

I get the slightly inferior bounds [-3.2697,9.]  (114% of
optimal width) with 62 effective interval operations, using
monotonicity arguments and term rearrangements.
(excesscost = 4.49e-4)


Can anyone do significantly better, either in terms of speed
(then with comparable accuracy), or in terms of accuracy (then
with comparable speed), or in terms of excesscost?
--- End of forwarded message ---

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



[sage-support] symbolic integration

2008-11-23 Thread Paul Zimmermann

 Unfortunately, I know little about symbolic
 integration techniques. Does anybody have suggestions for references?

there are basically two techniques for symbolic integration:
1) table lookup in some classes of integrals. Maple is quite good at this.
2) recognition of some inputs that (may) admit an integral in a given class,
   and computation of that integral by an algorithm. Axiom is quite good at
   this.
   
For 2), a good reference for the transcendental case is the following book:

@Book{Bronstein97,
  author =   Manuel Bronstein,
  title =Symbolic Integration {I}. Transcendental Functions,
  publisher =Springer,
  year = 1997,
  volume =   1,
  series =   Algorithms and Computation in Mathematics
}

Unfortunately Manuel Bronstein died before finishing vol. II on the algebraic
case, which is the difficult one. As far as I know, he did implement his
algorithms in Axiom, including (partly) the algebraic case.

Implementing symbolic integration from scratch is a major task, that would
require years before reaching what Axiom can do. In any case, I suggest
reusing the Axiom test suite as starting point.

Paul Zimmermann



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



[sage-support] integer linear programming in Sage?

2008-10-09 Thread Paul Zimmermann

   This may be a silly question, but integer linear programming seems to
   be about maximizing some quantity relative to constraints given by a
   matrix equality (or inequality), where everything is happening over
   the integers.  How does this relate to finding integer solutions to a
   matrix equation?

for example you could maximize vx with constraint Ax = b for a random vector
v, and do the same for Ax = b. If a solution exists, it should be found this
way.

   I find myself wanting to do something similar: find *all* solutions to
   Ax = b, where A, x, and b have non-negative integer entries.  I'm
   trying to figure out if the various responses here will help me.  In
   the situation of interest to me, I know that there are only finitely
   many solutions, and I know one solution.

By rotating the vector v, you will find solutions on the convex hull of the
solution set with the (very naive) algorithm above.

Paul Zimmermann

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



[sage-support] integer linear programming in Sage?

2008-10-07 Thread Paul Zimmermann

   Hi,

a question of a colleague from my lab:

can Sage solve linear systems A*x=b, where A is a matrix with positive
integer coefficients, b is a vector with positive integer coefficients,
and the unknown vector x is searched over the positive integers?

I guess this is more or less equivalent to integer linear programming (ILP),
see http://en.wikipedia.org/wiki/Integer_linear_programming#Integer_unknowns.

Paul Zimmermann

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



[sage-support] Sage Days 10: October 10-15, Nancy, France

2008-09-22 Thread Paul Zimmermann

   Hi all,

this is a reminder that Sage Days 10 (SD10) is fast approaching! It is still
possible to register until October 3. See http://wiki.sagemath.org/days10,
where you can see the scientific program, with the titles and abstracts of the
invited and contributed talks.

After SD6 in Bristol last year, SD10 will be the 2nd Sage Days in Europe,
and a unique opportunity to discuss with the Sage developers.

Two extra special events are planned for SD10:

* on October 11, there will be a sage-combinat session:
The purpose of the *-Combinat project is to provide an extensible
toolbox for computer exploration in algebraic combinatorics, and
foster code sharing between researchers in this area. We will present
the history, features, and design of MuPAD-Combinat, and discuss the
timeline, difficulties, but also great technical and community
opportunities that arise from the ongoing port as Sage-Combinat.

* on October 14, Robert Bradshaw will give a plenary demonstration of Sage.

If you have any questions, feel free to email me or any of the other organizers!

On behalf of the organizing committee,
Paul Zimmermann

PS: I take the opportunity to advertize a workshop on integer factoring that
will take place just before SD10 in Nancy: cado.gforge.inria.fr/workshop/.



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



[sage-support] Re: Peculiar Arithmetic Results

2008-02-24 Thread Paul Zimmermann

   Hi David,

 Here is a puzzle (to me if not to you).
 
 In sage 2.10.2 (although the problem occurs in earlier versions)
 on a CoreDuo MacIntosh running under MacOS X.5.2 we have:
 
 
 a = gp.sin(1)
 octave.eval('format long g')
 b = octave.sin(1)
 c = math.sin(1)
 eps = 1. - (4./3.-1.)*3.
 d = a*eps
 a
   0.8414709848078965066525023216
 b
   0.841470984807897
 c
   0.8414709848078965
 (a-b)/d
   -2.640423314436302686
 (a-c)/d
   -553.9021661362176753
 (b-c)/d
   -553.7921192926074518167939202
 
 Notice that a, b, c all seem to agree to about 16 digits, but when
 the 'native' sage value is mixed with the gp and octave values a
 horrendously large error occurs.
 
 The same behavior occurs for cos(1), exp(1), atan(1).
 
 Something very peculiar is happening. What? Why?
 
 Thank you,
 
 David Galant

my guess is that in a-c, c is converted to 'sage.interfaces.gp.GpElement'
with a smaller precision:

sage: a-a.parent()(c)
-1.0349334749767836598 E-13
sage: a-c
-1.0349334749767836598 E-13

sage: c
0.8414709848078965
sage: a.parent()(c)
0.841470984808

Paul Zimmermann

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



[sage-support] Re: [sage-devel] build problem with rc5

2008-02-09 Thread Paul Zimmermann

   Dear Alfredo,

 Date: Sat, 9 Feb 2008 14:51:30 -0500
 From: Alfredo Portes [EMAIL PROTECTED]
 
 Hi Paul,
 
 I also ran into this problem compiling Sage 2.10.1
 
 Did you find any solution for it?

no. However with the help of Michael Abshoff I've found out what the problem
exactly is: if you run the offending command in 
spkg/build/libgcrypt-1.4.0/src/cipher you get:

bash-3.00$ gcc -DHAVE_CONFIG_H -I. -I.. -I../src -I../src 
-I/tmp/sage-2.10.1/local/include -g -O2 -fvisibility=hidden -Wall 
-Wpointer-arith -MT rijndael.lo -MD -MP -MF .deps/rijndael.Tpo -c rijndael.c -o 
rijndael.o
rijndael.c: In function `do_padlock':
rijndael.c:2062: error: can't find a register in class `GENERAL_REGS' while 
reloading `asm'

and with -O0 instead of -O2 it compiles ok. I'll skip 2.10.1 on my laptop,
and wait for 2.10.2, which hopefully will fix that issue.

Paul

PS: you should be able to fix it by uncompressing libgcrypt-1.4.0.spkg in
spkg/standard, then add CFLAGS=-O0 -g; export CFLAGS at the beginning
of file spkg-install, recompressing the archive, and doing again make in
the sage build directory.

 Regards,
 
 Alfredo Portes
 
 On Feb 2, 2008 8:19 AM, Paul Zimmermann [EMAIL PROTECTED] wrote:
 
  rc5 fails to build on my Pentium M laptop:
 
   gcc -DHAVE_CONFIG_H -I. -I.. -I../src -I../src 
  -I/tmp/sage-2.10.1.rc5/local/include -g -O2 -fvisibility=hidden -Wall 
  -Wpointer-arith -MT rijndael.lo -MD -MP -MF .deps/rijndael.Tpo -c 
  rijndael.c -o rijndael.o /dev/null 21
  make[4]: *** [rijndael.lo] Error 1
  make[4]: Leaving directory 
  `/tmp/sage-2.10.1.rc5/spkg/build/libgcrypt-1.4.0/src/cipher'
  make[3]: *** [all-recursive] Error 1
  make[3]: Leaving directory 
  `/tmp/sage-2.10.1.rc5/spkg/build/libgcrypt-1.4.0/src'
  make[2]: *** [all] Error 2
  make[2]: Leaving directory 
  `/tmp/sage-2.10.1.rc5/spkg/build/libgcrypt-1.4.0/src'
  failed to build libgcrypt
 
  bash-3.00$ uname -a
  Linux toto.loria.fr 2.6.14-1.1656_FC4 #1 Thu Jan 5 22:13:22 EST 2006 i686 
  i686 i386 GNU/Linux
 
  The install.log is available at 
  http://www.loria.fr/~zimmerma/install.log.gz.
 
  Paul

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



[sage-support] Re: Constructor for ntl.GF2X polynomials does not take Polynomials over GF(2) as advertised by docstring

2008-02-08 Thread Paul Zimmermann

 Date: Thu, 7 Feb 2008 18:18:20 -0800 (PST)
 From: Marshall Buck [EMAIL PROTECTED]
 
 R.x = GF(2)[]
 
 f = x^5+x^2+1
 
 fx = ntl.GF2X(f)
 
 gives error:
 
 Traceback (most recent call last):fx
   File ntl_GF2X.pyx, line 141, in
 sage.libs.ntl.ntl_GF2X.ntl_GF2X.__init__
 AttributeError: 'sage.rings.polynomial.polynomial_modn_dense_ntl.Po'
 object has no attribute '_Polynomial_dense_mod_n__poly'
 
 fx = ntl.GF2X(f.list()) works,
 as well as
 fx = ntl.GF2X(f.ntl_ZZ_pX())
 
 (It is a shame that normal arithmetic for polys over GF(2) still seems
 to be implemented by the ntl ZZ_pX library, which is usually at least
 10 times slower than GF2X,  up to degree 2^17 anyway. In that range
 GF2X matches the speed of magma.)

for your information, on http://wwwmaths.anu.edu.au/~brent/gf2x.html you will
find an implementation up to 5 times faster than NTL's GF2X (for degree 2^20).

Paul Zimmermann

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



[sage-support] sage limitation

2008-02-06 Thread Paul Zimmermann

   Hi,

one of my colleagues discovered a limitation of SAGE: apparently one cannot
compute over multivariate ideals over GF(p) for p = 2^31:

sage: R.x,y = PolynomialRing(GF(2147483659))
sage: ideal([x^3-2*y^2,3*x+y^4]).groebner_basis()
...
type 'exceptions.TypeError': Singular error:
   ? `2147483659` greater than 2147483647(max. integer representation)
   ? error occurred in STDIN line 10: `ring sage4=2147483659,(x, y),dp;`
   ? expected ring-expression. type 'help ring;'

An alternative to SAGE is to use Magma:

 Rx,y := PolynomialRing(GF(2147483659),2);
 GroebnerBasis(Ideal([x^3-2*y^2,3*x+y^4]));
[
x + 1431655773*y^4,
y^12 + 54*y^2
]

or even Maple:

 Groebner[Basis]([x^3-2*y^2,3*x+y^4], plex(x,y), characteristic=2147483659);
 12   2  4
   [y   + 54 y , x + 1431655773 y ]

Is there a workaround? If no, are there plans to remove that limitation?

Regards,
Paul


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



[sage-support] Re: Putting parentheses around -1.

2008-01-23 Thread Paul Zimmermann

  [...,..,x == (-1)^(1/3)*3^(1/3)]
 
 
  I ran into this issue while demonstrating the usefulness of the solve
  function in front of a class of students.  That was quite 'fun' :-)
 
  Ted
 
 It does seem strange that the answer that looked like it should be real is
 actually not.  If you have sage evaluate the first value in the returned
 answers you see that despite its appearance it is the pure real number that
 you desire.
 
 b[0].right().n()
 
 you get
 
 -1.44224957030741
 
 So make sure that your students see that sage *did* return the desired
 value.  But also remind them to be careful because all other things
 being equal technology tends to answer your questions in the way that
 makes the most sense to its programmer, which does not necessarily
 make the most sense to a student (or anyone else).

right, as Jacob pointed it out, one has to be careful about values that look
real (resp. complex) and are not. In fact this is a very nice example to show
students that they should take care about the appearance of symbolic objects
(and the difference between classes where you have a canonical form like
integers, and other classes where no canonical form exists, more precisely
the problem is undecidable):

You can construct other nice examples: take the equation (x-1)*(x^2+1)=0,
with trivial root 1:

sage: expand((x-1)*(x^2+1))
x^3 - x^2 + x - 1

Then replace the constant term by a symbolic value a, and solve for the
degree 3 equation:

sage: var('a'); sol = solve(x^3 - x^2 + x - a==0, x); sol
a
[x == (-sqrt(3)*I/2 - 1/2)*(sqrt(27*a^2 - 14*a + 3)/(6*sqrt(3)) + (27*a - 
7)/54)^(1/3) - 2*(sqrt(3)*I/2 - 1/2)/(9*(sqrt(27*a^2 - 14*a + 3)/(6*sqrt(3)) + 
(27*a - 7)/54)^(1/3)) + 1/3, x == (sqrt(3)*I/2 - 1/2)*(sqrt(27*a^2 - 14*a + 
3)/(6*sqrt(3)) + (27*a - 7)/54)^(1/3) - 2*(-sqrt(3)*I/2 - 1/2)/(9*(sqrt(27*a^2 
- 14*a + 3)/(6*sqrt(3)) + (27*a - 7)/54)^(1/3)) + 1/3, x == (sqrt(27*a^2 - 14*a 
+ 3)/(6*sqrt(3)) + (27*a - 7)/54)^(1/3) - 2/(9*(sqrt(27*a^2 - 14*a + 
3)/(6*sqrt(3)) + (27*a - 7)/54)^(1/3)) + 1/3]

You know one of the roots should evaluate to 1 for a=1, in fact it is sol[2]:

sage: sol[2].subs(a=1).right().n()
1.00

Thus you have constructed a nice expression for 1:

sage: sol[2].subs(a=1).right()
(2/(3*sqrt(3)) + 10/27)^(1/3) - 2/(9*(2/(3*sqrt(3)) + 10/27)^(1/3)) + 1/3

Quiz: how to simplify that expression to 1 within SAGE? I've tried simplify,
and radical_simplify, but neither succeeds...

Paul Zimmermann

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



[sage-support] Re: find smallest integer to meet certain inequalities...

2008-01-21 Thread Paul Zimmermann

   Georg,

 is there an efficient way in sage to find the smallest integer k for
 which the inequality
 
 b^(k+1) / (factorial(k) * factorial(k+1)) = 1
 
 is true (b  0)

Stirling's expansion gives (when b goes to infinity) k ~ sqrt(b)*exp(1).
Thus it suffices to evaluates f(k) = b^(k+1) / (factorial(k) * factorial(k+1))
at this starting point. If f(k)  1, increasing k by 1 will multiply f(k) by a
factor about b/k^2 ~ exp(-2); if f(k)  1, decreasing k by 1 will multiply f(k)
by a factor about exp(2). Thus log(f(k))/2 at the starting point should give
you the number of corrections steps (more probably 0 or 1).

Paul Zimmermann

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



[sage-support] Re: Pexpect: pty.fork() failed: out of pty devices

2007-12-28 Thread Paul Zimmermann

   William,

  I got the error in subject while trying the new ECM().one_curve() command
  in sage-2.9. The problem might be due to the fact that I perform thousands 
  of
  calls to ECM().one_curve(), and maybe pexpect does not correctly frees pty
  devices.
 
 I'm glad you're stressing the use of ECM from sage.
 
  The problem can be reproduced with:
 
  $ sage  in552.sage  log 
 
  where the file in552.sage, and the auxiliary files Primes.sage and
  aliquot.sage can be downloaded from http://www.loria.fr/~zimmerma/tmp/xxx
  (replace xxx by in552.sage, ...)
 
 Please put the relevant files in your directory on sage.math or make it so
 http://www.loria.fr/~zimmerma/tmp
 is readable:
 Forbidden
 You don't have permission to access /~zimmerma/tmp/ on this server.

Sorry, I have put the files in sage.math:~zimmerma/tmp.

  The problem will occur after a few minutes.
 
  Any idea?
 
 Try the code with this line from one_curve commented out:
 
 child.__del__ = nothing   # work around stupid exception ignored error

I have tried this, I will tell you tomorrow if it runs more robustly. A first
difference I noticed is that 'top' only reports one ecm process at a time,
whereas previously it sometimes reported several (up to 5 or 6) ecm processes.

 Also, is there a way to rewrite one_curve using popen instead of pexpect?

I'm not sure it's worth the effort. It would be much better to write an
interface at the C level (see ticket #1550) if feasible.

Paul Zimmermann

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Pexpect: pty.fork() failed: out of pty devices

2007-12-27 Thread Paul Zimmermann

   Hi,

I got the error in subject while trying the new ECM().one_curve() command
in sage-2.9. The problem might be due to the fact that I perform thousands of
calls to ECM().one_curve(), and maybe pexpect does not correctly frees pty
devices.

The problem can be reproduced with:

$ sage  in552.sage  log 

where the file in552.sage, and the auxiliary files Primes.sage and
aliquot.sage can be downloaded from http://www.loria.fr/~zimmerma/tmp/xxx
(replace xxx by in552.sage, ...)

The problem will occur after a few minutes.

Any idea?

Paul Zimmermann

PS: I could not see a pointer to the SAGE FAQ from sagemath.org, neither
in Documentation, nor in Support
PS2: the message we were slashdotted is now out-of-date...

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Sage-2.9

2007-12-18 Thread Paul Zimmermann

 ATLAS failed to compile for you. It is no surprise that starting Sage
 afterwards fails. It isn't clear from the excerpt from the logs *why*
 it failed, so please post the couple missing lines from there until
 the end. Main potential culprit is power management in your case.
 Turning that off will *probably* solve the problem.

by the way, I noticed while compiling sage-2.9 from source on my laptop
(Pentium M) that ATLAS ran MANY tuning tests, which did take VERY long.
Wouldn't it be possible to use some default machine parameters, like GMP does?

Cheers,
Paul Zimmermann

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Bessel argument order

2007-12-12 Thread Paul Zimmermann

  even better would be to adopt a computational model such that all
  numerical computations can give only *one* correct result. Then you
  could simply compare to the expected result with utilities like diff.
 
 That would be nice but isn't realistic, since Sage includes systems like
 Numpy / Scipy / PARI, etc, and none of these systems adopt such a model,
 for whatever reason.

Maybe it is not realistic today, but you have to push those systems to adopt
clear semantics, so that it becomes realistic tomorrow. Otherwise a given
SAGE computation which works on a given computer might fail on another one.

Paul

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] Re: Weaning

2007-12-07 Thread Paul Zimmermann

 In[3]:= Pi \\ N
 Syntax::sntxf: Pi cannot be followed by  \\ N.
 
 In[4]:= f \\ g
 
 Syntax::sntxf: f cannot be followed by  \\ g.

please turn your '\' key by Pi/2:

In[2]:= f // g

Out[2]= g[f]

In[3]:= Pi // N

Out[3]= 3.14159

In[7]:= Pi + E // N + 5 // N

Out[7]= (5. + N)[5.85987]

Paul Zimmermann

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---



[sage-support] reference manual

2007-11-08 Thread Paul Zimmermann

On http://sagemath.org/doc/html/ref/module-sage.calculus.calculus.html one
can read:

sage: var('x, u, v')
(x, u, v)
sage: f = expand((2*u*v^2-v^2-4*u^3)^2 * (-u)^3 * (x-sin(x))^3) # not 
tested -- trac #946

This seems to work now:

sage: var('x, u, v')
sage: f = expand((2*u*v^2-v^2-4*u^3)^2 * (-u)^3 * (x-sin(x))^3)
sage: f.factor()
u^3*(2*u*v^2 - v^2 - 4*u^3)^2*(sin(x) - x)^3

Paul


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~--~~~~--~~--~--~---