-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrating the Sympy-based Boltzmann solver from PyCosmo #87
Comments
And tagging @moserb94 on this issue. After reading more of the PyCosmo code I realized that it still relied on an external RecFast implementation however :-( so not completely as easy as I was hoping. One would have to recode RecFast also in JAX, in the same way as Zack did it for Bolt.jl here: https://github.com/xzackli/Bolt.jl/blob/main/src/ionization/recfast.jl The whole thing is still doable :-) But slightly more involved than I was hoping. |
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. |
Thank you for tagging me. It sounds pretty cool (even though I just started looking into JAX)! Yes, we rely on RecFast++ to compute the evolution of thermodynamic quantities and we are actually planning to move to HYREC-2 in the near future. |
interesting :-) By any chance.... would you be thinking of doing an implementation in sympy as well for hyrec-2 ? |
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. |
Following 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:
jax.experimental.odeint
to integrate in time the systemAnd boom! You got yourself a diffable Boltzman solver!
The text was updated successfully, but these errors were encountered: