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

Bugfix for comparison to zero with torch tensor #5183

Merged
merged 3 commits into from
Feb 9, 2024
Merged

Conversation

lillian542
Copy link
Contributor

@lillian542 lillian542 commented Feb 8, 2024

Context:
ctrl_decomp_zyz with a target with torch parameters fails because qml.math.isclose(torch.Tensor, float) raises a TypeError. From forum post here.

Description of the Change:
Switching to qml.math.isclose(float, torch.Tensor) seems to appease PyTorch.

Related GitHub Issues:
#5185

@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c1a813d) 99.68% compared to head (4939bc5) 99.67%.
Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5183      +/-   ##
==========================================
- Coverage   99.68%   99.67%   -0.01%     
==========================================
  Files         394      394              
  Lines       36160    36051     -109     
==========================================
- Hits        36047    35935     -112     
- Misses        113      116       +3     

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

@lillian542 lillian542 linked an issue Feb 8, 2024 that may be closed by this pull request
1 task
@lillian542 lillian542 marked this pull request as ready for review February 8, 2024 22:30
@lillian542
Copy link
Contributor Author

[sc-56462]

@lillian542 lillian542 requested a review from a team February 9, 2024 15:12
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.

What a weird reason to raise an error.

@lillian542 lillian542 requested a review from a team February 9, 2024 15:53
@albi3ro albi3ro merged commit 6b127b8 into master Feb 9, 2024
33 checks passed
@albi3ro albi3ro deleted the torch_decomp_bugfix branch February 9, 2024 16:22
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.

[BUG] Controlled ZYZ decomp fails for operators with torch parameters
4 participants