# Formula or estimates for $\frac{\operatorname{Tr}(AB)}{\operatorname{Tr}(A)}$

Given two positive definite matrices $A,B$ with nonnegative entries, I seek convenient ways to analytically compute or estimate $\frac{\operatorname{Tr}(AB)}{\operatorname{Tr}(A)}$, where $\operatorname{Tr}$ denotes the trace.

I know essentially two things (beyond the representation in terms of the entries). First I know trivial bounds: the ratio is between $\lambda_{min}(B)$ and $\lambda_{max}(B)$. Second, I know that these are not at all tight. The following example quickly illustrates the point:

$$A=\begin{bmatrix} \epsilon & 0 \\ 0 & 1 \end{bmatrix} \\ B=\begin{bmatrix} 1 & 0 \\ 0 & \epsilon \end{bmatrix} \\ AB=\begin{bmatrix} \epsilon & 0 \\ 0 & \epsilon \end{bmatrix}$$

Thus $\frac{\operatorname{Tr}(AB)}{\operatorname{Tr}(A)}=\frac{2\epsilon}{1+\epsilon} \to 0$ as $\epsilon \to 0$. Yet $\lambda_{max}(B)=1$ for all $\epsilon$.

What happened in this example always happens if $A,B$ are simultaneously diagonalizable. Namely, if they share eigenvectors $v_1,\dots,v_n$, the corresponding eigenvalues of $A$ are $\lambda_1,\dots,\lambda_n$, and the corresponding eigenvalues of $B$ are $\eta_1,\dots,\eta_n$, then the ratio is $\frac{\sum_{i=1}^n \lambda_i \eta_i}{\sum_{i=1}^n \lambda_i}$. So the ratio in the simultaneously diagonalizable case is an average of the eigenvalues of $B$, but with completely arbitrary weights (determined by the eigenvalues of $A$).

Is there any similar way to think about the case when $A,B$ are not simultaneously diagonalizable? I realize this is underspecified, so let me offer some ideas as to what a good answer might look like:

• Notice that the "trivial bounds" above imply that the ratio is a weighted average of the eigenvalues of $B$. Is there any canonical way to choose such weights (which are of course non-unique), and then a way to estimate them?
• Two diagonalizable matrices are simultaneously diagonalizable if and only if they commute. If the commutator is "small", is it possible to approximate the ratio by replacing $B$ with a matrix that commutes with $A$, applying the formulation above, and then obtaining an error estimate in terms of the size of the commutator? (A quick look at the literature makes it look like this is a "no", but still, this would be a nice way to do it.)

If it helps, you may assume that the Cholesky factorizations $A=C^T C,B=D^T D$ are given.

Some relevant literature: http://ieeexplore.ieee.org/document/1695991/ http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.636.8021&rep=rep1&type=pdf etc.; search "trace of product of symmetric matrices" for more such papers. Some of these papers have relevant results but I have found them difficult to apply in my own context.

• Note that by $\operatorname{tr}(AB) = \operatorname{tr}(AD^TD) = \operatorname{tr}(DAD^T)$ the question is equivalent to the question on the relation between the trace of a matrix and a congruent one - unfortunately I don't know the either to that question either. – Dirk Jan 17 '17 at 14:08
• the trivial computational complexity is $n^2$, is that efficient enough? – Carlo Beenakker Jan 17 '17 at 14:28
• @CarloBeenakker The entrywise formula, i.e. $\frac{\sum_{i=1}^n \sum_{j=1}^n a_{ij} b_{ij}}{\sum_{i=1}^n a_{ii}}$, is not really good enough, because in my context $n$ is going to infinity. So I'm looking for something I can use to estimate this ratio in this situation. – Ian Jan 17 '17 at 14:42
• @NikWeaver That's an interesting way to think about it. (I've also edited in the detail that my matrices have nonnegative real entries.) – Ian Jan 17 '17 at 15:48
• This is the fundamental computational problem of thermal quantum field theory: en.wikipedia.org/wiki/Thermal_quantum_field_theory – Steve Huntsman Jan 18 '17 at 13:22