  A quantum error correcting protocol can be substantially improved by taking
into account features of the physical noise process. We present an efficient
decoder for the surface code which can account for general noise features,
including coherences and correlations. We demonstrate that the decoder
significantly outperforms the conventional matching algorithm on a variety of
noise models, including non-Pauli noise and spatially correlated noise. The
algorithm is based on an approximate calculation of the logical channel using a
tensor-network description of the noisy state.
