As machine learning techniques are well suited to this problem, a neural network is a potential candidate for an efficient decoder. Decoding the information to optimally detect which errors have occurred is in general a hard classical problem of pattern recognition.
However, careful repeated measurement of small pieces of a quantum computer provides information to detect and correct errors without disturbing the calculation itself. Unlike in modern classical computers, error rates in quantum hardware are many orders of magnitude too high to complete most useful calculations. The long short-term memory layers of the recurrent neural network maintain their performance over a large number of quantum error correction cycles, making it a practical decoder for forthcoming experimental realizations of the surface code. The machine learning algorithm adapts to the physical system, hence no noise model is needed. The performance gain is achieved because the neural network decoder can detect correlations between bit-flip (X) and phase-flip (Z) errors. Here we show that a recurrent neural network can be trained, using only experimentally accessible data, to detect errors in a widely used topological code, the surface code, with a performance above that of the established minimum-weight perfect matching (or blossom) decoder. In the context of machine learning, neural networks are a promising new approach to quantum error correction. A fault-tolerant quantum computation requires an efficient means to detect and correct errors that accumulate in encoded quantum information.