Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Artemkth opened this issue Apr 21, 2024 · 3 comments · Fixed by #180

Comments

@Artemkth
Copy link

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
Copy link
Author

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
Copy link
Author

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

@mducle
Copy link
Member

mducle commented Apr 30, 2024

@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).

mducle added a commit that referenced this issue May 20, 2024
* Fix bug where imag always plots in auto mode #172

* Allow row vector for hkl for single point #179

* Fix inverted user colormap #131

* Refactor sw_plotspec to avoid recursive calls #132

* Add fitspec fixes suggested by K Richardson #98

* Add spinw obj to spec for twin cases in fitspec #158

* Fix spec spinw object issues in fitmode

spinwave() now creates a .obj field regardless
  When fitmode=true, this a barebones struct
  When fitmode=false, this is a full spinw object
Fix issue with sw_plotspec when using fastmode/fitmode
Add basic test for fitspec() to check twins handling

* Fix bug in sw_plotspec 'fastmode' handling

* Fix issues from review. Add change log.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants