Psi4
mospace.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_LIBTRANS_MOSPACE_H_
30 #define _PSI_SRC_LIB_LIBTRANS_MOSPACE_H_
31 
32 #include "psi4/psi4-dec.h"
33 #include <map>
34 #include <vector>
35 
36 namespace psi {
37 
43  public:
44  MOSpace(const char label);
45  ~MOSpace();
46  MOSpace(const char label, const std::vector<int> aOrbs, const std::vector<int> bOrbs, const std::vector<int> aIndex,
47  const std::vector<int> bIndex);
48  MOSpace(const char label, const std::vector<int> aOrbs, const std::vector<int> aIndex);
49  MOSpace(const char label, const std::vector<int> orbsPI);
50 
56 #define MOSPACE_FZC 'o'
57  static std::shared_ptr<MOSpace> fzc;
67 #define MOSPACE_OCC 'O'
68  static std::shared_ptr<MOSpace> occ;
74 #define MOSPACE_FZV 'v'
75  static std::shared_ptr<MOSpace> fzv;
85 #define MOSPACE_VIR 'V'
86  static std::shared_ptr<MOSpace> vir;
94 #define MOSPACE_ALL 'A'
95  static std::shared_ptr<MOSpace> all;
101 #define MOSPACE_NIL 'n'
102  static std::shared_ptr<MOSpace> nil;
109 #define MOSPACE_DUM 'd'
110  static std::shared_ptr<MOSpace> dum;
111 
112  // These are to allow the map to be used
113  friend bool operator==(const MOSpace &lhs, const MOSpace &rhs) { return lhs.label_ == rhs.label_; }
114  friend bool operator>=(const MOSpace &lhs, const MOSpace &rhs) { return lhs.label_ >= rhs.label_; }
115  friend bool operator!=(const MOSpace &lhs, const MOSpace &rhs) { return lhs.label_ != rhs.label_; }
116  friend bool operator<=(const MOSpace &lhs, const MOSpace &rhs) { return lhs.label_ <= rhs.label_; }
117  friend bool operator<(const MOSpace &lhs, const MOSpace &rhs) { return lhs.label_ < rhs.label_; }
118  friend bool operator>(const MOSpace &lhs, const MOSpace &rhs) { return lhs.label_ > rhs.label_; }
119  friend bool operator==(const MOSpace &lhs, const char c) { return lhs.label_ == c; }
120  friend bool operator>=(const MOSpace &lhs, const char c) { return lhs.label_ >= c; }
121  friend bool operator!=(const MOSpace &lhs, const char c) { return lhs.label_ != c; }
122  friend bool operator<=(const MOSpace &lhs, const char c) { return lhs.label_ <= c; }
123  friend bool operator<(const MOSpace &lhs, const char c) { return lhs.label_ < c; }
124  friend bool operator>(const MOSpace &lhs, const char c) { return lhs.label_ > c; }
125 
127  char label() { return label_; }
128 
130  const std::vector<int> &aOrbs() const { return aOrbs_; }
131 
133  const std::vector<int> &bOrbs() const { return bOrbs_; }
134 
136  const std::vector<int> &aIndex() { return aIndex_; }
137 
139  const std::vector<int> &bIndex() { return bIndex_.size() == 0 ? aIndex_ : bIndex_; }
140 
142  bool placeholder() const { return placeholder_; }
143  void set_placeholder(bool t_f) { placeholder_ = t_f; }
144 
145  protected:
151  const char label_;
152  // The indices (Pitzer) of the alpha orbitals
153  std::vector<int> aOrbs_;
154  // The indices (Pitzer) of the beta orbitals
155  std::vector<int> bOrbs_;
156  // The alpha reindexing array
157  std::vector<int> aIndex_;
158  // The beta reindexing array
159  std::vector<int> bIndex_;
160  // Whether this only describes dimensions, and has no orbitals associated with it
162 };
163 
164 } // End namespaces
165 
166 #endif // Header guard
const std::vector< int > & bIndex()
Get the beta orbital indexing array for IWL.
Definition: mospace.h:139
friend bool operator>(const MOSpace &lhs, const char c)
Definition: mospace.h:124
Definition: mospace.h:42
static std::shared_ptr< MOSpace > vir
Definition: mospace.h:86
const std::vector< int > & aIndex()
Get the alpha orbital indexing array for IWL.
Definition: mospace.h:136
static std::shared_ptr< MOSpace > nil
Definition: mospace.h:102
friend bool operator!=(const MOSpace &lhs, const MOSpace &rhs)
Definition: mospace.h:115
friend bool operator<(const MOSpace &lhs, const MOSpace &rhs)
Definition: mospace.h:117
static std::shared_ptr< MOSpace > dum
Definition: mospace.h:110
bool placeholder_
Definition: mospace.h:161
friend bool operator==(const MOSpace &lhs, const char c)
Definition: mospace.h:119
const std::vector< int > & aOrbs() const
Get the alpha orbitals.
Definition: mospace.h:130
void set_placeholder(bool t_f)
Definition: mospace.h:143
static std::shared_ptr< MOSpace > all
Definition: mospace.h:95
std::vector< int > aOrbs_
Definition: mospace.h:153
char label()
Get the unique identifier for this space.
Definition: mospace.h:127
static std::shared_ptr< MOSpace > fzc
Keeps track of which labels have been assigned, for safety.
Definition: mospace.h:57
friend bool operator<=(const MOSpace &lhs, const char c)
Definition: mospace.h:122
friend bool operator==(const MOSpace &lhs, const MOSpace &rhs)
Definition: mospace.h:113
#define PSI_API
Definition: pragma.h:128
std::vector< int > aIndex_
Definition: mospace.h:157
const char label_
Definition: mospace.h:151
const std::vector< int > & bOrbs() const
Get the beta orbitals.
Definition: mospace.h:133
static std::shared_ptr< MOSpace > fzv
Definition: mospace.h:75
friend bool operator>=(const MOSpace &lhs, const MOSpace &rhs)
Definition: mospace.h:114
static std::shared_ptr< MOSpace > occ
Definition: mospace.h:68
friend bool operator!=(const MOSpace &lhs, const char c)
Definition: mospace.h:121
friend bool operator>=(const MOSpace &lhs, const char c)
Definition: mospace.h:120
friend bool operator>(const MOSpace &lhs, const MOSpace &rhs)
Definition: mospace.h:118
std::vector< int > bIndex_
Definition: mospace.h:159
friend bool operator<(const MOSpace &lhs, const char c)
Definition: mospace.h:123
bool placeholder() const
Whether this is just a placeholder.
Definition: mospace.h:142
friend bool operator<=(const MOSpace &lhs, const MOSpace &rhs)
Definition: mospace.h:116
std::vector< int > bOrbs_
Definition: mospace.h:155