Obtaining dense solution for large sparse linear system $AX=b$ in python, where $X$ is expected to be a dense matrix/array?

48 Views Asked by At

I want to solve the linear system of equation in python $AX=b$, where $A$ is big sparse matrix $(768^2 \times 768^2)$, $b$ is a dense matrix $(768^2 \times 1)$ and $X$ is expected to be a dense matrix.

I was trying to solve this system using scipy.sparse.linalg.spsolve but the kernel is dying in the process. In the documentation of spsolve, it is mentioned if $b$ is not a sparse matrix, one should convert $A$ into dense matrix and use linear solvers for dense matrices. However $A$ being so big, I'm unable to store it as a dense matrix. Is there any way I could solve this?