Solution (source code)

= Solution

The <Pauli matrices> obey $X|0\rangle=|1\rangle$, $X|1\rangle=|0\rangle$, $Y|0\rangle=i|1\rangle$, and $Y|1\rangle=-i|0\rangle$. Thus $X\otimes X$ and $Y\otimes Y$ contribute opposite amplitudes on $|00\rangle,|11\rangle$ and equal amplitudes on $|01\rangle,|10\rangle$. For the <XY exchange interaction> $E=(X\otimes X+Y\otimes Y)/2$,
$$
\boxed{E|00\rangle=0,\quad E|01\rangle=|10\rangle,\quad E|10\rangle=|01\rangle,\quad E|11\rangle=0.}
$$
Equivalently $E=|01\rangle\langle10|+|10\rangle\langle01|$. It transfers an excitation across a link without creating or destroying excitations, so a sum of such links preserves the <single-excitation subspace>.