ergo
|
Code for 1-electron integrals, computation of electron-nuclear potential energy matrix V. More...
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <errno.h>
#include <memory.h>
#include <time.h>
#include <stdarg.h>
#include <assert.h>
#include <vector>
#include "integrals_1el.h"
#include "integrals_1el_potential.h"
#include "integrals_1el_potential_prep.h"
#include "memorymanag.h"
#include "pi.h"
#include "output.h"
#include "utilities.h"
#include "boysfunction.h"
#include "integral_info.h"
#include "integrals_general.h"
#include "box_system.h"
#include "multipole.h"
#include "integrals_2el_single.h"
#include "integrals_1el_single.h"
#include "integrals_hermite.h"
#include "matrix_norm.h"
#include "mm_limit_table.h"
Classes | |
struct | atom_box_struct |
struct | DistributionSpecStructWithIndexes |
Functions | |
static ergo_real | get_distance_3d (const ergo_real *x, const ergo_real *y) |
static void | get_multipole_contribs_for_atom (multipole_struct_large &boxMultipole, ergo_real *multipolePointCoords, const Atom &currAtom, const MMTranslator &translator) |
static void | init_multipole_struct_large (multipole_struct_large &boxMultipole, const ergo_real *multipolePointCoords) |
static int | create_nuclei_mm_tree (const IntegralInfo &integralInfo, int nAtoms, const Atom *atomList, ergo_real boxSize, BoxSystem &boxSystem, atom_box_struct **return_boxList, int *return_numberOfLevels, Atom **return_atomListReordered, int *return_atomPermutation, bool compute_gradient_also) |
static int | do_interaction_recursive (const IntegralInfo &integralInfo, ergo_real *V_list, int noOfBasisFuncIndexPairs, const basis_func_index_pair_struct_1el *basisFuncIndexPairList, const DistributionSpecStructWithIndexes *list, int nDistrs, const multipole_struct_small *multipoleList, const ergo_real *maxMomentVectorNormForDistrsList, int maxNoOfMomentsForDistrs, int maxDegreeForDistrs, ergo_real distrExtent, const Atom *atomListReordered, const int *atomPermutation, ergo_real threshold, const atom_box_struct *boxList, MMInteractor &interactor, int boxIndex, int currLevel, int numberOfLevels, bool compute_gradient_also, const ergo_real *D_list, ergo_real *result_gradient_list) |
Take care of interaction between list of distrs and box. More... | |
static int | do_interaction_recursive_2 (const IntegralInfo &integralInfo, csr_matrix_struct *V_CSR, int noOfBasisFuncIndexPairs, const basis_func_index_pair_struct_1el *basisFuncIndexPairList, const DistributionSpecStructWithIndexes2 *list, int nDistrs, const multipole_struct_small *multipoleList, const ergo_real *maxMomentVectorNormForDistrsList, int maxNoOfMomentsForDistrs, int maxDegreeForDistrs, ergo_real distrExtent, const Atom *atomListReordered, const int *atomPermutation, ergo_real threshold, const atom_box_struct *boxList, MMInteractor &interactor, int boxIndex, int currLevel, int numberOfLevels) |
Take care of interaction between list of distrs and box. More... | |
static int | get_list_of_distrs_for_V (const BasisInfoStruct &basisInfo, const basis_func_index_pair_struct_1el *basisFuncIndexPairList, int noOfBasisFuncIndexPairs, ergo_real threshold, ergo_real maxCharge, DistributionSpecStructWithIndexes *resultList, int maxCountResult) |
static ergo_real | get_nucl_repulsion_energy_using_multipoles (const Atom *atomListReordered, const int *atomPermutation, ergo_real threshold, const atom_box_struct *boxList, MMInteractor &interactor, int boxIndex1, int boxIndex2, int currLevel, int numberOfLevels) |
int | compute_V_and_gradient_linear (const BasisInfoStruct &basisInfo, const IntegralInfo &integralInfo, const Molecule &molecule, ergo_real threshold, ergo_real boxSize, const basis_func_index_pair_struct_1el *basisFuncIndexPairList, ergo_real *V_list, int noOfBasisFuncIndexPairs, bool compute_gradient_also, const ergo_real *D_list, ergo_real *gradient_list, ergo_real &result_nuclearRepulsionEnergy) |
int | compute_V_hierarchical (const BasisInfoStruct &basisInfo, const IntegralInfo &integralInfo, const Molecule &molecule, ergo_real threshold, ergo_real boxSize, const basis_func_index_pair_struct_1el *basisFuncIndexPairList, int noOfBasisFuncIndexPairs, csr_matrix_struct *V_CSR, ergo_real &result_nuclearRepulsionEnergy) |
static ergo_real | simplePrimVintegralSingle (const DistributionSpecStruct &prim, const Atom &atom, const IntegralInfo &integralInfo) |
ergo_real | simplePrimVintegral_list (const DistributionSpecStruct *list, int nPrims, const Atom &atom, const IntegralInfo &integralInfo) |
int | compute_V_matrix_full (const BasisInfoStruct &basisInfo, const IntegralInfo &integralInfo, int nAtoms, const Atom *atomList, ergo_real threshold, ergo_real *result) |
Code for 1-electron integrals, computation of electron-nuclear potential energy matrix V.
int compute_V_and_gradient_linear | ( | const BasisInfoStruct & | basisInfo, |
const IntegralInfo & | integralInfo, | ||
const Molecule & | molecule, | ||
ergo_real | threshold, | ||
ergo_real | boxSize, | ||
const basis_func_index_pair_struct_1el * | basisFuncIndexPairList, | ||
ergo_real * | V_list, | ||
int | noOfBasisFuncIndexPairs, | ||
bool | compute_gradient_also, | ||
const ergo_real * | D_list, | ||
ergo_real * | gradient_list, | ||
ergo_real & | result_nuclearRepulsionEnergy | ||
) |
References A, atom_box_struct::basicBox, Atom::charge, compute_multipole_moments(), create_nuclei_mm_tree(), multipole_struct_small::degree, atom_box_struct::derivatives_wrt_multipole_moments, DistributionSpecStructWithIndexes::distr, do_interaction_recursive(), do_output(), DistributionSpecStruct::exponent, box_struct_basic::firstItemIndex, get_list_of_distrs_for_V(), get_nucl_repulsion_energy_using_multipoles(), Molecule::getAtom(), Molecule::getAtomListPtr(), IntegralInfo::GetMultipolePrep(), Molecule::getNoOfAtoms(), Molecule::getNuclearRepulsionEnergyGradientContribQuadratic(), LOG_AREA_INTEGRALS, LOG_CAT_ERROR, LOG_CAT_INFO, MAX_MULTIPOLE_DEGREE_BASIC, MAX_NO_OF_MOMENTS_PER_MULTIPOLE, multipole_struct_small::momentList, atom_box_struct::multipole_moment_derivatives, box_struct_basic::noOfItems, multipole_struct_small::noOfMoments, Util::TimeMeter::print(), sort_distr_list(), template_blas_fabs(), template_blas_log(), template_blas_sqrt(), and BoxSystem::totNoOfBoxes.
Referenced by compute_gradient_of_nucl_and_trDV(), and compute_V_sparse().
int compute_V_hierarchical | ( | const BasisInfoStruct & | basisInfo, |
const IntegralInfo & | integralInfo, | ||
const Molecule & | molecule, | ||
ergo_real | threshold, | ||
ergo_real | boxSize, | ||
const basis_func_index_pair_struct_1el * | basisFuncIndexPairList, | ||
int | noOfBasisFuncIndexPairs, | ||
csr_matrix_struct * | V_CSR, | ||
ergo_real & | result_nuclearRepulsionEnergy | ||
) |
References Atom::charge, create_nuclei_mm_tree(), SetOfDistrsForV::distrList, do_interaction_recursive_2(), do_output(), get_list_of_distrs_for_V(), get_nucl_repulsion_energy_using_multipoles(), Molecule::getAtom(), Molecule::getAtomListPtr(), IntegralInfo::GetMultipolePrep(), Molecule::getNoOfAtoms(), SetOfDistrsForV::groupList, LOG_AREA_INTEGRALS, LOG_CAT_ERROR, LOG_CAT_INFO, SetOfDistrsForV::maxMomentVectorNormList, SetOfDistrsForV::multipoleList, organize_distrs_for_V(), and Util::TimeMeter::print().
Referenced by compute_V_sparse_hierarchical().
int compute_V_matrix_full | ( | const BasisInfoStruct & | basisInfo, |
const IntegralInfo & | integralInfo, | ||
int | nAtoms, | ||
const Atom * | atomList, | ||
ergo_real | threshold, | ||
ergo_real * | result | ||
) |
References A, BasisInfoStruct::basisFuncList, do_output(), get_product_simple_prims(), LOG_AREA_INTEGRALS, LOG_CAT_ERROR, BasisInfoStruct::noOfBasisFuncs, BasisFuncStruct::noOfSimplePrimitives, BasisFuncStruct::simplePrimitiveIndex, BasisInfoStruct::simplePrimitiveList, and simplePrimVintegral_list().
Referenced by compute_h_core_matrix_full(), and test_V_by_explicit_comparison().
|
static |
References A, B, atom_box_struct::basicBox, BoxSystem::boxList, box_struct_basic::centerCoords, multipole_struct_large::centerCoords, atom_box_struct::centerOfChargeCoords, Atom::charge, Atom::coords, BoxSystem::create_box_system(), multipole_struct_large::degree, atom_box_struct::derivatives_wrt_multipole_moments, do_output(), box_struct_basic::firstChildBoxIndex, box_struct_basic::firstItemIndex, get_multipole_contribs_for_atom(), IntegralInfo::GetMultipolePrep(), MMTranslator::getTranslationMatrix(), init_multipole_struct_large(), BoxSystem::levelList, LOG_AREA_INTEGRALS, LOG_CAT_ERROR, MAX_MULTIPOLE_DEGREE, MAX_NO_OF_MOMENTS_PER_MULTIPOLE, multipole_struct_large::momentList, atom_box_struct::multipole, atom_box_struct::multipole_moment_derivatives, box_level_struct::noOfBoxes, box_struct_basic::noOfChildBoxes, box_struct_basic::noOfItems, BoxSystem::noOfLevels, multipole_struct_large::noOfMoments, box_item_struct::originalIndex, setup_multipole_maxAbsMomentList(), box_level_struct::startIndexInBoxList, and BoxSystem::totNoOfBoxes.
Referenced by compute_V_and_gradient_linear(), and compute_V_hierarchical().
|
static |
Take care of interaction between list of distrs and box.
References A, B, atom_box_struct::basicBox, DistributionSpecStruct::centerCoords, box_struct_basic::centerCoords, multipole_struct_large::centerCoords, Atom::charge, DistributionSpecStruct::coeff, Atom::coords, atom_box_struct::derivatives_wrt_multipole_moments, distance(), DistributionSpecStructWithIndexes::distr, DistributionSpecStruct::exponent, box_struct_basic::firstChildBoxIndex, box_struct_basic::firstItemIndex, get_distance_3d(), MMLimitTable::get_minimum_multipole_degree_needed(), get_related_integrals_hermite(), MMInteractor::getInteractionMatrix(), IntegralInfo::GetMMLimitTable(), MAX_MULTIPOLE_DEGREE, MAX_NO_OF_MOMENTS_PER_MULTIPOLE, multipole_struct_large::momentList, multipole_struct_small::momentList, monomial_info_struct::monomial_index_list, IntegralInfo::monomial_info, DistributionSpecStruct::monomialInts, IntegralInfo::multiply_by_hermite_conversion_matrix_from_right(), atom_box_struct::multipole, monomial_info_struct::no_of_monomials_list, box_struct_basic::noOfChildBoxes, box_struct_basic::noOfItems, multipole_struct_small::noOfMoments, DistributionSpecStructWithIndexes::pairIdx, pi, template_blas_sqrt(), and box_struct_basic::width.
Referenced by compute_V_and_gradient_linear().
|
static |
Take care of interaction between list of distrs and box.
References A, B, atom_box_struct::basicBox, DistributionSpecStructWithIndexes2::basisFuncIdx1, DistributionSpecStructWithIndexes2::basisFuncIdx2, DistributionSpecStruct::centerCoords, box_struct_basic::centerCoords, multipole_struct_large::centerCoords, Atom::charge, DistributionSpecStruct::coeff, Atom::coords, distance(), DistributionSpecStructWithIndexes2::distr, ergo_CSR_add_to_element(), DistributionSpecStruct::exponent, box_struct_basic::firstChildBoxIndex, box_struct_basic::firstItemIndex, get_distance_3d(), MMLimitTable::get_minimum_multipole_degree_needed(), get_related_integrals_hermite(), MMInteractor::getInteractionMatrix(), IntegralInfo::GetMMLimitTable(), MAX_MULTIPOLE_DEGREE, MAX_NO_OF_MOMENTS_PER_MULTIPOLE, multipole_struct_large::momentList, monomial_info_struct::monomial_index_list, IntegralInfo::monomial_info, DistributionSpecStruct::monomialInts, IntegralInfo::multiply_by_hermite_conversion_matrix_from_right(), atom_box_struct::multipole, monomial_info_struct::no_of_monomials_list, box_struct_basic::noOfChildBoxes, box_struct_basic::noOfItems, multipole_struct_small::noOfMoments, pi, template_blas_sqrt(), and box_struct_basic::width.
Referenced by compute_V_hierarchical().
References template_blas_sqrt().
Referenced by do_interaction_recursive(), do_interaction_recursive_2(), and get_nucl_repulsion_energy_using_multipoles().
|
static |
References DistributionSpecStructWithIndexes::basisFuncIdx1, DistributionSpecStructWithIndexes::basisFuncIdx2, DistributionSpecStruct::coeff, DistributionSpecStructWithIndexes::distr, do_output(), DistributionSpecStruct::exponent, get_product_simple_primitives(), basis_func_index_pair_struct_1el::index_1, basis_func_index_pair_struct_1el::index_2, LOG_AREA_INTEGRALS, LOG_CAT_ERROR, DistributionSpecStructWithIndexes::pairIdx, pi, POLY_PRODUCT_MAX_DISTRS, and template_blas_fabs().
Referenced by compute_V_and_gradient_linear(), and compute_V_hierarchical().
|
static |
References A, B, multipole_struct_large::centerCoords, Atom::charge, Atom::coords, multipole_struct_large::degree, multipole_struct_small::degree, MMTranslator::getTranslationMatrix(), MAX_MULTIPOLE_DEGREE, MAX_NO_OF_MOMENTS_PER_MULTIPOLE, multipole_struct_large::momentList, multipole_struct_small::momentList, multipole_struct_large::noOfMoments, and multipole_struct_small::noOfMoments.
Referenced by create_nuclei_mm_tree().
|
static |
References A, B, atom_box_struct::basicBox, box_struct_basic::centerCoords, multipole_struct_large::centerCoords, Atom::charge, Atom::coords, distance(), box_struct_basic::firstChildBoxIndex, box_struct_basic::firstItemIndex, get_distance_3d(), MMInteractor::getInteractionMatrix(), MAX_MULTIPOLE_DEGREE, multipole_struct_large::momentList, atom_box_struct::multipole, box_struct_basic::noOfChildBoxes, box_struct_basic::noOfItems, template_blas_sqrt(), and box_struct_basic::width.
Referenced by compute_V_and_gradient_linear(), and compute_V_hierarchical().
|
static |
ergo_real simplePrimVintegral_list | ( | const DistributionSpecStruct * | list, |
int | nPrims, | ||
const Atom & | atom, | ||
const IntegralInfo & | integralInfo | ||
) |
References simplePrimVintegralSingle().
Referenced by compute_V_matrix_full().
|
static |
References Atom::charge, Atom::coords, and do_1e_repulsion_integral_using_symb_info().
Referenced by simplePrimVintegral_list().