MADNESS  0.10.1
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
madness::PNO Class Reference

#include <PNO.h>

Inheritance diagram for madness::PNO:
Inheritance graph
[legend]
Collaboration diagram for madness::PNO:
Collaboration graph
[legend]

Public Types

typedef std::shared_ptr< operatorTpoperatorT
 

Public Member Functions

 PNO (World &world, const Nemo &nemo, const PNOParameters &parameters, const F12Parameters &paramf12)
 
PNOPairs adaptive_solver (PNOPairs &pairs) const
 Solve with adaptive solver descriped in the JPC paper. More...
 
void canonicalize (PNOPairs &v) const
 
void check_orthonormality (const vector_real_function_3d &v) const
 
vector_real_function_3d compute_CIS_potentials (const vector_real_function_3d &xcis) const
 get the CIS potentials without Fock residue, i.e Q(2tJ - 2tK)|i> , with transformed K and J More...
 
PairEnergies compute_cispd_correction_es (const vector_real_function_3d &xcis, PNOPairs &pairs) const
 
PairEnergies compute_cispd_correction_gs (const vector_real_function_3d &xcis, const PNOPairs &pairs) const
 
PairEnergies compute_cispd_f12_correction_es (const vector_real_function_3d &xcis, PairEnergies &energies) const
 only the f12 part of the excited state correction of CIS(D) (namely the terms s2b and s2c) More...
 
PairEnergies compute_cispd_f12_correction_gs (const vector_real_function_3d &xcis, PairEnergies &energies) const
 The f12 part of the ground state correction of CIS(D) (s4a, s4b, s4c) More...
 
Tensor< double > compute_cispd_fluctuation_matrix (const ElectronPairIterator &it, PNOPairs &pairs) const
 
PNOPairs compute_cispd_fluctuation_potential (const ElectronPairIterator &it, PNOPairs &pairs) const
 Compute the CIS(D) fluctuation potential of a specific pair. More...
 
Tensor< double > compute_fluctuation_matrix (const ElectronPairIterator &it, const vector_real_function_3d &pnos, const vector_real_function_3d &Kpnos_in=vector_real_function_3d()) const
 
PNOPairs compute_fluctuation_potential (const ElectronPairIterator &it, PNOPairs &pairs) const
 Compute the MP2 fluctuation potential of a speficif pair. More...
 
PairEnergies compute_projected_mp2_energies (PNOPairs &pairs) const
 
template<typename projector >
vector_real_function_3d compute_V_aj_i (const real_function_3d &moi, const real_function_3d &moj, const vector_real_function_3d &virtuals, const projector &Qpr) const
 
template<typename projector >
vector_real_function_3d compute_Vreg_aj_i (const real_function_3d &moi, const real_function_3d &moj, const vector_real_function_3d &virtuals, const projector &Qpr, const vector_real_function_3d &Kpno=vector_real_function_3d()) const
 
vector_real_function_3d compute_Vreg_aj_i (const size_t &i, const size_t &j, const vector_real_function_3d &virtuals, const vector_real_function_3d &Kpno) const
 
vector_real_function_3d compute_Vreg_aj_i_commutator_response (const real_function_3d &moi, const real_function_3d &moj, const vector_real_function_3d &virtuals, const vector_real_function_3d &Vx) const
 
vector_real_function_3d compute_Vreg_aj_i_fock_residue (const real_function_3d &ket1, const real_function_3d &ket2, const vector_real_function_3d &virtuals) const
 
EnergyType energytype () const
 convenience More...
 
PNOPairs freeze_insignificant_pairs (PNOPairs &pairs) const
 
std::pair< size_t, size_t > get_average_rank (const std::valarray< vector_real_function_3d > &va) const
 compute the average and the maximum rank of a set of PNOs More...
 
PNOPairs grow_rank (PNOPairs &pairs, std::string exop) const
 
vector_real_function_3d guess_virtuals (const vector_real_function_3d &f=vector_real_function_3d(), const GuessType &inpgt=UNKNOWN_GUESSTYPE) const
 
PNOPairs initialize_pairs (PNOPairs &pairs, const GuessType &inpgt=UNKNOWN_GUESSTYPE) const
 
bool is_guess_from_scratch (const PairType &ct) const
 
PNOPairs iterate_pairs (PNOPairs &pairs) const
 
PNOPairs iterate_pairs_internal (PNOPairs &pairs, const int maxiter, const double econv) const
 
PNOPairs load_pnos (PNOPairs &pairs) const
 load PNOs from disc More...
 
std::vector< poperatorTmake_bsh_operators (World &world, const tensorT &evals) const
 Convenience function to initialize all bsh operators. More...
 
size_t nact () const
 
std::string name () const
 
size_t nocc () const
 convenience More...
 
OrbitalIterator oit () const
 convenience More...
 
PNOPairs orthonormalize_cholesky (PNOPairs &pairs) const
 convenience More...
 
ElectronPairIterator pit () const
 
std::valarray< Tensor< double > > pno_compress (PNOPairs &pairs, const double tpno) const
 Compress the PNOs -> lose all PNOs which eigenvalue is below tpno. More...
 
void print_ranks (const PNOPairs &pairs) const
 Print information about the PNO rank of all pairs (i.e. the number of PNO functions) More...
 
void save_pnos (const PNOPairs &pairs) const
 save PNOs on disc More...
 
virtual bool selftest ()
 
void solve () const
 
void solve (std::vector< PNOPairs > &all_pairs) const
 Solve for the PairType that is given. More...
 
std::vector< PNOPairssolve_cispd (std::vector< PNOPairs > &pairs) const
 solve the PNO-CIS(D) equations More...
 
PNOPairs solve_mp2 (PNOPairs &pairs) const
 
void solve_mp2 (std::vector< PNOPairs > &pairs) const
 solve PNO-MP2 equations More...
 
PairEnergies t_solve (PNOPairs &pairs, const Tensor< double > &F_occ, const double R_convergence_threshold=1e-6, const size_t max_niter=100) const
 solve the MP2 and CIS(D) amplitude equations More...
 
PNOPairs transform_pairs (PNOPairs &pairs, const std::valarray< Tensor< double > > &U_ij) const
 transform the pnos and all the intermediates/potentials and matrices stored in the PNOPair structure More...
 
PNOPairs truncate_pair_ranks (PNOPairs &pairs) const
 Truncate the ranks of pairs to the given maxrank. More...
 
PNOPairs truncate_pairs (PNOPairs &pairs) const
 
void update_fluctuation_potentials (PNOPairs &pairs) const
 compute all fluctuation potentials and store them in the pair structure More...
 
bool update_pno (PNOPairs &pairs, const std::valarray< Tensor< double > > &rdm_evals_ij, const Tensor< double > &F_occ) const
 

Static Public Member Functions

static void help ()
 
static void print_parameters ()
 

Public Attributes

BasisFunctions basis
 class which holds all methods to read or create guess functions for PNO or CABS More...
 
Fock< double, 3 > F
 
F12Potentials f12
 
Coulomb< double, 3 > J
 
ParametrizedExchange K
 
CCMessenger msg
 
Nemo nemo
 
PNOParameters param
 calculation parameters More...
 
std::shared_ptr< real_convolution_3dpoisson
 
QProjector< double, 3 > Q
 
Kinetic< double, 3 > T
 
Nuclear< double, 3 > V
 
Worldworld
 

Member Typedef Documentation

◆ poperatorT

typedef std::shared_ptr<operatorT> madness::PNO::poperatorT

Constructor & Destructor Documentation

◆ PNO()

madness::PNO::PNO ( World world,
const Nemo nemo,
const PNOParameters parameters,
const F12Parameters paramf12 
)
inline

Member Function Documentation

◆ adaptive_solver()

PNOPairs madness::PNO::adaptive_solver ( PNOPairs pairs) const

◆ canonicalize()

void madness::PNO::canonicalize ( PNOPairs v) const
Parameters
[in,out]Aon input = real symmetric matrix, on output = diagonal matrix of eigenvalues (from smallest to largest)
[in,out]von input = basis in which input A is represented, on output = the eigenbasis of A

References madness::PNOPairs::F_ij, madness::PNOPairs::npairs, PAIRLOOP, madness::PNOPairs::pno_ij, madness::PNOPairs::rdm_evals_ij, madness::syev(), and transform_pairs().

Referenced by iterate_pairs_internal().

◆ check_orthonormality()

void madness::PNO::check_orthonormality ( const vector_real_function_3d v) const

◆ compute_CIS_potentials()

vector_real_function_3d madness::PNO::compute_CIS_potentials ( const vector_real_function_3d xcis) const

get the CIS potentials without Fock residue, i.e Q(2tJ - 2tK)|i> , with transformed K and J

References madness::F12Potentials::acmos, f12, J, K, param, poisson, Q, madness::PNOParameters::thresh(), madness::truncate(), and world.

Referenced by iterate_pairs_internal().

◆ compute_cispd_correction_es()

PairEnergies madness::PNO::compute_cispd_correction_es ( const vector_real_function_3d xcis,
PNOPairs pairs 
) const

◆ compute_cispd_correction_gs()

PairEnergies madness::PNO::compute_cispd_correction_gs ( const vector_real_function_3d xcis,
const PNOPairs pairs 
) const

◆ compute_cispd_f12_correction_es()

PairEnergies madness::PNO::compute_cispd_f12_correction_es ( const vector_real_function_3d xcis,
PairEnergies energies 
) const

◆ compute_cispd_f12_correction_gs()

PairEnergies madness::PNO::compute_cispd_f12_correction_gs ( const vector_real_function_3d xcis,
PairEnergies energies 
) const

◆ compute_cispd_fluctuation_matrix()

Tensor< double > madness::PNO::compute_cispd_fluctuation_matrix ( const ElectronPairIterator it,
PNOPairs pairs 
) const

◆ compute_cispd_fluctuation_potential()

PNOPairs madness::PNO::compute_cispd_fluctuation_potential ( const ElectronPairIterator it,
PNOPairs pairs 
) const

◆ compute_fluctuation_matrix()

Tensor< double > madness::PNO::compute_fluctuation_matrix ( const ElectronPairIterator it,
const vector_real_function_3d pnos,
const vector_real_function_3d Kpnos_in = vector_real_function_3d() 
) const

◆ compute_fluctuation_potential()

PNOPairs madness::PNO::compute_fluctuation_potential ( const ElectronPairIterator it,
PNOPairs pairs 
) const

◆ compute_projected_mp2_energies()

madness::PairEnergies madness::PNO::compute_projected_mp2_energies ( PNOPairs pairs) const

◆ compute_V_aj_i()

template<typename projector >
vector_real_function_3d madness::PNO::compute_V_aj_i ( const real_function_3d moi,
const real_function_3d moj,
const vector_real_function_3d virtuals,
const projector &  Qpr 
) const

the terms are expanded as follows: Q (-J1 +K1) | i(1) > < a(2) | j(2) >

  • Q | i(1) > < a(2) | -J(2) + K(2) | j(2) >
  • i(1) * \int \dr2 1/|r12| a(2) j(2) the first line is zero due to orthogonality of a and j, the second line is zero due to action of Q on i

References madness::apply(), madness::PNOParameters::f12(), MADNESS_ASSERT, madness::mul(), param, poisson, madness::PNOParameters::thresh(), madness::truncate(), and world.

Referenced by compute_cispd_fluctuation_potential(), and compute_fluctuation_potential().

◆ compute_Vreg_aj_i() [1/2]

template<typename projector >
vector_real_function_3d madness::PNO::compute_Vreg_aj_i ( const real_function_3d moi,
const real_function_3d moj,
const vector_real_function_3d virtuals,
const projector &  Qpr,
const vector_real_function_3d Kpno = vector_real_function_3d() 
) const

◆ compute_Vreg_aj_i() [2/2]

vector_real_function_3d madness::PNO::compute_Vreg_aj_i ( const size_t &  i,
const size_t &  j,
const vector_real_function_3d virtuals,
const vector_real_function_3d Kpno 
) const

◆ compute_Vreg_aj_i_commutator_response()

vector_real_function_3d madness::PNO::compute_Vreg_aj_i_commutator_response ( const real_function_3d moi,
const real_function_3d moj,
const vector_real_function_3d virtuals,
const vector_real_function_3d Vx 
) const

◆ compute_Vreg_aj_i_fock_residue()

vector_real_function_3d madness::PNO::compute_Vreg_aj_i_fock_residue ( const real_function_3d ket1,
const real_function_3d ket2,
const vector_real_function_3d virtuals 
) const

