  We give a test that can distinguish efficiently between product states of n
quantum systems and states which are far from product. If applied to a state
psi whose maximum overlap with a product state is 1-epsilon, the test passes
with probability 1-Theta(epsilon), regardless of n or the local dimensions of
the individual systems. The test uses two copies of psi. We prove correctness
of this test as a special case of a more general result regarding stability of
maximum output purity of the depolarising channel. A key application of the
test is to quantum Merlin-Arthur games with multiple Merlins, where we obtain
several structural results that had been previously conjectured, including the
fact that efficient soundness amplification is possible and that two Merlins
can simulate many Merlins: QMA(k)=QMA(2) for k>=2. Building on a previous
result of Aaronson et al, this implies that there is an efficient quantum
algorithm to verify 3-SAT with constant soundness, given two unentangled proofs
of O(sqrt(n) polylog(n)) qubits. We also show how QMA(2) with log-sized proofs
is equivalent to a large number of problems, some related to quantum
information (such as testing separability of mixed states) as well as problems
without any apparent connection to quantum mechanics (such as computing
injective tensor norms of 3-index tensors). As a consequence, we obtain many
hardness-of-approximation results, as well as potential algorithmic
applications of methods for approximating QMA(2) acceptance probabilities.
Finally, our test can also be used to construct an efficient test for
determining whether a unitary operator is a tensor product, which is a
generalisation of classical linearity testing.
