#19011: Add Jones representation of braid groups and Jones polynomials of braid
closures
-------------------------------------+-------------------------------------
       Reporter:  fuglede            |        Owner:
           Type:  enhancement        |       Status:  new
       Priority:  major              |    Milestone:  sage-6.9
      Component:  algebraic          |   Resolution:
  topology                           |    Merged in:
       Keywords:                     |    Reviewers:
        Authors:  Søren Fuglede      |  Work issues:
  Jørgensen                          |       Commit:
Report Upstream:  N/A                |  8202cf5754bcecd608e1dfb2c189eb7846febb6c
         Branch:                     |     Stopgaps:
  u/fuglede/jones_rep                |
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by mmarco):

 Some timings for conversion between univariate laurent polynomial rings:

 {{{

 sage: R.<t> = LaurentPolynomialRing(ZZ)
 sage: f = (t^-2+t^2) ^2 + 5*t -1
 sage: f
 t^-4 + 1 + 5*t + t^4
 sage: S.<a> = LaurentPolynomialRing(IntegerModRing(7))
 sage: d = f.dict()
 sage: d
 {-4: 1, 0: 1, 1: 5, 4: 1}
 sage: %time f.subs(t=a)
 CPU times: user 9 ms, sys: 1 ms, total: 10 ms
 Wall time: 9.29 ms
 a^-4 + 1 + 5*a + a^4
 sage: %time S(f)
 CPU times: user 1 ms, sys: 0 ns, total: 1 ms
 Wall time: 1.31 ms
 a^-4 + 1 + 5*a + a^4
 sage: %time S(d)
 CPU times: user 1 ms, sys: 0 ns, total: 1 ms
 Wall time: 1.02 ms
 a^-4 + 1 + 5*a + a^4
 sage: %time S(d)
 CPU times: user 1 ms, sys: 0 ns, total: 1 ms
 Wall time: 293 µs
 a^-4 + 1 + 5*a + a^4
 sage: d1 = (f+1).dict()
 sage: %time S(d1)
 CPU times: user 0 ns, sys: 0 ns, total: 0 ns
 Wall time: 211 µs
 a^-4 + 2 + 5*a + a^4
 sage: f1 = f+1
 sage: %time S(f1)
 CPU times: user 0 ns, sys: 0 ns, total: 0 ns
 Wall time: 147 µs
 a^-4 + 2 + 5*a + a^4

 }}}

 Definitely .subs is not a good idea. Direct conversion or construction
 from the underlying dictionary are much faster.

 Of course, this might deppend a lot on the rings involved, and the
 dictionart approach might not work if we talk about fraction fields or
 multivariate polynomial rings.

--
Ticket URL: <http://trac.sagemath.org/ticket/19011#comment:20>
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