Choose both circular ends of the cylinder to be electric, or rough, boundaries. In the convention of part 1, retain plaquette generators
with their boundary truncations, and use star generators
only at vertices not lying on an electric boundary. Omitting the endpoint star checks allows a string to terminate at either boundary, which is precisely anyon condensation at a boundary for .
Relative homology now has one nontrivial class represented by a primal path joining the two boundaries. The dual absolute homology has one class represented by an loop around the cylinder. Their strings intersect once and anticommute, so they form one logical pair . Every other closed or boundary-ending string is a product of stabilizers, so the code has exactly one logical qubit.
In the Random-bond Ising model mapping, there is no Ising spin for an omitted boundary star. An edge joining an interior vertex to an electric boundary is toggled by only , so its bond factor is replaced by the boundary-field factor . Equivalently, attach exterior spins fixed to and retain the same bond formula. Edges wholly on a boundary contribute fixed constants. The bulk Hamiltonian is therefore supplemented by
with the signs still determined by . This is the required boundary modification.
A green X, Y, or Z string may end on the bottom green boundary without leaving a violated green plaquette beyond the lattice. The top vertex is likewise a zero-length green boundary where such strings can terminate. Thus both locations absorb : they exhibit anyon condensation at a boundary.
A string joining these two green condensers preserves every stabilizer but cannot be reduced to stabilizers, so it is logical. In the pictured lattice the shortest such path contains nine qubits. No shorter nontrivial string connects equivalent condensing boundaries, hence
For example, the product of X operators along any shortest green path from the bottom boundary to the top corner is a logical , and the product of Z operators along a corresponding path is a logical . They may be chosen to overlap on an odd number of vertices, so they anticommute as required for one encoded qubit.