We have a two sets of vectors ($\mathbb{C}^d$), $A=\{ v\_1, \ldots v\_n\}$ and $B=\{u\_1, \ldots u\_n\}$.


The question is if there is an efficient solution (polynomial in $n$) for checking whether $A$ and $B$ are related by an unitary rotation, i.e. if there exists an $U\in \text{U}(d)$ and a permutation $\sigma$, such that for every $i$ 
$$u\_i = U v\_{\sigma(i)}.$$


Notes:


If it simplifies the task, I'm interested in $d=2$. (Or equivalently, $d=3$ for real vectors.)


I have been tying using Gram matrices for $A$ and $B$, however in a general case there are problems with sorting entries, so that one could compare.



Sets of vectors related by a rotation
Since $d$ is small, you can do the following.


Choose a maximal linearly independed system $A'$ in $A$.
Consider all maps $A'\to B$ (since $|A'|\le d$, there are roughly $n^d$ of them).
For each check if it extends to a rotation.


