MVR5
I'hidden=6"%&falseGE\[lZ%-genhallmonomGR6#'%'WeightG-%%listG6#%(integerG6-%%Gen
sG%$AlgG%$SetG%"iG%"jG%"kG%"UG%"VG%"AG%"BG%$AddG6$%'systemG%)rememberGF$C*@'2""
#9#-%&ERRORG6$%3too~many~argumentsG9"/FCFBC%>8$%(ALGEBRAG>8%&FH6#FB@$0FPFM-%$us
eG6#FO-%'RETURNG6#-F'6$9$FM>8-7#-%$seqG6$""!/8'Ffn@'-%%&!>=G6$FfnFhn>8.%%trueG-
%%&!<=GFco>FeoF%C$-FU6#FL-FE6%%'weightGFfn%Mhas~to~be~either~positive,~negative
~or~zero.G>8&7"?(F$"""FepF$0FhnFfnC$?(F_oFepFep-%%nopsG6#FhnFfo@%/&Fhn6#F_o&Ffn
F_q>F^qF]oC$@%Feo>F^q,&F^qFepFepFep>F^q,&F^qFep!""Fep%&breakG@$FfpC%>8*-F'6$,&F
fnFepFhnFhqFO>8+-F'6$FhnFO?(8(FepFep-Fjp6#F]rFfo?(8)FepFep-Fjp6#FbrFfo@$-%#&<G6
$&F]r6#Ffr&Fbr6#Fjr@$5-%,isgeneratorG6$FcsFO45Fgs-F_s6$Fas-%#opG6$FepFcs>Fbp7$&
FbpF$-%&evalnG6#-%#&*GF`s@$-%'memberG6%Ffn7#-F[o6$-%#wtG6$F_oFO/F_o%+GENERATORS
G.Fjr>Fbp7$Fct&FduFds@$3FI0FMFLF[p-FX6#Fbp6#%RGenerates~Hall~Monomials~of~the~s
pecified~degree.G6$FduFMF$%&AnmatGR6#'%"nGF/F$F<F$C$@$2FfnFB-FE6$%5subscript~is
~too~lowGFfn-FX6#-%(matbaseG6$FfnFfn6#%7generates~an~An~matrixGF$F$%'reduceGR6$
'%%exprG%*algebraicG'F2%%nameG6*%$lhsG%$rhsG%%funcG%&conslG%&consrG%%consG%&Tab
leGF1F<F$C$@%-F[u6$9%%'SIMPLEGC)>F]r-F_t6$""%-%%evalG6#%'simpleG>Fbp&F]r6$Fgx%%
typeG-%*unprotectG6#-Fet6#%,MATRIX_TYPEG>F[z&FbpFQ-%(protectGFhy@%0FgxFMC&>FbrF
M-FU6#Fgx>Fbp-&((%/simplefunctionG%"_GFbp6#Fep6$Ffn&F]rFez-FUF\s>FbpFgz@$0Fbp%%
FAILGF\v>Fbp-%,functionizeG6$-Fet6#FfnFgx@%/FbpFd[l-FXFj[lC%>FL-F_t6$FepFfn>FO-
F_t6$FBFfn@)3-Fey6$FL%(indexedG-Fey6$FOFi\l@%-Fey6$Fbp%*procedureGC%>F_o-F_tF\p
>Ffr-F_tFV-FX6#--F_yF]v6$F_oFfrF\vFg\l@%F]]lC$>FjrFb]l-FX6#-Fh]l6$FjrFOF\vFj\l@
%F]]lC$>FjrFd]l-FX6#-Fh]l6$FLFjrF\vF\v6#%awreduce(expression)~simplifies~an~exp
ression~according~to~the~rules~defined~in~the~|+~~~~~~~~~~~~~~~lookup~table;~re
duce()~can~only~simplify~an~expression~involving~two~terms,~not~|+~~~~~~~~~~~~~
~~moreGFjyF$%*listtolieGR6#%%ListG6%F4%'ResultG%*KeepTermsGF<F$C&@'FAFDFI>FbpFf
o>FbpF%@&4-Fey6$FfnF-@%/FbpFfo-FX6#-Fj^l6$7#FfnF]o-FX6#-Fj^l6#F_`l/-FjpFj[lF]o-
FX6#%%NULLG@%33/FbpF%/Fe`lFep5-Fey6$&FfnF$%"+G-Fey6$Faal%)functionG>FO-%(leadin
gG6$FaalFMC$@%-Fey6$&FfnF][lF-@%Fj_l>FO-Fj^l6$F^blF]o>FO-Fj^l6#F^bl>FOF^bl?(FLF
BFepFe`lFfo@%-Fey6$&FfnF\pF-@%Fj_l>FO-Fht6$FO-Fj^l6$F[clF]o>FO-Fht6$FO-Fj^l6#F[
cl>FO-Fht6$FOF[cl-FXFV6#%PConverts~a~list~to~a~lieexpression~(with~&*-s).GF$F$%
/epsilon_type_DGR6%'F9F,'F:F,'%"MG%'matrixG6%F4F5F__lF$F$C%>FbpF]o?(FLFepFepFe`
lFfo?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~second~is~the~list~of~coefficients.|+~~~~~~~~
~~~~~Returns:~[[list~of~monomials],~[list~of~coefficients]]G6#FMF$%&DnmatGRFcv6
#FcdlF<F$C(@$2FfnFc[mFiv>FL-F_w6$Ffn,&FfnFepFhqFep>&FL6$,&FfnFep!"#FepFfnFhq>&F
L6$FfnF_]nFhq>&FLF`wFB-FX6#-F_yF\p6#%7generates~an~Dn~matrixGF$F$%&fieldGRF$F$F
$F$@'2FepFC-FE6$%Yfield()~expects~zero~or~one~(integer)~argument,~receivedGFH/F
CF]oC'@$/%)MODVALUEG.Ff^n-FE6#%Nthere~is~no~MODVALUE~defined,~can't~set~flag.G-
Fgy6#-Fet6#%(MODFLAGG>F__n4F__n-F_zF\_n@%F__n-FX6#/-Fet6#%/characteristicGFf^n-
FX6#%3characteristic~offGC(@$4-Fey6$&FHF][lF/-FE6$%Nfield()~expects~an~integer~
argument,~receivedGFb`n-Fgy6$-Fet6#Ff^nF]_n>Ff^nFb`n>F__nFfo-F_zFg`nFd_n6#%Sthr
ough~field()~it~is~possible~to~set~the~MODVALUEG6$F__nFf^nF$%&EnmatGRFcvFd\nF<F
$C(@$2FfnF]yFiv>FLFi\n>&FL6$,&FfnFep!"$FepFfnFhq>&FL6$FfnFianFhq>Fe]nFBFf]n6#%7
generates~an~En~matrixGF$F$%:simplefunction_ADE_matrixGR6$'FaflFealFbdl6&%#LIG%
#RIGFhflFiflF$F$C'>FbpF`\l>F_oFc\l>FL7#-F_tF]v>FO7#-F_tF_q@-553-%(hastypeG6$FL%
)negativeG-Ffcn6$FL%)positiveG3-Ffcn6$FOFhcn-Ffcn6$FOF[dn/FbpF_oFe_m3/-F_t6$F]o
&FduFQ-F_t6$F]oFbp/Fddn-F_t6$F]oF_oFe_mFcdn@%3/-%%scpdG6%FOFOFgxFB32F]o&FLF$42-
FjpFVFden-FX6#*&-%$addG6$*&&FO6#F5Fep&Fgx6$FdenF5Fep/F5;FepFgenFep&-F_t6$F]o&Fd
uF][l6#Fe[nFepFe_mFidn@%3/-F`en6%FLFLFgxFB32F]oFe[n42-FjpF\pFe[n-FX6#,$*&-F\fn6
$*&&FLF`fnFep&Fgx6$Fe[nF5Fep/F5;FepFcgnFep&Fffn6#FdenFepFhqFe_m3F\gnF^en@'/-F`e
n6%FLFOFgxF`]n-FX6#*&)Fhq-(%)epsilon_GF[zFfhnFep-F\fn6$*&F[hnFep&FddnF`fnFepF^h
nFep/FehnFhq-FX6#*&FjhnFep&-Fgbm6%RFjbmF$6$%)operatorG%&arrowGF$&Fgx6#FaalF$F$F
$7#,&FLFepFOFepFffnF$FepFe_mFe_m6#%]qthis~is~the~function~for~a~simple~lie~alge
bra,~that~does~the~simplification~of~algebras~An,~Dn,~EnGF$F$%8simplefunction_B
_matrixGRFcbn6.FfbnFgbnF4F5%#LBG%"aG%#DIGFhflFifl%#DMG%$LenG%'unfoldGF$F$C(>8/R
6#'FedmF,6)F5Fcfl%&StateG%&zerosG%%onesG%%twosG%$zteGF$F$C'>FO7#-F[o6$F]o/FL;Fe
pFe`l>FbpF_o?(FLFepFepFe`lFfo@/3/F[clF]o5Fadn/FbpF]r>&FOF\pF]o3Fc\o/FbpFfrC$>Fb
pF]r>Fg\oF]o3/-%$absGFfclFepFadnC$>FbpFfr>Fg\oF[cl3F^]oFi\o>Fg\oF[cl3/F_]oFBFi\
oC$>FbpFjr>Fg\oF[cl3Fg]o/FbpFjr>Fg\oF[cl-FX6#Fcp@)Fe\o>FO7$7$Fe[nF]oFcpFi\o>FO7
$Fc^o7%&&FO6#;Fep,&FgenFepFhqFepF$F]o&FO6#FgenF\^o>FO7$7%Fg^o,$F\_o#FepFBFa_oFc
p>FOFcpFjclF$F$F$>FbrF`\l>Fj[mFc\l>FL7#-F_tF\s>FO7#-F_t6#Fj[m@+5Fccn/FbrFj[mFe_
m3/Fddn-F_t6$F]oFbr/Fddn-F_t6$F]oFj[mFe_mFa`o@%55/-F^[oFVFcp2FdenFepFfenFe_m-FX
6#*&-F\fn6$*&&FOF_qFep&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Fep,&FipFepF`]nFepF$,&&Fhn6#Fi[
pFepF\]pFepF$Fep6#%]qthis~is~the~function~for~a~simple~lie~algebra,~that~does~t
he~simplification~of~algebras~of~type~BnGF$F$%&BnmatGRFcvFd\nF<F$C&@$FhvFiv>FLF
^w>&FLFj\nF`]nFf]n6#%7generates~an~Bn~matrixGF$F$%%compGR6%'Fgjn-F-6#Fjw'%)unsi
mplVGFhw'%"bGF\_p6.F7F2F4%&PreviG%,BracketListG%&LeastG%(LowMarkG%)HighMarkGF1F
8%(leadofVG%(VinlistGF$F$C3@'2F]yFCFD/FCF]yC%>Fj[mFM>FO&FH6#F]yFTC$>Fj[mFM>FOFM
>Fhn-%)simplifyG6$FgxFO>Feo-FhalFdr@(-Fey6$FhnFbal@$/-FauFdrFcp-FE6$%Cterms~in~
sum~are~not~homogenous~inG%"zG/FhnF]oFe_m-Fey6$Fhn%)constantG-FE6#%fnmiddle~ter
m~simplifies~to~a~constant,~which~is~not~allowed.G@$-Fey6$FeoF_hlC$>Fhn*&FhnFep
-F_t6$FepFeoFhq>Feo*&FeoFepFcbpFhq>F^[o-Fgbm6$R6#F[cmF$F$F$@%F^cmFc\lFfnF$F$F$7
#-Fb\m6$FeoFO>FL7%Fajm-F_t6#F^[o-F_t6#Feel>F]r,&Fe`lFepFepFep>Fbr,&Fe`lFep-FjpF
ccpFep>Fjr&-%%sortG6$FLF_sF][l>FfrFcp>FbpFep?(F$FepFepF$1FbpFcgnC&>F_oFbp?(F$Fe
pFepF$3-%#&=G6$&FLF]vFjr2FbpFcgn>Fbp,&FbpFepFepFep@)31F_oF]r2FbrFbp>Ffr7$&FfrF$
7$&&FL6#;F_o,&F]rFepFhqFepF$7$7#Fhn-%+lieconvertG6$&FL6#;,&FbrFepFepFepFbpFO3Fa
ep1F]rFbpC$@%/F_oF]r>Ffr7$FeepF]fp>Ffr7$Feep7$FgepF]fp>FbpFbr/F_oFbp>Ffr7$FeepF
[ep@%3Fifp/FbpFbr>FfrF[gp>Ffr7$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F^co>F]rFcp?(FbpFepFep-FjpFdsFfoC$>&FjrF]v-Feo6#F\\r@&
/F\\rFcpFe_m2FbpFc[m@%/&F\\rF][l&F\\rFQ>F]r7$F_do&Fffn6#&Fd\rF$>F]r7$F_do,&Fh\r
Fep&Fffn6#&Fe\rF$Fep>F]rF]eo>Fhn-Fav6#-Fjp6#&&FjrF][lF][l@'Feeo>F]r-Fgbm6%RFjbm
F$FjinF$@%F^cmF\foF^foF$F$F$F]rFhnF_fo>F]rFbfo>F]rFjfo@%F]goFe_mC%@%Feeo>FhnFcf
o>FhnF]r@%-Fey6$FhnF_hlC$>FfrFb`m>FhnFd`m>FfrFep@%/-F_t6$F]oFhnFddn-FX6#-F]ho6$
<#-F[o6$/&FddnF]vF]o/Fbp;F[eoFe]rF]rC'>FL7#-F_tF[q>FO7#-F[o6$F]o/FbpFO?(F_oFepF
epF[_oFfo>Fcao,&FdboFep&FL6#,(FcgnFepFepFepF_oFhqFep>FcaoFdbo-FX6#*&FfrFep&F__r
FifnFep6#%]qthis~is~the~function~for~a~simple~lie~algebra,~that~does~the~simpli
fication~of~algebras~of~type~CnGF$F$%'expandGR6#'Fafl%)anythingG6$%'TermsXG%'Te
rmsYGF$F$@+Fe[mF]\l3-Fey6$F`\lFbal-Fey6$Fc\lFbal-FX6#-Fgbm6%RFjbmF$F$F$-Fgbm6%R
FjbmF$F$F$-Fht6$FgxFfnF$F$F$FgxFfnF$F$F$F`\lFc\lF\br-FX6#-Fgbm6%RFjbmF$F$F$Figl
F$F$F$F`\lFc\lF^br-FX6#-Fgbm6%RFjbmF$F$F$FhbrF$F$F$Fc\lF`\lF]\l6#%XExpands~a~Li
e~expression,~pulls~constants~to~the~front.GF$F$%*stablesetGR6$'%"RG-F-6#Fhw'%&
AlphaGF,6YF1F2F4F5F6Fefl%"QGFdflFcfl%&time0G%&time1G%&time2G%&time3G%&time4G%&t
ime5G%&time6G%&time7G%(timetotG%)timehallG%(timelocG%(timeredG%(timesubG%)timec
ompG%+printc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duFeu@$0FfrFjr@'3/Fgx%">
G2FjrFfr-FX6#Ffo3/Fgx%"<G2FfrFjrFabu-FX6#F%@%53F^bu2F`_uFdjm3FdbuF__uFabuFgbu6#
%_^levaluate(monomial,~operator,~monomial)~evaluates~the~relation~between~two~|
+~~~~~~~~~~~~~~~~non-commutative~expressions~are~the~same~or~not.~Returns~a~boo
lean.~Side~effect:~|+~~~~~~~~~~~~~~~~doesn't~work~with~negative~values~(since~o
p(-x)~=~-1,x);~works~only~with~the~|+~~~~~~~~~~~~~~~~default~set~of~generatorsG
F$F$%&FnmatGRFcvFd\nF<F$C&@$Fg\nFiv>FLF^w>&FL6$F_]nF[]nF`]nFf]n6#%7generates~an
~Fn~matrixGF$F$FghtR6$'%#E1GFhw'%#E2GFhw6+F4F9F:F__l%$RemGF1F2%#L1G%#L2GF$F$C+@
'FhasFDFiasC%>FjrFM>F]rF]bs@$0FMF]r-FUFhrC$>FjrFM>F]rFM>Fbr7#-Fb\m6$-FhalFc]mF]
r>Fj[m7#-Fb\m6$-Fhal6$FgxF]rF]r@%2Fj]tF[sC$>FO&Fbr6#;,(F[sFepFj]tFhqFepFepF[s>F
fr&Fbr6#;Fep,&F[sFepFj]tFhqC$>FOFbr>FfrFcp>FbpFj[m>F_oFcp?(FLFepFepFgenFfo@$/&F
O6#;FLFgen&Fbp6#;Fep,(FgenFepFepFepFLFhq>F_o7$&F_oF$7%7$Feep&&FOF]]sF$F_gu&Fbp6
#;,(FgenFepFBFepFLFhqFdjm@$Fj[nF[\n-FXF_q6#%droverlap()~picks~out~the~overlaps~
of~the~end~of~A~(1st~arguments)~and~the~|+~~~~~~~~~~~~~~~beginning~of~B~(second
~argument)GF$F$%%dumpGRF$F$F$F$@'Fb^n-FX6#/FM-%-anglebracketG6#&FduF$-Fey6$Fb`n
F_]l@%0-F_t6$F]y-F_y6#Fb`nFh`l-FX6#FciuFf`l-FX6#Fd[l6#%indebugging~tool,~dumps~
a~procedures~hash~table~(remember~table)GF$F$%/sorted_leadingGRFdhmF$F$F$@%F]jm
-FXFfhrF]\l6#%dpReturns~the~leading~term~of~the~sorted~sum|+~~~~~~~~~~~~~~~~wit
h~the~leading~coefficient~1GF$F$FhalRFdhm6%%(MinTermGF2F1F$F$C&@'FAFDFI@%F\imC%
>FbpFM>FOFPFTC$>FbpFM>FOFMC$>FbpFM>FOFM@%F]jm>FL&-F^dp6$F`jmF_sF][l>FLFfn@$3FI0
FbpFM-FUF]vFhjr6#%esPicks~out~the~leading~term~from~the~sum~(the~term~with~the~
maximum~value),|+~~~~~~~~~~~~~~~~and~also~checks~for~the~terms~to~be~homogenous
.GFa\nF$%/epsilon_type_EGRF_dl6&F4F5F__lFevF$F$C&>FbpF]o>F_o-Fjp6#-%(convertG6$
-&%'linalgG6#%$rowG6$FeelFepF-?(FLFepFepFe`lFfo?(FOFepFepFjdlFfo@$5553/FL,&FOFe
pFepFep1FL,&F_oFepFjanFep3/FLFi]v/FO,&F_oFepF`]nFep3/FLF]^v/FO,&F_oFepFhqFep3F[
^v/FOF_o>FbpF^elFgel6#%@epsilon~function~for~En~algebraGF$F$%$&!<GR6$F`dlFadlF$
F$F$-FX6#-%+comparewtsG6%FfnFebuFgx6#%dqlist~&!<~list~defines~the~operator~"&!<
",~which~is~interface~to~the~|+~~~~~~~~~~~~~~~~~function~comparewtsGF$F$%&Gnmat
GRFcvFd\nF<F$C&@$FhvFiv>FLF^w>FbdqFjanFf]n6#%7generates~an~Gn~matrixGF$F$F_aqRF
[du6(F4F1F2F__lF9F:F$F$C(@'FhasFDFiasC%>FOFM>FbpF]bs@$0FMFbpF[\vC$>FOFM>FbpFM>F
fr7#-Fb\m6$-Fhal6$FfnFbpFbp>Fjr7#-Fb\m6$-Fhal6$FgxFbpFbp@%/FfrFjr>F_o7%FcpFfnFc
pC$>F_oFcp?(FLFepFep,(Fi[rFepFacoFhqFepFepFfo@$/Ffr&Fjr6#;FL,(FLFepFacoFepFhqFe
pC$>F_o7%&FjrF]]sFfn&Fjr6#;,&FLFepFacoFepFi[rFiq@$0FOFMFTFbhu6#%`qsubwd()~picks
~out~the~subword~E1~in~E2~and~returns~a~and~b~in~a~list,|+~~~~~~~~~~~~~~~~where
~E2~=~aE1bGF$F$F]_vR6%'%#W1GF,'%#OPGF]^u'%#W2GF,6$F4%%FlagGF$F$C&@&0Fe`l-FjpFec
p-FE6'%,the~weightsGFfn%$andGFeel%Gare~of~non-equal~length,~can't~compareG4-F[u
6$Fgx<'%"=G%#>=GF_bu%#<=GFebu-FE6%%*operationGFgx%1is~not~supportedG>FOFfo?(FLF
epFepFe`lFfo@$5553Fdbu42F[cl&FeelF\p3F^bu42FbevF[cl3/FgxFddvFeev3/FgxFcdvFaevC$
>FOF%FiqFjcl6#%bschecks~for~W1~to~be~less~than~or~equal~to~W2~(this~relationshi
p|+~~~~~~~~~~~~~~~has~to~hold~for~all~corresponding~elements~in~the~lists)GF$F$
%$&!>GRFi^vF$F$F$-FX6#-F]_v6%FfnF_buFgx6#%dqlist~&!>~list~defines~the~operator~
"&!>",~which~is~interface~to~the~|+~~~~~~~~~~~~~~~~~function~comparewtsGF$F$%/e
psilon_type_AGRF_dlF`\vF$F$C&>FbpF]o>F_oFd\v?(FLFepFepFe`lFfo?(FOFepFepFjdlFfo@
$53Ff]v1,$FOFBF_o3/FL,&FOFepFhqFep2F_o,$FLFB>FbpF^elFgel6#%@epsilon~function~fo
r~An~algebraGF$F$%(rankingGR6#'%)MonomialGFhw6)F4F5Fedm%&valueGFffl%"fG%)positi
onG6#F>F$C(>FbpFh^u>F_oF]o>Ffr,&-Fjp6#FduFepFepFep>Fjr*$FfrFhq?(FLFepFepFdjmFfo
C%-F[u6%Fi_uFdu.F]r>F_o,&F_oFep*&F]rFepFjrFepFep>Fjr*&FjrFepFfrFhqFbhu6#%epgive
s~a~numerical~rank~to~a~monomial;~to~be~used|+~~~~~~~~~~~~~for~comparison~of~mo
nomials;GF$F$%*sortscaleGRFdhm6'F2F1FcflFaxF6F$F$C%@'FAFDFI@%F\im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FX6#-F]ho6$<%/&F
ddn6#""&F]o/&FddnF^aw&FddnFb`p/F^dwF]oFjrC%>FLFj_o>FO7&,&&FLF][lFep&FLFjcwFep,&
&FLFQFep&FLFb`pFep&FLFb[m&FLF^aw-FX6#*&F_oFep&Fe`oFifnFep6#%]qthis~is~the~funct
ion~for~a~simple~lie~algebra,~that~does~the~simplification~of~algebras~of~type~
F4GF$F$Fg[lRFew6(%&tableGF4F\xF]x%%tempG%(entriesGF<F$C'>FL-F_t6$F]y-F_y6#%&sto
reG@%3-Fey6$FfnFeal2FepFe`lC$>FbpF`\l>F_oFc\l-FE6$%Jnot~a~valid~expression~to~f
ind~a~rule~forGFfn@%FcasFiiu>FjrF[gm?(FOFepFepFi[rFfoC$>Ffr-F_t6$Fep&FjrFV@)3-F
ey6$FbpFi\l-Fey6$F_oFi\l@&33333/Fbp-F_t6$FepFfr/F_o-F_t6$FBFfr-Fey6$F\cn-F-6#Fi
ap/F\cn7#-F_t6#F^hw-Fey6$F_cnFehw/F_cn7#-F_t6#Fahw-FX6#-F_t6$FBF`gw333/Fgdn-F_t
6$F]o&-F_tFbsF][l/Fjdn-F_t6$F]o&F\jwFQ/-Fjp6#F\cn-Fjp6#-%'removeG6%Fey7#-F_t6#F
[jwF//-Fjp6#F_cn-Fjp6#-Fgjw6%Fey7#-F_t6#F`jwF/@%/FihwF_iw-FX6#-%(unapplyG6$Fciw
Fihw-FX6#-F[\x6%FciwFihwF_iwFcgw@&FjgwFaiw33Fhiw/F_oF`jwFajw@%/FihwF_o-FX6#-F[\
x6$FciwF_o-FX6#-F[\x6%FciwFihwF_oFegw@&33F\hwF[iwF]iwFaiw33/FbpF[jwF]jwF\[x@%/F
bpF_iw-FX6#-F[\x6$FciwFbp-FX6#-F[\x6%FciwFbpF_iw@$3Fd]xFd\xFaiwFiiu6#%\]lfuncti
onize(expression),~if~possible,~finds~the~rule~in~the~lookup~table~that~|+~~~~~
~~~~~~~~~~suits~the~given~expression,~and~returns~that~rule~converted~into~a~ma
ple~function;|+~~~~~~~~~~~~~~~when~no~corresponding~rule~is~found~or~the~lookup
~table~is~empty~FAIL~is~|+~~~~~~~~~~~~~~~returnedGF$F$%$&!=GRFi^vF$F$F$-FX6#-%&
evalbG6#/FfnFgx6#%dqlist~&!=~list~defines~the~operator~"&!=",~which~is~interfac
e~to~the~|+~~~~~~~~~~~~~~~~~function~comparewtsGF$F$FhtR6$'F9Ffar'F:FfarF$F$F$@
-5-Fey6$FfnFiap-Fey6$FgxFiap-FX6#*&FfnFepFgxFep35-Fey6$FfnFjwF`fw5-Fey6$FgxFeal
-Fey6$FgxFjw-FX6#-Fet6#FiglF^cm-FX6#*&F`\lFep-FhtFccmFepF[ir-FX6#*&FcirFep-Fht6
$FfnFeirFep5F]jmFjgr-FX6#-FbarFd`x-FE6%FfnFgx%Aare~not~defined~in~this~context.
GF$F$F$FboRFi^vF$F$F$-FX6#-F]_v6%FfnFcdvFgx6#%fqlist~&!>=~list~defines~the~oper
ator~"&!>=",~which~is~interface~to~the~|+~~~~~~~~~~~~~~~~~function~comparewtsGF
$F$%/factorsimplifyGRF\jp6-FcjpF4F5FbxFdjpFcflF2FejpFgcmF1F_pFchvF$C,>F_oFjjp>F
]r&7#&F_oFezF][l>Fbr&FebxFQ>Feo-FauFc]m>FL-F^]q6$FeoFgx@$/FcgnF]oFe_m>Ffr&&F_o6
$FbrFg]qFQ@%-Fbo6$Feo7#-F[o6$F]o/FOFeo>Ffr-Fgbm6&RFc^qF$F$F$@$Fe^qFfnF$F$F$FfrF
eoF]r>Ffr-Fgbm6&RFc^qF$F$F$@$F__qFfnF$F$F$FfrFeoF]r@$-F[u6$FfnFLF]\l?(FbpFepFep
FacoFfoC$>Fjr-F_aq6%FdcoFfnF]r@$0FjrFcpC'>Fj[m,&FfnFep-Fggl6$-Fh^p6$FjesF]rF]rF
hq@$/Fj[mF]oFe_m@$F[cw-FX6#*&F[`mFep-F^bx6$F]`mFgxFep@%Fads-FX6#-Fgbm6$RF[cpF$F
$F$@%F^cm*&F`\lFep-F^bxF\emFep-F^bxFaemF$F$6$F`jpFgxFj[m-FX6#-F^bxFc\mFiqF$F$F$
%,independentGR6#'F]_lF-6-F4F5F6%*SimplListG%%VarsGF1F2%(VectorsG%.LinIndVector
sGF__l%+addelementGF$F$C1>FeoR6$'%(ElementGFhw'F3%$setGF$F$F$@'F^cm-FX6#-%&unio
nG6$Fgx<#Fc\l4Fc_x-FX6#-Fbhx6$Fgx<#Ffn-FXFezF$F$F$@$FAFD@%FI@%F\imC%>FjrFM>F]rF
PF[euC$>FjrFM>F]rFM>F]rFM-%%withG6$F[]v%'vectorG-Fgix6$F[]v%&basisG>Ffr<">F_o-%
&arrayG6#F^\o?(FLFepFepFe`lFfoC$>F\au-Fh`p6$F[clF]r@%-Fey6$F\auFbal?(FOFepFep-F
jp6#F\auFfo>Ffr-Feo6$-F_t6$FOF\auFfr>Ffr-Feo6$F\auFfr>Fbr7#-F[o6$-Fiix6$FacoF]o
/FL;Fep-Fjp6#7#-F_]wF_q?(FLFepFepF^\yFfo?(FOFepFepFacoFfo@(Fijx?(FbpFepFepF\[yF
fo@&-Fey6$-F_t6$FbpF\auF_hl@$/-F_t6$FBFi\y&FfrFV>&&FbrF\pFV,&Fa]yFep-F_t6$FepFi
\yFep/Fi\yF_]y>Fa]y,&Fa]yFepFepFep3-Fey6$F\auF_hl/-F_t6$FBF\auF_]y>Fa]y,&Fa]yFe
p-F_t6$FepF\auFep/F\auF_]y>Fa]yFh]y>Fj[m-F\jxF\s>FhnFcp?(FLFepFepFj]tFfo@$-F[u6
%&Fj[mF\pFbr.Fbp>Fhn7$F_`rF[ds@$Fi[nF[\n-FXF[q6#%jqindependent([list~of~express
ions])~picks~out~the~linearly~independent~expressions~|+~~~~~~~~~~~~~~~from~the
~listGF$F$FhoRFi^vF$F$F$-FX6#-F]_v6%FfnFddvFgx6#%fqlist~&!<=~list~defines~the~o
perator~"&!<=",~which~is~interface~to~the~|+~~~~~~~~~~~~~~~~~function~comparewt
sGF$F$%*checktabsGRF$6%FierFedm%$indGF$F$C$>FO7#-F_]w6#-F_t6$F]y-F_y6#Fggl?(FLF
epFepFgenFfoC&>FbpFg\o-Fjft6#-F_t6$FepFbp@&-Fey6$F]ayFbal>&Fd`yF]v-Fet6#&Fd`y6#
F]cn4-Fho6$-FauF\ay7%FepFepFep>Fcay-Fet6#Fcay-Fjft6#-Fjp6#Fa`yF[flF$F$%8simplef
unction_G_matrixGRFh]w6'FfbnFgbnFhflFifl%)TrueGensGF$F$C(>FbpF`\l>F_oFc\l>FLF\c
n>FOF_cn>Ffr&F[y6$%#G2GF_]w@-FbcnFe_mFbdnFe_mFcdn@%3-F[u6$FOFfrFbenFhenFe_mFidn
@%3-F[u6$FLFfrF_gnFdgnFe_m3FhcyFdcyC%>FL-%)G2LookupG6#-Fet6#-Fht6$FbpF_o@$/FLFd
[l>FL,$-F^dy6#-Fet6#-Fht6$F_oFbpFhqFhjrFe_m6#%]qthis~is~the~function~for~a~simp
le~lie~algebra,~that~does~the~simplification~of~algebras~of~type~G2GF$F$Fj^wRF$
F$F$F$C$F>@%Fb^nCR>-Fj^w6#7&FepF]oF]oF]o7$7(FepF]oF]oF]oF]oF]o7(F]oF]oF]oF]oFep
F]o>-Fj^w6#7&F]oFepF]oF]o7$7(F]oFepF]oF]oF]oF]o7(F]oF]oF]oFepF]oF]o>-Fj^w6#7&F]
oF]oFepF]o7#7(F]oF]oFepF]oF]oF]o>-Fj^w6#7&F]oF]oF]oFep7#7(F]oF]oF]oF]oF]oFep>-F
j^w6#7&FepFepF]oF]o7$7(FepFepF]oF]oF]oF]o7(F]oF]oF]oFepFepF]o>-Fj^w6#7&F]oFepFe
pF]o7$7(F]oFepFepF]oF]oF]o7(F]oF]oFepFepF]oF]o>-Fj^w6#7&F]oF]oFepFep7#7(F]oF]oF
epF]oF]oFep>-Fj^w6#7&FepFepFepF]o7$7(FepFepFepF]oF]oF]o7(F]oF]oFepFepFepF]o>-Fj
^w6#7&F]oFepFepFep7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hzFjanF`]n7#7(FhqF`
]nFjanF`]nFhqF`]nFiiu6#%fnthis~is~for~looking~up~what~indices~in~F4~unfold~into
~in~E6GF$F$%)symbasisGR6#'F+Fehw6)%&isposG%.GenerateBasisGFejpFbx%*IdealGensG%(
AlgGensGF2F<F$C&>FOR6''F+F-'FfizF-'FgizF-Fiw'%$NegG%(booleanG6&F4%"WGFcflF__lF<
F$C&>F_oF^jx?(FLFepFepFhcvFfoC$>FO-%$zipG6&RFjbmF$FjinF$,&FfnFepFgxFhqF$F$F$Ffn
-Fau6$FbevF[hlF]o@&39(4F]dnC$>Fbp-Fj\s6'FOFgxFeelF[hlFb[[l>F_o-Fbhx6$F_o<#-F_t6
#-Fgbm6%RFjbmF$F$F$-Fet6#FhbrF$F$F$FbpFbev45Fb[[lF_dnC$>FbpFf[[l>F_o-Fbhx6$F_o<
#-F_t6#-Fgbm6%RFjbmF$F$F$Fa\[lF$F$F$FbpFbev?(FLFepFepFjdlFfo@$/Ffn-Fau6$Fe\sF[h
l>F_o-Fbhx6$F_o<#Fe\s-FX6#-F\gx6$F_cnF[hlF$F$6$FeizFO@'FAFDFI>FbpFP-FX6#-F_izFe
n>F_o-F_t6$F]y-F_y6#%&idealG@%0F_oFh`l@%-F[u6$7#FbpF`\yC'>Ffr7#&F_oF]v>F]r&F_o6
$Fbp%(algebraG>F_o-F_t6$F]y-F_yFf\w@%Fj^[l>Fjr7#&F_oFhr-FE6#%Athere~are~no~gene
rators~defined.G@'-Fbo6$Ffn7#-F[o6$F]o/F4Ffn@%/-Fgbm6%RFjbmF$F$F$@$-Fho6$-FauFj
gl7#-F[o6$F]o/F4Faa[lFgbuF$F$F$FjrF]rFcp-FX6#-FO6'FfnFfrFjrF]rFfoF^^o-FhoFd`[l@
%/-Fgbm6%RFjbmF$F$F$@$-FboF`a[lFgbuF$F$F$FjrF]rFcp-FX6#-FO6'FfnFfrFjrF]rF%F^^o-
FE6%%8received~a~mixed~weightGFfn%Jwhich~should~either~be~pos,~neg,~or~zero.G-F
E6$%-not~an~idealGFbp-FE6#%=there~are~no~ideals~defined.G6#%fosymbasis([weight]
)~generates~the~basis~of~an~algebra~for~a~specified~weightGF$F$%-leading_pairGR
FdhmFdjuF$F$C&@'FAFDFI@%F\imC%>FbpFM>FOFPFTC$>FbpFM>FOFMC$>FbpFM>FOFM@%F]jm>FLF
d[v>FLFfn@$Fi[vF[\v@%F]hl-FX6#7$FbhlFhhl-FX6#7$FepFL6#%`wPicks~out~the~leading~
term~from~the~sum~(the~smallest~term~with~respect~to~&<~order),|+~~~~~~~~~~~~~~
~~and~also~checks~for~the~terms~to~be~homogenous.~~~~~~~~~~~~~Returns~a~list:~[
coefficient,~term]GFa\nF$FcgmRF_fl6.F4F__lFbxFcflFdflFeflFfflFhflFifl%%LgenG%%A
lg1G%%Alg2GF$F$C/>FbpFdjl>F_oFjjl>FfrF][m>FjrF_[m>F]rFa[m@%Fe[mF]\lC$>FbrF`\l>F
j[mFc\l>Fhn7#-Fb\m6$FbrFgx@)-Fhs6$FhnFfr>FeoFfr-Fhs6$FhnFjr>FeoFjr-Fhs6$FhnF]r>
FeoF]rC&>F_o-FcgmF_f[l@$F]amFe_m@$Feam-FX6#*&FiamFep-Fcgm6$-Fht6$F]bmFj[mFgxFep
@%-Fey6$F_oFbal-FX6#-Fgbm6$RF[cpF$F$F$@%F^cm*&F`\lFep-Fcgm6$-Fht6$Fc\lFj\sT&Fep
-Fcgm6$-Fht6$FfnFj\sFdh[lF$F$6&FiflFj[mF2FgxF_o-FX6#-Fcgm6$-Fht6$F_oFj[mFgx>Fhn
F`\m@)Faf[l>F^[oFfrFdf[l>F^[oFjrFgf[l>F^[oF]rC&>F_o-FcgmFc\m@$F]amFe_m@$Feam-FX
6#*&FiamFep-Fcgm6$-Fht6$FbrF]bmFgxFep@%Fgg[l-FX6#-Fgbm6$RF[cpF$F$F$@%F^cm*&F`\l
Fep-Fcgm6$-Fht6$Fj\sFc\lFdh[lFep-Fcgm6$-Fht6$Fj\sFfn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x-FhsFj`vF]\l-FE6%Ffn%3not~a~generator~inGFbpF]jm-FX6#-Fgbm6
$RF[cpF$FjinF$@%F^cm*&F`\lFep-FgglFch[lFep-FgglFhh[lF$F$F`e\lFfnF^cm-FX6#*&F`\l
Fep-Fggl6$Fc\lFbpFepC%@%-F[u6$Fbp%+TRIANGALGSG-FX6#-FbcmFj`vC$>Fbr-Fht6$-Fggl6$
F`\lFbpFgf\l@)Fed\l-FX6#-Fgbm6$RF[cpF$FjinF$@%F^cmFaf\lFcf\lF$F$F`e\lFbrF]d\l-F
X6#*&F^_\lFep-FgglFcd\lFepF[d\lC$>-FgglFj`vF]oFe_mC$>FjrF^_\l>F]rFb_\l@$-F[u6$F
bp%+DIRECTSUMSGC$>F_o-FLFj`v@%F`gpFe_m>FbpF_o@%-F[u6$Fbp%*WITHRULESG-FX6#-Fcw6$
-Fet6#-Fht6$FjrF]rFbpC%>FOFMF[\v@)-FidpF\j\lC%FT>Fdh\lF]oFe_m-Fj[uF\j\lC&FT>Fj[
m,$-Fggl6$-Fht6$F]rFjrFbpFhq>Fdh\lFj[m-FXF\`o53-F_sF\j\l-Fhs6$F]rFbp3-Fey6$F]rF
eal-%$&>=G6$FjrFcfoC&FT>Fj[mF[j\l>Fdh\lFj[mF\[]lC&FT>Fj[m,&-Fggl6$-Fht6$-FhtFg[
]lFgfoFbpFep-Fggl6$-Fht6$Fcfo-Fht6$FjrFgfoFbpFep>Fdh\lFj[mF\[]l6#%`]lmainsimpli
fy(expression<,algname>)~simplifies~an~expression~containing~Hall~Monomials~|+~
~~~~~~~~~~~~~and~returns~the~simplified~expression;~precondition:~in~the~expres
sion~brackets~|+~~~~~~~~~~~~~~have~to~be~placed~around~constant~*~generator~~(i
e~instead~of~2*x&*y~use~|+~~~~~~~~~~~~~~(2*x)&*y)GF$F$F^dyRF$6$FgjnFa_pF$F$C$F>
@%FIC`o>FLFb`n>FOFP>-F^dy6#-Fet6#-Fht6$&FL6$FepF]o&FL6$F]oFep&FLF`^t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pFfelFB/-F`]o6#,&FLFep
FOFhqFep>F_c_lFhq-FX6#-Fg\v6$FbpFddl6#%Vthe~base~matrix~off~all~matrices~(for~a
lgs~An,..,~Gn)GF$F$Fb\mRFdar6%F]_lF2FfjpF$F$C%@'FAFDFI>FOFP>FOFM@'Ff[m>FLFfnF^c
m>FL-F_t6#Fc\l>FLFajm@%/-Fjp6#Ff\qFep@%-FhsFfelFhjr-FE6%FL%<is~not~a~valid~gene
rator~inGFO-FX6#&-Fgbm6%RFjbmF$F$F$Fja\lF$F$F$Ff\qFOF$6#%fvextract(expression)~
picks~out~all~the~generators~from~a~given~non-commutative~|+~~~~~~~~~~~~~~~~exp
ression~and~returns~them~in~a~list;~side~effects:~ignores~constants~inside~the~
expressionGF$F$F$
