1105 | | raise ValueError("invalid parameter %s"%(sumover)) |
| 1141 | raise ValueError("invalid parameter %s"%(sumover)) |
| 1142 | |
| 1143 | ################################################################################ |
| 1144 | # Similarity over rings of length two # |
| 1145 | ################################################################################ |
| 1146 | |
| 1147 | def dictionary_from_generator(gen): |
| 1148 | r""" |
| 1149 | Given a generator for a list of pairs `(c,f)` construct a dictionary whose |
| 1150 | keys are the distinct values for `c` and whose value at `c` is the sum of |
| 1151 | `f` over all pairs of the form `(c',f)` such that `c=c'`. |
| 1152 | |
| 1153 | EXAMPLES:: |
| 1154 | |
| 1155 | sage: from sage.combinat.similarity_class_type import dictionary_from_generator |
| 1156 | sage: dictionary_from_generator(((floor(x/2), x) for x in xrange(10))) |
| 1157 | {0: 1, 1: 5, 2: 9, 3: 13, 4: 17} |
| 1158 | |
| 1159 | It also works with lists:: |
| 1160 | |
| 1161 | sage: dictionary_from_generator([(floor(x/2),x) for x in range(10)]) |
| 1162 | {0: 1, 1: 5, 2: 9, 3: 13, 4: 17} |
| 1163 | |
| 1164 | .. NOTE:: |
| 1165 | |
| 1166 | Since the generator is first converted to a list, memory usage could be |
| 1167 | high. |
| 1168 | """ |
| 1169 | L = list(gen) |
| 1170 | setofkeys = list(set([item[0] for item in L])) |
| 1171 | return dict([(key, sum([entry[1] for entry in filter(lambda pair: pair[0] == key, L)])) for key in setofkeys]) |
| 1172 | |
| 1173 | def matrix_similarity_classes(n, q = None, invertible = False): |
| 1174 | r""" |
| 1175 | Return the number of matrix similarity classes over a finite field of order |
| 1176 | ``q``. |
| 1177 | |
| 1178 | TESTS:: |
| 1179 | |
| 1180 | sage: from sage.combinat.similarity_class_type import matrix_similarity_classes |
| 1181 | sage: matrix_similarity_classes(2) |
| 1182 | q^2 + q |
| 1183 | sage: matrix_similarity_classes(2, invertible = True) |
| 1184 | q^2 - 1 |
| 1185 | sage: matrix_similarity_classes(2, invertible = True, q = 4) |
| 1186 | 15 |
| 1187 | """ |
| 1188 | if q is None: |
| 1189 | q = FractionField(QQ['q']).gen() |
| 1190 | if n == 0: |
| 1191 | return 1 |
| 1192 | if invertible: |
| 1193 | return sum([q**max(la)*((1-q**(-1))**map(lambda x: x>0, la.to_exp()).count(True)) for la in Partitions(n)]) |
| 1194 | else: |
| 1195 | return sum([q**max(la) for la in Partitions(n)]) |
| 1196 | |
| 1197 | def matrix_centralizer_cardinalities(n, q = None, invertible = False): |
| 1198 | """ |
| 1199 | Generate pairs consisting of centralizer cardinalities of matrices over a |
| 1200 | finite field and their frequencies. |
| 1201 | |
| 1202 | TESTS:: |
| 1203 | |
| 1204 | sage: from sage.combinat.similarity_class_type import matrix_centralizer_cardinalities |
| 1205 | sage: list(matrix_centralizer_cardinalities(1)) |
| 1206 | [(q - 1, q)] |
| 1207 | sage: list(matrix_centralizer_cardinalities(2)) |
| 1208 | [(q^2 - 2*q + 1, 1/2*q^2 - 1/2*q), |
| 1209 | (q^2 - q, q), |
| 1210 | (q^4 - q^3 - q^2 + q, q), |
| 1211 | (q^2 - 1, 1/2*q^2 - 1/2*q)] |
| 1212 | sage: list(matrix_centralizer_cardinalities(2, invertible = True)) |
| 1213 | [(q^2 - 2*q + 1, 1/2*q^2 - 3/2*q + 1), |
| 1214 | (q^2 - q, q - 1), |
| 1215 | (q^4 - q^3 - q^2 + q, q - 1), |
| 1216 | (q^2 - 1, 1/2*q^2 - 1/2*q)] |
| 1217 | |
| 1218 | """ |
| 1219 | for tau in SimilarityClassTypes(n): |
| 1220 | yield (tau.centralizer_group_card(q = q), tau.number_of_classes(invertible = invertible, q = q)) |
| 1221 | |
| 1222 | def input_parsing(data): |
| 1223 | """ |
| 1224 | Recognize and return the intended type of ``input`` |
| 1225 | |
| 1226 | TESTS:: |
| 1227 | |
| 1228 | sage: from sage.combinat.similarity_class_type import input_parsing |
| 1229 | sage: input_parsing(Partition([2, 1])) |
| 1230 | ('par', [2, 1]) |
| 1231 | sage: input_parsing(PrimarySimilarityClassType(2, [2, 1])) |
| 1232 | ('pri', [2, [2, 1]]) |
| 1233 | sage: input_parsing(SimilarityClassType([[2, [2, 1]]])) |
| 1234 | ('sim', [[2, [2, 1]]]) |
| 1235 | sage: input_parsing([2, 1]) |
| 1236 | ('par', [2, 1]) |
| 1237 | sage: input_parsing([2, [2, 1]]) |
| 1238 | ('pri', [2, [2, 1]]) |
| 1239 | sage: input_parsing([[2, [2, 1]]]) |
| 1240 | ('sim', [[2, [2, 1]]]) |
| 1241 | """ |
| 1242 | if isinstance(data, SimilarityClassType): |
| 1243 | case = 'sim' |
| 1244 | output = data |
| 1245 | elif isinstance(data, PrimarySimilarityClassType): |
| 1246 | case = 'pri' |
| 1247 | output = data |
| 1248 | elif isinstance(data, Partition): |
| 1249 | case = 'par' |
| 1250 | output = data |
| 1251 | else: |
| 1252 | try: |
| 1253 | data = Partition(data) |
| 1254 | case = 'par' |
| 1255 | output = data |
| 1256 | except(TypeError, ValueError): |
| 1257 | try: |
| 1258 | data = SimilarityClassType(data) |
| 1259 | case = 'sim' |
| 1260 | output = data |
| 1261 | except(TypeError, ValueError): |
| 1262 | try: |
| 1263 | data = PrimarySimilarityClassType(*data) |
| 1264 | case = 'pri' |
| 1265 | output = data |
| 1266 | except(TypeError, ValueError): |
| 1267 | raise ValueError("Expected a Partition, a SimiliarityClassType or a PrimarySimilarityClassType, got a %s"%(type(data))) |
| 1268 | return case, data |
| 1269 | |
| 1270 | def ext_orbits(input, q = None, selftranspose = False): |
| 1271 | r""" |
| 1272 | Return the number of orbits in `\mathrm{Ext}^1(M, M)` for the action of |
| 1273 | `\mathrm{Aut}(M, M)`, where `M` is the `\mathbf F_q[t]`-module constructed |
| 1274 | from ``input``. |
| 1275 | |
| 1276 | TESTS:: |
| 1277 | |
| 1278 | sage: from sage.combinat.similarity_class_type import ext_orbits |
| 1279 | sage: ext_orbits([6, 1]) |
| 1280 | q^7 + q^6 + q^5 |
| 1281 | sage: ext_orbits([6, 1], selftranspose = True) |
| 1282 | q^7 + q^6 - q^5 |
| 1283 | sage: ext_orbits([6, 1, 1]) |
| 1284 | q^8 + 2*q^7 + 2*q^6 + 2*q^5 |
| 1285 | sage: ext_orbits ([6, 1, 1], selftranspose = True) |
| 1286 | q^8 + 2*q^7 |
| 1287 | sage: ext_orbits([2, 2]) |
| 1288 | q^4 + q^3 + q^2 |
| 1289 | sage: ext_orbits([2, 2], selftranspose = True) |
| 1290 | q^4 + q^3 + q^2 |
| 1291 | sage: ext_orbits([2, 2, 2]) |
| 1292 | q^6 + q^5 + 2*q^4 + q^3 + 2*q^2 |
| 1293 | sage: ext_orbits([2, 2, 2], selftranspose = True) |
| 1294 | q^6 + q^5 + 2*q^4 + q^3 |
| 1295 | sage: ext_orbits([2, 2, 2, 2]) |
| 1296 | q^8 + q^7 + 3*q^6 + 3*q^5 + 5*q^4 + 3*q^3 + 3*q^2 |
| 1297 | sage: ext_orbits([2, 2, 2, 2], selftranspose = True) |
| 1298 | q^8 + q^7 + 3*q^6 + 3*q^5 + 3*q^4 + q^3 + q^2 |
| 1299 | sage: ext_orbits([2, [6, 1]]) |
| 1300 | q^14 + q^12 + q^10 |
| 1301 | sage: ext_orbits([[2, [6, 1]]]) |
| 1302 | q^14 + q^12 + q^10 |
| 1303 | """ |
| 1304 | # Comments cite items in the paper "Similarity over rings of length two" by |
| 1305 | # Prasad, Singla, and Spallone. |
| 1306 | if q is None: |
| 1307 | q = FractionField(QQ['q']).gen() |
| 1308 | case, data = input_parsing(input) |
| 1309 | if case == 'par': |
| 1310 | la = data |
| 1311 | if la.size() == 0: |
| 1312 | return q.parent()(1) |
| 1313 | if max(la) == 1: |
| 1314 | return matrix_similarity_classes(len(la), q = q) |
| 1315 | elif len(la) == 1: |
| 1316 | return q**la.size() |
| 1317 | elif len(la) == 2 and list(la).count(1) == 1: # see Table 3 |
| 1318 | m = max(la) - 1 |
| 1319 | if selftranspose: |
| 1320 | return q**(m + 2) + q**(m + 1) - q**m |
| 1321 | else: |
| 1322 | return q**(m + 2) + q**(m + 1) + q**m |
| 1323 | elif len(la) == 3 and list(la).count(1) == 2: # see Table 4 |
| 1324 | m = max(la) - 1 |
| 1325 | if not selftranspose: |
| 1326 | return q**m*(q**3 + 2*q**2 + 2*q + 2) |
| 1327 | else: |
| 1328 | return q**m*(q**3 + 2*q**2) |
| 1329 | elif min(la) == 2 and max(la) == 2: |
| 1330 | return matrix_similarity_classes2(len(la), q = q, selftranspose = selftranspose) |
| 1331 | else: |
| 1332 | raise ValueError('partition %s not implemented for ExtOrbitClasses.orbits'%(la)) |
| 1333 | elif case == 'pri': |
| 1334 | tau = data |
| 1335 | return ext_orbits(tau.partition(), q = q, selftranspose = selftranspose).substitute(q = q**tau.degree()) |
| 1336 | elif case == 'sim': |
| 1337 | tau = data |
| 1338 | return prod([ext_orbits(PT, q = q, selftranspose = selftranspose) for PT in tau]) |
| 1339 | |
| 1340 | def matrix_similarity_classes2(n, q = None, selftranspose = False, invertible = False): |
| 1341 | """ |
| 1342 | Return the number of similarity classes of matrices of order ``n`` with |
| 1343 | entries in a principal ideal local ring of length two. |
| 1344 | |
| 1345 | EXAMPLES: |
| 1346 | |
| 1347 | We can generate Table 6 of [PSS13]_:: |
| 1348 | |
| 1349 | sage: from sage.combinat.similarity_class_type import matrix_similarity_classes2 |
| 1350 | sage: matrix_similarity_classes2(2) |
| 1351 | q^4 + q^3 + q^2 |
| 1352 | sage: matrix_similarity_classes2(2, invertible = True) |
| 1353 | q^4 - q |
| 1354 | sage: matrix_similarity_classes2(3) |
| 1355 | q^6 + q^5 + 2*q^4 + q^3 + 2*q^2 |
| 1356 | sage: matrix_similarity_classes2(3, invertible = true) |
| 1357 | q^6 - q^3 + 2*q^2 - 2*q |
| 1358 | sage: matrix_similarity_classes2(4) |
| 1359 | q^8 + q^7 + 3*q^6 + 3*q^5 + 5*q^4 + 3*q^3 + 3*q^2 |
| 1360 | sage: matrix_similarity_classes2(4, invertible = True) |
| 1361 | q^8 + q^6 - q^5 + 2*q^4 - 2*q^3 + 2*q^2 - 3*q |
| 1362 | |
| 1363 | And also Table 7:: |
| 1364 | |
| 1365 | sage: matrix_similarity_classes2(2, selftranspose = True) |
| 1366 | q^4 + q^3 + q^2 |
| 1367 | sage: matrix_similarity_classes2(2, selftranspose = True, invertible = True) |
| 1368 | q^4 - q |
| 1369 | sage: matrix_similarity_classes2(3, selftranspose = True) |
| 1370 | q^6 + q^5 + 2*q^4 + q^3 |
| 1371 | sage: matrix_similarity_classes2(3, selftranspose = True, invertible = True) |
| 1372 | q^6 - q^3 |
| 1373 | sage: matrix_similarity_classes2(4, selftranspose = True) |
| 1374 | q^8 + q^7 + 3*q^6 + 3*q^5 + 3*q^4 + q^3 + q^2 |
| 1375 | sage: matrix_similarity_classes2(4, selftranspose = True, invertible = True) |
| 1376 | q^8 + q^6 - q^5 - q |
| 1377 | """ |
| 1378 | if q is None: |
| 1379 | q = FractionField(QQ['q']).gen() |
| 1380 | return sum([tau.number_of_classes(invertible = invertible, q = q)*ext_orbits(tau, q = q, selftranspose = selftranspose) for tau in SimilarityClassTypes(n)]) |
| 1381 | |
| 1382 | def ext_orbit_centralizers(input, q = None, selftranspose = False): |
| 1383 | r""" |
| 1384 | Generate pairs consisting of centralizer cardinalities of orbits in |
| 1385 | `\mathrm{Ext}^1(M, M)` for the action of `\mathrm{Aut}(M, M)`, where `M` is |
| 1386 | the `\mathbf F_q[t]`-module constructed from ``input`` and their frequencies. |
| 1387 | |
| 1388 | TESTS:: |
| 1389 | |
| 1390 | sage: from sage.combinat.similarity_class_type import ext_orbit_centralizers |
| 1391 | sage: list(ext_orbit_centralizers([6, 1])) |
| 1392 | [(q^9 - 2*q^8 + q^7, q^6), |
| 1393 | (q^7 - 2*q^6 + q^5, q^7 - q^6), |
| 1394 | (q^7 - q^6, q^6 + q^5)] |
| 1395 | sage: list(ext_orbit_centralizers([6, 1], selftranspose = True)) |
| 1396 | [(q^9 - 2*q^8 + q^7, q^6), |
| 1397 | (q^7 - 2*q^6 + q^5, q^7 - q^6), |
| 1398 | (q^7 - q^6, q^6 - q^5)] |
| 1399 | sage: list(ext_orbit_centralizers([6, 1, 1])) |
| 1400 | [(q^12 - 3*q^11 + 3*q^10 - q^9, 1/2*q^7 - 1/2*q^6), |
| 1401 | (q^8 - 3*q^7 + 3*q^6 - q^5, 1/2*q^8 - q^7 + 1/2*q^6), |
| 1402 | (q^12 - 2*q^11 + q^10, q^6), |
| 1403 | (q^8 - 2*q^7 + q^6, q^7 - q^6), |
| 1404 | (q^14 - 2*q^13 + 2*q^11 - q^10, q^6), |
| 1405 | (q^10 - 2*q^9 + 2*q^7 - q^6, q^7 - q^6), |
| 1406 | (q^12 - q^11 - q^10 + q^9, 1/2*q^7 - 1/2*q^6), |
| 1407 | (q^8 - q^7 - q^6 + q^5, 1/2*q^8 - q^7 + 1/2*q^6), |
| 1408 | (q^8 - 2*q^7 + q^6, q^7 - q^6), |
| 1409 | (q^8 - q^7, q^6 + 2*q^5), |
| 1410 | (q^10 - 2*q^9 + q^8, 2*q^6)] |
| 1411 | sage: list(ext_orbit_centralizers([6, 1, 1], selftranspose = True)) |
| 1412 | [(q^12 - 3*q^11 + 3*q^10 - q^9, 1/2*q^7 - 1/2*q^6), |
| 1413 | (q^8 - 3*q^7 + 3*q^6 - q^5, 1/2*q^8 - q^7 + 1/2*q^6), |
| 1414 | (q^12 - 2*q^11 + q^10, q^6), |
| 1415 | (q^8 - 2*q^7 + q^6, q^7 - q^6), |
| 1416 | (q^14 - 2*q^13 + 2*q^11 - q^10, q^6), |
| 1417 | (q^10 - 2*q^9 + 2*q^7 - q^6, q^7 - q^6), |
| 1418 | (q^12 - q^11 - q^10 + q^9, 1/2*q^7 - 1/2*q^6), |
| 1419 | (q^8 - q^7 - q^6 + q^5, 1/2*q^8 - q^7 + 1/2*q^6), |
| 1420 | (q^8 - 2*q^7 + q^6, q^7 - q^6), |
| 1421 | (q^8 - q^7, q^6)] |
| 1422 | sage: list(ext_orbit_centralizers([2, [6, 1, 1]], selftranspose = True)) |
| 1423 | [(q^24 - 3*q^22 + 3*q^20 - q^18, 1/2*q^14 - 1/2*q^12), |
| 1424 | (q^16 - 3*q^14 + 3*q^12 - q^10, 1/2*q^16 - q^14 + 1/2*q^12), |
| 1425 | (q^24 - 2*q^22 + q^20, q^12), |
| 1426 | (q^16 - 2*q^14 + q^12, q^14 - q^12), |
| 1427 | (q^28 - 2*q^26 + 2*q^22 - q^20, q^12), |
| 1428 | (q^20 - 2*q^18 + 2*q^14 - q^12, q^14 - q^12), |
| 1429 | (q^24 - q^22 - q^20 + q^18, 1/2*q^14 - 1/2*q^12), |
| 1430 | (q^16 - q^14 - q^12 + q^10, 1/2*q^16 - q^14 + 1/2*q^12), |
| 1431 | (q^16 - 2*q^14 + q^12, q^14 - q^12), |
| 1432 | (q^16 - q^14, q^12)] |
| 1433 | sage: list(ext_orbit_centralizers([[2, [6, 1, 1]]], selftranspose = True)) |
| 1434 | [(q^24 - 3*q^22 + 3*q^20 - q^18, 1/2*q^14 - 1/2*q^12), |
| 1435 | (q^16 - 3*q^14 + 3*q^12 - q^10, 1/2*q^16 - q^14 + 1/2*q^12), |
| 1436 | (q^24 - 2*q^22 + q^20, q^12), |
| 1437 | (q^16 - 2*q^14 + q^12, q^14 - q^12), |
| 1438 | (q^28 - 2*q^26 + 2*q^22 - q^20, q^12), |
| 1439 | (q^20 - 2*q^18 + 2*q^14 - q^12, q^14 - q^12), |
| 1440 | (q^24 - q^22 - q^20 + q^18, 1/2*q^14 - 1/2*q^12), |
| 1441 | (q^16 - q^14 - q^12 + q^10, 1/2*q^16 - q^14 + 1/2*q^12), |
| 1442 | (q^16 - 2*q^14 + q^12, q^14 - q^12), |
| 1443 | (q^16 - q^14, q^12)] |
| 1444 | |
| 1445 | """ |
| 1446 | # Comments cite items in the paper "Similarity over rings of length two" by |
| 1447 | # Prasad, Singla, and Spallone. |
| 1448 | if q is None: |
| 1449 | q = FractionField(QQ['q']).gen() |
| 1450 | case, data = input_parsing(input) |
| 1451 | if case == 'par': |
| 1452 | la = data |
| 1453 | if len(la) == 0: |
| 1454 | yield (1, 1) |
| 1455 | return |
| 1456 | elif max(la) == 1: |
| 1457 | for item in matrix_centralizer_cardinalities(len(la), q = q): |
| 1458 | yield item |
| 1459 | return |
| 1460 | elif len(la) == 1: |
| 1461 | yield (q**la[0] - q**(la[0]-1), q**la[0]) |
| 1462 | return |
| 1463 | elif len(la) == 2 and list(la).count(1) == 1: # see Table 3 |
| 1464 | m = max(la) - 1 |
| 1465 | yield (q**(m + 4) - 2*q**(m + 3) + q**(m + 2), q**(m + 1)) # (8.5.1) |
| 1466 | yield (q**(m + 2) - 2*q**(m + 1) + q**m, q**(m + 2) - q**(m + 1)) # (8.5.2) |
| 1467 | if selftranspose: |
| 1468 | yield (q**(m + 2) - q**(m + 1), q**(m+1) - q**m) # (8.5.3) and (8.5.4) |
| 1469 | else: |
| 1470 | yield (q**(m + 2) - q**(m + 1), q**(m + 1) + q**m) # (8.5.3) and (8.5.4) |
| 1471 | return |
| 1472 | elif len(la) == 3 and list(la).count(1) == 2: # see Table 4 |
| 1473 | m = max(la) - 1 |
| 1474 | for item in matrix_centralizer_cardinalities(2, q = q): |
| 1475 | yield (item[0]*(q**(m + 5) - q**(m + 4)), item[1]*q**m) # (8.6.1) |
| 1476 | yield (item[0]*(q**(m + 1) - q**m), item[1]*(q**(m + 1) - q**m)) # (8.6.2) |
| 1477 | yield (q**(m + 3) - 2*q**(m + 2) + q**(m+1), q**(m + 2) - q**(m + 1)) # (8.6.3) |
| 1478 | if selftranspose: |
| 1479 | yield (q**(m + 3) - q**(m+2), q**(m+1)) #(8.6.4), (8.6.5) and (8.6.7) |
| 1480 | else: |
| 1481 | yield (q**(m + 3) - q**(m+2), q**(m + 1) + 2*q**m) # (8.6.4), (8.6.5) and (8.6.7) |
| 1482 | yield (q**(m + 5) - 2*q**(m + 4) + q**(m + 3), 2*q**(m + 1)) # (8.6.6) and (8.6.8) |
| 1483 | return |
| 1484 | elif max(la) == 2 and min(la) == 2: |
| 1485 | for item in matrix_centralizer_cardinalities2(len(la), q = q, selftranspose = selftranspose): |
| 1486 | yield item |
| 1487 | else: |
| 1488 | raise ValueError('partition %s not implemented for ExtOrbitClasses.orbit_centralizers'%(la)) |
| 1489 | elif case == 'pri': |
| 1490 | tau = data |
| 1491 | for item in ext_orbit_centralizers(tau.partition(), selftranspose = selftranspose): |
| 1492 | yield (item[0].substitute(q = q**tau.degree()), item[1].substitute(q = q**tau.degree())) |
| 1493 | elif case == 'sim': |
| 1494 | tau = data |
| 1495 | for item in CartesianProduct(*[IterableFunctionCall(lambda x: ext_orbit_centralizers(x, q = q, selftranspose = selftranspose), PT) for PT in tau]): |
| 1496 | size = prod([list(entry)[0] for entry in item]) |
| 1497 | freq = prod([list(entry)[1] for entry in item]) |
| 1498 | yield(size, freq) |
| 1499 | |
| 1500 | |
| 1501 | def matrix_centralizer_cardinalities2(n, q = None, selftranspose = False, invertible = False): |
| 1502 | r""" |
| 1503 | Generate pairs consisting of centralizer cardinalities of matrices over a |
| 1504 | principal ideal local ring of length two with residue field of order ``q`` |
| 1505 | and their frequencies. |
| 1506 | |
| 1507 | TESTS:: |
| 1508 | |
| 1509 | sage: from sage.combinat.similarity_class_type import matrix_centralizer_cardinalities2 |
| 1510 | sage: list(matrix_centralizer_cardinalities2(1)) |
| 1511 | [(q^2 - q, q^2)] |
| 1512 | sage: list(matrix_centralizer_cardinalities2(2)) |
| 1513 | [(q^4 - 2*q^3 + q^2, 1/2*q^4 - 1/2*q^3), |
| 1514 | (q^4 - q^3, q^3), |
| 1515 | (q^6 - 2*q^5 + q^4, 1/2*q^3 - 1/2*q^2), |
| 1516 | (q^6 - q^5, q^2), |
| 1517 | (q^8 - q^7 - q^6 + q^5, q^2), |
| 1518 | (q^6 - q^4, 1/2*q^3 - 1/2*q^2), |
| 1519 | (q^4 - q^2, 1/2*q^4 - 1/2*q^3)] |
| 1520 | sage: from sage.combinat.similarity_class_type import dictionary_from_generator |
| 1521 | sage: dictionary_from_generator(matrix_centralizer_cardinalities2(2, q = 2)) |
| 1522 | {96: 4, 32: 4, 4: 4, 16: 2, 8: 8, 12: 4, 48: 2} |
| 1523 | """ |
| 1524 | if q is None: |
| 1525 | q = FractionField(QQ['q']).gen() |
| 1526 | for tau in SimilarityClassTypes(n): |
| 1527 | for pair in ext_orbit_centralizers(tau, q = q, selftranspose = selftranspose): |
| 1528 | yield (q**tau.centralizer_algebra_dim()*pair[0], tau.number_of_classes(invertible = invertible, q = q)*pair[1]) |