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

optimaize antisymmetric interaction #188

Closed mkmk0324 closed 3 months ago

mkmk0324 commented 3 months ago

Hello. How can I optimize antisymmetric interactions? For example, if I want to include the z component of the DM interaction, D(matrix) = [0,D,0;-D,0,0;0,0,0] but, par_fit.func = @(obj,p)matparser(obj,'param',p,'mat',{},'init',true); What should I write in the part? In other words, can I put a constraint condition (D(1,2)=-D(2,1)) on D(1,2) and D(2,1)?

Also, is there a solution if I want to put a constraint condition on more than three terms, like the xy component of the DM interaction?

mducle commented 3 months ago

@mkmk0324 You can use the 'selector' argument of matparser as described in the documentation. E.g.

param = [J1, DM];
mat = {'J1', 'DM'};
sel = cat(3, eye(3), [0 1 0; -1 0 0; 0 0 0]);
par_fit.func = @(obj, p) matparser(obj, 'param', p, 'mat', mat, 'selector', sel, 'init', true);

Note that you have to give a selector matrix for every parameter.

mkmk0324 commented 3 months ago

Thank you for your prompt reply. I understood. This is a very useful feature that can be extended to many different cases. It was very helpful! Thanks.