Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
be3a706
Created branch and XCode project
EBHolm Oct 25, 2023
df3cbd8
Implemented background; _solve needs work
EBHolm Oct 25, 2023
6e7938f
Implemented input
EBHolm Oct 25, 2023
aedb5e6
Small changes to background
EBHolm Oct 25, 2023
2ebb427
Fixed shooting bug introduced in class_public
EBHolm Oct 25, 2023
a7a87d5
New XCode project
EBHolm Oct 25, 2023
b7abd33
Fixes
EBHolm Oct 25, 2023
c1e1d10
Final shooting fix
EBHolm Oct 25, 2023
baa365f
Implemented z_decay peak-finding and shooting
EBHolm Oct 27, 2023
a5ef61b
Fully working 2d shooting
EBHolm Oct 31, 2023
fefcc9a
Implemented trigger fluid approx, but bugs shootin
EBHolm Oct 31, 2023
de7396a
Default is now no trigger fluid approx
EBHolm Oct 31, 2023
fee5fbb
Forgot .h in fluid approximation
EBHolm Oct 31, 2023
12807a3
Recovered no-fluid as default
EBHolm Oct 31, 2023
d432a5e
Updates to FA
EBHolm Nov 1, 2023
66243ba
Implemented background approximation switching
EBHolm Nov 2, 2023
7c65f17
Progress on perturbations
EBHolm Nov 2, 2023
203b01f
Changes to XCode project
EBHolm Dec 19, 2023
665e604
Finished perturbations, needs testing
EBHolm Jan 5, 2024
83060c7
Implemented plot_gauge flag
EBHolm Jan 5, 2024
d2094e8
Forgot some changes
EBHolm Jan 5, 2024
6b2915d
Fixed bug
EBHolm Feb 8, 2024
1a047ed
Updates
EBHolm Feb 8, 2024
754ceed
Import RKDP45 evolver from LASAGNA
EBHolm Feb 8, 2024
9ce2a02
Fixed shooting with half-stepping iterations
EBHolm Feb 9, 2024
fbee848
Added rkdp to XCode project
EBHolm Feb 9, 2024
34e3b58
Small update
EBHolm Feb 9, 2024
d443c83
Fixed perturbs plotting bug
EBHolm Feb 22, 2024
1452f5d
Perts fixed?
EBHolm Feb 22, 2024
894d947
Plotting fluid quantities
EBHolm Feb 23, 2024
87c95e5
Compute phi and phi_prime after TFA
EBHolm Mar 4, 2024
5be71f3
Further changes?
EBHolm Mar 4, 2024
cd57831
Delayed onset of BG trigger fluid approx
EBHolm Mar 5, 2024
1bff345
Commented out print
EBHolm Mar 5, 2024
29526f8
Adjusted delayed trigger FA criterion
EBHolm Mar 5, 2024
8d64fef
Changes to bg
EBHolm Mar 5, 2024
0e2cfcc
Adjusted guess for robustness
EBHolm Mar 8, 2024
d11b830
Made cosmosevereerrro into non-severe error
EBHolm Mar 12, 2024
174227a
Fixed S8 shooting bug
EBHolm Mar 19, 2024
77facdd
Fixed settings precision parameters
EBHolm Mar 20, 2024
5d7d9a8
Last fixes to shooting bug
EBHolm Mar 20, 2024
4cf09d0
Cleanup of NEDE implementation
EBHolm Mar 20, 2024
0092a81
Final fixes to shooting
EBHolm Mar 21, 2024
719ddac
Fixed ugly bug where S8 was not indicated read
EBHolm Mar 21, 2024
ba379ab
Restructured input and parser functions
EBHolm Mar 22, 2024
0a252b8
Only activate trigger FA is NEDE has decayed
EBHolm Mar 22, 2024
e2e1fca
Fixed setting fluid_approximation False initially
Mar 26, 2024
c17c0d6
Maybe fixed bug
EBHolm Mar 26, 2024
9788cff
Added some derived parameters
Mar 26, 2024
a47b664
Fixed reading error when shooting failed
Mar 26, 2024
75b23e9
Fix
EBHolm Apr 18, 2024
584a4e5
Implemented twice linear NEDE sound speed params
EBHolm Apr 18, 2024
b90e6e1
Small fix
EBHolm Apr 18, 2024
c039a28
Removed not-needed error throw
EBHolm Apr 19, 2024
cef2d40
Error message when negative sound speed
EBHolm Apr 22, 2024
27da445
Warning fixes
EBHolm May 22, 2024
701e612
Removed unneeded imports
EBHolm May 22, 2024
a2dd1f8
Added notebook, input folder and montepython_tree
EBHolm Aug 22, 2024
5168f73
Updated README
EBHolm Aug 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ endif
%.o: %.c .base $(HEADERFILES)
cd $(WRKDIR);$(CC) $(OPTFLAG) $(OMPFLAG) $(CCFLAG) $(INCLUDES) -c ../$< -o $*.o

TOOLS = growTable.o dei_rkck.o sparse.o evolver_rkck.o evolver_ndf15.o arrays.o parser.o quadrature.o hyperspherical.o common.o trigonometric_integrals.o
TOOLS = growTable.o dei_rkck.o sparse.o evolver_rkck.o evolver_rkdp45.o evolver_ndf15.o arrays.o parser.o quadrature.o hyperspherical.o common.o trigonometric_integrals.o

SOURCE = input.o background.o thermodynamics.o perturbations.o primordial.o fourier.o transfer.o harmonic.o lensing.o distortions.o

Expand Down
123 changes: 27 additions & 96 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,120 +1,51 @@
CLASS: Cosmic Linear Anisotropy Solving System {#mainpage}
TriggerCLASS
==============================================
forked from CLASS by Julien Lesgourgues and Thomas Tram; see http://class-code.net and https://github.com/lesgourg/class_public

Authors: Julien Lesgourgues, Thomas Tram, Nils Schoeneberg
TriggerCLASS is a modification of CLASS that implements an instant phase transition in a new fluid component that goes from a cosmological constant phase to a decaying phase. The transition is triggered by a sub-dominant clock field that carries adiabatic fluctiations. As such, it describes the physics of the New Early Dark Energy (NEDE) and Hybrid Early Dark Energy model. The details of the implementation have been explained in the methodology part of https://arxiv.org/abs/2006.06686 and through many additional comments in the code tagged with "NEDE".

with several major inputs from other people, especially Benjamin
Audren, Simon Prunet, Jesus Torrado, Miguel Zumalacarregui, Francesco
Montanari, Deanna Hooper, Samuel Brieden, Daniel Meinert, Matteo Lucca, etc.
The version used for the publications ArXiv: 1910.10739, 2006.06686, 2009.00006 has been tagged with "NewEDEv3.0".
The version used for the publication ArXiv: 2209.02708 has been tagged with "NewEDEv4".

For download and information, see http://class-code.net
__New in version 7.0 [31 July 2024]__: Rebased TriggerCLASS on version 3.2.1 of class_public with the SHA 997d1ac0b64d11439948a0cc13f719ef427f87be (older versions of TriggerCLASS are based on the older version 2 of class_public). This comes with the following modifications:
* New precision parameters: In CLASS versions >3, the implicit ndf15 integrator is used for the background evolution. This automatically increases precision around the NEDE decay time, so the precision parameters "decay_res_enhancement" and "trigger_resolution" have been removed.
* Added a background approximation switching logic that splits up the background evolution into two phases (before and after the trigger fluid approximation).
Ultimately, version 7.0 is faster than v6.1 by a factor of about 10 in the background and between 5 and 8 in the perturbations. The two codes have been tested against each other, and produce similar results in Cls and matter power spectrum to within 5 permille, a difference coming from the LambdaCDM sector difference in the two CLASS codes. with the precision settings given in input/NewEDE.ini and the NEDE notebook in the notebooks directory.

__New in version 6.1 [7 May 2023]__: TriggerCLASS now allows for Omega0_NEDE_trigger_DM as input, controlling the trigger abundance today (which contributes to DM).

Compiling CLASS and getting started
-----------------------------------

(the information below can also be found on the webpage, just below
the download button)

Download the code from the webpage and unpack the archive (tar -zxvf
class_vx.y.z.tar.gz), or clone it from
https://github.com/lesgourg/class_public. Go to the class directory
(cd class/ or class_public/ or class_vx.y.z/) and compile (make clean;
make class). You can usually speed up compilation with the option -j:
make -j class. If the first compilation attempt fails, you may need to
open the Makefile and adapt the name of the compiler (default: gcc),
of the optimization flag (default: -O4 -ffast-math) and of the OpenMP
flag (default: -fopenmp; this flag is facultative, you are free to
compile without OpenMP if you don't want parallel execution; note that
you need the version 4.2 or higher of gcc to be able to compile with
-fopenmp). Many more details on the CLASS compilation are given on the
wiki page

https://github.com/lesgourg/class_public/wiki/Installation

(in particular, for compiling on Mac >= 10.9 despite of the clang
incompatibility with OpenMP).
__New in version 5 [12 Oct 2022]__: TriggerCLASS now takes the decay redshift z_decay_NEDE (rather than the trigger mass) as input. The trigger mass is then determined via a shooting method. Output improvments and more detailed comments.

To check that the code runs, type:
__New in version 4 [20 Dec 2020]__: TriggerCLASS now accepts f_NEDE as input parameter (replaces Omega_NEDE). Introduced "tracking mode" for which the rest-frame sound speed equals the adiabatic sound speed (this feature has not been tested intensively yet). Output improvments and more detailed comments.

./class explanatory.ini

The explanatory.ini file is THE reference input file, containing and
explaining the use of all possible input parameters. We recommend to
read it, to keep it unchanged (for future reference), and to create
for your own purposes some shorter input files, containing only the
input lines which are useful for you. Input files must have a *.ini
extension. We provide an example of an input file containing a
selection of the most used parameters, default.ini, that you may use as a
starting point.
Compiling TriggerCLASS and getting started
-----------------------------------

If you want to play with the precision/speed of the code, you can use
one of the provided precision files (e.g. cl_permille.pre) or modify
one of them, and run with two input files, for instance:
In order to install TriggerCLASS, clone the branch "NewEDEv4" in a new folder and follow the same steps as required for the installation of the base CLASS code detailed in https://github.com/lesgourg/class_public. Also see the Wiki page:

./class test.ini cl_permille.pre
https://github.com/lesgourg/class_public/wiki/Installation

The files *.pre are suppposed to specify the precision parameters for
which you don't want to keep default values. If you find it more
convenient, you can pass these precision parameter values in your *.ini
file instead of an additional *.pre file.
For a successfull compilation adapt the compiler information in "Makefile" and "./python/setup.py". After compiling it, check that TriggerCLASS has been properly set up by running first

./class input/explanatory.ini

The automatically-generated documentation is located in
This corresponds to a standard LambdaCDM run. To check that the trigger component works correctly, type:

doc/manual/html/index.html
doc/manual/CLASS_manual.pdf
./class input/NewEDE.ini

On top of that, if you wish to modify the code, you will find lots of
comments directly in the files.
This should result in a run with a non-vanishing fraction of NEDE. The output should provide a detailed account of the NEDE parameters.
The NewEDE.ini also explains the NEDE input parameters.

Python
MCMC analysis
------

To use CLASS from python, or ipython notebooks, or from the Monte
Python parameter extraction code, you need to compile not only the
code, but also its python wrapper. This can be done by typing just
'make' instead of 'make class' (or for speeding up: 'make -j'). More
details on the wrapper and its compilation are found on the wiki page

https://github.com/lesgourg/class_public/wiki

Plotting utility
----------------

Since version 2.3, the package includes an improved plotting script
called CPU.py (Class Plotting Utility), written by Benjamin Audren and
Jesus Torrado. It can plot the Cl's, the P(k) or any other CLASS
output, for one or several models, as well as their ratio or percentage
difference. The syntax and list of available options is obtained by
typing 'pyhton CPU.py -h'. There is a similar script for MATLAB,
written by Thomas Tram. To use it, once in MATLAB, type 'help
plot_CLASS_output.m'

Developing the code
--------------------

If you want to develop the code, we suggest that you download it from
the github webpage

https://github.com/lesgourg/class_public

rather than from class-code.net. Then you will enjoy all the feature
of git repositories. You can even develop your own branch and get it
merged to the public distribution. For related instructions, check

https://github.com/lesgourg/class_public/wiki/Public-Contributing

Using the code
--------------

You can use CLASS freely, provided that in your publications, you cite
at least the paper `CLASS II: Approximation schemes <http://arxiv.org/abs/1104.2933>`. Feel free to cite more CLASS papers!
In order to perform a MCMC analysis, we recommend using MontePython, https://github.com/brinckmann/montepython_public, and follow their installation instructions. Our baseline MCMC run (as discussed in https://arxiv.org/abs/2006.06686) can be found under input/run_NEDE_canonical.param. To make it run, you first need to update MontePython with the files from the folder montepython_tree. In particular, this will update the data.py to translate the NEDE input parameters. The corresponding covariance matrix and bestfit file can be found in the respective subfolders covmat and bestfit.

Support
-------

To get support, please open a new issue on the
To get support, please open a new issue on

https://github.com/lesgourg/class_public
https://github.com/NEDE-Cosmo/TriggerCLASS

webpage!
Loading