From db0f9cff00fae9520cde78960b21e880645f69bd Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 20 Feb 2025 17:38:01 +0000 Subject: [PATCH] Update documentations --- _modules/hippynn/layers/pairs/dispatch.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/_modules/hippynn/layers/pairs/dispatch.html b/_modules/hippynn/layers/pairs/dispatch.html index 7af6859d..769eb3e1 100644 --- a/_modules/hippynn/layers/pairs/dispatch.html +++ b/_modules/hippynn/layers/pairs/dispatch.html @@ -264,10 +264,12 @@

Source code for hippynn.layers.pairs.dispatch

if torch.count_nonzero(cell_prod - torch.diag(torch.diag(cell_prod))): raise ValueError("KD Tree search only works for orthorhombic cells.") - # Verify that the cutoff is less than the side lengths of the cell + # Verify that the cutoff is less half the shortest cell side length. Otherwise, it is possible to + # have multiple images of the same point be within the cutoff distance of another point. The + # current algorithm is unable to handle this. cell_side_lengths = torch.sqrt(torch.diag(cell_prod)) - if (cutoff >= cell_side_lengths).any(): - raise ValueError(f"Cutoff value ({cutoff}) must be less than the cell slide lengths ({cell_side_lengths}).") + if (cutoff >= cell_side_lengths/2).any(): + raise ValueError(f"Cutoff value ({cutoff}) must be less than half the shortest cell side length ({cell_side_lengths.min()}).") if torch.count_nonzero(cell - torch.diag(torch.diag(cell))): # Transform via isometry to a basis where cell is a diagonal matrix if it currently is not