Canonical partition function I have a question regarding the addition of a constant energy in the Hamilton when we compute the Canonical partition function. In my script it is said that even if we add a constant value of energy, the entropy won't change? How is that possible?
Is it because if you try to find the entropy from the free energy (sackur tetrode equation) that added energy will be divided by the number of particles of the system?
How does the entropy stays the same?
 A: In canonical ensemble, the partition funciton $Z(T, V, N)$ is directly related to Helmholtz free energy:
$$F = -KT \ln Z(T, V, N) \tag{1}$$,
and energy:
$$\tag{2}
  U = \frac{\sum_i E_i e^{-\beta E_i}}{Z} = -\frac{\partial \ln  Z}{\partial \beta}.
$$
Then, the entropy
$$\tag{3}
  S = \frac{U - F}{T}.
$$
Therefore, if all energies shift by a constant $\xi$, them energy $U$ in Eq. (2) will shift by the constant:
$$
  U \Longrightarrow \,\,  \frac{\sum_i (E_i+\xi) e^{-\beta (E_i+\xi)}}{Z} = U+\xi.
$$
and also the partition function and the Free energy $F$
$$
Z \to \sum_i e^{-\beta (E_i+\xi)} = e^{-\beta \xi} Z .\\
F = -K_b T \ln Z \,\,\Longrightarrow\,\, -K_b T \ln Z + \xi 
$$
Thus,  the sntropy :
$$
  S = \frac{U - F}{T}\,\, \Longrightarrow \frac{U + \xi - F -\xi}{T}= \frac{U  - F }{T}.
$$
Therefore, two constants cancel each other, and entropy doesn't changed.
A: Let's consider the quantum canonical ensemble partition function:
$$Z\equiv \mathrm{Tr}\,e^{-\beta H} \quad , $$
where $\beta=1/T$ ($k_\mathrm B = 1$) is the inverse temperature and $H$ the Hamiltonian. The entropy associated to a density operator $\rho$
is defined as
$$S[\rho]\equiv -\mathrm{Tr} \,\rho\ln \rho \quad . $$
Some algebraic manipulations show that for the equilibrium density operator
$$ \rho_{\mathrm{eq}} \equiv \frac{1}{Z} \, e^{-\beta H}$$
this yields
$$ S_{\mathrm{eq}} = \frac{\partial}{\partial T}\, (T\ln Z) \quad .$$
Now if we replace $H\rightarrow H + c$, where $c \in \mathbb{R}$ is a constant, then $Z \rightarrow Z\, e^{-\beta c}$ and consequently
$$ S_{\mathrm{eq}} \rightarrow \frac{\partial}{\partial T}\, (T\ln ( Z\, e^{-\beta c})) = \frac{\partial}{\partial T}\, (T\ln Z) + \frac{\partial}{\partial T}\, (-T\beta c) = \frac{\partial}{\partial T}\, (T\ln Z) = S_{\mathrm{eq}} \quad . $$
