On Mar 25, 2008, at 22:54 , Jay Pottharst wrote: > > Hi all, I'm having trouble adding two modular forms together, > sometimes. Here is a whittled-down demo case: > > sage: b=CuspForms(22).basis() > sage: sum(b) > Traceback (most recent call last): > ... > NameError: global name 'other' is not defined > > The following also doesn't work: > > sage: ssum=0 > sage: for u in b: > ... ssum=(ssum+u) > ... > Traceback (most recent call last): > ... > TypeError: unsupported operand parent(s) for '+': 'Integer Ring' and > 'Cuspidal subspace of dimension 2 of Modular Forms space of dimension > 5 for Congruence Subgroup Gamma0(22) of weight 2 over Rational Field' > > So there are probably at least two different issues. For the record: > > sage: b[0]+b[1] > q + q^2 - q^3 - 4*q^4 + q^5 + O(q^6) > > Is this my doing? Is there a work-around at present?
The first problem is a simple bug ('other' should be 'x'). However, once that is fixed, we run into your second problem, which might be more dicey. I'm not familiar with this code, but it might be related to coercion. I've reported this: <http://trac.sagemath.org/sage_trac/ticket/2674> At this point, I don't see a workaround other than what you show above. Thanks for reporting this! Justin -- Justin C. Walker, Curmudgeon-at-Large () The ASCII Ribbon Campaign /\ Help Cure HTML Email --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---