势函数模块 (potentials)
本模块提供各种原子间相互作用势函数。
基类
ThermoElasticSim - 势能基类模块
- class thermoelasticsim.potentials.base.Potential(parameters, cutoff)[源代码]
基类:
ABC
势能计算的抽象基类,定义了所有势能模型必须遵循的接口。
- Args:
parameters (dict): 势能相关的参数字典。 cutoff (float): 势能的截断距离,单位为 Å。
Methods
calculate_energy
(cell, neighbor_list)计算系统的总势能。
calculate_forces
(cell, neighbor_list)计算系统中所有原子的作用力。
- abstractmethod calculate_forces(cell, neighbor_list)[源代码]
计算系统中所有原子的作用力。
这是一个抽象方法,必须由子类实现。
- Args:
cell (Cell): 包含原子位置和速度等信息的晶胞对象。 neighbor_list (NeighborList): 用于加速计算的邻居列表对象。
- 参数:
cell (Cell)
neighbor_list (NeighborList)
- 返回类型:
None
- abstractmethod calculate_energy(cell, neighbor_list)[源代码]
计算系统的总势能。
这是一个抽象方法,必须由子类实现。
- Args:
cell (Cell): 包含原子位置和速度等信息的晶胞对象。 neighbor_list (NeighborList): 用于加速计算的邻居列表对象。
- 返回:
float
- 返回类型:
系统的总势能,单位为 eV。
- 参数:
cell (Cell)
neighbor_list (NeighborList)
EAM势
ThermoElasticSim - EAM 势模块
该模块实现了嵌入式原子方法 (Embedded Atom Method, EAM) 势, 特别是基于 Mendelev et al. (2008) 参数化的铝 (Al) 势。
EAM势将系统的总能量表示为对势项和嵌入能的总和。每个原子的嵌入能 取决于其所处位置的局部电子密度,而局部电子密度则由周围原子贡献的电子密度叠加而成。
总能量表达式为:
其中,\(F(\rho_i)\) 是嵌入能函数,\(\rho_i\) 是原子 \(i\) 处的局部电子密度, \(\\phi(r_{ij})\) 是原子 \(i\) 和 \(j\) 之间的对势函数。
局部电子密度 \(\rho_i\) 由以下公式计算:
其中,\(\\psi(r_{ij})\) 是原子 \(j\) 在原子 \(i\) 处产生的电子密度贡献函数。
作用在原子 \(i\) 上的力 \(\\mathbf{F}_i\) 由总能量对原子位置的负梯度给出:
- 参考文献:
Mendelev, M. I., Srolovitz, D. J., Ackland, G. J., & Asta, M. (2008). Development of new interatomic potentials for the Al-Mg system. Journal of Materials Research, 23(10), 2707-2721.
- Classes:
EAMAl1Potential: 铝的EAM势能实现。 EAMCu1Potential: 铜的EAM势能实现。
- class thermoelasticsim.potentials.eam.EAMAl1Potential(cutoff=6.5)[源代码]
基类:
Potential
铝的嵌入式原子方法 (EAM) 势的实现。
基于 Mendelev et al. (2008) 的参数化。
- Args:
cutoff (float, optional): 截断距离,单位为 Å。默认为 6.5。
Methods
calculate_energy
(cell[, neighbor_list])使用EAM势计算系统的总势能。
calculate_forces
(cell[, neighbor_list])使用EAM势计算系统中所有原子的作用力。
- 参数:
cutoff (float)
- calculate_forces(cell, neighbor_list=None)[源代码]
使用EAM势计算系统中所有原子的作用力。
- Args:
cell (Cell): 包含原子信息的晶胞对象。 neighbor_list (NeighborList, optional): 在此实现中未使用,但为保持接口一致性而保留。
- 参数:
cell (Cell)
neighbor_list (NeighborList)
- 返回类型:
None
- calculate_energy(cell, neighbor_list=None)[源代码]
使用EAM势计算系统的总势能。
- Args:
cell (Cell): 包含原子信息的晶胞对象。 neighbor_list (NeighborList, optional): 在此实现中未使用,但为保持接口一致性而保留。
- 返回:
float
- 返回类型:
系统的总势能,单位为 eV。
- 参数:
cell (Cell)
neighbor_list (NeighborList)
- class thermoelasticsim.potentials.eam.EAMCu1Potential(cutoff=6.0)[源代码]
基类:
Potential
铜的嵌入式原子方法 (EAM) 势的实现。
基于 Mendelev et al. (2008) 的参数化。
- Args:
cutoff (float, optional): 截断距离,单位为 Å。默认为 6.0。
Methods
calculate_energy
(cell[, neighbor_list])使用EAM Cu1势计算系统的总势能。
calculate_forces
(cell[, neighbor_list])使用EAM Cu1势计算系统中所有原子的作用力。
- 参数:
cutoff (float)
- calculate_forces(cell, neighbor_list=None)[源代码]
使用EAM Cu1势计算系统中所有原子的作用力。
- Args:
cell (Cell): 包含原子信息的晶胞对象。 neighbor_list (NeighborList, optional): 在此实现中未使用,但为保持接口一致性而保留。
- 参数:
cell (Cell)
neighbor_list (NeighborList)
- 返回类型:
None
- calculate_energy(cell, neighbor_list=None)[源代码]
使用EAM Cu1势计算系统的总势能。
- Args:
cell (Cell): 包含原子信息的晶胞对象。 neighbor_list (NeighborList, optional): 在此实现中未使用,但为保持接口一致性而保留。
- 返回:
float
- 返回类型:
系统的总势能,单位为 eV。
- 参数:
cell (Cell)
neighbor_list (NeighborList)
Lennard-Jones势
ThermoElasticSim - Lennard-Jones 势模块
- class thermoelasticsim.potentials.lennard_jones.LennardJonesPotential(epsilon, sigma, cutoff)[源代码]
基类:
Potential
Lennard-Jones (LJ) 对势的实现。
LJ势常用于模拟惰性气体原子间的相互作用。
- Args:
epsilon (float): 势阱深度,单位为 eV。 sigma (float): 零势能点对应的原子间距,单位为 Å。 cutoff (float): 截断距离,单位为 Å。
Methods
calculate_energy
(cell, neighbor_list)使用LJ势计算系统的总势能。
calculate_forces
(cell, neighbor_list)使用LJ势计算系统中所有原子的作用力。
- calculate_forces(cell, neighbor_list)[源代码]
使用LJ势计算系统中所有原子的作用力。
- Args:
cell (Cell): 包含原子信息的晶胞对象。 neighbor_list (NeighborList): 预先构建的邻居列表。
- 参数:
cell (Cell)
neighbor_list (NeighborList)
- 返回类型:
None
- calculate_energy(cell, neighbor_list)[源代码]
使用LJ势计算系统的总势能。
- Args:
cell (Cell): 包含原子信息的晶胞对象。 neighbor_list (NeighborList): 预先构建的邻居列表。
- 返回:
float
- 返回类型:
系统的总势能,单位为 eV。
- 参数:
cell (Cell)
neighbor_list (NeighborList)
Tersoff势
ThermoElasticSim - Tersoff 势模块
- class thermoelasticsim.potentials.tersoff.TersoffPotential(parameters, cutoff)[源代码]
基类:
Potential
Tersoff 多体势的框架。
这是一个占位符,用于未来实现 Tersoff 势,常用于模拟共价键材料如硅和碳。
- Args:
parameters (dict): Tersoff 势的参数。 cutoff (float): 截断距离。
Methods
calculate_energy
(cell, neighbor_list)计算Tersoff势下的能量(尚未实现)。
calculate_forces
(cell, neighbor_list)计算Tersoff势下的力(尚未实现)。
- calculate_forces(cell, neighbor_list)[源代码]
计算Tersoff势下的力(尚未实现)。
- 参数:
cell (Cell)
neighbor_list (NeighborList)
- 返回类型:
None
- calculate_energy(cell, neighbor_list)[源代码]
计算Tersoff势下的能量(尚未实现)。
- 参数:
cell (Cell)
neighbor_list (NeighborList)
- 返回类型:
机器学习势(开发中)
ThermoElasticSim - 机器学习势接口模块
- class thermoelasticsim.potentials.mlp.MLPotential(model_path, cutoff)[源代码]
基类:
Potential
机器学习势 (MLP) 的通用接口框架。
这是一个占位符,旨在为集成各种外部机器学习模型(如PyTorch, TensorFlow, JAX) 或KIM(知识库的原子间模型)提供一个统一的接口。
- Args:
model_path (str): 预训练模型的路径。 cutoff (float): 截断距离。
Methods
calculate_energy
(cell, neighbor_list)使用ML势计算能量(尚未实现)。
calculate_forces
(cell, neighbor_list)使用ML势计算力(尚未实现)。
- calculate_forces(cell, neighbor_list)[源代码]
使用ML势计算力(尚未实现)。
- 参数:
cell (Cell)
neighbor_list (NeighborList)
- 返回类型:
None
- calculate_energy(cell, neighbor_list)[源代码]
使用ML势计算能量(尚未实现)。
- 参数:
cell (Cell)
neighbor_list (NeighborList)
- 返回类型: