Cartan matrix for a relabelled Cartan type?
The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From:
Florent Hivert <Florent.Hiv... @lri.fr>
Date: Wed, 3 Oct 2012 12:13:31 +0200
Local: Wed, Oct 3 2012 6:13 am
Subject: Re: [sage-devel] Cartan matrix for a relabelled Cartan type?
Hi,
> When relabelling a Cartan type:
> sage: A3 = CartanType("A3")
> sage: A3r = A3.relabel({1:2,2:3,3:1})
> one loses the cartan_matrix method, which is not implemented in [...]/combinat/root_system/type_relabel.py.
> It would be trivial to create it: just calling the cartan_matrix method of the CartanType parent and reordering columns and rows according to the relabelling.
> May I open a ticket in trac?
I'm forwarding this to sage-combinat-devel, where most root system related
discussions take place.
Cheers,
Florent
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
JesusTorrado <jesu... @gmail.com>
Date: Wed, 3 Oct 2012 03:57:11 -0700 (PDT)
Local: Wed, Oct 3 2012 6:57 am
Subject: Re: [sage-devel] Cartan matrix for a relabelled Cartan type?
Hi there,
I am the author of the original question, freshly joined the group.
Cheers,
Jesús
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
"Nicolas M. Thiery" <Nicolas.Thi... @u-psud.fr>
Date: Thu, 4 Oct 2012 12:30:38 +0200
Local: Thurs, Oct 4 2012 6:30 am
Subject: Re: [sage-combinat-devel] Re: [sage-devel] Cartan matrix for a relabelled Cartan type?
Hi Jesus,
On Wed, Oct 03, 2012 at 12:13:31PM +0200, Florent Hivert wrote:
> > When relabelling a Cartan type:
> > sage: A3 = CartanType("A3")
> > sage: A3r = A3.relabel({1:2,2:3,3:1})
> > one loses the cartan_matrix method, which is not implemented in [...]/combinat/root_system/type_relabel.py.
> > It would be trivial to create it: just calling the cartan_matrix method of the CartanType parent and reordering columns and rows according to the relabelling.
Good catch! Thanks for the feedback.
Actually, the problem is that ``cartan_matrix`` is implemented for
crystalographic cartan types (in the class
sage.combinat.root_system.cartan_type.CartanType_crystalographic).
However, when constructing a relabeled cartan type, that information
is lost; A3r is not put in the right class::
sage: A3.__class__.mro()
[<class 'sage.combinat.root_system.type_A.CartanType'>, ...
<class 'sage.combinat.root_system.cartan_type.CartanType_finite'>,
<class 'sage.combinat.root_system.cartan_type.CartanType_simply_laced'>,
<class 'sage.combinat.root_system.cartan_type.CartanType_crystalographic'>,
<class 'sage.combinat.root_system.cartan_type.CartanType_simple'>, ...
<class 'sage.combinat.root_system.cartan_type.CartanType_abstract'>, ...]
sage: A3r.__class__.mro()
[<class 'sage.combinat.root_system.type_relabel.CartanType'>, ...
<class 'sage.combinat.root_system.cartan_type.CartanType_abstract'>, ...]
There is already a hook in the constructor for relabelled cartan types
to handle this for affine cartan types. In
sage.combinat.root_system.type_relabel.CartanType.__init__, you will find:
if type.is_affine():
self._add_abstract_superclass(CartanType_affine)
And indeed this works::
sage: C = CartanType(["A",3,1])
sage: Cr = C.relabel({0:0,1:2,2:3,3:1})
sage: Cr.cartan_matrix()
[ 2 -1 -1 0]
[-1 2 0 -1]
[-1 0 2 -1]
[ 0 -1 -1 2]
So the right fix would be to add similar hooks for finite, simply
laced, crystalographic, and simple cartan types.
> > May I open a ticket in trac?
Please! I'd be happy to review a patch if you would be willing to
write one.
Cheers,
Nicolas
--
Nicolas M. Thi ry "Isil" <nthi... @users.sf.net>
http://Nicolas.Thiery.name/
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
JesusTorrado <jesu... @gmail.com>
Date: Thu, 4 Oct 2012 04:01:11 -0700 (PDT)
Local: Thurs, Oct 4 2012 7:01 am
Subject: Re: [sage-combinat-devel] Re: [sage-devel] Cartan matrix for a relabelled Cartan type?
Hi Nicolas,
On Thursday, October 4, 2012 12:30:41 PM UTC+2, Nicolas M. Thiery wrote:
> > > May I open a ticket in trac?
> Please! I'd be happy to review a patch if you would be willing to > write one.
I will put my hands on it, then. This will be my first contribution to
Sage, so I would ask some patience from you ;)
Cheers,
Jesús
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
"Nicolas M. Thiery" <Nicolas.Thi... @u-psud.fr>
Date: Fri, 5 Oct 2012 09:24:38 +0200
Local: Fri, Oct 5 2012 3:24 am
Subject: Re: [sage-combinat-devel] Re: [sage-devel] Cartan matrix for a relabelled Cartan type?
On Thu, Oct 04, 2012 at 04:01:11AM -0700, JesusTorrado wrote:
> I will put my hands on it, then.
Great, thanks!
> This will be my first contribution to Sage,
Even better: we love when new contributors come in, and this is a
perfect fit for a first contribution.
> so I would ask some patience from you ;)
Certainly! We all know the hurdles ...
By the way, instead of a:
if type.is_affine():
self._add_abstract_superclass(CartanType_affine)
if ...
you may want to use something less redundant like:
for cls in [CartanType_affine, ...]:
if isinstance(type, cls) and not isinstance(self, cls):
self._add_abstract_superclass(cls)
Probably the list of classes should be ordered from most specific to
most general.
Cheers,
Nicolas
--
Nicolas M. Thi ry "Isil" <nthi... @users.sf.net>
http://Nicolas.Thiery.name/
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
JesusTorrado <jesu... @gmail.com>
Date: Tue, 30 Oct 2012 07:53:52 -0700 (PDT)
Local: Tues, Oct 30 2012 10:53 am
Subject: Re: [sage-combinat-devel] Re: [sage-devel] Cartan matrix for a relabelled Cartan type?
Ok, this is shameful, but I have been a few weeks absolutely overloaded with work.
Is it too late to fix it?
Cheers, ans sorry!
Jesús
Am Freitag, 5. Oktober 2012 09:24:38 UTC+2 schrieb Nicolas M. Thiery:
> On Thu, Oct 04, 2012 at 04:01:11AM -0700, JesusTorrado wrote: > > I will put my hands on it, then.
> Great, thanks!
> > This will be my first contribution to Sage,
> Even better: we love when new contributors come in, and this is a > perfect fit for a first contribution.
> > so I would ask some patience from you ;)
> Certainly! We all know the hurdles ...
> By the way, instead of a:
> if type.is_affine(): > self._add_abstract_superclass(CartanType_affine) > if ...
> you may want to use something less redundant like:
> for cls in [CartanType_affine, ...]: > if isinstance(type, cls) and not isinstance(self, cls): > self._add_abstract_superclass(cls)
> Probably the list of classes should be ordered from most specific to > most general.
> Cheers, > Nicolas > -- > Nicolas M. Thi�ry "Isil" <nth... @users.sf.net <javascript:>> > http://Nicolas.Thiery.name/
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
JesusTorrado <jesu... @gmail.com>
Date: Mon, 19 Nov 2012 14:46:49 -0800 (PST)
Local: Mon, Nov 19 2012 5:46 pm
Subject: Re: [sage-combinat-devel] Re: [sage-devel] Cartan matrix for a relabelled Cartan type?
FInally! http://trac.sagemath.org/sage_trac/ticket/13724
There are still broken things, seems to behave correctly:
{{{
sage: A3 = CartanType("A3")
sage: A3.cartan_matrix()
[ 2 -1 0]
[-1 2 -1]
[ 0 -1 2]
sage: A3r = A3.relabel({1:2,2:3,3:1})
sage: A3r.cartan_matrix()
[ 2 0 -1]
[ 0 2 -1]
[-1 -1 2]
}}}
Mainly, the doctest of type_relabel.py compains about some not correctly
inherited methods. I have the impression that it has to do with dynamic
classes, which are beyond my knowledge. Could I get any hint, please?
Cheers,
Jesús Torrado
You must
Sign in before you can post messages.
You do not have the permission required to post.