Lukas' Notes

quantum-computing

Definition

Ancilla Qubit

An ancilla qubit is a temporary helper qubit used as workspace inside a quantum circuit. An ancilla register is a collection of such helper qubits, usually initialised to

or, for several ancillae,

Ancillae store intermediate information that is needed during a computation but is not part of the intended final output.

Role

Input registers contain the meaningful data of the computation. Ancilla registers provide temporary workspace.

In arithmetic circuits, ancillae often store:

  • carry bits;
  • overflow bits;
  • comparison flags;
  • control flags;
  • temporary addition or subtraction results.

Because quantum circuits must be reversible, temporary information should often be removed after it has served its purpose.

Compute, Use, Uncompute

A common pattern is:

  1. compute a temporary value into an ancilla;
  2. use that temporary value;
  3. uncompute it to restore the ancilla.

Formally,

The final step returns the ancilla to its initial clean state. This prevents temporary garbage from remaining entangled with the useful output.