Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Defining a function of vector variables

I would like to define a Sage function that takes a vector variable and computes the result of some vector function on it, something like

f(v) = v.dot_product(vector((1,1)))

However, when I try to run this in Sage, I get

AttributeError: 'sage.symbolic.expression.Expression' object has no
attribute 'dot_product'

Is there a way to achieve this effect in Sage?