  We investigate how to determine whether the states of a set of quantum
systems are identical or not. This paper treats both error-free comparison, and
comparison where errors in the result are allowed. Error-free comparison means
that we aim to obtain definite answers, which are known to be correct, as often
as possible. In general, we will have to accept also inconclusive results,
giving no information. To obtain a definite answer that the states of the
systems are not identical is always possible, whereas, in the situation
considered here, a definite answer that they are identical will not be
possible. The optimal universal error-free comparison strategy is a projection
onto the totally symmetric and the different non-symmetric subspaces, invariant
under permutations and unitary transformations. We also show how to construct
optimal comparison strategies when allowing for some errors in the result,
minimising either the error probability, or the average cost of making an
error. We point out that it is possible to realise universal error-free
comparison strategies using only linear elements and particle detectors, albeit
with less than ideal efficiency. Also minimum-error and minimum-cost strategies
may sometimes be realised in this way. This is of great significance for
practical applications of quantum comparison.
