xnn.common.models.charge_solve.bonded_fragments#
- xnn.common.models.charge_solve.bonded_fragments(atomic_numbers, edge_index, edge_vec, radii, ions, bond_factor=1.2)[source]#
Fragment index of every atom,
(N,), from covalent connectivity.Two atoms are bonded when their distance is below
bond_factortimes the sum of their covalent radii; an atom with a formal ion charge is never bonded and forms its own fragment. The fragments are the connected components, numbered in the order of their first atom, found by label propagation over the edge list (one pass per bond of the longest chain).- Parameters:
atomic_numbers (Tensor) –
(N,).edge_index (Tensor) – The neighbor list
(2, E)and its vectors(E, 3)(any cutoff beyond the bond lengths; periodic images included).edge_vec (Tensor) – The neighbor list
(2, E)and its vectors(E, 3)(any cutoff beyond the bond lengths; periodic images included).radii (Tensor) – Tables indexed by atomic number:
covalent_radii()andion_charge_table().ions (Tensor) – Tables indexed by atomic number:
covalent_radii()andion_charge_table().bond_factor (float, optional) – The tolerance on the covalent-radius sum, by default 1.2.
- Return type: