-
Notifications
You must be signed in to change notification settings - Fork 361
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 BaseQuantumError
class
#2155
Conversation
c1dcc2b
to
e127261
Compare
Adds a `BaseQuantumError` parent class for `QuantumError` that is used by noise models and circuit insertion in preparation of adding additional optimized error classes for Pauli and Pauli Lindblad errors.
e127261
to
f2603b9
Compare
# Invalid error type | ||
else: | ||
raise NoiseError("Invalid error type: {}".format(error_type)) | ||
return noise_model |
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.
Is it difficult to implement from_dict
for new BaseQuantumError
structure?
(I think from_dict
is not so important, but I wonder if there are some users need this)
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.
I saw we had put a deprecation warning on this method a long time ago, so figured it wasn't used anymore and just removed it.
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.
I see
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.
For what it's worth, this is useful for people who want to run noisy simulations on a server but want to enable clients to pick their noise model. I'll also note that the associated to_dict
method is still present.
I'm not using this currently and I'm not requesting it be restored. The reason I noticed is because a unit test of mine broke with qiskit-aer 0.15, but I'll just delete my test.
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.
This removal also broke the unit tests in qiskit-ibm-runtime
because we need to serialize/deserialize noise models to send to the server.
For now, we can pin the aer version while we deprecate and remove support for this on our side.
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.
I temporary revert NoiseModel.from_dict
in #2222 and will be included in Aer 0.15.1
But we would like to remove again in the future release if it will not be used
Summary
This refactors QuantumError to inherit from a
BaseQuantumError
class, andNoiseModel
to allow adding BaseQuantumErrors rather than only QuantumErrors.Depends on #2158Details and comments
This is a pre requisit for adding the optimized PauliLindbladError and PauliError operators proposed in #2154
On its own this PR should have no visible changes to current users.