From 0add6f94283d7318493bb8c2eb969ab562cc475b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Wed, 27 Feb 2019 09:58:58 +0200 Subject: [PATCH] Update zJn to use new scipy functions for further testing. Former-commit-id: 6b301eff9a6cf2f07d265145f54b55c0c74ecbb2 --- qpms/qpms_p.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/qpms/qpms_p.py b/qpms/qpms_p.py index 09e5c08..5eb455e 100644 --- a/qpms/qpms_p.py +++ b/qpms/qpms_p.py @@ -269,27 +269,27 @@ def vswf_yr(pos_sph,lMax,J=1): return (M_y, N_y) #@jit -def _sph_zn_1(n,z): - return spherical_jn(n,z) +def _sph_zn_1(n,z,derivative=False): + return spherical_jn(n,z,derivative) #@jit -def _sph_zn_2(n,z): - return spherical_yn(n,z) +def _sph_zn_2(n,z,derivative=False): + return spherical_yn(n,z,derivative) #@jit -def _sph_zn_3(n,z): - besj=spherical_jn(n,z) - besy=spherical_yn(n,z) - return (besj[0] + 1j*besy[0],besj[1] + 1j*besy[1]) +def _sph_zn_3(n,z,derivative=False): + besj=spherical_jn(n,z,derivative) + besy=spherical_yn(n,z,derivative) + return besj + 1j*besy #@jit -def _sph_zn_4(n,z): - besj=spherical_jn(n,z) - besy=spherical_yn(n,z) - return (besj[0] - 1j*besy[0],besj[1] - 1j*besy[1]) +def _sph_zn_4(n,z,derivative=False): + besj=spherical_jn(n,z,derivative) + besy=spherical_yn(n,z,derivative) + return besj + 1j*besy _sph_zn = [_sph_zn_1,_sph_zn_2,_sph_zn_3,_sph_zn_4] # computes bessel/hankel functions for orders from 0 up to n; #@jit def zJn(n, z, J=1): - return _sph_zn[J-1](n=n,z=z) + return (_sph_zn[J-1](n=n,z=z,derivative=False), _sph_zn[J-1](n=n,z=z,derivative=True))