In a compact connected Lie group $G$, each element is conjugate to an element of a maximal torus $T$. For a classical group, one can pick a basis of the tautological representation such that $T$ is represented by diagonal matrices. The conjugacy classes in $G$ are in bijective correspondence with the orbits of the Weyl group $W$ on $T$. Thus, say, for $\operatorname{SU}(n)$ the conjugacy class of a unitary matrix $g$ is determined by its (unordered) eigenvalues, and the same holds for $\operatorname{SO}(2n+1)$.


For $\operatorname{SO}(2n)$, the torus $T$ can be represented by matrices $\operatorname{diag}(\gamma\_1,\dotsc,\gamma\_n,\gamma\_n^{-1},\ldots,\gamma\_1^{-1})$, and $W$ acts by permutations on $\gamma\_1,\dotsc,\gamma\_n$ and an *even* number of changes $\gamma\_i\leftrightarrow\gamma\_i^{-1}$ (contrary to $\operatorname{SO}(2n+1)$, where an arbitrary number of switches can be done, by virtue of an extra eigenvalue $1$). Thus the eigenvalues alone determine a pair of conjugacy classes which differ by one switch.



> 
> **Q:** How, given a matrix $g\in\operatorname{SO}(2n)$, to determine the corresponding element of the torus $T$?
> 
> 
> 


It can be done by diagonalizing $g$ by a matrix $C$ and checking whether $\det(C)=1$ or $-1$, but I was hoping for a more efficient solution (calculating the eigenvalues of $g$ is faster then finding $C$). Are there any other invariants which can, given the eigenvalues $\gamma\_1,\dotsc,\gamma\_n,\gamma\_n^{-1},\dotsc,\gamma\_1^{-1}$ of $g$, tell whether $g$ is conjugate to $\operatorname{diag}(\gamma\_1,\dotsc,\gamma\_n,\gamma\_n^{-1},\dotsc,\gamma\_1^{-1})$ or to $\operatorname{diag}(\gamma\_1^{-1},\gamma\_2,\dotsc,\gamma\_n,\gamma\_n^{-1},\dotsc,\gamma\_2^{-1},\gamma\_1)$?



How to distinguish conjugacy classes in SO(2n) efficiently?
One method, I don't know whether it is the most efficient, is to compute the following polynomial quantity $Q(g) = \mathrm{Pf}(g-g^t)$ for $g\in\mathrm{SO}(2n)$, where $g^t$ means the transpose of $g$ and $\mathrm{Pf}$, known as the *Pfaffian*, is a polynomial of degree $n$ on the skew-symmetric $2n$-by-$2n$ matrices that satisfies $\det(S) = \mathrm{Pf}(S)^2$ for skew-symmetric $2n$-by-$2n$ matrices.


This polynomial satisfies $Q(CgC^{-1}) = \det(C)\,Q(g)$ for $C$ in $\mathrm{O}(2n)$, so it takes different values on two elements of $\mathrm{SO}(2n)$ that are conjugate in $\mathrm{O}(2n)$ but not in $\mathrm{SO}(2n)$. (Also, if $Q(g)=0$, then the conjugacy class of $g$ in $\mathrm{SO}(2n)$ is the same as its conjugacy class in $\mathrm{O}(2n)$.)


