save

tenpy.tools.hdf5_io.save(data, filename, mode='w')[source]

Save data to file with given filename.

This function guesses the type of the file from the filename ending. Supported endings:

ending

description

.pkl

Pickle without compression

.pklz

Pickle with gzip compression.

.hdf5, .h5

HDF5 file (using h5py).

Parameters:
  • filename (str) – The name of the file where to save the data.

  • mode (str) – File mode for opening the file. 'w' for write (discard existing file), 'a' for append (add data to existing file). See open() for more details.