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-2018 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_nullptr(args) args = nullptr;
38 #define PSI_FREE(args) \
39  if (args != nullptr) free(args);
40 #define PSI_DELETE(args) \
41  if (args != nullptr) delete args;
42 #define PSI_DELETE_ARRAY(args) \
43  if (args != nullptr) delete[] args;
44 #define IOFF 5000000
45 
46 #include <string>
48 
49 typedef std::vector<int> intvec;
50 typedef std::vector<bool> boolvec;
51 
52 namespace psi {
53 
54 class Options;
55 class Wavefunction;
56 
57 class MOInfoBase {
58  public:
59  MOInfoBase(Wavefunction& ref_wfn_, Options& options_, bool silent_ = false);
60  ~MOInfoBase();
61 
62  double get_nuclear_energy() const { return (nuclear_energy); }
63 
64  std::vector<std::string> get_irr_labs() const { return (irr_labs); }
65  std::string get_irr_labs(int i) const { return (irr_labs[i]); }
66 
67  int get_nirreps() const { return (nirreps); }
68  int get_nso() const { return (nso); }
69 
70  size_t* get_ioff() const { return (ioff); }
71  intvec get_sopi() const { return (sopi); }
72  intvec get_docc() const { return (docc); }
73  intvec get_actv() const { return (actv); }
74  bool get_guess_occupation() const { return (guess_occupation); }
75  int get_ndocc() const { return (ndocc); }
76  int get_nactv() const { return (nactv); }
77 
78  int get_nael() const { return (nael); } // # of alpha electrons including frozen
79  int get_nbel() const { return (nbel); } // # of beta electrons including frozen
80 
81  double** get_scf_mos() const { return (scf); }
82  double** get_scf_mos(int i) const { return (scf_irrep[i]); }
83  double get_scf_mos(int i, int j) const {
84  if ((i < nmo) && (j < nso))
85  return (scf[i][j]);
86  else
87  return (0.0);
88  }
89 
90  protected:
91  void read_data();
93  void correlate(char* ptgrp, int irrep, int& nirreps_old, int& nirreps_new, int*& correlation);
94  void read_mo_space(int nirreps_ref, int& n, intvec& mo, std::string labels);
95  void print_mo_space(int& nmo, intvec& mo, std::string labels);
96  intvec convert_int_array_to_vector(int n, const int* array);
97 
98  void startup();
99  void cleanup();
100  void compute_ioff();
101 
104  int nirreps;
105  int wfn_sym;
106  int charge;
108 
109  int nso; // PSI nso (number of symmetry-adapted atomic orbitals)
110  int nmo; // Psi nmo (number of molecular orbitals, including frozen core and frozen virtual)
111  int ndocc;
112  int nactv;
113  int nael;
114  int nbel;
117 
118  size_t* ioff;
123  bool silent;
124 
126 
127  double** scf; // MO coefficients
128  double*** scf_irrep; // MO coefficients
129 
130  std::vector<std::string> irr_labs;
131 };
132 
133 } // namespace psi
134 
135 #endif // _psi_src_lib_libmoinfo_moinfo_base_h_
bool get_guess_occupation() const
Definition: moinfo_base.h:74
int nirreps
Definition: moinfo_base.h:104
intvec get_docc() const
Definition: moinfo_base.h:72
Definition: moinfo_base.h:57
int nactive_ael
Definition: moinfo_base.h:115
intvec sopi
Definition: moinfo_base.h:119
int get_nactv() const
Definition: moinfo_base.h:76
Options & options
Definition: moinfo_base.h:103
bool silent
Definition: moinfo_base.h:123
Definition: pointgrp.h:104
intvec get_actv() const
Definition: moinfo_base.h:73
void compute_number_of_electrons()
Definition: moinfo_base.cc:80
void cleanup()
Definition: moinfo_base.cc:69
int get_nael() const
Definition: moinfo_base.h:78
intvec convert_int_array_to_vector(int n, const int *array)
Definition: moinfo_base.cc:281
int charge
Definition: moinfo_base.h:106
int nactive_bel
Definition: moinfo_base.h:116
int nso
Definition: moinfo_base.h:109
int multiplicity
Definition: moinfo_base.h:107
int get_nirreps() const
Definition: moinfo_base.h:67
~MOInfoBase()
Definition: moinfo_base.cc:51
void read_mo_space(int nirreps_ref, int &n, intvec &mo, std::string labels)
Definition: moinfo_base.cc:101
intvec get_sopi() const
Definition: moinfo_base.h:71
void compute_ioff()
Definition: moinfo_base.cc:95
double get_nuclear_energy() const
Definition: moinfo_base.h:62
int nactv
Definition: moinfo_base.h:112
int nmo
Definition: moinfo_base.h:110
double ** get_scf_mos() const
Definition: moinfo_base.h:81
void correlate(char *ptgrp, int irrep, int &nirreps_old, int &nirreps_new, int *&correlation)
Definition: moinfo_base.cc:145
bool guess_occupation
Definition: moinfo_base.h:122
Definition: liboptions.h:353
const char * labels[]
Definition: petitelist.cc:958
int wfn_sym
Definition: moinfo_base.h:105
std::string get_irr_labs(int i) const
Definition: moinfo_base.h:65
int get_ndocc() const
Definition: moinfo_base.h:75
std::vector< int > intvec
Definition: moinfo_base.h:49
int ndocc
Definition: moinfo_base.h:111
void read_data()
Definition: moinfo_base.cc:71
void startup()
Definition: moinfo_base.cc:53
intvec actv
Definition: moinfo_base.h:121
int nbel
Definition: moinfo_base.h:114
Simple wavefunction base class.
Definition: wavefunction.h:85
double get_scf_mos(int i, int j) const
Definition: moinfo_base.h:83
intvec docc
Definition: moinfo_base.h:120
void print_mo_space(int &nmo, intvec &mo, std::string labels)
Definition: moinfo_base.cc:137
double *** scf_irrep
Definition: moinfo_base.h:128
size_t * get_ioff() const
Definition: moinfo_base.h:70
std::vector< std::string > get_irr_labs() const
Definition: moinfo_base.h:64
std::vector< bool > boolvec
Definition: moinfo_base.h:50
Wavefunction & ref_wfn
Definition: moinfo_base.h:102
int get_nso() const
Definition: moinfo_base.h:68
double ** scf
Definition: moinfo_base.h:127
int nael
Definition: moinfo_base.h:113
MOInfoBase(Wavefunction &ref_wfn_, Options &options_, bool silent_=false)
Definition: moinfo_base.cc:44
double nuclear_energy
Definition: moinfo_base.h:125
size_t * ioff
Definition: moinfo_base.h:118
std::vector< std::string > irr_labs
Definition: moinfo_base.h:130
double ** get_scf_mos(int i) const
Definition: moinfo_base.h:82
int get_nbel() const
Definition: moinfo_base.h:79