Skip to content

Commit

Permalink
Collect output parameters earlier
Browse files Browse the repository at this point in the history
since they need to be defined before the constraints can
be checked for validity
  • Loading branch information
Dylan Harries committed Feb 9, 2017
1 parent 2e197d0 commit 4671137
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions meta/FlexibleSUSY.m
Expand Up @@ -1926,7 +1926,7 @@ corresponding tadpole is real or imaginary (only in models with CP
gaugeCouplingNormalizationDefs = "",
numberOfDRbarBlocks, drBarBlockNames
},
particles = DeleteDuplicates @ Flatten[GetMassEigenstate /@ massMatrices];
particles = DeleteDuplicates @ Flatten[TreeMasses`GetMassEigenstate /@ massMatrices];
susyParticles = Select[particles, (!SARAH`SMQ[#])&];
smParticles = Complement[particles, susyParticles];
minpar = Cases[inputParameters, {p_, {"MINPAR", idx_}, ___} :> {idx, p}];
Expand Down Expand Up @@ -2625,7 +2625,7 @@ corresponding tadpole is real or imaginary (only in models with CP
inputParameters (* list of 3-component lists of the form {name, block, type} *),
massMatrices, phases,
diagonalizationPrecision,
allIntermediateOutputParametes = {},
allIntermediateOutputParameters = {},
allIntermediateOutputParameterIndexReplacementRules = {},
allInputParameterIndexReplacementRules = {},
allExtraParameterIndexReplacementRules = {},
Expand Down Expand Up @@ -2849,6 +2849,49 @@ corresponding tadpole is real or imaginary (only in models with CP
DebugPrint["input parameters: ", Parameters`GetInputParameters[]];
DebugPrint["auxiliary parameters: ", Parameters`GetExtraParameters[]];

allIndexReplacementRules = Join[
Parameters`CreateIndexReplacementRules[allParameters],
{Global`upQuarksDRbar[i_,j_] :> Global`upQuarksDRbar[i-1,j-1],
Global`downQuarksDRbar[i_,j_] :> Global`downQuarksDRbar[i-1,j-1],
Global`downLeptonsDRbar[i_,j_] :> Global`downLeptonsDRbar[i-1,j-1]}
];

allInputParameterIndexReplacementRules = Parameters`CreateIndexReplacementRules[
(* {parameter, type} *)
{#[[1]], #[[3]]}& /@ FlexibleSUSY`FSExtraInputParameters
];

allExtraParameterIndexReplacementRules = Parameters`CreateIndexReplacementRules[
(* {parameter, type} *)
{#, Parameters`GetType[#]}& /@ Parameters`GetExtraParameters[]
];

On[Assert];

Lat$massMatrices = TreeMasses`ConvertSarahMassMatrices[] /.
Parameters`ApplyGUTNormalization[] //.
{ SARAH`sum[j_, start_, end_, expr_] :> (Sum[expr, {j,start,end}]) };
massMatrices = Lat$massMatrices /. allIndexReplacementRules;
Lat$massMatrices = LatticeUtils`FixDiagonalization[Lat$massMatrices];

allIntermediateOutputParameters =
Parameters`GetIntermediateOutputParameterDependencies[TreeMasses`GetMassMatrix /@ massMatrices];
DebugPrint["intermediate output parameters = ", allIntermediateOutputParameters];

(* decrease index literals of intermediate output parameters in mass matrices *)
allIntermediateOutputParameterIndexReplacementRules =
Parameters`CreateIndexReplacementRules[allIntermediateOutputParameters];

massMatrices = massMatrices /. allIntermediateOutputParameterIndexReplacementRules;

allParticles = FlexibleSUSY`M[TreeMasses`GetMassEigenstate[#]]& /@ massMatrices;
allOutputParameters = DeleteCases[DeleteDuplicates[
Join[allParticles,
Flatten[TreeMasses`GetMixingMatrixSymbol[#]& /@ massMatrices]]], Null];

Parameters`SetOutputParameters[allOutputParameters];
DebugPrint["output parameters = ", allOutputParameters];

(* backwards compatibility replacements in constraints *)
backwardsCompatRules = {
Global`topDRbar -> Global`upQuarksDRbar,
Expand All @@ -2873,23 +2916,6 @@ corresponding tadpole is real or imaginary (only in models with CP
{FlexibleSUSY`LowScaleInput, FlexibleSUSY`SUSYScaleInput, FlexibleSUSY`HighScaleInput}];

(* replace all indices in the user-defined model file variables *)
allIndexReplacementRules = Join[
Parameters`CreateIndexReplacementRules[allParameters],
{Global`upQuarksDRbar[i_,j_] :> Global`upQuarksDRbar[i-1,j-1],
Global`downQuarksDRbar[i_,j_] :> Global`downQuarksDRbar[i-1,j-1],
Global`downLeptonsDRbar[i_,j_] :> Global`downLeptonsDRbar[i-1,j-1]}
];

allInputParameterIndexReplacementRules = Parameters`CreateIndexReplacementRules[
(* {parameter, type} *)
{#[[1]], #[[3]]}& /@ FlexibleSUSY`FSExtraInputParameters
];

allExtraParameterIndexReplacementRules = Parameters`CreateIndexReplacementRules[
(* {parameter, type} *)
{#, Parameters`GetType[#]}& /@ Parameters`GetExtraParameters[]
];

EvaluateUserInput[];
ReplaceIndicesInUserInput[allIndexReplacementRules];
ReplaceIndicesInUserInput[allInputParameterIndexReplacementRules];
Expand Down Expand Up @@ -3028,32 +3054,6 @@ corresponding tadpole is real or imaginary (only in models with CP
}
];

On[Assert];

Lat$massMatrices = ConvertSarahMassMatrices[] /.
Parameters`ApplyGUTNormalization[] //.
{ SARAH`sum[j_, start_, end_, expr_] :> (Sum[expr, {j,start,end}]) };
massMatrices = Lat$massMatrices /. allIndexReplacementRules;
Lat$massMatrices = LatticeUtils`FixDiagonalization[Lat$massMatrices];

allIntermediateOutputParametes =
Parameters`GetIntermediateOutputParameterDependencies[GetMassMatrix /@ massMatrices];
DebugPrint["intermediate output parameters = ", allIntermediateOutputParametes];

(* decrease index literals of intermediate output parameters in mass matrices *)
allIntermediateOutputParameterIndexReplacementRules =
Parameters`CreateIndexReplacementRules[allIntermediateOutputParametes];

massMatrices = massMatrices /. allIntermediateOutputParameterIndexReplacementRules;

allParticles = FlexibleSUSY`M[GetMassEigenstate[#]]& /@ massMatrices;
allOutputParameters = DeleteCases[DeleteDuplicates[
Join[allParticles,
Flatten[TreeMasses`GetMixingMatrixSymbol[#]& /@ massMatrices]]], Null];

Parameters`SetOutputParameters[allOutputParameters];
DebugPrint["output parameters = ", allOutputParameters];

extraSLHAOutputBlocks = Parameters`DecreaseIndexLiterals[
FlexibleSUSY`ExtraSLHAOutputBlocks,
Join[Parameters`GetOutputParameters[], Parameters`GetModelParameters[]]
Expand Down

0 comments on commit 4671137

Please sign in to comment.