Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You could use the method shown here: http://groups.google.com/group/sage-support/browse_thread/thread/18525d8c5bca0afa/8f9c64cbefa9ac67?lnk=gst&q=generate+symbolic+variables+jason#8f9c64cbefa9ac67

See, for example: http://sagenb.org/home/pub/3352/

class VariableGenerator(object): 
     def __init__(self, prefix): 
         self.__prefix = prefix 
     @cached_method 
     def __getitem__(self, key): 
         return SR.var("%s%s"%(self.__prefix,key)) 

a=VariableGenerator('a') 
p = sum(a[i]*x**i for i in range(10))