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 program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program 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 General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 
28 #ifndef _psi_src_lib_libmoinfo_moinfo_base_h_
29 #define _psi_src_lib_libmoinfo_moinfo_base_h_
30 
36 #define PSI_NULL(args) args = NULL;
37 #define PSI_FREE(args) if(args != NULL) free(args);
38 #define PSI_DELETE(args) if(args != NULL) delete args;
39 #define PSI_DELETE_ARRAY(args) if(args != NULL) delete[] args;
40 #define IOFF 5000000
41 
42 #include <string>
44 
45 typedef std::vector<int> intvec;
46 typedef std::vector<bool> boolvec;
47 
48 namespace psi {
49 
50 class Options;
51 class Wavefunction;
52 
53 class MOInfoBase{
54 public:
55  MOInfoBase(Wavefunction& ref_wfn_, Options& options_, bool silent_ = false);
56  ~MOInfoBase();
57 
58  double get_nuclear_energy() const {return(nuclear_energy);}
59 
60  char** get_irr_labs() const {return(irr_labs);}
61  char* get_irr_labs(int i) const {return(irr_labs[i]);}
62 
63  int get_nirreps() const {return(nirreps);}
64  int get_nso() const {return(nso);}
65 
66  size_t* get_ioff() const {return(ioff);}
67  intvec get_sopi() const {return(sopi);}
68  intvec get_docc() const {return(docc);}
69  intvec get_actv() const {return(actv);}
70  bool get_guess_occupation() const {return(guess_occupation);}
71  int get_ndocc() const {return(ndocc);}
72  int get_nactv() const {return(nactv);}
73 
74  int get_nael() const {return(nael);} // # of alpha electrons including frozen
75  int get_nbel() const {return(nbel);} // # of beta electrons including frozen
76 
77  double** get_scf_mos() const {return(scf);}
78  double** get_scf_mos(int i) const {return(scf_irrep[i]);}
79  double get_scf_mos(int i,int j) const {if((i<nmo)&&(j<nso)) return(scf[i][j]); else return(0.0);}
80 protected:
81  void read_data();
83  void correlate(char *ptgrp, int irrep, int& nirreps_old, int& nirreps_new,int*& correlation);
84  void read_mo_space(int nirreps_ref, int& n, intvec& mo, std::string labels);
85  void print_mo_space(int& nmo, intvec& mo, std::string labels);
86  intvec convert_int_array_to_vector(int n, const int* array);
87 
88  void startup();
89  void cleanup();
90  void compute_ioff();
91 
94  int nirreps;
95  int wfn_sym;
96  int charge;
98 
99  int nso; // PSI nso (number of symmetry-adapted atomic orbitals)
100  int nmo; // Psi nmo (number of molecular orbitals, including frozen core and frozen virtual)
101  int ndocc;
102  int nactv;
103  int nael;
104  int nbel;
107 
108  size_t* ioff;
113  bool silent;
114 
116 
117  double** scf; // MO coefficients
118  double*** scf_irrep; // MO coefficients
119 
120  char** irr_labs;
121 };
122 
123 }
124 
125 #endif // _psi_src_lib_libmoinfo_moinfo_base_h_
bool get_guess_occupation() const
Definition: moinfo_base.h:70
int nirreps
Definition: moinfo_base.h:94
intvec get_docc() const
Definition: moinfo_base.h:68
Definition: moinfo_base.h:53
int nactive_ael
Definition: moinfo_base.h:105
intvec sopi
Definition: moinfo_base.h:109
int get_nactv() const
Definition: moinfo_base.h:72
char ** get_irr_labs() const
Definition: moinfo_base.h:60
Options & options
Definition: moinfo_base.h:93
char ** irr_labs
Definition: moinfo_base.h:120
bool silent
Definition: moinfo_base.h:113
Definition: pointgrp.h:105
intvec get_actv() const
Definition: moinfo_base.h:69
void compute_number_of_electrons()
Definition: moinfo_base.cc:92
void cleanup()
Definition: moinfo_base.cc:76
int get_nael() const
Definition: moinfo_base.h:74
intvec convert_int_array_to_vector(int n, const int *array)
Definition: moinfo_base.cc:256
int charge
Definition: moinfo_base.h:96
int nactive_bel
Definition: moinfo_base.h:106
int nso
Definition: moinfo_base.h:99
int multiplicity
Definition: moinfo_base.h:97
int get_nirreps() const
Definition: moinfo_base.h:63
~MOInfoBase()
Definition: moinfo_base.cc:54
void read_mo_space(int nirreps_ref, int &n, intvec &mo, std::string labels)
Definition: moinfo_base.cc:117
intvec get_sopi() const
Definition: moinfo_base.h:67
void compute_ioff()
Definition: moinfo_base.cc:109
double get_nuclear_energy() const
Definition: moinfo_base.h:58
int nactv
Definition: moinfo_base.h:102
int nmo
Definition: moinfo_base.h:100
double ** get_scf_mos() const
Definition: moinfo_base.h:77
void correlate(char *ptgrp, int irrep, int &nirreps_old, int &nirreps_new, int *&correlation)
Definition: moinfo_base.cc:161
bool guess_occupation
Definition: moinfo_base.h:112
Definition: liboptions.h:359
const char * labels[]
Definition: petitelist.cc:1075
char * get_irr_labs(int i) const
Definition: moinfo_base.h:61
int wfn_sym
Definition: moinfo_base.h:95
int get_ndocc() const
Definition: moinfo_base.h:71
std::vector< int > intvec
Definition: moinfo_base.h:45
int ndocc
Definition: moinfo_base.h:101
void read_data()
Definition: moinfo_base.cc:81
void startup()
Definition: moinfo_base.cc:59
intvec actv
Definition: moinfo_base.h:111
int nbel
Definition: moinfo_base.h:104
Simple wavefunction base class.
Definition: wavefunction.h:85
double get_scf_mos(int i, int j) const
Definition: moinfo_base.h:79
intvec docc
Definition: moinfo_base.h:110
void print_mo_space(int &nmo, intvec &mo, std::string labels)
Definition: moinfo_base.cc:150
double *** scf_irrep
Definition: moinfo_base.h:118
size_t * get_ioff() const
Definition: moinfo_base.h:66
std::vector< bool > boolvec
Definition: moinfo_base.h:46
Wavefunction & ref_wfn
Definition: moinfo_base.h:92
int get_nso() const
Definition: moinfo_base.h:64
double ** scf
Definition: moinfo_base.h:117
int nael
Definition: moinfo_base.h:103
MOInfoBase(Wavefunction &ref_wfn_, Options &options_, bool silent_=false)
Definition: moinfo_base.cc:46
double nuclear_energy
Definition: moinfo_base.h:115
size_t * ioff
Definition: moinfo_base.h:108
double ** get_scf_mos(int i) const
Definition: moinfo_base.h:78
int get_nbel() const
Definition: moinfo_base.h:75