Hi all,

I recently had a need for Jacobi polynomials with the property that

  int(P(i, a, b, x)*P(j, a, b, x)*(1-x)^a*(1+b)^b, (x, -1, 1) = delta_ij

as I could not find these in SymPy I've come up with the following:

def norm_jacobi(n, a, b, x):
    G, F = sy.gamma, sy.factorial

    N2 = sy.S(2)**(a + b + 1)/(2*n + a + b + 1)\
       * (G(n + a + 1)*G(n + b + 1))/(F(n)*G(n + a + b + 1))

    return sy.jacobi(n, a, b, x) / sy.sqrt(N2)

with the key element being the normalization factor.  Would it be
possible to get this upstream (it is a pain to code up!), for example as
a norm=True kwarg?

Regards, Freddie.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to