w90_wannierise_mod Module

Main routines for the minimisation of the spread


Uses

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

Used by

  • module~~w90_wannierise_mod~~UsedByGraph module~w90_wannierise_mod w90_wannierise_mod proc~w90_wannierise~2 w90_wannierise proc~w90_wannierise~2->module~w90_wannierise_mod

Derived Types

type, private ::  localisation_vars_type

Contributions to the spread

Components

Type Visibility Attributes Name Initial
real(kind=dp), public :: om_i

Gauge Invarient

real(kind=dp), public :: om_d

Diagonal

real(kind=dp), public :: om_od

Off-diagonal

real(kind=dp), public :: om_tot

Total

real(kind=dp), public :: om_iod

Combined I-OD term for selective localization

real(kind=dp), public :: om_nu

Lagrange multiplier term due to constrained centres


Subroutines

public subroutine wann_main(ham_logical, kmesh_info, kpt_latt, wann_control, omega, sitesym, print_output, wannier_data, ws_region, w90_calculation, ham_k, ham_r, m_matrix_loc, u_matrix, real_lattice, wannier_centres_translated, irvec, mp_grid, ndegen, nrpts, num_kpts, num_proj, num_wann, optimisation, rpt_origin, bands_plot_mode, transport_mode, lsitesymmetry, stdout, timer, dist_k, error, comm)

Calculate the Unitary Rotations to give Maximally Localised Wannier Functions

Arguments

Type IntentOptional Attributes Name
type(ham_logical_type), intent(inout) :: ham_logical
type(kmesh_info_type), intent(in) :: kmesh_info
real(kind=dp), intent(in) :: kpt_latt(:,:)
type(wann_control_type), intent(inout) :: wann_control
type(wann_omega_type), intent(inout) :: omega
type(sitesym_type), intent(in) :: sitesym
type(print_output_type), intent(in) :: print_output
type(wannier_data_type), intent(inout) :: wannier_data
type(ws_region_type), intent(in) :: ws_region
type(w90_calculation_type), intent(in) :: w90_calculation
complex(kind=dp), intent(inout), allocatable :: ham_k(:,:,:)
complex(kind=dp), intent(inout), allocatable :: ham_r(:,:,:)
complex(kind=dp), intent(inout) :: m_matrix_loc(:,:,:,:)
complex(kind=dp), intent(inout) :: u_matrix(:,:,:)
real(kind=dp), intent(in) :: real_lattice(3,3)
real(kind=dp), intent(inout), allocatable :: wannier_centres_translated(:,:)
integer, intent(inout), allocatable :: irvec(:,:)
integer, intent(in) :: mp_grid(3)
integer, intent(inout), allocatable :: ndegen(:)
integer, intent(inout) :: nrpts
integer, intent(in) :: num_kpts
integer, intent(in) :: num_proj
integer, intent(in) :: num_wann
integer, intent(in) :: optimisation
integer, intent(inout) :: rpt_origin
character(len=*), intent(in) :: bands_plot_mode
character(len=*), intent(in) :: transport_mode
logical, intent(in) :: lsitesymmetry
integer, intent(in) :: stdout
type(timer_list_type), intent(inout) :: timer
integer, intent(in) :: dist_k(:)
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

private subroutine wann_phases(csheet, sheet, rguide, irguide, num_wann, kmesh_info, num_kpts, use_ss_functional, m_matrix_loc, timing_level, iprint, timer, nkrank, global_k, error, comm, m_w)

Uses guiding centres to pick phases which give a consistent choice of branch cut for the spread definition

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(out) :: csheet(:,:,:)

Choice of phase

real(kind=dp), intent(out) :: sheet(:,:,:)

Choice of branch cut

real(kind=dp), intent(inout) :: rguide(:,:)

Guiding centres

integer, intent(in) :: irguide

Zero if first call to this routine

integer, intent(in) :: num_wann
type(kmesh_info_type), intent(in) :: kmesh_info
integer, intent(in) :: num_kpts
logical, intent(in) :: use_ss_functional
complex(kind=dp), intent(in) :: m_matrix_loc(:,:,:,:)
integer, intent(in) :: timing_level
integer, intent(in) :: iprint
type(timer_list_type), intent(inout) :: timer
integer, intent(in) :: nkrank
integer, intent(in) :: global_k(:)
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm
real(kind=dp), intent(in), optional :: m_w(:,:,:)

private subroutine wann_omega(csheet, sheet, rave, r2ave, rave2, wann_spread, num_wann, kmesh_info, num_kpts, print_output, use_ss_functional, wann_slwf, omega_invariant, ln_tmp_loc, m_matrix_loc, lambda_loc, first_pass, timer, nkrank, global_k, error, comm)

Calculate the Wannier Function spread

Read more…

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: csheet(:,:,:)
real(kind=dp), intent(in) :: sheet(:,:,:)
real(kind=dp), intent(out) :: rave(:,:)
real(kind=dp), intent(out) :: r2ave(:)
real(kind=dp), intent(out) :: rave2(:)
type(localisation_vars_type), intent(out) :: wann_spread
integer, intent(in) :: num_wann
type(kmesh_info_type), intent(in) :: kmesh_info
integer, intent(in) :: num_kpts
type(print_output_type), intent(in) :: print_output
logical, intent(in) :: use_ss_functional
type(wann_slwf_type), intent(in) :: wann_slwf
real(kind=dp), intent(in) :: omega_invariant
real(kind=dp), intent(inout) :: ln_tmp_loc(:,:,:)
complex(kind=dp), intent(in) :: m_matrix_loc(:,:,:,:)
real(kind=dp), intent(in) :: lambda_loc
logical, intent(inout) :: first_pass
type(timer_list_type), intent(inout) :: timer
integer, intent(in) :: nkrank
integer, intent(in) :: global_k(:)
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

