This bug is fixed in the upstream SageMath branch (with additional
tests), but let's fix it here too until it hits "develop".
# Make a graph with ray -> ray edges where the coefficients in the
# W-representation nonzero. Beware: while they ultimately represent
# rays of K, the W-coordinates have been renumbered by pivots().
- vertices = list(range(W.dimension()))
+ vertices = list(range(K.nrays()))
edges = [ (i,pivots[j])
- for i in range(K.nrays())
+ for i in vertices
for j in W.coordinate_vector(K.ray(i)).nonzero_positions()
if pivots[j] != i ]
from sage.graphs.graph import Graph