Hi, good question about this. Currently it's not a feature the present code offers. The truncation happens deep inside a set of function calls and I didn't put in the chain of return values to pass the discarded weight values back out. Also it's a bit complicated to define a single discarded weight value on each bond because the truncation is done block-by-block looping over blocks of quantum number conserving tensors.
But a simple fix for your purposes could be to modify the code to print out the discarded weigh at each bond, combined or averaged in some way over the blocks.
Here's what you could do: the relevant function is compressMPO, defined near line 1143 of the file itensor/mps/autompo.cc
There is a loop on line 1184 over QN-Matrix pairs called "qb" (quantum number & block). Each block is converted to a Matrix object and a non-truncating SVD is performed on it (the call to SVD on line 1196). Then the singular values are truncated by the call to truncate on line 1200.
The truncate function on line 1200 returns a std::tuple<Real,Real>, the first entry of which is the truncation error. So you can grab this truncation error as follows:
Real truncerr=0, docut=0;
std::tie(truncerr,docut) = truncate(D,maxm,minm,cutoff);
and then you could either print all the truncerr values or take a max or average of them at each bond, say.
I hope that helps - please let me know if you have a suggestion about how this could be improved in the library in a more permanent way that people could use in the future.
Miles