radtools.load_tb2j_model#

radtools.load_tb2j_model(filename, quiet=True, bravais_type=None) SpinHamiltonian[source]#

Read spin Hamiltonian from TB2J output file.

Changed in version 0.8.1: Renamed from read_tb2j_model

In TB2J spin Hamiltonian is define in a following notation:

\[H = -\sum_{i,j} \hat{\boldsymbol{S}}_i \cdot \boldsymbol{J}_{i,j} \hat{\boldsymbol{S}}_j\]

where spin vectors \(\boldsymbol{S}_i\) are normalized to 1 and double counting is present (both \(ij\) and \(ji\) are in the sum). SpinHamiltonian can store exchange values in any notation. One could check the notation by calling the attribute SpinHamiltonian.notation.

This function reads and stores exchange parameters in the notation of Hamiltonian mentioned above.

Distance between the atoms are not read from the atoms, but rather computed from the unit cell and atom positions (see Crystal.get_distance()). If the distance read from the file is different from the computed one and quiet=False, the warning is printed. It is usual for the computed and read distances to differ in the last digits, since the unit cell is provided with the same precision as the distance in TB2J output file.

Parameters:
filenamestr

Path to the TB2J output file.

quietbool, default True

Whether to suppress output.

bravais_typestr, default None

Expected bravais lattice type. If None, the lattice type is identified automatically. See Crystal.identify() for more details. The bravais lattice type is reached by reducing the accuracy for the LePage algorithm. If the desired lattice type is not reached, the error is raised.

Returns:
modelSpinHamiltonian

Spin Hamiltonian build from TB2J file. With notation set to "TB2J".

Raises:
ValueError

If bravais_type is provided and can not be reached.