magnopy.io.load_grogu#

magnopy.io.load_grogu(filename, spin_values=None, spglib_types=None) SpinHamiltonian[source]#

Reads spin Hamiltonian from the .txt file produced by GROGU.

For more information on GROGU's file format see GROGU file format.

Parameters:
filenamestr

Path to the .txt file produced by GROGU.

spin_values(M, ) iterable of floats, optional

Spin values for all magnetic atom. Order is the same as in GROGU file. Magnetic atoms are defined as those that have at least one parameter associated with them. If none given, magnopy uses spin values computed from DFT (as provided in the GROGU file).

spglib_types(M_prime, ) iterable of ints, optional

Spglib types for all atoms (not only for magnetic ones, but for all). Order is the same as in GROGU file. If none given, then there will be no "spglib_types" key in spinham.atoms.

Returns:
spinhamSpinHamiltonian

Spin Hamiltonian, that is built from the GROGU file.

Raises:
ValueError

If spin_values is provided and its length does not match the number of magnetic atoms in the Hamiltonian.

ValueError

If spglib_types is provided and its length does not match the number of atoms in the Hamiltonian.