  Quantum bits are more robust to noise when they are encoded non-locally. In
such an encoding, errors affecting the underlying physical system can then be
detected and corrected before they corrupt the encoded information. In 2001,
Gottesman, Kitaev and Preskill (GKP) proposed a hardware-efficient instance of
such a qubit, which is delocalised in the phase-space of a single oscillator.
However, implementing measurements that reveal error syndromes of the
oscillator while preserving the encoded information has proved experimentally
challenging: the only realisation so far relied on post-selection, which is
incompatible with quantum error correction (QEC). The novelty of our experiment
is precisely that it implements these non-destructive error-syndrome
measurements for a superconducting microwave cavity. We design and implement an
original feedback protocol that incorporates such measurements to prepare
square and hexagonal GKP code states. We then demonstrate QEC of an encoded
qubit with unprecedented suppression of all logical errors, in quantitative
agreement with a theoretical estimate based on the measured imperfections of
the experiment. Our protocol is applicable to other continuous variable systems
and, in contrast with previous implementations of QEC, can mitigate all logical
errors generated by a wide variety of noise processes, and open a way towards
fault-tolerant quantum computation.