◆ energytype()

EnergyType madness::PNO::energytype ( ) const
inline

◆ freeze_insignificant_pairs()

PNOPairs madness::PNO::freeze_insignificant_pairs ( PNOPairs pairs) const

change the state of insignificant pairs to frozen This is based on:

  1. External Parameters (are some pairs demanded to be frozen)
  2. Energies (if the current energy is significantly below the MRA threshold there is no point in further optimizing)
  3. Spatial overlapp (if the norm of the product of the originating MOs is small: i.e. if ||(phi_i)*(phi_j)||_2 is small then pair_ij is insignificant)

freeze pairs which do not contribute significantly frozen pairs will not be further optimized

References madness::PNOParameters::active_pairs_of_orbital(), madness::PNOParameters::econv_pairs(), madness::PairEnergies::eij, madness::PNOPairs::energies, madness::PNOParameters::freeze(), madness::PNOParameters::freeze_pairs(), madness::PNOParameters::freeze_pairs_of_orbital(), madness::PNOPairs::frozen_ij, msg, madness::PNOPairs::name(), PAIRLOOP, param, madness::PNOParameters::thresh(), and madness::PairEnergies::update().

Referenced by adaptive_solver().

◆ get_average_rank()

std::pair< size_t, size_t > madness::PNO::get_average_rank ( const std::valarray< vector_real_function_3d > &  va) const

compute the average and the maximum rank of a set of PNOs

References max, madness::sum(), and v.

Referenced by main(), solve_cispd(), and solve_mp2().

◆ grow_rank()

PNOPairs madness::PNO::grow_rank ( PNOPairs pairs,
std::string  exop 
) const

◆ guess_virtuals()

vector_real_function_3d madness::PNO::guess_virtuals ( const vector_real_function_3d f = vector_real_function_3d(),
const GuessType inpgt = UNKNOWN_GUESSTYPE 
) const

◆ help()

static void madness::PNO::help ( )
inlinestatic

References madness::print(), and madness::print_header2().

Referenced by main().

◆ initialize_pairs()

PNOPairs madness::PNO::initialize_pairs ( PNOPairs pairs,
const GuessType inpgt = UNKNOWN_GUESSTYPE 
) const

◆ is_guess_from_scratch()

bool madness::PNO::is_guess_from_scratch ( const PairType ct) const
inline

◆ iterate_pairs()

PNOPairs madness::PNO::iterate_pairs ( PNOPairs pairs) const

◆ iterate_pairs_internal()

PNOPairs madness::PNO::iterate_pairs_internal ( PNOPairs pairs,
const int  maxiter,
const double  econv 
) const

The actual function which interates the pairs Guess functions have to be created before

References std::abs(), madness::F12Potentials::acmos, madness::ALL_PAIRTYPE, canonicalize(), madness::PNOParameters::canonicalize_pno(), madness::PNOParameters::chunk(), madness::PNOPairs::cis, madness::CISPD_PAIRTYPE, compute_CIS_potentials(), compute_cispd_fluctuation_matrix(), compute_fluctuation_matrix(), dist(), std::distance(), madness::PNOPairs::energies, energy, madness::PNOPairs::extract(), F, f12, madness::PNOPairs::F_ij, madness::PNOParameters::freeze(), madness::PNOPairs::frozen_ij, madness::Nemo::get_calc(), madness::get_size(), ij(), PNOTensors::Tensor_IJ_IK< T >::is_initialized(), PNOTensors::Tensor_IJ_KJ< T >::is_initialized(), J, k, K, madness::PNOPairs::Kpno_ij, madness::CISData::Kx, MADNESS_ASSERT, MADNESS_EXCEPTION, madness::matrix_inner(), maxiter, madness::PNOParameters::maxiter(), madness::PNOPairs::maxranks_ij, madness::PNOPairs::meminfo, msg, madness::PNOPairs::name(), nemo, madness::PNOParameters::no_compute(), madness::PNOParameters::no_opt(), madness::PNOParameters::no_opt_in_first_iteration(), madness::F12Potentials::npairs(), madness::CISData::number, oit(), omega, madness::CISData::omega, orthonormalize_cholesky(), PAIRLOOP, param, pit(), madness::F12Potentials::pit(), pno_compress(), madness::PNOPairs::pno_ij, madness::MyTimer::print(), madness::print(), print_ranks(), madness::World::rank(), madness::PNOPairs::rdm_evals_ij, madness::PNOPairs::reassemble(), PNOTensors::Tensor_IJ_IK< T >::reset(), PNOTensors::Tensor_IJ_KJ< T >::reset(), madness::PNOParameters::restart(), madness::PNOPairs::S_ij_ik, madness::PNOPairs::S_ij_kj, save_pnos(), PNOTensors::Tensor_IJ_IK< T >::set(), PNOTensors::Tensor_IJ_KJ< T >::set(), madness::MyTimer::start(), madness::MyTimer::stop(), madness::CCMessenger::subsection(), T, madness::PNOPairs::t_ij, t_solve(), TIMER, madness::PairEnergies::total_energy(), madness::PNOParameters::tpno(), madness::PNOParameters::tpno_tight(), madness::ElectronPairIterator::tridx(), truncate_pairs(), madness::PNOPairs::type, update_fluctuation_potentials(), madness::PNOPairs::update_meminfo(), update_pno(), V, madness::PNOPairs::verify(), madness::CISData::Vx, madness::PNOPairs::W_ij, madness::PNOPairs::W_ij_i, madness::PNOPairs::W_ij_j, madness::wall_time(), world, and madness::CISData::x.

