Skip to content

Enable compute metatomic#46

Merged
Luthaf merged 1 commit into
metatomicfrom
compute
Jul 10, 2026
Merged

Enable compute metatomic#46
Luthaf merged 1 commit into
metatomicfrom
compute

Conversation

@GardevoirX

@GardevoirX GardevoirX commented Mar 12, 2026

Copy link
Copy Markdown

Summary

This PR aims to allow lammps to use AtomisticModels to compute properties

Usage

compute <ID> <group-ID> metatomic <model_path> <property_name/[variant]> unit <unit> device <device> check_consistency <on/off> extensions_directory <extensions_directory> shape <scalar or vector> <vector_shape if shape == vector> types <type1> <type2> ...

Example

lmp -i in.compute_metatomic

Regarding determining the output shape

It is no longer feasible to determine it with a dummy system, because different outputs have different requirements on the system... e.g. heat flux need a system with PBC on, and the box size must be larger than the model's interactive range. Thus here I require the user to specify the shape (scalar/vector) and the size (if it's a vector) of their required properties. For users' convenience, we can later have a registry for standard outputs, so that users don't need to input the shape and size for standard outputs.

Comment thread src/ML-METATOMIC/compute_metatomic.cpp Outdated
Comment thread src/ML-METATOMIC/compute_metatomic.h
Comment thread src/ML-METATOMIC/compute_metatomic.h
Comment thread src/ML-METATOMIC/compute_metatomic.h Outdated
Comment thread src/ML-METATOMIC/compute_metatomic.h Outdated
} else {
error->all(FLERR, "the model requested an unsupported dtype '{}'", mta_data->capabilities->dtype());
}
auto system = this->system_adaptor->system_from_lmp(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should deal with requested inputs directly

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk if the current version is what you want

Comment thread src/ML-METATOMIC/compute_metatomic.cpp Outdated
Comment thread src/ML-METATOMIC/compute_metatomic.cpp Outdated
Comment thread src/ML-METATOMIC/compute_metatomic.cpp Outdated
Comment thread src/ML-METATOMIC/compute_metatomic.cpp Outdated
@GardevoirX GardevoirX changed the title Compute Enable compute metatomic Mar 12, 2026
@GardevoirX GardevoirX marked this pull request as ready for review March 28, 2026 19:29
@GardevoirX GardevoirX marked this pull request as draft June 22, 2026 18:54
@GardevoirX

Copy link
Copy Markdown
Author

Will be ready when #49 is merged

@GardevoirX GardevoirX force-pushed the compute branch 2 times, most recently from b68b2e0 to 7439141 Compare June 27, 2026 18:15
@GardevoirX GardevoirX marked this pull request as ready for review July 1, 2026 08:50
Comment thread examples/PACKAGES/metatomic/create-lj-nickel.py Outdated
Comment thread examples/PACKAGES/metatomic/in.compute_metatomic Outdated
Comment thread examples/PACKAGES/metatomic/in.compute_metatomic Outdated
Comment thread examples/PACKAGES/metatomic/in.compute_metatomic Outdated
Comment thread src/ML-METATOMIC/compute_metatomic.h
Comment thread src/ML-METATOMIC/compute_metatomic.cpp Outdated
Comment thread src/ML-METATOMIC/compute_metatomic.cpp
Comment thread src/ML-METATOMIC/compute_metatomic.cpp Outdated
Comment thread src/ML-METATOMIC/compute_metatomic.cpp
Comment thread src/ML-METATOMIC/compute_metatomic.cpp
@GardevoirX

Copy link
Copy Markdown
Author

Hm after removing the system energy output, we currently don't have a test for the global scalar output, what can be suitable?

@Luthaf Luthaf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting there, I think we can make this more convenient in 90% of the use cases by making more of the settings optional

Comment thread examples/PACKAGES/metatomic/in.compute_metatomic Outdated
Comment thread examples/PACKAGES/metatomic/in.compute_metatomic Outdated
Comment thread examples/PACKAGES/metatomic/in.compute_metatomic Outdated
Comment thread src/ML-METATOMIC/compute_metatomic.cpp Outdated
Comment thread src/ML-METATOMIC/metatomic_types.h Outdated
Comment thread src/ML-METATOMIC/compute_metatomic.cpp Outdated
This allow to use metatomic ML models to compute properties
of the system on the fly, for example to compute heat flux,
dipole moments, NMR shieldings, …
@Luthaf Luthaf merged commit 22628fa into metatomic Jul 10, 2026
@Luthaf Luthaf deleted the compute branch July 10, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants