#12630: Add representations of quivers and quiver algebras to sage
------------------------------------------------------------------------------+
       Reporter:  JStarx                                                      | 
        Owner:  AlexGhitza  
           Type:  enhancement                                                 | 
       Status:  needs_review
       Priority:  major                                                       | 
    Milestone:  sage-5.11   
      Component:  algebra                                                     | 
   Resolution:              
       Keywords:  algebra, quiver, module, days49                             | 
  Work issues:              
Report Upstream:  N/A                                                         | 
    Reviewers:  Simon King  
        Authors:  Jim Stark, Simon King, Mathieu Guay-Paquet, Aladin Virmaux  | 
    Merged in:              
   Dependencies:  #12412, #12413                                              | 
     Stopgaps:              
------------------------------------------------------------------------------+
Changes (by SimonKing):

  * status:  needs_work => needs_review
  * reviewer:  => Simon King
  * work_issues:  Use existing infrastructure for Representation, Homspace
                  and Morphism. Only import "Quiver" in
                  the global namespace, nothing else =>


Old description:

> This will add classes dealing with quivers, quiver algebras,
> representations of quivers, elements of these representations,
> homomorphisms between these representations, and spaces of homomorphisms
> between these representations.
>
> There's a lot here that is really easily computable.  We can compute
> socles, quotients, radicals, duals, and more for any finite dimensional
> representation.  We can compute projective covers of modules so
> Auslander-Rieten translations have been implemented and there's certainly
> potential for future enhancements dealing with homology and cohomology.
> There's only so much I can say here but everything is fully documented
> and should be self explanatory.
>
> Two shortcomings are that quivers need to be acyclic (to keep things
> finite dimensional) and this code does not handle quivers with relations.
> As far as quivers with relations go there are comments in the code
> detailing what should be done to implement that.  It's well within the
> reach of Sage, I just don't have the time to do it at the moment.
>
> __Apply__
>
> The second patch is supposed to split the code into chewable bits (so
> that maintenance and cythonization will become easier), introduces a
> parent structure for the paths of a quiver (namely: a free small
> category), makes paths inherit from Element (but ''not'' from
> `UniqueRepresentation`!) and fixes some tests. But there is more to do.
>
> * [attachment:trac_12630_quivers_v2.patch]
> * [attachment:trac12630_refactor_code.patch]

New description:

 This will add classes dealing with quivers, quiver algebras,
 representations of quivers, elements of these representations,
 homomorphisms between these representations, and spaces of homomorphisms
 between these representations.

 There's a lot here that is really easily computable.  We can compute
 socles, quotients, radicals, duals, and more for any finite dimensional
 representation.  We can compute projective covers of modules so Auslander-
 Rieten translations have been implemented and there's certainly potential
 for future enhancements dealing with homology and cohomology.  There's
 only so much I can say here but everything is fully documented and should
 be self explanatory.

 Two shortcomings are that quivers need to be acyclic (to keep things
 finite dimensional) and this code does not handle quivers with relations.
 As far as quivers with relations go there are comments in the code
 detailing what should be done to implement that.  It's well within the
 reach of Sage, I just don't have the time to do it at the moment.

 __Apply__

 The second patch is supposed to split the code into chewable bits (so that
 maintenance and cythonization will become easier), introduces a parent
 structure for the paths of a quiver (namely: a free small category), makes
 paths inherit from Element (but ''not'' from `UniqueRepresentation`!) and
 fixes some tests. The third patch uses Sage's infrastructure for morphisms
 and homsets of representations, and it reduces the pollution of the global
 namespace.

 * [attachment:trac_12630_quivers_v2.patch]
 * [attachment:trac12630_refactor_code.patch]
 * [attachment:trac12630-quiver_representation.patch]

--

Comment:

 I have provided a new patch. To make reviewing easier, I kept it separate.
 Once the review is done, we can think of folding it, to make it easier for
 the release manager.

 __What the new patch does__

 * To avoid pollution of the global namespace, ''only'' Quiver is imported
 at startup. There is really no need to import `QuiverRep` or
 `QuiverRepHom`. Instead, the user is supposed to first create a quiver Q,
 and then use `R = Q.representation(...)` or `R.hom(...)` to create
 representations and their morphisms. By consequence, there were many
 trivial fixes for the doctests needed.

 * In order to make `R.hom(S)` work with Sage's default infrastructure, it
 is needed to implement a method `natural_map()` for the homset `R.Hom(S)`.
 And this homset should be returned by a method `R._Hom_(S)`. Caching is
 actually not needed, because this is done in `sage.categories.homset.Hom`.
 Hence, '''TODO:''' Remove the `UniqueFactory`!!

 * There is a default `sage.structure.parent.Parent.hom`, and there is no
 need to overload it. In particular, the hom() method provided by the old
 patch expected its arguments in the wrong order. The default is: ''First''
 the data defining the morphism, ''second'' the codomain.

 * an_element() should be implemented by providing _an_element_().

 * There is a default `__contains__` method for parents, and there is
 usually no need to overload it (instead, one should implement coercions).
 Hence, I removed some of them. There is still `__contains__` for
 `FreeSmallCategory`, because it needs to extend what
 `DiGraph.__contains__` is doing. '''TODO:''' Check whether homspaces could
 do without the custom `__contains__`!

 * Speaking of default infrastructure: Elements should be created by either
 doing arithmetic on the generators of a parent, or by calling the parent
 with appropriate data, but not by passing these data to the ''underlying
 class'' of the elements (which does not coincide with the element class in
 many cases). '''TODO:''' Try to make `TestSuite()` work.

 * Speedup: I have already mentioned above that
 `self._vector[startdim:startdim + rows*cols]` is a lot slower than
 `self._vector.list()[startdim:startdim + rows*cols]`.

 * There is a default `zero` method, that caches the zero of a parent. So,
 there should be no need to overload it. However, some methods start with
 `self.zero()` and then change it in-place. That's of course not allowed
 with a cached element, and hence I had to replace `self.zero()` with a
 non-cached `self()`.

 I think, in spite of the above TODOs, I put it as "needs review" for now,
 and wait for your comments. For the record, I give positive review to
 those parts of the code that I did not change (hence, to most of the code
 inside of methods, as I was mainly changing the structure of the code base
 and the semantics of few methods that are important for Sage's
 infrastructure).

 Apply:

 trac_12630_quivers_v2.patch trac12630_refactor_code.patch
 trac12630-quiver_representation.patch

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12630#comment:95>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to