Tianyao Tan bio photo

Email

My CV

Github

RedNote

PHYS 5120 - 计算能源材料和电子结构模拟 Lecture-3

Lecturer: Prof.PAN DING

1 radial distribution function:

  • 内容:

This whiteboard explains the process of calculating the radial distribution function, often denoted as $g(r)$, to analyze the atomic structure of a material, which is referred to here as a “film”. 本白板解释了计算径向分布函数(通常表示为 $g(r)$)的过程,用于分析材料(本文中称为“薄膜”)的原子结构。

In simple terms, the radial distribution function tells you the probability of finding an atom at a certain distance from another reference atom. It’s a powerful way to see the local structure in a disordered system like a liquid or an amorphous solid.

简单来说,径向分布函数表示在距离另一个参考原子一定距离处找到一个原子的概率。它是观察无序系统(例如液体或非晶态固体)局部结构的有效方法。

## Core Concept: Radial Distribution Function 径向分布函数

The main goal is to compute the radial distribution function, $g(r)$, which is defined as the ratio of the actual number of atoms found in a thin shell at a distance $r$ to the number of atoms you’d expect to find if the material were an ideal gas (completely random). 主要目标是计算径向分布函数 $g(r)$,其定义为在距离 $r$ 的薄壳层中实际发现的原子数与材料为理想气体(完全随机)时预期发现的原子数之比。

The formula is expressed as: \(g(r)dr = \frac{n(r)}{\text{ideal gas}}\)

  • $n(r)$: Represents the average number of atoms found in a thin spherical shell between a distance $r$ and $r+dr$ from a central atom. 表示距离中心原子 $r$ 到 $r+dr$ 之间的薄球壳中原子的平均数量。
  • ideal gas: Represents the number of atoms you would expect in that same shell if the atoms were distributed completely randomly with the same average density ($\rho$). The volume of this shell is approximately $4\pi r^2 dr$.表示如果原子完全随机分布且平均密度 ($\rho$) 相同,则该球壳中原子的数量。该球壳的体积约为 $4\pi r^2 dr$。

A peak in the $g(r)$ plot indicates a high probability of finding neighboring atoms at that specific distance, revealing the material’s structural shells (e.g., nearest neighbors, second-nearest neighbors, etc.).$g(r)$ 图中的峰值表示在该特定距离处找到相邻原子的概率很高,从而揭示了材料的结构壳(例如,最近邻、次近邻等)。

## Calculation Method

The board outlines a two-step averaging process to get a statistically meaningful result from simulation data (a “film” at 20 frames per second).

  1. Average over atoms: In a single frame (a snapshot in time), you pick one atom as the center. Then, you count how many other atoms ($n(r)$) are in concentric spherical shells around it. This process is repeated, treating each atom in the frame as the center, and the results are averaged.

  2. Average over frames: The entire process described above is repeated for multiple frames from the simulation or video. This time-averaging ensures that the final result represents the typical structure of the material over time, smoothing out random fluctuations.

The board notes “dx = bin width 0.01Å”, which is a practical detail for the calculation. To create a histogram, the distance r is divided into small segments (bins) of 0.01 angstroms.

## Connection to Experiments

Finally, the whiteboard mentions “frame X-ray scattering”. This is a crucial point because it connects this computational analysis to real-world experiments. Experimental techniques like X-ray or neutron scattering can be used to measure a quantity called the structure factor, $S(q)$, which is directly related to the radial distribution function $g(r)$ through a mathematical operation called a Fourier transform. This allows scientists to directly compare the structure produced in their simulations with the structure of a real material measured in a lab. 最后,白板上提到了“帧 X 射线散射”。这一点至关重要,因为它将计算分析与实际实验联系起来。X射线或中子散射等实验技术可以用来测量一个称为结构因子$S(q)$的量,该量通过傅里叶变换的数学运算与径向分布函数$g(r)$直接相关。这使得科学家能够直接将模拟中产生的结构与实验室测量的真实材料结构进行比较。

The board correctly links $g(r)$ to X-ray scattering experiments. The quantity measured in these experiments is the static structure factor, $S(q)$, which describes how the material scatters radiation. The relationship between the two is a Fourier transform: 该板正确地将$g(r)$与X射线散射实验联系起来。这些实验中测量的量是静态结构因子$S(q)$,它描述了材料如何散射辐射。两者之间的关系是傅里叶变换: \(S(q) = 1 + 4 \pi \rho \int_0^\infty [g(r) - 1] r^2 \frac{\sin(qr)}{qr} dr\) This equation is crucial because it bridges the gap between computer simulations (which calculate $g(r)$) and physical experiments (which measure $S(q)$). 这个方程至关重要,因为它弥合了计算机模拟(计算 $g(r)$)和物理实验(测量 $S(q)$)之间的差距。

## 2. The Gaussian Distribution: Probability of Particle Position 高斯分布:粒子位置的概率

The board starts with the formula for a one-dimensional Gaussian (or normal) distribution: 白板首先展示的是一维高斯(或正态)分布的公式:

\[f(x | \mu, \sigma^2) = \frac{1}{\sqrt{2\pi\sigma^2}} \exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right)\]

This equation describes the probability of finding a particle at a specific position x after a certain amount of time has passed.

  • $\mu$ (mu) is the mean or average position. For a simple diffusion process starting at the origin, the particles spread out symmetrically, so the average position remains at the origin ($\mu = 0$).
  • $\sigma^2$ (sigma squared) is the variance, which measures how spread out the particles are from the mean position. A larger variance means the particles have, on average, traveled farther from the starting point. 这个方程描述了经过一定时间后,在特定位置“x”找到粒子的概率。
  • $\mu$ (mu)平均值或平均位置。对于从原点开始的简单扩散过程,粒子对称扩散,因此平均位置保持在原点($\mu = 0$)。
  • $\sigma^2$(sigma 平方)方差,用​​于衡量粒子与平均位置的扩散程度。方差越大,意味着粒子平均距离起点越远。

The note “Black-Scholes” is a side reference. The Black-Scholes model, famous in financial mathematics for pricing options, uses similar mathematical principles based on Brownian motion to model the random fluctuations of stock prices. “Black-Scholes”注释仅供参考。Black-Scholes 模型在金融数学中以期权定价而闻名,它使用基于布朗运动的类似数学原理来模拟股票价格的随机波动。

## 3. Mean Squared Displacement (MSD): Quantifying the Spread 均方位移 (MSD):量化扩散

The core of the board is dedicated to the Mean Squared Displacement (MSD). This is the primary tool used to measure how far, on average, particles have moved over a time interval t. 本版块的核心内容是均方位移 (MSD)。这是用于测量粒子在时间间隔“t”内平均移动距离的主要工具。

The variance $\sigma^2$ is formally defined as the average of the squared deviations from the mean: \(\sigma^2 = \langle x^2(t) \rangle - \langle x(t) \rangle^2\)

  • $\langle x(t) \rangle$ is the average displacement. As mentioned, for simple diffusion, $\langle x(t) \rangle = 0$.
  • $\langle x^2(t) \rangle$ is the average of the square of the displacement. 方差$\sigma^2$的正式定义为与平均值偏差平方的平均值: \(\sigma^2 = \langle x^2(t) \rangle - \langle x(t) \rangle^2\)
  • $\langle x(t) \rangle$是平均位移。如上所述,对于简单扩散,$\langle x(t) \rangle = 0$。
  • $\langle x^2(t) \rangle$是位移平方的平均值。

Since $\langle x(t) \rangle = 0$, the variance is simply equal to the MSD: \(\sigma^2 = \langle x^2(t) \rangle\) 由于 $\langle x(t) \rangle = 0$,方差等于均方差 (MSD): \(\sigma^2 = \langle x^2(t) \rangle\)

The crucial insight for a diffusive process is that the MSD grows linearly with time. The rate of this growth is determined by the diffusion coefficient, D. The board shows this relationship for different dimensions: 扩散过程的关键在于MSD 随时间线性增长。其增长率由扩散系数 D决定。棋盘显示了不同维度下的这种关系:

  • 1D: $\langle x^2(t) \rangle = 2Dt$ (Movement along a line) (沿直线运动)
  • 2D: The board has a slight typo or ambiguity with $\langle z^2(t) \rangle = 2Dt$. For 2D motion in the x-y plane, the total MSD would be $\langle r^2(t) \rangle = \langle x^2(t) \rangle + \langle y^2(t) \rangle = 4Dt$. The note on the board might be referring to just one component of motion. **棋盘上的 $\langle z^2(t) \rangle = 2Dt$ 存在轻微拼写错误或歧义。对于 x-y 平面上的二维运动,总平均散射差 (MSD) 为 $\langle r^2(t) \rangle = \langle x^2(t) \rangle + \langle y^2(t) \rangle = 4Dt$。黑板上的注释可能仅指运动的一个分量。
  • 3D: $\langle r^2(t) \rangle = \langle |\vec{r}(t) - \vec{r}(0)|^2 \rangle = 6Dt$ (Movement in 3D space, which is the most common case in molecular simulations) (三维空间中的运动,这是分子模拟中最常见的情况) Here, $\vec{r}(t)$ is the position vector of a particle at time t. The quantity $\langle |\vec{r}(t) - \vec{r}(0)|^2 \rangle$ is the average of the squared distance a particle has traveled from its initial position $\vec{r}(0)$. 这里,$\vec{r}(t)$ 是粒子在时间 t 的位置矢量。 $\langle |\vec{r}(t) - \vec{r}(0)|^2 \rangle$ 是粒子从其初始位置 $\vec{r}(0)$ 行进距离的平方平均值。

## 4. The Einstein Relation: Connecting Microscopic Motion to a Macroscopic Property 爱因斯坦关系:将微观运动与宏观特性联系起来

Finally, the board presents the famous Einstein relation, which rearranges the 3D MSD equation to solve for the diffusion coefficient D:

\[D = \lim_{t \to \infty} \frac{\langle |\vec{r}(t) - \vec{r}(0)|^2 \rangle}{6t}\]

This is a cornerstone equation in statistical mechanics. It provides a practical way to calculate a macroscopic property—the diffusion coefficient D—from the microscopic movements of individual particles observed in a computer simulation. 这是统计力学中的一个基石方程。它提供了一种实用的方法,可以通过计算机模拟中观察到的单个粒子的微观运动来计算宏观属性——扩散系数“D”。

In practice, one would:

  1. Run a simulation of particles. 运行粒子模拟。
  2. Track the position of each particle over time. 跟踪每个粒子随时间的位置。
  3. Calculate the squared displacement $ \vec{r}(t) - \vec{r}(0) ^2$ for each particle at various time intervals t. 计算每个粒子在不同时间间隔“t”的位移平方$ \vec{r}(t) - \vec{r}(0) ^2$。
  4. Average this value over all particles to get the MSD, $\langle \vec{r}(t) - \vec{r}(0) ^2 \rangle$. 对所有粒子取平均值,得到均方差(MSD),即$\langle \vec{r}(t) - \vec{r}(0) ^2 \rangle$。
  5. Plot the MSD as a function of time. 将MSD绘制成时间函数。
  6. The slope of this line, divided by 6, gives the diffusion coefficient D. The lim t→∞ indicates that this linear relationship is most accurate for long time scales, after initial transient effects have died down. 这条直线的斜率除以6,即扩散系数“D”。“lim t→∞”表明,在初始瞬态效应消退后,这种线性关系在长时间尺度上最为准确。

## 5. Right Board: Green-Kubo Relations

This board introduces a more advanced and powerful method to calculate transport coefficients like the diffusion coefficient, known as the Green-Kubo relations. 本面板介绍了一种更先进、更强大的方法来计算扩散系数等传输系数,即Green-Kubo 关系

### Velocity Autocorrelation Function (VACF) 速度自相关函数 (VACF)

The key idea is to look at how a particle’s velocity at one point in time is related to its velocity at a later time. This is measured by the Velocity Autocorrelation Function (VACF): \(C_{vv}(t) = \langle \vec{v}(t') \cdot \vec{v}(t' + t) \rangle\) This function tells us how long a particle “remembers” its velocity. For a typical liquid, the velocity is quickly randomized by collisions, so the VACF decays to zero rapidly. 其核心思想是考察粒子在某一时间点的速度与其在之后时间点的速度之间的关系。这可以通过速度自相关函数 (VACF)来测量: \(C_{vv}(t) = \langle \vec{v}(t') \cdot \vec{v}(t' + t) \rangle\) 此函数告诉我们粒子“记住”其速度的时间。对于典型的液体,速度会因碰撞而迅速随机化,因此 VACF 会迅速衰减为零。

### Connecting MSD and VACF

The board shows the mathematical link between the MSD and the VACF. Starting with the definition of position as the integral of velocity, $\vec{r}(t) = \int_0^t \vec{v}(t’) dt’$, one can show that the MSD is a double integral of the VACF. The board writes this as: \(\langle x^2(t) \rangle = \left\langle \left( \int_0^t v(t') dt' \right) \left( \int_0^t v(t'') dt'' \right) \right\rangle = \int_0^t dt' \int_0^t dt'' \langle v(t') v(t'') \rangle\) This shows that the two pictures of motion—the particle’s displacement (MSD) and its velocity fluctuations (VACF)—are deeply connected. 该面板展示了 MSD 和 VACF 之间的数学联系。从位置定义为速度的积分开始,$\vec{r}(t) = \int_0^t \vec{v}(t’) dt’$,可以证明 MSD 是 VACF 的二重积分。黑板上写着: \(\langle x^2(t) \rangle = \left\langle \left( \int_0^t v(t') dt' \right) \left( \int_0^t v(t'') dt'' \right) \right\rangle = \int_0^t dt' \int_0^t dt'' \langle v(t') v(t'') \rangle\) 这表明,粒子运动的两幅图像——粒子的位移(MSD)和速度涨落(VACF)——之间存在着深刻的联系。

### The Green-Kubo Formula for Diffusion 扩散的格林-久保公式

By combining the Einstein relation with the integral of the VACF, one arrives at the Green-Kubo formula for the diffusion coefficient: \(D = \frac{1}{3} \int_0^\infty \langle \vec{v}(0) \cdot \vec{v}(t) \rangle dt\) This incredible result states that the macroscopic property of diffusion ($D$) is determined by the integral of the microscopic velocity correlations. It’s often a more efficient way to compute $D$ in simulations than calculating the long-time limit of the MSD. 将爱因斯坦关系与VACF积分相结合,可以得到扩散系数的格林-久保公式: \(D = \frac{1}{3} \int_0^\infty \langle \vec{v}(0) \cdot \vec{v}(t) \rangle dt\) 这个令人难以置信的结果表明,扩散的宏观特性($D$)由微观速度关联的积分决定。在模拟中,这通常是计算$D$比计算MSD的长期极限更有效的方法。

## 6. The Grand Narrative: From Micro to Macro 宏大叙事:从微观到宏观

The previous whiteboards gave us two ways to calculate the diffusion constant, D, from the microscopic random walk of individual atoms: 之前的白板提供了两种从单个原子的微观随机游动计算扩散常数 D的方法:

  1. Einstein Relation: From the long-term slope of the Mean Squared Displacement (MSD). 根据均方位移 (MSD) 的长期斜率。
  2. Green-Kubo Relation: From the integral of the Velocity Autocorrelation Function (VACF). 根据速度自相关函数 (VACF) 的积分。

This new whiteboard shows how that single microscopic parameter, D, governs the large-scale, observable process of diffusion described by Fick’s Laws and the Diffusion Equation. 这块新的白板展示了单个微观参数 D 如何控制菲克定律扩散方程所描述的大规模可观测扩散过程。

## 1. The Starting Point: A Liquid’s Structure 起点:液体的结构

The plot on the top left is the Radial Distribution Function, $g(r)$, which we discussed in detail from the first whiteboard. 左上角的图是径向分布函数 $g(r)$,我们在第一个白板上详细讨论过它。

  • The Plot: It shows the characteristic structure of a liquid. The peaks are labeled “1st”, “2nd”, and “3rd”, corresponding to the first, second, and third solvation shells (layers of neighboring atoms). 它显示了液体的特征结构。峰分别标记为“第一”、“第二”和“第三”,分别对应于第一、第二和第三溶剂化壳层(相邻原子层)。
  • The Limit: The note lim r→∞ g(r) = 1 confirms that at large distances, the liquid has no long-range order, as expected.注释“lim r→∞ g(r) = 1”证实了在远距离下,液体没有长程有序,这与预期一致。
  • System Parameters: The values T = 0.71 and ρ = 0.844 are the temperature and density of the simulated system (likely in reduced or “Lennard-Jones” units) for which this $g(r)$ was calculated. 值“T = 0.71”和“ρ = 0.844”分别是模拟系统的温度和密度(可能采用约化或“Lennard-Jones”单位),用于计算此 $g(r)$。

This section sets the stage: we are looking at the dynamics within a system that has this specific liquid-like structure. 本节奠定了基础:我们将研究具有特定类液体结构的系统内的动力学。

## 2. The Macroscopic Laws of Diffusion 宏观扩散定律

The bottom-left and top-right sections introduce the continuum equations that describe how concentration changes in space and time. 左下角和右上角部分介绍了描述浓度随空间和时间变化的连续方程。左下角和右上角部分介绍了描述浓度随空间和时间变化的连续方程。

### Fick’s First Law 菲克第一定律

\(\vec{J} = -D \nabla C\) This is Fick’s first law of diffusion. It states that there is a flux of particles ($\vec{J}$), meaning a net flow. This flow is directed from high concentration to low concentration (hence the minus sign) and its magnitude is proportional to the concentration gradient ($\nabla C$). 这是菲克第一扩散定律。它指出存在粒子的通量 ($\vec{J}$),即净流量。该流量从高浓度流向低浓度(因此带有负号),其大小与浓度梯度 ($\nabla C$) 成正比。

The Crucial Link: The proportionality constant is D, the very same diffusion constant we calculated from the microscopic random walk (MSD/VACF). This is the key connection: the collective result of countless individual random walks is a predictable net flow of particles. 比例常数是D,与我们根据微观随机游走 (MSD/VACF) 计算出的扩散常数完全相同。这是关键的联系:无数个体随机游动的集合结果是可预测的粒子净流。

### The Diffusion Equation (Fick’s Second Law) 扩散方程(菲克第二定律)

\(\frac{\partial C(\vec{r},t)}{\partial t} = D \nabla^2 C(\vec{r},t)\) This is the diffusion equation, one of the most important equations in physics and chemistry (also called the heat equation, as noted). It’s derived from Fick’s first law and the principle of mass conservation ($\frac{\partial C}{\partial t} + \nabla \cdot \vec{J} = 0$). It’s a differential equation that tells you exactly how the concentration at any point, $C(\vec{r},t)$, will change over time. 这就是扩散方程,它是物理学和化学中最重要的方程之一(也称为热方程)。它源于菲克第一定律和质量守恒定律($\frac{\partial C}{\partial t} + \nabla \cdot \vec{J} = 0$)。它是一个微分方程,可以精确地告诉你任意一点的浓度 $C(\vec{r},t)$ 随时间的变化。

## 3. The Solution: Connecting Back to the Random Walk 与随机游动联系起来

This is the most beautiful part. The board shows the solution to the diffusion equation for a very specific scenario, linking the macroscopic equation directly back to the microscopic random walk. 黑板上展示了一个非常具体场景下扩散方程的解,将宏观方程直接与微观随机游动联系起来。

### The Initial Condition 初始条件

The problem is set up by assuming all particles start at a single point at time zero: \(C(\vec{r}, 0) = \delta(\vec{r})\) This is a Dirac delta function, representing an infinitely concentrated point source at the origin. 问题假设所有粒子在时间零点处从一个点开始: \(C(\vec{r}, 0) = \delta(\vec{r})\) 这是一个狄拉克函数,表示一个在原点处无限集中的点源。

### The Fundamental Solution (Green’s Function) 基本解(格林函数)

The solution to the diffusion equation with this starting condition is called the fundamental solution or Green’s function. For one dimension, it is: \(C(x,t) = \frac{1}{\sqrt{4\pi Dt}} \exp\left(-\frac{x^2}{4Dt}\right)\)

The “Aha!” Moment: This is a Gaussian distribution. Let’s compare it to the formula from the second whiteboard:

  • The mean is $\mu=0$. 均值为 $\mu=0$。
  • The variance is $\sigma^2 = 2Dt$. 方差为 $\sigma^2 = 2Dt$。

This is an incredible result. The macroscopic diffusion equation predicts that a concentration pulse will spread out over time, and the shape of the concentration profile will be a Gaussian curve. The width of this curve, measured by its variance $\sigma^2$, is exactly the Mean Squared Displacement, $\langle x^2(t) \rangle$, of the individual random-walking particles. 宏观扩散方程预测浓度脉冲会随时间扩散,浓度分布的形状将是高斯曲线。这条曲线的宽度,用其方差 $\sigma^2$ 来衡量,恰好是单个随机游动粒子的均方位移 $\langle x^2(t) \rangle$。

This perfectly unites the two perspectives:

  • Microscopic微观 (Board 2): Particles undergo a random walk, and their average squared displacement from the origin grows as $\langle x^2(t) \rangle = 2Dt$. 粒子进行随机游动,它们相对于原点的平均平方位移随着 $\langle x^2(t) \rangle = 2Dt$ 的增长而增长。
  • Macroscopic宏观 (This Board): A collection of these particles, described by a continuum concentration C, spreads out in a Gaussian profile whose variance is $\sigma^2 = 2Dt$. 这些粒子的集合,用连续浓度“C”来描述,呈方差为 $\sigma^2 = 2Dt$ 的高斯分布。

The two pictures are mathematically identical.