Skip to content

Contracting Vertices and Deleting Vertices in a ITensorNetwork formed from an inner product #5

@JoeyT1994

Description

@JoeyT1994

Given an ITensorNetwork formed from the inner product of two ITensorNetworks, trying to delete a vertex or contract a vertex onto another raises an error that the corresponding vertex doesn't exist.

Mininal Working Example:

using ITensors
using ITensorNetworks

dims = (2,2)
n = prod(dims)
g = named_grid(dims)

s = siteinds("S=1/2", g)

ψ_peps = ITensorNetwork(s, v -> "")

tn = inner(ψ_peps, sim(dag(ψ_peps), sites=[]))

display(tn[(2,1,2)])

tn = ITensors.contract(tn,  (2, 1,2) => (1, 1,2))

Raises the following output:

image

The issue seems to track down to attempting to remove a vertex (using the overloaded rem_vertex! from the graphs julia package) from the inner product tensor network.

Another Minimal Working Example which raises an issue when trying to form an inner product from an ITensorNetwork which has a vertex deleted from it:

using ITensors
using ITensorNetworks
using MultiDimDictionaries
using NamedGraphs
using Graphs

dims = (2,2)
n = prod(dims)
g = named_grid(dims)

s = siteinds("S=1/2", g)

ψ_peps = ITensorNetwork(s, v -> "")

rem_vertex!(ψ_peps, (1,2))

display(ψ_peps)

tn = inner(ψ_peps, sim(dag(ψ_peps), sites=[]))

Raising the output:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions