radtools.load_tb2j_model#
- radtools.load_tb2j_model(filename, quiet=True, bravais_type=None, standardize=True) SpinHamiltonian[source]#
Read spin Hamiltonian from TB2J output file.
Changed in version 0.8.1: Renamed from
read_tb2j_modelIn 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).
SpinHamiltoniancan store exchange values in any notation. One could check the notation by calling the attributeSpinHamiltonian.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 andquiet=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. SeeCrystal.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.- standardizebool, default True
Whether to standardize the unit cell upon loading.
- Returns:
- model
SpinHamiltonian Spin Hamiltonian build from TB2J file. With notation set to "TB2J".
- model
- Raises:
- ValueError
If
bravais_typeis provided and can not be reached.