Quiver Representations¶
AUTHORS:
 Jim Stark (20120304): Initial implementation of acyclic quivers without relations.
 Simon King (201305, 201402): Split code up. Allow cyclic quivers where possible.
A quiver is a directed graph used for representation theory. In our representation theoretic code, it is assumed that
 the vertices of the quiver are labelled by integers, and
 each edge of the quiver is labelled with a nonempty string. The label
cannot begin with
'e_'
or contain'*'
and distinct edges must have distinct labels.
As far as the DiGraph
class is concerned, a
path is a finite list of pairwise distinct vertices \(v_1, ..., v_n\) such
that there exists an edge from \(v_i\) to \(v_{i + 1}\). If there are
multiple edges between the same two vertices this does not contribute
additional paths as listed by the DiGraph
class; for example only two paths are listed from 1 to 3 in Q
:
sage: Q = DiGraph({1:{2:['a','b'], 3:['c']}, 2:{3:['d']}})
sage: Q.edges()
[(1, 2, 'a'), (1, 2, 'b'), (1, 3, 'c'), (2, 3, 'd')]
sage: Q.all_paths(1, 3)
[[1, 2, 3], [1, 3]]
The notion of a path in a quiver (in representation theory) is
fundamentally different in several aspects. First, paths are no longer
required to have distinct vertices, or even distinct edges; thus, “path”
in quiver theory is closer to the notion of “walk” in graph theory.
Furthermore, paths in quiver theory “know” their edges, so parallel edges
between the same two vertices of a Quiver make different paths. But
paths in quiver theory also “know” their vertices, so that a length\(0\)
path from \(a\) to \(a\) is not the same as a length\(0\) path from \(b\) to \(b\)
for \(a \neq b\).
Formally, we say that a path is given by two vertices, start
and
end
, and a finite (possibly empty) list of edges \(e_1, e_2, \ldots, e_n\)
such that the initial vertex of \(e_1\) is start
, the final vertex of \(e_i\)
is the initial vertex of \(e_{i + 1}\), and the final vertex of \(e_n\) is
end
. In the case where no edges are specified, we must have
start = end
and the path is called the trivial path at the given vertex.
Quiver paths in the sense stated above correspond to the elements of a
partial semigroup, with multiplication of paths given by concatenation. Hence,
rather than overloading the method name inherited from
DiGraph
or inventing a
new method name, we move this functionality to this socalled path
semigroup. Note that with this definition there are three paths from 1 to 3
in our example:
sage: Q.path_semigroup().all_paths(1, 3)
[a*d, b*d, c]
The returned paths are of type QuiverPath
, which
are elements in the path semigroup that is associated with the quiver (a
partial semigroup, which does not generally have a neutral element). You can
specify a QuiverPath
by giving an edge or a
list of edges, passed as arguments to the path semigroup containing this path.
Here an edge is a tuple of the form (i, j, l)
, where i
and j
are vertices and l
is the label of an edge from i to j:
sage: p = Q.path_semigroup()([(1, 2, 'a'), (2, 3, 'd')])
sage: p
a*d
Trivial paths are indicated by passing a list containing the tuple (vertex, vertex)
:
sage: Q.path_semigroup()([(3, 3)])
e_3
Here is an alternative way to define a path:
sage: PQ = Q.path_semigroup()
sage: q = PQ(['a', 'd'])
sage: p == q
True
If the vertices along the path do not match, a value error is raised:
sage: inv1 = PQ([(2, 3, 'd'), (1, 2, 'a')])
Traceback (most recent call last):
...
ValueError: Edge d ends at 3, but edge a starts at 1
sage: inv2 = PQ([(1, 2, 'a'), (1, 2, 'a')])
Traceback (most recent call last):
...
ValueError: Edge a ends at 2, but edge a starts at 1
sage: inv3 = PQ([(1, 2, 'x')])
Traceback (most recent call last):
...
ValueError: (1, 2, 'x') is not an edge
The *
operator is concatenation of paths. If the two paths do not compose,
then the result is None
(whence the “partial” in “partial semigroup”).
sage: print(p*q)
None
Let us now construct a larger quiver:
sage: Qbig = DiGraph({1:{2:['a','b'], 3:['c']}, 2:{3:['d']}, 3:{4:['e']}, 4:{5:['f']}, 5:{1:['g']} })
sage: Pbig = Qbig.path_semigroup()
Since Q
is a subdigraph of Qbig
, we have a coercion of the associated
path semigroups:
sage: Pbig.has_coerce_map_from(PQ)
True
In particular, p
is considered to be an element of Pbig
, and can be
composed with paths that were defined for the larger quiver:
sage: p in Pbig
True
sage: p*Pbig([(3, 4, 'e')])
a*d*e
sage: Pbig([(4, 5, 'f'), (5, 1, 'g')])*p
f*g*a*d
The length of a path is the number of edges in that path:
sage: len(p)
2
sage: triv = PQ([(1, 1)])
sage: len(triv)
0
List index and slice notation can be used to access the edges in a path. QuiverPaths can also be iterated over. Trivial paths have no elements:
sage: for x in p: print(x)
(1, 2, 'a')
(2, 3, 'd')
sage: triv[:]
e_1
There are methods giving the initial and terminal vertex of a path:
sage: p.initial_vertex()
1
sage: p.terminal_vertex()
3
QuiverPath
form the basis of the quiver
algebra of a quiver. Given a field \(k\) and a quiver \(Q\), the quiver
algebra \(kQ\) is, as a vector space, the free \(k\)vector space whose basis
is the set of all paths in \(Q\). Multiplication is defined on this basis
and extended bilinearly. The product of two basis elements is given by
path composition when it makes sense and is set to be zero otherwise.
Specifically, if the terminal vertex of the left path equals the initial
vertex of the right path, then their product is the concatenation of the
two paths, and otherwise their product is zero. In sage, quiver algebras
are handled by the QuiverAlgebra
class:
sage: A = PQ.algebra(GF(7))
sage: A
Path algebra of Multidigraph on 3 vertices over Finite Field of size 7
Quivers have a method that creates their algebra over a given field (or,
more generally, commutative ring). Note that
QuiverAlgebras
are uniquely defined by
their quiver and field, and play nicely with coercions of the underlying
path semigroups:
sage: A is PQ.algebra(GF(7))
True
sage: A is PQ.algebra(RR)
False
sage: Q1 = Q.copy()
sage: Q1.add_vertex(4)
sage: PQ1 = Q1.path_semigroup()
sage: A is PQ1.algebra(GF(7))
False
sage: Pbig.algebra(GF(7)).has_coerce_map_from(A)
True
The QuiverAlgebra
can create elements
from QuiverPaths
or from elements of the
base ring:
sage: A(5)
5*e_1 + 5*e_2 + 5*e_3
sage: r = PQ([(1, 2, 'b'), (2, 3, 'd')])
sage: e2 = PQ([(2, 2)])
sage: x = A(p) + A(e2)
sage: x
a*d + e_2
sage: y = A(p) + A(r)
sage: y
b*d + a*d
QuiverAlgebras
are \(\NN\)graded algebras.
The grading is given by assigning to each basis element the length of the
path corresponding to that basis element:
sage: x.is_homogeneous()
False
sage: x.degree()
Traceback (most recent call last):
...
ValueError: Element is not homogeneous.
sage: y.is_homogeneous()
True
sage: y.degree()
2
sage: A[1]
Free module spanned by [a, b, c, d] over Finite Field of size 7
sage: A[2]
Free module spanned by [a*d, b*d] over Finite Field of size 7
The category of right modules over a given quiver algebra is equivalent to the category of representations of that quiver. A quiver representation is a diagram in the category of vector spaces whose underlying graph is the quiver. So to each vertex of the quiver we assign a vector space and to each edge of the quiver a linear map between the vector spaces assigned to the start and end vertices of that edge. To create the zero representation we just specify the base ring and the path semigroup:
sage: Z = Q1.path_semigroup().representation(GF(5))
sage: Z.is_zero()
True
To each vertex of a quiver there is associated a simple module, an indecomposable projective, and an indecomposable injective, and these can be created from the quiver:
sage: S = PQ.S(GF(3), 1)
sage: I = PQ.I(QQ, 2)
sage: P = PQ.P(GF(3), 1)
Radicals, socles, tops, and quotients can all be computed and we can test if
modules are simple or semisimple, get their dimension, and test for equality.
Like quivers, QuiverRep
objects
are unique and therefore equal if and only if they are identical:
sage: P.is_simple()
False
sage: P.dimension()
6
sage: R = P.radical()
sage: P.socle()
Representation with dimension vector (0, 0, 3)
sage: (P/R).is_simple()
True
sage: P == R
False
sage: P.top() is P/R
True
There are special methods to deal with modules that are given as right
ideals in the quiver algebra. To create such a module pass the keyword
option='paths'
along with a path or list of paths that generate the
desired ideal:
sage: M = PQ.representation(QQ, [[(1, 1)], [(1, 2, 'a')]], option='paths')
sage: M.dimension_vector()
(1, 2, 3)
There are also special methods to deal with modules that are given as the
linear dual of a right ideal in the quiver algebra. To create such a
module, pass the keyword option='dual paths'
to the constructor along
with a path or list of paths. The module returned is the dual of the
ideal created in the opposite quiver by the reverses of the given paths:
sage: D = PQ.representation(QQ, [[(1, 1)], [(1, 2, 'a')]], option='dual paths')
sage: D.dimension_vector()
(2, 0, 0)
For modules that are not a standard module or an ideal of the quiver algebra
QuiverRep
can take as input two
dictionaries. The first associates to each vertex a vector space or an
integer (the desired dimension of the vector space), the second associates to
each edge a map or a matrix or something from which sage can construct a map:
sage: PQ2 = DiGraph({1:{2:['a', 'b']}}).path_semigroup()
sage: M2 = PQ2.representation(QQ, {1: QQ^2, 2: QQ^1}, {(1, 2, 'a'): [1, 0], (1, 2, 'b'): [0, 1]})
sage: M.get_space(2)
Vector space of dimension 2 over Rational Field
sage: M2.get_space(2)
Vector space of dimension 1 over Rational Field
sage: M.get_map((1, 2, 'a'))
Vector space morphism represented by the matrix:
[1 0]
Domain: Vector space of dimension 1 over Rational Field
Codomain: Vector space of dimension 2 over Rational Field
A homomorphism between two quiver representations is given by homomorphisms between the spaces assigned to the vertices of those representations such that those homomorphisms commute with the edge maps of the representations. The homomorphisms are created in the usual Sage syntax, the defining data given by a dictionary associating maps to vertices:
sage: P2 = PQ2.P(QQ, 1)
sage: f = P2.hom({1:[1, 1], 2:[[1], [1]]}, M2)
When the domain is given as a right ideal in the quiver algebra we can also create a homomorphism by just giving a single element in the codomain. The map is then induced by acting on that element:
sage: x = P2.gens('x')[0]
sage: x
x_0
sage: f == P2.hom(f(x), M2)
True
As you can see, the above homomorphisms can be applied to elements. Just
like elements, addition is defined via the +
operator. On elements scalar
multiplication is defined via the *
operator but on homomorphisms *
defines composition, so scalar multiplication is done using a method:
sage: g = f + f
sage: g == f.scalar_mult(2)
True
sage: g == 2*f # This multiplies the map with the scalar 2
True
sage: g(x) == 2*f(x) # This applies the map, then multiplies by the scalar
True
The direct_sum
method for modules returns only the resulting module by
default. But can also return the projection and inclusion homomorphisms into
the various factors:
sage: N2, inclusions, projections = M2.direct_sum([P2], return_maps=True)
sage: inclusions[0].domain() is M2
True
sage: projections[0].codomain() is M2
True
sage: (projections[0]*inclusions[0]).is_isomorphism()
True
As you see above we can determine if a given map is an isomorphism. Testing for injectivity and surjectivity works as well:
sage: f.is_injective()
False
sage: f.is_surjective()
False
We can create all the standard modules associated to maps:
sage: f.kernel()
Representation with dimension vector (0, 1)
sage: f.cokernel()
Representation with dimension vector (1, 0)
sage: im = f.image()
sage: im
Representation with dimension vector (1, 1)
These methods, as well as the submodule
and quotient
methods that are
defined for representations, return only the resulting representation. To get
the inclusion map of a submodule or the factor homomorphism of a quotient use
coerce_map_from
:
sage: incl = M2.coerce_map_from(im)
sage: incl.domain() is im
True
sage: incl.codomain() is M2
True
sage: incl.is_injective()
True
Both QuiverRep
objects and
QuiverRepHom
objects have linear_dual
and
algebraic_dual
methods. The linear_dual
method applies the functor
\(Hom_k(..., k)\) where \(k\) is the base ring of the representation, and the
algebraic_dual
method applies the functor \(Hom_Q(..., kQ)\) where \(kQ\)
is the quiver algebra. Both these functors yield left modules. A left
module is equivalent to a right module over the opposite algebra, and the
opposite of a quiver algebra is the algebra of the opposite quiver, so both
these methods yield modules and representations of the opposite quiver:
sage: f.linear_dual()
Homomorphism of representations of Reverse of (): Multidigraph on 2 vertices
sage: D = M2.algebraic_dual()
sage: D.quiver() is PQ2.reverse().quiver()
True
Todo
Change the wording Reverse of ()
into something more meaningful.
There is a method returning the projective cover of any module. Note that this method returns the homomorphism; to get the module take the domain of the homomorphism:
sage: cov = M2.projective_cover()
sage: cov
Homomorphism of representations of Multidigraph on 2 vertices
sage: cov.domain()
Representation with dimension vector (2, 4)
As projective covers are computable, so are the transpose and AuslanderReiten translates of modules:
sage: M2.transpose()
Representation with dimension vector (4, 3)
sage: PQ2.I(QQ, 1).AR_translate()
Representation with dimension vector (3, 2)
We have already used the gens
method above to get an element of a quiver
representation. An element of a quiver representation is simply a choice of
element from each of the spaces assigned to the vertices of the quiver.
Addition, subtraction, and scalar multiplication are performed pointwise and
implemented by the usual operators:
sage: M2.dimension_vector()
(2, 1)
sage: x, y, z = M2.gens('xyz')
sage: 2*x + y != x + 2*y
True
To create a specific element of a given representation we just specify the representation and a dictionary associating to each vertex an element of the space associated to that vertex in the representation:
sage: w = M2({1:(1, 1), 2:(3,)})
sage: w.get_element(1)
(1, 1)
The right action of a quiver algebra on an element is implemented via
the *
operator:
sage: A2 = x.quiver().path_semigroup().algebra(QQ)
sage: a = A2('a')
sage: x*a == z
True

class
sage.quivers.representation.
QuiverRepElement
(parent, elements=None, name=None)¶ Bases:
sage.structure.element.ModuleElement
An element of a quiver representation is a choice of element from each of the spaces assigned to the vertices of the quiver. Addition, subtraction, and scalar multiplication of these elements is done pointwise within these spaces.
INPUT:
module
–QuiverRep
(default:None
), the module to which the element belongselements
 dict (default: empty), a dictionary associating to each vertex a vector or an object from which sage can create a vector. Not all vertices must be specified, unspecified vertices will be assigned the zero vector of the space associated to that vertex in the given module. Keys that do not correspond to a vertex are ignored.name
– string (default:None
), the name of the element
OUTPUT:
Note
The constructor needs to know the quiver in order to create an element of a representation over that quiver. The default is to read this information from
module
as well as to fill in unspecified vectors with the zeros of the spaces inmodule
. Ifmodule
isNone
thenquiver
MUST be a quiver and each vertex MUST be specified or an error will result. If bothmodule
andquiver
are given thenquiver
is ignored.EXAMPLES:
sage: Q = DiGraph({1:{2:['a'], 3:['b']}, 2:{3:['c']}}).path_semigroup() sage: spaces = dict((v, GF(3)^2) for v in Q.quiver()) sage: M = Q.representation(GF(3), spaces) sage: elems = {1: (1, 0), 2: (0, 1), 3: (2, 1)} sage: M(elems) Element of quiver representation sage: v = M(elems, 'v') sage: v v sage: (v + v + v).is_zero() True

copy
()¶ Return a copy of
self
.EXAMPLES:
sage: Q = DiGraph({1:{2:['a'], 3:['b']}, 2:{3:['c']}}).path_semigroup() sage: spaces = dict((v, GF(3)^2) for v in Q.quiver()) sage: M = Q.representation(GF(3), spaces) sage: elems = {1: (1, 0), 2: (0, 1), 3: (2, 1)} sage: v = M(elems) sage: w = v.copy() sage: w._set_element((0, 0), 1) sage: w.get_element(1) (0, 0) sage: v.get_element(1) (1, 0)

get_element
(vertex)¶ Return the element at the given vertex.
INPUT:
vertex
– integer, a vertex of the quiver
OUTPUT:
 vector, the vector assigned to the given vertex
EXAMPLES:
sage: Q = DiGraph({1:{2:['a'], 3:['b']}, 2:{3:['c']}}).path_semigroup() sage: spaces = dict((v, GF(3)^2) for v in Q.quiver()) sage: M = Q.representation(GF(3), spaces) sage: elems = {1: (1, 0), 2: (0, 1), 3: (2, 1)} sage: v = M(elems) sage: v.get_element(1) (1, 0) sage: v.get_element(3) (2, 1)

is_zero
()¶ Test whether
self
is zero.OUTPUT:
 bool,
True
if the element is the zero element,False
otherwise
EXAMPLES:
sage: Q = DiGraph({1:{2:['a'], 3:['b']}, 2:{3:['c']}}).path_semigroup() sage: spaces = dict((v, GF(3)^2) for v in Q.quiver()) sage: M = Q.representation(GF(3), spaces) sage: elems = {1: (1, 0), 2: (0, 1), 3: (2, 1)} sage: v = M(elems) sage: v.is_zero() False sage: w = M() sage: w.is_zero() True
 bool,

quiver
()¶ Return the quiver of the representation.
OUTPUT:
DiGraph
, the quiver of the representation
EXAMPLES:
sage: Q = DiGraph({1:{2:['a'], 3:['b']}, 2:{3:['c']}}).path_semigroup() sage: P = Q.P(QQ, 1) sage: v = P.an_element() sage: v.quiver() is Q.quiver() True

support
()¶ Return the support of
self
as a list.The support is the set of vertices to which a nonzero vector is associated.
OUTPUT:
 list, the support
EXAMPLES:
sage: Q = DiGraph({1:{2:['a'], 3:['b']}, 2:{3:['c']}}).path_semigroup() sage: spaces = dict((v, GF(3)^2) for v in Q.quiver()) sage: M = Q.representation(GF(3), spaces) sage: elems = {1: (1, 0), 2: (0, 0), 3: (2, 1)} sage: v = M(elems) sage: v.support() [1, 3]

class
sage.quivers.representation.
QuiverRepFactory
¶ Bases:
sage.structure.factory.UniqueFactory
A quiver representation is a diagram in the category of vector spaces whose underlying graph is the quiver. Giving a finite dimensional representation is equivalent to giving a finite dimensional right module for the path algebra of the quiver.
INPUT:
The first two arguments specify the base ring and the quiver, and they are always required:
k
– ring, the base ring of the representationP
– the partial semigroup formed by the paths of the quiver of the representation
Then to specify the spaces and maps associated to the quiver there are three possible options. The first is the
'values'
option, where the next two arguments give the data to be assigned. The following can either be the next two entries in the argument list or they can be passed by keyword. If the argument list is long enough the keywords are ignored; the keywords are only checked in the event that the argument list does not have enough entries afterP
.spaces
– dict (default: empty); a dictionary associating to each vertex a free module over the base ring \(k\). Not all vertices must be specified; unspecified vertices are automatically set to \(k^0\). Keys of the dictionary that don’t correspond to vertices are ignored.maps
 dict (default: empty); a dictionary associating to each edge a map whose domain and codomain are the spaces associated to the initial and terminal vertex of the edge respectively. Not all edges must be specified; unspecified edges are automatically set to the zero map. Keys of the dictionary that don’t correspond to edges are ignored.
The second option is the
paths
option which creates a module by generating a right ideal from a list of paths. Thus the basis elements of this module correspond to paths of the quiver and the maps are given by right multiplication by the corresponding edge. As above this can be passed either as the next entry in the argument list or as a keyword. The keyword is only checked if there is no entry in the argument list afterQ
.basis
 list; a nonempty list of paths in the quiverQ
. Entries that do not represent valid paths are ignored and duplicate paths are deleted. There must be at least one valid path in the list or aValueError
is raised. The closure of this list under right multiplication forms the basis of the resulting representation.
The third option is the
dual paths
option which creates the dual of a left ideal in the quiver algebra. Thus the basis elements of this module correspond to paths of the quiver and the maps are given by deleting the corresponding edge from the start of the path (the edge map is zero on a path if that edge is not the initial edge of the path). As above this can be passed either as the next entry in the argument list or as a keyword.basis
– list; a nonempty list of paths in the quiverQ
. Entries that do not represent valid paths are ignored and duplicate paths are deleted. There must be at least one valid path in the list or aValueError
is raised. The closure of this list under left multiplication of edges forms the basis of the resulting representation.
Using the second and third options requires that the following keyword be passed to the constructor. This must be passed as a keyword.
option
 string (default:None
), either'values'
or'paths'
or'dual paths'
.None
is equivalent to'values'
.
OUTPUT:
QuiverRep
EXAMPLES:
sage: Q1 = DiGraph({1:{2:['a']}}).path_semigroup()
When the
option
keyword is not supplied the constructor uses the'values'
option and expects the spaces and maps to be specified. If no maps or spaces are given the zero module is created:sage: M = Q1.representation(GF(5)) sage: M.is_zero() True
The simple modules, indecomposable projectives, and indecomposable injectives are examples of quiver representations:
sage: S = Q1.S(GF(3), 1) sage: I = Q1.I(QQ, 2) sage: P = Q1.P(GF(3), 1)
Various standard submodules can be computed, such as radicals and socles. We can also form quotients and test for certain attributes such as semisimplicity:
sage: R = P.radical() sage: R.is_zero() False sage: (P/R).is_simple() True sage: P == R False
With the option
'paths'
the input data should be a list ofQuiverPaths
or things thatQuiverPaths
can be constructed from. The resulting module is the submodule generated by these paths in the quiver algebra, when considered as a right module over itself:sage: P1 = Q1.representation(QQ, [[(1, 1)]], option='paths') sage: P1.dimension() 2
In the following example, the 3rd and 4th paths are actually the same, so the duplicate is removed:
sage: N = Q1.representation(QQ, [[(1, 1)], [(2, 2)], [(1, 2, 'a')], [(1, 2, 'a')]], option='paths') sage: N.dimension() 3
The dimension at each vertex equals the number of paths in the closed basis whose terminal point is that vertex:
sage: Q2 = DiGraph({1:{2:['a'], 3:['b', 'c']}, 2:{3:['d']}}).path_semigroup() sage: M = Q2.representation(QQ, [[(2, 2)], [(1, 2, 'a')]], option='paths') sage: M.dimension_vector() (0, 2, 2) sage: N = Q2.representation(QQ, [[(2, 2)], [(1, 2, 'a'), (2, 3, 'd')]], option='paths') sage: N.dimension_vector() (0, 1, 2)

create_key
(k, P, *args, **kwds)¶ Return a key for the specified module.
The key is a tuple. The first and second entries are the base ring
k
and the partial semigroupP
formed by the paths of a quiver. The third entry is theoption
and the remaining entries depend on that option. If the option is'values'
and the quiver has \(n\) vertices then the next \(n\) entries are the vector spaces to be assigned to those vertices. After that are the matrices of the maps assigned to edges, listed in the same order thatQ.edges()
uses. If the option is'paths'
or'dual paths'
then the next entry is a tuple containing a sorted list of the paths that form a basis of the quiver.INPUT:
See the class documentation.
OUTPUT:
 tuple
EXAMPLES:
sage: P = DiGraph({1:{2:['a']}}).path_semigroup() sage: from sage.quivers.representation import QuiverRep sage: QuiverRep.create_key(GF(5), P) (Finite Field of size 5, Partial semigroup formed by the directed paths of Multidigraph on 2 vertices, 'values', Vector space of dimension 0 over Finite Field of size 5, Vector space of dimension 0 over Finite Field of size 5, [])

create_object
(version, key, **extra_args)¶ Create a
QuiverRep_generic
orQuiverRep_with_path_basis
object from the key.The key is a tuple. The first and second entries are the base ring
k
and the quiverQ
. The third entry is the'option'
and the remaining entries depend on that option. If the option is'values'
and the quiver has \(n\) vertices then the next \(n\) entries are the vector spaces to be assigned to those vertices. After that are the matrices of the maps assigned to edges, listed in the same order thatQ.edges()
uses. If the option is'paths'
or'dual paths'
then the next entry is a tuple containing a sorted list of the paths that form a basis of the quiver.INPUT:
version
– the version of sage, this is currently ignoredkey
– tuple
OUTPUT:
EXAMPLES:
sage: Q = DiGraph({1:{2:['a']}}).path_semigroup() sage: from sage.quivers.representation import QuiverRep sage: key = QuiverRep.create_key(GF(5), Q) sage: QuiverRep.create_object(0, key) Representation with dimension vector (0, 0)

class
sage.quivers.representation.
QuiverRep_generic
(k, P, spaces, maps)¶ Bases:
sage.misc.fast_methods.WithEqualityById
,sage.modules.module.Module
A generic quiver representation.
This class should not be called by the user.
Call
QuiverRep
withoption='values'
(which is the default) instead.INPUT:
k
– ring, the base ring of the representationP
– the path semigroup of the quiver \(Q\) of the representationspaces
– dict (default: empty), a dictionary associating to each vertex a free module over the base ring \(k\). Not all vertices need to be specified, unspecified vertices are automatically set to \(k^0\). Keys of the dictionary that don’t correspond to vertices are ignored.maps
– dict (default: empty), a dictionary associating to each edge a map whose domain and codomain are the spaces associated to the initial and terminal vertex of the edge respectively. Not all edges need to be specified, unspecified edges are automatically set to the zero map. Keys of the dictionary that don’t correspond to edges are ignored.
OUTPUT:
QuiverRep
EXAMPLES:
sage: Q = DiGraph({1:{3:['a']}, 2:{3:['b']}}).path_semigroup() sage: spaces = {1: QQ^2, 2: QQ^3, 3: QQ^2} sage: maps = {(1, 3, 'a'): (QQ^2).Hom(QQ^2).identity(), (2, 3, 'b'): [[1, 0], [0, 0], [0, 0]]} sage: M = Q.representation(QQ, spaces, maps)
sage: Q = DiGraph({1:{2:['a']}}).path_semigroup() sage: P = Q.P(GF(3), 1) sage: I = Q.I(QQ, 1) sage: P.an_element() in P True sage: I.an_element() in P False

AR_translate
()¶ Return the AuslanderReiten translate of
self
.EXAMPLES:
sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() sage: M = Q.representation(GF(3), {1: 1, 2: 1}, {(1, 2, 'a'): 1}) sage: tauM = M.AR_translate() sage: tauM Representation with dimension vector (1, 1) sage: tauM.get_map((1, 2, 'a')).matrix() [1] sage: tauM.get_map((1, 2, 'b')).matrix() [0]
The module
M
above is its own AR translate. This is not always true:sage: Q2 = DiGraph({3:{1:['b']}, 5:{3:['a']}}).path_semigroup() sage: Q2.S(QQ, 5).AR_translate() Representation with dimension vector (0, 1, 0)

Element
¶ alias of
QuiverRepElement

Hom
(codomain)¶ Return the hom space from
self
tocodomain
.For more information see the
QuiverHomSpace
documentation.

actor
()¶ Return the quiver path algebra acting on this representation.
OUTPUT:
 a quiver path algebra
EXAMPLES:
sage: Q = DiGraph({1:{2:['a']}}).path_semigroup() sage: M = Q.representation(GF(5)) sage: M.base_ring() Finite Field of size 5 sage: M.actor() Path algebra of Multidigraph on 2 vertices over Finite Field of size 5

algebraic_dual
(basis=False)¶ Compute the algebraic dual \(Hom_Q(M, kQ)\) of the module \(M\) =
self
.INPUT:
basis
– bool; ifFalse
, then only the module is returned. IfTrue
, then a tuple is returned. The first element is theQuiverRep
and the second element is a dictionary which associates to each vertex a list. The elements of this list are the homomorphisms which correspond to the basis elements of that vertex in the module.
OUTPUT:
QuiverRep
or tuple
Note
Here \(kQ\) is the path algebra considered as a right module over itself. If \(e\) is an edge of the quiver \(Q\) then we let \((fe)(m) = ef(m)\). This gives \(Hom_Q(M, kQ)\) a module structure over the opposite quiver
Q.reverse()
.EXAMPLES:
sage: Q = DiGraph({1:{2:['a', 'b'], 3: ['c', 'd']}, 2:{3:['e']}}).path_semigroup() sage: Q.free_module(GF(7)).algebraic_dual().dimension_vector() (7, 2, 1)

an_element
()¶ Return an element of
self
.OUTPUT:
EXAMPLES:
sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() sage: M = Q.P(QQ, 1) sage: M.an_element() Element of quiver representation

coordinates
(vector)¶ Return the coordinates when
vector
is expressed in terms of the gens.INPUT:
vector
–QuiverRepElement
OUTPUT:
 list, the coefficients when the vector is expressed as a linear combination of the generators of the module
EXAMPLES:
sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() sage: M = Q.P(QQ, 1) sage: x, y, z = M.gens('xyz') sage: M.coordinates(x  y + z) [1, 1, 1] sage: M.coordinates(M.an_element()) [1, 1, 0] sage: M.an_element() == x + y True

dimension
(vertex=None)¶ Return the dimension of the space associated to the given vertex
vertex
.INPUT:
vertex
– integer orNone
(default:None
), the given vertex
OUTPUT:
 integer, the dimension over the base ring of the space
associated to the given vertex. If
vertex=None
then the dimension over the base ring of the module is returned
EXAMPLES:
sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() sage: P = Q.P(GF(2), 1) sage: P.dimension(1) 1 sage: P.dimension(2) 2
The total dimension of the module is the sum of the dimensions at each vertex:
sage: P.dimension() 3

dimension_vector
()¶ Return the dimension vector of the representation.
OUTPUT:
 tuple
Note
The order of the entries in the tuple matches the order given by calling the
vertices()
method on the quiver.EXAMPLES:
sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() sage: P = Q.P(GF(2), 1) sage: P.dimension_vector() (1, 2)
Each coordinate of the dimension vector is the dimension of the space associated to that coordinate:
sage: P.get_space(2).dimension() 2

direct_sum
(modules, return_maps=False)¶ Return the direct sum of
self
with the given modulesmodules
.The modules must be modules over the same quiver and base ring.
INPUT:
modules
–QuiverRep
or list ofQuiverRep
’sreturn_maps
– Boolean (default:False
); ifFalse
, then the output is a single QuiverRep object which is the direct sum ofself
with the given module or modules. IfTrue
, then the output is a list[sum, iota, pi]
. The first entrysum
is the direct sum ofself
with the given module or modules. Bothiota
andpi
are lists of QuiverRepHoms with one entry for each summand;iota[i]
is the inclusion map andpi[i]
is the projection map of the \(i\)th summand. The summands are ordered as given withself
being the zeroth summand.
OUTPUT:
QuiverRep
or tuple
EXAMPLES:
sage: Q = DiGraph({1:{2:['a'], 3:['b']}, 2:{4:['c']}, 3:{4:['d']}}).path_semigroup() sage: P1 = Q.P(QQ, 1) sage: P2 = Q.P(QQ, 2) sage: S = P1.direct_sum(P2) sage: P1.dimension_vector() (1, 1, 1, 2) sage: P2.dimension_vector() (0, 1, 0, 1) sage: S.dimension_vector() (1, 2, 1, 3) sage: S, iota, pi = P1.direct_sum(P2, return_maps=True) sage: iota[0].domain() is P1 True sage: iota[1].domain() is P2 True sage: pi[0].codomain() is P1 True sage: pi[1].codomain() is P2 True sage: iota[0].codomain() is S True sage: iota[1].codomain() is S True sage: pi[0].domain() is S True sage: pi[1].domain() is S True sage: iota[0].get_matrix(4) [1 0 0] [0 1 0] sage: pi[0].get_matrix(4) [1 0] [0 1] [0 0] sage: P1prime = S/iota[1].image() sage: f = P1prime.coerce_map_from(S) sage: g = f*iota[0] sage: g.is_isomorphism() True

gens
(names='v')¶ Return a list of generators of
self
as a \(k\)module.INPUT:
names
– an iterable variable of length equal to the number of generators, or a string (default:'v'
); gives the names of the generators either by giving a name to each generator or by giving a name to which an index will be appended
OUTPUT:
 list of
QuiverRepElement
objects, the linear generators of the module (over the base ring)
Note
The generators are ordered first by vertex and then by the order given by the
gens()
method of the space associated to that vertex.EXAMPLES:
sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() sage: M = Q.P(QQ, 1) sage: M.gens() [v_0, v_1, v_2]
If a string is given then it is used as the name of each generator, with the index of the generator appended in order to differentiate them:
sage: M.gens('generator') [generator_0, generator_1, generator_2]
If a list or other iterable variable is given then each generator is named using the appropriate entry. The length of the variable must equal the number of generators (the dimension of the module):
sage: M.gens(['w', 'x', 'y', 'z']) Traceback (most recent call last): ... TypeError: can only concatenate list (not "str") to list sage: M.gens(['x', 'y', 'z']) [x, y, z]
Strings are iterable, so if the length of the string is equal to the number of generators then the characters of the string will be used as the names:
sage: M.gens('xyz') [x, y, z]

get_map
(edge)¶ Return the map associated to the given edge
edge
.INPUT:
edge
– tuple of the form (initial vertex, terminal vertex, label) specifying the edge whose map is returned
EXAMPLES:
sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() sage: Q.P(ZZ, 1).get_map((1, 2, 'a')) Free module morphism defined by the matrix [1 0] Domain: Ambient free module of rank 1 over the principal ideal domain Integer Ring Codomain: Ambient free module of rank 2 over the principal ideal domain Integer Ring

get_space
(vertex)¶ Return the module associated to the given vertex
vertex
.INPUT:
vertex
– integer, a vertex of the quiver of the module
EXAMPLES:
sage: Q = DiGraph({1:{2:['a'], 3:['b']}}).path_semigroup() sage: Q.P(QQ, 1).get_space(1) Vector space of dimension 1 over Rational Field

is_semisimple
()¶ Test whether the representation is semisimple.
OUTPUT:
 bool
EXAMPLES:
sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() sage: M = Q.P(QQ, 1) sage: (M/M.radical()).is_semisimple() True

is_simple
()¶ Test whether the representation is simple.
OUTPUT:
 bool
EXAMPLES:
sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() sage: Q.P(RR, 1).is_simple() False sage: Q.S(RR, 1).is_simple() True

is_zero
()¶ Test whether the representation is zero.
OUTPUT:
 bool
EXAMPLES:
sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() sage: M = Q.representation(ZZ) sage: N = Q.representation(ZZ, {1: 1}) sage: M Representation with dimension vector (0, 0) sage: N Representation with dimension vector (1, 0) sage: M.is_zero() True sage: N.is_zero() False

linear_combination_of_basis
(coordinates)¶ Return the linear combination of the basis for
self
given bycoordinates
.INPUT:
coordinates
– list; a list whose length is the dimension ofself
. The \(i\)th element of this list defines the coefficient of the \(i\)th basis vector in the linear combination.
OUTPUT:
EXAMPLES:
sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() sage: M = Q.P(QQ, 1) sage: x, y, z = M.gens('xyz') sage: e = x  y + z sage: M.coordinates(e) [1, 1, 1] sage: M.linear_combination_of_basis([1, 1, 1]) == e True

linear_dual
()¶ Compute the linear dual \(Hom_k(M, k)\) of the module \(M =\)
self
over the base ring \(k\).OUTPUT:
QuiverRep
, the dual representation
Note
If \(e\) is an edge of the quiver \(Q\) then we let \((fe)(m) = f(me)\). This gives \(Hom_k(M, k)\) a module structure over the opposite quiver
Q.reverse()
.EXAMPLES:
sage: Q = DiGraph({1:{2:['a','b']}, 2:{3:['c']}}).path_semigroup() sage: M = Q.P(QQ, 1) sage: M.linear_dual() Representation with dimension vector (1, 2, 2) sage: M.linear_dual().quiver() is Q.reverse().quiver() True

projective_cover
(return_maps=False)¶ Return the projective cover of
self
.EXAMPLES:
sage: Q = DiGraph({1:{2:['a','b']}, 2:{3:['c','d']}}).path_semigroup() sage: S1 = Q.S(GF(3), 1) sage: f1 = S1.projective_cover() sage: f1.is_surjective() True sage: f1._domain Representation with dimension vector (1, 2, 4) sage: Q.P(GF(3), 1) Representation with dimension vector (1, 2, 4)

quiver
()¶ Return the quiver of the representation.
OUTPUT:
EXAMPLES:
sage: Q = DiGraph({1:{2:['a']}}).path_semigroup() sage: M = Q.representation(GF(5)) sage: M.quiver() is Q.quiver() True

quotient
(sub, check=True)¶ Return the quotient of
self
by the submodulesub
.INPUT:
sub
–QuiverRep
; this must be a submodule ofself
, meaning the space associated to each vertex \(v\) ofsub
is a subspace of the space associated to \(v\) inself
and the map associated to each edge \(e\) ofsub
is the restriction of the map associated to \(e\) inself
check
– bool; ifTrue
thensub
is checked to verify that it is indeed a submodule ofself
and an error is raised if it is not
OUTPUT:
QuiverRep
, the quotient moduleself / sub
Note
This function returns only a QuiverRep object
quot
. The projection map fromself
toquot
can be obtained by callingquot.coerce_map_from(self)
.EXAMPLES:
sage: Q = DiGraph({1:{2:['a','b']}, 2:{3:['c']}}).path_semigroup() sage: M = Q.I(GF(3), 3) sage: N = Q.S(GF(3), 3) sage: M.quotient(N) Representation with dimension vector (2, 1, 0) sage: M.quotient(M.radical()) Representation with dimension vector (2, 0, 0) sage: M.quotient(M) Representation with dimension vector (0, 0, 0)

radical
()¶ Return the Jacobson radical of
self
.OUTPUT:
QuiverRep
, the Jacobson radical
EXAMPLES:
sage: Q = DiGraph({1:{2:['a','b']}, 2:{3:['c']}}).path_semigroup() sage: M = Q.P(QQ, 1) sage: M.radical() Representation with dimension vector (0, 2, 2)

right_edge_action
(element, path)¶ Return the result of
element*path
.INPUT:
element
–QuiverRepElement
, an element ofself
path
–QuiverPath
or list of tuples
OUTPUT:
QuiverRepElement
, the result ofelement*path
whenpath
is considered an element of the path algebra of the quiver
EXAMPLES:
sage: Q = DiGraph({1:{2:['a','b']}, 2:{3:['c']}}).path_semigroup() sage: M = Q.P(QQ, 1) sage: v = M.an_element() sage: v.support() [1, 2, 3] sage: M.right_edge_action(v, [(1, 1)]).support() [1] sage: M.right_edge_action(v, [(1, 1)]).support() [1] sage: M.right_edge_action(v, [(1, 2, 'a')]).support() [2] sage: M.right_edge_action(v, 'a') == M.right_edge_action(v, [(1, 2, 'a')]) True

socle
()¶ The socle of
self
.OUTPUT:
QuiverRep
, the socle
EXAMPLES:
sage: Q = DiGraph({1:{2:['a','b']}, 2:{3:['c']}}).path_semigroup() sage: M = Q.P(QQ, 1) sage: M.socle() Representation with dimension vector (0, 0, 2)

submodule
(elements=[], spaces=None)¶ Return the submodule generated by the data.
INPUT:
elements
– a collection of QuiverRepElements (default: empty list), each should be an element ofself
spaces
– dictionary (default: empty), this dictionary should contain entries of the form{v: S}
where \(v\) is a vertex of the quiver and \(S\) is a subspace of the vector space associated to \(v\)
OUTPUT:
QuiverRep
, the smallest subrepresentation ofself
containing the given elements and the given subspaces
Note
This function returns only a
QuiverRep
objectsub
. The inclusion map ofsub
intoM = self
can be obtained by callingM.coerce_map_from(sub)
.EXAMPLES:
sage: Q = DiGraph({1:{3:['a']}, 2:{3:['b']}}).path_semigroup() sage: spaces = {1: QQ^2, 2: QQ^3, 3: QQ^2} sage: maps = {(1, 3, 'a'): (QQ^2).Hom(QQ^2).identity(), (2, 3, 'b'): [[1, 0], [0, 0], [0, 0]]} sage: M = Q.representation(QQ, spaces, maps) sage: v = M.an_element() sage: M.submodule([v]) Representation with dimension vector (1, 1, 1)
The smallest submodule containing the vector space at vertex 1 also contains the entire vector space associated to vertex 3 because there is an isomorphism associated to the edge
(1, 3, 'a')
:sage: M.submodule(spaces={1: QQ^2}) Representation with dimension vector (2, 0, 2)
The smallest submodule containing the vector space at vertex 2 also contains the image of the rank 1 homomorphism associated to the edge
(2, 3, 'b')
:sage: M.submodule(spaces={2: QQ^3}) Representation with dimension vector (0, 3, 1)
As
v
is not already contained in this submodule, adding it as a generator yields a larger submodule:sage: v.support() [1, 2, 3] sage: M.submodule([v], {2: QQ^3}) Representation with dimension vector (1, 3, 1)
Giving no generating data yields the zero submodule:
sage: M.submodule().is_zero() True
If the given data generates all of M then the result is M:
sage: M.submodule(M.gens()) is M True

support
()¶ Return the support of
self
as a list.OUTPUT:
 list, the vertices of the representation that have nonzero spaces associated to them
EXAMPLES:
sage: Q = DiGraph({1:{2:['a']}, 3:{2:['b'], 4:['c']}}).path_semigroup() sage: M = Q.P(QQ, 3) sage: M Representation with dimension vector (0, 1, 1, 1) sage: M.support() [2, 3, 4]

top
()¶ Return the top of
self
.OUTPUT:
QuiverRep
, the quotient ofself
by its radical
EXAMPLES:
sage: Q = DiGraph({1:{2:['a','b']}, 2:{3:['c']}}).path_semigroup() sage: M = Q.P(QQ, 1) sage: M.top() Representation with dimension vector (1, 0, 0) sage: M.top() == M/M.radical() True

transpose
()¶ Return the transpose of
self
.The transpose, \(\mbox{Tr} M\), of a module \(M\) is defined as follows. Let \(p: P_1 \to P_2\) be the second map in a minimal projective presentation \(P_1 \to P_2 \to M \to 0\) of \(M\). If \(p^t\) is the algebraic dual of \(p\) then define \(\mbox{Tr} M = \mbox{coker} p^t\).
OUTPUT:
QuiverRep
EXAMPLES:
sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup() sage: M = Q.representation(GF(3), {1: 1, 2: 1}, {(1, 2, 'a'): 1}) sage: M.transpose() Representation with dimension vector (1, 1)

zero_submodule
()¶ Return the zero submodule of
self
.OUTPUT:
QuiverRep
, the zero submodule ofself
.
EXAMPLES:
sage: Q = DiGraph({1:{2:['a','b']}, 2:{3:['c']}}).path_semigroup() sage: M = Q.P(QQ, 1) sage: M.zero_submodule() Representation with dimension vector (0, 0, 0) sage: M.zero_submodule().is_zero() True

class
sage.quivers.representation.
QuiverRep_with_dual_path_basis
(k, P, basis)¶ Bases:
sage.quivers.representation.QuiverRep_generic
The basis of the module must be closed under left deletion of an edge; that is, deleting any edge from the beginning of any path in the basis must result in a path also contained in the basis of the module.
INPUT:
k
– ring; the base ring of the representationP
– the path semigroup of the quiver \(Q\) of the representationbasis
– list (default: empty); should be a list of paths (also lists) in the quiver \(Q\). Entries that do not represent valid paths are ignored and duplicate paths are deleted. The closure of this list under left deletion forms the basis of the resulting representation.

class
sage.quivers.representation.
QuiverRep_with_path_basis
(k, P, basis)¶ Bases:
sage.quivers.representation.QuiverRep_generic
The basis of the module must be closed under right multiplication by an edge; that is, appending any edge to the end of any path in the basis must result in either an invalid path or a valid path also contained in the basis of the module.
INPUT:
k
– ring, the base ring of the representationP
– the path semigroup of the quiver \(Q\) of the representationbasis
– list (default: empty); should be a list of paths (also lists) in the quiver \(Q\). Entries that do not represent valid paths are ignored and duplicate paths are deleted. The closure of this list under right multiplication forms the basis of the resulting representation.

is_left_module
()¶ Test whether the basis is closed under left multiplication.
EXAMPLES:
sage: Q1 = DiGraph({1:{2:['a']}}).path_semigroup() sage: P2 = Q1.representation(QQ, [[(2, 2)]], option='paths') sage: P2.is_left_module() False
The supplied basis is not closed under left multiplication, but it’s not closed under right multiplication either. When the closure under right multiplication is taken the result is also closed under left multiplication and therefore produces a left module structure:
sage: kQ = Q1.representation(QQ, [[(1, 1)], [(2, 2)]], option='paths') sage: kQ.is_left_module() True
Taking the right closure of a left closed set produces another left closed set:
sage: Q2 = DiGraph({1:{2:['a'], 3:['b', 'c']}, 2:{3:['d']}}).path_semigroup() sage: M = Q2.representation(QQ, [[(2, 2)], [(1, 2, 'a')]], option='paths') sage: M.is_left_module() True
Note that the second path is length 2, so even though the edge (1, 2, ‘a’) appears in the input the path [(1, 2, ‘a’)] is not in the right closure:
sage: N = Q2.representation(QQ, [[(2, 2)], [(1, 2, 'a'), (2, 3, 'd')]], option='paths') sage: N.is_left_module() False