Skip to content

Resolve "System links and ASE atoms for results section"

The new to_ase function allows to conviniently generate an ASE Atoms object from a given section syst em based on the data in its atoms sub-section. Here is a simple example:

from nomad.client import ArchiveQuery

query = ArchiveQuery(
    required={
        'run': {
            'system[-1]': {
                'atoms': '*'
            }
        }
    })

result = query.download(1)[0]
atoms = result.run[0].system[-1].atoms.to_ase()

print(atoms.get_chemical_formula(mode='reduce'))

See also the discussion here: https://matsci.org/t/convert-query-result-directly-to-ase-atoms-objects/44513/7

#1074 (closed)

Edited by Markus Scheidgen

Merge request reports