Skip to main content

Perturbation theory calculations for LCDM and Modified Gravity theories using fk-Kernels implemented in Python with JAX

Project description

fkptjax

PyPI version Python License: MIT Tests

Perturbation theory calculations for LCDM and Modified Gravity theories using "fk"-Kernels implemented in Python with JAX.

Based on the C code at https://github.com/alejandroaviles/fkpt, which is based on the paper Rodriguez-Meza, M. A. et al, "fkPT: Constraining scale-dependent modified gravity with the full-shape galaxy power spectrum", JCAP03(2024)049.

See KFUNCTIONS.md for details on what quantities this code calculates. See the included notebook for examples of how to perform the calculations. See BENCHMARKS.md for timing benchmarks on different platforms.

Installation

Install from pip:

pip install fkptjax

Requirements

  • Python 3.10+
  • JAX 0.4.0+
  • NumPy 1.24.0+
  • SciPy 1.10.0+

Development

For development, install with dev dependencies:

git clone https://github.com/cosmodesi/fkptjax.git
cd fkptjax
pip install -e ".[dev]"

Run tests:

pytest

Run benchmarks (default: all calculators, 100 runs):

python tests/test.py

Run benchmarks with options:

# Run only NumPy calculator
python tests/test.py -c numpy

# Run with custom data file and 50 runs
python tests/test.py -d mydata.npz -n 50

# Run both NumPy and JAX CPU calculators
python tests/test.py -c numpy jax-cpu

# Show all options
python tests/test.py --help

Run tests with coverage:

pytest --cov=fkptjax

Type checking:

mypy src/fkptjax

License

MIT License - see LICENSE file for details.

Authors

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

fkptjax-0.2.1.tar.gz (110.0 kB view details)

Uploaded Source

Built Distribution

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

fkptjax-0.2.1-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file fkptjax-0.2.1.tar.gz.

File metadata

  • Download URL: fkptjax-0.2.1.tar.gz
  • Upload date:
  • Size: 110.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fkptjax-0.2.1.tar.gz
Algorithm Hash digest
SHA256 793fc29d3c658bb9d7d2b7d90c5b776e5c76f28511be290c1925d55259fba9a7
MD5 fd4cfd73a12999e9bed6d2b837ac97cc
BLAKE2b-256 0ae54a48fcaf899144a4c708397eb68e5820632cf51b8cccb2de9fdf6ba54315

See more details on using hashes here.

Provenance

The following attestation bundles were made for fkptjax-0.2.1.tar.gz:

Publisher: publish.yml on cosmodesi/fkptjax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fkptjax-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: fkptjax-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fkptjax-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ed4ec7372e9904feb0f0819e59e65de1546fd96295f86f64c7fcbe46f3215e4
MD5 57c14d67bb6a3d77252bfd9ad5f16f31
BLAKE2b-256 3f97985446eec4cc202a180600e26f8b6ca0e01a2a27fe32900cf433ee349baa

See more details on using hashes here.

Provenance

The following attestation bundles were made for fkptjax-0.2.1-py3-none-any.whl:

Publisher: publish.yml on cosmodesi/fkptjax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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