librpahandler Type Reference

librpahandler Type Reference#

LibRPA: librpa_f03::librpahandler Type Reference
LibRPA
librpa_f03::librpahandler Type Reference

High-level Fortran wrapper for LibRPA handler. More...

Type definitions

type(c_ptr) ptr_c_handle = c_null_ptr
 
procedure init (this, comm)
 Create a new LibRPA handler instance.
 
procedure free (this)
 Destroy a LibRPA handler instance.
 
procedure set_scf_dimension (this, nspins, nkpts, nstates, nbasis)
 Set SCF wavefunction dimension.
 
procedure set_wg_ekb_efermi (this, nspins, nkpts, nstates, wg, ekb, efermi)
 Set occupation numbers, eigenvalues, and Fermi level.
 
procedure set_wfc (this, ispin, ik, nstates_local, nbasis_local, wfc_cplx)
 Set the wave-function expansion coefficients.
 
procedure set_ao_basis_wfc (this, natoms, nbs_wfc)
 Set the wave-function atomic basis.
 
procedure set_ao_basis_aux (this, natoms, nbs_aux)
 Set the auxiliary atomic basis.
 
procedure set_latvec_and_g (this, latt, recplatt)
 Set the direct and reciprocal lattice vectors.
 
procedure set_atoms (this, natoms, types, posi_cart)
 Set types and coordinates of the atoms in the model.
 
procedure set_kgrids_kvec (this, nk1, nk2, nk3, kvecs)
 Set k-point grid vectors.
 
procedure set_ibz_mapping (this, nkpts, map_ibzk)
 Set the mapping from full k-point list to the irreducbile sector.
 
procedure set_lri_coeff (this, routing, i_atom, j_atom, nao_i, nao_j, naux_i, r, coeff)
 Set the local RI coefficients.
 
procedure set_aux_bare_coulomb_k_atom_pair (this, ik, i_atom, j_atom, naux_i, naux_j, vq, vq_threshold)
 Set bare Coulomb matrix elements (atom-pair format).
 
procedure set_aux_cut_coulomb_k_atom_pair (this, ik, i_atom, j_atom, naux_i, naux_j, vq, vq_threshold)
 Set truncated Coulomb matrix elements (atom-pair format).
 
procedure set_aux_bare_coulomb_k_2d_block (this, ik, mu_begin, mu_end, nu_begin, nu_end, vq)
 Set bare Coulomb matrix elements (2D block format).
 
procedure set_aux_cut_coulomb_k_2d_block (this, ik, mu_begin, mu_end, nu_begin, nu_end, vq)
 Set truncated Coulomb matrix elements (2D block format).
 
procedure set_dielect_func_imagfreq (this, nfreq, omegas_imag, dielect_func)
 Set dielectric function on imaginary frequency axis.
 
procedure set_band_kvec (this, nkpts_band, kfrac_band)
 Set k-points for band structure calculations.
 
procedure set_wfc_band (this, ispin, ik_band, nstates_local, nbasis_local, wfc_cplx)
 Set the wave-function expansion coefficients for band calculation.
 
procedure set_band_occ_eigval (this, nspins, nkpts_band, nstates, occ, eig)
 Set occupation numbers and eigenvalues for band k-points.
 
procedure reset_band_data (this)
 Reset band structure data.
 
procedure get_imaginary_frequency_grids (this, opts, omegas, weights)
 Construct and return frequency grids.
 
procedure get_rpa_correlation_energy (this, opts, nkpts_ibz, contrib_ibzk)
 Compute RPA correlation energy.
 
procedure build_exx (this, opts)
 Build exact-exchange matrix in real space.
 
procedure get_exx_pot_kgrid (this, opts, n_spins, n_kpts_this, iks_this, i_state_low, i_state_high, vexx)
 Get exact-exchange potential for k-grid states.
 
procedure get_exx_pot_band_k (this, opts, n_spins, n_kpts_band_this, iks_band_this, i_state_low, i_state_high, vexx_band)
 Get exact-exchange potential for band k-points.
 
procedure build_g0w0_sigma (this, opts)
 Build G0W0 self-energy matrix in real space.
 
