#18664: Implement (left and right) Zassenhaus basis of NSym
-------------------------------------+-------------------------------------
       Reporter:  amypang            |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  minor              |    Milestone:  sage-6.8
      Component:  combinatorics      |   Resolution:
       Keywords:  days65             |    Merged in:
        Authors:  amypang, saliola   |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/amypang/implementation_of_zassenhaus_basis_of_nsym|  
80230bb4f12b46e4e3d63a93b9f0aba7edfe5cf5
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by tscrim):

 Hey Amy and Franco,

 You will need to rebase this off the latest `develop` and make sure all
 functions have doctests (some don't have docstrings). I would also just
 move the `_register_coercion_` method into the `__init__` (so really
 you're removing that method). Also the `_to_complete_on_generator` has a
 misaligned docstring. I'd also change the `if n == 0 or n == 1:` to `if n
 <= 1`.

 I would also use:
 {{{#!python
 def _from_complete_on_basis(self, I):
     n = I.size()
     m = self._complete_to_zassenhaus_transition_matrix(n).invers()
     C = Compositions(n)
     i = C.rank(I)    # this is typically faster than list(C).index(I)
     return self._from_dict({comp: m[i,j] for j,comp in enumerate(C)})
 }}}
 Actually, since you only use the inverses, I would cache the inverse
 matrices instead.

 On a more optimization point (which is not necessary to handle now):
 {{{#!python
 for partition in Partitions(n):
     if len(partition) > 1:
         ...
 }}}
 I would instead do this:
 {{{#!python
 P = Partitions(6)
 it = iter(P)
 it.next()
 for p in it:
     ...
 }}}
 If you really wanted to go crazy with optimization, I'd use
 {{{#!python
 from sage.combinat.partitions import ZS1_iterator
 it = ZS1_iterator(n)
 it.next()
 for p in it:
     d = {}
     for part in self:
         d[part] = d.get(part, 0) + 1
     coeff = prod(factorial(d[e]) for e in d)
     ...
 }}}
 Yet as I said, that's going crazy.

--
Ticket URL: <http://trac.sagemath.org/ticket/18664#comment:5>
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/d/optout.

Reply via email to