So I have this line of code that involves a matrix inversion
X = A @ B @ np.linalg.pinv(S)
$A$ is an $n$ by $n$ matrix, $B$ is an $n$ by $m$ matrix and $S$ is an $m$ by $m$ matrix. $m$ is smaller than $n$ but usually not orders of magnitude smaller. Usually $m \sim \frac{1}{2} n$. $S$ is a symmetrical positive definite matrix. How do I make this line of code run faster in python?
I realize I can do X = np.linalg.solve(S.T, (A@B).T).T
but is there more I can do given $S$ is a symmetrical positive definite matrix?