Probabilistic implementation of gates by cyclic permutation and measurement

Given an $n$- qubit Pauli operator $P=P_1\otimes \cdots \otimes P_n$, with $P_j\in\{I,X,Y,Z\}$, let $\eta(P)=P_2\otimes P_3\otimes\cdots\otimes P_n\otimes P_1$ be the Pauli operator obtained by cyclically permuting the factors. Let $S$ be a stabilizer with generators $\{M_j\}_j$, and let $\{\overline{X}_l,\overline{Z}_l\}_l$ be generators of $N(S)/S$. Consider the stabilizer $\eta(S)$ defined by generators $\{M'_j:=\eta(M_j)\}_j$, and the associated generators $\{\overline{X}'_l=\eta(\overline{X}_l), \overline{Z}'_l=\eta(\overline{Z}_l)\}_l$ of $N(\eta(S))/\eta(S)$.
Consider the following process:
  1. Start with some encoded state $\ket{\overline{\Psi}}$ for $S$.
  2. Measure all the stabilizer generators of $\eta(S)$.
  3. Output `success' and the post-measurement state if all outcomes are $+1$.

Let $S$ be the stabilizer of the $[[5,1,3]]$-code, and let $\ket{\overline{\Psi}}\in\mathcal{T}(S)$ be an arbitrary encoded state.

The stabilizer generators $S=<M_1,M_2,M_3,M_4>$ for this 5-qubit code, are given by
M_1=&X \ Z \ Z \ X \ I \\
M_2=& I \ X \ Z \ Z \ X \\
M_3=& X \ I \ X \ Z \ Z \\
M_4=& Z \ X \ I \ X \ Z ,
and so the resulting generators for $\eta(S)=<M'_1,M'_2,M'_3,M'_4>$ are given by
M'_1=&Z \ Z \ X \ I \ X \\
M'_2=&X \ Z \ Z \ X \ I \\
M'_3=& I \ X \ Z \ Z \ X \\
M'_4=& X \ I \ X \ Z \ Z. \\

Observe that $M'_2=M_1$, $M'_3=M_2$, $M'_4=M_3$, and that $M'_1=M_1M_2M_3M_4$. Thus, each of the generators $M'_j$ can be expressed in terms of the generators of $S$, which implies that $\eta(S)=S$. Since each $M\in S=\eta(S)$ satisfies $M\ket{\overline{\Psi}}=\ket{\overline{\Psi}}$, measuring the stabilizer generators $M'_j$ will always yield an outcome corresponding to $+1$, and the state will be left invariant as $\ket{\overline{\Psi}}$.  In regards to the procedure outlined above, the success probability will be $1$, and the post-measurement state will be $\ket{\overline{\Psi}}$.

Consider the set of stabilizers $S=<M_1,M_2>$ and generators of $N(S)/S=<\overline{X}_1,\overline{Z}_1,\overline{X}_2,\overline{Z}_2>$ given by
M_1=&X \ X \ X \ I  \\
M_2=& I \ Z \ Z \ I  \\
\overline{X}_1=& I \ X \ X \ I \\
\overline{Z}_1=& Z \ I \ Z \ I   \\
\overline{X}_2=& I \ I \ I \ X \\
\overline{Z}_3=&I \ I \ I \ Z.

Then the stabilizer generators of $\eta(S)=<M'_1,M'_2>$ are given by
M'_1=&X \ X \ I \ X  \\
M'_2=& Z \ Z \ I \ I.  \\
It is readily seen that $\{M'_1,M_i\}=0$ and $[M'_2,M_i]=0$, for $i=1,2$, implying that $M'_1\notin N(S)$, and that $M'_2\in N(S)$ but $M'_2\notin S$.

Consider the set of stabilizer generators of $S=<M_1,M_2>$ and generators of \\ $N(S)/S=<\overline{X}_1,\overline{Z}_1,\overline{X}_2,\overline{Z}_2>$ given by
M_1 =& X \ X \ X \ I \\
M_2 =& I \ Z \ Z \ I \\
\overline{X}_1=& I \ X \ X \ I \\
\overline{Z}_1=& Z \ I \ Z \ I \\
\overline{X}_2=& I \ I \ I \ X \\
\overline{Z}_2=& I \ I \ I \ Z, \\

and the generators of $\eta(S)$ and $N(\eta(S))/\eta(S)$ given by

M'_1 =& X \ X \ I \ X \\
M'_2 =& Z \ Z \ I \ I \\
\overline{X}'_1=& X \ X \ I \ I \\
\overline{Z}'_1=& I \ Z \ I \ Z \\
\overline{X}'_2=& I \ I \ X \ I \\
\overline{Z}'_2=& I \ I \ Z \ I. \\

Suppose the initial state is an encoded state $\ket{\overline{\Psi}}=\ket{\overline{+}}_1\otimes\ket{\overline{0}}_2$. Here, $\ket{\overline{+}}_1$ is interpreted as an encoded state of $3$ physical qubits, and the other encoded state $\ket{\overline{0}}_2$ in the tensor product is an encoded state represented by a single qubit.

More explicitly, consider the state $\frac{1}{\sqrt{2}}(\ket{000}+\ket{111})$ and observe that
 which suggests the encoded basis is given by
\ket{\overline{0}}_1= \frac{1}{\sqrt{2}}(\ket{000}+\ket{111}) \ \ \text{and} \ \ \ket{\overline{1}}_1=\frac{1}{\sqrt{2}}(\ket{011}+\ket{100}).
 For the second encoded qubit, it must be that $\ket{\overline{0}}_2=\ket{0}$ and $\ket{\overline{1}}_2=\ket{1}$.

 Hence, the intitial encoded state is of the form
\[ \begin{align*}
 \ket{\overline{\Psi}}=&\ket{\overline{+}}_1\ket{\overline{0}}_2 \\
 =&\frac{1}{\sqrt{2}}(\ket{\overline{0}}_1+\ket{\overline{1}}_1)\ket{\overline{0}}_2 \\
 =&\frac{1}{\sqrt{2}}(\ket{000}+\ket{111}+\ket{011}+\ket{100})\ket{0} \\

Consider the two permuted stabilizer $M'_1$ and $M'_2$. Note that $M'_1$ anticommutes with all of the logical Pauli operators in $N(S)/S$ so that $M'_1\notin N(S)$.  On the contrary, note that $M'_2$ does commute with all generators of $N(S)/S$, yet is not in the stabilizer $S$ since it cannot be generated by $M_1$ and $M_2$. Therefore, $M'_2\in N(S)\backslash S$, and can be expressed as a logical operation as $M'_2=\overline{Z}_1M_2$.

 Now suppose the operator $M'_2$ is measured on the encoded state $\ket{\overline{\Psi}}$. Since $M'_2=\overline{Z}_1M_2$ has the effect of applying a logical $Z$ operation on the first encoded qubit, which is in the state $\ket{\overline{+}}$, the probability of observing a $+1$ eigenvalue is $1/2$. In this case, the state after measuring $M'_2$ can be determined by applying the projector into the $+1$ eigenstate of $M'_2$:
\[ \begin{align*}
 =&\frac{1}{2}(\ket{\overline{+}}_1\ket{\overline{0}}_2+\ket{\overline{-}}_1\ket{\overline{0}}_2) \\
\end{align*} \]

Thus, after renormalization the resulting state is given by $\ket{\overline{0}}_1\ket{\overline{0}}_2$.

Now, consider measuring $M'_1$. Since $M'_1\notin N(S)$, it commutes with exactly half of the Paulis and anticommutes with the other half. This gives a $1/2$ probability of measuring a $+1$ eigenvalue. Hence, the overall success probability of measuring a $+1$ outcome for both operators $M'_1$ and $M'_2$ is given by $1/4$.

Moreover, the resulting state after this second measurement is made is determined via the projector:
\[ \begin{align*}
 \frac{1}{2}(I+M'_1)\ket{\overline{0}}_1\ket{\overline{0}}_2=&\frac{1}{2\sqrt{2}}(I+M'_1)(\ket{000}\ket{0}+\ket{111}\ket{0}) \\
 \rightarrow& \ \frac{1}{2}(\ket{000}\ket{0}+\ket{111}\ket{0}+\ket{110}\ket{1}+\ket{001}\ket{1}),
\end{align*} \]
 where the resulting state has been normalized accordingly.

 In the context of the permuted stabilizer $\eta(S)$, the $2$nd encoded qubit now appears physically in the $3$rd register of the system. Then by effectively permuting the qubits cyclically, the final state can be expressed in the form
\ket{\psi_{final}}=& \frac{1}{2}(\ket{000}\ket{0}+\ket{011}\ket{1}+\ket{111}\ket{0}+\ket{100}\ket{1}) \\
 showing that the state is entangled between logical qubits.