DeMonNanoPy
Python wrapper around deMonNano for preparing inputs, launching calculations, and parsing results.
Overview
DeMonNanoPy provides a small Python API to:
- write deMonNano input files from Python dictionaries,
- execute deMonNano calculations from a working directory,
- parse output data such as energies and geometries,
- drive predefined workflows such as optimization, PTMC, and molecular dynamics,
- integrate deMonNano usage with ASE structures.
The codebase is organized around three main layers:
deMonPy.input.write_input: buildsdeMon.inpfrom Python parameters,deMonPy.deMonNano.deMonNano: runs a standard calculation,deMonPy.deMonNano.Module_DeMonNano: runs higher-level workflows through modules.
Core Concepts
Standard Calculation
Use deMonPy.deMonNano.deMonNano when you want to:
- prepare a single calculation,
- run deMonNano,
- collect parsed results in a Python dictionary.
The normal workflow is:
- define the executable path and input parameters,
- create a
deMonNanoinstance, - call
calculate(symbols=..., positions=...), - read
calculator.results.
Module-Based Workflow
Use deMonPy.deMonNano.Module_DeMonNano when you want a higher-level workflow
implemented in deMonPy.modules, for example:
optfor geometry optimization,ptmcfor parallel tempering Monte Carlo,mdfor molecular dynamics.
Available module names are defined in deMonPy.__init__.py.
Current Capabilities
Based on the current source tree, the project already includes support for:
- DFTB input generation,
- charge and multiplicity settings,
- bond parameter writing,
- CI and TD-DFTB input and partial output parsing,
- geometry parsing,
- optimization, PTMC, and MD workflow entry points.
Some workflow sections are still incomplete. NEB output parsing, in
particular, is not implemented: rather than returning silently, it records an
explicit error entry that surfaces through has_errors() / raise_on_errors().
Notes
- Working directories are created automatically when needed.
- Results are stored in Python dictionaries and can be serialized as JSON via
deMonPy.encoder.AseEncoder(handles NumPy arrays, sets and ASE objects). - Paths to the executable and basis files are user-provided and must be valid in the execution environment.
Sections: Quickstart | Modules | Tutorial | Examples