  One of the main goals in quantum circuit optimisation is to reduce the number
of ancillary qubits and the depth of computation, to obtain robust computation.
However, most of known techniques, based on local rewriting rules, for
parallelising quantum circuits will require the addition of ancilla qubits,
leading to an undesired space-time tradeoff. Recently several novel approaches
based on measurement-based quantum computation (MBQC) techniques attempted to
resolve this problem. The key element is to explore the global structure of a
given circuit, defined via translation into a corresponding MBQC pattern. It is
known that the parallel power of MBQC is superior to the quantum circuit model,
and hence in these approaches one could apply the MBQC depth optimisation
techniques to achieve a lower depth. However, currently, once the obtained
parallel pattern is translated back to a quantum circuit, one should either
increase the depth or add ancilla qubits. In this paper we characterise those
computations where both optimisation could be achieved together. In doing so we
present a new connection between two MBQC depth optimisation procedures, known
as the maximally delayed generalised flow and signal shifting. This structural
link will allow us to apply an MBQC qubit optimisation procedure known as
compactification to a large class of pattern including all those obtained from
any arbitrary quantum circuit. We also present a more efficient algorithm
(compared to the existing one) for finding the maximally delayed generalised
flow for graph states with flow.
