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

Update op and MP __eq__ and __hash__ #4536

Merged
merged 22 commits into from Sep 1, 2023
Merged

Update op and MP __eq__ and __hash__ #4536

merged 22 commits into from Sep 1, 2023

Conversation

mudit2812
Copy link
Contributor

Context:
Operator and measurement process hash and equality have been pending changes.

Description of the Change:

  • Update operator/measurement process __eq__ to return qml.equal.
  • Update operator/measurement process __hash__ to return the hash property of the object.

Benefits:
Equality and hashing makes sense.

Possible Drawbacks:

Related GitHub Issues:

@mudit2812 mudit2812 requested a review from a team August 28, 2023 19:32
@timmysilv
Copy link
Contributor

I now fear that some of the changes I made last release were unnecessary... can we (I?) take a sec to see if any can be safely un-done in this PR?

@albi3ro
Copy link
Contributor

albi3ro commented Aug 29, 2023

[sc-36545] [sc-36546]

@codecov
Copy link

codecov bot commented Aug 29, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Comparison is base (8adc449) 99.65% compared to head (095a9f8) 99.65%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4536      +/-   ##
==========================================
- Coverage   99.65%   99.65%   -0.01%     
==========================================
  Files         376      376              
  Lines       33114    33104      -10     
==========================================
- Hits        33001    32991      -10     
  Misses        113      113              
Files Changed Coverage Δ
pennylane/measurements/measurements.py 100.00% <100.00%> (ø)
pennylane/measurements/mid_measure.py 100.00% <100.00%> (ø)
pennylane/operation.py 97.42% <100.00%> (-0.01%) ⬇️

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

Copy link
Contributor

@albi3ro albi3ro left a comment

Choose a reason for hiding this comment

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

Long time coming, but so exciting 🎉 🚀 🎉

Looks awesome!

@mudit2812
Copy link
Contributor Author

Progress has stalled a bit. Going to re-request review after updating docs and reverting any unnecessary changes that @timmysilv and I added before the 0.32 release.

@mudit2812 mudit2812 enabled auto-merge (squash) August 31, 2023 20:53
@mudit2812
Copy link
Contributor Author

mudit2812 commented Aug 31, 2023

Need to add a test for change to Hamiltonian.

Hamiltonian has a bug. Changes will be moved to a bug fix PR

@mudit2812 mudit2812 enabled auto-merge (squash) September 1, 2023 14:37
@mudit2812 mudit2812 merged commit 929e7b8 into master Sep 1, 2023
39 checks passed
@mudit2812 mudit2812 deleted the eq-hash branch September 1, 2023 15:34
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.

None yet

3 participants