MPQC 3.0.0-alpha
Loading...
Searching...
No Matches
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
8namespace mpqc {
9namespace 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
Contains new MPQC code since version 3.
Definition integralenginepool.hpp:37
CI class template.
Definition ci.hpp:75
int excitation(const String &s) const
rank/excitation of the string relative to its ground state, ie [11..00]
Definition ci.hpp:117
const ci::Config config
CI configuration.
Definition ci.hpp:79
size_t rank
Restricted CI order, rank=0 implies Full CI.
Definition ci.hpp:27
Restricted CI Functor.
Definition restricted.hpp:15
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
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
static bool test(const CI< Restricted, Index > &ci, const String &a)
tests if the excitation to a is allowed
Definition restricted.hpp:32
A CI space, marked by Spin S and rank.
Definition subspace.hpp:32
Definition string.hpp:24
Grid of subspaces, represented as blocks of determinants defined by alpha/beta pair,...
Definition subspace.hpp:103
A range of a space where all objects in the subspace range are assumed to have the same space rank.
Definition subspace.hpp:51
Matrix class derived from Eigen::Matrix with additional MPQC integration.
Definition matrix.hpp:23

Generated at Wed Sep 25 2024 02:45:30 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.12.0.