  Suppose two quantum circuit chips are located at different places, for which
we do not have any prior knowledge, and cannot see the internal structures
either. If we want to find out whether they have the same functions or not with
certainty, what should we do? In this paper, we show that this realistic
problem can be solved completely from the viewpoints of quantum nonlocality.
Specifically, we design an elegant protocol that examines underlying quantum
nonlocality, where the strongest nonlocality can be observed if and only if two
quantum circuits are equivalent to each other. We show that the protocol also
works approximately, where the distance between two quantum circuits can be
calculated accurately by observed quantum nonlocality in an analytical manner.
Furthermore, it turns out that the computational cost of our protocol is
independent in the size of compared quantum circuits. Lastly, we also discuss
the possibility to generalize the protocol to multipartite cases, i.e., if we
do equivalence checking for multiple quantum circuits, we try to solve the
problem in one go.
