Skip to content
Projects

JAX backend

The equations of opencr.backends.jax_backend, declared on the code that implements them and checked by the tests.

effective_rate

functionsource

Return M_eff[target, source] / n_e (m^3/s) as a differentiable JAX scalar.

gradient
∂∂Te Mtarget,sourceeff(Te,ne)neby jax.grad\frac{\partial}{\partial T_e}\, \frac{M^{\mathrm{eff}}_{\mathrm{target},\mathrm{source}}(T_e, n_e)}{n_e} \quad \text{by } \texttt{jax.grad}
Assumes
  • the reduction of quasi_static written in jax.numpy, vmapped over (Te,ne)(T_e, n_e); float64
Built from

jacobian

functionsource

Return dR/dn as a dense array by forward-mode automatic differentiation.

jacobian
J=∂R∂nby forward-mode automatic differentiation (jax.jacfwd) of R(n)=∑rνirwrJ = \frac{\partial R}{\partial \mathbf n} \quad \text{by forward-mode automatic differentiation (}\texttt{jax.jacfwd}\text{) of } R(\mathbf n) = \sum_r \nu_{ir} w_r
Assumes
  • dense; the general equations (nonlinear, quasi-neutral) with Maxwellian rates
  • a Function rate is tabulated on its file_temperatures and interpolated in log-log
Built from