MPQC  3.0.0-alpha
tascf.hpp
1 //
2 // tascf.hpp
3 //
4 // Copyright (C) 2013 Drew Lewis
5 //
6 // Authors: Drew Lewis
7 // Maintainer: Drew Lewis and Edward Valeev
8 //
9 // This file is part of the MPQC Toolkit.
10 //
11 // The MPQC Toolkit is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Library General Public License as published by
13 // the Free Software Foundation; either version 2, or (at your option)
14 // any later version.
15 //
16 // The MPQC Toolkit is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU Library General Public License for more details.
20 //
21 // You should have received a copy of the GNU Library General Public License
22 // along with the MPQC Toolkit; see the file COPYING.LIB. If not, write to
23 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 //
25 // The U.S. Government is granted a limited license as per AL 91-7.
26 //
27 
28 #ifndef _MPQC_CHEMISTRY_QC_SCF_TASCF_HPP_
29 #define _MPQC_CHEMISTRY_QC_SCF_TASCF_HPP_
30 
31 #include <chemistry/qc/wfn/tawfn.hpp>
32 #include <chemistry/qc/basis/integral.h>
33 #include <chemistry/qc/basis/tbint.h>
34 #include <elemental-lite.hpp>
35 
36 namespace mpqc{
37  namespace TA {
38 
39  class SCF : public Wavefunction {
40  public:
41  typedef Wavefunction::TAMatrix TAMatrix;
42  typedef Wavefunction::TAVector TAVector;
43  //typedef Wavefunction::TAMatrixExpr TAMatrixExpr;
44  typedef elem::DistMatrix<double, elem::VR, elem::STAR> ElemVector;
45  typedef std::pair<ElemVector, TAMatrix> ElemTAEigenSystem;
46 
50  SCF(const sc::Ref<sc::KeyVal> &kval);
51  virtual ~SCF();
52 
54  virtual size_t nelectron() const override;
55 
57  virtual size_t occupation() const {return occupation_;}
58 
63  TAMatrix MO_eigenvectors(double);
64 
69  TAMatrix
71  return MO_eigenvectors(MO_eigensystem_.desired_accuracy());
72  }
73 
78  ElemVector
79  MO_eigenvalues(double);
80 
85  ElemVector
87  return MO_eigenvalues(MO_eigensystem_.desired_accuracy());
88  }
89 
93  ElemTAEigenSystem
94  MO_eigensystem(double);
95 
99  ElemTAEigenSystem
101  return MO_eigensystem(MO_eigensystem_.desired_accuracy());
102  }
103 
105  TAMatrix& ao_fock(double);
106 
108  TAMatrix& ao_fock(){return ao_fock(ao_fock_.desired_accuracy());}
109 
114  //TAMatrixExpr ao_fock_expr(std::string);
115 
117  virtual double scf_energy() = 0;
118 
119  void print(std::ostream &os = sc::ExEnv::out0()) const;
120 
121  protected:
122 
123  typedef Wavefunction::AccResultMatrix AccResultMatrix;
124  typedef Wavefunction::AccResultVector AccResultVector;
125  typedef sc::AccResult<ElemTAEigenSystem> AccResultEigenSystem;
126 
127  virtual void compute_ao_fock(double) = 0;
128 
129  // returns & to the current state of ao_fock_ used for computing.
130  virtual TAMatrix& scf_ao_fock_(){return ao_fock_.result_noupdate();}
131 
132  unsigned int miniter() const {return miniter_; }
133  unsigned int maxiter() const {return maxiter_; }
134 
135  void set_occupation(unsigned int i){occupation_ = i;}
136 
137  private:
138  // default number of iterations to use
139  unsigned int maxiter_ = 100;
140  unsigned int miniter_ = 0;
141 
142  // The ao_fock matrix
143  AccResultMatrix ao_fock_;
144  // Holds the eigensystem of the ao_fock matrix
145  AccResultEigenSystem MO_eigensystem_;
146 
147  // Number of electrons
148  size_t occupation_ = 0;
149 
150  static sc::ClassDesc class_desc_;
151 
152  };
153  } // namespace mpqc::TA
154 } //namespace mpqc
155 
156 
157 #endif /* _MPQC_CHEMISTRY_QC_SCF_TASCF_HPP_ */
mpqc::TA::Wavefunction::TAMatrix
TiledArray::TArray2D TAMatrix
Matrix of reals.
Definition: tawfn.hpp:54
mpqc
Contains new MPQC code since version 3.
Definition: integralenginepool.hpp:37
sc::Ref< sc::KeyVal >
mpqc::TA::SCF::occupation
virtual size_t occupation() const
Definition: tascf.hpp:57
mpqc::TA::Wavefunction
Wavefunction represents an electronic wave function expressed in terms of a basis set of atomic orbit...
Definition: tawfn.hpp:49
mpqc::TA::SCF::MO_eigensystem
ElemTAEigenSystem MO_eigensystem()
Definition: tascf.hpp:100
sc::AccResult
This associates a result datum with an accuracy.
Definition: comptmpl.h:88
mpqc::TA::Wavefunction::TAVector
TiledArray::TArray1D TAVector
Vector of reals.
Definition: tawfn.hpp:53
sc::ClassDesc
This class is used to contain information about classes.
Definition: class.h:147
mpqc::TA::SCF::print
void print(std::ostream &os=sc::ExEnv::out0()) const
Print information about the object.
mpqc::TA::SCF::scf_energy
virtual double scf_energy()=0
Returns an expression to ao_fock matrix.
mpqc::TA::SCF::ao_fock
TAMatrix & ao_fock()
Definition: tascf.hpp:108
sc::ExEnv::out0
static std::ostream & out0()
Return an ostream that writes from node 0.
mpqc::TA::SCF::MO_eigenvalues
ElemVector MO_eigenvalues()
Definition: tascf.hpp:86
mpqc::TA::SCF::MO_eigenvectors
TAMatrix MO_eigenvectors()
Definition: tascf.hpp:70
mpqc::TA::SCF::SCF
SCF(const sc::Ref< sc::KeyVal > &kval)
SCF KeyValue constructor.
mpqc::TA::SCF::nelectron
virtual size_t nelectron() const override
mpqc::TA::SCF
Definition: tascf.hpp:39

Generated at Sun Jan 26 2020 23:24:00 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.