Handler Class Reference

Handler Class Reference#

LibRPA: librpa::Handler Class Reference
LibRPA
librpa::Handler Class Reference

Main handler class for LibRPA computations. More...

#include <librpa.hpp>

Public Member Functions

 Handler ()
 Default constructor (creates null handler).
 
 Handler (MPI_Comm comm)
 Construct and initialize handler with MPI communicator.
 
const LibrpaHandler * get_c_handler () const
 Get underlying C handler.
 
void init (MPI_Comm comm)
 Initialize handler with given MPI communicator.
 
void free ()
 Free handler and release resources.
 
 ~Handler ()
 Defatul destructor - automatically frees handler if not already freed.
 
void set_scf_dimension (int nspins, int nkpts, int nstates, int nbasis, int nspinor=1)
 Set mean-field wavefunction dimensions.
 
void set_wg_ekb_efermi (int nspins, int nkpts, int nstates, const double *wg, const double *ekb, double efermi)
 Set occupation numbers, eigenvalues, and Fermi level.
 
void set_wfc (int ispin, int ik, int nstates_local, int nbasis_local, const double *wfc_real, const double *wfc_imag)
 Set wavefunction coefficients from separate real and imaginary arrays.
 
void set_wfc_spinor (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 spinor wavefunction coefficients from separate real and imaginary arrays.
 
void set_wfc_packed (int ispin, int ik, int nstates_local, int nbasis_local, const std::complex< double > *wfc)
 Set wavefunction coefficients from a packed complex array.
 
void set_wfc_spinor_packed (int ik, int nstates_local, int nbasis_local, const std::complex< double > *wfc_up, const std::complex< double > *wfc_dn)
 Set spinor wavefunction coefficients from packed complex arrays.
 
void set_ao_basis_wfc (const std::vector< size_t > &nbs_wfc, const std::vector< std::vector< int > > &l_shells={})
 Set the wavefunction atomic-orbital basis.
 
void set_ao_basis_aux (const std::vector< size_t > &nbs_aux, const std::vector< std::vector< int > > &l_shells={})
 Set the auxiliary atomic-orbital basis.
 
void set_ao_basis_aux_shrink (const std::vector< size_t > &nbs_aux_shrink, const std::vector< std::vector< int > > &l_shells={})
 Set the compressed auxiliary atomic-orbital basis.
 
void set_basis_convention (int bloch_phase, int bloch_ratom, LibrpaAngularOrder order, LibrpaRshCoeff nega_m, LibrpaRshCoeff posi_m)
 Set basis-convention metadata used by symmetry reductions.
 
void set_symmetry_operations (int n_symops, int row_conv, const int *rotmats, const double *trans=nullptr)
 Set real-space symmetry operations.
 
void set_latvec_and_G (const double lat_mat[9], const double G_mat[9])
 Set direct and reciprocal lattice vectors.
 
void set_atoms (const std::vector< int > &types, const std::vector< double > &pos_cart)
 Set atom types and Cartesian coordinates.
 
void set_kgrids_kvec (int nk1, int nk2, int nk3, int nkpts, const double *kvecs, const double *kweights=nullptr)
 Set loaded SCF k-points from arrays.
 
void set_kgrids_kvec (int nk1, int nk2, int nk3, const std::vector< double > &kvecs, const std::vector< double > &kweights={})
 Set loaded SCF k-points from vectors.
 
void set_kq_mapping (const std::vector< int > &map_q_ks)
 Set the mapping from loaded SCF k-points to Coulomb q-points.
 
void set_lri_coeff (LibrpaParallelRouting routing, int I, int J, int nbasis_i, int nbasis_j, int naux_mu, const int R[3], const double *Cs_in, int shrink_aux=0)
 Set local RI coefficients.
 
void set_aux_bare_coulomb_k_atom_pair (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 in atom-pair format.
 
void set_aux_bare_coulomb_k_atom_pair_packed (int ik, int I, int J, int naux_mu, int naux_nu, const std::complex< double > *Vq, double vq_threshold)
 Set bare Coulomb matrix elements from a packed complex atom-pair matrix.
 
void set_aux_cut_coulomb_k_atom_pair (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 in atom-pair format.
 
void set_aux_cut_coulomb_k_atom_pair_packed (int ik, int I, int J, int naux_mu, int naux_nu, const std::complex< double > *Vq, double vq_threshold)
 Set truncated Coulomb matrix elements from a packed complex atom-pair matrix.
 
void set_aux_bare_coulomb_k_2d_block (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 a bare Coulomb matrix block.
 
void set_aux_bare_coulomb_k_2d_block_packed (int ik, int mu_begin, int mu_end, int nu_begin, int nu_end, const std::complex< double > *Vq)
 Set a bare Coulomb matrix block from packed complex values.
 
void set_aux_cut_coulomb_k_2d_block (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 a truncated Coulomb matrix block.
 
void set_aux_cut_coulomb_k_2d_block_packed (int ik, int mu_begin, int mu_end, int nu_begin, int nu_end, const std::complex< double > *Vq)
 Set a truncated Coulomb matrix block from packed complex values.
 
void set_dielect_func_imagfreq (const std::vector< double > &omegas_imag, const std::vector< double > &dielect_func)
 Set the dielectric function on the imaginary-frequency axis.
 
void set_velocity_matrix (int n_spins, int n_kpts, int n_states, const double *velocity_real, const double *velocity_imag)
 Set velocity matrices from separate real and imaginary arrays.
 
void set_velocity_matrix_packed (int n_spins, int n_kpts, int n_states, const std::complex< double > *velocity)
 Set velocity matrices from packed complex values.
 
void set_band_kvec (int n_kpts_band, const double *kfrac_band)
 Set k-points for band-structure calculations.
 
void set_band_occ_eigval (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 set_wfc_band (int ispin, int ik_band, int nstates_local, int nbasis_local, const double *wfc_real, const double *wfc_imag)
 Set band-k wavefunctions from separate real and imaginary arrays.
 
void set_wfc_band_spinor (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 spinor band-k wavefunctions from separate real and imaginary arrays.
 
void set_wfc_band_packed (int ispin, int ik_band, int nstates_local, int nbasis_local, const std::complex< double > *wfc)
 Set band-k wavefunctions from packed complex values.
 
void set_wfc_band_spinor_packed (int ik_band, int nstates_local, int nbasis_local, const std::complex< double > *wfc_up, const std::complex< double > *wfc_dn)
 Set spinor band-k wavefunctions from packed complex values.
 
void reset_band_data ()
 Reset band structure data.
 
void get_imaginary_frequency_grids (const Options &opts, std::vector< double > &omegas, std::vector< double > &weights)
 Construct imaginary-frequency grids.
 
double get_rpa_correlation_energy (const Options &opts, std::vector< std::complex< double > > &rpa_corr_ibzk_contrib)
 Compute RPA correlation energy.
 
void build_exx (const Options &opts)
 Build exact-exchange matrix in real space.
 
std::vector< double > get_exx_pot_kgrid (const Options &opts, const int n_spins, const std::vector< int > &iks_this, int i_state_low, int i_state_high)
 Get exact-exchange potential for k-grid states.
 
std::vector< double > get_exx_pot_band_k (const Options &opts, const int n_spins, const std::vector< int > &iks_band_this, int i_state_low, int i_state_high)
 Get exact-exchange potential for band k-points.
 
void build_g0w0_sigma (const Options &opts)
 Build G0W0 self-energy matrix in real space.
 
std::vector< std::complex< double > > get_g0w0_sigc_kgrid (const Options &opts, const int n_spins, const std::vector< int > &iks_this, int i_state_low, int i_state_high, const std::vector< double > &vxc, const std::vector< double > &vexx)
 Get G0W0 correlation self-energy for k-grid states.
 
G0W0QpeResult get_g0w0_qpe_kgrid (const Options &opts, const int n_spins, const std::vector< int > &iks_this, int i_state_low, int i_state_high, const std::vector< double > &vxc, const std::vector< double > &vexx)
 Get G0W0 correlation self-energies and quasiparticle energies for k-grid states.
 
std::vector< double > get_g0w0_spectral_function_kgrid (const Options &opts, const int n_spins, const std::vector< int > &iks_this, int i_state_low, int i_state_high, const std::vector< double > &omegas, const std::vector< double > &vxc, const std::vector< double > &vexx)
 Get G0W0 spectral functions for k-grid states.
 
G0W0SpectralFunctionResult get_g0w0_spectral_function_with_sigc_kgrid (const Options &opts, const int n_spins, const std::vector< int > &iks_this, int i_state_low, int i_state_high, const std::vector< double > &omegas, const std::vector< double > &vxc, const std::vector< double > &vexx)
 Get G0W0 spectral functions and continued self-energies for k-grid states.
 
std::vector< std::complex< double > > get_g0w0_sigc_band_k (const Options &opts, const int n_spins, const std::vector< int > &iks_band_this, int i_state_low, int i_state_high, const std::vector< double > &vxc_band, const std::vector< double > &vexx_band)
 Get G0W0 correlation self-energy for band k-points.
 
G0W0QpeResult get_g0w0_qpe_band_k (const Options &opts, const int n_spins, const std::vector< int > &iks_band_this, int i_state_low, int i_state_high, const std::vector< double > &vxc_band, const std::vector< double > &vexx_band)
 Get G0W0 correlation self-energies and quasiparticle energies for band-k states.
 
std::vector< double > get_g0w0_spectral_function_band_k (const Options &opts, const int n_spins, const std::vector< int > &iks_band_this, int i_state_low, int i_state_high, const std::vector< double > &omegas, const std::vector< double > &vxc_band, const std::vector< double > &vexx_band)
 Get G0W0 spectral functions for band k-point states.
 
G0W0SpectralFunctionResult get_g0w0_spectral_function_with_sigc_band_k (const Options &opts, const int n_spins, const std::vector< int > &iks_band_this, int i_state_low, int i_state_high, const std::vector< double > &omegas, const std::vector< double > &vxc_band, const std::vector< double > &vexx_band)
 Get G0W0 spectral functions and continued self-energies for band-k states.
 

Detailed Description

Main handler class for LibRPA computations.

This class wraps the C handler with RAII semantics for convenient resource management. It provides methods to set input data and perform RPA/EXX/G0W0 calculations.

Typical usage:

librpa::Handler h(MPI_COMM_WORLD);
h.set_scf_dimension(nspins, nkpts, nstates, nbasis);
// ... set more input data ...
double ec_rpa = h.get_rpa_correlation_energy(opts, ibzk_contrib);
h.free();
Main handler class for LibRPA computations.
Definition librpa.hpp:197
void init_global(Switch switch_redirect_stdout=LIBRPA_SWITCH_OFF, const char *redirect_path="stdout", Switch switch_process_output=LIBRPA_SWITCH_ON)
Initialize the global LibRPA environment.
void finalize_global(void)
Finalize the global LibRPA environment.

Constructor & Destructor Documentation

◆ Handler()

librpa::Handler::Handler ( MPI_Comm comm)

Construct and initialize handler with MPI communicator.

Parameters
[in]commMPI communicator for parallel computation.

◆ ~Handler()

librpa::Handler::~Handler ( )

Defatul destructor - automatically frees handler if not already freed.

Note
Rely on free() to explicitly release resources.

Member Function Documentation

◆ build_exx()

void librpa::Handler::build_exx ( const Options & opts)

Build exact-exchange matrix in real space.

Parameters
[in]optsRuntime options.

◆ build_g0w0_sigma()

void librpa::Handler::build_g0w0_sigma ( const Options & opts)

Build G0W0 self-energy matrix in real space.

Parameters
[in]optsRuntime options.

◆ get_c_handler()

const LibrpaHandler * librpa::Handler::get_c_handler ( ) const
inline

Get underlying C handler.

Returns
Non-owning pointer to the wrapped C handler.

◆ get_exx_pot_band_k()

std::vector< double > librpa::Handler::get_exx_pot_band_k ( const Options & opts,
const int n_spins,
const std::vector< int > & iks_band_this,
int i_state_low,
int i_state_high )

Get exact-exchange potential for band k-points.

Parameters
[in]optsRuntime options.
[in]n_spinsNumber of spin channels.
[in]iks_band_thisList of band k-point indices on this process.
[in]i_state_lowFirst state index (inclusive).
[in]i_state_highLast state index (exclusive).
Returns
Exact-exchange potentials for band states.

◆ get_exx_pot_kgrid()

std::vector< double > librpa::Handler::get_exx_pot_kgrid ( const Options & opts,
const int n_spins,
const std::vector< int > & iks_this,
int i_state_low,
int i_state_high )

Get exact-exchange potential for k-grid states.

Parameters
[in]optsRuntime options.
[in]n_spinsNumber of spin channels.
[in]iks_thisList of k-point indices computed on this process.
[in]i_state_lowFirst state index (inclusive).
[in]i_state_highLast state index (exclusive).
Returns
Exact-exchange potentials for selected states.

◆ get_g0w0_qpe_band_k()

G0W0QpeResult librpa::Handler::get_g0w0_qpe_band_k ( const Options & opts,
const int n_spins,
const std::vector< int > & iks_band_this,
int i_state_low,
int i_state_high,
const std::vector< double > & vxc_band,
const std::vector< double > & vexx_band )

Get G0W0 correlation self-energies and quasiparticle energies for band-k states.

Parameters
[in]optsRuntime options.
[in]n_spinsNumber of spin channels.
[in]iks_band_thisBand k-point indices computed on this process.
[in]i_state_lowFirst state index (inclusive).
[in]i_state_highLast state index (exclusive).
[in]vxc_bandXC potential for selected band states.
[in]vexx_bandExact-exchange potential for selected band states.
Returns
Correlation self-energies and quasiparticle energies.

◆ get_g0w0_qpe_kgrid()

G0W0QpeResult librpa::Handler::get_g0w0_qpe_kgrid ( const Options & opts,
const int n_spins,
const std::vector< int > & iks_this,
int i_state_low,
int i_state_high,
const std::vector< double > & vxc,
const std::vector< double > & vexx )

Get G0W0 correlation self-energies and quasiparticle energies for k-grid states.

Parameters
[in]optsRuntime options.
[in]n_spinsNumber of spin channels.
[in]iks_thisK-point indices computed on this process.
[in]i_state_lowFirst state index (inclusive).
[in]i_state_highLast state index (exclusive).
[in]vxcXC potential for selected states.
[in]vexxExact-exchange potential for selected states.
Returns
Correlation self-energies and quasiparticle energies.

◆ get_g0w0_sigc_band_k()

std::vector< std::complex< double > > librpa::Handler::get_g0w0_sigc_band_k ( const Options & opts,
const int n_spins,
const std::vector< int > & iks_band_this,
int i_state_low,
int i_state_high,
const std::vector< double > & vxc_band,
const std::vector< double > & vexx_band )

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

Parameters
[in]optsRuntime options.
[in]n_spinsNumber of spin channels.
[in]iks_band_thisList of band k-point indices on this process.
[in]i_state_lowFirst state index (inclusive).
[in]i_state_highLast state index (exclusive).
[in]vxc_bandXC potential for band states.
[in]vexx_bandExact-exchange potential for band states.
Returns
Correlation self-energy for band states.

◆ get_g0w0_sigc_kgrid()

std::vector< std::complex< double > > librpa::Handler::get_g0w0_sigc_kgrid ( const Options & opts,
const int n_spins,
const std::vector< int > & iks_this,
int i_state_low,
int i_state_high,
const std::vector< double > & vxc,
const std::vector< double > & vexx )

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

Parameters
[in]optsRuntime options.
[in]n_spinsNumber of spin channels.
[in]iks_thisList of k-point indices on this process.
[in]i_state_lowFirst state index (inclusive).
[in]i_state_highLast state index (exclusive).
[in]vxcXC potential for selected states.
[in]vexxExact-exchange potential for selected states.
Returns
Correlation self-energy for selected states.

◆ get_g0w0_spectral_function_band_k()

std::vector< double > librpa::Handler::get_g0w0_spectral_function_band_k ( const Options & opts,
const int n_spins,
const std::vector< int > & iks_band_this,
int i_state_low,
int i_state_high,
const std::vector< double > & omegas,
const std::vector< double > & vxc_band,
const std::vector< double > & vexx_band )

Get G0W0 spectral functions for band k-point states.

The returned data are ordered as [spin][band k-point][state][omega].

Parameters
[in]optsRuntime options.
[in]n_spinsNumber of spin channels.
[in]iks_band_thisBand k-point indices computed on this process.
[in]i_state_lowFirst state index (inclusive).
[in]i_state_highLast state index (exclusive).
[in]omegasReal-frequency points.
[in]vxc_bandXC potential for selected band states.
[in]vexx_bandExact-exchange potential for selected band states.
Returns
Spectral-function values.

◆ get_g0w0_spectral_function_kgrid()

std::vector< double > librpa::Handler::get_g0w0_spectral_function_kgrid ( const Options & opts,
const int n_spins,
const std::vector< int > & iks_this,
int i_state_low,
int i_state_high,
const std::vector< double > & omegas,
const std::vector< double > & vxc,
const std::vector< double > & vexx )

Get G0W0 spectral functions for k-grid states.

The returned data are ordered as [spin][k-point][state][omega].

Parameters
[in]optsRuntime options.
[in]n_spinsNumber of spin channels.
[in]iks_thisK-point indices computed on this process.
[in]i_state_lowFirst state index (inclusive).
[in]i_state_highLast state index (exclusive).
[in]omegasReal-frequency points.
[in]vxcXC potential for selected states.
[in]vexxExact-exchange potential for selected states.
Returns
Spectral-function values.

◆ get_g0w0_spectral_function_with_sigc_band_k()

G0W0SpectralFunctionResult librpa::Handler::get_g0w0_spectral_function_with_sigc_band_k ( const Options & opts,
const int n_spins,
const std::vector< int > & iks_band_this,
int i_state_low,
int i_state_high,
const std::vector< double > & omegas,
const std::vector< double > & vxc_band,
const std::vector< double > & vexx_band )

Get G0W0 spectral functions and continued self-energies for band-k states.

Parameters
[in]optsRuntime options.
[in]n_spinsNumber of spin channels.
[in]iks_band_thisBand k-point indices computed on this process.
[in]i_state_lowFirst state index (inclusive).
[in]i_state_highLast state index (exclusive).
[in]omegasReal-frequency points.
[in]vxc_bandXC potential for selected band states.
[in]vexx_bandExact-exchange potential for selected band states.
Returns
Spectral functions and continued correlation self-energies.

◆ get_g0w0_spectral_function_with_sigc_kgrid()

G0W0SpectralFunctionResult librpa::Handler::get_g0w0_spectral_function_with_sigc_kgrid ( const Options & opts,
const int n_spins,
const std::vector< int > & iks_this,
int i_state_low,
int i_state_high,
const std::vector< double > & omegas,
const std::vector< double > & vxc,
const std::vector< double > & vexx )

Get G0W0 spectral functions and continued self-energies for k-grid states.

Parameters
[in]optsRuntime options.
[in]n_spinsNumber of spin channels.
[in]iks_thisK-point indices computed on this process.
[in]i_state_lowFirst state index (inclusive).
[in]i_state_highLast state index (exclusive).
[in]omegasReal-frequency points.
[in]vxcXC potential for selected states.
[in]vexxExact-exchange potential for selected states.
Returns
Spectral functions and continued correlation self-energies.

◆ get_imaginary_frequency_grids()

void librpa::Handler::get_imaginary_frequency_grids ( const Options & opts,
std::vector< double > & omegas,
std::vector< double > & weights )

Construct imaginary-frequency grids.

Parameters
[in]optsRuntime options.
[out]omegasFrequency points.
[out]weightsQuadrature weights.

◆ get_rpa_correlation_energy()

double librpa::Handler::get_rpa_correlation_energy ( const Options & opts,
std::vector< std::complex< double > > & rpa_corr_ibzk_contrib )

Compute RPA correlation energy.

Parameters
[in]optsRuntime options.
[out]rpa_corr_ibzk_contribComplex RPA correlation contribution per k-point.
Returns
Total RPA correlation energy.

◆ init()

void librpa::Handler::init ( MPI_Comm comm)

Initialize handler with given MPI communicator.

Parameters
[in]commMPI communicator.

◆ set_ao_basis_aux()

void librpa::Handler::set_ao_basis_aux ( const std::vector< size_t > & nbs_aux,
const std::vector< std::vector< int > > & l_shells = {} )

Set the auxiliary atomic-orbital basis.

Parameters
[in]nbs_auxNumber of auxiliary basis functions per atom.
[in]l_shellsOptional angular momenta grouped by atom.

◆ set_ao_basis_aux_shrink()

void librpa::Handler::set_ao_basis_aux_shrink ( const std::vector< size_t > & nbs_aux_shrink,
const std::vector< std::vector< int > > & l_shells = {} )

Set the compressed auxiliary atomic-orbital basis.

Parameters
[in]nbs_aux_shrinkNumber of compressed auxiliary functions per atom.
[in]l_shellsOptional angular momenta grouped by atom.

◆ set_ao_basis_wfc()

void librpa::Handler::set_ao_basis_wfc ( const std::vector< size_t > & nbs_wfc,
const std::vector< std::vector< int > > & l_shells = {} )

Set the wavefunction atomic-orbital basis.

Parameters
[in]nbs_wfcNumber of basis functions per atom.
[in]l_shellsOptional angular momenta grouped by atom.

◆ set_atoms()

void librpa::Handler::set_atoms ( const std::vector< int > & types,
const std::vector< double > & pos_cart )

Set atom types and Cartesian coordinates.

Parameters
[in]typesSpecies indices.
[in]pos_cartCartesian coordinates in Bohr.

◆ set_aux_bare_coulomb_k_2d_block()

void librpa::Handler::set_aux_bare_coulomb_k_2d_block ( 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 a bare Coulomb matrix block.

Parameters
[in]ikK-point index.
[in]mu_beginFirst row index.
[in]mu_endRow end index.
[in]nu_beginFirst column index.
[in]nu_endColumn end index.
[in]Vq_real_inReal parts of the block.
[in]Vq_imag_inImaginary parts of the block.

◆ set_aux_bare_coulomb_k_2d_block_packed()

void librpa::Handler::set_aux_bare_coulomb_k_2d_block_packed ( int ik,
int mu_begin,
int mu_end,
int nu_begin,
int nu_end,
const std::complex< double > * Vq )

Set a bare Coulomb matrix block from packed complex values.

Parameters
[in]ikK-point index.
[in]mu_beginFirst row index.
[in]mu_endRow end index.
[in]nu_beginFirst column index.
[in]nu_endColumn end index.
[in]VqComplex block values.

◆ set_aux_bare_coulomb_k_atom_pair()

void librpa::Handler::set_aux_bare_coulomb_k_atom_pair ( 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 in atom-pair format.

Parameters
[in]ikK-point index.
[in]IFirst atom index.
[in]JSecond atom index.
[in]naux_muRow size.
[in]naux_nuColumn size.
[in]Vq_real_inReal parts of the matrix.
[in]Vq_imag_inImaginary parts of the matrix.
[in]vq_thresholdScreening threshold.

◆ set_aux_bare_coulomb_k_atom_pair_packed()

void librpa::Handler::set_aux_bare_coulomb_k_atom_pair_packed ( int ik,
int I,
int J,
int naux_mu,
int naux_nu,
const std::complex< double > * Vq,
double vq_threshold )

Set bare Coulomb matrix elements from a packed complex atom-pair matrix.

Parameters
[in]ikK-point index.
[in]IFirst atom index.
[in]JSecond atom index.
[in]naux_muRow size.
[in]naux_nuColumn size.
[in]VqComplex matrix elements.
[in]vq_thresholdScreening threshold.

◆ set_aux_cut_coulomb_k_2d_block()

void librpa::Handler::set_aux_cut_coulomb_k_2d_block ( 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 a truncated Coulomb matrix block.

Parameters
[in]ikK-point index.
[in]mu_beginFirst row index.
[in]mu_endRow end index.
[in]nu_beginFirst column index.
[in]nu_endColumn end index.
[in]Vq_real_inReal parts of the block.
[in]Vq_imag_inImaginary parts of the block.

◆ set_aux_cut_coulomb_k_2d_block_packed()

void librpa::Handler::set_aux_cut_coulomb_k_2d_block_packed ( int ik,
int mu_begin,
int mu_end,
int nu_begin,
int nu_end,
const std::complex< double > * Vq )

Set a truncated Coulomb matrix block from packed complex values.

Parameters
[in]ikK-point index.
[in]mu_beginFirst row index.
[in]mu_endRow end index.
[in]nu_beginFirst column index.
[in]nu_endColumn end index.
[in]VqComplex block values.

◆ set_aux_cut_coulomb_k_atom_pair()

void librpa::Handler::set_aux_cut_coulomb_k_atom_pair ( 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 in atom-pair format.

Parameters
[in]ikK-point index.
[in]IFirst atom index.
[in]JSecond atom index.
[in]naux_muRow size.
[in]naux_nuColumn size.
[in]Vq_real_inReal parts of the matrix.
[in]Vq_imag_inImaginary parts of the matrix.
[in]vq_thresholdScreening threshold.

◆ set_aux_cut_coulomb_k_atom_pair_packed()

void librpa::Handler::set_aux_cut_coulomb_k_atom_pair_packed ( int ik,
int I,
int J,
int naux_mu,
int naux_nu,
const std::complex< double > * Vq,
double vq_threshold )

Set truncated Coulomb matrix elements from a packed complex atom-pair matrix.

Parameters
[in]ikK-point index.
[in]IFirst atom index.
[in]JSecond atom index.
[in]naux_muRow size.
[in]naux_nuColumn size.
[in]VqComplex matrix elements.
[in]vq_thresholdScreening threshold.

◆ set_band_kvec()

void librpa::Handler::set_band_kvec ( int n_kpts_band,
const double * kfrac_band )

Set k-points for band-structure calculations.

Parameters
[in]n_kpts_bandNumber of band k-points.
[in]kfrac_bandFractional band k-point coordinates.

◆ set_band_occ_eigval()

void librpa::Handler::set_band_occ_eigval ( 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]n_spinsNumber of spin channels.
[in]n_kpts_bandNumber of band k-points.
[in]n_statesNumber of states.
[in]occOccupation numbers.
[in]eigEigenvalues.

◆ set_basis_convention()

void librpa::Handler::set_basis_convention ( int bloch_phase,
int bloch_ratom,
LibrpaAngularOrder order,
LibrpaRshCoeff nega_m,
LibrpaRshCoeff posi_m )

Set basis-convention metadata used by symmetry reductions.

Parameters
[in]bloch_phaseBloch-sum phase sign.
[in]bloch_ratomAtom-position coefficient in the Bloch phase.
[in]orderAngular basis ordering.
[in]nega_mReal-spherical-harmonic convention for negative m.
[in]posi_mReal-spherical-harmonic convention for positive m.

◆ set_dielect_func_imagfreq()

void librpa::Handler::set_dielect_func_imagfreq ( const std::vector< double > & omegas_imag,
const std::vector< double > & dielect_func )

Set the dielectric function on the imaginary-frequency axis.

Parameters
[in]omegas_imagImaginary-frequency points.
[in]dielect_funcDielectric-function values.

◆ set_kgrids_kvec() [1/2]

void librpa::Handler::set_kgrids_kvec ( int nk1,
int nk2,
int nk3,
const std::vector< double > & kvecs,
const std::vector< double > & kweights = {} )

Set loaded SCF k-points from vectors.

Parameters
[in]nk1Grid size along direction 1.
[in]nk2Grid size along direction 2.
[in]nk3Grid size along direction 3.
[in]kvecsCartesian k-point vectors.
[in]kweightsOptional weights, normalized to sum to one.

◆ set_kgrids_kvec() [2/2]

void librpa::Handler::set_kgrids_kvec ( int nk1,
int nk2,
int nk3,
int nkpts,
const double * kvecs,
const double * kweights = nullptr )

Set loaded SCF k-points from arrays.

Parameters
[in]nk1Grid size along direction 1.
[in]nk2Grid size along direction 2.
[in]nk3Grid size along direction 3.
[in]nkptsNumber of loaded SCF k-points.
[in]kvecsCartesian k-point vectors.
[in]kweightsOptional weights, normalized to sum to one.

◆ set_kq_mapping()

void librpa::Handler::set_kq_mapping ( const std::vector< int > & map_q_ks)

Set the mapping from loaded SCF k-points to Coulomb q-points.

Parameters
[in]map_q_ksRepresentative q-point index for each loaded k-point.

◆ set_latvec_and_G()

void librpa::Handler::set_latvec_and_G ( const double lat_mat[9],
const double G_mat[9] )

Set direct and reciprocal lattice vectors.

Parameters
[in]lat_matDirect lattice vectors in Bohr.
[in]G_matReciprocal lattice vectors in Bohr^-1.

◆ set_lri_coeff()

void librpa::Handler::set_lri_coeff ( LibrpaParallelRouting routing,
int I,
int J,
int nbasis_i,
int nbasis_j,
int naux_mu,
const int R[3],
const double * Cs_in,
int shrink_aux = 0 )

Set local RI coefficients.

Parameters
[in]routingParallel routing strategy.
[in]IFirst atom index.
[in]JSecond atom index.
[in]nbasis_iBasis size on atom I.
[in]nbasis_jBasis size on atom J.
[in]naux_muAuxiliary basis size.
[in]RLattice vector.
[in]Cs_inRI coefficients.
[in]shrink_auxNonzero selects the compressed auxiliary basis.

◆ set_scf_dimension()

void librpa::Handler::set_scf_dimension ( int nspins,
int nkpts,
int nstates,
int nbasis,
int nspinor = 1 )

Set mean-field wavefunction dimensions.

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

◆ set_symmetry_operations()

void librpa::Handler::set_symmetry_operations ( int n_symops,
int row_conv,
const int * rotmats,
const double * trans = nullptr )

Set real-space symmetry operations.

Parameters
[in]n_symopsNumber of operations.
[in]row_convNonzero for row-fractional rotations.
[in]rotmatsFlattened rotation matrices.
[in]transOptional flattened fractional translations.

◆ set_velocity_matrix()

void librpa::Handler::set_velocity_matrix ( int n_spins,
int n_kpts,
int n_states,
const double * velocity_real,
const double * velocity_imag )

Set velocity matrices from separate real and imaginary arrays.

Parameters
[in]n_spinsNumber of spin channels.
[in]n_kptsNumber of k-points.
[in]n_statesNumber of states.
[in]velocity_realReal parts of the matrices.
[in]velocity_imagImaginary parts of the matrices.

◆ set_velocity_matrix_packed()

void librpa::Handler::set_velocity_matrix_packed ( int n_spins,
int n_kpts,
int n_states,
const std::complex< double > * velocity )

Set velocity matrices from packed complex values.

Parameters
[in]n_spinsNumber of spin channels.
[in]n_kptsNumber of k-points.
[in]n_statesNumber of states.
[in]velocityComplex matrix values.

◆ set_wfc()

void librpa::Handler::set_wfc ( int ispin,
int ik,
int nstates_local,
int nbasis_local,
const double * wfc_real,
const double * wfc_imag )

Set wavefunction coefficients from separate real and imaginary arrays.

Parameters
[in]ispinSpin index.
[in]ikK-point index.
[in]nstates_localLocal number of states.
[in]nbasis_localLocal number of basis functions.
[in]wfc_realReal parts of the coefficients.
[in]wfc_imagImaginary parts of the coefficients.

◆ set_wfc_band()

void librpa::Handler::set_wfc_band ( int ispin,
int ik_band,
int nstates_local,
int nbasis_local,
const double * wfc_real,
const double * wfc_imag )

Set band-k wavefunctions from separate real and imaginary arrays.

Parameters
[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 parts of the coefficients.
[in]wfc_imagImaginary parts of the coefficients.

◆ set_wfc_band_packed()

void librpa::Handler::set_wfc_band_packed ( int ispin,
int ik_band,
int nstates_local,
int nbasis_local,
const std::complex< double > * wfc )

Set band-k wavefunctions from packed complex values.

Parameters
[in]ispinSpin index.
[in]ik_bandBand k-point index.
[in]nstates_localLocal number of states.
[in]nbasis_localLocal number of basis functions.
[in]wfcComplex coefficients.

◆ set_wfc_band_spinor()

void librpa::Handler::set_wfc_band_spinor ( 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 spinor band-k wavefunctions from separate real and imaginary arrays.

Parameters
[in]ik_bandBand k-point index.
[in]nstates_localLocal number of states.
[in]nbasis_localLocal number of basis functions.
[in]wfc_up_realReal parts of the spin-up coefficients.
[in]wfc_up_imagImaginary parts of the spin-up coefficients.
[in]wfc_dn_realReal parts of the spin-down coefficients.
[in]wfc_dn_imagImaginary parts of the spin-down coefficients.

◆ set_wfc_band_spinor_packed()

void librpa::Handler::set_wfc_band_spinor_packed ( int ik_band,
int nstates_local,
int nbasis_local,
const std::complex< double > * wfc_up,
const std::complex< double > * wfc_dn )

Set spinor band-k wavefunctions from packed complex values.

Parameters
[in]ik_bandBand k-point index.
[in]nstates_localLocal number of states.
[in]nbasis_localLocal number of basis functions.
[in]wfc_upSpin-up coefficients.
[in]wfc_dnSpin-down coefficients.

◆ set_wfc_packed()

void librpa::Handler::set_wfc_packed ( int ispin,
int ik,
int nstates_local,
int nbasis_local,
const std::complex< double > * wfc )

Set wavefunction coefficients from a packed complex array.

Parameters
[in]ispinSpin index.
[in]ikK-point index.
[in]nstates_localLocal number of states.
[in]nbasis_localLocal number of basis functions.
[in]wfcComplex coefficients.

◆ set_wfc_spinor()

void librpa::Handler::set_wfc_spinor ( 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 spinor wavefunction coefficients from separate real and imaginary arrays.

Parameters
[in]ikK-point index.
[in]nstates_localLocal number of states.
[in]nbasis_localLocal number of basis functions.
[in]wfc_up_realReal parts of the spin-up coefficients.
[in]wfc_up_imagImaginary parts of the spin-up coefficients.
[in]wfc_dn_realReal parts of the spin-down coefficients.
[in]wfc_dn_imagImaginary parts of the spin-down coefficients.

◆ set_wfc_spinor_packed()

void librpa::Handler::set_wfc_spinor_packed ( int ik,
int nstates_local,
int nbasis_local,
const std::complex< double > * wfc_up,
const std::complex< double > * wfc_dn )

Set spinor wavefunction coefficients from packed complex arrays.

Parameters
[in]ikK-point index.
[in]nstates_localLocal number of states.
[in]nbasis_localLocal number of basis functions.
[in]wfc_upSpin-up coefficients.
[in]wfc_dnSpin-down coefficients.

◆ set_wg_ekb_efermi()

void librpa::Handler::set_wg_ekb_efermi ( int nspins,
int nkpts,
int nstates,
const double * wg,
const double * ekb,
double efermi )

Set occupation numbers, eigenvalues, and Fermi level.

Parameters
[in]nspinsNumber of spin channels.
[in]nkptsNumber of k-points.
[in]nstatesNumber of states.
[in]wgOccupation numbers.
[in]ekbEigenvalues.
[in]efermiFermi level.

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