SOLIDstate
A C++ library for solid state physics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
ParticleNumberOperator.hpp
Go to the documentation of this file.
1 
11 #ifndef OBSERVABLE_PARTICLENUMBEROPERATOR_HPP
12 #define OBSERVABLE_PARTICLENUMBEROPERATOR_HPP
13 
14 #include "Observable.hpp"
15 
16 namespace solid
17 {
18 
31 template <template <typename> class T1, typename T2>
32 class ParticleNumberOperator : public Observable<T1, T2>, public IOperatorParameters<T1, T2>
33 {
36 
37 public:
44  {
45  L = _L;
46  SelectTerms();
48  }
49 
50 private:
51  int L;
52 
53  void SelectTerms()
54  {
55  _operator.termsEnabled.terms = {TermsEnum::FermionOneBodyInteraction};
56  }
57 
58  void FillParameters() override
59  {
60  arma::SpMat<T2> mu = arma::eye<arma::SpMat<T2>>(L, L);
61  parameters["mu"] = mu;
62  }
63 };
64 
65 } // namespace solid
66 
67 #endif
Observable parent class.
Definition: Observable.hpp:75
interface for Observable class
Definition: Observable.hpp:29
void FillParameters() override
Filling the Parameters.
Definition: ParticleNumberOperator.hpp:58
Parameters< T2 > parameters
parameters for Observable
Definition: Observable.hpp:85
void SelectTerms()
Definition: ParticleNumberOperator.hpp:53
Interface and class parent for Observables.
Operator< T1, T2 > _operator
container for matrixElements
Definition: Observable.hpp:81
implementation of the Total ParticleNumberOperator
Definition: ParticleNumberOperator.hpp:32
int L
Definition: ParticleNumberOperator.hpp:51