using System; using System.Numerics; using Skeleton.Algebra.Matrices; using Skeleton.Constants; namespace SkeletonTest.tests; public static class EigenValueTest { [Test] public static void AlgebraicMultiplicityTest() { string dumpString = "58,238,232,169,50,231,237,63252,28,121,1,53,106,202,63128,170,57,130,152,251,200,6340,128,219,130,233,145,181,6332,11,248,186,212,100,180,63204,48,165,236,132,31,199,63122,140,15,0,86,127,198,191222,180,98,122,22,20,193,63146,3,107,71,5,99,236,6322,210,160,78,188,185,177,191147,191,234,27,57,143,209,63240,146,207,126,75,149,210,1910,134,112,227,222,35,117,19152,213,176,25,233,25,200,63214,26,125,2,184,174,214,19188,13,118,78,172,199,200,191113,113,137,16,1,113,236,6358,148,110,160,208,108,187,191"; SU3 x2 = Matrix.Resolve(dumpString).MatrixCast(); x2.Log(); SU3 x = new ( 0.9344724005272333 + 0.20636618205956114 * AlgebraConstant.I, 0.19517809256224794 + 0.08425769276391348 * AlgebraConstant.I, 0.07966355862303631 + 0.18064939074463948 * AlgebraConstant.I, -0.17576098444905935 + 0.13342553115709327 * AlgebraConstant.I, 0.8870874781497256 - 0.069240349956836 * AlgebraConstant.I, 0.2743666432024778 - 0.29036223777647674 * AlgebraConstant.I, -0.005161162050201451 + 0.18829072718077955 * AlgebraConstant.I, -0.35441398852382855 - 0.1935935385809937 * AlgebraConstant.I, 0.888794452952011 - 0.10712913433833729 * AlgebraConstant.I ); x.Log(); Assert.IsTrue(x.IsEqualApprox(x2)); SU3 xx = new ( 0.900968867902419 + 0.4338837391175583 * AlgebraConstant.I, 0, 0, 0, 0.7844948739101761 - 0.07642217128558915 * AlgebraConstant.I, -0.43828707593371596 + 0.4320091244570258 * AlgebraConstant.I, 0, 0.5823247448725786 + 0.1990611364725401 * AlgebraConstant.I, 0.7399637958509763 - 0.27152557206488276 * AlgebraConstant.I ); xx.Log(); } [Test] public static void EigenValuesTest0() { C33 x = new ( 0.9344724005272333 + 0.20636618205956114 * AlgebraConstant.I, 0.19517809256224794 + 0.08425769276391348 * AlgebraConstant.I, 0.07966355862303631 + 0.18064939074463948 * AlgebraConstant.I, -0.17576098444905935 + 0.13342553115709327 * AlgebraConstant.I, 0.8870874781497256 - 0.069240349956836 * AlgebraConstant.I, 0.2743666432024778 - 0.29036223777647674 * AlgebraConstant.I, -0.005161162050201451 + 0.18829072718077955 * AlgebraConstant.I, -0.35441398852382855 - 0.1935935385809937 * AlgebraConstant.I, 0.888794452952011 - 0.10712913433833729 * AlgebraConstant.I ); Console.WriteLine(x.PythonRepresentation); foreach (Complex ev in x.EigenValues()) Console.WriteLine(ev); } [Test] public static void EigenValuesTest1() { // skew hermitian SU3 a = new SU3(//90 iterations needed 63ms -0.41682645597518747 - 0.04513264449558757 * AlgebraConstant.I, -0.562495137600655 - 0.25770471508224335 * AlgebraConstant.I, 0.23593397061664254 - 0.6210808413637191 * AlgebraConstant.I, -0.05956034617712977 + 0.59806270818534 * AlgebraConstant.I, 0.5101583950751629 + 0.16421725718762056 * AlgebraConstant.I, 0.47668976878561187 - 0.3525784039791803 * AlgebraConstant.I, -0.5813526822815206 - 0.3535836125237688 * AlgebraConstant.I, 0.5720026837092955 - 0.052645362620770714 * AlgebraConstant.I, -0.3928619416491455 - 0.2295834884879076 * AlgebraConstant.I ); try { a.Log(); } catch { Assert.Fail(); } } [Test] public static void EigenValuesTest2() { SU4 x = new SU4(-0.779847526429233 - 0.2685329483801642 * AlgebraConstant.I, -0.3671906793704016 + 0.20504085759385277 * AlgebraConstant.I, 0.1797326418785119 + 0.28869090035325307 * AlgebraConstant.I, -0.15699955803429697 + 0.05061643143068167 * AlgebraConstant.I, -0.12145228366009361 + 0.2219828375642076 * AlgebraConstant.I, -0.03499946085775628 + 0.2629095057479602 * AlgebraConstant.I, -0.567103313710783 + 0.2662838502567337 * AlgebraConstant.I, 0.2878300706241982 - 0.6247136826282005 * AlgebraConstant.I, 0.2853497437972582 - 0.01779705644091366 * AlgebraConstant.I, -0.41034837274261327 + 0.0923456495251366 * AlgebraConstant.I, 0.6481741606884517 + 0.060846786206961295 * AlgebraConstant.I, 0.4298166035109582 - 0.3643774085595283 * AlgebraConstant.I, 0.05763481181747576 - 0.413083370206058 * AlgebraConstant.I, 0.5679484644041604 + 0.5032930726822459 * AlgebraConstant.I, 0.0980393693330078 + 0.24165407559606544 * AlgebraConstant.I, 0.37281407453762927 + 0.20777930150098434 * AlgebraConstant.I ); LieSU4 lsu4 = x.Log(); try { lsu4.Exp(); } catch { Assert.Fail(); } } [Test] public static void EigenValuesTest3() { SU4 a = new SU4( 0.2780441294545625 + 0.19434718200997803 * AlgebraConstant.I, 0.6094077829723441 - 0.1163734891346272 * AlgebraConstant.I, -0.5767312412823015 + 0.2533899606424308 * AlgebraConstant.I, 0.010321491186588205 - 0.3210421623311934 * AlgebraConstant.I, 0.8990123896499085 + 0.15176635070803396 * AlgebraConstant.I, -0.22706249712540277 + 0.11668385179642621 * AlgebraConstant.I, 0.013997621769215651 - 0.22622336886409927 * AlgebraConstant.I, -0.12783033769259322 + 0.1893611837411106 * AlgebraConstant.I, 0.07111120550135545 - 0.017687997567439967 * AlgebraConstant.I, 0.39108090353805214 - 0.5931139251255253 * AlgebraConstant.I, 0.23802672123855062 - 0.44783907804266015 * AlgebraConstant.I, 0.41808364215728316 + 0.24060639687896418 * AlgebraConstant.I, 0.09132385258653822 - 0.19988651308258049 * AlgebraConstant.I, 0.1957076704935428 + 0.08292751430336807 * AlgebraConstant.I, 0.4136701345595704 - 0.35137176475490917 * AlgebraConstant.I, -0.2812055078850708 - 0.7299761886250002 * AlgebraConstant.I ); LieSU4 w = a.Log(); try { w.Exp(); } catch { Assert.Fail(); } } [Test] public static void EigenValuesTest4() { SU4 x = new SU4( 0.25169715721780095 - 0.3262818747696454 * AlgebraConstant.I, -0.06215393129320365 - 0.4816491933228719 * AlgebraConstant.I, 0.25169715721780095 - 0.3262818747696454 * AlgebraConstant.I, 0.6152713907633685 + 0.2144047984418787 * AlgebraConstant.I, 0.2787550780796054 + 0.22851703444051924 * AlgebraConstant.I, 0.35445639658760586 - 0.570912274248332 * AlgebraConstant.I, -0.5660185516284082 - 0.06586284820255425 * AlgebraConstant.I, -0.10741084418381291 - 0.28678110892615927 * AlgebraConstant.I, -0.31804746877893 - 0.19600790769136783 * AlgebraConstant.I, 0.23979550077869344 - 0.3936365944332084 * AlgebraConstant.I, 0.5899535555161333 - 0.007539030384152989 * AlgebraConstant.I, -0.3590019428886613 - 0.413510129757416 * AlgebraConstant.I, -0.561714694163377 - 0.4951439798153037 * AlgebraConstant.I, 0.2959147328215392 - 0.11204285633378004 * AlgebraConstant.I, -0.3917663713238493 + 0.06237659287659594 * AlgebraConstant.I, -0.04502121234778653 + 0.4240180093544583 * AlgebraConstant.I ); var lx = x.Log(); try { lx.Exp(); } catch { Assert.Fail(); } } [Test] public static void EigenValuesTest5() { SU3 x =new SU3(0.17014139728794547 + 0.3089560143523728 * AlgebraConstant.I, 0.12157066460524535 + 0.614463238212909 * AlgebraConstant.I, -0.6387486045542593 + 0.2743242765355136 * AlgebraConstant.I, 0.4612629745700969 - 0.17640828090272623 * AlgebraConstant.I, -0.3694430944315643 - 0.574371297110632 * AlgebraConstant.I, -0.5028726148696543 + 0.19195086081111523 * AlgebraConstant.I, -0.5726265570862423 + 0.5511927965454999 * AlgebraConstant.I, -0.10137418504620699 - 0.36192290619805034 * AlgebraConstant.I, -0.04987454749860609 + 0.47384907010892335 * AlgebraConstant.I) ; try { x.Log(); } catch { Assert.Fail(); } } [Test] public static void EigenValuesTest6() { SU3 a =new ( -0.7216998181876505 - 0.45142779443376374 * AlgebraConstant.I, 0.34302665847902336 - 0.38787711146921394 * AlgebraConstant.I, 0.04514277944337641 - 0.0721699818187651 * AlgebraConstant.I, 0.341352669936687 + 0.3129132782650185 * AlgebraConstant.I, 0.6595966877094065 - 0.46627939978443955 * AlgebraConstant.I, -0.36216794382181394 + 0.04374638704917619 * AlgebraConstant.I, -0.10338968932150652 - 0.22413506194952298 * AlgebraConstant.I, -0.24313232033505766 + 0.14243055739183164 * AlgebraConstant.I, -0.9249872548767164 - 0.06381877147098358 * AlgebraConstant.I ); try { a.Log(); } catch { Assert.Fail(); } } [Test] public static void EigenValuesTest7() { SU3 a =new ( -0.7216998181876505 - 0.45142779443376374 * AlgebraConstant.I, 0.34302665847902336 - 0.38787711146921394 * AlgebraConstant.I, 0.04514277944337641 - 0.0721699818187651 * AlgebraConstant.I, 0.341352669936687 + 0.3129132782650185 * AlgebraConstant.I, 0.6595966877094065 - 0.46627939978443955 * AlgebraConstant.I, -0.36216794382181394 + 0.04374638704917619 * AlgebraConstant.I, -0.10338968932150652 - 0.22413506194952298 * AlgebraConstant.I, -0.24313232033505766 + 0.14243055739183164 * AlgebraConstant.I, -0.9249872548767164 - 0.06381877147098358 * AlgebraConstant.I ); try { a.Log(); } catch { Assert.Fail(); } } [Test] public static void EigenValuesTest8() { SU3 a = new( -0.11146503597864356 + 0.11568058336290889 * AlgebraConstant.I, -0.6151654715746724 + 0.5226703988252228 * AlgebraConstant.I, 0.3491495237808594 + 0.4479679176067069 * AlgebraConstant.I, 0.37604139249936874 - 0.026618308590304313 * AlgebraConstant.I, -0.47527192364669435 - 0.32098661165443476 * AlgebraConstant.I, 0.4767287746734095 - 0.5492706126356045 * AlgebraConstant.I, 0.015969670489228482 - 0.9120432307662227 * AlgebraConstant.I, 0.13281746650969412 - 0.042787978404167926 * AlgebraConstant.I, 0.3075231991383097 + 0.232121318115649 * AlgebraConstant.I ); try { a.Log(); } catch { Assert.Fail(); } } }