Open kianpu34593 opened 3 months ago
Is this also after you updated ASE to the latest development branch? We'd need to figure out the source of this error before changing formats. What is the property that can't be written to xyz?
I am using chgnet as well and I have been running into the same problem. I think the problem originates in chgnet saving the model features in atoms.arrays, which is not guaranteed to be in the same shape as len(atoms). In ase.extxyz.write_xyz, the property columns to save in xyz files are specified by the following codes:
if columns is None:
fr_cols = (['symbols', 'positions']
+ [key for key in atoms.arrays if
key not in ['symbols', 'positions', 'numbers',
'species', 'pos']])
and when we output the atoms.arrays after performing simulation with CHGNet it shows these keys:
['symbols', 'positions', 'initial_magmoms', 'forces', 'magmoms', 'crystal_fea']
I believe the 'crystal_fea' is the incompatible column. One way to work around is to ignore xyz and save as traj file. Another way is to manually specify columns=['forces', 'magmoms']
. The latter solution might require a complete update of all the codes (and might be tricky because the properties given by different calculator might be different?)
P.S. To my knowledge this is only incompatible with latest ase-3.23.0b1, no incompatibility issue with ase 3.22 available from pip (although there are other problems like stress shape mismatch)
@hancheng2000's case is more a bug in CHGNet/ASE than it is an issue with ASIMTools. We can handle this by provide a write_atoms function but this is not a priority. I would recommend using the ASE-3.22 or an earlier commit of ASE-3.23 for now. Every other developer has to wait for ASE to become stable to fix these inconsistencies.
Hi,
I was using
image_array
withoptimize
.The optimization happened smoothly but at the last step it cannot save the optimized atoms to xyz file. Now, I temporarily change it to save as
.traj
file and it works.Here is the sim_input.yaml:
Here is the stderr.txt: