  The fault-tolerant operation of logical qubits is an important requirement
for realizing a universal quantum computer. Spin qubits based on quantum dots
have great potential to be scaled to large numbers because of their
compatibility with standard semiconductor manufacturing. Here, we show that a
quantum error correction code can be implemented using a four-qubit array in
germanium. We demonstrate a resonant SWAP gate and by combining controlled-Z
and controlled-$\text{S}^{-1}$ gates we construct a Toffoli-like three-qubit
gate. We execute a two-qubit phase flip code and find that we can preserve the
state of the data qubit by applying a refocusing pulse to the ancilla qubit. In
addition, we implement a phase flip code on three qubits, making use of a
Toffoli-like gate for the final correction step. Both the quality and quantity
of the qubits will require significant improvement to achieve fault-tolerance.
However, the capability to implement quantum error correction codes enables
co-design development of quantum hardware and software, where codes tailored to
the properties of spin qubits and advances in fabrication and operation can now
come together to scale semiconductor quantum technology toward universal
quantum computers.
