  Topological error correcting codes, and particularly the surface code,
currently provide the most feasible roadmap towards large-scale fault-tolerant
quantum computation. As such, obtaining fast and flexible decoding algorithms
for these codes, within the experimentally relevant context of faulty syndrome
measurements, is of critical importance. In this work, we show that the problem
of decoding such codes, in the full fault-tolerant setting, can be naturally
reformulated as a process of repeated interactions between a decoding agent and
a code environment, to which the machinery of reinforcement learning can be
applied to obtain decoding agents. As a demonstration, by using deepQ learning,
we obtain fast decoding agents for the surface code, for a variety of
noise-models.
