ITensor / ITensorNetworks.jl

A package with general tools for working with higher-dimensional tensor networks based on ITensor.
MIT License
51 stars 12 forks source link

Improve compatibility with tensor networks without internal vertices #144

Closed b-kloss closed 3 months ago

b-kloss commented 4 months ago

This PR addresses some issues related to using Tensor Networks where the vertex_data at some vertices is empty, e.g. Index[]. In particular the behaviour of check_hascommoninds which is for example called when computing an inner product between two tensor networks is now comparing empty vertex_data as equal. A test has been added that verifies that an inner product can be taken.

ToDo:

codecov-commenter commented 4 months ago

Codecov Report

Attention: Patch coverage is 33.33333% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 73.55%. Comparing base (3eb5362) to head (576bed3).

Files Patch % Lines
src/abstractitensornetwork.jl 33.33% 4 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #144 +/- ## ========================================== - Coverage 73.62% 73.55% -0.08% ========================================== Files 70 70 Lines 4118 4122 +4 ========================================== Hits 3032 3032 - Misses 1086 1090 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mtfishman commented 4 months ago

@b-kloss another approach here would be to just remove hascommoninds(::typeof(siteinds), A::AbstractITensorNetwork, B::AbstractITensorNetwork) and check_hascommoninds(::typeof(siteinds), A::AbstractITensorNetwork, B::AbstractITensorNetwork), I think basically they were copied over to this package from the MPS code in ITensors.jl where we were being more strict about inputs of certain functions but they may be more trouble than they are worth, and inherently may restrict the tensor network structure of certain functions more than we want in general.

mtfishman commented 3 months ago

This was addressed in #148.