XanaduAI / thewalrus

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

Adds extra normalization to make np.random.choice happy #278

Closed nquesada closed 3 years ago

nquesada commented 3 years ago

Add extra normalization of binary probabilities so that numpy choice gets exactly what it wants. Relevant for this

https://github.com/XanaduAI/photonics/pull/43#issuecomment-906603908

codecov[bot] commented 3 years ago

Codecov Report

Merging #278 (6c4c3ed) into master (1542332) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #278   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines         1439      1441    +2     
=========================================
+ Hits          1439      1441    +2     
Impacted Files Coverage Δ
thewalrus/samples.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 1542332...6c4c3ed. Read the comment docs.