I tried to run the sample code for TRG provided on the ITensor homepage (https://itensor.org/docs.cgi?page=book/trg&vers=cppv3) to familiarize myself with ITensor. I followed the instructions, cloned the latest version of ITensor with git, successfully installed it and tried to compile the code. However, I received the following error message:
trg.cc: In function ‘int main()’:
trg.cc:47:12: error: 3 names provided while ‘std::tuple<itensor::ITensor, itensor::ITensor>’ decomposes into 2 elements
auto [Fl,Fr,lnew] = factor(A,{r,d},{l,u},{"MaxDim=",maxdim,
^~~~~~~~~~~~~
trg.cc:52:12: error: 3 names provided while ‘std::tuple<itensor::ITensor, itensor::ITensor>’ decomposes into 2 elements
auto [Fu,Fd,unew] = factor(A,{l,d},{u,r},{"MaxDim=",maxdim,
Looking into the documentation, factor should behave as
factor(ITensor T, IndexSet Ais[, IndexSet Bis],
Args args = Args::global()) -> std::tuple<ITensor,ITensor>
Indeed, if I replace the the call to factor with
auto [Fl,Fr] = factor(A,{r,d},{l,u},{"MaxDim=",maxdim,
"Tags=","left,scale="+str(scale),
"ShowEigs=",true});
auto l_new = commonIndex(Fl,Fr);
and correspondingly the second call for factoring A in Fu, Fd , everything seems to work fine.
I was just wondering if I overlooked something, or if the calls to factor in the example provided should be replaced as shown above?