DifferentiableUniverseInitiative / jax_cosmo

A differentiable cosmology library in JAX
MIT License
172 stars 36 forks source link

Support for differentiable arbitrary linear operators? #120

Open mreineck opened 8 months ago

mreineck commented 8 months ago

I'm not sure if this proposal would be a good fit for jax_cosmo; please feel free to close the issue if it isn't!

Recently, during my work on the ducc0 package (https://gitlab.mpcdf.mpg.de/mtr/ducc or https://github.com/mreineck/ducc) I found a way to "JAX-enable" any linear operator, even if it is partially implemented in a way that JAX cannot trace (e.g. as a custom C++ function). Using this, it's possible to add JAX support for spherical harmonic transforms, non-uniform FFTs and similar operations that might be of interest for differential cosmology. The execution times will only be marginally slower than calling the code directly.

Would there be interest to use this functionality from jax-cosmo? If so, please get in touch so we can iterate on the best possible interface and other technicalities!