8 #ifndef PAPER_CODE_PNOSTRUCTURES_H_
9 #define PAPER_CODE_PNOSTRUCTURES_H_
23 double inner(
const std::valarray<double>& bra,
const std::valarray<double>& ket);
31 return std::valarray<double>(
dim);
68 const double& mul_tol = 0.0)
const;
99 printf(
"timer: %40.40s %8.2fs %8.2fs \n", msg.c_str(),
wtime_,
ctime_);
120 std::valarray<double>
eij;
137 eij[
ij]=ereg_ij+ef12_ij;
151 size_t i()
const {
return i_;}
182 operator bool()
const {
187 template <
typename Int>
189 size_t result= (row < col) ? (row + col * (col + 1) / 2)
190 : (col + row * (row + 1) / 2);
214 size_t i()
const{
return i_;}
215 size_t j()
const{
return j_;}
252 os <<
"PNOPairs Memory Information\n";
253 os <<
"Total: " << std::fixed << mi.
pno + mi.
Kpno + mi.
W <<
" GB \n";
254 os <<
"PNO : " << std::fixed << mi.
pno <<
" GB \n";
255 os <<
"KPNO : " << std::fixed << mi.
Kpno <<
" GB \n";
256 os <<
"W : " << std::fixed << mi.
W <<
" GB \n";
261 typedef std::valarray<vector_real_function_3d>
vfT ;
266 const size_t n2=
cis.
x.size();
279 std::valarray<Tensor<double> >
t_ij;
280 std::valarray<Tensor<double> >
F_ij;
281 std::valarray<Tensor<double> >
W_ij;
Definition: SCFOperators.h:104
The Nemo class.
Definition: nemo.h:326
Definition: PNOStructures.h:45
Exchange< double, 3 > K
Definition: PNOStructures.h:59
real_function_3d operator()(const real_function_3d &ket) const
Definition: PNOStructures.h:61
ParametrizedExchange(World &world, const Nemo &nemo_, const std::string &type_)
Definition: PNOStructures.h:47
const Nemo & nemo
Definition: PNOStructures.h:57
World & world
Definition: PNOStructures.h:56
const std::string type
Definition: PNOStructures.h:58
void fence(bool debug=false)
Synchronizes all processes in communicator AND globally ensures no pending AM or tasks.
Definition: worldgop.cc:161
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:318
WorldGopInterface & gop
Global operations.
Definition: world.h:205
char * p(char *buf, const char *name, int k, int initial_level, double thresh, int order)
Definition: derivatives.cc:72
static const double v
Definition: hatom_sf_dirac.cc:20
General header file for using MADNESS.
Defines madness::MadnessException for exception handling.
#define MADNESS_EXCEPTION(msg, value)
Macro for throwing a MADNESS exception.
Definition: madness_exception.h:119
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition: madness_exception.h:134
File holds all helper structures necessary for the CC_Operator and CC2 class.
Definition: DFParameters.h:10
static double cpu_time()
Returns the cpu time in seconds relative to an arbitrary origin.
Definition: timers.h:127
std::vector< real_function_3d > vector_real_function_3d
Definition: functypedefs.h:79
NDIM & f
Definition: mra.h:2416
double wall_time()
Returns the wall time in seconds relative to an arbitrary origin.
Definition: timers.cc:48
double inner(response_space &a, response_space &b)
Definition: response_functions.h:442
vector< functionT > vecfuncT
Definition: corepotential.cc:58
PairType
Definition: PNOParameters.h:17
static const double c
Definition: relops.cc:10
POD for CIS excitation.
Definition: PNOStructures.h:233
bool initialized() const
Definition: PNOStructures.h:241
vector_real_function_3d Kx
Definition: PNOStructures.h:237
CISData(const size_t &n, const double &o, const vector_real_function_3d &f)
Definition: PNOStructures.h:235
int number
Definition: PNOStructures.h:239
CISData()
Definition: PNOStructures.h:234
vector_real_function_3d Vx
Definition: PNOStructures.h:238
vector_real_function_3d x
Definition: PNOStructures.h:236
double omega
Definition: PNOStructures.h:240
Definition: PNOStructures.h:174
const size_t stop_
stop value for i and j (usually number of occ orbitals or occ-nfreeze for frozen core)
Definition: PNOStructures.h:226
size_t j_
current pair index j
Definition: PNOStructures.h:224
size_t npairs() const
total number of pairs n * (n + 1) / 2;
Definition: PNOStructures.h:203
bool finished_
true if all pairs where iterated
Definition: PNOStructures.h:229
size_t ij_
pair number starting from 00 => 0
Definition: PNOStructures.h:228
const size_t freeze_
number of frozen orbitals (just to print the correct name)
Definition: PNOStructures.h:227
size_t start() const
Definition: PNOStructures.h:216
size_t i() const
Definition: PNOStructures.h:214
bool diagonal() const
Definition: PNOStructures.h:220
ElectronPairIterator & operator++()
pre-increment operator
Definition: PNOStructures.cpp:57
size_t j() const
Definition: PNOStructures.h:215
std::string name() const
Gives back "pairij" (for frozen core i and j are the true indices corresponding to the reference with...
Definition: PNOStructures.h:209
bool finished() const
Definition: PNOStructures.h:219
size_t i_
current pair index i
Definition: PNOStructures.h:223
size_t ij() const
Definition: PNOStructures.h:218
size_t nocc() const
number of active occupied orbitals
Definition: PNOStructures.h:198
size_t tridx(Int row, Int col)
Gives the number of the pair in the valarray of pno-mp2.cc file.
Definition: PNOStructures.h:188
size_t stop() const
Definition: PNOStructures.h:217
const size_t start_
start value for i and j (usually 0)
Definition: PNOStructures.h:225
ElectronPairIterator(const size_t &nocc, const size_t &freeze)
Definition: PNOStructures.h:176
Timer structure.
Definition: PNOStructures.h:75
double wstop_
Definition: PNOStructures.h:78
MyTimer stop()
Definition: PNOStructures.h:89
double cstart_
Definition: PNOStructures.h:77
double wtime_
Definition: PNOStructures.h:79
MyTimer print() const
Definition: PNOStructures.h:103
double wstart_
Definition: PNOStructures.h:77
double ctime_
Definition: PNOStructures.h:79
World & world
Definition: PNOStructures.h:76
MyTimer(World &world)
Definition: PNOStructures.h:82
MyTimer start() const
Definition: PNOStructures.h:83
std::string msg_
Definition: PNOStructures.h:80
double cstop_
Definition: PNOStructures.h:78
MyTimer print(const std::string &msg) const
Definition: PNOStructures.h:96
iterates the third index for pair coupling
Definition: PNOStructures.h:143
std::string name() const
Definition: PNOStructures.h:164
OrbitalIterator & operator++()
Definition: PNOStructures.h:157
const size_t stop_
Definition: PNOStructures.h:147
size_t i() const
Definition: PNOStructures.h:151
bool finished_
Definition: PNOStructures.h:148
size_t freeze() const
Definition: PNOStructures.h:166
const size_t freeze_
Definition: PNOStructures.h:149
size_t i_
Definition: PNOStructures.h:145
OrbitalIterator(const size_t &nocc, const size_t &freeze)
Definition: PNOStructures.h:153
const size_t start_
Definition: PNOStructures.h:146
Definition: PNOStructures.h:247
double W
Definition: PNOStructures.h:250
double pno
Definition: PNOStructures.h:248
friend std::ostream & operator<<(std::ostream &os, const MemInfo &mi)
Definition: PNOStructures.h:251
double Kpno
Definition: PNOStructures.h:249
POD for PNO code.
Definition: PNOStructures.h:245
vfT reassemble(const vector_real_function_3d &v)
Definition: PNOStructures.h:317
vfT W_ij_i
Fluctuation Potential.
Definition: PNOStructures.h:286
vfT Kpno_ij
Exchange Intermediate.
Definition: PNOStructures.h:285
vfT pno_ij
the PNOs for all Pairs
Definition: PNOStructures.h:277
PNOTensors::Tensor_IJ_KJ< double > S_ij_kj
PNO overlaps.
Definition: PNOStructures.h:289
vector_real_function_3d extract(const vfT &vf) const
Definition: PNOStructures.cpp:190
void initialize(const std::size_t &nocc)
Definition: PNOStructures.cpp:154
std::valarray< vector_real_function_3d > vfT
Definition: PNOStructures.h:261
void verify() const
throes exception if consistency check fails fails
Definition: PNOStructures.h:302
bool is_consistent(std::string &errm) const
consistency check
Definition: PNOStructures.cpp:77
PNOTensors::Tensor_IJ_IK< double > S_ij_ik
PNO overlaps.
Definition: PNOStructures.h:288
MemInfo meminfo
information about the used memory
Definition: PNOStructures.h:290
std::valarray< bool > frozen_ij
if true then pairs are frozen and not optimized (but still contribute to energy -> not frozen core)
Definition: PNOStructures.h:283
CISData cis
CIS excitation structure.
Definition: PNOStructures.h:276
PairEnergies energies
all Pair Energies
Definition: PNOStructures.h:284
const size_t nocc
number of active occupied orbitals
Definition: PNOStructures.h:274
bool empty() const
check if all pairs are empty
Definition: PNOStructures.h:293
std::valarray< Tensor< double > > t_ij
the amplitudes for all Pairs
Definition: PNOStructures.h:279
const size_t npairs
number of Pairs
Definition: PNOStructures.h:275
PNOPairs operator=(const PNOPairs &other)
Definition: PNOStructures.cpp:171
std::valarray< Tensor< double > > F_ij
Fock matrices of the PNOs.
Definition: PNOStructures.h:280
std::valarray< Tensor< double > > rdm_evals_ij
PNO eigenvalues.
Definition: PNOStructures.h:278
std::string name(const ElectronPairIterator &it) const
Definition: PNOStructures.cpp:181
void clear_intermediates(const ElectronPairIterator &it)
Definition: PNOStructures.cpp:221
std::valarray< int > maxranks_ij
maxranks for all pairs, negative->unlimited
Definition: PNOStructures.h:282
PNOPairs(const PairType &t, const size_t &n)
Definition: PNOStructures.h:262
MemInfo update_meminfo() const
Definition: PNOStructures.cpp:239
const PairType type
type (i.e. MP2_PAIRTYPE, CISPD_PAIRTYPE, later CCSD etc
Definition: PNOStructures.h:273
PNOPairs(const PairType &t, const size_t &n, const CISData &c)
Definition: PNOStructures.h:263
vfT W_ij_j
Fluctuation Potential.
Definition: PNOStructures.h:287
std::valarray< Tensor< double > > W_ij
Fluctuation matrix.
Definition: PNOStructures.h:281
POD structure for energies.
Definition: PNOStructures.h:112
PairEnergies(const size_t &npairs)
Definition: PNOStructures.h:114
PairEnergies operator+=(const PairEnergies &right)
Definition: PNOStructures.cpp:24
double total_energy() const
Definition: PNOStructures.h:123
PairEnergies()
Definition: PNOStructures.h:113
PairEnergies operator+(const PairEnergies &right) const
Definition: PNOStructures.cpp:40
std::valarray< double > eijs
singlet pair energies (for CIS(D) the GS Part)
Definition: PNOStructures.h:116
std::valarray< double > eijt_f12
triplet f12 pair energies (for CIS(D) the ES Part)
Definition: PNOStructures.h:119
std::valarray< double > eijs_f12
singlet f12 pair energies (for CIS(D) the GS Part)
Definition: PNOStructures.h:118
double energy
total correlation energy (regularized Energy for f12 calculation)
Definition: PNOStructures.h:121
std::valarray< double > eijt
triplet pair energies (for CIS(D) the ES Part)
Definition: PNOStructures.h:117
void update()
Definition: PNOStructures.h:129
double energy_f12
total f12 correlation energy
Definition: PNOStructures.h:122
std::valarray< double > eij
total pair energies
Definition: PNOStructures.h:120
Definition: PNOStructures.h:25
const size_t dim
Definition: PNOStructures.h:26
std::valarray< double > operator()()
Definition: PNOStructures.h:30
valarray_allocator operator=(const valarray_allocator &other)
Definition: PNOStructures.h:33
valarray_allocator(const size_t &indim)
Definition: PNOStructures.h:28
double ij(int64_t i, int64_t j)
Definition: test_distributed_matrix.cc:8