# Replica trick

In the statistical physics of spin glasses and other systems with quenched disorder, the replica trick is a mathematical technique based on the application of the formula: $\ln Z=\lim _{n\to 0}{Z^{n}-1 \over n}$ or: $\ln Z=\lim _{n\to 0}{\frac {\partial Z^{n}}{\partial n}}$ where $Z$ is most commonly the partition function, or a similar thermodynamic function.
It is typically used to simplify the calculation of ${\overline {\ln Z}}$, the expected value of $\ln Z$, reducing the problem to calculating the disorder average ${\overline {Z^{n}}}$ where $n$ is assumed to be an integer. This is physically equivalent to averaging over $n$ copies or replicas of the system, hence the name.
The crux of the replica trick is that while the disorder averaging is done assuming $n$ to be an integer, to recover the disorder-averaged logarithm one must send $n$ continuously to zero. This apparent contradiction at the heart of the replica trick has never been formally resolved, however in all cases where the replica method can be compared with other exact solutions, the methods lead to the same results. (A natural sufficient rigorous proof that the replica trick works would be to check that the assumptions of Carlson's theorem hold, especially that the ratio $(Z^{n}-1)/n$ is of exponential type less than π.)
It is occasionally necessary to require the additional property of replica symmetry breaking (RSB) in order to obtain physical results, which is associated with the breakdown of ergodicity.

## General formulation

It is generally used for computations involving analytic functions (can be expanded in power series).
Expand $f(z)$ using its power series: into powers of $z$ or in other words replicas of $z$, and perform the same computation which is to be done on $f(z)$, using the powers of $z$.
A particular case which is of great use in physics is in averaging the thermodynamic free energy,
    $F=-k_{\rm {B}}T\ln Z[J_{ij}],$
over values of $J_{ij}$ with a certain probability distribution, typically Gaussian.
The partition function is then given by
    $Z[J_{ij}]\sim e^{-\beta J_{ij}}.$
Notice that if we were calculating just $Z[J_{ij}]$ (or more generally, any power of $J_{ij}$) and not its logarithm which we wanted to average, the resulting integral (assuming a Gaussian distribution) is just
    $\int dJ_{ij}\,e^{-\beta J-\alpha J^{2}},$
a standard Gaussian integral which can be easily computed (e.g. completing the square).
To calculate the free energy, we use the replica trick:$\ln Z=\lim _{n\to 0}{\dfrac {Z^{n}-1}{n}}$which reduces the complicated task of averaging the logarithm to solving a relatively simple Gaussian integral, provided $n$ is an integer. The replica trick postulates that if $Z^{n}$ can be calculated for all positive integers $n$ then this may be sufficient to allow the limiting behavior as $n\to 0$ to be calculated.
Clearly, such an argument poses many mathematical questions, and the resulting formalism for performing the limit $n\to 0$ typically introduces many subtleties.
When using mean-field theory to perform one's calculations, taking this limit often requires introducing extra order parameters, a property known as "replica symmetry breaking" which is closely related to ergodicity breaking and slow dynamics within disorder systems.

## Physical applications

The replica trick is used in determining ground states of statistical mechanical systems, in the mean-field approximation. Typically, for systems in which the determination of ground state is easy, one can analyze fluctuations near the ground state. Otherwise one uses the replica method. An example is the case of a quenched disorder in a system like a spin glass with different types of magnetic links between spins, leading to many different configurations of spins having the same energy.
In the statistical physics of systems with quenched disorder, any two states with the same realization of the disorder (or in case of spin glasses, with the same distribution of ferromagnetic and antiferromagnetic bonds) are called replicas of each other. For systems with quenched disorder, one typically expects that macroscopic quantities will be self-averaging, whereby any macroscopic quantity for a specific realization of the disorder will be indistinguishable from the same quantity calculated by averaging over all possible realizations of the disorder. Introducing replicas allows one to perform this average over different disorder realizations.
In the case of a spin glass, we expect the free energy per spin (or any self averaging quantity) in the thermodynamic limit to be independent of the particular values of ferromagnetic and antiferromagnetic couplings between individual sites, across the lattice. So, we explicitly find the free energy as a function of the disorder parameter (in this case, parameters of the distribution of ferromagnetic and antiferromagnetic bonds) and average the free energy over all realizations of the disorder (all values of the coupling between sites, each with its corresponding probability, given by the distribution function). As free energy takes the form:
    $F={\overline {F[J_{ij}]}}=-k_{B}T\,{\overline {\ln Z[J]}}$
where $J_{ij}$ describes the disorder (for spin glasses, it describes the nature of magnetic interaction between each of the individual sites $i$ and $j$) and we are taking the average over all values of the couplings described in $J$, weighted with a given distribution. To perform the averaging over the logarithm function, the replica trick comes in handy, in replacing the logarithm with its limit form mentioned above. In this case, the quantity $Z^{n}$ represents the joint partition function of $n$ identical systems.

## REM: the easiest replica problem

The random energy model (REM) is one of the simplest models of statistical mechanics of disordered systems, and probably the simplest model to show the meaning and power of the replica trick to the level 1 of replica symmetry breaking. The model is especially suitable for this introduction because an exact result by a different procedure is known, and the replica trick can be proved to work by crosschecking of results.

## Alternative methods

The cavity method is an alternative method, often of simpler use than the replica method, for studying disordered mean-field problems. It has been devised to deal with models on locally tree-like graphs.
Another alternative method is the supersymmetric method. The use of the supersymmetry method provides a mathematical rigorous alternative to the replica trick, but only in non-interacting systems. See for example the book:
Also, it has been demonstrated that the Keldysh formalism provides a viable alternative to the replica approach.

## Remarks

The first of the above identities is easily understood via Taylor expansion:
    ${\begin{aligned}\lim _{n\rightarrow 0}{\dfrac {Z^{n}-1}{n}}&=\lim _{n\rightarrow 0}{\dfrac {e^{n\ln Z}-1}{n}}\\&=\lim _{n\rightarrow 0}{\dfrac {n\ln Z+{1 \over 2!}(n\ln Z)^{2}+\cdots }{n}}\\&=\ln Z~~.\end{aligned}}$
For the second identity, one simply uses the definition of the derivative
    ${\begin{aligned}\lim _{n\rightarrow 0}{\dfrac {\partial Z^{n}}{\partial n}}&=\lim _{n\rightarrow 0}{\dfrac {\partial e^{n\ln Z}}{\partial n}}\\[5pt]&=\lim _{n\rightarrow 0}Z^{n}\ln Z\\[5pt]&=\lim _{n\rightarrow 0}(1+n\ln Z+\cdots )\ln Z\\[5pt]&=\ln Z~~.\end{aligned}}$