Sage Sum vs Python Sum

80 views
Skip to first unread message

saad khalid

unread,
Jun 11, 2016, 6:33:59 PM6/11/16
to sage-support
Hey everyone:

So, I was trying to compute this sum symbolically, and then make it so that I could plug in values for u later. I don't think that it's possible using the Sage sum, though it works with the python sum.
This is my attempt to do it using a Sage sum:
reset()
var("G")
G
= 5
u
= [SR("u_%i"%x) for x in [0..6]]
gamma
= (1/G)*sum(-(u[i])^(k-1)/(u[i]-1)^k,i,1,G-1)
show
(gamma(4))
I get the error "Unable to coerce I to an integer"

Here it is using a python sum:
reset()
var("G")
var('i')
G
= 5
u
= [SR("u_%i"%x) for x in [0..6]]
gamma
(k) = (1/G)*sum(-(u[i])^(k-1)/(u[i]-1)^k for i in (1..G-1))
show
(gamma(4))
It works just fine.

I guess my real question is, what exactly is the point of the Sage version of the sum? Why don't we just use the python sum by default? Are there any benefits to Sage's version? The python version seems to run faster as well.

Steve

unread,
Jun 11, 2016, 7:54:18 PM6/11/16
to sage-s...@googlegroups.com
Hi,

I kept getting timeouts and disconnects etc and pop ups saying "for a better experience..." so I signed up for the $7 subscription and applied upgrades to my current project and now I don't get the pop ups, but I still get time outs and disconnects and I thought the idle time out was supposed to be a day. The "experience" is still poor, What am I getting for the subscription price? I know its good to donate to the sage project because I like it but still I don't see an improvement in web performance.

-Steve

William Stein

unread,
Jun 11, 2016, 8:35:44 PM6/11/16
to sage-s...@googlegroups.com


On Saturday, June 11, 2016, Steve <strang...@gmail.com> wrote:
Hi,

I kept getting timeouts and disconnects etc and pop ups saying "for a better experience..." so I signed up for the $7 subscription and applied upgrades to my current project and now I don't get the pop ups, but I still get time outs and disconnects and I thought the idle time out was supposed to be a day. The "experience" is still poor, What am I getting for the subscription price? I know its good to donate to the sage project because I like it but still I don't see an improvement in web performance.


Maybe there is a problem or incompatibility with your browser.   Please email he...@sagemath.com  and include very detailed information about exactly how you are using SMC.  
 

-Steve

--
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...@googlegroups.com.
To post to this group, send email to sage-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


--
Sent from my massive iPhone 6 plus.

Steve

unread,
Jun 11, 2016, 8:54:07 PM6/11/16
to sage-s...@googlegroups.com

Hi, I'll send info to help, but I'm using Firefox latest v. with all scripts allowed on sagemath.com. Right now at 8:51p eastern Saturday 6/11 I can't even bring up the project although I'm logged in, I keep trying refresh also. The file list won't come up and cloudflare reports North America operational. I'm in Baltimore.

-Steve

William Stein

unread,
Jun 11, 2016, 9:02:49 PM6/11/16
to sage-s...@googlegroups.com
Please send a link to the project you're having trouble with to he...@sagemath.com.  

Steve

unread,
Jun 11, 2016, 9:10:23 PM6/11/16
to sage-s...@googlegroups.com
On 6/11/2016 8:35 PM, William Stein wrote:

OK it's working in Chrome, I think Firefox just issued an update a day or two ago.

-Steve

saad khalid

unread,
Jun 11, 2016, 10:30:51 PM6/11/16
to sage-support
Is there a reason this is appearing in my post? I can't tell if this is a glitch or something.

Nils Bruin

unread,
Jun 12, 2016, 12:48:07 AM6/12/16
to sage-support
On Saturday, June 11, 2016 at 3:33:59 PM UTC-7, saad khalid wrote:
I guess my real question is, what exactly is the point of the Sage version of the sum? Why don't we just use the python sum by default? Are there any benefits to Sage's version? The python version seems to run faster as well.

It can do things like this:

sage: sum(1/x^2,x,1,oo)
1/6*pi^2
 
People expect that computer algebra systems do that. Python's sum doesn't

kcrisman

unread,
Jun 13, 2016, 11:31:38 AM6/13/16
to sage-support

Is there a reason this is appearing in my post? I can't tell if this is a glitch or something.

It's a 'feature' of Google groups, that when you reply to a post in your email (at least sometimes) then this happens, even if you change the subject line (see https://groups.google.com/forum/?topic/mathbook-xml-support/_vS1h6nBuPw#!topic/mathbook-xml-support/_vS1h6nBuPw )  From that thread, good guidelines follow.  Sorry for that happening, I found it confusing too!

"But I think if you use email to interact with the list, then you can reply to a message AND CHANGE THE SUBJECT LINE, but the web interface "thinks" the two messages are in the same thread." 

"Email - do not start a new topic by replying to an existing message about something else.

Email - do start a new topic with a fresh message, copying the list address from somewhere else"

saad khalid

unread,
Jun 13, 2016, 11:35:47 AM6/13/16
to sage-support
Thanks for the help guys! :)

slelievre

unread,
Jun 14, 2016, 4:35:06 AM6/14/16
to sage-support


Le lundi 13 juin 2016 17:35:47 UTC+2, saad khalid a écrit :
Thanks for the help guys! :)

On a related note, see this ask-sage question about plugging in
a bound for the sum starting from a symbolic sum.


Reply all
Reply to author
Forward
0 new messages