# Quantum harmonic oscillator in thermodynamics

I'm trying to understand the microcanonical ensemble in thermodynamics using the quantum harmonic oscillator. The Hamiltonian of the whole system is given by $$H = \hbar\omega\sum\limits_{i=1}^N \left(a_i^\dagger a_i + \frac{1}{2}\right),$$ where $N$ is the total number of oscillators. I want to consider the case where $N=3$ and where the ensemble is formed by all states with total energy $\frac{9}{2}\hbar\omega$. Then there are 10 states in the ensemble.

I'm now wondering how to calculate the probability $p(\epsilon)$ to find one specific oscillator with energy $\epsilon$. Since this is very new stuff to me, I don't quite know how to approach such a problem. Is there anybody who can show me how to find that probability?

In the micro-canonical ensemble, if the given energy has a degenerate eigenspace of the hamiltonian, then you just take an orthonormal basis for that eigenspace and take an incoherent combination of those states as your density matrix. (Exercise for the reader: show that $\rho$, thusly defined, is independent of that choice of basis.)

For your specific case, rephrased without the boring zero-point energies as

$H = \sum\limits_{i=1}^N a_i^\dagger a_i$, for $N=3$ oscillators and with total energy $3\hbar\omega$, giving $10$ states in the ensemble.

we have the states $$\{|3,0,0⟩,|2,0,1⟩,|2,1,0⟩,|1,2,0⟩, |1,1,1⟩,|1,0,2⟩,|0,3,0⟩, |0,2,1⟩,|0,1,2⟩, |0,0,1⟩\}$$ as an orthonormal basis of that eigenspace, so you just take $\rho$ to be that combination, $$\rho = \frac{1}{10}\sum_{n_1+n_2+n_3=3} |n_1,n_2,n_3⟩⟨n_1,n_2,n_3|.$$

To calculate the measurement result distribution for a single-oscillator quantity like one of the individual sub-hamiltonians, you can just trace out the other hamiltonians as $$\rho_1 = \mathrm{Tr}_{2,3}\rho,$$ where the partial trace is the unique linear map such that $$\mathrm{Tr}_{2,3}|n_1,n_2,n_3⟩⟨n_1,n_2,n_3| =|n_1⟩⟨n_1|\ \mathrm{Tr}\bigg[|n_2,n_3⟩⟨n_2,n_3|\bigg] =|n_1⟩⟨n_1|, \tag{*}$$ giving you a result of the form $$\rho_1= p_1|n_1⟩⟨n_1| + p_2|n_2⟩⟨n_2| + p_3|n_3⟩⟨n_3|,$$ which then gives you the probabilities of getting the measurement results associated with each of those component states.

It might be beneficial to go through this in full but the $E=3\hbar \omega$ case is a lot of drudgework so I'll do the $E=\hbar \omega$ case instead. Here you have three relevant states, which means that your full state is $$\rho = \frac{1}{3}\bigg( |1,0,0⟩⟨1,0,0| + |0,1,0⟩⟨0,1,0| + |0,0,1⟩⟨0,0,1| \bigg).$$ You then want the reduced state, which you get from the full state via tracing out oscillators $2$ and $3$: you apply the partial trace, you break it up to the individual factors by linearity, you apply it via $(*)$ to each term, and then you add everything up: \begin{align} \rho_1 & = \mathrm{Tr}_{2,3}(\rho) \\ & = \frac{1}{3}\mathrm{Tr}_{2,3}\bigg( |1,0,0⟩⟨1,0,0| + |0,1,0⟩⟨0,1,0| + |0,0,1⟩⟨0,0,1| \bigg) \\ & = \frac{1}{3}\bigg[ \mathrm{Tr}_{2,3}\big(|1,0,0⟩⟨1,0,0|\big) + \mathrm{Tr}_{2,3}\big(|0,1,0⟩⟨0,1,0|\big) + \mathrm{Tr}_{2,3}\big(|0,0,1⟩⟨0,0,1|\big) \bigg] \\ & = \frac{1}{3}\bigg[ |1⟩⟨1|\mathrm{Tr}\big(|0,0⟩⟨0,0|\big) + |0⟩⟨0|\mathrm{Tr}\big(|1,0⟩⟨1,0|\big) + |0⟩⟨0|\mathrm{Tr}\big(|0,1⟩⟨0,1|\big) \bigg] \\ & = \frac{1}{3}\bigg[ |1⟩⟨1| + |0⟩⟨0| + |0⟩⟨0| \bigg] \\ & = \frac{1}{3}|1⟩⟨1| + \frac{2}{3} |0⟩⟨0|. \end{align} Hopefully that makes things clearer.

• I don't quite understand how to arrive at the last equation in your post. If I trace out the other Hamiltonians, how can $\rho_1$ be dependent on $n_2$ and $n_3$? Maybe you can elaborate on that a little more. Oct 29 '17 at 15:37
• @MeMeansMe You don't "trace out the other hamiltonians", you trace out the other tensor factors in each projector, as in my second-to-last equation. Once you do that, you'll have multiple terms contributing to each $|n_1⟩⟨n_1|$ end result. Oct 29 '17 at 15:44
• This answers basically everything I wanted to know. Thank you for the time and effort you put in your post! Maybe just one thing: The probabilities for the energies of the oscillator are then given by $p_n = ⟨n|\rho_1|n⟩$, right? (I know you can just read them off, but just for understanding the formalism...) Oct 29 '17 at 17:28

I will do this more generally for any $N$ and total energy $\mathcal{E}$. First of all, I suppose you forgot about $\hbar \omega$ in the Hamiltonian, so $$\hat{H} = \hbar\omega\sum\limits_{i=1}^{N}\left(\hat{a}_i^{\dagger}\hat{a}_i + \frac{1}{2}\right).$$ In microcanonical ensemble we need $\Phi(E)$ which is the total number of microstates which has total energy $E$. As you noted for $E=9/2\hbar\omega$ it will be $10$. In the case of quantum harmonic oscillator the total energy $\mathcal{E}$ is given by $$\mathcal{E}(n_1,n_2,\ldots,n_N) = N\frac{1}{2}\hbar\omega + \hbar\omega\sum\limits_{i=1}^{N} n_i.$$ Now you are facing the following problem. How many combination of integer numbers $n_i$ (including 0) there are such that $$\sum\limits_{i=1}^{N}n_i = \frac{E-N\hbar\omega/2}{\hbar\omega}.$$ The answer, which you can find e.q. here, is $$\Phi(E) = \binom{\frac{E-N\hbar\omega/2}{\hbar\omega} + N-1}{N-1}.$$

Let's denote by $p(\epsilon|i,E)$ the conditional probability that the oscillator number $i$ has energy $\epsilon$ given that the total energy is $E$. This is nothing more that the ratio $p(\epsilon|i,E) = \phi_i(\epsilon|E)/\Phi(E)$, between number of possibilities when $\hbar\omega(n_i + 1/2) = \epsilon$ and the total number of microstates. We can easily calculate $\phi_i(\epsilon|E)$ because it is similar to the previous combinatorial problem, but now we have one particle less: $$\phi_{i}(\epsilon|E) = \binom{\frac{E-\epsilon - (N-1)\hbar\omega/2}{\hbar\omega}+N-2}{N-2}.$$ For $E = 9\hbar\omega/2$ and $N=3$ you get: $$\phi_i(\epsilon|E=9\hbar\omega/2) = \frac{9}{2}- \frac{\epsilon}{\hbar\omega},$$ so $$p(\epsilon|i,E=9\hbar\omega/2) = \frac{9/2-\epsilon/\hbar\omega}{10}.$$

You can find the probability with the density matrix. This density matrix is an operator defined by

$\hat{\rho}= e^{-\frac{\hat{H}}{k_BT}}$

with Boltzmann constant $k_B$ and temperature $T$. If you calculate the operator expectation value you obtain the probability that the system is in the energy state $\epsilon$.

Expanding a quantum state in a linear combination of eigenstates of the Hamiltonian might be useful.

• Is this really true for the microcanonical ensemble? And I was asking about the probability of one specific oscillator to be found with energy $\epsilon$, not about the probability of the whole system. Maybe I'm missing something, though... Oct 29 '17 at 8:40
• You can also evaluate the operator $\delta(\epsilon-H)$ to get the probability density in microcanonical ensemble Oct 29 '17 at 8:50
• Nothing in this answer is useful to the question as posed. Oct 29 '17 at 9:22
• @EmilioPisanty Could you maybe show me how this is done? Oct 29 '17 at 12:12