原子模拟环境
ase的Python项目详细描述
ASE是一组工具和Python模块,用于设置、操作, 运行、可视化和分析原子模拟。
网页:http://wiki.fysik.dtu.dk/ase
安装
将~/ase添加到$pythonpath环境变量并添加 ~/ase/bin到$path(假设~/ase是ASE文件夹所在的位置)。
测试
请运行测试:
$ ase test # takes 1 min.
如果测试失败,请将输出发送给我们。
示例
用nwchem优化氢分子的几何结构
>>> from ase import Atoms >>> from ase.optimize import BFGS >>> from ase.calculators.nwchem import NWChem >>> from ase.io import write >>> h2 = Atoms('H2', positions=[[0, 0, 0], [0, 0, 0.7]]) >>> h2.calc = NWChem(xc='PBE') >>> opt = BFGS(h2, trajectory='h2.traj') >>> opt.run(fmax=0.02) BFGS: 0 19:10:49 -31.435229 2.2691 BFGS: 1 19:10:50 -31.490773 0.3740 BFGS: 2 19:10:50 -31.492791 0.0630 BFGS: 3 19:10:51 -31.492848 0.0023 >>> write('H2.xyz', h2) >>> h2.get_potential_energy() # ASE's units are eV and Ang -31.492847800329216
此示例要求安装nwchem。
$ ase gui h2.traj