Skip to content

Classical solveยค

We wish to solve the linear system \(Ax = b\). Here we consider the classical case for which the full matrix \(A\) is square, well-posed and materialised in memory.

import jax.random as jr
import lineax as lx

matrix = jr.normal(jr.PRNGKey(0), (3, 3))
vector = jr.normal(jr.PRNGKey(1), (3,))
operator = lx.MatrixLinearOperator(matrix)
solution = lx.linear_solve(operator, vector)
print("solution:", solution.value)
solution: [-2.7321298 -8.52878   -7.7226872]