+1 vote
edited

Hello Miles and ITensor team!

Thanks for the great library for handling tensor network algorithms! I am using the lastest version of ITensor v3 in C++, Ubuntu 18.04 and using gcc. I made two programs, one that calculates the ground state of the Extended Hubbard Model and saves the variables sites (Hubbard object) and mps to the disk. The other program loads these objects to make another calculations. But, when I am loading these objects in the second program, I get and error in the execution that follows:

"terminate called after throwing an instance of 'std::length_error'
what(): vector::_M_default_append"

I know the error is in the following line:

MPS psi = readFromFile<MPS>(format("./data/obc/%s/N_%03d/psi",foldername,N)+append, sites);


At the moment, I was not able to reproduce the error without needing to use the specific mps that I have saved to disk, and the saved mps files may have been generated in a previous version of itensor. While I am trying to analyze in debug mode and create a code that reproduces the error, I would like some opinion about what it could be, since I don't know the conditions that this error happens, and ask two questions: (1) can previous versions of mps still be loaded in the most recent version of ITensor? (2) Is the old Hubbard siteset completely equivalent to Electron siteset (just a change in the name of the spinfull fermion sites object)?

The important parameters of my code are maxdim = 2000 (and the mps reaches this limit), and cutoff = 1E-20. Using a number of N = 20 sites this error occurs, but for N = 22 it no longer occurs.

I really appreciate any help and I will update this post as soon as I discover the reason for the error. Thanks.