How to express a matrix as sum of two square zero matrices I have a real square matrix $M$ that I'd like to express as $M=A+B$ such that
$A^2=0$,$B^2=0$. $M$ has an additional property that $M^2$ is a scalar matrix :
($M^2=s^2I$); and it's dimension is a power of 2 : $dim(M)=2^n,n>0$; Any suggestions?
 A: Regarding what such matrices $M$ can be like and in what dimensions they can exist, here is a relatively thorough (but still incomplete) answer:


*

*If $s=0$, then such matrices $M$ exist in all dimensions. You can take $A=M$ and $B=0$.

*If $s\neq0$ (this will be assumed for all remaining bullets), such a matrix $M$ is diagonalizable and the only possible eigenvalues are $\pm s$.

*If the dimension $d$ is even, a matrix $M$ with $M^2=s^2I_d$ can be written as $A+B$ with $A^2=B^2=0$ if the eigenvalues $+s$ and $-s$ have the same multiplicity. In other words, up to change of basis, it is sufficient that $M$ is the diagonal matrix $\operatorname{diag}(s,\dots,s,-s,\dots,-s)$ with equal numbers of $s$ and $-s$.

*A necessary condition is that both $A$ and $B$ have the same rank $d/2$, but it is unclear whether it implies that the eigenvalues $\pm s$ of $M$ have equal multiplicities.

*If the dimension $d$ is odd, no such matrices $M$ exist (unless $s=0$).


These results follow from the following observations.
$\DeclareMathOperator{\rank}{rank}$
Lemma:
If a square matrix $M$ satisfies $M^2=s^2I$ for $s\neq0$, then $M$ is diagonalizable and the only possible eigenvalues are $\pm s$.
Proof:
The properties you are after are independent of basis, so write $M$ in it's Jordan normal form.
Then each upper triangular Jordan block $J$ of $M$ will have to satisfy $J^2=s^2I$.
First, this implies that the diagonal value (eigenvalue) of the block is $\pm s$.
Second, since there cannot be any non-zero off-diagonal entries in $J^2$ and $s\neq0$, the off-diagonals of $J$ must in fact vanish.
This means that $M$ is in fact diagonalizable.
$\square$
Remark:
The lemma is false for $s=0$, which is why I excluded it.
Case where A and B exist:
If the eigenvalues $+s$ and $-s$ have same multiplicity, then $s^{-1}M$ is a direct sum (block diagonal matrix) of copies of the matrix
$$
N
=
\begin{pmatrix}
1&0\\
0&-1
\end{pmatrix}
=
X+Y,
$$
where the matrices
$
X
=
\frac12
\begin{pmatrix}
1&-1\\
1&-1
\end{pmatrix}
$
and
$
Y
=
\frac12
\begin{pmatrix}
1&1\\
-1&-1
\end{pmatrix}
$
have zero square.
This gives a way to construct matrices $A$ and $B$ (as $s$ times a direct sum of the matrices given above).
Details of construction of $A$ and $B$:
Suppose
$$
M
=
s
\begin{pmatrix}
N&\cdots&0\\
\vdots&\ddots&\vdots\\
0&\cdots&N
\end{pmatrix}.
$$
Any $M$ expressible in the desired way is of this form after a change of basis.
You can choose $A$ be the block diagonal matrix
$$
s
\begin{pmatrix}
X&\cdots&0\\
\vdots&\ddots&\vdots\\
0&\cdots&X
\end{pmatrix}
$$
and $B$ can be given the same way using $Y$ instead of $X$.
Now it's evident that $A^2=B^2=0$ (since $X^2=Y^2=0$), $A+B=M$ (since $X+Y=N$), and $M^2=s^2I$ (since $N^2=s^2I$).
General case:
Assume $s\neq0$.
Due to the lemma, an $d\times d$ matrix $M$ with $M^2=s^2I_d$ can be written in the block form
$$
M
=
s
\begin{pmatrix}
I_a&0\\
0&-I_b
\end{pmatrix}
$$
with $a+b=d$.
If $a=b$, we can construct the matrices $A$ and $B$ as above.
Such $A$ and $B$ don't exist if $a\neq b$, as we will see next.
Observations with rank:
It follows from Sylvester's rank inequality that if a $d\times d$ matrix $A$ has zero square, then $\rank(A)\leq d/2$.
The inequality is strict if $d$ is odd.
Also, $\rank(M)=\rank(A+B)\leq\rank(A)+\rank(B)$.
Thus unless both $A$ and $B$ have rank $d/2$, $M$ can't have the full rank $d$.
If $s\neq0$, the condition $M^2=s^2I_d$ requires that $M$ has full rank.
A: Take
$$
A=\begin{pmatrix} 1 & -r^{-1}\cr r & -1 \end{pmatrix},\quad 
B=\begin{pmatrix} 1 & -s^{-1}\cr s & -1 \end{pmatrix}
$$
for non-zero $r,s$, and $M=A+B$.
Then $A^2=B^2=0$ and 
$$
M^2=(A+B)^2=\frac{-r^2+2rs-s^2}{rs}I
$$
A: This can always be done for $M$ of even size $2n$, i.e. $M$ is a $2n \times 2n$ matrix.
Set 
$P = \begin{bmatrix} 0 & I_n \\ 0 & 0 \end{bmatrix}, \tag{1}$
where $I_n$ is the $n \times n$ identity matrix.  Then
$P^2 = \begin{bmatrix} 0 & I_n \\ 0 & 0 \end{bmatrix}\begin{bmatrix} 0 & I_n \\ 0 & 0 \end{bmatrix} = 0; \tag{2}$
likewise take
$Q = P^T = \begin{bmatrix} 0 & 0 \\ I_n & 0 \end{bmatrix}; \tag{3}$
then
$Q^2 = (P^T)^2 = P^TP^T = (PP)^T = (P^2)^T = 0 \tag{4}$
as well.  Then
$P + Q =  \begin{bmatrix} 0 & I_n \\ I_n & 0 \end{bmatrix}, \tag{5}$
and
$(P + Q)^2 = \begin{bmatrix} 0 & I_n \\ I_n & 0 \end{bmatrix} \begin{bmatrix} 0 & I_n \\ I_n & 0 \end{bmatrix} = \begin{bmatrix} I_n & 0\\ 0 &  I_n \end{bmatrix} = I_{2n}, \tag{7}$
so setting
$A = sP, \tag{8}$
$B = sQ, \tag{9}$
we find
$(A + B)^2 = s^2(P + Q)^2 = s^2 I_{2n} = M. \tag{10}$
Also worth noting:
$(P + Q)^2 = P^2 + PQ + QP + Q^2 = PQ + QP; \tag{11}$
$PQ = \begin{bmatrix} 0 & I_n \\ 0 & 0 \end{bmatrix}\begin{bmatrix} 0 & 0 \\ I_n & 0 \end{bmatrix} = \begin{bmatrix} I_n & 0 \\ 0 & 0 \end{bmatrix}, \tag{12}$
and likewise
$QP = \begin{bmatrix} 0 & 0 \\ 0 & I_n \end{bmatrix}. \tag{12}$
Remark: Not sure if there is a solution for $M$ of odd size.
A: Another class of solutions:  $A = \left[\begin{matrix}0 &sI \\ 0& 0\end{matrix}\right]$, $B = \left[\begin{matrix}0&0\\sI &0\end{matrix}\right]$.
