Closed BusyBeaver-42 closed 8 months ago
This problem stems from the fact that the list of possible values has to be generated before the polynomial is evaluated, to ensure that the input values actually belong to the polynomial's definition domain.
From version 1.3.0 onwards (the first PR of which is #37), polynomials will no longer have a default definition domain (the domain will only need to be specified when casting the polynomial in an Ising model or when converting SB-optimized spins back to the origin domain). As a result, there will be no need to check the values when evaluating the polynomial, which solves this problem.
Description
Creating an instance of
IntegerPolynomial
over integers with a large number of bits raises aMemoryError
.The
IntegerPolynomial.__init__
creates a list of all accepted values which has size2**number_of_bits
.Code example
Traceback