CederGroupHub / chgnet

Pretrained universal neural network potential for charge-informed atomistic modeling https://chgnet.lbl.gov
https://doi.org/10.1038/s42256-023-00716-3
Other
215 stars 55 forks source link

[Bug]: Error for Isolated atoms #176

Closed chiang-yuan closed 1 week ago

chiang-yuan commented 1 week ago

Email (Optional)

No response

Version

v0.3.5

Which OS(es) are you using?

What happened?

Was trying to calculate the diatomic dissociation energy curves and found chgnet could not take two isolated atoms beyond cutoff

Code snippet

from chgnet.model.dynamics import CHGNetCalculator

atoms = Atoms('HH', positions=[[0, 0, 0], [7, 0, 0]], cell=[14, 14.001, 14.002], pbc=True)
calc = CHGNetCalculator()

atoms.calc = calc

print(atoms.get_potential_energy())

Log output

IndexError: too many indices for tensor of dimension 1

Code of Conduct

BowenD-UCB commented 1 week ago

solved in https://github.com/CederGroupHub/chgnet/commit/b819ef55f6dd87cc1e2b450c41cd47e5b06544e8