Solution (source code)

= Solution

Write $a=\gamma_{2M}$ and $b=\gamma_{2M-1}$. The ancilla condition $iab|\psi\rangle=|\psi\rangle$ implies $a|\psi\rangle=ib|\psi\rangle$ and lets every occurrence of $a$ on the state be replaced by $ib$. Define the two parity projectors
$$
P_1=\frac{1-i\gamma_3b}{2},
\qquad
P_2=\frac{1+\gamma_1\gamma_2\gamma_4b}{2}.
$$
Their factors square to one, so they are valid <fermion-parity measurement> projectors. Expanding $P_1P_2$, using the Majorana anticommutation relations, replacing $a$ with $ib$ on $|\psi\rangle$, and using
$$
e^{\pi\gamma_3a/4}=\frac{1+\gamma_3a}{\sqrt2},
\qquad
e^{i\pi\gamma_1\gamma_2\gamma_3\gamma_4/4}
=\frac{1+i\gamma_1\gamma_2\gamma_3\gamma_4}{\sqrt2},
$$
gives
$$
\boxed{
e^{i\pi\gamma_1\gamma_2\gamma_3\gamma_4/4}|\psi\rangle
\propto
e^{\pi\gamma_3\gamma_{2M}/4}
\frac{1-i\gamma_3\gamma_{2M-1}}2
\frac{1+\gamma_1\gamma_2\gamma_4\gamma_{2M-1}}2
|\psi\rangle.}
$$
The proportionality absorbs the probability amplitude for obtaining the two displayed measurement outcomes. This realizes the four-Majorana phase gate using one braid and parity measurements.