Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions metatomic-torch/src/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,7 @@ static std::map<std::string, Quantity> KNOWN_QUANTITIES = {
{"A/fs", 1e1},
{"m/s", 1e6},
{"nm/ps", 1e3},
{"(eV/u)^(1/2)", 101.80506},
}, {
// alternative names
}}},
Expand Down
11 changes: 7 additions & 4 deletions python/metatomic_torch/metatomic/torch/ase_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _get_charges(atoms: ase.Atoms) -> np.ndarray:
"velocities": {
"quantity": "velocity",
"getter": ase.Atoms.get_velocities,
"unit": "nm/fs",
"unit": "(eV/u)^(1/2)",
},
"charges": {
"quantity": "charge",
Expand Down Expand Up @@ -99,6 +99,10 @@ def _get_charges(atoms: ase.Atoms) -> np.ndarray:
},
}

IMPLEMENTED_PROPERTIES = [
"heat_flux",
]


class MetatomicCalculator(ase.calculators.calculator.Calculator):
"""
Expand Down Expand Up @@ -318,7 +322,7 @@ def __init__(

# We do our own check to verify if a property is implemented in `calculate()`,
# so we pretend to be able to compute all properties ASE knows about.
self.implemented_properties = ALL_ASE_PROPERTIES
self.implemented_properties = ALL_ASE_PROPERTIES + IMPLEMENTED_PROPERTIES

self.additional_outputs: Dict[str, TensorMap] = {}
"""
Expand Down Expand Up @@ -1019,8 +1023,7 @@ def _get_ase_input(
tensor.set_info("quantity", infos["quantity"])
tensor.set_info("unit", infos["unit"])

tensor.to(dtype=dtype, device=device)
return tensor
return tensor.to(dtype=dtype, device=device)


def _ase_to_torch_data(atoms, dtype, device):
Expand Down
Loading