-
Notifications
You must be signed in to change notification settings - Fork 3
Add spin-spin correlation function #83
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
Conversation
b13fc5f to
aa9d765
Compare
aa9d765 to
8627d86
Compare
daae816 to
e176675
Compare
05c6ce0 to
6c0190d
Compare
969f175 to
c880052
Compare
2319123 to
d135433
Compare
|
conversation about outputs 8th dec: we want to do away with the |
d135433 to
b9389f1
Compare
mducle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok... I've just got a few minor points, but I'm not sure why the tests are failing...
|
@mducle tests still fail but are a lot better after the changes to add a zero energy tolerance... and i've updated the examples to display the energies and sqw as two subplots on top of each other so it's a bit easier to see where the weird blow-ups are happening (it seems the only remaining massive one that won't fix itself is at small eigenvalues for the kagome example in Python) |
|
Thanks, I'll have a look at it later and will get back to you. Enjoy your break! |
mducle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to see how to fix the test discrepancies between Python and Rust calculations and found two parts where the rust calculations differ from the Python; however I still can't get the tests to pass - there is still some bug somewhere.
Looking at the values returned by Python and Rust codes I think that there is definitely some inconsistencies between the code and it's not just a matter of the intensities blowing up near regions where the eigenvalues goes to zero.
Also, both Python and Rust calculated intensities is different from the Matlab - mostly the differences are small but at some Q points they are significant so I'm still hunting this issue down...
mducle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, one last set of changes!
There two main issues causing the disagreement between Python and Rust (and hence test failures):
-
Degenerate eigenvalues: the eigenvectors for degenerate eigenvalues are not guaranteed to be unique or orthogonal by the eigendecomposition being computed in either Python or Rust - they can be any linear combination of each other and still satisfy the maths. Now, physically this is because we cannot determine separately the intensities of each degenerate mode - we can only measure their sum; And I think if we sum the intensities of degenerate modes we would find that the Rust and Python codes agree. (The sw_omegasum function in Matlab SpinW does this). However, for our tests we are just comparing the raw values and this will be different depending on the numerics of
numpyandfaer. -
There is something wrong with the
lbltdecomposition for thekagome_ferromagnetexample... I can get slightly better agreement for some Q-points by doing an addition permutation of the points but I can only get the test to pass using theldltdecomposition (which is not guaranteed to succeed)...
Anyway, below I've added suggestions for a quick fix for both these issues to get the test to pass... I'll let you decide if we keep these hacks and merge the PR or leave it open to find better solutions...
Co-authored-by: Duc Le <[email protected]>
mducle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now, tests passed!
Fixes #76
This PR also tidies up the code to increase reusability by moving lots of reused functionality into a
utils.rsfile.