SetDirectory["/www/user/fdahl/papers/Conjugation/"];
<<kappaLib.m
<<Petrov.m

Class XXI: (321)

B=(({{0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0}}));

V=(({{ lam1, 1, 0, 0, 0, 0}, {0, lam1, 1, 0, 0, 0}, {0, 0, lam1, 0, 0, 0}, {0, 0, 0, lam2, 1, 0}, {0, 0, 0, 0,  lam2, 0}, {0, 0, 0, 0, 0,  lam3}}));

Eigenvalues[V]

W=(({{0, 0, eps1, 0, 0, 0}, {0, eps1, 0, 0, 0, 0}, {eps1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, eps2, 0}, {0, 0, 0, eps2, 0, 0}, {0, 0, 0, 0, 0, eps3}}));

Possible choices for eps_i:

Eigenvalues[W]

s[i_]:=(-1)^i

For[i1=0,i1≤1,i1++,
For[i2=0,i2≤1,i2++,
For[i3=0,i3≤1,i3++,
Print[ToString[{s[i1],s[i2],s[i3]}]];
Print[Sort[Eigenvalues[W]/.{eps1->s[i1],eps2->s[i2],eps3->s[i3]}]];
]
]
]

4 sign possibilities: (e1,e2,e3)= {++-, +--, -++, --+}

W=W/.{eps3->-eps1};
W//MatrixForm
Eigenvalues[W]

(* Found using FindSPermutations.m *)
S=(({{0, 0, 0, eps2, 0, 0}, {1, 0, 0, 0, 0, 0}, {0, (1/(Sqrt[2])), 0, 0, 0, -(1/(Sqrt[2]))}, {0, 0, 0, 0, 1, 0}, {0, 0, eps1, 0, 0, 0}, {0, (eps1/(Sqrt[2])), 0, 0, 0, (eps1/(Sqrt[2]))}}));

Note: S does not depend on eps3 since we always have eps3 = -eps1.

Check that S is in the set mathcal(S)

Transpose[S].B.S==W

Compute result

res=Simplify[S.V.Inverse[S]];
res//MatrixForm

Petrov[res]

Export notebook as .pdf

NotebookPrint[SelectedNotebook[],"/www/user/fdahl/papers/Conjugation/notebooks/ClassXXI.pdf"]