pythtb.Lattice.nn_bonds#

Lattice.nn_bonds(n_shell, report=False)[source]#

Enumerate nearest-neighbor shells of the lattice.

The lattice’s orbitals are treated as points in real space (Cartesian coordinates). We form all displacement vectors connecting each orbital to every other orbital translated by integer lattice vectors and group them into n_shell distinct radial shells.

Parameters:
n_shellint

Number of shells to return (starting from the shortest non-zero displacement).

reportbool, optional

If True, print a human-readable table of the shells and their degeneracies. Default is False.

Returns:
dict

Dictionary with the following keys:

shells

List of length n_shell. Each entry is a dictionary with the keys shell (1-based shell index), radius (float), distance_sq (float), degeneracy_total (int), and orbitals (list of per-orbital neighbour data). Each orbital entry contains the indices of the bonded orbital, the lattice translation and the multiplicity.

displacements

List of n_shell entries. Each entry contains, for every orbital in the home cell, an array of Cartesian displacement vectors \(\Delta\mathbf{r}\) pointing to the neighbours in that shell.

indices

Same structure as displacements but holding integer metadata of the form [i, j, R_1, ..., R_{dim_r}] where i and j are orb indices and R is the lattice translation.

radii

One-dimensional numpy.ndarray of shell radii in Cartesian units.

Raises:
ValueError

If n_shell is not a positive integer, or if the lattice has no orbitals or zero real-space dimension.