lattice |
unit_cell |
matrix |
sinlge_ion |
coupling |
mag_str |
unit |
|---|---|---|---|---|---|---|
| angle | r | mat | aniso | dl | F | kB |
| lat_const | S | label | g | atom1 | k | muB |
| sym | label | field | atom2 | nExt | mu0 | |
| ff | T | mat_idx | label | |||
| idx |
Example:
lattice properties
The crystal lattice information is stored in spinw.lattice , to define the parameters use:
spinw.genlattice() with options: lat_const, angle, angled, symThe symmetry inequivalent atoms are stored in spinw.unit_cell with following parameters:
spinw.addatom() function with options as aboveMagnetic lattice is dynamically generated from:
spinw.latticespinw.unit_cellspinw.lattice.symThe function M = spinw.matom() generates the positions:
nMagAtomM.rspinw.unit_cell stored in M.idxM.S
The space group generators are stored in the symmetry.dat file, and spinw.lattice.sym stores
all symmetry operators of the space group
204 I m -3 : x+1/2,y+1/2,z+1/2; -x,-y,z; -x,y,-z; z,x,y; -x,-y,-z
205 P a -3 : -x+1/2,-y,z+1/2; -x,y+1/2,-z+1/2; z,x,y; -x,-y,-z
206 I a -3 : x+1/2,y+1/2,z+1/2; -x+1/2,-y,z+1/2; -x,y+1/2,-z+1/2; z,x,y; -x,-y,-z
The first nMagAtom magnetic moment directions stored in spinw.mag_str.S are corresponding to
the magnetic lattice generated by spinw.matom().
The generators of the 230 space group with standard settings are stored in symmetry.dat.
sym = swsym.add(symStr, {symName})spinw.lattice.symIf symmetry is off for bonds, the equivalent bonds will be generated based on length.
spinw.no_sym() removes all symmetries $\rightarrow$ P0 and repopulates spinw.unit_cell with all the
originally generated positions.{T} = spinw.newcell(bvect, {bshift}) creates a new unit cell and reduce the symmetry
to P0 and return the transformation matrix: Qrlu_new = T * Qrlu_oldmatrix propertiesspinw.matrix field:3x3xnMat matrix (mat subfield)These matrices are really just numbers. They will be part of the Hamiltonian once they are assigned to a single ion anisotropy, g-tensor or exchange coupling.
spinw.addmatrix(). The matrix value is given in the mat option:
mat = J1mat = [D1 0 D2]mat = diag([Jxy Jxy Jz])Each matrix can be referenced by its index (e.g. mat(:,:,idx)) or by ist label (e.g.
J1).
coupling propertiesspinw.coupling field:matom.r(:,atom1) $\rightarrow$ matom.r(:,atom2) + dlidx), starting with 1mat_idx)The bonds are generated from the magnetic lattice and the space group (if any) using the
spinw.gencoupling() method:
maxDistance option determines the maximum bond length that will be generatedspinw.addcoupling():mat)bond)subIdx)GENerates COUPLINGs
GENerates COUPLINGs
obj.coupling |
|||||||
|---|---|---|---|---|---|---|---|
dl(1,:) |
1 | 0 | 1 | 1 | 2 | 1 | ... |
dl(2,:) |
0 | 1 | -1 | 1 | 1 | 2 | ... |
dl(3,:) |
0 | 0 | 0 | 0 | 0 | 0 | ... |
atom1 |
1 | 1 | 1 | 1 | 1 | 1 | ... |
atom2 |
1 | 1 | 1 | 1 | 1 | 1 | ... |
mat_idx(1,:) |
0 | 0 | 0 | 0 | 0 | 0 | ... |
mat_idx(2,:) |
0 | 0 | 0 | 0 | 0 | 0 | ... |
mat_idx(3,:) |
0 | 0 | 0 | 0 | 0 | 0 | ... |
idx |
1 | 1 | 2 | 2 | 3 | 3 | ... |
obj.matrix |
|||
|---|---|---|---|
mat(1,:,1) |
1 | 0 | 0 |
mat(2,:,1) |
0 | 1 | 0 |
mat(3,:,1) |
0 | 0 | 1 |
GENerates COUPLINGs
spinw.gencoupling():obj.coupling |
|||||||
|---|---|---|---|---|---|---|---|
dl(1,:) |
1 | 0 | 1 | 1 | 2 | 1 | ... |
dl(2,:) |
0 | 1 | -1 | 1 | 1 | 2 | ... |
dl(3,:) |
0 | 0 | 0 | 0 | 0 | 0 | ... |
atom1 |
1 | 1 | 1 | 1 | 1 | 1 | ... |
atom2 |
1 | 1 | 1 | 1 | 1 | 1 | ... |
mat_idx(1,:) |
0 | 0 | 0 | 0 | 0 | 0 | ... |
mat_idx(2,:) |
0 | 0 | 0 | 0 | 0 | 0 | ... |
mat_idx(3,:) |
0 | 0 | 0 | 0 | 0 | 0 | ... |
idx |
1 | 1 | 2 | 2 | 3 | 3 | ... |
obj.matrix |
|||
|---|---|---|---|
mat(1,:,1) |
1 | 0 | 0 |
mat(2,:,1) |
0 | 1 | 0 |
mat(3,:,1) |
0 | 0 | 1 |
GENerates COUPLINGs
spinw.gencoupling():obj.coupling |
|||||||
|---|---|---|---|---|---|---|---|
dl(1,:) |
1 | 0 | 1 | 1 | 2 | 1 | ... |
dl(2,:) |
0 | 1 | -1 | 1 | 1 | 2 | ... |
dl(3,:) |
0 | 0 | 0 | 0 | 0 | 0 | ... |
atom1 |
1 | 1 | 1 | 1 | 1 | 1 | ... |
atom2 |
1 | 1 | 1 | 1 | 1 | 1 | ... |
mat_idx(1,:) |
0 | 0 | 0 | 0 | 0 | 0 | ... |
mat_idx(2,:) |
0 | 0 | 0 | 0 | 0 | 0 | ... |
mat_idx(3,:) |
1 | 1 | 0 | 0 | 0 | 0 | ... |
idx |
1 | 1 | 2 | 2 | 3 | 3 | ... |
sw.addcoupling('mat','J1','bond',idx)
single_ion propertiesg-tensor and external field values are stored in spinw.single_ion.
Subfields:
aniso single ion anisotropy is stored with 1xnMagAtom and a pointer to a matrixg g-tensor is nMagAtomfield stored as a row vector
To assign anisotropy use spinw.addaniso(matLabel,{atomIdx})
with matrix label and optional atom indices of labels.
Similar function spinw.addg().
mag_srt propertiesspinw.mag_str field.It can store arbitrary magnetic structures using Fourier components.
Subfields:
nExtkF
The number of magnetic moments stored in F are: nMagExt = prod(nExt)*nMagAtom
The experimental magnetization can be obtained by multiplying F with the g-tensor!
For spin wave calculation, the complex magnetic structure is converted to the rotating frame representation using the
spinw.magstr() function.
Output of spinw.magstr() is a struct with fields:
nExtknSThe representation allows an additional k=0 component parallel to n, however this is rarely used.
The conversion from Fourier components to rotating frame representation is not always possible, in this case
magstr() gives the best approximation and gives a warning. The conversion is approximate:
The spin Hamiltonian from LSWT:
Identify the symbols:
spinw.mag_str.Sspinw.coupling.atom1 $\rightarrow$ $i$spinw.coupling.atom2 $\rightarrow$ $j$spinw.coupling.dl $\rightarrow$ $m-n$spinw.matrix.mat(:,:,spinw.coupling.mat_idx) $\rightarrow$ $J$spinw.single_ion.field
cryst=spinw;
cryst.genlattice('sym','P 4','lat_const',[8 8 6]);
cryst.addatom('r',[1/4 1/4 0],’S’,1);
cryst.gencoupling;
cryst.addmatrix('label','A',’value',1-eye(3));
cryst.addaniso('A’);
cryst=spinw;
cryst.genlattice('lat_const',[8 8 6]);
cryst.addatom('r',[1/4 1/4 0],'S',1);
cryst.addatom('r',[3/4 1/4 0],'S',1);
cryst.addatom('r',[1/4 3/4 0],'S',1);
cryst.addatom('r',[3/4 3/4 0],'S',1);
cryst.gencoupling;
cryst.addmatrix('label','A','value',1-eye(3));
cryst.addaniso('A');
cryst=spinw;
cryst.genlattice('sym','P 4','lat_const',[8 8 6]);
cryst.addatom('r',[1/4 1/4 0],’S’,1);
cryst.gencoupling;
cryst.addmatrix('label','D',’value',[1 -1 0]);
cryst.addcoupling(‘mat’,'D',’bond’,1);
cryst=spinw;
cryst.genlattice('lat_const',[8 8 6]);
cryst.addatom('r',[1/4 1/4 0],'S',1);
cryst.addatom('r',[3/4 1/4 0],'S',1);
cryst.addatom('r',[1/4 3/4 0],'S',1);
cryst.addatom('r',[3/4 3/4 0],'S',1);
cryst.gencoupling;
cryst.addmatrix('label','D','mat',[1 -1 0]);
cryst.addcoupling(‘mat’,'D',’bond’,1);
swSpec = spinw.spinwave({Q1 Q2 nQ})There are a few important options:
formfacttrue: Includes magnetic form factor stored in spinw.unit_cellfalse: Magnetic form factor is not considered.gtensortrue: g-tensor is included in the spin-spin correlation function.false: g-tensor is not considered hermittrue: Colpa method is used.false: White method is usedusemextrue: Use compiled code for speedup (especially for small magnetic unit cells)false: Use MATLAB JIT codeswSpec = spinw.spinwave({Q1 Q2 nQ})swSpec structure for commensurate structures:
.omega- D:$[2\cdot nMagExt, nHkl]$, dispersion at every Q-point.Sab- D:$[3, 3, 2, \cdot nMagExt, nHkl]$, 3x3 correlation function for every omega and Q.hkl- D:$[3, nHkl]$, Q points in r.l.u..hklA- D:$[3, nHkl]$, Q points in $\unicode{x212B}^{-1}$, xyz coordinate system.incomm- Whether the spectrum is calculated in incommensurate mode..obj- Copy of the input spinw object.If there are several crystallographic twins, .omega and .Sab are packaged into a cell that contains nTwin number of matrices.
For incommensurate magnetic structures nHkl is tripled: $(k-k_m,k,k+k_m)$.
swSpec = sw_neutron(swSpec, ‘pol’,true,’uv’,{u1 v1})Calculates the polarised/unpolarised neutron scattering cross section.
New fields:
.Sperp- D:$[2\cdot nMagExt, nHkl]$, neutron scattering intensity for each .omega and Q.intP- D:$[3, 2, \cdot nMagExt, nHkl]$, polarised intensity.Pab- D:$[3, 3, 2\cdot nMagExt, nHkl]$, polarisation matrix for every mode and Q.Mab- D:$[3, 3, 2\cdot nMagExt, nHkl]$, spin-spin correlation function in the Blue-Maleev coordinate
system ($x\parallel Q$, $y$ in scattering plane, $z$ vertical)swSpec = sw_egrid(swSpec, ‘component’,{’Sxx’ ‘Syy’},’Evect’,E)Convolutes selected elements of the spin-spin correlation function.
component’: selects either a single element: ‘Sperp’, ‘S$_{xx}$+S$_{yy}$+S$_{zz}$’, ‘S$_{xx}$’, etc. or several components to compare: {‘S$_{xx}$’, ‘S$_{yy}$’}, etc.Evect': energy bin (bin edges)New fields:
.swConv- D:$[nE, nHKL]$, convoluted spectrum.swInt- D:$[nMode, nHKL]$, polarised intensityswSpec = sw_instrument(swSpec, ‘dE’,dE1, ‘dQ’, dQ1, ...)Introduces instrumental and other factors to the convoluted spectrum.
norm':true to normalize the spectrum to mbarn/meV/cell unitsNew fields:
.swRaw- D:$[nE, nHKL]$, original convoluted spectrum.norm.ki.dE.dQ
chainS = spinw;
chainS.symbolic(true)
chainS.genlattice('lat_const', [3 8 8])
chainS.addatom('r', [0 0 0], 'S', sym(1))
chainS.gencoupling;
chainS.addmatrix('label', 'J1')
chainS.addmatrix('label', 'J2')
chainS.addcoupling('mat', 'J1', 'bond', 1);
chainS.addcoupling('mat', 'J2', 'bond', 2);
chainS.genmagstr('mode', 'helical', 'k', sym([1/2 0 0]), 'nExt',[2 1 1], 'n', sym([0 0 1]), 'S', sym([0 1 0])');
chSpecSym = chainS.spinwave;
$$-(e^{-4\pi h i} - 1)\sqrt{J_2^2 - 2J_2^2e^{4\pi h i} +J_2^2e^{8\pi h i} - J_1^2e^{4\pi h i} + 4J_1J_2e^{4\pi h i}}$$
$$ 2\cos (2\pi h)\sqrt{J_1^2 + 4J_1J_2 - 4J_2^2\sin^2(2\pi h) }$$
To generate the dispersion
syms('J1','J2');
omega1 = subs(chSpecSym.omega(1),[J1 J2],[1 0.2]);
ezplot(real(omega1),[0 1])