︠815c1145-588a-4c2e-b815-d381cb7f7ea0s︠ ABC=0 ACB=0 BAC=0 BCA=0 CAB=0 CBA=0 for i in [1..50]: s=Permutations(3).random_element() if s==[1,2,3]: ABC=ABC+1 if s==[1,3,2]: ACB=ACB+1 if s==[2,1,3]: BAC=BAC+1 if s==[2,3,1]: CAB=CAB+1 if s==[3,2,1]: CBA=CBA+1 if s==[3,1,2]: BCA=BCA+1 #this part above creates a function on the permutations in S_3 by randomly generating 50 permutations and counting how many occurrences of each one. this is our f spc = SymmetricGroupRepresentation([2,1], 'specht') MABC=spc.representation_matrix(Permutation([1,2,3])) MACB=spc.representation_matrix(Permutation([1,3,2])) MBAC=spc.representation_matrix(Permutation([2,1,3])) MCAB=spc.representation_matrix(Permutation([2,3,1])) MCBA=spc.representation_matrix(Permutation([3,2,1])) MBCA=spc.representation_matrix(Permutation([3,1,2])) alt=SymmetricGroupRepresentation([1,1,1],'specht') AABC=alt.representation_matrix(Permutation([1,2,3])) AACB=alt.representation_matrix(Permutation([1,3,2])) ABAC=alt.representation_matrix(Permutation([2,1,3])) ACAB=alt.representation_matrix(Permutation([2,3,1])) ACBA=alt.representation_matrix(Permutation([3,2,1])) ABCA=alt.representation_matrix(Permutation([3,1,2])) #the part above gets the matrices for each permutation in S_3, for each representation. P111=ABC*AABC+ACB*AACB+BAC*ABAC+BCA*ABCA+CAB*ACAB+CBA*ACBA #this computes the sum f(s)rho(s) for each element s in S_3, for the representation 1,1,1. In other words, this is the fourier coefficient for the representation 1,1,1 P21=ABC*MABC+ACB*MACB+BAC*MBAC+BCA*MBCA+CAB*MCAB+CBA*MCBA #same as above but for 2,1 print 'P111', P111 print 'P21' print P21 ︡edcb9123-3114-4272-8d27-0e4d282ebf99︡{"stdout":"P111 [8]\n"}︡{"stdout":"P21\n"}︡{"stdout":"[-2 -7]\n[-2 -3]\n"}︡{"done":true} ︠10914127-9bf4-4fd0-84c2-e1aa6d68e6abs︠ #this is the same process as above but for S_4 instead of S_3 perm=[[1, 2, 3, 4],[1, 2, 4, 3],[1, 3, 2, 4],[1, 3, 4, 2],[1, 4, 2, 3],[1, 4, 3, 2],[2, 1, 3, 4],[2, 1, 4, 3],[2, 3, 1, 4],[2, 3, 4, 1],[2, 4, 1, 3],[2, 4, 3, 1],[3, 1, 2, 4],[3, 1, 4, 2],[3, 2, 1, 4],[3, 2, 4, 1],[3, 4, 1, 2],[3, 4, 2, 1],[4, 1, 2, 3],[4, 1, 3, 2],[4, 2, 1, 3],[4, 2, 3, 1],[4, 3, 1, 2],[4, 3, 2, 1]] #perm=permutations(4) L=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] for i in [1..7000]: s=Permutations(4).random_element() for j in [0..23]: if s==perm[j]: L[j]=L[j]+1 print L M=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] S=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] spc = SymmetricGroupRepresentation([3,1], 'specht') for k in [0..23]: M[k]=spc.representation_matrix(Permutation(perm[k])) square = SymmetricGroupRepresentation([2,2], 'specht') for k in [0..23]: S[k]=square.representation_matrix(Permutation(perm[k])) three = SymmetricGroupRepresentation([2,1,1], 'specht') for k in [0..23]: T[k]=three.representation_matrix(Permutation(perm[1])) alt = SymmetricGroupRepresentation([1,1,1,1], 'specht') for k in [0..23]: A[k]=alt.representation_matrix(Permutation(perm[k])) P22=0 P31=0 P211=0 P1111=0 for l in [0..23]: P22=P22+S[l]*L[l] for l in [0..23]: P31=P31+M[l]*L[l] for l in [0..23]: P211=P211+T[l]*L[l] for l in [0..23]: P1111=P1111+A[l]*L[l] print 'P31' print P31 print 'P22' print P22 print 'P211' print P211 print 'P1111' print P1111 print (P31[0,0]^2+P31[0,1]^2+P31[0,2]^2+P31[1,0]^2+P31[1,1]^2+P31[1,2]^2+P31[2,0]^2+P31[2,1]^2+P31[2,2]^2)/9.0 print (P22[0,0]^2+P22[0,1]^2+P22[1,0]^2+P22[1,1]^2)/4.0 print (P211[0,0]^2+P211[0,1]^2+P211[0,2]^2+P211[1,0]^2+P211[1,1]^2+P211[1,2]^2+P211[2,0]^2+P211[2,1]^2+P211[2,2]^2)/9.0 ︡a154e6f7-6c03-4575-bf22-bfcdf99adc46︡{"stdout":"[268, 289, 286, 290, 301, 274, 300, 272, 296, 304, 282, 290, 291, 266, 298, 298, 278, 309, 281, 310, 288, 297, 321, 311]\n"}︡{"stdout":"P31\n"}︡{"stdout":"[-101 89 -46]\n[ -5 -1 -40]\n[ 27 -95 26]\n"}︡{"stdout":"P22\n"}︡{"stdout":"[ 32 -20]\n[ 134 -138]\n"}︡{"stdout":"P211\n"}︡{"stdout":"[ 7000 0 0]\n[ 7000 -7000 0]\n[ 7000 0 -7000]\n"}︡{"stdout":"P1111\n"}︡{"stdout":"[-14]\n"}︡{"stdout":"3588.22222222222\n"}︡{"stdout":"9606.00000000000\n"}︡{"stdout":"2.72222222222222e7\n"}︡{"done":true} ︠e3fd0eed-d03d-49ce-898b-b726ef9688c3s︠ L=[1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] M=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] S=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] spc = SymmetricGroupRepresentation([3,1], 'specht') for k in [0..23]: M[k]=spc.representation_matrix(Permutation(perm[k])) square = SymmetricGroupRepresentation([2,2], 'specht') for k in [0..23]: S[k]=square.representation_matrix(Permutation(perm[k])) three = SymmetricGroupRepresentation([2,1,1], 'specht') for k in [0..23]: T[k]=three.representation_matrix(Permutation(perm[k])) alt = SymmetricGroupRepresentation([1,1,1,1], 'specht') for k in [0..23]: A[k]=alt.representation_matrix(Permutation(perm[k])) P22=0 P31=0 P211=0 P1111=0 for l in [0..23]: P22=P22+S[l]*L[l] for l in [0..23]: P31=P31+M[l]*L[l] for l in [0..23]: P211=P211+T[l]*L[l] for l in [0..23]: P1111=P1111+A[l]*L[l] print 'P31' print P31 print 'P22' print P22 print 'P211' print P211 print 'P1111' print P1111 print (P31[0,0]^2+P31[0,1]^2+P31[0,2]^2+P31[1,0]^2+P31[1,1]^2+P31[1,2]^2+P31[2,0]^2+P31[2,1]^2+P31[2,2]^2)/9.0 print (P22[0,0]^2+P22[0,1]^2+P22[1,0]^2+P22[1,1]^2)/4.0 print (P211[0,0]^2+P211[0,1]^2+P211[0,2]^2+P211[1,0]^2+P211[1,1]^2+P211[1,2]^2+P211[2,0]^2+P211[2,1]^2+P211[2,2]^2)/9.0 ︡7b33cbf9-cdec-4568-bb96-d11b2c7fe25f︡{"stdout":"P31\n"}︡{"stdout":"[ 6 0 0]\n[ 2 0 0]\n[-2 0 0]\n"}︡{"stdout":"P22\n"}︡{"stdout":"[0 0]\n[0 0]\n"}︡{"stdout":"P211\n"}︡{"stdout":"[0 0 0]\n[0 0 0]\n[0 0 0]\n"}︡{"stdout":"P1111\n"}︡{"stdout":"[0]\n"}︡{"stdout":"4.88888888888889\n"}︡{"stdout":"0.000000000000000\n"}︡{"stdout":"0.000000000000000\n"}︡{"done":true} ︠263fcccf-4f93-495e-8571-c5ea0417908cs︠ Q=matrix([[12,51,6,7],[3,52,22,120],[11,11,1,9],[3,3,3,8]]) F=[Q[0,0]+Q[1,1]+Q[2,2]+Q[3,3], Q[0,0]+Q[1,1]+Q[3,2]+Q[2,3],Q[0,0]+Q[2,1]+Q[1,2]+Q[3,3],Q[0,0]+Q[2,1]+Q[3,2]+Q[1,3],Q[0,0]+Q[3,1]+Q[1,2]+Q[2,3],Q[0,0]+Q[3,1]+Q[2,2]+Q[1,3],Q[1,0]+Q[0,1]+Q[2,2]+Q[3,3],Q[1,0]+Q[0,1]+Q[3,2]+Q[2,3],Q[1,0]+Q[2,1]+Q[0,2]+Q[3,3],Q[1,0]+Q[2,1]+Q[3,2]+Q[0,3],Q[1,0]+Q[3,1]+Q[0,2]+Q[2,3],Q[1,0]+Q[3,1]+Q[2,2]+Q[0,3],Q[2,0]+Q[0,1]+Q[1,2]+Q[3,3],Q[2,0]+Q[0,1]+Q[3,2]+Q[1,3],Q[2,0]+Q[1,1]+Q[0,2]+Q[3,3],Q[2,0]+Q[1,1]+Q[3,2]+Q[0,3],Q[2,0]+Q[3,1]+Q[0,2]+Q[1,3],Q[2,0]+Q[3,1]+Q[1,2]+Q[0,3],Q[3,0]+Q[0,1]+Q[1,2]+Q[2,3],Q[3,0]+Q[0,1]+Q[2,2]+Q[1,3],Q[3,0]+Q[1,1]+Q[0,2]+Q[2,3],Q[3,0]+Q[1,1]+Q[2,2]+Q[0,3],Q[3,0]+Q[2,1]+Q[0,2]+Q[1,3],Q[3,0]+Q[2,1]+Q[1,2]+Q[0,3]] print L M=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] S=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] spc = SymmetricGroupRepresentation([3,1], 'specht') for k in [0..23]: M[k]=spc.representation_matrix(Permutation(perm[k])) square = SymmetricGroupRepresentation([2,2], 'specht') for k in [0..23]: S[k]=square.representation_matrix(Permutation(perm[k])) three = SymmetricGroupRepresentation([2,1,1], 'specht') for k in [0..23]: T[k]=three.representation_matrix(Permutation(perm[k])) alt = SymmetricGroupRepresentation([1,1,1,1], 'specht') for k in [0..23]: A[k]=alt.representation_matrix(Permutation(perm[k])) P22=0 P31=0 P211=0 P1111=0 for l in [0..23]: P22=P22+S[l]*F[l] for l in [0..23]: P31=P31+M[l]*F[l] for l in [0..23]: P211=P211+T[l]*F[l] for l in [0..23]: P1111=P1111+A[l]*F[l] print 'P31' print P31 print 'P22' print P22 print 'P211' print P211 print 'P1111' print P1111 print (P31[0,0]^2+P31[0,1]^2+P31[0,2]^2+P31[1,0]^2+P31[1,1]^2+P31[1,2]^2+P31[2,0]^2+P31[2,1]^2+P31[2,2]^2)/9.0 print (P22[0,0]^2+P22[0,1]^2+P22[1,0]^2+P22[1,1]^2)/4.0 print (P211[0,0]^2+P211[0,1]^2+P211[0,2]^2+P211[1,0]^2+P211[1,1]^2+P211[1,2]^2+P211[2,0]^2+P211[2,1]^2+P211[2,2]^2)/9.0 ︡4a1bd2a9-6fe9-4cc1-a657-134100894552︡{"stdout":"[1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n"}︡{"stdout":"P31\n"}︡{"stdout":"[ 270 -406 216]\n[ 706 -490 560]\n[ 246 -70 160]\n"}︡{"stdout":"P22\n"}︡{"stdout":"[0 0]\n[0 0]\n"}︡{"stdout":"P211\n"}︡{"stdout":"[0 0 0]\n[0 0 0]\n[0 0 0]\n"}︡{"stdout":"P1111\n"}︡{"stdout":"[0]\n"}︡{"stdout":"158616.000000000\n"}︡{"stdout":"0.000000000000000\n"}︡{"stdout":"0.000000000000000\n"}︡{"done":true} ︠45021981-b3f6-437b-82d6-c94f3da64915s︠ #attempting to create their algorithm F=[0,0,10,0,16,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,20,0,0,0] Q=matrix([[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]) for i in [0..23]: for j in [1..4]: if perm[i][0]==j: Q[0,j-1]=Q[0,j-1]+F[i] for j in [1..4]: if perm[i][1]==j: Q[1,j-1]=Q[1,j-1]+F[i] for j in [1..4]: if perm[i][2]==j: Q[2,j-1]=Q[2,j-1]+F[i] for j in [1..4]: if perm[i][3]==j: Q[3,j-1]=Q[3,j-1]+F[i] print Q S=sorted(Q.list()) #ascending order of Q print S p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] k=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] for i in [1..9]: C= Subsets([0..k[i-1]], submultiset=True).list() print C for l in [1..len(C)-1]: print sum([C[l][h] for h in [0..len(C[l])-1]]) if S[i-1]==p[0]: k[i-1]=k[i-2] else: k[i-1]=k[i-2]+1 p[i]=S[i-1] print k ︡9069eb86-1673-4dc4-9fc2-d52ad9425323︡{"stdout":"[26 0 5 20]\n[ 5 20 10 16]\n[20 26 0 5]\n[ 0 5 36 10]\n"}︡{"stdout":"[0, 0, 0, 5, 5, 5, 5, 10, 10, 16, 20, 20, 20, 26, 26, 36]\n"}︡{"stdout":"[[], [0]]\n0\n[[], [0]]\n0\n[[], [0]]\n0\n[[], [0]]\n0\n[[], [0]]\n0\n[[], [0]]\n0\n[[], [0]]\n0\n[[], [0]]\n0\n[[], [0]]\n0\n"}︡{"stdout":"[0, 0, 0, 1, 2, 3, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0]\n"}︡{"done":true} ︠2a19eb7d-19a5-4f2e-812e-56f7c05a0f1cs︠ #start with a function f, find its Q1 and Q2, build the 'obvious' f, compare (see page 31 in notebook) Q1=matrix([[12,51,6,7],[3,52,22,120],[11,11,1,9],[3,3,3,8]]) Q2=matrix([[5,0,10,3,1,0],[0,14,0,0,0,5],[6,0,6,0,4,3],[3,4,0,6,0,6],[5,0,0,0,14,0],[0,1,3,10,0,5]]) F1=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] #perm=permutations(4) for k in [0..len(perm)-1]: for i in [1..4]: for j in [1..4]: if perm[k][i-1]==j: F1[k]=F1[k]+Q1[j-1,i-1] print F1 F2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] I=[[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]] #i indexes row in matrix Q2, j indexes column in matrix Q2, I[i-1] indexes the pair corresponding to that row, I[j-1] the pair corresponding to that column for k in [0..len(perm)-1]: for i in [1..6]: for j in [1..6]: # print 'i',i,'j',j, I[i-1], I[j-1] if perm[k][I[i-1][0]-1]==I[j-1][0] and perm[k][I[i-1][1]-1]==I[j-1][1] or perm[k][I[i-1][0]-1]==I[j-1][1] and perm[k][I[i-1][1]-1]==I[j-1][0]: F2[k]=F2[k]+Q2[i-1,j-1] #eg if i=3 and j=2 (so I[i-1]=1,4 and I[j-1]=1,3), does the kth permutation send 1->1,4->3 or 1->3,4->1? #if so, then add the i,j element of Q2 to F2[k] # print 'k',k,'i',i,'j',j,perm[k] print F2 M=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] S=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] spc = SymmetricGroupRepresentation([3,1], 'specht') for k in [0..23]: M[k]=spc.representation_matrix(Permutation(perm[k])) square = SymmetricGroupRepresentation([2,2], 'specht') for k in [0..23]: S[k]=square.representation_matrix(Permutation(perm[k])) three = SymmetricGroupRepresentation([2,1,1], 'specht') for k in [0..23]: T[k]=three.representation_matrix(Permutation(perm[k])) alt = SymmetricGroupRepresentation([1,1,1,1], 'specht') for k in [0..23]: A[k]=alt.representation_matrix(Permutation(perm[k])) P22=0 P31=0 P211=0 P1111=0 P22F2=0 P31F2=0 P211F2=0 P1111F2=0 for l in [0..23]: P22=P22+S[l]*F1[l] for l in [0..23]: P31=P31+M[l]*F1[l] for l in [0..23]: P211=P211+T[l]*F1[l] for l in [0..23]: P1111=P1111+A[l]*F1[l] for l in [0..23]: P22F2=P22F2+S[l]*F2[l] for l in [0..23]: P31F2=P31F2+M[l]*F2[l] for l in [0..23]: P211F2=P211F2+T[l]*F2[l] for l in [0..23]: P1111F2=P1111F2+A[l]*F2[l] print 'P31' print P31 print 'P22' print P22 print 'P211' print P211 print 'P1111' print P1111 print 'P31F2' print P31F2 print 'P22F2' print P22F2 print 'P211F2' print P211F2 print 'P1111F2' print P1111F2 ︡56a67253-e5cb-42be-b3b4-eb33e465f42f︡{"stdout":"[73, 76, 53, 146, 46, 136, 63, 66, 28, 24, 21, 14, 92, 185, 77, 73, 140, 43, 85, 175, 70, 63, 140, 43]\n"}︡{"stdout":"[50, 10, 12, 12, 20, 60, 18, 10, 14, 18, 2, 14, 6, 10, 40, 16, 28, 0, 26, 38, 8, 24, 8, 12]\n"}︡{"stdout":"P31\n"}︡{"stdout":"[ 270 -406 216]\n[ 706 -490 560]\n[ 246 -70 160]\n"}︡{"stdout":"P22\n"}︡{"stdout":"[0 0]\n[0 0]\n"}︡{"stdout":"P211\n"}︡{"stdout":"[0 0 0]\n[0 0 0]\n[0 0 0]\n"}︡{"stdout":"P1111\n"}︡{"stdout":"[0]\n"}︡{"stdout":"P31F2\n"}︡{"stdout":"[ 80 -24 16]\n[ 80 -8 80]\n[ 24 0 128]\n"}︡{"stdout":"P22F2\n"}︡{"stdout":"[-48 48]\n[ 36 120]\n"}︡{"stdout":"P211F2\n"}︡{"stdout":"[0 0 0]\n[0 0 0]\n[0 0 0]\n"}︡{"stdout":"P1111F2\n"}︡{"stdout":"[0]\n"}︡{"done":true} ︠c738508b-790a-4f31-98c3-d23ad09396dfs︠ spc = SymmetricGroupRepresentation([3,2], 'seminormal') ︡419b3e06-9a56-4b88-a928-450712c09ed2︡{"done":true} ︠823aa043-3e7a-482e-8220-670efaa13659s︠ print spc ︡b09695cc-9482-4ff9-907a-07b32362a6c3︡{"stdout":"Seminormal representation of the symmetric group corresponding to [3, 2]\n"}︡{"done":true} ︠3e0dcc41-517a-47c8-a0de-ea67f90ff264s︠ spc.representation_matrix(Permutation([1,2,3,5,4])) ︡bc2738c5-1c65-4250-80c2-2581e29f1790︡{"stdout":"[ 1 0 0 0 0]\n[ 0 -1/2 0 3/2 0]\n[ 0 0 -1/2 0 3/2]\n[ 0 1/2 0 1/2 0]\n[ 0 0 1/2 0 1/2]"}︡{"stdout":"\n"}︡{"done":true} ︠35f86dd1-af9a-4717-a120-12df9bf7c0e9︠ -- spc = SymmetricGroupRepresentation([4,1], 'orthogonal') spc.representation_matrix(Permutation([1,2,4,5,3])) ︡e06e7a99-1cee-4dc7-9c42-b3814724ac0b︡{"stdout":"[ -1/4 1/4*sqrt(15) 0 0]\n[ -1/12*sqrt(15) -1/12 2/3*sqrt(2) 0]\n[1/6*sqrt(15)*sqrt(2) 1/6*sqrt(2) 1/3 0]\n[ 0 0 0 1]\n"}︡{"done":true} ︠833a9b9c-d07a-415a-9f73-93e7103b8b76s︠ spc = SymmetricGroupRepresentation([2,2,1], 'orthogonal') L=spc.representation_matrix(Permutation([1,2,4,3,5])) L.nrows() ︡6a6251b0-b8bc-4a22-953b-45b2dfdc205a︡{"stdout":"5\n"}︡{"done":true} ︠24e23e5e-3cd1-444c-b969-f5f2f0a1e091︠