[sage-support] Re: strange behavior with sums

2014-06-23 Thread Dima Pasechnik
On 2014-06-23, Karl Schultheisz art.live...@gmail.com wrote:
 I'm using Sage 6.2 on Arch Linux. I have posted before about sums being 
 wrong 
https://groups.google.com/d/msg/sage-support/IgC78rcdO7c/qTWzpA9f-P8J, 
 and I am happy to see that the community took action. Thanks! I have been 
 seeing other errors that may or may not be related to those addressed in 
 the link above.

 I open a new Sage session (command line). The following code ought to 
 return (e^x - 1)/x.

 sage: k = var('k')
 sage: sum(x^k/factorial(k+1),k,0,oo)
 1/4*sqrt(pi)*sqrt(x)*e^(1/2*x)

 This looks similar to the sort of nonsense it was spitting out when 
 misinterpreting 
 Bessel functions from Maxima http://trac.sagemath.org/ticket/16224. In 
 the same session, if I run the summation command again, the result is 

did you try applying the patch from #16224 ?

 different.

 sage: sum(x^k/factorial(k+1),k,0,oo)
 sum(x^k/factorial(k + 1), k, 0, +Infinity)

 And after this it will not simplify any sums, even ones it would have done 
 correctly on the first try:

 sage: sum(x^k/factorial(k),k,0,oo)
 sum(x^k/factorial(k), k, 0, +Infinity)

 Even a reset doesn't help. (As a side-note, the exit command doesn't 
 survive reset.)

 sage: reset()
 sage: k = var('k')
 sage: sum(x^k/factorial(k),k,0,oo)
 sum(x^k/factorial(k), k, 0, +Infinity)
 sage: exit
 
 ---
 NameError Traceback (most recent call 
 last)
 /opt/sage/local/lib/python2.7/site-packages/sage/all_cmdline.py in 
module()
  1 exit

 NameError: name 'exit' is not defined

 Finite sums seem to be ok.

 sage: sum(x^k,k,0,3)
 x^3 + x^2 + x + 1
 sage: m = var('m')
 sage: sum(x^k,k,0,m)
 (x^(m + 1) - 1)/(x - 1)

 Any help is greatly appreciated.


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: strange behavior with sums

2014-06-23 Thread Karl Schultheisz
Sorry, I haven't. I don't know how.

On Monday, June 23, 2014 8:38:46 AM UTC-4, Dima Pasechnik wrote:

 On 2014-06-23, Karl Schultheisz art.l...@gmail.com javascript: wrote: 
  I'm using Sage 6.2 on Arch Linux. I have posted before about sums being 
  wrong 
 https://groups.google.com/d/msg/sage-support/IgC78rcdO7c/qTWzpA9f-P8J, 
  and I am happy to see that the community took action. Thanks! I have 
 been 
  seeing other errors that may or may not be related to those addressed in 
  the link above. 
  
  I open a new Sage session (command line). The following code ought to 
  return (e^x - 1)/x. 
  
  sage: k = var('k') 
  sage: sum(x^k/factorial(k+1),k,0,oo) 
  1/4*sqrt(pi)*sqrt(x)*e^(1/2*x) 
  
  This looks similar to the sort of nonsense it was spitting out when 
 misinterpreting 
  Bessel functions from Maxima http://trac.sagemath.org/ticket/16224. 
 In 
  the same session, if I run the summation command again, the result is 

 did you try applying the patch from #16224 ? 

  different. 
  
  sage: sum(x^k/factorial(k+1),k,0,oo) 
  sum(x^k/factorial(k + 1), k, 0, +Infinity) 
  
  And after this it will not simplify any sums, even ones it would have 
 done 
  correctly on the first try: 
  
  sage: sum(x^k/factorial(k),k,0,oo) 
  sum(x^k/factorial(k), k, 0, +Infinity) 
  
  Even a reset doesn't help. (As a side-note, the exit command doesn't 
  survive reset.) 
  
  sage: reset() 
  sage: k = var('k') 
  sage: sum(x^k/factorial(k),k,0,oo) 
  sum(x^k/factorial(k), k, 0, +Infinity) 
  sage: exit 
  
  
 --- 
  NameError Traceback (most recent 
 call 
  last) 
  /opt/sage/local/lib/python2.7/site-packages/sage/all_cmdline.py in 
 module() 
   1 exit 
  
  NameError: name 'exit' is not defined 
  
  Finite sums seem to be ok. 
  
  sage: sum(x^k,k,0,3) 
  x^3 + x^2 + x + 1 
  sage: m = var('m') 
  sage: sum(x^k,k,0,m) 
  (x^(m + 1) - 1)/(x - 1) 
  
  Any help is greatly appreciated. 
  



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: strange behavior with sums

2014-06-23 Thread Dima Pasechnik
On 2014-06-23, Dima Pasechnik dimp...@gmail.com wrote:
 On 2014-06-23, Karl Schultheisz art.live...@gmail.com wrote:
 I'm using Sage 6.2 on Arch Linux. I have posted before about sums being 
 wrong 
https://groups.google.com/d/msg/sage-support/IgC78rcdO7c/qTWzpA9f-P8J, 
 and I am happy to see that the community took action. Thanks! I have been 
 seeing other errors that may or may not be related to those addressed in 
 the link above.

 I open a new Sage session (command line). The following code ought to 
 return (e^x - 1)/x.

 sage: k = var('k')
 sage: sum(x^k/factorial(k+1),k,0,oo)
 1/4*sqrt(pi)*sqrt(x)*e^(1/2*x)

 This looks similar to the sort of nonsense it was spitting out when 
 misinterpreting 
 Bessel functions from Maxima http://trac.sagemath.org/ticket/16224. In 
 the same session, if I run the summation command again, the result is 

 did you try applying the patch from #16224 ?

Note that on Sage 6.3.beta4, which contains the fix from #16224, I get
sage: sum(x^k/factorial(k+1),k,0,oo)
2*sqrt(pi)*sqrt(1/(pi*x))*e^(1/2*x)*sinh(1/2*x)/sqrt(x)

which is correct (up to a failure to get obvious simplifications)



 different.

 sage: sum(x^k/factorial(k+1),k,0,oo)
 sum(x^k/factorial(k + 1), k, 0, +Infinity)

 And after this it will not simplify any sums, even ones it would have done 
 correctly on the first try:

 sage: sum(x^k/factorial(k),k,0,oo)
 sum(x^k/factorial(k), k, 0, +Infinity)

 Even a reset doesn't help. (As a side-note, the exit command doesn't 
 survive reset.)

 sage: reset()
 sage: k = var('k')
 sage: sum(x^k/factorial(k),k,0,oo)
 sum(x^k/factorial(k), k, 0, +Infinity)
 sage: exit
 
 ---
 NameError Traceback (most recent call 
 last)
 /opt/sage/local/lib/python2.7/site-packages/sage/all_cmdline.py in 
module()
  1 exit

 NameError: name 'exit' is not defined

 Finite sums seem to be ok.

 sage: sum(x^k,k,0,3)
 x^3 + x^2 + x + 1
 sage: m = var('m')
 sage: sum(x^k,k,0,m)
 (x^(m + 1) - 1)/(x - 1)

 Any help is greatly appreciated.



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: strange behavior with sums

2014-06-23 Thread Dima Pasechnik
On 2014-06-23, Karl Schultheisz art.live...@gmail.com wrote:
 Sorry, I haven't. I don't know how.
well, this is actually easy to fix, as no recompilation of Sage is
needed here: the only change is in src/sage/intefaces/maxima_lib.py

http://git.sagemath.org/sage.git/diff/src/sage/interfaces/maxima_lib.py?id=3e25c1357e6ecc551afe3e27633fdbbd01982708

if you have Sage installed locally, know how to use git then
you can get this patch applied and then run `sage -b`.  

In case you do not know anything about git, you can still get a copy
of the updated file from here:
http://git.sagemath.org/sage.git/plain/src/sage/interfaces/maxima_lib.py

save it as SAGE_ROOT/src/sage/intefaces/maxima_lib.py
and then run `sage -b`.

HTH,
Dmitrii

 On Monday, June 23, 2014 8:38:46 AM UTC-4, Dima Pasechnik wrote:

 On 2014-06-23, Karl Schultheisz art.l...@gmail.com javascript: wrote: 
  I'm using Sage 6.2 on Arch Linux. I have posted before about sums being 
  wrong 
 https://groups.google.com/d/msg/sage-support/IgC78rcdO7c/qTWzpA9f-P8J, 
  and I am happy to see that the community took action. Thanks! I have 
 been 
  seeing other errors that may or may not be related to those addressed in 
  the link above. 
  
  I open a new Sage session (command line). The following code ought to 
  return (e^x - 1)/x. 
  
  sage: k = var('k') 
  sage: sum(x^k/factorial(k+1),k,0,oo) 
  1/4*sqrt(pi)*sqrt(x)*e^(1/2*x) 
  
  This looks similar to the sort of nonsense it was spitting out when 
 misinterpreting 
  Bessel functions from Maxima http://trac.sagemath.org/ticket/16224. 
 In 
  the same session, if I run the summation command again, the result is 

 did you try applying the patch from #16224 ? 

  different. 
  
  sage: sum(x^k/factorial(k+1),k,0,oo) 
  sum(x^k/factorial(k + 1), k, 0, +Infinity) 
  
  And after this it will not simplify any sums, even ones it would have 
 done 
  correctly on the first try: 
  
  sage: sum(x^k/factorial(k),k,0,oo) 
  sum(x^k/factorial(k), k, 0, +Infinity) 
  
  Even a reset doesn't help. (As a side-note, the exit command doesn't 
  survive reset.) 
  
  sage: reset() 
  sage: k = var('k') 
  sage: sum(x^k/factorial(k),k,0,oo) 
  sum(x^k/factorial(k), k, 0, +Infinity) 
  sage: exit 
  
  
 --- 
  NameError Traceback (most recent 
 call 
  last) 
  /opt/sage/local/lib/python2.7/site-packages/sage/all_cmdline.py in 
 module() 
   1 exit 
  
  NameError: name 'exit' is not defined 
  
  Finite sums seem to be ok. 
  
  sage: sum(x^k,k,0,3) 
  x^3 + x^2 + x + 1 
  sage: m = var('m') 
  sage: sum(x^k,k,0,m) 
  (x^(m + 1) - 1)/(x - 1) 
  
  Any help is greatly appreciated. 
  




-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: strange behavior with sums

2014-06-23 Thread Dima Pasechnik
On 2014-06-23, Dima Pasechnik dimp...@gmail.com wrote:
 On 2014-06-23, Karl Schultheisz art.live...@gmail.com wrote:
 Sorry, I haven't. I don't know how.
 well, this is actually easy to fix, as no recompilation of Sage is
 needed here: the only change is in src/sage/intefaces/maxima_lib.py

 http://git.sagemath.org/sage.git/diff/src/sage/interfaces/maxima_lib.py?id=3e25c1357e6ecc551afe3e27633fdbbd01982708

 if you have Sage installed locally, know how to use git then
 you can get this patch applied and then run `sage -b`.  

 In case you do not know anything about git, you can still get a copy
 of the updated file from here:
 http://git.sagemath.org/sage.git/plain/src/sage/interfaces/maxima_lib.py
oops, sorry, this will give you an only unpatched copy...
So you really need to get the patch somehow.

 save it as SAGE_ROOT/src/sage/intefaces/maxima_lib.py
 and then run `sage -b`.

 HTH,
 Dmitrii

 On Monday, June 23, 2014 8:38:46 AM UTC-4, Dima Pasechnik wrote:

 On 2014-06-23, Karl Schultheisz art.l...@gmail.com javascript: wrote: 
  I'm using Sage 6.2 on Arch Linux. I have posted before about sums being 
  wrong 
 https://groups.google.com/d/msg/sage-support/IgC78rcdO7c/qTWzpA9f-P8J, 
  and I am happy to see that the community took action. Thanks! I have 
 been 
  seeing other errors that may or may not be related to those addressed in 
  the link above. 
  
  I open a new Sage session (command line). The following code ought to 
  return (e^x - 1)/x. 
  
  sage: k = var('k') 
  sage: sum(x^k/factorial(k+1),k,0,oo) 
  1/4*sqrt(pi)*sqrt(x)*e^(1/2*x) 
  
  This looks similar to the sort of nonsense it was spitting out when 
 misinterpreting 
  Bessel functions from Maxima http://trac.sagemath.org/ticket/16224. 
 In 
  the same session, if I run the summation command again, the result is 

 did you try applying the patch from #16224 ? 

  different. 
  
  sage: sum(x^k/factorial(k+1),k,0,oo) 
  sum(x^k/factorial(k + 1), k, 0, +Infinity) 
  
  And after this it will not simplify any sums, even ones it would have 
 done 
  correctly on the first try: 
  
  sage: sum(x^k/factorial(k),k,0,oo) 
  sum(x^k/factorial(k), k, 0, +Infinity) 
  
  Even a reset doesn't help. (As a side-note, the exit command doesn't 
  survive reset.) 
  
  sage: reset() 
  sage: k = var('k') 
  sage: sum(x^k/factorial(k),k,0,oo) 
  sum(x^k/factorial(k), k, 0, +Infinity) 
  sage: exit 
  
  
 --- 
  NameError Traceback (most recent 
 call 
  last) 
  /opt/sage/local/lib/python2.7/site-packages/sage/all_cmdline.py in 
 module() 
   1 exit 
  
  NameError: name 'exit' is not defined 
  
  Finite sums seem to be ok. 
  
  sage: sum(x^k,k,0,3) 
  x^3 + x^2 + x + 1 
  sage: m = var('m') 
  sage: sum(x^k,k,0,m) 
  (x^(m + 1) - 1)/(x - 1) 
  
  Any help is greatly appreciated. 
  





