Fredkin gate Created 2026-09-25 Updated 2026-11-05
The Fredkin gate, or Controlled-SWAP gate, exchanges two target qubits exactly when its control qubit is one.
Every Fredkin gate preserves the Hamming weight of a computational-basis string, so any network of these gates does too. A Toffoli gate maps to and hence cannot equal such a network on the same three wires. Fixed ancillas returned unchanged do not remove the obstruction. Extra encoded outputs or input-dependent garbage change the resource model and do not by themselves implement the same clean coherent three-qubit gate.
Use the time-ordered network , , . On bits its successive values areThus the network exchanges the two computational-basis states. Since the gates are linear, this basis proof also establishes SWAP gate on arbitrary quantum states.
The Bell states and obeyThe antisymmetric spin singlet state alone has eigenvalue . Its standalone sign is a global phase; a Fredkin gate can make that sign observable relative to the control branch, as in part d.
Three controlled-X gates for SWAP, and two decompositions of the Fredkin gate
. Details. Control all three CNOTs of the SWAP gate decomposition by qubit 1. This gives, in temporal order,When the first qubit is 0, all three Toffoli gates do nothing. When it is 1, the three lower-wire CNOTs implement SWAP gate. The middle panel of the original diagram shows this controlled network.
Only one Toffoli gate is actually needed. An equivalent circuit isFor input , the first gate forms on wire 2. The second changes wire 3 to , and the final gate gives wire 2 the value . For this is ; for it is . The last panel displays the circuit.
The Hamming-weight obstruction to Fredkin-only Toffoli synthesis means that a network of Fredkin gates alone cannot implement a Toffoli gate on the same three wires: each Fredkin gate preserves computational-basis Hamming weight, whereas Toffoli gate maps to . The same obstruction holds if fixed ancillary bits must be returned unchanged. Conservative classical computation can use extra encoded wires and input-dependent garbage, but that is not an ancilla-free coherent three-qubit Toffoli gate operation. The resources and output encoding would need to be specified before making a different universality claim.
Use basis order , with the ancilla first, and put , . Initially the ancilla is at the north pole of the Bloch sphere. The other two qubits lie on its equator at azimuths , with Bloch vectors .
The four dotted cuts, in left-to-right order, have the explicit normalized vectorsThe first Hadamard gate copies the lower-register amplitudes into two control branches; the Fredkin gate exchanges them only in the second branch; the final Hadamard gate adds and subtracts these branches.
Summing the squared magnitudes of the first four entries of givesMeanwhile , soIdentical input qubits give ; orthogonal equatorial inputs give . The factor one half is an ancilla-interference effect, not a direct projective measurement of the lower qubits individually.
Allow clean workspace bits, as in standard reversible computation. Boolean algebra expresses any Boolean function as XORs of ANDs and constants. A Toffoli gate maps to , so an initially zero target computes an AND without erasing the inputs. A CNOT gate accumulates XORs, and a NOT gate supplies complemented bits or constants. Intermediate products can be computed into workspace, XORed into an output, and then uncomputed by reversing the workspace computation. This realizes the reversible embedding for any Boolean function and, with reversible clean-up, universal reversible classical computation.
The Fredkin transformation has control and targets . A network of three gates, shown in i, iswhere the sequence is executed left to right. After the first gate ; after the second ; and the last gives . If , ; if , . Thus the circuit is exactly a Fredkin gate.
The workspace qualification matters for the unrestricted universality claim. On four or more wires, every embedded NOT, CNOT and Toffoli gate is an even permutation of all computational states. Without ancillary wires they cannot implement, for example, a permutation swapping just and while fixing the other four-bit strings. Clean ancillas remove this obstruction on the designated input subspace.
Past exam of the mathematics course of the University of Cambridge 2024 iii Paper 324 4 a Solution 2026-09-25
First construct a controlled unitary gate from the uncontrolled oracle. Keep the supplied in a reference register. Controlled on an extra qubit, swap the data and reference registers, query on the register that contains in one branch, and swap back. Because , that branch is unchanged, while the other branch acquires on the data. Reversing the control convention with Pauli X gates gives controlled-. The reference state is returned unchanged, and each use costs one query to and controlled-SWAP gates.
Expand in an eigenbasis of . Exact quantum phase estimation with an -qubit phase register producesApply the available phase gates, controlled by the corresponding bits of , to multiply branch byThen reverse phase estimation. Although no oracle was supplied, every eigenvalue obeys , so . The inverse controlled powers can therefore be implemented with forward calls to . Since , phase estimation and its inverse use only queries. The phase register returns to , while the data register isAs a direct check, the same spectral promise implies .
Swap test Created 2026-09-24 Updated 2026-11-05
The swap test estimates the overlap of two pure states without requiring their classical descriptions. Prepare an auxiliary qubit in , apply a Hadamard gate, a Fredkin gate controlled by that auxiliary qubit, and another Hadamard gate. Then measure the auxiliary qubit in the computational basis.
For target states , the auxiliary-zero branch has unnormalized target vector . Its squared norm is thereforeIdentical pure states give , while pure states with zero inner product give . A single zero outcome does not certify equality; repeated trials estimate the probability. The calculation is a direct projection onto the symmetric target subspace using the SWAP gate.
