Skip to content

Enable compute metatomic#46

Open
GardevoirX wants to merge 6 commits intometatomicfrom
compute
Open

Enable compute metatomic#46
GardevoirX wants to merge 6 commits intometatomicfrom
compute

Conversation

@GardevoirX
Copy link
Copy Markdown

@GardevoirX GardevoirX commented Mar 12, 2026

Summary

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

Usage

compute <ID> <group-ID> metatomic <model_path> <property_name> quantity <quantity_name> unit <unit> per_atom <on/off> device <device> check_consistency <on/off> extensions_directory <extensions_directory> shape <scalar/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.

} 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

auto output_components = output_block->components();
ResultKind kind = RESULT_NONE;
n_samples = output.size(0);
n_components = output.size(1);
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.

the output might not have components, or more than one component dimension

@GardevoirX GardevoirX changed the title Compute Enable compute metatomic Mar 12, 2026
Temp2

A (at least) compilable versiron of `compute metatomic`
@GardevoirX GardevoirX marked this pull request as ready for review March 28, 2026 19:29
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