-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: strange behavior with sums

2014-06-23 Thread Karl Schultheisz
Thank you. It is obviously time that I learn to use git.

On Monday, June 23, 2014 9:10:09 AM UTC-4, Dima Pasechnik wrote:

 On 2014-06-23, Dima Pasechnik dim...@gmail.com javascript: wrote: 
  On 2014-06-23, Karl Schultheisz art.l...@gmail.com javascript: 
 wrote: 
  Sorry, I haven't. I don't know how. 
  well, this is actually easy to fix, as no recompilation of Sage is 
  needed here: the only change is in src/sage/intefaces/maxima_lib.py 
  
  
 http://git.sagemath.org/sage.git/diff/src/sage/interfaces/maxima_lib.py?id=3e25c1357e6ecc551afe3e27633fdbbd01982708
  
  
  if you have Sage installed locally, know how to use git then 
  you can get this patch applied and then run `sage -b`.   
  
  In case you do not know anything about git, you can still get a copy 
  of the updated file from here: 
  http://git.sagemath.org/sage.git/plain/src/sage/interfaces/maxima_lib.py 
 oops, sorry, this will give you an only unpatched copy... 
 So you really need to get the patch somehow. 
  
  save it as SAGE_ROOT/src/sage/intefaces/maxima_lib.py 
  and then run `sage -b`. 
  
  HTH, 
  Dmitrii 
  
  On Monday, June 23, 2014 8:38:46 AM UTC-4, Dima Pasechnik wrote: 
  
  On 2014-06-23, Karl Schultheisz art.l...@gmail.com javascript: 
 wrote: 
   I'm using Sage 6.2 on Arch Linux. I have posted before about sums 
 being 
   wrong 
  
 https://groups.google.com/d/msg/sage-support/IgC78rcdO7c/qTWzpA9f-P8J, 
   and I am happy to see that the community took action. Thanks! I have 
  been 
   seeing other errors that may or may not be related to those 
 addressed in 
   the link above. 
   
   I open a new Sage session (command line). The following code ought 
 to 
   return (e^x - 1)/x. 
   
   sage: k = var('k') 
   sage: sum(x^k/factorial(k+1),k,0,oo) 
   1/4*sqrt(pi)*sqrt(x)*e^(1/2*x) 
   
   This looks similar to the sort of nonsense it was spitting out when 
  misinterpreting 
   Bessel functions from Maxima http://trac.sagemath.org/ticket/16224. 

  In 
   the same session, if I run the summation command again, the result 
 is 
  
  did you try applying the patch from #16224 ? 
  
   different. 
   
   sage: sum(x^k/factorial(k+1),k,0,oo) 
   sum(x^k/factorial(k + 1), k, 0, +Infinity) 
   
   And after this it will not simplify any sums, even ones it would 
 have 
  done 
   correctly on the first try: 
   
   sage: sum(x^k/factorial(k),k,0,oo) 
   sum(x^k/factorial(k), k, 0, +Infinity) 
   
   Even a reset doesn't help. (As a side-note, the exit command doesn't 
   survive reset.) 
   
   sage: reset() 
   sage: k = var('k') 
   sage: sum(x^k/factorial(k),k,0,oo) 
   sum(x^k/factorial(k), k, 0, +Infinity) 
   sage: exit 
   
   
  
 --- 
   NameError Traceback (most recent 
  call 
   last) 
   /opt/sage/local/lib/python2.7/site-packages/sage/all_cmdline.py 
 in 
  module() 
    1 exit 
   
   NameError: name 'exit' is not defined 
   
   Finite sums seem to be ok. 
   
   sage: sum(x^k,k,0,3) 
   x^3 + x^2 + x + 1 
   sage: m = var('m') 
   sage: sum(x^k,k,0,m) 
   (x^(m + 1) - 1)/(x - 1) 
   
   Any help is greatly appreciated. 
   
  
  
  
  



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: strange behavior with sums

2014-06-23 Thread Karl Schultheisz
I have installed git and chosen my name and email address. What commands
should I run to apply this patch? I have been reading the developer manual,
but at this point I am not interested in contributing code to Sage. I just
want to apply patches.


On Mon, Jun 23, 2014 at 9:45 AM, Karl Schultheisz art.live...@gmail.com
wrote:

 Thank you. It is obviously time that I learn to use git.

 On Monday, June 23, 2014 9:10:09 AM UTC-4, Dima Pasechnik wrote:

 On 2014-06-23, Dima Pasechnik dim...@gmail.com wrote:
  On 2014-06-23, Karl Schultheisz art.l...@gmail.com wrote:
  Sorry, I haven't. I don't know how.
  well, this is actually easy to fix, as no recompilation of Sage is
  needed here: the only change is in src/sage/intefaces/maxima_lib.py
 
  http://git.sagemath.org/sage.git/diff/src/sage/interfaces/
 maxima_lib.py?id=3e25c1357e6ecc551afe3e27633fdbbd01982708
 
  if you have Sage installed locally, know how to use git then
  you can get this patch applied and then run `sage -b`.
 
  In case you do not know anything about git, you can still get a copy
  of the updated file from here:
  http://git.sagemath.org/sage.git/plain/src/sage/interfaces/
 maxima_lib.py
 oops, sorry, this will give you an only unpatched copy...
 So you really need to get the patch somehow.
 
  save it as SAGE_ROOT/src/sage/intefaces/maxima_lib.py
  and then run `sage -b`.
 
  HTH,
  Dmitrii
 
  On Monday, June 23, 2014 8:38:46 AM UTC-4, Dima Pasechnik wrote:
 
  On 2014-06-23, Karl Schultheisz art.l...@gmail.com javascript:
 wrote:
   I'm using Sage 6.2 on Arch Linux. I have posted before about sums
 being
   wrong
  https://groups.google.com/d/msg/sage-support/IgC78rcdO7c/
 qTWzpA9f-P8J,
   and I am happy to see that the community took action. Thanks! I
 have
  been
   seeing other errors that may or may not be related to those
 addressed in
   the link above.
  
   I open a new Sage session (command line). The following code ought
 to
   return (e^x - 1)/x.
  
   sage: k = var('k')
   sage: sum(x^k/factorial(k+1),k,0,oo)
   1/4*sqrt(pi)*sqrt(x)*e^(1/2*x)
  
   This looks similar to the sort of nonsense it was spitting out when
  misinterpreting
   Bessel functions from Maxima http://trac.sagemath.org/ticket/16224.

  In
   the same session, if I run the summation command again, the result
 is
 
  did you try applying the patch from #16224 ?
 
   different.
  
   sage: sum(x^k/factorial(k+1),k,0,oo)
   sum(x^k/factorial(k + 1), k, 0, +Infinity)
  
   And after this it will not simplify any sums, even ones it would
 have
  done
   correctly on the first try:
  
   sage: sum(x^k/factorial(k),k,0,oo)
   sum(x^k/factorial(k), k, 0, +Infinity)
  
   Even a reset doesn't help. (As a side-note, the exit command
 doesn't
   survive reset.)
  
   sage: reset()
   sage: k = var('k')
   sage: sum(x^k/factorial(k),k,0,oo)
   sum(x^k/factorial(k), k, 0, +Infinity)
   sage: exit
  
  
  ---

   NameError Traceback (most
 recent
  call
   last)
   /opt/sage/local/lib/python2.7/site-packages/sage/all_cmdline.py
 in
  module()
    1 exit
  
   NameError: name 'exit' is not defined
  
   Finite sums seem to be ok.
  
   sage: sum(x^k,k,0,3)
   x^3 + x^2 + x + 1
   sage: m = var('m')
   sage: sum(x^k,k,0,m)
   (x^(m + 1) - 1)/(x - 1)
  
   Any help is greatly appreciated.
  
 
 
 
 

  --
 You received this message because you are subscribed to a topic in the
 Google Groups sage-support group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/sage-support/7bPMqk_ORNo/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: strange behavior with sums

2014-06-23 Thread Dima Pasechnik
On 2014-06-23, Karl Schultheisz art.live...@gmail.com wrote:
 I have installed git and chosen my name and email address. What commands
 should I run to apply this patch? I have been reading the developer manual,
 but at this point I am not interested in contributing code to Sage. I just
 want to apply patches.
this is basically reviewing tickets.
Although you need a developer's access to follow typical recepies from
there. However, without the latter you are still OK.
What you can do is the following:
(from your SAGEROOT directory)

   git fetch http://trac.sagemath.org/sage.git u/pbruin/16224-maxima_to_sage

you should  see something like:

From http://trac.sagemath.org/sage
 * branchu/pbruin/16224-maxima_to_sage - FETCH_HEAD

Now we merge the stuff we just fetched:

   git merge FETCH_HEAD

this will open up an editor to record the merge commit message; write
something there (normally it will already have some text to record).
After you saved this file you will see somthing like 

Merge made by the 'recursive' strategy.
 src/sage/interfaces/maxima_lib.py | 58
 ++
  1 file changed, 34 insertions(+), 24 deletions(-)

OK, patch applied, finally run

   ./sage -b

HTH,
Dmitrii






 On Mon, Jun 23, 2014 at 9:45 AM, Karl Schultheisz art.live...@gmail.com
 wrote:

 Thank you. It is obviously time that I learn to use git.

 On Monday, June 23, 2014 9:10:09 AM UTC-4, Dima Pasechnik wrote:

 On 2014-06-23, Dima Pasechnik dim...@gmail.com wrote:
  On 2014-06-23, Karl Schultheisz art.l...@gmail.com wrote:
  Sorry, I haven't. I don't know how.
  well, this is actually easy to fix, as no recompilation of Sage is
  needed here: the only change is in src/sage/intefaces/maxima_lib.py
 
  http://git.sagemath.org/sage.git/diff/src/sage/interfaces/
 maxima_lib.py?id=3e25c1357e6ecc551afe3e27633fdbbd01982708
 
  if you have Sage installed locally, know how to use git then
  you can get this patch applied and then run `sage -b`.
 
  In case you do not know anything about git, you can still get a copy
  of the updated file from here:
  http://git.sagemath.org/sage.git/plain/src/sage/interfaces/
 maxima_lib.py
 oops, sorry, this will give you an only unpatched copy...
 So you really need to get the patch somehow.
 
  save it as SAGE_ROOT/src/sage/intefaces/maxima_lib.py
  and then run `sage -b`.
 
  HTH,
  Dmitrii
 
  On Monday, June 23, 2014 8:38:46 AM UTC-4, Dima Pasechnik wrote:
 
  On 2014-06-23, Karl Schultheisz art.l...@gmail.com javascript:
 wrote:
   I'm using Sage 6.2 on Arch Linux. I have posted before about sums
 being
   wrong
  https://groups.google.com/d/msg/sage-support/IgC78rcdO7c/
 qTWzpA9f-P8J,
   and I am happy to see that the community took action. Thanks! I
 have
  been
   seeing other errors that may or may not be related to those
 addressed in
   the link above.
  
   I open a new Sage session (command line). The following code ought
 to
   return (e^x - 1)/x.
  
   sage: k = var('k')
   sage: sum(x^k/factorial(k+1),k,0,oo)
   1/4*sqrt(pi)*sqrt(x)*e^(1/2*x)
  
   This looks similar to the sort of nonsense it was spitting out when
  misinterpreting
   Bessel functions from Maxima http://trac.sagemath.org/ticket/16224.

  In
   the same session, if I run the summation command again, the result
 is
 
  did you try applying the patch from #16224 ?
 
   different.
  
   sage: sum(x^k/factorial(k+1),k,0,oo)
   sum(x^k/factorial(k + 1), k, 0, +Infinity)
  
   And after this it will not simplify any sums, even ones it would
 have
  done
   correctly on the first try:
  
   sage: sum(x^k/factorial(k),k,0,oo)
   sum(x^k/factorial(k), k, 0, +Infinity)
  
   Even a reset doesn't help. (As a side-note, the exit command
 doesn't
   survive reset.)
  
   sage: reset()
   sage: k = var('k')
   sage: sum(x^k/factorial(k),k,0,oo)
   sum(x^k/factorial(k), k, 0, +Infinity)
   sage: exit
  
  
  ---

   NameError Traceback (most
 recent
  call
   last)
   /opt/sage/local/lib/python2.7/site-packages/sage/all_cmdline.py
 in
  module()
    1 exit
  
   NameError: name 'exit' is not defined
  
   Finite sums seem to be ok.
  
   sage: sum(x^k,k,0,3)
   x^3 + x^2 + x + 1
   sage: m = var('m')
   sage: sum(x^k,k,0,m)
   (x^(m + 1) - 1)/(x - 1)
  
   Any help is greatly appreciated.
  
 
 
 
 

  --
 You received this message because you are subscribed to a topic in the
 Google Groups sage-support group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/sage-support/7bPMqk_ORNo/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, 

Re: [sage-support] Re: strange behavior with sums

2014-06-23 Thread Karl Schultheisz
Thanks for your help. I ran:

[...sage]$ git fetch http://trac.sagemath.org/sage.git
u/pbruin/16224-maxima_to_sage
fatal: Not a git repository (or any of the parent directories): .git




On Mon, Jun 23, 2014 at 2:55 PM, Dima Pasechnik dimp...@gmail.com wrote:

 On 2014-06-23, Karl Schultheisz art.live...@gmail.com wrote:
  I have installed git and chosen my name and email address. What commands
  should I run to apply this patch? I have been reading the developer
 manual,
  but at this point I am not interested in contributing code to Sage. I
 just
  want to apply patches.
 this is basically reviewing tickets.
 Although you need a developer's access to follow typical recepies from
 there. However, without the latter you are still OK.
 What you can do is the following:
 (from your SAGEROOT directory)

git fetch http://trac.sagemath.org/sage.git
 u/pbruin/16224-maxima_to_sage

 you should  see something like:

 From http://trac.sagemath.org/sage
  * branchu/pbruin/16224-maxima_to_sage - FETCH_HEAD

 Now we merge the stuff we just fetched:

git merge FETCH_HEAD

 this will open up an editor to record the merge commit message; write
 something there (normally it will already have some text to record).
 After you saved this file you will see somthing like

 Merge made by the 'recursive' strategy.
  src/sage/interfaces/maxima_lib.py | 58
  ++
   1 file changed, 34 insertions(+), 24 deletions(-)

 OK, patch applied, finally run

./sage -b

 HTH,
 Dmitrii




 
 
  On Mon, Jun 23, 2014 at 9:45 AM, Karl Schultheisz art.live...@gmail.com
 
  wrote:
 
  Thank you. It is obviously time that I learn to use git.
 
  On Monday, June 23, 2014 9:10:09 AM UTC-4, Dima Pasechnik wrote:
 
  On 2014-06-23, Dima Pasechnik dim...@gmail.com wrote:
   On 2014-06-23, Karl Schultheisz art.l...@gmail.com wrote:
   Sorry, I haven't. I don't know how.
   well, this is actually easy to fix, as no recompilation of Sage is
   needed here: the only change is in src/sage/intefaces/maxima_lib.py
  
   http://git.sagemath.org/sage.git/diff/src/sage/interfaces/
  maxima_lib.py?id=3e25c1357e6ecc551afe3e27633fdbbd01982708
  
   if you have Sage installed locally, know how to use git then
   you can get this patch applied and then run `sage -b`.
  
   In case you do not know anything about git, you can still get a copy
   of the updated file from here:
   http://git.sagemath.org/sage.git/plain/src/sage/interfaces/
  maxima_lib.py
  oops, sorry, this will give you an only unpatched copy...
  So you really need to get the patch somehow.
  
   save it as SAGE_ROOT/src/sage/intefaces/maxima_lib.py
   and then run `sage -b`.
  
   HTH,
   Dmitrii
  
   On Monday, June 23, 2014 8:38:46 AM UTC-4, Dima Pasechnik wrote:
  
   On 2014-06-23, Karl Schultheisz art.l...@gmail.com javascript:
  wrote:
I'm using Sage 6.2 on Arch Linux. I have posted before about sums
  being
wrong
   https://groups.google.com/d/msg/sage-support/IgC78rcdO7c/
  qTWzpA9f-P8J,
and I am happy to see that the community took action. Thanks! I
  have
   been
seeing other errors that may or may not be related to those
  addressed in
the link above.
   
I open a new Sage session (command line). The following code
 ought
  to
return (e^x - 1)/x.
   
sage: k = var('k')
sage: sum(x^k/factorial(k+1),k,0,oo)
1/4*sqrt(pi)*sqrt(x)*e^(1/2*x)
   
This looks similar to the sort of nonsense it was spitting out
 when
   misinterpreting
Bessel functions from Maxima 
 http://trac.sagemath.org/ticket/16224.
 
   In
the same session, if I run the summation command again, the
 result
  is
  
   did you try applying the patch from #16224 ?
  
different.
   
sage: sum(x^k/factorial(k+1),k,0,oo)
sum(x^k/factorial(k + 1), k, 0, +Infinity)
   
And after this it will not simplify any sums, even ones it would
  have
   done
correctly on the first try:
   
sage: sum(x^k/factorial(k),k,0,oo)
sum(x^k/factorial(k), k, 0, +Infinity)
   
Even a reset doesn't help. (As a side-note, the exit command
  doesn't
survive reset.)
   
sage: reset()
sage: k = var('k')
sage: sum(x^k/factorial(k),k,0,oo)
sum(x^k/factorial(k), k, 0, +Infinity)
sage: exit
   
   
  
 ---
 
NameError Traceback (most
  recent
   call
last)
   
 /opt/sage/local/lib/python2.7/site-packages/sage/all_cmdline.py
  in
   module()
 1 exit
   
NameError: name 'exit' is not defined
   
Finite sums seem to be ok.
   
sage: sum(x^k,k,0,3)
x^3 + x^2 + x + 1
sage: m = var('m')
sage: sum(x^k,k,0,m)
(x^(m + 1) - 1)/(x - 1)
   
Any help is greatly appreciated.
   
  
  
  
  
 
   --
  You received this message because you are subscribed to a topic in 

[sage-support] Re: strange behavior with sums

2014-06-23 Thread Dima Pasechnik
On 2014-06-23, Karl Schultheisz art.live...@gmail.com wrote:
 Thanks for your help. I ran:

 [...sage]$ git fetch http://trac.sagemath.org/sage.git
 u/pbruin/16224-maxima_to_sage
 fatal: Not a git repository (or any of the parent directories): .git

this should be one command (on one line)

$ git fetch http://trac.sagemath.org/sage.git u/pbruin/16224-maxima_to_sage


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: strange behavior with sums

2014-06-23 Thread Karl Schultheisz
I agree. Not sure why it is formatted in the quotation as two lines,
because I entered it as one line.


On Mon, Jun 23, 2014 at 6:09 PM, Dima Pasechnik dimp...@gmail.com wrote:

 On 2014-06-23, Karl Schultheisz art.live...@gmail.com wrote:
  Thanks for your help. I ran:
 
  [...sage]$ git fetch http://trac.sagemath.org/sage.git
  u/pbruin/16224-maxima_to_sage
  fatal: Not a git repository (or any of the parent directories): .git

 this should be one command (on one line)

 $ git fetch http://trac.sagemath.org/sage.git
 u/pbruin/16224-maxima_to_sage


 --
 You received this message because you are subscribed to a topic in the
 Google Groups sage-support group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/sage-support/7bPMqk_ORNo/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: strange behavior with sums

2014-06-23 Thread Karl Schultheisz
In Arch Linux, Sage installs to /opt/sage. I assume this is the SAGEROOT
you refer to.


On Mon, Jun 23, 2014 at 6:17 PM, Karl Schultheisz art.live...@gmail.com
wrote:

 I agree. Not sure why it is formatted in the quotation as two lines,
 because I entered it as one line.


 On Mon, Jun 23, 2014 at 6:09 PM, Dima Pasechnik dimp...@gmail.com wrote:

 On 2014-06-23, Karl Schultheisz art.live...@gmail.com wrote:
  Thanks for your help. I ran:
 
  [...sage]$ git fetch http://trac.sagemath.org/sage.git
  u/pbruin/16224-maxima_to_sage
  fatal: Not a git repository (or any of the parent directories): .git

 this should be one command (on one line)

 $ git fetch http://trac.sagemath.org/sage.git
 u/pbruin/16224-maxima_to_sage


 --
 You received this message because you are subscribed to a topic in the
 Google Groups sage-support group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/sage-support/7bPMqk_ORNo/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/d/optout.




-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: strange behavior with sums

2014-06-23 Thread Dima Pasechnik
On 2014-06-23, Karl Schultheisz art.live...@gmail.com wrote:
 Thanks for your help. I ran:

 [...sage]$ git fetch http://trac.sagemath.org/sage.git
 u/pbruin/16224-maxima_to_sage
 fatal: Not a git repository (or any of the parent directories): .git

I see - you don't have a git repository, and you do need one!
The quick way to get the patch is as follows: 
first do,  in some other directory, 

$ git clone http://trac.sagemath.org/sage.git

you'll see something like 

Cloning into 'sage'...
remote: Counting objects: 267342, done.
remote: Compressing objects: 100% (47582/47582), done.
remote: Total 267342 (delta 192114), reused 264313 (delta 189133)
Receiving objects: 100% (267342/267342), 76.30 MiB | 20.59 MiB/s,
done.
Resolving deltas: 100% (192114/192114), done.

now you do

$ cd sage
$ git fetch http://trac.sagemath.org/sage.git u/pbruin/16224-maxima_to_sage
$ git merge FETCH_HEAD

(the last two steps were already explained)

now you copy the patched file in question
(src/sage/interfaces/maxima_lib.py) to your working Sage
install, go there, run 'sage -b'...

If you like to do this on a regular basis then certainly it's better
to have Sage compiled from the git repo you just created.






 On Mon, Jun 23, 2014 at 2:55 PM, Dima Pasechnik dimp...@gmail.com wrote:

 On 2014-06-23, Karl Schultheisz art.live...@gmail.com wrote:
  I have installed git and chosen my name and email address. What commands
  should I run to apply this patch? I have been reading the developer
 manual,
  but at this point I am not interested in contributing code to Sage. I
 just
  want to apply patches.
 this is basically reviewing tickets.
 Although you need a developer's access to follow typical recepies from
 there. However, without the latter you are still OK.
 What you can do is the following:
 (from your SAGEROOT directory)

git fetch http://trac.sagemath.org/sage.git
 u/pbruin/16224-maxima_to_sage

 you should  see something like:

 From http://trac.sagemath.org/sage
  * branchu/pbruin/16224-maxima_to_sage - FETCH_HEAD

 Now we merge the stuff we just fetched:

git merge FETCH_HEAD

 this will open up an editor to record the merge commit message; write
 something there (normally it will already have some text to record).
 After you saved this file you will see somthing like

 Merge made by the 'recursive' strategy.
  src/sage/interfaces/maxima_lib.py | 58
  ++
   1 file changed, 34 insertions(+), 24 deletions(-)

 OK, patch applied, finally run

./sage -b

 HTH,
 Dmitrii




 
 
  On Mon, Jun 23, 2014 at 9:45 AM, Karl Schultheisz art.live...@gmail.com
 
  wrote:
 
  Thank you. It is obviously time that I learn to use git.
 
  On Monday, June 23, 2014 9:10:09 AM UTC-4, Dima Pasechnik wrote:
 
  On 2014-06-23, Dima Pasechnik dim...@gmail.com wrote:
   On 2014-06-23, Karl Schultheisz art.l...@gmail.com wrote:
   Sorry, I haven't. I don't know how.
   well, this is actually easy to fix, as no recompilation of Sage is
   needed here: the only change is in src/sage/intefaces/maxima_lib.py
  
   http://git.sagemath.org/sage.git/diff/src/sage/interfaces/
  maxima_lib.py?id=3e25c1357e6ecc551afe3e27633fdbbd01982708
  
   if you have Sage installed locally, know how to use git then
   you can get this patch applied and then run `sage -b`.
  
   In case you do not know anything about git, you can still get a copy
   of the updated file from here:
   http://git.sagemath.org/sage.git/plain/src/sage/interfaces/
  maxima_lib.py
  oops, sorry, this will give you an only unpatched copy...
  So you really need to get the patch somehow.
  
   save it as SAGE_ROOT/src/sage/intefaces/maxima_lib.py
   and then run `sage -b`.
  
   HTH,
   Dmitrii
  
   On Monday, June 23, 2014 8:38:46 AM UTC-4, Dima Pasechnik wrote:
  
   On 2014-06-23, Karl Schultheisz art.l...@gmail.com javascript:
  wrote:
I'm using Sage 6.2 on Arch Linux. I have posted before about sums
  being
wrong
   https://groups.google.com/d/msg/sage-support/IgC78rcdO7c/
  qTWzpA9f-P8J,
and I am happy to see that the community took action. Thanks! I
  have
   been
seeing other errors that may or may not be related to those
  addressed in
the link above.
   
I open a new Sage session (command line). The following code
 ought
  to
return (e^x - 1)/x.
   
sage: k = var('k')
sage: sum(x^k/factorial(k+1),k,0,oo)
1/4*sqrt(pi)*sqrt(x)*e^(1/2*x)
   
This looks similar to the sort of nonsense it was spitting out
 when
   misinterpreting
Bessel functions from Maxima 
 http://trac.sagemath.org/ticket/16224.
 
   In
the same session, if I run the summation command again, the
 result
  is
  
   did you try applying the patch from #16224 ?
  
different.
   
sage: sum(x^k/factorial(k+1),k,0,oo)
sum(x^k/factorial(k + 1), k, 0, +Infinity)
   
And after this it will not simplify any sums, even ones it would
  have
   done
correctly on 

[sage-support] Re: strange behavior with sums

