TBTK
Need a break? Support the development by playing Polarity Puzzles
DifferenceRule.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_DIFFERENCE_RULE
25 #define COM_DAFER45_TBTK_DIFFERENCE_RULE
26 
27 #include "TBTK/FockStateRule/FockStateRule.h"
28 #include "TBTK/Index.h"
29 
30 namespace TBTK{
31 namespace FockStateRule{
32 
33 class DifferenceRule : public FockStateRule{
34 public:
36  DifferenceRule(
37  std::initializer_list<Index> addStateIndices,
38  std::initializer_list<Index> subtractStateIndices,
39  int difference
40  );
41 
43  DifferenceRule(
44  std::vector<Index> addStateIndices,
45  std::vector<Index> subtractStateIndices,
46  int difference
47  );
48 
50  virtual ~DifferenceRule();
51 
53  virtual DifferenceRule* clone() const;
54 
56  virtual WrapperRule createNewRule(
57  const LadderOperator<BitRegister> &ladderOperator
58  ) const;
59 
61  virtual WrapperRule createNewRule(
62  const LadderOperator<ExtensiveBitRegister> &ladderOperator
63  ) const;
64 
67  virtual bool isSatisfied(
68  const FockSpace<BitRegister> &fockSpace,
69  const FockState<BitRegister> &fockState
70  ) const;
71 
74  virtual bool isSatisfied(
75  const FockSpace<ExtensiveBitRegister> &fockSpace,
76  const FockState<ExtensiveBitRegister> &fockState
77  ) const;
78 
80  virtual bool operator==(const FockStateRule &rhs) const;
81 
83  virtual void print() const;
84 private:
86  std::vector<Index> addStateIndices;
87 
89  std::vector<Index> subtractStateIndices;
90 
93  int difference;
94 };
95 
96 }; //End of namespace FockStateRule
97 }; //End of namespace TBTK
98 
99 #endif
100 
Physical index.
Definition: Boolean.h:32