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's NoiseModels #569

Closed
wants to merge 39 commits into from

Conversation

obliviateandsurrender
Copy link
Contributor

@obliviateandsurrender obliviateandsurrender commented Jul 5, 2024

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 particular things
    • Converting a Qiskit's Error object to that of a corresponding Qiskit's instructions consisting of their Pauli or Kraus representation
    • Using the above representation to map it to a corresponding PennyLane Channel's description.
    • Converting a Qiskit's NoiseModel object to a list of PennyLane Channel objects that are constructed based on the above description.
  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 becomes easier and hardware noise models can be better studied.

Possible Drawbacks:

  1. Kraus representations of errors are not unique. Since Qiskit simply stores the final description in a crude way consisting either of the Pauli words or via the Kraus operators, the conversion mapping doesn't remain one-to-one and could lead to a channel corresponding to a different error but with the same canonicalized Kraus representation for the computed parameters.
  2. Readout errors are not yet supported.

Related GitHub Issues: [sc-68045]

Copy link

codecov bot commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a5f0f5a) to head (53c26c1).
Report is 13 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##            master      #569    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files            7         8     +1     
  Lines          554       734   +180     
==========================================
+ Hits           554       734   +180     

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

@obliviateandsurrender obliviateandsurrender marked this pull request as ready for review July 9, 2024 14:41
@obliviateandsurrender obliviateandsurrender changed the title [WIP] Add conversion support for Qiskit's NoiseModels Add conversion support for Qiskit's NoiseModels Jul 9, 2024
Comment on lines 418 to 420
if noise_model._default_readout_error or noise_model._local_readout_errors:
warn("Readout errors are not supported currently and will be skipped.")

Choose a reason for hiding this comment

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

@trbromley we have in the requirements that if readout noise is present, PennyLane raises an error. But, I'm wondering if raising a warning instead and skipping the readout noise makes more sense? 🤔

@obliviateandsurrender
Copy link
Contributor Author

A minimalistic version of this PR is implemented here.

@trbromley trbromley deleted the noise-model-convert branch July 16, 2024 14:05
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.

2 participants