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
Disable improved sampling for nm_mcsolve #2234
Conversation
I now noticed that the tests failed because of the added warnings. Unsure how to handle this, could add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should remove the options from solver_options
instead.
It contain every valid options keys, just removing the key from it would makes setting it an error.
solver_options = {
**MCSolver.solver_options,
"completeness_rtol": 1e-5,
"completeness_atol": 1e-8,
"martingale_quad_limit": 100,
}
del solver_options["improved_sampling"]
Also I would suggest to overwrite the options
property to add the completeness_rtol
, etc. to it's docsting.
Hi Eric, thanks for your comment.
Unfortunately it is not so easy, since Line 474 in 48df19c
We could try overriding every method of MCSolver that accesses this option, but that seems easy to break accidentally again with future changes in MCSolver.
Done. |
Note: I tested the |
But it shows that our solver class structure is to be reworked or we need an equivalent to |
Okay, I have fixed it like this for now.
I could try implementing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy with that.
Description
The
improved_sampling
option was recently added to theMCSolver
.NonMarkovianMCSolver
extendsMCSolver
and can therefore be called withimproved_sampling=True
. Without this PR, it would then silently return wrong results.The technical reason is that
nm_mcsolve
calculates the value of an influence martingale, which is factored into the calculation of expectation values in the custom result classNmmcResult
. Ifimproved_sampling
is enabled,McResultImprovedSampling
is used instead.I here only disable the
improved_sampling
option fornm_mcsolve
and print a warning if a user tries to use it. I have created a new issue to discuss ways to implement the improved sampling fornm_mcsolve
.Related issue
#2235