3
$\begingroup$

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}}
$\endgroup$
3
$\begingroup$
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];
| improve this answer | |
$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – Kimberry Apr 3 at 15:42
  • $\begingroup$ See the updated post. $\endgroup$ – Henrik Schumacher Apr 3 at 15:47
  • $\begingroup$ Thank you for your update. Woud it be unique up to multiplications by orthogonal matrices? Thanks a lot! $\endgroup$ – Kimberry Apr 3 at 17:31
  • $\begingroup$ 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. $\endgroup$ – Henrik Schumacher Apr 3 at 17:41
2
$\begingroup$

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
      ]
| improve this answer | |
$\endgroup$
  • $\begingroup$ The matrix $A$ is definitely not unique as one may multiply it from the right by any orthogonal matrix. $\endgroup$ – Henrik Schumacher Apr 3 at 16:51
2
$\begingroup$

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.