passagemath-gap 10.5.43__cp310-cp310-macosx_14_0_arm64.whl → 10.6.1rc2__cp310-cp310-macosx_14_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gap/gap +0 -0
- {passagemath_gap-10.5.43.dist-info → passagemath_gap-10.6.1rc2.dist-info}/METADATA +5 -6
- {passagemath_gap-10.5.43.dist-info → passagemath_gap-10.6.1rc2.dist-info}/METADATA.bak +6 -7
- {passagemath_gap-10.5.43.dist-info → passagemath_gap-10.6.1rc2.dist-info}/RECORD +34 -34
- passagemath_gap.dylibs/libgap.9.dylib +0 -0
- sage/coding/codecan/autgroup_can_label.cpython-310-darwin.so +0 -0
- sage/coding/codecan/autgroup_can_label.pyx +34 -25
- sage/coding/codecan/codecan.cpython-310-darwin.so +0 -0
- sage/coding/codecan/codecan.pxd +2 -2
- sage/coding/codecan/codecan.pyx +25 -18
- sage/combinat/enumeration_mod_permgroup.cpython-310-darwin.so +0 -0
- sage/combinat/enumeration_mod_permgroup.pyx +3 -3
- sage/combinat/root_system/reflection_group_c.cpython-310-darwin.so +0 -0
- sage/combinat/root_system/reflection_group_complex.py +11 -12
- sage/combinat/root_system/reflection_group_element.cpython-310-darwin.so +0 -0
- sage/combinat/root_system/weyl_group.py +2 -2
- sage/groups/class_function.py +0 -1
- sage/groups/libgap_wrapper.cpython-310-darwin.so +0 -0
- sage/groups/libgap_wrapper.pyx +1 -1
- sage/groups/matrix_gps/binary_dihedral.py +1 -1
- sage/groups/matrix_gps/group_element_gap.cpython-310-darwin.so +0 -0
- sage/groups/perm_gps/partn_ref2/refinement_generic.cpython-310-darwin.so +0 -0
- sage/groups/perm_gps/permgroup.py +17 -48
- sage/groups/perm_gps/permgroup_element.cpython-310-darwin.so +0 -0
- sage/groups/perm_gps/permgroup_element.pyx +25 -9
- sage/interfaces/gap.py +12 -3
- sage/libs/gap/element.cpython-310-darwin.so +0 -0
- sage/libs/gap/gap_includes.pxd +1 -1
- sage/libs/gap/libgap.cpython-310-darwin.so +0 -0
- sage/libs/gap/util.cpython-310-darwin.so +0 -0
- sage/matrix/matrix_gap.cpython-310-darwin.so +0 -0
- sage/rings/species.py +116 -60
- {passagemath_gap-10.5.43.dist-info → passagemath_gap-10.6.1rc2.dist-info}/WHEEL +0 -0
- {passagemath_gap-10.5.43.dist-info → passagemath_gap-10.6.1rc2.dist-info}/top_level.txt +0 -0
@@ -83,7 +83,7 @@ class BinaryDihedralGroup(UniqueRepresentation, FinitelyGeneratedMatrixGroup_gap
|
|
83
83
|
|
84
84
|
MS = MatrixSpace(R, 2)
|
85
85
|
zero = R.zero()
|
86
|
-
gens = [
|
86
|
+
gens = [MS([zeta, zero, zero, ~zeta]), MS([zero, i, i, zero])]
|
87
87
|
|
88
88
|
from sage.libs.gap.libgap import libgap
|
89
89
|
gap_gens = [libgap(matrix_gen) for matrix_gen in gens]
|
Binary file
|
Binary file
|
@@ -383,13 +383,12 @@ def PermutationGroup(gens=None, *args, **kwds):
|
|
383
383
|
...
|
384
384
|
TypeError: gens must be a tuple, list, or GapElement
|
385
385
|
|
386
|
-
This
|
386
|
+
This now raises an error (:issue:`31510`)::
|
387
387
|
|
388
388
|
sage: G = PermutationGroup([(1,2,3,4)], [(1,7,3,5)])
|
389
|
-
|
389
|
+
Traceback (most recent call last):
|
390
390
|
...
|
391
|
-
|
392
|
-
See https://github.com/sagemath/sage/issues/31510 for details.
|
391
|
+
ValueError: please use keywords gap_group=, domain=, canonicalize=, category= in the input
|
393
392
|
"""
|
394
393
|
if not isinstance(gens, ExpectElement) and hasattr(gens, '_permgroup_'):
|
395
394
|
return gens._permgroup_()
|
@@ -405,18 +404,7 @@ def PermutationGroup(gens=None, *args, **kwds):
|
|
405
404
|
raise ValueError("you must specify the domain for an action")
|
406
405
|
return PermutationGroup_action(gens, action, domain, gap_group=gap_group)
|
407
406
|
if args:
|
408
|
-
|
409
|
-
deprecation(31510, "gap_group, domain, canonicalize, category will become keyword only")
|
410
|
-
if len(args) > 4:
|
411
|
-
raise ValueError("invalid input")
|
412
|
-
args = list(args)
|
413
|
-
gap_group = args.pop(0)
|
414
|
-
if args:
|
415
|
-
domain = args.pop(0)
|
416
|
-
if args:
|
417
|
-
canonicalize = args.pop(0)
|
418
|
-
if args:
|
419
|
-
category = args.pop(0)
|
407
|
+
raise ValueError("please use keywords gap_group=, domain=, canonicalize=, category= in the input")
|
420
408
|
return PermutationGroup_generic(gens=gens, gap_group=gap_group, domain=domain,
|
421
409
|
canonicalize=canonicalize, category=category)
|
422
410
|
|
@@ -1073,7 +1061,7 @@ class PermutationGroup_generic(FiniteGroup):
|
|
1073
1061
|
"""
|
1074
1062
|
return list(self)
|
1075
1063
|
|
1076
|
-
def __contains__(self, item):
|
1064
|
+
def __contains__(self, item) -> bool:
|
1077
1065
|
"""
|
1078
1066
|
Return whether ``item`` is an element of this group.
|
1079
1067
|
|
@@ -1110,33 +1098,6 @@ class PermutationGroup_generic(FiniteGroup):
|
|
1110
1098
|
return False
|
1111
1099
|
return True
|
1112
1100
|
|
1113
|
-
def has_element(self, item):
|
1114
|
-
"""
|
1115
|
-
Return whether ``item`` is an element of this group -
|
1116
|
-
however *ignores* parentage.
|
1117
|
-
|
1118
|
-
EXAMPLES::
|
1119
|
-
|
1120
|
-
sage: G = CyclicPermutationGroup(4)
|
1121
|
-
sage: gens = G.gens()
|
1122
|
-
sage: H = DihedralGroup(4)
|
1123
|
-
sage: g = G([(1,2,3,4)]); g
|
1124
|
-
(1,2,3,4)
|
1125
|
-
sage: G.has_element(g)
|
1126
|
-
doctest:warning
|
1127
|
-
...
|
1128
|
-
DeprecationWarning: G.has_element(g) is deprecated; use :meth:`__contains__`, i.e., `g in G` instead
|
1129
|
-
See https://github.com/sagemath/sage/issues/33831 for details.
|
1130
|
-
True
|
1131
|
-
sage: h = H([(1,2),(3,4)]); h
|
1132
|
-
(1,2)(3,4)
|
1133
|
-
sage: G.has_element(h)
|
1134
|
-
False
|
1135
|
-
"""
|
1136
|
-
from sage.misc.superseded import deprecation
|
1137
|
-
deprecation(33831, "G.has_element(g) is deprecated; use :meth:`__contains__`, i.e., `g in G` instead")
|
1138
|
-
return item in self
|
1139
|
-
|
1140
1101
|
def __iter__(self):
|
1141
1102
|
r"""
|
1142
1103
|
Return an iterator going through all elements in ``self``.
|
@@ -1166,9 +1127,9 @@ class PermutationGroup_generic(FiniteGroup):
|
|
1166
1127
|
"""
|
1167
1128
|
if len(self._gens) == 1:
|
1168
1129
|
return self._iteration_monogen()
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1130
|
+
|
1131
|
+
# TODO: this is too slow for moderately small permutation groups
|
1132
|
+
return self.iteration(algorithm='SGS')
|
1172
1133
|
|
1173
1134
|
def _iteration_monogen(self):
|
1174
1135
|
r"""
|
@@ -3357,9 +3318,17 @@ class PermutationGroup_generic(FiniteGroup):
|
|
3357
3318
|
Traceback (most recent call last):
|
3358
3319
|
...
|
3359
3320
|
TypeError: junk is not a permutation group
|
3321
|
+
|
3322
|
+
TESTS:
|
3323
|
+
|
3324
|
+
Verify that :issue`39416` is fixed::
|
3325
|
+
|
3326
|
+
sage: G = PermutationGroup(gens=[(1,2), (2,4)], domain={1, 2, 4})
|
3327
|
+
sage: G.commutator()
|
3328
|
+
Permutation Group with generators [(1,2,4)]
|
3360
3329
|
"""
|
3361
3330
|
if other is None:
|
3362
|
-
return PermutationGroup(gap_group=libgap.DerivedSubgroup(self))
|
3331
|
+
return PermutationGroup(gap_group=libgap.DerivedSubgroup(self), domain=self.domain())
|
3363
3332
|
else:
|
3364
3333
|
from sage.categories.finite_permutation_groups import FinitePermutationGroups
|
3365
3334
|
if other not in FinitePermutationGroups():
|
Binary file
|
@@ -136,8 +136,8 @@ import sage.interfaces.abc
|
|
136
136
|
|
137
137
|
from sage.libs.gap.libgap import libgap
|
138
138
|
from sage.libs.gap.gap_includes cimport (UInt, UInt2, UInt4, T_PERM2, T_PERM4,
|
139
|
-
NEW_PERM2, TNUM_OBJ, DEG_PERM2, DEG_PERM4, CONST_ADDR_PERM2,
|
140
|
-
CONST_ADDR_PERM4, ADDR_PERM2)
|
139
|
+
NEW_PERM2, NEW_PERM4, TNUM_OBJ, DEG_PERM2, DEG_PERM4, CONST_ADDR_PERM2,
|
140
|
+
CONST_ADDR_PERM4, ADDR_PERM2, ADDR_PERM4)
|
141
141
|
from sage.libs.gap.util cimport initialize
|
142
142
|
from sage.libs.gap.element cimport (GapElement, GapElement_List,
|
143
143
|
GapElement_String, GapElement_Permutation, make_GapElement_Permutation)
|
@@ -566,7 +566,7 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement):
|
|
566
566
|
('b','c')
|
567
567
|
"""
|
568
568
|
cdef int i, j, vn = len(v)
|
569
|
-
assert
|
569
|
+
assert vn <= self.n
|
570
570
|
if convert:
|
571
571
|
convert_dict = self._parent._domain_to_gap
|
572
572
|
for i in range(len(v)):
|
@@ -891,16 +891,32 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement):
|
|
891
891
|
sage: p = SymmetricGroup(0).an_element()
|
892
892
|
sage: p._libgap_()
|
893
893
|
()
|
894
|
+
|
895
|
+
A minimal test that we handle permutations of degree larger than 2^16 :issue:`39998`::
|
896
|
+
|
897
|
+
sage: SymmetricGroup(2**16+1)((2**16,2**16+1))._libgap_() # long time (100 mb)
|
898
|
+
(65536,65537)
|
894
899
|
"""
|
895
900
|
if self._libgap is not None:
|
896
901
|
return self._libgap
|
897
902
|
initialize()
|
898
903
|
|
899
|
-
cdef Obj res = NEW_PERM2(self.n)
|
900
|
-
cdef UInt2* p = ADDR_PERM2(res)
|
901
904
|
cdef UInt i
|
902
|
-
|
903
|
-
|
905
|
+
cdef Obj res
|
906
|
+
cdef UInt2* p2
|
907
|
+
cdef UInt4* p4
|
908
|
+
if self.n < 1<<16:
|
909
|
+
# make a new (small) permutation
|
910
|
+
res = NEW_PERM2(self.n)
|
911
|
+
p2 = ADDR_PERM2(res)
|
912
|
+
for i in range(self.n):
|
913
|
+
p2[i] = self.perm[i]
|
914
|
+
else:
|
915
|
+
# make a new (large) permutation
|
916
|
+
res = NEW_PERM4(self.n)
|
917
|
+
p4 = ADDR_PERM4(res)
|
918
|
+
for i in range(self.n):
|
919
|
+
p4[i] = self.perm[i]
|
904
920
|
self._libgap = make_GapElement_Permutation(libgap, res)
|
905
921
|
return self._libgap
|
906
922
|
|
@@ -1911,7 +1927,7 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement):
|
|
1911
1927
|
from sage.combinat.partition import _Partitions
|
1912
1928
|
return _Partitions(cycle_type)
|
1913
1929
|
|
1914
|
-
def has_descent(self, i, side='right', positive=False):
|
1930
|
+
def has_descent(self, i, side='right', positive=False) -> bool:
|
1915
1931
|
r"""
|
1916
1932
|
Return whether ``self`` has a left (resp. right) descent at
|
1917
1933
|
position ``i``. If ``positive`` is ``True``, then test for a non
|
@@ -2116,7 +2132,7 @@ cdef class SymmetricGroupElement(PermutationGroupElement):
|
|
2116
2132
|
from sage.combinat.permutation import Permutation
|
2117
2133
|
return Permutation(self).absolute_length()
|
2118
2134
|
|
2119
|
-
def has_left_descent(self, i):
|
2135
|
+
def has_left_descent(self, i) -> bool:
|
2120
2136
|
r"""
|
2121
2137
|
Return whether `i` is a left descent of ``self``.
|
2122
2138
|
|
sage/interfaces/gap.py
CHANGED
@@ -681,6 +681,15 @@ class Gap_generic(ExtraTabCompletion, Expect):
|
|
681
681
|
Restarting Gap and trying again
|
682
682
|
sage: a
|
683
683
|
3
|
684
|
+
|
685
|
+
Checks for :issue:`39906`::
|
686
|
+
|
687
|
+
sage: gap("a"*200)
|
688
|
+
Traceback (most recent call last):
|
689
|
+
...
|
690
|
+
TypeError: Gap terminated unexpectedly while reading in a large line:
|
691
|
+
Gap produced error output
|
692
|
+
Error, Variable: 'aaaa...aaaa' must have a value executing Read("...");
|
684
693
|
"""
|
685
694
|
expect_eof = self._quit_string() in line
|
686
695
|
|
@@ -739,7 +748,7 @@ class Gap_generic(ExtraTabCompletion, Expect):
|
|
739
748
|
else:
|
740
749
|
return ''
|
741
750
|
else:
|
742
|
-
raise
|
751
|
+
raise exc
|
743
752
|
|
744
753
|
except KeyboardInterrupt:
|
745
754
|
self._keyboard_interrupt()
|
@@ -952,7 +961,7 @@ class GapElement_generic(ModuleElement, ExtraTabCompletion, ExpectElement):
|
|
952
961
|
2
|
953
962
|
"""
|
954
963
|
# This is just a copy of ExpectElement._add_ to fix the fact
|
955
|
-
# that the
|
964
|
+
# that the abstract method ModuleElement._add_ comes first in
|
956
965
|
# the MRO.
|
957
966
|
return self._operation("+", other)
|
958
967
|
|
@@ -1083,7 +1092,7 @@ class Gap(Gap_generic):
|
|
1083
1092
|
# -p: enable "package output mode"; this confusingly named option
|
1084
1093
|
# causes GAP to output special control characters that are normally
|
1085
1094
|
# intended for communication with a window manager (i.e. for xgap)
|
1086
|
-
# but that we also use to control GAP with
|
1095
|
+
# but that we also use to control GAP with pexpect
|
1087
1096
|
# -T: disable interactive break loop when encountering errors
|
1088
1097
|
# -E: disable readline support
|
1089
1098
|
cmd += " -b -p -T -E"
|
Binary file
|
sage/libs/gap/gap_includes.pxd
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# sage_setup: distribution = sagemath-gap
|
2
|
-
# distutils: libraries = gap gmp
|
2
|
+
# distutils: libraries = gap gmp M_LIBRARIES
|
3
3
|
###############################################################################
|
4
4
|
# Copyright (C) 2009, William Stein <wstein@gmail.com>
|
5
5
|
# Copyright (C) 2012, Volker Braun <vbraun.name@gmail.com>
|
Binary file
|
Binary file
|
Binary file
|
sage/rings/species.py
CHANGED
@@ -35,6 +35,7 @@ AUTHORS:
|
|
35
35
|
|
36
36
|
from itertools import accumulate, chain, product
|
37
37
|
|
38
|
+
from sage.arith.misc import divisors
|
38
39
|
from sage.categories.graded_algebras_with_basis import GradedAlgebrasWithBasis
|
39
40
|
from sage.categories.modules import Modules
|
40
41
|
from sage.categories.monoids import Monoids
|
@@ -43,15 +44,17 @@ from sage.categories.sets_with_grading import SetsWithGrading
|
|
43
44
|
from sage.categories.tensor import tensor
|
44
45
|
from sage.combinat.free_module import CombinatorialFreeModule
|
45
46
|
from sage.combinat.integer_vector import IntegerVectors
|
47
|
+
from sage.combinat.integer_vector_weighted import WeightedIntegerVectors
|
46
48
|
from sage.combinat.partition import Partitions, _Partitions
|
47
49
|
from sage.groups.perm_gps.constructor import PermutationGroupElement
|
48
50
|
from sage.groups.perm_gps.permgroup import PermutationGroup, PermutationGroup_generic
|
49
51
|
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
|
50
52
|
from sage.libs.gap.libgap import libgap
|
51
|
-
from sage.misc.cachefunc import cached_method
|
53
|
+
from sage.misc.cachefunc import cached_method, cached_function
|
52
54
|
from sage.misc.fast_methods import WithEqualityById
|
53
55
|
from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass
|
54
56
|
from sage.misc.lazy_import import lazy_import
|
57
|
+
from sage.misc.misc_c import prod
|
55
58
|
from sage.modules.free_module_element import vector
|
56
59
|
from sage.monoids.indexed_free_monoid import (IndexedFreeAbelianMonoid,
|
57
60
|
IndexedFreeAbelianMonoidElement)
|
@@ -301,13 +304,13 @@ class AtomicSpeciesElement(WithEqualityById,
|
|
301
304
|
sage: len(P.cover_relations())
|
302
305
|
7
|
303
306
|
sage: sorted(P.cover_relations(), key=str)
|
304
|
-
[[C_4,
|
307
|
+
[[C_4, E_2(X^2)],
|
308
|
+
[E_2(E_2), C_4],
|
309
|
+
[E_2(E_2), Pb_4],
|
310
|
+
[E_4, E_2(E_2)],
|
305
311
|
[E_4, Eo_4],
|
306
|
-
[E_4, P_4],
|
307
312
|
[Eo_4, Pb_4],
|
308
|
-
[
|
309
|
-
[P_4, Pb_4],
|
310
|
-
[Pb_4, {((1,2)(3,4),)}]]
|
313
|
+
[Pb_4, E_2(X^2)]]
|
311
314
|
|
312
315
|
TESTS::
|
313
316
|
|
@@ -454,7 +457,7 @@ class AtomicSpecies(UniqueRepresentation, Parent):
|
|
454
457
|
|
455
458
|
sage: G = PermutationGroup([[(1,3),(5,7)]], domain=[1,3,5,7])
|
456
459
|
sage: A(G, ([1,3], [5,7]))
|
457
|
-
|
460
|
+
E_2(X*Y)
|
458
461
|
|
459
462
|
Test that errors are raised on some possible misuses::
|
460
463
|
|
@@ -520,9 +523,9 @@ class AtomicSpecies(UniqueRepresentation, Parent):
|
|
520
523
|
else:
|
521
524
|
raise ValueError("the assignment of sorts to the domain elements must be provided")
|
522
525
|
elif not isinstance(pi, dict):
|
523
|
-
pi =
|
526
|
+
pi = dict(enumerate(pi))
|
524
527
|
if check:
|
525
|
-
if not set(pi
|
528
|
+
if not set(pi).issubset(range(self._arity)):
|
526
529
|
raise ValueError(f"keys of pi (={pi.keys()}) must be in range({self._arity})")
|
527
530
|
if (sum(len(p) for p in pi.values()) != len(G.domain())
|
528
531
|
or set(chain.from_iterable(pi.values())) != set(G.domain())):
|
@@ -535,7 +538,7 @@ class AtomicSpecies(UniqueRepresentation, Parent):
|
|
535
538
|
|
536
539
|
def _rename(self, n):
|
537
540
|
r"""
|
538
|
-
|
541
|
+
Give common species of degree `n` their traditional names.
|
539
542
|
|
540
543
|
EXAMPLES::
|
541
544
|
|
@@ -550,9 +553,9 @@ class AtomicSpecies(UniqueRepresentation, Parent):
|
|
550
553
|
sage: A(CyclicPermutationGroup(4), {1: range(1, 5)})
|
551
554
|
C_4(Y)
|
552
555
|
sage: A(DihedralGroup(4), {0: range(1, 5)})
|
553
|
-
|
556
|
+
E_2(E_2(X))
|
554
557
|
sage: A(DihedralGroup(4), {1: range(1, 5)})
|
555
|
-
|
558
|
+
E_2(E_2(Y))
|
556
559
|
sage: A(AlternatingGroup(4), {0: range(1, 5)})
|
557
560
|
Eo_4(X)
|
558
561
|
sage: A(AlternatingGroup(4), {1: range(1, 5)})
|
@@ -593,6 +596,8 @@ class AtomicSpecies(UniqueRepresentation, Parent):
|
|
593
596
|
[(i, i+1) for i in range(1, n, 2)]]
|
594
597
|
self(PermutationGroup(gens), pi, check=False).rename(f"Pb_{n}" + sort)
|
595
598
|
|
599
|
+
_atomic_set_like_species(n, self._names)
|
600
|
+
|
596
601
|
def __contains__(self, x):
|
597
602
|
r"""
|
598
603
|
Return whether ``x`` is in ``self``.
|
@@ -641,7 +646,7 @@ class AtomicSpecies(UniqueRepresentation, Parent):
|
|
641
646
|
G, pi = x
|
642
647
|
if not isinstance(G, PermutationGroup_generic):
|
643
648
|
return False
|
644
|
-
if not set(pi
|
649
|
+
if not set(pi).issubset(range(self._arity)):
|
645
650
|
return False
|
646
651
|
if (sum(len(p) for p in pi.values()) != len(G.domain())
|
647
652
|
or set(chain.from_iterable(pi.values())) != set(G.domain())):
|
@@ -721,11 +726,7 @@ class AtomicSpecies(UniqueRepresentation, Parent):
|
|
721
726
|
|
722
727
|
sage: A = AtomicSpecies("X, Y")
|
723
728
|
sage: a = A.an_element(); a
|
724
|
-
|
725
|
-
|
726
|
-
sage: a.rename("E_2(XY)")
|
727
|
-
sage: a
|
728
|
-
E_2(XY)
|
729
|
+
E_2(X*Y)
|
729
730
|
"""
|
730
731
|
G = PermutationGroup([[(2 * s + 1, 2 * s + 2) for s in range(self._arity)]])
|
731
732
|
m = {s: [2 * s + 1, 2 * s + 2] for s in range(self._arity)}
|
@@ -849,7 +850,7 @@ class MolecularSpecies(IndexedFreeAbelianMonoid):
|
|
849
850
|
sage: M = MolecularSpecies("X,Y")
|
850
851
|
sage: G = PermutationGroup([[(1,2),(3,4)], [(5,6)]])
|
851
852
|
sage: M(G, {0: [5,6], 1: [1,2,3,4]})
|
852
|
-
E_2(X)*
|
853
|
+
E_2(X)*E_2(Y^2)
|
853
854
|
"""
|
854
855
|
@staticmethod
|
855
856
|
def __classcall__(cls, names):
|
@@ -944,11 +945,11 @@ class MolecularSpecies(IndexedFreeAbelianMonoid):
|
|
944
945
|
sage: a = lambda g, x: SetPartition([[g(e) for e in b] for b in x])
|
945
946
|
sage: X = SetPartitions(4, [2, 2])
|
946
947
|
sage: M((X, a, 'left'), {0: X.base_set()})
|
947
|
-
|
948
|
+
E_2(E_2)
|
948
949
|
|
949
950
|
sage: X = SetPartitions(8, [4, 2, 2])
|
950
951
|
sage: M((X, a, 'left'), {0: X.base_set()}, check=False)
|
951
|
-
E_4*
|
952
|
+
E_4*E_2(E_2)
|
952
953
|
|
953
954
|
TESTS::
|
954
955
|
|
@@ -960,7 +961,7 @@ class MolecularSpecies(IndexedFreeAbelianMonoid):
|
|
960
961
|
|
961
962
|
sage: G = PermutationGroup([[(2,3),(4,5)]], domain=[2,3,4,5])
|
962
963
|
sage: M(G, {0: [2, 3], 1: [4, 5]})
|
963
|
-
E_2(
|
964
|
+
E_2(X*Y)
|
964
965
|
|
965
966
|
sage: X = SetPartitions(4, 2)
|
966
967
|
sage: a = lambda g, x: SetPartition([[g(e) for e in b] for b in x])
|
@@ -971,7 +972,7 @@ class MolecularSpecies(IndexedFreeAbelianMonoid):
|
|
971
972
|
|
972
973
|
sage: G = PermutationGroup([[(1,3),(5,7)]], domain=[1,3,5,7])
|
973
974
|
sage: M(G, ([1,3], [5,7]))
|
974
|
-
E_2(
|
975
|
+
E_2(X*Y)
|
975
976
|
|
976
977
|
sage: G = PermutationGroup([[(1,2), (3,4,5,6)]])
|
977
978
|
sage: a = M(G, {0:[1,2], 1:[3,4,5,6]})
|
@@ -1036,7 +1037,7 @@ class MolecularSpecies(IndexedFreeAbelianMonoid):
|
|
1036
1037
|
else:
|
1037
1038
|
raise ValueError("the assignment of sorts to the domain elements must be provided")
|
1038
1039
|
elif not isinstance(pi, dict):
|
1039
|
-
pi =
|
1040
|
+
pi = dict(enumerate(pi))
|
1040
1041
|
domain = [e for p in pi.values() for e in p]
|
1041
1042
|
if check and len(domain) != len(set(domain)) or set(G.domain()) != set(domain):
|
1042
1043
|
raise ValueError(f"values of pi (={pi.values()}) must partition the domain of G (={G.domain()})")
|
@@ -1180,23 +1181,23 @@ class MolecularSpecies(IndexedFreeAbelianMonoid):
|
|
1180
1181
|
sage: len(P.cover_relations())
|
1181
1182
|
17
|
1182
1183
|
sage: sorted(P.cover_relations(), key=str)
|
1183
|
-
[[C_4,
|
1184
|
+
[[C_4, E_2(X^2)],
|
1185
|
+
[E_2(E_2), C_4],
|
1186
|
+
[E_2(E_2), E_2^2],
|
1187
|
+
[E_2(E_2), Pb_4],
|
1188
|
+
[E_2(X^2), X^4],
|
1189
|
+
[E_2^2, E_2(X^2)],
|
1184
1190
|
[E_2^2, X^2*E_2],
|
1185
|
-
[
|
1191
|
+
[E_4, E_2(E_2)],
|
1186
1192
|
[E_4, Eo_4],
|
1187
|
-
[E_4, P_4],
|
1188
1193
|
[E_4, X*E_3],
|
1189
1194
|
[Eo_4, Pb_4],
|
1190
1195
|
[Eo_4, X*C_3],
|
1191
|
-
[
|
1192
|
-
[P_4, E_2^2],
|
1193
|
-
[P_4, Pb_4],
|
1194
|
-
[Pb_4, {((1,2)(3,4),)}],
|
1196
|
+
[Pb_4, E_2(X^2)],
|
1195
1197
|
[X*C_3, X^4],
|
1196
1198
|
[X*E_3, X*C_3],
|
1197
1199
|
[X*E_3, X^2*E_2],
|
1198
|
-
[X^2*E_2, X^4]
|
1199
|
-
[{((1,2)(3,4),)}, X^4]]
|
1200
|
+
[X^2*E_2, X^4]]
|
1200
1201
|
|
1201
1202
|
TESTS::
|
1202
1203
|
|
@@ -1253,7 +1254,7 @@ class MolecularSpecies(IndexedFreeAbelianMonoid):
|
|
1253
1254
|
sage: M = MolecularSpecies("X,Y")
|
1254
1255
|
sage: G = PermutationGroup([[(1,2),(3,4)], [(5,6)]])
|
1255
1256
|
sage: A = M(G, {0: [5,6], 1: [1,2,3,4]}); A
|
1256
|
-
E_2(X)*
|
1257
|
+
E_2(X)*E_2(Y^2)
|
1257
1258
|
sage: A.permutation_group()
|
1258
1259
|
(Permutation Group with generators [(3,4)(5,6), (1,2)],
|
1259
1260
|
(frozenset({1, 2}), frozenset({3, 4, 5, 6})))
|
@@ -1278,7 +1279,7 @@ class MolecularSpecies(IndexedFreeAbelianMonoid):
|
|
1278
1279
|
sage: G = PermutationGroup([[(1,2),(3,4)], [(5,6)]])
|
1279
1280
|
sage: A = M(G, {0: [5,6], 1: [1,2,3,4]})
|
1280
1281
|
sage: A * B
|
1281
|
-
E_2(X)*C_3(X)*
|
1282
|
+
E_2(X)*C_3(X)*E_2(Y^2)
|
1282
1283
|
sage: (A*B).permutation_group()
|
1283
1284
|
(Permutation Group with generators [(6,7)(8,9), (3,4,5), (1,2)],
|
1284
1285
|
(frozenset({1, 2, 3, 4, 5}), frozenset({6, 7, 8, 9})))
|
@@ -1443,7 +1444,7 @@ class MolecularSpecies(IndexedFreeAbelianMonoid):
|
|
1443
1444
|
sage: X(E2)
|
1444
1445
|
E_2
|
1445
1446
|
sage: E2(E2)
|
1446
|
-
|
1447
|
+
E_2(E_2)
|
1447
1448
|
|
1448
1449
|
sage: M = MolecularSpecies(["X","Y"])
|
1449
1450
|
sage: X = M(SymmetricGroup(1), {0: [1]})
|
@@ -1641,22 +1642,22 @@ class PolynomialSpeciesElement(CombinatorialFreeModule.Element):
|
|
1641
1642
|
sage: P = PolynomialSpecies(QQ, "X")
|
1642
1643
|
sage: sortkey = lambda x: (len(x[1]), sum(x[1].coefficients()), str(x[0]))
|
1643
1644
|
sage: n=4; table(sorted([(m, P.monomial(m).tilde()) for m in M.subset(n)], key=sortkey))
|
1644
|
-
X^4
|
1645
|
-
X^2*E_2
|
1646
|
-
|
1647
|
-
X*C_3
|
1648
|
-
C_4
|
1649
|
-
E_2^2
|
1650
|
-
Pb_4
|
1651
|
-
X*E_3
|
1652
|
-
Eo_4
|
1653
|
-
|
1654
|
-
E_4
|
1645
|
+
X^4 X^4
|
1646
|
+
E_2(X^2) 2*E_2(X^2)
|
1647
|
+
X^2*E_2 2*X^2*E_2
|
1648
|
+
X*C_3 3*X*C_3
|
1649
|
+
C_4 4*C_4
|
1650
|
+
E_2^2 4*E_2^2
|
1651
|
+
Pb_4 4*Pb_4
|
1652
|
+
X*E_3 X*E_3 + X^2*E_2 + X*C_3
|
1653
|
+
Eo_4 Eo_4 + 2*X*C_3 + Pb_4
|
1654
|
+
E_2(E_2) 2*E_2(E_2) + E_2^2 + Pb_4 + C_4
|
1655
|
+
E_4 E_4 + E_2^2 + X*C_3 + E_2(E_2) + C_4
|
1655
1656
|
|
1656
1657
|
sage: P.<X,Y> = PolynomialSpecies(QQ)
|
1657
1658
|
sage: E2 = PolynomialSpecies(QQ, "X")(SymmetricGroup(2))
|
1658
1659
|
sage: E2(X*Y).tilde()
|
1659
|
-
2*E_2(
|
1660
|
+
2*E_2(X*Y)
|
1660
1661
|
"""
|
1661
1662
|
P = self.parent()
|
1662
1663
|
M = P._indices
|
@@ -1780,7 +1781,7 @@ class PolynomialSpeciesElement(CombinatorialFreeModule.Element):
|
|
1780
1781
|
sage: P = PolynomialSpecies(ZZ, "X")
|
1781
1782
|
sage: C4 = P(CyclicPermutationGroup(4))
|
1782
1783
|
sage: C4._compose_with_singletons("X, Y", [[2, 2]])
|
1783
|
-
E_2(
|
1784
|
+
E_2(X*Y) + X^2*Y^2
|
1784
1785
|
|
1785
1786
|
sage: P = PolynomialSpecies(ZZ, ["X", "Y"])
|
1786
1787
|
sage: F = P(PermutationGroup([[(1,2,3), (4,5,6)]]), {0: [1,2,3], 1: [4,5,6]})
|
@@ -1868,12 +1869,12 @@ class PolynomialSpeciesElement(CombinatorialFreeModule.Element):
|
|
1868
1869
|
|
1869
1870
|
sage: C4 = P(CyclicPermutationGroup(4))
|
1870
1871
|
sage: C4._compose_with_weighted_singletons(["X"], [-1], [[4]])
|
1871
|
-
-C_4 +
|
1872
|
+
-C_4 + E_2(X^2)
|
1872
1873
|
|
1873
1874
|
Exercise (2.5.17) in [BLL1998]_::
|
1874
1875
|
|
1875
1876
|
sage: C4._compose_with_weighted_singletons(["X", "Y"], [1, 1], [[2, 2]])
|
1876
|
-
E_2(
|
1877
|
+
E_2(X*Y) + X^2*Y^2
|
1877
1878
|
sage: C4._compose_with_weighted_singletons(["X", "Y"], [1, 1], [[3, 1]])
|
1878
1879
|
X^3*Y
|
1879
1880
|
sage: C4._compose_with_weighted_singletons(["X", "Y"], [1, 1], [[4, 0]])
|
@@ -1882,7 +1883,7 @@ class PolynomialSpeciesElement(CombinatorialFreeModule.Element):
|
|
1882
1883
|
Equation (4.60) in [ALL2002]_::
|
1883
1884
|
|
1884
1885
|
sage: C4._compose_with_weighted_singletons(["X", "Y"], [1, -1], [[2, 2]])
|
1885
|
-
-E_2(
|
1886
|
+
-E_2(X*Y) + 2*X^2*Y^2
|
1886
1887
|
|
1887
1888
|
A bivariate example::
|
1888
1889
|
|
@@ -1898,7 +1899,7 @@ class PolynomialSpeciesElement(CombinatorialFreeModule.Element):
|
|
1898
1899
|
TESTS::
|
1899
1900
|
|
1900
1901
|
sage: (C4+E2^2)._compose_with_weighted_singletons(["X"], [-1], [[4]])
|
1901
|
-
-C_4 + E_2^2 +
|
1902
|
+
-C_4 + E_2^2 + E_2(X^2) - 2*X^2*E_2 + X^4
|
1902
1903
|
|
1903
1904
|
sage: C4._compose_with_weighted_singletons(["X"], [-1, 0], [[4]])
|
1904
1905
|
Traceback (most recent call last):
|
@@ -1971,10 +1972,10 @@ class PolynomialSpeciesElement(CombinatorialFreeModule.Element):
|
|
1971
1972
|
sage: E2(-X)
|
1972
1973
|
-E_2 + X^2
|
1973
1974
|
sage: E2(X^2)
|
1974
|
-
|
1975
|
+
E_2(X^2)
|
1975
1976
|
|
1976
1977
|
sage: E2(X + X^2)
|
1977
|
-
E_2 + X^3 +
|
1978
|
+
E_2 + X^3 + E_2(X^2)
|
1978
1979
|
|
1979
1980
|
sage: P2 = PolynomialSpecies(QQ, ["X", "Y"])
|
1980
1981
|
sage: X = P2(SymmetricGroup(1), {0: [1]})
|
@@ -1983,7 +1984,7 @@ class PolynomialSpeciesElement(CombinatorialFreeModule.Element):
|
|
1983
1984
|
E_2(X) + X*Y + E_2(Y)
|
1984
1985
|
|
1985
1986
|
sage: E2(X*Y)(E2(X), E2(Y))
|
1986
|
-
|
1987
|
+
E_2(E_2(X)*E_2(Y))
|
1987
1988
|
|
1988
1989
|
sage: R.<q> = QQ[]
|
1989
1990
|
sage: P = PolynomialSpecies(R, ["X"])
|
@@ -2192,13 +2193,13 @@ class PolynomialSpecies(CombinatorialFreeModule):
|
|
2192
2193
|
sage: X = SetPartitions(4, 2)
|
2193
2194
|
sage: a = lambda g, x: SetPartition([[g(e) for e in b] for b in x])
|
2194
2195
|
sage: P((X, a, 'left'), {0: [1,2], 1: [3,4]})
|
2195
|
-
E_2(X)*E_2(Y) + X^2*E_2(Y) + E_2(
|
2196
|
+
E_2(X)*E_2(Y) + X^2*E_2(Y) + E_2(X*Y) + Y^2*E_2(X)
|
2196
2197
|
|
2197
2198
|
sage: P = PolynomialSpecies(ZZ, ["X"])
|
2198
2199
|
sage: X = SetPartitions(4, 2)
|
2199
2200
|
sage: a = lambda g, x: SetPartition([[g(e) for e in b] for b in x])
|
2200
2201
|
sage: P((X, a, 'left'), {0: [1,2,3,4]})
|
2201
|
-
X*E_3 +
|
2202
|
+
X*E_3 + E_2(E_2)
|
2202
2203
|
|
2203
2204
|
The species of permutation groups::
|
2204
2205
|
|
@@ -2210,7 +2211,7 @@ class PolynomialSpecies(CombinatorialFreeModule):
|
|
2210
2211
|
....: H = S.subgroup(G.conjugate(pi).gens())
|
2211
2212
|
....: return next(K for K in X if K == H)
|
2212
2213
|
sage: P((X, act), {0: range(1, n+1)}, check=False)
|
2213
|
-
4*E_4 + 4*
|
2214
|
+
4*E_4 + 4*E_2(E_2) + E_2^2 + 2*X*E_3
|
2214
2215
|
|
2215
2216
|
Create a multisort species given an action::
|
2216
2217
|
|
@@ -2285,7 +2286,7 @@ class PolynomialSpecies(CombinatorialFreeModule):
|
|
2285
2286
|
return self._from_dict({self._indices(G, check=check): ZZ.one()})
|
2286
2287
|
raise ValueError("the assignment of sorts to the domain elements must be provided")
|
2287
2288
|
elif not isinstance(pi, dict):
|
2288
|
-
pi =
|
2289
|
+
pi = dict(enumerate(pi))
|
2289
2290
|
return self._from_dict({self._indices(G, pi, check=check): ZZ.one()})
|
2290
2291
|
|
2291
2292
|
raise ValueError(f"{G} must be an element of the base ring, a permutation group or a pair (X, a) specifying a group action of the symmetric group on pi={pi}")
|
@@ -2509,3 +2510,58 @@ class PolynomialSpecies(CombinatorialFreeModule):
|
|
2509
2510
|
for s in range(self._arity))
|
2510
2511
|
|
2511
2512
|
Element = PolynomialSpeciesElement
|
2513
|
+
|
2514
|
+
|
2515
|
+
@cached_function
|
2516
|
+
def _atomic_set_like_species(n, names):
|
2517
|
+
r"""
|
2518
|
+
Return a list of the atomic set like species of degree `n`,
|
2519
|
+
and provide their traditional names.
|
2520
|
+
|
2521
|
+
INPUT:
|
2522
|
+
|
2523
|
+
- ``n`` -- positive integer, the degree
|
2524
|
+
- ``names`` -- an iterable of strings for the sorts of the species
|
2525
|
+
|
2526
|
+
EXAMPLES::
|
2527
|
+
|
2528
|
+
sage: from sage.rings.species import _atomic_set_like_species
|
2529
|
+
sage: _atomic_set_like_species(6, "X")
|
2530
|
+
(E_2(E_3), E_2(X*E_2), E_2(X^3), E_3(E_2), E_3(X^2), E_6)
|
2531
|
+
|
2532
|
+
sage: l = [len(_atomic_set_like_species(n, "X")) for n in range(12)]
|
2533
|
+
sage: l
|
2534
|
+
[0, 1, 1, 1, 3, 1, 6, 1, 10, 4, 12, 1]
|
2535
|
+
sage: oeis(l) # optional - internet
|
2536
|
+
0: A007650: Number of set-like atomic species of degree n.
|
2537
|
+
|
2538
|
+
sage: _atomic_set_like_species(4, "U, V")
|
2539
|
+
(E_2(E_2(V)), E_2(E_2(U)), E_2(V^2), E_2(U*V), E_2(U^2), E_4(U), E_4(V))
|
2540
|
+
"""
|
2541
|
+
if not n:
|
2542
|
+
return ()
|
2543
|
+
M1 = MolecularSpecies("X")
|
2544
|
+
M = MolecularSpecies(names)
|
2545
|
+
if n == 1:
|
2546
|
+
return tuple([M(SymmetricGroup(1), {s: [1]}) for s in range(M._arity)])
|
2547
|
+
result = []
|
2548
|
+
for d in divisors(n):
|
2549
|
+
if d == 1:
|
2550
|
+
continue
|
2551
|
+
if d == n:
|
2552
|
+
result.extend(M(SymmetricGroup(n), {s: range(1, n+1)})
|
2553
|
+
for s in range(M._arity))
|
2554
|
+
continue
|
2555
|
+
E_d = M1(SymmetricGroup(d))
|
2556
|
+
l = []
|
2557
|
+
w = []
|
2558
|
+
for degree in range(1, n // d + 1):
|
2559
|
+
a_degree = _atomic_set_like_species(degree, names)
|
2560
|
+
l.extend(a_degree)
|
2561
|
+
w.extend([degree]*len(a_degree))
|
2562
|
+
for a in WeightedIntegerVectors(n // d, w):
|
2563
|
+
G = prod(F ** e for F, e in zip(l, a))
|
2564
|
+
F = E_d(G)
|
2565
|
+
F.support()[0].rename(f"E_{d}({G})")
|
2566
|
+
result.append(F)
|
2567
|
+
return tuple(result)
|