Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Like this

def _libgap_(self):
    """
    self = a directed graph with vertices 0, ... , n-1
    """
    from sage.libs.gap.libgap import libgap
    libgap.LoadPackage("QPA")
    L = [(x + 1, y + 1, f"x_i")
         for i, (x, y) in enumerate(self.edges(labels=False))]
    return libgap.Quiver(dg.num_verts(), L)

Like this

def _libgap_(self):
    """
    self = a directed graph with vertices 0, ... , n-1
    """
    from sage.libs.gap.libgap import libgap
    libgap.LoadPackage("QPA")
    L = [(x + 1, y + 1, f"x_i")
f"x_{i}")
         for i, (x, y) in enumerate(self.edges(labels=False))]
    return libgap.Quiver(dg.num_verts(), L)

Like this

def _libgap_(self):
    """
    self = a directed graph with vertices 0, ... , n-1
    """
    from sage.libs.gap.libgap import libgap
    libgap.LoadPackage("QPA")
    L = [(x + 1, y + 1, f"x_{i}")
f"x_{i + 1}")
         for i, (x, y) in enumerate(self.edges(labels=False))]
    return libgap.Quiver(dg.num_verts(), L)

Like this

def _libgap_(self):
    """
    self = a directed graph with vertices 0, ... , n-1
    """
    from sage.libs.gap.libgap import libgap
    libgap.LoadPackage("QPA")
    L = [(x + 1, y + 1, f"x_{i + 1}")
         for i, (x, y) in enumerate(self.edges(labels=False))]
    return libgap.Quiver(dg.num_verts(), libgap.Quiver(self.num_verts(), L)

example

sage: G = DiGraph([(0, 4), (3, 2), (4, 5), (5, 1), (5, 3)])
sage: _libgap_(G)
<quiver with 6 vertices and 5 arrows>