Skip to main content

code for cosmological gravitational wave backgrounds

Project description

License Logo

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 all required test data files are present in the tests directory.


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 MIT License.


🚀 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.33.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.33-py3-none-any.whl (5.8 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cosmogw-0.0.33.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.33.tar.gz
Algorithm Hash digest
SHA256 313effcd0b5db4ddbd8642d4f41a21452cf00c62d683700c8e4c09baa7f5f0b5
MD5 df57c8c996aca37c35c48cc8a8c4690f
BLAKE2b-256 265f57e4b4b1e28e082080bed1558a43b29d8841d9a0e85dd3d7bb204014b511

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cosmogw-0.0.33-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.33-py3-none-any.whl
Algorithm Hash digest
SHA256 2220aff4a8edf301d72f39483c57f60d2eae21de7ff5ae2cd1c8ccdf117393e3
MD5 14d835a2c1a4d087e53bf7301c7afb07
BLAKE2b-256 590914652f3215e1882a628dba611d565208f3db6936ad7a78379cb2602b8760

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