Conversation
| wrapped_pos = torch.bmm(cell_per_atom, wrapped_frac.unsqueeze(2)).squeeze(2) | ||
| out = torch.where(active_per_atom, wrapped_pos, positions) | ||
| shifts = torch.where(active_per_atom, int_shifts, torch.zeros_like(int_shifts)) | ||
| return out, shifts |
There was a problem hiding this comment.
key idea was just to keep these extra shifts around and adjust the nl shifts accordingly.
|
alchemiops can run on CPU but many of our test cases hit it's default max neighbor amounts |
| "fcc": lambda: bulk("Cu", "fcc", a=3.6), | ||
| "hcp": lambda: bulk("Ti", "hcp", a=2.95, c=4.68), | ||
| "diamond": lambda: bulk("Si", "diamond", a=5.43), | ||
| "bcc": lambda: bulk("Al", "bcc", a=2 / np.sqrt(3), cubic=True), |
There was a problem hiding this comment.
too dense lead to nbr explosion exceeding alchemiops padding heuristic
| if stress_computed and fe_model_output["stress"].shape != (1, 3, 3): | ||
| raise ValueError(f"{fe_model_output['stress'].shape=} != (1, 3, 3)") | ||
|
|
||
| # Translating one atom by a full lattice vector should not change outputs. |
There was a problem hiding this comment.
@alphalm4 This test seemingly passes with the upstream sevennet so I would guess that no additional changes are needed for the precision issue you mentioned at least at the 0.1 meV level (1e-4)
There was a problem hiding this comment.
Great! I think the validation condition should be stricter in this line like below,
since I found only using + lattice_vec luckly PASSES even though NL things are not patched.
shifted_state.positions[0] = shifted_state.positions[0] + 10 * lattice_vec
I also checked that the current PR version, together with nvalchemi-toolkit-ops==0.3.0 and vesin[torch]==0.5.3 passes all sevenn+torchsim tests with all four torchsim_nls. Thanks for considering this.
Addresses #437