private subroutine wann_domega(csheet, sheet, rave, num_wann, kmesh_info, num_kpts, wann_slwf, use_ss_functional, lsitesymmetry, ln_tmp_loc, m_matrix_loc, rnkb_loc, cdodq_loc, lambda_loc, timing_level, sitesym, timer, nkrank, global_k, error, comm, iprint, cdodq)

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: csheet(:,:,:)
real(kind=dp), intent(in) :: sheet(:,:,:)
real(kind=dp), intent(out) :: rave(:,:)
integer, intent(in) :: num_wann
type(kmesh_info_type), intent(in) :: kmesh_info
integer, intent(in) :: num_kpts
type(wann_slwf_type), intent(inout) :: wann_slwf
logical, intent(in) :: use_ss_functional
logical, intent(in) :: lsitesymmetry
real(kind=dp), intent(inout) :: ln_tmp_loc(:,:,:)
complex(kind=dp), intent(in) :: m_matrix_loc(:,:,:,:)
real(kind=dp), intent(inout) :: rnkb_loc(:,:,:)
complex(kind=dp), intent(out) :: cdodq_loc(:,:,:)
real(kind=dp), intent(in) :: lambda_loc
integer, intent(in) :: timing_level
type(sitesym_type), intent(in) :: sitesym
type(timer_list_type), intent(inout) :: timer
integer, intent(in) :: nkrank
integer, intent(in) :: global_k(:)
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm
integer, intent(in) :: iprint
complex(kind=dp), intent(out), optional :: cdodq(:,:,:)

private subroutine wann_spread_copy(orig, copy)

Arguments

Type IntentOptional Attributes Name
type(localisation_vars_type), intent(in) :: orig
type(localisation_vars_type), intent(out) :: copy

private subroutine wann_check_unitarity(num_kpts, num_wann, u_matrix, timing_level, iprint, stdout, timer, error, comm)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: num_kpts
integer, intent(in) :: num_wann
complex(kind=dp), intent(in) :: u_matrix(:,:,:)
integer, intent(in) :: timing_level
integer, intent(in) :: iprint
integer, intent(in) :: stdout
type(timer_list_type), intent(inout) :: timer
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

public subroutine wann_main_gamma(kmesh_info, wann_control, omega, print_output, wannier_data, m_matrix, u_matrix, real_lattice, num_kpts, num_wann, stdout, timer, error, comm)

Arguments

Type IntentOptional Attributes Name
type(kmesh_info_type), intent(in) :: kmesh_info
type(wann_control_type), intent(inout) :: wann_control
type(wann_omega_type), intent(inout) :: omega
type(print_output_type), intent(in) :: print_output
type(wannier_data_type), intent(inout) :: wannier_data
complex(kind=dp), intent(inout) :: m_matrix(:,:,:,:)
complex(kind=dp), intent(inout) :: u_matrix(:,:,:)
real(kind=dp), intent(in) :: real_lattice(3,3)
integer, intent(in) :: num_kpts
integer, intent(in) :: num_wann
integer, intent(in) :: stdout
type(timer_list_type), intent(inout) :: timer
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

private subroutine wann_omega_gamma(m_w, csheet, sheet, rave, r2ave, rave2, wann_spread, num_wann, nntot, wbtot, wb, bk, omega_invariant, ln_tmp, first_pass, timing_level, timer, error, comm)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: m_w(:,:,:)
complex(kind=dp), intent(in) :: csheet(:,:,:)
real(kind=dp), intent(in) :: sheet(:,:,:)
real(kind=dp), intent(out) :: rave(:,:)
real(kind=dp), intent(out) :: r2ave(:)
real(kind=dp), intent(out) :: rave2(:)
type(localisation_vars_type), intent(out) :: wann_spread
integer, intent(in) :: num_wann
integer, intent(in) :: nntot
real(kind=dp), intent(in) :: wbtot
real(kind=dp), intent(in) :: wb(:)
real(kind=dp), intent(in) :: bk(:,:,:)
real(kind=dp), intent(in) :: omega_invariant
real(kind=dp), intent(out) :: ln_tmp(:,:,:)
logical, intent(inout) :: first_pass
integer, intent(in) :: timing_level
type(timer_list_type), intent(inout) :: timer
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

private subroutine internal_test_convergence(old_spread, wann_spread, history, save_spread, iter, conv_count, noise_count, lconverged, lrandom, lfirst, wann_control, error, comm)

Determine whether minimisation of non-gauge invariant spread is converged

Arguments

Type IntentOptional Attributes Name
type(localisation_vars_type), intent(in) :: old_spread
type(localisation_vars_type), intent(in) :: wann_spread
real(kind=dp), intent(inout) :: history(:)
real(kind=dp), intent(inout) :: save_spread
integer, intent(in) :: iter
integer, intent(inout) :: conv_count
integer, intent(inout) :: noise_count
logical, intent(inout) :: lconverged
logical, intent(inout) :: lrandom
logical, intent(inout) :: lfirst
type(wann_control_type), intent(in) :: wann_control
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm