nano_exit

基礎的なことこそ、簡単な例が必要だと思うのです。

X線吸収の多重散乱理論でよく使いそうな関数 (python)

ほぼ自分用のメモ

from scipy.special import spherical_jn, spherical_yn, sph_harm
from sympy import *
from sympy.physics.wigner import clebsch_gordan, gaunt

# spherical Bessel function
def jl( l, rho ):
    return spherical_jn( l, rho )

# spherical Neumann function
def nl( l, rho ):
    return spherical_yn( l, rho )

# 1st kind of spherical Hankel function
def h1l( l, rho ):
    return spherical_jn( l, rho ) + 1j * spherical_yn( l, rho )

# 1st derivative of spherical Bessel function
def jlp( l, rho ):
    return spherical_jn( l, rho, True )

# 1st derivative of spherical Neumann function
def nlp( l, rho ):
    return spherical_yn( l, rho, True )

# spherical harmonics
def Ylm( l, m, theta, phi ):
    return sph_harm( m, l, phi, theta )

# Clebsh-Gordan coefficient
def cg( j1, m1, j2, m2, j3, m3 ):
    return float( clebsch_gordan( j1, j2, j3, m1, m2, m3 ) )

# Gaunt integral
def GLLL( l1, m1, l2, m2, l3, m3 ):
    temp = complex( gaunt( l1, l2, l3, m1, m2, -m3 ) )
    return (-1)**m3 * temp