Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Matrix multiplication with a vector in EuclideanSpace

Hello

Oversimplified version of my question is "How can I multiply a vector with a matrix?"

E.<x,y,z>=EuclideanSpace(start_index=0)
vf=E.vector_field([x*y,x^2,z**2]) # the components are for testing purposes

M=Matrix(RR,3,3);M[:]=1 # this is just a test
# Neither this
M*vf
# nor this works
M*vf.at(E((3,2,1)))

The only work around I could think of is

v=vf.at(E((3,2,1)))
q=vector([v[0],v[1],v[2]])
M*q

or directly on the vector field

v=vector([v[0].expr(), v[1].expr(), v[2].expr()])
M*q

With this approach I have to put the transformed components back in the vector field defined within EuclideanSpace.

I would like to use EuclideanSpace to work with vectors.

Is there an easy way to handle this? Basically I am looking for an easy way to transform a vector field defined in EuclideanSpace?

Thanks in advance for your help.

click to hide/show revision 2
retagged

Matrix multiplication with a vector in EuclideanSpace

Hello

Oversimplified version of my question is "How can I multiply a vector with a matrix?"

E.<x,y,z>=EuclideanSpace(start_index=0)
vf=E.vector_field([x*y,x^2,z**2]) # the components are for testing purposes

M=Matrix(RR,3,3);M[:]=1 # this is just a test
# Neither this
M*vf
# nor this works
M*vf.at(E((3,2,1)))

The only work around I could think of is

v=vf.at(E((3,2,1)))
q=vector([v[0],v[1],v[2]])
M*q

or directly on the vector field

v=vector([v[0].expr(), v[1].expr(), v[2].expr()])
M*q

With this approach I have to put the transformed components back in the vector field defined within EuclideanSpace.

I would like to use EuclideanSpace to work with vectors.

Is there an easy way to handle this? Basically I am looking for an easy way to transform a vector field defined in EuclideanSpace?

Thanks in advance for your help.