ITensor / ITensor/NamedGraphs.jl

[ENHANCEMENT] Further improvements to graph indexing code logic

Open
#116 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Julia
Stars
10
Forks
5
Avg merge
6h 43m
Merged PRs (30d)
17

Description

Here are some potential followups to #115:

  • Vertex wrapper (like Vertices but indicating it is a single vertex).
  • to_vertex function as an interface for canonicalizing single vertex inputs, such as converting QuotientVertexVertex to a plain vertex (which is currently handled by to_graph_index).
  • get_graph_index could call out to new interface functions get_graph_vertex or get_graph_edge, and maybe call to_vertex or to_edge for vertex/edge canonicalization (see the point above proposing to_vertex).
  • get_graph_indices could call out to new interface functions get_graph_vertices or get_graph_edges, which could call to_vertices or to_edges for vertex/edge collection canonicalization (such as wrapping QuotientVertexVertices in a QuotientVertexSlice).
  • Reevaluate parent_graph_indices, maybe find a better name or see if it can be removed.
  • Reevaluate graph_index_list_to_graph_index name/interface. Maybe it could be called flatten_graph_index_list?
  • Define isassigned(g::AbstractNamedGraph, I) = false (and write it in terms of associated interface functions is_graph_index_assigned, etc. which would get overloaded by DataGraphs).
  • Define and ispartitioned(g) trait function and use it in departition/unpartition, see the discussion here: https://github.com/ITensor/DataGraphs.jl/pull/55#discussion_r2774748837.
  • Reassess what is output by add/rem_vertex!, add/rem_edge!, since it is not consistent with the output of those functions in Graphs.jl. Maybe we want to introduce other stricter interfaces like insert_vertex!, delete_vertex!, set_vertex!, unset_vertex!, etc. (modeled after the Dictionaries.jl interface).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading issue #115 and the linked pull-request discussion. The issue lists several possible interface and naming changes but does not identify files, tests, or a single agreed scope. Before implementation, narrow it to one follow-up and define the expected interface behavior and completion criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.