Atom & Atoms
Atom,Atoms
在目标研究的程序中,主要使用了这两个库
ase库中的Atom和Atoms是用于处理分子和结构的重要工具。Atom对象用于表示单个原子,它包含原子的元素类型、位置、速度等信息。Atoms对象是一个用于存储和操纵多个Atom对象的容器,它可以用来表示分子、晶体、表面等多种结构。除了原子的信息,Atoms对象还可以存储诸如晶格参数、原子间距、键长等结构信息。
Atom类
类Atom非常简单,基本只包含原子的非常基础的信息
初始化
1  | ***class* ase.atom.Atom(*symbol='X'*, *position=(0, 0, 0)*, *tag=None*, *momentum=None*,  | 
- symbol:分子式,可以使用化学符号’Si’或者相应的原子序号14来表示
 - position:三维坐标,单位为Å
 - tag:特殊用途标签
 - momentum:三位动量坐标
 - mass:质量
 - magmom:磁矩
 - charge:电荷
 
从Atoms读取
1  | from ase.build import molecule  | 
Atomes类
初始化
Atomes的初始化与Atom类似,具体见例子:
1  | from ase import Atoms  | 

- pbc指定的沿x轴的周期性重复
 - cell:单一晶胞尺寸,它可以是正交晶胞的三个数字的序列,或者一般晶胞的3*3数字(三个数字的三个序列的序列)或六个数字(三个长度和三个角度)
 - pcb:周期性边界条件,将给出沿所有三个轴的周期性边界条件。可以给出三个布尔值的序列来指定沿特定轴的周期性
 
封装方法-同时作为atom的补充
这些方法基本都由get/set_属性名称组成
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_atomic_numbers | https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.set_atomic_numbers | 
|---|---|
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_initial_charges | https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.set_initial_charges | 
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_charges | |
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_chemical_symbols | https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.set_chemical_symbols | 
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_initial_magnetic_moments | https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.set_initial_magnetic_moments | 
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_magnetic_moments | |
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_masses | https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.set_masses | 
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_momenta | https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.set_momenta | 
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_forces | |
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_positions | https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.set_positions | 
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_potential_energies | |
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_scaled_positions | https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.set_scaled_positions | 
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_stresses | |
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_tags | https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.set_tags | 
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_velocities | https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.set_velocities | 
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_calculator | https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.set_calculator | 
|---|---|
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_cell | https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.set_cell | 
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_cell_lengths_and_angles | |
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_center_of_mass | |
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_kinetic_energy | |
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_magnetic_moment | |
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_global_number_of_atoms | |
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_pbc | https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.set_pbc | 
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_potential_energy | |
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_stress | |
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_total_energy | |
| https://wiki.fysik.dtu.dk/ase/ase/atoms.html#ase.Atoms.get_volume | 
Cell操作
Cell类类似于一个3*3的矩阵,以以下方式查看
1
2
3
4
5
6atoms.cell
Cell([0.0, 0.0, 0.0], pbc=False)
atoms.cell[:]
array([[0., 0., 0.],
[0., 0., 0.],
[0., 0., 0.]])可以使用set_cell设置单位晶胞大小:
1
2
3atoms.set_cell(2 * np.identity(3))
>>>atoms.get_cell()
Cell([2.0, 2.0, 2.0], pbc=False)在set_cell时加入
scale_atoms=True可来使原子坐标跟随晶胞尺寸改变
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Raphael's Home!






