aiida-dftbplus

v0.1.0 • Maintained by Quantum ARISE / ShellRuner

Overview

aiida-dftbplus is an AiiDA plugin that integrates DFTB+ calculations into the AiiDA provenance-tracking pipeline. It handles writing input files (dftb_in.hsd), submitting calculations, retrieving outputs, and converting results into queryable database properties.

Installation & Setup

Install via pip:

pip install aiida-dftbplus

Configure your AiiDA profile and register the executable code:

verdi quicksetup # If you do not have a profile set up yet
 
# Register DFTB+ on localhost
verdi code create core.code.installed \ --label dftb+ --computer localhost \ --default-calc-job-plugin dftbplus \ --filepath-executable $(which dftb+)

Usage Example

Define inputs in Python using nested dictionaries for full database queryability:

from aiida import engine, orm
from aiida.plugins import CalculationFactory, DataFactory

DftbParameters = DataFactory("dftbplus")

parameters = DftbParameters({
    "Geometry": {"GenFormat": {"_raw": open("geometry.gen").read()}},
    "Hamiltonian": {"DFTB": {
        "SCC": True,
        "MaxSCCIterations": 100,
        "SCCTolerance": 1e-5,
        "_raw_1": 'SlaterKosterFiles = Type2FileNames {\n'
                  '  Prefix = "/opt/skf/mio-1-1/"\n'
                  '  Separator = "-"\n  Suffix = ".skf"\n}',
    }},
    "Analysis": {"CalculateForces": True},
})

engine.submit(CalculationFactory("dftbplus"), code=code, parameters=parameters)

Slater-Koster Parameter Sets

Retrieving SKF files can affect performance. This plugin offers two strategies:

  • Remote Path (use_remote_skf_path=True): Keep Slater-Koster files on the local machine and avoid copying them for every calculation. Recommended for speed when dealing with large parameter sets.
  • FolderData Shipping (skf_files): Ship only the active element pair combinations along with the job, minimizing overhead.

Result Parameters

The output node carries parsed parameters as attributes:

Scalars

• total_energy_H / eV
• fermi_energy_eV
• scc_converged (bool)
• n_scc_iterations
• forces_eV_Ang
• max_force_eV_Ang

Calculation Exit Codes

• 300: Output missing
• 310: DFTB+ core runtime error
• 320: Self-Consistent Charge (SCC) not converged
• 330: Geometry structure not converged