TBTK
FockStateRule.h
Go to the documentation of this file.
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_FOCK_STATE_RULE
24 #define COM_DAFER45_TBTK_FOCK_STATE_RULE
25 
26 #include "TBTK/FockState.h"
27 #include "TBTK/BitRegister.h"
29 #include "TBTK/LadderOperator.h"
30 
31 namespace TBTK{
32 
33 template<typename BIT_REGISTER>
34 class FockSpace;
35 
36 namespace FockStateRule{
37 
38 class WrapperRule;
39 
41 public:
48  enum class FockStateRuleID {
49  WrapperRule = 0,
50  SumRule = 1,
51  DifferenceRule = 2
52  };
53 
55  FockStateRule(FockStateRuleID fockStateRuleID);
56 
58  virtual ~FockStateRule();
59 
61  virtual FockStateRule* clone() const = 0;
62 
65  virtual WrapperRule createNewRule(
66  const LadderOperator<BitRegister> &ladderOperator
67  ) const = 0;
68 
71  virtual WrapperRule createNewRule(
72  const LadderOperator<ExtensiveBitRegister> &ladderOperator
73  ) const = 0;
74 
77  virtual bool isSatisfied(
78  const FockSpace<BitRegister> &fockSpace,
79  const FockState<BitRegister> &fockState
80  ) const = 0;
81 
84  virtual bool isSatisfied(
85  const FockSpace<ExtensiveBitRegister> &fockSpace,
86  const FockState<ExtensiveBitRegister> &fockState
87  ) const = 0;
88 
90  virtual bool operator==(const FockStateRule &rhs) const = 0;
91 
98  friend WrapperRule operator*(
99  const LadderOperator<BitRegister> &ladderOperator,
100  const FockStateRule &fockStateRule
101  );
102 
109  friend WrapperRule operator*(
110  const LadderOperator<ExtensiveBitRegister> &ladderOperator,
111  const FockStateRule &fockStateRule
112  );
113 
116 
118  virtual void print() const = 0;
119 private:
121  FockStateRuleID fockStateRuleID;
122 };
123 
125  return fockStateRuleID;
126 }
127 
128 }; //End of namespace FockSpaceRule
129 }; //End of namespace TBTK
130 
131 #endif
Definition: FockSpace.h:44
Register of bits.
FockStateRuleID
Definition: FockStateRule.h:48
FockStateRule(FockStateRuleID fockStateRuleID)
virtual WrapperRule createNewRule(const LadderOperator< BitRegister > &ladderOperator) const =0
virtual FockStateRule * clone() const =0
Definition: FockState.h:34
virtual void print() const =0
Definition: SumRule.h:36
virtual bool operator==(const FockStateRule &rhs) const =0
Register of bits.
Definition: FockStateRule.h:40
Definition: WrapperRule.h:31
Definition: DifferenceRule.h:32
FockState.
Definition: ModelFactory.h:35
friend WrapperRule operator*(const LadderOperator< BitRegister > &ladderOperator, const FockStateRule &fockStateRule)
Definition: WrapperRule.h:98
Definition: FockState.h:37
virtual bool isSatisfied(const FockSpace< BitRegister > &fockSpace, const FockState< BitRegister > &fockState) const =0
FockStateRuleID getFockStateRuleID() const
Definition: FockStateRule.h:124