>
> /Users/s/sw/sage/local/lib/python2.6/site-packages/sage/calculus/
> calculus.pyc in symbolic_sum(expression, v, a, b, algorithm)
> 499
> 500 if algorithm == 'maxima':
> --> 501 sum = "'sum(%s, %s, %s, %s)" %
> tuple([repr(expr._maxima_()) for expr in (expression, v, a, b)])
> 502 try:
> 503 result = maxima.simplify_sum(sum)
>
> AttributeError: 'int' object has no attribute '_maxima_'
I think that this message says the problem isn't iterators. For
instance,
var('k n m')
for item in [n,m]:
sum(k,k,1,item)
works. The error message makes it clear that since you used range
(and not srange?), you get Python ints, not Sage integers, and
apparently we don't have a coercion for Python ints to become Maxima
objects.
As a temporary workaround, I'd use
for n in [1..10]:
sum(k,k,1,n)
which works fine since
type(n)
<type 'sage.rings.integer.Integer'>
But this really is a bug, I think. See
http://trac.sagemath.org/sage_trac/ticket/9630
.
I feel like this is also related to discussion about making input to
certain functions be Sage objects; if we did sage(blah) to inputs blah
this could be avoided, though presumably this would be nasty overhead.
- kcrisman
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org