  Quantum entanglement is essential to the development of quantum computation,
communications, and technology. The controlled SWAP test, widely used for state
comparison, can be adapted to an efficient and useful test for entanglement of
a pure state. Here we show that the test can evidence the presence of
entanglement (and further, genuine n-qubit entanglement), can distinguish
entanglement classes, and that the concurrence of a two-qubit state is related
to the test's output probabilities. We also propose a multipartite measure of
entanglement that acts similarly for n-qubit states. The number of copies
required to detect entanglement decreases for larger systems, to four on
average for many (n>8) qubits for maximally entangled states. For non-maximally
entangled states, the average number of copies of the test state required to
detect entanglement increases with decreasing entanglement. Furthermore, the
results are robust to second order when typical small errors are introduced to
the state under investigation.
