Controlled-NOT gate
| Identifier | Operator | Example statement |
|---|---|---|
| CNOT | \(CNOT\) | CNOT q[0], q[1] |
Description
The controlled-NOT, or CNOT, gate is a two-qubit gate. It performs an X gate on the second qubit, conditional on the state of the first qubit. The first qubit is usually referred to as the control qubit and the second qubit as the target qubit.
In the standard computational basis for two qubits \(\{|00\rangle ,|01\rangle \,|10\rangle ,|11\rangle \}\) , the CNOT gate:
- leaves the control qubit unchanged,
- performs an X gate on the target qubit, when the control qubit is in state \(|1\rangle\),
- leaves the target qubit unchanged, when the control qubit is in state \(|0\rangle\).
Note
The notion of a control qubit and a target qubit (for any controlled operation) only holds for the standard computational basis. Generally, in another basis, all states could be affected.
Aliases
Also known as controlled-X, CX, or controlled bit-flip gate.
Properties
- Clifford gate;
- Involutory operation (its own inverse);
- Controlled gate;
- Perfect Entangler (maximally entangles specific product states);
- Maximum Entangling Power over all uniformly random product states;
- Ising gate.
Representation
which is equal to:
Operation examples
Standard basis
Qubit state ordering convention and matrix representation
Note that qubits in a ket are ordered with qubit indices decreasing from left to right, i.e.,
Note that for matrices a reversed basis ordering convention is adopted, as is done in most textbooks. For instance, in the case of a two-qubit control gate, the matrix is represented such that \(q_0\) is the control qubit and \(q_1\) is the target qubit; the state on which the matrix is applied should then effectively be written as \(|q_0\rangle \otimes |q_1\rangle\).