Abstract
In order to build a large scale quantum computer, one must be able to correct errors extremely fast. We design a fast decoding algorithm for topological codes to correct for Pauli errors and erasure and combination of both errors and erasure. Our algorithm has a worst case complexity of , where is the number of physical qubits and is the inverse of Ackermann's function, which is very slowly growing. For all practical purposes, . We prove that our algorithm performs optimally for errors of weight up to and for loss of up to qubits, where is the minimum distance of the code. Numerically, we obtain a threshold of for the 2d-toric code with perfect syndrome measurements and with faulty measurements.