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

Qutrit channel amplitude damping #5503

Merged

Conversation

Gabriel-Bottrill
Copy link
Contributor

@Gabriel-Bottrill Gabriel-Bottrill commented Apr 11, 2024

Context:
default.qutrit.mixed device has been added, but only one channel has been added, qml.QutritDepolarizingChannel, this adds the second channel to the device so the device can simulate the qutrit equivalent of amplitude damping noise.

Description of the Change:
Adds new channel module to qml.ops.qutrit package. Adding the second qutrit channel QutritAmplitudeDamping.

Benefits:
Allows for defualt.qutrit.mixed to simulate amplitude damping noise. Making default.qutrit.mixed, much more useful.

Possible Drawbacks:
N/A

Related GitHub Issues:
N/A

Copy link
Contributor Author

@Gabriel-Bottrill Gabriel-Bottrill left a comment

Choose a reason for hiding this comment

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

@albi3ro, @glassnotes, @mudit2812, and @trbromley I have finished this PR and added some comments. I look forward to your reviews!

tests/ops/qutrit/test_qutrit_channel_ops.py Show resolved Hide resolved
tests/ops/qutrit/test_qutrit_channel_ops.py Show resolved Hide resolved
tests/ops/qutrit/test_qutrit_channel_ops.py Show resolved Hide resolved
pennylane/ops/qutrit/channel.py Outdated Show resolved Hide resolved
@Gabriel-Bottrill Gabriel-Bottrill marked this pull request as ready for review May 15, 2024 23:35
Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.67%. Comparing base (b7b4b75) to head (033eb34).
Report is 262 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5503      +/-   ##
==========================================
- Coverage   99.68%   99.67%   -0.01%     
==========================================
  Files         415      416       +1     
  Lines       38898    38761     -137     
==========================================
- Hits        38774    38636     -138     
- Misses        124      125       +1     

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

Copy link
Contributor

@glassnotes glassnotes left a comment

Choose a reason for hiding this comment

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

@Gabriel-Bottrill looks great! Small comment re. gradient, and realized this and previous PR are missing integration tests for the channels.

pennylane/ops/qutrit/channel.py Outdated Show resolved Hide resolved
pennylane/ops/qutrit/channel.py Outdated Show resolved Hide resolved
pennylane/ops/qutrit/channel.py Show resolved Hide resolved
pennylane/ops/qutrit/channel.py Outdated Show resolved Hide resolved
pennylane/ops/qutrit/channel.py Outdated Show resolved Hide resolved
tests/ops/qutrit/test_qutrit_channel_ops.py Show resolved Hide resolved
tests/ops/qutrit/test_qutrit_channel_ops.py Outdated Show resolved Hide resolved
tests/ops/qutrit/test_qutrit_channel_ops.py Outdated Show resolved Hide resolved
tests/ops/qutrit/test_qutrit_channel_ops.py Show resolved Hide resolved
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 a lot @Gabriel-Bottrill!

doc/releases/changelog-dev.md Outdated Show resolved Hide resolved
pennylane/ops/qutrit/channel.py Show resolved Hide resolved
pennylane/ops/qutrit/channel.py Show resolved Hide resolved
Copy link
Contributor

@mudit2812 mudit2812 left a comment

Choose a reason for hiding this comment

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

Looks great! Happy to approve after the open comments are addressed.

pennylane/ops/qutrit/channel.py Outdated Show resolved Hide resolved
pennylane/ops/qutrit/channel.py Outdated Show resolved Hide resolved
pennylane/ops/qutrit/channel.py Outdated Show resolved Hide resolved
tests/ops/qutrit/test_qutrit_channel_ops.py Show resolved Hide resolved
Co-authored-by: Thomas R. Bromley <49409390+trbromley@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Copy link
Contributor Author

@Gabriel-Bottrill Gabriel-Bottrill left a comment

Choose a reason for hiding this comment

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

I comment on a few open questions, there are still a few open questions that I will address shortly.

pennylane/ops/qutrit/channel.py Show resolved Hide resolved
tests/ops/qutrit/test_qutrit_channel_ops.py Show resolved Hide resolved
tests/ops/qutrit/test_qutrit_channel_ops.py Show resolved Hide resolved
pennylane/ops/qutrit/channel.py Outdated Show resolved Hide resolved
Copy link
Contributor

@glassnotes glassnotes left a comment

Choose a reason for hiding this comment

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

This looks good to me - thanks @Gabriel-Bottrill ! I will keep an eye on the remaining discussions, but I leave it to Mudit or Tom to give the final approval here.

pennylane/ops/qutrit/channel.py Show resolved Hide resolved
pennylane/ops/qutrit/channel.py Show resolved Hide resolved
tests/ops/qutrit/test_qutrit_channel_ops.py Show resolved Hide resolved
@mudit2812
Copy link
Contributor

The jax failures should fix themselves once you update the branch @Gabriel-Bottrill

@Gabriel-Bottrill
Copy link
Contributor Author

Thank you @mudit2812!

@mudit2812 mudit2812 enabled auto-merge (squash) May 23, 2024 21:42
@mudit2812 mudit2812 merged commit fdca352 into PennyLaneAI:master May 23, 2024
38 checks passed
glassnotes added a commit that referenced this pull request Jun 6, 2024
**Context:**
The QutritAmplitudeDamping channel #5503 and #5757 variable names are
named with numbers, when making the TritFlip channel #5784 I realized
that it would be better to specify subspaces for clarity. This PR is
meant to change the name of QutritAmplitudeDamping's variables.

**Description of the Change:**
Change the name of the QutritAmplitudeDamping channel's variables from
gamma_1, gamma_2, and gamma_3 to gamma_01, gamma_02, and gamma_12,
respectively.

**Benefits:**
Makes the code more clear for which variables affect which subspace,
reducing the need to check the docs.

**Possible Drawbacks:**
Changes the name of variables of development code.

**Related GitHub Issues:**
N/A

---------

Co-authored-by: Gabriel Bottrill <bottrill@student.ubc.ca>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
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.

4 participants