magnopy.SpinHamiltonian#

class magnopy.SpinHamiltonian(cell, atoms, convention, units='meV')[source]#

Spin Hamiltonian.

Implements the Spin Hamiltonian.

Parameters:
conventionConvention or str

A convention of the spin Hamiltonian. See Convention for more details.

cell(3, 3) array-like

Matrix of a cell, rows are interpreted as vectors. See Cell for more details.

atomsdict

Dictionary with atoms. See Atoms/Sites for more details.

unitsstr, default "meV"

Added in version 0.3.0.

Units of the Hamiltonian's parameters. See SpinHamiltonian.units for more details. Case-insensitive.

Examples

See Spin Hamiltonian for examples.

Methods

add(nus, alphas, parameter[, units, ...])

Adds any parameter with at most four components of spin operator to the Hamiltonian.

add_1(alpha, parameter[, units, when_present])

Adds a parameter of one spin & one site term of the Hamiltonian (partition 1).

add_21(alpha, parameter[, units, when_present])

Adds a parameter of two spins & one site term of the Hamiltonian (partition 2+0).

add_22(alpha, beta, nu, parameter[, units, ...])

Adds a parameter of two spins & two sites term of the Hamiltonian (partition 1+1).

add_31(alpha, parameter[, units, when_present])

Adds a parameter of three spins & one site term of the Hamiltonian (partition 3+0+0).

add_41(alpha, parameter[, units, when_present])

Adds a parameter of four spins & one site term of the Hamiltonian (partition 4+0+0+0).

add_dipole_dipole([R_cut, E_cut, alphas])

Adds magnetic dipole dipole interaction to the Hamiltonian.

add_magnetic_field([B, alphas, h])

Adds external magnetic field to the Hamiltonian.

copy()

Returns a new, independent copy of the same Hamiltonian.

get_empty()

Returns the Hamiltonian with the same cell, atoms, units and convention, but with no parameters present.

parameters([n, p_n])

Returns an iterator over parameters of the Hamiltonian.

purge([tolerance])

Removes parameters of the Hamiltonian that are smaller than the given tolerance.

remove(nus, alphas[, remove_equivalent])

Removes any parameter with at most four components of spin operator from the Hamiltonian.

remove_1(alpha)

Removes a parameter of one spin & one site term of the Hamiltonian (partition 1).

remove_21(alpha)

Removes a parameter of two spins & one site term of the Hamiltonian (partition 2+0).

remove_22(alpha, beta, nu)

Removes a parameter of two spins & two sites term of the Hamiltonian (partition 1+1).

remove_31(alpha)

Removes a parameter of three spins & one site term of the Hamiltonian (partition 3+0+0).

remove_41(alpha)

Removes a parameter of four spins & one site term of the Hamiltonian (partition 4+0+0+0).

restore_missing_parameters([strategy])

Checks that all interactions from the equivalent sets are present in the Hamiltonian and adds the missing ones (if any).

set_distribution([strategy])

Enforces one of the supported distributions of parameters within the sets of equivalent parameters.

set_magnetic_field([B, alphas])

Sets a uniform external magnetic field applied to the Hamiltonian.

symmetrize()

Symmetrize interaction parameters as specified in the SI note 3 of paper about Magnopy.

Properties

M

Amount of magnetic atoms in the unit cell.

M_prime

Amount of atoms in the unit cell.

atoms

Atoms of the crystal on which the Hamiltonian is build.

cell

Cell of the crystal on which the Hamiltonian is build.

convention

Convention of the spin Hamiltonian.

magnetic_atoms

Magnetic atoms of the spin Hamiltonian.

magnetic_field

External magnetic field applied to the Hamiltonian.

map_to_all

Index map from magnetic atoms to all atoms.

map_to_magnetic

Index map from all atoms to the magnetic ones.

p1

Parameters of one spin & one site term of the Hamiltonian (( 1 ) terms).

p21

Parameters of two spins & one site term of the Hamiltonian ((2, 1) terms).

p22

Parameters of two spins & two sites term of the Hamiltonian ((2, 2) terms).

p31

Parameters of three spins & one site term of the Hamiltonian ((3, 1) terms).

p32

Parameters of three spins & two sites term of the Hamiltonian ((3, 2) terms).

p33

Parameters of three spins & three sites term of the Hamiltonian ((3, 3) terms).

p41

Parameters of four spins & one site term of the Hamiltonian ((4, 1) terms).

p42

Parameters of four spins & two sites term of the Hamiltonian ((4, 2) terms).

p43

Parameters of four spins & two sites term of the Hamiltonian ((4, 3) terms).

p44

Parameters of four spins & three sites term of the Hamiltonian ((4, 4) terms).

p45

Parameters of four spins & four sites term of the Hamiltonian ((4, 5) terms).

units

Units of the Hamiltonian's interaction parameters.

zeeman_parameters

Returns an iterator over Zeeman parameters of the Hamiltonian.