Skip to content

Magnets: revisions to (hypergraph) coloring#2972

Merged
brad-lackey merged 4 commits intofeature/qrefrom
brlackey/magnets-revisions
Feb 26, 2026
Merged

Magnets: revisions to (hypergraph) coloring#2972
brad-lackey merged 4 commits intofeature/qrefrom
brlackey/magnets-revisions

Conversation

@brad-lackey
Copy link

Issue: different terms in a Trotter expansion may need different coloring of the edges. So the coloring is not an intrinsic property of the graph. We remove (edge) coloring of a graph to be a seperate class, and shift all the coloring functionality to this class. Hence a single graph can now support multiple different colorings.

  • Major revisions to the Hypergraph class and introduction of the HypergraphEdgeColoring class
  • Introduction of the the edge_coloring() function that wraps greedy_edge_coloring() for the base class
  • Revisions of each of the graph subclasses to remove coloring and create an overloaded version of edge_coloring()
  • Revisions of the docstrings across all these classes
  • Minor changes to some string representations
  • Update to all the unit tests

Copy link
Member

@msoeken msoeken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me, but some tests are not passing (see actions tab for details).

@brad-lackey
Copy link
Author

Problem fixed (there was nondeterminism in one of the tests).

@brad-lackey brad-lackey merged commit 41bf7b5 into feature/qre Feb 26, 2026
9 checks passed
@brad-lackey brad-lackey deleted the brlackey/magnets-revisions branch February 26, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants