magnopy.io.load_tb2j#
- magnopy.io.load_tb2j(filename, spin_values=None, g_factors=None, quiet=True) SpinHamiltonian[source]#
Read spin Hamiltonian from the output of TB2J.
- Parameters:
- filenamestr
Path to the TB2J output file.
- spin_values(M, ) iterable of floats, optional
Spin values for each atom. In the same order as in TB2J file. TB2J outputs magnetic moments and not spin values, therefore the spin values for each atom are subject to user definition. If user does not define the spin values, then magnopy set spin value as \(|\boldsymbol{m} / g_{factor}|\) for each spin.
- g_factors(M, ) iterable of floats, optional
g-factors for each atom. In the same order as in TB2J file. TB2J does not provide g-factors, therefore g-factor for each atom is subject to user definition. If user does not define g-factors, then magnopy sets g-factor of each atom to \(2\).
- quietbool, default True
Whether to suppress output.
- Returns:
- spinham
SpinHamiltonian Spin Hamiltonian build from TB2J file. Convention is set to the one of TB2J.
- spinham
Notes
Distances between atoms are not read from the atoms, but rather computed from the unit cell and atom positions. 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.