21 class MP3 :
public CCPotentials {
25 : CCPotentials(world,nemo,
param) {}
26 MP3(
const CCPotentials& ops) : CCPotentials(ops) {}
45 std::string msg =
"Unknown partitioning shape: " + shape;
58 const std::vector<int>&,
59 const std::vector<int>&,
60 const std::vector<std::vector<CCPairFunction<double,6>>>& ,
61 const std::vector<Function<double,3>>&,
62 const std::vector<Function<double,3>>&,
68 using resultT =std::shared_ptr<ScalarResult<double>>;
75 const std::vector<int>& ij_vec,
76 const std::vector<int>& j_vec,
83 const std::vector<std::string>& argument)
const {
90 const long nact=mo_ket.size()-parameters.
freeze();
94 bool is_triangular=(j_vec.size()==0);
104 auto ij_to_i_and_j = [&tri_map](
const int ij) {
return tri_map.
map[
ij]; };
105 auto [ii,jj]=ij_to_i_and_j(
ij);
124 else if (diagram==
"ef")
126 else if (diagram==
"ghij")
128 else if (diagram==
"klmn")
131 std::string msg =
"Unknown MP3 diagram: " + diagram;
157 const long i,
const long j,
164 const std::vector<std::string>& argument);
168 const long i,
const long j,
175 const std::vector<std::string>& argument);
181 const long i,
const long j,
188 const std::vector<std::string>& argument);
192 const long i,
const long j,
199 const std::vector<std::string>& argument);
long size() const
Definition: macrotaskpartitioner.h:79
long begin
Definition: macrotaskpartitioner.h:67
Batch_1D result
Definition: macrotaskpartitioner.h:136
std::vector< Batch_1D > input
Definition: macrotaskpartitioner.h:135
a 6D function, either in full or low rank form, possibly including an 2-particle function
Definition: ccpairfunction.h:373
World & world() const
Returns the world.
Definition: mra.h:648
Partitioner(const std::string shape)
Definition: mp3.h:39
helper class for calculating the MP3 energy contributions
Definition: mp3.h:35
resultT operator()(const std::string &diagram, const std::vector< int > &ij_vec, const std::vector< int > &j_vec, const std::vector< std::vector< CCPairFunction< double, 6 >>> &pair_square, const std::vector< Function< double, 3 >> &mo_ket, const std::vector< Function< double, 3 >> &mo_bra, const CCParameters ¶meters, const Molecule &molecule, const Function< double, 3 > &Rsquare, const std::vector< std::string > &argument) const
Definition: mp3.h:74
std::tuple< const std::string &, const std::vector< int > &, const std::vector< int > &, const std::vector< std::vector< CCPairFunction< double, 6 > > > &, const std::vector< Function< double, 3 > > &, const std::vector< Function< double, 3 > > &, const CCParameters &, const Molecule &, const Function< double, 3 > &, const std::vector< std::string > & > argtupleT
Definition: mp3.h:66
std::shared_ptr< ScalarResult< double > > resultT
Definition: mp3.h:68
resultT allocator(World &world, const argtupleT &argtuple) const
Definition: mp3.h:70
MacroTaskMP3(const std::string shape)
Definition: mp3.h:52
double compute_mp3_cd(const Pairs< CCPair > &mp2pairs) const
Definition: mp3.cc:8
double compute_mp3_ef_with_permutational_symmetry(const Pairs< CCPair > &mp2pairs) const
compute the EF term of the MP3 energy with permutational symmetry
Definition: mp3.cc:168
double compute_mp3_klmn_fast(const Pairs< CCPair > &mp2pairs) const
Definition: mp3.cc:467
double compute_mp3_klmn(const Pairs< CCPair > &mp2pairs) const
Definition: mp3.cc:537
double compute_mp3_ghij_fast(const Pairs< CCPair > &mp2pairs, const Pairs< std::vector< CCPairFunction< double, 6 >>> clusterfunctions) const
Definition: mp3.cc:400
MP3(World &world, const std::shared_ptr< Nemo > nemo, const CCParameters ¶m)
Definition: mp3.h:24
double mp3_energy_contribution_macrotask_driver(const Pairs< CCPair > &mp2pairs) const
compute the MP3 energy contribution, macrotask version
Definition: mp3.cc:928
MP3(const CCPotentials &ops)
Definition: mp3.h:26
double mp3_test(const Pairs< CCPair > &mp2pairs, const Pairs< std::vector< CCPairFunction< double, 6 >>> clusterfunctions) const
Definition: mp3.cc:613
double compute_mp3_ef_low_scaling(const Pairs< CCPair > &mp2pairs, const Pairs< std::vector< CCPairFunction< double, 6 >>> clusterfunctions) const
Definition: mp3.cc:253
double compute_mp3_ghij(const Pairs< CCPair > &mp2pairs, const Pairs< std::vector< CCPairFunction< double, 6 >>> clusterfunctions) const
Definition: mp3.cc:317
double compute_mp3_ef_as_overlap(const Pairs< CCPair > &mp2pairs, const Pairs< std::vector< CCPairFunction< double, 6 >>> clusterfunctions) const
double mp3_energy_contribution(const Pairs< CCPair > &mp2pairs) const
Definition: mp3.cc:886
double compute_mp3_ef(const Pairs< CCPair > &mp2pairs) const
Definition: mp3.cc:45
Definition: macrotaskq.h:716
Batch batch
Definition: macrotaskq.h:718
std::shared_ptr< MacroTaskPartitioner > partitioner
Definition: macrotaskq.h:720
partition one (two) vectors into 1D (2D) batches.
Definition: macrotaskpartitioner.h:190
std::size_t dimension
partition one or two vectors
Definition: macrotaskpartitioner.h:199
std::size_t min_batch_size
minimum batch size
Definition: macrotaskpartitioner.h:195
std::size_t max_batch_size
maximum batch size (for memory management)
Definition: macrotaskpartitioner.h:196
Definition: molecule.h:124
helper class for returning the result of a task, which is not a madness Function, but a simple scalar
Definition: macrotaskq.h:43
A parallel world class.
Definition: world.h:132
Declares the macrotaskq and MacroTaskBase classes.
#define MADNESS_CHECK(condition)
Check a condition — even in a release build the condition is always evaluated so it can have side eff...
Definition: madness_exception.h:190
#define MADNESS_EXCEPTION(msg, value)
Macro for throwing a MADNESS exception.
Definition: madness_exception.h:119
Main include file for MADNESS and defines Function interface.
File holds all helper structures necessary for the CC_Operator and CC2 class.
Definition: DFParameters.h:10
Definition: CCStructures.h:199
long freeze() const
Definition: CCStructures.h:355
Definition: CCStructures.h:381
static PairVectorMap triangular_map(const int nfreeze, const int nocc)
Definition: CCStructures.h:387
std::vector< std::pair< int, int > > map
maps pair index (i,j) to vector index k
Definition: CCStructures.h:383
static PairVectorMap quadratic_map(const int nfreeze, const int nocc)
Definition: CCStructures.h:397
Definition: CCStructures.h:421
InputParameters param
Definition: tdse.cc:203
double ij(int64_t i, int64_t j)
Definition: test_distributed_matrix.cc:8
static Molecule molecule
Definition: testperiodicdft.cc:38