#14516: Refactoring of crystals for speedup
----------------------------------------------+-----------------------------
       Reporter:  tscrim                      |         Owner:  sage-combinat
           Type:  enhancement                 |        Status:  needs_review 
       Priority:  major                       |     Milestone:  sage-5.10    
      Component:  combinatorics               |    Resolution:               
       Keywords:  crystals speedup            |   Work issues:               
Report Upstream:  N/A                         |     Reviewers:               
        Authors:  Travis Scrimshaw            |     Merged in:               
   Dependencies:  #14402 #14413 #14143 #2023  |      Stopgaps:               
----------------------------------------------+-----------------------------
Changes (by tscrim):

  * status:  new => needs_review


Old description:

> In order to speed up many of the crystals computations, I'm proposing the
> following:
>
> - Cythonize `CrystalOfLetters`
> - Instead of e, f, epsilon, phi checking the index set each time, these
> functions will check to make sure i is in the index set, then call _e,
> _f, _epsilon, _phi which assume i is valid input and respectively call
> the private methods.
> - Make index_set a cached method. Subsequently this requires it to be
> returned as a tuple instead of a list

New description:

 In order to speed up many of the crystals computations, I'm proposing the
 following:

 - Cythonize `CrystalOfLetters`
 - Instead of `e()`, `f()`, `epsilon()`, `phi()` checking the index set
 each time, these functions will check to make sure i is in the index set,
 then call `_e()`, `_f()`, `_epsilon()`, `_phi()` which assume i is valid
 input and respectively call the private methods.
 - Make `index_set()` a cached method. Subsequently this requires it to be
 returned as a tuple instead of a list
 - Make different letters classes, one for integers (classical types), one
 for tuples (exceptional/spin)
 - Store by caching result of `_element_constructor_()` the elements of
 `CrystalOfLetters`.

--

Comment:

 I'm also getting significant speedups now in creating `CrystalOfLetters`
 and doctests for `tensor_product.py` and `kirillov_reshetikhin.py`:
 {{{
 sage: %time C = CrystalOfLetters(['D',100])
 CPU times: user 0.84 s, sys: 0.24 s, total: 1.08 s
 Wall time: 1.67 s

 sage -t tensor_product.py
     [349 tests, 13.05 s]
 sage -t kirillov_reshetikhin.py
     [653 tests, 30.51 s]
 }}}
 Before:
 {{{
 sage: %time C = CrystalOfLetters(['D',100])
 CPU times: user 2.33 s, sys: 0.42 s, total: 2.76 s
 Wall time: 3.58 s

 sage -t tensor_product.py
     [349 tests, 14.60 s]
 sage -t kirillov_reshetikhin.py
     [653 tests, 47.96 s]
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14516#comment:2>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to