Consider errors on a set of edges of the toric code with qubits; errors are treated identically on the dual lattice. Two error sets have the same syndrome and the same effect on the code space exactly when they differ by a sum of plaquette boundaries. Write for this class. Put an Ising spin on every plaquette and a coupling on the edges of , elsewhere. The spin configuration with on a set of plaquettes corresponds to the error , whose edges are those with , where are the two plaquettes sharing . Summing the probabilities over the class gives
provided the inverse temperature is tied to the error rate by the second relation in the displayed equation. The factor appears because a spin configuration and its global flip give the same error set. The couplings are themselves drawn with a fraction of antiferromagnetic bonds, so the disorder strength and the temperature are locked together: this is the line in the phase diagram of the random-bond Ising model studied by Nishimori.
The other classes with the same syndrome are obtained by adding a non-contractible loop to , which inserts a domain wall around the torus. Maximum-likelihood decoding succeeds with probability tending to 1 exactly when, for typical , the free-energy cost of that domain wall diverges with , which is the definition of the ferromagnetically ordered phase. Hence the threshold is the disorder strength at which the Nishimori line leaves the ordered phase. The mapping is due to Dennis, Kitaev, Landahl and Preskill; the numerical value of is recorded in a separate result.
A decoder that returns the single most probable error, such as minimum-weight matching, corresponds to the zero-temperature axis of the same model and has a lower threshold (Wang, Harrington and Preskill).