-
Notifications
You must be signed in to change notification settings - Fork 110
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
Add derivative methods without caches #410
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #410 +/- ##
==========================================
- Coverage 97.03% 96.68% -0.36%
==========================================
Files 18 19 +1
Lines 1554 1688 +134
==========================================
+ Hits 1508 1632 +124
- Misses 46 56 +10 ☔ View full report in Codecov by Sentry. |
@Krastanov @david-pl pinging for review. |
For the following:
does this mean that each step of the solver will be causing an allocation (the |
And related to my question, do we want to create something like this:
but a bit cleaner and with better names |
@Krastanov yes, that is the case. We actually get a really nice performance speedup here using just the ODE interface. Although there's some allocation overhead, the speed is much better (here I set
|
I think this would be really good to implement. It seems pretty inefficient to allocate so much just for the sake of having a saving step in updating |
This confuses me a lot. What is going wrong in Is there a potential future version of |
@Krastanov
Maybe I am thinking about this the wrong way but this was my thought process. |
Addresses #406. This PR makes defining in-place functions straightforward (that is, the user does not have to input caches or adjoints of operators) for any solver. This is important given the recent merges (#404, qojulia/QuantumOpticsBase.jl#172) to have a SciML interface in QO.jl. The following example illustrates the motivation for this PR.
Before, we would have to define an in-place function as
Now, we can instead simply write
And solve the ODE as follows: