  The optimal cost of a three-qubit Fredkin gate is 5 two-qubit entangling
gates, and the overhead climbs to 8 when restricted to controlled-not (CNOT)
gates. By harnessing higher-dimensional Hilbert spaces, we reduce the cost of a
three-qubit Fredkin gate from 8 CNOTs to 5 nearest-neighbor CNOTs. We also
present construction of an n-control-qubit Fredkin gate with 2n+3 CNOTs and 2n
single-qudit operations. Finally, we design deterministic and nondeterministic
three-qubit Fredkin gates in photonic architectures. The cost of a
nondeterministic three-qubit Fredkin gate is further reduced to 4
nearest-neighbor CNOTs, and the success of such a gate is heralded by a
single-photon detector. Our insights bridge the gap between the theoretical
lower bound and the current best result for the n-qubit quantum computation.
