The Toffoli gate, also known as the Controlled-Controlled NOT gate, is a three-qubit operation defined by:
version 1.0 qubits 4 X q # bring qubit 1 to the |1> state X q # bring qubit 2 to the |1> state H q # bring qubit 3 to the|+> state display #display qubit state Toffoli q, q, q display #display qubit state Toffoli q, q, q display #display qubit state
Note. On most hardware backends, a Toffoli gate cannot be implemented directly, but needs to be compiled to single- and two-qubit gates and mapped onto the qubit topology.
For more information see Toffoli gate on Wikipedia.