Skip to main content

code for cosmological gravitational wave backgrounds

Project description

License: GPL v3 PyPI version

CosmoGW v1.0

CosmoGW is a Python package for the analysis and modeling of cosmological gravitational wave (GW) backgrounds from different sources in the early Universe, including analytical models, templates, and data analysis routines.

v1.0 (August 2025) focuses on the production of GWs from sound waves and MHD turbulence from cosmological phase transitions.

Other sources of GWs will be included in future versions, contact me if you are interested in contributing and becoming a developer.

CosmoGW is an extension of GW_turbulence, created in December 2021, used for calculations of GWs produced by MHD turbulence.


Contact

Author: Alberto Roper Pol
Email: alberto.roperpol@unige.ch
GitHub: albertoroperpol

If you use any of the cosmoGW results, please cite this repository, the [manual] (coming soon) and the relevant references listed in the routines.

Feel free to reach out for questions, issues, or collaboration! I would also love to hear about your interest for this project and your work, so feel free to reach out for questions, issues, or collaboration!


Installation

CosmoGW is a Python package that can be installed using pip from PyPI:

pip install cosmoGW

Or directly from GitHub (last version but not necessarily stable):

pip install git+https://github.com/cosmoGW/cosmoGW.git

Requirements:
Python >= 3.8, numpy, scipy, matplotlib, astropy, pandas

To use the plotting routines available in the tutorials and in plot_sets, make sure to install latex for Python:

sudo apt install cm-super dvipng texlive-latex-extra texlive-latex-recommended

File Structure

The main routines of cosmoGW are stored under src/cosmoGW:

  • cosmology.py: Cosmological calculations.
  • GW_analytical.py: Analytical calculations and mathematical functions.
  • GW_back.py: Functions for cosmological GW backgrounds.
  • GW_models.py: Theoretical and numerical models for sources of GWs.
  • GW_templates.py: Templates for GW backgrounds from different sources.
  • hydro_bubbles.py: Fluid perturbations from bubbles in first-order phase transitions.
  • interferometry.py: Response and sensitivity functions for GW detectors (LISA, Taiji).
  • utils.py: Utility functions and reference values for CosmoGW.
  • tests/: Unit tests and example data.
  • resources/: Data files used in the code (numerical data, sensitivity curves, ...)
  • tutorials/: Tutorials showing how to use CosmoGW for different applications.

Documentation

Comprehensive documentation is available at Read the Docs.

  • API Reference: Detailed documentation for all modules and functions.
  • Tutorials: Step-by-step guides and example workflows.
  • Theory: Background information and mathematical details.

To build the documentation locally:

cd docs
make html

Tutorials

Tutorials and example notebooks are available in the tutorials/ directory:

These tutorials can be run from Google Colab by loading the notebooks from GitHub.

When using Colab, latex needs to be installed, together with CosmoGW, for plotting routines. For the installation, uncomment and execute the first cell of the tutorials:

pip install cosmoGW
sudo apt-get update
sudo apt-get install -y cm-super dvipng texlive-latex-extra texlive-latex-recommended

Tests

Unit tests are provided in the tests/ directory.

To run all tests (from cosmoGW directory):

pytest

Make sure pytest is installed and that all required test data files are present in the tests directory.

Further test is available using the tutorial notebooks (see [python-package_nbs.yml]). To test the output plots and results from the notebooks run (e.g. from GWs_sound-waves tutorial):

pytest --nbval tutorials/GWs_sound-waves.ipynb

Make sure to have installed pytest, nbval and latex:

pip install pytest nbval
sudo apt install cm-super dvipng texlive-latex-extra texlive-latex-recommended

Resources

Data files are available in cosmoGW that are required by some of the libraries.

They are stored in src/cosmoGW/resources:

  • cosmology: Cosmological evolution files and Friedmann equation tutorial.
  • interferometry: Space-based GW interferometry calculations and tutorials.
  • detector_sensitivity: Sensitivity of various detectors; see the README.
  • higgsless: Data sets from Higgsless simulations of phase transitions.

📄 License

This project is licensed under the GNU General Public License v3 (GPLv3).


🚀 Enjoy exploring the early Universe with gravitational waves! 🪐

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cosmogw-0.0.36.tar.gz (5.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cosmogw-0.0.36-py3-none-any.whl (5.8 MB view details)

Uploaded Python 3

File details

Details for the file cosmogw-0.0.36.tar.gz.

File metadata

  • Download URL: cosmogw-0.0.36.tar.gz
  • Upload date:
  • Size: 5.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for cosmogw-0.0.36.tar.gz
Algorithm Hash digest
SHA256 a1c4354018e53ea0a8bc34404146fa04a0ed8e48bef45e006946e8a9b528c541
MD5 f62bb64dc89e87245e6f097bb8bda221
BLAKE2b-256 51c371645c6570fe962edcdaf4e2eeb12d22f96378bf95b2225130cd80c8c7b3

See more details on using hashes here.

File details

Details for the file cosmogw-0.0.36-py3-none-any.whl.

File metadata

  • Download URL: cosmogw-0.0.36-py3-none-any.whl
  • Upload date:
  • Size: 5.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for cosmogw-0.0.36-py3-none-any.whl
Algorithm Hash digest
SHA256 c8a627911eaed07e026f8ff1ddbeb2b963c588af02c797d303edcbd18ecdff0d
MD5 a3d29896f67475c173b4457ca31fc9f6
BLAKE2b-256 cf8ff9fdc5bc2b320b3aeea46330357080dbec05c31f20f47adeb7988fc24f24

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page