Skip to content
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

Merged
merged 3 commits into from
Jun 5, 2024
Merged

Conversation

chriseclectic
Copy link
Member

@chriseclectic chriseclectic commented May 30, 2024

Summary

This refactors QuantumError to inherit from a BaseQuantumError class, and NoiseModel to allow adding BaseQuantumErrors rather than only QuantumErrors.

Depends on #2158

Details 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.

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.
@doichanj doichanj self-requested a review June 4, 2024 02:32
@doichanj doichanj added this to the Aer 0.15.0 milestone Jun 4, 2024
@doichanj doichanj added the Changelog: New Feature Include in the Added section of the changelog label Jun 4, 2024
# Invalid error type
else:
raise NoiseError("Invalid error type: {}".format(error_type))
return noise_model
Copy link
Collaborator

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)

Copy link
Member Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see

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.

Copy link
Member

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.

Copy link
Collaborator

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

@doichanj doichanj self-requested a review June 5, 2024 01:17
@doichanj doichanj added the automerge This PR will automatically merge once its CI has passed label Jun 5, 2024
@doichanj doichanj merged commit 18a2668 into Qiskit:main Jun 5, 2024
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge This PR will automatically merge once its CI has passed Changelog: New Feature Include in the Added section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants