nvalchemi.distributed.COOPadder#
- class nvalchemi.distributed.COOPadder[source]#
Built-in
GraphPadderfor COOedge_indexgraphs.The inferred default: a model whose halo-padded graph is an ordinary
Batchwith per-atom fields and a per-edgeneighbor_list(COO endpoints) declares nothing. It works on the abstractBatchstorage groups, so it is model-agnostic.Atom / edge counts are knowable up front, so
pad()resolves both caps fromcap_statebefore padding:"atoms"(1.15 initial headroom,strict_gt=Falsesince the dead node sits at the last slot) and"edges"(1.35 initial headroom — edge count climbs ~25% through equilibration). Both regrow x1.30 on overflow, stride 16.Layout:
Per-atom fields ->
n_cap: appended rows carry zeros and join the last graph (their node outputs are dropped by the owned-only consolidation).Per-edge fields ->
e_cap: invalid edges (sentinel rows with endpoint>= n_real) and the fill are routed to an isolated dead node (the last row,n_cap - 1) as self-loops.neighbor_list_shiftsfor those rows uses the[1, 0, 0]image so the edge vector is non-degenerate (a zero vectorNaNs through spherical harmonics). The dead node is referenced by no real edge and masked out of every owned output.
unpad()is a no-op: the owned-only output consolidation already drops the dead / ghost rows. The framework restores the transient padded storage separately (the paddedBatchis reused in place across MD steps).