v2DM-DOCI  1.0
PHM.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Copyright (C) 2014-2015 Ward Poelmans
5  *
6  * This file is part of v2DM-DOCI.
7  *
8  * v2DM-DOCI is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * Foobar is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
20  *
21  * @END LICENSE
22  */
23 
24 #ifndef PHM_H
25 #define PHM_H
26 
27 #include<memory>
28 #include<hdf5.h>
29 
30 #include "helpers.h"
31 #include "BlockStructure.h"
32 
33 namespace doci2DM
34 {
35 
36 class TPM;
37 
38 class PHM: public BlockMatrix
39 {
40  friend std::ostream &operator<<(std::ostream &output,PHM &phm);
41 
42  public:
43 
44  PHM(int, int);
45 
46  PHM(const PHM &) = default;
47 
48  PHM(PHM &&) = default;
49 
50  virtual ~PHM() = default;
51 
52  PHM& operator=(const PHM &) = default;
53 
54  PHM& operator=(PHM &&) = default;
55 
56  using BlockMatrix::operator=;
57 
58  using BlockMatrix::operator();
59 
60  double operator()(int a, int b, int c, int d) const;
61 
62  const Matrix& getBlock(int a, int b) const;
63 
64  Matrix& getBlock(int a, int b);
65 
66  int gN() const;
67 
68  int gL() const;
69 
70  void G(const TPM &);
71 
72  Matrix Gimg(const TPM &) const;
73 
74  Matrix Gbuild() const;
75 
76  void sep_pm(BlockMatrix &, BlockMatrix &);
77 
78  void sqrt(int);
79 
80  void invert();
81 
82  void L_map(const BlockMatrix &, const BlockMatrix &);
83 
84  void WriteToFile(hid_t &group_id) const;
85 
86  void ReadFromFile(hid_t &group_id);
87 
88  void WriteFullToFile(hid_t &group_id) const;
89 
90  private:
91 
92  void constr_lists(int L);
93 
94  int L;
95 
96  int N;
97 
99  static std::unique_ptr<helpers::tmatrix<int>> s2ph;
100 
102  static std::unique_ptr<helpers::tmatrix<int>> ph2s;
103 
105  static std::unique_ptr<helpers::tmatrix<int>> s2b;
106 
108  static std::unique_ptr<helpers::tmatrix<int>> b2s;
109 };
110 
111 }
112 
113 #endif /* PHM_H */
114 
115 /* vim: set ts=3 sw=3 expandtab :*/
static std::unique_ptr< helpers::tmatrix< int > > s2b
table translating single particles indices to the correct 2x2 block
Definition: PHM.h:105
PHM(int, int)
Definition: PHM.cpp:40
static std::unique_ptr< helpers::tmatrix< int > > s2ph
table translating single particles indices to two particle indices
Definition: PHM.h:99
void WriteToFile(hid_t &group_id) const
Definition: PHM.cpp:388
int gL() const
Definition: PHM.cpp:191
void WriteFullToFile(hid_t &group_id) const
Definition: PHM.cpp:435
void sqrt(int)
Definition: PHM.cpp:357
int gN() const
Definition: PHM.cpp:186
Matrix Gimg(const TPM &) const
Definition: PHM.cpp:262
void invert()
Definition: PHM.cpp:366
const Matrix & getBlock(int a, int b) const
Definition: PHM.cpp:203
Matrix Gbuild() const
Definition: PHM.cpp:296
void G(const TPM &)
Definition: PHM.cpp:230
void ReadFromFile(hid_t &group_id)
Definition: PHM.cpp:499
virtual ~PHM()=default
void sep_pm(BlockMatrix &, BlockMatrix &)
Definition: PHM.cpp:343
double operator()(int a, int b, int c, int d) const
Definition: PHM.cpp:129
static std::unique_ptr< helpers::tmatrix< int > > b2s
table translating the block index to the single particle indices
Definition: PHM.h:108
int N
Definition: PHM.h:96
static std::unique_ptr< helpers::tmatrix< int > > ph2s
table translating two particles indices to single particle indices
Definition: PHM.h:102
void constr_lists(int L)
Definition: PHM.cpp:56
PHM & operator=(const PHM &)=default
int L
Definition: PHM.h:94
void L_map(const BlockMatrix &, const BlockMatrix &)
Definition: PHM.cpp:375
friend std::ostream & operator<<(std::ostream &output, PHM &phm)
Definition: PHM.cpp:320