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

Support for converting Qiskit Noise models #5996

Merged
merged 29 commits into from
Jul 30, 2024

Conversation

obliviateandsurrender
Copy link
Contributor

Context: Adds support for converting Qiskit noise models to PennyLane ones.

Description of the Change: Adds a from_qiskit_noise function that uses implementation in pennylane-qiskit plugin for executing the conversion.

Benefits: Qiskit noise models can be mapped to PL ones.

Possible Drawbacks: Multi-qubit errors would be a bit harder to track since PL only has single-qubit error channels (except qml.QubitChannel).

Related GitHub Issues: [sc-68046]

Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

Copy link

codecov bot commented Jul 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.65%. Comparing base (55058c7) to head (ca196ef).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5996      +/-   ##
==========================================
- Coverage   99.66%   99.65%   -0.01%     
==========================================
  Files         430      430              
  Lines       41488    41210     -278     
==========================================
- Hits        41348    41069     -279     
- Misses        140      141       +1     

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

Copy link
Contributor

@trbromley trbromley left a comment

Choose a reason for hiding this comment

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

doc/releases/changelog-dev.md Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py 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.

Looks good @obliviateandsurrender. Just a comment about the confusing example lol, but otherwise it seems like the changes are pretty straightforward. No tests are necessary for this load_noise_model function?

pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
Copy link
Contributor

@soranjh soranjh left a comment

Choose a reason for hiding this comment

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

Thanks @obliviateandsurrender, please address my final minor points before merging. Also, please make sure that @trbromley and @isaacdevlugt approve the kwargs.

pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/noise/conditionals.py Show resolved Hide resolved
Copy link
Contributor

@isaacdevlugt isaacdevlugt left a comment

Choose a reason for hiding this comment

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

Thanks @obliviateandsurrender! This looks really nice ⭐. Couple suggestions on docstring wording / explanation. Otherwise, looks great!

pennylane/io.py Show resolved Hide resolved
pennylane/io.py Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
Copy link
Contributor

@isaacdevlugt isaacdevlugt left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Contributor

@trbromley trbromley left a comment

Choose a reason for hiding this comment

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

Thanks @obliviateandsurrender! This overall looks great. Once we've resolved my final question there will be no more blockers from me.

pennylane/io.py Outdated Show resolved Hide resolved
pennylane/io.py Outdated Show resolved Hide resolved
@obliviateandsurrender obliviateandsurrender merged commit 20eed81 into master Jul 30, 2024
40 checks passed
@obliviateandsurrender obliviateandsurrender deleted the noise-model-convert branch July 30, 2024 00:20
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.

5 participants