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.2.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.2-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiida_dftbplus-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 ad20fbb13c3783c6136af2b31416459139e9fce35002adda9377d944353e50ea
MD5 277664af34b02b5005f57e6fe8692959
BLAKE2b-256 c223a2f8beaaef817f2b443a93d7f419fd687d227135190cb14878f03c05773b

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiida_dftbplus-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: aiida_dftbplus-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3a67c98fa53f421de10387d135b1142a7e709ca921a8a287fd74550bdd6f7772
MD5 c7e486696ac04feb5e5d557a9da968f9
BLAKE2b-256 3eecbc703dc368d8caa808b725cfd5bc41419e63b0f078c1696852c23f65df8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiida_dftbplus-0.1.2-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

This release

0.1.2 This release

2 files

0.1.1

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