Psi4
moinfo_base.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
29 #ifndef _psi_src_lib_libmoinfo_moinfo_base_h_
30 #define _psi_src_lib_libmoinfo_moinfo_base_h_
31 
37 #define PSI_NULL(args) args = NULL;
38 #define PSI_FREE(args) if(args != NULL) free(args);
39 #define PSI_DELETE(args) if(args != NULL) delete args;
40 #define PSI_DELETE_ARRAY(args) if(args != NULL) delete[] args;
41 #define IOFF 5000000
42 
43 #include <string>
45 
46 typedef std::vector<int> intvec;
47 typedef std::vector<bool> boolvec;
48 
49 namespace psi {
50 
51 class Options;
52 class Wavefunction;
53 
54 class MOInfoBase{
55 public:
56  MOInfoBase(Wavefunction& ref_wfn_, Options& options_, bool silent_ = false);
57  ~MOInfoBase();
58 
59  double get_nuclear_energy() const {return(nuclear_energy);}
60 
61  char** get_irr_labs() const {return(irr_labs);}
62  char* get_irr_labs(int i) const {return(irr_labs[i]);}
63 
64  int get_nirreps() const {return(nirreps);}
65  int get_nso() const {return(nso);}
66 
67  size_t* get_ioff() const {return(ioff);}
68  intvec get_sopi() const {return(sopi);}
69  intvec get_docc() const {return(docc);}
70  intvec get_actv() const {return(actv);}
71  bool get_guess_occupation() const {return(guess_occupation);}
72  int get_ndocc() const {return(ndocc);}
73  int get_nactv() const {return(nactv);}
74 
75  int get_nael() const {return(nael);} // # of alpha electrons including frozen
76  int get_nbel() const {return(nbel);} // # of beta electrons including frozen
77 
78  double** get_scf_mos() const {return(scf);}
79  double** get_scf_mos(int i) const {return(scf_irrep[i]);}
80  double get_scf_mos(int i,int j) const {if((i<nmo)&&(j<nso)) return(scf[i][j]); else return(0.0);}
81 protected:
82  void read_data();
84  void correlate(char *ptgrp, int irrep, int& nirreps_old, int& nirreps_new,int*& correlation);
85  void read_mo_space(int nirreps_ref, int& n, intvec& mo, std::string labels);
86  void print_mo_space(int& nmo, intvec& mo, std::string labels);
87  intvec convert_int_array_to_vector(int n, const int* array);
88 
89  void startup();
90  void cleanup();
91  void compute_ioff();
92 
95  int nirreps;
96  int wfn_sym;
97  int charge;
99 
100  int nso; // PSI nso (number of symmetry-adapted atomic orbitals)
101  int nmo; // Psi nmo (number of molecular orbitals, including frozen core and frozen virtual)
102  int ndocc;
103  int nactv;
104  int nael;
105  int nbel;
108 
109  size_t* ioff;
114  bool silent;
115 
117 
118  double** scf; // MO coefficients
119  double*** scf_irrep; // MO coefficients
120 
121  char** irr_labs;
122 };
123 
124 }
125 
126 #endif // _psi_src_lib_libmoinfo_moinfo_base_h_
bool get_guess_occupation() const
Definition: moinfo_base.h:71
int nirreps
Definition: moinfo_base.h:95
intvec get_docc() const
Definition: moinfo_base.h:69
Definition: moinfo_base.h:54
int nactive_ael
Definition: moinfo_base.h:106
intvec sopi
Definition: moinfo_base.h:110
int get_nactv() const
Definition: moinfo_base.h:73
char ** get_irr_labs() const
Definition: moinfo_base.h:61
Options & options
Definition: moinfo_base.h:94
char ** irr_labs
Definition: moinfo_base.h:121
bool silent
Definition: moinfo_base.h:114
Definition: pointgrp.h:106
intvec get_actv() const
Definition: moinfo_base.h:70
void compute_number_of_electrons()
Definition: moinfo_base.cc:93
void cleanup()
Definition: moinfo_base.cc:77
int get_nael() const
Definition: moinfo_base.h:75
intvec convert_int_array_to_vector(int n, const int *array)
Definition: moinfo_base.cc:257
int charge
Definition: moinfo_base.h:97
int nactive_bel
Definition: moinfo_base.h:107
int nso
Definition: moinfo_base.h:100
int multiplicity
Definition: moinfo_base.h:98
int get_nirreps() const
Definition: moinfo_base.h:64
~MOInfoBase()
Definition: moinfo_base.cc:55
void read_mo_space(int nirreps_ref, int &n, intvec &mo, std::string labels)
Definition: moinfo_base.cc:118
intvec get_sopi() const
Definition: moinfo_base.h:68
void compute_ioff()
Definition: moinfo_base.cc:110
double get_nuclear_energy() const
Definition: moinfo_base.h:59
int nactv
Definition: moinfo_base.h:103
int nmo
Definition: moinfo_base.h:101
double ** get_scf_mos() const
Definition: moinfo_base.h:78
void correlate(char *ptgrp, int irrep, int &nirreps_old, int &nirreps_new, int *&correlation)
Definition: moinfo_base.cc:162
bool guess_occupation
Definition: moinfo_base.h:113
Definition: liboptions.h:360
const char * labels[]
Definition: petitelist.cc:1076
char * get_irr_labs(int i) const
Definition: moinfo_base.h:62
int wfn_sym
Definition: moinfo_base.h:96
int get_ndocc() const
Definition: moinfo_base.h:72
std::vector< int > intvec
Definition: moinfo_base.h:46
int ndocc
Definition: moinfo_base.h:102
void read_data()
Definition: moinfo_base.cc:82
void startup()
Definition: moinfo_base.cc:60
intvec actv
Definition: moinfo_base.h:112
int nbel
Definition: moinfo_base.h:105
Simple wavefunction base class.
Definition: wavefunction.h:84
double get_scf_mos(int i, int j) const
Definition: moinfo_base.h:80
intvec docc
Definition: moinfo_base.h:111
void print_mo_space(int &nmo, intvec &mo, std::string labels)
Definition: moinfo_base.cc:151
double *** scf_irrep
Definition: moinfo_base.h:119
size_t * get_ioff() const
Definition: moinfo_base.h:67
std::vector< bool > boolvec
Definition: moinfo_base.h:47
Wavefunction & ref_wfn
Definition: moinfo_base.h:93
int get_nso() const
Definition: moinfo_base.h:65
double ** scf
Definition: moinfo_base.h:118
int nael
Definition: moinfo_base.h:104
MOInfoBase(Wavefunction &ref_wfn_, Options &options_, bool silent_=false)
Definition: moinfo_base.cc:47
double nuclear_energy
Definition: moinfo_base.h:116
size_t * ioff
Definition: moinfo_base.h:109
double ** get_scf_mos(int i) const
Definition: moinfo_base.h:79
int get_nbel() const
Definition: moinfo_base.h:76