Skip to content

Commit

Permalink
Merge branch 'feature-2.0' into feature-2.0-semianalytic-solver
Browse files Browse the repository at this point in the history
 Conflicts:
	meta/FlexibleSUSY.m
	templates/module.mk.in
	test/module.mk
  • Loading branch information
Dylan Harries committed Jun 15, 2017
2 parents 8865edf + 8df67a1 commit 578c7c0
Show file tree
Hide file tree
Showing 26 changed files with 1,619 additions and 94 deletions.
22 changes: 22 additions & 0 deletions ChangeLog
Expand Up @@ -40,6 +40,28 @@ FlexibleSUSY 2.0.0 [not released yet]

Thanks to Jobst Ziebell.

* Feature: BSM contributions to the electric dipole moment of
fermions at the 1L level in any given BSM model. Note: Diagrams
with non-SM vector bosons are not taken into account.

In order to let FlexibleSUSY calculate the EDM of a fermion F, the
symbol FlexibleSUSYObservable`EDM[F] must be written into an SLHA
output block in the ExtraSLHAOutputBlocks variable in the
FlexibleSUSY model file. If F is a multiplet, the field index must
be specified, for example FlexibleSUSYObservable`EDM[F[1]] for the
first field in the multiplet.

Example:

ExtraSLHAOutputBlocks = {
{FlexibleSUSYLowEnergy,
{{23, FlexibleSUSYObservable`EDM[Fe[1]]},
{24, FlexibleSUSYObservable`EDM[Fe[2]]},
{25, FlexibleSUSYObservable`EDM[Fe[3]]} } }
};

Thanks to Jobst Ziebell.

* Feature: New functions, FS<model>GetProblems[],
FS<model>GetWarnings[] and FS<model>ToSLHA[], have been added to
FlexibleSUSY's spectrum generator Mathematica interface. The first
Expand Down
2 changes: 1 addition & 1 deletion doc/librarylink.dox
Expand Up @@ -227,7 +227,7 @@ _Output_:

~~~~~~~~~~~~~~~~~~~~{.m}
{ alphaEmMZ -> 0.00781763, (* alpha_em(MZ) in the SM(5), MS-bar *)
GF -> 0.0000116637, (* Fermi constant *)
GF -> 0.000011663787, (* Fermi constant *)
alphaSMZ -> 0.1184, (* alpha_s(MZ) in the SM(5), MS-bar *)
MZ -> 91.1876, (* Z pole mass *)
mbmb -> 4.18, (* MS-bar bottom mass at Q = mb *)
Expand Down
2 changes: 1 addition & 1 deletion meta/CConversion.m
Expand Up @@ -237,7 +237,7 @@
CConversion`ArrayType[ CConversion`complexScalarCType,_] |
CConversion`MatrixType[CConversion`complexScalarCType,__]|
CConversion`TensorType[CConversion`complexScalarCType,__],
"(" <> expr <> ").cast<" <> CreateCType[CConversion`ScalarType[complexScalarCType]] <> " >()"
"(" <> expr <> ").template cast<" <> CreateCType[CConversion`ScalarType[complexScalarCType]] <> " >()"
,
_,
Print["Error: CastTo: cannot cast expression ", expr, " to ", toType];
Expand Down
540 changes: 540 additions & 0 deletions meta/EDM.m

Large diffs are not rendered by default.

17 changes: 14 additions & 3 deletions meta/FSMathLink.m
Expand Up @@ -164,9 +164,20 @@
PutSpectrum[pars_List, link_String] :=
StringJoin[PutParameter[#,link]& /@ pars];

PutObservable[obs_, type_, link_String] :=
"MLPutRuleTo(" <> link <> ", OBSERVABLE(" <> Observables`GetObservableName[obs] <>
"), \"" <> ToString[obs] <> "\");\n";
ObsToStr[obs_?NumericQ] := ToString[obs];
ObsToStr[obs_] := "\"" <> ToString[obs] <> "\"";

HeadToStr[sym_] := "\"" <> ToString[sym] <> "\"";
HeadsToStr[{}] := "";
HeadsToStr[l_List] := ", {" <> StringJoin[Riffle[HeadToStr /@ l, ", "]] <> "}";

PutObservable[obs_[sub_], type_, link_String, heads_:{}] :=
PutObservable[sub, type, link, Join[heads, {obs}]];

PutObservable[obs_, type_, link_String, heads_:{}] :=
"MLPutRuleTo(" <> link <> ", OBSERVABLE(" <>
Observables`GetObservableName[Composition[Sequence @@ heads][obs]] <>
"), " <> ObsToStr[obs] <> HeadsToStr[heads] <> ");\n";

PutObservables[obs_List, link_String] :=
StringJoin[PutObservable[#, Observables`GetObservableType[#], link]& /@ obs];
Expand Down
51 changes: 42 additions & 9 deletions meta/FlexibleSUSY.m
Expand Up @@ -23,6 +23,7 @@
"ThreeLoopMSSM`",
"Observables`",
"GMuonMinus2`",
"EDM`",
"EffectiveCouplings`",
"FlexibleEFTHiggsMatching`",
"FSMathLink`",
Expand Down Expand Up @@ -1756,12 +1757,12 @@ corresponding tadpole is real or imaginary (only in models with CP
WriteGMuonMinus2Class[vertexRules_List, files_List] :=
Module[{particles, muonFunctionPrototypes, diagrams, vertexFunctionData,
definitions, calculationCode, getMSUSY, getQED2L},
particles = GMuonMinus2`CreateParticles[];
muonFunctionPrototypes = GMuonMinus2`CreateMuonFunctions[vertexRules][[1]];
diagrams = GMuonMinus2`CreateDiagrams[];
vertexFunctionData = GMuonMinus2`CreateVertexFunctionData[vertexRules];
definitions = GMuonMinus2`CreateDefinitions[vertexRules];
calculationCode = GMuonMinus2`CreateCalculation[];
particles = GMuonMinus2`GMuonMinus2CreateParticles[];
muonFunctionPrototypes = GMuonMinus2`GMuonMinus2CreateMuonFunctions[vertexRules][[1]];
diagrams = GMuonMinus2`GMuonMinus2CreateDiagrams[];
vertexFunctionData = GMuonMinus2`GMuonMinus2CreateVertexFunctionData[vertexRules];
definitions = GMuonMinus2`GMuonMinus2CreateDefinitions[vertexRules];
calculationCode = GMuonMinus2`GMuonMinus2CreateCalculation[];
getMSUSY = GMuonMinus2`GetMSUSY[];
getQED2L = GMuonMinus2`GetQED2L[];

Expand All @@ -1778,6 +1779,26 @@ corresponding tadpole is real or imaginary (only in models with CP
} ];
];

(* Write the EDM c++ files *)
WriteEDMClass[vertexRules_List, files_List] :=
Module[{fields, diagrams, interfaceFunctions,
vertexFunctionData, definitions},
fields = EDM`EDMCreateFields[];
diagrams = EDM`EDMCreateDiagrams[];
interfaceFunctions = EDM`EDMCreateInterfaceFunctions[];
vertexFunctionData = EDM`EDMCreateVertexFunctionData[vertexRules];
definitions = EDM`EDMCreateDefinitions[vertexRules];
WriteOut`ReplaceInFiles[files,
{ "@EDM_Fields@" -> fields,
"@EDM_Diagrams@" -> diagrams,
"@EDM_VertexFunctionData@" -> vertexFunctionData,
"@EDM_Definitions@" -> definitions,
"@EDM_InterfaceFunctionPrototypes@" -> interfaceFunctions[[1]],
"@EDM_InterfaceFunctionDefinitions@" -> interfaceFunctions[[2]],
Sequence @@ GeneralReplacementRules[]
} ];
];

GetBVPSolverHeaderName[solver_] :=
Switch[solver,
FlexibleSUSY`TwoScaleSolver, "two_scale",
Expand Down Expand Up @@ -2292,7 +2313,7 @@ corresponding tadpole is real or imaginary (only in models with CP
];

(* Get all nPointFunctions that GMM2 needs *)
PrepareGMuonMinus2[] := GMuonMinus2`NPointFunctions[];
PrepareGMuonMinus2[] := GMuonMinus2`GMuonMinus2NPointFunctions[];

PrepareUnrotatedParticles[eigenstates_] :=
Module[{nonMixedParticles = {}, nonMixedParticlesFile},
Expand Down Expand Up @@ -2724,7 +2745,7 @@ corresponding tadpole is real or imaginary (only in models with CP

MakeFlexibleSUSY[OptionsPattern[]] :=
Module[{nPointFunctions, runInputFile, initialGuesserInputFile,
gmm2Vertices = {},
gmm2Vertices = {}, edmFields,
susyBetaFunctions, susyBreakingBetaFunctions,
numberOfSusyParameters, anomDim,
inputParameters (* list of 3-component lists of the form {name, block, type} *),
Expand Down Expand Up @@ -3579,7 +3600,19 @@ corresponding tadpole is real or imaginary (only in models with CP
{{FileNameJoin[{$flexiblesusyTemplateDir, "a_muon.hpp.in"}],
FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_a_muon.hpp"}]},
{FileNameJoin[{$flexiblesusyTemplateDir, "a_muon.cpp.in"}],
FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_a_muon.cpp"}]}}];
FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_a_muon.cpp"}]}}];

Print["Creating class EDM"];
edmFields = DeleteDuplicates @ Cases[Observables`GetRequestedObservables[extraSLHAOutputBlocks],
FlexibleSUSYObservable`EDM[p_[__]|p_] :> p];
EDM`EDMInitialize[];
EDM`EDMSetEDMFields[edmFields];

WriteEDMClass[Join[vertexRules, Vertices`VertexRules[EDM`EDMNPointFunctions[], Lat$massMatrices]],
{{FileNameJoin[{$flexiblesusyTemplateDir, "edm.hpp.in"}],
FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_edm.hpp"}]},
{FileNameJoin[{$flexiblesusyTemplateDir, "edm.cpp.in"}],
FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_edm.cpp"}]}}];

PrintHeadline["Creating Mathematica interface"];
Print["Creating LibraryLink ", FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> ".mx"}], " ..."];
Expand Down
30 changes: 15 additions & 15 deletions meta/GMuonMinus2.m
@@ -1,15 +1,15 @@
BeginPackage["GMuonMinus2`", {"SARAH`", "CConversion`", "TextFormatting`", "TreeMasses`", "LoopMasses`", "Vertices`"}];

CreateParticles::usage="Returns the c++ code that contains all particle classes";
CreateMuonFunctions::usage="Returns the c++ code that contains all muon functions";
CreateDiagrams::usage="Returns the c++ code that contains all relevant diagram classes";
CreateVertexFunctionData::usage="Returns the c++ code that contains all relevant vertex function data";
GMuonMinus2CreateParticles::usage="Returns the c++ code that contains all particle classes";
GMuonMinus2CreateMuonFunctions::usage="Returns the c++ code that contains all muon functions";
GMuonMinus2CreateDiagrams::usage="Returns the c++ code that contains all relevant diagram classes";
GMuonMinus2CreateVertexFunctionData::usage="Returns the c++ code that contains all relevant vertex function data";

CreateCalculation::usage="Returns the c++ code that performs the actual calculation the magnetic moment";
GMuonMinus2CreateCalculation::usage="Returns the c++ code that performs the actual calculation the magnetic moment";

CreateDefinitions::usage="Returns the c++ that contains all function definitions"
GMuonMinus2CreateDefinitions::usage="Returns the c++ that contains all function definitions"

NPointFunctions::usage="Returns a list of all n point functions that are needed. Actually it is a list of fake functions to extract vertex functions...";
GMuonMinus2NPointFunctions::usage="Returns a list of all n point functions that are needed. Actually it is a list of fake functions to extract vertex functions...";

GetMSUSY::usage="returns minimum charged BSM mass";

Expand Down Expand Up @@ -49,7 +49,7 @@ If you add new kinds of vertices (e.g for new diagram types):
];

(* Create c++ classes for all particles *)
CreateParticles[] :=
GMuonMinus2CreateParticles[] :=
Module[{particles, code},
(* Get a list of all particles *)
particles = TreeMasses`GetParticles[];
Expand Down Expand Up @@ -111,7 +111,7 @@ If you add new kinds of vertices (e.g for new diagram types):
];

muonFunctions = Null;
CreateMuonFunctions[vertexRules_List] :=
GMuonMinus2CreateMuonFunctions[vertexRules_List] :=
Module[{muonIndex, muonFamily, prototypes = "", definitions,
contextMuonPole},
If[muonFunctions =!= Null, Return[muonFunctions]];
Expand Down Expand Up @@ -145,7 +145,7 @@ If you add new kinds of vertices (e.g for new diagram types):
{prototypes, definitions}
];

CreateDiagrams[] :=
GMuonMinus2CreateDiagrams[] :=
Module[{diagramTypes, diagramTypeHeads, code},
diagrams = contributingFeynmanDiagramTypes;
diagramHeads = DeleteDuplicates @ (Head /@ diagrams);
Expand All @@ -167,7 +167,7 @@ If you add new kinds of vertices (e.g for new diagram types):
Return[code];
];

CreateVertexFunctionData[vertexRules_List] := CreateVertices[vertexRules][[1]];
GMuonMinus2CreateVertexFunctionData[vertexRules_List] := CreateVertices[vertexRules][[1]];

CreateDiagramEvaluatorClass[type_OneLoopDiagram] :=
("template<class PhotonEmitter, class ExchangeParticle>\n" <>
Expand Down Expand Up @@ -206,7 +206,7 @@ If you add new kinds of vertices (e.g for new diagram types):
"return qed_2L;";

calculationCode = Null;
CreateCalculation[] :=
GMuonMinus2CreateCalculation[] :=
Module[{code},
(* If we have been here before return the old result *)
If[calculationCode =!= Null, Return[calculationCode]];
Expand All @@ -228,13 +228,13 @@ If you add new kinds of vertices (e.g for new diagram types):
Return[code];
];

CreateDefinitions[vertexRules_List] :=
GMuonMinus2CreateDefinitions[vertexRules_List] :=
(CreateEvaluationContextSpecializations[] <> "\n\n" <>
CreateMuonFunctions[vertexRules][[2]] <> "\n\n" <>
GMuonMinus2CreateMuonFunctions[vertexRules][[2]] <> "\n\n" <>
CreateVertices[vertexRules][[2]]);

nPointFunctions = Null;
NPointFunctions[] :=
GMuonMinus2NPointFunctions[] :=
Module[{contributingDiagrams, vertices},
If[nPointFunctions =!= Null, Return[nPointFunctions]];

Expand Down
4 changes: 2 additions & 2 deletions meta/Observables.m
Expand Up @@ -74,8 +74,8 @@
GetObservableDescription[obs_ /; obs === FlexibleSUSYObservable`CpHiggsGluonGluon] := "effective H-Gluon-Gluon coupling";
GetObservableDescription[obs_ /; obs === FlexibleSUSYObservable`CpPseudoScalarPhotonPhoton] := "effective A-Photon-Photon coupling";
GetObservableDescription[obs_ /; obs === FlexibleSUSYObservable`CpPseudoScalarGluonGluon] := "effective A-Gluon-Gluon coupling";
GetObservableDescription[FlexibleSUSYObservable`EDM[p_[idx_]]] := GetObservableDescription[FlexibleSUSYObservable`EDM[p]] <> "(" <> ToString[idx] <> ")";
GetObservableDescription[FlexibleSUSYObservable`EDM[p_]] := "electric dipole moment of " <> CConversion`ToValidCSymbolString[p];
GetObservableDescription[FlexibleSUSYObservable`EDM[p_[idx_]]] := "electric dipole moment of " <> CConversion`ToValidCSymbolString[p] <> "(" <> ToString[idx] <> ") [1/GeV]";
GetObservableDescription[FlexibleSUSYObservable`EDM[p_]] := "electric dipole moment of " <> CConversion`ToValidCSymbolString[p] <> " [1/GeV]";

GetObservableType[obs_ /; obs === FlexibleSUSYObservable`aMuon] := CConversion`ScalarType[CConversion`realScalarCType];
GetObservableType[obs_ /; obs === FlexibleSUSYObservable`aMuonUncertainty] := CConversion`ScalarType[CConversion`realScalarCType];
Expand Down
60 changes: 36 additions & 24 deletions meta/WriteOut.m
Expand Up @@ -885,13 +885,13 @@
CConversion`ToValidCSymbolString[c] <> "_slha";

GetSLHATrilinearCouplingType[c_] :=
CConversion`ToRealType[Parameters`GetType[c]];
Parameters`GetType[c];

CreateSLHASoftSquaredMassName[c_] :=
CConversion`ToValidCSymbolString[c] <> "_slha";

GetSLHASoftSquaredMassType[c_] :=
CConversion`ToRealType[Parameters`GetType[c]];
Parameters`GetType[c];

CreateSLHAYukawaDefinition[] :=
StringJoin[Parameters`CreateParameterDefinitionAndDefaultInitialize[
Expand Down Expand Up @@ -976,19 +976,24 @@
If[Parameters`IsOutputParameter[{vL, vR}] &&
ParametersHaveSameDimension[{vL, vR, #}],
result = result <>
CreateSLHATrilinearCouplingName[#] <> " = (" <>
CreateSLHAFermionMixingMatrixName[vR] <> ".conjugate() * " <>
"MODELPARAMETER(" <>
CConversion`ToValidCSymbolString[#] <> ") * " <>
CreateSLHAFermionMixingMatrixName[vL] <> ".adjoint()" <>
").real();\n";
CreateSLHATrilinearCouplingName[#] <> " = " <>
CConversion`CastTo[
CreateSLHAFermionMixingMatrixName[vR] <> ".conjugate() * " <>
"MODELPARAMETER(" <>
CConversion`ToValidCSymbolString[#] <> ") * " <>
CreateSLHAFermionMixingMatrixName[vL] <> ".adjoint()",
GetSLHATrilinearCouplingType[#]
] <> ";\n";
,
Print["Warning: Cannot convert Trilinear coupling ", #,
" to SLHA, because ", {vL,vR}, " are not defined",
" or have incompatible dimension."];
result = result <>
CreateSLHATrilinearCouplingName[#] <> " = MODELPARAMETER(" <>
CConversion`ToValidCSymbolString[#] <> ").real();\n";
CreateSLHATrilinearCouplingName[#] <> " = " <>
CConversion`CastTo[
"MODELPARAMETER(" <> CConversion`ToValidCSymbolString[#] <> ")",
GetSLHATrilinearCouplingType[#]
] <> ";\n";
];
]& /@ tril;
result
Expand Down Expand Up @@ -1038,28 +1043,35 @@
ParametersHaveSameDimension[{vL, vR, #}],
If[IsLeftHanded[#],
result = result <>
CreateSLHASoftSquaredMassName[#] <> " = (" <>
CreateSLHAFermionMixingMatrixName[vL] <> " * " <>
"MODELPARAMETER(" <>
CConversion`ToValidCSymbolString[#] <> ") * " <>
CreateSLHAFermionMixingMatrixName[vL] <> ".adjoint()" <>
").real();\n";
CreateSLHASoftSquaredMassName[#] <> " = " <>
CConversion`CastTo[
CreateSLHAFermionMixingMatrixName[vL] <> " * " <>
"MODELPARAMETER(" <>
CConversion`ToValidCSymbolString[#] <> ") * " <>
CreateSLHAFermionMixingMatrixName[vL] <> ".adjoint()",
GetSLHASoftSquaredMassType[#]
] <> ";\n";
,
result = result <>
CreateSLHASoftSquaredMassName[#] <> " = (" <>
CreateSLHAFermionMixingMatrixName[vR] <> ".conjugate() * " <>
"MODELPARAMETER(" <>
CConversion`ToValidCSymbolString[#] <> ") * " <>
CreateSLHAFermionMixingMatrixName[vR] <> ".transpose()" <>
").real();\n";
CreateSLHASoftSquaredMassName[#] <> " = " <>
CConversion`CastTo[
CreateSLHAFermionMixingMatrixName[vR] <> ".conjugate() * " <>
"MODELPARAMETER(" <>
CConversion`ToValidCSymbolString[#] <> ") * " <>
CreateSLHAFermionMixingMatrixName[vR] <> ".transpose()",
GetSLHASoftSquaredMassType[#]
] <> ";\n";
];
,
Print["Warning: Cannot convert soft squared mass ", #,
" to SLHA, because ", {vL,vR}, " are not defined",
" or have incompatible dimension."];
result = result <>
CreateSLHASoftSquaredMassName[#] <> " = MODELPARAMETER(" <>
CConversion`ToValidCSymbolString[#] <> ").real();\n";
CreateSLHASoftSquaredMassName[#] <> " = " <>
CConversion`CastTo[
"MODELPARAMETER(" <> CConversion`ToValidCSymbolString[#] <> ")",
GetSLHASoftSquaredMassType[#]
] <> ";\n";
];
]& /@ massSq;
result
Expand Down
5 changes: 4 additions & 1 deletion model_files/CMSSMCPV/FlexibleSUSY.m.in
Expand Up @@ -85,7 +85,10 @@ ExtraSLHAOutputBlocks = {
{1, Hold[SUSYScale]},
{2, Hold[LowScale]} } },
{FlexibleSUSYLowEnergy,
{{21, FlexibleSUSYObservable`aMuon} } },
{{21, FlexibleSUSYObservable`aMuon},
{23, FlexibleSUSYObservable`EDM[Fe[1]]},
{24, FlexibleSUSYObservable`EDM[Fe[2]]},
{25, FlexibleSUSYObservable`EDM[Fe[3]]} } },
{EFFHIGGSCOUPLINGS, NoScale,
{{1, FlexibleSUSYObservable`CpHiggsPhotonPhoton},
{2, FlexibleSUSYObservable`CpHiggsGluonGluon},
Expand Down

0 comments on commit 578c7c0

Please sign in to comment.