Quiver Homspace - Quivers

Skip to content
Back to top
View this page
Edit this page

# Quiver Homspace

class sage.quivers.homspace.QuiverHomSpace(domain, codomain, category=None)

  Bases: `Homset`

  A homomorphism of quiver representations (of one and the same quiver) is given by specifying, for each vertex of the quiver, a homomorphism of the spaces assigned to this vertex such that these homomorphisms commute with the edge maps. This class handles the set of all such maps, \(Hom_Q(M, N)\).

  INPUT:

  - `domain` – the domain of the homomorphism space

  - `codomain` – the codomain of the homomorphism space

  OUTPUT:

  - `QuiverHomSpace`, the homomorphism space `Hom_Q(domain, codomain)`

  Note

  The quivers of the domain and codomain must be equal or a `ValueError` is raised.

  EXAMPLES:

  Sage

      sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup()
      sage: H = Q.S(QQ, 2).Hom(Q.P(QQ, 1))
      sage: H.dimension()
      2
      sage: H.gens()
      (Homomorphism of representations of Multi-digraph on 2 vertices,
       Homomorphism of representations of Multi-digraph on 2 vertices)

  Python

      >>> from sage.all import *
      >>> Q = DiGraph({Integer(1):{Integer(2):['a', 'b']}}).path_semigroup()
      >>> H = Q.S(QQ, Integer(2)).Hom(Q.P(QQ, Integer(1)))
      >>> H.dimension()
      2
      >>> H.gens()
      (Homomorphism of representations of Multi-digraph on 2 vertices,
       Homomorphism of representations of Multi-digraph on 2 vertices)

  Element

    alias of `QuiverRepHom`

  base_ring()

    Return the base ring of the representations.

    EXAMPLES:

    Sage

        sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup()
        sage: H = Q.S(QQ, 2).Hom(Q.P(QQ, 1))
        sage: H.base_ring()
        Rational Field

    Python

        >>> from sage.all import *
        >>> Q = DiGraph({Integer(1):{Integer(2):['a', 'b']}}).path_semigroup()
        >>> H = Q.S(QQ, Integer(2)).Hom(Q.P(QQ, Integer(1)))
        >>> H.base_ring()
        Rational Field

  codomain()

    Return the codomain of the hom space.

    OUTPUT: `QuiverRep`; the codomain of the Hom space

    EXAMPLES:

    Sage

        sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup()
        sage: P = Q.P(QQ, 1)
        sage: H = Q.S(QQ, 2).Hom(P)
        sage: H.codomain() is P
        True

    Python

        >>> from sage.all import *
        >>> Q = DiGraph({Integer(1):{Integer(2):['a', 'b']}}).path_semigroup()
        >>> P = Q.P(QQ, Integer(1))
        >>> H = Q.S(QQ, Integer(2)).Hom(P)
        >>> H.codomain() is P
        True

  coordinates(hom)

    Return the coordinates of the map when expressed in terms of the generators (i. e., the output of the `gens` method) of the hom space.

    INPUT:

    - `hom` – `QuiverRepHom`

    OUTPUT:

    - list, the coordinates of the given map when written in terms of the generators of the `QuiverHomSpace`

    EXAMPLES:

    Sage

        sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup()
        sage: S = Q.S(QQ, 2)
        sage: P = Q.P(QQ, 1)
        sage: H = S.Hom(P)
        sage: f = S.hom({2: [[1,-1]]}, P)
        sage: H.coordinates(f)
        [1, -1]

    Python

        >>> from sage.all import *
        >>> Q = DiGraph({Integer(1):{Integer(2):['a', 'b']}}).path_semigroup()
        >>> S = Q.S(QQ, Integer(2))
        >>> P = Q.P(QQ, Integer(1))
        >>> H = S.Hom(P)
        >>> f = S.hom({Integer(2): [[Integer(1),-Integer(1)]]}, P)
        >>> H.coordinates(f)
        [1, -1]

  dimension()

    Return the dimension of the hom space.

    OUTPUT: integer; the dimension

    EXAMPLES:

    Sage

        sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup()
        sage: H = Q.S(QQ, 2).Hom(Q.P(QQ, 1))
        sage: H.dimension()
        2

    Python

        >>> from sage.all import *
        >>> Q = DiGraph({Integer(1):{Integer(2):['a', 'b']}}).path_semigroup()
        >>> H = Q.S(QQ, Integer(2)).Hom(Q.P(QQ, Integer(1)))
        >>> H.dimension()
        2

  domain()

    Return the domain of the hom space.

    OUTPUT: `QuiverRep`; the domain of the Hom space

    EXAMPLES:

    Sage

        sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup()
        sage: S = Q.S(QQ, 2)
        sage: H = S.Hom(Q.P(QQ, 1))
        sage: H.domain() is S
        True

    Python

        >>> from sage.all import *
        >>> Q = DiGraph({Integer(1):{Integer(2):['a', 'b']}}).path_semigroup()
        >>> S = Q.S(QQ, Integer(2))
        >>> H = S.Hom(Q.P(QQ, Integer(1)))
        >>> H.domain() is S
        True

  gens()

    Return a tuple of generators of the hom space (as a \(k\)-vector space).

    OUTPUT: tuple of `QuiverRepHom` objects; the generators

    EXAMPLES:

    Sage

        sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup()
        sage: H = Q.S(QQ, 2).Hom(Q.P(QQ, 1))
        sage: H.gens()
        (Homomorphism of representations of Multi-digraph on 2 vertices,
         Homomorphism of representations of Multi-digraph on 2 vertices)

    Python

        >>> from sage.all import *
        >>> Q = DiGraph({Integer(1):{Integer(2):['a', 'b']}}).path_semigroup()
        >>> H = Q.S(QQ, Integer(2)).Hom(Q.P(QQ, Integer(1)))
        >>> H.gens()
        (Homomorphism of representations of Multi-digraph on 2 vertices,
         Homomorphism of representations of Multi-digraph on 2 vertices)

  left_module(basis=False)

    Create the QuiverRep of `self` as a module over the opposite quiver.

    INPUT:

    - `basis` – boolean; if `False`, then only the module is returned. If `True`, then a tuple is returned. The first element is the QuiverRep 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

    Warning

    The codomain of the Hom space must be a left module.

    Note

    The left action of a path \(e\) on a map \(f\) is given by \((ef)(m) = ef(m)\). This gives the Hom space its structure as a left module over the path algebra. This is then converted to a right module over the path algebra of the opposite quiver `Q.reverse()` and returned.

    EXAMPLES:

    Sage

        sage: Q = DiGraph({1:{2:['a', 'b'], 3: ['c', 'd']}, 2:{3:['e']}}).path_semigroup()
        sage: P = Q.P(GF(3), 3)
        sage: A = Q.free_module(GF(3))
        sage: H = P.Hom(A)
        sage: H.dimension()
        6
        sage: M, basis_dict = H.left_module(true)
        sage: M.dimension_vector()
        (4, 1, 1)
        sage: Q.reverse().P(GF(3), 3).dimension_vector()
        (4, 1, 1)

    Python

        >>> from sage.all import *
        >>> Q = DiGraph({Integer(1):{Integer(2):['a', 'b'], Integer(3): ['c', 'd']}, Integer(2):{Integer(3):['e']}}).path_semigroup()
        >>> P = Q.P(GF(Integer(3)), Integer(3))
        >>> A = Q.free_module(GF(Integer(3)))
        >>> H = P.Hom(A)
        >>> H.dimension()
        6
        >>> M, basis_dict = H.left_module(true)
        >>> M.dimension_vector()
        (4, 1, 1)
        >>> Q.reverse().P(GF(Integer(3)), Integer(3)).dimension_vector()
        (4, 1, 1)

    As lists start indexing at 0 the \(i\)-th vertex corresponds to the \((i-1)\)-th entry of the dimension vector:

    Sage

        sage: len(basis_dict[2]) == M.dimension_vector()[1]
        True

    [Python]

        >>> from sage.all import *
        >>> len(basis_dict[Integer(2)]) == M.dimension_vector()[Integer(1)]
        True

  natural_map()

    The natural map from domain to codomain.

    This is the zero map.

    EXAMPLES:

    Sage

        sage: Q = DiGraph({1:{2:['a', 'b']}, 2:{3:['c']}}).path_semigroup()
        sage: spaces = {1: QQ^2, 2: QQ^2, 3:QQ^1}
        sage: maps = {(1, 2, 'a'): [[1, 0], [0, 0]], (1, 2, 'b'): [[0, 0], [0, 1]], (2, 3, 'c'): [[1], [1]]}
        sage: M = Q.representation(QQ, spaces, maps)
        sage: spaces2 = {2: QQ^1, 3: QQ^1}
        sage: S = Q.representation(QQ, spaces2)
        sage: S.hom(M)      # indirect doctest
        Homomorphism of representations of Multi-digraph on 3 vertices
        sage: S.hom(M) == S.Hom(M).natural_map()
        True

    Python

        >>> from sage.all import *
        >>> Q = DiGraph({Integer(1):{Integer(2):['a', 'b']}, Integer(2):{Integer(3):['c']}}).path_semigroup()
        >>> spaces = {Integer(1): QQ**Integer(2), Integer(2): QQ**Integer(2), Integer(3):QQ**Integer(1)}
        >>> maps = {(Integer(1), Integer(2), 'a'): [[Integer(1), Integer(0)], [Integer(0), Integer(0)]], (Integer(1), Integer(2), 'b'): [[Integer(0), Integer(0)], [Integer(0), Integer(1)]], (Integer(2), Integer(3), 'c'): [[Integer(1)], [Integer(1)]]}
        >>> M = Q.representation(QQ, spaces, maps)
        >>> spaces2 = {Integer(2): QQ**Integer(1), Integer(3): QQ**Integer(1)}
        >>> S = Q.representation(QQ, spaces2)
        >>> S.hom(M)      # indirect doctest
        Homomorphism of representations of Multi-digraph on 3 vertices
        >>> S.hom(M) == S.Hom(M).natural_map()
        True

  quiver()

    Return the quiver of the representations.

    OUTPUT: `DiGraph`; the quiver of the representations

    EXAMPLES:

    Sage

        sage: P = DiGraph({1:{2:['a', 'b']}}).path_semigroup()
        sage: H = P.S(QQ, 2).Hom(P.P(QQ, 1))
        sage: H.quiver() is P.quiver()
        True

    Python

        >>> from sage.all import *
        >>> P = DiGraph({Integer(1):{Integer(2):['a', 'b']}}).path_semigroup()
        >>> H = P.S(QQ, Integer(2)).Hom(P.P(QQ, Integer(1)))
        >>> H.quiver() is P.quiver()
        True

  zero()

    Return the zero morphism.

    Note

    It is needed to override the method inherited from the category of modules, because it would create a morphism that is of the wrong type and does not comply with `QuiverRepHom`.

    EXAMPLES:

    Sage

        sage: Q = DiGraph({1:{2:['a', 'b']}}).path_semigroup()
        sage: H = Q.S(QQ, 2).Hom(Q.P(QQ, 1))
        sage: H.zero() + H.an_element() == H.an_element()
        True
        sage: isinstance(H.zero(), H.element_class)
        True

    Python

        >>> from sage.all import *
        >>> Q = DiGraph({Integer(1):{Integer(2):['a', 'b']}}).path_semigroup()
        >>> H = Q.S(QQ, Integer(2)).Hom(Q.P(QQ, Integer(1)))
        >>> H.zero() + H.an_element() == H.an_element()
        True
        >>> isinstance(H.zero(), H.element_class)
        True