This module computes the optimal Wigner-Seitz cell around each Wannier function to use for interpolation.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private, | parameter | :: | ndegenx | = | 8 |
max number of unit cells that can touch in a single point (i.e. vertex of cube) |
Find the supercell translation (i.e. the translation by a integer number of supercell vectors, the supercell being defined by the mp_grid) that minimizes the distance between two given Wannier functions, i and j, the first in unit cell 0, the other in unit cell R. I.e., we find the translation to put WF j in the Wigner-Seitz of WF i. We also look for the number of equivalent translation, that happen when w_j,R is on the edge of the WS of w_i,0. The results are stored in global arrays wdist_ndeg, irdist_ws, crdist_ws.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ws_distance_type), | intent(inout) | :: | ws_distance | |||
| type(ws_region_type), | intent(in) | :: | ws_region | |||
| integer, | intent(in) | :: | num_wann | |||
| real(kind=dp), | intent(in) | :: | wannier_centres(:,:) | |||
| real(kind=dp), | intent(in) | :: | real_lattice(3,3) | |||
| integer, | intent(in) | :: | mp_grid(3) | |||
| integer, | intent(in) | :: | nrpts | |||
| integer, | intent(in) | :: | irvec(:,:) | |||
| type(w90_error_type), | intent(out), | allocatable | :: | error | ||
| type(w90_comm_type), | intent(in) | :: | comm | |||
| logical, | intent(in), | optional | :: | force_recompute |
Put R_in in the Wigner-Seitz cell centered around R0, and find all equivalent vectors to this (i.e., with same distance). Return their coordinates and the degeneracy, as well as the integer shifts needed to get the vector (these are always multiples of the mp_grid, i.e. they are supercell displacements in the large supercell)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=DP), | intent(in) | :: | R_in(3) | |||
| real(kind=DP), | intent(in) | :: | R0(3) | |||
| integer, | intent(out) | :: | ndeg | |||
| real(kind=DP), | intent(out) | :: | R_out(3,ndegenx) | |||
| integer, | intent(out) | :: | shifts(3,ndegenx) | |||
| integer, | intent(in) | :: | mp_grid(3) | |||
| real(kind=dp), | intent(in) | :: | real_lattice(3,3) | |||
| real(kind=dp), | intent(in) | :: | inv_lattice(3,3) | |||
| integer, | intent(in) | :: | ws_search_size(3) | |||
| real(kind=dp), | intent(in) | :: | ws_distance_tol | |||
| type(w90_error_type), | intent(out), | allocatable | :: | error | ||
| type(w90_comm_type), | intent(in) | :: | comm |
Write to file the lattice vectors of the superlattice to be added to R vector in seedname_hr.dat, seedname_rmn.dat, etc. in order to have the second Wannier function inside the WS cell of the first one.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ws_distance_type), | intent(in) | :: | ws_distance | |||
| integer, | intent(in) | :: | nrpts | |||
| integer, | intent(in) | :: | irvec(3,nrpts) | |||
| integer, | intent(in) | :: | num_wann | |||
| logical, | intent(in) | :: | use_ws_distance | |||
| logical, | intent(in) | :: | write_ndegen_applied | |||
| character(len=50), | intent(in) | :: | seedname | |||
| type(w90_error_type), | intent(out), | allocatable | :: | error | ||
| type(w90_comm_type), | intent(in) | :: | comm |
Build the fully expanded list of lattice vectors, i.e. the set of all R + T that occur in the Wigner-Seitz mapping computed by ws_translate_dist, together with the index map ir_map(ideg, i, j, ir) that sends a degenerate image of the pair (i, j) at the folded vector irvec(:, ir) to its position in that list.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ws_distance_type), | intent(in) | :: | ws_distance | |||
| logical, | intent(in) | :: | use_ws_distance | |||
| integer, | intent(in) | :: | num_wann | |||
| integer, | intent(in) | :: | nrpts | |||
| integer, | intent(in) | :: | irvec(3,nrpts) | |||
| integer, | intent(in) | :: | ndegen(nrpts) | |||
| integer, | intent(out), | allocatable | :: | irvec_full(:,:) | ||
| integer, | intent(out) | :: | nrpts_full | |||
| integer, | intent(out), | allocatable | :: | ir_map(:,:,:,:) | ||
| integer, | intent(out) | :: | ir_origin |
index of R = 0 in the expanded list |
||
| type(w90_error_type), | intent(out), | allocatable | :: | error | ||
| type(w90_comm_type), | intent(in) | :: | comm |
Divide a real-space operator by its degeneracy weights and spread it over the expanded lattice-vector list built by ws_expand_rvec, so that it can be Fourier transformed with a plain sum over exp(i k.R), irrespective of use_ws_distance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ws_distance_type), | intent(in) | :: | ws_distance | |||
| logical, | intent(in) | :: | use_ws_distance | |||
| integer, | intent(in) | :: | num_wann | |||
| integer, | intent(in) | :: | nrpts | |||
| integer, | intent(in) | :: | ndegen(nrpts) | |||
| integer, | intent(in) | :: | nrpts_full | |||
| integer, | intent(in) | :: | ir_map(:,:,:,:) | |||
| complex(kind=dp), | intent(in) | :: | op_R(num_wann,num_wann,nrpts) |
operator on the folded grid, before applying the degeneracy weights |
||
| complex(kind=dp), | intent(out) | :: | op_R_full(num_wann,num_wann,nrpts_full) |
operator on the expanded grid, after applying the degeneracy weights |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ws_distance_type), | intent(inout) | :: | ws_distance | |||
| type(w90_error_type), | intent(out), | allocatable | :: | error | ||
| type(w90_comm_type), | intent(in) | :: | comm |