# Ln(detA)=Tr(lnJ) identity?

Hi,

I've come accross the identity det(expA)=exp(Tr(A)) many times now, but recently came across log(detA)=Tr(log(A)), can anyone explain to me why this is true? or if it can be derived from the more familiar first identity?

I'm not sure if there are any particular constraints the matrix must satisfy for the identity, it was a field theory book in which I saw it, so I guess the author could be assuming a couple of things about the matrices (maybe unitary for example)

cheers

Hi,

I've come accross the identity det(expA)=exp(Tr(A)) many times now, but recently came across log(detA)=Tr(log(A)), can anyone explain to me why this is true? or if it can be derived from the more familiar first identity?
I know very little about matrix exponentials, but if you make the substitution A = log(B), and substitute into your identity and take the log of both sides, you get the result you desire:
$$\det B = \det(\exp(\log(B))) = \det(\exp(A)) =\exp(\text{Tr}(A)) = \exp(\text{Tr}(\log(B)))$$
$$\log(\det B) = \log(\exp(\text{Tr}(\log B))) = \text{Tr}(\log B)$$

I don't know under what conditions these manipulations are justified, though...

Last edited:
I like Serena
Homework Helper
Hi LAHLH!

It so happens that all steps of spamiam are justified in this case.
This can be verified by checking the steps with the definitions of the http://en.wikipedia.org/wiki/Matrix_exponential" [Broken].

Note that the key concept to the regular proof is the observation that if λ is an eigenvalue of A, that eλ is an eigenvalue of eA, and that log(λ) is an eigenvalue of log(A).

Furthermore det(A) is the product of eigenvalues, and Tr(A) is the sum of eigenvalues.
Since log and exp convert sums and products into each other, the respective formulas follow.

Last edited by a moderator:
If A is a square matrix, then we can diagonalize it:
$$\mathbf{A} \cdot \mathbf{U} = \mathbf{U} \cdot \mathbf{\Lambda}$$
where $\mathbf{\Lambda}$ is a diagonal matrix with the eigenvalues of [itex[\mathbf{A}[/itex] along its diagonal and the columns of the matrix $\mathbf{U}$ are the corresponding eigenvectors.

Then, we can wrie:
$$\mathbf{A} = \mathbf{U} \cdot \mathbf{\Lambda} \cdot \mathbf{U}^{-1}$$
provided that $\mathbf{U}^{-1}$ exists (which means that the eigenvectors of A form a complete basis). Let us assume this to be the case.

Then, any function of the matrix A, $f(\mathbf{A})$, is defined as:
$$f(\mathbf{A}) = \mathbf{U} \cdot f(\mathbf{\Lambda}) \cdot \mathbf{U}^{-1}$$
where $f(\mathbf{\Lambda})$ is the diagonal matrix $f( \mathbf{\Lambda}) = \mathrm{diag} \left( \lbrace f(\lambda_{\alpha}) \rbrace \right)$.

If you find the determinant:
$$\det{ \left[ f(\mathbf{A}) \right]} = \det{ \left[ \mathbf{U} \cdot f( \mathbf{\Lambda} ) \cdot \mathbf{U}^{-1} \right] } = \det{\left[ \mathbf{U} \right]} \, \det{\left[ f(\mathbf{\Lambda}) \right]} \, \frac{1}{\det{\left[ \mathbf{U} \right]}}$$
$$\det{ \left[ f(\mathbf{A} ) \right] } = \det{ \left[ f( \mathbf{\Lambda} ) \right] } = \prod_{\alpha}{f(\lambda_{\alpha})}$$
The last step follows from the fact that the determinant of a diagonal matrix is the product of the diagonal elements.

A similar rule holds for the trace:
$$\mathrm{Tr} \left[ f(\mathbf{A}) \right] = \mathrm{Tr} \left[ \mathbf{U} \cdot f(\mathbf{\Lambda}) \cdot \mathbf{U}^{-1} \right] = \mathrm{Tr} \left[ \mathbf{U}^{-1} \cdot \mathbf{U} \cdot f(\mathbf{\Lambda}) \right] = \mathrm{Tr} \left[ f(\mathbf{\Lambda}) \right] = \sum_{\alpha}{f(\lambda_{\alpha})}$$
where we used the "cyclic property of the trace" and its definition as a sum of the diagonal elements in the last step.

Now, if you use some properties of the exponential function, it is not hard to prove:
$$\det{ \left[ \exp{ \left( \mathbf{A} \right) } \right] } = \exp{ \left( \mathrm{Tr} \left[ \mathbf{A} \right] \right)}$$

Now, assuming $\mathbf{A}$ has only positive eigenvalues, you can define $\ln{\mathbf{A}}$. If you write down the above identity for that matrix and take the logarithm of both sides, you will get your required identity.

Last edited:
I like Serena
Homework Helper
If A is a square matrix, then we can diagonalize it:
$$\mathbf{A} \cdot \mathbf{U} = \mathbf{U} \cdot \mathbf{\Lambda}$$
where $\mathbf{\Lambda}$ is a diagonal matrix with the eigenvalues of [itex[\mathbf{A}[/itex] along its diagonal and the columns of the matrix $\mathbf{U}$ are the corresponding eigenvectors.

Then, we can wrie:
$$\mathbf{A} = \mathbf{U} \cdot \mathbf{\Lambda} \cdot \mathbf{U}^{-1}$$
provided that $\mathbf{U}^{-1}$ exists (which means that the eigenvectors of A form a complete basis). Let us assume this to be the case.
Uhh :uhh: that is quite an assumption.

Then, any function of the matrix A, $f(\mathbf{A})$, is defined as:
$$f(\mathbf{A}) = \mathbf{U} \cdot f(\mathbf{\Lambda}) \cdot \mathbf{U}^{-1}$$
where $f(\mathbf{\Lambda})$ is the diagonal matrix $f( \mathbf{\Lambda}) = \mathrm{diag} \left( \lbrace f(\lambda_{\alpha}) \rbrace \right)$.

If you find the determinant:
$$\det{ \left[ f(\mathbf{A}) \right]} = \det{ \left[ \mathbf{U} \cdot f( \mathbf{\Lambda} ) \cdot \mathbf{U}^{-1} \right] } = \det{\left[ \mathbf{U} \right]} \, \det{\left[ f(\mathbf{\Lambda}) \right]} \, \frac{1}{\det{\left[ \mathbf{U} \right]}}$$
$$\det{ \left[ f(\mathbf{A} ) \right] } = \det{ \left[ f( \mathbf{\Lambda} ) \right] } = \prod_{\alpha}{f(\lambda_{\alpha})}$$
The last step follows from the fact that the determinant of a diagonal matrix is the product of the diagonal elements.

A similar rule holds for the trace:
$$\mathrm{Tr} \left[ f(\mathbf{A}) \right] = \mathrm{Tr} \left[ \mathbf{U} \cdot f(\mathbf{\Lambda}) \cdot \mathbf{U}^{-1} \right] = \mathrm{Tr} \left[ \mathbf{U}^{-1} \cdot \mathbf{U} \cdot f(\mathbf{\Lambda}) \right] = \mathrm{Tr} \left[ f(\mathbf{\Lambda}) \right] = \sum_{\alpha}{f(\lambda_{\alpha})}$$
where we used the "cyclic property of the trace" and its definition as a sum of the diagonal elements in the last step.
How did you get $\mathrm{Tr} \left[ \mathbf{U} \cdot f(\mathbf{\Lambda}) \cdot \mathbf{U}^{-1} \right] = \mathrm{Tr} \left[ \mathbf{U}^{-1} \cdot \mathbf{U} \cdot f(\mathbf{\Lambda}) \right]$?

Now, if you use some properties of the exponential function, it is not hard to prove:
$$\det{ \left[ \exp{ \left( \mathbf{A} \right) } \right] } = \exp{ \left( \mathrm{Tr} \left[ \mathbf{A} \right] \right)}$$

Now, assuming $\mathbf{A}$ has only positive eigenvalues, you can define $\ln{\mathbf{A}}$. If you write down the above identity for that matrix and take the logarithm of both sides, you will get your required identity.
Shouldn't negative eigenvalues also work in combination with the complex logarithm?

Uhh :uhh: that is quite an assumption.
Yes, and I stated when this is the case.

How did you get $\mathrm{Tr} \left[ \mathbf{U} \cdot f(\mathbf{\Lambda}) \cdot \mathbf{U}^{-1} \right] = \mathrm{Tr} \left[ \mathbf{U}^{-1} \cdot \mathbf{U} \cdot f(\mathbf{\Lambda}) \right]$?
By the "cyclic property of the trace":
$$\mathrm{Tr} \left[ \mathbf{A} \cdot \mathbf{B} \cdot \mathbf{C} \right] = \mathrm{Tr} \left[ \mathbf{B} \cdot \mathbf{C} \cdot \mathbf{A} \right] = \mathrm{Tr} \left[ \mathbf{C} \cdot \mathbf{A} \cdot \mathbf{B} \right]$$

Shouldn't negative eigenvalues also work in combination with the complex logarithm?
Actually, if we perform the analytic continuation for the logarithm, it can hold for any complex eigenvalues. However, for the principal branch of the logarithm:
$$\mathrm{Log}{(z_1 z_2)} \neq \mathrm{Log}{(z_1)} + \mathrm{Log}{(z_2)}$$
For example:
$$z_1 = \frac{-1 + i \sqrt{3}}{2} = e^{i \frac{2 \pi}{3}} \Rightarrow \mathrm{Log}{(z_1)} = i \frac{2 \pi}{3}$$
and
$$z_2 = i = e^{i \frac{\pi}{2}} \Rightarrow \mathrm{Log}{(z_2)} = i \frac{\pi}{2}$$
$$z_1 z_2 = \frac{-\sqrt{3} - i}{2} = e^{i \frac{7 \pi}{6}} \Rightarrow \mathrm{Log}{(z_1 z_2)} = -i \frac{5 \pi}{6}$$
This is not equal to:
$$\mathrm{Log}{(z_1)} + \mathrm{Log}{(z_2)} = i \frac{7 \pi}{6}$$

So, in general, one cannot use:
$$\mathrm{Log}{\left( \prod_{\alpha}{\lambda_\alpha} \right)} \neq \sum_{\alpha}{\mathrm{Log}{( \lambda _\alpha )}}$$

I like Serena
Homework Helper
Yes, and I stated when this is the case.
Couldn't it be generalized by specifying that $\mathbf \Lambda$ is a Jordan normal form?
Then $\mathbf U$ would hold the generalized eigenvectors.

By the "cyclic property of the trace":
$$\mathrm{Tr} \left[ \mathbf{A} \cdot \mathbf{B} \cdot \mathbf{C} \right] = \mathrm{Tr} \left[ \mathbf{B} \cdot \mathbf{C} \cdot \mathbf{A} \right] = \mathrm{Tr} \left[ \mathbf{C} \cdot \mathbf{A} \cdot \mathbf{B} \right]$$
Ah, okay! :)

Actually, if we perform the analytic continuation for the logarithm, it can hold for any complex eigenvalues. However, for the principal branch of the logarithm:
$$\mathrm{Log}{(z_1 z_2)} \neq \mathrm{Log}{(z_1)} + \mathrm{Log}{(z_2)}$$
Yes, but don't the steps in the proof hold if we calculate with all branches?

So
$$\mathrm{Log}(e^{i \frac \pi 3})=\{i(\frac \pi 3 + 2k\pi) : k \in \mathbb Z\}$$

Couldn't it be generalized by specifying that $\mathbf \Lambda$ is a Jordan normal form?
Then $\mathbf U$ would hold the generalized eigenvectors.
Maybe, I am not that familiar with Jordan normal forms. The procedure depends sensitively on the existence of $\mathbf{U}^{-1}$. If you notice the above proof of the equality $\det{\left[ \exp{\left( \mathbf{A} \right)} \right]} = \exp{\left( \mathrm{Tr}\left[ \mathbf{A} \right]\right)}$ depended twice on the existince of the inverse matrix of eigenvector columns.
Yes, but don't the steps in the proof hold if we calculate with all branches?

So
$$\mathrm{Log}(e^{i \frac \pi 3})=\{i(\frac \pi 3 + 2k\pi) : k \in \mathbb Z\}$$
If you use the multiple valued function $\log$, then:
$$\exp{\left( \log{(z)} \right)} = z$$
BUT
$$\log{\left( \exp{(z)} \right)} = z + 2 k \pi i \neq z$$

If you start from the identity $\det{\left[ \exp{\left( \mathbf{A} \right)} \right]} = \exp{\left( \mathrm{Tr}\left[ \mathbf{A} \right]\right)}$ in order to prove $\log{ \left( \det{\left[ \mathbf{A} \right]} \right)} = \mathrm{Tr} \left[ \log{(\mathbf{A})} \right]$ in the last step you do take the logarithm on both sides. So, you must be careful to show that this equality holds as a set equality. In either case, $\det{\left[\mathbf{A}\right]} \neq 0$ must hold, that is 0 must not be an eigenvalue of the matrix $\mathbf{A}$.

I like Serena
Homework Helper
If you use the multiple valued function $\log$, then:
$$\exp{\left( \log{(z)} \right)} = z$$
BUT
$$\log{\left( \exp{(z)} \right)} = z + 2 k \pi i \neq z$$

If you start from the identity $\det{\left[ \exp{\left( \mathbf{A} \right)} \right]} = \exp{\left( \mathrm{Tr}\left[ \mathbf{A} \right]\right)}$ in order to prove $\log{ \left( \det{\left[ \mathbf{A} \right]} \right)} = \mathrm{Tr} \left[ \log{(\mathbf{A})} \right]$ in the last step you do take the logarithm on both sides. So, you must be careful to show that this equality holds as a set equality. In either case, $\det{\left[\mathbf{A}\right]} \neq 0$ must hold, that is 0 must not be an eigenvalue of the matrix $\mathbf{A}$.
Ah, I see.
I guess the complex logarithm is a bit more troublesome than I thought!

But then I think the equation log(det A)=Tr(log A) is not quite proper.
Shouldn't it be: log(det A)=Tr(log A) mod i2pi?
The reference to log(det A) implies that all eigenvalues must be ≠ 0.

But then I think the equation log(det A)=Tr(log A) is not quite proper.
Shouldn't it be: log(det A)=Tr(log A) mod i2pi?
The reference to log(det A) implies that all eigenvalues must be ≠ 0.
Yes, and this is what I call a "set equality". Both sides of that equation contain an infinite set of values. You need to show that those sets are equal.

You are right about the determinant not being equal to zero should be implied. I just made a remark in the end of my previous post.