跳转到主要内容

AiiDA的官方ASE插件。

项目描述

aiida-ase

AiiDA插件用于ASE

安装

  1. 从PyPI安装
pip install aiida-ase
  1. 从此存储库(用于开发)
git clone https://github.com/aiidateam/aiida-ase
pip install -e aiida-ase

用法

此插件的主要目标是围绕ASE进行包装。

为了使其易于设置计算,请按照以下方式生成一个builder

AseCalculation = CalculationFactory('ase.ase')
builder = AseCalculation.get_builder()

需要指定的builder的主要参数如下

  1. 代码
from aiida.orm import load_code
code = load_code('your-code-here@your-computer-here')
builder.code = code

注意:如果使用GPAW,有两种设置计算器的方式:a. 指定带有特定模块加载的Python可执行文件;b. 直接指定GPAW可执行文件。在这种情况下,需要CMDLINE参数(见下文)。

  1. 结构
builder.structure = structure
  1. k点数据
kpoints = KpointsData()
kpoints.set_kpoints_mesh([2,2,2])  # choose the right mesh here
builder.kpoints = kpoints
  1. 参数

这里展示了GPAW的示例参数集的一部分。有关其他功能的具体示例,请参阅examples文件夹(将不断更新)。

使用GPAW定义一个PW计算的计算器。这里计算器的name设置为GPAW,args是传递给ASE中使用的计算器的参数的等效。请注意,@function功能允许向计算器中的函数传递参数。在此示例中,等效的ASE命令是PW(300)。可以添加其他参数,例如convergenceoccupations

calculator = {
    'name': 'gpaw',
    'args': {
    'mode': {
        '@function': 'PW',
        'args': {'ecut': 300}
    },
    'convergence': {
        'energy': 1e-9
    },
    'occupations': {
        'name': 'fermi-dirac',
        'width':0.05
    }
}

在此处添加标签,它们将被写入为atoms.get_xyz(),例如,第一个项将是atoms.get_temperature()

atoms_getters = [
    'temperature',
    ['forces', {'apply_constraint': True}],
    ['masses', {}],
]

一些附加实用函数包括

  1. pre_lines:添加到Python文件开头的行列表
  2. post_lines:添加到Python文件结尾的行列表
  3. extra_imports:以分隔字符串的额外导入列表,例如["numpy", "array"]将导致from numpy import array

关于选择代码的说明

  1. 如果使用GPAW,可以使用/path/to/execut/gpaw python run_gpaw.py运行并行计算。通过在AiiDA中添加gpaw可执行文件来设置代码。然后,使用命令行选项添加python标签。
settings = {'CMDLINE': ['python']}
builder.settings = orm.Dict(settings)
  1. 如果您感兴趣的代码存在于此插件注册表中,可能更合理地使用它。https://aiidateam.github.io/aiida-registry/

文档

该软件包的文档可以在Read the Docs上找到,网址为http://aiida-ase.readthedocs.io/en/latest/

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分布

aiida_ase-3.0.0.tar.gz (15.5 kB 查看哈希)

上传时间

构建分布

aiida_ase-3.0.0-py3-none-any.whl (15.2 kB 查看哈希)

上传时间 Python 3

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面