Signature matrix in linear algebra Let's look to the following equation:
\begin{equation}
D'JD=T'T
\end{equation}
where $D\in\mathbb{R}^{n\times m}$, $J\in\mathbb{R}^{n\times n}$, $T\in\mathbb{R}^{m\times m}$, and $J$ is a signature matrix. Assume $D,T$ are not zero matrices.
One thing I notice is that $J$ cannot be equal to $-I$, where $I$ is an identity matrix. Otherwise, since RHS is positive semidefinite, the LHS must be positive semidefinite and if $J=-I$ it means both $T$ and $D$ must be zero matrices.
Can we say more about $J$, I have the feeling that for the given equation $J$ might be always an identity.
 A: The punchline: given $J$ and $T$, a solution $D$ exists if and only if $p \geq \operatorname{rank}(T)$, where $p$ is the number of $+1$ entries in the signature matrix $J$.
It follows that a solution will exist for all possible matrices $T$ if and only if $p \geq m$.

We'll focus on the case that $J \neq \pm I$. Without loss of generality, we can suppose that $J$ has the form
$$
J = \pmatrix{I_p & 0\\0 & -I_q}
$$
for positive integers $p,q$. Partition $D$ into the form
$$
D = \pmatrix{D_1\\ D_2},
$$
where $D_1$ is $p \times m$ and $D_2$ is $q \times m$. We find that
$$
D'JD = D_1'D_1 - D_2'D_2.
$$
The matrix $T'T$ is necessarily positive semidefinite, so in order to have $D'JD = T'T$ it must be the case that $D'JD$ is positive semidefinite. Under this assumption, we note that $D'JD \preceq D_1'D_1$ (where $\preceq$ denotes the Loewner order), which means that the rank of $D'JD$ is less than or equal to the rank of $D_1'D_1$. The rank of $D_1'D_1$ is necessarily equal to the rank of $D_1$, which is at most equal to $\min\{p,m\}$.
This leads us to the following conclusion: if there is a solution to the equation $D'JD = T'T$, then it must be the case that
$$
p \geq \operatorname{\min}\{p,m\} \geq \operatorname{rank}(T'T) = \operatorname{rank}(T).
$$
That is, it must be the case that $p \geq \operatorname{rank}(T)$.
The converse holds as well. Suppose that $p \geq \operatorname{rank}(T)$. It follows that $T$ has a "thin" $QR$ decomposition where $Q$ is $m \times p$ with orthonormal columns and $R$ is $p \times m$. It follows that
$$
T'T = (QR)'(QR) = R'Q'QR = R'R.
$$
If we take $D_1 = R$ and $D_2 = 0$, then we find that $D'JD = R'R = T'T$, which was what we wanted.
