Add run_from_experiment to stochastic solvers.#2318
Merged
Ericgig merged 22 commits intoApr 25, 2024
Conversation
pmenczel
reviewed
Apr 18, 2024
pmenczel
left a comment
Member
There was a problem hiding this comment.
This is a cool new feature! I do not think that I have much to add.
Just as a side note, I used this opportunity to finally try to understand what exactly happens with the heterodyne option, and it took me quite a while to figure out. In the users guide, there is the definition of the homodyne current; I think it could be useful to add a definition of the heterodyne currents as well? (But I don't know if that's in the scope of this PR.)
Co-authored-by: Paul <[email protected]>
…com/Ericgig/qutip into feature.stochastic_from_experiments
42c9b93 to
3c14639
Compare
82f0bae to
04994a2
Compare
…com/Ericgig/qutip into feature.stochastic_from_experiments
04994a2 to
b508e4b
Compare
added 2 commits
April 22, 2024 09:05
pmenczel
approved these changes
Apr 25, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add the capacity of stochastic solver to run from know noise or measurements.
In the lab, the measurement can be obtained, but that measurements is a mix of and expectation values and noise. The stochastic solver can be used to split these components to study the system.
The new method for this is
SMESolver.run_from_experiment. It works similarly torunof deterministic solver: it compute a single trajectory. It can take eitherdWormeasurementas the noise input. (dWis the default).dWinput is available with every integration method, but measurement input is limited toeuler,milstein,pred_corr,platen.The measurement is
expect(m_ops, state_t) + dW / dt. Forrun_from_experimentit has no choice but to takestate_tat the start of the interval, but for the result forsmesovle, it was taken at the end of the interval. I updated thestore_measurementoptions to allow the user the choose where it is taken betweenstart,endandmiddle. Whenstartis used, therun's result's measurement can be feed back torun_from_experimentto recompute the same trajectory. (The theory is the integral of the expectation value over the interval.)Another change in this PR is to keep the dW in the wiener and result class. We used to sum them into
W, but thedWare what we use so it just end up being extra calls tonp.cumsumandnp.diff.