This is a continuation of my previous question here, but I previously did not fully specify some of the restrictions on the matrices and so the solutions posted there were not that helpful.
I'm looking to find a Hermitian solution $X$ to the pair of equations,
I'm trying to solve a pair of simultaneous matrix equations of the form,
$$AX + XA^\dagger + BJB^\dagger = 0,\ \ X C^\dagger + B J D^\dagger = 0,$$ where, $$J = \text{diag}\left(\begin{bmatrix}1&0\\0&-1\end{bmatrix},\dots,\begin{bmatrix}1&0\\0&-1\end{bmatrix}\right). $$
and $J \in \mathbb{R}^{m \times m}$.
Here $A \in \mathbb{C}^{n\times n}$, $B \in \mathbb{C}^{n\times m}$, $C \in \mathbb{C}^{m\times n}$, $D \in \mathbb{C}^{m\times m}$ where $n$ and $m$ are even
The former is the Lyapunov equation, but the solution $X$ may not be unique since $A$ may be unstable. Furthermore, the matrices $A, B, C$ may all be singular. So there are many solutions, but I need just one which is Hermitian. Does anyone know if there is a general way to find this (or the non-existence of this) for matrices with symbolic elements?
I tried something like this:
X=Array[x,{n,n}];
X=Solve[Simplify[c.a.X==-c.b.j.ConjugateTranspose[b]+d.j.ConjugateTranspose[b].ConjugateTranspose[a]]
&&Simplify[X==ConjugateTranspose[X]],Flatten[X]];
but it takes far too long.
Thanks!
EDIT: here is a concrete example as requested, here $\gamma > 0$
$$ A=\left( \begin{array}{cc} -\frac{\gamma }{2 \gamma ^2+1} & \frac{\gamma \sqrt{4 \gamma ^2+1}}{2 \gamma ^2+1} \\ \frac{\gamma \sqrt{4 \gamma ^2+1}}{2 \gamma ^2+1} & -\frac{4 \gamma ^3+\gamma }{2 \gamma ^2+1} \\ \end{array} \right), $$
$$ B=\left( \begin{array}{cc} 0 & \frac{1}{\sqrt{2 \gamma ^2+1}} \\ \sqrt{\frac{2 \gamma ^2+1}{4 \gamma ^2+1}} & -\frac{2 \gamma ^2}{\sqrt{8 \gamma ^4+6 \gamma ^2+1}} \\ \end{array} \right),$$
$$ C=\left( \begin{array}{cc} -\frac{4 \gamma ^2}{\sqrt{\frac{1}{\gamma ^2}+2}} & -\frac{2 \left(4 \gamma ^3+\gamma \right)}{\sqrt{8 \gamma ^4+6 \gamma ^2+1}} \\ -2 \gamma \sqrt{2 \gamma ^2+1} & 0 \\ \end{array} \right),$$
$$D=I_{2\times 2}.$$
Then a Hermitian solution is
$$ X=\left( \begin{array}{cc} -\frac{1}{4 \gamma ^3+2 \gamma } & \frac{\gamma }{\left(2 \gamma ^2+1\right) \sqrt{4 \gamma ^2+1}} \\ \frac{\gamma }{\left(2 \gamma ^2+1\right) \sqrt{4 \gamma ^2+1}} & \frac{1}{4 \gamma ^3+2 \gamma } \\ \end{array} \right). $$
The above equations in mathematica code
$Assumptions = {\[Gamma] > 0};
{a,b,c,d}={{{-(\[Gamma]/(1 + 2 \[Gamma]^2)), (\[Gamma] Sqrt[1 + 4 \[Gamma]^2])/(
1 + 2 \[Gamma]^2)}, {(\[Gamma] Sqrt[1 + 4 \[Gamma]^2])/(
1 + 2 \[Gamma]^2), -((\[Gamma] + 4 \[Gamma]^3)/(
1 + 2 \[Gamma]^2))}}, {{0, 1/Sqrt[1 + 2 \[Gamma]^2]}, {Sqrt[(
1 + 2 \[Gamma]^2)/(
1 + 4 \[Gamma]^2)], -((2 \[Gamma]^2)/Sqrt[
1 + 6 \[Gamma]^2 + 8 \[Gamma]^4])}}, {{-((4 \[Gamma]^2)/Sqrt[
2 + 1/\[Gamma]^2]), -((2 (\[Gamma] + 4 \[Gamma]^3))/Sqrt[
1 + 6 \[Gamma]^2 + 8 \[Gamma]^4])}, {-2 \[Gamma] Sqrt[
1 + 2 \[Gamma]^2], 0}}, {{1, 0}, {0, 1}}};
X={{-(1/(2 \[Gamma]+4 \[Gamma]^3)),\[Gamma]/((1+2 \[Gamma]^2) Sqrt[1+4 \[Gamma]^2])},{\[Gamma]/((1+2 \[Gamma]^2) Sqrt[1+4 \[Gamma]^2]),1/(2 \[Gamma]+4 \[Gamma]^3)}}
EDIT 2: Here is a slightly more complex example which takes long to compute
$Assumptions = {\[Gamma] > 0, s0 > 0};
{a, b, c, d} =
{{{-((\[Gamma] (1 - s0 \[Gamma] + \[Gamma]^2))/(
1 + s0 \[Gamma] + \[Gamma]^2)), Sqrt[
s0 \[Gamma] (s0^2 \[Gamma]^2 -
2 s0 \[Gamma] (-1 + \[Gamma]^2) + (1 + \[Gamma]^2)^2)]/(
1 + s0 \[Gamma] + \[Gamma]^2)}, {(
Sqrt[(s0^5 \[Gamma]^3)/(1 + s0 \[Gamma] + \[Gamma]^2)] +
2 Sqrt[(s0^7 \[Gamma]^5)/(1 + s0 \[Gamma] + \[Gamma]^2)] +
2 Sqrt[(s0^5 \[Gamma]^7)/(1 + s0 \[Gamma] + \[Gamma]^2)] + Sqrt[(
s0^9 \[Gamma]^7)/(1 + s0 \[Gamma] + \[Gamma]^2)] -
2 Sqrt[(s0^7 \[Gamma]^9)/(1 + s0 \[Gamma] + \[Gamma]^2)] + Sqrt[(
s0^5 \[Gamma]^11)/(1 + s0 \[Gamma] + \[Gamma]^2)])/(
s0^2 \[Gamma] Sqrt[(1 +
s0 \[Gamma] + \[Gamma]^2) (s0^2 \[Gamma]^2 -
2 s0 \[Gamma] (-1 + \[Gamma]^2) + (1 + \[Gamma]^2)^2)]), \
\[Gamma] (-1 - (2 s0 \[Gamma])/(1 + s0 \[Gamma] + \[Gamma]^2))}}, {{0,
1/Sqrt[1 + s0 \[Gamma] + \[Gamma]^2]}, {Sqrt[(
1 + s0 \[Gamma] + \[Gamma]^2)/(
s0^2 \[Gamma]^2 -
2 s0 \[Gamma] (-1 + \[Gamma]^2) + (1 + \[Gamma]^2)^2)], -2 \
\[Gamma] Sqrt[(
s0 \[Gamma])/((1 + s0 \[Gamma] + \[Gamma]^2) (s0^2 \[Gamma]^2 -
2 s0 \[Gamma] (-1 + \[Gamma]^2) + (1 + \[Gamma]^2)^2))]}}, \
{{-4 Sqrt[(s0 \[Gamma]^5)/(
1 + s0 \[Gamma] + \[Gamma]^2)], -2 \[Gamma] Sqrt[(
s0^2 \[Gamma]^2 -
2 s0 \[Gamma] (-1 + \[Gamma]^2) + (1 + \[Gamma]^2)^2)/(
1 + s0 \[Gamma] + \[Gamma]^2)]}, {-2 \[Gamma] Sqrt[
1 + s0 \[Gamma] + \[Gamma]^2], 0}}, {{1, 0}, {0, 1}}};
A Hermitian solution is
X = {{-(1/(2 \[Gamma] (1+s0 \[Gamma]+\[Gamma]^2))),Sqrt[(s0 \[Gamma])/(s0^2 \[Gamma]^2-2 s0 \[Gamma] (-1+\[Gamma]^2)+(1+\[Gamma]^2)^2)]/(1+s0 \[Gamma]+\[Gamma]^2)},{Sqrt[(s0 \[Gamma])/(s0^2 \[Gamma]^2-2 s0 \[Gamma] (-1+\[Gamma]^2)+(1+\[Gamma]^2)^2)]/(1+s0 \[Gamma]+\[Gamma]^2),1/(2 \[Gamma]+2 s0 \[Gamma]^2+2 \[Gamma]^3)}};