librpa_input.h File Reference

librpa_input.h File Reference#

LibRPA: librpa_input.h File Reference
LibRPA
librpa_input.h File Reference

Input data APIs for LibRPA. More...

#include <stddef.h>
#include "librpa_enums.h"
#include "librpa_handler.h"
Include dependency graph for librpa_input.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void librpa_set_scf_dimension (LibrpaHandler *h, int nspins, int nkpts, int nstates, int nbasis, int nspinor=1)
 Set meanfield wavefunction dimension.
 
void librpa_set_wg_ekb_efermi (LibrpaHandler *h, int nspins, int nkpts, int nstates, const double *wg, const double *ekb, double efermi)
 Set occupation numbers, eigenvalues, and Fermi level of meanfield input.
 
void librpa_set_wfc (LibrpaHandler *h, int ispin, int ik, int nstates_local, int nbasis_local, const double *wfc_real, const double *wfc_imag)
 Set wavefunction coefficients (real/imag separate arrays).
 
void librpa_set_wfc_spinor (LibrpaHandler *h, int ik, int nstates_local, int nbasis_local, const double *wfc_up_real, const double *wfc_up_imag, const double *wfc_dn_real, const double *wfc_dn_imag)
 Set wavefunction coefficients of spinor format (real/imag separate arrays).
 
void librpa_set_wfc_packed (LibrpaHandler *h, int ispin, int ik, int nstates_local, int nbasis_local, const double *wfc_ri)
 Set wavefunction coefficients (packed complex array).
 
void librpa_set_wfc_spinor_packed (LibrpaHandler *h, int ik, int nstates_local, int nbasis_local, const double *wfc_up_ri, const double *wfc_dn_ri)
 Set wavefunction coefficients (packed complex array).
 
void librpa_set_ao_basis_wfc (LibrpaHandler *h, int natoms, const size_t *nbs_wfc)
 Set atomic orbital basis size for wavefunctions.
 
void librpa_set_ao_basis_aux (LibrpaHandler *h, int natoms, const size_t *nbs_aux)
 Set auxiliary atomic orbital basis size.
 
void librpa_set_latvec_and_G (LibrpaHandler *h, const double lat_mat[9], const double G_mat[9])
 Set direct and reciprocal lattice vectors.
 
void librpa_set_atoms (LibrpaHandler *h, int natoms, const int *types, const double *posi_cart)
 Set atom types and Cartesian coordinates.
 
void librpa_set_kgrids_kvec (LibrpaHandler *h, int nk1, int nk2, int nk3, const double *kvecs)
 Set k-point grid vectors.
 
void librpa_set_ibz_mapping (LibrpaHandler *h, int nkpts, const int *map_ibzk)
 Set the mapping from full k-point list to the irreducible sector.
 
void librpa_set_lri_coeff (LibrpaHandler *h, LibrpaParallelRouting routing, int I, int J, int nbasis_i, int nbasis_j, int naux_mu, const int R[3], const double *Cs_in)
 Set local RI coefficients.
 
void librpa_set_aux_bare_coulomb_k_atom_pair (LibrpaHandler *h, int ik, int I, int J, int naux_mu, int naux_nu, const double *Vq_real_in, const double *Vq_imag_in, double vq_threshold)
 Set bare Coulomb matrix elements (atom-pair format).
 
void librpa_set_aux_cut_coulomb_k_atom_pair (LibrpaHandler *h, int ik, int I, int J, int naux_mu, int naux_nu, const double *Vq_real_in, const double *Vq_imag_in, double vq_threshold)
 Set truncated Coulomb matrix elements (atom-pair format).
 
void librpa_set_aux_bare_coulomb_k_2d_block (LibrpaHandler *h, int ik, int mu_begin, int mu_end, int nu_begin, int nu_end, const double *Vq_real_in, const double *Vq_imag_in)
 Set bare Coulomb matrix elements (2D block format).
 
void librpa_set_aux_cut_coulomb_k_2d_block (LibrpaHandler *h, int ik, int mu_begin, int mu_end, int nu_begin, int nu_end, const double *Vq_real_in, const double *Vq_imag_in)
 Set truncated Coulomb matrix elements (2D block format).
 
void librpa_set_dielect_func_imagfreq (LibrpaHandler *h, int nfreq, const double *omegas_imag, const double *dielect_func)
 Set dielectric function on imaginary frequency axis.
 
void librpa_set_band_kvec (LibrpaHandler *h, int n_kpts_band, const double *kfrac_band)
 Set k-points for band structure calculations.
 
void librpa_set_band_occ_eigval (LibrpaHandler *h, int n_spins, int n_kpts_band, int n_states, const double *occ, const double *eig)
 Set occupation numbers and eigenvalues for band k-points.
 
void librpa_set_wfc_band (LibrpaHandler *h, int ispin, int ik_band, int nstates_local, int nbasis_local, const double *wfc_real, const double *wfc_imag)
 Set wavefunction for band k-point (separate real/imag).
 
void librpa_set_wfc_band_spinor (LibrpaHandler *h, int ik_band, int nstates_local, int nbasis_local, const double *wfc_up_real, const double *wfc_up_imag, const double *wfc_dn_real, const double *wfc_dn_imag)
 Set wavefunction for band k-point (spinor format, separate real/imag).
 
void librpa_set_wfc_band_packed (LibrpaHandler *h, int ispin, int ik_band, int nstates_local, int nbasis_local, const double *wfc_ri)
 Set wavefunction for band k-point (packed complex).
 
void librpa_set_wfc_band_spinor_packed (LibrpaHandler *h, int ik_band, int nstates_local, int nbasis_local, const double *wfc_up_ri, const double *wfc_dn_ri)
 Set wavefunction for band k-point (packed complex).
 
void librpa_reset_band_data (LibrpaHandler *h)
 Reset band structure input data.
 

Detailed Description

Input data APIs for LibRPA.

Function Documentation

◆ librpa_reset_band_data()

void librpa_reset_band_data ( LibrpaHandler * h)

Reset band structure input data.

Parameters
[in]hHandler.

◆ librpa_set_ao_basis_aux()

void librpa_set_ao_basis_aux ( LibrpaHandler * h,
int natoms,
const size_t * nbs_aux )

Set auxiliary atomic orbital basis size.

Parameters
[in]hHandler.
[in]natomsNumber of atoms.
[in]nbs_auxNumber of auxiliary basis functions per atom.

◆ librpa_set_ao_basis_wfc()

void librpa_set_ao_basis_wfc ( LibrpaHandler * h,
int natoms,
const size_t * nbs_wfc )

Set atomic orbital basis size for wavefunctions.

Parameters
[in]hHandler.
[in]natomsNumber of atoms.
[in]nbs_wfcNumber of basis functions per atom.

◆ librpa_set_atoms()

void librpa_set_atoms ( LibrpaHandler * h,
int natoms,
const int * types,
const double * posi_cart )

Set atom types and Cartesian coordinates.

Parameters
[in]hHandler.
[in]natomsNumber of atoms.
[in]typesAtom types (species indices, 0-based).
[in]posi_cartCartesian coordinates (3*natoms, in Bohr).

◆ librpa_set_aux_bare_coulomb_k_2d_block()

void librpa_set_aux_bare_coulomb_k_2d_block ( LibrpaHandler * h,
int ik,
int mu_begin,
int mu_end,
int nu_begin,
int nu_end,
const double * Vq_real_in,
const double * Vq_imag_in )

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

Parameters
[in]hHandler.
[in]ikK-point index.
[in]mu_beginStarting index for mu.
[in]mu_endEnding index for mu.
[in]nu_beginStarting index for nu.
[in]nu_endEnding index for nu.
[in]Vq_real_inReal part of Coulomb matrix.
[in]Vq_imag_inImaginary part of Coulomb matrix.

◆ librpa_set_aux_bare_coulomb_k_atom_pair()

void librpa_set_aux_bare_coulomb_k_atom_pair ( LibrpaHandler * h,
int ik,
int I,
int J,
int naux_mu,
int naux_nu,
const double * Vq_real_in,
const double * Vq_imag_in,
double vq_threshold )

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

Parameters
[in]hHandler.
[in]ikK-point index.
[in]IAtom I index.
[in]JAtom J index.
[in]naux_muNumber of auxiliary functions for mu.
[in]naux_nuNumber of auxiliary functions for nu.
[in]Vq_real_inReal part of Coulomb matrix.
[in]Vq_imag_inImaginary part of Coulomb matrix.
[in]vq_thresholdThreshold for screening.

◆ librpa_set_aux_cut_coulomb_k_2d_block()

void librpa_set_aux_cut_coulomb_k_2d_block ( LibrpaHandler * h,
int ik,
int mu_begin,
int mu_end,
int nu_begin,
int nu_end,
const double * Vq_real_in,
const double * Vq_imag_in )

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

Parameters
[in]hHandler.
[in]ikK-point index.
[in]mu_beginStarting index for mu.
[in]mu_endEnding index for mu.
[in]nu_beginStarting index for nu.
[in]nu_endEnding index for nu.
[in]Vq_real_inReal part of Coulomb matrix.
[in]Vq_imag_inImaginary part of Coulomb matrix.

◆ librpa_set_aux_cut_coulomb_k_atom_pair()

void librpa_set_aux_cut_coulomb_k_atom_pair ( LibrpaHandler * h,
int ik,
int I,
int J,
int naux_mu,
int naux_nu,
const double * Vq_real_in,
const double * Vq_imag_in,
double vq_threshold )

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

Parameters
[in]hHandler.
[in]ikK-point index.
[in]IAtom I index.
[in]JAtom J index.
[in]naux_muNumber of auxiliary functions for mu.
[in]naux_nuNumber of auxiliary functions for nu.
[in]Vq_real_inReal part of Coulomb matrix.
[in]Vq_imag_inImaginary part of Coulomb matrix.
[in]vq_thresholdThreshold for screening.

◆ librpa_set_band_kvec()

void librpa_set_band_kvec ( LibrpaHandler * h,
int n_kpts_band,
const double * kfrac_band )

Set k-points for band structure calculations.

Parameters
[in]hHandler.
[in]n_kpts_bandNumber of band k-points.
[in]kfrac_bandBand k-point coordinates (fractional).

◆ librpa_set_band_occ_eigval()

void librpa_set_band_occ_eigval ( LibrpaHandler * h,
int n_spins,
int n_kpts_band,
int n_states,
const double * occ,
const double * eig )

Set occupation numbers and eigenvalues for band k-points.

Parameters
[in]hHandler.
[in]n_spinsNumber of spin channels.
[in]n_kpts_bandNumber of band k-points.
[in]n_statesNumber of states.
[in]occOccupation numbers.
[in]eigEigenvalues.

◆ librpa_set_dielect_func_imagfreq()

void librpa_set_dielect_func_imagfreq ( LibrpaHandler * h,
int nfreq,
const double * omegas_imag,
const double * dielect_func )

Set dielectric function on imaginary frequency axis.

Parameters
[in]hHandler.
[in]nfreqNumber of frequency points.
[in]omegas_imagImaginary frequency values.
[in]dielect_funcDielectric function values.

◆ librpa_set_ibz_mapping()

void librpa_set_ibz_mapping ( LibrpaHandler * h,
int nkpts,
const int * map_ibzk )

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

Parameters
[in]hHandler.
[in]nkptsNumber of k-points in the full Brillouin zone.
[in]map_ibzkMapping to the k-point in the irreducible sector (0-based).

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

◆ librpa_set_kgrids_kvec()

void librpa_set_kgrids_kvec ( LibrpaHandler * h,
int nk1,
int nk2,
int nk3,
const double * kvecs )

Set k-point grid vectors.

Parameters
[in]hHandler.
[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 (nk1*nk2*nk3, Cartesian coordinates, in Bohr^-1).

◆ librpa_set_latvec_and_G()

void librpa_set_latvec_and_G ( LibrpaHandler * h,
const double lat_mat[9],
const double G_mat[9] )

Set direct and reciprocal lattice vectors.

Parameters
[in]hHandler.
[in]lat_matLattice vectors (3x3, column-major, in Bohr).
[in]G_matReciprocal lattice vectors (3x3, column-major, in Bohr^-1).

◆ librpa_set_lri_coeff()

void librpa_set_lri_coeff ( LibrpaHandler * h,
LibrpaParallelRouting routing,
int I,
int J,
int nbasis_i,
int nbasis_j,
int naux_mu,
const int R[3],
const double * Cs_in )

Set local RI coefficients.

Parameters
[in]hHandler.
[in]routingParallel routing strategy.
[in]IAtom I index (0-based).
[in]JAtom J index (0-based).
[in]nbasis_iNumber of basis functions on atom I.
[in]nbasis_jNumber of basis functions on atom J.
[in]naux_muNumber of auxiliary functions for mu index.
[in]RLattice vector [R1, R2, R3].
[in]Cs_inRI triple coefficients.

◆ librpa_set_scf_dimension()

void librpa_set_scf_dimension ( LibrpaHandler * h,
int nspins,
int nkpts,
int nstates,
int nbasis,
int nspinor = 1 )

Set meanfield wavefunction dimension.

Parameters
[in]hHandler.
[in]nspinsNumber of spin channels.
[in]nkptsNumber of k-points.
[in]nstatesNumber of electronic states.
[in]nbasisNumber of atomic basis functions.
[in]nspinorNumber of spin components per wavefunction

◆ librpa_set_wfc()

void librpa_set_wfc ( LibrpaHandler * h,
int ispin,
int ik,
int nstates_local,
int nbasis_local,
const double * wfc_real,
const double * wfc_imag )

Set wavefunction coefficients (real/imag separate arrays).

Parameters
[in]hHandler.
[in]ispinSpin index (0-based).
[in]ikK-point index (0-based).
[in]nstates_localLocal number of states.
[in]nbasis_localLocal number of basis functions.
[in]wfc_realReal part of wavefunction coefficients.
[in]wfc_imagImaginary part of wavefunction coefficients.

◆ librpa_set_wfc_band()

void librpa_set_wfc_band ( LibrpaHandler * h,
int ispin,
int ik_band,
int nstates_local,
int nbasis_local,
const double * wfc_real,
const double * wfc_imag )

Set wavefunction for band k-point (separate real/imag).

Parameters
[in]hHandler.
[in]ispinSpin index.
[in]ik_bandBand k-point index.
[in]nstates_localLocal number of states.
[in]nbasis_localLocal number of basis functions.
[in]wfc_realReal part of wavefunction.
[in]wfc_imagImaginary part of wavefunction.

◆ librpa_set_wfc_band_packed()

void librpa_set_wfc_band_packed ( LibrpaHandler * h,
int ispin,
int ik_band,
int nstates_local,
int nbasis_local,
const double * wfc_ri )

Set wavefunction for band k-point (packed complex).

Parameters
[in]hHandler.
[in]ispinSpin index.
[in]ik_bandBand k-point index.
[in]nstates_localLocal number of states.
[in]nbasis_localLocal number of atomic basis functions.
[in]wfc_riComplex wavefunction (packed).

◆ librpa_set_wfc_band_spinor()

void librpa_set_wfc_band_spinor ( LibrpaHandler * h,
int ik_band,
int nstates_local,
int nbasis_local,
const double * wfc_up_real,
const double * wfc_up_imag,
const double * wfc_dn_real,
const double * wfc_dn_imag )

Set wavefunction for band k-point (spinor format, separate real/imag).

Parameters
[in]hHandler.
[in]ik_bandBand k-point index.
[in]nstates_localLocal number of states.
[in]nbasis_localLocal number of atomic basis functions.
[in]wfc_up_realReal part of wavefunction coefficients (spin-up component).
[in]wfc_up_imagImaginary part of wavefunction coefficients (spin-up component).
[in]wfc_dn_realReal part of wavefunction coefficients (spin-down component).
[in]wfc_dn_imagImaginary part of wavefunction coefficients (spin-down component).

◆ librpa_set_wfc_band_spinor_packed()

void librpa_set_wfc_band_spinor_packed ( LibrpaHandler * h,
int ik_band,
int nstates_local,
int nbasis_local,
const double * wfc_up_ri,
const double * wfc_dn_ri )

Set wavefunction for band k-point (packed complex).

Parameters
[in]hHandler.
[in]ik_bandBand k-point index.
[in]nstates_localLocal number of states.
[in]nbasis_localLocal number of basis functions.
[in]wfc_up_riComplex wavefunction of spin-up component (packed).
[in]wfc_dn_riComplex wavefunction of spin-down component (packed).

◆ librpa_set_wfc_packed()

void librpa_set_wfc_packed ( LibrpaHandler * h,
int ispin,
int ik,
int nstates_local,
int nbasis_local,
const double * wfc_ri )

Set wavefunction coefficients (packed complex array).

Parameters
[in]hHandler.
[in]ispinSpin index (0-based).
[in]ikK-point index (0-based).
[in]nstates_localLocal number of states.
[in]nbasis_localLocal number of basis functions.
[in]wfc_riComplex wavefunction coefficients (packed).

◆ librpa_set_wfc_spinor()

void librpa_set_wfc_spinor ( LibrpaHandler * h,
int ik,
int nstates_local,
int nbasis_local,
const double * wfc_up_real,
const double * wfc_up_imag,
const double * wfc_dn_real,
const double * wfc_dn_imag )

Set wavefunction coefficients of spinor format (real/imag separate arrays).

Parameters
[in]hHandler.
[in]ikK-point index (0-based).
[in]nstates_localLocal number of states.
[in]nbasis_localLocal number of basis functions.
[in]wfc_up_realReal part of wavefunction coefficients (spin-up component).
[in]wfc_up_imagImaginary part of wavefunction coefficients (spin-up component).
[in]wfc_dn_realReal part of wavefunction coefficients (spin-down component).
[in]wfc_dn_imagImaginary part of wavefunction coefficients (spin-down component).

◆ librpa_set_wfc_spinor_packed()

void librpa_set_wfc_spinor_packed ( LibrpaHandler * h,
int ik,
int nstates_local,
int nbasis_local,
const double * wfc_up_ri,
const double * wfc_dn_ri )

Set wavefunction coefficients (packed complex array).

Parameters
[in]hHandler.
[in]ikK-point index (0-based).
[in]nstates_localLocal number of states.
[in]nbasis_localLocal number of basis functions.
[in]wfc_up_riComplex wavefunction coefficients of spin-up component (packed).
[in]wfc_dn_riComplex wavefunction coefficients of spin-down component (packed).

◆ librpa_set_wg_ekb_efermi()

void librpa_set_wg_ekb_efermi ( LibrpaHandler * h,
int nspins,
int nkpts,
int nstates,
const double * wg,
const double * ekb,
double efermi )

Set occupation numbers, eigenvalues, and Fermi level of meanfield input.

Parameters
[in]hHandler.
[in]nspinsNumber of spin channels.
[in]nkptsNumber of k-points.
[in]nstatesNumber of electronic states.
[in]wgOccupation numbers (size: nspins * nkpts * nstates).
[in]ekbEigenvalues (size: same as wg).
[in]efermiFermi level.