Skip to content

Commit

Permalink
Version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmarco committed Oct 29, 2024
1 parent d3c17ac commit f6a8082
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 29 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([libbraiding], [1.2], [mmarco@unizar.es])
AC_INIT([libbraiding], [1.3], [mmarco@unizar.es])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign -Wall])
Expand Down
118 changes: 90 additions & 28 deletions library.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ to expose the functions as a C++ library instead of an interactive
program.
Braids are returned in left normal form as a list of lists. The
Braids are returned in left normal form as a list of lists. The
first list contains only an integer, representing the power of
Delta. The subsequent lists are the Tietze lists of the elementary
permutation braids.
"""
from cysignals.signals cimport sig_on, sig_off

from libcpp.list cimport list

Expand All @@ -30,30 +31,35 @@ cdef extern from "braiding.h" namespace "Braiding":
int thurstontype(int n, list[int] word);
int Rigidity_ext(int n, list[int] word);
list[list[list[list[int]]]] SlidingCircuits(int n, list[int] word)

list[list[list[int]]] SendToSSS(int n, list[int] word)
list[list[list[int]]] SendToUSS(int n, list[int] word)
list[list[list[int]]] SendToSC(int n, list[int] word)
list[list[list[int]]] Trajectory(int n, list[int] word)
list[list[list[list[int]]]] CyclicSlidings(int n, list[int] word)

def conjugatingbraid(braid1, braid2):
r"""
Return a braid that conjugates braid1 to braid2, if such a braid exists.
INPUT:
- ``braid1`` -- the braid to be conjugated.
- ``braid2`` -- the braid to conjugate to.
OUTPUT:
The list of lists that represent a conjugating braid. If the input braids
are not conjugate, an empty list is returned.
EXAMPLES::
sage: B = BraidGroup(3)
sage: b = B([1,2,1,-2])
sage: c = B([1,2])
sage: conjugatingbraid(b,c) # optional - libbraiding
[[0], [2]]
"""
nstrands = max(braid1.parent().strands(), braid2.parent().strands())
l1 = braid1.Tietze()
Expand All @@ -66,18 +72,18 @@ def conjugatingbraid(braid1, braid2):
def leftnormalform(braid):
r"""
Return the left normal form of a braid.
INPUT:
- ``braid`` -- a braid
OUTPUT:
A list of lists with the left normal form. The first list contains the
power of delta. The subsequent lists are the elementary permutation braids.
EXAMPLES::
sage: B = BraidGroup(3)
sage: b = B([1,2,1,-2])
sage: leftnormalform(b) # optional - libbraiding
Expand All @@ -94,31 +100,31 @@ def leftnormalform(braid):
def rightnormalform(braid):
r"""
Return the right normal form of a braid.
INPUT:
- ``braid`` -- a braid
OUTPUT:
A list of lists with the right normal form. The first list contains the
power of delta. The subsequent lists are the elementary permutation braids.
EXAMPLES::
sage: B = BraidGroup(3)
sage: b = B([1,2,1,-2])
sage: rightnormalform(b) # optional - libbraiding
[[2, 1], [0]]
"""
nstrands = braid.parent().strands()
l1 = braid.Tietze()
sig_on()
cdef list[list[int]] rop = RightNormalForm(nstrands, l1)
sig_off()
return rop

def greatestcommondivisor(braid1, braid2):
r"""
Return the greatest common divisor of two braids.
Expand All @@ -130,7 +136,7 @@ def greatestcommondivisor(braid1, braid2):
cdef list[list[int]] rop = GreatestCommonDivisor(nstrands, l1, l2)
sig_off()
return rop

def leastcommonmultiple(braid1, braid2):
r"""
Return the least common multiple of two braids.
Expand All @@ -142,7 +148,7 @@ def leastcommonmultiple(braid1, braid2):
cdef list[list[int]] rop = LeastCommonMultiple(nstrands, l1, l2)
sig_off()
return rop

def centralizer(braid):
r"""
Return a list of generators of the centralizer of a braid.
Expand All @@ -161,7 +167,7 @@ def centralizer(braid):
cdef list[list[list[int]]] rop = CentralizerGenerators(nstrands, l)
sig_off()
return rop

def supersummitset(braid):
r"""
Return a list with the super-summit-set of a braid.
Expand Down Expand Up @@ -200,7 +206,7 @@ def thurston_type(braid):
return 'reducible'
elif i==3:
return 'pseudo-anosov'

def rigidity(braid):
r"""
Return the rigidity of the braid
Expand All @@ -222,3 +228,59 @@ def sliding_circuits(braid):
cdef list[list[list[list[int]]]] rop = SlidingCircuits(nstrands, l)
sig_off()
return rop

def send_to_sss(braid):
r"""
Returns an element of the braid's SSS and the conjugating braid.
"""
nstrands = braid.parent().strands()
l = braid.Tietze()
sig_on()
cdef list[list[list[int]]] rop = SendToSSS(nstrands, l)
sig_off()
return rop

def send_to_uss(braid):
r"""
Returns an element of the braid's USS and the conjugating braid.
"""
nstrands = braid.parent().strands()
l = braid.Tietze()
sig_on()
cdef list[list[list[int]]] rop = SendToUSS(nstrands, l)
sig_off()
return rop

def send_to_sc(braid):
r"""
Returns an element of the braid's sliding circuits and the conjugating braid.
"""
nstrands = braid.parent().strands()
l = braid.Tietze()
sig_on()
cdef list[list[list[int]]] rop = SendToSC(nstrands, l)
sig_off()
return rop

def trajectory(braid):
r"""
Returns the trajectory of the braid
"""
nstrands = braid.parent().strands()
l = braid.Tietze()
sig_on()
cdef list[list[list[int]]] rop = Trajectory(nstrands, l)
sig_off()
return rop

def cyclic_slidings(braid):
r"""
Returns the braid's cyclic slidings
"""
nstrands = braid.parent().strands()
l = braid.Tietze()
sig_on()
cdef list[list[list[list[int]]]] rop = CyclicSlidings(nstrands, l)
sig_off()
return rop

0 comments on commit f6a8082

Please sign in to comment.