Open JoeyT1994 opened 5 months ago
In v0.11.5
of ITensorNetworks, if all the vertices
are integers, the alg="bp"
fails
ERROR: LoadError: MethodError: induced_subgraph(::ITensorNetwork{Int64}, ::Vector{Int64}) is ambiguous.
Candidates:
induced_subgraph(graph::DataGraphs.AbstractDataGraph, subvertices)
@ DataGraphs ~/.julia/packages/DataGraphs/2Mi8t/src/abstractdatagraph.jl:385
induced_subgraph(g::T, vlist::AbstractVector{U}) where {U<:Integer, T<:Graphs.AbstractGraph}
@ Graphs ~/.julia/packages/Graphs/S7tMY/src/operators.jl:657
Possible fix, define
induced_subgraph(::T, ::AbstractVector{U}) where {U<:Integer, T<:DataGraphs.AbstractDataGraph}
Could you make a PR to DataGraphs.jl fixing that issue? As a reference, this is how it is fixed in NamedGraphs.jl: https://github.com/mtfishman/NamedGraphs.jl/blob/0feb5396d9aa0142cd4292f138ccf17d83f8339b/src/namedgraph.jl#L219-L238
Couple of bugs that we know exist and stem from
ITensorNetworks.jl
f
maps to0
for a givenx
(because its projection ends up with0
tensors) then callingcalculate_fx(f, x)
will yieldNan
because the BP contraction backend inITensorNetworks.jl
doesn't correctly handle0
tensors. A small change toITensorNetworks.jl
should fix this. For now we have to docalculate_fx(f, x; alg = "exact")
to deal with it.~contract(O::ITensorNetwork, f::ITensorNetwork)
when the bond dimension of theTNS f
is1
. This is presumably stemming from something in theTTN
code inITensorNetworks.jl