TBTK
Need a break? Support the development by playing Polarity Puzzles
DefaultMap.h
1 /* Copyright 2017 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_DEFAULT_MAP
25 #define COM_DAFER45_TBTK_DEFAULT_MAP
26 
27 #include "TBTK/FockStateMap/FockStateMap.h"
28 #include "TBTK/BitRegister.h"
30 
31 namespace TBTK{
32 namespace FockStateMap{
33 
34 template<typename BIT_REGISTER>
35 class DefaultMap : public FockStateMap<BIT_REGISTER>{
36 public:
38  DefaultMap(unsigned int exponentialDimension);
39 
41  virtual ~DefaultMap();
42 
44  virtual unsigned int getBasisSize() const;
45 
47  virtual unsigned int getBasisIndex(const FockState<BIT_REGISTER> &fockState) const;
48 
50  virtual FockState<BIT_REGISTER> getFockState(unsigned int index) const;
51 private:
52 };
53 
54 template<typename BIT_REGISTER>
55 DefaultMap<BIT_REGISTER>::DefaultMap(
56  unsigned int exponentialDimension
57 ) :
58  FockStateMap<BIT_REGISTER>(exponentialDimension)
59 {
60 }
61 
62 template<typename BIT_REGISTER>
63 DefaultMap<BIT_REGISTER>::~DefaultMap(){
64 }
65 
66 template<typename BIT_REGISTER>
67 unsigned int DefaultMap<BIT_REGISTER>::getBasisSize() const{
68  return (1 << FockStateMap<BIT_REGISTER>::getExponentialDimension());
69 }
70 
71 }; //End of namespace FockStateMap
72 }; //End of namespace TBTK
73 
74 #endif
75 
Register of bits.
Register of bits.
Definition: Boolean.h:32