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

Recursive hafnian #325

Closed dleclerc33 closed 2 years ago

dleclerc33 commented 2 years ago

Context: Addition of a new algorithm for the calculation of the hafnian.

Description of the Change: New functions, recursive_hafnian and solve added in the module _hafnian.

Benefits: Faster computation of the hafnian than the default method in place.

Possible Drawbacks: Does not support the computation of the loop hafnian.

Related GitHub Issues:

codecov[bot] commented 2 years ago

Codecov Report

Merging #325 (006d02c) into master (017d24c) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #325   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        24           
  Lines         1697      1708   +11     
=========================================
+ Hits          1697      1708   +11     
Impacted Files Coverage Δ
thewalrus/_hafnian.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 017d24c...006d02c. Read the comment docs.

nquesada commented 2 years ago

Before this PR can me merged a figure comparing benchmarking must be included.

benjaminlanthier commented 2 years ago

haf_benchmark

nquesada commented 2 years ago

@sduquemesa @josh146 : the CodeFactor bot is complaining for something that has nothing to do with this PR. Assuming you are OK with this, then this is ready to be merged.