Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

factorial for large numbers #628

Merged
merged 8 commits into from
Sep 23, 2021
Merged

Conversation

sduquemesa
Copy link
Contributor

@sduquemesa sduquemesa commented Sep 23, 2021

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

factorials of numbers larger than 170 do not fit into a int, hence return float using the qarg `exact=True` when needed
@sduquemesa sduquemesa linked an issue Sep 23, 2021 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Sep 23, 2021

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.

Copy link
Member

@josh146 josh146 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch @sduquemesa! Don't forget to add this to the changelog before merging it in 🙂

@sduquemesa sduquemesa merged commit b15c9ff into master Sep 23, 2021
@sduquemesa sduquemesa deleted the gh284-factorial-large-numbers branch September 23, 2021 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Orbit cardinality for large number of modes
3 participants