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

Change qml.equal default behaviour to return False instead of raising error #4315

Merged
merged 16 commits into from Jul 11, 2023

Conversation

mudit2812
Copy link
Contributor

Description of the Change:

  • Updated qml.equal and dispatches to remove any errors that are raised and replace them with return False.

Benefits:

  • qml.equal doesn't break code execution. Users no longer need to use try-except blocks to rely on qml.equal without raising errors.

Possible Drawbacks:

Related GitHub Issues:

@mudit2812 mudit2812 marked this pull request as ready for review July 4, 2023 19:23
@mudit2812 mudit2812 requested a review from a team July 4, 2023 19:52
@mudit2812
Copy link
Contributor Author

[sc-40553]

@mudit2812 mudit2812 added the review-ready 👌 PRs which are ready for review by someone from the core team. label Jul 4, 2023
@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Merging #4315 (ee3f64b) into master (0f2cf7d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #4315   +/-   ##
=======================================
  Coverage   99.79%   99.79%           
=======================================
  Files         351      351           
  Lines       32058    32108   +50     
=======================================
+ Hits        31991    32041   +50     
  Misses         67       67           
Impacted Files Coverage Δ
pennylane/devices/experimental/device_api.py 98.00% <ø> (ø)
pennylane/gradients/hadamard_gradient.py 100.00% <ø> (ø)
pennylane/gradients/jvp.py 100.00% <ø> (ø)
pennylane/gradients/parameter_shift.py 100.00% <ø> (ø)
pennylane/templates/layers/cv_neural_net.py 100.00% <ø> (ø)
pennylane/devices/default_gaussian.py 100.00% <100.00%> (ø)
pennylane/gradients/general_shift_rules.py 100.00% <100.00%> (ø)
pennylane/ops/cv.py 100.00% <100.00%> (ø)
pennylane/ops/functions/bind_new_parameters.py 100.00% <100.00%> (ø)
pennylane/ops/functions/equal.py 98.37% <100.00%> (-0.04%) ⬇️
... and 7 more

tests/ops/functions/test_equal.py Outdated Show resolved Hide resolved
pennylane/ops/functions/equal.py Show resolved Hide resolved
Copy link
Contributor

@timmysilv timmysilv left a comment

Choose a reason for hiding this comment

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

my previous approval stands

@mudit2812 mudit2812 requested a review from a team July 10, 2023 19:01
Copy link
Contributor

@lillian542 lillian542 left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks @mudit2812 ! 🚀

pennylane/ops/functions/equal.py Show resolved Hide resolved
@mudit2812 mudit2812 enabled auto-merge (squash) July 10, 2023 21:09
@mudit2812 mudit2812 merged commit b781be0 into master Jul 11, 2023
43 checks passed
@mudit2812 mudit2812 deleted the equal-error branch July 11, 2023 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-ready 👌 PRs which are ready for review by someone from the core team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants