Iterable access to solver results and possibility of feedback to solvers
See original GitHub issueCurrently QuTiP solvers are pure batch jobs. One calls a function, e.g. mesolve
, which then runs until the state has been propagated to all requested time steps and then the function returns the result.
There are a variety of use cases where having access to results as they are calculated can be useful:
- Implementing a progress bar
- Limiting how long a solver runs for
- Stopping a solver early if a steady state or other desired or undesired state is detected.
- Implementing adaptive solvers where parameters are changed depending on the current state
We’re currently refactoring the QuTiP solvers for QuTiP v5, so perhaps now is a good time to consider whether this feature will see enough use to be worth the effort.
Implementation options:
- The solver could call a
callback function
each time a new result becomes available. - The solver could
yield
each time a new result becomes available. - The solver could do something asynchronous (I think this is not worth supporting natively in QuTiP – either of the others would allow something asynchronous to be implemented by a QuTiP users themselves if they wanted).
Probably these are not mutually exclusive. To make porting easier, it should still be possible to call some solve function without a callback or yielding as one can do now.
Related issues:
- qucontrol/krotov#93
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Iterable access to solver results and possibility of feedback to solvers
Currently QuTiP solvers are pure batch jobs. One calls a function, e.g. mesolve , which then runs until the state has been propagated...
Read more >Account Roles and Permissions - Iterable Support Center
Custom roles are bundles of permissions that give team members access to the Iterable features and resources they need to efficiently do their...
Read more >Pyomo Documentation - Read the Docs
This section provides an introduction to Pyomo: Python Optimization Modeling Objects. A more complete description.
Read more >PyROS Solver — Pyomo 6.4.4 documentation
Subordinate local and global NLP optimization solvers. Below is a list of arguments that PyROS expects the user to provide when calling the...
Read more >Iterable Reviews 2022: Details, Pricing, & Features - G2
The updates to the platform have made creating comms extremely fast and easy to preview, proof, and get quick feedback on. Our onboarding...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The new QuTiP solvers now support
solver.step(self, t, args=args)
. which allows manually stepping the state until timet
with the optional supplied args. I don’t think this quite addresses the full feedback possibilities, but I am noting the progress here.Most of scipy’s solver are not “thread-safe”, but we will be able to use other solvers in the new version. We will be sure to add at least one which is thread safe.
The
args=new_args
refer to theargs
in[H0, [H1, f(t, args)]]
, in your case, you could use something like:We don’t have step interpolation with changing coefficient array. It could be added, but we will have to think about it. Using a mutable, as in your example, would create error with most ODE solver with variable step, so I would not recommend it.