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

Fix qutrit mixed sampling of hamiltonians #5413

Merged
merged 3 commits into from
Mar 20, 2024
Merged

Conversation

astralcai
Copy link
Contributor

Context:
TestHamiltonianSamples fails in ham-tests

Description of the Change:
Update qml.Hamiltonian to qml.ops.Hamiltonian in isinstance checks such that it always refer to the old Hamiltonian

[sc-59163]

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.

@astralcai astralcai marked this pull request as ready for review March 20, 2024 16:01
@@ -29,7 +29,7 @@
from pennylane.measurements import Shots


APPROX_ATOL = 0.01
APPROX_ATOL = 0.05
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably I'm missing something, but I thought that this wasn't necessary anymore after this change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is to fix intermittent failures due to random fluctuations, actually unrelated to the actual failing test cases that this PR addresses

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, then it is the same issues that affected other PRs as well with opmath enabled

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.46%. Comparing base (4b35c14) to head (924d4f5).

Additional details and impacted files
@@            Coverage Diff             @@
##           ham-tests    #5413   +/-   ##
==========================================
  Coverage      99.46%   99.46%           
==========================================
  Files            400      400           
  Lines          37133    37133           
==========================================
  Hits           36935    36935           
  Misses           198      198           

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

Copy link
Contributor

@PietropaoloFrisoni PietropaoloFrisoni left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM

@Alex-Preciado Alex-Preciado requested review from albi3ro and removed request for Qottmann March 20, 2024 21:55
@astralcai astralcai merged commit 1037363 into ham-tests Mar 20, 2024
39 checks passed
@astralcai astralcai deleted the qutrit-sampling branch March 20, 2024 22:03
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