The triple product is not present in Sage, as far as I know.
But it takes one line using cross-product and dot-product, or a determinant.
Defining a triple_product
function is also possible.
On the other hand, u * v * w
will return $(u \cdot v) w$.
This is because the first multiplication (of two vectors u and v) is interpreted as a dot-product,
and the second multiplication (of a scalar and a vector) is then a scalar multiplication.
Triple product using a cross-product and a dot-product:
sage: u = vector((1, 0, 0))
sage: v = vector((0, 1, 0))
sage: w = vector((0, 0, 1))
sage: u.cross_product(v)*w
1
Triple product using a determinant:
sage: matrix([u, v, w]).det()
Function using cross-product and dot-product:
def triple_product(u, v, w):
r"""
Return the triple product of these three vectors.
"""
return u.cross_product(v)*w
Function using determinant:
def triple_product(u, v, w):
r"""
Return the triple product of these three vectors.
"""
return matrix([u, v, w]).det()
Then with either function:
sage: triple_product(u, v, w)
1
If you need it often, you can add the function to your init.sage
file.
That makes it available to you in each of your Sage sessions.
EDIT. Sorry, the above does not answer the question.
There is no way to compute with vector symbols in Sage.
Sage's symbolic expressions assumes variables are complex variables.
One can add assumptions that they are real, integer, positive, etc, but that's it.
Maybe Cadabra can do that.