Closed Tinaatucsd closed 1 year ago
if I directly use
prediction = chgnet.predict_structure(structure)
The energy is different from the initial step energy when using
StructOptimizer().relax(s, steps=1)
That's a bug in ase
.
def run(self, fmax=0.05, steps=None):
""" call Dynamics.run and keep track of fmax"""
self.fmax = fmax
if steps:
self.max_steps = steps
return Dynamics.run(self)
bool(0) == false
so max_steps
is not set when you pass steps=0
.
Cool! Thanks for the swift explanation!
But how about the second issue?
Two methods return different energies for the same structure.
How different are the energies and are you sure you're passing the same structure? Your variables are called differently (s
and structure
).
Yes, I am sure I am passing the same structure.
Oops, excuse me, I found out the reason.
The relax
method output is energy, while predict_structure
output is energy per atom, I happen to use the structure with 102 atoms and misread the digit point.
For relax
method, here is the output:
Step Time Energy fmax
Force-consistent energies used in optimization. FIRE: 0 21:55:55 -326.627214 4.2172 FIRE: 1 21:55:55 -324.937722* 45.8358 -326.6272144317627
For predict_structure
method
CHGNet-predicted energy=-3.2022275924682617
I encountered an unexpected situation.
I am trying to use CHGNET for static calculations and compare the energy with DFT values. However, when I set
steps=0
, the relaxation process continues indefinitely, without being limited by the default 500 steps:This behavior is not what I was expecting.
I wonder if this is intentional.
When I set
steps = 1
, the output appears as follows:This output is as expected.