XanaduAI / thewalrus

A library for the calculation of hafnians, Hermite polynomials and Gaussian boson sampling.
https://the-walrus.readthedocs.io
Apache License 2.0
99 stars 54 forks source link

Fix size-0 matrix permanents #320

Closed GregoryMorse closed 2 years ago

GregoryMorse commented 2 years ago

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

codecov[bot] commented 2 years ago

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.

thisac commented 2 years ago

@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.