Cosmax
Fast and differentiable tools for analysis and inference on structured and unstructured data in cosmology. Powered by JAX.
Install with pip install cosmax.
What can I do with this package?
Classical Use Cases
Generate the Matter Power Spectrum from a 3D densitiy field:
Generate the ICs for a given matter power spectrum:
Cloud in a cell mass assignment scheme to convert unstructured particles to a 3D density field:
Optimization
With gradient optimization over the cic mass assignment scheme, we can find the particle positions that best fit an observed density field:
We can also use the power spectrum as a loss function to find a conditional IC density field :
What are the limitations?
- The package is currently in development and the API is not stable.
- The package generally ONLY works with 3D square boxes and periodic boundary conditions.
- I am not a physicist, so the package may contain errors and inaccuracies.
Development
To develop, clone the repository and install the package in editable mode:
pip install -e .
To release as pip package, tests, docs and builds are handled automatically by github actions as defined in .github/workflows. To make a new release:
git tag v*.*.*
git push origin v*.*.*
and change the version number in pyproject.toml.
Test
pytest
Build
python -m build
Local Docs
With the pip package sphinx installed, run
sphinx-apidoc -o docs/source cosmax/
sphinx-build -b html docs/source docs/_build
to view locally
cd docs/_build
python -m http.server
Acknowledgements
-
PowerBox was used as a reference implementation the matter power spectrum.
-
Felix Köhlers implementation of Fourier Neural Operator was used as a guide to adapt the fno to jax and equinox.
-
The original NeuralOperator served as a reference for the fno implementation.
Metadata
Release files for cosmax 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cosmax-0.0.7-py3-none-any.whl | Python 3 | none | any | Details for cosmax-0.0.7-py3-none-any.whl |
Release files / cosmax-0.0.7-py3-none-any.whl
| Download URL | cosmax-0.0.7-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
803800f8af3d48dc2cda2ad3c956210081f1296b9514fa38088ff9e5a2686b25
|
|
BLAKE2b-256 checksum How to use checksums |
4c7ce48f1d88d33e6a141c4c8a2dcca5aed747d2b9352c2022a53e72228c024d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Security for cosmax 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.