ergo
|
Wrapper routines for different parts of the integral code, including conversion of matrices from/to the hierarchical matrix library (HML) format. More...
#include <string.h>
#include "integral_matrix_wrappers.h"
#include "output.h"
#include "basis_func_pair_list_1el.h"
#include "integrals_1el_kinetic.h"
#include "integrals_1el_potential.h"
#include "operator_matrix.h"
#include "basis_func_pair_list.h"
#include "integrals_2el_boxed.h"
#include "integrals_2el_J.h"
#include "integrals_2el_K.h"
#include "integrals_2el_K_prep.h"
#include "utilities.h"
#include "memorymanag.h"
Typedefs | |
typedef int * | int_ptr |
typedef ergo_real * | ergo_real_ptr |
Functions | |
static ergo_real | get_max_charge (const Molecule &molecule) |
static void | convert_symm_CSR_to_HML_and_destroy_CSR (csr_matrix_struct &M_CSR, symmMatrix &M_HML, std::vector< int > const &permutationHML) |
int | compute_V_sparse (const BasisInfoStruct &basisInfo, const IntegralInfo &integralInfo, const Molecule &molecule, ergo_real threshold, ergo_real boxSize, symmMatrix &V, std::vector< int > const &permutationHML, ergo_real &result_nuclearRepulsionEnergy) |
int | compute_V_sparse_hierarchical (const BasisInfoStruct &basisInfo, const IntegralInfo &integralInfo, const Molecule &molecule, ergo_real threshold, ergo_real boxSize, symmMatrix &V, std::vector< int > const &permutationHML, ergo_real &result_nuclearRepulsionEnergy) |
int | compute_gradient_of_nucl_and_trDV (const BasisInfoStruct &basisInfo, const IntegralInfo &integralInfo, const Molecule &molecule, ergo_real threshold, ergo_real boxSize, const symmMatrix &densityMatrix_sparse, std::vector< int > const &permutationHML, ergo_real *result_gradient_list) |
ergo_real | get_electron_nuclear_attraction_energy (const IntegralInfo &integralInfo, const Molecule &molecule, const BasisInfoStruct &basisInfo, const symmMatrix &D, ergo_real threshold_integrals_1el, mat::SizesAndBlocks const &matrix_size_block_info, std::vector< int > const &permutationHML) |
int | compute_T_sparse_linear (const BasisInfoStruct &basisInfo, const IntegralInfo &integralInfo, ergo_real threshold, ergo_real boxSize, symmMatrix &T, std::vector< int > const &permutationHML) |
static int | check_diagonal_elements_of_overlap_matrix (int n, const symmMatrix &S_symm) |
int | compute_overlap_matrix_sparse (const BasisInfoStruct &basisInfo, symmMatrix &S_symm, std::vector< int > const &permutationHML) |
int | compute_R_matrix_sparse (const BasisInfoStruct &basisInfo_A, const BasisInfoStruct &basisInfo_B, normalMatrix &result_R, ergo_real sparse_threshold, std::vector< int > const &matrixPermutationVec_A, std::vector< int > const &matrixPermutationVec_B) |
compute_R_matrix_sparse computes the overlap matrix between two different basis sets. More... | |
int | compute_operator_matrix_sparse_symm (const BasisInfoStruct &basisInfo, int pow_x, int pow_y, int pow_z, symmMatrix &A_symm, std::vector< int > const &permutationHML) |
int | compute_J_by_boxes_sparse (const BasisInfoStruct &basisInfo, const IntegralInfo &integralInfo, const JK::Params &J_K_params, symmMatrix &J, const symmMatrix &densityMatrix_sparse, std::vector< int > const &permutationHML) |
static int | get_CSR_from_symmMatrix (int n, const symmMatrix &A, std::vector< int > const &inversePermutationHML, csr_matrix_struct &CSR) |
static int | get_CSR_from_normalMatrix (int n, const normalMatrix &A, std::vector< int > const &inversePermutationHML, csr_matrix_struct &CSR) |
int | compute_K_by_boxes_sparse (const BasisInfoStruct &basisInfo, const IntegralInfo &integralInfo, const JK::ExchWeights &CAM_params, const JK::Params &J_K_params, symmMatrix &K, symmMatrix &densityMatrix_sparse, std::vector< int > const &permutationHML, std::vector< int > const &inversePermutationHML) |
Returns the exchange matrix multiplied by 0.5. More... | |
int | compute_K_by_boxes_sparse_nosymm (const BasisInfoStruct &basisInfo, const IntegralInfo &integralInfo, const JK::ExchWeights &CAM_params, const JK::Params &J_K_params, normalMatrix &K, normalMatrix &densityMatrix_sparse, std::vector< int > const &permutationHML, std::vector< int > const &inversePermutationHML) |
Wrapper routines for different parts of the integral code, including conversion of matrices from/to the hierarchical matrix library (HML) format.
typedef ergo_real* ergo_real_ptr |
typedef int* int_ptr |
|
static |
References do_output(), LOG_AREA_UNDEFINED, LOG_CAT_INFO, LOG_CAT_WARNING, and template_blas_fabs().
Referenced by compute_overlap_matrix_sparse().
int compute_gradient_of_nucl_and_trDV | ( | const BasisInfoStruct & | basisInfo, |
const IntegralInfo & | integralInfo, | ||
const Molecule & | molecule, | ||
ergo_real | threshold, | ||
ergo_real | boxSize, | ||
const symmMatrix & | densityMatrix_sparse, | ||
std::vector< int > const & | permutationHML, | ||
ergo_real * | result_gradient_list | ||
) |
References compute_V_and_gradient_linear(), do_output(), get_basis_func_pair_list_1el_for_V(), get_max_charge(), Molecule::getNoOfAtoms(), LOG_AREA_UNDEFINED, LOG_CAT_ERROR, LOG_CAT_INFO, and BasisInfoStruct::noOfBasisFuncs.
Referenced by get_gradient_for_given_mol_and_dens(), and test_gradient_by_explicit_comparison().
int compute_J_by_boxes_sparse | ( | const BasisInfoStruct & | basisInfo, |
const IntegralInfo & | integralInfo, | ||
const JK::Params & | J_K_params, | ||
symmMatrix & | J, | ||
const symmMatrix & | densityMatrix_sparse, | ||
std::vector< int > const & | permutationHML | ||
) |
References compute_J_by_boxes_linear(), do_output(), get_basis_func_pair_list_2el(), LOG_AREA_DENSFROMF, LOG_AREA_UNDEFINED, LOG_CAT_ERROR, LOG_CAT_INFO, BasisInfoStruct::noOfBasisFuncs, output_current_memory_usage(), Util::TimeMeter::print(), JK::Params::threshold_J, and mat::FileWritable::writeAndReadAll().
Referenced by Jworker::ComputeMatrix(), Jworkertest::ComputeMatrix(), get_2e_matrices_and_energy_restricted_open(), get_2e_matrices_and_energy_simple_HF_sparse_unrestricted(), get_2e_matrices_and_energy_simple_sparse_unrestricted(), get_2e_matrix_and_energy_simple_HF_sparse(), get_2e_matrix_and_energy_simple_sparse(), get_energy(), get_Fock_matrix_in_ort_basis(), get_HML_J(), and main().
int compute_K_by_boxes_sparse | ( | const BasisInfoStruct & | basisInfo, |
const IntegralInfo & | integralInfo, | ||
const JK::ExchWeights & | CAM_params, | ||
const JK::Params & | J_K_params, | ||
symmMatrix & | K, | ||
symmMatrix & | densityMatrix_sparse, | ||
std::vector< int > const & | permutationHML, | ||
std::vector< int > const & | inversePermutationHML | ||
) |
Returns the exchange matrix multiplied by 0.5.
To get the correct value multiply K by 2.
References compute_K_by_boxes(), convert_symm_CSR_to_HML_and_destroy_CSR(), create_CSR_for_K(), do_output(), ergo_CSR_destroy(), get_CSR_from_symmMatrix(), LOG_AREA_UNDEFINED, LOG_CAT_ERROR, BasisInfoStruct::noOfBasisFuncs, output_current_memory_usage(), and Util::TimeMeter::print().
Referenced by Kworker::ComputeMatrix(), get_2e_matrices_and_energy_restricted_open(), get_2e_matrices_and_energy_simple_HF_sparse_unrestricted(), get_2e_matrices_and_energy_simple_sparse_unrestricted(), get_2e_matrix_and_energy_simple_HF_sparse(), get_2e_matrix_and_energy_simple_sparse(), get_energy(), get_HML_K(), and main().
int compute_K_by_boxes_sparse_nosymm | ( | const BasisInfoStruct & | basisInfo, |
const IntegralInfo & | integralInfo, | ||
const JK::ExchWeights & | CAM_params, | ||
const JK::Params & | J_K_params, | ||
normalMatrix & | K, | ||
normalMatrix & | densityMatrix_sparse, | ||
std::vector< int > const & | permutationHML, | ||
std::vector< int > const & | inversePermutationHML | ||
) |
References compute_K_by_boxes(), create_CSR_for_K(), do_output(), ergo_CSR_destroy(), ergo_CSR_get_nvalues(), ergo_CSR_get_values(), get_CSR_from_normalMatrix(), LOG_AREA_UNDEFINED, LOG_CAT_ERROR, BasisInfoStruct::noOfBasisFuncs, output_current_memory_usage(), and Util::TimeMeter::print().
Referenced by get_Fock_matrix_in_ort_basis(), and main().
int compute_operator_matrix_sparse_symm | ( | const BasisInfoStruct & | basisInfo, |
int | pow_x, | ||
int | pow_y, | ||
int | pow_z, | ||
symmMatrix & | A_symm, | ||
std::vector< int > const & | permutationHML | ||
) |
int compute_overlap_matrix_sparse | ( | const BasisInfoStruct & | basisInfo, |
symmMatrix & | S_symm, | ||
std::vector< int > const & | permutationHML | ||
) |
int compute_R_matrix_sparse | ( | const BasisInfoStruct & | basisInfo_A, |
const BasisInfoStruct & | basisInfo_B, | ||
normalMatrix & | result_R, | ||
ergo_real | sparse_threshold, | ||
std::vector< int > const & | matrixPermutationVec_A, | ||
std::vector< int > const & | matrixPermutationVec_B | ||
) |
compute_R_matrix_sparse computes the overlap matrix between two different basis sets.
References compute_operator_matrix_sparse(), do_output(), LOG_AREA_UNDEFINED, LOG_CAT_ERROR, and BasisInfoStruct::noOfBasisFuncs.
Referenced by load_density_and_project_sparse().
int compute_T_sparse_linear | ( | const BasisInfoStruct & | basisInfo, |
const IntegralInfo & | integralInfo, | ||
ergo_real | threshold, | ||
ergo_real | boxSize, | ||
symmMatrix & | T, | ||
std::vector< int > const & | permutationHML | ||
) |
References compute_T_matrix_sparse_linear(), do_output(), ergo_free(), LOG_AREA_UNDEFINED, LOG_CAT_ERROR, and BasisInfoStruct::noOfBasisFuncs.
Referenced by compute_h_core_matrix_sparse(), get_energy(), and main().
int compute_V_sparse | ( | const BasisInfoStruct & | basisInfo, |
const IntegralInfo & | integralInfo, | ||
const Molecule & | molecule, | ||
ergo_real | threshold, | ||
ergo_real | boxSize, | ||
symmMatrix & | V, | ||
std::vector< int > const & | permutationHML, | ||
ergo_real & | result_nuclearRepulsionEnergy | ||
) |
References compute_V_and_gradient_linear(), do_output(), get_basis_func_pair_list_1el_for_V(), get_max_charge(), Molecule::getNoOfAtoms(), LOG_AREA_UNDEFINED, LOG_CAT_ERROR, LOG_CAT_INFO, and BasisInfoStruct::noOfBasisFuncs.
Referenced by compute_h_core_matrix_sparse(), get_electron_nuclear_attraction_energy(), get_energy(), main(), test_S_V_comparison(), test_V_by_explicit_comparison(), and test_V_by_explicit_comparison_tight().
int compute_V_sparse_hierarchical | ( | const BasisInfoStruct & | basisInfo, |
const IntegralInfo & | integralInfo, | ||
const Molecule & | molecule, | ||
ergo_real | threshold, | ||
ergo_real | boxSize, | ||
symmMatrix & | V, | ||
std::vector< int > const & | permutationHML, | ||
ergo_real & | result_nuclearRepulsionEnergy | ||
) |
References compute_V_hierarchical(), convert_symm_CSR_to_HML_and_destroy_CSR(), do_output(), ergo_CSR_create(), get_basis_func_pair_list_1el_for_V(), get_max_charge(), Molecule::getNoOfAtoms(), LOG_AREA_UNDEFINED, LOG_CAT_ERROR, LOG_CAT_INFO, and BasisInfoStruct::noOfBasisFuncs.
Referenced by test_V_by_explicit_comparison().
|
static |
References do_output(), ergo_CSR_destroy(), ergo_CSR_get_nvalues(), ergo_CSR_get_values(), LOG_AREA_UNDEFINED, and LOG_CAT_ERROR.
Referenced by compute_K_by_boxes_sparse(), and compute_V_sparse_hierarchical().
|
static |
References A, do_output(), ergo_CSR_add_to_element(), ergo_CSR_create(), ergo_CSR_get_element(), LOG_AREA_UNDEFINED, and LOG_CAT_ERROR.
Referenced by compute_K_by_boxes_sparse_nosymm().
|
static |
References A, do_output(), ergo_CSR_add_to_element(), ergo_CSR_create(), ergo_CSR_get_element(), LOG_AREA_UNDEFINED, and LOG_CAT_ERROR.
Referenced by compute_K_by_boxes_sparse().
ergo_real get_electron_nuclear_attraction_energy | ( | const IntegralInfo & | integralInfo, |
const Molecule & | molecule, | ||
const BasisInfoStruct & | basisInfo, | ||
const symmMatrix & | D, | ||
ergo_real | threshold_integrals_1el, | ||
mat::SizesAndBlocks const & | matrix_size_block_info, | ||
std::vector< int > const & | permutationHML | ||
) |
References compute_V_sparse().
Referenced by get_nucl_energy_for_given_mol_and_dens().
References Atom::charge, Molecule::getAtom(), and Molecule::getNoOfAtoms().
Referenced by compute_gradient_of_nucl_and_trDV(), compute_V_sparse(), and compute_V_sparse_hierarchical().