TBTK
Need a break? Support the development by playing Polarity Puzzles
SumRule.h
1 /* Copyright 2016 Kristofer Björnson
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
17 
24 #ifndef COM_DAFER45_TBTK_SUM_RULE
25 #define COM_DAFER45_TBTK_SUM_RULE
26 
27 #include "TBTK/FockSpace.h"
28 #include "TBTK/FockStateRule/FockStateRule.h"
29 #include "TBTK/Index.h"
30 
31 #include <initializer_list>
32 #include <vector>
33 
34 namespace TBTK{
35 namespace FockStateRule{
36 
37 class SumRule : public FockStateRule{
38 public:
40  SumRule(
41  std::initializer_list<Index> stateIndices,
42  int numParticles
43  );
44 
46  SumRule(
47  std::vector<Index> stateIndices,
48  int numParticles
49  );
50 
52  virtual ~SumRule();
53 
55  virtual SumRule* clone() const;
56 
58  virtual WrapperRule createNewRule(
59  const LadderOperator<BitRegister> &ladderOperator
60  ) const;
61 
63  virtual WrapperRule createNewRule(
64  const LadderOperator<ExtensiveBitRegister> &ladderOperator
65  ) const;
66 
69  virtual bool isSatisfied(
70  const FockSpace<BitRegister> &fockSpace,
71  const FockState<BitRegister> &fockState
72  ) const;
73 
76  virtual bool isSatisfied(
77  const FockSpace<ExtensiveBitRegister> &fockSpace,
78  const FockState<ExtensiveBitRegister> &fockState
79  ) const;
80 
82  virtual bool operator==(const FockStateRule &rhs) const;
83 
85  virtual void print() const;
86 private:
88  std::vector<Index> stateIndices;
89 
92  int numParticles;
93 };
94 
95 }; //End of namespace FockStateRule
96 }; //End of namespace TBTK
97 
98 #endif
99 
Physical index.
Definition: Boolean.h:32