functions.py 683 B

123456789101112131415161718192021222324252627282930
  1. import numpy as np
  2. import scipy.special as sps
  3. def sph_bessel_i(n, x, **kwargs):
  4. return sps.spherical_in(n, x, **kwargs)
  5. def sph_bessel_k(n, x, **kwargs):
  6. return 2 / np.pi * sps.spherical_kn(n, x, **kwargs)
  7. def sph_harm(l, m, theta, phi, **kwargs):
  8. return sps.sph_harm(m, l, phi, theta, **kwargs)
  9. def interaction_coef_C(l, p, x):
  10. return np.pi / 2 * x * sps.iv(l + 1 / 2, x) * sps.iv(p + 1 / 2, x)
  11. def coefficient_Cpm(l, x):
  12. return x * sps.kv(l + 1 / 2, x) * sps.iv(l + 1 / 2, x)
  13. def coefficient_Cim(l, x):
  14. return sps.kv(l + 1 / 2, x) / sps.kv(l + 3 / 2, x)
  15. def coef_C_diff(l, x):
  16. return 1 / (x * sps.iv(l + 1 / 2, x) * sps.kv(l + 3 / 2, x))