XanaduAI / thewalrus

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

Updates input_validation and _hafnian #206

Closed nquesada closed 3 years ago

nquesada commented 3 years ago

Updates input_validation to use np.allclose to check for symmetry. It also updates _hafnian so that if it gets a diagonal matrix and loop=True it calculates the loop hafnian efficiently.

codecov[bot] commented 3 years ago

Codecov Report

Merging #206 into master will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #206   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines         1164      1166    +2     
=========================================
+ Hits          1164      1166    +2     
Impacted Files Coverage Δ
thewalrus/_hafnian.py 100.00% <100.00%> (ø)
thewalrus/_hermite_multidimensional.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 35e192b...8525dd6. Read the comment docs.