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 conversion support for Qiskit noise models #577

Merged
merged 16 commits into from
Jul 25, 2024

Conversation

obliviateandsurrender
Copy link
Contributor

Context: Add support for converting Qiskit's noise models to PennyLane's noise models.

Description of the Change:

  1. noise_models.py contains helper methods for converting a Qiskit's NoiseModel object to a list of PennyLane Channel objects that are constructed based on their Kraus representation obtained via Qiskit.
  2. converter.py contains the load_noise_model method, which accepts a Qiskit noise model along with some mentioned keyword arguments and returns the corresponding PennyLane noise model.

Benefits:
Noise model construction can be done in PennyLane from a Qiskit one.

Possible Drawbacks:

  1. The Readability of converted noise models will not be the best as QubitChannels will only give Kraus representation and not any information on the corresponding error.

Related GitHub Issues: [sc-68045]

Copy link

codecov bot commented Jul 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a5f0f5a) to head (cb9f811).
Report is 14 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##            master      #577    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files            7         9     +2     
  Lines          554       867   +313     
==========================================
+ Hits           554       867   +313     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@austingmhuang austingmhuang left a comment

Choose a reason for hiding this comment

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

Looking good @obliviateandsurrender! Don't think I totally understand how the tests work for the noise models at a detailed level but I think I get it on a high-level basis. Seems like you take a qiskit noise model -> quantum error map (converting qiskit errors to kraus matrices) -> pennylane noise model?

pennylane_qiskit/converter.py Show resolved Hide resolved
pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
pennylane_qiskit/noise_models.py Outdated Show resolved Hide resolved
tests/test_converter.py Outdated Show resolved Hide resolved
tests/test_noise_models.py Outdated Show resolved Hide resolved
tests/test_noise_models.py Outdated Show resolved Hide resolved
pennylane_qiskit/noise_models.py Show resolved Hide resolved
Copy link
Contributor

@austingmhuang austingmhuang left a comment

Choose a reason for hiding this comment

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

No major comments or issues from my side. Just left some nitpicky stuff 😅

CHANGELOG.md Outdated Show resolved Hide resolved
pennylane_qiskit/noise_models.py Outdated Show resolved Hide resolved
pennylane_qiskit/noise_models.py Show resolved Hide resolved
Copy link
Contributor

@lillian542 lillian542 left a comment

Choose a reason for hiding this comment

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

Looks good to me! 🎉

@obliviateandsurrender obliviateandsurrender merged commit 30b8c31 into master Jul 25, 2024
10 checks passed
@obliviateandsurrender obliviateandsurrender deleted the noise-models-conversion branch July 25, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants