ERKALE
ERKALE - DFT from Hel
 All Classes Functions Variables Friends Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CompletenessOptimizer< ValueType > Class Template Referenceabstract

Completeness optimizer class. More...

#include <co-opt.h>

Public Member Functions

 CompletenessOptimizer ()
 Constructor. More...
 
virtual ~CompletenessOptimizer ()
 Destructor.
 
int get_ntau () const
 Get moment of completeness profile to optimize.
 
void set_ntau (int n)
 Set moment of completeness profile to optimize.
 
int get_nfull () const
 Get amount of fully optimized exponents.
 
void set_nfull (int n)
 Set amount of fully optimized exponents.
 
arma::vec optimize_completeness (int am, double min, double max, int Nf, double &mog)
 Get exponents.
 
arma::vec maxwidth_exps_table (int am, double tol, size_t nexp, double &width)
 Get completeness-optimized exponents.
 
arma::vec span_width (int am, double tol, double &width, int nx)
 Span necessary width.
 
virtual BasisSetLibrary form_basis (const std::vector< coprof_t > &cpl)
 Form a basis set.
 
void save_limits (const std::vector< coprof_t > &cpl, const std::string &fname) const
 Save the limits.
 
std::vector< coprof_tload_limits (const std::string &fname)
 Load limits.
 
std::vector< coprof_tload_limits (const BasisSetLibrary &baslib, double tol, int maxam)
 Generate limits from existing basis set.
 
std::vector< coprof_tinitial_profile (const std::vector< int > &nshells, int nexp, double cotol=1e-4)
 
std::vector< coprof_tinitial_profile (const std::vector< size_t > &nfuncs, double cotol=1e-4)
 
std::vector< coprof_tinitial_profile (const std::vector< size_t > &nfuncs, std::vector< double > offsets, double cotol=1e-4)
 
virtual std::vector< ValueType > compute_values (const std::vector< BasisSetLibrary > &baslib)=0
 Compute values with given basis sets (implementation can be parallellized)
 
std::vector< ValueType > compute_values (const std::vector< std::vector< coprof_t > > &cpl)
 Compute value with given basis set.
 
virtual double compute_mog (const ValueType &val, const ValueType &ref, double failval)=0
 
double check_polarization (std::vector< coprof_t > &cpl, ValueType &curval, int am_max, double minpol, double maxpol, double dpol, bool polinterp, double cotol, int nx, bool forcesub=false)
 
bool comply_subset (std::vector< coprof_t > &cpl, ValueType &curval)
 Reform to comply to subset requirement.
 
double scan_profile (std::vector< coprof_t > &cpl, ValueType &curval, int npoints, double dpol, double tol, bool allam=true, bool bothsd=true, bool forcesub=false)
 
double extend_profile (std::vector< coprof_t > &cpl, ValueType &curval, double tau, int next=3, int nxadd=1, bool forcesub=false)
 Extend the current shells until mog < tau. Returns maximal mog.
 
double tighten_profile (std::vector< coprof_t > &cpl, ValueType &curval, double tau, int nxadd=1, bool forcesub=false)
 Tighten the shells until mog < tau. Returns maximal mog.
 
virtual int atom_am () const =0
 Get SCF free-atom angular momentum.
 
virtual void print_value (const ValueType &value, std::string msg)=0
 Print value.
 
void find_cbs_limit (std::vector< coprof_t > &cpl, ValueType &curval, double cotol, double minpol, double maxpol, double dpol, bool extend=true, int next=3, bool scan=true, int nscan=5, bool polinterp=true, int nxpol=1, bool doadd=true, int nxext=1, int am_max=max_am, bool cbsinterp=true, double cbsthr=0.0, double delta=0.9, bool allam=true, bool bothsd=true, bool forcesub=false)
 Extend the basis set till the CBS limit.
 
double reduce_profile (std::vector< coprof_t > &cpl, ValueType &curval, const ValueType &refval, double tol=0.0, int nred=3, bool saveall=false, bool allelectron=true, bool forcesub=false)
 Reduce the profile until only a single function is left on the highest am shell (polarization / correlation consistence)
 
void reduce_basis (const std::vector< coprof_t > &cbscpl, std::vector< coprof_t > &cpl, int nred=3, bool docontr=true, bool restr=true, double nelcutoff=0.01, double Porth=true, double saveall=false, double tol=0.0, bool allelectron=true, bool forcesub=false)
 
virtual std::vector< size_t > update_contraction (const std::vector< coprof_t > &cpl, double cutoff)=0
 Update the contraction coefficients, return the amount of electrons in each am shell.
 
