biosspheres.laplace.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[, ...])

a_0j_linear_operator(big_l, r[, azimuthal])

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

a_0j_matrix(big_l, r[, 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 Laplace 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[, azimuthal])

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

a_j_matrix(big_l, r[, azimuthal])

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

bio_jj(big_l, r, bio_azimuthal)

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

k_0_jj_azimuthal_symmetry(big_l, r)

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

k_1_jj_azimuthal_symmetry(big_l, r)

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

reduced_a_sparse_matrix(n, big_l, radii, pii)

v_jj_azimuthal_symmetry(big_l, r)

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

w_jj_azimuthal_symmetry(big_l, r)

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

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

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

Parameters:
  • azimuthal (bool)

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

  • r (float) – > 0, radius.

  • azimuthal – Default True.

Returns:

linear_operator – a scipy linear operator.

Return type:

sparse.linalg.LinearOperator

See also

a_0j_matrix

biosspheres.laplace.selfinteractions.a_0j_matrix(big_l: int, r: 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 Laplace 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.

  • azimuthal (bool) – Default True.

Returns:

matrix_0j – of floats. 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.laplace.selfinteractions.a_j_linear_operator(big_l: int, r: float, azimuthal: bool = True) → LinearOperator[source]#

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

Parameters:
  • azimuthal (bool)

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

  • r (float) – > 0, radius.

  • azimuthal – Default True.

Returns:

linear_operator – a scipy linear operator.

Return type:

sparse.linalg.LinearOperator

See also

a_j_matrix

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

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

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

with Laplace 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.

  • azimuthal (bool) – Default True.

Returns:

matrix_j – of floats. 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.laplace.selfinteractions.bio_jj(big_l: int, r: float, bio_azimuthal: Callable[[int, float], ndarray]) → ndarray[source]#

Returns a numpy array with the corresponding boundary integral operator from the function bio_azimuthal with Laplace 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.

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

Returns:

op – of floats, length (big_l+1)**2. See the section notes for the ordering of the array.

Return type:

np.ndarray

biosspheres.laplace.selfinteractions.k_0_jj_azimuthal_symmetry(big_l: int, r: 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 Laplace 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). = r**2 / (2*(2l + 1))

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.

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 Laplace kernel.

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

  • r (float) – > 0, radius.

Returns:

k_0_jj – of floats, length (big_l+1). See the section notes for the ordering of the array.

Return type:

np.ndarray

biosspheres.laplace.selfinteractions.k_1_jj_azimuthal_symmetry(big_l: int, r: 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 Laplace 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). = -r**2 / (2*(2l + 1)) 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.

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 Laplace kernel.

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

  • r (float) – > 0, radius.

Returns:

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

Return type:

np.ndarray

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

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

Notes

v[l] = ( V_{j,j} Y_l,0 ; Y_l,0 )_L^2(surface sphere radius r). = r**3 / (2 l + 1) 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.

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

  • r (float) – > 0, radius.

Returns:

v – of floats, Length (big_l+1). See the section notes for the ordering of the array.

Return type:

np.ndarray

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

Returns a numpy array with the boundary integral operator W_{j,j} with Laplace 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). = r * l(l+1) / (2l + 1) 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.

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

  • r (float) – > 0, radius.

Returns:

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

Return type:

np.ndarray