Referenced by adaptive_solver(), and iterate_pairs().

◆ load_pnos()

PNOPairs madness::PNO::load_pnos ( PNOPairs pairs) const

◆ make_bsh_operators()

std::vector< PNO::poperatorT > madness::PNO::make_bsh_operators ( World world,
const tensorT evals 
) const

◆ nact()

size_t madness::PNO::nact ( ) const
inline

◆ name()

std::string madness::PNO::name ( ) const
inlinevirtual

◆ nocc()

size_t madness::PNO::nocc ( ) const
inline

convenience

References madness::Nemo::get_calc(), and nemo.

Referenced by solve_cispd(), and solve_mp2().

◆ oit()

OrbitalIterator madness::PNO::oit ( ) const
inline

◆ orthonormalize_cholesky()

PNOPairs madness::PNO::orthonormalize_cholesky ( PNOPairs pairs) const

◆ pit()

ElectronPairIterator madness::PNO::pit ( ) const
inline

◆ pno_compress()

std::valarray< Tensor< double > > madness::PNO::pno_compress ( PNOPairs pairs,
const double  tpno 
) const

◆ print_parameters()

static void madness::PNO::print_parameters ( )
inlinestatic

◆ print_ranks()

void madness::PNO::print_ranks ( const PNOPairs pairs) const

Print information about the PNO rank of all pairs (i.e. the number of PNO functions)

References madness::PNOPairs::frozen_ij, max, msg, name(), madness::PNOPairs::name(), PAIRLOOP, madness::PNOPairs::pno_ij, and madness::sum().

Referenced by iterate_pairs(), and iterate_pairs_internal().

◆ save_pnos()

void madness::PNO::save_pnos ( const PNOPairs pairs) const

◆ selftest()

virtual bool madness::PNO::selftest ( )
inlinevirtual

◆ solve() [1/2]

void madness::PNO::solve ( ) const
inline

solves whatever was specified in input will call solve_mp2, solve_cispd etc

Referenced by main().

◆ solve() [2/2]

void madness::PNO::solve ( std::vector< PNOPairs > &  all_pairs) const

◆ solve_cispd()

std::vector< PNOPairs > madness::PNO::solve_cispd ( std::vector< PNOPairs > &  pairs) const

◆ solve_mp2() [1/2]

PNOPairs madness::PNO::solve_mp2 ( PNOPairs pairs) const

◆ solve_mp2() [2/2]

void madness::PNO::solve_mp2 ( std::vector< PNOPairs > &  pairs) const
inline

solve PNO-MP2 equations

References madness::F12Potentials::acmos, f12, and madness::MP2_PAIRTYPE.

Referenced by solve(), and solve_cispd().

◆ t_solve()

madness::PairEnergies madness::PNO::t_solve ( PNOPairs pairs,
const Tensor< double > &  F_occ,
const double  R_convergence_threshold = 1e-6,
const size_t  max_niter = 100 
) const

