MPQC  3.0.0-alpha
moinfo.h
1 //
2 // moinfo.h
3 //
4 // Copyright (C) 2011 Edward Valeev
5 //
6 // Author: Edward Valeev <evaleev@vt.edu>
7 // Maintainer: EV
8 //
9 // This file is part of the SC Toolkit.
10 //
11 // The SC Toolkit is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Library General Public License as published by
13 // the Free Software Foundation; either version 2, or (at your option)
14 // any later version.
15 //
16 // The SC Toolkit 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 Library General Public License for more details.
20 //
21 // You should have received a copy of the GNU Library General Public License
22 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 //
25 // The U.S. Government is granted a limited license as per AL 91-7.
26 //
27 
28 #ifndef _mpqc_src_lib_extern_moinfo_moinfo_h
29 #define _mpqc_src_lib_extern_moinfo_moinfo_h
30 
31 #include <vector>
32 #include <string>
33 #include <chemistry/qc/basis/basis.h>
34 #include <chemistry/qc/wfn/rdm.h>
35 #include <math/scmat/abstract.h>
36 
37 namespace sc {
38 
45  class ExternMOInfo : public DescribedClass {
46  public:
47  ExternMOInfo(std::string filename,
48  Ref<Integral> integral = Integral::get_default_integral()->clone(),
49  std::string basisname = std::string());
50  ~ExternMOInfo() {}
51 
55  const Ref<SymmOrbitalSpace>& orbs() const { return orbs_sb_; }
58  const std::vector<unsigned int>& indexmap() const;
60  const std::vector<unsigned int>& occindexmap_occ() const;
62  const std::vector<unsigned int>& actindexmap_occ() const;
63 
64  const std::vector<unsigned int>& fzcpi() const;
65  const std::vector<unsigned int>& fzvpi() const;
66  const std::vector<unsigned int>& inactpi() const;
67  const std::vector<unsigned int>& actpi() const;
68  const std::vector<unsigned int>& corrpi() const;
69  const std::vector<unsigned int>& mopi() const;
70 
71  private:
72  static ClassDesc class_desc_;
73 
74  std::vector<unsigned int> indexmap_; //< all file order -> all mpqc order
75  std::vector<unsigned int> occindexmap_occ_; //< occ file order -> occ mpqc order
76  std::vector<unsigned int> actindexmap_occ_; //< act file order -> act mpqc order
77 
78  Ref<SymmOrbitalSpace> orbs_sb_;
80  std::vector<unsigned int> mopi_;
81  std::vector<unsigned int> fzcpi_;
82  std::vector<unsigned int> fzvpi_;
83  std::vector<unsigned int> inactpi_;
84  std::vector<unsigned int> actpi_;
85  std::vector<unsigned int> corrpi_; // explicitly correlated orbitals
86  };
87 
89  class ExternSpinFreeRDMOne : public SpinFreeRDM<One>{
90  public:
93 
103  ExternSpinFreeRDMOne(const std::string& filename,
104  const std::vector<unsigned int>& indexmap,
105  const Ref<OrbitalSpace>& orbs);
109  const Ref<OrbitalSpace>& orbs);
110  virtual ~ExternSpinFreeRDMOne();
111 
113  void obsolete() {}
115  void compute() {}
117  Ref<OrbitalSpace> orbs() const { return orbs_; }
119  RefSymmSCMatrix scmat() const { return scmat_; }
120 
121  private:
122  static ClassDesc class_desc_;
123 
124  Ref<OrbitalSpace> orbs_;
125  };
126 
128  class ExternSpinFreeRDMTwo : public SpinFreeRDM<Two>{
129  public:
132  ExternSpinFreeRDMTwo(const std::string& filename,
133  const std::vector<unsigned int>& indexmap,
134  const Ref<OrbitalSpace>& occ_orbs);
135  virtual ~ExternSpinFreeRDMTwo();
136 
138  void obsolete() {}
140  void compute() {}
142  Ref<OrbitalSpace> orbs() const { return orbs_; }
144  RefSymmSCMatrix scmat() const { return scmat_; }
146  const Ref<DistArray4>& da4() const;
147  Ref< SpinFreeRDM<One> > rdm_m_1() const;
148 
149  private:
150  static ClassDesc class_desc_;
151 
152  private:
153  Ref<OrbitalSpace> orbs_;
154  std::string filename_; // filename from which this was constructed -- may be useful to find rdm1 file
155 
156  void init_from_rdm2_occspace(const std::vector<unsigned int>& indexmap,
157  const Ref<OrbitalSpace> & occ_orbs);
158  void init_from_rdm2_actspace(const std::vector<unsigned int>& indexmap,
159  const Ref<OrbitalSpace> & occ_orbs);
160 
161  mutable Ref<ExternSpinFreeRDMOne> rdm1_; // cached value to avoid recomputation
162  };
163 
164 } // end of namespace sc
165 
166 #endif // end of header guard
167 
168 
169 // Local Variables:
170 // mode: c++
171 // c-file-style: "CLJ-CONDENSED"
172 // End:
sc::ExternSpinFreeRDMOne::ExternSpinFreeRDMOne
ExternSpinFreeRDMOne(const std::string &filename, const std::vector< unsigned int > &indexmap, const Ref< OrbitalSpace > &orbs)
reads 1-rdm from filename assumes that 1-rdm is expressed in orbs_sb
sc::ExternMOInfo::occindexmap_occ
const std::vector< unsigned int > & occindexmap_occ() const
same as occindexmap_sb(), except it maps the occupied subset of orbs only
sc::ExternSpinFreeRDMTwo::compute
void compute()
already computed
Definition: moinfo.h:140
sc::ExternMOInfo::orbs
const Ref< SymmOrbitalSpace > & orbs() const
This object reports orbitals in symmetry-blocked order.
Definition: moinfo.h:55
sc::ExternSpinFreeRDMTwo
Reads 2-RDM from a text file.
Definition: moinfo.h:128
sc::RefSymmSCMatrix
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition: matrix.h:265
sc::ExternSpinFreeRDMTwo::rdm_m_1
Ref< SpinFreeRDM< One > > rdm_m_1() const
RDM of rank decreased by 1.
sc::Ref
A template class that maintains references counts.
Definition: ref.h:361
sc::ExternSpinFreeRDMOne
Reads 1-RDM from a text file.
Definition: moinfo.h:89
sc::ClassDesc
This class is used to contain information about classes.
Definition: class.h:147
sc::ExternSpinFreeRDMOne::orbs
Ref< OrbitalSpace > orbs() const
the orbital space in which the density is reported
Definition: moinfo.h:117
sc::ExternMOInfo::actindexmap_occ
const std::vector< unsigned int > & actindexmap_occ() const
same as actindexmap_sb(), except it maps the active subset of orbs only
sc::ExternSpinFreeRDMTwo::obsolete
void obsolete()
cannot be obsoleted
Definition: moinfo.h:138
sc::ExternSpinFreeRDMTwo::ExternSpinFreeRDMTwo
ExternSpinFreeRDMTwo(const std::string &filename, const std::vector< unsigned int > &indexmap, const Ref< OrbitalSpace > &occ_orbs)
this assumes that the file reports 2-rdm in the entire occupied space.
sc::ExternSpinFreeRDMOne::scmat
RefSymmSCMatrix scmat() const
density matrix
Definition: moinfo.h:119
sc::Integral::get_default_integral
static Integral * get_default_integral()
Returns the default Integral factory.
sc::SpinFreeRDM
SpinFreeRDM<R> is a spin-free reduced density matrix of rank R.
Definition: rdm.h:226
sc::ExternMOInfo::indexmap
const std::vector< unsigned int > & indexmap() const
maps the MO indices assumed by the contents of the data file to that of orbs()
sc::ExternMOInfo
Reads MO information from a text file Note that the MO ordering in the external file may not be the s...
Definition: moinfo.h:45
sc::ExternSpinFreeRDMOne::obsolete
void obsolete()
cannot be obsoleted
Definition: moinfo.h:113
sc::ExternSpinFreeRDMTwo::scmat
RefSymmSCMatrix scmat() const
density matrix
Definition: moinfo.h:144
sc::ExternSpinFreeRDMTwo::orbs
Ref< OrbitalSpace > orbs() const
the orbital space of spincase s in which the density is reported
Definition: moinfo.h:142
sc::DescribedClass
Classes which need runtime information about themselves and their relationship to other classes can v...
Definition: class.h:233
sc::ExternSpinFreeRDMOne::compute
void compute()
already computed
Definition: moinfo.h:115
sc::OrderedOrbitalSpace
This is an OrbitalSpace ordered according to the Order type.
Definition: orbitalspace.h:701
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
sc::ExternSpinFreeRDMTwo::da4
const Ref< DistArray4 > & da4() const
density matrix in DistArray4 format

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