SpinW / spinw

SpinW Matlab library for spin wave calculation
http://www.spinw.org
GNU General Public License v3.0
35 stars 15 forks source link

Bug in assigning eigenvalues to spinwave modes #169

Open RichardWaiteSTFC opened 5 months ago

RichardWaiteSTFC commented 5 months ago

To reproduce (1) Run this script

nqbins = 11
ebin_edge = 0:0.2:6;
FMchain = spinw;
FMchain.genlattice('lat_const',[3 8 8],'angled',[90 90 90],'spgr',0);
FMchain.addatom('r',[0 0 0],'S',1,'label','MCu1','color','blue');
FMchain.gencoupling('maxDistance',7)
FMchain.addmatrix('value', eye(3),'label','Ja','color','green')
FMchain.addcoupling('mat','Ja','bond',1);
FMchain.genmagstr('mode','direct', 'k',[0 0 0],'n',[1 0 0],'S',[0; 1; 0]);
FMspec = FMchain.spinwave({[0 0 0] [1 0 0], nqbins},'hermit',false); % , 'sortMode', true);
FMspec = sw_egrid(FMspec,'component','Sperp', 'Evect', ebin_edge);
FMspec.omega

prints

    0.0000    0.3820    1.3820    2.6180    3.6180    4.0000    3.6180    2.6180    1.3820   -0.3820   -0.0000
   -0.0000   -0.3820   -1.3820   -2.6180   -3.6180   -4.0000   -3.6180   -2.6180   -1.3820    0.3820    0.0000

The eigenvalue of the modes has been swapped in the penultimate q point image