tbplas.find_neighbors

tbplas.find_neighbors(cell_bra: Union[PrimitiveCell, SuperCell], cell_ket: Union[PrimitiveCell, SuperCell] = None, a_max: int = 0, b_max: int = 0, c_max: int = 0, max_distance: float = 1.0) List[namedtuple]

Find neighbours between the (0, 0, 0) cell of model_bra and nearby cells of cell_ket up to given cutoff distance.

NOTE: only neighbours with distance > 0 will be returned.

The searching range of nearby cells is: [-a_max, a_max] * [-b_max, b_max] * [-c_max, c_max].

The named tuples have four attributes: rn for cell index, pair for orbital indices, rij for Cartesian coordinates of displacement vector in nm and distance for the norm of rij.

Parameters:
  • cell_bra – the ‘bra’ primitive cell or supercell

  • cell_ket – the ‘ket’ primitive cell or supercell default to pc_ket if not set

  • a_max – upper bound of range on a-axis

  • b_max – upper bound of range on b-axis

  • c_max – upper bound of range on c-axis

  • max_distance – cutoff distance in NM

Returns:

list of neighbors as named tuples

Raises:

PCOrbEmptyError – if cell_bra or cell_ket does not contain orbitals