## 6 Modified Distance Metric  
The algorithm presented here is an example of an HDRG decoder. Some of the properties of this class of decoding methods were presented in [5]. This includes a proposed improvement for these decoders, aimed at increasing the minimum number of physical errors required to cause logical error. The proposed improvement is a redefinition of the distances used by the decoder. The purpose of the distances is to reflect how likely two elements of the syndrome are to be endpoints of the same error string. The most obvious choice is therefore the number of errors required to correct them, which is the Manhattan distance for the planar code defined on a square lattice. However, this does not always lead to the best results. In some iteration of the process, suppose the decoder chooses to annihilate two anyons \(b\) and \(c\), separated by a Manhattan distance \(D_{bc}\). The decoder then assumes that a chain of \(D_{bc}\) errors has occurred between them. At some later iteration, the decoder will need to determine whether another pair, \(a\) and \(d\), should be annihilated. For this it will need to know the number of errors an error chain between them would require. Ordinarily, this would be the Manhattan distance \(D_{ad}\). However, consider a path between \(a\) and \(d\) that intersects \(c\) and \(b\). An error chain that goes from \(a\) to \(b\), and then from \(c\) to \(d\), would therefore also be consistent with the original syndrome. This would require \(D_{ab}+D_{cd}\) errors, which may be less that \(D_{ad}\) in general. The pairing of \(a\) and \(d\) would then be more likely than the decoder would assume due to the possibility of this shortcut for the error chain. The improvement suggested in [5], when adapted for the specific case of the planar code, is to perform an update of the distances between pairs of anyons each time an annihilation occurs. Initially the distance, \(D(a,b)\) between all pairs of anyons will be set to be the Manhattan distance. Upon the annihilation of a pair, \(c\) and \(d\), the distances are updated according to  
\[D_{a,b}\rightarrow\min\left(D_{a,b}\,,\,D_{a,c}+D_{d,b}\,,\,D_{a,d}+D_{c,b} \right). \tag{2}\]  
This will allow the syndrome information concerning pairs annihilated early in the process to still be used later in the process, even though they have been removed from the syndrome. As such, the decoder can make better decisions concerning which anyons to pair at later stages. In Figure 4 data is presented to compare the results of decoder when these redefined distances are used to that when they are not. These are referred to as the \"shortcut\" and \"standard\" methods, respectively. Due to the way the shortcut method is implemented, it is more difficult to obtain results for large system sizes. As such, a direct comparison of thresholds is not made. Instead the system size \(L^{*}\) is compared for both the correlated and uncorrelated error models. It is found that the shortcuts offer no significant advantages for low error rates, for which the corresponding \(L^{*}\) is small. However, for larger error rates the growth of \(L^{*}\) with \(p\) and \(p^{\prime}\) is found to be much slower when the shortcuts are used, and so the same degree of error suppression can be achieved with much smaller systems. The ratio of logical error rates is also compared. For the uncorrelated error model the ratio \(P(standard)/P(shortcuts)\) is found for \(p=3.5\%\approx p_{c}/2\) and multiple system sizes. This ratio quantifies how much more likely the standard method is to fail than the one with shortcuts. The results suggest that this increases exponentially with \(L\), or a power thereof. This suggests that the value of \(\beta\) for the shortcuts is higher than that for the standard method, as is expected [5]. The ratio is similarly found for the correlated error model and \(p^{\prime}=2.5\%\approx p^{\prime}_{c}/2\), with similar results. Figure 4: Comparison of the results of the method using shortcuts with the standard method.