Computing Library › Quantum Logic Gates
Quantum Logic Gates
CZ Gate (Controlled-Z)
The CZ gate applies a phase flip to |11⟩ — a symmetric, entangling gate that is native to many hardware platforms.
Matrix
Unitary matrix
100001000010000−1
Circuit symbol
Action on basis states
| input | output |
|---|---|
| |00⟩ | |00⟩ |
| |01⟩ | |01⟩ |
| |10⟩ | |10⟩ |
| |11⟩ | −|11⟩ |
How it works
CZ is symmetric in its two qubits and diagonal, so it commutes cleanly and maps to CNOT via a Hadamard on the target. It is the entangling gate of measurement-based (cluster-state) quantum computing and a common native two-qubit gate.
In code (Qiskit)
python
qc = QuantumCircuit(2)
qc.cz(0, 1)
two-qubitCliffordentanglingsymmetric