Does anyone see what is causing the error here?

sage: var('x,y')
(x, y)
sage: v=vector([x,y,x^2+y])
sage: v.subs(x=1,y=2)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

/home/grout/.sage/temp/good/23967/_home_grout__sage_init_sage_0.py in 
<module>()

/home/grout/sage/local/lib/python2.5/site-packages/sage/structure/element.so 
in sage.structure.element.Element.subs (sage/structure/element.c:3320)()
     369             else:
     370                 variables.append(gen)
--> 371         return self(*variables)
     372
     373     def n(self, prec=None, digits=None):

/home/grout/sage/local/lib/python2.5/site-packages/sage/modules/free_module_element.so
 
in 
sage.modules.free_module_element.FreeModuleElement_generic_dense.__call__ 
(sage/modules/free_module_element.c:13987)()

/home/grout/sage/local/lib/python2.5/site-packages/sage/calculus/calculus.pyc 
in __call__(self, *args, **kwds)
    1789                     d[ vars[i] ] = args[i]
    1790                 except IndexError:
-> 1791                     raise ValueError, "the number of arguments 
must be less than or equal to %s"%len(self.variables())
    1792
    1793         return self.substitute(d, **kwds)

ValueError: the number of arguments must be less than or equal to 1




I think it traces back to trying to basically call the first expression 
(x) with arguments 1 and 2, resulting in the same error message as:

sage: f=x
sage: f(1,2)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

/home/grout/.sage/temp/good/23967/_home_grout__sage_init_sage_0.py in 
<module>()

/home/grout/sage/local/lib/python2.5/site-packages/sage/calculus/calculus.pyc 
in __call__(self, *args, **kwds)
    1789                     d[ vars[i] ] = args[i]
    1790                 except IndexError:
-> 1791                     raise ValueError, "the number of arguments 
must be less than or equal to %s"%len(self.variables())
    1792
    1793         return self.substitute(d, **kwds)

ValueError: the number of arguments must be less than or equal to 1


I guess my questions are:

1. Is my analysis of the error correct?

2. Why is it not just calling the .subs method for each component of the 
vector?  Is there something tricky that is going on here that I'm missing?

Thanks,

Jason


--~--~---------~--~----~------------~-------~--~----~
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-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to