/usr/share/axiom-20170501/src/algebra/CYCLES.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | )abbrev package CYCLES CycleIndicators
++ Author: William H. Burge
++ Date Created: 1986
++ Date Last Updated: 11 Feb 1992
++ References: J.H.Redfield, 'The Theory of Group-Reduced Distributions',
++ American J. Math., 49 (1927) 433-455.
++ G.Polya, 'Kombinatorische Anzahlbestimmungen fur Gruppen,
++ Graphen und chemische Verbindungen', Acta Math. 68
++ (1937) 145-254.
++ Description:
++ Polya-Redfield enumeration by cycle indices.
CycleIndicators() : SIG == CODE where
I ==> Integer
L ==> List
B ==> Boolean
SPOL ==> SymmetricPolynomial
PTN ==> Partition
RN ==> Fraction Integer
FR ==> Factored Integer
h ==> complete
s ==> powerSum
--a ==> elementary
alt ==> alternating
cyc ==> cyclic
dih ==> dihedral
ev == eval
SIG ==> with
complete : I -> SPOL RN
++\spad{complete n} is the \spad{n} th complete homogeneous
++ symmetric function expressed in terms of power sums.
++ Alternatively it is the cycle index of the symmetric
++ group of degree n.
powerSum : I -> SPOL RN
++\spad{powerSum n} is the \spad{n} th power sum symmetric
++ function.
elementary : I -> SPOL RN
++\spad{elementary n} is the \spad{n} th elementary symmetric
++ function expressed in terms of power sums.
alternating : I -> SPOL RN
++\spad{alternating n} is the cycle index of the
++ alternating group of degree n.
cyclic : I -> SPOL RN --cyclic group
++\spad{cyclic n} is the cycle index of the
++ cyclic group of degree n.
dihedral : I -> SPOL RN --dihedral group
++\spad{dihedral n} is the cycle index of the
++ dihedral group of degree n.
graphs : I -> SPOL RN
++\spad{graphs n} is the cycle index of the group induced on
++ the edges of a graph by applying the symmetric function to the
++ n nodes.
cap : (SPOL RN,SPOL RN) -> RN
++\spad{cap(s1,s2)}, introduced by Redfield,
++ is the scalar product of two cycle indices.
cup : (SPOL RN,SPOL RN) -> SPOL RN
++\spad{cup(s1,s2)}, introduced by Redfield,
++ is the scalar product of two cycle indices, in which the
++ power sums are retained to produce a cycle index.
eval : SPOL RN -> RN
++\spad{eval s} is the sum of the coefficients of a cycle index.
wreath : (SPOL RN,SPOL RN) -> SPOL RN
++\spad{wreath(s1,s2)} is the cycle index of the wreath product
++ of the two groups whose cycle indices are \spad{s1} and
++ \spad{s2}.
SFunction : L I -> SPOL RN
++\spad{SFunction(li)} is the S-function of the partition \spad{li}
++ expressed in terms of power sum symmetric functions.
skewSFunction : (L I,L I) -> SPOL RN
++\spad{skewSFunction(li1,li2)} is the S-function
++ of the partition difference \spad{li1 - li2}
++ expressed in terms of power sum symmetric functions.
CODE ==> add
import PartitionsAndPermutations
import IntegerNumberTheoryFunctions
trm: PTN -> SPOL RN
trm pt == monomial(inv(pdct(pt) :: RN),pt)
list: Stream L I -> L L I
list st == entries complete st
complete i ==
if i=0
then 1
else if i<0
then 0
else
_+/[trm(partition pt) for pt in list(partitions i)]
even?: L I -> B
even? li == even?( #([i for i in li | even? i]))
alt i ==
2 * _+/[trm(partition li) for li in list(partitions i) | even? li]
elementary i ==
if i=0
then 1
else if i<0
then 0
else
_+/[(spol := trm(partition pt); even? pt => spol; -spol)
for pt in list(partitions i)]
divisors: I -> L I
divisors n ==
b := factors(n :: FR)
c := concat(1,"append"/
[[a.factor**j for j in 1..a.exponent] for a in b]);
if #(b) = 1 then c else concat(n,c)
ss: (I,I) -> SPOL RN
ss(n,m) ==
li : L I := [n for j in 1..m]
monomial(1,partition li)
s n == ss(n,1)
cyc n ==
n = 1 => s 1
_+/[(eulerPhi(i) / n) * ss(i,numer(n/i)) for i in divisors n]
dih n ==
k := n quo 2
odd? n => (1/2) * cyc n + (1/2) * ss(2,k) * s 1
(1/2) * cyc n + (1/4) * ss(2,k) + (1/4) * ss(2,k-1) * ss(1,2)
trm2: L I -> SPOL RN
trm2 li ==
lli := powers(li)$PTN
xx := 1/(pdct partition li)
prod : SPOL RN := 1
for ll in lli repeat
ll0 := first ll; ll1 := second ll
k := ll0 quo 2
c :=
odd? ll0 => ss(ll0,ll1 * k)
ss(k,ll1) * ss(ll0,ll1 * (k - 1))
c := c * ss(ll0,ll0 * ((ll1*(ll1 - 1)) quo 2))
prod2 : SPOL RN := 1
for r in lli | first(r) < ll0 repeat
r0 := first r; r1 := second r
prod2 := ss(lcm(r0,ll0),gcd(r0,ll0) * r1 * ll1) * prod2
prod := c * prod2 * prod
xx * prod
graphs n == _+/[trm2 li for li in list(partitions n)]
cupp: (PTN,SPOL RN) -> SPOL RN
cupp(pt,spol) ==
zero? spol => 0
(dg := degree spol) < pt => 0
dg = pt => (pdct pt) * monomial(leadingCoefficient spol,dg)
cupp(pt,reductum spol)
cup(spol1,spol2) ==
zero? spol1 => 0
p := leadingCoefficient(spol1) * cupp(degree spol1,spol2)
p + cup(reductum spol1,spol2)
ev spol ==
zero? spol => 0
leadingCoefficient(spol) + ev(reductum spol)
cap(spol1,spol2) == ev cup(spol1,spol2)
mtpol: (I,SPOL RN) -> SPOL RN
mtpol(n,spol)==
zero? spol => 0
deg := partition [n*k for k in (degree spol)::L(I)]
monomial(leadingCoefficient spol,deg) + mtpol(n,reductum spol)
fn2: I -> SPOL RN
evspol: ((I -> SPOL RN),SPOL RN) -> SPOL RN
evspol(fn2,spol) ==
zero? spol => 0
lc := leadingCoefficient spol
prod := _*/[fn2 i for i in (degree spol)::L(I)]
lc * prod + evspol(fn2,reductum spol)
wreath(spol1,spol2) == evspol(x+->mtpol(x,spol2),spol1)
hh: I -> SPOL RN --symmetric group
hh n == if n=0 then 1 else if n<0 then 0 else h n
SFunction li ==
a:Matrix SPOL RN:=matrix [[hh(k -j+i) for k in li for j in 1..#li]
for i in 1..#li]
determinant a
roundup:(L I,L I)-> L I
roundup(li1,li2)==
#li1 > #li2 => roundup(li1,concat(li2,0))
li2
skewSFunction(li1,li2)==
#li1 < #li2 =>
error "skewSFunction: partition1 does not include partition2"
li2:=roundup (li1,li2)
a:Matrix SPOL RN:=matrix [[hh(k-li2.i-j+i)
for k in li1 for j in 1..#li1] for i in 1..#li1]
determinant a
|