Merge and Split Operations¶
In Entwine, you can combine patches together or divide them apart through the merge and split operations. These are central procedures in lattice surgery, enabling logical qubits to interact and build logical gates. Together, these merge-and-split protocols form the basis of lattice surgery, providing a fault-tolerant and scalable alternative to direct transversal gates.
⚠️ Important: Remember to enter lattice surgery mode by pressing
sbefore growing or shrinking!
Merge Operation¶
Merging allows you to combine two patches along a shared boundary. Specifically, a merge operation between two logical qubits measures a joint stabiliser along the boundary where their patches touch. This joint parity measurement creates correlations between the qubits, effectively generating entanglement. Since entangling operations are the foundation of multi-qubit logical gates (such as the CNOT), lattice surgery provides a practical alternative to direct transversal gates.
Use Cases¶
- Performing joint measurements between logical qubits.
- Creating temporary composite codes during lattice surgery protocols.
- Generating entanglement between patches before splitting them apart.
Demo – Merge Operation:
Split Operation¶
Splitting allows you to separate a patch back into two independent logical blocks. Specifically, a split operation takes a single logical qubit patch and divides it into two smaller patches while measuring a joint stabiliser across the new boundary. In Loom (and Entwine) the split operation is specified by selecting a single column (or row) of qubits to be the point-of-divide. This process distributes quantum information between the two patches, creating correlations that can generate entanglement. Just like merges, splits play a central role in surface code architectures by enabling logical multi-qubit operations.
Use Cases¶
- Restoring individual logical qubits after a merge.
- Completing lattice surgery operations by returning to the original layout.
- Reducing code size once an interaction is complete.
Split Operation:
Tips¶
- Merges always occur along a shared boundary — ensure your patches are aligned before attempting the operation.
- After a split, check stabiliser coloring to confirm both resulting patches are valid logical blocks.
- Merge and split can be combined with grow/shrink operations for flexible patch management.