-
Notifications
You must be signed in to change notification settings - Fork 61
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
JAX pulse simulation compilation bug #122
Comments
Upon further inspection I think it may be possible to fix both failure modes to be JAX-compilable. Will do further testing of this idea then implement in a PR if it works out. |
So it seems like:
For the last point, I don't think it's worth spending the time to do this personally right now - it will require a non-trivial rewrite of the fixed step solvers template, and (I'm guessing) these solvers are unlikely to be used in the majority of use-cases for pulse simulation. So, I think a reasonable course of action is:
|
Informations
What is the current behavior?
The automatic
jit
compilation routine for simulating pulse schedules with JAX raises errors under certain conditions.Steps to reproduce the problem
Specifying if using
method='jax_odeint'
, specifying thet_eval
kwarg will cause the error to be raised. Also, if usingmethod='jax_expm'
, the error will be raised regardless of whethert_eval
is included or not.Examples here can probably be reduced further in terms of lines of code, but here is a minimal example:
This works:
However this does not:
and similarly this does not:
What is the expected behavior?
The above calls should work and produce correct results.
Suggested solutions
Both errors are being raised in different places, but the underlying reason is the same: the function being internally compiled (located here) takes
t_span
as an argument, but in both cases (ift_eval
is specified, or if a fixed step solver is being used),t_span
cannot be compiled over.Some imperfect options:
t_span
as a static argument in the internally compiled function. This is an extremely easy option, but will limit the usefulness of the compilation to cases where allt_span
values are the same. It will still apply to a lot of cases, but I think this is an option of last resort.The text was updated successfully, but these errors were encountered: