Hello all- 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. 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)? 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. Thanks very much for your help. Regards, Brant -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-de...@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.