-
Notifications
You must be signed in to change notification settings - Fork 17
Description
I don't know where the setting went wrong. This has caused an abnormal dispersion relationship from G to A. How should I solve this problem?
% Create a SpinW object
FMsq = spinw;
% Generate the lattice
FMsq.genlattice('lat_const', [4.074 4.074 15.723], 'angled', [90 90 120]);
% Add atoms to the lattice
FMsq.addatom('r', [0.3333, 0.6667, 0.25], 'S', 2.38, 'label', 'MFe1', 'color', 'blue');
FMsq.addatom('r', [0.6667, 0.3333, 0.75], 'S', 2.38, 'label', 'MFe2', 'color', 'black');
FMsq.addatom('r', [0.0000, 0.0000, 0.1758], 'S', 1.41, 'label', 'MFe3', 'color', 'black');
FMsq.addatom('r', [0.0000, 0.0000, 0.3242], 'S', 1.41, 'label', 'MFe4', 'color', 'black');
FMsq.addatom('r', [0.0000, 0.0000, 0.6758], 'S', 1.41, 'label', 'MFe5', 'color', 'black');
FMsq.addatom('r', [0.0000, 0.0000, 0.8242], 'S', 1.41, 'label', 'MFe6', 'color', 'black');
% Plot the structure
FMsq.plot('range', [5 5 4]);
% Generate the coupling
FMsq.gencoupling('maxDistance', 15);
FMsq.table('bond', 1:3);
% Define exchange interactions
J1 = 5.718; % meV
J2 = 1.702; % meV
J3 = -0.092; % meV
% Add exchange matrices
FMsq.addmatrix('value', J1 * -eye(3), 'label', 'J1', 'color', 'green');
FMsq.addmatrix('value', J2 * -eye(3), 'label', 'J2', 'color', 'black');
FMsq.addmatrix('value', J3 * -eye(3), 'label', 'J3', 'color', 'blue');
% Assign exchange interactions to bonds
FMsq.addcoupling('mat', 'J1', 'bond', 1);
FMsq.addcoupling('mat', 'J2', 'bond', 2);
FMsq.addcoupling('mat', 'J3', 'bond', 3);
% Plot the structure with the couplings
plot(FMsq, 'range', [5 5 4], 'cellMode', 'none', 'baseMode', 'none');
% Generate the magnetic structure
%S = [0 0 ; 1 1 ; 0 0]; % Example matrix, modify as needed
%FMsq.genmagstr('mode', 'direct', 'k', [0 0 0], 'S', S);
FMsq.genmagstr('mode','helical','k',[0 0 0],'n',[0 0 1],'S',[0 0 1]')
FMsq.table('mag')
% Display the magnetic structure
disp('Magnetic structure:');
FMsq.table('mag');
plot(FMsq, 'range', [5 5 4], 'baseMode', 'none', 'cellMode', 'none');
% Define the Brillouin zone path and labels
Qlist = {[0 0 0], [0.5 0 0], [0.333 0.333 0], [0 0 0], [0 0 0.5], [0.5 0 0.5]}; % G M K G A L
Qlab = {'\Gamma', 'M', 'K', '\Gamma', 'A', 'L'};
% Calculate the spin wave spectrum along the specified path
FMspec = FMsq.spinwave(Qlist, 'hermit', false);
Zc = 1.0; % Scaling factor for omega
FMspec.omega = FMspec.omega * Zc;
% Apply neutron scattering effects at 0K
FMspec = sw_neutron(FMspec, 'T', 0);
FMspec = sw_egrid(FMspec, 'component', 'Sperp');
% Plot the magnon dispersion and intensity
figure;
subplot(2, 1, 1);
sw_plotspec(FMspec, 'mode', 3, 'axLim', [0 5], 'dE', 35, 'dashed', true, 'qlabel', Qlab);
colorbar off;
subplot(2, 1, 2);
FMspec = sw_omegasum(FMspec, 'zeroint', 1e-5, 'tol', 1e-3);
sw_plotspec(FMspec, 'mode', 2, 'axLim', [0 20], 'dashed', true, 'colormap', [0 0 0], 'qlabel', Qlab);
swplot.subfigure(1, 3, 1);
% Calculate and plot powder-averaged spectrum
FMpowspec = FMsq.powspec(linspace(0, 5, 120), 'Evect', linspace(0, 120, 250), 'nRand', 1000, 'hermit', false);
figure;
sw_plotspec(FMpowspec, 'dE', 0.1);
axis([0 5 0 120]);
caxis([0 .05]);
title('Powder-Averaged Spectrum at 100K');
xlabel('Q (Å^{-1})');
ylabel('Energy (meV)');
colorbar;
% Plot the magnon dispersion
figure;
sw_plotspec(FMspec, 'mode', 1, 'qlabel', Qlab);
title('Magnon Dispersion');
xlabel('Wave Vector');
ylabel('Energy (meV)');
