write_to_disk does not work.

Hello,

In dmrg calculations, When the bond dimension is large, we can write some operators in the disk to reduce the memory cost. From the sample code, we should add the kwargs write_when_maxdim_exceeds when call dmrg engine, and the following is my julia code

       energy, psi = dmrg(H, psi0, sweeps; write_when_maxdim_exceeds=25)

But I find it does not work, as I can not find the related files in the work directory. What should I do to fixed this problem?

my ITensor is v0.3.18

Thanks a lot.

Zongsheng Zhou.

Hi Zongsheng,
Thanks for the question. The write to disk feature here is working, but is just putting the files into a folder on your computer in a location you may not expect. The locations are determined by calling the tempname() function in Julia, which on my Mac have values like "/var/folders/lp/ps_h2f0x3slbjl73k01qf1v800014g/T/jl_owCTeT". Depending on your machine the locations may be different.

The writing to disk in ITensor is handled by the SerializedElementArrays library which calls tempname() internally to determine the folder location.

A good feature we might add is to have the dmrg function print the folder name when write to disk is turned on, and when the outputlevel option is >=2.

Overall, though, you shouldn’t need to know the folder name in a typical scenario since ITensor will manage the location for you, and Julia will or should delete this folder after it finishes running (I checked and on my machine Julia does delete the files automatically after the Julia session ends).

Hi miles,

Thanks a lot for your answer,it dispels my doubts .

Best regards.

1 Like