Let $S$ be the set of complex $N\times N$ matrices that are traceless, unitary and hermitian.

A friend asked me the following question, motivated by a problem in condensed matter physics:

Is it true that for every two matrices $A$, $B$ in $S$, the value of $\det(A+iB)$ is always imaginary?

Well, if a matrix is unitary and hermitian, it can only have $\pm 1$ as eigenvalues. To be traceless, $N$ must be even.

I ran a computer experiment. I wrote $A=UDU^\dagger$ and $B=VDV^\dagger$ where $D={\rm diag}(1^M,(-1)^M)$ and $U$, $V$ are random unitary matrices of dimension $N=2M$.

The result is that $\det(A+iB)$ seems to be indeed always imaginary, if $N\equiv 2 \text{ mod } 4$.

Any ideas how this could be proved?