8 #ifndef PAPER_CODE_PNO_H_
9 #define PAPER_CODE_PNO_H_
12 #define PAIRLOOP(it) for(ElectronPairIterator it=pit();it;++it)
13 #define TIMER(timer) MyTimer timer=MyTimer(world).start();
39 Q(
nemo.get_calc()->amo),
49 std::string
name()
const {
return "PNO";};
53 print(
"The PNO code computes MP2 energies using pair natural orbitals");
54 print(
"You can print all available calculation parameters by running\n");
55 print(
"pno --print_parameters\n");
56 print(
"You can perform a simple calculation by running\n");
57 print(
"pno --geometry=h2o.xyz\n");
58 print(
"provided you have an xyz file in your directory.");
64 print(
"default parameters for the pno program are\n");
68 print(
"\n\nadditional parameters for the correlation factor are\n");
69 f12param.
print(
"f12",
"end");
71 print(
"\n\nthe molecular geometry must be specified in a separate block:");
86 std::vector<PNOPairs> dummy;
90 void solve(std::vector<PNOPairs>& all_pairs)
const;
117 pairs.push_back(mp2);
124 std::vector<PNOPairs>
solve_cispd(std::vector<PNOPairs>& pairs)
const;
127 std::pair<size_t, size_t>
get_average_rank(
const std::valarray<vector_real_function_3d>& va)
const;
187 const double R_convergence_threshold = 1
e-6,
const size_t max_niter = 100)
const;
214 template<
typename projector>
218 const projector& Qpr)
const;
226 template<
typename projector>
Definition: derivatives.cc:60
Definition: PNOGuessFunctions.h:33
Definition: PNOParameters.h:227
EnergyType energytype() const
Definition: PNOParameters.h:256
Class that provides all necessary F12 Potentials and Integrals.
Definition: PNOF12Potentials.h:18
ElectronPairIterator pit() const
Convenience: Get electron pair iterator.
Definition: PNOF12Potentials.h:59
vector_real_function_3d acmos
Active Molecular Orbitals.
Definition: PNOF12Potentials.h:35
F12Parameters param
parameters
Definition: PNOF12Potentials.h:24
static void print_parameters()
Definition: molecule.cc:110
The Nemo class.
Definition: nemo.h:326
std::shared_ptr< SCF > get_calc() const
Definition: nemo.h:482
Definition: PNOParameters.h:30
std::size_t freeze() const
Definition: PNOParameters.h:158
PairType restart() const
Definition: PNOParameters.h:195
bool f12() const
Definition: PNOParameters.h:201
double op_thresh() const
Definition: PNOParameters.h:194
QProjector< double, 3 > Q
Definition: PNO.h:271
bool update_pno(PNOPairs &pairs, const std::valarray< Tensor< double > > &rdm_evals_ij, const Tensor< double > &F_occ) const
Definition: PNO.cpp:2156
std::vector< PNOPairs > solve_cispd(std::vector< PNOPairs > &pairs) const
solve the PNO-CIS(D) equations
Definition: PNO.cpp:500
F12Potentials f12
Definition: PNO.h:274
std::string name() const
Definition: PNO.h:49
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
Definition: PNO.cpp:2689
std::valarray< Tensor< double > > pno_compress(PNOPairs &pairs, const double tpno) const
Compress the PNOs -> lose all PNOs which eigenvalue is below tpno.
Definition: PNO.cpp:1959
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
Definition: PNO.cpp:2442
PNOPairs iterate_pairs(PNOPairs &pairs) const
Definition: PNO.cpp:971
void canonicalize(PNOPairs &v) const
Definition: PNO.cpp:2591
size_t nocc() const
convenience
Definition: PNO.h:276
PNOParameters param
calculation parameters
Definition: PNO.h:264
Kinetic< double, 3 > T
Definition: PNO.h:268
PNOPairs initialize_pairs(PNOPairs &pairs, const GuessType &inpgt=UNKNOWN_GUESSTYPE) const
Definition: PNO.cpp:741
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
Definition: PNO.cpp:2714
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
Definition: PNO.cpp:636
PNOPairs compute_fluctuation_potential(const ElectronPairIterator &it, PNOPairs &pairs) const
Compute the MP2 fluctuation potential of a speficif pair.
Definition: PNO.cpp:881
PNOPairs adaptive_solver(PNOPairs &pairs) const
Solve with adaptive solver descriped in the JPC paper.
Definition: PNO.cpp:1000
virtual bool selftest()
Definition: PNO.h:75
vector_real_function_3d guess_virtuals(const vector_real_function_3d &f=vector_real_function_3d(), const GuessType &inpgt=UNKNOWN_GUESSTYPE) const
Definition: PNO.cpp:90
bool is_guess_from_scratch(const PairType &ct) const
Definition: PNO.h:145
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
Definition: PNO.cpp:2424
size_t nact() const
Definition: PNO.h:277
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
Definition: PNO.cpp:2047
Nemo nemo
Definition: PNO.h:265
void check_orthonormality(const vector_real_function_3d &v) const
Definition: PNO.cpp:2729
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
Definition: PNO.cpp:1747
PNOPairs load_pnos(PNOPairs &pairs) const
load PNOs from disc
Definition: PNO.cpp:2617
PNO(World &world, const Nemo &nemo, const PNOParameters ¶meters, const F12Parameters ¶mf12)
Definition: PNO.h:30
CCMessenger msg
Definition: PNO.h:280
std::shared_ptr< operatorT> poperatorT
Definition: PNO.h:29
ParametrizedExchange K
Definition: PNO.h:267
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)
Definition: PNO.cpp:319
PairEnergies compute_projected_mp2_energies(PNOPairs &pairs) const
Definition: PNO.cpp:12
PairEnergies compute_cispd_correction_gs(const vector_real_function_3d &xcis, const PNOPairs &pairs) const
Definition: PNO.cpp:186
void save_pnos(const PNOPairs &pairs) const
save PNOs on disc
Definition: PNO.cpp:2608
Nuclear< double, 3 > V
Definition: PNO.h:269
OrbitalIterator oit() const
convenience
Definition: PNO.h:279
PNOPairs truncate_pair_ranks(PNOPairs &pairs) const
Truncate the ranks of pairs to the given maxrank.
Definition: PNO.cpp:722
void solve_mp2(std::vector< PNOPairs > &pairs) const
solve PNO-MP2 equations
Definition: PNO.h:113
ElectronPairIterator pit() const
Definition: PNO.h:278
PNOPairs orthonormalize_cholesky(PNOPairs &pairs) const
convenience
Definition: PNO.cpp:1597
Tensor< double > compute_cispd_fluctuation_matrix(const ElectronPairIterator &it, PNOPairs &pairs) const
Definition: PNO.cpp:2467
static void print_parameters()
Definition: PNO.h:62
std::vector< poperatorT > make_bsh_operators(World &world, const tensorT &evals) const
Convenience function to initialize all bsh operators.
Definition: PNO.cpp:2408
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
Definition: PNO.cpp:2704
Fock< double, 3 > F
Definition: PNO.h:270
void update_fluctuation_potentials(PNOPairs &pairs) const
compute all fluctuation potentials and store them in the pair structure
Definition: PNO.cpp:2636
EnergyType energytype() const
convenience
Definition: PNO.h:183
Coulomb< double, 3 > J
Definition: PNO.h:266
BasisFunctions basis
class which holds all methods to read or create guess functions for PNO or CABS
Definition: PNO.h:273
void solve() const
Definition: PNO.h:85
PNOPairs iterate_pairs_internal(PNOPairs &pairs, const int maxiter, const double econv) const
Definition: PNO.cpp:1113
PNOPairs grow_rank(PNOPairs &pairs, std::string exop) const
Definition: PNO.cpp:1536
void print_ranks(const PNOPairs &pairs) const
Print information about the PNO rank of all pairs (i.e. the number of PNO functions)
Definition: PNO.cpp:2134
PNOPairs compute_cispd_fluctuation_potential(const ElectronPairIterator &it, PNOPairs &pairs) const
Compute the CIS(D) fluctuation potential of a specific pair.
Definition: PNO.cpp:909
World & world
Definition: PNO.h:263
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)
Definition: PNO.cpp:1654
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
Definition: PNO.cpp:2659
static void help()
Definition: PNO.h:51
PairEnergies compute_cispd_correction_es(const vector_real_function_3d &xcis, PNOPairs &pairs) const
Definition: PNO.cpp:118
std::shared_ptr< real_convolution_3d > poisson
Definition: PNO.h:272
PNOPairs freeze_insignificant_pairs(PNOPairs &pairs) const
Definition: PNO.cpp:675
PNOPairs truncate_pairs(PNOPairs &pairs) const
Definition: PNO.cpp:649
Definition: PNOStructures.h:45
void print(const std::string header="", const std::string footer="") const
print all parameters
Definition: QCCalculationParametersBase.cc:22
class implementing properties of QC models
Definition: QCPropertyInterface.h:11
A parallel world class.
Definition: world.h:132
const int maxiter
Definition: gygi_soltion.cc:68
static const double v
Definition: hatom_sf_dirac.cc:20
#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 const char * filename
Definition: legendre.cc:96
void print_header2(const std::string &s)
medium section heading
Definition: print.cc:54
EnergyType
Definition: PNOParameters.h:21
@ HYLLERAAS_ENERGYTYPE
Definition: PNOParameters.h:21
@ PROJECTED_ENERGYTYPE
Definition: PNOParameters.h:21
std::vector< real_function_3d > vector_real_function_3d
Definition: functypedefs.h:79
GuessType
Definition: PNOParameters.h:25
@ UNKNOWN_GUESSTYPE
Definition: PNOParameters.h:25
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
std::vector< std::string > cubefile_header(std::string filename="input", const bool &no_orient=false)
Definition: molecule.cc:69
NDIM & f
Definition: mra.h:2416
static SeparatedConvolution< double, 3 > * CoulombOperatorPtr(World &world, double lo, double eps, const BoundaryConditions< 3 > &bc=FunctionDefaults< 3 >::get_bc(), int k=FunctionDefaults< 3 >::get_k())
Factory function generating separated kernel for convolution with 1/r in 3D.
Definition: operator.h:1762
PairType
Definition: PNOParameters.h:17
@ MP2_PAIRTYPE
Definition: PNOParameters.h:17
@ ALL_PAIRTYPE
Definition: PNOParameters.h:17
Definition: CCStructures.h:77
Definition: PNOStructures.h:174
iterates the third index for pair coupling
Definition: PNOStructures.h:143
POD for PNO code.
Definition: PNOStructures.h:245
POD structure for energies.
Definition: PNOStructures.h:112
Definition: dirac-hatom.cc:108
void e()
Definition: test_sig.cc:75
static Molecule molecule
Definition: testperiodicdft.cc:38