librpa_compute.h File Reference#
|
LibRPA
|
Computing data APIs for LibRPA. More...
Go to the source code of this file.
Classes | |
| struct | LibrpaOpticalResult |
| struct | LibrpaQsgwOutput |
| struct | LibrpaOrbitalInfo |
| struct | LibrpaOrbitalGroup |
| struct | LibrpaOrbitalState |
| struct | LibrpaCrpaModelInfo |
| struct | LibrpaCrpaModelK |
| struct | LibrpaCrpaContinuedTensor |
| struct | LibrpaCrpaTensor |
Typedefs | |
| typedef struct LibrpaOpticalResult | LibrpaOpticalResult |
| typedef LibrpaOpticalResult | LibrpaOpticalView |
| typedef int(* | LibrpaQsgwOutputSink) (const LibrpaQsgwOutput *, void *user_data) |
| typedef int(* | LibrpaCrpaOutputSink) (const LibrpaCrpaResult *, const LibrpaOrbitalResult *, int state_index, int gw_update, int final_state, void *user_data) |
Functions | |
| void | librpa_get_imaginary_frequency_grids (LibrpaHandler *h, const LibrpaOptions *p_opts, double *omegas, double *weights) |
| Construct and return frequency grids for numerical integration. | |
| void | librpa_compute_hartree_ao (LibrpaHandler *h, const LibrpaOptions *p_opts, int n_kpoints, const int *kpoints, int n_aos, double *values_re, double *values_im) |
| Compute the physical, spin-summed periodic Hartree potential in the spatial AO basis. | |
| double | librpa_get_rpa_correlation_energy (LibrpaHandler *h, const LibrpaOptions *p_opts, int n_ibz_kpoints, double *rpa_corr_ibzk_contrib_re, double *rpa_corr_ibzk_contrib_im) |
| Compute RPA correlation energy. | |
| void | librpa_build_exx (LibrpaHandler *h, const LibrpaOptions *p_opts) |
| Build exact-exchange matrix. | |
| void | librpa_get_exx_pot_kgrid (LibrpaHandler *h, const LibrpaOptions *p_opts, const int n_spins, const int n_kpts_this, const int *iks_this, int i_state_low, int i_state_high, double *vexx) |
| Obtain exact-exchange potential for selected states. | |
| void | librpa_get_exx_pot_band_k (LibrpaHandler *h, const LibrpaOptions *p_opts, const int n_spins, const int n_kpts_band_this, const int *iks_band_this, int i_state_low, int i_state_high, double *vexx_band) |
| Obtain exact-exchange potential for selected states at band k-points. | |
| void | librpa_build_g0w0_sigma (LibrpaHandler *h, const LibrpaOptions *p_opts) |
| Build self-energy matrix of G0W0, including the correlation and exchange contributions. | |
| void | librpa_get_g0w0_sigc_kgrid (LibrpaHandler *h, const LibrpaOptions *p_opts, const int n_spins, const int n_kpts_this, const int *iks_this, int i_state_low, int i_state_high, const double *vxc, const double *vexx, double *sigc_re, double *sigc_im) |
| Obtain correlation self-energies for selected states. | |
| void | librpa_get_g0w0_qpe_kgrid (LibrpaHandler *h, const LibrpaOptions *p_opts, const int n_spins, const int n_kpts_this, const int *iks_this, int i_state_low, int i_state_high, const double *vxc, const double *vexx, double *sigc_re, double *sigc_im, double *eqp) |
| Obtain correlation self-energies and QP energies for selected states. | |
| void | librpa_get_g0w0_spectral_function_kgrid (LibrpaHandler *h, const LibrpaOptions *p_opts, const int n_spins, const int n_kpts_this, const int *iks_this, int i_state_low, int i_state_high, const int n_omegas, const double *omegas, const double *vxc, const double *vexx, double *spectral_function, double *sigc) |
| Obtain spectral functions for selected k-grid states. | |
| void | librpa_get_g0w0_sigc_band_k (LibrpaHandler *h, const LibrpaOptions *p_opts, const int n_spins, const int n_kpts_band_this, const int *iks_band_this, int i_state_low, int i_state_high, const double *vxc_band, const double *vexx_band, double *sigc_band_re, double *sigc_band_im) |
| Obtain correlation self-energies for selected states at band k-points. | |
| void | librpa_get_g0w0_qpe_band_k (LibrpaHandler *h, const LibrpaOptions *p_opts, const int n_spins, const int n_kpts_band_this, const int *iks_band_this, int i_state_low, int i_state_high, const double *vxc_band, const double *vexx_band, double *sigc_band_re, double *sigc_band_im, double *eqp_band) |
| Obtain correlation self-energies and QP energies for selected band-k states. | |
| void | librpa_get_g0w0_spectral_function_band_k (LibrpaHandler *h, const LibrpaOptions *p_opts, const int n_spins, const int n_kpts_band_this, const int *iks_band_this, int i_state_low, int i_state_high, const int n_omegas, const double *omegas, const double *vxc_band, const double *vexx_band, double *spectral_function_band, double *sigc_band) |
| Obtain spectral functions for selected band-k states. | |
| void | librpa_prepare_native_velocity (LibrpaHandler *h, const LibrpaOptions *options, const LibrpaNativeVelocityInput *root_input, int prepare_optical) |
| LibrpaOpticalResult * | librpa_get_optical_result (const LibrpaHandler *h) |
| LibrpaOpticalView | librpa_get_optical_view (const LibrpaOpticalResult *result) |
| void | librpa_delete_optical_result (LibrpaOpticalResult *result) |
| LibrpaQsgwTask * | librpa_create_qsgw_task (LibrpaHandler *, const LibrpaOptions *, const LibrpaQsgwControls *) |
| void | librpa_prepare_qsgw_task (LibrpaQsgwTask *) |
| void | librpa_set_qsgw_output_sink (LibrpaQsgwTask *, LibrpaQsgwOutputSink, void *user_data) |
| void | librpa_run_qsgw_task (LibrpaQsgwTask *) |
| void | librpa_delete_qsgw_task (LibrpaQsgwTask *) |
| void | librpa_get_meanfield_dimensions (const LibrpaHandler *h, int band_path, int *nspins, int *nkpts, int *nstates, int *naos, int *nspinor) |
| LibrpaOrbitalResult * | librpa_analyze_orbitals (const LibrpaHandler *h, int n_kpoints, int n_aos, const double *overlap_k_ri, double residual_tol) |
| void | librpa_delete_orbital_result (LibrpaOrbitalResult *result) |
| void | librpa_orbital_info (const LibrpaOrbitalResult *result, LibrpaOrbitalInfo *info) |
| void | librpa_orbital_group (const LibrpaOrbitalResult *result, int group, LibrpaOrbitalGroup *view) |
| void | librpa_orbital_state (const LibrpaOrbitalResult *result, int spin, int k, int band, LibrpaOrbitalState *view) |
| void | librpa_orbital_pdos (const LibrpaOrbitalResult *result, int n_energies, const double *energy_grid_ha, double sigma_ha, double *mulliken, double *lowdin) |
| void | librpa_crpa_model_info (const LibrpaCrpaResult *result, LibrpaCrpaModelInfo *info) |
| void | librpa_crpa_model_k (const LibrpaCrpaResult *result, int spin, int kpoint, LibrpaCrpaModelK *view) |
| void | librpa_crpa_model_site (const LibrpaCrpaResult *result, int parent, int site, int *atom, int *column_start, int *n_orbitals) |
| const char * | librpa_crpa_model_label (const LibrpaCrpaResult *result, int parent, int site, int orbital) |
| void | librpa_crpa_model_local (const LibrpaCrpaResult *result, int parent, int spin, int site, double *h_ha_ri, double *density_ri) |
| void | librpa_crpa_model_hopping (const LibrpaCrpaResult *result, int parent, int spin, const int *lattice_R, double *h_ha_ri) |
| void | librpa_crpa_project_one_body (int n_orbitals, int n_bands, const double *projector_ri, const double *diagonal, double *operator_ri) |
| void | librpa_crpa_project_orbitals (int n_aos, int n_spinor, int n_bands, int n_orbitals, const double *coefficients_ri, const double *overlap_ri, const double *phi_ri, double *projector_ri) |
| void | librpa_crpa_rotate_projector (int n_bands, int n_old, int n_new, const double *projector_ri, const double *rotation_ri, double *rotated_projector_ri) |
| void | librpa_crpa_rotate_tensor (int n_old, int n_new, const double *tensor_ri, const double *left_rotation_ri, const double *right_rotation_ri, double *rotated_ri) |
| void | librpa_crpa_tensor_to_fermion (int n_orbitals, const double *density_ri, double *fermion_ri) |
| void | librpa_crpa_tensor_averages (int n_orbitals, const double *tensor_ri, double *averages_ha_ri) |
| LibrpaCrpaContinuedResult * | librpa_continue_crpa (const LibrpaCrpaResult *result, int n_queries, const double *queries_ha_ri, int n_parameters, double tolerance_ha) |
| LibrpaCrpaContinuedResult * | librpa_continue_crpa_with_options (const LibrpaCrpaResult *result, int n_queries, const double *queries_ha_ri, const LibrpaOptions *options, double tolerance_ha) |
| void | librpa_delete_crpa_continued_result (LibrpaCrpaContinuedResult *result) |
| int | librpa_crpa_continued_size (const LibrpaCrpaContinuedResult *result) |
| void | librpa_crpa_continued_tensor (const LibrpaCrpaContinuedResult *result, int tensor, int query, LibrpaCrpaContinuedTensor *view) |
| void | librpa_get_crpa_kgrid (const LibrpaHandler *h, int n_kpoints, double *fractional_k) |
| LibrpaCrpaResult * | librpa_prepare_crpa_model (const LibrpaHandler *h, const LibrpaOptions *options, const LibrpaCrpaInput *input) |
| LibrpaCrpaResult * | librpa_compute_crpa_window (const LibrpaHandler *h, const LibrpaOptions *options, const LibrpaCrpaInput *input) |
| LibrpaCrpaResult * | librpa_build_g0w0_sigma_crpa (LibrpaHandler *h, const LibrpaOptions *options, const LibrpaCrpaInput *input) |
| LibrpaCrpaResult * | librpa_compute_crpa_u_window (const LibrpaHandler *h, const LibrpaOptions *options, const LibrpaCrpaInput *input) |
| void | librpa_write_crpa_tracking_checkpoint (const LibrpaCrpaResult *result, const char *filename, int iteration, const char *definition, int n_energies, const double *energies_ha) |
| void | librpa_set_qsgw_crpa (LibrpaQsgwTask *task, const LibrpaCrpaInput *input, const LibrpaQsgwCrpaControls *controls, LibrpaCrpaOutputSink sink, void *user_data) |
| void | librpa_delete_crpa_result (LibrpaCrpaResult *result) |
| int | librpa_crpa_result_size (const LibrpaCrpaResult *result) |
| void | librpa_crpa_result_tensor (const LibrpaCrpaResult *result, int index, LibrpaCrpaTensor *tensor) |
| void | librpa_crpa_result_bands (const LibrpaCrpaResult *result, int response_window, int spin, int kpoint, int *count, const int **bands) |
| void | librpa_crpa_result_weights (const LibrpaCrpaResult *result, int spin, int kpoint, int *count, const double **weights) |
| const char * | librpa_crpa_result_orbital_label (const LibrpaCrpaResult *result, int atom, int orbital) |
Detailed Description
Computing data APIs for LibRPA.
Typedef Documentation
◆ LibrpaCrpaOutputSink
| typedef int(* LibrpaCrpaOutputSink) (const LibrpaCrpaResult *, const LibrpaOrbitalResult *, int state_index, int gw_update, int final_state, void *user_data) |
Borrowed numerical output on every rank, valid only during the call. The sink may query results and write files, but must not delete these views or recursively use the handler/task. The orbital result may be null when analysis is unavailable. Return zero on success.
◆ LibrpaOpticalResult
| typedef struct LibrpaOpticalResult LibrpaOpticalResult |
Independently owned, rank-local snapshot of numerical optical outputs. Obtain this structure with librpa_get_optical_result and release it only with librpa_delete_optical_result. Do not modify its fields, free its arrays, or pass a copied structure to the deletion function. All arrays are read-only and remain valid until that original result is deleted, including after the handler is changed or destroyed. Empty arrays have null pointers.
Complex arrays are row-major, interleaved [real,imag]. Velocity is [n_spins][n_kpoints][3][n_states][n_states][2], in Hartree*Bohr; frequencies_ha contains n_frequencies imaginary-frequency nodes in Hartree. Head and wing are [n_frequencies][rows][columns][2], with their respective dimensions below. Head is dimensionless; the auxiliary-basis wing uses LibRPA's Coulomb-normalized response convention. No MPI gathering is done.
◆ LibrpaOpticalView
| typedef LibrpaOpticalResult LibrpaOpticalView |
Source-compatible borrowed view. Copying it does not copy or own the arrays.
Function Documentation
◆ librpa_analyze_orbitals()
| LibrpaOrbitalResult * librpa_analyze_orbitals | ( | const LibrpaHandler * | h, |
| int | n_kpoints, | ||
| int | n_aos, | ||
| const double * | overlap_k_ri, | ||
| double | residual_tol ) |
Collective orbital analysis from loaded eigenstates and spatial S(k). S is packed [k][AO row][AO column][real/imag], replicated on every rank. Requires complete scalar or two-component spinor coefficients, shell metadata, explicit basis conventions, and normalized loaded k weights. Evaluates S^(1/2), never H. Mulliken = Re[c* (Sc)]; Lowdin = |S^(1/2)c|^2/(c-dagger S c). For spinors, sum both components in each spatial AO and normalize by their combined S norm. n_spins is one; no extra spin-degeneracy factor is added. All radial shells contribute to atom/l groups, with d split into eg/t2g. Does not alter the handler, eigenstates, cRPA windows or response weights. Each rank owns its result and must delete it. Views remain valid until deletion.
◆ librpa_build_exx()
| void librpa_build_exx | ( | LibrpaHandler * | h, |
| const LibrpaOptions * | p_opts ) |
Build exact-exchange matrix.
- Parameters
-
[in] h Pointer to LibRPA handler. [in] p_opts Pointer to runtime options.
◆ librpa_build_g0w0_sigma()
| void librpa_build_g0w0_sigma | ( | LibrpaHandler * | h, |
| const LibrpaOptions * | p_opts ) |
Build self-energy matrix of G0W0, including the correlation and exchange contributions.
- Parameters
-
[in] h Pointer to LibRPA handler. [in] p_opts Pointer to runtime options.
◆ librpa_build_g0w0_sigma_crpa()
| LibrpaCrpaResult * librpa_build_g0w0_sigma_crpa | ( | LibrpaHandler * | h, |
| const LibrpaOptions * | options, | ||
| const LibrpaCrpaInput * | input ) |
Build the ordinary GW self-energy and cRPA U for the same entering state. P0 is built once by GW and borrowed by cRPA; only Pd and constrained screening are added. GW P0, optical data, W and self-energy conventions remain unchanged. Requires full-grid LIBRI and rejects a SigC file-read shortcut. Input has the same full-grid and optional q-star screening contract as the standalone call. The owned result contains bare/U; fully_screened_ri is null. cRPA screens and projects with full Coulomb independently of the GW eps/Wc/EXX Coulomb flags, which keep their original GW meaning.
◆ librpa_compute_crpa_u_window()
| LibrpaCrpaResult * librpa_compute_crpa_u_window | ( | const LibrpaHandler * | h, |
| const LibrpaOptions * | options, | ||
| const LibrpaCrpaInput * | input ) |
Response-only bare/U calculation for the handler's current E/C/f. Builds P0 and Pd and screens Pr, without full-W screening or self-energy. Suitable for the final updated QSGW state. Uses current velocity data when optical correction is enabled. Returns an independently owned result whose fully_screened_ri is null. The cRPA solve uses full Coulomb regardless of the independent GW Coulomb flags.
◆ librpa_compute_crpa_window()
| LibrpaCrpaResult * librpa_compute_crpa_window | ( | const LibrpaHandler * | h, |
| const LibrpaOptions * | options, | ||
| const LibrpaCrpaInput * | input ) |
Collective calculation on the handler communicator; no input/output files. All ranks must call with identical options and replicated LibrpaCrpaInput. Supports scalar or two-component spinor full-grid LIBRI with replicated KS eigenvectors and native positive minimax nodes. With use_symmetry_rpa enabled, only q-space screening is reduced; kernels are restored before full-grid local contraction. Original full-k states are required. No static node or analytic continuation is added. Each rank owns its result independently and must delete it.
◆ librpa_compute_hartree_ao()
| void librpa_compute_hartree_ao | ( | LibrpaHandler * | h, |
| const LibrpaOptions * | p_opts, | ||
| int | n_kpoints, | ||
| const int * | kpoints, | ||
| int | n_aos, | ||
| double * | values_re, | ||
| double * | values_im ) |
Compute the physical, spin-summed periodic Hartree potential in the spatial AO basis.
Collective on the handler communicator. Rebuilds from the current eigenvectors and occupations on every call, without EXX spin factors or an occupation cutoff. Requires a complete Gamma-centred full-BZ grid, matched full/shrunk RI data, and a bare q=0 Coulomb metric supplied through the normal Coulomb-input API. Its electrostatic zero mode must be chosen explicitly by the host (e.g. G=0 omitted). An EXX singularity-corrected q=0 metric is not interchangeable with that metric. Uses the native RI Fourier orientation exp(+2*pi*i*k.R); mean-field and RI inputs must share this orientation. Atom-position phase must be zero. Requires official LibRI Hartree support and complete directed coefficients loaded with LIBRPA_ROUTING_LIBRI, with unique MPI ownership of each Cs block. Strict 2D is not yet supported.
- Parameters
-
h Handler. p_opts Options; use_shrink_abfs selects both RI and auxiliary metric basis. n_kpoints Number of requested SCF k indices on this rank; may be zero. kpoints Zero-based indices in the loaded full SCF grid. n_aos Spatial AO dimension. values_re Real output in Hartree, row-major [requested k][AO row][AO column]. values_im Imaginary output, same layout. Each buffer holds n_kpoints*n_aos*n_aos doubles.
◆ librpa_continue_crpa()
| LibrpaCrpaContinuedResult * librpa_continue_crpa | ( | const LibrpaCrpaResult * | result, |
| int | n_queries, | ||
| const double * | queries_ha_ri, | ||
| int | n_parameters, | ||
| double | tolerance_ha ) |
Default Pade continuation of U-v at original z=i*nu; restores v, no fermionic shift. Queries are [real,imag] in Hartree: z=0 for static extrapolation, or Im(z)>0. n_parameters=-1 uses all nodes. tolerance_ha controls numerical diagnostics. Noncollective; returns independently owned values, not an added response node. Status bits: 1 primary failure, 2 subset failure, 4 excessive subset spread, 8 excessive source/holdout residual, 16 fewer than four nodes, 32 nonfinite value. No passivity, causality, basis or mesh convergence certificate is implied.
◆ librpa_continue_crpa_with_options()
| LibrpaCrpaContinuedResult * librpa_continue_crpa_with_options | ( | const LibrpaCrpaResult * | result, |
| int | n_queries, | ||
| const double * | queries_ha_ri, | ||
| const LibrpaOptions * | options, | ||
| double | tolerance_ha ) |
Continue Delta U with the selected analytic-continuation options. Same units, ownership, query and status conventions as librpa_continue_crpa. options must be initialized and non-null. Uses anacon_method, n_params_anacon, anacon_aaa_tolerance and the ridge penalty controls. librpa_continue_crpa retains its signature and uses default Pade settings.
◆ librpa_create_qsgw_task()
| LibrpaQsgwTask * librpa_create_qsgw_task | ( | LibrpaHandler * | , |
| const LibrpaOptions * | , | ||
| const LibrpaQsgwControls * | ) |
All energies are Hartree unless the field explicitly says eV. Strings and numeric inputs are copied by the call receiving them. Checkpoints preserve the immutable input eigenframe; original producer inputs remain required. Keep the handler alive until the task is deleted. After preparation keep its SCF eigenframe/grid fixed; finish band/Coulomb/velocity input before run. Do not modify or reenter the handler during run or its callbacks. Call prepare and set_input collectively before the single run call.
◆ librpa_crpa_model_hopping()
| void librpa_crpa_model_hopping | ( | const LibrpaCrpaResult * | result, |
| int | parent, | ||
| int | spin, | ||
| const int * | lattice_R, | ||
| double * | h_ha_ri ) |
Full parent/output hopping at integer lattice R, [M][M][2], Hartree. Uses sum_k weight_k exp(-i 2*pi k.R) H(k). R need not be a stored BvK representative.
◆ librpa_crpa_model_local()
| void librpa_crpa_model_local | ( | const LibrpaCrpaResult * | result, |
| int | parent, | ||
| int | spin, | ||
| int | site, | ||
| double * | h_ha_ri, | ||
| double * | density_ri ) |
Weighted onsite H and density in one site's actual frame, supplied output buffers [M][M][2].
◆ librpa_crpa_project_one_body()
| void librpa_crpa_project_one_body | ( | int | n_orbitals, |
| int | n_bands, | ||
| const double * | projector_ri, | ||
| const double * | diagonal, | ||
| double * | operator_ri ) |
Noncollective numerical helpers; arrays are row-major complex pairs. P=[orbital][band], diagonal uses the caller's energy or occupation convention.
◆ librpa_crpa_project_orbitals()
| void librpa_crpa_project_orbitals | ( | int | n_aos, |
| int | n_spinor, | ||
| int | n_bands, | ||
| int | n_orbitals, | ||
| const double * | coefficients_ri, | ||
| const double * | overlap_ri, | ||
| const double * | phi_ri, | ||
| double * | projector_ri ) |
Construct P from an explicit metric-orthonormal frame without a KS solve. C=[component-major AO][band], Phi=[component-major AO][orbital], S is spatial. Returns P=[orbital][band]. The orbital construction/window is chosen by the caller.
◆ librpa_crpa_result_bands()
| void librpa_crpa_result_bands | ( | const LibrpaCrpaResult * | result, |
| int | response_window, | ||
| int | spin, | ||
| int | kpoint, | ||
| int * | count, | ||
| const int ** | bands ) |
Retrieve A (response_window != 0) or B selected original-KS band indices. Band indices are zero based and the returned array is owned by result.
◆ librpa_crpa_result_orbital_label()
| const char * librpa_crpa_result_orbital_label | ( | const LibrpaCrpaResult * | result, |
| int | atom, | ||
| int | orbital ) |
Trial label for a local output column; owned by result until deletion. SOC suffix up/down identifies a trial, not a conserved spin quantum number. SOC tensor spin_left/right are channel zero; spinor indices are a,b,c,d.
◆ librpa_crpa_result_weights()
| void librpa_crpa_result_weights | ( | const LibrpaCrpaResult * | result, |
| int | spin, | ||
| int | kpoint, | ||
| int * | count, | ||
| const double ** | weights ) |
Actual endpoint weights [band], owned by result. Binary or fractional, depending on the input mode. Weighted mode has no binary A band list.
◆ librpa_crpa_rotate_projector()
| void librpa_crpa_rotate_projector | ( | int | n_bands, |
| int | n_old, | ||
| int | n_new, | ||
| const double * | projector_ri, | ||
| const double * | rotation_ri, | ||
| double * | rotated_projector_ri ) |
P_new=R^dagger P_old for Phi_new=Phi_old R; use the same R on the corresponding U legs.
◆ librpa_crpa_rotate_tensor()
| void librpa_crpa_rotate_tensor | ( | int | n_old, |
| int | n_new, | ||
| const double * | tensor_ri, | ||
| const double * | left_rotation_ri, | ||
| const double * | right_rotation_ri, | ||
| double * | rotated_ri ) |
Phi_new=Phi_old R, R=[old][new] is an isometry; rotate both density legs. No screening response is changed. Use the matching rotated projector/H.
◆ librpa_crpa_tensor_averages()
| void librpa_crpa_tensor_averages | ( | int | n_orbitals, |
| const double * | tensor_ri, | ||
| double * | averages_ha_ri ) |
Ordered-column averages of U_mm,mm, U_mm,nn and U_mn,nm (m!=n). Input is [M][M][M][M][2]; output is three complex pairs in the same energy unit. Off-diagonal means are zero for M=1. Spinor columns use the same ordered means, without a scalar-shell Hund interpretation or an added degeneracy factor.
◆ librpa_crpa_tensor_to_fermion()
| void librpa_crpa_tensor_to_fermion | ( | int | n_orbitals, |
| const double * | density_ri, | ||
| double * | fermion_ri ) |
Density U_ab,cd -> fermionic V_acbd: V_ijkl=U_ik,jl. V multiplies (1/2) c_i^dagger c_j^dagger c_l c_k, with the stored spin-frame pair. No antisymmetrization or Kanamori/Slater approximation is performed.
◆ librpa_delete_optical_result()
| void librpa_delete_optical_result | ( | LibrpaOpticalResult * | result | ) |
Release a result and its arrays. Passing NULL is permitted.
◆ librpa_get_crpa_kgrid()
| void librpa_get_crpa_kgrid | ( | const LibrpaHandler * | h, |
| int | n_kpoints, | ||
| double * | fractional_k ) |
Read full fractional k coordinates in the current KS eigenvector order.
◆ librpa_get_exx_pot_band_k()
| void librpa_get_exx_pot_band_k | ( | LibrpaHandler * | h, |
| const LibrpaOptions * | p_opts, | ||
| const int | n_spins, | ||
| const int | n_kpts_band_this, | ||
| const int * | iks_band_this, | ||
| int | i_state_low, | ||
| int | i_state_high, | ||
| double * | vexx_band ) |
Obtain exact-exchange potential for selected states at band k-points.
- Parameters
-
[in] h Pointer to LibRPA handler. [in] p_opts Pointer to runtime options. [in] n_spins Number of spin channels. [in] n_kpts_band_this Number of k-points to compute on this process. [in] iks_band_this (Global) index of k-points that this process compute. Each process can have different indices. Must be a subset of band k-points at which the eigenvetors are parsed. [in] i_state_low Index of the first state to compute the potential (inclusive) [in] i_state_high Index of the last state to compute the potential (exclusive) [out] vexx_band Exact-exchange potential for selected states at band k-points. It should be at least as long as n_spins * n_kpts_band_this * (i_state_high - i_state_low).
◆ librpa_get_exx_pot_kgrid()
| void librpa_get_exx_pot_kgrid | ( | LibrpaHandler * | h, |
| const LibrpaOptions * | p_opts, | ||
| const int | n_spins, | ||
| const int | n_kpts_this, | ||
| const int * | iks_this, | ||
| int | i_state_low, | ||
| int | i_state_high, | ||
| double * | vexx ) |
Obtain exact-exchange potential for selected states.
- Parameters
-
[in] h Pointer to LibRPA handler. [in] p_opts Pointer to runtime options. [in] n_spins Number of spin channels. [in] n_kpts_this Number of k-points to compute on this process. [in] iks_this (Global) index of k-points that this process compute. Each process can have different indices. Must be a subset of k-points at which the eigenvetors are parsed. [in] i_state_low Index of the first state to compute the potential (inclusive) [in] i_state_high Index of the last state to compute the potential (exclusive) [out] vexx Exact-exchange potential for selected states. It should be at least as long as n_spins * n_kpts_local * (i_state_high - i_state_low).
◆ librpa_get_g0w0_qpe_band_k()
| void librpa_get_g0w0_qpe_band_k | ( | LibrpaHandler * | h, |
| const LibrpaOptions * | p_opts, | ||
| const int | n_spins, | ||
| const int | n_kpts_band_this, | ||
| const int * | iks_band_this, | ||
| int | i_state_low, | ||
| int | i_state_high, | ||
| const double * | vxc_band, | ||
| const double * | vexx_band, | ||
| double * | sigc_band_re, | ||
| double * | sigc_band_im, | ||
| double * | eqp_band ) |
Obtain correlation self-energies and QP energies for selected band-k states.
Same inputs and SigC outputs as librpa_get_g0w0_sigc_band_k. If p_opts->use_hedin_shift is enabled, the QP solver evaluates
\[\Sigma_c(E - E_F - \Delta). \]
If p_opts->istate_ref_hedin_shift is negative, Delta is computed separately for each selected band state. Otherwise, that absolute zero-based reference state at each band k-point and spin provides Delta for all states in the same channel.
- Parameters
-
[in] h LibRPA handler. [in] p_opts Runtime options. [in] n_spins Number of spin channels. [in] n_kpts_band_this Number of band k-points computed on this process. [in] iks_band_this Global indices of those band k-points. [in] i_state_low First state index (inclusive). [in] i_state_high Last state index (exclusive). [in] vxc_band XC potential for the selected band states. [in] vexx_band Exact-exchange potential for the selected band states. [out] sigc_band_re Real part of the correlation self-energy. [out] sigc_band_im Imaginary part of the correlation self-energy. [out] eqp_band Quasi-particle energy solved by the selected QPE solver. It should be at least as long as sigc_band_re/sigc_band_im.
◆ librpa_get_g0w0_qpe_kgrid()
| void librpa_get_g0w0_qpe_kgrid | ( | LibrpaHandler * | h, |
| const LibrpaOptions * | p_opts, | ||
| const int | n_spins, | ||
| const int | n_kpts_this, | ||
| const int * | iks_this, | ||
| int | i_state_low, | ||
| int | i_state_high, | ||
| const double * | vxc, | ||
| const double * | vexx, | ||
| double * | sigc_re, | ||
| double * | sigc_im, | ||
| double * | eqp ) |
Obtain correlation self-energies and QP energies for selected states.
Same inputs and SigC outputs as librpa_get_g0w0_sigc_kgrid. If p_opts->use_hedin_shift is enabled, the QP solver evaluates
\[\Sigma_c(E - E_F - \Delta). \]
If p_opts->istate_ref_hedin_shift is negative, Delta is computed separately for each selected state. Otherwise, that absolute zero-based reference state at each k-point and spin provides Delta for all states in the same channel.
- Parameters
-
[in] h LibRPA handler. [in] p_opts Runtime options. [in] n_spins Number of spin channels. [in] n_kpts_this Number of k-points computed on this process. [in] iks_this Global indices of those k-points. [in] i_state_low First state index (inclusive). [in] i_state_high Last state index (exclusive). [in] vxc XC potential for the selected states. [in] vexx Exact-exchange potential for the selected states. [out] sigc_re Real part of the correlation self-energy. [out] sigc_im Imaginary part of the correlation self-energy. [out] eqp Quasi-particle energy solved by the selected QPE solver. It should be at least as long as sigc_re/sigc_im.
◆ librpa_get_g0w0_sigc_band_k()
| void librpa_get_g0w0_sigc_band_k | ( | LibrpaHandler * | h, |
| const LibrpaOptions * | p_opts, | ||
| const int | n_spins, | ||
| const int | n_kpts_band_this, | ||
| const int * | iks_band_this, | ||
| int | i_state_low, | ||
| int | i_state_high, | ||
| const double * | vxc_band, | ||
| const double * | vexx_band, | ||
| double * | sigc_band_re, | ||
| double * | sigc_band_im ) |
Obtain correlation self-energies for selected states at band k-points.
- Parameters
-
[in] h Pointer to LibRPA handler. [in] p_opts Pointer to runtime options. [in] n_spins Number of spin channels. [in] n_kpts_band_this Number of k-points to compute on this process. [in] iks_band_this (Global) index of k-points that this process compute. Each process can have different indices. Must be a subset of k-points at which the eigenvetors are parsed. [in] i_state_low Index of the first state to compute the potential (inclusive) [in] i_state_high Index of the last state to compute the potential (exclusive) [in] vxc_band exchange-correlation potential of the selected states at band k-points. [in] vexx_band Exact-exchange potential for the selected states at band k-points. It should be at least as long as n_spins * n_kpts_band_this * (i_state_high - i_state_low). It can be obtained using librpa_get_exx_pot_kgrid. [out] sigc_band_re Real-part of the correlation self-energy for the selected states. For option_qpe_solver=2, this is the perturbative effective real contribution that reconstructs the perturbative QP energy. It should be at least as long as n_spins * n_kpts_band_this * (i_state_high - i_state_low). [out] sigc_band_im Same as sigc_band_re, but for the imaginary part.
◆ librpa_get_g0w0_sigc_kgrid()
| void librpa_get_g0w0_sigc_kgrid | ( | LibrpaHandler * | h, |
| const LibrpaOptions * | p_opts, | ||
| const int | n_spins, | ||
| const int | n_kpts_this, | ||
| const int * | iks_this, | ||
| int | i_state_low, | ||
| int | i_state_high, | ||
| const double * | vxc, | ||
| const double * | vexx, | ||
| double * | sigc_re, | ||
| double * | sigc_im ) |
Obtain correlation self-energies for selected states.
- Parameters
-
[in] h Pointer to LibRPA handler. [in] p_opts Pointer to runtime options. [in] n_spins Number of spin channels. [in] n_kpts_this Number of k-points to compute on this process. [in] iks_this (Global) index of k-points that this process compute. Each process can have different indices. Must be a subset of k-points at which the eigenvetors are parsed. [in] i_state_low Index of the first state to compute the potential (inclusive) [in] i_state_high Index of the last state to compute the potential (exclusive) [in] vxc exchange-correlation potential of the selected states. [in] vexx Exact-exchange potential for the selected states. It should be at least as long as n_spins * n_kpoints_local * (i_state_high - i_state_low). It can be obtained using librpa_get_exx_pot_kgrid. [out] sigc_re Real-part of the correlation self-energy for the selected states. For option_qpe_solver=2, this is the perturbative effective real contribution that reconstructs the perturbative QP energy. It should be at least as long as n_spins * n_kpoints_local * (i_state_high - i_state_low). [out] sigc_im Same as sigc_re, but for the imaginary part.
◆ librpa_get_g0w0_spectral_function_band_k()
| void librpa_get_g0w0_spectral_function_band_k | ( | LibrpaHandler * | h, |
| const LibrpaOptions * | p_opts, | ||
| const int | n_spins, | ||
| const int | n_kpts_band_this, | ||
| const int * | iks_band_this, | ||
| int | i_state_low, | ||
| int | i_state_high, | ||
| const int | n_omegas, | ||
| const double * | omegas, | ||
| const double * | vxc_band, | ||
| const double * | vexx_band, | ||
| double * | spectral_function_band, | ||
| double * | sigc_band ) |
Obtain spectral functions for selected band-k states.
Same convention as librpa_get_g0w0_spectral_function_kgrid, but evaluates states at band k-points.
- Parameters
-
[in] h Pointer to LibRPA handler. [in] p_opts Pointer to runtime options. [in] n_spins Number of spin channels. [in] n_kpts_band_this Number of band k-points to compute on this process. [in] iks_band_this Global band-k indices computed on this process. [in] i_state_low First state index (inclusive). [in] i_state_high Last state index (exclusive). [in] n_omegas Number of real-frequency points. [in] omegas Real-frequency points, in Hartree. [in] vxc_band XC potential for selected band states. [in] vexx_band Exact-exchange potential for selected band states. [out] spectral_function_band Spectral functions. This output array should be at least as long as n_spins * n_kpts_band_this * (i_state_high - i_state_low) * n_omegas. The order is [spin][band k-point][state][omega]. [out] sigc_band Optional continued correlation self-energy. Pass nullptr if this output is not needed. If present, this is a packed complex<double> buffer with the same [spin][band k-point][state][omega] order as spectral_function_band.
◆ librpa_get_g0w0_spectral_function_kgrid()
| void librpa_get_g0w0_spectral_function_kgrid | ( | LibrpaHandler * | h, |
| const LibrpaOptions * | p_opts, | ||
| const int | n_spins, | ||
| const int | n_kpts_this, | ||
| const int * | iks_this, | ||
| int | i_state_low, | ||
| int | i_state_high, | ||
| const int | n_omegas, | ||
| const double * | omegas, | ||
| const double * | vxc, | ||
| const double * | vexx, | ||
| double * | spectral_function, | ||
| double * | sigc ) |
Obtain spectral functions for selected k-grid states.
Computes spectral functions under the diagonal approximation of the Green's function: \(A_{n\mathbf{k}}(\omega) = -\pi^{-1}\mathrm{Im}\,G_{n\mathbf{k}}(\omega)\).
- Parameters
-
[in] h Pointer to LibRPA handler. [in] p_opts Pointer to runtime options. [in] n_spins Number of spin channels. [in] n_kpts_this Number of k-points to compute on this process. [in] iks_this Global k-point indices computed on this process. [in] i_state_low First state index (inclusive). [in] i_state_high Last state index (exclusive). [in] n_omegas Number of real-frequency points. [in] omegas Real-frequency points, in Hartree. [in] vxc XC potential for selected states. [in] vexx Exact-exchange potential for selected states. [out] spectral_function Spectral functions. This output array should be at least as long as n_spins * n_kpts_this * (i_state_high - i_state_low) * n_omegas. The order is [spin][k-point][state][omega]. [out] sigc Optional continued correlation self-energy. Pass nullptr if this output is not needed. If present, this is a packed complex<double> buffer with the same [spin][k-point][state][omega] order as spectral_function.
◆ librpa_get_imaginary_frequency_grids()
| void librpa_get_imaginary_frequency_grids | ( | LibrpaHandler * | h, |
| const LibrpaOptions * | p_opts, | ||
| double * | omegas, | ||
| double * | weights ) |
Construct and return frequency grids for numerical integration.
Generates the frequency points and quadrature weights based on the grid type specified in the options (e.g., Gauss-Legendre, Minimax, etc.).
- Parameters
-
[in] h Handler. [in] p_opts Runtime options. [out] omegas Array of frequency points (size: opts->nfreq). [out] weights Array of quadrature weights (size: opts->nfreq).
◆ librpa_get_meanfield_dimensions()
| void librpa_get_meanfield_dimensions | ( | const LibrpaHandler * | h, |
| int | band_path, | ||
| int * | nspins, | ||
| int * | nkpts, | ||
| int * | nstates, | ||
| int * | naos, | ||
| int * | nspinor ) |
Query the numerical dimensions needed to prepare a QSGW task's host input. band_path selects band input when nonzero. This call is noncollective.
◆ librpa_get_optical_result()
| LibrpaOpticalResult * librpa_get_optical_result | ( | const LibrpaHandler * | h | ) |
Noncollective snapshot; analytic head/wing preparation must be complete.
◆ librpa_get_optical_view()
| LibrpaOpticalView librpa_get_optical_view | ( | const LibrpaOpticalResult * | result | ) |
Return a borrowed copy of the public fields, with the original result's lifetime.
◆ librpa_get_rpa_correlation_energy()
| double librpa_get_rpa_correlation_energy | ( | LibrpaHandler * | h, |
| const LibrpaOptions * | p_opts, | ||
| int | n_ibz_kpoints, | ||
| double * | rpa_corr_ibzk_contrib_re, | ||
| double * | rpa_corr_ibzk_contrib_im ) |
Compute RPA correlation energy.
Calculates the RPA correlation energy using the input data (wavefunctions, Coulomb matrices, etc.) that has been set via the input parsing functions.
- Parameters
-
[in] h Handler. [in] p_opts Runtime options. [in] n_ibz_kpoints Number of irreducible k-points. [out] rpa_corr_ibzk_contrib_re Real part of correlation energy per IBZ k-point. [out] rpa_corr_ibzk_contrib_im Imaginary part of correlation energy per IBZ k-point.
- Returns
- Total RPA correlation energy (real part).
◆ librpa_orbital_pdos()
| void librpa_orbital_pdos | ( | const LibrpaOrbitalResult * | result, |
| int | n_energies, | ||
| const double * | energy_grid_ha, | ||
| double | sigma_ha, | ||
| double * | mulliken, | ||
| double * | lowdin ) |
Local Gaussian PDOS from an existing result; no collective or files. Grid is absolute Hartree and sigma is Hartree. Output arrays, supplied by the caller, each have n_spins*n_energies*n_groups doubles in [spin][E][group] order and units states/(Ha cell stored-spin-channel). Uses loaded k weights; applies neither occupation nor an extra spin-degeneracy factor.
◆ librpa_prepare_crpa_model()
| LibrpaCrpaResult * librpa_prepare_crpa_model | ( | const LibrpaHandler * | h, |
| const LibrpaOptions * | options, | ||
| const LibrpaCrpaInput * | input ) |
Prepare current local frames, weights and one-body model only. Collective. Builds no response, W or self-energy; returns zero interaction tensors. Useful for cheap parent transport between selected screening evaluations.
◆ librpa_prepare_native_velocity()
| void librpa_prepare_native_velocity | ( | LibrpaHandler * | h, |
| const LibrpaOptions * | options, | ||
| const LibrpaNativeVelocityInput * | root_input, | ||
| int | prepare_optical ) |
Collective velocity computation and setter; optional analytic head/wing preparation reuses the ordinary numerical API. Options use API values 3/4, never driver preset 6. Optical preparation requires replace_w_head enabled. Option 3 also requires use_scalapack_gw_wc to consume the analytic wing. Input is borrowed only for this call; input structures are in librpa_input.h.
◆ librpa_prepare_qsgw_task()
| void librpa_prepare_qsgw_task | ( | LibrpaQsgwTask * | ) |
Collective preparation. If IBZ expansion is triggered, the handler's SCF mean field and k grid are replaced by full-grid states and existing compute objects are invalidated. Mean-field getters then expose the expanded grid. Supply Vxc for the original source grid and gauge; retain its dimensions before preparation if needed.
◆ librpa_set_qsgw_crpa()
| void librpa_set_qsgw_crpa | ( | LibrpaQsgwTask * | task, |
| const LibrpaCrpaInput * | input, | ||
| const LibrpaQsgwCrpaControls * | controls, | ||
| LibrpaCrpaOutputSink | sink, | ||
| void * | user_data ) |
Attach after librpa_prepare_qsgw_task, before run. Input and controls are copied; the sink and user_data must remain valid until run returns.
◆ librpa_write_crpa_tracking_checkpoint()
| void librpa_write_crpa_tracking_checkpoint | ( | const LibrpaCrpaResult * | result, |
| const char * | filename, | ||
| int | iteration, | ||
| const char * | definition, | ||
| int | n_energies, | ||
| const double * | energies_ha ) |
Noncollective save of this result's parent frame in the native tracking checkpoint format. The caller selects the writing rank. Energy context may be empty for a state export, or include every spin/k/band pole.
Generated by