0

I am looking to invert a (lower) triangular matrix that comes from the Cholesky decomposition of A, as A = L @ L.T. There are a few potential solutions, including numpy: inverting an upper triangular matrix. Unfortunately, this question is now more than 11 years old so newer solutions might exist now. Is there any method in numpy or scipy or any other relevant package that could be used to compute the inverse of a triangular matrix, upper or lower?

I can obviously code a solution myself (inverse of diagonal terms and ensuring that non-diagonal products are null) but this is error-prone and might not be as stable and tested as more common packages.

1 Answer 1

1

Echoing the previous post, it is often unnecessary to obtain the explicit inverse, and refactoring the code to call a triangular solver routine wherever it is used next is usually preferable. Using a triangular solver with identity as the complementary argument produces the explicit inverse if it is really necessary.

Tensorflow's triangular solver can be much faster than those mentioned in the previous post if used correctly. See:

https://www.tensorflow.org/api_docs/python/tf/linalg/triangular_solve https://www.tensorflow.org/guide/function

Other than that (as someone who does a lot of work with Cholesky decompositions) the answers in the previous post still ring true from my perspective.

Sign up to request clarification or add additional context in comments.

7 Comments

Thank you for the reply, in fact the exact problem I have is here. Basically, I have L a lower triangular matrix and A = L @ X @ L.T is known, can I get back to X somehow?
Oh yeah, I can help with that. Let me put something together and I'll post the relevant info where it is appropriate between here and math.stackexchange
Just to clarify, you only have A, not chol(A), correct? Because if you already have chol(A) there is a very clear path forward
Yes I have only L which comes from another Cholesky decomposition that is not related to A directly.
See math exchange answer and let me know if you need further assistance.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.