biosspheres.helmholtz.selfinteractions#

Routine listings#

v_jj_azimuthal_symmetry k_0_jj_azimuthal_symmetry k_1_jj_azimuthal_symmetry w_jj_azimuthal_symmetry bio_jj a_0j_matrix a_j_matrix a_0j_linear_operator a_j_linear_operator a_0_a_n_sparse_matrices reduced_a_sparse_matrix

Functions

a_0_a_n_sparse_matrices(n, big_l, radii, kii)

a_0j_linear_operator(big_l, r, k[, azimuthal])

Returns a scipy linear operator equivalent to the given by a_0j_matrix.

a_0j_matrix(big_l, r, k[, azimuthal])

Returns a numpy array that represents the following matrix boundary integral operator A_{j,j}^0 = [ -K_{j,j}^0 , V_{j,j}^0 ] [ W_{j,j}^0 , K*_{j,j}^0 ] with Helmholtz kernel evaluated and tested with spherical harmonics of order 0 if azimuthal = True, or all orders if azimuthal = False.

a_j_linear_operator(big_l, r, k[, azimuthal])

Returns a scipy linear operator equivalent to the given by a_j_matrix.

a_j_matrix(big_l, r, k[, azimuthal])

Returns a numpy array that represents the following matrix boundary integral operator A_{j,j}^0 = [ -K_{j,j} , V_{j,j} ] [ W_{j,j} , K*_{j,j} ] with Helmholtz kernel evaluated and tested with spherical harmonics of order 0 if azimuthal = True, or all orders if azimuthal = False.

bio_jj(big_l, r, k, bio_azimuthal)

Returns a numpy array with the corresponding boundary integral operator from the function bio_azimuthal with Helmholtz kernel evaluated and tested with spherical harmonics of all orders.

k_0_jj_azimuthal_symmetry(big_l, r, k)

Returns a numpy array with the boundary integral operator K_{j,j}^0, with normals from out to in of the sphere, with Helmholtz kernel evaluated and tested with spherical harmonics of order 0.

k_1_jj_azimuthal_symmetry(big_l, r, k)

Returns a numpy array with the boundary integral operator K_{j,j}, with normals from in to out of the sphere, with Helmholtz kernel evaluated and tested with spherical harmonics of order 0.

reduced_a_sparse_matrix(n, big_l, radii, ...)

v_jj_azimuthal_symmetry(big_l, r, k)

Returns a numpy array with the boundary integral operator V_{j,j} with Helmholtz kernel evaluated and tested with spherical harmonics of order 0 in a sphere of radius r.

w_jj_azimuthal_symmetry(big_l, r, k)

Returns a numpy array with the boundary integral operator W_{j,j} with Helmholtz kernel evaluated and tested with spherical harmonics of order 0.

biosspheres.helmholtz.selfinteractions.a_0j_linear_operator(big_l: int, r: float, k: float, azimuthal: bool = True) → LinearOperator[source]#

Returns a scipy linear operator equivalent to the given by a_0j_matrix.

Parameters:
  • big_l (int) – >= 0, max degree.

  • r (float) – > 0, radius.

  • k (float) – wave number.

  • azimuthal (bool) – Default True

Returns:

linear_operator – a scipy linear operator.

Return type:

sparse.linalg.LinearOperator

See also

a_0j_matrix

biosspheres.helmholtz.selfinteractions.a_0j_matrix(big_l: int, r: float, k: float, azimuthal: bool = True) → ndarray[source]#

Returns a numpy array that represents the following matrix boundary integral operator A_{j,j}^0 = [ -K_{j,j}^0 , V_{j,j}^0 ]

[ W_{j,j}^0 , K*_{j,j}^0 ]

with Helmholtz kernel evaluated and tested with spherical harmonics of order 0 if azimuthal = True, or all orders if azimuthal = False.

Each block is a diagonal matrix.

Parameters:
  • big_l (int) – >= 0, max degree.

  • r (float) – > 0, radius.

  • k (float) – wave number.

  • azimuthal (bool) – Default True.

Returns:

