#12667: category root lattice realization issue: infinite loop while trying to
reflect to the positive chamber
-----------------------------+----------------------------------------------
   Reporter:  mshimo         |          Owner:  sage-combinat 
       Type:  defect         |         Status:  new           
   Priority:  major          |      Milestone:  sage-5.0      
  Component:  combinatorics  |       Keywords:  root system   
Work_issues:                 |       Upstream:  N/A           
   Reviewer:                 |         Author:  Mark Shimozono
     Merged:                 |   Dependencies:                
-----------------------------+----------------------------------------------

Comment(by nthiery):

 Hi Mark,

 > What is the right sage-combinat way to handle a situation
 > where the function input will lead to an infinite loop?
 > Can I just assert conditions that will ensure things like that
 > don't happen, or should I emit a more precise error?
 > Pointing me to example code will suffice.

 Sorry for my delayed answer. In the affine case, please add a test on
 level; something like:
 {{{
      assert not self.parent().is_affine() or self.level() >= 0, "This
 element is not in the orbit of the fundamental chamber"
 }}}

 For the general Kac-Moody case: I think we can assume that a user
 playing with those has some non trivial background. In that case, and
 unless there is a cheap and easy to implement test as in the affine
 case, it would be perfectly fine to write in the documentation
 something like:

 {{{
     INPUT:

     - ``self`` -- an element in the orbit of the fundamental chamber

     .. warning::

         The behavior of this method is not specified if ``self`` is
         not in the orbit of the fundamental chamber (the algorithm may
         run in an infinite loop). This never occurs for finite root
         systems. For affine Weyl groups, an element is in the orbit of
         the fundamental chamber iff it is of positive level (see
         :meth:`level`), and this is currently checked, but do not rely
         on it::

              sage: ...
 }}}

 Otherwise put: as long as it is well documented, it is preferable for
 power users to have a feature that needs to be used with care, than no
 feature. Sage should be usable as a race car for those who wants one.

 Cheers,
                        Nicolas

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12667#comment:4>
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 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-trac?hl=en.

Reply via email to