I am doing some ground state simulations and I want to obtain the von Neumann entropy of entanglement of bipartition i.e. the "bond entropy" which is computed automatically by OSMPS. If I understand correctly it is stored in a binary file along with the matrix product states (is it?), and can be obtained by calling the appropriate post-processing commands. For certain technical reasons I don't want to use OSMPS' built-in post-processing tools. Is there a convenient way to tell OSMPS to store the bond entropy in a raw text data file in a manner similar to how OSMPS deals with user-defined observables?
Regards,
Elmer
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
you can read the bond entropy from the results files directly. The binaries store the MPS as its whole, but no results. The results are written in your "Write_Directory" ending on ObsOut0_k.dat where k corresponds the k-th item in your list of convergence parameters. For the details:
1) In order to measure the bond entropy, you have to measure at least a single local observable.
2) Since you are doing statics, each file contains exactly one set of measurements. The file contains all measurements.
a) First line: energy, variance, convergence flag, bond dimension
b) Local observables: for each local observables one line. Number of floats corresponds to the number of sites.
c) If at least one local observable: site entropies in one line
d) If at least one local observable: bond entropies in one line
e) Other measurements, but if you only need the bond entropy, you can close the file at this point.
I don't know how familiar you are with python, but you can take a closer look at this in the file Obs.py in the function GetUnitObservableFromFile.
Let me know if this was detailed enough or if you need any further information to extract your results.
Kind regards,
Daniel Jaschke
P.S. Personally, I think it might be faster to use the openMPS postprocessing and just write a new file in the structure you need for your postprocessing. If you do your post processing in python anyway, you could store the intermediate results as numpy arrays.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, those output files do not contain the bond entropy, just the first line with energy etc. followed by my user-defined 'corr' observable (an LxL array of data) - this is why I thought the bond entropy was stored in the binary file. Should I define a (superfluous) 'site' observable to obtain both the 'SiteEntropy' and the 'BondEntropy'? Perhaps this is a bug?
I use Python and NumPy for post-processing, but I generate many simulations in parallel and the bookkeeping is a bit less cumbersome when accessing the data directly although I am certain I could equivalently use OSMPS' post-processing syntax.
Best regards, and thanks for the swift response,
Elmer
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
the measurement of entropies (site and bond entropy) is tied to the measurement of a local observable, I guess due to historical reasons. I will think about changing that for some future release.
But for you at this very moment: yes, measuring a superfluous local observable is the way to go. As local measurements are almost for free - especially in comparison to correlations - this should not affect calculation time much.
Kind regards,
Daniel Jaschke
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am doing some ground state simulations and I want to obtain the von Neumann entropy of entanglement of bipartition i.e. the "bond entropy" which is computed automatically by OSMPS. If I understand correctly it is stored in a binary file along with the matrix product states (is it?), and can be obtained by calling the appropriate post-processing commands. For certain technical reasons I don't want to use OSMPS' built-in post-processing tools. Is there a convenient way to tell OSMPS to store the bond entropy in a raw text data file in a manner similar to how OSMPS deals with user-defined observables?
Regards,
Elmer
Hallo Elmer,
you can read the bond entropy from the results files directly. The binaries store the MPS as its whole, but no results. The results are written in your "Write_Directory" ending on ObsOut0_k.dat where k corresponds the k-th item in your list of convergence parameters. For the details:
1) In order to measure the bond entropy, you have to measure at least a single local observable.
2) Since you are doing statics, each file contains exactly one set of measurements. The file contains all measurements.
a) First line: energy, variance, convergence flag, bond dimension
b) Local observables: for each local observables one line. Number of floats corresponds to the number of sites.
c) If at least one local observable: site entropies in one line
d) If at least one local observable: bond entropies in one line
e) Other measurements, but if you only need the bond entropy, you can close the file at this point.
I don't know how familiar you are with python, but you can take a closer look at this in the file Obs.py in the function GetUnitObservableFromFile.
Let me know if this was detailed enough or if you need any further information to extract your results.
Kind regards,
Daniel Jaschke
P.S. Personally, I think it might be faster to use the openMPS postprocessing and just write a new file in the structure you need for your postprocessing. If you do your post processing in python anyway, you could store the intermediate results as numpy arrays.
Hello,
Well, those output files do not contain the bond entropy, just the first line with energy etc. followed by my user-defined 'corr' observable (an LxL array of data) - this is why I thought the bond entropy was stored in the binary file. Should I define a (superfluous) 'site' observable to obtain both the 'SiteEntropy' and the 'BondEntropy'? Perhaps this is a bug?
I use Python and NumPy for post-processing, but I generate many simulations in parallel and the bookkeeping is a bit less cumbersome when accessing the data directly although I am certain I could equivalently use OSMPS' post-processing syntax.
Best regards, and thanks for the swift response,
Elmer
Hallo Elmer,
the measurement of entropies (site and bond entropy) is tied to the measurement of a local observable, I guess due to historical reasons. I will think about changing that for some future release.
But for you at this very moment: yes, measuring a superfluous local observable is the way to go. As local measurements are almost for free - especially in comparison to correlations - this should not affect calculation time much.
Kind regards,
Daniel Jaschke
Thanks - that seems to work.