MPQC 3.0.0-alpha
Loading...
Searching...
No Matches
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
35namespace 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; }
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;
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);
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; }
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;
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:
static std::ostream & out0()
Return an ostream that writes from node 0.
RefWavefunction specialization for a general restricted-active-space multiconfiguration wave function...
Definition psiref.h:99
bool desired_value_accuracy_set_to_default() const
Definition psiref.h:130
RefSymmSCMatrix ordm(SpinCase1 spin) const
return the AO basis density
Ref< GaussianBasisSet > momentum_basis() const
Definition psiref.h:135
double actual_value_accuracy() const
Return the accuracy with which the value has been computed.
Definition psiref.h:128
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
Ref< DensityFittingInfo > dfinfo() const
which DensityFittingRuntime used to compute this reference wave function
double magnetic_moment() const
Definition psiref.h:132
double energy()
Definition psiref.h:127
double desired_value_accuracy() const
Definition psiref.h:129
int dk() const
Definition psiref.h:134
int nelectron() const
Definition psiref.h:131
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
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.
bool sdref() const
is this a single-determinantal reference?
Definition psiref.h:126
void print(std::ostream &os=ExEnv::out0()) const
Print the object.
RefWavefunction specialization initialized with a PsiSCF wave function.
Definition psiref.h:38
bool sdref() const
is this a single-determinantal reference?
Definition psiref.h:70
double magnetic_moment() const
Definition psiref.h:76
Ref< GaussianBasisSet > momentum_basis() const
Definition psiref.h:79
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
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.
const Ref< GaussianBasisSet > & uocc_basis() const
returns the basis supporting unoccupied orbitals. The defauls is same as returned by basis().
Definition psiref.h:63
void print(std::ostream &os=ExEnv::out0()) const
Print the object.
double desired_value_accuracy() const
Definition psiref.h:73
Ref< DensityFittingInfo > dfinfo() const
which DensityFittingRuntime used to compute this reference wave function
double actual_value_accuracy() const
Return the accuracy with which the value has been computed.
Definition psiref.h:72
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
double energy()
Definition psiref.h:71
bool desired_value_accuracy_set_to_default() const
Definition psiref.h:74
RefSymmSCMatrix ordm(SpinCase1 spin) const
return the AO basis density
int nelectron() const
Definition psiref.h:75
int dk() const
Definition psiref.h:78
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition matrix.h:265
RefWavefunction represents the reference wave function (or, more generally, a state) used as a starti...
Definition ref.h:159
A template class that maintains references counts.
Definition ref.h:361
Restores fundamental and user-defined types from images created with StateOut.
Definition statein.h:79
Serializes fundamental and user-defined types.
Definition stateout.h:71
Contains all MPQC code up to version 3.
Definition mpqcin.h:14

Generated at Wed Sep 25 2024 02:45:30 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.12.0.