MPQC  3.0.0-alpha
psiref.h
1 //
2 // psiref.h
3 //
4 // Copyright (C) 2009 Edward Valeev
5 //
6 // Author: Edward Valeev <evaleev@vt.edu>
7 // Maintainer: EV
8 //
9 // This file is part of the SC Toolkit.
10 //
11 // The SC 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 SC 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 SC 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_src_lib_chemistry_qc_psi_psiref_h
29 #define _mpqc_src_lib_chemistry_qc_psi_psiref_h
30 
31 #include <chemistry/qc/nbody/ref.h>
32 #include <chemistry/qc/psi/psiwfn.h>
33 #include <chemistry/qc/psi/psici.h>
34 
35 namespace sc {
36 
39  public:
53  const Ref<PsiSCF>& scf,
54  bool spin_restricted = true,
55  unsigned int nfzc = 0,
56  unsigned int nfzv = 0,
57  Ref<OrbitalSpace> vir_space = 0);
61  const Ref<PsiSCF>& scf() const { return scf_; }
62  const Ref<OrbitalSpace>& vir_space() const { return vir_space_; }
64  if (vir_space_) return vir_space_->basis();
65  else return this->basis();
66  }
67 
68  void print(std::ostream& os = ExEnv::out0()) const;
69 
70  bool sdref() const { return true; }
71  double energy() { return scf()->energy(); }
72  double actual_value_accuracy () const { return scf()->actual_value_accuracy(); }
73  double desired_value_accuracy() const { return scf()->desired_value_accuracy(); }
74  bool desired_value_accuracy_set_to_default() const { return scf()->desired_value_accuracy_set_to_default(); }
75  int nelectron() const { return scf()->nelectron(); }
76  double magnetic_moment() const { return scf_->magnetic_moment(); }
77  bool spin_restricted() const { return spin_restricted_; }
78  int dk() const { return 0; }
79  Ref<GaussianBasisSet> momentum_basis() const { return 0; }
81  const Ref<GaussianBasisSet> &p_basis);
82  unsigned int nfzc() const { return nfzc_; }
83  unsigned int nfzv() const { return nfzv_; }
84  RefSymmSCMatrix ordm(SpinCase1 spin) const;
85  Ref<DensityFittingInfo> dfinfo() const;
86  private:
87  Ref<PsiSCF> scf_;
88  Ref<OrbitalSpace> vir_space_;
89  bool spin_restricted_;
90  unsigned int nfzc_;
91  unsigned int nfzv_;
92  void init_spaces();
93  void init_spaces_restricted();
94  void init_spaces_unrestricted();
95  void _set_desired_value_accuracy(double eps) { scf_->set_desired_value_accuracy(eps); }
96  };
97 
100  public:
114  const Ref<PsiRASCI>& wfn,
115  bool spin_restricted = true,
116  unsigned int nfzc = 0,
117  unsigned int nfzv = 0,
118  bool omit_uocc = false);
121  void save_data_state(StateOut&);
122  const Ref<PsiRASCI>& wfn() const { return wfn_; }
123 
124  void print(std::ostream& os = ExEnv::out0()) const;
125 
126  bool sdref() const { return false; }
127  double energy() { return wfn()->energy(); }
128  double actual_value_accuracy () const { return wfn()->actual_value_accuracy(); }
129  double desired_value_accuracy() const { return wfn()->desired_value_accuracy(); }
130  bool desired_value_accuracy_set_to_default() const { return wfn()->desired_value_accuracy_set_to_default(); }
131  int nelectron() const { return wfn()->nelectron(); }
132  double magnetic_moment() const { return wfn_->magnetic_moment(); }
133  bool spin_restricted() const { return spin_restricted_; }
134  int dk() const { return 0; }
135  Ref<GaussianBasisSet> momentum_basis() const { return 0; }
137  const Ref<GaussianBasisSet> &p_basis);
138  unsigned int nfzc() const { return nfzc_; }
139  unsigned int nfzv() const { return nfzv_; }
140  bool omit_uocc() const { return omit_uocc_; }
141  RefSymmSCMatrix ordm(SpinCase1 spin) const;
142  Ref<DensityFittingInfo> dfinfo() const;
143  private:
144  Ref<PsiRASCI> wfn_;
145  bool spin_restricted_;
146  unsigned int nfzc_;
147  unsigned int nfzv_;
148  bool omit_uocc_;
149  void init_spaces();
150  void _set_desired_value_accuracy(double eps) { wfn_->set_desired_value_accuracy(eps); }
151  };
152 
153 } // end of namespace sc
154 
155 #endif // end of header guard
156 
157 
158 // Local Variables:
159 // mode: c++
160 // c-file-style: "CLJ-CONDENSED"
161 // End:
sc::PsiRASCI_RefWavefunction::core_hamiltonian_for_basis
RefSymmSCMatrix core_hamiltonian_for_basis(const Ref< GaussianBasisSet > &basis, const Ref< GaussianBasisSet > &p_basis)
Returns the SO core Hamiltonian in the given basis and momentum basis.
sc::PsiSCF_RefWavefunction::ordm
RefSymmSCMatrix ordm(SpinCase1 spin) const
return the AO basis density
sc::PsiRASCI_RefWavefunction::ordm
RefSymmSCMatrix ordm(SpinCase1 spin) const
return the AO basis density
sc::PsiSCF_RefWavefunction::desired_value_accuracy_set_to_default
bool desired_value_accuracy_set_to_default() const
Definition: psiref.h:74
sc::PsiSCF_RefWavefunction::energy
double energy()
Definition: psiref.h:71
sc::PsiRASCI_RefWavefunction::dk
int dk() const
Definition: psiref.h:134
sc::PsiSCF_RefWavefunction::nelectron
int nelectron() const
Definition: psiref.h:75
sc::RefSymmSCMatrix
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition: matrix.h:265
sc::PsiRASCI_RefWavefunction::energy
double energy()
Definition: psiref.h:127
sc::PsiSCF_RefWavefunction::PsiSCF_RefWavefunction
PsiSCF_RefWavefunction(const Ref< WavefunctionWorld > &world, const Ref< PsiSCF > &scf, bool spin_restricted=true, unsigned int nfzc=0, unsigned int nfzv=0, Ref< OrbitalSpace > vir_space=0)
construct from a PsiSCF object
sc::PsiSCF_RefWavefunction
RefWavefunction specialization initialized with a PsiSCF wave function.
Definition: psiref.h:38
sc::Ref
A template class that maintains references counts.
Definition: ref.h:361
sc::PsiSCF_RefWavefunction::momentum_basis
Ref< GaussianBasisSet > momentum_basis() const
Definition: psiref.h:79
sc::PsiSCF_RefWavefunction::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::PsiRASCI_RefWavefunction::actual_value_accuracy
double actual_value_accuracy() const
Return the accuracy with which the value has been computed.
Definition: psiref.h:128
sc::PsiSCF_RefWavefunction::dk
int dk() const
Definition: psiref.h:78
sc::PsiSCF_RefWavefunction::dfinfo
Ref< DensityFittingInfo > dfinfo() const
which DensityFittingRuntime used to compute this reference wave function
sc::StateIn
Definition: statein.h:79
sc::PsiRASCI_RefWavefunction::PsiRASCI_RefWavefunction
PsiRASCI_RefWavefunction(const Ref< WavefunctionWorld > &world, const Ref< PsiRASCI > &wfn, bool spin_restricted=true, unsigned int nfzc=0, unsigned int nfzv=0, bool omit_uocc=false)
construct from a PsiRASCI object
sc::PsiSCF_RefWavefunction::sdref
bool sdref() const
is this a single-determinantal reference?
Definition: psiref.h:70
sc::PsiSCF_RefWavefunction::core_hamiltonian_for_basis
RefSymmSCMatrix core_hamiltonian_for_basis(const Ref< GaussianBasisSet > &basis, const Ref< GaussianBasisSet > &p_basis)
Returns the SO core Hamiltonian in the given basis and momentum basis.
sc::PsiSCF_RefWavefunction::print
void print(std::ostream &os=ExEnv::out0()) const
Print the object.
sc::PsiSCF_RefWavefunction::desired_value_accuracy
double desired_value_accuracy() const
Definition: psiref.h:73
sc::PsiRASCI_RefWavefunction::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::PsiRASCI_RefWavefunction::nelectron
int nelectron() const
Definition: psiref.h:131
sc::PsiSCF_RefWavefunction::actual_value_accuracy
double actual_value_accuracy() const
Return the accuracy with which the value has been computed.
Definition: psiref.h:72
sc::StateOut
Definition: stateout.h:71
sc::PsiSCF_RefWavefunction::magnetic_moment
double magnetic_moment() const
Definition: psiref.h:76
sc::PsiRASCI_RefWavefunction::sdref
bool sdref() const
is this a single-determinantal reference?
Definition: psiref.h:126
sc::PsiRASCI_RefWavefunction::magnetic_moment
double magnetic_moment() const
Definition: psiref.h:132
sc::PsiRASCI_RefWavefunction::desired_value_accuracy_set_to_default
bool desired_value_accuracy_set_to_default() const
Definition: psiref.h:130
sc::PsiRASCI_RefWavefunction::dfinfo
Ref< DensityFittingInfo > dfinfo() const
which DensityFittingRuntime used to compute this reference wave function
sc::RefWavefunction
RefWavefunction represents the reference wave function (or, more generally, a state) used as a starti...
Definition: ref.h:159
sc::ExEnv::out0
static std::ostream & out0()
Return an ostream that writes from node 0.
sc::PsiRASCI_RefWavefunction::momentum_basis
Ref< GaussianBasisSet > momentum_basis() const
Definition: psiref.h:135
sc::PsiRASCI_RefWavefunction
RefWavefunction specialization for a general restricted-active-space multiconfiguration wave function...
Definition: psiref.h:99
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
sc::PsiRASCI_RefWavefunction::desired_value_accuracy
double desired_value_accuracy() const
Definition: psiref.h:129
sc::PsiRASCI_RefWavefunction::print
void print(std::ostream &os=ExEnv::out0()) const
Print the object.
sc::PsiSCF_RefWavefunction::uocc_basis
const Ref< GaussianBasisSet > & uocc_basis() const
returns the basis supporting unoccupied orbitals. The defauls is same as returned by basis().
Definition: psiref.h:63

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