The following figure and it's caption is taken from quant-ph/9511018 (Vedral et.al.: Quantum networks for elementary arithmetic operations).
Truth tables and graphical representations of the elementary quantum gates used for the construction of more complicated quantum networks. The control qubits are graphically represented by a dot, the target qubits by a cross. i)NOT
operation. ii) Control--NOT
. This gate can be seen as a "copy operation" in the sense that a target qubit (b) initially in the state 0 will be after the action of the gate in the same state as the control qubit. iii) Toffoli gate. This gate can also be seen as a Control--control--NOT
: the target bit (c) undergoes aNOT
operation only when the two controls (a and b) are in state 1.
EqcsVedral::Not::Not(int bit) : EqcsLambda(0.0, 1.0, 1.0, 0.0, 0) { set(0, bit); }
EqcsVedral::CNot::CNot(int bit, int c) : EqcsLambda(0.0, 1.0, 1.0, 0.0, 1) { set(0, bit); set(1, c); }
EqcsVedral::CCNot::CCNot(int bit, int c1, int c0) : EqcsLambda(0.0, 1.0, 1.0, 0.0, 2) { set(0, bit); set(1, c1); set(2, c0); }