Hamiltonian
#include "Spirit/Hamiltonian.h"
This currently only provides an interface to the Heisenberg Hamiltonian.
DMI chirality
This means that
Bloch chirality corresponds to DM vectors along bonds
Neel chirality corresponds to DM vectors orthogonal to bonds
Neel chirality should therefore only be used in 2D systems.
SPIRIT_CHIRALITY_BLOCH
SPIRIT_CHIRALITY_BLOCH 1
Bloch chirality
SPIRIT_CHIRALITY_NEEL
SPIRIT_CHIRALITY_NEEL 2
Neel chirality
SPIRIT_CHIRALITY_BLOCH_INVERSE
SPIRIT_CHIRALITY_BLOCH_INVERSE -1
Bloch chirality, inverted DM vectors
SPIRIT_CHIRALITY_NEEL_INVERSE
SPIRIT_CHIRALITY_NEEL_INVERSE -2
Neel chirality, inverted DM vectors
Dipole-Dipole method
SPIRIT_DDI_METHOD_NONE
SPIRIT_DDI_METHOD_NONE 0
Do not use dipolar interactions
SPIRIT_DDI_METHOD_FFT
SPIRIT_DDI_METHOD_FFT 1
Use fast Fourier transform (FFT) convolutions
SPIRIT_DDI_METHOD_FMM
SPIRIT_DDI_METHOD_FMM 2
Use the fast multipole method (FMM)
SPIRIT_DDI_METHOD_CUTOFF
SPIRIT_DDI_METHOD_CUTOFF 3
Use a direct summation with a cutoff radius
Setters
Hamiltonian_Set_Boundary_Conditions
void Hamiltonian_Set_Boundary_Conditions(State *state, const bool* periodical, int idx_image=-1, int idx_chain=-1)
Set the boundary conditions along the translation directions [a, b, c]
Hamiltonian_Set_Field
void Hamiltonian_Set_Field(State *state, float magnitude, const float* normal, int idx_image=-1, int idx_chain=-1)
Set the (homogeneous) external magnetic field [T]
Hamiltonian_Set_Anisotropy
void Hamiltonian_Set_Anisotropy(State *state, float magnitude, const float* normal, int idx_image=-1, int idx_chain=-1)
Set a global uniaxial anisotropy [meV]
Hamiltonian_Set_Biaxial_Anisotropy
void Hamiltonian_Set_Biaxial_Anisotropy(
State * state, const scalar * magnitude, const unsigned int exponents[][3], const scalar * primary,
const scalar * secondary, int n_terms, int idx_image=-1, int idx_chain=-1)
Set a global biaxial anisotropy [meV] Note: the secondary axis will be orthogonalized with respect to the primary axis and both axes will be normalized.
Hamiltonian_Set_Exchange
void Hamiltonian_Set_Exchange(State *state, int n_shells, const float* jij, int idx_image=-1, int idx_chain=-1)
Set the exchange interaction in terms of neighbour shells [meV]
Hamiltonian_Set_DMI
void Hamiltonian_Set_DMI(State *state, int n_shells, const float * dij, int chirality=SPIRIT_CHIRALITY_BLOCH, int idx_image=-1, int idx_chain=-1)
Set the Dzyaloshinskii-Moriya interaction in terms of neighbour shells [meV]
Hamiltonian_Set_DDI
void Hamiltonian_Set_DDI(State *state, int ddi_method, int n_periodic_images[3], float cutoff_radius=0, bool pb_zero_padding=true, int idx_image=-1, int idx_chain=-1)
Configure the dipole-dipole interaction
ddi_method
: see integers defined aboven_periodic_images
: how many repetition of the spin configuration to append along the translation directions [a, b, c], if periodical boundary conditions are usedcutoff_radius
: the distance at which to stop the direct summation, if usedpb_zero_padding
: ifTrue
zero padding is used even for periodical directions
Getters
Hamiltonian_Get_Name
const char * Hamiltonian_Get_Name(State * state, int idx_image=-1, int idx_chain=-1)
Returns a string containing the name of the Hamiltonian in use
Hamiltonian_Get_Boundary_Conditions
void Hamiltonian_Get_Boundary_Conditions(State *state, bool * periodical, int idx_image=-1, int idx_chain=-1)
Retrieves the boundary conditions
Hamiltonian_Get_Field
void Hamiltonian_Get_Field(State *state, float * magnitude, float * normal, int idx_image=-1, int idx_chain=-1)
Retrieves the external magnetic field [T]
Hamiltonian_Get_Anisotropy
void Hamiltonian_Get_Anisotropy(State *state, float * magnitude, float * normal, int idx_image=-1, int idx_chain=-1)
Retrieves the uniaxial anisotropy [meV]
Hamiltonian_Get_Biaxial_Anisotropy_N_Atoms
int Hamiltonian_Get_Biaxial_Anisotropy_N_Atoms( State * state, int idx_image = -1, int idx_chain = -1 )
Retrieve the number of atoms within the unit cell for which a biaxial anisotropy is defined
Hamiltonian_Get_Biaxial_Anisotropy_N_Terms
void Hamiltonian_Get_Biaxial_Anisotropy_N_Terms(State * state, int idx_image = -1, int idx_chain = -1 )
Retrieve the total number of terms that define the biaxial anisotropy.
Hamiltonian_Get_Biaxial_Anisotropy
void Hamiltonian_Get_Biaxial_Anisotropy(
State * state, int * indices, scalar primary[][3], scalar secondary[][3], int * site_p, const int n_indices,
scalar * magnitude, int exponents[][3], const int n_terms, int idx_image = -1, int idx_chain = -1 )
Retrieve the data representing the biaxial anisotropy.
Each index indices[i]
has a corresponding primary[i]
and secondary[i]
axis as well as a range of terms [site_p[i]
, site_p[i+1]
).
The full list of terms is written to the magnitude
(given in [meV]) and the exponents
array respectively.
Hamiltonian_Get_Exchange_Shells
void Hamiltonian_Get_Exchange_Shells(State *state, int * n_shells, float * jij, int idx_image=-1, int idx_chain=-1)
Retrieves the exchange interaction in terms of neighbour shells.
Note: if the interactions were specified as pairs, this function
will retrieve n_shells=0
.
Hamiltonian_Get_Exchange_N_Pairs
int Hamiltonian_Get_Exchange_N_Pairs(State *state, int idx_image=-1, int idx_chain=-1)
Returns the number of exchange interaction pairs
Hamiltonian_Get_DMI_Shells
void Hamiltonian_Get_DMI_Shells(State *state, int * n_shells, float * dij, int * chirality, int idx_image=-1, int idx_chain=-1)
Retrieves the Dzyaloshinskii-Moriya interaction in terms of neighbour shells.
Note: if the interactions were specified as pairs, this function
will retrieve n_shells=0
.
Hamiltonian_Get_DMI_N_Pairs
int Hamiltonian_Get_DMI_N_Pairs(State *state, int idx_image=-1, int idx_chain=-1)
Returns the number of Dzyaloshinskii-Moriya interaction pairs
Hamiltonian_Get_DDI
void Hamiltonian_Get_DDI(State *state, int * ddi_method, int n_periodic_images[3], float * cutoff_radius, bool * pb_zero_padding, int idx_image=-1, int idx_chain=-1)
Retrieves the dipole-dipole interaction configuration.
ddi_method
: see integers defined aboven_periodic_images
: how many repetitions of the spin configuration to append along the translation directions [a, b, c], if periodical boundary conditions are usedcutoff_radius
: the distance at which to stop the direct summation, if method_cutoff is usedpb_zero_padding
: ifTrue
zero padding is used even for periodical directions