Skip to content

Commit

Permalink
Fix a bug in formatRepMat which returns Indeterminate:
Browse files Browse the repository at this point in the history
      (-1+I)/4*((2+2*I)*(-1)^(11/12)+I*Sqrt[2]+Sqrt[6])//formatRepMat
    An example affected by this is the following MSGCorep function:
      showMLGCorep[{222, 100},{-1/3,2/3,1/4},"trace"->True]
    The reason is that Simplify can not simplify the above number which is indeed 0.
    Just change the Simplify in formatRepMat to FullSimplify to fix it.
  • Loading branch information
goodluck1982 committed Dec 3, 2022
1 parent c57326c commit 78850b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
029. 2022-12-03 20:41:17 v1.2.6

Fix a bug in formatRepMat which returns Indeterminate:
(-1+I)/4*((2+2*I)*(-1)^(11/12)+I*Sqrt[2]+Sqrt[6])//formatRepMat
An example affected by this is the following MSGCorep function:
showMLGCorep[{222, 100},{-1/3,2/3,1/4},"trace"->True]
The reason is that Simplify can not simplify the above number which is indeed 0.
Just change the Simplify in formatRepMat to FullSimplify to fix it.

028. 2022-11-25 22:42:44 v1.2.5

Add a function showBandRep to show the result of getBandRep.
Expand Down
4 changes: 2 additions & 2 deletions SpaceGroupIrep.wl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
(* Mathematica version: >=11.2 *)
(* License: GPLv3 http://www.gnu.org/licenses/gpl-3.0.txt *)

SpaceGroupIrep`Private`Version={1,2,5}; (*Specify version here.*)
SpaceGroupIrep`Private`Version={1,2,6}; (*Specify version here.*)

With[{p=DirectoryName[$InputFileName]}, If[!MemberQ[$Path,p],AppendTo[$Path, p]]];

Expand Down Expand Up @@ -4200,7 +4200,7 @@ formatRepMat[mat_]:=Module[{norm,arg,fl,pu,poth,num},
If[MachineNumberQ[mat], Return[Round[mat,1.*^-6]]];
num=formatRepMatDict[mat];
If[num=!=None, Return[num]];
num=Simplify[mat];
num=FullSimplify[mat];
If[Flatten[Position[num,#]&/@{t\:2081,t\:2082,t\:2083}]!={}, formatRepMatDict[mat]=num; Return[num]];
If[Position[num,u]=={},
norm=Norm[num]//FullSimplify; arg=Arg[num]//FullSimplify;
Expand Down

0 comments on commit 78850b9

Please sign in to comment.