Ticket #15505: 15505_braid_rels.patch

File 15505_braid_rels.patch, 4.4 KB (added by mmarco, 8 years ago)
  • sage/groups/braid.py

    # HG changeset patch
    # User Miguel Angel Marco Buzunariz <mmarco@unizar.es>
    # Date 1386682613 28800
    # Node ID cda8b4495ef90f3d8467f7013e8a826ec3d99c93
    # Parent  ce0e25f19b062aa1086922719677996914d1107a
    Add missing relations to braid group
    
    diff --git a/sage/groups/braid.py b/sage/groups/braid.py
    a b  
    109109        nfself = map(lambda i: i.Tietze(), self.left_normal_form())
    110110        nfother = map(lambda i: i.Tietze(), other.left_normal_form())
    111111        return cmp(nfself, nfother)
    112        
     112
    113113    def _latex_(self):
    114114        """
    115115        Return a LaTeX representation
     
    159159
    160160        The Burau matrix of the braid. It is a matrix whose entries
    161161        are Laurent polynomials in the variable ``var``.
    162        
     162
    163163        EXAMPLES::
    164164
    165165            sage: B = BraidGroup(4)
     
    415415        OUTPUT:
    416416
    417417        The matrix corresponding to the Lawence-Krammer-Bigelow representation of the braid.
    418        
     418
    419419        EXAMPLES::
    420420
    421421            sage: B = BraidGroup(3)
     
    515515        P = self.parent()
    516516        return tuple( [P._permutation_braid(delta).__pow__(a)] +
    517517                      map(lambda i:P._permutation_braid(i), l) )
    518        
     518
    519519    def _left_normal_form_perm_(self):
    520520        """
    521521        Return the left normal form of the braid, in permutation form.
     
    612612            sage: B1 = BraidGroup(5) # indirect doctest
    613613            sage: B1
    614614            Braid group on 5 strands
    615            
     615
    616616        Check that :trac:`14081` is fixed::
    617617
    618618            sage: BraidGroup(2)
    619619            Braid group on 2 strands
    620620            sage: BraidGroup(('a',))
    621621            Braid group on 2 strands
     622
     623        Check that :trac:`15505` is fixed::
     624
     625            sage: B=BraidGroup(4)
     626            sage: B.relations()
     627            (s0*s1*s0*s1^-1*s0^-1*s1^-1, s0*s2*s0^-1*s2^-1, s1*s2*s1*s2^-1*s1^-1*s2^-1)
     628            sage: B=BraidGroup('a,b,c,d,e,f')
     629            sage: B.relations()
     630            (a*b*a*b^-1*a^-1*b^-1,
     631             a*c*a^-1*c^-1,
     632             a*d*a^-1*d^-1,
     633             a*e*a^-1*e^-1,
     634             a*f*a^-1*f^-1,
     635             b*c*b*c^-1*b^-1*c^-1,
     636             b*d*b^-1*d^-1,
     637             b*e*b^-1*e^-1,
     638             b*f*b^-1*f^-1,
     639             c*d*c*d^-1*c^-1*d^-1,
     640             c*e*c^-1*e^-1,
     641             c*f*c^-1*f^-1,
     642             d*e*d*e^-1*d^-1*e^-1,
     643             d*f*d^-1*f^-1,
     644             e*f*e*f^-1*e^-1*f^-1)
    622645        """
    623646        n = len(names)
    624647        if n<1: #n is the number of generators, not the number of strands (see ticket 14081)
    625648            raise ValueError("the number of strands must be an integer bigger than one")
    626649        free_group = FreeGroup(names)
    627650        rels = []
    628         for i in range(1, n):   
    629             if i<n-1:
    630                 rels.append(free_group([i, i+1, i, -i-1, -i, -i-1]))
    631             for j in range(i+2, n):
     651        for i in range(1, n):
     652            rels.append(free_group([i, i+1, i, -i-1, -i, -i-1]))
     653            for j in range(i+2, n+1):
    632654                rels.append(free_group([i, j, -i, -j]))
    633655        FinitelyPresentedGroup.__init__(self, free_group, tuple(rels))
    634656        self._nstrands_ = n+1
     
    680702        return Infinity
    681703
    682704    order = cardinality
    683    
     705
    684706    def as_permutation_group(self):
    685707        """
    686708        Return an isomorphic permutation group.
     
    688710        OUTPUT:
    689711
    690712        Raises a ``ValueError`` error since braid groups are infinite.
    691        
     713
    692714        TESTS::
    693715
    694716            sage: B = BraidGroup(4, 'g')
     
    807829        - ``variab`` -- string. the names of the variables that will
    808830          appear in the matrix. They must be given as a string,
    809831          separated by a comma
    810            
     832
    811833        OUTPUT:
    812834
    813835        The LKB matrix of the braid, with respect to the variables.
     
    10171039    This action is defined as follows:
    10181040
    10191041    .. MATH::
    1020    
     1042
    10211043        x_j \cdot \sigma_i=\begin{cases}
    10221044        x_{j}\cdot x_{j+1}\cdot {x_j}^{-1} & \text{if $i=j$} \\
    10231045        x_{j-1} & \text{if $i=j-1$} \\
     
    10331055    method of the braid group to constuct this action.
    10341056
    10351057    EXAMPLES::
    1036    
     1058
    10371059        sage: B.<s0,s1,s2> = BraidGroup(4)
    10381060        sage: F.<x0,x1,x2,x3> = FreeGroup(4)
    10391061        sage: x0 * s1
     
    10641086        """
    10651087        import operator
    10661088        Action.__init__(self, G, M, is_left, operator.mul)
    1067    
     1089
    10681090    def _call_(self, x, b):
    10691091        """
    10701092        Return the action of ``b`` on ``x``.