ITensorNetworkAD.jl icon indicating copy to clipboard operation
ITensorNetworkAD.jl copied to clipboard

Find a way to get Zygote working with PEPS without overloading `Base.:+(::PEPS, ::PEPS)`

Open mtfishman opened this issue 4 years ago • 0 comments

Currently, Zygote makes use of the definition Base.:+(::PEPS, ::PEPS) to add up sums of gradient terms that show up in the chain rule. For the sake of adding up gradient terms, it is an elementwise sum of the elements of the PEPS tensors. However, this definition is at odds with the usual definition we would think of for adding PEPS in terms of adding the quantum states.

It would be nice to find a way to overload Zygote behavior so we can define Base.:+(::PEPS, ::PEPS) as the addition of quantum states instead of elementwise addition.

Cross reference: https://github.com/ITensor/ITensorNetworkAD.jl/pull/10#discussion_r671600409

mtfishman avatar Jul 20 '21 13:07 mtfishman