  Key to realising quantum computers is minimising the resources required to
build logic gates into useful processing circuits. While the salient features
of a quantum computer have been shown in proof-of-principle experiments,
difficulties in scaling quantum systems have made more complex operations
intractable. This is exemplified in the classical Fredkin (controlled-SWAP)
gate for which, despite theoretical proposals, no quantum analogue has been
realised. By adding control to the SWAP unitary, we use photonic qubit logic to
demonstrate the first quantum Fredkin gate, which promises many applications in
quantum information and measurement. We implement example algorithms and
generate the highest-fidelity three-photon GHZ states to-date. The technique we
use allows one to add a control operation to a black-box unitary, something
impossible in the standard circuit model. Our experiment represents the first
use of this technique to control a two-qubit operation and paves the way for
larger controlled circuits to be realised efficiently.
