MPQC  3.0.0-alpha
tawfn.hpp
1 //
2 // tawfn.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_WFN_TAWFN_HPP_
29 #define _MPQC_CHEMISTRY_WFN_TAWFN_HPP_
30 
31 #include <tiledarray_fwd.h>
32 #include <util/madness/world.h>
33 #include <chemistry/qc/basis/integral.h>
34 #include <chemistry/qc/basis/tiledbasisset.hpp>
35 #include <chemistry/molecule/energy.h>
36 #include <chemistry/qc/wfn/spin.h>
37 
38 // will happen: namespace sc -> namespace mpqc
39 
40 namespace mpqc {
41  namespace TA {
42 
45 
50 
51  public:
52 
53  typedef TiledArray::TArray1D TAVector;
54  typedef TiledArray::TArray2D TAMatrix;
59  typedef TiledArray::TensorD TATensor;
60 
61 
65  Wavefunction(const sc::Ref<sc::KeyVal> &kval);
66  //Wavefunction(sc::StateIn &s);
67  virtual ~Wavefunction();
68  //void save_data_state(sc::StateOut &s);
69 
71  const sc::Ref<TiledBasisSet>& basis() const {
72  return tbs_;
73  }
76  return integral_;
77  }
78 
80  sc::Ref<sc::Molecule> molecule() const override {
81  return tbs_->molecule();
82  }
83 
85  double total_charge() const{
86  return molecule()->total_charge() - nelectron();
87  }
88 
90  virtual size_t nelectron() const = 0;
91 
102  virtual double magnetic_moment() const;
104  bool spin_polarized() {
105  return magnetic_moment() != 0.0;
106  }
107 
109  virtual const TAMatrix& rdm1() = 0;
110 
115  //virtual TAMatrixExpr rdm1_expr(std::string);
116 
118  virtual const TAMatrix& rdm1(sc::SpinCase1 s) = 0;
120  virtual const TAMatrix& ao_overlap();
121 
126  //virtual TAMatrixExpr ao_overlap_expr(std::string);
127 
129  virtual const TAMatrix& ao_hcore();
130 
135  //virtual TAMatrixExpr ao_hcore_expr(std::string);
136 
138  unsigned debug() const {
139  return debug_;
140  }
141 
142 
144  void obsolete();
145 
146  void print(std::ostream& os = sc::ExEnv::out0()) const;
147 
148  // functions for internal access
149  protected:
150 
151  const sc::Ref<mpqc::World> world() const {
152  return world_;
153  }
154 
157  virtual TAMatrix& ao_density(){
158  return rdm1_.result_noupdate();
159  }
160 
161  ResultMatrix rdm1_; // Result density abreviated D
162  ResultMatrix rdm1_alpha_; // Result alpha density abreviated Da
163  ResultMatrix rdm1_beta_; // Result beta density abreviated Db
164 
165  private:
166 
167  sc::Ref<mpqc::World> world_;
169  sc::Ref<sc::Integral> integral_;
170  ResultMatrix overlap_; // Overlap Matrix abreviated S
171  ResultMatrix hcore_; // Hcore Matrix abreviated H
172 
173  mutable double magnetic_moment_;
174  bool nonzero_efield_supported() const;
177 
178  unsigned debug_;
179 
180  private:
181  static sc::ClassDesc class_desc_;
182 
183  };
184 
186 
187  }// namespace mpqc::TA
188 } // namespace mpqc
189 
190 #endif /* CHEMISTRY_WFN_TAWFN_HPP */
mpqc::TA::Wavefunction::Wavefunction
Wavefunction(const sc::Ref< sc::KeyVal > &kval)
The KeyVal constructor.
mpqc::TA::Wavefunction::basis
const sc::Ref< TiledBasisSet > & basis() const
Definition: tawfn.hpp:71
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::Molecule::total_charge
double total_charge() const
Returns the total nuclear charge.
mpqc::TA::Wavefunction::ao_hcore
virtual const TAMatrix & ao_hcore()
Returns expression to the AO overlap matrix.
sc::Ref< sc::KeyVal >
mpqc::TA::Wavefunction::nelectron
virtual size_t nelectron() const =0
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::Wavefunction::rdm1
virtual const TAMatrix & rdm1()=0
Returns electron 1-body reduced density matrix (1-RDM) in AO basis.
sc::AccResult
This associates a result datum with an accuracy.
Definition: comptmpl.h:88
mpqc::TA::Wavefunction::ao_overlap
virtual const TAMatrix & ao_overlap()
Returns the AO overlap.
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::Wavefunction::print
void print(std::ostream &os=sc::ExEnv::out0()) const
Print information about the object.
sc::MolecularEnergy
The MolecularEnergy abstract class inherits from the Function class.
Definition: energy.h:50
mpqc::TA::Wavefunction::molecule
sc::Ref< sc::Molecule > molecule() const override
Definition: tawfn.hpp:80
mpqc::TA::Wavefunction::spin_polarized
bool spin_polarized()
Definition: tawfn.hpp:104
mpqc::TA::Wavefunction::magnetic_moment
virtual double magnetic_moment() const
Computes the S (or J) magnetic moment of the target state(s), in units of .
mpqc::TA::Wavefunction::obsolete
void obsolete()
makes this object obsolete, next call to compute() will recompute
mpqc::TA::Wavefunction::ao_density
virtual TAMatrix & ao_density()
Returns reference to rdm1_.result_noupdate(), but guarantees nothing about its computed status.
Definition: tawfn.hpp:157
sc::ExEnv::out0
static std::ostream & out0()
Return an ostream that writes from node 0.
mpqc::TA::Wavefunction::debug
unsigned debug() const
Returns expression to the AO hcore matrix.
Definition: tawfn.hpp:138
sc::Result
Result are members of Compute specializations that keep track of whether or not a particular result s...
Definition: comptmpl.h:37
mpqc::TA::Wavefunction::total_charge
double total_charge() const
Definition: tawfn.hpp:85
mpqc::TA::Wavefunction::integral
const sc::Ref< sc::Integral > & integral() const
Definition: tawfn.hpp:75

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