Consider the following square matrix
\begin{align}
A = \left(\matrix{d & 0 & -\frac12 & 0 & 0 & 0 & 0 & 0 \\
 0 & d & -d+1 & -\frac12 & 0 & 0 & 0 & 0 \\
 -\frac12 & -d+1 & d & 0 & -\frac12 & 0 & 0 & 0 \\
 0 & -\frac12 & 0 & d & -d+1 & -\frac12 & 0 & 0 \\
 0 & 0 & -\frac12 & -d+1 & d & 0 & -\frac12 & 0 \\
 0 & 0 & 0 & -\frac12 & 0 & d & -d+1 & -\frac12 \\
 0 & 0 & 0 & 0 & -\frac12 & -d+1 & d & 0 \\
 0 & 0 & 0 & 0 & 0 & -\frac12 & 0 & d }\right),
\end{align}
and the following rectangular matrix
\begin{align}
B = \left(\matrix{1 & \frac12 & \frac12 & 0 & 0 & 0 & 0 & 0 \\
 0 & \frac12 & \frac12 & 1 & 0 & 0 & 0 & 0 \\
 0 & 0 & 0 & 0 & 1 & \frac12 & \frac12 & 0 \\
 0 & 0 & 0 & 0 & 0 & \frac12 & \frac12 & 1 }\right),
\end{align}
then
\begin{align}
B A B^\intercal = \left(\matrix{d & 0 & -\frac14 & 0 \\
 0 & d & -d+\frac12 & -\frac14 \\
 -\frac14 & -d+\frac12 & d & 0 \\
 0 & -\frac14 & 0 & d}\right).
\end{align}


I am looking for a matrix $C$, the same size as $B$ such that
\begin{align}
C A C^\intercal = \left(\matrix{\frac{d}2 & 0 & -\frac14 & 0 \\
 0 & \frac{d}2 & -\frac{d}2+\frac12 & -\frac14 \\
 -\frac14 & -\frac{d}2+\frac12 & \frac{d}2 & 0 \\
 0 & -\frac14 & 0 & \frac{d}2}\right).
\end{align}


I get into a very complex system of equations in order to find $C$ that I am having a very hard time solving.


Does somebody see a way to profit from the sparsity and symmetries of $A$ to obtain $C$?



Matrix equation of the form $C A C^\intercal = D$
Answered in the [crosspost](https://math.stackexchange.com/questions/2960731/matrix-equation-of-the-form-c-a-c-intercal-d).


Credit to [@amd](https://math.stackexchange.com/users/265466/amd).


