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

3D spinW plots #187

Closed SrimalR closed 3 months ago

SrimalR commented 4 months ago

Is there a way to plot 3D spin wave dispersion plots in spinW? I want to plot H,-H vs L with energy plot as in the figure.

Screen Shot 2022-10-28 at 5 03 18 PM
mducle commented 3 months ago

@SrimalR - there's no method implemented in SpinW to do this but you can do it yourself by generating a grid, calling spinwave() on that grid and then using surf to plot the magnon energies omega. The main difficulty is that the eigenvalues in omega are not sorted so unless the system is very simple and there are no mode crossings you'll have to work out how to disentangle the modes yourself...

The following code will work for a simple system... for more complex systems with mode crossings and other degeneracies, ymmv...

swo = sw_model('chain', 1);
[hh,kk] = meshgrid(-1:0.02:1, -1:0.02:1);    % Create a grid for surf()
spc = swo.spinwave([hh(:) kk(:) hh(:)*0]');  % Compute spin waves on this grid
% Plot using surf - note that the first eigenvalues is spc.omega(1,:), second is spc.omega(2,:) etc
figure; surf(hh,kk,reshape(spc.omega(1,:),size(hh,1),size(hh,2)))
SrimalR commented 3 months ago

Hi @mducle,

Thank you for your reply. This will be helpful. My system is complex with 6 exchange interactions and exchange anisotropies. I will try to do the calculations and plot the surf plot as in your code.