Standard reference for gate matrices, the Clifford/non-Clifford distinction, and controlled-gate constructions used throughout this record.
doi.org/10.1017/cbo9780511976667 ↗CCZ (doubly-controlled Z) gate
The phase-only sibling of the Toffoli gate that applies a -1 phase exactly when all three qubits are |1⟩, symmetric in all three qubits and the natural three-qubit generalization of CZ.
Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.
CCZ matters wherever Grover-style diffusion or oracle marking needs a symmetric multi-controlled phase rather than a bit flip: because it treats all three qubits identically, it composes more transparently into larger multi-controlled-phase constructions than Toffoli does.
Circuit & simulation
What this takes and returns
Takes3 qubitsWhat joins here
Takes a 3-qubit register and states no assumption about what is on it. That is the whole condition: anything returning 3 qubits can feed it.
3 entries meet this end · 1 entry lines up on shape, composition unverified. Named below.
Returns3 qubitsWhat joins here
Returns a 3-qubit register a next stage can take. This is the end that joins.
2 entries meet this end · 14 entries line up on shape, composition unverified. Named below.
A unitary. The same register goes in and comes out, and this entry states no assumption about what is on it — which is what lets anything of the same width feed it. See all 29 →
The widths and types line up. What is not established is everything a width does not carry — the basis convention, the normalisation, the state each was written to start from — so this is not a claim that the two compose.
How it works
Definition
As an diagonal matrix, in the ordered basis — the identity everywhere except a sign flip on .
Action on basis states and symmetry
Only picks up a phase; the other seven computational-basis states are completely unaffected. Because the matrix is symmetric under any permutation of the three qubits, has no distinguished "target" — unlike Toffoli, where swapping the target with a control changes the gate.
Decomposition
exactly mirroring the two-qubit identity : conjugating the Toffoli's target by Hadamard converts its controlled bit-flip ( on the control-11 block) into a controlled phase-flip ( on that same block), leaving the control-not-both-1 blocks at identity in both cases.
Key identities
- : applying the same doubly-controlled phase twice restores the input.
- is non-Clifford, exactly like Toffoli: it inherits the same resource cost (6 CNOT + 2 H + 7 T-family gates, via the Toffoli decomposition sandwiched by the extra pair of target Hadamards, which cancel two of Toffoli's own Hadamards).
- is the natural building block for multi-controlled-phase oracles in amplitude amplification and Grover-style search, since its full symmetry across all three qubits makes larger constructions compose more uniformly than ones.
Implementation
OPENQASM 3.0;
include "stdgates.inc";
qubit[3] q;
x q[0];
x q[1];
x q[2];
h q[2];
ccx q[0], q[1], q[2];
h q[2];Quantum vs classical
Classical baseline
Use a classical state-vector or matrix simulation at the same width, precision, and measurement objective.
Quantum claim
The quantum record demonstrates a state or operator behavior; it does not make classical simulation or communication costs disappear.
How to compare
Compare fidelity, samples, gate depth, noise, memory, and the cost of preparing and reading the state.
Declared gaps
Nobody has reviewed this record for gaps yet.
Literature & references
Defines the standard gate library (id, sdg, tdg, cy, crz, rxx, rzz, ccx, cx…) used natively by the code snippets on this record.
arxiv.org/abs/2104.14722 ↗