Skip to content

Commit

Permalink
Add ComplexLog() to handle negative mass^2
Browse files Browse the repository at this point in the history
  • Loading branch information
jhyeon committed Sep 5, 2014
1 parent c286ad4 commit a402d7c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 7 additions & 1 deletion meta/Lattice.m
Expand Up @@ -95,6 +95,8 @@
Format[Lattice`Private`M2[f_], CForm] :=
Format["M2" <> ToValidCSymbolString[f], OutputForm];

Format[ComplexLog, CForm] := Format["ComplexLog", OutputForm];

Format[Lattice`Private`SUM, CForm] := Format["SUM", OutputForm];

Format[Lattice`Private`USUM, CForm] := Format["USUM", OutputForm];
Expand Down Expand Up @@ -373,7 +375,11 @@
restoreMassPowerRules = {
(f:SARAH`A0|SARAH`B0|SARAH`B1|SARAH`B00|SARAH`B22|
SARAH`F0|SARAH`G0|SARAH`H0)[a___,FlexibleSUSY`M[b_],c___] :>
f[a,Lattice`Private`M2[b],c]
f[a,Lattice`Private`M2[b],c],
Global`FiniteLog[Abs[FlexibleSUSY`M[f_][i_] / scl_]] :>
ComplexLog[Lattice`Private`M2[f[{i}]] / scl^2] / 2,
Global`FiniteLog[Abs[FlexibleSUSY`M[f_] / scl_]] :>
ComplexLog[Lattice`Private`M2[f] / scl^2] / 2
};

ParametrizeNPointFunction[h_[field_, expr_], replaceGhosts_] :=
Expand Down
10 changes: 10 additions & 0 deletions src/wrappers.hpp
Expand Up @@ -181,6 +181,16 @@ typename Eigen::MatrixBase<Derived>::PlainObject Diag(const Eigen::MatrixBase<De
return diag;
}

inline std::complex<double> ComplexLog(const std::complex<double>& z)
{
return std::log(z);
}

inline std::complex<double> ComplexLog(double x)
{
return std::log(std::complex<double>(x));
}

inline double FiniteLog(double a)
{
return a > std::numeric_limits<double>::epsilon() ? std::log(a) : 0;
Expand Down

0 comments on commit a402d7c

Please sign in to comment.