# Question about ergodicity and the evolution of the probability distribution under Liouville's theorem

According to Liouville's theorem, the probability distribution function $$\rho$$ evolve in phase space with $$\frac{d \rho}{d t} = \frac{\partial \rho}{\partial t}+\left\{\rho,H\right\}_{P.B} =0$$ when the system is steady, $$\frac{\partial \rho}{\partial t}=0$$, we have $$\left\{\rho,H\right\}_{P.B} =0$$ this holds for two condition, the first one is $$\rho$$ is uniform through out the whole phase space, the second one is $$\rho$$ is a function of the Hamiltonian $$H(q,p)$$, as the case of canonical ensemble, $$\rho=exp(\frac{-H(q,p)}{k_Bt}).$$

Here is my question, if the system is in equilibrium, then the system is ergodic. In this case, the trajectory formed by the evolution of the system under Hamilton Equation will visit every point of the phase space. Then $$\rho$$ should be uniform through out the whole phase space. This seems to violate the second case mentioned above as $$\frac{d \rho}{d t}=0$$, then the canonical ensemble should be non-ergodic. I dont know where I am wrong.

Motion governed by a time-independent hamiltonian $$H(q,p)$$ conserves energy. Therefore, only the microstates with the same energy are visited under such hamiltonian motion, not whole phase space. That's what happens with the microcanonical ensemble.