# Solving a System/Matrix of Equations in Matrix Form

Ok, I am trying to solve an equation involving matrices (well, tensors actually), which is of the form: $\mathbf{e}^{T} \cdot \mathbf{M} \cdot \mathbf{e}$ = $\mathbf{N}$, where $\mathbf{e}$ is an unknown matrix and both $\mathbf{M}$ and $\mathbf{N}$ are known ($\mathbf{M}$ contains variables).

Essentially, I am trying to find the values of the components of $\mathbf{e}$ (x,y,z,t) in terms of a,b,c,d. Here is a 2-d example of what I have tried so far, but I hope to do this in 4-dimensions eventually.

metric = ({{a, b},{c, d}});
eta = ({{1, 0},{0, -1}});
vb = ({{x, y},{z, t}});
neta = Transpose[vb].metric.vb; (* Need to set this equal to eta and solve for x, y, z, t *)
neta == eta
(* Need to do something like Solve[%, {x,t,y,z}] but I get {} if I do that *)


Thanks!

• The problem is that this system imposes a constraint on the parameters {a,b,c,d}, hence is empty for "generic" values of the params. You can see this by explicitly allowing for such a situation: Solve[Flatten[neta - eta] == 0, {x, y, z, t}, MaxExtraConditions -> 1] – Daniel Lichtblau Oct 2 '14 at 16:09
• Thank you. If I do that I get the conditions that b == c (i.e. there is only a solution if the matrix is symmetric?). Let's suppose I have a symmetric matrix, is there a way I can solve this and spit out the matrix vb? (Containing only a,b,c,d). – Akoben Oct 2 '14 at 16:32
• No, not quite. You can change metric to {{a,b}, {b,d}} but then the system is underdetermined. If you then do vb /. Solve[Flatten[neta - eta] == 0, {x, y, z, t}] you get a result that still contains x. – Daniel Lichtblau Oct 2 '14 at 16:39
• If I do that, I actually get a vector of matrices, some of which have x in some do not. For example, If I do vb /. Solve[Flatten[neta - eta] == 0, {x, y, z, t}][[6]] I get a matrix without x in. What's going on here? – Akoben Oct 2 '14 at 17:03
• It means the Solve thinks solution set has isolated zero dimensional components (points) as well as one dimensional families of solutions. I suspect these isolated ones are actually special values of the dimensional components though. – Daniel Lichtblau Oct 2 '14 at 17:16

Given a matrix:

eta = ({{1, 0}, {0, -1}});


one can decompose this into three matrices in the following way:

{u, w, v} = SingularValueDecomposition[eta];
(* Where the original eta is defined by: *)
u.w.Transpose[v]  (* = eta *)


Another way, which more appropriately addresses your problem is to use Schur decomposition.

 eta = ({{1, 0}, {0, -1}});
{q, t} = QRDecomposition[eta];
q.t.Conjugate[Transpose[q]]  (* = eta *)


I think this latter method should work. The Mathematica documentation says this is how to reproduce the original matrix, but I am finding that the following gives back the original matrix:

q.t  (* = eta *)


Thats odd...