Home > Software engineering >  What is the best approach to compute the trace of a (sparse) matrix product efficiently in python
What is the best approach to compute the trace of a (sparse) matrix product efficiently in python

Time:10-25

I'm trying to take the hilbert schmidt inner product of two matices.

For two matrices A, B this operation requires the matrix product of the Hermitian conjugate of A times B followed by the trace (summing down the diagonal). As you only need the diagonal entries, it is pointless to find the full matrix product, as the off diagonal terms are not needed.

In effect one needs to compute:

  • Related