Table of Contents

CCZ gate (Controlled-Controlled-Z)

CCZ (Controlled-Controlled-Z or Doubly-Controlled-Z) is a three-qubit gate: applies a phase to the target qubit if both control qubits are $|1\rangle$. Like CZ but doubly-controlled, it is symmetric in all three qubits and less commonly used than CCX on most platforms.

Action: $|c_1 c_2 t\rangle \to (-1)^{c_1 c_2 t}|c_1 c_2 t\rangle$ where only the $|111\rangle$ state gets a $-1$ phase.

$$\text{CCZ} = \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & -1 \end{pmatrix}$$

Basis state mapping: identity on all states except $|111\rangle$. Maps $|111\rangle \to -|111\rangle$.

Properties

Uses

Decomposition

CCZ can be decomposed using CCX and Hadamard gates:

$$\text{CCZ} = (I \otimes I \otimes H) \text{CCX} (I \otimes I \otimes H)$$

Alternatively, decompose into CX/CZ chains. Gate count: two Hadamard gates and one CCX, or ~6 CX gates.

Parametric version

Implementation

Relations