magnopy.io.dump_vampire#

magnopy.io.dump_vampire(spinham: SpinHamiltonian, seedname='vampire', anisotropic=True, dmi=True, custom_mask=None, decimals=5, materials=None, no_logo=False) None[source]#

Saves spin Hamiltonian in the format suitable for Vampire (.UCF and .mat).

Parameters:
spinhamSpinHamiltonian

Spin Hamiltonian object to be saved.

seednamestr, default "vampire"

Seedname for the .UCF and .mat files. Extensions are added automatically. Input file is independent of seedname and always has the name "input-template".

anisotropicbool, default True

Whether to output anisotropic exchange.

dmibool, default True

Whether to output DMI exchange.

custom_maskfunc, optional

Custom mask for the exchange parameter. Function that takes (3, 3) numpy.ndarray as an input and returns (3, 3) numpy.ndarray as an output. If given, then anisotropic and dmi parameters are ignored.

parameter_to_output = custom_mask(parameter)
decimalsint, default 4

Number of decimals to be printed (only for the exchange values).

materialslist of int, optional

List of materials for the atoms. Length is the same as the number of magnetic atoms in the spinham (spinham.M). Order is the same as in SpinHamiltonian.magnetic_atoms. If none given, each magnetic atom is considered as a separate material. Material indices start from 0 and should contain all consecutive integers between 0 and number of materials. Number of materials cannot be higher than number of magnetic atoms.

no_logobool, default False

Whether to include the logo in the output files.

Notes

Examples of the correct materials list for 5 magnetic atoms

[0, 0, 0, 0, 0]
[1, 3, 2, 1, 0]
[0, 1, 2, 3, 4]

Examples of the incorrect materials list for 5 magnetic atoms

[0, 6, 0, 0, 0]
[1, 3, 3, 1, 0]
[1, 2, 3, 4, 5]