Skip to content

Custom (Arch/Calculator dependent) properties in written structures (traj etc.) #673

@harveydevereux

Description

@harveydevereux

Summary

This may be possible some other way but it was not obvious to me (write_kwargs that goes to ase.io?) but for example MACE has the node_energy result which is the list of predicted per-atom energies. This would be very useful for thermal-conductivity and more analysis.

This is stored in atoms.calc.results['node_energy']) after a single_point.

from janus_core.calculations.single_point import SinglePoint
from ase.io import read

atoms = read("LiF.extxyz")
sp = SinglePoint(
    struct=atoms, 
    arch="mace",
    write_results=True
)

sp.run()

print(atoms.calc.results['node_energy'])
# array([-3.04302047, -5.38119082, -2.85913875, -5.24258456, -2.88435103, ...
# The predicted "Per-atom" energies, useful for thermal-conductivity.

At the moment though in the written results here we just have these properties,

Properties=species:S:1:pos:R:3:momenta:R:3:masses:R:1:mace_mp_forces:R:3:mace_forces:R:3:forces:R:3

But If you do,

atoms.set_array('atom_energy', atoms.calc.results['node_energy'])
write("LiF-sp.extxyz", atoms)

Then atom_energy is in the properties

Properties=species:S:1:pos:R:3:momenta:R:3:masses:R:1:mace_mp_forces:R:3:mace_forces:R:3:atom_energy:R:1:forces:R:3

Example

User controlled properties like so (atom_energy),

Properties=species:S:1:pos:R:3:momenta:R:3:masses:R:1:mace_mp_forces:R:3:mace_forces:R:3:atom_energy:R:1:forces:R:3

Alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew/improved feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions