Psi4
local.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2018 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
29 #ifndef _psi_src_lib_libmints_local_h_
30 #define _psi_src_lib_libmints_local_h_
31 
32 #include <vector>
33 #include <memory>
34 
35 #include "psi4/pragma.h"
36 
37 namespace psi {
38 class Options;
39 
40 class Matrix;
41 
42 class BasisSet;
43 
45  protected:
46  // => Parameters <= //
47 
49  int print_;
51  int debug_;
53  int bench_;
54 
56  double convergence_;
58  int maxiter_;
59 
61  std::shared_ptr<BasisSet> primary_;
63  std::shared_ptr<Matrix> C_;
64 
65  // => Targets <= //
66 
68  std::shared_ptr<Matrix> L_;
70  std::shared_ptr<Matrix> U_;
72  bool converged_;
73 
75  void common_init();
76 
77  public:
78  // => Constructors <= //
79 
80  Localizer(std::shared_ptr<BasisSet> primary_, std::shared_ptr<Matrix> C);
81 
82  virtual ~Localizer();
83 
84  static std::shared_ptr<Localizer> build(const std::string &type, std::shared_ptr<BasisSet> primary,
85  std::shared_ptr<Matrix> C);
86 
87  static std::shared_ptr<Localizer> build(const std::string &type, std::shared_ptr<BasisSet> primary,
88  std::shared_ptr<Matrix> C, Options &options);
89 
90  static std::shared_ptr<Localizer> build(std::shared_ptr<BasisSet> primary, std::shared_ptr<Matrix> C,
91  Options &options);
92 
93  // => Computers <= //
94 
96  virtual void print_header() const = 0;
97 
99  virtual void localize() = 0;
100 
103  std::shared_ptr<Matrix> fock_update(std::shared_ptr<Matrix> F_orig);
104 
105  // => Accessors <= //
106 
107  std::shared_ptr<Matrix> L() const { return L_; }
108 
109  std::shared_ptr<Matrix> U() const { return U_; }
110 
111  bool converged() const { return converged_; }
112 
113  // => Knobs <= //
114 
115  void set_print(int print) { print_ = print; }
116 
117  void set_debug(int debug) { debug_ = debug; }
118 
119  void set_bench(int bench) { bench_ = bench; }
120 
121  void set_convergence(double convergence) { convergence_ = convergence; }
122 
123  void set_maxiter(int maxiter) { maxiter_ = maxiter; }
124 };
125 
127  protected:
129  void common_init();
130 
131  public:
132  BoysLocalizer(std::shared_ptr<BasisSet> primary, std::shared_ptr<Matrix> C);
133 
134  virtual ~BoysLocalizer();
135 
136  virtual void print_header() const;
137 
138  virtual void localize();
139 };
140 
141 class PMLocalizer : public Localizer {
142  protected:
144  void common_init();
145 
146  public:
147  PMLocalizer(std::shared_ptr<BasisSet> primary, std::shared_ptr<Matrix> C);
148 
149  virtual ~PMLocalizer();
150 
151  virtual void print_header() const;
152 
153  virtual void localize();
154 };
155 
156 } // Namespace psi
157 
158 #endif
std::shared_ptr< Matrix > L() const
Definition: local.h:107
void set_convergence(double convergence)
Definition: local.h:121
Definition: local.h:126
PMLocalizer(std::shared_ptr< BasisSet > primary, std::shared_ptr< Matrix > C)
Definition: libmints/local.cc:336
std::shared_ptr< Matrix > U() const
Definition: local.h:109
int print_
Print flag.
Definition: local.h:49
void set_maxiter(int maxiter)
Definition: local.h:123
void set_bench(int bench)
Definition: local.h:119
std::shared_ptr< Matrix > C_
Delocalized Orbitals.
Definition: local.h:63
virtual void localize()
Perform the localization algorithm.
Definition: libmints/local.cc:347
int debug_
Debug flug.
Definition: local.h:51
int maxiter_
Maximum number of iterations.
Definition: local.h:58
void common_init()
Set defaults.
Definition: libmints/local.cc:340
std::shared_ptr< Matrix > U_
MO -&gt; LO transformation.
Definition: local.h:70
Definition: liboptions.h:353
std::shared_ptr< BasisSet > primary_
Primary orbital basis set.
Definition: local.h:61
Definition: local.h:141
std::shared_ptr< Matrix > L_
Localized Orbitals.
Definition: local.h:68
#define PSI_API
Definition: pragma.h:155
Definition: local.h:44
virtual ~PMLocalizer()
Definition: libmints/local.cc:339
int bench_
Bench flag.
Definition: local.h:53
virtual void print_header() const
Print out the localization algorithm and parameters.
Definition: libmints/local.cc:341
bool converged() const
Definition: local.h:111
double convergence_
Relative convergence criteria.
Definition: local.h:56
void set_debug(int debug)
Definition: local.h:117
bool converged_
Did the algorithm converge?
Definition: local.h:72
void set_print(int print)
Definition: local.h:115