◆ transform_pairs()

PNOPairs madness::PNO::transform_pairs ( PNOPairs pairs,
const std::valarray< Tensor< double > > &  U_ij 
) const

◆ truncate_pair_ranks()

PNOPairs madness::PNO::truncate_pair_ranks ( PNOPairs pairs) const

Truncate the ranks of pairs to the given maxrank.

References madness::PNOPairs::clear_intermediates(), madness::PNOPairs::maxranks_ij, msg, PAIRLOOP, and madness::PNOPairs::pno_ij.

◆ truncate_pairs()

PNOPairs madness::PNO::truncate_pairs ( PNOPairs pairs) const

◆ update_fluctuation_potentials()

void madness::PNO::update_fluctuation_potentials ( PNOPairs pairs) const

◆ update_pno()

bool madness::PNO::update_pno ( PNOPairs pairs,
const std::valarray< Tensor< double > > &  rdm_evals_ij,
const Tensor< double > &  F_occ 
) const

Update all PNOs: i.e. compute Fock-residue potential (V+2J-K, K is reused if Kpno_ij intermeidate in pairs is initialized) and apply the Green's function The fluctuation potentials have to be precomputed and stored in the pairs structure

References a, madness::append(), madness::apply(), b, c, madness::PNOParameters::chunk(), madness::PNOPairs::cis, madness::CISPD_PAIRTYPE, madness::PNOPairs::clear_intermediates(), madness::PNOParameters::dconv(), madness::PNOParameters::debug(), dist(), std::distance(), e(), madness::PNOPairs::extract(), f12, madness::PNOPairs::F_ij, madness::PNOPairs::frozen_ij, PNOTensors::Tensor_IJ_IK< T >::get(), PNOTensors::Tensor_IJ_KJ< T >::get(), madness::get_size(), ij(), madness::inner(), PNOTensors::Tensor_IJ_IK< T >::is_initialized(), PNOTensors::Tensor_IJ_KJ< T >::is_initialized(), J, k, K, madness::PNOPairs::Kpno_ij, MADNESS_ASSERT, make_bsh_operators(), msg, madness::PNOPairs::name(), madness::PNOPairs::nocc, oit(), omega, madness::CISData::omega, PAIRLOOP, param, pit(), madness::F12Potentials::pit(), madness::PNOPairs::pno_ij, madness::timer::print(), madness::print(), Q, madness::World::rank(), madness::PNOPairs::reassemble(), PNOTensors::Tensor_IJ_IK< T >::reset(), PNOTensors::Tensor_IJ_KJ< T >::reset(), madness::PNOPairs::S_ij_ik, madness::PNOPairs::S_ij_kj, madness::scale(), PNOTensors::Tensor_IJ_IK< T >::set(), PNOTensors::Tensor_IJ_KJ< T >::set(), T, madness::PNOPairs::t_ij, TIMER, madness::ElectronPairIterator::tridx(), madness::truncate(), madness::ParametrizedExchange::type, madness::PNOPairs::type, V, madness::PNOPairs::W_ij, madness::PNOPairs::W_ij_i, madness::PNOPairs::W_ij_j, madness::wall_time(), and world.

Referenced by iterate_pairs_internal().

Member Data Documentation

◆ basis

BasisFunctions madness::PNO::basis

class which holds all methods to read or create guess functions for PNO or CABS

Referenced by grow_rank(), and guess_virtuals().

◆ F

Fock<double,3> madness::PNO::F

Referenced by iterate_pairs_internal().

◆ f12

F12Potentials madness::PNO::f12

◆ J

Coulomb<double,3> madness::PNO::J

◆ K

ParametrizedExchange madness::PNO::K

◆ msg

CCMessenger madness::PNO::msg

◆ nemo

Nemo madness::PNO::nemo

◆ param

PNOParameters madness::PNO::param

◆ poisson

std::shared_ptr<real_convolution_3d> madness::PNO::poisson

◆ Q

QProjector<double, 3> madness::PNO::Q

◆ T

Kinetic<double, 3> madness::PNO::T

◆ V

Nuclear<double,3> madness::PNO::V

◆ world

World& madness::PNO::world

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