SetDirectory[NotebookDirectory[]];

矩阵构建

ClearAll["`*"]
v=1;
i=PauliMatrix[0];x=PauliMatrix[1];y=PauliMatrix[2];z=PauliMatrix[3];
g1=KroneckerProduct[x,x];g2=KroneckerProduct[x,y];g3=KroneckerProduct[x,z];
g4=KroneckerProduct[y,i];g5=KroneckerProduct[z,i];
g13=1/(2I)(g1.g3-g3.g1);g12=1/(2I)(g1.g2-g2.g1);
U[ϕ_,θ_]:=MatrixExp[I g13 θ/2].MatrixExp[I g12 ϕ/2](*旋转矩阵*)
H=v(kx g1+ky g2-kz g3)+(m01+m1/2((kx^2)+(ky^2))-m2/2(kz^2))g5;(*正常态哈密顿量*)

coor2=U[ϕ,θ].H.FullSimplify[ConjugateTranspose[U[ϕ,θ]],Assumptions->Element[ϕ,Reals]&&Element[θ,Reals]];(*坐标变换矩阵*)
(*coorTF=FullSimplify[tranForm,Assumptions->Element[ϕ,Reals]&&Element[θ,Reals]];(*符号化简变换矩阵*)
coorTFCC=FullSimplify[FullSimplify[ConjugateTranspose[coorTF],Assumptions->Element[ϕ,Reals]&&Element[θ,Reals]],Assumptions->Element[ϕ,Reals]&&Element[θ,Reals]];(*符号化简变换矩阵的幺正形式*)

coor2=coorTF.H.coorTFCC;*)
HTr=FullSimplify[coor2,Assumptions->Element[ϕ,Reals]&&Element[θ,Reals]&&Element[m01,Reals]&&Element[m1,Reals]&&Element[m2,Reals]];

MatrixForm[g3]
HTr[[1]][[3]]//Expand(*验证g3这一项的正确性*)

坐标变化((Subscript[k, 3])-->G3)

nvec=Transpose[{{Sin[θ]Cos[ϕ],Sin[θ]Sin[ϕ],Cos[θ]}}];
kvec={{kx,ky,kz}};
k3=kvec.nvec//Flatten(*k3在文章中表达式*)

坐标变化(G5)

MatrixForm[g5]
HTr[[1]][[1]]

欧拉转动矩阵

ClearAll["`*"]
eulerAng=EulerMatrix[{0,-ϕ,-θ}];(*欧拉角转动*)
kvec1=Transpose[{{(Subscript[k, x]),(Subscript[k, y]),(Subscript[k, z])}}];
{k11,k22,k33}=Flatten[eulerAng.kvec1];(*通过欧拉角转动计算任意角度转动的坐标((Subscript[k, 1]),(Subscript[k, 2]),(Subscript[k, 3]))*)
kvec2=Transpose[{{k1,k2,k3}}];
{kx,ky,kz}=FullSimplify[Inverse[eulerAng].kvec2]//Flatten;
re=TrigReduce@Expand[(m01+(1/2) (((kx^2)+(ky^2)) m1-(kz^2) m2))]
Collect[re,(k1^2)][[1]](*计算(6)中m1~*)

Simplify[1+Cos[2ϕ]]
Simplify[1-Cos[2ϕ]]

Collect[re,k3*k1][[2]](*计算(6)中m13*)

Collect[re,(k2^2)][[1]](*计算(6)中m1/2*)

补充计算

ClearAll["`*"]
i=PauliMatrix[0];x=PauliMatrix[1];y=PauliMatrix[2];z=PauliMatrix[3];
g1=KroneckerProduct[x,x];
g2=KroneckerProduct[x,y];
g3=KroneckerProduct[x,z];
g5=KroneckerProduct[z,i];
g13=(1/(2I))(g1.g3-g3.g1);
g12=(1/(2I))(g1.g2-g2.g1);
rot=MatrixExp[I (θ/2)g13].MatrixExp[I (ϕ/2)g12];
Rot[mat_]:=FullSimplify[rot.mat.ConjugateTranspose[rot],Assumptions->Element[ϕ,Reals]&&Element[θ,Reals]]

H1=kx Rot[g1] + ky Rot[g2]-kz Rot[g3];
H1[[1,4]]
H1[[1,3]]
g3//MatrixForm
g13//MatrixForm
KroneckerProduct[i,y]//MatrixForm
g12//MatrixForm
KroneckerProduct[i,z]//MatrixForm

Rot[g5]//MatrixForm
g5//MatrixForm

ki={kx,ky,kz}/.Flatten@Solve[k1==kx Cos[θ]Cos[ϕ]+ky Cos[θ]Sin[ϕ]-kz Sin[θ]&&k2==-kx Sin[ϕ]+ky Cos[ϕ]&&k3==kx Cos[ϕ]Sin[θ]+ky Sin[θ]Sin[ϕ]+kz Cos[θ],{kx,ky,kz}]//FullSimplify

m1/2(ki[[1]]^2+ki[[2]]^2)-m2/2ki[[3]]^2//Expand//FullSimplify

1+Cos[2θ]//FullSimplify
1-Cos[2θ]//FullSimplify
Cos[Pi+a]

ki[[1]]^2+ki[[2]]^2//FullSimplify

Spin Rotation2

ClearAll["`*"]
i=PauliMatrix[0];x=PauliMatrix[1];y=PauliMatrix[2];z=PauliMatrix[3];
g1=KroneckerProduct[x,x];
g2=KroneckerProduct[x,y];
g3=KroneckerProduct[x,z];
g5=KroneckerProduct[z,i];
g13=(1/(2I))(g1.g3-g3.g1);
g12=(1/(2I))(g1.g2-g2.g1);
rot=MatrixExp[-I (θ/2)g13].MatrixExp[I (ϕ/2)g12];(*转动方向填个负号，计算结果表明这个负号对最终的结果是没有影响的*)
Rot[mat_]:=FullSimplify[rot.mat.ConjugateTranspose[rot],Assumptions->Element[ϕ,Reals]&&Element[θ,Reals]]

H1=kx Rot[g1] + ky Rot[g2]-kz Rot[g3];
H1[[1,4]]
H1[[1,3]]
g1//MatrixForm
g2//MatrixForm
g3//MatrixForm

Rot[g5]//MatrixForm
g5//MatrixForm

ki={kx,ky,kz}/.Flatten@Solve[k1==kx Cos[θ]Cos[ϕ]+ky Cos[θ]Sin[ϕ]+kz Sin[θ]&&k2==-kx Sin[ϕ]+ky Cos[ϕ]&&k3==-kx Cos[ϕ]Sin[θ]-ky Sin[θ]Sin[ϕ]+kz Cos[θ],{kx,ky,kz}]//FullSimplify

m1/2(ki[[1]]^2+ki[[2]]^2)-m2/2ki[[3]]^2//Expand//FullSimplify

1+Cos[2θ]//FullSimplify
1-Cos[2θ]//FullSimplify

Solve[d0+2d1-d1(((m0-2m1+m2))/(m2 Cos[θ]^2-m1 Sin[θ]^2))Sin[θ]^2==0,θ]

d0+2d1-d1(((m0-2m1+m2))/(m2 Cos[θ]^2-m1 Sin[θ]^2))Sin[θ]^2//FullSimplify

Cos[θ]/Sin[θ]

Plot[Cot[x],{x,-Pi,Pi}]