3

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.

kglr
  • 394,356
  • 18
  • 477
  • 896
Takoda
  • 765
  • 3
  • 10

1 Answers1

2
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}}

kglr
  • 394,356
  • 18
  • 477
  • 896