Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #27232: is_isomorphic broken with keyword edge_labels=True
This code led to finding this bug in the `is_isomorphic` method. Here is a simple working example: {{{ sage: m1 = matrix(ZZ, [[1, -1, -1], [-1, -1, -1], [1, 0, -1]]) sage: m2 = matrix(ZZ, [[-1, -1, -1], [-1, 1, -1], [-1, 1, 0]]) }}} The two matrices are equal up to permutation of rows and columns: {{{ sage: m1.is_permutation_of(m2) True }}} But, not over `CyclotomicField`s: {{{ sage: CF = CyclotomicField(1) sage: p1 = matrix(CF, [[1, -1, -1], [-1, -1, -1], [1, 0, -1]]) sage: p2 = matrix(CF, [[-1, -1, -1], [-1, 1, -1], [-1, 1, 0]]) sage: p1.is_permutation_of(p2) False }}} Even with 2 is also does not work: {{{ sage: CF = CyclotomicField(2) sage: p1 = matrix(CF, [[1, -1, -1], [-1, -1, -1], [1, 0, -1]]) sage: p2 = matrix(CF, [[-1, -1, -1], [-1, 1, -1], [-1, 1, 0]]) sage: p1.is_permutation_of(p2) False }}} This error is provoked at the level of graphs: {{{ sage: g1 = p1.as_bipartite_graph() sage: g2 = p2.as_bipartite_graph() sage: sorted(g1.edge_labels()) [1, -1, -1, -1, -1, -1, 1, 0, -1] sage: sorted(g2.edge_labels()) [-1, -1, -1, -1, 1, -1, -1, 1, 0] }}} URL: https://trac.sagemath.org/27232 Reported by: jipilab Ticket author(s): David Coudert Reviewer(s): Travis Scrimshaw, John Palmieri
- Loading branch information