TBTK
DifferenceRule.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_DIFFERENCE_RULE
24 #define COM_DAFER45_TBTK_DIFFERENCE_RULE
25 
26 #include "TBTK/FockStateRule.h"
27 #include "TBTK/Index.h"
28 
29 namespace TBTK{
30 namespace FockStateRule{
31 
33 public:
36  std::initializer_list<Index> addStateIndices,
37  std::initializer_list<Index> subtractStateIndices,
38  int difference
39  );
40 
43  std::vector<Index> addStateIndices,
44  std::vector<Index> subtractStateIndices,
45  int difference
46  );
47 
49  virtual ~DifferenceRule();
50 
52  virtual DifferenceRule* clone() const;
53 
55  virtual WrapperRule createNewRule(
56  const LadderOperator<BitRegister> &ladderOperator
57  ) const;
58 
60  virtual WrapperRule createNewRule(
61  const LadderOperator<ExtensiveBitRegister> &ladderOperator
62  ) const;
63 
66  virtual bool isSatisfied(
67  const FockSpace<BitRegister> &fockSpace,
68  const FockState<BitRegister> &fockState
69  ) const;
70 
73  virtual bool isSatisfied(
74  const FockSpace<ExtensiveBitRegister> &fockSpace,
75  const FockState<ExtensiveBitRegister> &fockState
76  ) const;
77 
79  virtual bool operator==(const FockStateRule &rhs) const;
80 
82  virtual void print() const;
83 private:
85  std::vector<Index> addStateIndices;
86 
88  std::vector<Index> subtractStateIndices;
89 
92  int difference;
93 };
94 
95 }; //End of namespace FockStateRule
96 }; //End of namespace TBTK
97 
98 #endif
Flexible physical index.
Definition: FockSpace.h:44
virtual WrapperRule createNewRule(const LadderOperator< BitRegister > &ladderOperator) const
DifferenceRule(std::initializer_list< Index > addStateIndices, std::initializer_list< Index > subtractStateIndices, int difference)
virtual bool isSatisfied(const FockSpace< BitRegister > &fockSpace, const FockState< BitRegister > &fockState) const
Definition: FockState.h:34
virtual DifferenceRule * clone() const
virtual bool operator==(const FockStateRule &rhs) const
FockStateRule.
Definition: FockStateRule.h:40
Definition: WrapperRule.h:31
Definition: DifferenceRule.h:32
Definition: ModelFactory.h:35
Definition: FockState.h:37