#15439: sage/combinat/matrices/latin.py: isotopism method uses product of
permutations
-------------------------------------------------+-------------------------
       Reporter:  darij                          |        Owner:
           Type:  defect                         |       Status:  new
       Priority:  major                          |    Milestone:  sage-5.13
      Component:  combinatorics                  |   Resolution:
       Keywords:  permutation, combinat, latin   |    Merged in:
  square                                         |    Reviewers:
        Authors:                                 |  Work issues:
Report Upstream:  N/A                            |       Commit:
         Branch:                                 |     Stopgaps:
   Dependencies:                                 |
-------------------------------------------------+-------------------------

Comment (by ncohen):

 Yoooooooooooo !!

 > Good point. I'm not sure if I want to add a `translate_from_0n_to_1n`
 variable to the `Permutation` constructor (that constructor is already
 quite complex, and it gets called a hell lot). But maybe we should add a
 function to `sage/combinat/permutation.py` which constructs a permutation
 from its "left shift by 1"?

 Well... I'd say that having this exposed in the constructor would be cool,
 considering that I don't even get why the permutations are on 1..n in the
 first place. Accepting them on a 0..n-1 input, even to only return a 1..n
 one would be cool.
 But I tried to put some sense into what's happening in the combinat/
 folder, and each time it crashes on a
   1) We will do it some day

   2) It's a good idea but it makes existing code slower (#14019 is in this
 case, though wrong results are actually returned in the meantime)

   3) I have to ask XXXX, which never happens

 So, well. Even though the only sensible thing would be to support at least
 both 0..n-1 and 1..n (why not LABELLED permutations btw ? Like
 PermutationGroupElement already does ?). Even though the slightly less
 sensible thing would be to give this up but to be able to relabel them
 from the constructor, I think I can't hope for anything better than having
 a relabeling function that I could import and use manually.

 > +1 for the link. It just doesn't have much to do with the `isotopism`
 method; it probably should be in the `apply_isotopism` docstring.

 Right, right.

 > OK, good point -- it seems that the `isotopism` method is indeed meant
 to take disjoint cycles, whence the order is irrelevant. But I'm saying
 "seems" because to me, too, it's far from clear from the docstring. If we
 can confirm than this is what's meant, it should be rather easy to avoid
 the use of `*` and probably even gain some speed this way.

 Oh, I'm pretty sure that this is what is meant there. Of course nothing
 checks it (we are in the combinat/ folder after all) but it was done in
 the very same way in the constructor of permutations before #13742.

 > For quite a long time I believed that everyone agreed `pq` would mean
 "first do `q`, then `p`", apart from maybe some 19th century British
 authors (who would be unreadable anyway). But it turned out that the
 opposite convention is still around in Britain :(

 HMmmmmmmmm `>_<`

 > The `global_options` constructor is just a new way to handle these
 global variables, but the global variable determining order of
 multiplication is not new. I guess it's nuclear waste from the olden days
 of Sage.
 >
 > In #15174 it surfaced that with `Permutations.global_options(mult) ==
 'l2r'`, the Hecke algebra (a deformation of the symmetric group algebra)
 would have its multiplication opposite of that of the symmetric group
 algebra, whereas with `Permutations.global_options(mult) == 'r2l'` it
 would not be an algebra at all (associativity would not hold). I believe
 this has been around for ages. You've gotta love our codebase...

 Nightmares. Nightmares. Why don't we have "permutations acting on right"
 and "permutations acting on the left" then ? And get rid of a flag that
 might break dozens of functions without anybody knowing ?

 Nathann

--
Ticket URL: <http://trac.sagemath.org/ticket/15439#comment:3>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to