Skip to content

Commit

Permalink
fix: PT polar UT (#3824)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Simplified the calculation process for `coord_s` in the `test_trans()`
method, improving efficiency and readability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
anyangml authored May 28, 2024
1 parent d754672 commit 3f6e511
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions source/tests/pt/model/test_polarizability_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,7 @@ def test_permu(self):

def test_trans(self):
atype = self.atype.reshape(1, 5)
coord_s = torch.matmul(
torch.remainder(
torch.matmul(self.coord + self.shift, torch.linalg.inv(self.cell)), 1.0
),
self.cell,
)
coord_s = self.coord + self.shift
for fit_diag, scale in itertools.product([True, False], [None, self.scale]):
ft0 = PolarFittingNet(
self.nt,
Expand Down

0 comments on commit 3f6e511

Please sign in to comment.