Quantum arithmetic (source code)

= Quantum arithmetic

Quantum arithmetic implements a classical numerical function reversibly on computational-basis registers and therefore coherently on their superpositions. Temporary work values must be uncomputed to avoid unwanted entanglement.