2014-06-23 Thread Dima Pasechnik
On 2014-06-23, Karl Schultheisz art.live...@gmail.com wrote:
 In Arch Linux, Sage installs to /opt/sage. I assume this is the SAGEROOT
 you refer to.

yes. (usually you will also have an environment variable called
SAGE_ROOT set to the location)

As well,iIf you start Sage and type at the prompt, you'll see something like:

sage: SAGE_ROOT
'/usr/local/src/sage/sage'
sage: 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Strange behavior when trying to get help from command line

2013-04-28 Thread João Alberto Ferreira
Complementing, in the notebook interface, help(sqrt) and help(diff) shows 
the help for the functions in a new tab, but help(exp), help(cos) and 
help(sin) opens a new tab, but shows only the name of the function, not the 
help.

On Sunday, April 28, 2013 5:57:54 PM UTC-3, João Alberto Ferreira wrote:

 I perceived a strange behaviour when trying to get help from the command 
 line. When I hit

 sage: exp?

 for example, the help screen is shown as in the Fist_attempt.png appended 
 file. But, when I roll down and up again (using the arrow keys, or the 
 space or b keys), the help screen changes to the shown in the 
 Second_attempt.png appended file. For all commands tested, the first lines 
 of the help screen changed when I rolled down and up again.

 Still, the text of the help is duplicated. Is this correct? Some functions 
 do not show this duplicated text, like sqrt, diff, but others do, like 
 cos, sin.

 Cordially,
  
 João Alberto Ferreira.
  
 -
 ~$ uname -a
 Linux Hades 3.2.0-40-generic #64-Ubuntu SMP Mon Mar 25 21:22:26 UTC 2013 
 i686 athlon i386 GNU/Linux
  
 sage: version()
 'Sage Version 5.8, Release Date: 2013-03-15'


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: strange behavior on assigning string with single quotes

2010-05-12 Thread Rajeev
Let me also add that there is no problem if the dropdown menu at the
top is set at sage (the default option).



On May 12, 4:31 pm, Rajeev rajs2...@gmail.com wrote:
 Hi,

 I am finding a very strange behavior in notebook. Evaluating

 a = 'hello'

 gives

 Traceback (most recent call last):
   File stdin, line 1, in module
   File _sage_input_12.py, line 4, in module
     print _support_.syseval(python, ur\u0027\u0027\u0027a = \u0027hello
 \u0027\u0027\u0027\u0027, \u0027/home/rajeev/sage_notebook/
 sage_notebook.sagenb/home/admin/32/cells/25\u0027)
   File , line 1
     print _support_.syseval(python, ur'''a = 'hello, '/home/rajeev/
 sage_notebook/sage_notebook.sagenb/home/admin/32/cells/25')

 ^
 SyntaxError: EOL while scanning string literal

 There is no problem when I use double quotes. I am using sage 4.2 and
 I have selected python from the dropdown menu at the top.

 Rajeev

 --
 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 
 athttp://groups.google.com/group/sage-support
 URL:http://www.sagemath.org

-- 
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] Re: strange behavior on assigning string with single quotes

2010-05-12 Thread Tim Joseph Dumol
Hi Rajeev,

This is a bug in older versions of Sage. Please try downloading the latest
version over at: http://sagemath.org/download-linux.html.

On Wed, May 12, 2010 at 7:43 PM, Rajeev rajs2...@gmail.com wrote:

 Let me also add that there is no problem if the dropdown menu at the
 top is set at sage (the default option).



 On May 12, 4:31 pm, Rajeev rajs2...@gmail.com wrote:
  Hi,
 
  I am finding a very strange behavior in notebook. Evaluating
 
  a = 'hello'
 
  gives
 
  Traceback (most recent call last):
File stdin, line 1, in module
File _sage_input_12.py, line 4, in module
  print _support_.syseval(python, ur\u0027\u0027\u0027a = \u0027hello
  \u0027\u0027\u0027\u0027, \u0027/home/rajeev/sage_notebook/
  sage_notebook.sagenb/home/admin/32/cells/25\u0027)
File , line 1
  print _support_.syseval(python, ur'''a = 'hello, '/home/rajeev/
  sage_notebook/sage_notebook.sagenb/home/admin/32/cells/25')
 
  ^
  SyntaxError: EOL while scanning string literal
 
  There is no problem when I use double quotes. I am using sage 4.2 and
  I have selected python from the dropdown menu at the top.
 
  Rajeev
 
  --
  To post to this group, send email to sage-support@googlegroups.com
  To unsubscribe from this group, send email to
 sage-support+unsubscr...@googlegroups.comsage-support%2bunsubscr...@googlegroups.com
  For more options, visit this group athttp://
 groups.google.com/group/sage-support
  URL:http://www.sagemath.org

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




-- 
Tim Joseph Dumol tim (at) timdumol (dot) com
http://timdumol.com

-- 
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: Strange behavior in timeit

2009-08-03 Thread VictorMiller

As far as I know Maxima isn't involved -- I don't think that isogenies
uses Maxima.

Victor

On Aug 3, 6:58 pm, Simon King simon.k...@nuigalway.ie wrote:
 On 4 Aug., 00:29, VictorMiller victorsmil...@gmail.com wrote:
 ...





   phi = E.isogeny([E(0),P,-P])
  for i in xrange(20): timeit('phi(Q)')

  625 loops, best of 3: 1.17 ms per loop
  625 loops, best of 3: 1.75 ms per loop
  125 loops, best of 3: 2.1 ms per loop
  125 loops, best of 3: 2.22 ms per loop
  125 loops, best of 3: 2.3 ms per loop
  125 loops, best of 3: 2.4 ms per loop
  125 loops, best of 3: 2.52 ms per loop
  125 loops, best of 3: 2.73 ms per loop
  125 loops, best of 3: 3.02 ms per loop
  125 loops, best of 3: 3.32 ms per loop
  125 loops, best of 3: 3.48 ms per loop
  125 loops, best of 3: 3.73 ms per loop
  125 loops, best of 3: 3.79 ms per loop
  125 loops, best of 3: 4.21 ms per loop
  125 loops, best of 3: 4.56 ms per loop
  125 loops, best of 3: 5.09 ms per loop
  125 loops, best of 3: 5.63 ms per loop
  125 loops, best of 3: 6.23 ms per loop
  125 loops, best of 3: 6.86 ms per loop
  125 loops, best of 3: 7.52 ms per loop

 This reminds me the 
 threadshttp://groups.google.com/group/sage-devel/browse_thread/thread/863e59...
 orhttp://groups.google.com/group/sage-support/browse_thread/thread/abb4...

 In other words:
 Is Maxima involved in this computation?
 If yes, then it might be related with 
 tickethttp://trac.sagemath.org/sage_trac/ticket/4731
 Is someone working on this ticket?

 Cheers,
    Simon
--~--~-~--~~~---~--~~
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: Strange behavior in timeit

2009-08-03 Thread Minh Nguyen

Hi Victor,

On Tue, Aug 4, 2009 at 8:29 AM, VictorMillervictorsmil...@gmail.com wrote:

 I was trying to find out how fast a calculation was (applying an
 isogeny of degree on an elliptic curve over
 a finite field).  At first I noticed that when I repeated a timeit
 call with the same expression I was getting monotonically increasing
 numbers, so I decided to try something more systematic. I got the
 following peculiar results on sagenb.org (just now).  The average
 times keep getting longer and longer.  Could this be some bug in the
 way that the calls to internal timer routines are used?

  phi = E.isogeny([E(0),P,-P])

Just out of curiosity: How did you define E? I assume it's an elliptic
curve. But what were the commands you used to define it?

-- 
Regards
Minh Van Nguyen

--~--~-~--~~~---~--~~
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: Strange behavior in timeit

2009-08-03 Thread Simon King



On 4 Aug., 00:29, VictorMiller victorsmil...@gmail.com wrote:
...
  phi = E.isogeny([E(0),P,-P])
 for i in xrange(20): timeit('phi(Q)')

 625 loops, best of 3: 1.17 ms per loop
 625 loops, best of 3: 1.75 ms per loop
 125 loops, best of 3: 2.1 ms per loop
 125 loops, best of 3: 2.22 ms per loop
 125 loops, best of 3: 2.3 ms per loop
 125 loops, best of 3: 2.4 ms per loop
 125 loops, best of 3: 2.52 ms per loop
 125 loops, best of 3: 2.73 ms per loop
 125 loops, best of 3: 3.02 ms per loop
 125 loops, best of 3: 3.32 ms per loop
 125 loops, best of 3: 3.48 ms per loop
 125 loops, best of 3: 3.73 ms per loop
 125 loops, best of 3: 3.79 ms per loop
 125 loops, best of 3: 4.21 ms per loop
 125 loops, best of 3: 4.56 ms per loop
 125 loops, best of 3: 5.09 ms per loop
 125 loops, best of 3: 5.63 ms per loop
 125 loops, best of 3: 6.23 ms per loop
 125 loops, best of 3: 6.86 ms per loop
 125 loops, best of 3: 7.52 ms per loop

This reminds me the threads
http://groups.google.com/group/sage-devel/browse_thread/thread/863e59ba164590c5/e29c67ce1230f27d
or 
http://groups.google.com/group/sage-support/browse_thread/thread/abb492807b52973f/8737fbb78f1ed4e5

In other words:
Is Maxima involved in this computation?
If yes, then it might be related with ticket 
http://trac.sagemath.org/sage_trac/ticket/4731
Is someone working on this ticket?

Cheers,
   Simon

--~--~-~--~~~---~--~~
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: Strange behavior in timeit

2009-08-03 Thread William Stein

On Mon, Aug 3, 2009 at 4:37 PM, VictorMillervictorsmil...@gmail.com wrote:

 As far as I know Maxima isn't involved -- I don't think that isogenies
 uses Maxima.

You can prove Maxima isn't involved by doing the computation then
exiting sage and seeing if it says Exiting Maxima when Sage is
quiting.

William


 Victor

 On Aug 3, 6:58 pm, Simon King simon.k...@nuigalway.ie wrote:
 On 4 Aug., 00:29, VictorMiller victorsmil...@gmail.com wrote:
 ...





   phi = E.isogeny([E(0),P,-P])
  for i in xrange(20): timeit('phi(Q)')

  625 loops, best of 3: 1.17 ms per loop
  625 loops, best of 3: 1.75 ms per loop
  125 loops, best of 3: 2.1 ms per loop
  125 loops, best of 3: 2.22 ms per loop
  125 loops, best of 3: 2.3 ms per loop
  125 loops, best of 3: 2.4 ms per loop
  125 loops, best of 3: 2.52 ms per loop
  125 loops, best of 3: 2.73 ms per loop
  125 loops, best of 3: 3.02 ms per loop
  125 loops, best of 3: 3.32 ms per loop
  125 loops, best of 3: 3.48 ms per loop
  125 loops, best of 3: 3.73 ms per loop
  125 loops, best of 3: 3.79 ms per loop
  125 loops, best of 3: 4.21 ms per loop
  125 loops, best of 3: 4.56 ms per loop
  125 loops, best of 3: 5.09 ms per loop
  125 loops, best of 3: 5.63 ms per loop
  125 loops, best of 3: 6.23 ms per loop
  125 loops, best of 3: 6.86 ms per loop
  125 loops, best of 3: 7.52 ms per loop

 This reminds me the 
 threadshttp://groups.google.com/group/sage-devel/browse_thread/thread/863e59...
 orhttp://groups.google.com/group/sage-support/browse_thread/thread/abb4...

 In other words:
 Is Maxima involved in this computation?
 If yes, then it might be related with 
 tickethttp://trac.sagemath.org/sage_trac/ticket/4731
 Is someone working on this ticket?

 Cheers,
    Simon
 




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

--~--~-~--~~~---~--~~
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: Strange behavior in timeit

2009-08-03 Thread VictorMiller

Here are the commands I used:

qq = [z for z in primes(10,10+100) if (z%12) == 11]
E = EllipticCurve(j=GF(qq[0])(1728))
# E has qq[0]+1 points over GF(qq[0])
factor(qq[0]+1)
P = ((qq[0]+1)//3)*E.random_element()
K = [E(0),P,-P]
phi = E.isogeny(K)
for i in xrange(20): timeit('phi(Q)')


On Aug 3, 7:41 pm, Minh Nguyen nguyenmi...@gmail.com wrote:
 Hi Victor,

 On Tue, Aug 4, 2009 at 8:29 AM, VictorMillervictorsmil...@gmail.com wrote:

  I was trying to find out how fast a calculation was (applying an
  isogeny of degree on an elliptic curve over
  a finite field).  At first I noticed that when I repeated a timeit
  call with the same expression I was getting monotonically increasing
  numbers, so I decided to try something more systematic. I got the
  following peculiar results on sagenb.org (just now).  The average
  times keep getting longer and longer.  Could this be some bug in the
  way that the calls to internal timer routines are used?

   phi = E.isogeny([E(0),P,-P])

 Just out of curiosity: How did you define E? I assume it's an elliptic
 curve. But what were the commands you used to define it?

 --
 Regards
 Minh Van Nguyen
--~--~-~--~~~---~--~~
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: Strange behavior in timeit

2009-08-03 Thread Simon King

Hi!

On 4 Aug., 02:31, VictorMiller victorsmil...@gmail.com wrote:
 Here are the commands I used:

 qq = [z for z in primes(10,10+100) if (z%12) == 11]
 E = EllipticCurve(j=GF(qq[0])(1728))
 # E has qq[0]+1 points over GF(qq[0])
 factor(qq[0]+1)
 P = ((qq[0]+1)//3)*E.random_element()
 K = [E(0),P,-P]
 phi = E.isogeny(K)

No Maxima up  to here (tested by quitting Sage)...

 for i in xrange(20): timeit('phi(Q)')

But also no Q. How is Q defined?

Regards,
Simon
--~--~-~--~~~---~--~~
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: Strange behavior in timeit

2009-08-03 Thread VictorMiller

Sorry, here's the definition of Q:

Q = E.random_element()

Victor

On Aug 3, 8:45 pm, Simon King simon.k...@nuigalway.ie wrote:
 Hi!

 On 4 Aug., 02:31, VictorMiller victorsmil...@gmail.com wrote:

  Here are the commands I used:

  qq = [z for z in primes(10,10+100) if (z%12) == 11]
  E = EllipticCurve(j=GF(qq[0])(1728))
  # E has qq[0]+1 points over GF(qq[0])
  factor(qq[0]+1)
  P = ((qq[0]+1)//3)*E.random_element()
  K = [E(0),P,-P]
  phi = E.isogeny(K)

 No Maxima up  to here (tested by quitting Sage)...

  for i in xrange(20): timeit('phi(Q)')

 But also no Q. How is Q defined?

 Regards,
 Simon
--~--~-~--~~~---~--~~
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: Strange behavior in timeit

2009-08-03 Thread Simon King

Hi Victor,

On 4 Aug., 03:10, VictorMiller victorsmil...@gmail.com wrote:
 Sorry, here's the definition of Q:

 Q = E.random_element()

Thanks! So, probably it is unrelated with the ticket I mentioned.

Also note that the computation time does not increase monotonely:
sage: for i in xrange(20): timeit('phi(Q)')
:
625 loops, best of 3: 612 µs per loop
625 loops, best of 3: 1.12 ms per loop
625 loops, best of 3: 1.78 ms per loop
125 loops, best of 3: 2.8 ms per loop
125 loops, best of 3: 2.13 ms per loop
125 loops, best of 3: 2.19 ms per loop
125 loops, best of 3: 2.3 ms per loop
25 loops, best of 3: 9.26 ms per loop
25 loops, best of 3: 8.69 ms per loop
25 loops, best of 3: 8.8 ms per loop
25 loops, best of 3: 10.2 ms per loop
25 loops, best of 3: 2.55 ms per loop
125 loops, best of 3: 2.75 ms per loop
25 loops, best of 3: 9.93 ms per loop
25 loops, best of 3: 2.92 ms per loop
125 loops, best of 3: 5.31 ms per loop
125 loops, best of 3: 4.19 ms per loop
125 loops, best of 3: 8.45 ms per loop
25 loops, best of 3: 8.83 ms per loop
25 loops, best of 3: 5.13 ms per loop

This might be explainable with randomized algorithms, which wouldn't
be a bug, even though the discrepancy between 10ms and 0.6ms is
impressive, and even though timeit should not be much affected by
random noise, since it does many loops.

Cheers,
   Simon
--~--~-~--~~~---~--~~
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: Strange behavior in timeit

2009-08-03 Thread William Stein

On Mon, Aug 3, 2009 at 6:10 PM, VictorMillervictorsmil...@gmail.com wrote:

 Sorry, here's the definition of Q:

 Q = E.random_element()

 Victor

 On Aug 3, 8:45 pm, Simon King simon.k...@nuigalway.ie wrote:
 Hi!

 On 4 Aug., 02:31, VictorMiller victorsmil...@gmail.com wrote:

  Here are the commands I used:

  qq = [z for z in primes(10,10+100) if (z%12) == 11]
  E = EllipticCurve(j=GF(qq[0])(1728))
  # E has qq[0]+1 points over GF(qq[0])
  factor(qq[0]+1)
  P = ((qq[0]+1)//3)*E.random_element()
  K = [E(0),P,-P]
  phi = E.isogeny(K)

There appears to be a memory leak -- or some sort of caching (!) -- in
the code to evaluate phi.  This is likely impacting the complexity of
the some code that is run during the computation of phi(P).  The log
below shows that memory usage increases upon evaluation of phi(P):

sage: get_memory_usage()
210.109375
sage: timeit('phi(P)')
125 loops, best of 3: 7.13 ms per loop
sage: get_memory_usage()
210.609375
sage: timeit('phi(P)')
125 loops, best of 3: 7.3 ms per loop
sage: get_memory_usage()
211.109375
sage: timeit('phi(P)')
125 loops, best of 3: 7.49 ms per loop
sage: get_memory_usage()
211.609375
sage: timeit('phi(P)')
125 loops, best of 3: 7.69 ms per loop
sage: get_memory_usage()
212.109375

Now I looked at the source code for the function phi(P) =
phi.__call__(P) and bisected by putting early returns in.  If you
change

else:
outP = self.__E2(outP)

to

else:
return outP
outP = self.__E2(outP)

in that function in ell_curve_isogeny.py (around line 875), then the
leak and slowdown vanishes.

Thus the real problem is in the trivial line self.__E2(outP),
which by the way takes even in good cases like 10 times as long as the
rest of the whole function put together.  Indeed, coercing a point
into a curve is a horrendous disaster (this is the real problem,
forget the isogeny stuff):

sage: get_memory_usage()
195.81640625
sage: timeit('E(P)')
625 loops, best of 3: 4.24 ms per loop
sage: get_memory_usage()
201.31640625

In fact, the function E.point is to blame, evidently:

sage: timeit('E.point(P)')
125 loops, best of 3: 4.13 ms per loop
sage: get_memory_usage()
202.08984375
sage: timeit('E.point(P)')
125 loops, best of 3: 4.4 ms per loop
sage: get_memory_usage()
203.08984375

... but *ONLY* with check=True (the default):

sage: timeit('E.point(P,check=False)')
625 loops, best of 3: 8.26 µs per loop
sage: get_memory_usage()
203.08984375
sage: timeit('E.point(P,check=False)')
625 loops, best of 3: 7.29 µs per loop
sage: get_memory_usage()
203.08984375

I.e., we get a speedup of a factor of nearly 1000 by using
check=False, plus the leak goes away.So in the check -- which
involves arithmetic -- maybe the coercion model is surely being
invoked at some point (I guess), and that is perhaps caching
information, thus memory usage goes up and performance goes down.  I
don't know, I'm not looking further.

Going back to your original problem, if I change in ell_curve_isogeny.py

else:
outP = self.__E2(outP)

to

else:
outP = self.__E2.point(outP,check=False)

then we have the following, which is exactly what you would hope for
(things are fast,  no slowdown).

sage: qq = [z for z in primes(10,10+100) if (z%12) == 11]
sage: E = EllipticCurve(j=GF(qq[0])(1728))
sage: # E has qq[0]+1 points over GF(qq[0])
sage: factor(qq[0]+1)
2^2 * 3 * 5 * 1667
sage: P = ((qq[0]+1)//3)*E.random_element()
sage: K = [E(0),P,-P]
sage: phi = E.isogeny(K)
sage: get_memory_usage()
190.56640625
sage: timeit('phi(P)')
625 loops, best of 3: 69.8 µs per loop
sage: for i in xrange(20): timeit('phi(P)')

:
625 loops, best of 3: 69.3 µs per loop
625 loops, best of 3: 69.3 µs per loop
625 loops, best of 3: 69.6 µs per loop
625 loops, best of 3: 69.9 µs per loop
625 loops, best of 3: 69.8 µs per loop
625 loops, best of 3: 70 µs per loop
625 loops, best of 3: 71.2 µs per loop
625 loops, best of 3: 69.3 µs per loop
625 loops, best of 3: 70.8 µs per loop
625 loops, best of 3: 69.2 µs per loop
625 loops, best of 3: 70.2 µs per loop
625 loops, best of 3: 70.7 µs per loop
625 loops, best of 3: 70 µs per loop
625 loops, best of 3: 71 µs per loop
625 loops, best of 3: 70 µs per loop
625 loops, best of 3: 70.2 µs per loop
625 loops, best of 3: 70.1 µs per loop
625 loops, best of 3: 70 µs per loop
625 loops, best of 3: 70.1 µs per loop
625 loops, best of 3: 70.1 µs per loop

The above change is very sensible, since we know that outP is on
self.__E2, so should directly create a point on E2 and not check again
that our point is really on E2 (which is very expensive).

I hope the above is helpful and that somebody opens a trac ticket and
submits a patch.I have to get back to what I was doing...   I also
hope the above email provides some ideas as to how to quickly get to
the bottom of questions like this.  Note that I did all this in  10
minutes by using ?? to see where relevant source code is, putting in
some 

[sage-support] Re: Strange behavior in timeit

2009-08-03 Thread Dan Shumow

 The above change is very sensible, since we know that outP is on
 self.__E2, so should directly create a point on E2 and not check again
 that our point is really on E2 (which is very expensive).

I agree that we should make the change:

   else:
   outP = self.__E2(outP)

to

   else:
   outP = self.__E2.point(outP,check=False)


When I originally wrote the code I did not know that this problem
existed.  I just wanted to map a pair of elements on a field to the
elliptic curve point object associated to those coordinates.

I created the ticket:
http://trac.sagemath.org/sage_trac/ticket/6672

and will fix this when I get home tonight (I'm at work right now.)
The fix is very easy, if someone else wants to grab it for now, that
is fine.  But just be sure to set check = false in the other point
coercion call as well (in the if block associated with this else
block.)

Thanks,
Dan



On Mon, Aug 3, 2009 at 7:00 PM, William Steinwst...@gmail.com wrote:
 On Mon, Aug 3, 2009 at 6:10 PM, VictorMillervictorsmil...@gmail.com wrote:

 Sorry, here's the definition of Q:

 Q = E.random_element()

 Victor

 On Aug 3, 8:45 pm, Simon King simon.k...@nuigalway.ie wrote:
 Hi!

 On 4 Aug., 02:31, VictorMiller victorsmil...@gmail.com wrote:

  Here are the commands I used:

  qq = [z for z in primes(10,10+100) if (z%12) == 11]
  E = EllipticCurve(j=GF(qq[0])(1728))
  # E has qq[0]+1 points over GF(qq[0])
  factor(qq[0]+1)
  P = ((qq[0]+1)//3)*E.random_element()
  K = [E(0),P,-P]
  phi = E.isogeny(K)

 There appears to be a memory leak -- or some sort of caching (!) -- in
 the code to evaluate phi.  This is likely impacting the complexity of
 the some code that is run during the computation of phi(P).  The log
 below shows that memory usage increases upon evaluation of phi(P):

 sage: get_memory_usage()
 210.109375
 sage: timeit('phi(P)')
 125 loops, best of 3: 7.13 ms per loop
 sage: get_memory_usage()
 210.609375
 sage: timeit('phi(P)')
 125 loops, best of 3: 7.3 ms per loop
 sage: get_memory_usage()
 211.109375
 sage: timeit('phi(P)')
 125 loops, best of 3: 7.49 ms per loop
 sage: get_memory_usage()
 211.609375
 sage: timeit('phi(P)')
 125 loops, best of 3: 7.69 ms per loop
 sage: get_memory_usage()
 212.109375

 Now I looked at the source code for the function phi(P) =
 phi.__call__(P) and bisected by putting early returns in.  If you
 change

        else:
            outP = self.__E2(outP)

 to

        else:
            return outP
            outP = self.__E2(outP)

 in that function in ell_curve_isogeny.py (around line 875), then the
 leak and slowdown vanishes.

 Thus the real problem is in the trivial line self.__E2(outP),
 which by the way takes even in good cases like 10 times as long as the
 rest of the whole function put together.  Indeed, coercing a point
 into a curve is a horrendous disaster (this is the real problem,
 forget the isogeny stuff):

 sage: get_memory_usage()
 195.81640625
 sage: timeit('E(P)')
 625 loops, best of 3: 4.24 ms per loop
 sage: get_memory_usage()
 201.31640625

 In fact, the function E.point is to blame, evidently:

 sage: timeit('E.point(P)')
 125 loops, best of 3: 4.13 ms per loop
 sage: get_memory_usage()
 202.08984375
 sage: timeit('E.point(P)')
 125 loops, best of 3: 4.4 ms per loop
 sage: get_memory_usage()
 203.08984375

 ... but *ONLY* with check=True (the default):

 sage: timeit('E.point(P,check=False)')
 625 loops, best of 3: 8.26 µs per loop
 sage: get_memory_usage()
 203.08984375
 sage: timeit('E.point(P,check=False)')
 625 loops, best of 3: 7.29 µs per loop
 sage: get_memory_usage()
 203.08984375

 I.e., we get a speedup of a factor of nearly 1000 by using
 check=False, plus the leak goes away.    So in the check -- which
 involves arithmetic -- maybe the coercion model is surely being
 invoked at some point (I guess), and that is perhaps caching
 information, thus memory usage goes up and performance goes down.  I
 don't know, I'm not looking further.

 Going back to your original problem, if I change in ell_curve_isogeny.py

        else:
            outP = self.__E2(outP)

 to

        else:
            outP = self.__E2.point(outP,check=False)

 then we have the following, which is exactly what you would hope for
 (things are fast,  no slowdown).

 sage: qq = [z for z in primes(10,10+100) if (z%12) == 11]
 sage: E = EllipticCurve(j=GF(qq[0])(1728))
 sage: # E has qq[0]+1 points over GF(qq[0])
 sage: factor(qq[0]+1)
 2^2 * 3 * 5 * 1667
 sage: P = ((qq[0]+1)//3)*E.random_element()
 sage: K = [E(0),P,-P]
 sage: phi = E.isogeny(K)
 sage: get_memory_usage()
 190.56640625
 sage: timeit('phi(P)')
 625 loops, best of 3: 69.8 µs per loop
 sage: for i in xrange(20): timeit('phi(P)')

 :
 625 loops, best of 3: 69.3 µs per loop
 625 loops, best of 3: 69.3 µs per loop
 625 loops, best of 3: 69.6 µs per loop
 625 loops, best of 3: 69.9 µs per loop
 625 loops, best of 3: 69.8 µs per loop
 625 loops, best of 3: 70 µs per loop
 625 loops, 

[sage-support] Re: Strange behavior in timeit

2009-08-03 Thread William Stein

On Mon, Aug 3, 2009 at 7:23 PM, Dan Shumowshu...@gmail.com wrote:
 The above change is very sensible, since we know that outP is on
 self.__E2, so should directly create a point on E2 and not check again
 that our point is really on E2 (which is very expensive).

 I agree that we should make the change:

       else:
           outP = self.__E2(outP)

 to

       else:
           outP = self.__E2.point(outP,check=False)


 When I originally wrote the code I did not know that this problem
 existed.

And I didn't know about it until a half hour ago :-).

William

 I just wanted to map a pair of elements on a field to the
 elliptic curve point object associated to those coordinates.

 I created the ticket:
 http://trac.sagemath.org/sage_trac/ticket/6672

 and will fix this when I get home tonight (I'm at work right now.)

Thanks!!

 The fix is very easy, if someone else wants to grab it for now, that
 is fine.  But just be sure to set check = false in the other point
 coercion call as well (in the if block associated with this else
 block.)

 Thanks,
 Dan



 On Mon, Aug 3, 2009 at 7:00 PM, William Steinwst...@gmail.com wrote:
 On Mon, Aug 3, 2009 at 6:10 PM, VictorMillervictorsmil...@gmail.com wrote:

 Sorry, here's the definition of Q:

 Q = E.random_element()

 Victor

 On Aug 3, 8:45 pm, Simon King simon.k...@nuigalway.ie wrote:
 Hi!

 On 4 Aug., 02:31, VictorMiller victorsmil...@gmail.com wrote:

  Here are the commands I used:

  qq = [z for z in primes(10,10+100) if (z%12) == 11]
  E = EllipticCurve(j=GF(qq[0])(1728))
  # E has qq[0]+1 points over GF(qq[0])
  factor(qq[0]+1)
  P = ((qq[0]+1)//3)*E.random_element()
  K = [E(0),P,-P]
  phi = E.isogeny(K)

 There appears to be a memory leak -- or some sort of caching (!) -- in
 the code to evaluate phi.  This is likely impacting the complexity of
 the some code that is run during the computation of phi(P).  The log
 below shows that memory usage increases upon evaluation of phi(P):

 sage: get_memory_usage()
 210.109375
 sage: timeit('phi(P)')
 125 loops, best of 3: 7.13 ms per loop
 sage: get_memory_usage()
 210.609375
 sage: timeit('phi(P)')
 125 loops, best of 3: 7.3 ms per loop
 sage: get_memory_usage()
 211.109375
 sage: timeit('phi(P)')
 125 loops, best of 3: 7.49 ms per loop
 sage: get_memory_usage()
 211.609375
 sage: timeit('phi(P)')
 125 loops, best of 3: 7.69 ms per loop
 sage: get_memory_usage()
 212.109375

 Now I looked at the source code for the function phi(P) =
 phi.__call__(P) and bisected by putting early returns in.  If you
 change

        else:
            outP = self.__E2(outP)

 to

        else:
            return outP
            outP = self.__E2(outP)

 in that function in ell_curve_isogeny.py (around line 875), then the
 leak and slowdown vanishes.

 Thus the real problem is in the trivial line self.__E2(outP),
 which by the way takes even in good cases like 10 times as long as the
 rest of the whole function put together.  Indeed, coercing a point
 into a curve is a horrendous disaster (this is the real problem,
 forget the isogeny stuff):

 sage: get_memory_usage()
 195.81640625
 sage: timeit('E(P)')
 625 loops, best of 3: 4.24 ms per loop
 sage: get_memory_usage()
 201.31640625

 In fact, the function E.point is to blame, evidently:

 sage: timeit('E.point(P)')
 125 loops, best of 3: 4.13 ms per loop
 sage: get_memory_usage()
 202.08984375
 sage: timeit('E.point(P)')
 125 loops, best of 3: 4.4 ms per loop
 sage: get_memory_usage()
 203.08984375

 ... but *ONLY* with check=True (the default):

 sage: timeit('E.point(P,check=False)')
 625 loops, best of 3: 8.26 µs per loop
 sage: get_memory_usage()
 203.08984375
 sage: timeit('E.point(P,check=False)')
 625 loops, best of 3: 7.29 µs per loop
 sage: get_memory_usage()
 203.08984375

 I.e., we get a speedup of a factor of nearly 1000 by using
 check=False, plus the leak goes away.    So in the check -- which
 involves arithmetic -- maybe the coercion model is surely being
 invoked at some point (I guess), and that is perhaps caching
 information, thus memory usage goes up and performance goes down.  I
 don't know, I'm not looking further.

 Going back to your original problem, if I change in ell_curve_isogeny.py

        else:
            outP = self.__E2(outP)

 to

        else:
            outP = self.__E2.point(outP,check=False)

 then we have the following, which is exactly what you would hope for
 (things are fast,  no slowdown).

 sage: qq = [z for z in primes(10,10+100) if (z%12) == 11]
 sage: E = EllipticCurve(j=GF(qq[0])(1728))
 sage: # E has qq[0]+1 points over GF(qq[0])
 sage: factor(qq[0]+1)
 2^2 * 3 * 5 * 1667
 sage: P = ((qq[0]+1)//3)*E.random_element()
 sage: K = [E(0),P,-P]
 sage: phi = E.isogeny(K)
 sage: get_memory_usage()
 190.56640625
 sage: timeit('phi(P)')
 625 loops, best of 3: 69.8 µs per loop
 sage: for i in xrange(20): timeit('phi(P)')

 :
 625 loops, best of 3: 69.3 µs per loop
 625 loops, best of 3: 69.3 µs per loop
 625 loops, 

[sage-support] Re: strange behavior

2009-06-15 Thread William Stein

On Mon, Jun 15, 2009 at 6:07 AM, Florian Beutlerflorian.beut...@gmx.de wrote:

 hello

 flor...@florian-laptop:~/Gadget-2.0.3/Analysis$ sage -v
 | SAGE Version 3.0.5, Release Date: 2008-07-11

 my operation system is ubuntu 9,04

 What are the paths below to /usr/lib?

 I don't know what you mean...
 regards
 florian

You should apt-get remove sagemath, then install sage from source or
one of the binaries
at http://sagemath.org/.  The Sage included in Debian/Ubuntu is
extremely out of date.

William


 On Jun 14, 10:00 pm, William Stein wst...@gmail.com wrote:
 On Sun, Jun 14, 2009 at 6:48 AM, Florian Beutlerflorian.beut...@gmx.de 
 wrote:

  yep sorry... here is the error message

 What version of Sage are you using?  On what computer? Etc. etc.
 What are the paths below to /usr/lib?

  -- William





  flor...@florian-laptop:~/sage$ sage friction.py
  Ok... dann legen wir mal los!

  step1: definition of the density profile
  99824085.5683

  step2: definition of the circular velocity
  3.51331142172386

  step3: definition of the integrated mass
  229643.853879355

  step3: definition of the integrated mass
  Traceback (most recent call last):
   File friction.py, line 29, in module
     print mass(r).n(),\n
   File /home/florian/sage/functions.py, line 21, in mass
     i_term = integral(x**2*rho(x), x, 0, r)
   File /usr/lib/python2.5/site-packages/sage/misc/functional.py,
  line 436, in integral
     return x.integral(*args, **kwds)
   File /usr/lib/python2.5/site-packages/sage/calculus/calculus.py,
  line 2508, in integral
     return self.parent()(self._maxima_().integrate(v, a, b))
   File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
  line 1601, in integral
     return I(var, min, max)
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line 1182, in __call__
     return self._obj.parent().function_call(self._name, [self._obj] +
  list(args))
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line , in function_call
     return self.new(%s(%s)%(function, ,.join([s.name() for s in
  args])))
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line 1013, in new
     return self(code)
   File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
  line 377, in __call__
     return Expect.__call__(self, x)
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line 948, in __call__
     return cls(self, x)
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line 1214, in __init__
     self._name = parent._create(value)
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line 1092, in _create
     self.set(name, value)
   File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
  line 855, in set
     self._eval_line(cmd)
   File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
  line 567, in _eval_line
     self._expect_expr()
   File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
  line 457, in _expect_expr
     i = self._expect.expect(expr)
   File /usr/lib/python2.5/site-packages/pexpect.py, line 1311, in
  expect
     return self.expect_list(compiled_pattern_list, timeout,
  searchwindowsize)
   File /usr/lib/python2.5/site-packages/pexpect.py, line 1325, in
  expect_list
     return self.expect_loop(searcher_re(pattern_list), timeout,
  searchwindowsize)
   File /usr/lib/python2.5/site-packages/pexpect.py, line 1396, in
  expect_loop
     raise EOF (str(e) + '\n' + str(self))
  pexpect.EOF: End Of File (EOF) in read_nonblocking(). Exception style
  platform.
  pexpect.spawn object at 0x3cfe890
  version: 2.3 ($Revision: 399 $)
  command: /usr/bin/maxima
  args: ['/usr/bin/maxima', '-p', '/usr/lib/sagemath/local/bin/sage-
  maxima.lisp']
  searcher: searcher_re:
     0: re.compile(\(\%i[0-9]+\))
     1: re.compile(zero or nonzero?)
     2: re.compile(an integer?)
     3: re.compile(positive, negative, or zero?)
     4: re.compile(positive or negative?)
     5: re.compile(Break [0-9]+)
  buffer (last 100 chars):
  before (last 100 chars):
  `rat' replaced 1.0 by 1/1 = 1.0

  `rat' replaced 1.234567901234568 by 100/81 = 1.234567901234568

  after: class 'pexpect.EOF'
  match: None
  match_index: None
  exitstatus: None
  flag_eof: True
  pid: 4147
  child_fd: 3
  closed: False
  timeout: None
  delimiter: class 'pexpect.EOF'
  logfile: None
  logfile_read: None
  logfile_send: None
  maxread: 1
  ignorecase: False
  searchwindowsize: None
  delaybeforesend: 0
  delayafterclose: 0.1
  delayafterterminate: 0.1
  Maxima crashed -- automatically restarting.
  End Of File (EOF) in read_nonblocking(). Exception style platform.
  pexpect.spawn object at 0x3cfe890
  version: 2.3 ($Revision: 399 $)
  command: /usr/bin/maxima
  args: ['/usr/bin/maxima', '-p', '/usr/lib/sagemath/local/bin/sage-
  maxima.lisp']
  searcher: searcher_re:
     0: re.compile(\(\%i[0-9]+\))
  buffer (last 100 chars):
  before (last 100 chars):
  after: class 

[sage-support] Re: strange behavior

2009-06-14 Thread Florian Beutler

yep sorry... here is the error message

flor...@florian-laptop:~/sage$ sage friction.py
Ok... dann legen wir mal los!

step1: definition of the density profile
99824085.5683

step2: definition of the circular velocity
3.51331142172386

step3: definition of the integrated mass
229643.853879355

step3: definition of the integrated mass
Traceback (most recent call last):
  File friction.py, line 29, in module
print mass(r).n(),\n
  File /home/florian/sage/functions.py, line 21, in mass
i_term = integral(x**2*rho(x), x, 0, r)
  File /usr/lib/python2.5/site-packages/sage/misc/functional.py,
line 436, in integral
return x.integral(*args, **kwds)
  File /usr/lib/python2.5/site-packages/sage/calculus/calculus.py,
line 2508, in integral
return self.parent()(self._maxima_().integrate(v, a, b))
  File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
line 1601, in integral
return I(var, min, max)
  File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
line 1182, in __call__
return self._obj.parent().function_call(self._name, [self._obj] +
list(args))
  File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
line , in function_call
return self.new(%s(%s)%(function, ,.join([s.name() for s in
args])))
  File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
line 1013, in new
return self(code)
  File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
line 377, in __call__
return Expect.__call__(self, x)
  File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
line 948, in __call__
return cls(self, x)
  File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
line 1214, in __init__
self._name = parent._create(value)
  File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
line 1092, in _create
self.set(name, value)
  File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
line 855, in set
self._eval_line(cmd)
  File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
line 567, in _eval_line
self._expect_expr()
  File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
line 457, in _expect_expr
i = self._expect.expect(expr)
  File /usr/lib/python2.5/site-packages/pexpect.py, line 1311, in
expect
return self.expect_list(compiled_pattern_list, timeout,
searchwindowsize)
  File /usr/lib/python2.5/site-packages/pexpect.py, line 1325, in
expect_list
return self.expect_loop(searcher_re(pattern_list), timeout,
searchwindowsize)
  File /usr/lib/python2.5/site-packages/pexpect.py, line 1396, in
expect_loop
raise EOF (str(e) + '\n' + str(self))
pexpect.EOF: End Of File (EOF) in read_nonblocking(). Exception style
platform.
pexpect.spawn object at 0x3cfe890
version: 2.3 ($Revision: 399 $)
command: /usr/bin/maxima
args: ['/usr/bin/maxima', '-p', '/usr/lib/sagemath/local/bin/sage-
maxima.lisp']
searcher: searcher_re:
0: re.compile(\(\%i[0-9]+\))
1: re.compile(zero or nonzero?)
2: re.compile(an integer?)
3: re.compile(positive, negative, or zero?)
4: re.compile(positive or negative?)
5: re.compile(Break [0-9]+)
buffer (last 100 chars):
before (last 100 chars):
`rat' replaced 1.0 by 1/1 = 1.0

`rat' replaced 1.234567901234568 by 100/81 = 1.234567901234568

after: class 'pexpect.EOF'
match: None
match_index: None
exitstatus: None
flag_eof: True
pid: 4147
child_fd: 3
closed: False
timeout: None
delimiter: class 'pexpect.EOF'
logfile: None
logfile_read: None
logfile_send: None
maxread: 1
ignorecase: False
searchwindowsize: None
delaybeforesend: 0
delayafterclose: 0.1
delayafterterminate: 0.1
Maxima crashed -- automatically restarting.
End Of File (EOF) in read_nonblocking(). Exception style platform.
pexpect.spawn object at 0x3cfe890
version: 2.3 ($Revision: 399 $)
command: /usr/bin/maxima
args: ['/usr/bin/maxima', '-p', '/usr/lib/sagemath/local/bin/sage-
maxima.lisp']
searcher: searcher_re:
0: re.compile(\(\%i[0-9]+\))
buffer (last 100 chars):
before (last 100 chars):
after: class 'pexpect.EOF'
match: None
match_index: None
exitstatus: 1
flag_eof: True
pid: 4166
child_fd: 3
closed: False
timeout: 30
delimiter: class 'pexpect.EOF'
logfile: None
logfile_read: None
logfile_send: None
maxread: 1
ignorecase: False
searchwindowsize: None
delaybeforesend: 0
delayafterclose: 0.1
delayafterterminate: 0.1
sage: Error running friction.py using Python
flor...@florian-laptop:~/sage$

--~--~-~--~~~---~--~~
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: strange behavior

2009-06-14 Thread William Stein

On Sun, Jun 14, 2009 at 6:48 AM, Florian Beutlerflorian.beut...@gmx.de wrote:

 yep sorry... here is the error message

What version of Sage are you using?  On what computer? Etc. etc.
What are the paths below to /usr/lib?

 -- William


 flor...@florian-laptop:~/sage$ sage friction.py
 Ok... dann legen wir mal los!

 step1: definition of the density profile
 99824085.5683

 step2: definition of the circular velocity
 3.51331142172386

 step3: definition of the integrated mass
 229643.853879355

 step3: definition of the integrated mass
 Traceback (most recent call last):
  File friction.py, line 29, in module
    print mass(r).n(),\n
  File /home/florian/sage/functions.py, line 21, in mass
    i_term = integral(x**2*rho(x), x, 0, r)
  File /usr/lib/python2.5/site-packages/sage/misc/functional.py,
 line 436, in integral
    return x.integral(*args, **kwds)
  File /usr/lib/python2.5/site-packages/sage/calculus/calculus.py,
 line 2508, in integral
    return self.parent()(self._maxima_().integrate(v, a, b))
  File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
 line 1601, in integral
    return I(var, min, max)
  File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
 line 1182, in __call__
    return self._obj.parent().function_call(self._name, [self._obj] +
 list(args))
  File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
 line , in function_call
    return self.new(%s(%s)%(function, ,.join([s.name() for s in
 args])))
  File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
 line 1013, in new
    return self(code)
  File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
 line 377, in __call__
    return Expect.__call__(self, x)
  File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
 line 948, in __call__
    return cls(self, x)
  File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
 line 1214, in __init__
    self._name = parent._create(value)
  File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
 line 1092, in _create
    self.set(name, value)
  File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
 line 855, in set
    self._eval_line(cmd)
  File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
 line 567, in _eval_line
    self._expect_expr()
  File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
 line 457, in _expect_expr
    i = self._expect.expect(expr)
  File /usr/lib/python2.5/site-packages/pexpect.py, line 1311, in
 expect
    return self.expect_list(compiled_pattern_list, timeout,
 searchwindowsize)
  File /usr/lib/python2.5/site-packages/pexpect.py, line 1325, in
 expect_list
    return self.expect_loop(searcher_re(pattern_list), timeout,
 searchwindowsize)
  File /usr/lib/python2.5/site-packages/pexpect.py, line 1396, in
 expect_loop
    raise EOF (str(e) + '\n' + str(self))
 pexpect.EOF: End Of File (EOF) in read_nonblocking(). Exception style
 platform.
 pexpect.spawn object at 0x3cfe890
 version: 2.3 ($Revision: 399 $)
 command: /usr/bin/maxima
 args: ['/usr/bin/maxima', '-p', '/usr/lib/sagemath/local/bin/sage-
 maxima.lisp']
 searcher: searcher_re:
    0: re.compile(\(\%i[0-9]+\))
    1: re.compile(zero or nonzero?)
    2: re.compile(an integer?)
    3: re.compile(positive, negative, or zero?)
    4: re.compile(positive or negative?)
    5: re.compile(Break [0-9]+)
 buffer (last 100 chars):
 before (last 100 chars):
 `rat' replaced 1.0 by 1/1 = 1.0

 `rat' replaced 1.234567901234568 by 100/81 = 1.234567901234568

 after: class 'pexpect.EOF'
 match: None
 match_index: None
 exitstatus: None
 flag_eof: True
 pid: 4147
 child_fd: 3
 closed: False
 timeout: None
 delimiter: class 'pexpect.EOF'
 logfile: None
 logfile_read: None
 logfile_send: None
 maxread: 1
 ignorecase: False
 searchwindowsize: None
 delaybeforesend: 0
 delayafterclose: 0.1
 delayafterterminate: 0.1
 Maxima crashed -- automatically restarting.
 End Of File (EOF) in read_nonblocking(). Exception style platform.
 pexpect.spawn object at 0x3cfe890
 version: 2.3 ($Revision: 399 $)
 command: /usr/bin/maxima
 args: ['/usr/bin/maxima', '-p', '/usr/lib/sagemath/local/bin/sage-
 maxima.lisp']
 searcher: searcher_re:
    0: re.compile(\(\%i[0-9]+\))
 buffer (last 100 chars):
 before (last 100 chars):
 after: class 'pexpect.EOF'
 match: None
 match_index: None
 exitstatus: 1
 flag_eof: True
 pid: 4166
 child_fd: 3
 closed: False
 timeout: 30
 delimiter: class 'pexpect.EOF'
 logfile: None
 logfile_read: None
 logfile_send: None
 maxread: 1
 ignorecase: False
 searchwindowsize: None
 delaybeforesend: 0
 delayafterclose: 0.1
 delayafterterminate: 0.1
 sage: Error running friction.py using Python
 flor...@florian-laptop:~/sage$

 




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

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 

[sage-support] Re: strange behavior

2009-06-14 Thread Florian Beutler

hello

flor...@florian-laptop:~/Gadget-2.0.3/Analysis$ sage -v
| SAGE Version 3.0.5, Release Date: 2008-07-11

my operation system is ubuntu 9,04

 What are the paths below to /usr/lib?

I don't know what you mean...
regards
florian

On Jun 14, 10:00 pm, William Stein wst...@gmail.com wrote:
 On Sun, Jun 14, 2009 at 6:48 AM, Florian Beutlerflorian.beut...@gmx.de 
 wrote:

  yep sorry... here is the error message

 What version of Sage are you using?  On what computer? Etc. etc.
 What are the paths below to /usr/lib?

  -- William





  flor...@florian-laptop:~/sage$ sage friction.py
  Ok... dann legen wir mal los!

  step1: definition of the density profile
  99824085.5683

  step2: definition of the circular velocity
  3.51331142172386

  step3: definition of the integrated mass
  229643.853879355

  step3: definition of the integrated mass
  Traceback (most recent call last):
   File friction.py, line 29, in module
     print mass(r).n(),\n
   File /home/florian/sage/functions.py, line 21, in mass
     i_term = integral(x**2*rho(x), x, 0, r)
   File /usr/lib/python2.5/site-packages/sage/misc/functional.py,
  line 436, in integral
     return x.integral(*args, **kwds)
   File /usr/lib/python2.5/site-packages/sage/calculus/calculus.py,
  line 2508, in integral
     return self.parent()(self._maxima_().integrate(v, a, b))
   File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
  line 1601, in integral
     return I(var, min, max)
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line 1182, in __call__
     return self._obj.parent().function_call(self._name, [self._obj] +
  list(args))
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line , in function_call
     return self.new(%s(%s)%(function, ,.join([s.name() for s in
  args])))
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line 1013, in new
     return self(code)
   File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
  line 377, in __call__
     return Expect.__call__(self, x)
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line 948, in __call__
     return cls(self, x)
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line 1214, in __init__
     self._name = parent._create(value)
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line 1092, in _create
     self.set(name, value)
   File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
  line 855, in set
     self._eval_line(cmd)
   File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
  line 567, in _eval_line
     self._expect_expr()
   File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
  line 457, in _expect_expr
     i = self._expect.expect(expr)
   File /usr/lib/python2.5/site-packages/pexpect.py, line 1311, in
  expect
     return self.expect_list(compiled_pattern_list, timeout,
  searchwindowsize)
   File /usr/lib/python2.5/site-packages/pexpect.py, line 1325, in
  expect_list
     return self.expect_loop(searcher_re(pattern_list), timeout,
  searchwindowsize)
   File /usr/lib/python2.5/site-packages/pexpect.py, line 1396, in
  expect_loop
     raise EOF (str(e) + '\n' + str(self))
  pexpect.EOF: End Of File (EOF) in read_nonblocking(). Exception style
  platform.
  pexpect.spawn object at 0x3cfe890
  version: 2.3 ($Revision: 399 $)
  command: /usr/bin/maxima
  args: ['/usr/bin/maxima', '-p', '/usr/lib/sagemath/local/bin/sage-
  maxima.lisp']
  searcher: searcher_re:
     0: re.compile(\(\%i[0-9]+\))
     1: re.compile(zero or nonzero?)
     2: re.compile(an integer?)
     3: re.compile(positive, negative, or zero?)
     4: re.compile(positive or negative?)
     5: re.compile(Break [0-9]+)
  buffer (last 100 chars):
  before (last 100 chars):
  `rat' replaced 1.0 by 1/1 = 1.0

  `rat' replaced 1.234567901234568 by 100/81 = 1.234567901234568

  after: class 'pexpect.EOF'
  match: None
  match_index: None
  exitstatus: None
  flag_eof: True
  pid: 4147
  child_fd: 3
  closed: False
  timeout: None
  delimiter: class 'pexpect.EOF'
  logfile: None
  logfile_read: None
  logfile_send: None
  maxread: 1
  ignorecase: False
  searchwindowsize: None
  delaybeforesend: 0
  delayafterclose: 0.1
  delayafterterminate: 0.1
  Maxima crashed -- automatically restarting.
  End Of File (EOF) in read_nonblocking(). Exception style platform.
  pexpect.spawn object at 0x3cfe890
  version: 2.3 ($Revision: 399 $)
  command: /usr/bin/maxima
  args: ['/usr/bin/maxima', '-p', '/usr/lib/sagemath/local/bin/sage-
  maxima.lisp']
  searcher: searcher_re:
     0: re.compile(\(\%i[0-9]+\))
  buffer (last 100 chars):
  before (last 100 chars):
  after: class 'pexpect.EOF'
  match: None
  match_index: None
  exitstatus: 1
  flag_eof: True
  pid: 4166
  child_fd: 3
  closed: False
  timeout: 30
  delimiter: class 'pexpect.EOF'
  logfile: None
  logfile_read: None
  logfile_send: None
  maxread: 1
  ignorecase: False
  

[sage-support] Re: strange behavior

2009-06-14 Thread Florian Beutler

hello

flor...@florian-laptop:~/Gadget-2.0.3/Analysis$ sage -v
| SAGE Version 3.0.5, Release Date: 2008-07-11

my operation system is ubuntu 9,04

 What are the paths below to /usr/lib?

I don't know what you mean...
regards
florian

On Jun 14, 10:00 pm, William Stein wst...@gmail.com wrote:
 On Sun, Jun 14, 2009 at 6:48 AM, Florian Beutlerflorian.beut...@gmx.de 
 wrote:

  yep sorry... here is the error message

 What version of Sage are you using?  On what computer? Etc. etc.
 What are the paths below to /usr/lib?

  -- William





  flor...@florian-laptop:~/sage$ sage friction.py
  Ok... dann legen wir mal los!

  step1: definition of the density profile
  99824085.5683

  step2: definition of the circular velocity
  3.51331142172386

  step3: definition of the integrated mass
  229643.853879355

  step3: definition of the integrated mass
  Traceback (most recent call last):
   File friction.py, line 29, in module
     print mass(r).n(),\n
   File /home/florian/sage/functions.py, line 21, in mass
     i_term = integral(x**2*rho(x), x, 0, r)
   File /usr/lib/python2.5/site-packages/sage/misc/functional.py,
  line 436, in integral
     return x.integral(*args, **kwds)
   File /usr/lib/python2.5/site-packages/sage/calculus/calculus.py,
  line 2508, in integral
     return self.parent()(self._maxima_().integrate(v, a, b))
   File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
  line 1601, in integral
     return I(var, min, max)
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line 1182, in __call__
     return self._obj.parent().function_call(self._name, [self._obj] +
  list(args))
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line , in function_call
     return self.new(%s(%s)%(function, ,.join([s.name() for s in
  args])))
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line 1013, in new
     return self(code)
   File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
  line 377, in __call__
     return Expect.__call__(self, x)
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line 948, in __call__
     return cls(self, x)
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line 1214, in __init__
     self._name = parent._create(value)
   File /usr/lib/python2.5/site-packages/sage/interfaces/expect.py,
  line 1092, in _create
     self.set(name, value)
   File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
  line 855, in set
     self._eval_line(cmd)
   File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
  line 567, in _eval_line
     self._expect_expr()
   File /usr/lib/python2.5/site-packages/sage/interfaces/maxima.py,
  line 457, in _expect_expr
     i = self._expect.expect(expr)
   File /usr/lib/python2.5/site-packages/pexpect.py, line 1311, in
  expect
     return self.expect_list(compiled_pattern_list, timeout,
  searchwindowsize)
   File /usr/lib/python2.5/site-packages/pexpect.py, line 1325, in
  expect_list
     return self.expect_loop(searcher_re(pattern_list), timeout,
  searchwindowsize)
   File /usr/lib/python2.5/site-packages/pexpect.py, line 1396, in
  expect_loop
     raise EOF (str(e) + '\n' + str(self))
  pexpect.EOF: End Of File (EOF) in read_nonblocking(). Exception style
  platform.
  pexpect.spawn object at 0x3cfe890
  version: 2.3 ($Revision: 399 $)
  command: /usr/bin/maxima
  args: ['/usr/bin/maxima', '-p', '/usr/lib/sagemath/local/bin/sage-
  maxima.lisp']
  searcher: searcher_re:
     0: re.compile(\(\%i[0-9]+\))
     1: re.compile(zero or nonzero?)
     2: re.compile(an integer?)
     3: re.compile(positive, negative, or zero?)
     4: re.compile(positive or negative?)
     5: re.compile(Break [0-9]+)
  buffer (last 100 chars):
  before (last 100 chars):
  `rat' replaced 1.0 by 1/1 = 1.0

  `rat' replaced 1.234567901234568 by 100/81 = 1.234567901234568

  after: class 'pexpect.EOF'
  match: None
  match_index: None
  exitstatus: None
  flag_eof: True
  pid: 4147
  child_fd: 3
  closed: False
  timeout: None
  delimiter: class 'pexpect.EOF'
  logfile: None
  logfile_read: None
  logfile_send: None
  maxread: 1
  ignorecase: False
  searchwindowsize: None
  delaybeforesend: 0
  delayafterclose: 0.1
  delayafterterminate: 0.1
  Maxima crashed -- automatically restarting.
  End Of File (EOF) in read_nonblocking(). Exception style platform.
  pexpect.spawn object at 0x3cfe890
  version: 2.3 ($Revision: 399 $)
  command: /usr/bin/maxima
  args: ['/usr/bin/maxima', '-p', '/usr/lib/sagemath/local/bin/sage-
  maxima.lisp']
  searcher: searcher_re:
     0: re.compile(\(\%i[0-9]+\))
  buffer (last 100 chars):
  before (last 100 chars):
  after: class 'pexpect.EOF'
  match: None
  match_index: None
  exitstatus: 1
  flag_eof: True
  pid: 4166
  child_fd: 3
  closed: False
  timeout: 30
  delimiter: class 'pexpect.EOF'
  logfile: None
  logfile_read: None
  logfile_send: None
  maxread: 1
  ignorecase: False
  

[sage-support] Re: strange behavior

2009-06-13 Thread William Stein

2009/6/13 Florian Beutler florian.beut...@gmx.de:

 Hay
 I am a bit annoyed by sage... I just want to print a function two
 times and sage gives me an error... this is the first script
 
 #!/usr/bin/env sage -python
 import sys
 from sage.all import *

 import functions
 from functions import *

 grav_const = 4.3e-06
 pi = 3.14159265358979323846
 sat_mass = 20.

 print Ok... dann legen wir mal los!\n
 print step1: definition of the density profile

 r = 0.08

 print rho(r),\n

 print step3: definition of the integrated mass

 print mass(r).n(),\n

 print step3: definition of the integrated mass

 print mass(r).n(),\n
 
 the function definition is the following
 
 import sys
 from sage.all import *

 def rho(r):
    return  1.32419e+08/(1.+(r/0.81))**3

 def mass(r):
    pi = 3.14159265358979323846

    x=var('x')
    assume(x0)
    i_term = integral(x**2*rho(x), x, 0, r)

    return i_term*4.*pi;
 
 so I just try to plot the mass two times... the error message of sage
 is not very helpful (at least to me)
 thanks for any help
 florian

The error message might be helpful to somebody besides you, so perhaps
you could post the error message here?

William

--~--~-~--~~~---~--~~
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: Strange behavior on sagenb

2009-03-28 Thread Jason Bandlow

William Stein wrote:
 On Thu, Mar 26, 2009 at 8:50 AM, Jason Bandlow jband...@gmail.com wrote:
 Hi all,

 When I start up a clean version of sage 3.4 on my local machine and
 enter the following into a notebook cell:

 M=load('http://www.math.upenn.edu/~jbandlow/sage_data/dic_of_kst_to_G_cob_mats.sobj')
 # This object is a dictionary
 key = (1, Partition([1]),Partition([2]))
 print key in M.keys()
 M[key]

 I get the following (correct) output:

 Attempting to load remote file:
 http://www.math.upenn.edu/~jbandlow/sage_data/dic_of_kst_to_G_cob_mats.s\
 obj
 Loading: [..]
 True
 # A matrix that I won't reproduce here

 When I enter the exact same text in a notebook cell on sagenb, I get the
 following output:

 Attempting to load remote file:
 http://www.math.upenn.edu/~jbandlow/sage_data/dic_of_kst_to_G_cob_mats.s\
 obj
 Loading: [..]
 True
 Traceback (most recent call last):
  File stdin, line 1, in module
  File
 /home/sage/sagenb/sage_notebook/worksheets/jbandlow/11/code/41.py,
 line 10, in module
M[key]
  File
 /home/sage/sage_install/sage-a/local/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/,
 line 1, in module

 KeyError: (1, [1], [2])

 Why am I getting a KeyError if key in M.keys() is returning True?  And
 why is the behavior on sagenb different than on my local, 3.4
 built-from-source on Ubuntu 10.8 distribution?

 Any ideas are very welcome!

 
 I'm guessing this is a subtle 32 versus 64-bit issue involving
 pickling and assumptions made somewhere in the combinat or other sage
 code involving 32/64-bit.  The notebook is 64-bit and I bet your
 computer is 32-bit.
 
 By the way, this works on the notebook in the context of your session above:
 
 for a, b in M.iteritems():
 if a == key: print b
 

Thanks William!  This does seem likely to be the problem.  I'll do more
investigation when I get a chance and see if I can find out precisely
where the problem is.


--~--~-~--~~~---~--~~
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: Strange behavior on sagenb

2009-03-28 Thread William Stein

On Sat, Mar 28, 2009 at 6:26 AM, Jason Bandlow jband...@gmail.com wrote:
 I'm guessing this is a subtle 32 versus 64-bit issue involving
 pickling and assumptions made somewhere in the combinat or other sage
 code involving 32/64-bit.  The notebook is 64-bit and I bet your
 computer is 32-bit.

 By the way, this works on the notebook in the context of your session above:

 for a, b in M.iteritems():
     if a == key: print b


 Thanks William!  This does seem likely to be the problem.  I'll do more
 investigation when I get a chance and see if I can find out precisely
 where the problem is.

I know of one place in sage where objects cache their hash for
efficiency reasons (e.g., I think Sage matrices do). I hadn't thought
about the fact that pickling, moving to an object to a platform where
the hashes are different, and unpickling, would result in the subtle
issue above, but that makes sense.   Here is an example:

On a 32-bit platform do this:

sage: a = matrix(ZZ,2,[1,-2,4,1993938292]); a.set_immutable(); b =
{a:5}; save(b,'/Users/wstein/b.sobj')

Then load b on a 64-bit platform (e.g. ,sage.math):

sage: a = matrix(ZZ,2,[1,-2,4,1993938292]); a.set_immutable(); b =
load('b.sobj'); b[a]
boom! KeyError ...
sage: sage: b.keys()[0] == a
True

The fix here is that right before pickling the cached hash of the
matrix should be deleted.

I don't know any other places in Sage that do the above.

This is now

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

 -- William

--~--~-~--~~~---~--~~
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: Strange behavior on sagenb

2009-03-28 Thread Carl Witty

On Mar 28, 8:59 am, William Stein wst...@gmail.com wrote:
 I know of one place in sage where objects cache their hash for
 efficiency reasons (e.g., I think Sage matrices do). I hadn't thought
 about the fact that pickling, moving to an object to a platform where
 the hashes are different, and unpickling, would result in the subtle
 issue above, but that makes sense.   Here is an example:

 On a 32-bit platform do this:

 sage: a = matrix(ZZ,2,[1,-2,4,1993938292]); a.set_immutable(); b =
 {a:5}; save(b,'/Users/wstein/b.sobj')

 Then load b on a 64-bit platform (e.g. ,sage.math):

 sage: a = matrix(ZZ,2,[1,-2,4,1993938292]); a.set_immutable(); b =
 load('b.sobj'); b[a]
 boom! KeyError ...
 sage: sage: b.keys()[0] == a
 True

 The fix here is that right before pickling the cached hash of the
 matrix should be deleted.

 I don't know any other places in Sage that do the above.

This also happens (at least) in combinat/; see the __hash__
implementation in combinat/combinat.py

 This is now

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

I've mentioned this on the ticket, as well.

Carl

--~--~-~--~~~---~--~~
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: Strange behavior on sagenb

2009-03-26 Thread William Stein

On Thu, Mar 26, 2009 at 8:50 AM, Jason Bandlow jband...@gmail.com wrote:

 Hi all,

 When I start up a clean version of sage 3.4 on my local machine and
 enter the following into a notebook cell:

 M=load('http://www.math.upenn.edu/~jbandlow/sage_data/dic_of_kst_to_G_cob_mats.sobj')
 # This object is a dictionary
 key = (1, Partition([1]),Partition([2]))
 print key in M.keys()
 M[key]

 I get the following (correct) output:

 Attempting to load remote file:
 http://www.math.upenn.edu/~jbandlow/sage_data/dic_of_kst_to_G_cob_mats.s\
 obj
 Loading: [..]
 True
 # A matrix that I won't reproduce here

 When I enter the exact same text in a notebook cell on sagenb, I get the
 following output:

 Attempting to load remote file:
 http://www.math.upenn.edu/~jbandlow/sage_data/dic_of_kst_to_G_cob_mats.s\
 obj
 Loading: [..]
 True
 Traceback (most recent call last):
  File stdin, line 1, in module
  File
 /home/sage/sagenb/sage_notebook/worksheets/jbandlow/11/code/41.py,
 line 10, in module
    M[key]
  File
 /home/sage/sage_install/sage-a/local/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/,
 line 1, in module

 KeyError: (1, [1], [2])

 Why am I getting a KeyError if key in M.keys() is returning True?  And
 why is the behavior on sagenb different than on my local, 3.4
 built-from-source on Ubuntu 10.8 distribution?

 Any ideas are very welcome!


I'm guessing this is a subtle 32 versus 64-bit issue involving
pickling and assumptions made somewhere in the combinat or other sage
code involving 32/64-bit.  The notebook is 64-bit and I bet your
computer is 32-bit.

By the way, this works on the notebook in the context of your session above:

for a, b in M.iteritems():
if a == key: print b



 -- William

--~--~-~--~~~---~--~~
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: Strange behavior in Partition(x).next()

2007-12-13 Thread David Harvey


On Dec 13, 2007, at 9:19 PM, mekaj wrote:

 def get_partitions(x,y=[]):

The problem might be your default argument above. This is really a  
python issue. Every time your function is called, it's getting the  
*same* list object. The standard python idiom to get around this is:

def get_partitions(x, y=None):
if y is None:
y = []
[... other stuff ...]

david


--~--~-~--~~~---~--~~
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/
-~--~~~~--~~--~--~---