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

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, 0, 0}, {0, 0, 0, 0,  sigma1, tau1}, {0, 0, 0, 0, -tau1,  sigma1}}));

W=(({{0, 0, eps1, 0, 0, 0}, {0, eps1, 0, 0, 0, 0}, {eps1, 0, 0, 0, 0, 0}, {0, 0, 0, eps2, 0, 0}, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 1, 0}}))/.{eps2->-eps1};

Solve S-matrix manually for metaclass XXII

petrovTarget =(({{-tau1, 0, 0, 0, 0, sigma1}, {0, 0, (eps1/(Sqrt[2])), (1/(Sqrt[2])), lam1, 0}, {0, (eps1/(Sqrt[2])), eps1((lam1-lam2)/2), ((lam1+lam2)/2), 0, 0}, {0, (1/(Sqrt[2])), ((lam1+lam2)/2), eps1((lam1-lam2)/2), 0, 0}, {0, lam1, 0, 0, 0, 0}, {sigma1, 0, 0, 0, 0, tau1}}));mat=Table[ToExpression["x"<>ToString[i]<>ToString[j]],{i,1,6},{j,1,6}];
Petrov[mat]
j3=Flatten[(({{x14, x15, x16, x13, x12, x11}, {x24, x25, x26, x23, x22, x21}, {x34, x35, x36, x33, x32, x31}, {x64, x65, x66, x63, x62, x61}, {x54, x55, x56, x53, x52, x51}, {x44, x45, x46, x43, x42, x41}}))-petrovTarget];
eqs=Table[j3[[i]]==0,{i,1,Length[j3]}];
sol=Solve[eqs,Variables[mat]];
mat = mat//.sol[[1]];

mat//MatrixForm

S=Table[ToExpression["s"<>ToString[i]<>ToString[j]],{i,1,6},{j,1,6}];
j1=Flatten[Transpose[S].B.S-W];
j2=Flatten[mat.S-S.V];

exp=Join[j1,j2];

sub={s51->0,s52->0,s54->0,s16->s45,s15->-s46,s31->-eps1 s61,s61->0,s62->eps1 s32,s64->-eps1 s34,s56->0,s55->0,s41->0,s11->0,s35->0,s36->0,s46->0,s65->0,s12->0,s42->0,s66->0,s14->0,s44->0,s43->0,s13->0,s25->0,s26->0,s24->0,s45->1,s21->1,s53->eps1,s32->1/Sqrt[2],s63->eps1 s33,s22->-Sqrt[2] s33,s33->0,s23->0,s34->1/Sqrt[2]};
Simplify[Sort[Union[exp//.sub],emSize[#1]≤ emSize[#2]&]]//MatrixForm
Simplify[S//.sub ]//MatrixForm

(* export .pdf *)
NotebookPrint[SelectedNotebook[],"/www/user/fdahl/papers/Conjugation/notebooks/ClassXXII_Solve.pdf"]