  It is challenging to transform an arbitrary quantum circuit into a form
protected by surface code quantum error correcting codes (a variant of
topological quantum error correction), especially if the goal is to minimise
overhead. One of the issues is the efficient placement of magic state
distillation sub circuits, so-called distillation boxes, in the space-time
volume that abstracts the computation's required resources. This work presents
a general, systematic, online method for the synthesis of such circuits.
Distillation box placement is controlled by so-called schedulers. The work
introduces a greedy scheduler generating compact box placements. The
implemented software, whose source code is available online, is used to
illustrate and discuss synthesis examples. Synthesis and optimisation
improvements are proposed.
