tsadar.core.physics.ratintn#

Functions

ratcen(f, g)

Return "rationally centered" f / g such that int_s(1) ^ s(0) ds f(s) / g(s) = sum(ratcen(f, g) * s(dif)) when f and g are linear functions of s.

ratintn(f, g, z)

Integrate f / g dz taking each to be piecwise linear.This is more accurate when f / g has a near - pole in an interval f, g and z are 1D complex arrays.

tsadar.core.physics.ratintn.ratintn(f: Array, g: Array, z: Array) ArraySource#

Integrate f / g dz taking each to be piecwise linear.This is more accurate when f / g has a near - pole in an interval f, g and z are 1D complex arrays.

Based on newlip routine by Ed Williams. :param f: 1D complex array representing the numerator of the rational function to be integrated. :type f: jnp.ndarray :param g: 1D complex array representing the denominator of the rational function. :type g: jnp.ndarray :param z: 1D complex array representing the variable of integration. :type z: jnp.ndarray

Returns:

jnp.ndarray – The integrated values of f / g over z.

tsadar.core.physics.ratintn.ratcen(f: Array, g: Array) ArraySource#

Return “rationally centered” f / g such that int_s(1) ^ s(0) ds f(s) / g(s) = sum(ratcen(f, g) * s(dif)) when f and g are linear functions of s. This allows accurate integration through near poles of f / g

Based on newlip routine by Ed Williams. :param f: 2D complex array (shape: [batch, N]) representing the numerator values of the rational function. :type f: jnp.ndarray :param g: 1D complex array (shape: [N]) representing the denominator values of the rational function. :type g: jnp.ndarray

Returns:

jnp.ndarray – 2D real array (shape: [batch, N-2]) containing the rationally centered values for integration.