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

Define commoninds(tensors...)

Open LinjianMa opened this issue 4 years ago • 3 comments

LinjianMa avatar Feb 05 '22 04:02 LinjianMa

Do you mean generalize commoninds(::ITensor...) to the case where the "tensors" are tensor networks?

mtfishman avatar Feb 07 '22 00:02 mtfishman

yes, I would like to get all inner indices of a tensor network. Not sure if commoninds is the correct one, but something like that

LinjianMa avatar Feb 07 '22 18:02 LinjianMa

Maybe we would call it linkinds to match the same concept for MPS. It could be a dictionary that takes a pair of vertex labels corresponding to an edge of the network with ITensors with common indices as keys and outputs the common indices.

It doesn't help you directly just yet, but I've been working on a rewrite of https://github.com/mtfishman/ITensorNetworks.jl which is meant to define operations like this for generic tensor networks (in addition to priming, tagging, getting external indices of a network, etc.). It has a graph interface and is built on top of some graph data structures, so linkinds(tn::ITensorNetwork) outputs a metagraph with vertex labels that match the vertex labels of the input ITensorNetwork, and the metadata of the edges are the indices common between the tensors living on the incident vertices. I think that design leads to a pretty intuitive interface, but it needs more development to make it fully featured for applications.

mtfishman avatar Feb 07 '22 19:02 mtfishman