# Confusion about Free Energy and the Hamiltonian

I'm probably making a relatively basic mistake here, but I'm a bit confused about the relation between the Hamiltonian and Helmholtz free energy.

From what I can see, the free energy can be written as a function of the partition function as:

$$A= -\frac{1}{\beta}log(Z)$$

And the partition function can be written as a function of the Hamiltonian as:

$$Z = tr(e^{-\beta H})$$

(This is for the quantum case, but my question applies equally to the classical case)

From this, as far as I can see the free energy depends only on the Hamiltonian, not on the actual state of the system (other than its temperature), which I find hard to understand.

For example, imagine the free energy of a free particle before and after it collides with another particle. It will have the same Hamiltonian before and after the collision, but conceptually it seems like the free energy should change (for example if the collision increases its momentum)

Could somebody unravel my confusion here?

-

The formulae you quote are not the cleanest for understanding. Let's re-write them: $$e^{-\beta F} = \mathrm{tr}\left(e^{-\beta H}\right).$$ On the left, $F$ is just a number, whereas on the right, $H$ is an operator. The trace can be thought of as an average — which raises the question of what ensemble are we averaging over. The answer, as Lubos alludes to, is the unique mixed state (the Gibbs state) defined by the temperature and the Hamiltonian. If there are more relevant quantities which constrain the macroscopic state, then the expression should be changed. For example, if number of particles is allowed to fluctuate, then we get: $$e^{-\beta F} = \mathrm{tr}\left(e^{-\beta H - \beta \mu N}\right).$$ However, you are certainly at liberty to define other kinds of free energies, depending on the ensemble you choose.

-
Thanks for the answer, it does help somewhat. I think the question I commented on Lubos' answer is still relevant to this one. –  Ben Aaronson Oct 15 '12 at 14:41
When you specify a precise temperature of a physical system, then you are specifying the exact (mixed) state whose probability distribution is $\exp(-\beta E(p_i,q_i))$ (up to the overall normalization coefficient) classically or whose density matrix is proportional to $\exp(-\beta H)$ quantum mechanically.