Hello all,


Assume NxN matrix A of complex values. I want to calculate the sum of all elements of its inverse.


The problem is that calculating the inverse is computationally expensive and since I am looking only for the sum of its elements, I thought there might be something smarter to do.


Note: the real part of A is a diagonal matrix while the imaginary is a 2x2 block matrix of symmetric submatrices.


Thank you



Sum of elements of inverse matrix
The sum of the elements of a matrix $M$ is $e^T M e$, where $e$ is the vector of all ones.


So, instead of computing the inverse, you should solve the system $Ax=e$ and then compute $e^Tx$. This might look like a simple trick, but solving linear systems is faster than computing inverses in basically all settings.


Of course you should then use a method to solve this linear system which is appropriate to the matrix that you are dealing with (but there is a large amount of literature on that).


I don't think that you can get the quantity you want any faster than this, unless your matrix has very special properties.


