MPQC  3.0.0-alpha
psici.h
1 //
2 // psici.h
3 //
4 // Copyright (C) 2008 Martin Torheyden
5 //
6 // Author: Martin Torheyden <mtorhey@vt.edu>
7 //
8 // This file is part of the SC Toolkit.
9 //
10 // The SC Toolkit is free software; you can redistribute it and/or modify
11 // it under the terms of the GNU Library General Public License as published by
12 // the Free Software Foundation; either version 2, or (at your option)
13 // any later version.
14 //
15 // The SC Toolkit is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Library General Public License for more details.
19 //
20 // You should have received a copy of the GNU Library General Public License
21 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
22 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23 //
24 // The U.S. Government is granted a limited license as per AL 91-7.
25 //
26 
27 #ifndef _chemistry_qc_psi_psici_h
28 #define _chemistry_qc_psi_psici_h
29 
30 #include <chemistry/qc/psi/psiwfn.h>
31 #include <chemistry/qc/wfn/spin.h>
32 
33 namespace sc {
34 
37  class PsiRASCI : public PsiCorrWavefunction {
38  public:
73  PsiRASCI(const Ref<KeyVal> &keyval);
74  PsiRASCI(StateIn &s);
75  ~PsiRASCI();
76  void save_data_state(StateOut &s);
77  void compute();
78  void print(std::ostream&) const;
79 
80  double magnetic_moment() const;
81 
83  const std::vector<unsigned int>& ras1() const { return ras1_; }
85  const std::vector<unsigned int>& ras2() const { return ras2_; }
87  const std::vector<unsigned int>& ras3() const { return ras3_; }
89  unsigned int ras3_max() const { return ras3_max_; }
90 
92  RefSymmSCMatrix mo_density(SpinCase1 spin); // mo_density is overloaded because detci
93  // reports density in active orbitals only; it reports ORDM in OBS (!)
95  const Ref<OrbitalSpace>& orbs_sb(SpinCase1 spin);
98  const Ref<OrbitalSpace>& occ(SpinCase1 spin);
100  RefSymmSCMatrix onepdm_occ(SpinCase1 spin);
102  RefSymmSCMatrix twopdm_occ(SpinCase2 spin);
105 
106  protected:
107 
108  bool opdm_print_;
109  bool tpdm_print_;
110  int root_;
112  int nroots_;
115  bool repl_otf_;
116 
117  // this data may need to be modified by RASSCF
119  int convergence_;
120  int maxiter_;
121 
123  Ref<OrbitalSpace> occ_[NSpinCases1];
124 
125  RefSymmSCMatrix onepdm_occ_[NSpinCases1];
126  RefSymmSCMatrix twopdm_occ_[NSpinCases2];
127  RefSymmSCMatrix twopdm_sf_occ_;
128 
129  // optional RAS info
130  // it is initialized automatically
131  std::vector<unsigned int> ras1_;
132  std::vector<unsigned int> ras2_;
133  std::vector<unsigned int> ras3_;
134  int ras1_max_; //< max number of holes in RAS1; in PsiRASCI, defaults to 2; in PsiRASSCF, defaults to 0. It appears that this keyword is created pratically as
135  // an 'alias' to ex_lvl in Psi3, but ras1_max_ is a better name than ex_lvl
136  int ras3_max_; //< max number of electrons in RAS3; in PsiRASCI, defaults to 2; in PsiRASSCF, defaults to 0
137 
138  double scf_levelshift_;
140 
159 
161  std::vector<unsigned int> moorder_;
162 
163  void write_input(int convergence);
164  void write_rasci_input(int convergence, bool rasscf);
165 
166  std::vector<unsigned int> map_density_to_sb();
167  };
168 
170  class PsiRASSCF : public PsiRASCI {
171  public:
193  PsiRASSCF(const Ref<KeyVal>& kv);
194  PsiRASSCF(StateIn&);
195  ~PsiRASSCF();
196  void save_data_state(StateOut&);
197  void compute();
198  void print(std::ostream&) const;
199 
200  private:
201  static ClassDesc class_desc_;
202 
203  int rasscf_energy_convergence_;
204  int rasscf_convergence_;
205  int rasscf_maxiter_; //< max number of iterations in rasscf
206  int rasscf_target_sym_; //< target symmetry
207  int diis_start_;
208  double max_step_;
209 
210 
211  bool state_average_; //< state average?
212  bool relax_core_;
213 
214  bool run_detci_only_; // hack to allow running state-averaged RASSCF
215 
216  void write_input(int convergence);
217 
218  };
219 
220 
221 }
222 
223 #endif /*_chemistry_qc_psi_psici_h*/
sc::PsiRASCI::PsiRASCI
PsiRASCI(const Ref< KeyVal > &keyval)
A KeyVal constructor is used to generate a PsiRASCI object from the input.
sc::PsiRASSCF
PsiRASSCF is a type of a PsiRASCI wavefunction that implements orbital optimization.
Definition: psici.h:170
sc::RefSymmSCMatrix
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition: matrix.h:265
sc::PsiRASCI::h0_blocksize_
int h0_blocksize_
the symmetry (irrep) of the target root
Definition: psici.h:114
sc::PsiRASCI::target_sym_
int target_sym_
number of roots for detci calculations
Definition: psici.h:113
sc::Ref
A template class that maintains references counts.
Definition: ref.h:361
sc::PsiRASCI::magnetic_moment
double magnetic_moment() const
Computes the S (or J) magnetic moment of the target state(s), in units of .
sc::PsiRASCI
PsiRASCI is a general (RAS) CI PsiWavefunction.
Definition: psici.h:37
sc::PsiRASCI::occ
const Ref< OrbitalSpace > & occ(SpinCase1 spin)
returns occupied OrbitalSpace.
sc::PsiRASSCF::compute
void compute()
Recompute at least the results that have compute true and are not already computed.
sc::PsiRASCI::energy_convergence_
int energy_convergence_
do CI string replacements on the fly. saves memory, but is slower.
Definition: psici.h:118
sc::PsiRASCI::print
void print(std::ostream &) const
Print information about the object.
sc::PsiRASCI::ras3
const std::vector< unsigned int > & ras3() const
returns vector that specifies the number of RAS3 orbitals in each irrep
Definition: psici.h:87
sc::StateIn
Definition: statein.h:79
sc::ClassDesc
This class is used to contain information about classes.
Definition: class.h:147
sc::PsiRASSCF::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::orbs_sb
const Ref< OrbitalSpace > & orbs_sb(SpinCase1 spin)
if this is PsiRASSCF this will return RASSCF orbitals
sc::PsiRASCI::multiplicity_
int multiplicity_
compute a specific root of the wave function
Definition: psici.h:111
sc::PsiRASCI::ras3_max
unsigned int ras3_max() const
returns the maximum number of electrons allowed in RAS3 space
Definition: psici.h:89
sc::PsiRASCI::moorder_
std::vector< unsigned int > moorder_
orbital reordering
Definition: psici.h:161
sc::PsiRASCI::repl_otf_
bool repl_otf_
block size for the H0 guess
Definition: psici.h:115
sc::PsiRASSCF::print
void print(std::ostream &) const
Print information about the object.
sc::PsiRASCI::compute
void compute()
Recompute at least the results that have compute true and are not already computed.
sc::StateOut
Definition: stateout.h:71
sc::PsiRASCI::map_density_to_sb
std::vector< unsigned int > map_density_to_sb()
returns the index map that transforms indices in which densities are reported in Psi to the symmetry-...
sc::PsiRASCI::mo_density
RefSymmSCMatrix mo_density(SpinCase1 spin)
sc::PsiRASCI::valence_obwfn_
Ref< OneBodyWavefunction > valence_obwfn_
number of iterations, for which the levelshift is applied
Definition: psici.h:158
sc::PsiRASCI::twopdm_occ
RefSymmSCMatrix twopdm_occ()
spin-free 2-pdm in the space reported by occ()
sc::PsiRASCI::ras2
const std::vector< unsigned int > & ras2() const
returns vector that specifies the number of RAS2 orbitals in each irrep
Definition: psici.h:85
sc::PsiRASCI::save_data_state
void save_data_state(StateOut &s)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::PsiRASCI::nroots_
int nroots_
the spin multiplicity of the target state
Definition: psici.h:112
sc::PsiRASSCF::PsiRASSCF
PsiRASSCF(const Ref< KeyVal > &kv)
A KeyVal constructor is used to generate a PsiRASSCF object from the input.
sc::PsiRASCI::root_
int root_
print the two-particle density matrix
Definition: psici.h:110
sc::PsiRASCI::orbs_sb_
Ref< OrbitalSpace > orbs_sb_[NSpinCases1]
maxiter for detci
Definition: psici.h:122
sc::PsiRASCI::onepdm_occ
RefSymmSCMatrix onepdm_occ(SpinCase1 spin)
1-pdm in the space reported by occ()
sc::PsiCorrWavefunction
PsiCorrWavefunction is a Psi correlated wave function.
Definition: psiwfn.h:140
sc::PsiRASCI::tpdm_print_
bool tpdm_print_
print the one-particle density matrix
Definition: psici.h:109
sc::PsiRASCI::ras1
const std::vector< unsigned int > & ras1() const
returns vector that specifies the number of RAS1 orbitals in each irrep
Definition: psici.h:83
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
sc::PsiRASCI::write_input
void write_input(int convergence)
Prepares a complete Psi input file. The input file is assumed to have been opened.
sc::PsiRASCI::scf_stop_levelshift_
int scf_stop_levelshift_
Psi3 cscf levelshift.
Definition: psici.h:139

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