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

Unclear documentation about calculating spinwave spectra (or potentially a python regression) #179

Closed Artemkth closed 4 months ago

Artemkth commented 4 months ago

On this page it is mentioned that one is able to launch spinwave solver just for a single k point symbolically by calling it like so: Q = sym([0 1 0]); it is not clear (to me) whether it is possible to do this numerically too. When I try using similar syntaxis, but without sym wrapper, I end up with error about matrix multiplication.

I have hacked around this limitation like so nips.spinwave(([0, 0, 0], [0, 0, 0], 1), hermit=False) which works well enough, I could check how it works in matlab when I am back in the office tomorrow (since my matlab is complaining about me being on wrong domain for my license).

Artemkth commented 4 months ago
FMchain = spinw;
FMchain.genlattice('lat_const',[3 8 8],'angled',[90 90 90])
FMchain.addatom('r', [0 0 0],'S', 1,'label','MCu1','color','blue')
FMchain.plot('range',[3 1 1])

FMchain.gencoupling('maxDistance',7)

% list the 1st and 2nd neighbor bonds
FMchain.table('bond',1:2)

FMchain.addmatrix('value',-eye(3),'label','Ja','color','green')
FMchain.addcoupling('mat','Ja','bond',1);
plot(FMchain,'range',[3 0.2 0.2],'cellMode','none','baseMode','none')

FMchain.genmagstr('mode','direct', 'k',[0 0 0],'n',[1 0 0],'S',[0; 1; 0]);

disp('Magnetic structure:')
FMchain.table('mag')
plot(FMchain,'range',[3 0.9 0.9],'baseMode','none','cellMode','none')

Q = sym([0 1 0])
FMchain.spinwave(Q)

I tried the following in matlab, and get the same error as in python, with a better error message: 'Error in spinw/spinwave (line 371) hkl = obj.unit.qmat*hkl; '

Artemkth commented 4 months ago

Thank you @mducle , sorry I keep throwing more work at you :)

mducle commented 4 months ago

@Artemkth no problems... it's good to fix these things.

We need to do some updates of the build process to handle both Intel and Apple-Silicon Macs (at the moment we only have one Mac build which was for Intel but github recently upgraded all their servers to Apple-Silicon so now we only have that build) but then we'll make a release (probably around mid-May).