# solving matrix equation

I want to solve the following matrix equation. Could anyone give me a hand? Thanks.

Given an $n \times n$ matrix $\mathbf A$ (diagonally dominant), I need to solve an $n \times n$ symmetric matrix $\mathbf X$ such that

$\mathbf A\mathbf X+\mathbf X\mathbf A^\top =\mathbf I$,

where $\mathbf I$ is an $n \times n$ identity matrix.

-
I don't get the question. Let A=0, then surely no such X exists. Also, please remove those irrelevant tags. – akkkk Apr 16 '12 at 14:09
We assume that $A$ is a nonzero matrix. – Janie Apr 16 '12 at 14:16
Is $A$ strictly diagonally dominant? If so, $A$ is of course non-zero. – martini Apr 16 '12 at 14:18
Yeah, it is strictly diagonally dominant. – Janie Apr 16 '12 at 14:26
By Gershgorin circle theorem, diagonally dominated matrices are non-singular. Therefore A inverse(which is square) exists – Ben Apr 16 '12 at 14:49

If you are just going to use it for purposes of computation etc. then it seems to me that the simplest way is to consider this as A'X'=B', where A' is $n^2 \times n^2$, X' is $n^2 \times 1$, B' is $n^2 \times 1$. X' and B' are basically 'flattened' versions of X and I, respectively. If general element of X is $x_{ij}$, then $x_{ij}$ is also $(i \times (n-1) + j)$th element of X'. Similarly for getting B' from I. $(i \times (n-1) + j), (k \times (n-1) + l)$th element of A' is number of times $x_ij$ contributes to (k,l)th element in the expansion of the LHS here. So eg. $a'_{11}$ is $2 \times a_{11}$.