jaxion 0.0.3__tar.gz → 0.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {jaxion-0.0.3 → jaxion-0.0.5}/PKG-INFO +69 -4
- jaxion-0.0.5/README.md +138 -0
- {jaxion-0.0.3 → jaxion-0.0.5}/jaxion/analysis.py +19 -4
- {jaxion-0.0.3 → jaxion-0.0.5}/jaxion/constants.py +8 -8
- {jaxion-0.0.3 → jaxion-0.0.5}/jaxion/simulation.py +62 -11
- {jaxion-0.0.3 → jaxion-0.0.5}/jaxion/utils.py +17 -0
- {jaxion-0.0.3 → jaxion-0.0.5}/jaxion/visualization.py +11 -7
- {jaxion-0.0.3 → jaxion-0.0.5}/jaxion.egg-info/PKG-INFO +69 -4
- {jaxion-0.0.3 → jaxion-0.0.5}/jaxion.egg-info/SOURCES.txt +2 -0
- jaxion-0.0.5/tests/test_analysis.py +24 -0
- jaxion-0.0.5/tests/test_cosmology.py +29 -0
- {jaxion-0.0.3 → jaxion-0.0.5}/tests/test_examples.py +12 -1
- jaxion-0.0.3/README.md +0 -73
- {jaxion-0.0.3 → jaxion-0.0.5}/LICENSE +0 -0
- {jaxion-0.0.3 → jaxion-0.0.5}/jaxion/__init__.py +0 -0
- {jaxion-0.0.3 → jaxion-0.0.5}/jaxion/cosmology.py +0 -0
- {jaxion-0.0.3 → jaxion-0.0.5}/jaxion/gravity.py +0 -0
- {jaxion-0.0.3 → jaxion-0.0.5}/jaxion/hydro.py +0 -0
- {jaxion-0.0.3 → jaxion-0.0.5}/jaxion/params_default.json +0 -0
- {jaxion-0.0.3 → jaxion-0.0.5}/jaxion/particles.py +0 -0
- {jaxion-0.0.3 → jaxion-0.0.5}/jaxion/quantum.py +0 -0
- {jaxion-0.0.3 → jaxion-0.0.5}/jaxion.egg-info/dependency_links.txt +0 -0
- {jaxion-0.0.3 → jaxion-0.0.5}/jaxion.egg-info/requires.txt +0 -0
- {jaxion-0.0.3 → jaxion-0.0.5}/jaxion.egg-info/top_level.txt +0 -0
- {jaxion-0.0.3 → jaxion-0.0.5}/pyproject.toml +0 -0
- {jaxion-0.0.3 → jaxion-0.0.5}/requirements.txt +0 -0
- {jaxion-0.0.3 → jaxion-0.0.5}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jaxion
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: A differentiable simulation library for fuzzy dark matter in JAX
|
|
5
5
|
Author-email: Philip Mocz <philip.mocz@gmail.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -32,8 +32,12 @@ Dynamic: license-file
|
|
|
32
32
|
[![Repo Status][status-badge]][status-link]
|
|
33
33
|
[![PyPI Version Status][pypi-badge]][pypi-link]
|
|
34
34
|
[![Test Status][workflow-test-badge]][workflow-test-link]
|
|
35
|
+
[![Coverage][coverage-badge]][coverage-link]
|
|
36
|
+
[![Ruff][ruff-badge]][ruff-link]
|
|
37
|
+
[![asv][asv-badge]][asv-link]
|
|
35
38
|
[![Readthedocs Status][docs-badge]][docs-link]
|
|
36
39
|
[![License][license-badge]][license-link]
|
|
40
|
+
[![Software DOI][software-doi-badge]][software-doi-link]
|
|
37
41
|
|
|
38
42
|
[status-link]: https://www.repostatus.org/#active
|
|
39
43
|
[status-badge]: https://www.repostatus.org/badges/latest/active.svg
|
|
@@ -41,10 +45,19 @@ Dynamic: license-file
|
|
|
41
45
|
[pypi-badge]: https://img.shields.io/pypi/v/jaxion?label=PyPI&logo=pypi
|
|
42
46
|
[workflow-test-link]: https://github.com/JaxionProject/jaxion/actions/workflows/test-package.yml
|
|
43
47
|
[workflow-test-badge]: https://github.com/JaxionProject/jaxion/actions/workflows/test-package.yml/badge.svg?event=push
|
|
48
|
+
[coverage-link]: https://app.codecov.io/gh/JaxionProject/jaxion
|
|
49
|
+
[coverage-badge]: https://codecov.io/github/jaxionproject/jaxion/graph/jaxion-server/badge.svg
|
|
50
|
+
[ruff-link]: https://github.com/astral-sh/ruff
|
|
51
|
+
[ruff-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
|
|
52
|
+
[asv-link]: https://jaxionproject.github.io/jaxion-benchmarks/
|
|
53
|
+
[asv-badge]: https://img.shields.io/badge/benchmarked%20by-asv-blue.svg?style=flat
|
|
44
54
|
[docs-link]: https://jaxion.readthedocs.io
|
|
45
55
|
[docs-badge]: https://readthedocs.org/projects/jaxion/badge
|
|
46
56
|
[license-link]: https://opensource.org/licenses/Apache-2.0
|
|
47
57
|
[license-badge]: https://img.shields.io/badge/License-Apache_2.0-blue.svg
|
|
58
|
+
[software-doi-link]: https://doi.org/10.5281/zenodo.17438467
|
|
59
|
+
[software-doi-badge]: https://zenodo.org/badge/1072645376.svg
|
|
60
|
+
|
|
48
61
|
|
|
49
62
|
A simple JAX-powered simulation library for numerical experiments of fuzzy dark matter, stars, gas + more!
|
|
50
63
|
|
|
@@ -63,34 +76,86 @@ Install with:
|
|
|
63
76
|
pip install jaxion
|
|
64
77
|
```
|
|
65
78
|
|
|
66
|
-
or, for GPU support use:
|
|
79
|
+
or, for GPU support, use:
|
|
67
80
|
|
|
68
81
|
```console
|
|
69
82
|
pip install jaxion[cuda12]
|
|
70
83
|
```
|
|
71
84
|
|
|
72
|
-
|
|
85
|
+
See the docs for more info on how to [build from source](https://jaxion.readthedocs.io/en/latest/pages/installation.html).
|
|
73
86
|
|
|
74
87
|
|
|
75
88
|
## Examples
|
|
76
89
|
|
|
90
|
+
Check out the `examples/` directory for demonstrations of using Jaxion.
|
|
91
|
+
|
|
77
92
|
<p align="center">
|
|
93
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/cosmological_box">
|
|
94
|
+
<img src="examples/cosmological_box/movie.gif" alt="cosmological_box" width="128"/>
|
|
95
|
+
</a>
|
|
78
96
|
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/dynamical_friction">
|
|
79
97
|
<img src="examples/dynamical_friction/movie.gif" alt="dynamical_friction" width="128"/>
|
|
80
98
|
</a>
|
|
81
99
|
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/heating_gas">
|
|
82
100
|
<img src="examples/heating_gas/movie.gif" alt="heating_gas" width="128"/>
|
|
83
101
|
</a>
|
|
102
|
+
<br>
|
|
103
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/heating_stars">
|
|
104
|
+
<img src="examples/heating_stars/movie.gif" alt="heating_stars" width="128"/>
|
|
105
|
+
</a>
|
|
106
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/kinetic_condensation">
|
|
107
|
+
<img src="examples/kinetic_condensation/movie.gif" alt="kinetic_condensation" width="128"/>
|
|
108
|
+
</a>
|
|
109
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/logo_inverse_problem">
|
|
110
|
+
<img src="examples/logo_inverse_problem/movie.gif" alt="logo_inverse_problem" width="128"/>
|
|
111
|
+
</a>
|
|
112
|
+
<br>
|
|
113
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/soliton_binary_merger">
|
|
114
|
+
<img src="examples/soliton_binary_merger/movie.gif" alt="soliton_binary_merger" width="128"/>
|
|
115
|
+
</a>
|
|
116
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/soliton_merger">
|
|
117
|
+
<img src="examples/soliton_merger/movie.gif" alt="soliton_merger" width="128"/>
|
|
118
|
+
</a>
|
|
84
119
|
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/tidal_stripping">
|
|
85
120
|
<img src="examples/tidal_stripping/movie.gif" alt="tidal_stripping" width="128"/>
|
|
86
121
|
</a>
|
|
87
122
|
</p>
|
|
88
123
|
|
|
124
|
+
|
|
125
|
+
## High-Performance
|
|
126
|
+
|
|
127
|
+
Jaxion is scalable on multiple GPUs!
|
|
128
|
+
|
|
129
|
+
<p align="center">
|
|
130
|
+
<a href="https://jaxion.readthedocs.io">
|
|
131
|
+
<img src="examples/soliton_binary_merger/timing.png" alt="timing" width="400"/>
|
|
132
|
+
</a>
|
|
133
|
+
</p>
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
## Contributing
|
|
137
|
+
|
|
138
|
+
Jaxion welcomes community contributions of all kinds. Open an issue or fork the code and submit a pull request. Please check out the [Contributing Guidelines](CONTRIBUTING.md)
|
|
139
|
+
|
|
140
|
+
|
|
89
141
|
## Links
|
|
90
142
|
|
|
91
143
|
* [Code repository](https://github.com/JaxionProject/jaxion) on GitHub (this page).
|
|
92
|
-
* [Documentation](https://jaxion.readthedocs.io) for up-to-date information about installing and
|
|
144
|
+
* [Documentation](https://jaxion.readthedocs.io) for up-to-date information about installing and using Jaxion.
|
|
93
145
|
|
|
94
146
|
|
|
95
147
|
## Cite this repository
|
|
96
148
|
|
|
149
|
+
If you use this software, please cite it as below.
|
|
150
|
+
|
|
151
|
+
```bibtex
|
|
152
|
+
@software{Mocz_Jaxion_2025,
|
|
153
|
+
author = {Mocz, Philip},
|
|
154
|
+
doi = {10.5281/zenodo.17438467},
|
|
155
|
+
month = oct,
|
|
156
|
+
title = {{Jaxion}},
|
|
157
|
+
url = {https://github.com/JaxionProject/jaxion},
|
|
158
|
+
version = {0.0.4},
|
|
159
|
+
year = {2025}
|
|
160
|
+
}
|
|
161
|
+
```
|
jaxion-0.0.5/README.md
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://jaxion.readthedocs.io">
|
|
3
|
+
<img src="docs/_static/jaxion-logo.svg" alt="jaxion logo" width="128"/>
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
# jaxion
|
|
8
|
+
|
|
9
|
+
[![Repo Status][status-badge]][status-link]
|
|
10
|
+
[![PyPI Version Status][pypi-badge]][pypi-link]
|
|
11
|
+
[![Test Status][workflow-test-badge]][workflow-test-link]
|
|
12
|
+
[![Coverage][coverage-badge]][coverage-link]
|
|
13
|
+
[![Ruff][ruff-badge]][ruff-link]
|
|
14
|
+
[![asv][asv-badge]][asv-link]
|
|
15
|
+
[![Readthedocs Status][docs-badge]][docs-link]
|
|
16
|
+
[![License][license-badge]][license-link]
|
|
17
|
+
[![Software DOI][software-doi-badge]][software-doi-link]
|
|
18
|
+
|
|
19
|
+
[status-link]: https://www.repostatus.org/#active
|
|
20
|
+
[status-badge]: https://www.repostatus.org/badges/latest/active.svg
|
|
21
|
+
[pypi-link]: https://pypi.org/project/jaxion
|
|
22
|
+
[pypi-badge]: https://img.shields.io/pypi/v/jaxion?label=PyPI&logo=pypi
|
|
23
|
+
[workflow-test-link]: https://github.com/JaxionProject/jaxion/actions/workflows/test-package.yml
|
|
24
|
+
[workflow-test-badge]: https://github.com/JaxionProject/jaxion/actions/workflows/test-package.yml/badge.svg?event=push
|
|
25
|
+
[coverage-link]: https://app.codecov.io/gh/JaxionProject/jaxion
|
|
26
|
+
[coverage-badge]: https://codecov.io/github/jaxionproject/jaxion/graph/jaxion-server/badge.svg
|
|
27
|
+
[ruff-link]: https://github.com/astral-sh/ruff
|
|
28
|
+
[ruff-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
|
|
29
|
+
[asv-link]: https://jaxionproject.github.io/jaxion-benchmarks/
|
|
30
|
+
[asv-badge]: https://img.shields.io/badge/benchmarked%20by-asv-blue.svg?style=flat
|
|
31
|
+
[docs-link]: https://jaxion.readthedocs.io
|
|
32
|
+
[docs-badge]: https://readthedocs.org/projects/jaxion/badge
|
|
33
|
+
[license-link]: https://opensource.org/licenses/Apache-2.0
|
|
34
|
+
[license-badge]: https://img.shields.io/badge/License-Apache_2.0-blue.svg
|
|
35
|
+
[software-doi-link]: https://doi.org/10.5281/zenodo.17438467
|
|
36
|
+
[software-doi-badge]: https://zenodo.org/badge/1072645376.svg
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
A simple JAX-powered simulation library for numerical experiments of fuzzy dark matter, stars, gas + more!
|
|
40
|
+
|
|
41
|
+
Author: [Philip Mocz (@pmocz)](https://github.com/pmocz/)
|
|
42
|
+
|
|
43
|
+
Jaxion is built for multi-GPU scalability and is fully differentiable. It is a high-performance JAX-based simulation library for modeling fuzzy dark matter alongside stars, gas, and cosmological dynamics. Being differentiable, Jaxion can seamlessly integrate with pipelines for inverse-problems, inference, optimization, and coupling to ML models.
|
|
44
|
+
|
|
45
|
+
Jaxion is the simpler companion project to differentiable astrophysics code [Adirondax](https://github.com/AdirondaxProject/adirondax)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
## Getting started
|
|
49
|
+
|
|
50
|
+
Install with:
|
|
51
|
+
|
|
52
|
+
```console
|
|
53
|
+
pip install jaxion
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
or, for GPU support, use:
|
|
57
|
+
|
|
58
|
+
```console
|
|
59
|
+
pip install jaxion[cuda12]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
See the docs for more info on how to [build from source](https://jaxion.readthedocs.io/en/latest/pages/installation.html).
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## Examples
|
|
66
|
+
|
|
67
|
+
Check out the `examples/` directory for demonstrations of using Jaxion.
|
|
68
|
+
|
|
69
|
+
<p align="center">
|
|
70
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/cosmological_box">
|
|
71
|
+
<img src="examples/cosmological_box/movie.gif" alt="cosmological_box" width="128"/>
|
|
72
|
+
</a>
|
|
73
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/dynamical_friction">
|
|
74
|
+
<img src="examples/dynamical_friction/movie.gif" alt="dynamical_friction" width="128"/>
|
|
75
|
+
</a>
|
|
76
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/heating_gas">
|
|
77
|
+
<img src="examples/heating_gas/movie.gif" alt="heating_gas" width="128"/>
|
|
78
|
+
</a>
|
|
79
|
+
<br>
|
|
80
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/heating_stars">
|
|
81
|
+
<img src="examples/heating_stars/movie.gif" alt="heating_stars" width="128"/>
|
|
82
|
+
</a>
|
|
83
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/kinetic_condensation">
|
|
84
|
+
<img src="examples/kinetic_condensation/movie.gif" alt="kinetic_condensation" width="128"/>
|
|
85
|
+
</a>
|
|
86
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/logo_inverse_problem">
|
|
87
|
+
<img src="examples/logo_inverse_problem/movie.gif" alt="logo_inverse_problem" width="128"/>
|
|
88
|
+
</a>
|
|
89
|
+
<br>
|
|
90
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/soliton_binary_merger">
|
|
91
|
+
<img src="examples/soliton_binary_merger/movie.gif" alt="soliton_binary_merger" width="128"/>
|
|
92
|
+
</a>
|
|
93
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/soliton_merger">
|
|
94
|
+
<img src="examples/soliton_merger/movie.gif" alt="soliton_merger" width="128"/>
|
|
95
|
+
</a>
|
|
96
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/tidal_stripping">
|
|
97
|
+
<img src="examples/tidal_stripping/movie.gif" alt="tidal_stripping" width="128"/>
|
|
98
|
+
</a>
|
|
99
|
+
</p>
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
## High-Performance
|
|
103
|
+
|
|
104
|
+
Jaxion is scalable on multiple GPUs!
|
|
105
|
+
|
|
106
|
+
<p align="center">
|
|
107
|
+
<a href="https://jaxion.readthedocs.io">
|
|
108
|
+
<img src="examples/soliton_binary_merger/timing.png" alt="timing" width="400"/>
|
|
109
|
+
</a>
|
|
110
|
+
</p>
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
## Contributing
|
|
114
|
+
|
|
115
|
+
Jaxion welcomes community contributions of all kinds. Open an issue or fork the code and submit a pull request. Please check out the [Contributing Guidelines](CONTRIBUTING.md)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## Links
|
|
119
|
+
|
|
120
|
+
* [Code repository](https://github.com/JaxionProject/jaxion) on GitHub (this page).
|
|
121
|
+
* [Documentation](https://jaxion.readthedocs.io) for up-to-date information about installing and using Jaxion.
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
## Cite this repository
|
|
125
|
+
|
|
126
|
+
If you use this software, please cite it as below.
|
|
127
|
+
|
|
128
|
+
```bibtex
|
|
129
|
+
@software{Mocz_Jaxion_2025,
|
|
130
|
+
author = {Mocz, Philip},
|
|
131
|
+
doi = {10.5281/zenodo.17438467},
|
|
132
|
+
month = oct,
|
|
133
|
+
title = {{Jaxion}},
|
|
134
|
+
url = {https://github.com/JaxionProject/jaxion},
|
|
135
|
+
version = {0.0.4},
|
|
136
|
+
year = {2025}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
@@ -4,10 +4,25 @@ import jaxdecomp as jd
|
|
|
4
4
|
|
|
5
5
|
def radial_power_spectrum(data_cube, kx, ky, kz, box_size):
|
|
6
6
|
"""
|
|
7
|
-
Computes radially averaged power spectral density of
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
Computes the radially averaged power spectral density of a 3D datacube.
|
|
8
|
+
|
|
9
|
+
Parameters
|
|
10
|
+
----------
|
|
11
|
+
data_cube : jnp.ndarray
|
|
12
|
+
3D data cube, must be cubic
|
|
13
|
+
kx, ky, kz: jnp.ndarray
|
|
14
|
+
wavenumber grids in each dimension
|
|
15
|
+
box_size: float
|
|
16
|
+
physical size of box
|
|
17
|
+
|
|
18
|
+
Returns
|
|
19
|
+
-------
|
|
20
|
+
Pf: jnp.ndarray
|
|
21
|
+
radial power spectrum
|
|
22
|
+
k: jnp.ndarray
|
|
23
|
+
wavenumbers
|
|
24
|
+
total_power: float
|
|
25
|
+
total power
|
|
11
26
|
"""
|
|
12
27
|
dim = data_cube.ndim
|
|
13
28
|
nx = data_cube.shape[0]
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Copyright (c) 2025 The Jaxion Team.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
"""
|
|
4
|
+
Physical constants in units of:
|
|
5
|
+
[L] = kpc,
|
|
6
|
+
[V] = km/s,
|
|
7
|
+
[M] = Msun
|
|
8
|
+
|
|
9
|
+
note: other units are derived from these base units, e.g., [T] = [L]/[V] = kpc / (km/s) ~= 0.978 Gyr
|
|
10
|
+
"""
|
|
11
11
|
|
|
12
12
|
constants = {
|
|
13
13
|
"gravitational_constant": 4.30241002e-6, # G / (kpc * (km/s)^2 / Msun)
|
|
@@ -14,6 +14,7 @@ from .cosmology import get_supercomoving_time_interval, get_next_scale_factor
|
|
|
14
14
|
from .utils import (
|
|
15
15
|
set_up_parameters,
|
|
16
16
|
print_parameters,
|
|
17
|
+
print_distributed_info,
|
|
17
18
|
xmeshgrid,
|
|
18
19
|
xmeshgrid_transpose,
|
|
19
20
|
xzeros,
|
|
@@ -28,8 +29,11 @@ class Simulation:
|
|
|
28
29
|
|
|
29
30
|
Parameters
|
|
30
31
|
----------
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
params : dict
|
|
33
|
+
The Python dictionary that contains the simulation parameters.
|
|
34
|
+
Params can also be a string path to a checkpoint directory to load a saved simulation.
|
|
35
|
+
sharding : jax.sharding.NamedSharding, optional
|
|
36
|
+
jax sharding used for distributed (multi-GPU) simulations
|
|
33
37
|
|
|
34
38
|
"""
|
|
35
39
|
|
|
@@ -69,10 +73,12 @@ class Simulation:
|
|
|
69
73
|
"hydro/particles sharding is not yet implemented."
|
|
70
74
|
)
|
|
71
75
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
# print info
|
|
77
|
+
if jax.process_index() == 0:
|
|
78
|
+
print("Simulation parameters:")
|
|
79
|
+
print_parameters(self.params)
|
|
80
|
+
if sharding is not None:
|
|
81
|
+
print_distributed_info()
|
|
76
82
|
|
|
77
83
|
# jitted functions
|
|
78
84
|
self.xmeshgrid_jit = jax.jit(
|
|
@@ -126,6 +132,9 @@ class Simulation:
|
|
|
126
132
|
|
|
127
133
|
@property
|
|
128
134
|
def resolution(self):
|
|
135
|
+
"""
|
|
136
|
+
Return the (linear) resolution of the simulation
|
|
137
|
+
"""
|
|
129
138
|
return (
|
|
130
139
|
self.params["domain"]["resolution_base"]
|
|
131
140
|
* self.params["domain"]["resolution_multiplier"]
|
|
@@ -133,18 +142,30 @@ class Simulation:
|
|
|
133
142
|
|
|
134
143
|
@property
|
|
135
144
|
def num_particles(self):
|
|
145
|
+
"""
|
|
146
|
+
Return the number of particles in the simulation
|
|
147
|
+
"""
|
|
136
148
|
return self.params["particles"]["num_particles"]
|
|
137
149
|
|
|
138
150
|
@property
|
|
139
151
|
def box_size(self):
|
|
152
|
+
"""
|
|
153
|
+
Return the box size of the simulation (kpc)
|
|
154
|
+
"""
|
|
140
155
|
return self.params["domain"]["box_size"]
|
|
141
156
|
|
|
142
157
|
@property
|
|
143
158
|
def dx(self):
|
|
159
|
+
"""
|
|
160
|
+
Return the cell size size of the simulation (kpc)
|
|
161
|
+
"""
|
|
144
162
|
return self.box_size / self.resolution
|
|
145
163
|
|
|
146
164
|
@property
|
|
147
165
|
def axion_mass(self):
|
|
166
|
+
"""
|
|
167
|
+
Return the axion particle mass in the simulation (M_sun)
|
|
168
|
+
"""
|
|
148
169
|
return (
|
|
149
170
|
self.params["quantum"]["m_22"]
|
|
150
171
|
* 1.0e-22
|
|
@@ -152,16 +173,32 @@ class Simulation:
|
|
|
152
173
|
/ constants["speed_of_light"] ** 2
|
|
153
174
|
)
|
|
154
175
|
|
|
176
|
+
@property
|
|
177
|
+
def m_per_hbar(self):
|
|
178
|
+
"""
|
|
179
|
+
Return the mass per hbar in the simulation (M_sun / hbar)
|
|
180
|
+
"""
|
|
181
|
+
return self.axion_mass / constants["reduced_planck_constant"]
|
|
182
|
+
|
|
155
183
|
@property
|
|
156
184
|
def sound_speed(self):
|
|
185
|
+
"""
|
|
186
|
+
Return the isothermal gas sound speed in the simulation (km/s)
|
|
187
|
+
"""
|
|
157
188
|
return self.params["hydro"]["sound_speed"]
|
|
158
189
|
|
|
159
190
|
@property
|
|
160
191
|
def params(self):
|
|
192
|
+
"""
|
|
193
|
+
Return the parameters of the simulation
|
|
194
|
+
"""
|
|
161
195
|
return self._params
|
|
162
196
|
|
|
163
197
|
@property
|
|
164
198
|
def grid(self):
|
|
199
|
+
"""
|
|
200
|
+
Return the simulation grid
|
|
201
|
+
"""
|
|
165
202
|
hx = 0.5 * self.dx
|
|
166
203
|
x_lin = jnp.linspace(hx, self.box_size - hx, self.resolution)
|
|
167
204
|
xx, yy, zz = self.xmeshgrid_jit(x_lin)
|
|
@@ -169,6 +206,9 @@ class Simulation:
|
|
|
169
206
|
|
|
170
207
|
@property
|
|
171
208
|
def kgrid(self):
|
|
209
|
+
"""
|
|
210
|
+
Return the simulation spectral grid
|
|
211
|
+
"""
|
|
172
212
|
nx = self.resolution
|
|
173
213
|
k_lin = (2.0 * jnp.pi / self.box_size) * jnp.arange(-nx / 2, nx / 2)
|
|
174
214
|
kx, ky, kz = self.xmeshgrid_transpose_jit(k_lin)
|
|
@@ -179,8 +219,10 @@ class Simulation:
|
|
|
179
219
|
|
|
180
220
|
@property
|
|
181
221
|
def quantum_velocity(self):
|
|
182
|
-
|
|
183
|
-
|
|
222
|
+
"""
|
|
223
|
+
Return the dark matter velocity field from the wavefunction
|
|
224
|
+
"""
|
|
225
|
+
return quantum_velocity(self.state["psi"], self.box_size, self.m_per_hbar)
|
|
184
226
|
|
|
185
227
|
def _calc_rho_bar(self, state):
|
|
186
228
|
rho_bar = 0.0
|
|
@@ -214,6 +256,9 @@ class Simulation:
|
|
|
214
256
|
|
|
215
257
|
@property
|
|
216
258
|
def potential(self):
|
|
259
|
+
"""
|
|
260
|
+
Return the gravitational potential
|
|
261
|
+
"""
|
|
217
262
|
kx, ky, kz = self.kgrid
|
|
218
263
|
k_sq = kx**2 + ky**2 + kz**2
|
|
219
264
|
return self._calc_grav_potential(self.state, k_sq)
|
|
@@ -235,7 +280,7 @@ class Simulation:
|
|
|
235
280
|
|
|
236
281
|
# Simulation parameters
|
|
237
282
|
dx = self.dx
|
|
238
|
-
m_per_hbar = self.
|
|
283
|
+
m_per_hbar = self.m_per_hbar
|
|
239
284
|
box_size = self.box_size
|
|
240
285
|
|
|
241
286
|
dt_fac = 1.0
|
|
@@ -372,14 +417,17 @@ class Simulation:
|
|
|
372
417
|
elapsed = time.time() - t_start_timer
|
|
373
418
|
est_total = elapsed / i * num_checkpoints
|
|
374
419
|
est_remaining = est_total - elapsed
|
|
420
|
+
num_cells = self.resolution**3
|
|
421
|
+
mcups = (num_cells * (i * nt_sub)) / (elapsed * 1.0e6)
|
|
375
422
|
if jax.process_index() == 0:
|
|
376
423
|
print(
|
|
377
|
-
f"{percent:.1f}%: estimated time
|
|
424
|
+
f"{percent:.1f}%: mcups={mcups:.1f}, estimated time left (s): {est_remaining:.1f}"
|
|
378
425
|
)
|
|
379
426
|
plot_sim(state, checkpoint_dir, i, self.params)
|
|
380
427
|
async_checkpoint_manager.wait_until_finished()
|
|
381
428
|
else:
|
|
382
|
-
|
|
429
|
+
carry = jax.lax.fori_loop(0, nt, _update, init_val=carry)
|
|
430
|
+
state, kx, ky, kz, k_sq = carry
|
|
383
431
|
jax.block_until_ready(state)
|
|
384
432
|
if jax.process_index() == 0:
|
|
385
433
|
print("Simulation Run Time (s): ", time.time() - t_start_timer)
|
|
@@ -387,5 +435,8 @@ class Simulation:
|
|
|
387
435
|
return state
|
|
388
436
|
|
|
389
437
|
def run(self):
|
|
438
|
+
"""
|
|
439
|
+
Run the simulation
|
|
440
|
+
"""
|
|
390
441
|
self.state = self._evolve(self.state)
|
|
391
442
|
jax.block_until_ready(self.state)
|
|
@@ -5,6 +5,7 @@ from pathlib import Path
|
|
|
5
5
|
import importlib.resources
|
|
6
6
|
import json
|
|
7
7
|
from importlib.metadata import version
|
|
8
|
+
import jax
|
|
8
9
|
import jax.numpy as jnp
|
|
9
10
|
|
|
10
11
|
|
|
@@ -12,6 +13,22 @@ def print_parameters(params):
|
|
|
12
13
|
print(json.dumps(params, indent=2))
|
|
13
14
|
|
|
14
15
|
|
|
16
|
+
def print_distributed_info():
|
|
17
|
+
for env_var in [
|
|
18
|
+
"SLURM_JOB_ID",
|
|
19
|
+
"SLURM_NTASKS",
|
|
20
|
+
"SLURM_NODELIST",
|
|
21
|
+
"SLURM_STEP_NODELIST",
|
|
22
|
+
"SLURM_STEP_GPUS",
|
|
23
|
+
"SLURM_GPUS",
|
|
24
|
+
]:
|
|
25
|
+
print(f"{env_var}: {os.getenv(env_var, '')}")
|
|
26
|
+
print("Total number of processes: ", jax.process_count())
|
|
27
|
+
print("Total number of devices: ", jax.device_count())
|
|
28
|
+
print("List of devices: ", jax.devices())
|
|
29
|
+
print("Number of devices on this process: ", jax.local_device_count())
|
|
30
|
+
|
|
31
|
+
|
|
15
32
|
def set_up_parameters(user_overwrites):
|
|
16
33
|
# first load the default params
|
|
17
34
|
params_path = importlib.resources.files("jaxion") / "params_default.json"
|
|
@@ -13,15 +13,19 @@ def plot_sim(state, checkpoint_dir, i, params):
|
|
|
13
13
|
if params["physics"]["quantum"]:
|
|
14
14
|
nx = state["psi"].shape[0]
|
|
15
15
|
rho_bar_dm = jnp.mean(jnp.abs(state["psi"]) ** 2)
|
|
16
|
-
rho_proj_dm =
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
rho_proj_dm = jnp.log10(
|
|
17
|
+
jax.experimental.multihost_utils.process_allgather(
|
|
18
|
+
jnp.mean(jnp.abs(state["psi"]) ** 2, axis=2), tiled=True
|
|
19
|
+
)
|
|
20
|
+
).T
|
|
19
21
|
if params["physics"]["hydro"]:
|
|
20
22
|
nx = state["rho"].shape[0]
|
|
21
23
|
rho_bar_gas = jnp.mean(state["rho"])
|
|
22
|
-
rho_proj_gas =
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
rho_proj_gas = jnp.log10(
|
|
25
|
+
jax.experimental.multihost_utils.process_allgather(
|
|
26
|
+
jnp.mean(state["rho"], axis=2), tiled=True
|
|
27
|
+
)
|
|
28
|
+
).T
|
|
25
29
|
|
|
26
30
|
# create plot on process 0
|
|
27
31
|
if jax.process_index() == 0:
|
|
@@ -48,7 +52,7 @@ def plot_sim(state, checkpoint_dir, i, params):
|
|
|
48
52
|
sx = (state["pos"][:, 0] / box_size) * nx
|
|
49
53
|
sy = (state["pos"][:, 1] / box_size) * nx
|
|
50
54
|
plt.plot(
|
|
51
|
-
sx, sy, color="cyan", marker=".", linestyle="None", markersize=
|
|
55
|
+
sx, sy, color="cyan", marker=".", linestyle="None", markersize=5
|
|
52
56
|
)
|
|
53
57
|
ax.set_aspect("equal")
|
|
54
58
|
ax.get_xaxis().set_visible(False)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jaxion
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: A differentiable simulation library for fuzzy dark matter in JAX
|
|
5
5
|
Author-email: Philip Mocz <philip.mocz@gmail.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -32,8 +32,12 @@ Dynamic: license-file
|
|
|
32
32
|
[![Repo Status][status-badge]][status-link]
|
|
33
33
|
[![PyPI Version Status][pypi-badge]][pypi-link]
|
|
34
34
|
[![Test Status][workflow-test-badge]][workflow-test-link]
|
|
35
|
+
[![Coverage][coverage-badge]][coverage-link]
|
|
36
|
+
[![Ruff][ruff-badge]][ruff-link]
|
|
37
|
+
[![asv][asv-badge]][asv-link]
|
|
35
38
|
[![Readthedocs Status][docs-badge]][docs-link]
|
|
36
39
|
[![License][license-badge]][license-link]
|
|
40
|
+
[![Software DOI][software-doi-badge]][software-doi-link]
|
|
37
41
|
|
|
38
42
|
[status-link]: https://www.repostatus.org/#active
|
|
39
43
|
[status-badge]: https://www.repostatus.org/badges/latest/active.svg
|
|
@@ -41,10 +45,19 @@ Dynamic: license-file
|
|
|
41
45
|
[pypi-badge]: https://img.shields.io/pypi/v/jaxion?label=PyPI&logo=pypi
|
|
42
46
|
[workflow-test-link]: https://github.com/JaxionProject/jaxion/actions/workflows/test-package.yml
|
|
43
47
|
[workflow-test-badge]: https://github.com/JaxionProject/jaxion/actions/workflows/test-package.yml/badge.svg?event=push
|
|
48
|
+
[coverage-link]: https://app.codecov.io/gh/JaxionProject/jaxion
|
|
49
|
+
[coverage-badge]: https://codecov.io/github/jaxionproject/jaxion/graph/jaxion-server/badge.svg
|
|
50
|
+
[ruff-link]: https://github.com/astral-sh/ruff
|
|
51
|
+
[ruff-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
|
|
52
|
+
[asv-link]: https://jaxionproject.github.io/jaxion-benchmarks/
|
|
53
|
+
[asv-badge]: https://img.shields.io/badge/benchmarked%20by-asv-blue.svg?style=flat
|
|
44
54
|
[docs-link]: https://jaxion.readthedocs.io
|
|
45
55
|
[docs-badge]: https://readthedocs.org/projects/jaxion/badge
|
|
46
56
|
[license-link]: https://opensource.org/licenses/Apache-2.0
|
|
47
57
|
[license-badge]: https://img.shields.io/badge/License-Apache_2.0-blue.svg
|
|
58
|
+
[software-doi-link]: https://doi.org/10.5281/zenodo.17438467
|
|
59
|
+
[software-doi-badge]: https://zenodo.org/badge/1072645376.svg
|
|
60
|
+
|
|
48
61
|
|
|
49
62
|
A simple JAX-powered simulation library for numerical experiments of fuzzy dark matter, stars, gas + more!
|
|
50
63
|
|
|
@@ -63,34 +76,86 @@ Install with:
|
|
|
63
76
|
pip install jaxion
|
|
64
77
|
```
|
|
65
78
|
|
|
66
|
-
or, for GPU support use:
|
|
79
|
+
or, for GPU support, use:
|
|
67
80
|
|
|
68
81
|
```console
|
|
69
82
|
pip install jaxion[cuda12]
|
|
70
83
|
```
|
|
71
84
|
|
|
72
|
-
|
|
85
|
+
See the docs for more info on how to [build from source](https://jaxion.readthedocs.io/en/latest/pages/installation.html).
|
|
73
86
|
|
|
74
87
|
|
|
75
88
|
## Examples
|
|
76
89
|
|
|
90
|
+
Check out the `examples/` directory for demonstrations of using Jaxion.
|
|
91
|
+
|
|
77
92
|
<p align="center">
|
|
93
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/cosmological_box">
|
|
94
|
+
<img src="examples/cosmological_box/movie.gif" alt="cosmological_box" width="128"/>
|
|
95
|
+
</a>
|
|
78
96
|
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/dynamical_friction">
|
|
79
97
|
<img src="examples/dynamical_friction/movie.gif" alt="dynamical_friction" width="128"/>
|
|
80
98
|
</a>
|
|
81
99
|
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/heating_gas">
|
|
82
100
|
<img src="examples/heating_gas/movie.gif" alt="heating_gas" width="128"/>
|
|
83
101
|
</a>
|
|
102
|
+
<br>
|
|
103
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/heating_stars">
|
|
104
|
+
<img src="examples/heating_stars/movie.gif" alt="heating_stars" width="128"/>
|
|
105
|
+
</a>
|
|
106
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/kinetic_condensation">
|
|
107
|
+
<img src="examples/kinetic_condensation/movie.gif" alt="kinetic_condensation" width="128"/>
|
|
108
|
+
</a>
|
|
109
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/logo_inverse_problem">
|
|
110
|
+
<img src="examples/logo_inverse_problem/movie.gif" alt="logo_inverse_problem" width="128"/>
|
|
111
|
+
</a>
|
|
112
|
+
<br>
|
|
113
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/soliton_binary_merger">
|
|
114
|
+
<img src="examples/soliton_binary_merger/movie.gif" alt="soliton_binary_merger" width="128"/>
|
|
115
|
+
</a>
|
|
116
|
+
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/soliton_merger">
|
|
117
|
+
<img src="examples/soliton_merger/movie.gif" alt="soliton_merger" width="128"/>
|
|
118
|
+
</a>
|
|
84
119
|
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/tidal_stripping">
|
|
85
120
|
<img src="examples/tidal_stripping/movie.gif" alt="tidal_stripping" width="128"/>
|
|
86
121
|
</a>
|
|
87
122
|
</p>
|
|
88
123
|
|
|
124
|
+
|
|
125
|
+
## High-Performance
|
|
126
|
+
|
|
127
|
+
Jaxion is scalable on multiple GPUs!
|
|
128
|
+
|
|
129
|
+
<p align="center">
|
|
130
|
+
<a href="https://jaxion.readthedocs.io">
|
|
131
|
+
<img src="examples/soliton_binary_merger/timing.png" alt="timing" width="400"/>
|
|
132
|
+
</a>
|
|
133
|
+
</p>
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
## Contributing
|
|
137
|
+
|
|
138
|
+
Jaxion welcomes community contributions of all kinds. Open an issue or fork the code and submit a pull request. Please check out the [Contributing Guidelines](CONTRIBUTING.md)
|
|
139
|
+
|
|
140
|
+
|
|
89
141
|
## Links
|
|
90
142
|
|
|
91
143
|
* [Code repository](https://github.com/JaxionProject/jaxion) on GitHub (this page).
|
|
92
|
-
* [Documentation](https://jaxion.readthedocs.io) for up-to-date information about installing and
|
|
144
|
+
* [Documentation](https://jaxion.readthedocs.io) for up-to-date information about installing and using Jaxion.
|
|
93
145
|
|
|
94
146
|
|
|
95
147
|
## Cite this repository
|
|
96
148
|
|
|
149
|
+
If you use this software, please cite it as below.
|
|
150
|
+
|
|
151
|
+
```bibtex
|
|
152
|
+
@software{Mocz_Jaxion_2025,
|
|
153
|
+
author = {Mocz, Philip},
|
|
154
|
+
doi = {10.5281/zenodo.17438467},
|
|
155
|
+
month = oct,
|
|
156
|
+
title = {{Jaxion}},
|
|
157
|
+
url = {https://github.com/JaxionProject/jaxion},
|
|
158
|
+
version = {0.0.4},
|
|
159
|
+
year = {2025}
|
|
160
|
+
}
|
|
161
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import jax.numpy as jnp
|
|
2
|
+
import jaxion
|
|
3
|
+
from jaxion.quantum import quantum_velocity
|
|
4
|
+
from jaxion.analysis import radial_power_spectrum
|
|
5
|
+
import pytest
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_quantum_velocity_and_radial_power_spectrum():
|
|
9
|
+
sim = jaxion.Simulation({})
|
|
10
|
+
box_size = sim.box_size
|
|
11
|
+
m_per_hbar = sim.m_per_hbar
|
|
12
|
+
xx, yy, _ = sim.grid
|
|
13
|
+
kx, ky, kz = sim.kgrid
|
|
14
|
+
|
|
15
|
+
psi = (
|
|
16
|
+
jnp.cos(2.0 * jnp.pi * xx / box_size) ** 2
|
|
17
|
+
+ jnp.cos(2.0 * jnp.pi * yy / box_size) * 1j
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
vx, _, _ = quantum_velocity(psi, box_size, m_per_hbar)
|
|
21
|
+
|
|
22
|
+
Pf, _, _ = radial_power_spectrum(vx, kx, ky, kz, box_size)
|
|
23
|
+
|
|
24
|
+
assert jnp.max(Pf) == pytest.approx(8244.606, rel=1e-4)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from jaxion.cosmology import (
|
|
2
|
+
get_physical_time_interval,
|
|
3
|
+
get_supercomoving_time_interval,
|
|
4
|
+
get_scale_factor,
|
|
5
|
+
get_next_scale_factor,
|
|
6
|
+
)
|
|
7
|
+
import pytest
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def test_cosmology_functions():
|
|
11
|
+
z_start = 127.0
|
|
12
|
+
z_end = 0.0
|
|
13
|
+
omega_matter = 0.3
|
|
14
|
+
omega_lambda = 0.7
|
|
15
|
+
little_h = 0.7
|
|
16
|
+
dt_hat = 10.0
|
|
17
|
+
|
|
18
|
+
assert get_physical_time_interval(
|
|
19
|
+
z_start, z_end, omega_matter, omega_lambda, little_h
|
|
20
|
+
) == pytest.approx(13.76084)
|
|
21
|
+
assert get_supercomoving_time_interval(
|
|
22
|
+
z_start, z_end, omega_matter, omega_lambda, little_h
|
|
23
|
+
) == pytest.approx(530.44415)
|
|
24
|
+
assert get_scale_factor(
|
|
25
|
+
z_start, dt_hat, omega_matter, omega_lambda, little_h
|
|
26
|
+
) == pytest.approx(0.008084139320999384)
|
|
27
|
+
assert get_next_scale_factor(
|
|
28
|
+
z_start, dt_hat, omega_matter, omega_lambda, little_h
|
|
29
|
+
) == pytest.approx(0.00808401)
|
|
@@ -7,7 +7,18 @@ rel_tol = 1e-4
|
|
|
7
7
|
|
|
8
8
|
def test_tidal_stripping():
|
|
9
9
|
sim = run_example_main(
|
|
10
|
-
"examples/tidal_stripping/tidal_stripping.py",
|
|
10
|
+
"examples/tidal_stripping/tidal_stripping.py",
|
|
11
|
+
argv=["--res", "1", "--save", "False"],
|
|
12
|
+
)
|
|
13
|
+
assert sim.resolution == 32
|
|
14
|
+
assert sim.state["t"] > 0.0
|
|
15
|
+
assert jnp.mean(jnp.abs(sim.state["psi"])) == pytest.approx(639.0479, rel=rel_tol)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def test_tidal_stripping_distributed_emulate():
|
|
19
|
+
sim = run_example_main(
|
|
20
|
+
"examples/tidal_stripping/tidal_stripping.py",
|
|
21
|
+
argv=["--res", "1", "--distributed", "--emulate"],
|
|
11
22
|
)
|
|
12
23
|
assert sim.resolution == 32
|
|
13
24
|
assert sim.state["t"] > 0.0
|
jaxion-0.0.3/README.md
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<a href="https://jaxion.readthedocs.io">
|
|
3
|
-
<img src="docs/_static/jaxion-logo.svg" alt="jaxion logo" width="128"/>
|
|
4
|
-
</a>
|
|
5
|
-
</p>
|
|
6
|
-
|
|
7
|
-
# jaxion
|
|
8
|
-
|
|
9
|
-
[![Repo Status][status-badge]][status-link]
|
|
10
|
-
[![PyPI Version Status][pypi-badge]][pypi-link]
|
|
11
|
-
[![Test Status][workflow-test-badge]][workflow-test-link]
|
|
12
|
-
[![Readthedocs Status][docs-badge]][docs-link]
|
|
13
|
-
[![License][license-badge]][license-link]
|
|
14
|
-
|
|
15
|
-
[status-link]: https://www.repostatus.org/#active
|
|
16
|
-
[status-badge]: https://www.repostatus.org/badges/latest/active.svg
|
|
17
|
-
[pypi-link]: https://pypi.org/project/jaxion
|
|
18
|
-
[pypi-badge]: https://img.shields.io/pypi/v/jaxion?label=PyPI&logo=pypi
|
|
19
|
-
[workflow-test-link]: https://github.com/JaxionProject/jaxion/actions/workflows/test-package.yml
|
|
20
|
-
[workflow-test-badge]: https://github.com/JaxionProject/jaxion/actions/workflows/test-package.yml/badge.svg?event=push
|
|
21
|
-
[docs-link]: https://jaxion.readthedocs.io
|
|
22
|
-
[docs-badge]: https://readthedocs.org/projects/jaxion/badge
|
|
23
|
-
[license-link]: https://opensource.org/licenses/Apache-2.0
|
|
24
|
-
[license-badge]: https://img.shields.io/badge/License-Apache_2.0-blue.svg
|
|
25
|
-
|
|
26
|
-
A simple JAX-powered simulation library for numerical experiments of fuzzy dark matter, stars, gas + more!
|
|
27
|
-
|
|
28
|
-
Author: [Philip Mocz (@pmocz)](https://github.com/pmocz/)
|
|
29
|
-
|
|
30
|
-
Jaxion is built for multi-GPU scalability and is fully differentiable. It is a high-performance JAX-based simulation library for modeling fuzzy dark matter alongside stars, gas, and cosmological dynamics. Being differentiable, Jaxion can seamlessly integrate with pipelines for inverse-problems, inference, optimization, and coupling to ML models.
|
|
31
|
-
|
|
32
|
-
Jaxion is the simpler companion project to differentiable astrophysics code [Adirondax](https://github.com/AdirondaxProject/adirondax)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
## Getting started
|
|
36
|
-
|
|
37
|
-
Install with:
|
|
38
|
-
|
|
39
|
-
```console
|
|
40
|
-
pip install jaxion
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
or, for GPU support use:
|
|
44
|
-
|
|
45
|
-
```console
|
|
46
|
-
pip install jaxion[cuda12]
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Check out the `examples/` directory for demonstrations of using Jaxion.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
## Examples
|
|
53
|
-
|
|
54
|
-
<p align="center">
|
|
55
|
-
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/dynamical_friction">
|
|
56
|
-
<img src="examples/dynamical_friction/movie.gif" alt="dynamical_friction" width="128"/>
|
|
57
|
-
</a>
|
|
58
|
-
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/heating_gas">
|
|
59
|
-
<img src="examples/heating_gas/movie.gif" alt="heating_gas" width="128"/>
|
|
60
|
-
</a>
|
|
61
|
-
<a href="https://github.com/JaxionProject/jaxion/tree/main/examples/tidal_stripping">
|
|
62
|
-
<img src="examples/tidal_stripping/movie.gif" alt="tidal_stripping" width="128"/>
|
|
63
|
-
</a>
|
|
64
|
-
</p>
|
|
65
|
-
|
|
66
|
-
## Links
|
|
67
|
-
|
|
68
|
-
* [Code repository](https://github.com/JaxionProject/jaxion) on GitHub (this page).
|
|
69
|
-
* [Documentation](https://jaxion.readthedocs.io) for up-to-date information about installing and running jaxion.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
## Cite this repository
|
|
73
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|