Closed GTorlai closed 2 years ago
As part of the PEPS gradient optimization code in https://github.com/ITensor/ITensorNetworkAD.jl we are thinking about general strategies for approximate gradient optimization of tensor networks, maybe would be of interest here as well (though it seems like in the circuit case, the approximate gradients can be computed in a straightforward way with runcircuit
so a general strategy may not be necessary).
I think we could incorporate the AD part to compute the gradients of the tensor that are removed from the network wrt the tensor parameters. Otherwise those derivatives have to be implemented manually.
Right, that is definitely a step where we will want to use AD.
Can we already plug in the ITensorNetworkAD.jl
for this use case?
We can probably just use the simpler package https://github.com/mtfishman/ITensorsGrad.jl for that more limited usage (like differentiating through constructing an ITensor from an Array). ITensorNetworkAD.jl
builds on top of that functionality for network level AD.
I think actually the hardest part will be doing AD through all of our data structures that we use to make the gate list (like we have to AD through making the gate list and then making the ITensor gates from the gate list, where many of those operations are probably not differentiable), so we will have to think about how to do that correctly.
I was thinking something much simpler. As in just using AD at the lowest level of the AD graph, and using exact gradients on anything above that. Eventually we will want to just use AD on end-to-end calculation.
Gotcha, maybe there is a simpler way to do it than the one I am picturing.
We should finalize the interface for optimizing parametrized circuits. Two near-term use cases are the minimization of a given MPO (e.g. VQE), and the maximization of fidelity (e.g. optimal coherent control). In both cases the optimization reduces to evaluate environments and propagate the gradients through the contractions.