NESSi  v1.0.2 The NonEquilibrium Systems Simulation Library

## ◆ write_to_hdf5_tavtrel() [1/3]

template<typename T >
 void cntr::herm_matrix< T >::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 HDF5 group handle.

Purpose

Stores greater and lesser components of herm_matrix $$C(t,t^\prime)$$ in Wigner time representation to a given HDF5 group handle. The representation is defined by $$\widetilde{C}^\gtrless}(T,t) = C^\gtrless(T+t/2,T-t/2)$$. Every dt time steps are stored.

Parameters
 group_id The HDF5 group handle. dt Store the slices as function of the relative time every dt time steps.

Definition at line 1939 of file cntr_herm_matrix_impl.hpp.

1939  {
1940  assert(dt >= 1);
1941
1942  typedef std::complex<double> complex;
1943  char name[100];
1944  if (nt_ < 0)
1945  return;
1946  complex *ggtr = new complex[(nt_ + 1) * element_size_]; // temp storage
1947  complex *gles = new complex[(nt_ + 1) * element_size_]; // temp storage
1948  store_int_attribute_to_hid(group_id, std::string("nt"), nt_);
1949  store_int_attribute_to_hid(group_id, std::string("size1"), size1_);
1950  store_int_attribute_to_hid(group_id, std::string("size2"), size2_);
1951  store_int_attribute_to_hid(group_id, std::string("element_size"),
1952  element_size_);
1953  hid_t group_id_les = create_group(group_id, std::string("les"));
1954  hid_t group_id_gtr = create_group(group_id, std::string("gtr"));
1955  hsize_t len_shape = 3, shape[3];
1956  shape[1] = size1_;
1957  shape[2] = size2_;
1958  for (int tav = 0; tav <= nt_; tav += dt) {
1959  int len = (tav <= nt_ - tav ? tav : nt_ - tav);
1960  std::sprintf(name, "%d", tav);
1961  shape[0] = len + 1;
1962  // read data: trel2 is trel/2
1963  for (int trel2 = 0; trel2 <= len; trel2++) {
1964  cdmatrix ggtrtt, glestt;
1965  this->get_les(tav + trel2, tav - trel2, glestt);
1966  this->get_gtr(tav + trel2, tav - trel2, ggtrtt);
1967  for (int i = 0; i < element_size_; i++) {
1968  gles[trel2 * element_size_ + i] =
1969  glestt(i / size2_, i % size2_);
1970  ggtr[trel2 * element_size_ + i] =
1971  ggtrtt(i / size2_, i % size2_);
1972  }
1973  }
1974  store_cplx_array_to_hid(group_id_les, std::string(name), gles, shape,
1975  len_shape);
1976  store_cplx_array_to_hid(group_id_gtr, std::string(name), ggtr, shape,
1977  len_shape);
1978  }
1979  delete[] ggtr;
1980  delete[] gles;
1981 }