[ITensors] [ENHANCEMENT] Expose ConvergenceInfo
in calls to KrylovKit methods
#88
Labels
enhancement
New feature or request
ConvergenceInfo
in calls to KrylovKit methods
#88
I'm be curious what others think of the value of the following. I was recently trying to debug some issues I was having with
linsolve
via ITensorTDVP (which I understand will be deprecated by ITensorMPS).linsolve
is built on top of KrylovKits methods and in this particular case their implementation of GMRES.Underlying this all, there is a series of iterations which are trying to minimize a cost function (usually the square of the L2 norm of some residual vector, for
linsolve
its the cost function formed by doing two-site overlapping updates up the MPS chain). I found myself wondering how I could see this residual or "cost" for each iteration of the GMRES call. I don't think it is currently exposed in ITensors. I know withoutputlevel
you can see themaxtruncerr
but I don't think that is the same as the residual or cost from GMRES. If I have that wrong please set me straight. From KrylovKit's documentation, the residual information is contained in a struct calledConvergenceInfo
.Starting from my specific use case of
linsolve
here is what I found:linsolve
callsalternating_update
alternating_update
callssweep_update
sweep_update
callssub_sweep_update
Within
sub_sweep_update
there is a call toregion_update!
which does appear to returnConvergenceInfo
from KyrlovKit asinfo
(see line 117 ofsweep_update.jl
). However, it never makes it outside the call tosweep_update
. So it would be a matter of propagatinginfo
back up the chain of return values. Probably some type of container would need to be created to hold theConvergenceInfo
for each call toregion_update!
. This could be done with aNamedTuple
or maybe something more complex if its warranted.Thoughts on this?
The text was updated successfully, but these errors were encountered: