Skip to content

Hydrogen module

associated_laguerre_polynomial(x, i, alpha)

Associated Laguerre polynomial constructed by recursion (see https://en.wikipedia.org/wiki/Laguerre_polynomials#Generalized_Laguerre_polynomials)

Source code in braketlab/hydrogen.py
34
35
36
37
38
39
40
41
def associated_laguerre_polynomial(x, i,alpha):
    """
    Associated Laguerre polynomial constructed by recursion
    (see https://en.wikipedia.org/wiki/Laguerre_polynomials#Generalized_Laguerre_polynomials)
    """

    rr = sp.symbols("r_1")
    return sp.exp(x)*x**-alpha/factorial(i)*(sp.diff(sp.exp(-rr)*rr**(i+alpha), rr, i).subs(rr,x))

legendre_polynomial(x, n)

Returns the Legendre polynomial, as

Source code in braketlab/hydrogen.py
 8
 9
10
11
12
def legendre_polynomial(x, n):
    """
    Returns the Legendre polynomial, as 
    """
    return 1.0/(2.0**n*factorial(n))*sp.diff((x**2.0 - 1.0)**n, x, n)