Quantum routines (and Oracles)
A quantum routine is a sequence of pure quantum gate. It can be compiled into a Circuit, or used
as any quantum gate, to build a quantum program or another quantum routine.
Quantum routines provide a set of features simplifying the creation of a circuit:
Naming quantum routines: naming a quantum routine is used to wrap a
QRoutineinto anAbstractGate. TheQRoutineclass provides advanced feature (e.g. ancilla management, compute scope) which can simplify the creation of anAbstractGate. Moreover, naming routines can be used to link the implementation of a gate at compile timeAncillae management and compute scopes:
QRoutinemanages ancilla qubits (an ancilla qubit is a qubit initialized at \(|0\rangle\) state and reset to \(|0\rangle\) at the end of the routine).QRoutinecan flag these qubits to reuse them inside another quantum routine. In addition,QRoutineprovides scopes to compute a sequence of gates, to uncompute this sequence laterOracles and quantum types: quantum registers can be typed to simplify the design of a quantum oracle