  We provide a feasible necessary and sufficient condition for when an unknown
quantum operation (quantum device) secretely selected from a set of known
quantum operations can be identified perfectly within a finite number of
queries, and thus complete the characterization of the perfect
distinguishability of quantum operations. We further design an optimal protocol
which can achieve the perfect discrimination between two quantum operations by
a minimal number of queries. Interestingly, employing the techniques from the
theory of $q$-numerical range we find that an optimal perfect discrimination
between two isometries is always achievable without using auxiliary systems or
entanglement.
