I knew that there is no builtin sph_hankel1 in scipy then i want to know that how to implement it in the right way?
Additional: Just show me one correct implementation of sph_hankel1 either using of Scipy or Sympy.
Regarding implementing it in SymPy, there is a guide on how to implement special functions here. We would love pull requests for well-known special functions.
For numerical routines, they are implemented in mpmath. It looks like it just uses the definition directly.
Although it would be nice if there were an existing routine for calculating the spherical Hankel functions (like there is for the ordinary Hankel functions), they are just a (complex) linear combination of the spherical Bessel functions of the first and second kind so can be easily calculated from existing routines. Since the Hankel functions are complex and depending on your application of them, it can be advantageous to rewrite your expression in terms of the Bessel functions of the first and second kind, ie entirely real quantities, particularly if your final result is real.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With