matrix_0j – with complex values. If azimuthal = True

Shape (2*(big_l+1), 2*(big_l+1))

Else

Shape (2*(big_l+1)**2, 2*(big_l+1)**2)

Return type:

np.ndarray

biosspheres.helmholtz.selfinteractions.a_j_linear_operator(big_l: int, r: float, k: float, azimuthal: bool = True) → LinearOperator[source]#

Returns a scipy linear operator equivalent to the given by a_j_matrix.

Parameters:
  • big_l (int) – >= 0, max degree.

  • r (float) – > 0, radius.

  • k (float) – wave number.

  • azimuthal (bool) – Default True.

Returns:

linear_operator – a scipy linear operator.

Return type:

sparse.linalg.LinearOperator

See also

a_j_matrix

biosspheres.helmholtz.selfinteractions.a_j_matrix(big_l: int, r: float, k: float, azimuthal: bool = True) → ndarray[source]#

Returns a numpy array that represents the following matrix boundary integral operator A_{j,j}^0 = [ -K_{j,j} , V_{j,j} ]

[ W_{j,j} , K*_{j,j} ]

with Helmholtz kernel evaluated and tested with spherical harmonics of order 0 if azimuthal = True, or all orders if azimuthal = False.

Each block is a diagonal matrix.

Parameters:
  • big_l (int) – >= 0, max degree.

  • r (float) – > 0, radius.

  • k (float) – wave number.

  • azimuthal (bool) – Default True.

Returns:

matrix_j – with complex values. If azimuthal = True

Shape (2*(big_l+1), 2*(big_l+1))

Else

Shape (2*(big_l+1)**2, 2*(big_l+1)**2)

Return type:

np.ndarray

biosspheres.helmholtz.selfinteractions.bio_jj(big_l: int, r: float, k: float, bio_azimuthal: Callable[[int, float, float], ndarray]) → ndarray[source]#

Returns a numpy array with the corresponding boundary integral operator from the function bio_azimuthal with Helmholtz kernel evaluated and tested with spherical harmonics of all orders.

Notes

D[l*(2l+1) + m] = (D_{j,j}Y_l,m;Y_l,m)_L^2(surface sphere radius r). which in this case is equal to = D[l*(2l+1)] for each l such that 0 <= l <= big_l, and with ( ., .)_L^2(surface sphere radius r): inner product where indicated. D: boundary integral operator corresponding to the function

bio_azimuthal

Y_l,m: spherical harmonic degree l, order m.

Parameters:
  • big_l (int) – >= 0, max degree.

  • r (float) – > 0, radius.

  • k (float) – wave number.

  • bio_azimuthal (Callable[[int, float, float]) – python function for computing the operator for m = 0. Must be one of the functions written before this one.

Returns:

with complex values, length (big_l+1)**2. See the section notes for the ordering of the array.

Return type:

np.ndarray

biosspheres.helmholtz.selfinteractions.k_0_jj_azimuthal_symmetry(big_l: int, r: float, k: float) → ndarray[source]#

Returns a numpy array with the boundary integral operator K_{j,j}^0, with normals from out to in of the sphere, with Helmholtz kernel evaluated and tested with spherical harmonics of order 0.

Notes

k_0_jj[l] = (K_{j,j}^0 Y_l,0 ; Y_l,0)_L^2(surface sphere radius r). = -1j * k**2 * r**4 * 0.5

  • (j_l(r k) * h_l_d(r k) + j_l_d(r k) * h_l(r k))

for each l such that 0 <= l <= big_l, and with ( ., .)_L^2(surface sphere radius r): inner product where indicated. Y_l,0: spherical harmonic degree l, order 0. j_l: spherical Bessel function, and j_l_d its derivative. h_l: spherical Hanckel function of first kind, and j_l_d its

derivative.

Notice that in this specific case ( K_{j,j}^0 Y_l,0 ; Y_l,0 )_L^2(surface sphere radius r) = ( K_{j,j}^{*0} Y_l,0 ; Y_l,0 )_L^2(surface sphere radius r) where K_{j,j}^{*0} has normals from out to in of the sphere, and with Helmholtz kernel.

Parameters:
  • big_l (int) – >= 0, max degree.

  • r (float) – > 0, radius.

  • k (float) – wave number.

Returns:

k_0 – with complex values. Length (big_l+1). See the section notes for the ordering of the array.

Return type:

np.ndarray

biosspheres.helmholtz.selfinteractions.k_1_jj_azimuthal_symmetry(big_l: int, r: float, k: float) → ndarray[source]#

Returns a numpy array with the boundary integral operator K_{j,j}, with normals from in to out of the sphere, with Helmholtz kernel evaluated and tested with spherical harmonics of order 0.

Notes

k_jj[l] = ( K_{j,j} Y_l,0 ; Y_l,0 )_L^2(surface sphere radius r). = 1j * k**2 * r**4 * 0.5

  • (j_l(r k) * h_l_d(r k) + j_l_d(r k) * h_l(r k))

for each l such that 0 <= l <= big_l, and with ( ., .)_L^2(surface sphere radius r): inner product where indicated. Y_l,0: spherical harmonic degree l, order 0. j_l: spherical Bessel function, and j_l_d its derivative. h_l: spherical Hanckel function of first kind, and j_l_d its

derivative.

Notice that in this specific case ( K_{j,j} Y_l,0 ; Y_l,0 )_L^2(surface sphere radius r) = ( K_{j,j}^{*} Y_l,0 ; Y_l,0 )_L^2(surface sphere radius r) where K_{j,j}^{*} has normals from in to out of the sphere, and with Helmholtz kernel.

Parameters:
  • big_l (int) – >= 0, max degree.

  • r (float) – > 0, radius.

  • k (float) – wave number.

Returns:

k_jj – with complex values, length (big_l+1). See the section notes for the ordering of the array.

Return type:

np.ndarray

biosspheres.helmholtz.selfinteractions.v_jj_azimuthal_symmetry(big_l: int, r: float, k: float) → ndarray[source]#

Returns a numpy array with the boundary integral operator V_{j,j} with Helmholtz kernel evaluated and tested with spherical harmonics of order 0 in a sphere of radius r.

Notes

v[l] = ( V_{j,j} Y_l,0 ; Y_l,0 )_L^2(surface sphere radius r). = i r**4 k j_l(kr) h_l(kr) for each l such that 0 <= l <= big_l, and with ( ., .)_L^2(surface sphere radius r): inner product where indicated. Y_l,0: spherical harmonic degree l, order 0. j_l: spherical Bessel function. h_l: spherical Hanckel function of first kind.

Notice that the expression could also be computed as: 0.5 i r pi J_{l+0.5}(k r) H_{l+0.5}(k r) with J_{nu} the Bessel function and H_{nu} the Hanckel function of first kind.

Parameters:
  • big_l (int) – >= 0, max degree.

  • r (float) – > 0, radius.

  • k (float) – wave number.

Returns:

v – with complex values. Length (big_l+1). See the section notes for the ordering of the array.

Return type:

np.ndarray

biosspheres.helmholtz.selfinteractions.w_jj_azimuthal_symmetry(big_l: int, r: float, k: float) → ndarray[source]#

Returns a numpy array with the boundary integral operator W_{j,j} with Helmholtz kernel evaluated and tested with spherical harmonics of order 0.

Notes

w[l] = ( W_{j,j} Y_l,0 ; Y_l,0 )_L^2(surface sphere radius r). = -1j k**3 * r**4 * j_l_d(k r) h_l_d(k r) for each l such that 0 <= l <= big_l, and with ( ., .)_L^2(surface sphere radius r): inner product where indicated. Y_l,0: spherical harmonic degree l, order 0. j_l_d: derivative of the spherical Bessel function. h_l_d: derivative of the spherical Hanckel function of first kind.

Parameters:
  • big_l (int) – >= 0, max degree.

  • r (float) – > 0, radius.

  • k (float) – wave number.

Returns:

w – with complex values, length (big_l+1). See the section notes for the ordering of the array.

Return type:

np.ndarray