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

fock.basis_size gives overflow error #1

Open
rdprins opened this issue Mar 8, 2021 · 0 comments
Open

fock.basis_size gives overflow error #1

rdprins opened this issue Mar 8, 2021 · 0 comments

Comments

@rdprins
Copy link

rdprins commented Mar 8, 2021

Example:
print(len(bosonic.fock.basis(11,4))) gives correct result
print(bosonic.fock.basis_size(11,4)) gives the following error:

File "bosonic\fock.pyx", line 109, in bosonic.fock.basis_size
OverflowError: Python int too large to convert to C long

Possible solution:
I forked the code, (converted to python 3) and changed bosonic.fock.basis_size to:

def basis_size(int n, int m):
    cdef int res = scipy.special.binom(n+m-1,n)
    return res

A more efficient solution should be possible.

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

No branches or pull requests

1 participant