Skip to content

Commit d64a0e7

Browse files
committed
GRE: allow choice of SignConvention (MTW or Weinberg)
1 parent 6e78f62 commit d64a0e7

File tree

2 files changed

+252
-129
lines changed

2 files changed

+252
-129
lines changed

resources/GRE/GRE.m

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,17 @@
3030
If[!DefQ[Simp], Simp[e_] := Collect[e, Col, Simplify]];
3131

3232

33-
If[!DefQ[\[DoubleStruckX]], Print["Please define coordinate before running GRE."];Abort[]];
33+
If[!DefQ[\[DoubleStruckX]], Print["Please define coordinate before running GRE. Aborting."];Abort[]];
3434
If[DefQ[\[DoubleStruckD]s2], \[DoubleStruckG]Mat = Simp[Map[Coefficient[\[DoubleStruckD]s2,#[[2]]]/If[#[[1]],1,2]&,Table[{i===j,\[DoubleStruckD][i]\[DoubleStruckD][j]},{i,\[DoubleStruckX]},{j,\[DoubleStruckX]}],{2}]],
3535
If[DefQ[\[DoubleStruckG]Mat], \[DoubleStruckD]s2 = (Table[\[DoubleStruckD][i],{i,\[DoubleStruckX]}] . \[DoubleStruckG]Mat . Table[{\[DoubleStruckD][i]},{i,\[DoubleStruckX]}])[[1]]//Simp,
36-
Print["Please define either \[DoubleStruckD]s2 or \[DoubleStruckG] before running GRE."];Abort[]]];
36+
Print["Please define either \[DoubleStruckD]s2 or \[DoubleStruckG] before running GRE. Aborting."];Abort[]]];
37+
38+
39+
(* ::Input::Initialization:: *)
40+
If[!DefQ[SignConvention],SignConvention = "MTW"];
41+
If[!MemberQ[{"MTW","Weinberg"},SignConvention],Print["Unknown sign convention. Aborting.";Abort[]] ];
42+
R4Sign["MTW"]=+1;
43+
R4Sign["Weinberg"]=-1;
3744

3845

3946
PdBox[lst_]:= StyleBox[#, FontSize->10]&@ GridBox[#, Selectable->True, ColumnSpacings->0, RowSpacings->0]&@ Transpose@DeleteCases[Transpose[Map[ToBoxes,lst,{2}]]/.{"1",dn_}:>{"",dn},{"0",_}];
@@ -299,7 +306,7 @@
299306
},
300307
GridBoxSpacings->{"Columns" -> {Offset[0.27999999999999997`], {Offset[0.]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {Offset[0.2], {Offset[0.]}, Offset[0.2]}, "RowsIndexed" -> {}}],
301308
"GRETsr",
302-
Selectable->False]\) = Simp[\!\(
309+
Selectable->False]\) = R4Sign[SignConvention] * Simp[\!\(
303310
\*SubscriptBox[\(\[PartialD]\), \(\[Nu]\)]\*
304311
TagBox[GridBox[{
305312
{GridBox[{

0 commit comments

Comments
 (0)