Ticket #12397: 12397.patch
File 12397.patch, 9.2 KB (added by , 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 324 324 sage: fb4 = lambda a,b,c,d: CrystalOfTableaux(['B',4],shape=[a+b+c+d,b+c+d,c+d,d]) 325 325 sage: fd4 = lambda a,b,c,d: CrystalOfTableaux(['D',4],shape=[a+b+c+d,b+c+d,c+d,d]) 326 326 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]]]) 335 335 336 336 TODO: choose a good panel of values for a,b,c ... both for 337 337 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 81 81 82 82 EXAMPLES: 83 83 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], 89 89 ... [0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]]) 90 90 sage: weight_dist(M) 91 91 [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], 96 96 ... [0,0,0,1,1,0,0,0,0,1,1,0,1,1,0,1,1]]) 97 97 sage: weight_dist(M) 98 98 [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], 107 107 ... [0,0,0,0,0,0,0,1,0,0,1,1,1,1,0,0,1]]) 108 108 sage: weight_dist(M) 109 109 [1, 0, 0, 0, 0, 0, 68, 0, 85, 0, 68, 0, 34, 0, 0, 0, 0, 0] … … 3074 3074 sage: from sage.coding.binary_code import * 3075 3075 sage: BC = BinaryCodeClassifier() 3076 3076 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], 3082 3082 ... [0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]]) 3083 3083 sage: B = BinaryCode(M) 3084 3084 sage: gens, labeling, size, base = BC._aut_gp_and_can_label(B) … … 3089 3089 sage: size 3090 3090 322560 3091 3091 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], 3096 3096 ... [0,0,0,1,1,0,0,0,0,1,1,0,1,1,0,1,1]]) 3097 3097 sage: B = BinaryCode(M) 3098 3098 sage: gens, labeling, size, base = BC._aut_gp_and_can_label(B) … … 3103 3103 sage: size 3104 3104 2304 3105 3105 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], 3114 3114 ... [0,0,0,0,0,0,0,1,0,0,1,1,1,1,0,0,1]]) 3115 3115 sage: B = BinaryCode(M) 3116 3116 sage: gens, labeling, size, base = BC._aut_gp_and_can_label(B) … … 3121 3121 sage: size 3122 3122 136 3123 3123 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], 3135 3135 ... [0,0,1,0,1,1,1,0,0,0,1,1,0,0,1,0,0,0,1,1,1,0]]) 3136 3136 sage: B = BinaryCode(M) 3137 3137 sage: gens, labeling, size, base = BC._aut_gp_and_can_label(B) … … 3155 3155 sage: size 3156 3156 87178291200 3157 3157 3158 sage: M = Matrix(GF(2),[ \3158 sage: M = Matrix(GF(2),[ 3159 3159 ... [1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0], 3160 3160 ... [0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0], 3161 3161 ... [0,0,0,0,1,1,0,0,0,0,0,0,1,1,1,1,1,1], … … 3166 3166 sage: BC._aut_gp_and_can_label(B)[2] 3167 3167 2160 3168 3168 3169 sage: M = Matrix(GF(2),[ \3169 sage: M = Matrix(GF(2),[ 3170 3170 ... [1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 3171 3171 ... [0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 3172 3172 ... [0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0], … … 3181 3181 sage: BC._aut_gp_and_can_label(B)[2] 3182 3182 294912 3183 3183 3184 sage: M = Matrix(GF(2), [ \3184 sage: M = Matrix(GF(2), [ 3185 3185 ... [1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 3186 3186 ... [0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], 3187 3187 ... [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0],