Skip to content

Commit 1fb65f5

Browse files
committed
Fix non-PBC evaluations in nvalchemi neighbor list
1 parent 08fb957 commit 1fb65f5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/fairchem/core/graph/radius_graph_pbc_nvidia.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,15 @@ def get_neighbors_nvidia(
146146
)
147147
num_neighbors = torch.zeros(total_atoms, dtype=torch.int32, device=device)
148148

149+
# nvalchemi builds temporary bounding cells when no PBC inputs are provided.
150+
neighbor_cell = None if not bool(pbc.any().item()) else cell
151+
neighbor_pbc = None if neighbor_cell is None else pbc
152+
149153
neighbor_list(
150154
positions=positions,
151155
cutoff=nvidia_cutoff,
152-
cell=cell,
153-
pbc=pbc,
156+
cell=neighbor_cell,
157+
pbc=neighbor_pbc,
154158
batch_idx=batch.int(),
155159
method=f"batch_{method}",
156160
neighbor_matrix=neighbor_matrix,

0 commit comments

Comments
 (0)