Skip to content

Fix bug for GraphHamiltonian with colored eges

Created by: femtobit

When using colored edges, GraphHamiltonian cannot be constructed right now as it expects es = graph.edges(color=True) to return a list of tuples of the form (edge, color) == ((i, j), color) but in reality elements of es have the form (i, j, color).

This went unnoticed because it seems we did not have a test case for a GraphOperator with colored edges. Thus, this PR (a) adds such a test case (153227c4) and (b) fixes the bug in GraphOperator (9e796ac8).

Merge request reports