Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Make the pullback for split_network more general #21

Description

@mtfishman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions