w90_ws_distance Module

This module computes the optimal Wigner-Seitz cell around each Wannier function to use for interpolation.


Uses

  • module~~w90_ws_distance~~UsesGraph module~w90_ws_distance w90_ws_distance module~w90_constants w90_constants module~w90_ws_distance->module~w90_constants module~w90_error w90_error module~w90_ws_distance->module~w90_error module~w90_comms w90_comms module~w90_error->module~w90_comms module~w90_error_base w90_error_base module~w90_error->module~w90_error_base module~w90_comms->module~w90_constants module~w90_comms->module~w90_error_base

Used by

  • module~~w90_ws_distance~~UsedByGraph module~w90_ws_distance w90_ws_distance proc~hamiltonian_get_rmn hamiltonian_get_rmn proc~hamiltonian_get_rmn->module~w90_ws_distance proc~operator_wigner_setup operator_wigner_setup proc~operator_wigner_setup->module~w90_ws_distance proc~plot_interpolate_bands plot_interpolate_bands proc~plot_interpolate_bands->module~w90_ws_distance proc~plot_main plot_main proc~plot_main->module~w90_ws_distance proc~pw90common_fourier_r_to_k pw90common_fourier_R_to_k proc~pw90common_fourier_r_to_k->module~w90_ws_distance proc~pw90common_fourier_r_to_k_new pw90common_fourier_R_to_k_new proc~pw90common_fourier_r_to_k_new->module~w90_ws_distance proc~pw90common_fourier_r_to_k_new_second_d pw90common_fourier_R_to_k_new_second_d proc~pw90common_fourier_r_to_k_new_second_d->module~w90_ws_distance proc~pw90common_fourier_r_to_k_new_second_d_tb_conv pw90common_fourier_R_to_k_new_second_d_TB_conv proc~pw90common_fourier_r_to_k_new_second_d_tb_conv->module~w90_ws_distance proc~pw90common_fourier_r_to_k_vec pw90common_fourier_R_to_k_vec proc~pw90common_fourier_r_to_k_vec->module~w90_ws_distance proc~pw90common_fourier_r_to_k_vec_dadb pw90common_fourier_R_to_k_vec_dadb proc~pw90common_fourier_r_to_k_vec_dadb->module~w90_ws_distance proc~pw90common_fourier_r_to_k_vec_dadb_tb_conv pw90common_fourier_R_to_k_vec_dadb_TB_conv proc~pw90common_fourier_r_to_k_vec_dadb_tb_conv->module~w90_ws_distance proc~pw90common_wanint_setup pw90common_wanint_setup proc~pw90common_wanint_setup->module~w90_ws_distance proc~wigner_seitz_opt_setup wigner_seitz_opt_setup proc~wigner_seitz_opt_setup->module~w90_ws_distance

Variables

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)


Subroutines

public subroutine ws_translate_dist(ws_distance, ws_region, num_wann, wannier_centres, real_lattice, mp_grid, nrpts, irvec, error, comm, force_recompute)

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.

Arguments

Type IntentOptional 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

private subroutine R_wz_sc(R_in, R0, ndeg, R_out, shifts, mp_grid, real_lattice, inv_lattice, ws_search_size, ws_distance_tol, error, comm)

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)

Arguments

Type IntentOptional 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

public subroutine ws_write_vec(ws_distance, nrpts, irvec, num_wann, use_ws_distance, write_ndegen_applied, seedname, error, 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.

Read more…

Arguments

Type IntentOptional 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

public subroutine ws_expand_rvec(ws_distance, use_ws_distance, num_wann, nrpts, irvec, ndegen, irvec_full, nrpts_full, ir_map, ir_origin, error, 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.

Read more…

Arguments

Type IntentOptional 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

public subroutine ws_apply_ndegen(ws_distance, use_ws_distance, num_wann, nrpts, ndegen, nrpts_full, ir_map, op_R, op_R_full)

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.

Arguments

Type IntentOptional 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

public subroutine clean_ws_translate(ws_distance, error, comm)

Arguments

Type IntentOptional 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