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

Noise Channels with the CliffordSimulator #1183

Merged
merged 5 commits into from
Feb 3, 2024
Merged

Conversation

BrunoLiegiBastonLiegi
Copy link
Contributor

@BrunoLiegiBastonLiegi BrunoLiegiBastonLiegi commented Feb 1, 2024

This PR adds support for noise channels to the CliffordSimulator.

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.

Copy link

codecov bot commented Feb 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5665875) 100.00% compared to head (965df66) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1183   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           68        68           
  Lines         9906      9919   +13     
=========================================
+ Hits          9906      9919   +13     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@BrunoLiegiBastonLiegi BrunoLiegiBastonLiegi marked this pull request as ready for review February 1, 2024 09:13
@renatomello renatomello added documentation Improvements or additions to documentation enhancement New feature or request quantum_info module PRs and issues related to the quantum information module labels Feb 1, 2024
@renatomello renatomello added this to the Qibo 0.2.5 milestone Feb 1, 2024
Copy link
Contributor

@renatomello renatomello left a comment

Choose a reason for hiding this comment

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

I think this is missing an explicit how-to in the docs of Pauli noise channels and Clifford simulation

Comment on lines +42 to +43
def apply_clifford(self, backend, state, nqubits):
return backend.apply_channel(self, state, nqubits)
Copy link
Contributor

Choose a reason for hiding this comment

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

This will break if one calls this method in any other scenario that isn't the Clifford backend acting on a symplectic matrix, right?

Maybe we should add a docstring explicitly mentioning that and/or raising an error when state isn't a symplectic matrix and/or raising an error when backend isn't Clifford

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, in principle, a user might instantiate a channel and call the apply_clifford method on a state vector and with a backend that is not the ClffordBackend, but the same is true for the standard apply and apply_density_matrix.
I don't think that's the way channels are intended to be used. Usually you just build the circuit put the channels you like and execute it. If an user wants for some reason to perform all the steps manually, then it's their responsibility to be aware of which backend and state object to use.

@renatomello renatomello added this pull request to the merge queue Feb 3, 2024
Merged via the queue into master with commit 465e88d Feb 3, 2024
18 of 19 checks passed
@renatomello renatomello deleted the clifford_channels branch February 3, 2024 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request quantum_info module PRs and issues related to the quantum information module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants