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 QRoutine into an AbstractGate. The QRoutine class provides advanced feature (e.g. ancilla management, compute scope) which can simplify the creation of an AbstractGate. Moreover, naming routines can be used to link the implementation of a gate at compile time

  • Ancillae management and compute scopes: QRoutine manages ancilla qubits (an ancilla qubit is a qubit initialized at \(|0\rangle\) state and reset to \(|0\rangle\) at the end of the routine). QRoutine can flag these qubits to reuse them inside another quantum routine. In addition, QRoutine provides scopes to compute a sequence of gates, to uncompute this sequence later

  • Oracles and quantum types: quantum registers can be typed to simplify the design of a quantum oracle

Naming quantum routines
Ancillae management and compute scopes
Oracles and quantum types