CCP applies phase $e^{i\theta}$ to the target if both controls are $|1\rangle$. Parametric doubly-controlled gate for phase estimation and variational algorithms.
Action: $|c_1 c_2 t\rangle \to e^{i c_1 c_2 \theta}|c_1 c_2 t\rangle$ where phase is applied only when both controls are $|1\rangle$.
$$\text{CCP}(\theta) = \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 & e^{i\theta} \end{pmatrix}$$
Basis state mapping: identity on all states except $|111\rangle$. Maps $|111\rangle \to e^{i\theta}|111\rangle$.
CCP can be decomposed using CCZ and single-qubit phase gates:
$$\text{CCP}(\theta) = (I \otimes I \otimes R_Z(\theta/2)) \text{CCZ}^{1/2} (I \otimes I \otimes R_Z(\theta/2))$$
Alternatively, decompose directly into CX/phase gate chains.