# Harmonic oscillator with heat bath

I need to calculate the expectation value for a harmonic oscillator coupled to a heat bath using the trace method. I know that the density operator looks like:

$$\rho = \frac{e^{-H / k_B T}}{\text{Tr}\left( e^{-H/ k_B T} \right) } \, .$$

I need to show the following:

$$\text{Tr} (\rho H) = \frac{1}{2 \hbar \omega} + \frac{\hbar \omega}{e^{\hbar \omega / k_B T} - 1} \, .$$

I know the energy spectrum of the harmonic oscillator, but how do I compute the expectation value if I take the exponential of the Hamiltonian? I guess one should somehow use the creation and annihilation operator.

• Do you know the partition function before hand? Say you do. If you write $e^{-\frac{H}{k_BT}}$ as $e^{-\beta H}$, what relationship do you see between $Tr\left[e^{-\beta H}\right]$ and $Tr\left[H e^{-\beta H}\right]$? – udrv Jan 3 '16 at 14:35
• The partition function is not given in the exercise, but we had that topic in thermodynamics, so I guess I could write it down. But sorry, I'm kind of stuck at that point.. – Darius Jan 3 '16 at 15:08
• Ok, so calculating the partition function would indeed require use of creation & annihilation ops. It's not hard to do the trace sum though. Assuming you try this, what happens if you take the derivative on $\beta$ of $Tr\left[e^{-\beta H}\right]$? – udrv Jan 3 '16 at 15:27
• Now I see, that they are connected by the derivative and a minus. And I can somehow remember, that taking the derivative by $\beta$ would give the energy of the system :) – Darius Jan 3 '16 at 15:45
• The units are wrong in your last expression. The way to calculate this is to directly compute the trace in the oscillator eigenbasis. That allows you to get rid of $H$ in favor of $n$'s, and the trace turns into a geometric series and the derivative of a geometric series. – march Jan 5 '16 at 5:51

The trace can be calculated in any basis. Therefore, we will calculate it in the oscillator eigenbasis $\{|n\rangle\}$ as follows. First, $$\text{Tr}\left( e^{-H/ k_B T} \right) = \sum_{n=0}^{\infty}\langle n|e^{-H/ k_B T}|n\rangle =\sum_{n=0}^{\infty}\langle n|e^{-\hbar\omega(n+1/2)/ k_B T}|n\rangle =\sum_{n=0}^{\infty}e^{-\hbar\omega(n+1/2)/ k_B T}.$$ This last sum can be evaluated because it can be written as a geometric series: $$\text{Tr}\left( e^{-H/ k_B T} \right) =e^{-\hbar\omega/2k_B T}\sum_{n=0}^{\infty}\left(e^{-\hbar\omega / k_B T}\right)^n =e^{-\hbar\omega/2k_B T}\frac{1}{1-e^{-\hbar\omega / k_B T}} =\frac{e^{\hbar\omega / 2k_B T}}{e^{\hbar\omega / k_B T}-1}$$ Then, note that $$\text{Tr}(\rho H) = \text{Tr}\left(\frac{e^{-H / k_B T}}{\text{Tr}\left( e^{-H/ k_B T} \right) } H\right) =\frac{\text{Tr}\left(e^{-H / k_B T}H\right)}{\text{Tr}\left( e^{-H/ k_B T} \right) }.$$ So, we have to do the top: \begin{align*} \text{Tr}\left(e^{-H / k_B T}H\right) &=\sum_{n=0}^{\infty}\langle n|e^{-H / k_B T}H|n\rangle =\sum_{n=0}^{\infty}e^{-\hbar\omega(n+1/2)/ k_B T}\hbar\omega\left(n+\frac{1}{2}\right)\\ &=\frac{\hbar\omega}{2}\sum_{n=0}^{\infty}e^{-\hbar\omega(n+1/2)/ k_B T} + \hbar\omega\sum_{n=0}^{\infty}e^{-\hbar\omega(n+1/2)/ k_B T}n\\ &=\frac{\hbar\omega}{2}\frac{e^{\hbar\omega / 2k_B T}}{e^{\hbar\omega / k_B T}-1} + \hbar\omega \frac{e^{\hbar\omega / 2k_B T}}{e^{\hbar\omega / k_B T}-1} \frac{1}{e^{\hbar\omega / k_B T}-1} \end{align*} Putting these together yields $$\text{Tr} (\rho H) = \frac{\hbar \omega}{2} + \frac{\hbar \omega}{e^{\hbar \omega / k_B T} - 1} \, .$$
• @Darius. It's possible there's an algebraic mistake. I don't have time to fix it right now. Perhaps you can find the error! The last sum can be done by pulling out the $e^{-\hbar\omega n/k_BT}$ and performing the sum, which is just $\sum_n nx^n$ for suitable $x$, whose value you can look up in any table of sums. – march Jan 5 '16 at 16:36
• Yes, I guess the exponential term after the $\hbar \omega$ shouldn't appear, as it wouldn't disappear when calculating the fraction. I'll look that up and fix it. Thank you again! – Darius Jan 5 '16 at 16:48