sisl.geom.UniqueNeighborList

class sisl.geom.UniqueNeighborList

Bases: AtomsNeighborList

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

What this means, is that 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 retrieve 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.

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.

to_full()[source]

Converts the unique neighbors list to a full neighbors list.

Return type:

FullNeighborList

property I: ndarray

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

property J: ndarray

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

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.