(n, K)
return seq[n]
Low-level implementation of Hermite polynomials.
Low-level implementation of Hermite polynomials.
Low - level implementation of Hermite polynomials .
def dup_hermite(n, K):
    """Low-level implementation of Hermite polynomials. """
    seq = [[K.one], [K(2), K.zero]]

    for i in xrange(2, n + 1):
        a = dup_lshift(seq[-1], 1, K)
        b = dup_mul_ground(seq[-2], K(i - 1), K)

        c = dup_mul_ground(dup_sub(a, b, K), K(2), K)

        seq.append(c)

    return seq[n]
def dup_hermite ( n , K ) : seq = [ [ K . one ] , [ K ( 2 ) , K . zero ] ] for i in xrange ( 2 , n + 1 ) : a = dup_lshift ( seq [ - 1 ] , 1 , K ) b = dup_mul_ground ( seq [ - 2 ] , K ( i - 1 ) , K ) c = dup_mul_ground ( dup_sub ( a , b , K ) , K ( 2 ) , K ) seq . append ( c ) return seq [ n ]