procedure get_g0w0_sigc_kgrid (this, opts, n_spins, n_kpts_this, iks_this, i_state_low, i_state_high, vxc, vexx, sigc)
 Get G0W0 correlation self-energy for k-grid states.
 
procedure get_g0w0_sigc_band_k (this, opts, n_spins, n_kpts_band_this, iks_band_this, i_state_low, i_state_high, vxc_band, vexx_band, sigc_band)
 Get G0W0 correlation self-energy for band k-points.
 

Detailed Description

High-level Fortran wrapper for LibRPA handler.

This type encapsulates the LibRPA handler and provides member procedures for setting input data and performing calculations.

Usage:

type(LibrpaHandler) :: h
call h%create(mpi_comm_world)
call h%set_scf_dimension(nspins, nkpts, nstates, nbasis)
! ... set more input ...
ec = h%get_rpa_correlation_energy(opts)
call h%destroy()

Member Function/Subroutine Documentation

◆ build_exx()

procedure librpa_f03::librpahandler::build_exx ( class(librpahandler), intent(inout) this,
type(librpaoptions), intent(inout) opts )

Build exact-exchange matrix in real space.

Parameters
[in,out]thisHandler.
[in,out]optsRuntime options.

◆ build_g0w0_sigma()

procedure librpa_f03::librpahandler::build_g0w0_sigma ( class(librpahandler), intent(inout) this,
type(librpaoptions), intent(inout) opts )

Build G0W0 self-energy matrix in real space.

Parameters
[in,out]thisHandler.
[in,out]optsRuntime options.

◆ free()

procedure librpa_f03::librpahandler::free ( class(librpahandler), intent(inout) this)

Destroy a LibRPA handler instance.

Frees all internal resources associated with the handler.

Parameters
[in,out]thisHandler to destroy.

◆ get_exx_pot_band_k()

procedure librpa_f03::librpahandler::get_exx_pot_band_k ( class(librpahandler), intent(inout) this,
type(librpaoptions), intent(inout) opts,
integer, intent(in) n_spins,
integer, intent(in) n_kpts_band_this,
integer, dimension(:), intent(in), contiguous iks_band_this,
integer, intent(in) i_state_low,
integer, intent(in) i_state_high,
real(dp), dimension(i_state_high - i_state_low + 1, n_kpts_band_this, n_spins), intent(inout) vexx_band )

Get exact-exchange potential for band k-points.

Parameters
[in,out]thisHandler.
[in,out]optsRuntime options.
[in]n_spinsNumber of spin channels.
[in]n_kpts_band_thisNumber of band k-points on this process.
[in]iks_band_thisList of band k-point indices (1-based).
[in]i_state_lowFirst state index (1-based, inclusive).
[in]i_state_highLast state index (1-based, inclusive).
[out]vexx_bandExact-exchange potentials for band k-points.

◆ get_exx_pot_kgrid()

procedure librpa_f03::librpahandler::get_exx_pot_kgrid ( class(librpahandler), intent(inout) this,
type(librpaoptions), intent(inout) opts,
integer, intent(in) n_spins,
integer, intent(in) n_kpts_this,
integer, dimension(:), intent(in), contiguous iks_this,
integer, intent(in) i_state_low,
integer, intent(in) i_state_high,
real(dp), dimension(i_state_high - i_state_low + 1, n_kpts_this, n_spins), intent(inout) vexx )

Get exact-exchange potential for k-grid states.

Parameters
[in,out]thisHandler.
[in,out]optsRuntime options.
[in]n_spinsNumber of spin channels.
[in]n_kpts_thisNumber of k-points on this process.
[in]iks_thisList of k-point indices (1-based).
[in]i_state_lowFirst state index (1-based, inclusive).
[in]i_state_highLast state index (1-based, inclusive).
[out]vexxExact-exchange potentials.

◆ get_g0w0_sigc_band_k()

procedure librpa_f03::librpahandler::get_g0w0_sigc_band_k ( class(librpahandler), intent(inout) this,
type(librpaoptions), intent(inout) opts,
integer, intent(in) n_spins,
integer, intent(in) n_kpts_band_this,
integer, dimension(:), intent(in), contiguous iks_band_this,
integer, intent(in) i_state_low,
integer, intent(in) i_state_high,
real(dp), dimension(i_state_high - i_state_low + 1, n_kpts_band_this, n_spins), intent(in) vxc_band,
real(dp), dimension(i_state_high - i_state_low + 1, n_kpts_band_this, n_spins), intent(in) vexx_band,
complex(dp), dimension(i_state_high - i_state_low + 1, n_kpts_band_this, n_spins), intent(inout) sigc_band )

Get G0W0 correlation self-energy for band k-points.

Parameters
[in,out]thisHandler.
[in,out]optsRuntime options.
[in]n_spinsNumber of spin channels.
[in]n_kpts_band_thisNumber of band k-points on this process.
[in]iks_band_thisList of band k-point indices (1-based).
[in]i_state_lowFirst state index (1-based, inclusive).
[in]i_state_highLast state index (1-based, inclusive).
[in]vxc_bandXC potential for band states.
[in]vexx_bandExact-exchange potential for band states.
[out]sigc_bandCorrelation self-energy for band (complex).

◆ get_g0w0_sigc_kgrid()

procedure librpa_f03::librpahandler::get_g0w0_sigc_kgrid ( class(librpahandler), intent(inout) this,
type(librpaoptions), intent(inout) opts,
integer, intent(in) n_spins,
integer, intent(in) n_kpts_this,
integer, dimension(:), intent(in), contiguous iks_this,
integer, intent(in) i_state_low,
integer, intent(in) i_state_high,
real(dp), dimension(i_state_high - i_state_low + 1, n_kpts_this, n_spins), intent(in) vxc,
real(dp), dimension(i_state_high - i_state_low + 1, n_kpts_this, n_spins), intent(in) vexx,
complex(dp), dimension(i_state_high - i_state_low + 1, n_kpts_this, n_spins), intent(inout) sigc )

Get G0W0 correlation self-energy for k-grid states.

Parameters
[in,out]thisHandler.
[in,out]optsRuntime options.
[in]n_spinsNumber of spin channels.
[in]n_kpts_thisNumber of k-points on this process.
[in]iks_thisList of k-point indices (1-based).
[in]i_state_lowFirst state index (1-based, inclusive).
[in]i_state_highLast state index (1-based, inclusive).
[in]vxcXC potential for selected states.
[in]vexxExact-exchange potential for selected states.
[out]sigcCorrelation self-energy (complex).

◆ get_imaginary_frequency_grids()

procedure librpa_f03::librpahandler::get_imaginary_frequency_grids ( class(librpahandler), intent(inout) this,
type(librpaoptions), intent(inout) opts,
real(dp), dimension(:), intent(inout), allocatable omegas,
real(dp), dimension(:), intent(inout), allocatable weights )

Construct and return frequency grids.

Parameters
[in,out]thisHandler.
[in,out]optsRuntime options.
[out]omegasFrequency values.
[out]weightsQuadrature weights.

◆ get_rpa_correlation_energy()

procedure librpa_f03::librpahandler::get_rpa_correlation_energy ( class(librpahandler), intent(inout) this,
type(librpaoptions), intent(inout) opts,
integer, intent(in) nkpts_ibz,
complex(dp), dimension(nkpts_ibz), intent(inout) contrib_ibzk )

Compute RPA correlation energy.

Parameters
[in,out]thisHandler.
[in,out]optsRuntime options.
[in]nkpts_ibzNumber of irreducible k-points.
[out]contrib_ibzkComplex correlation contribution per k-point.
Returns
Total RPA correlation energy.

◆ init()

procedure librpa_f03::librpahandler::init ( class(librpahandler), intent(inout) this,
integer, intent(in) comm )

Create a new LibRPA handler instance.

Allocates and initializes a new LibRPA handler associated with the given MPI communicator.

Parameters
[in,out]thisHandler to create.
[in]commMPI communicator (e.g., MPI_COMM_WORLD).

◆ reset_band_data()

procedure librpa_f03::librpahandler::reset_band_data ( class(librpahandler), intent(inout) this)

Reset band structure data.

Parameters
[in,out]thisHandler.

◆ set_ao_basis_aux()

procedure librpa_f03::librpahandler::set_ao_basis_aux ( class(librpahandler), intent(inout) this,
integer, intent(in) natoms,
integer, dimension(natoms), intent(in) nbs_aux )

Set the auxiliary atomic basis.

Parameters
natomsnumber of atoms
nbs_auxnumber of auxiliary basis functions on each atom

◆ set_ao_basis_wfc()

procedure librpa_f03::librpahandler::set_ao_basis_wfc ( class(librpahandler), intent(inout) this,
integer, intent(in) natoms,
integer, dimension(natoms), intent(in) nbs_wfc )

Set the wave-function atomic basis.

Parameters
natomsnumber of atoms
nbs_wfcnumber of wave-function basis on each atom

◆ set_atoms()

procedure librpa_f03::librpahandler::set_atoms ( class(librpahandler), intent(inout) this,
integer, intent(in) natoms,
integer, dimension(natoms), intent(in) types,
real(dp), dimension(3, natoms), intent(in) posi_cart )

Set types and coordinates of the atoms in the model.

Parameters
natomsnumber of atoms
typesspecies type of each atom
pos_cartCartesian coordinates of each atom

◆ set_aux_bare_coulomb_k_2d_block()

procedure librpa_f03::librpahandler::set_aux_bare_coulomb_k_2d_block ( class(librpahandler), intent(inout) this,
integer, intent(in) ik,
integer, intent(in) mu_begin,
integer, intent(in) mu_end,
integer, intent(in) nu_begin,
integer, intent(in) nu_end,
complex(dp), dimension(mu_end-mu_begin+1, nu_end-nu_begin+1), intent(in) vq )

Set bare Coulomb matrix elements (2D block format).

Parameters
[in,out]thisHandler.
[in]ikK-point index (1-based).
[in]mu_beginStarting mu index (1-based).
[in]mu_endEnding mu index (inclusive).
[in]nu_beginStarting nu index (1-based).
[in]nu_endEnding nu index (inclusive).
[in]vqCoulomb matrix (complex).

◆ set_aux_bare_coulomb_k_atom_pair()

procedure librpa_f03::librpahandler::set_aux_bare_coulomb_k_atom_pair ( class(librpahandler), intent(inout) this,
integer, intent(in) ik,
integer, intent(in) i_atom,
integer, intent(in) j_atom,
integer, intent(in) naux_i,
integer, intent(in) naux_j,
complex(dp), dimension(naux_i, naux_j), intent(in) vq,
real(dp), intent(in) vq_threshold )

Set bare Coulomb matrix elements (atom-pair format).

Parameters
[in,out]thisHandler.
[in]ikK-point index (1-based).
[in]i_atomAtom I index (1-based).
[in]j_atomAtom J index (1-based).
[in]naux_iNumber of aux functions for i.
[in]naux_jNumber of aux functions for j.
[in]vqCoulomb matrix (naux_i x naux_j, complex).
[in]vq_thresholdThreshold for screening.

◆ set_aux_cut_coulomb_k_2d_block()

procedure librpa_f03::librpahandler::set_aux_cut_coulomb_k_2d_block ( class(librpahandler), intent(inout) this,
integer, intent(in) ik,
integer, intent(in) mu_begin,
integer, intent(in) mu_end,
integer, intent(in) nu_begin,
integer, intent(in) nu_end,
complex(dp), dimension(mu_end-mu_begin+1, nu_end-nu_begin+1), intent(in) vq )

Set truncated Coulomb matrix elements (2D block format).

Parameters
[in,out]thisHandler.
[in]ikK-point index (1-based).
[in]mu_beginStarting mu index (1-based).
[in]mu_endEnding mu index (inclusive).
[in]nu_beginStarting nu index (1-based).
[in]nu_endEnding nu index (inclusive).
[in]vqCoulomb matrix (complex).

◆ set_aux_cut_coulomb_k_atom_pair()

