1 #ifndef CNTR_HERM_MATRIX_DECL_H 2 #define CNTR_HERM_MATRIX_DECL_H 8 template <
typename T>
class function;
9 template <
typename T>
class herm_matrix_timestep;
46 typedef std::complex<T>
cplx;
56 #if __cplusplus >= 201103L 67 int element_size(
void)
const {
return element_size_; }
68 int size1(
void)
const {
return size1_; }
69 int size2(
void)
const {
return size2_; }
70 int ntau(
void)
const {
return ntau_; }
71 int nt(
void)
const {
return nt_; }
72 int sig(
void)
const {
return sig_; }
79 inline cplx *lesptr(
int i,
int j);
81 inline cplx *retptr(
int i,
int j);
83 inline cplx *tvptr(
int i,
int j);
85 inline cplx *matptr(
int i);
87 inline const cplx *lesptr(
int i,
int j)
const;
89 inline const cplx *retptr(
int i,
int j)
const;
91 inline const cplx *tvptr(
int i,
int j)
const;
93 inline const cplx *matptr(
int i)
const;
96 template <
class Matrix>
97 void get_les(
int i,
int j, Matrix &M)
const;
99 template <
class Matrix>
100 void get_gtr(
int i,
int j, Matrix &M)
const;
102 template <
class Matrix>
103 void get_ret(
int i,
int j, Matrix &M)
const;
105 template <
class Matrix>
106 void get_vt(
int i,
int j, Matrix &M)
const;
108 template <
class Matrix>
109 void get_tv(
int i,
int j, Matrix &M)
const;
111 template <
class Matrix>
112 void get_mat(
int i, Matrix &M)
const;
114 template <
class Matrix>
115 void get_matminus(
int i, Matrix &M)
const;
119 inline void get_les(
int i,
int j,
cplx &x)
const;
121 inline void get_gtr(
int i,
int j,
cplx &x)
const;
123 inline void get_ret(
int i,
int j,
cplx &x)
const;
125 inline void get_vt(
int i,
int j,
cplx &x)
const;
127 inline void get_tv(
int i,
int j,
cplx &x)
const;
129 inline void get_mat(
int i,
cplx &x)
const;
131 inline void get_matminus(
int i,
cplx &x)
const;
133 cplx density_matrix(
int i)
const;
135 template <
class Matrix>
136 void density_matrix(
int tstp, Matrix &M)
const;
140 template <
class Matrix>
141 void set_les(
int i,
int j, Matrix &M);
143 template <
class Matrix>
144 void set_ret(
int i,
int j, Matrix &M);
146 template <
class Matrix>
147 void set_tv(
int i,
int j, Matrix &M);
149 template <
class Matrix>
150 void set_mat(
int i, Matrix &M);
152 template<
class Matrix>
void set_mat_real(
int i,Matrix &M);
154 void set_mat_herm(
int i);
156 void set_mat_herm(
void);
158 inline void set_les(
int i,
int j,
cplx x);
160 inline void set_ret(
int i,
int j,
cplx x);
162 inline void set_tv(
int i,
int j,
cplx x);
164 inline void set_mat(
int i,
cplx x);
166 void print_to_file(
const char *file,
int precision = 16)
const;
171 #if CNTR_USE_HDF5 == 1 174 void write_to_hdf5(
const char *filename,
const char *groupname);
180 void read_from_hdf5(
int nt1, hid_t group_id,
const char *groupname);
181 void read_from_hdf5(
int nt1,
const char *filename,
const char *groupname);
219 void set_submatrix(std::vector<int> &i1,std::vector<int> &i2,
221 void set_submatrix(
int tstp, std::vector<int> &i1,std::vector<int> &i2,
230 left_multiply(
int tstp,
cplx *f0,
cplx *ft,
234 right_multiply(
int tstp,
cplx *f0,
cplx *ft,
236 void left_multiply(
int tstp,
function<T> &ft, T weight = 1.0);
242 void left_multiply_(
int tstp,
function<T> &ft, T weight,
243 std::integral_constant<int, SIZE>);
244 void right_multiply(
int tstp,
function<T> &ft, T weight = 1.0);
247 void right_multiply_(
int tstp,
function<T> &ft, T weight,
248 std::integral_constant<int, SIZE>);
255 void smul(
int tstp, T weight);
258 #if CNTR_USE_MPI == 1 265 int les_offset(
int t,
int t1)
const;
266 int ret_offset(
int t,
int t1)
const;
267 int tv_offset(
int t,
int tau)
const;
268 int mat_offset(
int tau)
const;
305 #endif // CNTR_HERM_MATRIX_DECL_H void clear(void)
Sets all values to zero.
void get_timestep(int tstp, herm_matrix_timestep< T > ×tep) const
Class herm_matrix_timestep deals with contour objects at a particular timestep .
void resize_nt(int nt)
Resizes herm_matrix object with respect to the number of time points nt. Internal routine; see top-l...
void resize_discard(int nt, int ntau, int size1)
Discards the herm_matrix object and resize with respect to the number of time points nt...
void left_multiply_hermconj(int tstp, function< T > &ft, T weight=1.0)
Left-multiplies the herm_matrix with the hermitian conjugate of a contour function.
void smul(int tstp, T weight)
Multiplies all component of the herm_matrix with a real scalar.
void right_multiply_hermconj(int tstp, function< T > &ft, T weight=1.0)
Right-multiplies the herm_matrix with the hermitian conjugate of a contour function.
void set_timestep_zero(int tstp)
Sets all components at time step tstp to zero.
void incr_timestep(int tstp, herm_matrix_timestep< T > ×tep, cplx alpha)
Adds a herm_matrix_timestep with given weight to the herm_matrix.
void set_matrixelement(int tstp, int i1, int i2, herm_matrix_timestep< T > ×tep)
Sets given matrix elements of all components at time step tstp to the components of a given herm_mat...
Class function for objects with time on real axis.
void Recv_timestep(int tstp, int root, int tag)
Recevies the herm_matrix at a given time step from a specific task.
void Send_timestep(int tstp, int dest, int tag)
Sends the herm_matrix at a given time step to a specific task.
void set_submatrix(std::vector< int > &i1, std::vector< int > &i2, herm_matrix< T > &g, std::vector< int > &j1, std::vector< int > &j2)
Sets a (sub-) matrix of this contour object at all time steps to a (sub-) matrix of a given herm_mat...
Class herm_matrix for two-time contour objects with hermitian symmetry.
void write_to_hdf5(hid_t group_id)
Stores herm_matrix to a given group in HDF5 format.
void print_to_file(const char *file, int precision=16) const
Saves the herm_matrix to file in text format.
void write_to_hdf5_tavtrel(hid_t group_id, int dt)
Stores greater and lesser components of herm_matrix average-relative time representation to a given ...
void Reduce_timestep(int tstp, int root)
MPI reduce for the herm_matrix at a given time step.
void write_to_hdf5_slices(hid_t group_id, int dt)
Stores time slices of herm_matrix with a given interval to a HDF5 group handle. ...
void set_timestep(int tstp, herm_matrix &g1)
Sets all components at time step tstp to the components of a given herm_matrix. ...
void read_from_hdf5(hid_t group_id)
Reads herm_matrix from a given HDF5 group handle.
herm_matrix & operator=(const herm_matrix &g)
void Bcast_timestep(int tstp, int root)
Broadcasts the herm_matrix at a given time step to all tasks.
void resize(int nt, int ntau, int size1)
Resizes herm_matrix object with respect to the number of time points nt, points on the Matsubara bra...
void incr(herm_matrix< T > &g, cplx alpha)
Adds a herm_matrix with given weight to the herm_matrix at all time steps.
void read_from_file(const char *file)
Reads the herm_matrix from file in text format.