You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Print out long-range and short-range part during prediction with MACELES #1223
I am interested to use MACE with long-range corrections (MACE-LES).
I would like to request a guidance on how to print out the short-range and long-range part of the total energy, as well as the atomic charge during the predictions.
As reference, here in the input file I use to train the MACE-LES potential and the script to do total energy and force predictions.
from ase.io import read, write
import numpy as np
from ase import Atoms
from ase.io.trajectory import Trajectory
from ase.calculators.singlepoint import SinglePointCalculator
from mace.calculators import MACECalculator
calc = MACECalculator(model_path='../MACE_models/mace01.model', device='cuda')
traj = read('dft.xyz', index=':')
for atoms in traj:
atoms.calc = calc
atoms.get_potential_energy()
atoms.write('mace.xyz', append=True)
Hey, that is currently not possible from the ASE calculator atm. We will add that in a future update. If you need it now, you can try to hack it by directly evaluating the model and looking at the "les_energy"
Activity
ilyes319 commentedon Oct 20, 2025
Hey, that is currently not possible from the ASE calculator atm. We will add that in a future update. If you need it now, you can try to hack it by directly evaluating the model and looking at the "les_energy"
mace/mace/modules/extensions.py
Line 269 in 42cd495