(n, k, symbolic)
return frac(2 ** n, prod([kk + 1 for kk in k]))
Returns the integral of the polynomial given by the coefficients k over the
    n-dimensional cube.
Returns the integral of the polynomial given by the coefficients k over the
    n-dimensional cube.
Returns the integral of the polynomial given by the coefficients k over the n - dimensional cube .
def integrator(n, k, symbolic):
    """Returns the integral of the polynomial given by the coefficients k over the
    n-dimensional cube.
    """
    assert len(k) <= n

    if any(kk % 2 == 1 for kk in k):
        return 0

    frac = sympy.Rational if symbolic else lambda a, b: a / b
    return frac(2 ** n, prod([kk + 1 for kk in k]))
def integrator ( n , k , symbolic ) : assert len ( k ) <= n if any ( kk % 2 == 1 for kk in k ) : return 0 frac = sympy . Rational if symbolic else lambda a , b : a / b return frac ( 2 ** n , prod ( [ kk + 1 for kk in k ] ) )