ITensorNetworks.jl icon indicating copy to clipboard operation
ITensorNetworks.jl copied to clipboard

Allow passing a `Graphs.SimpleGraph` to `siteinds`

Open mtfishman opened this issue 3 years ago • 1 comments

Allow passing Graphs.SimpleGraph to siteinds(site_type::String, graph).

Also define a default constructor NamedDimGraph(g::SimpleGraph) = NamedDimGraph(g, 1:nv(g)) which could be used internally in siteinds(::String, graph).

Originally posted by @mtfishman in https://github.com/mtfishman/ITensorNetworks.jl/pull/6#discussion_r978956086

mtfishman avatar Sep 23 '22 18:09 mtfishman

It seems the constructor NamedDimGraph(g::SimpleGraph) already works thanks to NamedGraphs.default_vertices.

leburgel avatar Oct 04 '22 17:10 leburgel