librpa.hpp Source File

librpa.hpp Source File#

LibRPA: librpa.hpp Source File
LibRPA
librpa.hpp
Go to the documentation of this file.
1#pragma once
16
17#include "librpa_enums.h"
18#include "librpa_options.h"
19#include "librpa_handler.h"
20#include "librpa_compute.h"
21
22#include <array>
23#include <vector>
24#include <complex>
25#include <memory>
26
30namespace librpa
31{
32
33using QsgwTask = std::unique_ptr<LibrpaQsgwTask, decltype(&librpa_delete_qsgw_task)>;
34using OpticalResult = std::unique_ptr<LibrpaOpticalResult, decltype(&librpa_delete_optical_result)>;
35using OrbitalResult = std::unique_ptr<LibrpaOrbitalResult, decltype(&librpa_delete_orbital_result)>;
36using CrpaResult = std::unique_ptr<LibrpaCrpaResult, decltype(&librpa_delete_crpa_result)>;
37using CrpaContinuedResult =
38 std::unique_ptr<LibrpaCrpaContinuedResult, decltype(&librpa_delete_crpa_continued_result)>;
41CrpaContinuedResult continue_crpa(const LibrpaCrpaResult *result,
42 const std::vector<std::complex<double>> &queries,
43 int n_parameters = -1,
44 double tolerance_ha = 0.0003674932217565499);
45
47std::array<std::complex<double>, 3> crpa_tensor_averages(
48 int n_orbitals, const std::vector<std::complex<double>> &tensor);
49
50/* Enums */
56
58
60
62
64
67{
68 std::vector<std::complex<double>> sigc;
69 std::vector<double> eqp;
70};
71
74{
75 std::vector<std::complex<double>> sigc;
76 std::vector<double> spectral_function;
77};
78
79
80/* Options */
92{
93public:
96
103
113};
114
116CrpaContinuedResult continue_crpa(const LibrpaCrpaResult *result,
117 const std::vector<std::complex<double>> &queries,
118 const Options &options,
119 double tolerance_ha = 0.0003674932217565499);
120
121/* Global environment functions */
122
128const char* get_build_info(void);
129
136
143
150
161void init_global(Switch switch_redirect_stdout = LIBRPA_SWITCH_OFF, const char *redirect_path = "stdout",
162 Switch switch_process_output = LIBRPA_SWITCH_ON);
163
169void set_output_level(Verbose output_level);
170
177
185
190void test(void);
191
196void print_profile(void);
197
198/* C++ handler definition, input and compute methods declarations */
199
222{
223private:
224 LibrpaHandler *h_ = nullptr;
225public:
227 Handler(): h_(nullptr) {};
228
233 Handler(MPI_Comm comm);
234
239 const LibrpaHandler *get_c_handler() const { return h_; }
240
244 OrbitalResult analyze_orbitals(int n_kpoints, int n_aos,
245 const std::vector<double> &overlap_k_ri,
246 double residual_tol) const;
247
252 void init(MPI_Comm comm);
253
257 void free();
258
265
270 QsgwTask create_qsgw_task(const Options &opts, const LibrpaQsgwControls &controls) const;
271
272 /* Input (set) functions */
273
282 void set_scf_dimension(int nspins, int nkpts, int nstates, int nbasis, int nspinor = 1);
283
293 void set_wg_ekb_efermi(int nspins, int nkpts, int nstates, const double *wg, const double *ekb,
294 double efermi);
295
305 void set_wfc(int ispin, int ik, int nstates_local, int nbasis_local, const double *wfc_real,
306 const double *wfc_imag);
307
318 void set_wfc_spinor(int ik, int nstates_local, int nbasis_local,
319 const double* wfc_up_real, const double* wfc_up_imag,
320 const double* wfc_dn_real, const double* wfc_dn_imag);
321
330 void set_wfc_packed(int ispin, int ik, int nstates_local, int nbasis_local,
331 const std::complex<double> *wfc);
332
341 void set_wfc_spinor_packed(int ik, int nstates_local, int nbasis_local,
342 const std::complex<double> *wfc_up,
343 const std::complex<double> *wfc_dn);
344
350 void set_ao_basis_wfc(const std::vector<size_t> &nbs_wfc,
351 const std::vector<std::vector<int>> &l_shells = {});
352
358 void set_ao_basis_aux(const std::vector<size_t> &nbs_aux,
359 const std::vector<std::vector<int>> &l_shells = {});
360
366 void set_ao_basis_aux_shrink(const std::vector<size_t> &nbs_aux_shrink,
367 const std::vector<std::vector<int>> &l_shells = {});
368
377 void set_basis_convention(int bloch_phase, int bloch_ratom, LibrpaAngularOrder order,
378 LibrpaRshCoeff nega_m, LibrpaRshCoeff posi_m);
379
387 void set_symmetry_operations(int n_symops, int row_conv, const int* rotmats,
388 const double* trans = nullptr);
389
401 void set_symmetry_spin_operations(int n_ops, int row_conv, const int* rotmats,
402 const double* trans = nullptr,
403 const int* antiunitary = nullptr,
404 const double* spin_u = nullptr,
405 int spin_action_source = 0,
406 int grey_group = 0);
407
413 void set_latvec_and_G(const double lat_mat[9], const double G_mat[9]);
414
420 void set_atoms(const std::vector<int> &types, const std::vector<double> &pos_cart);
421
431 void set_kgrids_kvec(int nk1, int nk2, int nk3, int nkpts,
432 const double *kvecs, const double *kweights = nullptr);
433
442 void set_kgrids_kvec(int nk1, int nk2, int nk3, const std::vector<double> &kvecs,
443 const std::vector<double> &kweights = {});
444
449 void set_kq_mapping(const std::vector<int> &map_q_ks);
450
454 void set_irreducible_kgrids_kvec(int nk1, int nk2, int nk3,
455 const std::vector<double> &kvecs_scf,
456 const std::vector<double> &kvecs_full,
457 const std::vector<int> &full_to_scf);
458
471 void set_lri_coeff(LibrpaParallelRouting routing, int I, int J, int nbasis_i, int nbasis_j,
472 int naux_mu, const int R[3], const double *Cs_in,
473 int shrink_aux = 0);
474
486 void set_aux_bare_coulomb_k_atom_pair(int ik, int I, int J, int naux_mu, int naux_nu,
487 const double *Vq_real_in, const double *Vq_imag_in,
488 double vq_threshold);
489
500 void set_aux_bare_coulomb_k_atom_pair_packed(int ik, int I, int J, int naux_mu, int naux_nu,
501 const std::complex<double> *Vq,
502 double vq_threshold);
503
515 void set_aux_cut_coulomb_k_atom_pair(int ik, int I, int J, int naux_mu, int naux_nu,
516 const double *Vq_real_in, const double *Vq_imag_in,
517 double vq_threshold);
518
529 void set_aux_cut_coulomb_k_atom_pair_packed(int ik, int I, int J, int naux_mu, int naux_nu,
530 const std::complex<double> *Vq,
531 double vq_threshold);
532
543 void set_aux_bare_coulomb_k_2d_block(int ik, int mu_begin, int mu_end, int nu_begin, int nu_end,
544 const double *Vq_real_in, const double *Vq_imag_in);
545
555 void set_aux_bare_coulomb_k_2d_block_packed(int ik, int mu_begin, int mu_end,
556 int nu_begin, int nu_end,
557 const std::complex<double> *Vq);
558
569 void set_aux_cut_coulomb_k_2d_block(int ik, int mu_begin, int mu_end, int nu_begin, int nu_end,
570 const double *Vq_real_in, const double *Vq_imag_in);
571
581 void set_aux_cut_coulomb_k_2d_block_packed(int ik, int mu_begin, int mu_end,
582 int nu_begin, int nu_end,
583 const std::complex<double> *Vq);
584
590 void set_dielect_func_imagfreq(const std::vector<double> &omegas_imag,
591 const std::vector<double> &dielect_func);
592
601 void set_velocity_matrix(int n_spins, int n_kpts, int n_states,
602 const double *velocity_real, const double *velocity_imag);
603
611 void set_velocity_matrix_packed(int n_spins, int n_kpts, int n_states,
612 const std::complex<double> *velocity);
613
615 void prepare_native_velocity(const Options &opts, const LibrpaNativeVelocityInput *root_input,
616 bool prepare_optical = true);
618 OpticalResult get_optical_result() const;
619
625 void set_band_kvec(int n_kpts_band, const double *kfrac_band);
626
635 void set_band_occ_eigval(int n_spins, int n_kpts_band, int n_states, const double *occ,
636 const double *eig);
637
647 void set_wfc_band(int ispin, int ik_band, int nstates_local, int nbasis_local,
648 const double *wfc_real, const double *wfc_imag);
649
660 void set_wfc_band_spinor(int ik_band, int nstates_local, int nbasis_local,
661 const double* wfc_up_real, const double* wfc_up_imag,
662 const double* wfc_dn_real, const double* wfc_dn_imag);
663
672 void set_wfc_band_packed(int ispin, int ik_band, int nstates_local, int nbasis_local,
673 const std::complex<double> *wfc);
674
683 void set_wfc_band_spinor_packed(int ik_band, int nstates_local, int nbasis_local,
684 const std::complex<double> *wfc_up,
685 const std::complex<double> *wfc_dn);
686
689
690 /* Compute (build/get) functions */
691
699 std::vector<double> &omegas, std::vector<double> &weights);
700
708 std::vector<std::complex<double>> &rpa_corr_ibzk_contrib);
709
714 void build_exx(const Options &opts);
715
720 std::vector<std::complex<double>> compute_hartree_ao(
721 const Options& opts, const std::vector<int>& iks_this, int n_aos);
722
732 std::vector<double>
733 get_exx_pot_kgrid(const Options &opts, const int n_spins, const std::vector<int> &iks_this,
734 int i_state_low, int i_state_high);
735
746 std::vector<double>
747 get_exx_pot_band_k(const Options &opts, const int n_spins, const std::vector<int> &iks_band_this,
748 int i_state_low, int i_state_high);
749
754 void build_g0w0_sigma(const Options &opts);
755
757 CrpaResult build_g0w0_sigma_crpa(const Options &opts, const LibrpaCrpaInput &input);
758
760 CrpaResult compute_crpa_window(const Options &opts, const LibrpaCrpaInput &input) const;
761
763 CrpaResult compute_crpa_u_window(const Options &opts, const LibrpaCrpaInput &input) const;
765 CrpaResult prepare_crpa_model(const Options &opts, const LibrpaCrpaInput &input) const;
766
779 std::vector<std::complex<double>>
780 get_g0w0_sigc_kgrid(const Options &opts, const int n_spins, const std::vector<int> &iks_this,
781 int i_state_low, int i_state_high, const std::vector<double> &vxc, const std::vector<double> &vexx);
782
795 get_g0w0_qpe_kgrid(const Options &opts, const int n_spins, const std::vector<int> &iks_this,
796 int i_state_low, int i_state_high, const std::vector<double> &vxc,
797 const std::vector<double> &vexx);
798
812 std::vector<double>
814 const Options &opts, const int n_spins, const std::vector<int> &iks_this,
815 int i_state_low, int i_state_high, const std::vector<double> &omegas,
816 const std::vector<double> &vxc, const std::vector<double> &vexx);
817
832 const Options &opts, const int n_spins, const std::vector<int> &iks_this,
833 int i_state_low, int i_state_high, const std::vector<double> &omegas,
834 const std::vector<double> &vxc, const std::vector<double> &vexx);
835
848 std::vector<std::complex<double>>
849 get_g0w0_sigc_band_k(const Options &opts, const int n_spins, const std::vector<int> &iks_band_this,
850 int i_state_low, int i_state_high, const std::vector<double> &vxc_band, const std::vector<double> &vexx_band);
851
864 get_g0w0_qpe_band_k(const Options &opts, const int n_spins,
865 const std::vector<int> &iks_band_this, int i_state_low,
866 int i_state_high, const std::vector<double> &vxc_band,
867 const std::vector<double> &vexx_band);
868
882 std::vector<double>
884 const Options &opts, const int n_spins, const std::vector<int> &iks_band_this,
885 int i_state_low, int i_state_high, const std::vector<double> &omegas,
886 const std::vector<double> &vxc_band, const std::vector<double> &vexx_band);
887
902 const Options &opts, const int n_spins, const std::vector<int> &iks_band_this,
903 int i_state_low, int i_state_high, const std::vector<double> &omegas,
904 const std::vector<double> &vxc_band, const std::vector<double> &vexx_band);
905
906 /* Utility functions */
907};
908
909}
void set_latvec_and_G(const double lat_mat[9], const double G_mat[9])
Set direct and reciprocal lattice vectors.
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_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.
QsgwTask create_qsgw_task(const Options &opts, const LibrpaQsgwControls &controls) const
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_ao_basis_aux(const std::vector< size_t > &nbs_aux, const std::vector< std::vector< int > > &l_shells={})
Set the auxiliary atomic-orbital basis.
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< std::complex< double > > compute_hartree_ao(const Options &opts, const std::vector< int > &iks_this, int n_aos)
Physical spin-summed Hartree AO matrices on selected full-grid k points. Collective; see librpa_compu...
void set_kq_mapping(const std::vector< int > &map_q_ks)
Set the mapping from loaded SCF k-points to Coulomb q-points.
double get_rpa_correlation_energy(const Options &opts, std::vector< std::complex< double > > &rpa_corr_ibzk_contrib)
Compute RPA correlation energy.
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.
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.
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.
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 reset_band_data()
Reset band structure data.
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.
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.
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_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_symmetry_spin_operations(int n_ops, int row_conv, const int *rotmats, const double *trans=nullptr, const int *antiunitary=nullptr, const double *spin_u=nullptr, int spin_action_source=0, int grey_group=0)
Set spatial and spin-space symmetry operations for spinor data.
void get_imaginary_frequency_grids(const Options &opts, std::vector< double > &omegas, std::vector< double > &weights)
Construct imaginary-frequency grids.
void init(MPI_Comm comm)
Initialize handler with given MPI communicator.
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.
~Handler()
Defatul destructor - automatically frees handler if not already freed.
void set_atoms(const std::vector< int > &types, const std::vector< double > &pos_cart)
Set atom types and Cartesian coordinates.
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_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_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_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.
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.
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.
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.
CrpaResult prepare_crpa_model(const Options &opts, const LibrpaCrpaInput &input) const
Current frames/weights/model without response, W, or Sigma.
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_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_scf_dimension(int nspins, int nkpts, int nstates, int nbasis, int nspinor=1)
Set mean-field wavefunction dimensions.
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.
OrbitalResult analyze_orbitals(int n_kpoints, int n_aos, const std::vector< double > &overlap_k_ri, double residual_tol) const
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.
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.
CrpaResult build_g0w0_sigma_crpa(const Options &opts, const LibrpaCrpaInput &input)
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 build_g0w0_sigma(const Options &opts)
Build G0W0 self-energy matrix in real space.
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.
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.
void build_exx(const Options &opts)
Build exact-exchange matrix in real space.
CrpaResult compute_crpa_u_window(const Options &opts, const LibrpaCrpaInput &input) const
void set_symmetry_operations(int n_symops, int row_conv, const int *rotmats, const double *trans=nullptr)
Set real-space symmetry operations.
const LibrpaHandler * get_c_handler() const
Get underlying C handler.
Definition librpa.hpp:239
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_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_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_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_band_kvec(int n_kpts_band, const double *kfrac_band)
Set k-points for band-structure calculations.
void free()
Free handler and release resources.
void prepare_native_velocity(const Options &opts, const LibrpaNativeVelocityInput *root_input, bool prepare_optical=true)
Collective original-H/S/r velocity in the loaded SCF frame; input on rank zero.
Handler()
Default constructor (creates null handler).
Definition librpa.hpp:227
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 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_irreducible_kgrids_kvec(int nk1, int nk2, int nk3, const std::vector< double > &kvecs_scf, const std::vector< double > &kvecs_full, const std::vector< int > &full_to_scf)
OpticalResult get_optical_result() const
Noncollective owning snapshot of this rank's numerical optical results.
Handler(MPI_Comm comm)
Construct and initialize handler with MPI communicator.
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_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.
CrpaResult compute_crpa_window(const Options &opts, const LibrpaCrpaInput &input) const
C++ wrapper for runtime options.
Definition librpa.hpp:92
Options()
Construct with default options.
Definition librpa.hpp:95
void set_restart_from_dir(const char *restart_from_dir)
Set directory to read restart checkpoint files from.
Definition librpa.hpp:109
void set_output_dir(const char *output_dir)
Set output directory.
Definition librpa.hpp:102
Computing data APIs for LibRPA.
void librpa_delete_optical_result(LibrpaOpticalResult *result)
struct LibrpaOpticalResult LibrpaOpticalResult
Enumeration types and constants for LibRPA.
int LibrpaKind
Type of DFT code (reserved for future use).
Definition librpa_enums.h:146
LibrpaAngularOrder
Ordering of real spherical harmonics inside one angular-momentum shell.
Definition librpa_enums.h:53
int LibrpaSwitch
Boolean switch type.
Definition librpa_enums.h:138
#define LIBRPA_SWITCH_OFF
Switch value for disabled/off state (equivalent to false).
Definition librpa_enums.h:23
LibrpaRshCoeff
Coefficient-pair convention for one nonzero real spherical harmonic branch.
Definition librpa_enums.h:68
#define LIBRPA_SWITCH_ON
Switch value for enabled/on state (equivalent to true).
Definition librpa_enums.h:26
int LibrpaVerbose
Verbosity level for runtime output.
Definition librpa_enums.h:154
LibrpaParallelRouting
Parallel routing strategy for distributed memory calculations.
Definition librpa_enums.h:83
LibrpaTimeFreqGrid
Type of time or frequency grid for integration.
Definition librpa_enums.h:101
Handler management for LibRPA instances.
struct LibrpaCrpaContinuedResult LibrpaCrpaContinuedResult
Definition librpa_handler.h:48
struct LibrpaQsgwTask LibrpaQsgwTask
Definition librpa_handler.h:32
struct LibrpaCrpaResult LibrpaCrpaResult
Definition librpa_handler.h:42
Runtime options for LibRPA calculations.
void librpa_set_output_dir(LibrpaOptions *opts, const char *output_dir)
Set the output directory for LibRPA results.
void librpa_set_restart_from_dir(LibrpaOptions *opts, const char *restart_from_dir)
Set the directory to read restart checkpoint files from.
void librpa_init_options(LibrpaOptions *opts)
Initialize runtime options to default values.
Main namespace for LibRPA C++ API.
Definition file_reader.hpp:30
const char * get_build_info(void)
Get build information string.
void set_output_level(Verbose output_level)
Set the global LibRPA stdout verbosity.
void print_profile(void)
Print profiling information.
int get_minor_version(void)
Get minor version number.
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.
LibrpaParallelRouting ParallelRouting
Parallel routing strategy (C++ alias).
Definition librpa.hpp:55
LibrpaKind Kind
DFT code kind type (C++ alias, reserved)
Definition librpa.hpp:61
void test(void)
Run internal self-tests.
int get_patch_version(void)
Get patch version number.
CrpaContinuedResult continue_crpa(const LibrpaCrpaResult *result, const std::vector< std::complex< double > > &queries, int n_parameters=-1, double tolerance_ha=0.0003674932217565499)
LibrpaVerbose Verbose
Verbosity level type (C++ alias)
Definition librpa.hpp:63
Verbose get_output_level(void)
Get the global LibRPA stdout verbosity.
LibrpaTimeFreqGrid TimeFreqGrid
Time/frequency grid type (C++ alias)
Definition librpa.hpp:57
int get_major_version(void)
Get major version number.
std::array< std::complex< double >, 3 > crpa_tensor_averages(int n_orbitals, const std::vector< std::complex< double > > &tensor)
LibrpaSwitch Switch
Boolean switch type (C++ alias)
Definition librpa.hpp:59
Definition librpa_input.h:623
Opaque handle to a LibRPA instance.
Definition librpa_handler.h:26
Definition librpa_input.h:47
Runtime options structure for LibRPA calculations.
Definition librpa_options.h:35
char restart_from_dir[LIBRPA_MAX_STRLEN]
Definition librpa_options.h:55
char output_dir[LIBRPA_MAX_STRLEN]
Definition librpa_options.h:45
Definition librpa_options.h:793
G0W0 correlation self-energies and quasiparticle energies.
Definition librpa.hpp:67
std::vector< std::complex< double > > sigc
Correlation self-energies.
Definition librpa.hpp:68
std::vector< double > eqp
Quasiparticle energies.
Definition librpa.hpp:69
G0W0 spectral functions and continued correlation self-energies.
Definition librpa.hpp:74
std::vector< double > spectral_function
Spectral-function values.
Definition librpa.hpp:76
std::vector< std::complex< double > > sigc
Continued correlation self-energies.
Definition librpa.hpp:75