On 03/09/2013 22:48, Simon King wrote:
PS:
On 2013-09-03, Simon King <simon.k...@uni-jena.de> wrote:
Shouldn't there always be a coercion from the base ring into a
unital algebra? It seems to me that the underlying problem is that
matrix spaces do not properly use the new coercion model (in particular,
they define their own __call__, how nasty!).
Looking at what I wrote later in my previous post, I think this is *not* the
problem. Since the previous post was so long, here is a summary:
- For efficience reasons, we do not want full category initialisation
during __init__ (please don't change this, unless you want to mess
with the number theorists...)
=> __init_extra__ of Algebras.ParentMethods is not called
=> one needs to establish an action from the base ring "manually"
- The category *is* initialised for CategoryObject, but just not for Parent.
It would be a good idea to check whether IntegralDomains() could be
used in the category, since this is needed for FractionField to be
defined.
- The usual framework for actions of a base ring on a module relies on
cpdef methods _rmul_ and _lmul_. Problem: These expect their input of
a particular type, that is often *not* used in sage.combinat.
- I recommend to *try* (no guarantee it will work) to create a new type
of action "A" (inherit from sage.categories.action.Action). You need to
implement its _call_ and _repr_name_, and I think that's all what is to do
(but perhaps you'll find other examples of Action in Sage, so, try to
learn from existing code).
Typically, the _call_ method of the action A._call_(a,b) will rely on
methods of a and b (in our application, "a" is element of the
base ring and "b" is a matrix).
And then, let MatrixSpace._get_action_ return A.
Hope the short version of my post was helpful :)
Best regards,
Simon
Thanks you very much for these two long and detailed posts... I will try
to reread them carefully tomorrow and propose some patch shortly...
I will post a patch number on this thread when I will have something
interesting.
Thanks you Simon.
Cheers,
Nicolas B.
--
You received this message because you are subscribed to the Google Groups
"sage-combinat-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.