-
Notifications
You must be signed in to change notification settings - Fork 23
Preserve message type upon use of rescale
#254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@JoeyT1994 this is the same process we went through in ITensors.jl and ITensorMPS.jl when we upgraded those codes to work on GPU. It'll be nice to have the code more generic for other reasons, for example these kinds of changes should make it easier to use exotic number types like |
|
@mtfishman Yeah I noticed it when trying to do some sampling from 2D PEPS on GPU (which pre-normalizes for stability). Definitely will be good to have it all working for all sort of different number types (as far as I can tell we have done a pretty good job as this was all I could find). |
Something I do with tests now is set them up so they loop over different element types and array types: https://github.com/ITensor/BlockSparseArrays.jl/blob/8cfd7f9ea56a6cfb7c185903298879c1dfdb9e61/test/test_basics.jl#L49-L61, we should start doing that with ITensorNetworks tests. |
This PR fixes a bug where the
rescale(bpc::BeliefPropagationCache, ...)function would automatically convert messages to 32-bit floating point precision because of them being normalized by an inverse power which automatically converts everything to 64-bit precision.A test is added that checks calling
normalizenow appropriately conserves the precision.