Skip to content

Commit

Permalink
Fix a bug for generateGroup with "generationProcess"->True.
Browse files Browse the repository at this point in the history
  • Loading branch information
goodluck1982 committed Nov 25, 2022
1 parent 3c61b9c commit c57326c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions SpaceGroupIrep.wl
Original file line number Diff line number Diff line change
Expand Up @@ -2406,7 +2406,7 @@ rotAxisAngle[O3RotMat_]/;MatrixQ[O3RotMat,NumericQ]:=
in the form of multiplication sequence of generators. *)
Options[generateGroup]={"generationProcess"->False};
generateGroup[gens_,identityElement_,multiply_,OptionsPattern[]]:=
Module[{i,j,ng,MAXORDER=200,orders,subs,mlist,g1,g2,g3,g1tmp,powers,g2tmp,mseq,gp},
Module[{i,j,ng,MAXORDER=200,orders,subs,mlist,g1,g2,g3,powers,g2tmp,mseq,gp},
gp=OptionValue["generationProcess"]===True;
ng=Length[gens]; orders=subs=Table[0,ng];
powers=<||>;
Expand Down Expand Up @@ -2438,15 +2438,14 @@ generateGroup[gens_,identityElement_,multiply_,OptionsPattern[]]:=
g3=Complement[g2,g1]; g1=g2;
];
While[g3!={},
g1tmp=DeleteCases[g1,identityElement];
If[gp,
g2tmp=Table[multiply[g3[[i]],g1tmp[[j]]]->{g3[[i]],g1tmp[[j]]},{i,Length[g3]},{j,Length[g1tmp]}];
g2tmp=Table[multiply[g3[[i]],g1[[j]]]->{g3[[i]],g1[[j]]},{i,Length[g3]},{j,Length[g1]}];
g2tmp=Union[Sequence@@g2tmp,SameTest->(#1[[1]]==#2[[1]]&)];
g2=g2tmp[[All,1]];
g3=Complement[g2,g1]; g1=g2;
g2tmp=Association[g2tmp]; (mseq[#]=g2tmp[#])&/@g3,
(*-------else------*)
g2=Union@@Table[multiply[g3[[i]],g1tmp[[j]]],{i,Length[g3]},{j,Length[g1tmp]}];
g2=Union@@Table[multiply[g3[[i]],g1[[j]]],{i,Length[g3]},{j,Length[g1]}];
g3=Complement[g2,g1]; g1=g2;
]
];
Expand Down

0 comments on commit c57326c

Please sign in to comment.