procedure librpa_f03::librpahandler::set_aux_cut_coulomb_k_atom_pair ( class(librpahandler), intent(inout) this,
integer, intent(in) ik,
integer, intent(in) i_atom,
integer, intent(in) j_atom,
integer, intent(in) naux_i,
integer, intent(in) naux_j,
complex(dp), dimension(naux_i, naux_j), intent(in) vq,
real(dp), intent(in) vq_threshold )

Set truncated Coulomb matrix elements (atom-pair format).

Parameters
[in,out]thisHandler.
[in]ikK-point index (1-based).
[in]i_atomAtom I index (1-based).
[in]j_atomAtom J index (1-based).
[in]naux_iNumber of aux functions for i.
[in]naux_jNumber of aux functions for j.
[in]vqCoulomb matrix (naux_i x naux_j, complex).
[in]vq_thresholdThreshold for screening.

◆ set_band_kvec()

procedure librpa_f03::librpahandler::set_band_kvec ( class(librpahandler), intent(inout) this,
integer, intent(in) nkpts_band,
real(dp), dimension(3, nkpts_band), intent(in) kfrac_band )

Set k-points for band structure calculations.

Parameters
[in,out]thisHandler.
[in]nkpts_bandNumber of band k-points.
[in]kfrac_bandBand k-point coordinates (3 x nkpts_band, fractional).

◆ set_band_occ_eigval()

procedure librpa_f03::librpahandler::set_band_occ_eigval ( class(librpahandler), intent(inout) this,
integer, intent(in) nspins,
integer, intent(in) nkpts_band,
integer, intent(in) nstates,
real(dp), dimension(nstates, nkpts_band, nspins), intent(in) occ,
real(dp), dimension(nstates, nkpts_band, nspins), intent(in) eig )

Set occupation numbers and eigenvalues for band k-points.

Parameters
[in,out]thisHandler.
[in]nspinsNumber of spin channels.
[in]nkpts_bandNumber of band k-points.
[in]nstatesNumber of states.
[in]occOccupation numbers (nstates x nkpts_band x nspins).
[in]eigEigenvalues (nstates x nkpts_band x nspins).

◆ set_dielect_func_imagfreq()

procedure librpa_f03::librpahandler::set_dielect_func_imagfreq ( class(librpahandler), intent(inout) this,
integer, intent(in) nfreq,
real(dp), dimension(nfreq), intent(in) omegas_imag,
real(dp), dimension(nfreq), intent(in) dielect_func )

Set dielectric function on imaginary frequency axis.

Parameters
[in,out]thisHandler.
[in]nfreqNumber of frequency points.
[in]omegas_imagImaginary frequency values.
[in]dielect_funcDielectric function values.

◆ set_ibz_mapping()

procedure librpa_f03::librpahandler::set_ibz_mapping ( class(librpahandler), intent(inout) this,
integer, intent(in) nkpts,
integer, dimension(nkpts), intent(in) map_ibzk )

Set the mapping from full k-point list to the irreducbile sector.

Example: four-k-point case where the first two and last points are in the irreducbile sector, and the third point is mapped to the second, then map_ibzk should be (1, 2, 2, 4)

Parameters
nkptsnumber of k-points in the full Brillouin zone
map_ibzkmapping to the k-point in the irreducible sector

◆ set_kgrids_kvec()

procedure librpa_f03::librpahandler::set_kgrids_kvec ( class(librpahandler), intent(inout) this,
integer, intent(in) nk1,
integer, intent(in) nk2,
integer, intent(in) nk3,
real(dp), dimension(3, nk1*nk2*nk3), intent(in) kvecs )

Set k-point grid vectors.

Parameters
[in,out]thisHandler.
[in]nk1Number of k-points along direction 1.
[in]nk2Number of k-points along direction 2.
[in]nk3Number of k-points along direction 3.
[in]kvecsK-point vectors (3 x nk1*nk2*nk3, Cartesian).

◆ set_latvec_and_g()

procedure librpa_f03::librpahandler::set_latvec_and_g ( class(librpahandler), intent(inout) this,
real(dp), dimension(3, 3), intent(in) latt,
real(dp), dimension(3, 3), intent(in) recplatt )

