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

Hafnian modifications #333

Closed nquesada closed 2 years ago

nquesada commented 2 years ago

The new hafnian functions now use the Labudde method to calculate power traces instead of using diagonalization.

codecov[bot] commented 2 years ago

Codecov Report

Merging #333 (9610392) into master (8d56ecf) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #333   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        24           
  Lines         1722      1723    +1     
=========================================
+ Hits          1722      1723    +1     
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 8d56ecf...9610392. Read the comment docs.

brandonpolymtl commented 2 years ago

Benchmark_hafnian_eig_vs_charpoly Here is a benchmark of how long it takes to calculate the hafnian of different matrix sizes with the eigenvalues method and with the powertraces method