Ticket #12397: 12397.patch

File 12397.patch, 9.2 KB (added by roed, 8 years ago)
  • sage/categories/classical_crystals.py

    # HG changeset patch
    # User David Roe <roed@math.harvard.edu>
    # Date 1327971260 28800
    # Node ID 6401865dc6c972df556c65f703b0f002ab16e524
    # Parent  2b0c676f530d297aede555b6524fe3940fdbadc1
    #12397: Change doctests to remove trailing backslashes
    
    diff --git a/sage/categories/classical_crystals.py b/sage/categories/classical_crystals.py
    a b  
    324324                sage: fb4 = lambda a,b,c,d: CrystalOfTableaux(['B',4],shape=[a+b+c+d,b+c+d,c+d,d])
    325325                sage: fd4 = lambda a,b,c,d: CrystalOfTableaux(['D',4],shape=[a+b+c+d,b+c+d,c+d,d])
    326326                sage: fd5 = lambda a,b,c,d,e: CrystalOfTableaux(['D',5],shape=[a+b+c+d+e,b+c+d+e,c+d+e,d+e,e])
    327                 sage: def fd4spinplus(a,b,c,d):\
    328                      C = CrystalOfTableaux(['D',4],shape=[a+b+c+d,b+c+d,c+d,d]);\
    329                      D = CrystalOfSpinsPlus(['D',4]);\
    330                      return TensorProductOfCrystals(C,D,generators=[[C[0],D[0]]])
    331                 sage: def fb3spin(a,b,c):\
    332                      C = CrystalOfTableaux(['B',3],shape=[a+b+c,b+c,c]);\
    333                      D = CrystalOfSpins(['B',3]);\
    334                      return TensorProductOfCrystals(C,D,generators=[[C[0],D[0]]])
     327                sage: def fd4spinplus(a,b,c,d):
     328                ...     C = CrystalOfTableaux(['D',4],shape=[a+b+c+d,b+c+d,c+d,d])
     329                ...     D = CrystalOfSpinsPlus(['D',4])
     330                ...     return TensorProductOfCrystals(C,D,generators=[[C[0],D[0]]])
     331                sage: def fb3spin(a,b,c):
     332                ...     C = CrystalOfTableaux(['B',3],shape=[a+b+c,b+c,c])
     333                ...     D = CrystalOfSpins(['B',3])
     334                ...     return TensorProductOfCrystals(C,D,generators=[[C[0],D[0]]])
    335335
    336336            TODO: choose a good panel of values for a,b,c ... both for
    337337            basic systematic tests and for conditionally run,
  • sage/coding/binary_code.pyx

    diff --git a/sage/coding/binary_code.pyx b/sage/coding/binary_code.pyx
    a b  
    8181   
    8282    EXAMPLES:
    8383        sage: from sage.coding.binary_code import weight_dist
    84         sage: M = Matrix(GF(2),[\
    85         ... [1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0],\
    86         ... [0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0],\
    87         ... [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1],\
    88         ... [0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1],\
     84        sage: M = Matrix(GF(2),[
     85        ... [1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0],
     86        ... [0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0],
     87        ... [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1],
     88        ... [0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1],
    8989        ... [0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]])
    9090        sage: weight_dist(M)
    9191        [1, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 1]
    92         sage: M = Matrix(GF(2),[\
    93         ... [1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0],\
    94         ... [0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0],\
    95         ... [0,0,0,0,0,1,0,1,0,0,0,1,1,1,1,1,1],\
     92        sage: M = Matrix(GF(2),[
     93        ... [1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0],
     94        ... [0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0],
     95        ... [0,0,0,0,0,1,0,1,0,0,0,1,1,1,1,1,1],
    9696        ... [0,0,0,1,1,0,0,0,0,1,1,0,1,1,0,1,1]])
    9797        sage: weight_dist(M)
    9898        [1, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 4, 0, 0, 0, 0, 0]
    99         sage: M=Matrix(GF(2),[\
    100         ... [1,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0,0],\
    101         ... [0,1,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0],\
    102         ... [0,0,1,0,0,1,1,1,1,0,0,1,0,0,0,0,0],\
    103         ... [0,0,0,1,0,0,1,1,1,1,0,0,1,0,0,0,0],\
    104         ... [0,0,0,0,1,0,0,1,1,1,1,0,0,1,0,0,0],\
    105         ... [0,0,0,0,0,1,0,0,1,1,1,1,0,0,1,0,0],\
    106         ... [0,0,0,0,0,0,1,0,0,1,1,1,1,0,0,1,0],\
     99        sage: M=Matrix(GF(2),[
     100        ... [1,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0,0],
     101        ... [0,1,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0],
     102        ... [0,0,1,0,0,1,1,1,1,0,0,1,0,0,0,0,0],
     103        ... [0,0,0,1,0,0,1,1,1,1,0,0,1,0,0,0,0],
     104        ... [0,0,0,0,1,0,0,1,1,1,1,0,0,1,0,0,0],
     105        ... [0,0,0,0,0,1,0,0,1,1,1,1,0,0,1,0,0],
     106        ... [0,0,0,0,0,0,1,0,0,1,1,1,1,0,0,1,0],
    107107        ... [0,0,0,0,0,0,0,1,0,0,1,1,1,1,0,0,1]])
    108108        sage: weight_dist(M)
    109109        [1, 0, 0, 0, 0, 0, 68, 0, 85, 0, 68, 0, 34, 0, 0, 0, 0, 0]
     
    30743074            sage: from sage.coding.binary_code import *
    30753075            sage: BC = BinaryCodeClassifier()
    30763076
    3077             sage: M = Matrix(GF(2),[\
    3078             ... [1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0],\
    3079             ... [0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0],\
    3080             ... [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1],\
    3081             ... [0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1],\
     3077            sage: M = Matrix(GF(2),[
     3078            ... [1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0],
     3079            ... [0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0],
     3080            ... [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1],
     3081            ... [0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1],
    30823082            ... [0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]])
    30833083            sage: B = BinaryCode(M)
    30843084            sage: gens, labeling, size, base = BC._aut_gp_and_can_label(B)
     
    30893089            sage: size
    30903090            322560
    30913091
    3092             sage: M = Matrix(GF(2),[\
    3093             ... [1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0],\
    3094             ... [0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0],\
    3095             ... [0,0,0,0,0,1,0,1,0,0,0,1,1,1,1,1,1],\
     3092            sage: M = Matrix(GF(2),[
     3093            ... [1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0],
     3094            ... [0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0],
     3095            ... [0,0,0,0,0,1,0,1,0,0,0,1,1,1,1,1,1],
    30963096            ... [0,0,0,1,1,0,0,0,0,1,1,0,1,1,0,1,1]])
    30973097            sage: B = BinaryCode(M)
    30983098            sage: gens, labeling, size, base = BC._aut_gp_and_can_label(B)
     
    31033103            sage: size
    31043104            2304
    31053105
    3106             sage: M=Matrix(GF(2),[\
    3107             ... [1,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0,0],\
    3108             ... [0,1,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0],\
    3109             ... [0,0,1,0,0,1,1,1,1,0,0,1,0,0,0,0,0],\
    3110             ... [0,0,0,1,0,0,1,1,1,1,0,0,1,0,0,0,0],\
    3111             ... [0,0,0,0,1,0,0,1,1,1,1,0,0,1,0,0,0],\
    3112             ... [0,0,0,0,0,1,0,0,1,1,1,1,0,0,1,0,0],\
    3113             ... [0,0,0,0,0,0,1,0,0,1,1,1,1,0,0,1,0],\
     3106            sage: M=Matrix(GF(2),[
     3107            ... [1,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0,0],
     3108            ... [0,1,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0],
     3109            ... [0,0,1,0,0,1,1,1,1,0,0,1,0,0,0,0,0],
     3110            ... [0,0,0,1,0,0,1,1,1,1,0,0,1,0,0,0,0],
     3111            ... [0,0,0,0,1,0,0,1,1,1,1,0,0,1,0,0,0],
     3112            ... [0,0,0,0,0,1,0,0,1,1,1,1,0,0,1,0,0],
     3113            ... [0,0,0,0,0,0,1,0,0,1,1,1,1,0,0,1,0],
    31143114            ... [0,0,0,0,0,0,0,1,0,0,1,1,1,1,0,0,1]])
    31153115            sage: B = BinaryCode(M)
    31163116            sage: gens, labeling, size, base = BC._aut_gp_and_can_label(B)
     
    31213121            sage: size
    31223122            136
    31233123
    3124             sage: M=Matrix(GF(2),[\
    3125             ... [0,1,0,1,1,1,0,0,0,1,0,0,0,1,0,0,0,1,1,1,0,1],\
    3126             ... [1,0,1,1,1,0,0,0,1,0,0,0,1,0,0,0,1,1,1,0,1,0],\
    3127             ... [0,1,1,1,0,0,0,1,0,0,1,1,0,0,0,1,1,1,0,1,0,0],\
    3128             ... [1,1,1,0,0,0,1,0,0,1,0,0,0,0,1,1,1,0,1,0,0,1],\
    3129             ... [1,1,0,0,0,1,0,0,1,0,1,0,0,1,1,1,0,1,0,0,1,0],\
    3130             ... [1,0,0,0,1,0,0,1,0,1,1,0,1,1,1,0,1,0,0,1,0,0],\
    3131             ... [0,0,0,1,0,0,1,0,1,1,1,1,1,1,0,1,0,0,1,0,0,0],\
    3132             ... [0,0,1,0,0,1,0,1,1,1,0,1,1,0,1,0,0,1,0,0,0,1],\
    3133             ... [0,1,0,0,1,0,1,1,1,0,0,1,0,1,0,0,1,0,0,0,1,1],\
    3134             ... [1,0,0,1,0,1,1,1,0,0,0,0,1,0,0,1,0,0,0,1,1,1],\
     3124            sage: M=Matrix(GF(2),[
     3125            ... [0,1,0,1,1,1,0,0,0,1,0,0,0,1,0,0,0,1,1,1,0,1],
     3126            ... [1,0,1,1,1,0,0,0,1,0,0,0,1,0,0,0,1,1,1,0,1,0],
     3127            ... [0,1,1,1,0,0,0,1,0,0,1,1,0,0,0,1,1,1,0,1,0,0],
     3128            ... [1,1,1,0,0,0,1,0,0,1,0,0,0,0,1,1,1,0,1,0,0,1],
     3129            ... [1,1,0,0,0,1,0,0,1,0,1,0,0,1,1,1,0,1,0,0,1,0],
     3130            ... [1,0,0,0,1,0,0,1,0,1,1,0,1,1,1,0,1,0,0,1,0,0],
     3131            ... [0,0,0,1,0,0,1,0,1,1,1,1,1,1,0,1,0,0,1,0,0,0],
     3132            ... [0,0,1,0,0,1,0,1,1,1,0,1,1,0,1,0,0,1,0,0,0,1],
     3133            ... [0,1,0,0,1,0,1,1,1,0,0,1,0,1,0,0,1,0,0,0,1,1],
     3134            ... [1,0,0,1,0,1,1,1,0,0,0,0,1,0,0,1,0,0,0,1,1,1],
    31353135            ... [0,0,1,0,1,1,1,0,0,0,1,1,0,0,1,0,0,0,1,1,1,0]])
    31363136            sage: B = BinaryCode(M)
    31373137            sage: gens, labeling, size, base = BC._aut_gp_and_can_label(B)
     
    31553155            sage: size
    31563156            87178291200
    31573157
    3158             sage: M = Matrix(GF(2),[\
     3158            sage: M = Matrix(GF(2),[
    31593159            ... [1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0],
    31603160            ... [0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0],
    31613161            ... [0,0,0,0,1,1,0,0,0,0,0,0,1,1,1,1,1,1],
     
    31663166            sage: BC._aut_gp_and_can_label(B)[2]
    31673167            2160
    31683168
    3169             sage: M = Matrix(GF(2),[\
     3169            sage: M = Matrix(GF(2),[
    31703170            ... [1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
    31713171            ... [0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
    31723172            ... [0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],
     
    31813181            sage: BC._aut_gp_and_can_label(B)[2]
    31823182            294912
    31833183
    3184             sage: M = Matrix(GF(2), [\
     3184            sage: M = Matrix(GF(2), [
    31853185            ... [1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
    31863186            ... [0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
    31873187            ... [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0],