Skip to main content

CI/CD Status Coverage Status Docs status PyPI version

aiida-dftbplus

Run DFTB+ from AiiDA: the plugin writes dftb_in.hsd, submits the job, brings every output file back and stores the input parameters as queryable database attributes.

One calculation in, one calculation out — no workflows, no error recovery.

Install

pip install aiida-dftbplus
verdi quicksetup          # if you do not have a profile yet

DFTB+ itself comes separately (e.g. conda install -c conda-forge dftbplus). Register it once:

verdi code create core.code.installed \
    --label dftb+ --computer localhost \
    --default-calc-job-plugin dftbplus \
    --filepath-executable $(which dftb+)

Run something

verdi daemon start
cd examples
./example_01.py --code dftb+@localhost --skf-dir /path/to/skf/

Describe the input

Write the HSD as a nested dictionary — every setting stays queryable:

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)

Anything the dictionary form does not cover goes through verbatim under a _raw* key, so nothing in DFTB+ is out of reach. Dictionaries are validated before submission — print(DftbParameters.schema.schema) lists the blocks.

Already have a file? Hand it over instead:

inputs["dftb_input"] = DataFactory("core.singlefile")(file="dftb_in.hsd")

Exactly one of parameters or dftb_input is required.

Slater-Koster files

Two options, and the choice matters for speed:

  • use_remote_skf_path=True — the files already sit on the machine, keep the absolute path in the HSD and upload nothing. Best for a full parameter set.

  • skf_files (a FolderData) — ship the files with the job, but only the pairs the run reads. A full set is copied into every working directory and turns a one-second job into a several-minute one; a two-element material needs four files:

    skf_files = orm.FolderData()
    for name in (f"{a}-{b}.skf" for a in ["O", "S"] for b in ["O", "S"]):
        skf_files.put_object_from_file(str(skf_dir / name), name)
    

Get the results

verdi process list -a
verdi calcjob res <PK>        # parsed scalars: energies, Fermi level, forces
verdi calcjob outputls <PK>   # every retrieved file
verdi process report <PK>     # why it failed, if it did

output_parameters carries total_energy_H, total_energy_eV, fermi_energy_eV, scc_converged, n_scc_iterations, forces_eV_Ang and max_force_eV_Ang. Failures come back as exit codes: 300 output missing, 310 DFTB+ error, 320 SCC not converged, 330 geometry not converged.

Inspect the stored input nodes with the bundled verdi commands:

verdi data dftbplus list
verdi data dftbplus hsd <PK>    # render the node as the dftb_in.hsd it produces

Documentation

Full documentation — getting started, tutorials, how-to guides, architecture and API reference — at aiida-dftbplus.readthedocs.io.

Start here:

Build it locally with pip install -e . --group docs && make -C docs.

License

MIT — see LICENSE.

Contact

sitouamu510@gmail.com

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiida_dftbplus-0.1.1.tar.gz (195.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiida_dftbplus-0.1.1-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

Details for the file aiida_dftbplus-0.1.1.tar.gz.

File metadata

  • Download URL: aiida_dftbplus-0.1.1.tar.gz
  • Upload date:
  • Size: 195.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for aiida_dftbplus-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f4da2ff4c4a883d9fe455f7cb5063f5ed576ff77c0b88c30398525fde20bdf2c
MD5 1cbfe83e2e2a6413ccb9462d6643855d
BLAKE2b-256 3d99c425999f1eab67f9f7e00311727fe25bfc6553fb0d732b7eb3f0bb764f4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiida_dftbplus-0.1.1.tar.gz:

Publisher: release.yml on Quantum-ARISE-Acad/aiida-dftbplus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiida_dftbplus-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: aiida_dftbplus-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 23.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for aiida_dftbplus-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ecb3875c3f6361e8da81c6ae7fe202193473fc7b8eaf215aa58bf30d8bfabc48
MD5 8ea9965d8ad29dcb27854fa1c1037a29
BLAKE2b-256 7683639f9c29f99d4676a62d6ac93328cf6ec86e51e51fb91a5da17d7eb4c745

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiida_dftbplus-0.1.1-py3-none-any.whl:

Publisher: release.yml on Quantum-ARISE-Acad/aiida-dftbplus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page