## Real space correlations, radial distribution function ### Correlation function Correlation is a description of relationship between two bivariate data, whether causal or not. There are different types of correlation, but we select the most common one, **Pearson's product-moment coefficient** (PPMCC) to be covered, and expand to correlation functions. This defines the operator $\mathrm{corr}$. Pearson's correlation coefficient $\rho_{X,Y}$ is defined as $\rho_{X,Y} = \operatorname{corr}(X,Y) = \frac{\operatorname{cov}(X,Y)}{\sigma_X \sigma_Y} = \frac{\mathbb{E}[(X - \mu_X)(Y - \mu_Y)]}{\sigma_X \sigma_Y}=\frac{\langle(X - \mu_X)(Y - \mu_Y)\rangle}{\sigma_X \sigma_Y}, \quad \text{if } \sigma_X \sigma_Y > 0.$ Here $\mathrm{cov}$ is the [covariance](https://en.wikipedia.org/wiki/Covariance), $\sigma_{X}$ and $\sigma_{X}$ are standard deviation, $\mu_{X}$, $\mu_{Y}$ are average. If we expand the correlation operation to functions, we get the [correlation function](https://en.wikipedia.org/wiki/Correlation_function). The definition of general correlation function would be $C_{s,t} = \mathrm{corr}(X(s)Y(t))$ If input function has more than 1 dimension, one may write the correlation function into a matrix form. The $\mathrm{corr}$ ensures the output value is in -1 to 1, since it is normalized by dividing of $\sigma$ and substruction of $\mu$. ### Autocorrelation Autocorrelation, as the name suggested, is a special type of correlation function that defined with the variable itself. $\text{corr}(X_t, X_{t+\tau}) = \frac{\mathbb{E}[(X_t - \mu_X)(X_{t+\tau} - \mu_X)]}{\sigma_X^2}= \frac{\mathbb{E}[X_t X_{t+\tau}] - \mu_X^2}{\sigma_X^2}$ This is normalized, so the value stays in -1 to 1. The definition here is in time domain, which is common in signal processing, but it can also be defined with respect to space or other quantity, for example, $\text{corr}(A(\vec{x}), A(\vec{x} + \vec{r})) = \frac{\mathbb{E}[(A(\vec{x}) - \mu_A)(A(\vec{x} + \vec{r}) - \mu_A)]}{\sigma_A^2}=\frac{\mathbb{E}[A(\vec{x}) A(\vec{x} + \vec{r})] - \mu_A^2}{\sigma_A^2} $ In practice, people may not doing normalization or doing average substruction, and use the rigorous form of $\mathrm{corr}$. A good indicator capturing the critical behaviors of autocorrelation would be the average itself, namely $\langle X(t) X(t+\tau)\rangle$ or, define initial time $t=0$, we have $\langle X(\tau) X(0)\rangle$ And for real space, the autocorrelation function could be written in the form of $\langle A(\mathbf{r}) A(\mathbf{r}_{0}+\mathbf{r})\rangle$ Notice the $\vec{0}$ is a position vector, time averaged (it depends, could also be ensemble average or other types of average). It is worth noting that if we consider the correlation on time (or say, [autocorrelation](https://en.wikipedia.org/wiki/Autocorrelation)), we may get the expression for classical picture of [[Fluctuation-Dissipation theorem]], written as $\braket{\delta A(t)\delta A(0)}=2k_{B}T\chi''(\omega) $ Here $\delta A(t)$ is the fluctuation of quantity $A$ at time $t$, $\chi ''(\omega)$ is the Fourier's transform of imaginary part of the [linear response function](https://en.wikipedia.org/wiki/Linear_response_function) of quantity $A$. [[Einstein relation]] for transport is a direction result of it. One may see above forms were not normalized. Whether do the normalization or not depends on the problem one wanna study. Besides doing the normalization in the Pearson's correlation way, one can also divided by $\langle A^{2}\rangle$ directly. ### Real space correlation, density autocorrelation function and radial distribution function #### Density autocorrelation function For continuum, density autocorrelation function describes the density fluctuation in space or time, the definition is, $G(\mathbf{r})=\langle \rho(\mathbf{r}_{0}) \rho(\mathbf{r}_{0}+\mathbf{r})\rangle$ If the system is stable and homogeneous at the scale of interest, then it can be simplified to $G(\mathbf{r})=\langle \rho(0) \rho(\mathbf{r})\rangle$ This function is defined at $\mathbf{r}=0$, and $G(0)=\langle\rho(\mathbf{r}_{0})^{2}\rangle$. This is the expectation value of density square. But of course, one may define the density as number density and use the same methodology (counting particles), in this case it becomes very similar to radial distribution function, but with $r=0$ maintained cause we do not have to ensure the physical significance. #### Radial distribution function Another example of such correlation function in material studies is radial distribution function $g(r)$, who describes the probability of finding a pair with distance $r$ apart. It compares the probability of finding a particle at $r$ to the random distributed case, or say the average number density $\rho_{0}$, and this can be used to calculate the average number of atom in a shell. Writing into the form of autocorrelation, we have for 2nd order $g(\mathbf{r})=\frac{1}{\rho_{0}^{2}}\langle \rho(\mathbf{r}_{0}) \rho(\mathbf{r}_{0}+\mathbf{r})\rangle\Bigg|_{\mathbf{r}\neq0}$ This $\mathbf{r}\neq0$ is to maintain proper physical significance and will cause a singular point. See the [[#^87cfbe|notice]] below. ![[Drawing 2023-07-27 11.54.48.excalidraw.svg]] The expanded expression may be written as $g(r) = \dfrac{\left( N - 1 \right)}{4 \pi \rho r^2} \dfrac{1}{Z} \int_{| \textbf{r}_1 - \textbf{r}_2 | = r} \mathrm{d}x_{\textbf{r}} \: e^{-\beta U \left( \textbf{r}_1, \ldots, \textbf{r}_N \right)}$ where $Z = \int \mathrm{d}x_{\textbf{r}} \: e^{-\beta U \left( \textbf{r}_1, \ldots, \textbf{r}_N \right)}$ ^7819bb This is a rigorous definition for n-th order $g(r)$ and is used in statistical mechanics, see [wiki page](https://en.wikipedia.org/wiki/Radial_distribution_function#Definition) for more on how it's defined. But easier ways to understand this $g(r)$ are applied in most cases, by simply counting particle. This is done for second order $g(\mathbf{r})$ (**Notice**, here it's not isotropic and we use the vector form, but actual $g(r)$ typically does not have orientational dependence by definition). $ g(\mathbf{r}) = \frac{1}{\rho_{0}} \left\langle \sum_{i \ne 0} \delta(\mathbf{r} - \mathbf{r}_i) \right\rangle $ We can [[Structure factor S(q) and density autocorrelation functions#Structure factor and radial distribution function|prove]] that this form is equivalent to the density autocorrelation form. >[!Notice] >If one check above expression, one can quickly notice that this function is not defined at $r=r_{0}$, which is our origin. >This is due to the **discrete** nature of number density. One can only have or not have a particle at a point, and for the origin, we certainly have, and this gives a $\delta$ peak at $r=0$ cause the average contains only 1 particle range. If the volume is big we no longer have this issue. > >From this perspective, this radial distribution function by counting particle number is not specifically good to investigate long range ordering. In long range studies ($r\gg r_{0}$), the density autocorrelation function would do the same job. ^87cfbe This 2nd order radial distribution function can be used to compute the [[Structure factor S(q) and density autocorrelation functions]] in liquid, which gives $S(q)$ as $S(q) = 1 + \rho_{0} \int_{V} \mathrm{d\bf{r}}\ e^\mathbf{-iqr} g(r)$ To deal with the diverges of $\int g(r) dr$, alternative definition is applied, and we minus 1 from $g(r)$, this gives (see [wiki page](https://en.wikipedia.org/wiki/Radial_distribution_function#Definition)) $S(q) = 1 + \rho_{0} \int_{V} \mathrm{d\bf{r}}\ e^\mathbf{-iqr} [g(r)-1]$ This form ensures all other parts being exactly the same, but removes the $\delta(q=0)$ point. The derivation of this is given in [[Structure factor S(q) and density autocorrelation functions]]. This $\rho_{0}$ is $\frac{N}{V}$, particle number density, sometimes written as $\langle n\rangle$. For isotropic materials, an even simpler form would be $g(r)=\frac{\rho(r)}{\rho_{0}}$ namely the number density of particle deviate from the average. >[!Notice] >In some context people may have slight different forms for radial distribution function and pair correlation function. Here only a potential form is provided. >>[!Answer] >>One huge difference is that pair distribution function is the orientational dependence, while radial distribution function not. For the general pair distribution function description under Fraunhofer scattering condition, see [[Fraunhofer scattering#From cross-section to real space correlation]]. However, in many cases, these two terms are used interchangeably. Even the word pair distribution function may have different meanings when applied in different fields. >[!info] >See more at >https://en.wikipedia.org/wiki/Correlation_function, >https://en.wikipedia.org/wiki/Radial_distribution_function and >[1.2: Radial Distribution Function - Chemistry LibreTexts](https://chem.libretexts.org/Bookshelves/Biological_Chemistry/Concepts_in_Biophysical_Chemistry_(Tokmakoff)/01%3A_Water_and_Aqueous_Solutions/01%3A_Fluids/1.02%3A_Radial_Distribution_Function), >[1.5: The van der Waals equation of state and radial distribution functions - Chemistry LibreTexts](https://chem.libretexts.org/Courses/New_York_University/CHEM-UA_652%3A_Thermodynamics_and_Kinetics/01%3A_Lectures/1.05%3A_The_van_der_Waals_equation_of_state_and_radial_distribution_functions). >[structure factor](https://en.wikipedia.org/wiki/Structure_factor)