-
Notifications
You must be signed in to change notification settings - Fork 196
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
Unset noise after noise tests #635
Conversation
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Thanks for the fixes here, Ben. I would like to try to find a different approach, as I do not want to make it a requirement that users instantiate a I think there are other approaches that we can take to address the issues we've seen in the runtime. Happy to meet this week to discuss those approaches. One approach may be an update to the noise model destructor to call |
Thanks for the feedback. I'm definitely open to different approaches and was indeed questioning if this was the best path forward. Do you think 447b7ce is a valid use case that should be supported? Maybe the answer is 'no', and if so, maybe the smart pointer portion of these changes aren't needed. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Issue discovered while investigating Issue NVIDIA#609
c1215ee
to
dae7cd6
Compare
After further discussion with @amccaskey, we decided to remove the smart pointer portion of this PR and instead just a) make it clear when the user must call |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
This helps fix issue #609 by unsetting noise models at the end of noise tests. Without this change, the prior test's noise model could be used in subsequent tests, which is undesirable.
(Edited later) The following information is no longer applicable but is left for posterity...
In addition, a new test was added to show another related issue existed if the noise model was used outside of its original scope (as the API permits).
The resolution for that is to convert the noise model to
shared_ptr
instead of raw pointers. It would've been preferable to useunique_ptr
, but Python bindings do not allowunique_ptr
's to be used as function arguments, and we need the ability pass them into the C++ engine via functions, soshared_ptr
was chosen.