Why do we disorder-average before/after taking the logarithm of the partition function for annealed/quenched disorder? Pg. 19 of these notes says

Crucially, the [disorder] average $\overline{\log Z}$ has to be computed after taking the logarithm.  Such an average is called quenched ... Computing the average first, i.e. on the partition function itself, is called annealed averaging. Physically, this corresponds to a situation in which the couplings themselves are fluctuating variables.

The sentence spanning the first two pages of this paper says pretty much the same thing.
I understand the physical difference between quenched and annealed disorder, but why does disorder-averaging after vs. before taking the logarithm correctly capture their respective statistics?
 A: A few additional thoughts prompted by valerio's great answer:
The annealed and quenched disorder cases should be thought of as being described by two completely different Hamiltonians with different dynamical degrees of freedom (or in the quantum case, acting on different Hilbert spaces). In the annealed case, the $J_{ij}$ variables aren't really coupling constants at all, but dynamical Hamiltonian degrees of freedom that live on the links of the lattice and feel an external potential $V(J) = -T \ln p(J)$. (The setup is in fact very similar to a lattice gauge theory coupled to a matter field.) And the integral over the $J_{ij}$ isn't really a "disorder average", but rather just a part of the usual trace for the partition function. In fact, in the annealed case the Hamiltonian is perfectly translationally invariant, so to my mind the system isn't really disordered at all (although that is of course just a matter of definitions). That's why the annealed case is so much easier to deal with.
The only thing that keeps the annealed case from being a completely standard stat mech problem is that the potential term in the effective Hamiltonian $H_\text{eff}$ depends explicity on temperature, so that changing the physical temperature doesn't just dilate the reduced Hamiltonian $\beta H_\text{eff}$ uniformly as usual, but changes the relative weights between the terms. At finite temperature, this isn't a very significant change from the usual case.
In the quenched case, one way to think about the reason for disorder-averaging the free energy rather than the partition function is that physically observable thermodynamic quantities are partial derivatives of the free energy, and the partial derivatives commute with the disorder average (as they act on different degrees of freedom), so disorder-averaging the free energy is equivalent to disorder-averaging the observable thermodynamic quantities, which is basically what happens in a real experiment.
A: To fix the idea, let's consider a spin glass Hamiltonian $H(\sigma,J)$, where $\sigma$ are the spins and $J$ is a random variable with distribution $p(J)$ representing the couplings.
An example is the Edwards-Anderson spin glass:
$$H = - \sum_{\langle i,j \rangle} J_{ij} \sigma_i \sigma_j$$
where $J_{ij}$ are Gaussian random variables.
The annealed free energy is
$$F_a = -\frac{1}{\beta} \  \log \int dJ \ p(J) \int d\sigma\ e^{-\beta H(\sigma,J)}  =  -\frac{1}{\beta} \log[\overline{Z(\beta,J)}]\tag{1}\label{1}$$
while the quenched free energy is
$$F_q =  -\frac{1}{\beta} \int dJ\ p(J) \ \log \int d\sigma\ e^{-\beta H(\sigma,J)} =-\frac{1}{\beta} \overline{\log[Z(\beta,J)]}\tag{2}\label{2}$$
In \ref{1} you are treating $J$ and $\sigma$ on equal footing, so that $J$ becomes just another degree of freedom: $J$ and $\sigma$ fluctuate "together".
You could actually define an "effective Hamiltonian" 
$$\tilde H_\beta(\sigma,J) = H-\frac 1 \beta \log p(J)$$
and write
$$F_a = -\frac{1}{\beta} \log \int dJ d\sigma e^{-\beta \tilde H_\beta(\sigma,J)}$$
In \ref{2}, the situation is different, because you are


*

*First, creating a realization of the system with a certain (fixed) disorder $J$, and calculating the corresponding free energy.

*Then, averaging over all the free energies obtained this way with respect to the disorder $J$.


The variables $J$ and $\sigma$ are not anymore on equal footing: $J$ is fixed when you average over $\sigma$, and this is the crucial point. 

References


*

*T. Castellani, A. Cavagna, Spin-Glass Theory for Pedestrians (2005)
