10#ifndef CCSTRUCTURES_H_
11#define CCSTRUCTURES_H_
81 ss <<
"memory usage of process "<< world.
rank()<<
" on "<< hostname<<
": "<< mem/1024/1024<<
"MB";
82 std::string msg=ss.str();
83 auto memusage=world.
gop.
concat0(std::vector<std::string>(1,msg));
84 std::sort(memusage.begin(),memusage.end());
85 if (world.
rank()==0)
for (
const auto& msg : memusage)
print(msg);
105 output(
const std::string& msg)
const;
108 section(
const std::string& msg)
const;
114 warning(
const std::string& msg)
const;
122 using madness::operators::operator<<;
160 info(
const bool debug =
true,
const double norm = 12345.6789);
201 void print(
const std::pair<double, double>& times)
const {
203 std::cout << std::setfill(
' ') << std::scientific << std::setprecision(2)
204 <<
"Timer: " << times.first <<
" (Wall), " << times.second <<
" (CPU)" <<
", (" +
operation +
")"
231 double thresh_operators=1.e-6;
232 initialize < std::string > (
"calc_type",
"mp2",
"the calculation type", {
"mp2",
"mp3",
"cc2",
"cis",
"lrcc2",
"cispd",
"adc2",
"test"});
233 initialize < double > (
"lo", 1.e-7,
"the finest length scale to be resolved by 6D operators");
234 initialize < double > (
"dmin", 1.0,
"defines the depth of the special level");
235 initialize < double > (
"thresh_6d",
thresh,
"threshold for the 6D wave function");
236 initialize < double > (
"tight_thresh_6d", 0.1*
thresh,
"tight threshold for the 6D wave function");
237 initialize < double > (
"thresh_3d", 0.01*
thresh,
"threshold for the 3D reference wave function");
238 initialize < double > (
"tight_thresh_3d", 0.001*
thresh,
"tight threshold for the 3D reference wave function");
239 initialize < double > (
"thresh_bsh_3d", thresh_operators,
"threshold for BSH operators");
240 initialize < double > (
"thresh_bsh_6d", thresh_operators,
"threshold for BSH operators");
241 initialize < double > (
"thresh_poisson", thresh_operators,
"threshold for Poisson operators");
242 initialize < double > (
"thresh_f12", thresh_operators,
"threshold for Poisson operators");
243 initialize < double > (
"thresh_Ue", thresh_operators,
"ue threshold");
244 initialize < double > (
"econv",
thresh,
"overal convergence threshold ");
245 initialize < double > (
"econv_pairs", 0.1*
thresh,
"convergence threshold for pairs");
246 initialize < double > (
"dconv_3d", 0.3*
thresh,
"convergence for cc singles");
247 initialize < double > (
"dconv_6d", 3.0*
thresh,
"convergence for cc doubles");
248 initialize < std::size_t > (
"iter_max", 10,
"max iterations");
249 initialize < std::size_t > (
"iter_max_3d", 10,
"max iterations for singles");
250 initialize < std::size_t > (
"iter_max_6d", 10,
"max iterations for doubles");
251 initialize < std::pair<int, int>> (
"only_pair", {-1, -1},
"compute only a single pair");
252 initialize < bool > (
"restart",
false,
"restart");
253 initialize < bool > (
"no_compute",
false,
"no compute");
254 initialize < bool > (
"no_compute_gs",
false,
"no compute");
255 initialize < bool > (
"no_compute_mp2_constantpart",
false,
"no compute");
256 initialize < bool > (
"no_compute_response",
false,
"no compute");
257 initialize < bool > (
"no_compute_mp2",
false,
"no compute");
258 initialize < bool > (
"no_compute_cc2",
false,
"no compute");
259 initialize < bool > (
"no_compute_cispd",
false,
"no compute");
260 initialize < bool > (
"no_compute_lrcc2",
false,
"no compute");
261 initialize < double > (
"corrfac_gamma", 1.0,
"exponent for the correlation factor");
262 initialize < std::size_t > (
"output_prec", 8,
"for formatted output");
263 initialize < bool > (
"debug",
false,
"");
264 initialize < bool > (
"plot",
false,
"");
265 initialize < bool > (
"kain",
true,
"");
266 initialize < std::size_t > (
"kain_subspace", 3,
"");
267 initialize < long > (
"freeze", -1,
"number of frozen orbitals: -1: automatic");
268 initialize < bool > (
"test",
false,
"");
270 initialize < bool > (
"decompose_Q",
true,
"always true",{
true});
274 initialize < bool > (
"QtAnsatz",
true,
"always true",{
true});
276 initialize < std::vector<size_t>>
277 (
"excitations", {},
"vector containing the excitations");
283 std::string value = get<std::string>(
"calc_type");
284 if (value ==
"mp2")
return CT_MP2;
285 if (value ==
"mp3")
return CT_MP3;
286 if (value ==
"cc2")
return CT_CC2;
287 if (value ==
"cis")
return CT_LRCCS;
288 if (value ==
"lrcc2")
return CT_LRCC2;
289 if (value ==
"cispd")
return CT_CISPD;
290 if (value ==
"adc2")
return CT_ADC2;
291 if (value ==
"test")
return CT_TEST;
296 double lo()
const {
return get<double>(
"lo"); }
298 double dmin()
const {
return get<double>(
"dmin"); }
300 double thresh_3D()
const {
return get<double>(
"thresh_3d"); }
304 double thresh_6D()
const {
return get<double>(
"thresh_6d"); }
314 double thresh_f12()
const {
return get<double>(
"thresh_f12"); }
316 double thresh_Ue()
const {
return get<double>(
"thresh_ue"); }
318 double econv()
const {
return get<double>(
"econv"); }
322 double dconv_3D()
const {
return get<double>(
"dconv_3d"); }
324 double dconv_6D()
const {
return get<double>(
"dconv_6d"); }
326 std::size_t
iter_max()
const {
return get<std::size_t>(
"iter_max"); }
328 std::size_t
iter_max_3D()
const {
return get<std::size_t>(
"iter_max_3d"); }
330 std::size_t
iter_max_6D()
const {
return get<std::size_t>(
"iter_max_6d"); }
332 std::pair<int, int>
only_pair()
const {
return get<std::pair<int, int>>(
"only_pair"); }
334 bool restart()
const {
return get<bool>(
"restart"); }
352 bool debug()
const {
return get<bool>(
"debug"); }
354 bool plot()
const {
return get<bool>(
"plot"); }
356 bool kain()
const {
return get<bool>(
"kain"); }
358 bool test()
const {
return get<bool>(
"test"); }
362 bool QtAnsatz()
const {
return get<bool>(
"qtansatz"); }
364 std::size_t
output_prec()
const {
return get<std::size_t>(
"output_prec"); }
366 std::size_t
kain_subspace()
const {
return get<std::size_t>(
"kain_subspace"); }
368 long freeze()
const {
return get<long>(
"freeze"); }
370 std::vector<std::size_t>
excitations()
const {
return get<std::vector<std::size_t>>(
"excitations"); }
372 double gamma()
const {
return get<double>(
"corrfac_gamma");}
381 if (world.
rank() == 0)
382 std::cout <<
"\n\n\n\n\n!!!!!!!!!\n\nERROR IN CC_PARAMETERS:\n ERROR MESSAGE IS: " << msg
383 <<
"\n\n\n!!!!!!!!" << std::endl;
388 if (world.
rank() == 0) std::cout <<
"WARNING IN CC_PARAMETERS!: " << msg << std::endl;
396 std::vector<std::pair<int, int>>
map;
401 std::vector<std::pair<int, int>>
map;
402 for (
int i=nfreeze; i<nocc; ++i) {
403 for (
int j=i; j<nocc; ++j) {
404 map.push_back(std::make_pair(i,j));
411 std::vector<std::pair<int, int>>
map;
412 for (
int i=nfreeze; i<nocc; ++i) {
413 for (
int j=nfreeze; j<nocc; ++j) {
414 map.push_back(std::make_pair(i,j));
420 void print(
const std::string msg=
"PairVectorMap")
const {
423 for (
size_t i=0; i<
map.size(); ++i) {
442 template<
typename R,
typename opT>
445 for (
auto&
p :
arg.allpairs) {
447 int j=
p.first.second;
455 for (
int i=0; i<argument.size(); ++i) {
456 pairs.
insert(map.
map[i].first,map.
map[i].second,argument[i]);
462 std::vector<T> vector;
463 for (
size_t i=0; i<argument.
allpairs.size(); ++i) {
464 vector.push_back(argument(map.
map[i].first,map.
map[i].second));
471 return allpairs.at(std::make_pair(i, j));
479 return allpairs[std::make_pair(i, j)];
485 std::pair<int, int> key = std::make_pair(i, j);
486 allpairs.insert(std::make_pair(key, pair));
495 if (
allpairs.size() == 0)
return true;
501template <
typename T, std::
size_t NDIM>
508template<
typename T, std::
size_t NDIM>
512 for (
const auto& tmp : im.allpairs) {
513 size += get_size<T, NDIM>(tmp.second);
529 for (
size_t i = 0; i <
v.size(); i++) {
531 functions.insert(std::make_pair(i, tmp));
536 for (
size_t i = 0; i <
v.size(); i++) {
543 for (
size_t i = 0; i <
v.size(); i++) {
545 functions.insert(std::make_pair(i, tmp));
553 for (
size_t i = 0; i <
v.size(); i++) {
555 functions.insert(std::make_pair(freeze + i, tmp));
561 for (
auto x:
v)
functions.insert(std::make_pair(x.i, x));
574 if (
this == &other)
return *
this;
591 tmp.
functions.insert(std::make_pair(x.first,
copy(x.second)));
597 for (
auto& x :
functions) x.second.function.reconstruct();
625 template<
typename Archive>
627 typedef std::vector<std::pair<std::size_t, CCFunction<double,3>>> CC_functionvec;
630 return CC_functionvec(map.begin(), map.end());
632 auto vector2map = [] (
const CC_functionvec&
vec) {
637 if (ar.is_input_archive) {
640 CC_functionvec tmp(
size);
642 for (
auto& t : tmp) ar & t.first & t.second;
644 }
else if (ar.is_output_archive) {
647 for (
auto& t : tmp) ar & t.first & t.second;
652 hashT hashval = std::hash<FuncType>{}(
type);
704 for (
size_t i = 0; i <
v.size(); i++) {
706 functions.insert(std::make_pair(freeze + i, tmp));
713 for (
auto x:
functions) tmp.push_back(x.second.function);
724 print_size(
const std::string& msg =
"!?not assigned!?")
const;
729 const size_t freeze =
functions.cbegin()->first;
736 ktmp.second.function.scale(factor);
744 void plot(
const std::string& msg =
"")
const {
746 ktmp.second.plot(msg);
758template<
typename T=
double, std::
size_t NDIM=3>
781 template<
typename archiveT>
810 param.freeze=
a.parameters.freeze;
814 friend std::shared_ptr<CCConvolutionOperator>
combine(
const std::shared_ptr<CCConvolutionOperator>&
a,
815 const std::shared_ptr<CCConvolutionOperator>&
b) {
816 if (
a and (not
b))
return a;
817 if ((not
a) and
b)
return b;
818 if ((not
a) and (not
b))
return nullptr;
826 if (
op)
return ((*
op)(
f)).truncate();
835 std::vector<Function<T, NDIM>> result;
836 if constexpr (
NDIM == 3) {
841 result.push_back(tmpi);
859 return apply<T,T,NDIM,NDIM>(
world, (*
op),
f);
886 std::stringstream ss;
914 for (
const auto& tmp:
imH.allpairs)
915 tmp.second.print_size(
"<H" + std::to_string(tmp.first.first) +
"|" +
name() +
"|H" +
916 std::to_string(tmp.first.second) +
"> intermediate");
918 for (
const auto& tmp:
imP.allpairs)
919 tmp.second.print_size(
"<H" + std::to_string(tmp.first.first) +
"|" +
name() +
"|P" +
920 std::to_string(tmp.first.second) +
"> intermediate");
922 for (
const auto& tmp:
imR.allpairs)
923 tmp.second.print_size(
"<H" + std::to_string(tmp.first.first) +
"|" +
name() +
"|R" +
924 std::to_string(tmp.first.second) +
"> intermediate");
930 factory.set_info(
op->info);
938 std::shared_ptr<SeparatedConvolution<T,NDIM>>
get_op()
const {
return op;};
949 std::shared_ptr<SeparatedConvolution<T,NDIM>>
op;
956 void error(
const std::string& msg)
const {
958 std::cout <<
"\n\n!!!!ERROR in CCConvolutionOperator " <<
name() <<
": " << msg
959 <<
"!!!!!\n\n" << std::endl;
965template<
typename T, std::
size_t NDIM>
1062 for (
const auto&
f :
v) {
1100 std::cout <<
"Intermediate Potential Manager: " << msg <<
"\n";
1116 std::vector<Function<double,3>>
U1;
1153 records+=cloud.
store(world,
U2);
1154 records+=cloud.
store(world,
U1);
1173 U1=cloud.
forward_load<std::vector<Function<double,3>>>(world,recordlist);
1205 std::vector<unsigned char>
v;
1223 std::vector<unsigned char>
v=cloud.
forward_load<std::vector<unsigned char>>(
world,recordlist);
1225 bool function_is_assigned =
false, constant_part_is_initialized=
false;
1226 arin &
type &
ctype &
i &
j &
bsh_eps & function_is_assigned & constant_part_is_initialized;
1263 template<
typename Archive>
1266 bool fexist = (f_size > 0) && (
functions[0].get_function().is_initialized());
1269 if constexpr (Archive::is_input_archive) {
1277 if (fexist) ar &
functions[0].get_function();
1286 if (
f.is_assigned() and
f.is_pure())
f.get_function().
reconstruct();
1291 std::string fname=this->
name();
1292 if (verbose and
world.
rank()==0)
print(
"loading pair from file", fname);
1304 std::string fname =this->
name();
1305 if (verbose and
world.
rank()==0)
print(
"loading pair from file", fname);
1312 hashT hash_i = std::hash<std::size_t>{}(
i);
1334 std::string
name =
"???";
1410 template <
typename T,
size_t NDIM>
1419 if (do_print)
f.print_size(
name);
1420 if (
f.is_compressed()) {
1421 if (
world.
rank()==0 and do_print)
print(
"function is compressed -- reconstructing");
1423 if (do_print)
f.print_size(
name+
" reconstructed");
1449 template<
typename T, std::
size_t NDIM>
1455 if (vp.empty())
return;
1456 for (
const auto&
p : vp) {
1463 template<
typename... Args>
1464 void add(
const Args&... args) {
1470 world.
gop.
sum(size_global);
1488 const std::string
policy)
const override {
1490 for (
size_t i = 0; i < vsize1; i++) {
1492 p.push_back(std::make_pair(
batch,1.0));
1509 std::size_t n = std::get<0>(argtuple).size();
1510 resultT result = zero_functions_auto_tree_state<double, 6>(world, n);
1518 resultT operator() (
const std::vector<CCPair>& pair,
const Info& info,
const std::vector<std::string>& argument)
const;
1534 const std::string
policy)
const override {
1536 for (
size_t i = 0; i < vsize1; i++) {
1538 p.push_back(std::make_pair(
batch,1.0));
1547 name=
"ConstantPart";
1553 typedef std::tuple<const std::vector<CCPair>&,
1554 const std::vector<Function<double,3>>&,
const std::vector<Function<double,3>>&,
1560 std::size_t n = std::get<0>(argtuple).size();
1561 resultT result = zero_functions_auto_tree_state<double, 6>(world, n);
1567 const Info& info)
const;
1579 const std::string
policy)
const override {
1581 for (
size_t i = 0; i < vsize1; i++) {
1583 p.push_back(std::make_pair(
batch, 1.0));
1591 name=
"MP2UpdatePair";
1598 typedef std::tuple<const std::vector<CCPair>&,
const std::vector<real_function_6d>&,
1604 std::size_t n = std::get<0>(argtuple).size();
1605 resultT result = zero_functions_auto_tree_state<double, 6>(world, n);
1613 resultT operator() (
const std::vector<CCPair>& pair,
const std::vector<real_function_6d>& mp2_coupling,
1625 const std::string
policy)
const override {
1627 for (
size_t i = 0; i < vsize1; i++) {
1629 p.push_back(std::make_pair(
batch,1.0));
1641 const std::vector<CCPair>&,
1642 const std::vector<real_function_6d>&,
1652 std::size_t n = std::get<0>(argtuple).size();
1653 resultT result = zero_functions_auto_tree_state<double, 6>(world, n);
1669 const std::vector<real_function_6d>& local_coupling,
1673 const std::size_t&
maxiter)
const;
1681 name=
"SinglesPotentialEx";
1687 const std::vector<int>&,
1689 const std::vector<CCPair>&,
1691 const std::vector<CCPair>&,
1696 using resultT = std::tuple<std::vector<real_function_3d>,std::vector<real_function_3d>>;
1699 std::size_t n = std::get<0>(argtuple).size();
1700 std::vector<real_function_3d> result = zero_functions_auto_tree_state<double, 3>(world, n);
1701 std::vector<real_function_3d> intermediate = zero_functions_auto_tree_state<double, 3>(world, n);
1703 return std::make_tuple(result,intermediate);
1708 const std::vector<CCPair>& doubles_gs,
1710 const std::vector<CCPair>& doubles_ex,
1719 name=
"SinglesPotentialGs";
1723 const std::vector<int>&,
1725 const std::vector<CCPair>&,
1731 using resultT = std::tuple<std::vector<real_function_3d>,std::vector<real_function_3d>>;
1735 std::size_t n = std::get<0>(argtuple).size();
1736 std::vector<real_function_3d> result = zero_functions_auto_tree_state<double, 3>(world, n);
1737 std::vector<real_function_3d> intermediate = zero_functions_auto_tree_state<double, 3>(world, n);
1739 return std::make_tuple(result,intermediate);
1744 const std::vector<CCPair>& doubles_gs,
1754 name=
"CorrelationEnergy";
1758 const std::vector<CCPair>&,
1764 typedef std::vector<ScalarResult<double>>
resultT;
1769 std::size_t n = std::get<0>(argtuple).size();
1770 return scalar_result_vector<double>(world,n);
1775 const Info& info)
const;
double potential(const coord_3d &r)
Definition 3dharmonic.cc:132
Definition macrotaskpartitioner.h:55
a batch consists of a 2D-input batch and a 1D-output batch: K-batch <- (I-batch, J-batch)
Definition macrotaskpartitioner.h:124
Definition CCStructures.h:759
intermediateT< T, NDIM > imH
Definition CCStructures.h:950
CCConvolutionOperator(const CCConvolutionOperator &other)=default
friend hashT hash_value(CCConvolutionOperator< T, NDIM > &op)
Definition CCStructures.h:898
static std::shared_ptr< CCConvolutionOperator > CCConvolutionOperatorPtr(World &world, const OpType type, Parameters param)
Definition CCStructures.h:798
Function< T, NDIM > operator()(const Function< T, NDIM > &f) const
Definition CCStructures.h:825
SeparatedConvolution< T, NDIM > * init_op(const OpType &type, const Parameters ¶meters) const
Definition CCStructures.cc:370
size_t info() const
prints out information (operatorname, number of stored intermediates ...)
Definition CCStructures.cc:352
std::shared_ptr< SeparatedConvolution< T, NDIM > > op
Definition CCStructures.h:949
std::vector< Function< T, NDIM > > operator()(const std::vector< Function< T, NDIM > > &f) const
Definition CCStructures.h:857
OpType type() const
Definition CCStructures.h:934
void clear_intermediates(const FuncType &type)
Definition CCStructures.cc:330
World & world
the world
Definition CCStructures.h:942
void sanity() const
sanity check .. doens not do so much
Definition CCStructures.h:909
std::string name() const
Definition CCStructures.h:885
friend std::shared_ptr< CCConvolutionOperator > combine(const std::shared_ptr< CCConvolutionOperator > &a, const std::shared_ptr< CCConvolutionOperator > &b)
Definition CCStructures.h:814
void update_elements(const CC_vecfunction &bra, const CC_vecfunction &ket)
Definition CCStructures.cc:298
intermediateT< T, NDIM > imP
Definition CCStructures.h:951
void error(const std::string &msg) const
Definition CCStructures.h:956
const Parameters parameters
Definition CCStructures.h:936
CCConvolutionOperator(World &world, const OpType type, Parameters param)
Definition CCStructures.h:791
std::vector< Function< T, NDIM > > operator()(const CC_vecfunction &bra, const CCFunction< T, NDIM > &ket) const
Definition CCStructures.h:833
std::shared_ptr< SeparatedConvolution< T, NDIM > > get_op() const
Definition CCStructures.h:938
void print_intermediate(const FuncType type) const
Definition CCStructures.h:912
intermediateT< T, NDIM > imR
Definition CCStructures.h:952
TwoElectronFactory< T, 2 *NDIM > get_kernel() const
create a TwoElectronFactory with the operatorkernel
Definition CCStructures.h:928
friend CCConvolutionOperator combine(const CCConvolutionOperator &a, const CCConvolutionOperator &b)
Definition CCStructures.h:804
structure for a CC Function 3D which holds an index and a type
Definition ccpairfunction.h:45
Function< T, NDIM > function
Definition ccpairfunction.h:70
size_t i
Definition ccpairfunction.h:78
build an MP2 or CC2 or LRCC2 etc pair, possibly including the lo-rank parts
Definition CCStructures.h:1350
CCPairBuilder & set_ex_singles(const CC_vecfunction &ex)
provide excited state singles, needed for CC2 and LRCC2 wave function ansatz
Definition CCStructures.h:1361
CCPairBuilder(World &world, const Info &info)
Definition CCStructures.h:1352
CC_vecfunction gs_singles
Definition CCStructures.h:1437
const Info & info
Definition CCStructures.h:1436
CCPair make_bare_pair(const int i, const int j) const
make a CCPair without the 6d function and some bookkeeping information
Definition CCStructures.cc:506
CCPairBuilder & set_gs_singles(const CC_vecfunction &gs)
provide ground-state singles, needed for CC2 and LRCC2 wave function ansatz
Definition CCStructures.h:1355
static CCState cc_state(const CalcType &type)
Definition CCStructures.h:1380
CCPair make_bare_pair_from_file(const int i, const int j) const
make a CCPair with the 6d function only and some bookkeeping information
Definition CCStructures.cc:529
World & world
Definition CCStructures.h:1435
Function< T, NDIM > load_function(const std::string name, bool do_print) const
Function to load a function from disk.
Definition CCStructures.h:1411
CCPair make_pair(const int i, const int j, const std::vector< CCPairFunction< double, 6 > > &u) const
make a CCPair
Definition CCStructures.cc:520
CalcType ctype
Definition CCStructures.h:1438
CC_vecfunction ex_singles
Definition CCStructures.h:1437
CCPairBuilder & set_ctype(const CalcType &type)
Definition CCStructures.h:1366
CCPair complete_pair_with_low_rank_parts(const CCPair &pair) const
complete the given pair with the low-rank parts
Definition CCStructures.cc:545
Pairs< CCPair > make_all_bare_pairs() const
make a CCPair with the 6d function only and some bookkeeping information
Definition CCStructures.h:1389
a 6D function, either in full or low rank form, possibly including an 2-particle function
Definition ccpairfunction.h:373
Definition CCStructures.h:1179
void reconstruct() const
reconstruct constant part and all functions
Definition CCStructures.h:1283
hashT hash() const
Definition CCStructures.h:1311
void info() const
Definition CCStructures.cc:84
std::string basename() const
return the base name like "MP2_pair_u" or "CC2_pair_x"
Definition CCStructures.h:1333
CCPair(const CCPair &other)
Definition CCStructures.h:1190
World & world() const
return the world of the function
Definition CCStructures.h:1235
void store_pair(World &world, const bool verbose=false)
Definition CCStructures.h:1303
Recordlist< Cloud::keyT > cloud_store(World &world, Cloud &cloud) const
customized function to store this to the cloud
Definition CCStructures.h:1203
bool function_exists() const
check if the pair has a function assigned
Definition CCStructures.h:1241
std::string name() const
Definition CCStructures.h:1340
CCPair(const size_t ii, const size_t jj, const CCState t, const CalcType c, const std::vector< CCPairFunction< double, 6 > > &f)
Definition CCStructures.h:1186
size_t i
Definition CCStructures.h:1196
bool load_pair(World &world, const bool verbose=false)
Definition CCStructures.h:1290
real_function_6d function() const
gives back the pure 6D part of the pair function
Definition CCStructures.h:1246
real_function_6d constant_part
the constant part
Definition CCStructures.h:1324
std::vector< CCPairFunction< double, 6 > > functions
the functions which belong to the pair
Definition CCStructures.h:1321
CCPair(const size_t ii, const size_t jj, const CCState t, const CalcType c)
Definition CCStructures.h:1183
void update_u(const real_function_6d &u)
updates the pure 6D part of the pair function
Definition CCStructures.h:1253
size_t j
Definition CCStructures.h:1197
CCState type
Definition CCStructures.h:1194
double bsh_eps
Definition CCStructures.h:1330
void serialize(const Archive &ar)
Definition CCStructures.h:1264
CalcType ctype
Definition CCStructures.h:1195
void cloud_load(World &world, const Cloud &cloud, Recordlist< Cloud::keyT > &recordlist)
customized function to load this from the cloud
Definition CCStructures.h:1221
cloud class
Definition cloud.h:147
recordlistT store(madness::World &world, const T &source)
Definition cloud.h:316
T forward_load(madness::World &world, recordlistT &recordlist) const
load a single object from the cloud, recordlist is consumed while loading elements
Definition cloud.h:298
FunctionDefaults holds default paramaters as static class members.
Definition funcdefaults.h:100
static const double & get_thresh()
Returns the default threshold.
Definition funcdefaults.h:176
A multiresolution adaptive numerical function.
Definition mra.h:139
World & world() const
Returns the world.
Definition mra.h:688
void set_thresh(double value, bool fence=true)
Sets the value of the truncation threshold. Optional global fence.
Definition mra.h:617
const std::shared_ptr< FunctionImpl< T, NDIM > > & get_impl() const
Returns a shared-pointer to the implementation.
Definition mra.h:654
const Function< T, NDIM > & reconstruct(bool fence=true) const
Reconstructs the function, transforming into scaling function basis. Possible non-blocking comm.
Definition mra.h:817
void clear(bool fence=true)
Clears the function as if constructed uninitialized. Optional fence.
Definition mra.h:889
bool is_initialized() const
Returns true if the function is initialized.
Definition mra.h:167
Definition CCStructures.h:1750
resultT operator()(const std::vector< CCPair > &pairs, const CC_vecfunction &singles_gs, const Info &info) const
Definition CCStructures.cc:748
std::tuple< const std::vector< CCPair > &, const CC_vecfunction &, const Info & > argtupleT
Definition CCStructures.h:1761
MacroTaskComputeCorrelationEnergy()
Definition CCStructures.h:1753
resultT allocator(World &world, const argtupleT &argtuple) const
allocate the result and set the name of this task
Definition CCStructures.h:1768
std::vector< ScalarResult< double > > resultT
first vector is the potential, second is an intermediate (if applicable, e.g. for s2b and s2c potenti...
Definition CCStructures.h:1764
std::string basename
Definition CCStructures.h:1752
Definition CCStructures.h:1529
partitionT do_partitioning(const std::size_t &vsize1, const std::size_t &vsize2, const std::string policy) const override
override this if you want your own partitioning
Definition CCStructures.h:1533
ConstantPartPartitioner()
Definition CCStructures.h:1531
Definition CCStructures.h:1527
std::vector< real_function_6d > resultT
Definition CCStructures.h:1557
MacroTaskConstantPart()
Definition CCStructures.h:1545
std::tuple< const std::vector< CCPair > &, const std::vector< Function< double, 3 > > &, const std::vector< Function< double, 3 > > &, const madness::Info & > argtupleT
Definition CCStructures.h:1555
resultT allocator(World &world, const argtupleT &argtuple) const
Definition CCStructures.h:1559
resultT operator()(const std::vector< CCPair > &pair, const std::vector< Function< double, 3 > > &gs_singles, const std::vector< Function< double, 3 > > &ex_singles, const Info &info) const
Definition CCStructures.cc:616
Definition CCStructures.h:1620
IteratePairPartitioner()=default
partitionT do_partitioning(const std::size_t &vsize1, const std::size_t &vsize2, const std::string policy) const override
override this if you want your own partitioning
Definition CCStructures.h:1624
Definition CCStructures.h:1618
std::tuple< const std::vector< CCPair > &, const std::vector< real_function_6d > &, const CC_vecfunction &, const CC_vecfunction &, const Info &, const std::size_t & > argtupleT
Definition CCStructures.h:1647
resultT operator()(const std::vector< CCPair > &pair, const std::vector< real_function_6d > &local_coupling, const CC_vecfunction &gs_singles, const CC_vecfunction &ex_singles, const Info &info, const std::size_t &maxiter) const
iterate a given pair of the MP2, CC2 or LRCC2 calculation
Definition CCStructures.cc:653
MacroTaskIteratePair()
Definition CCStructures.h:1635
resultT allocator(World &world, const argtupleT &argtuple) const
Definition CCStructures.h:1651
std::vector< real_function_6d > resultT
Definition CCStructures.h:1649
Definition CCStructures.h:1483
ConstantPartPartitioner()
Definition CCStructures.h:1485
partitionT do_partitioning(const std::size_t &vsize1, const std::size_t &vsize2, const std::string policy) const override
override this if you want your own partitioning
Definition CCStructures.h:1487
Definition CCStructures.h:1481
resultT operator()(const std::vector< CCPair > &pair, const Info &info, const std::vector< std::string > &argument) const
Definition CCStructures.cc:604
MacroTaskMp2ConstantPart()
Definition CCStructures.h:1499
std::tuple< const std::vector< CCPair > &, const madness::Info &, const std::vector< std::string > & > argtupleT
Definition CCStructures.h:1504
std::vector< real_function_6d > resultT
Definition CCStructures.h:1506
resultT allocator(World &world, const argtupleT &argtuple) const
Definition CCStructures.h:1508
Definition CCStructures.h:1572
UpdatePairPartitioner()
Definition CCStructures.h:1574
partitionT do_partitioning(const std::size_t &vsize1, const std::size_t &vsize2, const std::string policy) const override
override this if you want your own partitioning
Definition CCStructures.h:1578
Definition CCStructures.h:1570
MacroTaskMp2UpdatePair()
Definition CCStructures.h:1589
resultT allocator(World &world, const argtupleT &argtuple) const
Definition CCStructures.h:1603
std::vector< real_function_6d > resultT
Definition CCStructures.h:1601
std::tuple< const std::vector< CCPair > &, const std::vector< real_function_6d > &, const std::vector< madness::Vector< double, 3 > > &, const Info & > argtupleT
Definition CCStructures.h:1599
resultT operator()(const std::vector< CCPair > &pair, const std::vector< real_function_6d > &mp2_coupling, const std::vector< madness::Vector< double, 3 > > &all_coords_vec, const Info &info) const
Definition CCStructures.cc:635
Definition macrotaskq.h:978
Batch batch
Definition macrotaskq.h:980
std::shared_ptr< MacroTaskPartitioner > partitioner
Definition macrotaskq.h:982
std::string name
Definition macrotaskq.h:981
partition one (two) vectors into 1D (2D) batches.
Definition macrotaskpartitioner.h:182
std::string policy
how to partition the batches
Definition macrotaskpartitioner.h:190
std::list< std::pair< Batch, double > > partitionT
Definition macrotaskpartitioner.h:186
MacroTaskPartitioner & set_dimension(const std::size_t &n)
Definition macrotaskpartitioner.h:205
Definition CCStructures.h:1677
std::tuple< std::vector< real_function_3d >, std::vector< real_function_3d > > resultT
Definition CCStructures.h:1696
resultT allocator(World &world, const argtupleT &argtuple) const
Definition CCStructures.h:1698
std::tuple< const std::vector< int > &, const CC_vecfunction &, const std::vector< CCPair > &, const CC_vecfunction &, const std::vector< CCPair > &, const int &, const Info & > argtupleT
Definition CCStructures.h:1694
std::string basename
Definition CCStructures.h:1679
MacroTaskSinglesPotentialEx()
Definition CCStructures.h:1680
resultT operator()(const std::vector< int > &result_index, const CC_vecfunction &singles_gs, const std::vector< CCPair > &doubles_gs, const CC_vecfunction &singles_ex, const std::vector< CCPair > &doubles_ex, const int &name, const Info &info)
convenience function
Definition CCStructures.cc:674
Definition CCStructures.h:1715
std::string basename
Definition CCStructures.h:1717
std::tuple< const std::vector< int > &, const CC_vecfunction &, const std::vector< CCPair > &, const int &, const Info & > argtupleT
Definition CCStructures.h:1728
std::tuple< std::vector< real_function_3d >, std::vector< real_function_3d > > resultT
first vector is the potential, second is an intermediate (if applicable, e.g. for s2b and s2c potenti...
Definition CCStructures.h:1731
resultT operator()(const std::vector< int > &result_index, const CC_vecfunction &singles_gs, const std::vector< CCPair > &doubles_gs, const int &name, const Info &info)
Definition CCStructures.cc:716
MacroTaskSinglesPotentialGs()
Definition CCStructures.h:1718
resultT allocator(World &world, const argtupleT &argtuple) const
allocate the result and set the name of this task
Definition CCStructures.h:1734
class for holding the parameters for calculation
Definition QCCalculationParametersBase.h:290
virtual void read_input_and_commandline_options(World &world, const commandlineparser &parser, const std::string tag)
Definition QCCalculationParametersBase.h:325
Convolutions in separated form (including Gaussian)
Definition operator.h:139
static OperatorInfo combine_OT(const SeparatedConvolution< Q, NDIM > &left, const SeparatedConvolution< Q, NDIM > &right)
return operator type and other info of the combined operator (e.g. fg = f(1,2)* g(1,...
Definition operator.h:1706
A tensor is a multidimensional array.
Definition tensor.h:317
factory for generating TwoElectronInterfaces
Definition function_factory.h:443
A simple, fixed dimension vector.
Definition vector.h:64
void fence(bool debug=false)
Synchronizes all processes in communicator AND globally ensures no pending AM or tasks.
Definition worldgop.cc:161
std::vector< T > concat0(const std::vector< T > &v, size_t bufsz=1024 *1024)
Concatenate an STL vector of serializable stuff onto node 0.
Definition worldgop.h:953
void sum(T *buf, size_t nelem)
Inplace global sum while still processing AM & tasks.
Definition worldgop.h:870
A parallel world class.
Definition world.h:132
ProcessID rank() const
Returns the process rank in this World (same as MPI_Comm_rank()).
Definition world.h:320
WorldGopInterface & gop
Global operations.
Definition world.h:207
static std::enable_if_t< std::is_same< X, BinaryFstreamInputArchive >::value||std::is_same< X, BinaryFstreamOutputArchive >::value, bool > exists(World &world, const char *filename)
Returns true if the named, unopened archive exists on disk with read access.
Definition parallel_archive.h:224
An archive for storing local or parallel data wrapping a BinaryFstreamOutputArchive.
Definition parallel_archive.h:321
Objects that implement their own parallel archive interface should derive from this class.
Definition parallel_archive.h:58
Wraps an archive around an STL vector for output.
Definition vector_archive.h:55
double(* f1)(const coord_3d &)
Definition derivatives.cc:55
char * p(char *buf, const char *name, int k, int initial_level, double thresh, int order)
Definition derivatives.cc:72
static bool debug
Definition dirac-hatom.cc:16
auto T(World &world, response_space &f) -> response_space
Definition global_functions.cc:34
Tensor< typename Tensor< T >::scalar_type > arg(const Tensor< T > &t)
Return a new tensor holding the argument of each element of t (complex types only)
Definition tensor.h:2503
const int maxiter
Definition gygi_soltion.cc:68
static const double v
Definition hatom_sf_dirac.cc:20
static double u(double r, double c)
Definition he.cc:20
Tensor< double > op(const Tensor< double > &x)
Definition kain.cc:508
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:182
#define MADNESS_EXCEPTION(msg, value)
Macro for throwing a MADNESS exception.
Definition madness_exception.h:119
#define MADNESS_CHECK_THROW(condition, msg)
Check a condition — even in a release build the condition is always evaluated so it can have side eff...
Definition madness_exception.h:207
Main include file for MADNESS and defines Function interface.
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
long get_memory_usage()
Definition unique_filename.cc:29
static const char * filename
Definition legendre.cc:96
CalcType
Calculation Types used by CC2.
Definition CCStructures.h:27
@ CT_CC2
Definition CCStructures.h:28
@ CT_LRCC2
Definition CCStructures.h:28
@ CT_MP3
Definition CCStructures.h:28
@ CT_UNDEFINED
Definition CCStructures.h:28
@ CT_LRCCS
Definition CCStructures.h:28
@ CT_CISPD
Definition CCStructures.h:28
@ CT_TEST
Definition CCStructures.h:28
@ CT_MP2
Definition CCStructures.h:28
@ CT_ADC2
Definition CCStructures.h:28
@ CT_TDHF
Definition CCStructures.h:28
static std::string stringify(T arg)
Definition funcplot.h:1035
static double cpu_time()
Returns the cpu time in seconds relative to an arbitrary origin.
Definition timers.h:127
void print_memory_usage(const World &world)
check memory usage using getrusage
Definition CCStructures.h:77
Function< TENSOR_RESULT_TYPE(Q, T), NDIM > mul(const Q alpha, const Function< T, NDIM > &f, bool fence=true)
Returns new function equal to alpha*f(x) with optional fence.
Definition mra.h:1765
void truncate(World &world, response_space &v, double tol, bool fence)
Definition basic_operators.cc:30
CCState
Type of Pairs used by CC_Pair2 class.
Definition CCStructures.h:31
@ CCSTATE_UNDEFINED
Definition CCStructures.h:32
@ GROUND_STATE
Definition CCStructures.h:32
@ EXCITED_STATE
Definition CCStructures.h:32
FuncType
Definition ccpairfunction.h:26
@ RESPONSE
Definition ccpairfunction.h:26
@ HOLE
Definition ccpairfunction.h:26
@ UNDEFINED
Definition ccpairfunction.h:26
@ PARTICLE
Definition ccpairfunction.h:26
@ reconstructed
s coeffs at the leaves only
Definition funcdefaults.h:60
CalcType assign_calctype(const std::string name)
Assigns enum to string.
Definition CCStructures.cc:396
const std::vector< Function< T, NDIM > > & reconstruct(const std::vector< Function< T, NDIM > > &v)
reconstruct a vector of functions
Definition vmra.h:162
std::shared_ptr< CCConvolutionOperator< T, NDIM > > CCConvolutionOperatorPtr(World &world, const OpType type, typename CCConvolutionOperator< T, NDIM >::Parameters param)
Definition CCStructures.h:966
void hash_combine(hashT &seed, const T &v)
Combine hash values.
Definition worldhash.h:260
Pairs< Function< T, NDIM > > intermediateT
f12 and g12 intermediates of the form <f1|op|f2> (with op=f12 or op=g12) will be saved using the pair...
Definition CCStructures.h:502
double size_of(const intermediateT< T, NDIM > &im)
Returns the size of an intermediate.
Definition CCStructures.h:510
std::vector< real_function_3d > vector_real_function_3d
Definition functypedefs.h:94
std::shared_ptr< FunctionFunctorInterface< double, 3 > > func(new opT(g))
OpType
operator types
Definition operatorinfo.h:11
void print(const T &t, const Ts &... ts)
Print items to std::cout (items separated by spaces) and terminate with a new line.
Definition print.h:225
response_space apply(World &world, std::vector< std::vector< std::shared_ptr< real_convolution_3d > > > &op, response_space &f)
Definition basic_operators.cc:39
std::string get_hostname()
Definition unique_filename.cc:40
NDIM & f
Definition mra.h:2481
std::size_t hashT
The hash value type.
Definition worldhash.h:145
double wall_time()
Returns the wall time in seconds relative to an arbitrary origin.
Definition timers.cc:48
std::string type(const PairType &n)
Definition PNOParameters.h:18
constexpr Vector< T, sizeof...(Ts)+1 > vec(T t, Ts... ts)
Factory function for creating a madness::Vector.
Definition vector.h:750
PotentialType
CC2 Singles Potentials.
Definition CCStructures.h:36
@ POT_singles_
Definition CCStructures.h:53
@ POT_s2b_
Definition CCStructures.h:45
@ POT_F3D_
Definition CCStructures.h:38
@ POT_s5b_
Definition CCStructures.h:43
@ POT_s4c_
Definition CCStructures.h:49
@ POT_s5c_
Definition CCStructures.h:44
@ POT_s6_
Definition CCStructures.h:50
@ POT_s4b_
Definition CCStructures.h:48
@ POT_ccs_
Definition CCStructures.h:51
@ POT_s3c_
Definition CCStructures.h:41
@ POT_s4a_
Definition CCStructures.h:47
@ POT_s5a_
Definition CCStructures.h:42
@ POT_s3b_
Definition CCStructures.h:40
@ POT_s2c_
Definition CCStructures.h:46
@ POT_cis_
Definition CCStructures.h:52
@ POT_UNDEFINED
Definition CCStructures.h:37
@ POT_s3a_
Definition CCStructures.h:39
std::string assign_name(const CCState &input)
Assigns strings to enums for formated output.
Definition CCStructures.cc:379
std::string name(const FuncType &type, const int ex=-1)
Definition ccpairfunction.h:28
madness::hashT hash_value(const std::array< T, N > &a)
Hash std::array with madness hash.
Definition array_addons.h:78
void save(const Function< T, NDIM > &f, const std::string name)
Definition mra.h:2835
double get_size(World &world, const std::vector< Function< T, NDIM > > &v)
Definition vmra.h:1851
double get_size_local(World &world, const std::vector< Function< T, NDIM > > &v)
return the size of a vector of functions for each rank
Definition vmra.h:1832
static const double b
Definition nonlinschro.cc:119
static const double a
Definition nonlinschro.cc:118
static const double c
Definition relops.cc:10
static const double thresh
Definition rk.cc:45
parameter class
Definition CCStructures.h:763
int freeze
Definition CCStructures.h:778
Parameters()
Definition CCStructures.h:764
void serialize(archiveT &ar)
f12 exponent
Definition CCStructures.h:782
double lo
Definition CCStructures.h:777
double gamma
Definition CCStructures.h:779
Parameters(const CCParameters ¶m)
Definition CCStructures.h:773
double thresh_op
Definition CCStructures.h:776
Parameters(const Parameters &other)
Definition CCStructures.h:766
Definition CCStructures.h:90
void print_warnings() const
Definition CCStructures.h:116
void warning(const std::string &msg) const
Definition CCStructures.cc:45
void debug_output(const std::string &msg) const
Definition CCStructures.h:100
bool debug
Definition CCStructures.h:96
void subsection(const std::string &msg) const
Definition CCStructures.cc:34
CCMessenger operator<<(const T &t) const
Definition CCStructures.h:121
World & world
Definition CCStructures.h:93
bool scientific
Definition CCStructures.h:95
std::vector< std::string > warnings
collect all warnings that occur to print out at the end of the job
Definition CCStructures.h:128
std::ostream & os
output stream
Definition CCStructures.h:130
void section(const std::string &msg) const
Definition CCStructures.cc:23
void output(const std::string &msg) const
Definition CCStructures.cc:14
CCMessenger(World &world)
Definition CCStructures.h:91
size_t output_prec
Definition CCStructures.h:94
void operator()(const std::string &msg) const
Definition CCStructures.h:98
Definition CCStructures.h:212
double thresh_Ue() const
Definition CCStructures.h:316
double thresh_f12() const
Definition CCStructures.h:314
std::size_t kain_subspace() const
Definition CCStructures.h:366
double tight_thresh_6D() const
Definition CCStructures.h:306
std::size_t iter_max_3D() const
Definition CCStructures.h:328
bool no_compute_cispd() const
Definition CCStructures.h:348
CCParameters(World &world, const commandlineparser &parser)
ctor reading out the input file
Definition CCStructures.h:222
bool no_compute_mp2_constantpart() const
Definition CCStructures.h:340
std::pair< int, int > only_pair() const
Definition CCStructures.h:332
bool kain() const
Definition CCStructures.h:356
bool plot() const
Definition CCStructures.h:354
bool no_compute_response() const
Definition CCStructures.h:342
double thresh_poisson() const
Definition CCStructures.h:312
CCParameters()
Definition CCStructures.h:214
double thresh_bsh_3D() const
Definition CCStructures.h:308
bool no_compute_mp2() const
Definition CCStructures.h:344
double dconv_6D() const
Definition CCStructures.h:324
double econv_pairs() const
Definition CCStructures.h:320
void initialize_parameters()
Definition CCStructures.h:229
bool response() const
Definition CCStructures.h:295
bool decompose_Q() const
Definition CCStructures.h:360
double thresh_bsh_6D() const
Definition CCStructures.h:310
void error(World &world, const std::string &msg) const
Definition CCStructures.h:380
CCParameters(const CCParameters &other)=default
copy constructor
double gamma() const
Definition CCStructures.h:372
double thresh_3D() const
Definition CCStructures.h:300
double tight_thresh_3D() const
Definition CCStructures.h:302
bool no_compute() const
Definition CCStructures.h:336
double dconv_3D() const
Definition CCStructures.h:322
std::size_t iter_max() const
Definition CCStructures.h:326
double lo() const
Definition CCStructures.h:296
long freeze() const
Definition CCStructures.h:368
double thresh_6D() const
Definition CCStructures.h:304
bool no_compute_cc2() const
Definition CCStructures.h:346
std::vector< std::size_t > excitations() const
Definition CCStructures.h:370
void set_derived_values()
Definition CCStructures.cc:159
bool QtAnsatz() const
Definition CCStructures.h:362
bool test() const
Definition CCStructures.h:358
double dmin() const
Definition CCStructures.h:298
std::size_t output_prec() const
Definition CCStructures.h:364
bool restart() const
Definition CCStructures.h:334
double econv() const
Definition CCStructures.h:318
std::size_t iter_max_6D() const
Definition CCStructures.h:330
CalcType calc_type() const
Definition CCStructures.h:282
bool no_compute_gs() const
Definition CCStructures.h:338
bool debug() const
Definition CCStructures.h:352
void information(World &world) const
print out the parameters
Definition CCStructures.cc:191
bool no_compute_lrcc2() const
Definition CCStructures.h:350
size_t warning(World &world, const std::string &msg) const
Definition CCStructures.h:387
void sanity_check(World &world) const
check if parameters are set correct
Definition CCStructures.cc:202
print accumulated size of all functions
Definition CCStructures.h:1444
void print(World &world, const std::string msg="") const
Definition CCStructures.h:1468
double size_local
Definition CCStructures.h:1445
void add_helper(const std::vector< CCPair > &vp)
Definition CCStructures.h:1454
void add(const Args &... args)
variadic template parameters to add the size of all functions and pairs
Definition CCStructures.h:1464
void add_helper(const std::vector< Function< T, NDIM > > &v)
Definition CCStructures.h:1450
Timer Structure.
Definition CCStructures.h:135
std::pair< double, double > current_time(bool printout=false)
Definition CCStructures.h:188
CCTimer(World &world, std::string msg)
Definition CCStructures.h:139
void print() const
Definition CCStructures.h:197
std::string operation
Definition CCStructures.h:146
double start_cpu
Definition CCStructures.h:145
double time_wall
Definition CCStructures.h:149
double get_wall_time_diff() const
Definition CCStructures.h:184
void update_time()
Definition CCStructures.h:152
CCTimer stop()
Definition CCStructures.h:168
CCTimer start()
Definition CCStructures.h:162
void print()
Definition CCStructures.h:193
double time_cpu
Definition CCStructures.h:150
double start_wall
Definition CCStructures.h:144
double get_cpu_time_diff() const
Definition CCStructures.h:186
void print(const std::pair< double, double > ×) const
Definition CCStructures.h:201
double reset()
Definition CCStructures.h:176
World & world
Definition CCStructures.h:143
double end_wall
Definition CCStructures.h:147
double end_cpu
Definition CCStructures.h:148
A helper structure which holds a map of functions.
Definition CCStructures.h:522
std::string irrep
Definition CCStructures.h:665
hashT hash() const
Definition CCStructures.h:651
CC_vecfunction(const vector_real_function_3d &v, const FuncType &type, const size_t &freeze)
Definition CCStructures.h:549
std::map< std::size_t, CCFunction< double, 3 > > CC_functionmap
Definition CCStructures.h:658
CC_vecfunction(const CC_vecfunction &other)
copy ctor (shallow)
Definition CCStructures.h:565
const CCFunction< double, 3 > & operator()(const CCFunction< double, 3 > &i) const
getter
Definition CCStructures.h:677
void insert(const size_t &i, const CCFunction< double, 3 > &f)
setter
Definition CCStructures.h:697
CC_vecfunction(const vector_real_function_3d &v, const FuncType &type)
Definition CCStructures.h:541
static CC_vecfunction load_restartdata(World &world, std::string filename)
Definition CCStructures.h:613
const CCFunction< double, 3 > & operator()(const size_t &i) const
getter
Definition CCStructures.h:682
CC_vecfunction operator*(const double &fac) const
scalar multiplication
Definition CCStructures.h:727
double delta
Definition CCStructures.h:664
CCFunction< double, 3 > & operator()(const size_t &i)
getter
Definition CCStructures.h:692
void print_size(const std::string &msg="!?not assigned!?") const
Print the memory of which is used by all the functions in the map.
Definition CCStructures.cc:69
CC_vecfunction(const std::vector< CCFunction< double, 3 > > &v)
Definition CCStructures.h:535
bool operator<(const CC_vecfunction &b) const
operator needed for sort operation (sorted by omega values)
Definition CCStructures.h:741
CC_vecfunction(const FuncType type_)
Definition CCStructures.h:526
void serialize(const Archive &ar)
Definition CCStructures.h:626
CC_vecfunction(const std::vector< CCFunction< double, 3 > > &v, const FuncType type_)
Definition CCStructures.h:559
CC_vecfunction(const vector_real_function_3d &v)
Definition CCStructures.h:528
CC_vecfunction()
Definition CCStructures.h:524
void set_functions(const vector_real_function_3d &v, const FuncType &type, const size_t &freeze)
setter
Definition CCStructures.h:702
CCFunction< double, 3 > & operator()(const CCFunction< double, 3 > &i)
getter
Definition CCStructures.h:687
void scale(const double &factor)
scaling (inplace)
Definition CCStructures.h:734
void plot(const std::string &msg="") const
Definition CCStructures.h:744
FuncType type
Definition CCStructures.h:661
double current_error
excitation energy
Definition CCStructures.h:663
friend CC_vecfunction copy(const CC_vecfunction &other)
returns a deep copy (void shallow copy errors)
Definition CCStructures.h:587
size_t size() const
Get the size vector (number of functions in the map)
Definition CCStructures.h:718
CC_vecfunction & operator=(const CC_vecfunction &other)
assignment operator, shallow wrt the functions
Definition CCStructures.h:573
double omega
Definition CCStructures.h:662
bool is_converged(const double econv, const double dconv) const
Definition CCStructures.h:672
vector_real_function_3d get_vecfunction() const
Returns all the functions of the map as vector.
Definition CCStructures.h:711
void save_restartdata(World &world, std::string filename) const
Definition CCStructures.h:620
CC_functionmap functions
Definition CCStructures.h:659
std::string name(const int ex) const
excitation irrep (direct product of x function and corresponding orbital)
Definition CCStructures.h:668
void reconstruct() const
Definition CCStructures.h:596
POD holding some basic functions and some intermediates for the CC2 calculation.
Definition CCStructures.h:1107
void reconstruct() const
Definition CCStructures.h:1130
std::vector< Function< double, 3 > > mo_ket
Definition CCStructures.h:1108
Recordlist< Cloud::keyT > cloud_store(World &world, Cloud &cloud) const
customized function to store this to the cloud
Definition CCStructures.h:1143
Tensor< double > fock
Definition CCStructures.h:1113
Function< double, 3 > R
Definition CCStructures.h:1115
std::vector< Function< double, 3 > > U1
Definition CCStructures.h:1116
CCIntermediatePotentials intermediate_potentials
Definition CCStructures.h:1114
Function< double, 3 > U2
Definition CCStructures.h:1115
std::vector< madness::Vector< double, 3 > > molecular_coordinates
Definition CCStructures.h:1110
std::vector< double > orbital_energies
Definition CCStructures.h:1112
std::vector< Function< double, 3 > > mo_bra
Definition CCStructures.h:1109
CCParameters parameters
Definition CCStructures.h:1111
vector_real_function_3d get_active_mo_bra() const
Definition CCStructures.h:1124
void cloud_load(World &world, const Cloud &cloud, Recordlist< Cloud::keyT > &recordlist)
customized function to load this from the cloud
Definition CCStructures.h:1162
Function< double, 3 > R_square
Definition CCStructures.h:1115
vector_real_function_3d get_active_mo_ket() const
Definition CCStructures.h:1118
Definition CCStructures.h:394
static PairVectorMap triangular_map(const int nfreeze, const int nocc)
Definition CCStructures.h:400
void print(const std::string msg="PairVectorMap") const
Definition CCStructures.h:420
std::vector< std::pair< int, int > > map
maps pair index (i,j) to vector index k
Definition CCStructures.h:396
static PairVectorMap quadratic_map(const int nfreeze, const int nocc)
Definition CCStructures.h:410
PairVectorMap(const std::vector< std::pair< int, int > > map1)
Definition CCStructures.h:398
Definition CCStructures.h:434
void swap(Pairs< T > &other)
swap the contant of the pairmap
Definition CCStructures.h:490
pairmapT allpairs
Definition CCStructures.h:437
static Pairs vector2pairs(const std::vector< T > &argument, const PairVectorMap map)
Definition CCStructures.h:453
Pairs< R > convert(const Pairs< T > arg, const opT op) const
convert Pairs<T> to another type
Definition CCStructures.h:443
std::map< std::pair< int, int >, T > pairmapT
Definition CCStructures.h:436
bool empty() const
Definition CCStructures.h:494
T & operator()(int i, int j)
getter
Definition CCStructures.h:477
void insert(int i, int j, const T &pair)
Definition CCStructures.h:484
const T & operator()(int i, int j) const
getter
Definition CCStructures.h:470
static std::vector< T > pairs2vector(const Pairs< T > &argument, const PairVectorMap map)
Definition CCStructures.h:461
very simple command line parser
Definition commandlineparser.h:15
Definition lowrankfunction.h:332
static double current_time
Definition tdse1d.cc:160
InputParameters param
Definition tdse.cc:203
double norm(const T i1)
Definition test_cloud.cc:72
constexpr std::size_t NDIM
Definition testgconv.cc:54
double h(const coord_1d &r)
Definition testgconv.cc:175