Skip to content

Commit 6aae14e

Browse files
authored
Merge pull request #334 from GambitBSM/CosmoBit_ACROPOLIS
CosmoALP merge
2 parents fd89d08 + b22aab9 commit 6aae14e

135 files changed

Lines changed: 55869 additions & 3328 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Models/src/particle_database.cpp
6666
# Makefiles generated by configure in contributed packages
6767
contrib/**/Makefile*
6868
contrib/MassSpectra/flexiblesusy/config/depgen.x
69+
contrib/MassSpectra/flexiblesusy/config/flexiblesusy-version
6970
contrib/pybind11/
7071

7172
# Local configuration files
@@ -91,3 +92,6 @@ gum/mathematica
9192
gum/include/cmake_variables.hpp
9293
gum/src/cmake_variables.py
9394

95+
# Files generated by the citation system
96+
GAMBIT.bib
97+
GAMBIT.tex

Backends/include/gambit/Backends/backend_types/AlterBBN.hpp

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
/// (pat.scott@uq.edu.au)
1818
/// \date 2020 Apr
1919
///
20+
/// \author Tomas Gonzalo
21+
/// (gonzalo@physik.rwth-aachen.de)
22+
/// \date 2022 Jan
23+
///
2024
/// *********************************************
2125

2226
#ifndef __AlterBBN_types_hpp__
@@ -62,7 +66,8 @@ namespace Gambit
6266
void set_abund_map(map_str_int map_in) {abund_map = map_in;}
6367

6468
/// Setter functions for abundance vector
65-
void set_BBN_abund(int pos, double val) {BBN_abund[pos] = val;}
69+
void set_BBN_abund(int pos, double val) {BBN_abund[pos].central = val;}
70+
void set_BBN_abund(int pos, triplet<double> val) {BBN_abund[pos] = val;}
6671

6772
/// Setter function for covariance matrix
6873
void set_BBN_covmat(int row, int col, double val) {BBN_covmat[row][col] = val;}
@@ -74,10 +79,14 @@ namespace Gambit
7479
const std::map<std::string,int>& get_abund_map() const {return abund_map;};
7580

7681
/// Getter for abundance
77-
double get_BBN_abund(int pos) const {return BBN_abund[pos];}
82+
double get_BBN_abund(int pos) const {return BBN_abund[pos].central;}
83+
double get_BBN_abund_upper(int pos) const {return BBN_abund[pos].upper;}
84+
double get_BBN_abund_lower(int pos) const {return BBN_abund[pos].lower;}
7885

7986
/// Getter for abundance
80-
double get_BBN_abund(str iso) const {return BBN_abund[abund_map.at(iso)];}
87+
double get_BBN_abund(str iso) const {return BBN_abund[abund_map.at(iso)].central;}
88+
double get_BBN_abund_upper(str iso) const {return BBN_abund[abund_map.at(iso)].upper;}
89+
double get_BBN_abund_lower(str iso) const {return BBN_abund[abund_map.at(iso)].lower;}
8190

8291
/// Getter for covariance matrix
8392
double get_BBN_covmat(int row, int col) const {return BBN_covmat[row][col];}
@@ -103,15 +112,29 @@ namespace Gambit
103112
/// Getter for indices of active isotopes in BBN_abundance vector
104113
const std::set<int>& get_active_isotope_indices() const {return active_isotope_indices;}
105114

115+
/// Check whether there is any non-zero upper or lower abundance
116+
bool has_BBN_abund_upper() const {return std::any_of(BBN_abund.begin(), BBN_abund.end(), [](triplet<double> i){return i.upper > 0;});}
117+
bool has_BBN_abund_lower() const {return std::any_of(BBN_abund.begin(), BBN_abund.end(), [](triplet<double> i){return i.lower > 0;});}
118+
106119
private:
107120
size_t NNUC;
108-
std::vector<double> BBN_abund;
121+
std::vector<triplet<double>> BBN_abund;
109122
std::vector<std::vector<double>> BBN_covmat;
110123
std::map<str,int> abund_map;
111124
std::set<str> active_isotopes;
112125
std::set<int> active_isotope_indices;
113126
};
114127

128+
inline std::ostream& operator << (std::ostream& os, const BBN_container& bbn)
129+
{
130+
std::set<str> isotopes = bbn.get_active_isotopes();
131+
for(auto it=isotopes.begin(); it!=isotopes.end(); it++)
132+
{
133+
os << *it << ": " << bbn.get_BBN_abund(*it) << " ";
134+
}
135+
return os;
136+
}
137+
115138
// Version dependent declarations of 'relicparam' and 'errorparam' start here
116139
namespace AlterBBN_2_2
117140
{
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// GAMBIT: Global and Modular BSM Inference Tool
2+
// *********************************************
3+
/// \file
4+
///
5+
/// Frontend header for the Acropolis backend
6+
///
7+
/// Compile-time registration of available
8+
/// functions and variables from this backend.
9+
///
10+
/// *********************************************
11+
///
12+
/// Authors (add name and date if you modify):
13+
///
14+
/// \author Patrick Stoecker
15+
/// (stoecker@physik.rwth-aachen.de)
16+
/// \date 2021 Oct
17+
///
18+
/// \author Tomas Gonzalo
19+
/// (gonzalo@physik.rwth-aachen.de)
20+
/// \date 2021 Oct
21+
///
22+
/// *********************************************
23+
24+
#define BACKENDNAME Acropolis
25+
#define BACKENDLANG Python3
26+
#define VERSION 1.2.1
27+
#define SAFE_VERSION 1_2_1
28+
#define REFERENCE Depta:2020mhj,Depta:2020zbh,Hufnagel:2018bjp
29+
30+
LOAD_LIBRARY
31+
32+
#ifdef HAVE_PYBIND11
33+
34+
BE_CONV_FUNCTION(set_input_params, void, (bool,int,int,double), "set_input_params")
35+
BE_CONV_FUNCTION(abundance_photodisintegration_decay, void,(double*,double*,double*,double*,double,double,double,double,double,int), "abundance_photodisintegration_decay")
36+
37+
#endif
38+
39+
// Undefine macros to avoid conflict with other backends
40+
#include "gambit/Backends/backend_undefs.hpp"

Backends/include/gambit/Backends/frontends/AlterBBN_2_2.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
/// (pat.scott@uq.edu.au)
2121
/// \date 2020 Apr
2222
///
23+
/// \author Tomas Gonzalo
24+
/// (gonzalo@physik.rwth-aachen.de)
25+
/// \date 2022 Jan
26+
///
2327
/// *********************************************
2428

2529

@@ -33,11 +37,13 @@ LOAD_LIBRARY
3337

3438
BE_FUNCTION(Init_cosmomodel, void, (AlterBBN_2_2::relicparam*), "Init_cosmomodel", "Init_cosmomodel")
3539
BE_FUNCTION(nucl_err, int, (AlterBBN_2_2::relicparam*,double*,double*), "nucl_err", "nucl_err")
40+
BE_FUNCTION(nucl, int, (AlterBBN_2_2::relicparam*,double*), "nucl", "nucl")
3641

3742
BE_CONV_FUNCTION(get_NNUC, size_t, (), "get_NNUC")
3843
BE_CONV_FUNCTION(get_abund_map_AlterBBN, map_str_int, (), "get_abund_map_AlterBBN")
3944
BE_CONV_FUNCTION(fill_cosmomodel, void, (AlterBBN_2_2::relicparam*, map_str_dbl &), "Init_AlterBBN")
4045
BE_CONV_FUNCTION(call_nucl_err, int, (map_str_dbl&,double*,double*), "call_nucl_err")
46+
BE_CONV_FUNCTION(call_nucl, int, (map_str_dbl&,double*), "call_nucl")
4147

4248
// Undefine macros to avoid conflict with other backends
4349
#include "gambit/Backends/backend_undefs.hpp"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// GAMBIT: Global and Modular BSM Inference Tool
2+
// *********************************************
3+
/// \file
4+
///
5+
/// Frontend header for the MontePython backend.
6+
///
7+
/// *********************************************
8+
///
9+
/// Authors (add name and date if you modify):
10+
///
11+
/// \author Janina Renk
12+
/// (janina.renk@fysik.su.se)
13+
/// \date 2019 June, 2020 May
14+
///
15+
/// \author Sanjay Bloor
16+
/// (sanjay.bloor12@imperial.ac.uk)
17+
/// \date 2019 June
18+
///
19+
/// \author Pat Scott
20+
/// (pat.scott@uq.edu.au)
21+
/// \date 2020 Apr
22+
///
23+
/// \author Patrick Stoecker
24+
/// (stoecker@physik.rwth-aachen.de)
25+
/// \date 2021 Sep
26+
///
27+
/// *********************************************
28+
29+
#define BACKENDNAME MontePythonLike
30+
#define BACKENDLANG Python
31+
#define VERSION 3.5.0
32+
#define SAFE_VERSION 3_5_0
33+
#define REFERENCE Audren:2012wb,Brinckmann:2018cvx
34+
35+
LOAD_LIBRARY
36+
37+
#ifdef HAVE_PYBIND11
38+
39+
BE_CONV_FUNCTION(get_MP_available_likelihoods, std::vector<str>, (), "get_MP_available_likelihoods")
40+
BE_CONV_FUNCTION(check_likelihood_classy_combi, void, (str&,str&), "check_likelihood_classy_combi")
41+
BE_CONV_FUNCTION(check_likelihood_support, void, (str&), "check_likelihood_support")
42+
BE_CONV_FUNCTION(get_MP_loglike, double, (const MPLike_data_container&, pybind11::object&, std::string&), "get_MP_loglike")
43+
BE_CONV_FUNCTION(create_MP_data_object, pybind11::object, (map_str_str&), "create_MP_data_object")
44+
BE_CONV_FUNCTION(create_MP_likelihood_objects, map_str_pyobj, (pybind11::object&, map_str_str&), "create_MP_likelihood_objects")
45+
46+
#endif
47+
48+
// Undefine macros to avoid conflict with other backends
49+
#include "gambit/Backends/backend_undefs.hpp"

Backends/include/gambit/Backends/frontends/classy_2_6_3.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
/// \author Patrick Stoecker
2121
/// (stoecker@physik.rwth-aachen.de)
2222
/// \date 2019 July
23+
/// \date 2021 January
2324
///
2425
/// *********************************************
2526

@@ -37,6 +38,8 @@ LOAD_LIBRARY
3738
BE_CONV_FUNCTION(get_classy_backendDir, std::string, (), "get_classy_backendDir")
3839

3940
BE_CONV_FUNCTION(class_get_rs, double, (), "class_get_rs")
41+
BE_CONV_FUNCTION(class_get_tau_reio, double, (), "class_get_tau_reio")
42+
BE_CONV_FUNCTION(class_get_z_reio, double, (), "class_get_z_reio")
4043
BE_CONV_FUNCTION(class_get_Neff, double, (), "class_get_Neff")
4144
BE_CONV_FUNCTION(class_get_sigma8, double, (), "class_get_sigma8")
4245
BE_CONV_FUNCTION(class_get_Omega0_r, double, (), "class_get_Omega0_r")

Backends/include/gambit/Backends/frontends/classy_2_9_3.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
/// \author Patrick Stoecker
2121
/// (stoecker@physik.rwth-aachen.de)
2222
/// \date 2019 July
23+
/// \date 2021 January
2324
///
2425
/// *********************************************
2526

@@ -37,6 +38,8 @@ LOAD_LIBRARY
3738
BE_CONV_FUNCTION(get_classy_backendDir, std::string, (), "get_classy_backendDir")
3839

3940
BE_CONV_FUNCTION(class_get_rs, double, (), "class_get_rs")
41+
BE_CONV_FUNCTION(class_get_tau_reio, double, (), "class_get_tau_reio")
42+
BE_CONV_FUNCTION(class_get_z_reio, double, (), "class_get_z_reio")
4043
BE_CONV_FUNCTION(class_get_Neff, double, (), "class_get_Neff")
4144
BE_CONV_FUNCTION(class_get_sigma8, double, (), "class_get_sigma8")
4245
BE_CONV_FUNCTION(class_get_Omega0_r, double, (), "class_get_Omega0_r")

Backends/include/gambit/Backends/frontends/classy_2_9_4.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
/// \author Patrick Stoecker
2121
/// (stoecker@physik.rwth-aachen.de)
2222
/// \date 2019 July
23+
/// \date 2021 January
2324
///
2425
/// *********************************************
2526

@@ -37,6 +38,8 @@ LOAD_LIBRARY
3738
BE_CONV_FUNCTION(get_classy_backendDir, std::string, (), "get_classy_backendDir")
3839

3940
BE_CONV_FUNCTION(class_get_rs, double, (), "class_get_rs")
41+
BE_CONV_FUNCTION(class_get_tau_reio, double, (), "class_get_tau_reio")
42+
BE_CONV_FUNCTION(class_get_z_reio, double, (), "class_get_z_reio")
4043
BE_CONV_FUNCTION(class_get_Neff, double, (), "class_get_Neff")
4144
BE_CONV_FUNCTION(class_get_sigma8, double, (), "class_get_sigma8")
4245
BE_CONV_FUNCTION(class_get_Omega0_r, double, (), "class_get_Omega0_r")
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// GAMBIT: Global and Modular BSM Inference Tool
2+
// *********************************************
3+
/// \file
4+
///
5+
/// Frontend header for the classy backend.
6+
///
7+
/// *********************************************
8+
///
9+
/// Authors (add name and date if you modify):
10+
///
11+
/// \author Janina Renk
12+
/// (janina.renk@fysik.su.se)
13+
/// \date 2019 June
14+
/// \date 2020 July,Aug
15+
///
16+
/// \author Sanjay Bloor
17+
/// (sanjay.bloor12@imperial.ac.uk)
18+
/// \date 2019 June
19+
///
20+
/// \author Patrick Stoecker
21+
/// (stoecker@physik.rwth-aachen.de)
22+
/// \date 2019 July
23+
/// \date 2020 Nov
24+
/// \date 2021 Jan, Mar, Sep
25+
///
26+
/// *********************************************
27+
28+
#define BACKENDNAME classy
29+
#define BACKENDLANG Python
30+
#define VERSION 3.1.0
31+
#define SAFE_VERSION 3_1_0
32+
#define REFERENCE Blas:2011rf,Lucca:2019rxf
33+
34+
LOAD_LIBRARY
35+
36+
#ifdef HAVE_PYBIND11
37+
38+
BE_CONV_FUNCTION(get_classy_cosmo_object, pybind11::object, (), "get_classy_cosmo_object")
39+
BE_CONV_FUNCTION(get_classy_backendDir, std::string, (), "get_classy_backendDir")
40+
41+
BE_CONV_FUNCTION(class_get_rs, double, (), "class_get_rs")
42+
BE_CONV_FUNCTION(class_get_tau_reio, double, (), "class_get_tau_reio")
43+
BE_CONV_FUNCTION(class_get_z_reio, double, (), "class_get_z_reio")
44+
BE_CONV_FUNCTION(class_get_Neff, double, (), "class_get_Neff")
45+
BE_CONV_FUNCTION(class_get_sigma8, double, (), "class_get_sigma8")
46+
BE_CONV_FUNCTION(class_get_Omega0_r, double, (), "class_get_Omega0_r")
47+
BE_CONV_FUNCTION(class_get_Omega0_ur, double, (), "class_get_Omega0_ur")
48+
BE_CONV_FUNCTION(class_get_Omega0_m, double, (), "class_get_Omega0_m")
49+
BE_CONV_FUNCTION(class_get_Omega0_ncdm_tot, double, (), "class_get_Omega0_ncdm_tot")
50+
BE_CONV_FUNCTION(class_get_Omega0_Lambda, double, (), "class_get_Omega0_Lambda")
51+
BE_CONV_FUNCTION(class_get_H0, double, (), "class_get_H0")
52+
BE_CONV_FUNCTION(class_get_Da, double, (double), "class_get_Da")
53+
BE_CONV_FUNCTION(class_get_Dl, double, (double), "class_get_Dl")
54+
BE_CONV_FUNCTION(class_get_Hz, double, (double), "class_get_Hz")
55+
BE_CONV_FUNCTION(class_get_tz, double, (double), "class_get_tz")
56+
57+
BE_CONV_FUNCTION(class_get_lensed_cl, std::vector<double>, (str), "class_get_lensed_cl")
58+
BE_CONV_FUNCTION(class_get_unlensed_cl, std::vector<double>, (str), "class_get_unlensed_cl")
59+
BE_CONV_FUNCTION(class_get_scale_independent_growth_factor, double, (double), "class_get_scale_independent_growth_factor")
60+
BE_CONV_FUNCTION(class_get_scale_independent_growth_factor_f, double, (double), "class_get_scale_independent_growth_factor_f")
61+
62+
BE_INI_DEPENDENCY(classy_input_params, Classy_input)
63+
64+
#endif
65+
66+
// Undefine macros to avoid conflict with other backends
67+
#include "gambit/Backends/backend_undefs.hpp"

Backends/include/gambit/Backends/frontends/classy_exo_2_7_2.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
/// (stoecker@physik.rwth-aachen.de)
2222
/// \date 2019 July
2323
/// \date 2020 January
24+
/// \date 2021 January
2425
///
2526
/// *********************************************
2627

@@ -38,6 +39,8 @@ LOAD_LIBRARY
3839
BE_CONV_FUNCTION(get_classy_backendDir, std::string, (), "get_classy_backendDir")
3940

4041
BE_CONV_FUNCTION(class_get_rs, double, (), "class_get_rs")
42+
BE_CONV_FUNCTION(class_get_tau_reio, double, (), "class_get_tau_reio")
43+
BE_CONV_FUNCTION(class_get_z_reio, double, (), "class_get_z_reio")
4144
BE_CONV_FUNCTION(class_get_Neff, double, (), "class_get_Neff")
4245
BE_CONV_FUNCTION(class_get_sigma8, double, (), "class_get_sigma8")
4346
BE_CONV_FUNCTION(class_get_Omega0_r, double, (), "class_get_Omega0_r")

0 commit comments

Comments
 (0)