-
Notifications
You must be signed in to change notification settings - Fork 143
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
Higher-order finite difference #504
Higher-order finite difference #504
Conversation
…osition_higher
Except the test The order of b-vectors file has been changed by the subroutine |
bvecs in benchmark, and the lines in |
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.
Higher order functionality coded neatly and consistently with new code style. Tests all pass correctly and new functionality is tested and documented appropriately.
The formula for calculating derivatives in k-space has so far been calculated using the first-order finite-difference(FD) approximation. This PR adds the higher-order FD to make
.nnkp
files. The main changes are inkmesh.f90.
Suppose the first-order FD uses b-vectors. The main strategy of n-th order(n>1) FD is to add 2b, 3b, ... nb vectors, and apply more conditions like Eq. (B1) in [1] to calculate the finite difference coefficients w_b, w_2b, w_3b, ... w_nb.
The scheme is in the same way as we did in one-dimension(see https://en.wikipedia.org/wiki/Finite_difference_coefficient)
This PR includes
New parameters:
higher_order_n
: default is 1(1st-order).higher_order_nearest_shells
: default is.false.
. If true, the routine uses the nearest shells to satisfy the conditions like (B1). Not extensively tested, and it is an experimental feature.New tests:
testw90_nnkpt6
: a test for the higher-order bvectors and weights. output:.nnkp
testw90_nnkpt7
: a test for the higher-order bvectors and bweights, using the nearest-shells method. output:.nnkp
testw90_knbo3_higher
: a test for the Wannier position matrix elements and spreads using higher-order finite difference. output:.wout
testpostw90_pt_shc_higher
: a test for the spin hall conductivity using higher-order finite difference. output:-shc-fermiscan.dat
[1] N. Marzari and D. Vanderbilt, Physical Review B 56, 12847 (1997)