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

Inconsistencies in triAF model calculations #148

Open
mducle opened this issue Jul 5, 2023 · 3 comments
Open

Inconsistencies in triAF model calculations #148

mducle opened this issue Jul 5, 2023 · 3 comments

Comments

@mducle
Copy link
Member

mducle commented Jul 5, 2023

Issue

Running successive spin wave calculations on the same triAF model sometimes generates spectra which disagree in a few bins.

Issue was original found by @williamratcliff and colleagues.

To reproduce

Run the following script:

q_start = [0, 0, 0];
q_end = [1, 1, 0];
pts = 501;
evect = linspace(0.5, 5, 500);
model = 'triAF';

s = sw_model(model, 1);
spec = sw_egrid(sw_neutron(spinwave(s, {q_start, q_end, pts})), 'component', 'Sperp', 'Evect', evect);

s2 = sw_model(model, 1);
spec2 = sw_egrid(sw_neutron(spinwave(s2, {q_start, q_end, pts})), 'component', 'Sperp', 'Evect', evect);

fprintf('\nabsolute delta %f\n', max(abs(spec.swConv(:) - spec2.swConv(:))))
dd = spec.swConv - spec2.swConv; idx = find(abs(dd)>0.01);
[dd(idx) spec.swConv(idx) spec2.swConv(idx)]

figure; pcolor(dd*10+spec.swConv); shading flat; colorbar

Sometimes it reports no discrepancies, sometimes intensities are transposed between neighbouring bins (can be seen in the figure).

If the chain or squareAF model are used instead of triAF then swConv always agree between the two runs. There seems to be something to do with the incommensurate nature of the triAF model.

@RichardWaiteSTFC
Copy link
Collaborator

I'll check whether this has been fixed by #130

@RichardWaiteSTFC
Copy link
Collaborator

Yeh this is still a problem...FYI the discrepancy occurs in bins indicated with a red cross in this image
image

@mducle
Copy link
Member Author

mducle commented Jul 7, 2023

Yeah... to be honest its small enough it usually not noticeable - except it might cause flaky tests if we didn't have such a large tolerance on the tests.

Also, I'm not entirely sure how to fix it...

So, we might have to leave this until after release 4.0

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

No branches or pull requests

2 participants