JoeyT1994 / ITensorNumericalAnalysis.jl

MIT License
4 stars 1 forks source link

Known ITensorNetwork based Bugs #25

Open JoeyT1994 opened 5 months ago

JoeyT1994 commented 5 months ago

Couple of bugs that we know exist and stem from ITensorNetworks.jl

  1. ~If a ITensorNetwork function f maps to 0 for a given x (because its projection ends up with 0 tensors) then calling calculate_fx(f, x) will yield Nan because the BP contraction backend in ITensorNetworks.jl doesn't correctly handle 0 tensors. A small change to ITensorNetworks.jl should fix this. For now we have to do calculate_fx(f, x; alg = "exact") to deal with it.~
  2. There seem to be some numerical issues with calling a TNO-TNS contraction with contract(O::ITensorNetwork, f::ITensorNetwork) when the bond dimension of the TNS f is 1. This is presumably stemming from something in the TTN code in ITensorNetworks.jl
ryanlevy commented 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}
mtfishman commented 5 months ago

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