  The large-scale execution of quantum algorithms requires basic quantum
operations to be implemented fault-tolerantly. The most popular technique for
accomplishing this, using the devices that can be realised in the near term,
uses stabilizer codes which can be embedded in a planar layout. The set of
fault-tolerant operations which can be executed in these systems using unitary
gates is typically very limited. This has driven the development of
measurement-based schemes for performing logical operations in these codes,
known as lattice surgery and code deformation. In parallel, gauge fixing has
emerged as a measurement-based method for performing universal gate sets in
subsystem stabilizer codes. In this work, we show that lattice surgery and code
deformation can be expressed as special cases of gauge fixing, permitting a
simple and rigorous test for fault-tolerance together with simple guiding
principles for the implementation of these operations. We demonstrate the
accuracy of this method numerically with examples based on the surface code,
some of which are novel.
