Solution (source code)

= Solution

With identical $m$-condensing boundaries, the cylinder supports one logical qubit and hence has
$$
\boxed{\operatorname{GSD}(h=0)=2.}
$$
One logical operator is an electric $Z$ string around the circumference; its conjugate is a magnetic $X$ string joining the two boundaries. The perturbation $h\sum_jX_j$ can generate the latter only after a virtual magnetic anyon traverses the length of the cylinder. Degenerate perturbation theory therefore gives the <ground-state splitting of a surface-code cylinder>
$$
\boxed{\Delta E_m=O\left[J C\left(\frac{|h|}{J}\right)^L\right],}
$$
where the factor $C$ counts translated shortest paths and nonuniversal order-one factors have been suppressed.

If both boundaries instead condense $e$, the unperturbed degeneracy remains two. The logical operator made solely from $X$ is now a magnetic loop winding around the circumference, so the same perturbation first acts nontrivially at order $C$:
$$
\boxed{\Delta E_e=O\left[J L\left(\frac{|h|}{J}\right)^C\right].}
$$
Thus exchanging the condensed anyon exchanges the geometrical length controlling this perturbative splitting.