Skip to content

fock.basis_size gives overflow error #1

@rdprins

Description

@rdprins

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions