Out of my head, the bracket method is exponential in the number of 
crossings, and pretty much independent on the number of strands. The TL 
representation involves the product of a nuumber of matrices that is linear 
on the number of crossings, and the complexity of such a matrix is also 
polynomial on the number of strands (around fourth power maybe?). So one 
could expect the bracket method to be better only if the number of 
crossings is really small.

In the future we could have even a thirthd option, which is to compute the 
HOMFLY polyonimal using Jenkins method. I have ported his program to be 
used as a shared library, and written sage package with a cython interface. 
When the knot code gets merged, i will open another ticket to include it. 
His method is also exponential in the worst case, but quite fast in 
practice. Its problem is that it consumes a lot of memory.

El miércoles, 12 de agosto de 2015, 12:43:04 (UTC+2), fuglede....@gmail.com 
escribió:
>
> The methods have been include in [http://trac.sagemath.org/ticket/19011 
> trac ticket #19011].
>
> At the end of the day, it would be nice to have some kind of mechanism for 
> deciding which algorithm to use as they really are rather different. I made 
> a simply benchmark to highlight their strengths and weaknesses:
>
> sage: benchmark()
>
> Test 1: A very long braid on very few strands
> Braid: (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
> Braid rep: 0.03 seconds, Kauffman bracket: 10.33 seconds
>
> Test 2: A very simple braid on quite a few strands
> Braid: (1, 2, 3, 4, 5, 6, 7, 8)
> Braid rep: 6.56 seconds, Kauffman bracket: 0.00 seconds
>
> Code:
>
> import time
>
> def benchmark():
>     def test(b):
>         L = Link(b)
>         print "Braid: " + str(b.Tietze())
>         result_string = "Braid rep: {0:.2f} seconds, Kauffman bracket: 
> {1:.2f} seconds"
>
>         start_time = time.time()
>         jones = b.jones_polynomial()
>         testb = time.time() - start_time
>     
>         start_time = time.time()
>         jones = L.jones_polynomial()
>         testl = time.time() - start_time
>
>         print result_string.format(testb, testl)
>
>     print "\nTest 1: A very long braid on very few strands"
>     l = 60
>     B = BraidGroup(2)
>     test(B([1]*l))
>     
>     print "\nTest 2: A very simple braid on quite a few strands"
>     n = 9
>     B = BraidGroup(n)
>     test(B(range(1,n)))
>
>
>
> -Søren
>
> Den søndag den 9. august 2015 kl. 12.47.34 UTC+2 skrev mmarco:
>>
>> Oh, i forgot to say: please open a ticket with your code added to the 
>> braid class. It is definitely a nice addition. I would be happy to review 
>> it. write your methods inside the class definition, and consider which ones 
>> should be public and which ones should be hidden to the user.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to