Set the direct and reciprocal lattice vectors.

Each column is a lattice/reciprocal lattice vector.

Parameters
lattlattice vectors (in Bohr)
recplattreciprocal lattice vectors (in Bohr^-1)

◆ set_lri_coeff()

procedure librpa_f03::librpahandler::set_lri_coeff ( class(librpahandler), intent(inout) this,
integer, intent(in) routing,
integer, intent(in) i_atom,
integer, intent(in) j_atom,
integer, intent(in) nao_i,
integer, intent(in) nao_j,
integer, intent(in) naux_i,
integer, dimension(3), intent(in) r,
real(dp), dimension(:, :, :), intent(in), contiguous coeff )

Set the local RI coefficients.

Parameters
routingParallel routing, should be one of the LIBRPA_ROUTING_* parameters
i_atomIndex of atom I (starting from 1)
j_atomIndex of atom J (starting from 1)
nao_iNumber of wave-functions basis on atom I
nao_jNumber of wave-functions basis on atom J
naux_iNumber of auxiliary basis on atom I
rIndex of unit cell in the crystal, with (0,0,0) at the origin
coeffLocal RI coefficients associated with atom pair I-J, with auxiliary basis on I.

◆ set_scf_dimension()

procedure librpa_f03::librpahandler::set_scf_dimension ( class(librpahandler), intent(inout) this,
integer, intent(in) nspins,
integer, intent(in) nkpts,
integer, intent(in) nstates,
integer, intent(in) nbasis )

Set SCF wavefunction dimension.

Parameters
[in,out]thisHandler.
[in]nspinsNumber of spin channels.
[in]nkptsNumber of k-points.
[in]nstatesNumber of electronic states.
[in]nbasisNumber of basis functions.

◆ set_wfc()

procedure librpa_f03::librpahandler::set_wfc ( class(librpahandler), intent(inout) this,
integer, intent(in) ispin,
integer, intent(in) ik,
integer, intent(in) nstates_local,
integer, intent(in) nbasis_local,
complex(dp), dimension(nbasis_local, nstates_local), intent(in), target wfc_cplx )

Set the wave-function expansion coefficients.

Parameters
ispinspin index (starting from 1) of the wave function
ik(global) k-point index (starting from 1) of the wave function
nstates_locallocal dimenstion (number of states) of the parsed wave-function
nbasis_locallocal dimenstion (number of basis functions) of the parsed wave-function
wfc_cplxComplex-valued wave function to parse

◆ set_wfc_band()

procedure librpa_f03::librpahandler::set_wfc_band ( class(librpahandler), intent(inout) this,
integer, intent(in) ispin,
integer, intent(in) ik_band,
integer, intent(in) nstates_local,
integer, intent(in) nbasis_local,
complex(dp), dimension(nbasis_local, nstates_local), intent(in), target wfc_cplx )

Set the wave-function expansion coefficients for band calculation.

Parameters
ispinspin index (starting from 1) of the wave function
ik_band(global) k-point index (starting from 1) of the wave function
nstates_locallocal dimenstion (number of states) of the parsed wave-function
nbasis_locallocal dimenstion (number of basis functions) of the parsed wave-function
wfc_cplxComplex-valued wave function to parse

◆ set_wg_ekb_efermi()

procedure librpa_f03::librpahandler::set_wg_ekb_efermi ( class(librpahandler), intent(inout) this,
integer, intent(in) nspins,
integer, intent(in) nkpts,
integer, intent(in) nstates,
real(dp), dimension(nstates, nkpts, nspins), intent(in) wg,
real(dp), dimension(nstates, nkpts, nspins), intent(in) ekb,
real(dp), intent(in) efermi )

Set occupation numbers, eigenvalues, and Fermi level.

Parameters
[in,out]thisHandler.
[in]nspinsNumber of spin channels.
[in]nkptsNumber of k-points.
[in]nstatesNumber of electronic states.
[in]wgOccupation numbers (nstates x nkpts x nspins).
[in]ekbEigenvalues (nstates x nkpts x nspins).
[in]efermiFermi level.

The documentation for this type was generated from the following file: