CheMPS2
ConvergenceScheme.h
1 /*
2  CheMPS2: a spin-adapted implementation of DMRG for ab initio quantum chemistry
3  Copyright (C) 2013-2016 Sebastian Wouters
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 
20 #ifndef CONVERGENCESCHEME_CHEMPS2_H
21 #define CONVERGENCESCHEME_CHEMPS2_H
22 
23 #include "Options.h"
24 
25 namespace CheMPS2{
42 
43  public:
44 
46 
47  ConvergenceScheme(const int num_instructions);
48 
50  virtual ~ConvergenceScheme();
51 
53 
54  int get_number() const;
55 
57 
63  void set_instruction(const int instruction, const int D, const double energy_conv, const int max_sweeps, const double noise_prefactor, const double davidson_rtol);
64 
66 
71  void setInstruction(const int instruction, const int D, const double energy_conv, const int max_sweeps, const double noise_prefactor){
72  set_instruction( instruction, D, energy_conv, max_sweeps, noise_prefactor, CheMPS2::DAVIDSON_DMRG_RTOL );
73  }
74 
76 
78  int get_D(const int instruction) const;
79 
81 
83  double get_energy_conv(const int instruction) const;
84 
86 
88  int get_max_sweeps(const int instruction) const;
89 
91 
93  double get_noise_prefactor(const int instruction) const;
94 
96 
98  double get_dvdson_rtol(const int instruction) const;
99 
100  private:
101 
102  //The number of instructions
103  int num_instructions;
104 
105  //Number of renormalized states
106  int * num_D;
107 
108  //Energy convergence thresholds
109  double * energy_convergence;
110 
111  //Maximum number of sweeps per instruction
112  int * num_max_sweeps;
113 
114  //The noise prefactor for each instruction
115  double * noise_prefac;
116 
117  //The Davidson residual tolerance for each instruction
118  double * dvdson_rtol;
119 
120  };
121 }
122 
123 #endif
virtual ~ConvergenceScheme()
Destructor.
double get_energy_conv(const int instruction) const
Get the energy convergence threshold for a particular instruction.
double get_noise_prefactor(const int instruction) const
Get the noise prefactor for a particular instruction.
void set_instruction(const int instruction, const int D, const double energy_conv, const int max_sweeps, const double noise_prefactor, const double davidson_rtol)
Set an instruction.
Definition: CASPT2.h:42
int get_D(const int instruction) const
Get the number of renormalized states for a particular instruction.
int get_number() const
Get the number of instructions.
int get_max_sweeps(const int instruction) const
Get the maximum number of sweeps for a particular instruction.
double get_dvdson_rtol(const int instruction) const
Get the Davidson residual tolerance for a particular instruction.
void setInstruction(const int instruction, const int D, const double energy_conv, const int max_sweeps, const double noise_prefactor)
Set an instruction.
ConvergenceScheme(const int num_instructions)
Constructor.