# Symbolic decomposition of a tensor given an assumption

I am relatively new to Mathematica. Suppose I have a matrix

M = {{a^2, a b, 0}, {a b, b^2, 0}, {0, 0, 0}}


How can I get Mathematica to decompose this into an outer product of the vector

v = {a,b,0}


with itself? I assume it has something to do with the function TensorReduce but I am not sure. In general if I know that a tensor T can be written in the form $$T = A \otimes B$$ and I know T and B how can I use mathematica to find A?

Related:

Symbolic tensor simplifications and the identity matrix

How do I simplify a vector expression?

Simplify vector expression - is there something like "Factor" for vectors, dot products etc.?

Thank you!

Update: I think the function CoefficientArray may be useful here but I can't quite figure it out fully.

• With[{z = Array[x, Length@M]}, z /. Solve[M == TensorProduct[z, z], z]]?
– kglr
Nov 20, 2018 at 16:59
• This works wonderfully! Now if I were to define M = {{a c, a d, 0}, {b c, b d, 0}, {0, 0, 0}} and I knew the form of z how could I use your answer to solve for y = {c,d,0}? Nov 21, 2018 at 11:43
• Takado, does With[{y = Array[x, Length@M]}, y /. Solve[M == TensorProduct[z, y], y]] work?
– kglr
Nov 27, 2018 at 1:58
• Yes that exactly what I was looking for thank you :) Nov 27, 2018 at 16:13
• Takoda, I posted the comment as an answer.
– kglr
Nov 27, 2018 at 16:18

With[{z = Array[x, Length@M]}, z /. Solve[M == TensorProduct[z, z], z]]


{{-a, -b, 0}, {a, b, 0}}

Update: if I were to define M = {{a c, a d, 0}, {b c, b d, 0}, {0, 0, 0}} and I knew the form of z how could I .. solve for y = {c,d,0}?

M2 = {{a c, a d, 0}, {b c, b d, 0}, {0, 0, 0}};
z = {a, b, 0};
With[{y = Array[x, Length@M2]}, y /. Solve[M2 == TensorProduct[z, y], y]]


{{c, d, 0}}