TBTK
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 
23 #ifndef COM_DAFER45_TBTK_SUM_RULE
24 #define COM_DAFER45_TBTK_SUM_RULE
25 
26 #include "TBTK/FockSpace.h"
27 #include "TBTK/FockStateRule.h"
28 #include "TBTK/Index.h"
29 
30 #include <initializer_list>
31 #include <vector>
32 
33 namespace TBTK{
34 namespace FockStateRule{
35 
36 class SumRule : public FockStateRule{
37 public:
39  SumRule(
40  std::initializer_list<Index> stateIndices,
41  int numParticles
42  );
43 
45  SumRule(
46  std::vector<Index> stateIndices,
47  int numParticles
48  );
49 
51  virtual ~SumRule();
52 
54  virtual SumRule* clone() const;
55 
57  virtual WrapperRule createNewRule(
58  const LadderOperator<BitRegister> &ladderOperator
59  ) const;
60 
62  virtual WrapperRule createNewRule(
63  const LadderOperator<ExtensiveBitRegister> &ladderOperator
64  ) const;
65 
68  virtual bool isSatisfied(
69  const FockSpace<BitRegister> &fockSpace,
70  const FockState<BitRegister> &fockState
71  ) const;
72 
75  virtual bool isSatisfied(
76  const FockSpace<ExtensiveBitRegister> &fockSpace,
77  const FockState<ExtensiveBitRegister> &fockState
78  ) const;
79 
81  virtual bool operator==(const FockStateRule &rhs) const;
82 
84  virtual void print() const;
85 private:
87  std::vector<Index> stateIndices;
88 
91  int numParticles;
92 };
93 
94 }; //End of namespace FockStateRule
95 }; //End of namespace TBTK
96 
97 #endif
virtual WrapperRule createNewRule(const LadderOperator< BitRegister > &ladderOperator) const
virtual bool operator==(const FockStateRule &rhs) const
Flexible physical index.
Definition: FockSpace.h:44
SumRule(std::initializer_list< Index > stateIndices, int numParticles)
Definition: FockState.h:34
Definition: SumRule.h:36
FockStateRule.
Definition: FockStateRule.h:40
Definition: WrapperRule.h:31
virtual SumRule * clone() const
Definition: ModelFactory.h:35
virtual void print() const
Definition: FockState.h:37
virtual bool isSatisfied(const FockSpace< BitRegister > &fockSpace, const FockState< BitRegister > &fockState) const