#12630: Add representations of quivers and quiver algebras to sage
-------------------------------------------+--------------------------------
Reporter: JStarx | Owner: AlexGhitza
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.10
Component: algebra | Resolution:
Keywords: algebra, quiver, module | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Jim Stark | Merged in:
Dependencies: #12412, #12413 | Stopgaps:
-------------------------------------------+--------------------------------
Comment (by SimonKing):
I am now experimenting with the following setting:
* I suggest to let Quiver inherit from `UniqueRepresentation`, `DiGraph`
and `Parent`.
* In your `UniqueFactory`, you create a key for caching by creating a
`DiGraph` and asking it for the (sorted) lists of vertices and edges. I
suggest to do the same in `__classcall__`, but with one additional twist:
After all, what we want to return is a `DiGraph` (namely a quiver). So, we
create a new Quiver instance Q, initialise Q as a `DiGraph` and obtain
from it the key.
- If it turns out that this key has already been used in the cache, then
we return the cached instance and drop Q.
- Otherwise, we complete the initialisation of Q (which essentially
means calling Parent.__init__), put it into the cache, and return it.
By the way: In that way, one can use all arguments that are available for
digraphs. For example, one could create two quivers with essentially the
same edges, but using different graph backends.
By the way, using @property as I suggested in my previous post would not
work, because we need the mutation methods while we initialise Q as a
`DiGraph`.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12630#comment:38>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.