MPQC  3.0.0-alpha
orbitalspace.h
1 //
2 // orbitalspace.h
3 //
4 // Copyright (C) 2004 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 _chemistry_qc_mbptr12_orbitalspace_h
29 #define _chemistry_qc_mbptr12_orbitalspace_h
30 
31 #include <bitset>
32 #include <vector>
33 #include <stdexcept>
34 #include <algorithm>
35 #include <util/ref/ref.h>
36 #include <util/state/statein.h>
37 #include <util/state/stateout.h>
38 #include <util/group/thread.h>
39 #include <math/scmat/abstract.h>
40 #include <util/state/statein.h>
41 #include <chemistry/qc/basis/basis.h>
42 #include <chemistry/qc/basis/operator.h>
43 #include <chemistry/qc/wfn/spin.h>
44 #include <util/misc/registry.h>
45 
46 namespace sc {
47 
50 
52  template <typename Attributes>
54  public:
55  DecoratedOrbital() {}
56  DecoratedOrbital(size_t index, const Attributes& attr) : index_(index), attr_(attr) {}
57 
58  size_t index() const { return index_; }
59  const Attributes& attr() const { return attr_; }
60 
61  private:
62  size_t index_;
63  Attributes attr_;
64  };
65 
68 
71  public:
72  MolecularOrbitalAttributes(unsigned int irrep, double energy,
73  double occnum) :
74  irrep_(irrep), energy_(energy), occnum_(occnum) {
75  }
76 
77  unsigned int irrep() const {
78  return irrep_;
79  }
80  double energy() const {
81  return energy_;
82  }
83  double occnum() const {
84  return occnum_;
85  }
86 
87  private:
88  unsigned int irrep_;
89  double energy_;
90  double occnum_;
91  };
94  public:
95  MolecularSpinOrbitalAttributes(unsigned int irrep,
96  double energy,
97  double occnum,
98  SpinCase1 spin) :
99  MolecularOrbitalAttributes(irrep, energy, occnum), spin_(spin)
100  {}
101 
102  SpinCase1 spin() const { return spin_; }
103 
104  private:
105  SpinCase1 spin_;
106  };
107 
108 
112  struct ParticleHoleOrbitalAttributes : public std::bitset<2> {
114  ParticleHoleOrbitalAttributes(unsigned long val) : std::bitset<2>(val) {}
115  ParticleHoleOrbitalAttributes(const std::bitset<2>& bs) : std::bitset<2>(bs) {}
116 
121  };
122 
125 
128  public:
129  SymmetryMOOrder(unsigned int nirreps) : nirreps_(nirreps) {}
130 
131  bool operator()(const MolecularOrbital& o1, const MolecularOrbital& o2) const {
132  if (o1.attr().irrep() < o2.attr().irrep())
133  return true;
134  else if (o1.attr().irrep() == o2.attr().irrep()) {
135  if (o1.attr().energy() < o2.attr().energy())
136  return true;
137  else if (o1.attr().energy() == o2.attr().energy()) {
138  if (o1.attr().occnum() < o2.attr().occnum())
139  return true;
140  }
141  }
142  return false;
143  }
144  unsigned int block(const MolecularOrbital& o) const {
145  return o.attr().irrep();
146  }
147  unsigned int nblocks() const {
148  return nirreps_;
149  }
150 
151  private:
152  unsigned int nirreps_;
153  };
154 
156  template <typename EnergyCompare = std::less<double> > struct EnergyMOOrder {
157  public:
158  bool operator()(const MolecularOrbital& o1, const MolecularOrbital& o2) const {
159  if ( ecompare(o1.attr().energy(), o2.attr().energy()) )
160  return true;
161  else if (o1.attr().energy() == o2.attr().energy()) {
162  if (o1.attr().irrep() < o2.attr().irrep())
163  return true;
164  }
165  return false;
166  }
167  unsigned int block(const MolecularOrbital& o) const {
168  return 0;
169  }
170  unsigned int nblocks() const {
171  return 1;
172  }
173  private:
174  EnergyCompare ecompare;
175  };
176 
179  public:
180  CorrelatedMOOrder(unsigned int nirreps) : nirreps_(nirreps) {}
181 
182  bool operator()(const MolecularOrbital& o1, const MolecularOrbital& o2) const {
183  // occupieds come before virtuals
184  if (o1.attr().occnum() > o2.attr().occnum())
185  return true;
186  else if (o1.attr().occnum() == o2.attr().occnum()) {
187  if (o1.attr().irrep() < o2.attr().irrep())
188  return true;
189  else if (o1.attr().irrep() == o2.attr().irrep()) {
190  if (o1.attr().energy() < o2.attr().energy())
191  return true;
192  }
193  }
194  return false;
195  }
196 
197  unsigned int block(const MolecularOrbital& o) const {
198  const unsigned int irrep = o.attr().irrep();
199  const double occnum = o.attr().occnum();
200  // occupieds come before virtuals
201  const int occblock = (occnum == 1.0) ? 0 : 1;
202  return occblock * nirreps_ + irrep;
203  }
204  unsigned int nblocks() const {
205  return nirreps_ * 2;
206  }
207 
208  private:
209  unsigned int nirreps_;
210  };
211 
214  public:
215  CorrelatedSpinMOOrder(unsigned int nirreps) : nirreps_(nirreps) {}
216 
217  bool operator()(const MolecularSpinOrbital& o1, const MolecularSpinOrbital& o2) const {
218  // occupieds come before virtuals
219  if (o1.attr().occnum() > o2.attr().occnum())
220  return true;
221  else if (o1.attr().occnum() == o2.attr().occnum()) {
222  if (o1.attr().spin() < o2.attr().spin())
223  return true;
224  else if (o1.attr().spin() == o2.attr().spin()) {
225  if (o1.attr().irrep() < o2.attr().irrep())
226  return true;
227  else if (o1.attr().irrep() == o2.attr().irrep()) {
228  if (o1.attr().energy() < o2.attr().energy())
229  return true;
230  }
231  }
232  }
233  return false;
234  }
235 
236  unsigned int block(const MolecularSpinOrbital& o) const {
237  const unsigned int irrep = o.attr().irrep();
238  const SpinCase1 spin = o.attr().spin();
239  const unsigned int spincase = (spin == Alpha) ? 0 : 1;
240  const double occnum = o.attr().occnum();
241  const unsigned int occblock = (occnum == 1.0) ? 0 : 1;
242  // occupieds come before virtuals, Alpha before Beta
243  const unsigned int result = (occblock * 2 + spincase) * nirreps_ + irrep;
244  return result;
245  }
246  unsigned int nblocks() const {
247  return nirreps_ * 4;
248  }
249 
250  private:
251  unsigned int nirreps_;
252  };
253 
254  namespace detail {
255 
256  template <typename Container> struct ContainerAdaptor {
257  public:
258  typedef typename Container::value_type value_type;
259  ContainerAdaptor(const Container& cont) : cont_(cont) {}
260  size_t size() const { return cont_.size(); }
261  value_type elem(size_t i) const { return cont_[i]; }
262 
263  private:
264  const Container& cont_;
265  };
266 
267  template<> struct ContainerAdaptor<RefDiagSCMatrix> {
268  public:
269  typedef RefDiagSCMatrix Container;
270  typedef double value_type;
271  ContainerAdaptor(const Container& cont) : cont_(cont) {}
272  size_t size() const { return cont_.dim().n(); }
273  value_type elem(size_t i) const { return cont_(i); }
274 
275  private:
276  const Container& cont_;
277  };
278 
279  } // namespace detail
280 
282  template <typename Attribute,
283  typename AttributeContainer,
284  typename Compare = std::less<Attribute> >
286  private:
288  struct _compare {
289  bool operator()(const MO& mo1,
290  const MO& mo2) const {
291  Compare comp;
292  return comp(mo1.attr(), mo2.attr());
293  }
294  };
295 
296  public:
297  MolecularOrbitalMask(unsigned int n,
298  const AttributeContainer& attributes) :
299  mask_(detail::ContainerAdaptor<AttributeContainer>(attributes).size(),true)
300  {
301  // validate input
302  if (n == 0) return;
303  const size_t nmos = mask_.size();
304  MPQC_ASSERT(n < nmos);
305 
306  // copy attributes to vector of MOs
307  std::vector<MO> mos;
308  detail::ContainerAdaptor<AttributeContainer> contadaptor(attributes);
309  for(size_t mo=0; mo<nmos; ++mo) {
310  mos.push_back(MO(mo,contadaptor.elem(mo)));
311  }
312 
313  // sort
314  _compare comp;
315  std::stable_sort(mos.begin(), mos.end(), comp);
316 
317  // copy to mask
318  for(unsigned int t=0; t<n; ++t) {
319  mask_[ mos[t].index() ] = false;
320  }
321  }
322 
323  const std::vector<bool>& mask() const { return mask_; }
324 
325  bool operator[](size_t o) const { return mask_[o]; }
326 
327  private:
328  std::vector<bool> mask_;
329  };
330 
331 
333 
342  class OrbitalSpace: virtual public SavableState {
343 
344  public:
345 
347  enum IndexOrder {
348  symmetry = 0,
349  energy = 1,
353  general = 3
354  };
355 
356  private:
357 
358  static const unsigned int max_id_length = 30; // max length of string returned by id()
359  std::string id_; // see documentation for id()
360  std::string name_; // String identifier for the orbital space
361 
362  Ref<GaussianBasisSet> basis_; // The AO basis
363  Ref<Integral> integral_;
364  RefSCMatrix coefs_; // AO->MO transformation coefficients (nao by nmo matrix)
365  RefDiagSCMatrix evals_; // "eigenvalues" associated with the MOs
366  RefSCDimension dim_; // only here to allow dim() return const &
367  std::vector<unsigned int> orbsym_; // irrep of each orbital
368  std::vector<unsigned int> block_offsets_; // Start of each block
369  std::vector<unsigned int> block_sizes_; // Number of orbitals in each block
370 
371  // checks orbsym_ for irrep indices outside of the allowed range
372  void check_orbsym() const;
373 
374  // determines block_sizes_ from nfzc, nfzv, and evals and returns offsets for each block
375  std::vector<unsigned int>
376  frozen_to_blockinfo(unsigned int nfzc, unsigned int nfzv,
377  const RefDiagSCMatrix& evals);
378 
379  // computes coefficient matrix from the full coefficient matrix. If moorder == energy
380  // then the MO vectors will be sorted by their eigenvalues
381  void full_coefs_to_coefs(const RefSCMatrix& full_coefs,
382  const RefDiagSCMatrix& evals,
383  const std::vector<unsigned int>& offsets,
384  IndexOrder moorder);
386  void init();
387 
388  // sorting functions borrowed from mbpt.cc
389  static void dquicksort(double *item, unsigned int *index, unsigned int n);
390 
391  protected:
393  OrbitalSpace();
395  void init(const std::string& id, const std::string& name,
397  const RefSCMatrix& coefs,
398  const RefDiagSCMatrix& evals,
399  const std::vector<unsigned int>& orbsyms,
400  unsigned int nblocks,
401  const std::vector<BlockedOrbital>& indexmap);
402 
403  public:
406  OrbitalSpace(const OrbitalSpace&);
422  OrbitalSpace(const std::string& id, const std::string& name,
423  const RefSCMatrix& full_coefs, const RefDiagSCMatrix& evals,
425  const Ref<Integral>& integral,
426  const std::vector<unsigned int>& block_offsets,
427  const std::vector<unsigned int>& block_sizes);
428 
447  OrbitalSpace(const std::string& id, const std::string& name,
448  const RefSCMatrix& full_coefs,
450  const Ref<Integral>& integral,
451  const std::vector<unsigned int>& block_offsets,
452  const std::vector<unsigned int>& block_sizes,
453  const IndexOrder& moorder = symmetry,
454  const RefDiagSCMatrix& evals = 0);
460  OrbitalSpace(const std::string& id, const std::string& name,
461  const RefSCMatrix& full_coefs,
464  unsigned int nfzc, unsigned int nfzv,
465  const IndexOrder& moorder = energy);
468  OrbitalSpace(const std::string& id, const std::string& name,
469  const RefSCMatrix& full_coefs,
471  const Ref<Integral>& integral);
472 
475  OrbitalSpace(const std::string& id, const std::string& name,
476  const Ref<OrbitalSpace>& orig_space,
477  const RefSCMatrix& new_coefs,
478  const Ref<GaussianBasisSet>& new_basis);
479  ~OrbitalSpace();
480 
481  void save_data_state(StateOut&);
482 
483  OrbitalSpace& operator=(const OrbitalSpace& other);
484 
486  const std::string& name() const;
488 
496  const std::string& id() const;
498  const RefSCDimension& dim() const;
500  const Ref<GaussianBasisSet>& basis() const;
502  const Ref<Integral>& integral() const;
504  const RefSCMatrix& coefs() const;
506  RefSCMatrix coefs_nb() const;
508  const RefDiagSCMatrix& evals() const;
510  const std::vector<unsigned int>& orbsym() const;
512  unsigned int rank() const;
514  unsigned int nblocks() const;
516  const std::vector<unsigned int>& block_sizes() const;
517 
519  size_t memory_in_use() const;
520 
522  void print(std::ostream&o = ExEnv::out0()) const;
524  void print_summary(std::ostream& os) const;
526  void print_detail(std::ostream&o = ExEnv::out0()) const;
527 
528  };
529 
530  bool operator==(const OrbitalSpace& space1, const OrbitalSpace& space2);
531 
532  class CannotConstructMap: public std::logic_error {
533  public:
535  std::logic_error("Cannot map given OrbitalSpaces") {
536  }
537  };
538 
539  typedef std::vector<unsigned int> MOIndexMap;
547  MOIndexMap operator<<(const OrbitalSpace& space2, const OrbitalSpace& space1);
548 
552  std::vector<int> map(const OrbitalSpace& space2, const OrbitalSpace& space1, bool expect_same_bases = true);
553 
554  typedef std::vector<std::pair<unsigned int, double> > SparseMOIndexMap;
562  SparseMOIndexMap sparsemap(const OrbitalSpace& space2,
563  const OrbitalSpace& space1, double hardzero =
564  1e-12);
565 
575  RefSCMatrix transform(const OrbitalSpace& space2, const OrbitalSpace& space1,
576  const Ref<SCMatrixKit>& kit =
578 
584  RefSCMatrix overlap(const OrbitalSpace& space2, const OrbitalSpace& space1,
585  const Ref<SCMatrixKit>& kit =
587 
589  bool in(const OrbitalSpace& s1, const OrbitalSpace& s2);
590 
601  public:
602  struct exception {};
603 
605  ParsedOrbitalSpaceKey(const std::string& key);
606 
607  const std::string& key() const {
608  return key_;
609  }
610  const std::string& label() const {
611  return label_;
612  }
613  SpinCase1 spin() const {
614  return spin_;
615  }
616 
617  static std::string key(const std::string& label, SpinCase1 spin);
618 
619  private:
620  std::string key_;
621  std::string label_;
622  SpinCase1 spin_;
623  };
624 
636  public:
637  struct exception { };
638 
640  ParsedTransformedOrbitalSpaceKey(const std::string& key);
641 
642  const std::string& key() const {
643  return key_;
644  }
645  const std::string& label() const {
646  return label_;
647  }
648  SpinCase1 spin() const {
649  return spin_;
650  }
651  const std::string& support_label() const {
652  return support_label_;
653  }
654  SpinCase1 support_spin() const {
655  return spin_;
656  }
657  OneBodyOper::type transform_operator() const {
658  return transform_operator_;
659  }
660 
661  static std::string key(const std::string& label, SpinCase1 spin,
662  const std::string& original_label,
663  SpinCase1 original_spin, OneBodyOper::type oper);
664 
665  static bool valid_key(const std::string& key);
666 
667  private:
668  std::string key_;
669  std::string label_;
670  SpinCase1 spin_;
671  std::string support_label_;
672  SpinCase1 support_spin_;
673  OneBodyOper::type transform_operator_;
674  };
675 
677  typedef Registry<std::string, Ref<OrbitalSpace> ,
678  detail::NonsingletonCreationPolicy,
679  std::equal_to<std::string>,
682  std::pair<std::string, Ref<OrbitalSpace> > make_keyspace_pair(const Ref<
683  OrbitalSpace>& space, SpinCase1 spin = AnySpinCase1);
686  std::string new_unique_key(const Ref<OrbitalSpaceRegistry>& oreg);
687 
691  std::equal_to< Ref<GaussianBasisSet> >,
693 
695 
700  template <typename Order>
702  public:
703  OrderedOrbitalSpace(const std::string& id, const std::string& name,
705  const Ref<Integral>& integral,
706  const RefSCMatrix& coefs, const RefDiagSCMatrix& evals,
707  const RefDiagSCMatrix& occnums,
708  const std::vector<unsigned int>& orbsyms,
709  const Order& order);
710 
712  void save_data_state(StateOut&);
714 
715  private:
716 
718  // ClassDesc object
719  static ClassDesc class_desc_;
720  };
721 
724  template <typename Order>
726  public:
727  OrderedSpinOrbitalSpace(const std::string& id, const std::string& name,
729  const Ref<Integral>& integral,
730  const RefSCMatrix& coefs_alpha,
731  const RefSCMatrix& coefs_beta,
732  const RefDiagSCMatrix& evals_alpha,
733  const RefDiagSCMatrix& evals_beta,
734  const RefDiagSCMatrix& occnums_alpha,
735  const RefDiagSCMatrix& occnums_beta,
736  const std::vector<unsigned int>& orbsyms_alpha,
737  const std::vector<unsigned int>& orbsyms_beta,
738  const Order& order);
739 
741  void save_data_state(StateOut&);
743 
744  private:
745 
747  // ClassDesc object
748  static ClassDesc class_desc_;
749  };
750 
752 
756  public:
757  MaskedOrbitalSpace(const std::string& id, const std::string& name,
758  const Ref<OrbitalSpace>& orig_space,
759  const std::vector<bool>& mask);
760 
762  void save_data_state(StateOut&);
763 
764  };
765 
767 
772  public:
773  NonblockedOrbitalSpace(const std::string& id, const std::string& name,
774  const Ref<OrbitalSpace>& orig_space);
775 
777  void save_data_state(StateOut&);
778 
779  };
780 
782 
787  public:
788  AtomicOrbitalSpace(const std::string& id, const std::string& name,
790  const Ref<Integral>& integral);
791 
793  void save_data_state(StateOut&);
794 
795  };
796 
798 
802  public:
806  OrbitalSpaceUnion(const std::string& id, const std::string& name,
807  const OrbitalSpace& s1, const OrbitalSpace& s2,
808  bool merge_blocks = true);
809 
811  void save_data_state(StateOut&);
812  };
813 
815 
819  public:
820  EmptyOrbitalSpace(const std::string& id, const std::string& name,
822  const Ref<Integral>& integral,
823  const IndexOrder& moorder = symmetry
824  );
825 
827  void save_data_state(StateOut&);
828  private:
829  static ClassDesc class_desc_;
830  };
831 
833  // end of addtogroup ChemistryElectronicStructureOneBody
834 
835 }
836 
837 #include <chemistry/qc/wfn/orbitalspace.timpl.h>
838 
839 #endif
840 
841 // Local Variables:
842 // mode: c++
843 // c-file-style: "ETS"
844 // End:
845 
846 
sc::ParsedTransformedOrbitalSpaceKey::exception
Definition: orbitalspace.h:637
sc::ParticleHoleOrbitalAttributes::None
static ParticleHoleOrbitalAttributes None
neither holes nor particles can be created
Definition: orbitalspace.h:120
sc::OrbitalSpace::print
void print(std::ostream &o=ExEnv::out0()) const
Prints out this.
sc::new_unique_key
std::string new_unique_key(const Ref< OrbitalSpaceRegistry > &oreg)
helper function to create a key basename (i.e.
sc::OrbitalSpaceRegistry
Registry< std::string, Ref< OrbitalSpace >, detail::NonsingletonCreationPolicy, std::equal_to< std::string >, RefObjectEqual< OrbitalSpace > > OrbitalSpaceRegistry
registry of globally-known OrbitalSpace objects
Definition: orbitalspace.h:680
sc::OneBodyOper::type
type
Types of one-body operators, includes various context-dependent "projectors", such as 1-RDM,...
Definition: operator.h:103
sc::CorrelatedSpinMOOrder
order by occupation first, then by spin, then by symmetry, then by energy
Definition: orbitalspace.h:213
sc::ParticleHoleOrbitalAttributes::Particle
static ParticleHoleOrbitalAttributes Particle
only particles can be created
Definition: orbitalspace.h:118
sc::overlap
RefSCMatrix overlap(const OrbitalSpace &space2, const OrbitalSpace &space1, const Ref< SCMatrixKit > &kit=SCMatrixKit::default_matrixkit())
overlap(s2,s1) returns the overlap matrix between s2 and s1.
sc::OrbitalSpace::general
any other
Definition: orbitalspace.h:353
sc::OrbitalSpace::evals
const RefDiagSCMatrix & evals() const
Returns the "eigenvalues" matrix.
sc::OrbitalSpace::print_summary
void print_summary(std::ostream &os) const
Produces a short summary.
sc::OrbitalSpace::energy
energy corresponds to orbitals ordered by energy.
Definition: orbitalspace.h:349
sc::RefSCMatrix
The RefSCMatrix class is a smart pointer to an SCMatrix specialization.
Definition: matrix.h:135
sc::Ref
A template class that maintains references counts.
Definition: ref.h:361
sc::EnergyMOOrder
order by energy first, then by symmetry. EnergyCompare specifies the weak strict ordering of orbitals...
Definition: orbitalspace.h:156
sc::OrbitalSpace::orbsym
const std::vector< unsigned int > & orbsym() const
Returns the orbital symmetry array.
sc::OrbitalSpace::coefs
const RefSCMatrix & coefs() const
Returns the coefficient matrix.
sc::ParsedOrbitalSpaceKey::ParsedOrbitalSpaceKey
ParsedOrbitalSpaceKey(const std::string &key)
throws if key is not properly formatted
sc::OrbitalSpace::block_sizes
const std::vector< unsigned int > & block_sizes() const
Returns the number of orbitals in each block.
sc::OrbitalSpace::id
const std::string & id() const
Returns a short (preferably, one, max 10 character) identifier for the space.
sc::OrbitalSpace::correlated
correlated corresponds to orbitals ordered as: frozen occupied, active occupied, active virtual,...
Definition: orbitalspace.h:350
sc::OrbitalSpace::integral
const Ref< Integral > & integral() const
Returns the integral factory used to instantiate the coefficient matrix.
sc::AtomicOrbitalSpace::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::MaskedOrbitalSpace::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::detail::NonsingletonCreationPolicy
NonsingletonCreationPolicy is used to create non-Singletons on heap.
Definition: registry.h:73
sc::in
bool in(const std::pair< I, I > &r, const std::pair< I, I > &range)
return true if r is contained in range defined as pair<start,fence>, i.e. [start, fence)
Definition: mtensor.h:58
sc::ParsedOrbitalSpaceKey::exception
Definition: orbitalspace.h:602
sc::RefDiagSCMatrix
The RefDiagSCMatrix class is a smart pointer to an DiagSCMatrix specialization.
Definition: matrix.h:389
sc::NonblockedOrbitalSpace
This is an OrbitalSpace produced from an existing one by getting rid of the blocking.
Definition: orbitalspace.h:771
sc::ParticleHoleOrbitalAttributes::Any
static ParticleHoleOrbitalAttributes Any
holes and particles can be created
Definition: orbitalspace.h:119
sc::EmptyOrbitalSpace
This is an empty OrbitalSpace.
Definition: orbitalspace.h:818
sc::OrbitalSpace::IndexOrder
IndexOrder
Describes the ordering of indices.
Definition: orbitalspace.h:347
sc::CannotConstructMap
Definition: orbitalspace.h:532
sc::OrbitalSpace::rank
unsigned int rank() const
Returns the rank of the space.
sc::MolecularOrbitalMask
mask out first n MOs in the order defined by Compare. By default mask the n lowest-energy MOs
Definition: orbitalspace.h:285
sc::AOSpaceRegistry
Registry< Ref< GaussianBasisSet >, Ref< OrbitalSpace >, detail::NonsingletonCreationPolicy, std::equal_to< Ref< GaussianBasisSet > >, RefObjectEqual< OrbitalSpace > > AOSpaceRegistry
registry of globally-known OrbitalSpace objects that describe AO basis spaces
Definition: orbitalspace.h:692
sc::OrbitalSpace::dim
const RefSCDimension & dim() const
returns the dimension corresponding to this space
sc::StateIn
Definition: statein.h:79
sc::RefSCDimension
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition: dim.h:152
sc::ClassDesc
This class is used to contain information about classes.
Definition: class.h:147
sc::OrbitalSpace
Class OrbitalSpace describes a range of orbitals that are linear combinations of Gaussian basis funct...
Definition: orbitalspace.h:342
sc::OrbitalSpace::print_detail
void print_detail(std::ostream &o=ExEnv::out0()) const
Prints out this in details (coefficients, etc.)
sc::ParsedTransformedOrbitalSpaceKey::ParsedTransformedOrbitalSpaceKey
ParsedTransformedOrbitalSpaceKey(const std::string &key)
throws ParsedTransformedOrbitalSpaceKey::exception if the key is not properly formatted
sc::ParsedTransformedOrbitalSpaceKey
Parses keys of a "transformed" OrbitalSpace.
Definition: orbitalspace.h:635
sc::ParticleHoleOrbitalAttributes
Describes particle-hole attributes of orbitals.
Definition: orbitalspace.h:112
sc::AtomicOrbitalSpace
This is an OrbitalSpace describing a set of atomic orbitals.
Definition: orbitalspace.h:786
sc::MolecularSpinOrbitalAttributes
Same as MolecularOrbitalAttributes, plus spin.
Definition: orbitalspace.h:93
sc::SCMatrixKit::default_matrixkit
static SCMatrixKit * default_matrixkit()
This returns the default matrix kit.
sc::operator<<
std::vector< unsigned int > operator<<(const GaussianBasisSet &B, const GaussianBasisSet &A)
computes a map from basis functions in A to the equivalent basis functions in B.
sc::OrbitalSpace::OrbitalSpace
OrbitalSpace()
Empty constructor only useful for derived classes – don't forget to call init()
sc::OrbitalSpace::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::BlockedOrbital
DecoratedOrbital< unsigned int > BlockedOrbital
Orbital in a blocked space.
Definition: orbitalspace.h:67
sc::OrbitalSpaceUnion
This is a union of two OrbitalSpaces s1 and s2.
Definition: orbitalspace.h:801
sc::map
std::vector< int > map(const GaussianBasisSet &B, const GaussianBasisSet &A)
same as operator<<, except A does not have to be contained in B, map[a] = -1 if function a is not in ...
sc::other
SpinCase1 other(SpinCase1 S)
given 1-spin return the other 1-spin
sc::NonblockedOrbitalSpace::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::StateOut
Definition: stateout.h:71
sc::MaskedOrbitalSpace
This is an OrbitalSpace produced from an existing one by masking out some Orbitals.
Definition: orbitalspace.h:755
sc::OrbitalSpace::name
const std::string & name() const
Returns a self-contained expressive label.
sc::CorrelatedMOOrder
order by occupation first, then by symmetry, then by energy
Definition: orbitalspace.h:178
sc::OrbitalSpace::symmetry
symmetry corresponds to orbitals ordered by symmetry, then (i.e. within each symmetry block) by energ...
Definition: orbitalspace.h:348
sc::SymmetryMOOrder
order by symmetry first, then by energy, then by occ num
Definition: orbitalspace.h:127
sc::OrderedOrbitalSpace::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
Definition: orbitalspace.timpl.h:55
sc::EmptyOrbitalSpace::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::ExEnv::out0
static std::ostream & out0()
Return an ostream that writes from node 0.
sc::detail::ContainerAdaptor
Definition: orbitalspace.h:256
sc::make_keyspace_pair
std::pair< std::string, Ref< OrbitalSpace > > make_keyspace_pair(const Ref< OrbitalSpace > &space, SpinCase1 spin=AnySpinCase1)
helper function to form a key/space pair from a OrbitalSpace
sc::sparsemap
SparseMOIndexMap sparsemap(const OrbitalSpace &space2, const OrbitalSpace &space1, double hardzero=1e-12)
sparsemap(s2,s1) returns a sparse one-to-one map from s1 to s2.
sc::transform
RefSCMatrix transform(const OrbitalSpace &space2, const OrbitalSpace &space1, const Ref< SCMatrixKit > &kit=SCMatrixKit::default_matrixkit())
transform(s2,s1) returns matrix that transforms s1 to s2.
sc::OrbitalSpace::memory_in_use
size_t memory_in_use() const
Returns how much "significant" (i.e. O^2) memory this object uses.
sc::DecoratedOrbital
Orbital = index + attributes.
Definition: orbitalspace.h:53
sc::SavableState
Base class for objects that can save/restore state.
Definition: state.h:45
sc::operator==
bool operator==(const Atom &a, const Atom &b)
sc::OrbitalSpace::nblocks
unsigned int nblocks() const
Returns the number of blocks.
sc::OrderedSpinOrbitalSpace::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
Definition: orbitalspace.timpl.h:129
sc::OrderedOrbitalSpace
This is an OrbitalSpace ordered according to the Order type.
Definition: orbitalspace.h:701
sc::OrbitalSpaceUnion::OrbitalSpaceUnion
OrbitalSpaceUnion(const std::string &id, const std::string &name, const OrbitalSpace &s1, const OrbitalSpace &s2, bool merge_blocks=true)
sc::ParsedOrbitalSpaceKey
Parses keys of OrbitalSpace.
Definition: orbitalspace.h:600
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
sc::OrbitalSpace::coefs_nb
RefSCMatrix coefs_nb() const
Returns the coefficient matrix built with a non-blocked kit.
sc::ParticleHoleOrbitalAttributes::Hole
static ParticleHoleOrbitalAttributes Hole
only holes can be created
Definition: orbitalspace.h:117
sc::OrbitalSpaceUnion::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::OrderedSpinOrbitalSpace
Same as OrderedOrbitalSpace, except for spin-orbitals.
Definition: orbitalspace.h:725
sc::Registry
Registry wraps std::map and can be policy-configured to act as a Singleton or a regular object.
Definition: registry.h:112
sc::OrbitalSpace::basis
const Ref< GaussianBasisSet > & basis() const
Returns the AO basis set.
sc::MolecularOrbitalAttributes
MO is irrep, energy, occupation number.
Definition: orbitalspace.h:70
sc::RefObjectEqual
this functor can be used as a binary predicate for standard algorithms.
Definition: ref.h:659

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