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

#include <CC2.h>

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

Public Member Functions

 CC2 (World &world_, const commandlineparser &parser, const std::shared_ptr< Nemo > nemo_)
 
virtual ~CC2 ()
 
bool check_core_valence_separation (const Tensor< double > &fmat) const
 
double compute_mp3 (const Pairs< CCPair > &mp2pairs) const
 
Tensor< double > enforce_core_valence_separation (const Tensor< double > &fmat)
 
bool initialize_pairs (Pairs< CCPair > &pairs, const CCState ftype, const CalcType ctype, const CC_vecfunction &tau, const CC_vecfunction &x, const size_t extitation, const Info &info) const
 read pairs from file or initialize new ones More...
 
CC_vecfunction initialize_singles (const FuncType type, const int ex=-1) const
 read singles from file or initialize new ones More...
 
bool iterate_adc2_pairs (Pairs< CCPair > &cispd, const CC_vecfunction &ccs)
 
bool iterate_adc2_singles (Pairs< CCPair > &mp2, CC_vecfunction &singles, Pairs< CCPair > &x, Info &info)
 
bool iterate_ccs_singles (CC_vecfunction &x, Info &info) const
 
bool iterate_pair (CCPair &pair, const CC_vecfunction &singles=CC_vecfunction(UNDEFINED)) const
 Iterates a pair of the CC2 doubles equations. More...
 
std::string name () const
 
void output_calc_info_schema (const std::string model, const double &energy) const
 
void plot (const real_function_3d &f, const std::string &msg="unspecified function") const
 
virtual bool selftest ()
 
void solve ()
 solve the CC2 ground state equations, returns the correlation energy More...
 
double solve_cc2 (CC_vecfunction &tau, Pairs< CCPair > &u, Info &info) const
 
std::vector< CC_vecfunctionsolve_ccs () const
 
double solve_cispd (Pairs< CCPair > &doubles, const Pairs< CCPair > &mp2_pairs, const CC_vecfunction &cis_singles)
 
std::tuple< Pairs< CCPair >, CC_vecfunction, double > solve_lrcc2 (Pairs< CCPair > &gs_doubles, const CC_vecfunction &gs_singles, const CC_vecfunction &cis, const std::size_t excitation, Info &info) const
 solve the excited state LR-CC2 equations for a given excitation More...
 
double solve_mp2_coupled (Pairs< CCPair > &doubles, Info &info)
 
void store_singles (const CC_vecfunction &singles, const int ex=-1) const
 store singles to file More...
 
bool update_constant_part_adc2 (const CC_vecfunction &ccs, CCPair &pair)
 
bool update_constant_part_cc2_gs (const CC_vecfunction &tau, CCPair &pair)
 
bool update_constant_part_cispd (const CC_vecfunction &ccs, CCPair &pair)
 
bool update_constant_part_lrcc2 (CCPair &pair, const CC_vecfunction &tau, const CC_vecfunction &x)
 
double value ()
 
double value (const Tensor< double > &x)
 Should return the value of the objective function. More...
 
- Public Member Functions inherited from madness::OptimizationTargetInterface
virtual ~OptimizationTargetInterface ()
 
virtual Tensor< double > gradient (const Tensor< double > &x)
 Should return the derivative of the function. More...
 
virtual bool provides_gradient () const
 Override this to return true if the derivative is implemented. More...
 
double test_gradient (Tensor< double > &x, double value_precision, bool doprint=true)
 Numerical test of the derivative ... optionally prints to stdout, returns max abs error. More...
 
virtual void value_and_gradient (const Tensor< double > &x, double &value, Tensor< double > &gradient)
 Reimplement if more efficient to evaluate both value and gradient in one call. More...
 

Static Public Member Functions

static Pairs< real_function_6dcompute_local_coupling (const Pairs< real_function_6d > &pairs, const Info &info)
 add the coupling terms for local MP2 More...
 
static Pairs< real_function_6dcompute_local_coupling (const std::vector< CCPair > &vpairs, const Info &info)
 forward to the other function (converting CCPair to real_function) More...
 
static std::vector< real_function_3dcompute_local_coupling (const std::vector< real_function_3d > &singles, const Info &info)
 compute the coupling of singles function if orbitals are localized More...
 
static void help ()
 
static bool iterate_cc2_singles (World &world, CC_vecfunction &singles, Pairs< CCPair > &doubles, Info &info)
 
static bool iterate_lrcc2_pairs (World &world, const CC_vecfunction &cc2_s, const CC_vecfunction lrcc2_s, Pairs< CCPair > &lrcc2_d, const Info &info)
 
static bool iterate_lrcc2_singles (World &world, const CC_vecfunction &cc2_s, Pairs< CCPair > &cc2_d, CC_vecfunction &lrcc2_s, Pairs< CCPair > lrcc2_d, Info &info)
 
static bool iterate_singles (World &world, CC_vecfunction &singles, const CC_vecfunction singles2, Pairs< CCPair > &gs_doubles, Pairs< CCPair > &ex_doubles, const CalcType ctype, const std::size_t maxiter, Info &info)
 
static void print_parameters ()
 
static void update_reg_residues_ex (World &world, const CC_vecfunction &singles, const CC_vecfunction &response, Pairs< CCPair > &doubles, const Info &info)
 
static void update_reg_residues_gs (World &world, const CC_vecfunction &singles, Pairs< CCPair > &doubles, const Info &info)
 

Public Attributes

CCPotentials CCOPS
 The CC Operator Class. More...
 
std::shared_ptr< Nemonemo
 The SCF Calculation. More...
 
CCMessengeroutput
 Formated Output (same as used in CC2Potentials structure) More...
 
CCParameters parameters
 Structure holds all the parameters used in the CC2 calculation. More...
 
std::shared_ptr< TDHFtdhf
 The excited state cis calculation. More...
 
PairVectorMap triangular_map
 map Pair struct to vector More...
 
Worldworld
 The World. More...
 

Constructor & Destructor Documentation

◆ CC2()

madness::CC2::CC2 ( World world_,
const commandlineparser parser,
const std::shared_ptr< Nemo nemo_ 
)
inline

◆ ~CC2()

virtual madness::CC2::~CC2 ( )
inlinevirtual

Member Function Documentation

◆ check_core_valence_separation()

bool madness::CC2::check_core_valence_separation ( const Tensor< double > &  fmat) const

◆ compute_local_coupling() [1/3]

Pairs< real_function_6d > madness::CC2::compute_local_coupling ( const Pairs< real_function_6d > &  pairs,
const Info info 
)
static

◆ compute_local_coupling() [2/3]

static Pairs<real_function_6d> madness::CC2::compute_local_coupling ( const std::vector< CCPair > &  vpairs,
const Info info 
)
inlinestatic

forward to the other function (converting CCPair to real_function)

References a, madness::Pairs< T >::convert(), and madness::Pairs< T >::insert().

Referenced by iterate_lrcc2_pairs(), iterate_singles(), solve_cc2(), and solve_mp2_coupled().

◆ compute_local_coupling() [3/3]

static std::vector<real_function_3d> madness::CC2::compute_local_coupling ( const std::vector< real_function_3d > &  singles,
const Info info 
)
inlinestatic

compute the coupling of singles function if orbitals are localized

Returns
the coupling terms c_i = -\sum_(j\neq i) f_ij |\phi_j> (for whatever phi is)

References madness::BaseTensor::dim(), madness::Info::fock, madness::CCParameters::freeze(), MADNESS_CHECK_THROW, madness::Info::parameters, madness::transform(), and world.

◆ compute_mp3()

double madness::CC2::compute_mp3 ( const Pairs< CCPair > &  mp2pairs) const
inline

◆ enforce_core_valence_separation()

Tensor< double > madness::CC2::enforce_core_valence_separation ( const Tensor< double > &  fmat)

◆ help()

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

◆ initialize_pairs()

bool madness::CC2::initialize_pairs ( Pairs< CCPair > &  pairs,
const CCState  ftype,
const CalcType  ctype,
const CC_vecfunction tau,
const CC_vecfunction x,
const size_t  extitation,
const Info info 
) const

◆ initialize_singles()

CC_vecfunction madness::CC2::initialize_singles ( const FuncType  type,
const int  ex = -1 
) const

◆ iterate_adc2_pairs()

bool madness::CC2::iterate_adc2_pairs ( Pairs< CCPair > &  cispd,
const CC_vecfunction ccs 
)

◆ iterate_adc2_singles()

bool madness::CC2::iterate_adc2_singles ( Pairs< CCPair > &  mp2,
CC_vecfunction singles,
Pairs< CCPair > &  x,
Info info 
)
inline

◆ iterate_cc2_singles()

static bool madness::CC2::iterate_cc2_singles ( World world,
CC_vecfunction singles,
Pairs< CCPair > &  doubles,
Info info 
)
inlinestatic

convencience function to iterate the CC2 ground state singles, makes the right call on the iterate_singles functions

References madness::CCIntermediatePotentials::clear_all(), madness::CT_CC2, madness::Info::intermediate_potentials, madness::CCParameters::iter_max_3D(), iterate_singles(), madness::Info::parameters, madness::RESPONSE, and world.

Referenced by solve_cc2().

◆ iterate_ccs_singles()

bool madness::CC2::iterate_ccs_singles ( CC_vecfunction x,
Info info 
) const
inline

convencience function to iterate the CCS Response singles, makes the right call on the iterate_singles functions

References madness::CCIntermediatePotentials::clear_response(), madness::CT_LRCCS, madness::Info::intermediate_potentials, madness::CCParameters::iter_max_3D(), iterate_singles(), madness::Info::parameters, madness::PARTICLE, and world.

Referenced by solve(), and solve_lrcc2().

◆ iterate_lrcc2_pairs()

bool madness::CC2::iterate_lrcc2_pairs ( World world,
const CC_vecfunction cc2_s,
const CC_vecfunction  lrcc2_s,
Pairs< CCPair > &  lrcc2_d,
const Info info 
)
static

◆ iterate_lrcc2_singles()

static bool madness::CC2::iterate_lrcc2_singles ( World world,
const CC_vecfunction cc2_s,
Pairs< CCPair > &  cc2_d,
CC_vecfunction lrcc2_s,
Pairs< CCPair lrcc2_d,
Info info 
)
inlinestatic

◆ iterate_pair()

bool madness::CC2::iterate_pair ( CCPair pair,
const CC_vecfunction singles = CC_vecfunction(UNDEFINED) 
) const

◆ iterate_singles()

static bool madness::CC2::iterate_singles ( World world,
CC_vecfunction singles,
const CC_vecfunction  singles2,
Pairs< CCPair > &  gs_doubles,
Pairs< CCPair > &  ex_doubles,
const CalcType  ctype,
const std::size_t  maxiter,
Info info 
)
inlinestatic

Iterates the singles equations for CCS, CC2, LRCC2 The corresponding regulairzation tails of the doubles are updated in every iteration (therefore doubles are not marked as const)

Parameters
[in]singles, the singles that are iterated
[in]singles2, additional set of singles for potential (in LRCC2 this are the Ground State singles)
[in]gs_doubles, Ground State doubles (Needed for CC2 and LRCC2)
[in]ex_doubles, Excited State doubles (Needed for LRCC2)
[in]ctype: the calculation type: CCS, CC2, CC2_response_
[in]maxiter: maxmial number of iterations
[out]

References madness::assign_name(), bsh_eps, madness::BSHOperatorPtr3D(), compute_local_coupling(), madness::copy(), madness::CT_ADC2, madness::CT_CC2, madness::CT_CISPD, madness::CT_LRCC2, madness::CT_LRCCS, madness::CT_MP2, madness::CT_TEST, madness::CCParameters::dconv_3D(), madness::CCParameters::debug(), madness::WorldGopInterface::fence(), madness::CCParameters::freeze(), madness::CC_vecfunction::functions, G, madness::CC_vecfunction::get_vecfunction(), madness::World::gop, madness::CCTimer::info(), madness::inner(), madness::CCParameters::kain(), madness::CCParameters::lo(), MADNESS_ASSERT, MADNESS_EXCEPTION, maxiter, madness::Info::mo_bra, madness::Info::mo_ket, madness::CC_vecfunction::name(), madness::detail::norm(), madness::norm2(), omega, madness::CC_vecfunction::omega, madness::Info::orbital_energies, output, madness::CCParameters::output_prec(), madness::Info::parameters, madness::PARTICLE, madness::print(), madness::print_size(), Q(), madness::Info::R_square, madness::World::rank(), residual(), madness::RESPONSE, madness::scale(), madness::CC_vecfunction::size(), madness::sub(), madness::CCMessenger::subsection(), madness::Tensor< T >::sum(), madness::CCParameters::thresh_bsh_3D(), madness::truncate(), madness::CC_vecfunction::type, update_reg_residues_ex(), update_reg_residues_gs(), V(), madness::CCMessenger::warning(), and world.

Referenced by iterate_adc2_singles(), iterate_cc2_singles(), iterate_ccs_singles(), and iterate_lrcc2_singles().

◆ name()

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

◆ output_calc_info_schema()

void madness::CC2::output_calc_info_schema ( const std::string  model,
const double &  energy 
) const

References energy, nemo, madness::World::rank(), and world.

Referenced by solve().

◆ plot()

void madness::CC2::plot ( const real_function_3d f,
const std::string &  msg = "unspecified function" 
) const
inline

◆ print_parameters()

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

◆ selftest()

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

◆ solve()

void madness::CC2::solve ( )

◆ solve_cc2()

double madness::CC2::solve_cc2 ( CC_vecfunction tau,
Pairs< CCPair > &  u,
Info info 
) const

◆ solve_ccs()

std::vector< CC_vecfunction > madness::CC2::solve_ccs ( ) const

◆ solve_cispd()

double madness::CC2::solve_cispd ( Pairs< CCPair > &  doubles,
const Pairs< CCPair > &  mp2_pairs,
const CC_vecfunction cis_singles 
)

◆ solve_lrcc2()

std::tuple< Pairs< CCPair >, CC_vecfunction, double > madness::CC2::solve_lrcc2 ( Pairs< CCPair > &  gs_doubles,
const CC_vecfunction gs_singles,
const CC_vecfunction cis,
const std::size_t  excitation,
Info info 
) const

solve the excited state LR-CC2 equations for a given excitation

Parameters
[in]gs_doublesthe ground state doubles
[in]gs_singlesthe ground state singles
[in]cisthe CIS singles
[in]excitationthe excitation number
Returns
a tuple with the excited state doubles, the excited state singles and the excitation energy

References madness::copy(), madness::CT_LRCC2, madness::CCTimer::current_time(), madness::EXCITED_STATE, initialize_pairs(), madness::CCParameters::iter_max(), iterate_ccs_singles(), iterate_lrcc2_pairs(), iterate_lrcc2_singles(), output, parameters, madness::print_header2(), madness::World::rank(), madness::CCMessenger::section(), update_reg_residues_ex(), and world.

Referenced by solve().

◆ solve_mp2_coupled()

double madness::CC2::solve_mp2_coupled ( Pairs< CCPair > &  doubles,
Info info 
)

◆ store_singles()

void madness::CC2::store_singles ( const CC_vecfunction singles,
const int  ex = -1 
) const

store singles to file

◆ update_constant_part_adc2()

bool madness::CC2::update_constant_part_adc2 ( const CC_vecfunction ccs,
CCPair pair 
)
inline

◆ update_constant_part_cc2_gs()

bool madness::CC2::update_constant_part_cc2_gs ( const CC_vecfunction tau,
CCPair pair 
)
inline

◆ update_constant_part_cispd()

bool madness::CC2::update_constant_part_cispd ( const CC_vecfunction ccs,
CCPair pair 
)
inline

◆ update_constant_part_lrcc2()

bool madness::CC2::update_constant_part_lrcc2 ( CCPair pair,
const CC_vecfunction tau,
const CC_vecfunction x 
)
inline

◆ update_reg_residues_ex()

void madness::CC2::update_reg_residues_ex ( World world,
const CC_vecfunction singles,
const CC_vecfunction response,
Pairs< CCPair > &  doubles,
const Info info 
)
static

◆ update_reg_residues_gs()

void madness::CC2::update_reg_residues_gs ( World world,
const CC_vecfunction singles,
Pairs< CCPair > &  doubles,
const Info info 
)
static

◆ value() [1/2]

double madness::CC2::value ( )
inline

References nemo.

◆ value() [2/2]

double madness::CC2::value ( const Tensor< double > &  x)
inlinevirtual

Should return the value of the objective function.

Implements madness::OptimizationTargetInterface.

References solve().

Member Data Documentation

◆ CCOPS

CCPotentials madness::CC2::CCOPS

◆ nemo

std::shared_ptr<Nemo> madness::CC2::nemo

◆ output

CCMessenger& madness::CC2::output

Formated Output (same as used in CC2Potentials structure)

Referenced by CC2(), iterate_adc2_pairs(), iterate_pair(), iterate_singles(), plot(), solve(), solve_cc2(), solve_cispd(), and solve_lrcc2().

◆ parameters

CCParameters madness::CC2::parameters

◆ tdhf

std::shared_ptr<TDHF> madness::CC2::tdhf

The excited state cis calculation.

Referenced by CC2(), solve(), and solve_ccs().

◆ triangular_map

PairVectorMap madness::CC2::triangular_map

map Pair struct to vector

Referenced by iterate_lrcc2_pairs(), solve(), solve_cc2(), and solve_mp2_coupled().

◆ world

World& madness::CC2::world

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