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 size-0 matrix permanents #320

Merged
merged 10 commits into from
Jan 24, 2022
Merged

Fix size-0 matrix permanents #320

merged 10 commits into from
Jan 24, 2022

Conversation

GregoryMorse
Copy link
Contributor

Context:
Permanent computations with size 0 returning incorrect values, with size 1 not optimized

Description of the Change:
Fix 0x0 and optimize 1x1 cases for permanent

Benefits:
0x0 matrices have correct output, 1x1 are faster

Possible Drawbacks:
None

Related GitHub Issues:
#319

Fix issue XanaduAI#319 by checking 0 size matrices and returning one in permanent computations
remove unnecessary whitespace
Fixed formatting
Copy link
Contributor

@thisac thisac 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 @GregoryMorse! Don't forget to add an entry to the changelog and your name to the list of contributors. Thanks a lot for your contribution! 💯

thewalrus/_permanent.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jan 17, 2022

Codecov Report

Merging #320 (1dab9cd) into master (4452c64) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #320   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         1568      1572    +4     
=========================================
+ Hits          1568      1572    +4     
Impacted Files Coverage Δ
thewalrus/_permanent.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4452c64...1dab9cd. Read the comment docs.

@sduquemesa sduquemesa linked an issue Jan 17, 2022 that may be closed by this pull request
1 task
@thisac
Copy link
Contributor

thisac commented Jan 21, 2022

@GregoryMorse Just missing an entry to the changelog, and then we can merge the PR. You can simply add an entry under Bug fixes, describing the fix, and your name under Contributors at the top of the file.

.github/CHANGELOG.md Outdated Show resolved Hide resolved
@thisac thisac merged commit dde8320 into XanaduAI:master Jan 24, 2022
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.

Library hard crashing when computing BBFG permanent with a 0x0 matrix
3 participants