cirq_rigetti.quil_input.CCNOT

The Tofolli gate, also known as the Controlled-Controlled-X gate.

If the first two qubits are in the |11⟩ state, this flips the third qubit in the computational basis, otherwise this applies identity to the third qubit.

The exponent=1 instance of cirq.CCXPowGate.

The unitary matrix of this gate is (empty elements are \(0\)):

\[ \begin{bmatrix} 1 & & & & & & & \\ & 1 & & & & & & \\ & & 1 & & & & & \\ & & & 1 & & & & \\ & & & & 1 & & & \\ & & & & & 1 & & \\ & & & & & & 0 & 1 \\ & & & & & & 1 & 0 \end{bmatrix} \]

Alternative names: cirq.CCNOT and cirq.TOFFOLI.