Integrating the Sympy-based Boltzmann solver from PyCosmo
See original GitHub issueFollowing a very nice talk from Beatrice Moser, I looked a little bit at how PyCosmo is implementing their own Boltzmann code and it’s actually pretty nice and could be pretty easily ported to JAX I think.
The ODE is specificied using Sympy, which makes it pretty easy to write down the equations, and then they use their own sympy2c code to transform the python code into JIT compiled code to run the actual ODE solver.
So that’s pretty cool 😃 But we could make it way cooler by doing the following:
- Copy/Paste the Sympy equations from PyCosmo (which is GPL licensed)
- Use Miles’ sympy2jax library https://github.com/MilesCranmer/sympy2jax to turn the equations into JAX functions
- Use
jax.experimental.odeint
to integrate in time the system - Profit!
And boom! You got yourself a diffable Boltzman solver!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
PyCosmo: An Integrated Cosmological Boltzmann Solver - arXiv
We present PyCosmo, a new Python-based framework to solve this set of equations using a special pur- pose solver based on symbolic manipulations ......
Read more >Issues · DifferentiableUniverseInitiative/jax_cosmo - GitHub
Migration integration: ClenshawCurtis ... Integrating the Sympy-based Boltzmann solver from PyCosmo Cosmology Issue related to implementing cosmology ...
Read more >PyCosmo: an integrated cosmological Boltzmann solver ...
The symbolic representation of the Einstein–Boltzmann equation system in PyCosmo provides a convenient interface for implementing extended cosmological models.
Read more >[PDF] PyCosmo: An integrated cosmological Boltzmann solver
Semantic Scholar extracted view of "PyCosmo: An integrated cosmological Boltzmann solver" by A. Réfrégier et al.
Read more >arXiv:1708.05177v1 [astro-ph.CO] 17 Aug 2017 - Scinapse
PyCosmo : An Integrated Cosmological Boltzmann Solver ... Keywords: Cosmology, Boltzmann Equation, Differential Equations, Python.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also I’m thinking it would be worthwhile to host a JAX Boltzmann solver as a separate project, as opposed to integrating it directly into jax-cosmo.
The idea was to use hyrec-2 the way we use RecFast++ (meaning a python wrapper and an interpolator), rather than rewriting the code in sympy… so that wouldn’t help I guess.