sisl.geom.UniqueNeighborList

class sisl.geom.UniqueNeighborList(geometry: Geometry, finder_results: ndarray, split_indices: ndarray | None = None)

Bases: AtomsNeighborList

Full neighbors list of a system, but containing only the upper triangle of the adjacency matrix.

What this means, is that the the object only contains one direction of each interaction.

This is only possible if the interaction is symmetric (there is no directionality and thresholds for interaction do not depend on direction).

Examples

You can get a unique neighbors list from the find_unique_pairs method of a NeighborFinder object. 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 the list of unique neighbor pairs
neighbors = finder.find_unique_pairs()

# You can get the neighbor pairs (i,j) from the i and j attributes
# The supercell index of atom J is in the isc attribute.
print("ATOM I", neighbors.i)
print("ATOM J (NEIGHBOR)", neighbors.j)
print("NEIGHBORS ISC:", neighbors.isc)

# Notice that I is always smaller than J. Each connection is only
# stored once.
# You can convert to a full neighbors list, which will contain both
# directions.
full_neighbors = neighbors.to_full()

Methods

to_full()

Converts the unique neighbors list to a full neighbors list.

i

For each neighbor pair (i, j), the first index.

isc

For each neighbor pair (i, j), the supercell indices of j.

j

For each neighbor pair (i, j), the second index.

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.

Parameters:
  • geometry (Geometry)

  • finder_results (np.ndarray)

  • split_indices (Optional[np.ndarray])

__init__(geometry: Geometry, finder_results: ndarray, split_indices: ndarray | None = None)
Parameters:
property i: ndarray

For each neighbor pair (i, j), the first index.

property isc: ndarray

For each neighbor pair (i, j), the supercell indices of j.

property j: ndarray

For each neighbor pair (i, j), the second index.

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.

to_full() FullNeighborList[source]

Converts the unique neighbors list to a full neighbors list.

Return type:

FullNeighborList