cholesky#
- class saiunit.lax.cholesky(x, symmetrize_input=True)#
Cholesky decomposition.
Compute the Cholesky decomposition \(A = L \cdot L^H\) of square positive-definite matrices such that \(L\) is lower triangular. The matrices must be Hermitian (if complex) or symmetric (if real).
- Parameters:
x (saiunit.Quantity |
Array|ndarray|bool|number|bool|int|float|complex) – A batch of square positive-definite matrices with shape[..., n, n].symmetrize_input (
bool) – IfTrue, the matrix is symmetrized before decomposition by computing \(\frac{1}{2}(x + x^H)\). IfFalse, only the lower triangle ofxis used. Default isTrue.
- Returns:
L – The lower-triangular Cholesky factor with shape
[..., n, n]. Ifxcarries a unitu, the result has unitu ** 0.5. If decomposition fails, the result is filled with NaNs.- Return type:
saiunit.Quantity |
Array|ndarray|bool|number|bool|int|float|complex
See also
saiunit.linalg.choleskyHigher-level Cholesky wrapper.
Examples
>>> import jax.numpy as jnp >>> import saiunit as u >>> import saiunit.lax as sulax >>> A = jnp.array([[4.0, 2.0], [2.0, 3.0]]) * (u.meter ** 2) >>> L = sulax.cholesky(A) >>> u.get_unit(L) == u.meter True