# How to handle bra-ket in logarithm?

$$\newcommand{\ket}{\left| #1 \right>} \newcommand{\bra}{\left< #1 \right|}$$Say the following two equations:

$$S = - k_B \text{Tr} (\rho \ln \rho)$$ $$\rho = \sum _\epsilon \ket{\epsilon} \frac{\chi (\epsilon)}{w(E)} \bra{\epsilon}$$

where $$\chi, w$$ are some functions, and variables $$\epsilon, E$$ are independent. Now my textbook says

$$S = - k_B \text{Tr} \left( \ket{\epsilon} \frac{\chi (\epsilon)}{w(E)} \ln \left( \frac{\chi (\epsilon)}{w(E)} \right) \bra{\epsilon} \right)$$

but I don't understand how to get this equation. Could anyone tell me the process?

My textbook: "Perspectives on Statistical Thermodynamics" (The second and the third equations are written in p.262 though the page can't be previewed on GoogleBooks.)

Hint: Note that your density matrix $$\rho$$ is already diagonalized. So, $$\ln (\rho)$$ is simply taking log of each diagonal element.

• Thank you. Your hint has totally solved my question. However, how can I prove the theorem log(rho) is simply taking log of each diagonal element? This fact is referred to in many websites (e.g. Logarithm of a matrix) but I can't find the proof. – ynn Oct 1 '18 at 6:09
• @ynn I finally succeeded to prove the theorem, using the log(matrix) definition and the fact that $A - E$ is diagonal if $A$ is diagonal. – ynn Oct 1 '18 at 6:27
• @ynn If you have turned this hint into a nontrivial solution to your problem, you might consider writing a more complete answer for the benefit of future readers. – rob Oct 2 '18 at 14:06
• @rob Actually I considered that but didn't carry that out since it seemed troublesome (so I left some more hints for future readers). However, I think your attitude are right. So I've just added the complete answer to my question. Thank you for your advice. – ynn Oct 3 '18 at 3:09

$$\newcommand{\ket}{\left| #1 \right>} \newcommand{\bra}{\left< #1 \right|}$$For the future readers, I would like to prove the theorem

If $$D$$ is a diagonal matrix, $$\ln (D)$$ is simply taking log of each diagonal element $$D_i$$.

At first, logarithm of a matrix is defined as this, where $$E$$ is an identity matrix (which often denoted as $$I$$).

$$\ln (A) \equiv \sum _{k=1} ^{\infty} \frac{1}{k} (-1)^{k-1} (A - E)^k$$

This definition is natural since this form is completely the same as the Taylor expansion of $$\ln (x)$$ around $$x = 1$$.

Now, let $$D$$ be a diagonal matrix. Then we can transcribe $$D$$ as

$$D = \sum _i D_i \ket{i} \bra{i}$$

, where $$\{D_i\}$$ are the diagonal elements and $$\{\ket{i}\}$$ are the base ket vectors of diagonalization. This decomposition is not strange (if you don't understand, say the simplest case where $$\ket{i} = {}^t(1\ \ 0)$$ and you'll understand).

In addition, the next theorem is trivial.

$$D\ \text{is diagonal.}\ \ \Leftrightarrow\ \ D - E\ \text{is diagonal.}$$

Using these formulae, we can prove the theorem as below.

$$\begin{eqnarray} \ln (D) &=& \sum _{k=1} ^{\infty} \frac{1}{k} (-1)^{k-1} (D - E)^k \\ &=& \sum _{k=1} ^{\infty} \frac{1}{k} (-1)^{k-1} \left( \sum _i (D_i - E_i) \ket{i} \bra{i} \right)^k \\ &=& \sum _{k=1} ^{\infty} \frac{1}{k} (-1)^{k-1} \sum _i ((D_i - E_i) \ket{i} \bra{i})^k\ \ \ (\because \left< i | j \right> = \delta _{ij}) \\ &=& \sum _{k=1} ^{\infty} \frac{1}{k} (-1)^{k-1} \sum _i (D_i - E_i)^k \ket{i} \bra{i}\ \ \ (\because \ket{i} \bra{i} \ket{i} \bra{i} \cdots \ket{i} \bra{i} = \ket{i} \bra{i}) \\ &=& \sum _{k=1} ^{\infty} \frac{1}{k} (-1)^{k-1} \sum _i (D_i - 1)^k \ket{i} \bra{i} \\ &=& \sum _i \left( \sum _{k=1} ^{\infty} \frac{1}{k} (-1)^{k-1} (D_i - 1)^k \right) \ket{i} \bra{i} \\ &=& \sum _i \ln (D_i) \ket{i} \bra{i} \end{eqnarray}$$

This theorem instantly (and generally) solve my question.