Skip to content
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

Make the pullback for split_network more general #21

Open
mtfishman opened this issue Jul 26, 2021 · 0 comments
Open

Make the pullback for split_network more general #21

mtfishman opened this issue Jul 26, 2021 · 0 comments

Comments

@mtfishman
Copy link
Member

Right now the pullback for split_network assumes that the network was split by priming one index of a pair of link indices, and also that none of the tensors of the original network before splitting were primed. It would be good to generalize this assumption.

This could be done by analyzing which pairs of indices get split in the forward pass, and how they were split, and use that information in the reverse pass.

function ChainRulesCore.rrule(
::typeof(split_network),
tn::Matrix{ITensor};
projector_center=default_projector_center(tn),
)
function pullback(dtn_split::Matrix{ITensor})
dtn = map(t -> replaceprime(t, 1 => 0), dtn_split)
return (NoTangent(), dtn, NoTangent())
end
return split_network(tn; projector_center=projector_center), pullback
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant