Hi Brant!

Good to hear from you :-)

On Thu, May 13, 2010 at 05:56:38PM -0700, Brant Jones wrote:
> Anne and I are working on merging some code that implements the
> Lenart--Postnikov alcove path model into sage.  The algorithm needed a
> few features that aren't available in the root_system package, so I
> implemented (very basic) versions of what I needed in a temporary file
> called crystals/alcove_path_util.py.
> 
> I'd like to get some advice on whether my implementations can be
> merged into the root_system code.

They definitely should :-) We need them elsewhere.

> Essentially, I need the
> associated_coroot() method (that returns the element of the
> coroot_space corresponding to a given element of the root_space) in
> the root_lattice_realization.py to be implemented.  My implementation
> (currently residing in alcove_path_util.py) is:
> 
> def root_norm(R, root):
>       V = R.ambient_space()
>       alpha = V.simple_roots()
>       v = alpha[Integer(1)] - alpha[Integer(1)]
>       for i in (ellipsis_range(Integer(0),Ellipsis,len(root.monomials())-
> Integer(1))):
>               simple_root = root.monomials()[i]
>               coeff = root.coefficients()[i]
>               for j in R.index_set():
>                       if simple_root == R.root_space().simple_root(j):
>                               v = v + coeff*alpha[j]
>       return v.scalar(v)
> 
> # Return an element of coroot_space that is the coroot of the given
> root.
> def coroot(R, root):
>       rcoroot = R.coroot_space().simple_root(Integer(1)) -
> R.coroot_space().simple_root(Integer(1))
>       for i in (ellipsis_range(Integer(0),Ellipsis,len(root.monomials())-
> Integer(1))):
>               simple_root = root.monomials()[i]
>               coeff = root.coefficients()[i]
>               for j in R.index_set():
>                       if simple_root == R.root_space().simple_root(j):
>                               rcoroot = rcoroot + 
> coeff*(Integer(1)/Integer(2))*(root_norm(R,
> R.root_space().simple_root(j)))*R.coroot_space().simple_root(j)
>       return (Integer(2)/root_norm(R, root))*rcoroot
> 
> (I wrote this code over 6 months ago when the root_system code was
> still being developed, so you may have more efficient ways to
> accomplish this, and I welcome your feedback.)  Would anyone mind if I
> make a patch to move this code into root_lattice_realization.py (using
> the appropriate method names, of course)?

+1

What the code is doing in the ambient space is to find the appropriate
scaling factors between a simple root and the corresponding simple
coroot, right? A type free implementation could be to look at the
Cartan matrix M (which is symmetrizable), and compute the appropriate
diagonal matrix making D^-1 M D symmetric.

Then, a nice implementation (which is partly how it was done in MuPAD,
and how I would like to eventually see it in Sage) would be to:

 - Add a method in DynkinDiagram (possibly with a link from
   CartanType) returning D (as a family i -> D[i]).

   Question: What would be a good name for this method?

   Todo: check how this relates to the a/acheck c/check coefficients.

 - Implement a diagonal module morphism from the root lattice to the
   coroot lattice, using D (this morphism is usually denoted by mu/nu
   if I remember well). It could be made available under:

        L.to_coroot_lattice_morphism()

   or some better name.

   See also the documentation of module_morphism.

 - Implement the method associated_coroot in the root lattice by
   applying the morphism, and dividing by the scalar product with the
   root as you did above.

Do you feel like implementing some or all of the above? Except
possibly for finding D, this should be just a few lines of code.
There might be a bit of fiddling with integer w.r.t. rational
coefficients though, unless you work in the root space.

> Once I do this, I think that the existing reflection() method in
> root_lattice_realization.py should be able to replace my method
> root_space_reflection() in alcove_path_util.py, and I will be able
> to get rid of the alcove_path_util.py file entirely.

Perfect.

Have a nice week-end,
                                Nicolas
--
Nicolas M. ThiĆ©ry "Isil" <[email protected]>
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.

Reply via email to