MPQC  3.0.0-alpha
restricted.hpp
1 #ifndef MPQC_CI_RESTRICTED_HPP
2 #define MPQC_CI_RESTRICTED_HPP
3 
4 #include "mpqc/ci/ci.hpp"
5 #include "mpqc/ci/subspace.hpp"
6 #include "mpqc/math/matrix.hpp"
7 
8 namespace mpqc {
9 namespace ci {
10 
13 
15  struct Restricted {
17  template<class Index>
19  const std::vector< Subspace<Alpha> > &A,
20  const std::vector< Subspace<Beta> > &B)
21  {
22  mpqc::matrix<bool> mask(A.size(), B.size());
23  for (int j = 0; j < B.size(); ++j) {
24  for (int i = 0; i < A.size(); ++i) {
25  mask(i,j) = test(ci, A.at(i), B.at(j));
26  }
27  }
28  return SubspaceGrid(A, B, mask);
29  }
31  template<class Index>
32  static bool test(const CI<Restricted, Index> &ci,
33  const String &a)
34  {
35  return (ci.excitation(a) <= ci.config.rank);
36  }
38  template<class Index>
39  static bool test(const CI<Restricted, Index> &ci,
40  const Space<Alpha> &a,
41  const Space<Beta> &b)
42  {
43  return ((a.rank() + b.rank()) <= ci.config.rank);
44  }
45  };
46 
48 
49 } // namespace ci
50 } // namespace mpqc
51 
52 #endif // MPQC_CI_RESTRICTED_HPP
mpqc::ci::SubspaceGrid
Grid of subspaces, represented as blocks of determinants defined by alpha/beta pair,...
Definition: subspace.hpp:103
mpqc
Contains new MPQC code since version 3.
Definition: integralenginepool.hpp:37
mpqc::ci::CI::config
const ci::Config config
CI configuration.
Definition: ci.hpp:79
mpqc::matrix< bool >
mpqc::ci::Restricted::test
static bool test(const CI< Restricted, Index > &ci, const String &a)
tests if the excitation to a is allowed
Definition: restricted.hpp:32
mpqc::ci::Restricted::test
static bool test(const CI< Restricted, Index > &ci, const Space< Alpha > &a, const Space< Beta > &b)
tests if simultaneous excitation to space a and space b is allowed
Definition: restricted.hpp:39
mpqc::ci::CI
CI class template.
Definition: ci.hpp:71
mpqc::ci::Subspace
A range of a space where all objects in the subspace range are assumed to have the same space rank.
Definition: subspace.hpp:51
mpqc::ci::Restricted::grid
static SubspaceGrid grid(const CI< Restricted, Index > &ci, const std::vector< Subspace< Alpha > > &A, const std::vector< Subspace< Beta > > &B)
Create Restricted CI subspace grid.
Definition: restricted.hpp:18
mpqc::ci::Restricted
Restricted CI Functor.
Definition: restricted.hpp:15
mpqc::ci::Space
A CI space, marked by Spin S and rank.
Definition: subspace.hpp:32
mpqc::ci::CI::excitation
int excitation(const String &s) const
rank/excitation of the string relative to its ground state, ie [11..00]
Definition: ci.hpp:117
mpqc::ci::String
Definition: string.hpp:24

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