<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/probability/blob/v0.25.0/tensorflow_probability/substrates/jax/math/linalg.py) |

Functions for common linear algebra operations.

#### View aliases


**Main aliases**

[`tfp.experimental.fastgp.fast_gp.fast_log_det.preconditioners.tfp_math`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math), [`tfp.experimental.fastgp.fast_gp.preconditioners.tfp_math`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math), [`tfp.experimental.fastgp.fast_log_det.preconditioners.tfp_math`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math), [`tfp.experimental.fastgp.fast_mtgp.fast_gp.fast_log_det.preconditioners.tfp_math`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math), [`tfp.experimental.fastgp.fast_mtgp.fast_gp.preconditioners.tfp_math`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math), [`tfp.experimental.fastgp.fast_mtgp.fast_log_det.preconditioners.tfp_math`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math), [`tfp.experimental.fastgp.fast_mtgp.preconditioners.tfp_math`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math)

<br />

> [!NOTE]
> **Note:** Many of these functions will eventually be migrated to core TensorFlow.

## Functions

[`cholesky_concat(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math/cholesky_concat): Concatenates `chol @ chol.T` with additional rows and columns.

[`cholesky_update(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math/cholesky_update): Returns cholesky of chol @ chol.T + multiplier \* u @ u.T.

[`fill_triangular(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math/fill_triangular): Creates a (batch of) triangular matrix from a vector of inputs.

[`fill_triangular_inverse(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math/fill_triangular_inverse): Creates a vector from a (batch of) triangular matrix.

[`hpsd_logdet(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math/hpsd_logdet): Computes `log|det(matrix)|`, where `matrix` is a HPSD matrix.

[`hpsd_quadratic_form_solve(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math/hpsd_quadratic_form_solve): Computes `rhs^T matrix^-1 rhs`, where `matrix` is HPSD.

[`hpsd_quadratic_form_solvevec(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math/hpsd_quadratic_form_solvevec): Computes `rhs^T matrix^-1 rhs`, where `matrix` is HPSD.

[`hpsd_solve(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math/hpsd_solve): Computes `matrix^-1 rhs`, where `matrix` is HPSD.

[`hpsd_solvevec(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math/hpsd_solvevec): Computes `matrix^-1 rhs`, where `matrix` is HPSD.

[`low_rank_cholesky(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math/low_rank_cholesky): Computes a low-rank approximation to the Cholesky decomposition.

[`lu_matrix_inverse(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math/lu_matrix_inverse): Computes a matrix inverse given the matrix's LU decomposition.

[`lu_reconstruct(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math/lu_reconstruct): The inverse LU decomposition, `X == lu_reconstruct(*tf.linalg.lu(X))`.

[`lu_reconstruct_assertions(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math/lu_reconstruct_assertions): Returns list of assertions related to `lu_reconstruct` assumptions.

[`lu_solve(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math/lu_solve): Solves systems of linear eqns `A X = RHS`, given LU factorizations.

[`pivoted_cholesky(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math/pivoted_cholesky): Computes the (partial) pivoted cholesky decomposition of `matrix`.

[`sparse_or_dense_matmul(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math/sparse_or_dense_matmul): Returns (batched) matmul of a SparseTensor (or Tensor) with a Tensor.

[`sparse_or_dense_matvecmul(...)`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/fastgp/preconditioners/tfp_math/sparse_or_dense_matvecmul): Returns (batched) matmul of a (sparse) matrix with a column vector.