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

loop Torontonian #317

Closed jakeffbulmer closed 2 years ago

jakeffbulmer commented 2 years ago

Context: Previously, threshold detector probabilities of displaced Gaussian states used a method which could not be distilled into a matrix function - like the Torontonian. We create a new function called the loop Torontonian, which allows for displaced Gaussian state calculations to be performed in a similar way to zero-mean Gaussian states.

Description of the Change: New function ltor added, which calls numba_ltor. Updated the inner workings of threshold_detection_prob to reflect this. Also updated numba_tor to be able to run in parallel.

Benefits: Faster, more stable, more consistent methods for calculating threshold detector probabilities of all Gaussian states

codecov[bot] commented 2 years ago

Codecov Report

Merging #317 (77beed0) into master (c96b9da) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #317   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         1603      1616   +13     
=========================================
+ Hits          1603      1616   +13     
Impacted Files Coverage Δ
thewalrus/__init__.py 100.00% <ø> (ø)
thewalrus/_torontonian.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 c96b9da...77beed0. Read the comment docs.