# Why the boundary data qubits have to be put in the ground state for lattice surgery rough merging

I am trying to understand why we need to put the boundary data qubits in the ground state $$|0\rangle$$ for a rough merging procedure.

From my current understanding, if no errors occurred (perfect qubits) it would be unnecessary. The point of doing it is only in order to preserve fault tolerance.

In this image (taken from Horsman's paper), we have two surfaces (left and right) containing a single logical qubit. I call the left and right logical states $$|\psi_L\rangle=\alpha|0\rangle+\beta|1\rangle$$ and $$|\psi_R\rangle=\alpha'|0\rangle+\beta'|1\rangle$$. Then we will merge those two surfaces following the two steps:

1. Put all the pink data qubits in $$|0\rangle$$
2. Treat all the qubits as if we had a single surface. In practice it means that we include the pink data qubits in the $$Z$$ stabilizer measurements, and we measure the $$X$$ stabilizers at the boundary. To ensure fault-tolerance we then measure the stabilizers for $$d$$ clock cycles ($$d$$ being the code distance).

When doing step 2, we see that the product of the $$X$$ stabilizer measurement will be equal to $$X_L X_R$$ (the product of the logical Pauli of the two surfaces). Based on that, and after some calculations and some conventions taken, we can show that the resulting surface will have a quantum state being

$$|\Psi\rangle=\alpha |\psi_R\rangle + \beta X (-1)^M |\psi_R \rangle$$

Where $$M$$ is the eigenvalue of $$X_L X_R$$.

In the absence of any errors, for me it is unnecessary to put the intermediate pink data qubits in $$|0\rangle$$ (hence step 1). Indeed, we don't need step 1 to see that $$X_L^1 X_L^2$$ is being measured. And the reasoning yielding a final state being $$|\Psi\rangle$$ doesn't need to know that the pink qubits were initially in $$|0\rangle$$ (at least from my understanding, please correct me if you believe I am wrong).

For this reason, I guess that step 1 is here, to ensure fault tolerance. I would like to understand precisely why it is necessary.

While I am here focused on merging procedure, the philosophy behind my question is more general. It is very frequent to have to put qubits in some specific state before turning on or off stabilizer measurements and I really struggle to understand why. A related question has been asked here (but I don't get the answer there either).

An X parity measurement has two input qubits and two output qubits, so it has a total of four stabilizer generators that define its behavior. One generator is for the measurement result:

• $$X_1 X_2 \rightarrow +m$$

The other three generators are for observables that the operation must preserve:

• $$X_1 \rightarrow +X_1$$
• $$X_2 \rightarrow +X_2$$
• $$Z_1 Z_2 \rightarrow +Z_1 Z_2$$

The basis that you use to initialize and measure the crossbar data qubits is important because it affects the $$Z_1 Z_2 \rightarrow Z_1 Z_2$$ requirement. If you pick the wrong basis, or don't initialize the data qubits at all, you will destroy the Z parity instead of preserving it. This is because the $$Z_1 Z_2$$ parity sheet stretches from one side of the system to the other, across the crossbar, touching those timelike boundaries:

The thing that might be confusing you is that the measurement result will still be correct if you initialize the crossbar wrong. It's easy to accidentally focus on making sure the measurement result is correct but forget to check that you didn't lose things you're not supposed to lose.

• Thank you for your answer. I try to reformulate/interpret a bit to check my understanding. Basically even in the absence of any error, it is necessary to put the intermediate qubit in $|0\rangle$ (hence I made a mistake in my text). It is necessary because otherwise, I will at the same time measure $X_1 X_2$ but also potentially change $Z_1 Z_2$ (if all qubits at the boundary were in $|1\rangle$ for instance). So in the end this point is not even about fault-tolerance but simply about doing the logical operation we would like to. Is this correct? Commented Mar 21, 2022 at 15:23
• @StarBucK Right. Commented Mar 21, 2022 at 15:26
• Wonderful. Thanks a lot. Commented Mar 21, 2022 at 15:26
• Hello. I am coming back on this because I do not understand anymore the argument. $Z_1 Z_2$ lives on an edge of the lattice. For this reason it never involves the pink qubits represented on the image and I don't get anymore why the value of the pink qubit should affect this observable? It would be great if you can provide a bit more explanation for this reason! Thanks a lot. Commented Jun 7, 2022 at 11:22