-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add new adjusted weight scheme to work with DCSF and CCF jobs #689
Conversation
…eight scheme and the SSF, van Hove function and PDF. Changed diagonal part of the partial PDF, SSF and van Hove function so that it is also consistent with the weight scheme.
…k with the MDANSE weight scheme. Corrected DCSF and DISF.
ff14155
to
19b472b
Compare
I see a potential issue with this redefinition. The original definition (A-L scheme) is reported in the literature and the partials have a well defined limit, as F(Q --> infinity, t=0) = delta_alpha,beta. The new definition does not correspond to neither the F-Z nor the A-L definitions, so the users should be warned about how to proceed if they want to use the partials. |
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.
Seems fairly sensible. A couple of questions just for my own understanding of the changes.
MDANSE/Src/MDANSE/Framework/Jobs/NeutronDynamicTotalStructureFactor.py
Outdated
Show resolved
Hide resolved
I had a think about this, we can change it so that MDANSE will have two weight schemes for properties that depend on two atom types. X-Ray, van Hove, SSF, coordination number, and PDF will use the current one, while DCSF and CCF will use a new one. DCSF and CCF will follow A-L definitions as in 1.5, but the weight scheme will be adjusted so the total is corrected. The new weight scheme will be where I think it's probably best to leave the denominator the same across the two weight schemes. @gonzalezma is this preferable? |
I think so, but we will need to check the results. In particular, I don't know how the CCF is calculated now in MDANSE and I think that I have only seen the definition of the CCF for a monatomic liquid, so I am not completely sure of the best way to handle this in a polyatomic system. |
… weight scheme has been changed for these jobs
…actor.py Co-authored-by: Jacob Wilkins <46597752+oerc0122@users.noreply.github.com> Signed-off-by: Chi Cheng <chi-yang.cheng@proton.me>
…h DCSF and DISF using the apply weight option in the plotter
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.
All looks good functionally.
Just to double check, are there comparison plots of these new factors?
MDANSE/Src/MDANSE/Framework/Jobs/NeutronDynamicTotalStructureFactor.py
Outdated
Show resolved
Hide resolved
The plots will be the weighted versions, so they are scaled by the scaling factor. The recent changes allow you to plot the unweighed ones as well; previously, you could only plot the weighted ones, as the scaling factor was set to 1. |
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.
Happy with this if it's working as it should. LGTM.
Description of work
Some prefactors involving two atom types were not compatible with the MDANSE weight scheme, so the weighted total was not equal to (or equal to within a scaling factor) the proper total result.
The following changes have been made.
A new adjusted weight scheme has been created
to be used with DCSF and CCF. With this weight scheme, the DCSF total is calculated properly
therefore
so the results from the DCSF are just a scaled version of the NTDSF results.
This makes the MDANSE calculations consistent with itself. Results from the DCSF and DISF are consistent with the NTDSF results (they are the same up to some scaling factor). Here, I plot the$F_{\text{coh}}(q,0)$ results from the DCSF and NTDSF calculation using an Argon trajectory where I've randomly assigned the atom types to Test1 and Test2 which have the same b_inc and b_coh but with concentrations of 0.25 and 0.75.
Note that I plot the weighted partials$W_{\alpha\beta} F_{\text{coh},\alpha\beta}(q,0)$ from DCSF and $\sqrt{c_{\alpha}c_{\beta}}b_{\alpha} b_{\beta} F_{\text{coh},\alpha\beta}(q,0)$ from NTDSF so that you can see they are the same as the NTDSF except for some scaling factor. I have updated NTDSF results file so that you can also plot $F_{\text{coh},\alpha\beta}(q,t)$ by deselecting the "apply weight?" option in the plotter as with the DCSF results.
I also did the test for the SSF and DCSF for this system.
The blue plots are from the (unweighted) partials SSF results, and the orange plots are the partial intermediate scattering function from the DCSF for t=0 converted to the F-Z formalism using
Fixes
Fixes #683
To test
Run the DCSF, DISF and NTDSF calculations. Compare the DCSF results with the coherent results in NTDSF they should be equivalent to some scaling factor.