Skip to content

Commit

Permalink
Feature/sm as input and add unit test for Debye calculations (#107)
Browse files Browse the repository at this point in the history
* Add struct containing all SM constants

* Increase version to 2.6

* Adjust all models to get constants from member

* Get everything to compile with API adjustment

* Adjust all tests to new api

* Add test to check for SM debye correction

* Add tests to docu and add description for new test

* Add overloads and deprecated message to old api

* Set self coupling in test to zero to only have yt^2 contribution

* Add comments

* Update Test-origin.cpp
  • Loading branch information
phbasler authored Apr 6, 2023
1 parent dfaeb8e commit e926240
Show file tree
Hide file tree
Showing 56 changed files with 2,204 additions and 1,429 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
cmake_minimum_required(VERSION 3.13)
project(
BSMPT
VERSION 2.5.1
VERSION 2.6.0
LANGUAGES C CXX
DESCRIPTION
"BSMPT - Beyond the Standard Model Phase Transitions : A C++ package for the computation of the EWPT in BSM models"
Expand Down Expand Up @@ -210,7 +210,8 @@ if(BSMPT_IS_TOPLEVEL)
"${CMAKE_CURRENT_SOURCE_DIR}/include/"
"${CMAKE_CURRENT_SOURCE_DIR}/src/"
"${CMAKE_CURRENT_SOURCE_DIR}/README.md"
"${CMAKE_CURRENT_SOURCE_DIR}/Changelog.md")
"${CMAKE_CURRENT_SOURCE_DIR}/Changelog.md"
"${CMAKE_CURRENT_SOURCE_DIR}/tests/")

else()
message(
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SPDX-FileCopyrightText: 2021 Philipp Basler, Margarete Mühlleitner and Jonas M
SPDX-License-Identifier: GPL-3.0-or-later
-->

Program: BSMPT version 2.5.1
Program: BSMPT version 2.6.0

Released by: Philipp Basler and Lisa Biermann and Margarete Mühlleitner and Jonas Müller

Expand All @@ -18,7 +18,6 @@ Released by: Philipp Basler and Lisa Biermann and Margarete Mühlleitner and Jon
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/phbasler/bsmpt/graphs/commit-activity)
[![GitHub license](https://img.shields.io/github/license/phbasler/bsmpt.svg)](https://github.com/phbasler/BSMPT/blob/master/LICENSE.md)
[![Latest release](https://badgen.net/github/release/phbasler/bsmpt)](https://github.com/phbasler/bsmpt/releases)
[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/phbasler/BSMPT.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/phbasler/BSMPT/context:cpp)



Expand Down
61 changes: 58 additions & 3 deletions include/BSMPT/baryo_calculation/CalculateEtaInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <BSMPT/baryo_calculation/transport_equations.h>
#include <BSMPT/minimizer/Minimizer.h>
#include <BSMPT/models/IncludeAllModels.h>
#include <BSMPT/models/SMparam.h>
#include <string>
#include <vector>

Expand Down Expand Up @@ -105,13 +106,33 @@ class CalculateEtaInterface
*/
GSL_integration_mubl GSL_integration_mubl_container;

/**
* @brief SMConstants The SM Constants used during the EWBG calculation
*/
const ISMConstants SMConstants;

public:
/**
* @brief CalculateEtaInterface Initialises the class with a config pair
* @param config config.first sets the CalculateEtaInterface::method_transport
* and second CalculateEtaInterface::bot_mass_flag
*/
CalculateEtaInterface(const std::pair<std::vector<bool>, int> &config);
[[deprecated(
"Will call CalculateEtaInterface with GetSMConstants(). Please use the "
"detailed overload "
"to ensure consistent SM constants through all "
"routines.")]] CalculateEtaInterface(const std::pair<std::vector<bool>,
int> &config);

/**
* @brief CalculateEtaInterface Initialises the class with a config pair
* @param config config.first sets the CalculateEtaInterface::method_transport
* and second CalculateEtaInterface::bot_mass_flag
* @param smConstants The SM Constants. This should be the same as used by the
* parameter point used to calculate the SFOEWPT
*/
CalculateEtaInterface(const std::pair<std::vector<bool>, int> &config,
const ISMConstants &smConstants);

/**
* Initialises the class member and sets the
Expand All @@ -121,16 +142,50 @@ class CalculateEtaInterface
* @param bot_mass_flag_in Sets the CalculateEtaInterface::bot_mass_flag
* member
*/
[[deprecated(
"Will call CalculateEtaInterface with GetSMConstants(). Please use the "
"detailed overload "
"to ensure consistent SM constants through all "
"routines.")]] CalculateEtaInterface(const std::vector<bool>
&method_input,
const int &bot_mass_flag_in);

/**
* Initialises the class member and sets the
* CalculateEtaInterface::method_transport and
* CalculateEtaInterface::bot_mass_flag
* @param method_input Sets the CalculateEtaInterface::method_transport member
* @param bot_mass_flag_in Sets the CalculateEtaInterface::bot_mass_flag
* member
* @param smConstants The SM Constants. This should be the same as used by the
* parameter point used to calculate the SFOEWPT
*/
CalculateEtaInterface(const std::vector<bool> &method_input,
const int &bot_mass_flag_in);
const int &bot_mass_flag_in,
const ISMConstants &smConstants);

/**
* Initialises the class member and sets the
* CalculateEtaInterface::method_transport and
* CalculateEtaInterface::bot_mass_flag with the input given in the input file
* @param file input file to get the settings
*/
[[deprecated(
"Will call CalculateEtaInterface with GetSMConstants(). Please use the "
"detailed overload "
"to ensure consistent SM constants through all "
"routines.")]] CalculateEtaInterface(const std::string &file);

/**
* Initialises the class member and sets the
* CalculateEtaInterface::method_transport and
* CalculateEtaInterface::bot_mass_flag with the input given in the input file
* @param file input file to get the settings
* @param smConstants The SM Constants. This should be the same as used by the
* parameter point used to calculate the SFOEWPT
*/
CalculateEtaInterface(const std::string &file);
CalculateEtaInterface(const std::string &file,
const ISMConstants &smConstants);

virtual ~CalculateEtaInterface();

Expand Down
9 changes: 8 additions & 1 deletion include/BSMPT/baryo_calculation/Fluid_Type/bot_source.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (C) 2020 Philipp Basler, Margarete Mühlleitner and Jonas Müller
// SPDX-FileCopyrightText: 2021 Philipp Basler, Margarete Mühlleitner and Jonas Müller
// SPDX-FileCopyrightText: 2021 Philipp Basler, Margarete Mühlleitner and Jonas
// Müller
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -37,6 +38,12 @@ class bot_source : public gen_fluid
{
private:
public:
[[deprecated("Will call bot_source with GetSMConstants(). Please use the "
"detailed overload "
"to ensure consistent SM constants through all "
"routines.")]] bot_source();

bot_source(const ISMConstants &smConstants);
/**
* @brief operator () Needed for the numerical solution via boost.
* @param omega Vector of all included (rescaled) chemical potentials
Expand Down
19 changes: 16 additions & 3 deletions include/BSMPT/baryo_calculation/Fluid_Type/gen_func_fluid.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ double NIntegrate_kappa(const Calc_kappa_t &C_kap);
class Calc_eta
{
private:
ISMConstants SMConstants;
/**
* @brief Temp Temperature
*/
Expand All @@ -255,6 +256,11 @@ class Calc_eta

public:
double prefactor;
[[deprecated("Will call Calc_eta with GetSMConstants(). Please use the "
"detailed overload "
"to ensure consistent SM constants through all "
"routines.")]] Calc_eta();
Calc_eta(const ISMConstants &smConstants);
void set_class(std::vector<double> array_z,
std::vector<double> array_nL,
double Temp,
Expand Down Expand Up @@ -297,7 +303,14 @@ double Nintegrate_eta(const Calc_eta &C_eta,
class gen_fluid
{
private:
const ISMConstants SMConstants;

public:
[[deprecated("Will call gen_fluid with GetSMConstants(). Please use the "
"detailed overload "
"to ensure consistent SM constants through all "
"routines.")]] gen_fluid();
gen_fluid(const ISMConstants &smConstants);
int bot_mass_flag;
int tau_mass_flag =
1; // Changing to zero for massless tau leptons --> might cause problems!
Expand Down Expand Up @@ -394,9 +407,9 @@ class gen_fluid
double gprime = 0.36;
double alphaS = 1. / 7;
double alphaW = 1. / 30;
double mtop_0 = C_MassTop;
double mbot_0 = C_MassBottom;
double mtau_0 = C_MassTau;
double mtop_0{0};
double mbot_0{0};
double mtau_0{0};

/**
* @brief Dq Diffusion constant of quarks.
Expand Down
9 changes: 8 additions & 1 deletion include/BSMPT/baryo_calculation/Fluid_Type/tau_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#define TAU_SOURCE_H

// Copyright (C) 2020 Philipp Basler, Margarete Mühlleitner and Jonas Müller
// SPDX-FileCopyrightText: 2021 Philipp Basler, Margarete Mühlleitner and Jonas Müller
// SPDX-FileCopyrightText: 2021 Philipp Basler, Margarete Mühlleitner and Jonas
// Müller
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -32,6 +33,12 @@ class tau_source : public gen_fluid
{
private:
public:
[[deprecated("Will call tau_source with GetSMConstants(). Please use the "
"detailed overload "
"to ensure consistent SM constants through all "
"routines.")]] tau_source();

tau_source(const ISMConstants &smConstants);
/**
* @brief operator () Needed for the numerical solution via boost.
* @param omega Vector of all included (rescaled) chemical potentials
Expand Down
8 changes: 7 additions & 1 deletion include/BSMPT/baryo_calculation/Fluid_Type/top_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#define TOP_SOURCE_H

// Copyright (C) 2020 Philipp Basler, Margarete Mühlleitner and Jonas Müller
// SPDX-FileCopyrightText: 2021 Philipp Basler, Margarete Mühlleitner and Jonas Müller
// SPDX-FileCopyrightText: 2021 Philipp Basler, Margarete Mühlleitner and Jonas
// Müller
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -32,6 +33,11 @@ class top_source : public gen_fluid
{
private:
public:
[[deprecated("Will call top_source with GetSMConstants(). Please use the "
"detailed overload "
"to ensure consistent SM constants through all "
"routines.")]] top_source();
top_source(const ISMConstants &smConstants);
/**
* @brief operator () Needed for the numerical solution via boost.
* @param omega Vector of all included (rescaled) chemical potentials
Expand Down
34 changes: 33 additions & 1 deletion include/BSMPT/minimizer/MinimizePlane.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: 2021 Philipp Basler, Margarete Mühlleitner and Jonas Müller
// SPDX-FileCopyrightText: 2021 Philipp Basler, Margarete Mühlleitner and Jonas
// Müller
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -123,13 +124,44 @@ struct PointerContainerMinPlane
* @return MinimizePlaneReturn struct which has the minimum and the value of the
* potential
*/
[[deprecated("Will call MinimizePlane with GetSMConstants(). Please use the "
"detailed overload "
"to ensure consistent SM constants through all "
"routines.")]] MinimizePlaneReturn
MinimizePlane(const std::vector<double> &basepoint,
const std::vector<double> &VEVSymmetric,
const std::vector<double> &VEVBroken,
const ModelID::ModelIDs &Model,
const std::vector<double> &par,
const std::vector<double> &parCT,
const double &Temp,
const int &WhichMinimizer = WhichMinimizerDefault);

/**
* Calculates the minimum of a potential on a plane. For this the normal vector
* of the plane is calculated as the connection vector between the symmetric and
* the broken phase. At a given point the plane normal to the connection vector
* is then calculated and the potential is minimised along this plane.
* @param basepoint Parameter point at which the plane and the connection
* between the symmetric and the broken minimum should be calculated
* @param VEVSymmetric Symmetric minimum
* @param VEVBroken Broken minimum
* @param Model Decides which model should be used through FChoose
* @param par Inputparameters for the parameterpoint
* @param parCT Counterterm parameters for the parameterpoint
* @param SMConstant The SM constants used by the parameter point
* @param Temp Temperature at which the minimum should be calculated
* @return MinimizePlaneReturn struct which has the minimum and the value of the
* potential
*/
MinimizePlaneReturn
MinimizePlane(const std::vector<double> &basepoint,
const std::vector<double> &VEVSymmetric,
const std::vector<double> &VEVBroken,
const ModelID::ModelIDs &Model,
const std::vector<double> &par,
const std::vector<double> &parCT,
const ISMConstants &SMConstant,
const double &Temp,
const int &WhichMinimizer = WhichMinimizerDefault);
/**
Expand Down
26 changes: 26 additions & 0 deletions include/BSMPT/minimizer/Minimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,36 @@ PTFinder_gen_all(const std::shared_ptr<Class_Potential_Origin> &modelPointer,
* = NLOPT, to use multiple add the numbers
* @return the global minimum
*/
[[deprecated("Will call Minimize_gen_all_tree_level with GetSMConstants(). "
"Please use the "
"detailed overload "
"to ensure consistent SM constants through all "
"routines.")]] std::vector<double>
Minimize_gen_all_tree_level(const ModelID::ModelIDs &Model,
const std::vector<double> &par,
const std::vector<double> &parCT,
std::vector<double> &Check,
const std::vector<double> &start,
int WhichMinimizer = WhichMinimizerDefault,
bool UseMultithreading = true);

/**
* @brief Minimize_gen_all_tree_level Minimizes the tree-level potential
* @param Model Which Model to minimize
* @param par parameters of the point
* @param parCT counterterm parameters
* @param SMConstants The SM Constants used for the minimisation
* @param Check Vector to safe the error flags during the minimization
* @param start Starting point for the minimization
* @param WhichMinimizer Which minimizers should be taken? 1 = CMAES, 2 = GSL, 4
* = NLOPT, to use multiple add the numbers
* @return the global minimum
*/
std::vector<double>
Minimize_gen_all_tree_level(const ModelID::ModelIDs &Model,
const std::vector<double> &par,
const std::vector<double> &parCT,
const ISMConstants &SMConstants,
std::vector<double> &Check,
const std::vector<double> &start,
int WhichMinimizer = WhichMinimizerDefault,
Expand Down
9 changes: 5 additions & 4 deletions include/BSMPT/models/ClassPotentialC2HDM.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (C) 2018 Philipp Basler and Margarete Mühlleitner
// SPDX-FileCopyrightText: 2021 Philipp Basler, Margarete Mühlleitner and Jonas Müller
// SPDX-FileCopyrightText: 2021 Philipp Basler, Margarete Mühlleitner and Jonas
// Müller
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -77,7 +78,7 @@ namespace Models
class Class_Potential_C2HDM : public Class_Potential_Origin
{
public:
Class_Potential_C2HDM();
Class_Potential_C2HDM(const ISMConstants &smConstants);
virtual ~Class_Potential_C2HDM() override;

bool UseHsmNotationInTripleHiggs = false;
Expand All @@ -88,7 +89,7 @@ class Class_Potential_C2HDM : public Class_Potential_Origin
Du1CT = 0, DRu3CT = 0;
double DIL5CT = 0, DIu3CT = 0;
double DT1 = 0, DT2 = 0, DT3 = 0, DTCharged = 0;
double DIL6CT=0;
double DIL6CT = 0;
double TanBeta = 0, C_CosBeta = 0, C_SinBeta = 0, C_CosBetaSquared = 0,
C_SinBetaSquared = 0;
double beta = 0;
Expand All @@ -97,7 +98,7 @@ class Class_Potential_C2HDM : public Class_Potential_Origin
double CTempC1 = 0, CTempC2 = 0, CTempCS = 0;
double R_Hh_1 = 0, R_Hh_2 = 0, R_Hh_3 = 0, R_Hl_1 = 0, R_Hl_2 = 0, R_Hl_3 = 0,
R_Hsm_1 = 0, R_Hsm_2 = 0, R_Hsm_3 = 0;

void ReadAndSet(const std::string &linestr,
std::vector<double> &par) override;
std::vector<std::string> addLegendCT() const override;
Expand Down
2 changes: 1 addition & 1 deletion include/BSMPT/models/ClassPotentialCPintheDark.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ namespace Models
class Class_Potential_CPintheDark : public Class_Potential_Origin
{
public:
Class_Potential_CPintheDark();
Class_Potential_CPintheDark(const ISMConstants &smConstants);
virtual ~Class_Potential_CPintheDark();

// parameters of scalar potential
Expand Down
Loading

5 comments on commit e926240

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'C++ Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: e926240 Previous: dfaeb8e Ratio
BM_EWPT/repeats:5_stddev 780149642.4816339 ns/iter 178286284.74625245 ns/iter 4.38
BM_EWPT/repeats:5_cv 0.1440596843216325 ns/iter 0.032388508812073925 ns/iter 4.45

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'C++ Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: e926240 Previous: dfaeb8e Ratio
BM_EWPT/repeats:5 8831983141.000023 ns/iter 5810820420.000028 ns/iter 1.52
BM_EWPT/repeats:5_stddev 864416702.7439226 ns/iter 178286284.74625245 ns/iter 4.85
BM_EWPT/repeats:5_cv 0.11862396192851732 ns/iter 0.032388508812073925 ns/iter 3.66
BM_EWBG/repeats:5_stddev 2048817283.8253517 ns/iter 1365101223.597942 ns/iter 1.50

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'C++ Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: e926240 Previous: dfaeb8e Ratio
BM_EWPT/repeats:5_stddev 611111666.5153555 ns/iter 178286284.74625245 ns/iter 3.43
BM_EWPT/repeats:5_cv 0.12115012947255006 ns/iter 0.032388508812073925 ns/iter 3.74

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'C++ Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: e926240 Previous: cc87ed0 Ratio
BM_EWPT/repeats:5_stddev 654152015.1279104 ns/iter 115056335.3931975 ns/iter 5.69
BM_EWPT/repeats:5_cv 0.12310570253100407 ns/iter 0.022779672907023017 ns/iter 5.40

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'C++ Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: e926240 Previous: cc87ed0 Ratio
BM_EWPT/repeats:5_cv 0.14444837149832176 ns/iter 0.0761819726454681 ns/iter 1.90

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.