Need help with finding a matrix

Could anyone please help me find a 4 by 4 matrix A such that A.Transpose[A] exactly equals the following matrix:

{{1, -(1/2), 0, 1/2},
{-(1/2), 1, 1/2, 0},
{0, 1/2, 1, -(1/2)},
{1/2, 0, -(1/2), 1}}


B = {{1, -(1/2), 0, 1/2}, {-(1/2), 1, 1/2, 0}, {0, 1/2, 1, -(1/2)}, {1/2, 0, -(1/2), 1}};
{λ, U} = Eigensystem[B];
A = Transpose[Sqrt[λ] Normalize /@ U];

• Thank you for your answer and for the numerical solution. Could you please find A such that A.Transpose[A] exactly equals the given matrix? Thanks a lot. – Kimberry Apr 3 at 15:42
• See the updated post. – Henrik Schumacher Apr 3 at 15:47
• Thank you for your update. Woud it be unique up to multiplications by orthogonal matrices? Thanks a lot! – Kimberry Apr 3 at 17:31
• That depends on what you mean by "multiplications by orthogonal matrices". Since the eigenvalue $1$ is two-fold, the matrix $A$ is not unique up to multiplication by orthogonal matrices from the right, because one can also rotate within the eigenspace of the eigenvalue 1 by multiplying, e.g., RotationMatrix[{U[[2]], U[[3]]}] from the left. – Henrik Schumacher Apr 3 at 17:41

I'm not sure if the problem has a unique solution without imposing any restriction on the solution $$A$$. If we assume that the matrix $$A$$ is symmetric (i.e. $$A=A^T$$), the solution ($$AA=B$$) can be easily obtained by the singular value decomposition (SVD) method.

Essentially, SVD decomposes the square matrix $$B$$ into the form of $$B=U\Lambda U^T$$, where $$\Lambda$$ is a diagonal matrix and the matrix $$U$$ is unitary (i.e. $$U^TU=UU^T=I$$). Observing that $$B=U\sqrt\Lambda U^T (U\sqrt\Lambda U^T)$$, we have $$A=U\sqrt\Lambda U^T$$.

In Mathematica,

    matA = Module[{
matB = {{1, -(1/2), 0, 1/2}, {-(1/2), 1, 1/2, 0},
{0, 1/2, 1, -(1/2)}, {1/2, 0, -(1/2), 1}},
u, \[Lambda], v
},

(* Calculate the singular value decomposition *)
{u, \[Lambda], v} = SingularValueDecomposition[matB];

(* Calculate the matrix A *)
u.Sqrt[w].Transpose[u] // Simplify
]

• The matrix $A$ is definitely not unique as one may multiply it from the right by any orthogonal matrix. – Henrik Schumacher Apr 3 at 16:51

The Cholesky decomposition can be used for this (objections from the usual suspects notwithstanding). It can be applied to any symmetric real-valued positive definite matrix, that is, any symmetric matrix with positive eigenvalues. Is that the case here?

mat = {{1, -(1/2), 0, 1/2}, {-(1/2), 1, 1/2, 0},
{0, 1/2, 1, -(1/2)}, {1/2, 0, -(1/2), 1}};
Eigenvalues[mat]

(* Out[62]= {2, 1, 1, 0} *)


Okay, so one of them is zero. In such circumstances one can perturb by adding a "small" value to the main diagonal, take the Cholesky decomposition, and extract the limiting value as that perturbation goes to zero from above.

matmod = mat + DiagonalMatrix[ConstantArray[eps, 4]];
cd = Simplify[CholeskyDecomposition[matmod], Assumptions -> eps > 0]

(* Out[68]= {{Sqrt[1 + eps], -(1/(2 Sqrt[1 + eps])), 0, 1/(
2 Sqrt[1 + eps])}, {0, Sqrt[(3 + 8 eps + 4 eps^2)/(4 + 4 eps)],
Sqrt[(1 + eps)/(3 + 8 eps + 4 eps^2)], 1/(
2 Sqrt[(1 + eps) (3 + 8 eps + 4 eps^2)])}, {0, 0, Sqrt[
1 + eps - (1 + eps)/(3 + 8 eps + 4 eps^2)], -((Sqrt[2] (1 + eps)^2)/
Sqrt[(3 + 8 eps + 4 eps^2) (1 + 5 eps + 6 eps^2 + 2 eps^3)])}, {0,
0, 0, Sqrt[2] Sqrt[(eps (1 + eps) (2 + eps))/(
1 + 4 eps + 2 eps^2)]}} *)


Now take the limit: and check the result.

lmat = Limit[cd, eps -> 0, Direction -> -1]
Transpose[lmat].lmat == mat

(* Out[75]= {{1, -(1/2), 0, 1/2},
{0, Sqrt[3]/2, 1/Sqrt[3], 1/(2 Sqrt[3])},
{0, 0, Sqrt[2/3], -Sqrt[(2/3)]}, {0, 0, 0, 0}}

Out[76]= True *)


This case actually could have been handled more simply. Instead of using a symbolic eps one can use an explicit positive value, say E. Take the decomposition and then replace with E->0. It works.

• Time for an $LDL^T$-decomposition in Mathematica? (IMHO, it's overdue.) ;) – Henrik Schumacher Apr 3 at 16:47