Skip to content

Commit

Permalink
change isclose to equal in cell checking
Browse files Browse the repository at this point in the history
Co-authored-by: Philip Loche <philip.loche@posteo.de>
  • Loading branch information
tulga-rdn and PicoCentauri authored Dec 18, 2024
1 parent 6a1cfb3 commit eb49a8c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/torchpme/calculators/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,8 @@ def _validate_compute_parameters(
f"({device})"
)

determinant = torch.linalg.det(cell)

if smearing is not None and torch.isclose(
determinant, torch.tensor(0.0, dtype=cell.dtype, device=cell.device)
if smearing is not None and torch.equal(
cell.det(), torch.tensor(0.0, dtype=cell.dtype, device=cell.device)
):
raise ValueError(
"provided `cell` has a determinant of 0 and therefore is not valid for "
Expand Down

0 comments on commit eb49a8c

Please sign in to comment.