v2DM-DOCI  1.0
Method.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Copyright (C) 2014-2015 Ward Poelmans
5  *
6  * This file is part of v2DM-DOCI.
7  *
8  * v2DM-DOCI is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * Foobar is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
20  *
21  * @END LICENSE
22  */
23 
24 #ifndef METHOD_H
25 #define METHOD_H
26 
27 #include <memory>
28 
29 namespace CheMPS2 { class Hamiltonian; }
30 
31 namespace doci2DM
32 {
33 class TPM;
34 
35 class Method
36 {
37  public:
38 
39  Method() { do_output = true; }
40 
41  virtual ~Method() = default;
42 
43  virtual unsigned int Run() = 0;
44 
45  virtual void BuildHam(const CheMPS2::Hamiltonian &) = 0;
46 
47  virtual void BuildHam(const TPM &) = 0;
48 
49  virtual Method* Clone() const = 0;
50 
51  virtual Method* Move() = 0;
52 
53  virtual TPM& getRDM() const = 0;
54 
55  virtual TPM& getHam() const = 0;
56 
57  virtual double evalEnergy() const = 0;
58 
59  double getEnergy() const { return energy; }
60 
61  virtual void set_output(bool out) { do_output = out; }
62 
63  virtual void set_outfile(std::string filename) { outfile = filename; }
64 
65  virtual bool FullyConverged() const = 0;
66 
67  protected:
68 
69  int L;
70 
71  int N;
72 
73  double energy;
74 
75  bool do_output;
76 
77  std::string outfile;
78 };
79 
80 }
81 
82 #endif /* METHOD_H */
83 
84 /* vim: set ts=3 sw=3 expandtab :*/
std::string outfile
Definition: Method.h:77
virtual Method * Clone() const =0
virtual void set_outfile(std::string filename)
Definition: Method.h:63
virtual void BuildHam(const CheMPS2::Hamiltonian &)=0
virtual TPM & getRDM() const =0
double getEnergy() const
Definition: Method.h:59
virtual unsigned int Run()=0
virtual double evalEnergy() const =0
virtual void set_output(bool out)
Definition: Method.h:61
bool do_output
Definition: Method.h:75
virtual Method * Move()=0
double energy
Definition: Method.h:73
virtual bool FullyConverged() const =0
virtual ~Method()=default
virtual TPM & getHam() const =0