{"id":18990498,"url":"https://github.com/dftd3/simple-dftd3","last_synced_at":"2026-01-25T07:36:26.944Z","repository":{"id":38114837,"uuid":"220631589","full_name":"dftd3/simple-dftd3","owner":"dftd3","description":"Library first implementation of the D3 dispersion correction","archived":false,"fork":false,"pushed_at":"2025-08-25T10:01:17.000Z","size":1766,"stargazers_count":76,"open_issues_count":20,"forks_count":33,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-10T19:08:42.601Z","etag":null,"topics":["ase","computational-chemistry","dispersion-correction","pyscf","qcschema","quantum-chemistry"],"latest_commit_sha":null,"homepage":"https://dftd3.readthedocs.io","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dftd3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-11-09T11:21:43.000Z","updated_at":"2025-12-18T13:40:35.000Z","dependencies_parsed_at":"2024-06-25T12:32:49.592Z","dependency_job_id":"636b9cfd-03ea-4d18-a5c8-447ac4df4837","html_url":"https://github.com/dftd3/simple-dftd3","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/dftd3/simple-dftd3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dftd3%2Fsimple-dftd3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dftd3%2Fsimple-dftd3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dftd3%2Fsimple-dftd3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dftd3%2Fsimple-dftd3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dftd3","download_url":"https://codeload.github.com/dftd3/simple-dftd3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dftd3%2Fsimple-dftd3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28747678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T05:12:38.112Z","status":"ssl_error","status_checked_at":"2026-01-25T05:04:50.338Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ase","computational-chemistry","dispersion-correction","pyscf","qcschema","quantum-chemistry"],"created_at":"2024-11-08T17:10:01.496Z","updated_at":"2026-01-25T07:36:26.927Z","avatar_url":"https://github.com/dftd3.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The D3 dispersion model\n\n[![Latest Version](https://img.shields.io/github/v/release/dftd3/simple-dftd3)](https://github.com/dftd3/simple-dftd3/releases/latest)\n[![LGPL-3.0-or-later](https://img.shields.io/github/license/dftd3/simple-dftd3)](COPYING)\n[![JOSS](https://joss.theoj.org/papers/1a0f4b4571b8a362d596bd5759572d7f/status.svg)](https://joss.theoj.org/papers/1a0f4b4571b8a362d596bd5759572d7f)\n[![CI](https://github.com/dftd3/simple-dftd3/workflows/CI/badge.svg)](https://github.com/dftd3/simple-dftd3/actions)\n[![Documentation](https://readthedocs.org/projects/dftd3/badge/?version=latest)](https://dftd3.readthedocs.io/en/latest/)\n[![docs](https://github.com/dftd3/simple-dftd3/actions/workflows/docs.yml/badge.svg)](https://dftd3.github.io/simple-dftd3/)\n[![codecov](https://codecov.io/gh/dftd3/simple-dftd3/branch/main/graph/badge.svg)](https://codecov.io/gh/dftd3/simple-dftd3)\n\nThis package provides a library first implementation of the DFT-D3 dispersion correction\n(see [*JCP* **132**, 154104 (2010)](https://dx.doi.org/10.1063/1.3382344)\nand [*JCC* **32**, 1456 (2011)](https://dx.doi.org/10.1002/jcc.21759) for details).\nUsable via the command line interface of the [`s-dftd3` executable](man/s-dftd3.1.adoc),\nin Fortran via the [`dftd3` module](https://dftd3.readthedocs.io/en/latest/api/fortran.html),\nwith the C interface by including the [`dftd3.h` header](https://dftd3.readthedocs.io/en/latest/api/c.html),\nor in Python by using the [`dftd3` module](https://dftd3.readthedocs.io/en/latest/api/python.html).\nAdditionally, the geometric counter-poise correction (see [*JCP* **136**, 154101 (2012)](https://dx.doi.org/10.1063/1.3700154))\nis available to correct for basis set superposition errors and construct composite electronic structure methods of the 3c family.\n\n\n## Installation\n\nA full guide for installing this package or building from source can be found in the\n[installation guide](https://dftd3.readthedocs.io/en/latest/installation.html).\n\n### Conda package\n\n[![Conda Version](https://img.shields.io/conda/vn/conda-forge/simple-dftd3.svg?label=simple-dftd3)](https://anaconda.org/conda-forge/simple-dftd3)\n[![Conda Version](https://img.shields.io/conda/vn/conda-forge/dftd3-python.svg?label=dftd3-python)](https://anaconda.org/conda-forge/dftd3-python)\n\nThe preferred way of installing this package is from the *conda-forge* distribution via the *mamba* package manager.\nTo install the *mamba* package manager the [miniforge](https://github.com/conda-forge/miniforge/releases) installer can be used.\nIf you already have the *mamba* package manager installed add the *conda-forge* channel if it is not yet enabled:\n\n```\nmamba config --add channels conda-forge\n```\n\nOnce the *conda-forge* channel has been enabled, this project can be installed with:\n\n```\nmamba install simple-dftd3\n```\n\nIf you want to enable the Python API as well install\n\n```\nmamba install dftd3-python\n```\n\nNow you are ready to use ``s-dftd3``.\n\n\n### Building from Source\n\nTo build this project from the source code in this repository you need a Fortran compiler supporting\nat least the Fortran 2008 standard.\nIf a C compiler is available the C interface tests will be build with this compiler.\nFor building the Python bindings a C compiler is required to build the Python extension module.\n\nFor building from source the\n\n- [meson](https://mesonbuild.com) version 0.58 or newer, with\n  a build-system backend, *i.e.* [ninja](https://ninja-build.org) version 1.7 or newer\n- [asciidoctor](https://asciidoctor.org/) to build the manual page (optional)\n- [FORD](https://forddocs.readthedocs.io/en/stable/) to build the developer documentation (optional)\n- Python 3.7 or newer with the [CFFI](https://cffi.readthedocs.io/en/latest/), [NumPy](https://numpy.org/) and [setuptools](https://setuptools.pypa.io/en/latest/index.html) package installed to build the Python API\n\nThis project builds on many existing Fortran packages, the following ones are used as dependencies\n\n- [mctc-lib](https://github.com/grimme-lab/mctc-lib):\n  For reading geometry files in a wide range of formats\n  (like xyz, PBD, mol, SDF, Turbomole, DFTB+, Vasp, FHI-aims, Gaussian, QChem, QCSchema JSON, Chemical JSON)\n- [toml-f](https://toml-f.readthedocs.org)\n  For reading the parameter file with all damping parameters\n  (see [`assets/`](assets/parameters.toml))\n- [mstore](https://github.com/grimme-lab/mstore)\n  For molecule fixtures to use when defining unit tests\n  (testing only)\n- [test-drive](https://github.com/fortran-lang/test-drive)\n  Unit testing framework\n  (testing only)\n\nIf these Fortran packages are not available, the build system will automatically fetch them and build\nthem as part of this project.\n\nTo setup a build use\n\n```\nmeson setup _build --prefix=/path/to/install\n```\n\nYou can select the Fortran compiler by the `FC` environment variable, similarly the C compiler is selected from the `CC` environment variable.\nTo compile and run the projects testsuite use\n\n```\nmeson test -C _build --print-errorlogs\n```\n\nIf the testsuite passes you can install with\n\n```\nmeson install -C _build\n```\n\nThis might require administrator access depending on the chosen install prefix.\n\nMeson is the primary build system and provides feature-complete functionality of this project.\nIf you for any reason cannot use meson, this project also supports CMake and fpm as build systems.\nFor more details checkout the [installation guide](https://dftd3.readthedocs.io/en/latest/installation.html#building-from-source).\n\n\n## Generating docs\n\nThe documentation is generated using [sphinx](https://www.sphinx-doc.org) for the general documentation and the Python API,\n[FORD](https://forddocs.readthedocs.io) for the Fortran API documentation,\nand [asciidoctor](https://asciidoctor.org/) for the command line interface manpage.\n\n\n### Documentation pages (Sphinx)\n\n[![Documentation](https://readthedocs.org/projects/dftd3/badge/?version=latest)](https://dftd3.readthedocs.io/en/latest/)\n\nFor generating the main documentation pages, install the documentation dependencies with\n\n```\npip install -r doc/requirements.txt\n```\n\nThe pages can be built with\n\n```\nsphinx-build doc _docs -b html\n```\n\nTo view the final pages you can start a HTTP server via\n\n```\npython -m http.server -d _docs\n```\n\nAnd open the shown URL in a browser (usually this is https://localhost:8000).\nThe documentation is automatically deployed from the main branch and can be viewed on [readthedocs](https://dftd3.readthedocs.io/).\n\n\n### API documentation (Ford)\n\n[![docs](https://github.com/dftd3/simple-dftd3/actions/workflows/docs.yml/badge.svg)](https://dftd3.github.io/simple-dftd3/)\n\nTo generate the API documentation of the Fortran library install ford via\n\n```\nmamba install ford\n```\n\nThe API documentation can be generated with\n\n```\nford docs.md -o _api\n```\n\nTo view the final pages you can start a HTTP server via\n\n```\npython -m http.server -d _docs\n```\n\nAnd open the shown URL in a browser.\nThe API documentation is automatically deployed from the main branch and can be viewed on [GitHub pages](https://dftd3.github.io/simple-dftd3).\n\n\n## Usage\n\nDFT-D3 calculations can be performed with the ``s-dftd3`` executable.\nTo calculate the dispersion correction for PBE0-D3(BJ)-ATM run:\n\n```\ns-dftd3 --bj pbe0 --atm coord\n```\n\nIn case you want to access the DFT-D3 results from other programs, dump the results to JSON with\n(the ``--noedisp`` flag prevents the ``.EDISP`` file generation):\n\n```\ns-dftd3 --bj pbe0 --atm --json --grad --noedisp struct.xyz\n```\n\nDispersion related properties can be calculated as well:\n\n```\ns-dftd3 --property geo.gen\n```\n\nFor an overview over all command line arguments use the ``--help`` argument or checkout the [``s-dftd3(1)``](man/s-dftd3.1.adoc) manpage.\n\n\n## API access\n\nThis DFT-D3 implementation provides first class API support Fortran, C and Python.\nOther programming languages should try to interface via one of those three APIs.\nTo provide first class API support for a new language the interface specification should be available as meson build files.\n\n\n### Fortran API\n\nThe recommended way to access the Fortran module API is by using ``dftd3`` as a meson subproject.\nAlternatively, the project is accessible by the Fortran package manager ([fpm](https://github.com/fortran-lang/fpm)) or as CMake subproject as explained above.\n\nThe complete API is available from ``dftd3`` module, the individual modules are available to the user as well but are not part of the public API and therefore not guaranteed to remain stable.\nAPI compatibility is only guaranteed for the same minor version, while ABI compatibility cannot be guaranteed in a pre 1.0 stage.\n\nThe communication with the Fortran API uses the ``error_type`` and ``structure_type`` of the modular computation tool chain library (mctc-lib) to handle errors and represent geometries, respectively.\n\n\n### C API\n\nThe C API provides access to the basic Fortran objects and their most important methods to interact with them.\nAll Fortran objects are available as opaque ``void*`` in C and can only be manipulated with the correct API calls.\nTo evaluate a dispersion correction in C four objects are available:\n\n1. the error handler:\n\n   Simple error handler to carry runtime exceptions created by the library.\n   Exceptions can be handled and/or transfered to the downstream error handling system by this means.\n\n2. the molecular structure data:\n\n   Provides a representation of the molecular structure with immutable number of atoms, atomic species, total charge and boundary conditions.\n   The object provides a way to update coordinates and lattice parameters, to update immutable quantities the object has to be recreated.\n\n3. the dispersion model:\n\n   Instantiated for a given molecular structure type, it carries no information on the geometry but relies on the atomic species of the structure object.\n   Recreating a structure object requires to recreate the dispersion model as well.\n\n4. the damping parameters:\n\n   Damping parameter object determining the short-range behaviour of the dispersion correction.\n   Standard damping parameters like the rational damping are independent of the molecular structure and can easily be reused for several structures or easily exchanged.\n\n5. the counter-poise parameters:\n\n   Counter-poise parameter object determining the basis set specific correction for basis set superposition error.\n   Recreating a structure object requires to recreate the counter-poise parameters as well as they are dependent on the basis definition for each element type.\n\nThe user is responsible for creating and deleting the objects to avoid memory leaks.\n\n\n### Python API\n\nThe Python API is disabled by default and can be built in-tree or out-of-tree.\nThe in-tree build is mainly meant for end users and packages.\nTo build the Python API with the normal project set the ``python`` option in the configuration step with\n\n```sh\nmeson setup _build -Dpython=true -Dpython_version=$(which python3)\n```\n\nThe Python version can be used to select a different Python version, it defaults to `'python3'`.\nPython 2 is not supported with this project, the Python version key is meant to select between several local Python 3 versions.\n\nProceed with the build as described before and install the projects to make the Python API available in the selected prefix.\n\nFor the out-of-tree build see the instructions in the [``python``](./python) directory.\n\n\n## Contributing\n\nThis is a volunteer open source projects and contributions are always welcome. \nPlease, take a moment to read the [contributing guidelines](CONTRIBUTING.md).\n\n\n## License\n\nThis project is free software: you can redistribute it and/or modify it under\nthe terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis project is distributed in the hope that it will be useful,\nbut without any warranty; without even the implied warranty of\nmerchantability or fitness for a particular purpose.  See the\nGNU Lesser General Public License for more details.\n\nUnless you explicitly state otherwise, any contribution intentionally\nsubmitted for inclusion in this project by you, as defined in the\nGNU Lesser General Public license, shall be licensed as above, without any\nadditional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdftd3%2Fsimple-dftd3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdftd3%2Fsimple-dftd3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdftd3%2Fsimple-dftd3/lists"}