Complex solveยค
We can also solve a system with complex entries. Here we consider the classical case for which the full matrix \(A\) is square, well-posed and materialised in memory.
import jax.numpy as jnp
import jax.random as jr
import lineax as lx
matrix = jr.normal(jr.PRNGKey(0), (3, 3), dtype=jnp.complex64)
vector = jr.normal(jr.PRNGKey(1), (3,), dtype=jnp.complex64)
operator = lx.MatrixLinearOperator(matrix)
solution = lx.linear_solve(operator, vector)
print(f"A=\n{matrix}\nb={vector}\nx={solution.value}")