Move the ITensors.MPS/ITensors.MPO graph interface layer from ITensor/ITensorTDVP.jl#43 into this package, once that PR is merged.
An interesting question that hits on some limitations of Julia's subtyping system is that it would be nice for ITensors.MPS/ITensors.MPO to work in the functions defined in these packages, once they adhere to the AbstractDataGraph interface. However, it is awkward to try to make them subtypes of AbstractDataGraph.
It's possible to do that without making ITensors.jl depend on the full DataGraphs.jl package by making an interface package DataGraphsCore.jl in the spirit of StaticArraysCore.jl but that seems a bit overkill. The alternative is to use traits implemented with the SimpleTraits.jl package, and define traits such as IsITensorNetwork or IsDataGraph which are then overloaded for ITensors.MPS/ITensors.MPO, but that also seems a bit overkill as well since then we would need to define all of the functions we currently define through abstract type dispatch with AbstractITensorNetwork or AbstractDataGraph with traits instead.
In the end, it may not matter so much since I think the ITensorNetworks.TreeTensorNetwork type will supersede the ITensors.MPS/ITensors.MPO types but be superior in a variety of ways, so we can just keep some simple interfacing functionality and have conversions from ITensors.MPS/ITensors.MPO to ITensorNetworks.TreeTensorNetwork.
Move the
ITensors.MPS/ITensors.MPOgraph interface layer from ITensor/ITensorTDVP.jl#43 into this package, once that PR is merged.An interesting question that hits on some limitations of Julia's subtyping system is that it would be nice for
ITensors.MPS/ITensors.MPOto work in the functions defined in these packages, once they adhere to theAbstractDataGraphinterface. However, it is awkward to try to make them subtypes ofAbstractDataGraph.It's possible to do that without making
ITensors.jldepend on the fullDataGraphs.jlpackage by making an interface packageDataGraphsCore.jlin the spirit of StaticArraysCore.jl but that seems a bit overkill. The alternative is to use traits implemented with the SimpleTraits.jl package, and define traits such asIsITensorNetworkorIsDataGraphwhich are then overloaded forITensors.MPS/ITensors.MPO, but that also seems a bit overkill as well since then we would need to define all of the functions we currently define through abstract type dispatch withAbstractITensorNetworkorAbstractDataGraphwith traits instead.In the end, it may not matter so much since I think the
ITensorNetworks.TreeTensorNetworktype will supersede theITensors.MPS/ITensors.MPOtypes but be superior in a variety of ways, so we can just keep some simple interfacing functionality and have conversions fromITensors.MPS/ITensors.MPOtoITensorNetworks.TreeTensorNetwork.