-
Notifications
You must be signed in to change notification settings - Fork 145
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 options for sorting b vectors #539
base: develop
Are you sure you want to change the base?
Conversation
if ((.not. common_data%kmesh_input%order_b_vectors) .and. & | ||
common_data%wann_control%use_ss_functional) then | ||
call set_error_input(error, 'Error: If use_ss_functional is true, & | ||
order_b_vector must be true. ', common_data%comm) | ||
return | ||
endif |
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.
Probably we need to add this check to the library interface w90_input_setopt
as well, i.e. after this line
wannier90/src/library_interface.F90
Line 347 in 93f4abf
common_data%comm) |
But this will duplicate the same code, pinging @JeromeCCP9 maybe you have a better place of organizing these checks?
In addition, there is a binary file |
Hi Junfeng! I did that removal in pr #540 |
Co-authored-by: Junfeng Qiao <[email protected]>
Dear Seung-Ju and Junfeng, please can you tell me why we don't simply always sort the b-vectors? (i.e. default kmesh_input%order_b_vectors to T) Is the sort algorithm ok, or does it scale terribly or so? This would allow the Stengler-Spalding functional to be activated with only a single option setting, which clearly is preferable. If somebody requires the "not-sorted" behaviour, then they would deliberately choose to deactivate the sorting. With many thanks, |
Hi Jerome,
It is simply because of backward compatibility. The order of b-vectors will influence the
I think the scaling is fine.
It might be a little bit inconvenient (or dangerous) for a user--I ran But since v4 changes a lot, we can default it to Best, |
Hi! I see! Yes, this is more tricky than it seemed :) Maybe we could look at it the other way around: w90 sets up it's vectors in whatever order it currently follows (so, the nnkp files will be the same, and so the mmn, etc remain backwards compatible) and if we need sorted b-vectors (eg for the S.S. functional) then we apply this b-vector permutation to the (already readin) mmn, etc? This way would mean that the ordering exposed to the outside world remains the same as before and it allows the S.S. method to be used for existing mmn, etc, data. |
So you mean the S.S. method will explicitly sort bvector after reading the "standard" The only catch is that, one needs to implement this sorting function after reading |
Sorry for the late reply.
Actually, the
The problems are in |
This pull request adds the option of sorting the b vectors. This resolves the issue #538.
The checkpoint files modified to sorted b vector orders in #498 and #533 were restored to the previous b vector order for backward compatibility.
The default value of
order_b_vectors
isfalse
. Also, it raises an error if one does not sort the b vectors for Stengel-Spaldin functional or translation invariance.