sisl.geom.PartialNeighborList

class sisl.geom.PartialNeighborList

Bases: AtomsNeighborList

Neighbors list containing only the neighbors of some atoms.

Examples

You can get a partial neighbors list from the find_neighbors method of a NeighborFinder object if you pass the atoms argument. Then, you can retreive the neighbors from it:

import sisl

# Build a graphene supercell with a vacancy
graphene = sisl.geom.graphene().tile(2, 0).tile(2, 1)
graphene = graphene.remove(2).translate2uc()

# Initialize a finder for neighbors that are within 1.5 Angstrom
finder = sisl.geom.NeighborFinder(graphene, R=1.5)

# Get a partial neighbors list
neighbors = finder.find_neighbors(atoms=[2, 4])

# You can loop through atoms to get their neighbors
# In this case, the loop will go through atoms 2 and 4
for at_neighs in neighbors:
    print()
    print(f"NEIGHBORS OF ATOM {at_neighs.atom} ({at_neighs.n_neighbors} neighbors): ")
    print("J", at_neighs.J)
    print("ISC", at_neighs.isc)

# Or get the neighbors of a particular atom
neighbors[0].atom # This will be 2
neighbors[0].J

See also

AtomNeighborList

The object returned by this list when iterating or indexing.

Attributes

I

For each neighbor pair (I, J), the first index.

J

For each neighbor pair (I, J), the second index.

i

Same as I, provided for backwards compatibility, may be deprecated later

isc

For each neighbor pair (I, J), the supercell indices of J.

j

Same as J, provided for backwards compatibility, may be deprecated later

min_nsc

The minimum nsc for an auxiliary supercell to contain all neighbors in this object.

n_neighbors

Number of neighbors that each atom has.

split_indices

Indices to split the interactions of each atom.

property I: ndarray

For each neighbor pair (I, J), the first index.

property J: ndarray

For each neighbor pair (I, J), the second index.

atoms: np.ndarray
property i: ndarray

Same as I, provided for backwards compatibility, may be deprecated later

property isc: ndarray

For each neighbor pair (I, J), the supercell indices of J.

property j: ndarray

Same as J, provided for backwards compatibility, may be deprecated later

property min_nsc: ndarray

The minimum nsc for an auxiliary supercell to contain all neighbors in this object.

property n_neighbors: ndarray

Number of neighbors that each atom has.

property split_indices: ndarray

Indices to split the interactions of each atom.