The calc.results["energy"] property from the M3GNetCalculator should be a float but is a numpy array of length 1. This behavior is not observed in CHGNet, for what it's worth.
Code snippet
import matgl
from matgl.ext.ase import M3GNetCalculator
from ase.build import bulk
atoms = bulk("Cu")
potential = matgl.load_model("M3GNet-MP-2021.2.8-DIRECT-PES")
atoms.calc = M3GNetCalculator(potential)
e = atoms.get_potential_energy() # or atoms.calc.results["energy"]
print(e)
You can compare this with:
from ase.build import bulk
from ase.calculators.emt import EMT
atoms = bulk("Cu")
atoms.calc = EMT()
e = atoms.get_potential_energy()
print(e)
Log output
The output is:
array(-32.750034, dtype=float32)
Code of Conduct
[X] I agree to follow this project's Code of Conduct
Email (Optional)
No response
Version
0.0.3
Which OS(es) are you using?
What happened?
The
calc.results["energy"]
property from theM3GNetCalculator
should be a float but is a numpy array of length 1. This behavior is not observed in CHGNet, for what it's worth.Code snippet
You can compare this with:
Log output
Code of Conduct