Skip to content

geope.jax.logm¤

geope.jax.logm.roots_legendre(n, max_n=10) ¤

Compute roots and weights for Gauss-Legendre quadrature.

JAX implementation compatible with JIT compilation.

Parameters:

Name Type Description Default
n int

Quadrature order.

required
max_n int

Maximum number of roots to compute. Output arrays will have this size; entries beyond n are zero.

10

Returns:

Type Description
tuple[Array, Array]

A tuple (nodes, weights) of arrays of length max_n.

Note

For inputs of 10000 and more, results may include NaNs due to precision errors.

References

W. H. Press et al., Numerical Recipes in FORTRAN (1992), section 4.5, page 152.

geope.jax.logm.sqrtm(A, blocksize=1) ¤

Compute the matrix square root.

JAX implementation of scipy.linalg.sqrtm.

Parameters:

Name Type Description Default
A Union

Array of shape (N, N).

required
blocksize int

Not supported in JAX; always uses blocksize=1.

1

Returns:

Type Description
Array

An array of shape (N, N) containing the matrix square root.

Raises:

Type Description
NotImplementedError

If blocksize > 1.

References

Björck, Å., & Hammarling, S. (1983). "A Schur method for the square root of a matrix". Linear Algebra and its Applications, 52, 127–140.

geope.jax.logm.logm(A, key) ¤

Compute the matrix logarithm.

JAX implementation of scipy.linalg.logm using the improved inverse scaling-and-squaring method.

Parameters:

Name Type Description Default
A Union

Array of shape (N, N).

required
key Union

JAX PRNG key for internal norm estimation.

required

Returns:

Type Description
Array

An array of shape (N, N) containing the matrix logarithm.

References

Al-Mohy, A. H., & Higham, N. J. (2012). "Improved Inverse Scaling and Squaring Algorithms for the Matrix Logarithm". SIAM J. Sci. Comput., 34(4), C152–C169.

geope.jax.logm.rsf2csf(T, Z, check_finite=True) ¤

Convert real Schur form to complex Schur form.

JAX implementation of scipy.linalg.rsf2csf.

Parameters:

Name Type Description Default
T Union

Array of shape (N, N) containing the real Schur form.

required
Z Union

Array of shape (N, N) containing the corresponding Schur transformation matrix.

required
check_finite bool

Unused by JAX (present for API compatibility).

True

Returns:

Type Description
Array

A tuple (T, Z) of the same shape, containing the complex

Array

Schur form and its transformation matrix.

Raises:

Type Description
ValueError

If T or Z is not square, or if their sizes do not match.