# $\log(\det A) = tr(\log(A))$? [duplicate]

I want to know that if the equation in the title always holds? I have generated a random Hermitian matrix $$A$$, and then compute $$\log(\det A)$$ and $$tr(\log(A))$$ in matlab, it is not equal. So I'm really puzzled.

Can you give me the proof of this equation if it is true. Thanks in advance

I just show an example:

$$A=\begin{bmatrix}30.9186 + 0.0000i & -0.5120 - 0.0197i \\-0.5120 + 0.0197i & 10.3822 + 0.0000i \end{bmatrix}$$

$$K>> log2(det(A))$$

$$ans = 8.3253 + 0.0000i$$

$$K>> trace(log2(A))$$

$$ans =8.3264 + 0.0000i$$

it is essentially different from these problem such as

How to prove $\det(e^A) = e^{\operatorname{tr}(A)}$?

because I think this equation is totally wrong, so I don't know why it can be proved.

• Do you know a formula for the determinant or trace, maybe in terms of eigenvalues? Commented Feb 28, 2019 at 12:13
• yes, but I don't know how to proof this equation Commented Feb 28, 2019 at 12:16
• First you have to ensure that the expression $\log(A)$ makes sense (this is not the case for all hermitian matrices). Commented Feb 28, 2019 at 12:17
• Continuing the @Alpha001 comment: To answer this, you need a definition of $\log(A)$. So begin there. Commented Feb 28, 2019 at 12:25
• I just add an example, do you know what's wrong with it Commented Feb 28, 2019 at 12:25

If $$A$$ is hermitian $$>0$$, then your formula is valid is we choose the principal logarithm $$(\log(re^{i\theta})=\log(r)+i\theta$$ where $$\theta\in (-\pi,\pi)$$).
If $$A$$ is invertible hermitian, your formula is -in general- not valid; example
$$A=-I_2$$. The required equality is (*) $$\log(1)=2\log(-1)$$.
If we choose the following $$\log$$: $$\log(re^{i\theta})=\log(r)+i\theta$$ where $$\theta\in (-\pi+1/10,\pi+1/10)$$, then $$\log(1)=0,\log(-1)=i\pi$$ and (*) is not satisfied.
If $$spectrum(A)=(\lambda_i)$$, then $$spectrum(e^A)=(e^{\lambda_i})$$. Therefore, $$\det(e^A)=\Pi_i e^{\lambda_i}$$ and $$e^{tr(A)}=e^{\Sigma_i \lambda_i}$$. I hope that you are convinced...