radtools.SpinHamiltonian.get_distance#

method

SpinHamiltonian.get_distance(atom1: Atom | str, atom2: Atom | str, R=(0, 0, 0), index1=None, index2=None, relative=False)#

Getter for distance between the atom1 and atom2.

Parameters:
atom1Atom or str

:py:class`.Atom` object or atom`s name in (0, 0, 0) unit cell. If name, then it has to be unique among atoms of the crystal.

atom2Atom or str

:py:class`.Atom` object or atom`s name in R unit cell. If name, then it has to be unique among atoms of the crystal.

R(3,) array-like, default (0, 0, 0)

Radius vector of the unit cell for atom2 (i,j,k).

relativebool, default False

Whether to use relative coordinates. (Strange, but if you wish)

index1int, optional

Index of the atom1.

index2int, optional

Index of the atom2.

Returns:
distancefloats

Distance between atom1 in (0,0,0) cell and atom2 in R cell.