# Procedures

ProcedureLocationProcedure TypeDescription
berry_get_imf_klistw90_berrySubroutine

Calculates the Berry curvature traced over the occupied states, -2Im[f(k)] [Eq.33 CTVR06, Eq.6 LVTS12] for a list of Fermi energies, and stores it in axial-vector form

berry_get_imfgh_klistw90_berrySubroutine

Calculates the three quantities needed for the orbital magnetization:

berry_get_kubo_kw90_berrySubroutine

Contribution from point k to the complex interband optical conductivity, separated into Hermitian (H) and anti-Hermitian (AH) parts. Also returns the joint density of states

berry_mainw90_berrySubroutine

Computes the following quantities:
(i) Anomalous Hall conductivity (from Berry curvature)
(ii) Complex optical conductivity (Kubo-Greenwood) & JDOS (iii) Orbital magnetization

boltzwann_mainw90_boltzwannSubroutine

This is the main routine of the BoltzWann module. It calculates the transport coefficients using the Boltzmann transport equation.

calcTDFandDOSw90_boltzwannSubroutine

This routine calculates the Transport Distribution Function $$\sigma_{ij}(\epsilon)$$ (TDF) in units of 1/hbar^2 * eV*fs/angstrom, and possibly the DOS.

check_and_sort_similar_centresw90_transportSubroutine
clean_ws_translatew90_ws_distanceSubroutine
comms_allreducew90_commsInterface
comms_allreduce_cmplxw90_commsSubroutine

Reduce complex data to all nodes

comms_allreduce_realw90_commsSubroutine

Reduce real data to all nodes

comms_array_splitw90_commsSubroutine

Given an array of size numpoints, we want to split on num_nodes nodes. This function returns two arrays: count and displs.

comms_barrierw90_commsSubroutine

A barrier to synchronise all nodes

comms_bcastw90_commsInterface
comms_bcast_charw90_commsSubroutine

Send character array from root node to all nodes

comms_bcast_cmplxw90_commsSubroutine

Send character array from root node to all nodes

comms_bcast_intw90_commsSubroutine

Send integar array from root node to all nodes

comms_bcast_logicalw90_commsSubroutine

Send logical array from root node to all nodes

comms_bcast_realw90_commsSubroutine

Send real array from root node to all nodes

comms_endw90_commsSubroutine

Called to finalise the comms

comms_gathervw90_commsInterface
comms_gatherv_realw90_commsSubroutine

Gather real data to root node

comms_recvw90_commsInterface
comms_recv_charw90_commsSubroutine

Receive character array from specified node

comms_recv_cmplxw90_commsSubroutine

Receive complex array from specified node

comms_recv_intw90_commsSubroutine

Receive integer array from specified node

comms_recv_logicalw90_commsSubroutine

Receive logical array from specified node

comms_recv_realw90_commsSubroutine

Receive real array from specified node

comms_reducew90_commsInterface
comms_reduce_cmplxw90_commsSubroutine

Reduce complex data to root node

comms_reduce_intw90_commsSubroutine

Reduce integer data to root node

comms_reduce_realw90_commsSubroutine

Reduce real data to root node

comms_scattervw90_commsInterface
comms_scatterv_int_1w90_commsSubroutine

Scatter integer data from root node (array of rank 1)

comms_scatterv_int_2w90_commsSubroutine

Scatter integer data from root node (array of rank 2)

comms_scatterv_int_3w90_commsSubroutine

Scatter integer data from root node (array of rank 3)

comms_scatterv_realw90_commsSubroutine

Scatter data from root node

comms_sendw90_commsInterface
comms_send_charw90_commsSubroutine

Send character array to specified node

comms_send_cmplxw90_commsSubroutine

Send complex array to specified node

comms_send_intw90_commsSubroutine

Send integer array to specified node

comms_send_logicalw90_commsSubroutine

Send logical array to specified node

comms_send_realw90_commsSubroutine

Send real array to specified node

comms_setupw90_commsSubroutine

Set up communications

conv_get_seednamew90_convSubroutine

Set the seedname from the command line

conv_write_chkptw90_convSubroutine

Write formatted checkpoint file

conv_write_chkpt_fmtw90_convSubroutine

Write formatted checkpoint file

dis_extractw90_disentangleSubroutine

Extracts an num_wann-dimensional subspace at each k by minimizing Omega_I

dis_extract_gammaw90_disentangleSubroutine

Extracts an num_wann-dimensional subspace at each k by minimizing Omega_I (Gamma point version)

dis_mainw90_disentangleSubroutine

Main disentanglement routine

dis_proj_frozw90_disentangleSubroutine

COMPUTES THE LEADING EIGENVECTORS OF Q_froz . P_s . Q_froz, WHERE P_s PROJECTOR OPERATOR ONTO THE SUBSPACE S OF THE PROJECTED GAUSSIANS, P_f THE PROJECTOR ONTO THE FROZEN STATES, AND Q_froz = 1 - P_froz, ALL EXP IN THE BASIS OF THE BLOCH EIGENSTATES INSIDE THE OUTER ENERGY WINDOW (See Eq. (27) in Sec. III.G of SMV)

dis_projectw90_disentangleSubroutine

Construct projections for the start of the disentanglement routine

dis_windowsw90_disentangleSubroutine

This subroutine selects the states that are inside the outer window (ie, the energy window out of which we fish out the optimally-connected subspace) and those that are inside the inner window (that make up the frozen manifold, and are straightfowardly included as they are). This, in practice, amounts to slimming down the original num_wann x num_wann overlap matrices, removing rows and columns that belong to u_nks that have been excluded forever, and marking (indexing) the rows and columns that correspond to frozen states.

dos_get_kw90_dosSubroutine

This subroutine calculates the contribution to the DOS of a single k point

dos_get_levelspacingw90_dosSubroutine

This subroutine calculates the level spacing, i.e. how much the level changes near a given point of the interpolation mesh

dos_mainw90_dosSubroutine

Computes the electronic density of states. Can resolve into up-spin and down-spin parts, project onto selected Wannier orbitals, and use adaptive broadening, as in PRB 75, 195121 (2007) [YWVS07].

fourier_q_to_Rw90_get_operSubroutine

Fourier transforms Wannier-gauge representation of a given operator O from q-space to R-space:

gauss_freqw90_utilityFunction

gauss_freq(x) = (1+erf(x/sqrt(2)))/2 = erfc(-x/sqrt(2))/2 - See comments in erf

geninterp_mainw90_geninterpSubroutine

This routine prints the band energies (and possibly the band derivatives)

get_AA_Rw90_get_operSubroutine

AA_a(R) = <0|r_a|R> is the Fourier transform of the Berrry connection AA_a(k) = i (a=x,y,z)

get_BB_Rw90_get_operSubroutine

BB_a(R)=<0n|H(r-R)|Rm> is the Fourier transform of BB_a(k) = i (a=x,y,z)

get_CC_Rw90_get_operSubroutine

CC_ab(R) = <0|r_a.H.(r-R)_b|R> is the Fourier transform of CC_ab(k) = (a,b=x,y,z)

get_FF_Rw90_get_operSubroutine

FF_ab(R) = <0|r_a.(r-R)_b|R> is the Fourier transform of FF_ab(k) = (a=alpha,b=beta)

get_HH_Rw90_get_operSubroutine

computes <0n|H|Rm>, in eV (pwscf uses Ry, but pw2wannier90 converts to eV)

This function reads and sets the interpolation mesh variables needed by a given module

get_smearing_indexw90_parametersFunction

This function parses a string containing the type of smearing and returns the correct index for the smearing_index variable

get_SS_Rw90_get_operSubroutine

Wannier representation of the Pauli matrices: <0n|sigma_a|Rm> (a=x,y,z)

get_win_minw90_get_operSubroutine

Find the lower bound (band index) of the outer energy window at the specified k-point

groupw90_transportSubroutine
hamiltonian_deallocw90_hamiltonianSubroutine

Deallocate module data

hamiltonian_get_hrw90_hamiltonianSubroutine

Calculate the Hamiltonian in the WF basis

hamiltonian_setupw90_hamiltonianSubroutine

Allocate arrays and setup data

hamiltonian_wigner_seitzw90_hamiltonianSubroutine

Calculates a grid of points that fall inside of (and eventually on the surface of) the Wigner-Seitz supercell centered on the origin of the B lattice with primitive translations nmonkh(1)a_1+nmonkh(2)a_2+nmonkh(3)*a_3

hamiltonian_write_hrw90_hamiltonianSubroutine

Write the Hamiltonian in the WF basis

hamiltonian_write_rmnw90_hamiltonianSubroutine

Write out the matrix elements of r

hamiltonian_write_tbw90_hamiltonianSubroutine

Write in a single file all the information that is needed to set up a Wannier-based tight-binding model:
* lattice vectors
* <0n|H|Rn>
* <0n|r|Rn>

internal_maxlocw90_kmeshFunction

A reproducible maxloc function so b-vectors come in the same order each time

This routines returns the three integers that define the interpolation k-mesh, satisfying the condition that the spacing between two neighboring points along each of the three k_x, k_y and k_z directions is at smaller than a given spacing.

Writes a header for the output file(s).

io_datew90_ioSubroutine

Returns two strings containing the date and the time in human-readable format. Uses a standard f90 call.

io_errorw90_ioSubroutine

Abort the code giving an error message

io_file_unitw90_ioFunction

Returns an unused unit number so we can later open a file on that unit.

io_get_seednamew90_ioSubroutine

Get the seedname from the commandline

io_print_timingsw90_ioSubroutine

Output timing information to stdout

io_stopwatchw90_ioSubroutine

Stopwatch to time parts of the code

io_timew90_ioFunction

Returns elapsed CPU time in seconds since its first call. Uses standard f90 call

k_pathw90_kpathSubroutine

Main routine

k_slicew90_ksliceSubroutine

Main routine

kmesh_deallocw90_kmeshSubroutine

Release memory from the kmesh module

kmesh_getw90_kmeshSubroutine

Main routine to calculate the b-vectors

kmesh_get_bvectorsw90_kmeshSubroutine

Returns the b-vectors for a given shell and kpoint.

kmesh_shell_automaticw90_kmeshSubroutine

Find the correct set of shells to satisfy B1
The stratagy is:
1) Take the bvectors from the next shell
2) Reject them if they are parallel to exisiting b vectors
3) Test to see if we satisfy B1, if not add another shell and repeat

kmesh_shell_fixedw90_kmeshSubroutine

Find the B1 weights for a set of shells specified by the user

kmesh_shell_from_filew90_kmeshSubroutine

Find the B1 weights for a set of b-vectors given in a file. This routine is only activated via a devel_flag and is not intended for regular use.

kmesh_spacing_meshw90_postw90_commonFunction

Same as kmesh_spacing_singleinteger, but for a kmesh with three different mesh samplings along the three directions

kmesh_spacing_singleintegerw90_postw90_commonFunction

Set up the value of the interpolation mesh spacing, needed for adaptive smearing [see Eqs. (34-35) YWVS07]. Choose it as the largest of the three Delta_k's for each of the primitive translations b1, b2, and b3

kmesh_supercell_sortw90_kmeshSubroutine

We look for kpoint neighbours in a large supercell of reciprocal unit cells. Done sequentially this is very slow.
Here we order the cells by the distance from the origin. Doing the search in this order gives a dramatic speed up

kmesh_writew90_kmeshSubroutine

Writes nnkp file (list of overlaps needed)

master_sort_and_groupw90_transportSubroutine
MinusFermiDerivativew90_boltzwannFunction

This function calculates -dn(E)/dE, where n(E) is the Fermi distribution function.

my_ICOPYcomms.F90Subroutine
orthogonalize_uw90_sitesymSubroutine
overlap_deallocw90_overlapSubroutine

Dellocate memory

overlap_projectw90_overlapSubroutine

Construct initial guess from the projection via a Lowdin transformation See section 3 of the CPC 2008 Note that in this subroutine num_wann = num_bands since, if we are here, then disentanglement = FALSE

overlap_project_gammaw90_overlapSubroutine

Construct initial guess from the projection via a Lowdin transformation See section 3 of the CPC 2008 Note that in this subroutine num_wann = num_bands
since, if we are here, then disentanglement = FALSE Gamma specific version

Allocate and read the Mmn and Amn from files

overlap_rotatew90_overlapSubroutine

Only used when interfaced to the CP code Not sure why this is done here and not in CP

release memory from allocated parameters

Fills the atom data block

Finds the length of the data block

Finds the value of the required keyword.

Finds the values of the required data block

Fills the kpath data block

Finds the values of the required keyword vector

Fills the projection data block

Read a range vector eg. 1,2,3,4-10 or 1 3 400:100
if(lcount) we return the number of states in length

param_get_smearing_typew90_parametersFunction

This function returns a string describing the type of smearing associated to a given smr_index integer value.

Returns the length of a keyword vector

Load the *.win file into a character
blank lines and converting everything to lowercase characters

Fills the atom data block during a library call

Estimate how much memory we will allocate

write postw90 parameters to stdout

Read parameters and calculate derived values

IMPORTANT! If you change the chkpt format, adapt accordingly also the w90chk2chk.x utility!

Convert a few things to uppercase to look nice in the output

write wannier90 parameters to stdout

Write checkpoint file
IMPORTANT! If you change the chkpt format, adapt accordingly also the w90chk2chk.x utility!

Write a suitable header for the calculation - version authors etc

plot_fermi_surfacew90_plotSubroutine

Prepares a Xcrysden bxsf file to view the fermi surface

plot_interpolate_bandsw90_plotSubroutine

Plots the interpolated band structure

plot_mainw90_plotSubroutine

Main plotting routine

plot_u_matricesw90_plotSubroutine

Plot u_matrix and u_matrix_opt to textfiles in readable format

plot_wannierw90_plotSubroutine

Plot the WF in Xcrysden format based on code written by Michel Posternak

print_usagew90_convSubroutine

Writes the usage of the program to stdout

pw90common_fourier_R_to_kw90_postw90_commonSubroutine

For alpha=0:
O_ij(R) --> O_ij(k) = sum_R e^{+ik.R}*O_ij(R)

pw90common_fourier_R_to_k_neww90_postw90_commonSubroutine

For OO: $$O_{ij}(k) = \sum_R e^{+ik.R}.O_{ij}(R)$$ For $$OO_{dx,dy,dz}$$: $$\sum_R [i.R_{dx,dy,dz}.e^{+ik.R}.O_{ij}(R)]$$ where R_{x,y,z} are the Cartesian components of R

pw90common_fourier_R_to_k_vecw90_postw90_commonSubroutine

For OO_true (true vector):
$${\vec O}_{ij}(k) = \sum_R e^{+ik.R} {\vec O}_{ij}(R)$$

pw90common_get_occw90_postw90_commonSubroutine

Compute the electronic occupancy

pw90common_kmesh_spacingw90_postw90_commonInterface
pw90common_wanint_data_distw90_postw90_commonSubroutine

Distribute the um and chk files

pw90common_wanint_get_kpoint_filew90_postw90_commonSubroutine

read kpoints from kpoint.dat and distribute

pw90common_wanint_param_distw90_postw90_commonSubroutine

distribute the parameters across processors
NOTE: we only send the ones postw90 uses, not all in w90

pw90common_wanint_setupw90_postw90_commonSubroutine

qe_erfw90_utilityFunction

Error function - computed from the rational approximations of W. J. Cody, Math. Comp. 22 (1969), pages 631-637.

qe_erfcw90_utilityFunction

erfc(x) = 1-erf(x) - See comments in erf

R_wz_scw90_ws_distanceFunction

puts R_in in the Wigner-Seitz cell centered around R0

R_wz_sc_equivw90_ws_distanceSubroutine

Find the list list of R_out that differ from R_in by a lattice vector and are equally distant from R0 (i.e. that are on the edges of the WS cell centered on R0)

script_commonw90_ksliceSubroutine
script_fermi_linesw90_ksliceSubroutine
sitesym_deallocw90_sitesymSubroutine
sitesym_dis_extract_symmetryw90_sitesymSubroutine
sitesym_replace_d_matrix_bandw90_sitesymSubroutine
sitesym_slim_d_matrix_bandw90_sitesymSubroutine
sitesym_symmetrize_rotationw90_sitesymSubroutine
sitesym_symmetrize_u_matrixw90_sitesymSubroutine
sitesym_symmetrize_zmatrixw90_sitesymSubroutine
sortw90_transportSubroutine
spin_get_momentw90_spinSubroutine

Computes the spin magnetic moment by Wannier interpolation

spin_get_moment_kw90_spinSubroutine

Computes the spin magnetic moment by Wannier interpolation at the specified k-point

spin_get_nkw90_spinSubroutine

Computes (m=1,...,num_wann) where S.n = n_x.S_x + n_y.S_y + n_z.Z_z

symmetrize_ukirrw90_sitesymSubroutine
TDF_kptw90_boltzwannSubroutine

This subroutine calculates the contribution to the TDF of a single k point

tran_bulkw90_transportSubroutine
tran_cut_hr_one_dimw90_transportSubroutine
tran_deallocw90_transportSubroutine

Dellocate module data

tran_find_integral_signaturesw90_transportSubroutine
tran_get_htw90_transportSubroutine
tran_greenw90_transportSubroutine
tran_lcrw90_transportSubroutine
tran_lcr_2c2_build_hamw90_transportSubroutine
tran_lcr_2c2_sortw90_transportSubroutine
tran_mainw90_transportSubroutine

Main transport subroutine

tran_parity_enforcew90_transportSubroutine
tran_reduce_hrw90_transportSubroutine
tran_transferw90_transportSubroutine
tran_write_xyzw90_transportSubroutine
utility_cart_to_fracw90_utilitySubroutine

Convert from Cartesian to fractional coordinates

utility_commutator_diagw90_utilityFunction

Computes diagonal elements of [mat1,mat2]=mat1.mat2-mat2.mat1

utility_comparw90_utilitySubroutine

Compares two vectors

utility_diagonalizew90_utilitySubroutine

Diagonalize the dim x dim hermitian matrix 'mat' and return the eigenvalues 'eig' and the unitary rotation 'rot'

utility_frac_to_cartw90_utilitySubroutine

Convert from fractional to Cartesian coordinates

utility_im_trw90_utilityFunction

Imaginary part of the trace

utility_inv2w90_utilitySubroutine

Return in b the adjoint of the 2x2 matrix a, together with the determinant of a.
The inverse is defined as the adjoind divided by the determinant, so that inverse(a) = b/det

utility_inv3w90_utilitySubroutine

Return in b the adjoint of the 3x3 matrix a, and its
determinant.
The inverse is defined as the adjoind divided by the determinant, so that inverse(a) = b/det

utility_lowercasew90_utilityFunction

Takes a string and converts to lowercase characters

utility_matmul_diagw90_utilityFunction

Computes the diagonal elements of the matrix mat1.mat2

utility_metricw90_utilitySubroutine

Calculate the real and reciprical space metrics

utility_re_trw90_utilityFunction

Real part of the trace

utility_recip_latticew90_utilitySubroutine

Calculates the reciprical lattice vectors and the cell volume

utility_rotatew90_utilityFunction

Rotates the dim x dim matrix 'mat' according to (rot)^dagger.mat.rot, where 'rot' is a unitary matrix

utility_rotate_diagw90_utilityFunction

Rotates the dim x dim matrix 'mat' according to (rot)^dagger.mat.rot, where 'rot' is a unitary matrix. Computes only the diagonal elements of rotated matrix.

utility_string_to_coordw90_utilitySubroutine

Takes a string in the form 0.0,1.0,0.5 and returns an array of the real num

utility_stripw90_utilityFunction

Strips string of all blank spaces

utility_translate_homew90_utilitySubroutine

Translate a vector to the home unit cell

utility_w0gaussw90_utilityFunction

the derivative of utility_wgauss: an approximation to the delta function

utility_wgaussw90_utilityFunction

this function computes the approximate theta function for the given order n, at the point x.

utility_zgemmw90_utilitySubroutine

Return matrix product of complex n x n matrices a and b:

wann_calc_projectionw90_wannieriseSubroutine
wann_check_unitarityw90_wannieriseSubroutine
wann_domegaw90_wannieriseSubroutine
wann_mainw90_wannieriseSubroutine

Calculate the Unitary Rotations to give Maximally Localised Wannier Functions

wann_main_gammaw90_wannieriseSubroutine
wann_omegaw90_wannieriseSubroutine

wann_omega_gammaw90_wannieriseSubroutine
wann_phasesw90_wannieriseSubroutine

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

wann_svd_omega_iw90_wannieriseSubroutine
wann_write_r2mnw90_wannieriseSubroutine
wann_write_vdw_dataw90_wannieriseSubroutine
wann_write_xyzw90_wannieriseSubroutine
wannier_runwannier_lib.F90Subroutine
wannier_setupwannier_lib.F90Subroutine
wham_get_D_hw90_wan_hamSubroutine

Compute D^H_a=UU^dag.del_a UU (a=x,y,z) using Eq.(24) of WYSV06

wham_get_D_h_aw90_wan_hamSubroutine

Compute D^H_a=UU^dag.del_a UU (a=alpha,beta), using Eq.(24) of WYSV06

wham_get_deleig_aw90_wan_hamSubroutine

Band derivatives dE/dk_a

wham_get_eig_deleigw90_wan_hamSubroutine

Given a k point, this function returns eigenvalues E and derivatives of the eigenvalues dE/dk_a, using wham_get_deleig_a

wham_get_eig_UU_HH_JJlistw90_wan_hamSubroutine

Wrapper routine used to reduce number of Fourier calls

wham_get_JJm_listw90_wan_hamSubroutine

Compute JJ^-_a (a=Cartesian index) for a list of Fermi energies

wham_get_JJp_listw90_wan_hamSubroutine

Compute JJ^+_a (a=Cartesian index) for a list of Fermi energies

wham_get_occ_mat_listw90_wan_hamSubroutine

Occupation matrix f, and g=1-f for a list of Fermi energies

wigner_seitzw90_postw90_commonSubroutine

Calculates a grid of lattice vectors r that fall inside (and eventually on the surface of) the Wigner-Seitz supercell centered on the origin of the Bravais superlattice with primitive translations mp_grid(1)a_1, mp_grid(2)a_2, and mp_grid(3)*a_3

ws_translate_distw90_ws_distanceSubroutine

The next three subroutines find the supercell translation (i.e. the translation by a integer number of supercell) That minimizes the distance between two given funtions, i and j, the first in unit cell 0, the other in unit cell R. I.e. we put WF j in the Wigner-Seitz of WF i. We also look for the number of equivalent translation, meaning that j is on the edge of the WS The results are stored in global arrays wdist_ndeg and irdist_ws

ws_write_vecw90_ws_distanceSubroutine

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.

Help