Giter Club home page Giter Club logo

symbolic_pofk's Introduction

symbolic_pofk

arXiv arXiv

Precise symbolic emulators of the linear and non-linear matter power spectra and for the conversion $\sigma_8 \leftrightarrow A_{\rm s}$ as a function of cosmology. Here we give the emulators as simple python functions and as a fortran90 routine, but these can be easily copied, pasted and modified to the language of your choice. Please see Bartlett et al. 2023 and Bartlett et al. 2024 for further details.

By default, outside the $k$ range tested in Bartlett et al. 2023, we use the Eisenstein & Hu fit which includes baryons. This can be switched off by setting extrapolate=False in the functions plin_emulated(), logF_max_precision() and logF_fiducial().

Installation

To install the emulators and the dependencies, run the following

git clone [email protected]:DeaglanBartlett/symbolic_pofk.git
pip install -e symbolic_pofk

If you wish to use the fortran version of the code, running the script

./setup_fortran.sh

will compile the fortran code and will produce a python wrapper for this.

Examples

We give an example for how to use the linear emulator in examples/linear_example.py. and the non-linear emulator in examples/halofit_example.py.

The example examples/fortran_example.py shows how to run the fortran code with the python wrapper, and compares the difference between the python and fortran implementations (they are identical up to a fractional difference of O(1e-6), which is much smaller than the error on the emulation).

Citation

If you use any of the emulators in this repository, please cite the following paper

@ARTICLE{symbolic_pofk,
     author = {{Bartlett}, D.~J. and {Kammerer}, L. and {Kronberger}, G. and {Desmond}, H.
               and {Ferreira}, P.~G. and {Wandelt}, B.~D. and {Burlacu}, B.
               and {Alonso}, D. and {Zennaro}, M.},
      title = "{A precise symbolic emulator for the linear matter power spectrum}",
    journal = {arXiv e-prints},
   keywords = {Astrophysics - Cosmology and Nongalactic Astrophysics},
       year = 2023,
      month = nov,
        eid = {arXiv:2311.15865},
      pages = {arXiv:2311.15865},
        doi = {10.48550/arXiv.2311.15865},
archivePrefix = {arXiv},
     eprint = {2311.15865},
primaryClass = {astro-ph.CO},
        url = {https://arxiv.org/abs/2311.15865},
}

and if you use the non-linear emulator, please also cite the following paper

@ARTICLE{syren_halofit,
     author = {{Bartlett}, D.~J. and {Wandelt}, B.~D. and {Zennaro}, M.
		and {Ferreira}, P.~G. and {Desmond}, H.},  
      title = "{syren-halofit: A fast, interpretable, high-precision formula for
	the LCDM nonlinear matter power spectrum}",
    journal = {arXiv e-prints},
   keywords = {Astrophysics - Cosmology and Nongalactic Astrophysics},
       year = 2024,
      month = feb,
        eid = {arXiv:2402.17492},
      pages = {arXiv:2402.17492},
        doi = {10.48550/arXiv.2402.17492},
archivePrefix = {arXiv},
     eprint = {2402.17492},
primaryClass = {astro-ph.CO},
        url = {https://arxiv.org/abs/2402.17492},
}

The software is available on the MIT licence:

Copyright 2024 Deaglan J. Bartlett

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Acknowledgements

DJB is supported by the Simons Collaboration on "Learning the Universe".

symbolic_pofk's People

Contributors

deaglanbartlett avatar

Stargazers

Ce Sui avatar Tristan Hoellinger avatar Zhao Chen (陈钊) avatar Marco Bonici avatar Alberto Acuto avatar zhaoruiyang98 avatar Jamie Donald-McCann avatar

Watchers

 avatar

symbolic_pofk's Issues

Remove colossus dependence from linear P(k)

It is straightforward to write the Eisenstein & Hu part of the linear P(k) in fortran, so this should also be rewritten in python to remove the number of dependencies on other packages

Upgrade sigma8 emulator

In the original version of the linear P(k) paper, the equation for $\sigma_8$ was linear between $\sigma_8$ and $A_{\rm s}$ when the other cosmological parameters were fixed. This is not physically correct, and should have been $\sigma_8 \propto \sqrt{A_{\rm s}}$. A new equation was found for the published version of the paper and v2 on arXiv which obeys this, but needs to be updated in this package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.