XanaduAI / strawberryfields

Strawberry Fields is a full-stack Python library for designing, simulating, and optimizing continuous variable (CV) quantum optical circuits.
https://strawberryfields.ai
Apache License 2.0
745 stars 187 forks source link

factorial for large numbers #628

Closed sduquemesa closed 2 years ago

sduquemesa commented 2 years ago

Context: Factorials of numbers larger than 170 do not fit into an int, hence return float when needed

Description of the Change: use the qarg exact=True/False on scipy.special.factorial when the result cannot be fitted inside an int

Benefits: Error won't be raised when factorial is called with a large number

Possible Drawbacks: None

Related GitHub Issues: #284

codecov[bot] commented 2 years ago

Codecov Report

Merging #628 (9ff4d38) into master (f7b9e70) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #628   +/-   ##
=======================================
  Coverage   98.55%   98.55%           
=======================================
  Files          77       77           
  Lines        8987     8989    +2     
=======================================
+ Hits         8857     8859    +2     
  Misses        130      130           
Impacted Files Coverage Δ
strawberryfields/apps/similarity.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 f7b9e70...9ff4d38. Read the comment docs.