Skip to content

Fix: se_r prod_env_mat #3351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 28, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions deepmd/pt/utils/env_mat_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ def iter(
dtype=env.GLOBAL_PT_FLOAT_PRECISION,
device=env.DEVICE,
)
if self.last_dim == 4:
radial_only = False
elif self.last_dim == 1:
radial_only = True
else:
raise ValueError(
"last_dim should be 1 for raial-only or 4 for full descriptor."
)
for system in data:
coord, atype, box, natoms = (
system["coord"],
Expand Down Expand Up @@ -130,6 +138,7 @@ def iter(
self.descriptor.get_rcut(),
# TODO: export rcut_smth from DescriptorBlock
self.descriptor.rcut_smth,
radial_only,
)
# reshape to nframes * nloc at the atom level,
# so nframes/mixed_type do not matter
Expand Down