Logical Blocks¶
In Entwine, we can group stabilisers together to define logical qubits. Logical qubits will often times be referred in these docs as logical blocks.
For example, for a standard logical qubit in the surface code, this boils down to manually drawing the eight stabilisers required to define it. Once created, the logical block represents a single logical qubit embedded in the patch.
Creating a Logical Block¶
- Manually define stabilisers – Begin by drawing the set of stabilisers (X and Z) that form your logical qubit. For the surface code, this requires 8 stabilisers.
- Visual feedback – When stabilisers are arranged correctly, Entwine automatically detects the block and highlights it.
- Valid logical block → outlined in light green.
- Invalid block → no outline! (indicating that no logical operators (yet)exist for that configuration).
This immediate feedback helps you validate your patch design without needing to manually check operator structures.
Example¶
Here’s an example of constructing a logical block for the rotated surface code
In this example, you can see the stabilisers being placed, followed by Entwine recognising the valid logical block and highlighting it with a green border. The color of the verteces is a quick indication of the Pauli charge at that vertex. That is, it is a visual way to check whether you have an even/odd number of X or Z operators. See the Pauli Charges page for more details.
Automatic Recognition¶
Entwine includes a block recogniser system that automatically checks stabiliser groups to see if they correspond to known logical qubit structures.
Rules of the Recogniser¶
- Order matters – The recognisers are checked in sequence, and the first one that matches defines the block.
- Colors:
- Green border → valid block (logical operators exist).
- Red border → invalid block (no logical operators detected).
Manual Recognition¶
The regogniser can also be toggled by pressing the keys 0-4 on your keyboard.
-
Dummy Block
- Always returns a match.
- Used as a fallback to ensure every configuration has a classification.
-
Custom Block
- Performs a validity check on the stabilisers to confirm whether they form a logical block.
-
Rotated Surface Code
- Recognises logical qubits defined using the rotated surface code layout.
-
Repetition Code
- Recognises logical qubits built as repetition codes, which protect against bit-flip or phase-flip errors depending on orientation.
Tips for Building Logical Blocks¶
- Always check the border color:
- Green means your logical qubit is valid.
- Red means Entwine cannot find logical operators.
- If your block is being misclassified, remember that order matters — a higher-priority recogniser may be overriding the intended classification.