v2DM-DOCI  1.0
BoundaryPoint.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 BOUNDARY_POINT_H
25 #define BOUNDARY_POINT_H
26 
27 #include "include.h"
28 
29 namespace CheMPS2 { class Hamiltonian; }
30 
31 namespace doci2DM
32 {
33 
34 class BoundaryPoint: public Method
35 {
36  public:
37 
39 
40  BoundaryPoint(const TPM &);
41 
43 
44  BoundaryPoint(BoundaryPoint &&) = default;
45 
46  virtual ~BoundaryPoint() = default;
47 
49 
50  BoundaryPoint& operator=(BoundaryPoint &&) = default;
51 
52  BoundaryPoint* Clone() const;
53 
55 
56  void BuildHam(const CheMPS2::Hamiltonian &);
57 
58  void BuildHam(const TPM &);
59 
60  unsigned int Run();
61 
62  double getFullEnergy() const;
63 
64  void set_tol_PD(double);
65 
66  void set_tol_en(double);
67 
68  void set_mazzy(double);
69 
70  void set_sigma(double);
71 
72  void set_max_iter(unsigned int);
73 
74  double get_tol_PD() const;
75 
76  SUP& getX() const;
77 
78  SUP& getZ() const;
79 
80  Lineq& getLineq() const;
81 
82  TPM& getRDM() const;
83 
84  TPM& getHam() const;
85 
86  void set_use_prev_result(bool);
87 
88  double evalEnergy() const;
89 
90  void ReturnHighWhenBailingOut(bool);
91 
92  void Reset_avg_iters();
93 
94  double get_P_conv() const;
95 
96  double get_D_conv() const;
97 
98  double get_convergence() const;
99 
100  bool FullyConverged() const;
101 
102  std::vector<double> energyperirrep(const CheMPS2::Hamiltonian &, bool print=false);
103 
104  private:
105 
106  std::unique_ptr<TPM> ham;
107 
108  std::unique_ptr<SUP> X;
109 
110  std::unique_ptr<SUP> Z;
111 
112  std::unique_ptr<Lineq> lineq;
113 
114  double nuclrep;
115 
116  double tol_PD, tol_en;
117 
118  double mazzy;
119 
120  double sigma;
121 
122  unsigned int max_iter;
123 
124  unsigned int avg_iters;
125 
126  unsigned int iters;
127  unsigned int runs;
128 
130 
133 
136 };
137 
138 }
139 
140 #endif /* BOUNDARY_POINT_H */
141 
142 /* vim: set ts=3 sw=3 expandtab :*/
std::unique_ptr< SUP > Z
BoundaryPoint & operator=(const BoundaryPoint &)
double get_P_conv() const
std::unique_ptr< SUP > X
Lineq & getLineq() const
std::vector< double > energyperirrep(const CheMPS2::Hamiltonian &, bool print=false)
double getFullEnergy() const
double get_convergence() const
bool FullyConverged() const
bool returnhigh
when true, return very high value for the energy if the calculation takes too many iterations ...
std::unique_ptr< Lineq > lineq
BoundaryPoint(const CheMPS2::Hamiltonian &)
BoundaryPoint * Move()
double evalEnergy() const
void ReturnHighWhenBailingOut(bool)
double get_D_conv() const
void set_max_iter(unsigned int)
std::unique_ptr< TPM > ham
BoundaryPoint * Clone() const
double get_tol_PD() const
void BuildHam(const CheMPS2::Hamiltonian &)
virtual ~BoundaryPoint()=default
double D_conv
the 3 convergence criteria