(a) (b)
Figure 5. Density matrix evolution in the 3-state problem described in snippet, Figure 4: a) a snippet to read and plot the computed density matrix from the generated HDF5 file; b) the time-dependence of populations (diagonal matrix elements) and coherences (off-diagonal matrix elements).
The results of HEOM calculations are stored in an HDF5-format file, called by default “mem_data.hdf” and stored in the automatically-created directory defined by the “prefix” keyword of the input parameters. The “dynamics.heom” module utilizes the “libra_py.data_savers” module, which defines the convenience classes to temporarily store arbitrary data in RAM, to save it in the HDF5 files all-in-once or on-the-fly, and to control other relevant properties of the produced HDF5 files, such as internal storage type and the compression level. In turn, the “data_savers” module utilizes the “h5py” library38 that enables Python to create and read the HDF5 files.
The HDF5 files produced by the “heom.save” module have the data groups called identically to the entries of the “properties_to_save” list in the input parameters dictionary. Each data group contains the metadata about the stored entry (e.g. the dimensionality of the archive) and the data itself. The latter is stored in the dataset always called “data”, such that one can access the density matrix e.g. via the following instruction “f[“denmat/data”][:, :, :]” (e.g. see Figure 5a). The results can be easily plotted using the standard “matplotlib” library39,40 (Figure 5b).