BasisSetLibrary contract_basis (const std::vector< coprof_t > &cpl, const ValueType &refval, double tol, double nelcutoff, bool Porth=true, bool restr=true)
 Contract basis set. nel holds amount of states of each angular momentum. P toggles intermediate P-orthogonalization; returned basis is always generally contracted.
 

Private Member Functions

virtual double compute_energy (const std::vector< coprof_t > &cpl)=0
 Compute the energy.
 
virtual BasisSetLibrary form_basis (const std::vector< coprof_t > &cpl, std::vector< size_t > contract, bool Porth=true)
 Form a contracted basis set. Porth toggles P-orthogonalization. More...
 
virtual void update_reference (const std::vector< coprof_t > &cpl)
 Update reference wave function. More...
 
void mog_decompose (const std::vector< int > &tram, const arma::vec &mogs, std::vector< arma::uvec > &amidx, std::vector< arma::vec > &ammog) const
 Decompose vectorized mogs per angular momentum.
 

Private Attributes

int n_tau
 Moment of profile to optimize.
 
int n_full
 Amount of fully optimized exponents on each end.
 
size_t politer
 Iteration number (for saving out polarization and stability scans)
 

Detailed Description

template<typename ValueType>
class CompletenessOptimizer< ValueType >

Completeness optimizer class.

Constructor & Destructor Documentation

template<typename ValueType >
CompletenessOptimizer< ValueType >::CompletenessOptimizer ( )
inline

Constructor.

Optimize area

4 fully optimized exponents

Iteration number

Member Function Documentation

template<typename ValueType >
double CompletenessOptimizer< ValueType >::check_polarization ( std::vector< coprof_t > &  cpl,
ValueType &  curval,
int  am_max,
double  minpol,
double  maxpol,
double  dpol,
bool  polinterp,
double  cotol,
int  nx,
bool  forcesub = false 
)
inline

Compute the mog of a new polarization shell. Returns maximal mog. cpl and curval are modified.

Parameters am_max: maximal angular momentum allowed minpol: ~ minimal allowed value for polarization exponent (log10 scale) maxpol: ~ maximal allowed value for polarization exponent (log10 scale) dpol: amount of points used per completeness range polinterp: toggle interpolation of mog to find maximum cotol: deviation from completeness nx: amounts of exponents to place on the shell forcesub: force the subset composition: ..., d subset p, p subset s

template<typename ValueType >
virtual BasisSetLibrary CompletenessOptimizer< ValueType >::form_basis ( const std::vector< coprof_t > &  cpl,
std::vector< size_t >  contract,
bool  Porth = true 
)
inlineprivatevirtual

Form a contracted basis set. Porth toggles P-orthogonalization.

Dummy declarations

template<typename ValueType >
std::vector<coprof_t> CompletenessOptimizer< ValueType >::initial_profile ( const std::vector< int > &  nshells,
int  nexp,
double  cotol = 1e-4 
)
inline

Generate initial profile by minimizing the energy. Place nexp functions per occupied electronic shell, given with nel argument.

template<typename ValueType >
std::vector<coprof_t> CompletenessOptimizer< ValueType >::initial_profile ( const std::vector< size_t > &  nfuncs,
double  cotol = 1e-4 
)
inline

Generate initial profile by minimizing the energy. Amount of functions of each angular momentum given in nfuncs.

template<typename ValueType >
std::vector<coprof_t> CompletenessOptimizer< ValueType >::initial_profile ( const std::vector< size_t > &  nfuncs,
std::vector< double >  offsets,
double  cotol = 1e-4 
)
inline

Generate initial profile by minimizing the energy. Amount of functions of each angular momentum given in nfuncs. Offset for start given in offsets.

template<typename ValueType >
double CompletenessOptimizer< ValueType >::scan_profile ( std::vector< coprof_t > &  cpl,
ValueType &  curval,
int  npoints,
double  dpol,
double  tol,
bool  allam = true,
bool  bothsd = true,
bool  forcesub = false 
)
inline

Scan stability of an existing shell by placing in an additional exponent.

Parameters scanam: angular momentum to scan npoints: amount of steps to go in each direction dpol: spacing for trials tol: tolerance threshold allam: accept trials for all am at once bothsd: accept trials for steep and diffuse directions simultaneously forcesub: force the subset composition: ..., d subset p, p subset s

template<typename ValueType >
virtual void CompletenessOptimizer< ValueType >::update_reference ( const std::vector< coprof_t > &  cpl)
inlineprivatevirtual

Update reference wave function.

Dummy declaration


The documentation for this class was generated from the following file: