librpa_input.h Source File

librpa_input.h Source File#

LibRPA: librpa_input.h Source File
LibRPA
librpa_input.h
Go to the documentation of this file.
1#pragma once
6
7#include <stddef.h>
8#include "librpa_enums.h"
9#include "librpa_handler.h"
10
11// C APIs
12#ifdef __cplusplus
13#define LIBRPA_INPUT_DEFAULT(value) = value
14extern "C" {
15#else
16#define LIBRPA_INPUT_DEFAULT(value)
17#endif
18
23 typedef struct
24 {
25 int translation[3];
26 const double* values_ri;
27 int row_major;
29
30 typedef struct
31 {
32 int dimension;
33 int n_blocks;
34 const LibrpaLocalizedBlock* blocks;
36
46 typedef struct
47 {
48 int n_spins;
49 const LibrpaLocalizedOperator* hamiltonian;
51 LibrpaLocalizedOperator position[3];
54 double auxiliary_monopole_norm_squared;
56
66void librpa_set_scf_dimension(LibrpaHandler* h, int nspins, int nkpts, int nstates, int nbasis, int nspinor LIBRPA_INPUT_DEFAULT(1));
67
83void librpa_set_wg_ekb_efermi(LibrpaHandler* h, int nspins, int nkpts, int nstates,
84 const double* wg, const double* ekb, double efermi);
85
96void librpa_set_wfc(LibrpaHandler* h, int ispin, int ik, int nstates_local, int nbasis_local,
97 const double* wfc_real, const double* wfc_imag);
98
110void librpa_set_wfc_spinor(LibrpaHandler* h, int ik, int nstates_local, int nbasis_local,
111 const double* wfc_up_real, const double* wfc_up_imag,
112 const double* wfc_dn_real, const double* wfc_dn_imag);
113
123void librpa_set_wfc_packed(LibrpaHandler* h, int ispin, int ik, int nstates_local, int nbasis_local,
124 const double* wfc_ri);
125
135void librpa_set_wfc_spinor_packed(LibrpaHandler* h, int ik, int nstates_local,
136 int nbasis_local, const double* wfc_up_ri,
137 const double* wfc_dn_ri);
138
147void librpa_set_ao_basis_wfc(LibrpaHandler* h, int natoms, const size_t* nbs_wfc,
148 const int* nshells LIBRPA_INPUT_DEFAULT(nullptr), const int* l_shells LIBRPA_INPUT_DEFAULT(nullptr));
149
158void librpa_set_ao_basis_aux(LibrpaHandler* h, int natoms, const size_t* nbs_aux,
159 const int* nshells LIBRPA_INPUT_DEFAULT(nullptr), const int* l_shells LIBRPA_INPUT_DEFAULT(nullptr));
160
170 const size_t* nbs_aux_shrink,
171 const int* nshells LIBRPA_INPUT_DEFAULT(nullptr),
172 const int* l_shells LIBRPA_INPUT_DEFAULT(nullptr));
173
186void librpa_set_basis_convention(LibrpaHandler* h, int bloch_phase, int bloch_ratom,
188 LibrpaRshCoeff posi_m);
189
199void librpa_set_symmetry_operations(LibrpaHandler* h, int n_symops, int row_conv,
200 const int* rotmats, const double* trans);
201
231 LibrpaHandler* h, int n_ops, int row_conv,
232 const int* rotmats, const double* trans,
233 const int* antiunitary, const double* spin_u,
234 int spin_action_source, int grey_group);
235
242void librpa_set_latvec_and_G(LibrpaHandler* h, const double lat_mat[9], const double G_mat[9]);
243
251void librpa_set_atoms(LibrpaHandler* h, int natoms, const int* types, const double* posi_cart);
252
265void librpa_set_kgrids_kvec(LibrpaHandler* h, int nk1, int nk2, int nk3,
266 int nkpts, const double* kvecs, const double* kweights);
267
279void librpa_set_kq_mapping(LibrpaHandler* h, int nkpts, const int* map_q_ks);
280
288void librpa_set_irreducible_kgrids_kvec(LibrpaHandler* h, int nk1, int nk2, int nk3,
289 int n_scf, const double* kvecs_scf,
290 int n_full, const double* kvecs_full,
291 const int* full_to_scf);
292
308 int nbasis_i, int nbasis_j, int naux_mu, const int R[3],
309 const double* Cs_in, int shrink_aux LIBRPA_INPUT_DEFAULT(0));
310
324void librpa_set_aux_bare_coulomb_k_atom_pair(LibrpaHandler* h, int ik, int I, int J, int naux_mu,
325 int naux_nu, const double* Vq_real_in,
326 const double* Vq_imag_in, double vq_threshold);
327
341 int naux_mu, int naux_nu,
342 const double* Vq_ri_in,
343 double vq_threshold);
344
358void librpa_set_aux_cut_coulomb_k_atom_pair(LibrpaHandler* h, int ik, int I, int J, int naux_mu,
359 int naux_nu, const double* Vq_real_in,
360 const double* Vq_imag_in, double vq_threshold);
361
375 int naux_mu, int naux_nu,
376 const double* Vq_ri_in,
377 double vq_threshold);
378
391void librpa_set_aux_bare_coulomb_k_2d_block(LibrpaHandler* h, int ik, int mu_begin, int mu_end,
392 int nu_begin, int nu_end, const double* Vq_real_in,
393 const double* Vq_imag_in);
394
407 int mu_end, int nu_begin, int nu_end,
408 const double* Vq_ri_in);
409
422void librpa_set_aux_cut_coulomb_k_2d_block(LibrpaHandler* h, int ik, int mu_begin, int mu_end,
423 int nu_begin, int nu_end, const double* Vq_real_in,
424 const double* Vq_imag_in);
425
438 int mu_end, int nu_begin, int nu_end,
439 const double* Vq_ri_in);
440
449void librpa_set_dielect_func_imagfreq(LibrpaHandler* h, int nfreq, const double* omegas_imag,
450 const double* dielect_func);
451
466void librpa_set_velocity_matrix(LibrpaHandler* h, int n_spins, int n_kpts, int n_states,
467 const double* velocity_real, const double* velocity_imag);
468
481void librpa_set_velocity_matrix_packed(LibrpaHandler* h, int n_spins, int n_kpts, int n_states,
482 const double* velocity_ri);
483
491void librpa_set_band_kvec(LibrpaHandler* h, int n_kpts_band, const double* kfrac_band);
492
503void librpa_set_band_occ_eigval(LibrpaHandler* h, int n_spins, int n_kpts_band, int n_states,
504 const double* occ, const double* eig);
505
517void librpa_set_wfc_band(LibrpaHandler* h, int ispin, int ik_band, int nstates_local,
518 int nbasis_local, const double* wfc_real, const double* wfc_imag);
519
531void librpa_set_wfc_band_spinor(LibrpaHandler* h, int ik_band, int nstates_local,
532 int nbasis_local, const double* wfc_up_real, const double* wfc_up_imag,
533 const double* wfc_dn_real, const double* wfc_dn_imag);
534
545void librpa_set_wfc_band_packed(LibrpaHandler* h, int ispin, int ik_band, int nstates_local,
546 int nbasis_local, const double* wfc_ri);
547
558void librpa_set_wfc_band_spinor_packed(LibrpaHandler* h, int ik_band, int nstates_local,
559 int nbasis_local, const double* wfc_up_ri, const double* wfc_dn_ri);
560
567
573typedef struct
574{
575 int spin, kpoint, dimension, row_major;
576 const double* values_ri;
578
582typedef struct
583{
584 int atom_i, atom_j, translation[3];
585 int n_aos_i, n_aos_j, n_aux_i;
586 const double* values;
588typedef struct
589{
590 int n_vxc, n_vxc_band;
591 const LibrpaQsgwMatrix *vxc, *vxc_band;
592 int vxc_in_ao_basis;
593 const LibrpaNativeVelocityInput* native_operators;
594 double inplane_area_bohr2, auxiliary_monopole_norm_squared;
600 const double* hartree_coulomb_q0_ri;
604 const LibrpaQsgwLriBlock* hartree_lri_blocks;
606
609
622 typedef struct
623 {
624 int n_species;
625 const char* const* species_labels;
626 const char* correlated_species;
627 const char* ligand_species;
628 const char* parent_orbitals;
629 const char* output_orbitals;
630 int n_response_edges;
631 const double* response_windows_ha;
632 int n_orbital_edges;
633 const double* orbital_windows_ha;
637 const int* response_bands;
638 int n_orbital_bands;
639 const int* orbital_bands;
640 int n_kpoints;
641 int n_aos;
644 const double* overlap_k_ri;
645 double gram_abs;
646 double gram_rel;
647 double gram_cond_max;
648 double s_abs;
649 double s_rel;
650 double s_cond_max;
651 double residual_tol;
652 double t_roundtrip_tol;
667 const double* previous_parent_phi_ri;
673
674 void librpa_init_crpa_input(LibrpaCrpaInput* input);
675
676#ifdef __cplusplus
677}
678#endif
679
680#undef LIBRPA_INPUT_DEFAULT
Enumeration types and constants for LibRPA.
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
LibrpaRshCoeff
Coefficient-pair convention for one nonzero real spherical harmonic branch.
Definition librpa_enums.h:68
LibrpaParallelRouting
Parallel routing strategy for distributed memory calculations.
Definition librpa_enums.h:83
Handler management for LibRPA instances.
struct LibrpaQsgwTask LibrpaQsgwTask
Definition librpa_handler.h:32
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_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_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_basis_convention(LibrpaHandler *h, int bloch_phase, int bloch_ratom, LibrpaAngularOrder order, LibrpaRshCoeff nega_m, LibrpaRshCoeff posi_m)
Set basis convention metadata used by symmetry-based reductions.
void librpa_set_kgrids_kvec(LibrpaHandler *h, int nk1, int nk2, int nk3, int nkpts, const double *kvecs, const double *kweights)
Set k-point grid vectors.
void librpa_set_ao_basis_aux(LibrpaHandler *h, int natoms, const size_t *nbs_aux, const int *nshells LIBRPA_INPUT_DEFAULT(nullptr), const int *l_shells LIBRPA_INPUT_DEFAULT(nullptr))
Set auxiliary atomic orbital basis size.
void librpa_set_aux_bare_coulomb_k_2d_block_packed(LibrpaHandler *h, int ik, int mu_begin, int mu_end, int nu_begin, int nu_end, const double *Vq_ri_in)
Set bare Coulomb matrix elements (2D block format, packed complex).
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_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_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_packed(LibrpaHandler *h, int ik, int mu_begin, int mu_end, int nu_begin, int nu_end, const double *Vq_ri_in)
Set truncated Coulomb matrix elements (2D block format, packed complex).
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_reset_band_data(LibrpaHandler *h)
Reset band structure input data.
void librpa_set_irreducible_kgrids_kvec(LibrpaHandler *h, int nk1, int nk2, int nk3, int n_scf, const double *kvecs_scf, int n_full, const double *kvecs_full, const int *full_to_scf)
Set an explicit full-grid to loaded SCF representative mapping.
void librpa_set_aux_bare_coulomb_k_atom_pair_packed(LibrpaHandler *h, int ik, int I, int J, int naux_mu, int naux_nu, const double *Vq_ri_in, double vq_threshold)
Set bare Coulomb matrix elements (atom-pair format, packed complex).
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_atoms(LibrpaHandler *h, int natoms, const int *types, const double *posi_cart)
Set atom types and Cartesian coordinates.
void librpa_set_qsgw_input(LibrpaQsgwTask *, const LibrpaQsgwInput *root_input)
void librpa_set_velocity_matrix_packed(LibrpaHandler *h, int n_spins, int n_kpts, int n_states, const double *velocity_ri)
Set velocity/momentum matrix.
void librpa_set_symmetry_operations(LibrpaHandler *h, int n_symops, int row_conv, const int *rotmats, const double *trans)
Set real-space symmetry operations.
void librpa_set_velocity_matrix(LibrpaHandler *h, int n_spins, int n_kpts, int n_states, const double *velocity_real, const double *velocity_imag)
Set velocity/momentum matrix.
void librpa_set_aux_cut_coulomb_k_atom_pair_packed(LibrpaHandler *h, int ik, int I, int J, int naux_mu, int naux_nu, const double *Vq_ri_in, double vq_threshold)
Set truncated Coulomb matrix elements (atom-pair format, packed complex).
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_ao_basis_wfc(LibrpaHandler *h, int natoms, const size_t *nbs_wfc, const int *nshells LIBRPA_INPUT_DEFAULT(nullptr), const int *l_shells LIBRPA_INPUT_DEFAULT(nullptr))
Set atomic orbital basis size for wavefunctions.
void librpa_set_ao_basis_aux_shrink(LibrpaHandler *h, int natoms, const size_t *nbs_aux_shrink, const int *nshells LIBRPA_INPUT_DEFAULT(nullptr), const int *l_shells LIBRPA_INPUT_DEFAULT(nullptr))
Set shrink auxiliary atomic orbital basis size.
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_symmetry_spin_operations(LibrpaHandler *h, int n_ops, int row_conv, const int *rotmats, const double *trans, const int *antiunitary, const double *spin_u, int spin_action_source, int grey_group)
Set symmetry operations with explicit spin actions (magnetic or spin-space group input).
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_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, int shrink_aux LIBRPA_INPUT_DEFAULT(0))
Set local RI coefficients.
void librpa_set_kq_mapping(LibrpaHandler *h, int nkpts, const int *map_q_ks)
Set the mapping from loaded SCF k-points to Coulomb q-points.
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_latvec_and_G(LibrpaHandler *h, const double lat_mat[9], const double G_mat[9])
Set direct and reciprocal lattice vectors.
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_scf_dimension(LibrpaHandler *h, int nspins, int nkpts, int nstates, int nbasis, int nspinor LIBRPA_INPUT_DEFAULT(1))
Set meanfield wavefunction dimension.
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_band_kvec(LibrpaHandler *h, int n_kpts_band, const double *kfrac_band)
Set k-points for band structure calculations.
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).
Definition librpa_input.h:623
LibrpaSwitch use_orbital_weights
Definition librpa_input.h:660
LibrpaSwitch retain_raw_model
Definition librpa_input.h:655
double tracking_min_capture
Definition librpa_input.h:671
const double * overlap_k_ri
Definition librpa_input.h:644
int n_response_bands
Definition librpa_input.h:636
int n_previous_parent
Definition librpa_input.h:666
Opaque handle to a LibRPA instance.
Definition librpa_handler.h:26
Definition librpa_input.h:24
Definition librpa_input.h:31
Definition librpa_input.h:47
double inplane_area_bohr2
Definition librpa_input.h:53
Definition librpa_input.h:589
int n_hartree_lri_blocks
Definition librpa_input.h:603
int hartree_n_aux
Definition librpa_input.h:599
Definition librpa_input.h:583
Definition librpa_input.h:574