Relative Content

Tag Archive for pythonsympyjax

How to use jax.custom_vjp with functions that take non-JAX types (e.g., SymPy expressions) as inputs?

I’m trying to use JAX’s custom_vjp to define custom gradient computations for a function that takes a SymPy expression as an input. However, I’m encountering errors because JAX doesn’t support non-JAX types as inputs for functions that are transformed (e.g., with grad, jit, or custom_vjp). I am recently modifying code in ScQubits to add a new jax backend to improve the efficiency, and then I meet some problem with jax and sympy.