Quit[]

Quiet@Needs["MagneticTB`"];

Graphene

NonSOC

sgop=msgop[gray[191]];
init[
lattice->{{a,0,0},{-(a/2),(Sqrt[3] a)/2,0},{0,0,c}},
lattpar->{a->1,c->3},
wyckoffposition->{{{1/3,2/3,0},{0,0,0}}},
symminformation->sgop,
basisFunctions->{{"pz"}}];

ham=Sum[symham[n],{n,1,3}];MatrixForm[FullSimplify[ham]]

path={{{{0,0,0},{0,1/2,0}},{"Γ","M"}},{{{0,1/2,0},{1/3,1/3,0}},{"M","K"}},{{{1/3,1/3,0},{0,0,0}},{"K","Γ"}}};bandManipulate[path,20,ham]

bandplot[path,200,ham,{e1->0.05,r1->0.02,t1->0.5}]

hop[ham,{e1->0,r1->0.02`,r2->0,t1->0.5`}]

SOC

sgop=msgop[gray[191]];
init[
lattice->{{a,0,0},{-(a/2),(Sqrt[3] a)/2,0},{0,0,c}},
lattpar->{a->1,c->3},
wyckoffposition->{{{2/3,1/3,1/2},{0,0,0}}},
symminformation->sgop,
basisFunctions->{{"pzup","pzdn"}}];

hamsoc=Sum[symham[n],{n,1,3}];MatrixForm[FullSimplify[hamsoc]]

path={{{{0,0,0},{0,1/2,0}},{"Γ","M"}},{{{0,1/2,0},{1/3,1/3,0}},{"M","K"}},{{{1/3,1/3,0},{0,0,0}},{"K","Γ"}}};bandManipulate[path,20,hamsoc]

bandplot[path,200,hamsoc,{e1->0,r1->0.02,r2->0,t1->0.5}]

hop[hamsoc,{e1->0,r1->0.02`,r2->0,t1->0.5`}]

Graphene2

sgop=msgop[gray[191]];
init[
lattice->{{a,0,0},{-(a/2),(Sqrt[3] a)/2,0},{0,0,c}},
lattpar->{a->1,c->3},
wyckoffposition->{{{1/3,2/3,1/2},{2/3,1/3,1/2}}},(*BCS网站上面查到的Wyckoff position*)
symminformation->sgop,
basisFunctions->{{"pz"}}];

ham=Sum[symham[n],{n,1,3}];MatrixForm[FullSimplify[ham]]

path={{{{0,0,0},{0,1/2,0}},{"Γ","M"}},{{{0,1/2,0},{1/3,1/3,0}},{"M","K"}},{{{1/3,1/3,0},{0,0,0}},{"K","Γ"}}};bandManipulate[path,20,ham]

bandplot[path,200,ham,{e1->0.05,r1->0.02,t1->0.5}]

hop[ham,{e1->0,r1->0.02`,r2->0,t1->0.5`}]

Graphene3

sgop=msgop[gray[191]];
init[
lattice->{{a,0,0},{-(a/2),(Sqrt[3] a)/2,0},{0,0,c}},
lattpar->{a->1,c->3},
wyckoffposition->{{{2/3,1/3,1/2},{0,0,0}}},(*BCS网站上面查到的Wyckoff position*)
symminformation->sgop,
basisFunctions->{{"pz"}}];

ham=Sum[symham[n],{n,1,3}];MatrixForm[FullSimplify[ham]]

path={{{{0,0,0},{0,1/2,0}},{"Γ","M"}},{{{0,1/2,0},{1/3,1/3,0}},{"M","K"}},{{{1/3,1/3,0},{0,0,0}},{"K","Γ"}}};bandManipulate[path,20,ham]

bandplot[path,200,ham,{e1->0.05,r1->0.02,t1->0.5}]

hop[ham,{e1->0,r1->0.02`,r2->0,t1->0.5`}]

MoS2

不考虑自旋轨道耦合

sgop=msgop[gray[187]]

tran={{1,-1,0},{0,1,0},{0,0,1}};
sgoptr=MapAt[FullSimplify[tran.#.Inverse@tran]&,sgop,{;;,2}](*对每一个操作的形式进行一个tran的变化*)

init[
lattice->{{1,0,0},{(1/2),((Sqrt[3])/2),0},{0,0,100}},(*直接给丁晶格常数*)
lattpar->{},
wyckoffposition->{{{0,0,0},{0,0,0}}},
symminformation->sgoptr,
basisFunctions->{{"dz2","dxy","dx2-y2"}}];

mos2=Sum[symham[i,symmetryset->{9,11,13}],{i,{1,2}}];MatrixForm[ExpToTrig[mos2]]

mos2=Sum[symham[i,symmetryset->All],{i,2}];MatrixForm[ExpToTrig[mos2]]

mos2Liu=mos2/.Thread[{kx,ky,kz}->({kx,ky,kz}(2Pi)).Inverse@reclatt];
Expand@Simplify[ExpToTrig@mos2Liu/.{kx->2α,ky->2/(Sqrt[3]) β,t1->T0,t4->T2,t2->T1,t3->T11,t6->T22,t5->T12}]//MatrixForm

path={{{{0,0,0},{(2/3),(1/3),0}},{"Γ","K"}},{{{(2/3),(1/3),0},{(1/2),(1/2),0}},{"K","M"}},{{{(1/2),(1/2),0},{0,0,0}},{"M","Γ"}}};
bandplot[path,100,mos2,{e1->1.046,e2->2.104,t1->-0.184,t2-> 0.401,t4-> 0.507,t3-> 0.218,t5-> 0.338,t6-> 0.057}]

考虑自旋轨道耦合

init[
lattice->{{1,0,0},{(1/2),((Sqrt[3])/2),0},{0,0,100}},
lattpar->{},
wyckoffposition->{{{0,0,0},{0,0,0}}},
symminformation->sgoptr,
basisFunctions->{{"dz2up","dxyup","dx2-y2up","dz2dn","dxydn","dx2-y2dn"}}];
mos2soc=Quiet@Sum[symham[i,symmetryset->{9,11,13}],{i,1}];MatrixForm[ExpToTrig[mos2soc]]

mos2soc=Sum[symham[i,symmetryset->{9,11,13}],{i,{1,2}}];MatrixForm[ExpToTrig[mos2]]

mos2soc=Sum[symham[i,symmetryset->All],{i,{1,2}}];MatrixForm[ExpToTrig[mos2]]

path={{{{0,0,0},{(2/3),(1/3),0}},{"Γ","K"}},{{{(2/3),(1/3),0},{(1/2),(1/2),0}},{"K","M"}},{{{(1/2),(1/2),0},{0,0,0}},{"M","Γ"}}};
bandplot[path,100,mos2,{e1->1.046,e2->2.104,t1->-0.184,t2-> 0.401,t4-> 0.507,t3-> 0.218,t5-> 0.338,t6-> 0.057}]

Magnetic C-3 Weyl point

sgop=msgop[bnsdict[{143,3}]];
init[lattice->{{((Sqrt[3])/2),-(( 1)/2),0},{0,1,0},{0,0,2}},
lattpar->{},
wyckoffposition->{{{0,0,0},{0,0,1}}},
symminformation->sgop,
basisFunctions->{{{x+ I y,0},{0,x- I y}}}];
c3w=Sum[symham[i],{i,{2,4}}];
c3w2band=Table[c3w[[i,j]],{i,{1,4}},{j,{1,4}}];

path={{{{0,0,0},{(1/2),0,0}},{"\\Gamma","M"}},{{{(1/2),0,0},{(1/3),(1/3),0}},{"M","K"}},{{{(1/3),(1/3),0},{0,0,0}},{"K","\\Gamma"}},{{{0,0,0},{0,0,(1/2)}},{"\\Gamma","A"}},{{{0,0,(1/2)},{(1/2),0,(1/2)}},{"A","L"}},{{{(1/2),0,(1/2)},{(1/3),(1/3),(1/2)}},{"L","H"}},{{{(1/3),(1/3),(1/2)},{0,0,(1/2)}},{"H","A"}},{{{(1/2),0,(1/2)},{(1/2),0,0}},{"L","M"}},{{{(1/3),(1/3),0},{(1/3),(1/3),(1/2)}},{"K","H"}}};bandManipulate[path,20,c3w2band]

path={{{{0,0,0},{(1/2),0,0}},{"\\Gamma","M"}},{{{(1/2),0,0},{(1/3),(1/3),0}},{"M","K"}},{{{(1/3),(1/3),0},{0,0,0}},{"K","\\Gamma"}},{{{0,0,0},{0,0,(1/2)}},{"\\Gamma","A"}},{{{0,0,(1/2)},{(1/2),0,(1/2)}},{"A","L"}},{{{(1/2),0,(1/2)},{(1/3),(1/3),(1/2)}},{"L","H"}},{{{(1/3),(1/3),(1/2)},{0,0,(1/2)}},{"H","A"}},{{{(1/2),0,(1/2)},{(1/2),0,0}},{"L","M"}},{{{(1/3),(1/3),0},{(1/3),(1/3),(1/2)}},{"K","H"}}};rule=Thread[Variables[c3w2band]->RandomReal[{-1,1},Length@Variables[c3w2band]]];
bandplot[path,200,c3w2band,{s4->-0.15`,s8->0.01,t11->-0.246`,t13->-0.01,t3->-0.2,t5->0.18}]

tt=Normal@Chop@Series[c3w2band,{ky,0,3},{kx,0,3},{kz,0,3}]//Expand;
cub=FromCoefficientRules[Map[Select[#,Total[#[[1]]]==3&]&,CoefficientRules[tt,{kx,ky,kz}],{2}],{kx,ky,kz}];MatrixForm[cub]

α(kx+ ky)^3+β(kx- ky)^3//Expand

2s4(kx+ I ky)^3-(2 (kx^3) s4-2 (ky^3) s4+kx (ky^2) (-3 s4+t5)+(kx^2) ky (3 s4+t5))//Expand

SolveAlways[2 (kx^3) s4-2 (ky^3) s4+kx (ky^2) (-3 s4+t5)+(kx^2) ky (3 s4+t5)==(c+I d)( kx+Exp[-I Pi/3] ky)^3 +(c-I d)( kx+Exp[I Pi/3] ky)^3,{kx,ky,kz}]

Magnetic cubic nodal line

sgop=msgop[bnsdict[{184,196}]];

init[lattice->{{((Sqrt[3])/2),-(( 1)/2),0},{0,1,0},{0,0,2}},
lattpar->{},
wyckoffposition->{{{0,0,0},{0,0,1}}},
symminformation->sgop,
basisFunctions->{{{x+ I y,0},{0,x- I y}}}]

cnl=Sum[symham[i,symmetryset->{2,7,13}],{i,1,5}];
cnl2band=Table[cnl[[i,j]],{i,{1,4}},{j,{1,4}}];MatrixForm[cnl2band]

path={{{{0,(1/10),(1/4)},{0,0,(1/4)}},{"Q","P"}},{{{0,0,(1/4)},{-(1/10),(1/15),(1/4)}},{"P","Q"}}};
bandManipulate[path,100,cnl2band]

C4 TI

sgop=msgop[gray[75]];

init[lattice->{{a,0,0},{0,a,0},{0,0,c}},
lattpar->{a->1,c->1},
wyckoffposition->{{{0,0,1/4},{0,0,0}},{{0,0,0},{0,0,0}}},
symminformation->sgop,
basisFunctions->{{"px","py"},{"px","py"}}]

hc4=FullSimplify[
(symham[2]/.{t1->0,t2->t1p})+
(symham[3]/.{r1->0,r2->tzp})+
(symham[4]/.{s10->0,s7->0,s9->0,s2->0,s4->0,s1->0,s6->0,s5->0}/.{s8->t1a,s3->t1b})+
(symham[5]/.{p5n2->0,p5n3->0,p5n1->p5n4}/.{p5n4->t2p})+
(symham[7]/.{p7n7->p7n5,p7n1->0,p7n4->0,p7n2->0,p7n3->0,p7n14->p7n12,p7n11->0,p7n8->0,p7n10->0,p7n9->0,p7n6->-p7n5,p7n13->p7n12}/.{p7n5->t2a/2,p7n12->t2b/2})]

path={{{{0,0,0},{(1/2),(1/2),0}},{"Γ","M"}},{{{(1/2),(1/2),0},{(1/2),(1/2),(1/2)}},{"M","A"}},{{{(1/2),(1/2),(1/2)},{0,0,(1/2)}},{"A","Z"}},{{{0,0,(1/2)},{0,0,0}},{"Z","Γ"}}};
bandplot[path,200,hc4,{t1a->1,t1b->-1,t2a->0.5,t2b->-0.5,t1p->2.5,t2p->.5,tzp->2}]

fumodel=ExpToTrig@symhamII[hc4];MatrixForm[fumodel]

TB model for magnetic space group 198.11

Spinless

sgop=msgop[bnsdict[{198,11}]];
init[
lattice->{{a,0,0},{0,a,0},{0,0,a}},
lattpar->{a->1,c->1},
wyckoffposition->{{{1/4,1/4,1/4},{1,1,1}}},
symminformation->sgop,
basisFunctions->{{"s"}}];
ham=Sum[symham[n,symmetryset->{2,4,9,13}],{n,1,2}];MatrixForm[ham]

path={{{{0,0,0},{1/2,(1/2),1/2}},{"\\Gamma","R"}},{{{1/2,(1/2),1/2},{0,0,1/2}},{"R","X"}},{{{0,0,1/2},{1/2,0,1/2}},{"X","M"}}};
bandplot[path,200,ham,{e1->2.4,t1->0.585`,t2->-0.61`,t3->1.`,t4->0.295},plotRange->{-1.5,1.5}]

C-4 WP in Spinful system

sgop=msgop[bnsdict[{198,11}]];
init[
lattice->{{a,0,0},{0,a,0},{0,0,a}},
lattpar->{a->1,c->1},
wyckoffposition->{{{1/4,1/4,1/4},{1,1,1}}},
symminformation->sgop,
basisFunctions->{{"sup","sdn"}}];
hamso=Sum[symham[n,symmetryset->{2,4,9,13}],{n,1,2}];MatrixForm[hamso]

path={{{{0,0,0},{1/2,(1/2),1/2}},{"\\Gamma","R"}},{{{1/2,(1/2),1/2},{0,0,1/2}},{"R","X"}},{{{0,0,1/2},{1/2,0,1/2}},{"X","M"}}};
bandplot[path,200,hamso,{e1->0.2,e2->1.75,t1->0,t10->0,t11->0.53`,t12->0,t2->0,t3->0,t4->0,t5->-0.45`,t6->0.62,t7->0.55,t8->-0.025,t9->0},plotRange->{-1.3,1.3}]