diff --git a/math.jl b/math.jl index 96b6e7d..fb55ec9 100644 --- a/math.jl +++ b/math.jl @@ -1,4 +1,4 @@ -using SpecialFunctions +using SpecialFunctions, WignerSymbols include("helper.jl") # Gaussian potentials in HO space @@ -13,3 +13,26 @@ sqrt_double_factorial(n) = Iterators.prod(sqrt.(n:-2:1)) sqrt_sqrt_pi = sqrt(sqrt(pi)) laguerre(l, n, x) = gamma(n + l + 3/2) * better_sum([(-x * x)^k / gamma(k + l + 3/2) * inv_factorial(n - k) * inv_factorial(k) for k in 0:n]) ho_basis(l, n, x) = (-1)^n / sqrt_sqrt_pi * 2^((n + l + 2) / 2) * sqrt_factorial(n) / sqrt_double_factorial(2*n + 2*l + 1) * x^(l + 1) * exp(-x^2 / 2) * laguerre(l, n, x) + +# for implementation of simple relative coordinates +double_factorial(n) = Iterators.prod(n:-2:1) + +"Gaussian integral for n ∈ Integers (Ref: Wolfram MathWorld + simplifications)" +gauss_int(a, n) = double_factorial(n - 1) / (2 * a)^((n + 1)/2) * (iseven(n) ? sqrt(π / 2) : 1) + +"Gives ∫dp p u' u where u' and u' may have different l (Ref: worked out in Mathematica)" +function integral(np, lp, n, l, μω) + s = 0.0 + for m in 0 : n + for mp in 0 : np + s += (-1)^(m + mp) * gauss_int(1, 2 * m + 2 * mp + l + lp + 3) / (factorial(n - m) * gamma(l + 3/2 + m) * factorial(m) * factorial(np - mp) * gamma(lp + 3/2 + mp) * factorial(mp)) + end + end + return 2 * sqrt(μω * factorial(n) * factorial(np) * gamma(n + l + 3/2) * gamma(np + lp + 3/2)) * s +end + +"Gives for the HO basis" +reduced_matrix_element(np, lp, n, l, μω) = (-1)^lp * sqrt(2*lp + 1) * sqrt(2*l + 1) * wigner3j(Float64, lp, 1, l, 0, 0, 0) * integral(np, lp, n, l, μω) + +"Matrix element (Ref: de-Shalit & Talmi, Eq 15.5)" +racahs_reduction_formula(n1p, l1p, n2p, l2p, n1, l1, n2, l2, Λ, μ1ω1, μ2ω2) = (-1)^(l1 + l2p + Λ) * wigner6j(Float64, l1p, l2p, Λ, l2, l1, 1) * reduced_matrix_element(n1p, l1p, n1, l1, μ1ω1) * reduced_matrix_element(n2p, l2p, n2, l2, μ2ω2) diff --git a/test/racah_test_data.csv b/test/racah_test_data.csv new file mode 100644 index 0000000..657c6d4 --- /dev/null +++ b/test/racah_test_data.csv @@ -0,0 +1,394 @@ +7,0,9,2,6,3,4,1,2,1.814015780626331,0.31761295034743053,0. +4,1,8,2,0,3,10,1,2,2.515704477303288,0.9326957996621834,0. +7,0,0,2,9,1,5,3,2,2.5903554660341337,1.0568013065085622,0. +6,1,6,2,9,3,2,3,3,2.9999496216653956,1.6497986418831179,0. +2,2,3,2,4,0,4,3,3,2.116847147588511,0.7763851946752616,0. +8,1,9,0,0,1,8,2,1,1.220800289093844,1.6476865616633996,0. +0,1,9,2,10,1,3,3,2,1.582975468430873,0.9195545930075113,0. +1,1,10,0,1,1,1,0,1,0.24397780742502473,2.4209761806215555,0. +5,2,9,3,10,0,0,1,1,1.9233579444490685,1.8987482882421576,0. +2,3,0,2,2,3,8,1,2,1.9196884057772818,1.975871981858429,0. +4,0,6,0,4,0,8,0,0,2.2711846721896283,2.3132726167656905,0. +6,0,3,0,4,1,6,1,0,1.399692254824099,0.9950172674659634,0. +10,0,10,3,7,3,4,3,3,2.960108171100922,1.03156955433702,0. +4,3,1,2,0,2,0,0,2,2.755821701046238,0.4141438740600649,0. +7,2,6,3,7,1,0,3,3,2.129595684025249,1.6707015787820136,0. +9,3,7,3,7,2,10,1,2,1.6843210432624094,2.609752192846747,0. +6,2,0,2,7,0,6,1,1,0.45670303547577706,2.422519888814705,0. +4,2,2,1,10,1,1,2,1,0.32338812584009613,1.5722462575839762,0. +5,2,3,3,4,3,2,3,3,2.767561141317448,1.2110830756110493,0. +9,3,7,3,10,2,7,0,2,1.4895623646521203,1.6769259902203677,0. +6,2,9,3,0,1,6,2,3,1.446011113597664,2.7617654087284,0. +9,1,9,0,5,0,5,1,1,1.7323243882368056,2.315472617193815,0. +8,0,2,1,0,0,6,1,1,0.7209565139039209,2.199641641281561,0. +6,0,8,1,3,2,10,1,1,1.2671393724874904,0.7771869290409112,0. +1,3,7,3,6,3,6,0,3,1.9574091501985889,2.4574078873676886,0. +8,3,4,1,2,3,9,0,3,1.9245588582886857,0.5103388791864503,0. +8,2,2,1,4,1,10,0,1,1.212301252824088,2.7603142421103364,0. +7,2,10,3,6,3,4,0,3,1.9744507312230564,1.4771522631217433,0. +0,1,9,0,9,3,7,3,1,0.5187401574057913,0.964552313606597,0. +10,2,8,3,10,2,3,1,3,0.2599664549251335,0.5450305710252779,0. +3,0,10,2,4,0,6,2,2,0.956646655940045,0.6395305196538215,0. +8,3,6,2,5,1,4,2,3,0.7464329296699308,1.9841737374023616,0. +2,2,0,0,2,2,1,2,2,0.23261101638604087,0.5176928148000774,0. +10,1,0,0,9,0,1,1,1,1.2545823376386598,0.5048045942041348,0. +0,1,2,2,1,3,0,3,3,1.558056903311419,1.3988161462552906,0. +10,3,7,3,1,3,3,2,3,1.9148695313430482,0.48628725210840074,0. +2,0,0,1,4,3,6,3,1,0.5257602941803001,1.2930122314500414,0. +4,1,3,3,1,3,8,0,3,1.3496327869569438,1.1427327536319405,0. +8,3,8,3,6,0,4,0,0,0.5711386188675842,0.5888782270737702,0. +1,2,6,3,2,2,2,2,3,2.9956973520122183,0.7248009016126531,0. +1,2,3,2,3,1,7,3,3,0.4145755796578059,1.4307340270484579,0. +2,2,7,3,10,3,9,2,3,2.685762820125839,0.5817864379111408,0. +8,3,2,0,9,3,1,1,3,0.8536166021495442,2.831409503443342,0. +3,2,5,3,6,1,6,2,2,0.3757250772540499,1.0768653566539799,0. +3,0,3,2,1,1,9,2,2,1.2630698727274052,2.0048561621972256,0. +6,1,5,2,9,1,5,2,2,1.4009697754505064,2.9243485934467603,0. +0,1,1,0,3,2,3,1,1,1.7981074893214615,1.1733115548236888,0. +10,1,6,3,7,0,6,2,2,1.3975741955035317,0.8041387431065972,0. +10,2,2,2,8,3,5,2,1,0.3060905737774853,1.6263254819558188,0. +4,2,1,2,9,3,2,0,3,2.1994593139141987,2.7144803415599226,0. +4,0,8,1,0,2,6,3,1,0.22805840367354957,2.766605603491813,0. +10,1,6,2,9,3,6,0,3,1.8952045436148648,2.452612552084771,0. +4,1,5,1,10,1,5,1,1,2.375982939210733,1.9025344376161275,0. +2,1,1,2,7,0,6,2,2,2.113849419751805,1.9104359416335672,0. +1,3,5,1,2,2,7,3,4,2.02149408579581,1.368097013214017,0. +6,2,3,2,2,3,9,0,3,1.4055683747959709,2.4582031692824984,0. +5,0,5,0,2,3,3,3,0,1.1153781894449613,0.9068742389956621,0. +3,0,7,2,0,2,7,0,2,1.4111845492360269,0.6732680892818301,0. +7,3,10,3,5,2,8,1,3,1.9848951474031322,2.4578952024256298,0. +6,0,8,2,6,2,8,0,2,1.4578238805742023,1.1518832571291955,0. +10,1,3,2,4,1,5,3,3,1.2192511939833812,2.0158328233879557,0. +9,3,2,0,3,3,9,2,3,1.2797473932123715,2.667667661305056,0. +8,0,10,3,0,3,8,3,3,2.285711438100728,0.22059474264607237,0. +6,2,0,1,9,2,3,3,3,2.8881587127859625,0.6081659349774284,0. +10,0,2,3,10,2,10,2,3,0.8297938391271313,0.960138065675562,0. +3,0,3,1,0,2,4,3,1,0.21328186623882406,1.2311076036461,0. +8,2,4,3,2,0,3,2,2,0.8251169290508718,1.1095768354163535,0. +4,3,10,2,2,2,1,2,1,0.8357825571268513,2.2224824421545453,0. +5,2,3,0,10,2,2,1,2,1.869069235391776,1.3153079415023394,0. +5,2,3,0,8,1,7,3,2,1.2112027314556468,0.24402234054725547,0. +5,2,4,2,3,2,7,1,2,2.831067058006135,1.9120594786024165,0. +8,0,6,1,10,1,5,0,1,1.764964714444523,2.4487202997210007,0. +10,2,7,3,0,0,7,2,2,2.278217843222772,2.775272068243126,0. +3,3,8,2,5,2,3,0,2,1.7589455764413522,1.4064044462398142,0. +10,1,4,3,3,1,9,2,2,2.06876313322885,0.22607329718500546,0. +8,0,7,2,7,2,1,1,2,2.4416454902507905,0.7243667318187437,0. +8,3,2,3,8,2,3,3,5,1.2910467979209828,1.403619916165507,0. +4,2,9,2,3,3,5,1,2,2.445764063212766,2.173777620627739,0. +1,3,3,1,5,3,7,2,2,1.2658295470673893,1.9628964675476874,0. +10,1,3,3,3,1,10,3,2,2.3035625824024804,1.9108079797747974,0. +8,0,7,1,7,3,8,2,1,0.49675868831532854,2.260373534425864,0. +4,1,7,2,1,2,3,0,2,2.0611222000632017,1.740466393102568,0. +9,1,1,1,5,2,5,0,2,1.40740819772524,2.9935666286843166,0. +9,1,4,3,0,3,4,0,3,0.3562426063144586,0.7235963155544058,0. +0,2,7,1,0,2,7,2,2,1.0876556792518466,0.8833736225929467,0. +10,1,4,2,0,2,6,1,1,2.035851553546901,0.8300448108041114,0. +9,3,8,3,5,3,9,0,3,1.911972100417156,2.2237561765875364,0. +3,0,1,1,4,2,2,2,1,1.7187301421013963,0.8618792544099589,0. +1,3,0,3,10,3,5,3,5,1.913359245050719,1.8760070332509713,0. +3,3,7,3,5,0,9,3,3,2.8794361138878495,1.379357031950632,0. +5,0,6,3,3,1,9,2,3,0.35823253241992736,1.5846005438435986,0. +10,2,9,0,3,0,1,2,2,0.5283482898935912,1.6364445896483728,0. +4,3,4,2,4,0,9,2,2,2.0050711544115103,2.0957389353682645,0. +2,1,5,3,7,3,0,3,2,0.6639637330404109,1.1061377810436603,0. +5,1,4,3,3,2,3,0,2,0.6840887921337129,2.6849008266875316,0. +6,2,4,3,1,1,0,0,1,1.6452416314801024,2.0368139268479455,0. +2,2,3,0,2,3,3,2,2,0.9677862345336279,1.2494451261398418,0. +9,1,9,2,8,1,7,2,2,1.0501656717739194,1.4022906289727706,0. +10,1,9,2,9,1,0,1,1,2.624157932514823,1.4761947215103186,0. +3,2,2,3,2,3,10,2,5,2.157200298018802,1.1245644711848843,0. +8,1,5,2,7,3,3,0,3,1.1523541866400628,1.3469246957355803,0. +2,3,3,1,1,0,1,2,2,2.628341346918659,2.2930240603473093,0. +7,0,0,2,9,3,0,2,2,2.389750841742125,1.8216124450573883,0. +0,1,3,2,3,2,5,2,2,2.7896019040087907,0.9986610161043483,0. +4,2,3,1,9,2,7,3,1,2.7165154687837116,2.963378781051744,0. +2,1,5,2,10,1,9,2,1,0.3709764737423984,2.0765374018626943,0. +2,1,4,2,6,0,1,2,2,0.21902106177412017,1.1492494058458895,0. +3,2,5,1,0,1,6,2,3,0.6820642494990143,2.6993023125066236,0. +6,0,9,3,7,3,9,1,3,0.6187605180324209,1.020975988251681,0. +2,3,1,2,2,3,1,1,4,1.2223115097437915,2.1343602303126428,0. +7,2,2,0,8,1,3,1,2,2.0142607190902364,0.9954029772981974,0. +7,2,5,1,4,2,1,1,2,2.594626514696124,1.5175260050832744,0. +1,2,1,2,10,1,5,2,3,0.3111192768230273,2.8112263288469235,0. +0,1,7,0,7,3,0,3,1,1.8840788154975554,2.8993378540925354,0. +1,0,8,3,5,3,3,0,3,0.948776838100235,0.6853668471418368,0. +2,0,8,2,8,0,0,2,2,0.39713348642724355,1.067770932108763,0. +4,2,9,0,4,2,10,2,2,0.4561988946384665,0.47449829482884365,0. +2,0,9,0,2,2,9,2,0,0.6194033296740726,0.59422943408623,0. +8,2,8,2,5,2,8,3,4,0.6202828734276022,2.061594866067792,0. +0,1,0,2,5,1,3,2,3,1.4745942504343361,2.7133928321110643,0. +10,0,4,0,9,0,0,0,0,2.8759181820595137,1.380273796890902,0. +7,1,9,3,7,0,6,3,3,1.1859777296228957,2.8057492062298692,0. +9,3,5,3,4,3,4,3,5,2.3609790502467813,0.7164491711977563,0. +8,0,0,2,10,1,10,3,2,1.4154619064975886,1.465466737956615,0. +0,0,8,3,2,1,4,2,3,0.6780851332441382,1.3447427691729348,0. +7,1,6,1,10,3,1,3,2,1.1982686329626064,1.8692134305499257,0. +10,0,7,1,6,1,1,0,1,1.7581772456058342,1.8202460385913826,0. +9,1,10,0,2,0,8,1,1,0.6284047973606959,1.4272263981605553,0. +3,2,5,3,1,2,5,0,2,0.3390453731390104,2.8272566400628367,0. +4,3,7,1,10,0,0,3,3,1.578655573469553,0.5733820564342134,0. +10,1,5,0,4,3,1,2,1,2.581146994474029,1.2342265033297362,0. +9,3,9,2,1,0,10,1,1,0.43451196632235245,2.6688207604075735,0. +5,0,6,3,2,1,8,3,3,1.2385801101608784,0.437268037873344,0. +2,0,0,1,2,2,4,1,1,0.5994216284566964,1.0625110269737794,0. +7,3,2,0,6,2,7,2,3,2.5828238238658905,1.1923274747440487,0. +7,1,3,0,8,2,2,2,1,0.6737359059633938,1.2427758004972653,0. +2,2,9,3,8,0,7,2,2,2.150164455507258,2.122395591867509,0. +6,2,2,1,2,2,9,1,3,2.5967624839646444,2.0757013163487272,0. +6,1,5,1,8,0,4,2,2,0.8978490223450057,1.2193808242453867,0. +10,2,3,3,9,0,2,2,2,0.8809409835000146,1.5187712534347382,0. +1,2,1,3,9,1,6,2,2,1.8808632272352952,0.4505198447272689,0. +5,1,5,3,9,2,3,2,4,2.3346445281394645,2.0798789213270528,0. +10,1,5,0,5,1,0,0,1,0.34160998660105557,1.5035564613810308,0. +7,3,9,0,2,2,3,1,3,1.2302930096364828,1.4436988581999923,0. +4,1,1,2,3,2,5,1,1,2.0942984072331727,0.6797904378785482,0. +2,2,1,1,10,1,5,3,2,0.6540753786271623,0.4049482101678352,0. +5,3,10,2,6,1,3,0,1,1.8417320969433835,2.298377287684584,0. +6,2,4,0,8,2,2,1,2,2.3815383597039457,0.8004705197856254,0. +8,1,5,1,4,3,2,2,1,2.5552117180009564,2.2365732883254283,0. +2,3,0,1,0,2,3,3,2,2.5095676071484414,2.293417061014919,0. +6,2,10,0,2,1,7,2,2,2.3711043555947846,0.24207203078070227,0. +10,0,7,2,2,2,6,1,2,0.2671153432646567,0.8399449228219353,0. +9,1,9,2,10,1,8,2,2,2.218421507828804,1.7155245378409854,0. +4,3,8,0,7,0,1,3,3,2.2099997737293355,0.7314275864627486,0. +4,0,6,1,3,0,1,1,1,1.276892998530276,0.9197993726132232,0. +3,1,8,3,2,0,5,3,3,0.5716451123856436,2.037879106428588,0. +4,0,8,2,8,2,3,2,2,0.5086036896688197,2.9387095840765127,0. +6,1,3,2,2,3,0,2,2,1.9272008603731496,1.5911534712080435,0. +5,0,9,3,5,1,4,2,3,1.2387445692895778,0.3867039583278631,0. +6,3,8,2,10,3,3,2,4,1.1521258223678745,2.00883174980026,0. +6,1,0,1,9,1,2,2,2,2.1662258412996414,1.7365491366292618,0. +4,2,5,3,0,0,4,1,1,2.346431395521596,1.1642830144343521,0. +1,0,3,0,3,2,0,2,0,1.867507383423587,2.997267145090274,0. +3,0,1,2,0,3,10,3,2,1.1293300431562168,0.925551787404113,0. +4,1,6,0,10,3,3,2,1,1.1909381184210392,1.1912844382397711,0. +4,2,9,3,10,3,4,3,2,0.9048669437193357,1.2625671545813635,0. +0,1,3,0,1,2,6,3,1,0.9529790554069351,0.4055503545005079,0. +6,0,3,3,1,3,2,3,3,1.662977948037054,0.6740783803204522,0. +9,1,4,1,8,3,5,1,2,1.6468520903575143,0.7236646916869782,0. +5,0,10,3,0,2,8,3,3,0.8774588100459741,1.2547470451529361,0. +10,1,3,3,6,1,8,1,2,2.3081455432542217,2.051622121078866,0. +7,2,6,2,1,2,9,1,1,2.0134242300356338,2.2304852336883245,0. +4,3,5,0,8,3,7,0,3,1.460825719255726,1.1679667635870241,0. +7,2,4,1,7,3,6,1,2,1.7691273817966797,1.5656190862101873,0. +9,2,10,1,3,3,4,1,2,1.2893757724247248,2.9548696378734958,0. +1,1,2,1,6,3,2,3,0,2.0983974345532728,2.230871584724648,0. +1,3,3,2,1,2,8,2,3,2.739308734996998,2.072069552944285,0. +7,3,7,0,10,0,5,3,3,2.8186399994154856,1.8770216551411307,0. +0,2,4,2,3,1,7,3,3,0.8809600210348778,1.491409649097255,0. +4,0,9,2,4,2,3,1,2,1.7396149436047947,2.451993082069987,0. +5,0,6,2,4,3,4,3,2,2.5857980097045576,1.997799661059986,0. +1,1,0,0,9,2,3,2,1,2.571570270882603,2.794346852077428,0. +4,1,0,3,6,3,8,0,3,0.9599461017147672,2.328831086684705,0. +8,0,4,3,1,1,10,2,3,2.9015917146664174,1.1289844714388684,0. +0,3,4,1,10,3,7,2,3,2.374299112806458,2.613921799174644,0. +1,3,4,2,9,3,8,3,4,2.8198495531527064,1.809181764001428,0. +8,2,2,2,10,2,4,0,2,0.4116372611335577,1.6572404088273176,0. +10,2,8,2,9,1,8,2,2,0.4530434507544614,0.3776426797808945,0. +7,0,2,1,0,2,1,2,1,2.1022710510768787,1.742236560783736,0. +9,2,10,0,9,1,1,1,2,0.21242829075399117,1.6566221134229258,0. +10,3,1,3,5,0,10,3,3,1.9832083026233258,2.865741611784066,0. +7,0,7,3,8,1,1,2,3,2.9665641483653733,2.008538174295932,0. +3,0,3,3,4,3,9,3,3,2.003355904592383,0.7288646243906562,0. +10,3,1,1,9,0,10,3,3,2.088508913181318,1.2292932199569124,0. +4,0,1,1,9,1,3,0,1,1.787886172442871,2.86221745056685,0. +0,2,9,0,3,2,7,0,2,2.4271520593348317,1.8090321815732038,0. +3,1,6,2,4,3,10,0,3,0.6731911486994688,0.7906198203951433,0. +7,3,2,2,1,0,1,1,1,2.3988812165101994,0.5520594588598602,0. +7,2,10,2,1,3,10,1,2,0.7530685271286641,1.1228780791291681,0. +7,2,8,0,2,1,3,1,2,2.6886989186570007,0.2563369176107657,0. +9,2,5,0,2,2,1,1,2,0.43702875854657375,2.5261949787590394,0. +2,2,9,2,9,0,10,2,2,2.1484823915056754,1.290481311138711,0. +0,0,8,1,0,1,2,1,1,0.5722898605060553,0.7941544974876251,0. +3,0,3,3,9,3,6,2,3,2.9997790195940057,1.3506426409482568,0. +10,1,7,2,0,0,5,2,2,0.5837317841766856,2.842871688270571,0. +0,3,5,3,9,0,0,0,0,2.1309864597904555,2.548422234130329,0. +7,0,8,1,2,1,5,1,1,2.9394031269606984,0.7291244635348755,0. +8,3,9,0,0,2,1,3,3,0.6178407107402948,2.5654286399274095,0. +1,2,1,2,4,3,10,0,3,1.1995293845013895,1.478740265690111,0. +9,2,3,3,5,0,2,1,1,1.3694279201743247,2.4644462718245883,0. +8,1,3,0,8,1,1,0,1,0.2600830032907284,1.3154800644674571,0. +4,2,6,0,6,3,3,2,2,0.46808679647644347,2.8568629823703144,0. +6,1,9,2,0,0,2,1,1,0.318735539207597,0.24268921905327456,0. +3,1,10,2,8,1,9,3,2,2.1135474263739846,2.483728510858497,0. +4,2,3,2,1,0,10,1,1,2.4865069485715976,0.616718772179834,0. +9,0,1,2,9,3,5,3,2,1.0190031994779951,2.3944808411012017,0. +9,2,3,1,10,3,9,0,3,2.3360439820945276,1.0547834989345204,0. +3,2,1,1,4,1,3,2,1,1.8116206920007336,0.48177202975911726,0. +7,2,5,3,2,0,6,1,1,1.9905292131072176,2.363131469098433,0. +2,0,3,3,0,3,10,2,3,0.7099270334013639,2.0177460001276204,0. +0,0,1,1,5,2,1,2,1,1.510712337765253,2.0661361777828056,0. +10,2,10,1,9,1,0,2,2,2.3542529898090807,2.702018543015825,0. +1,2,4,2,3,1,0,3,3,2.323283532992355,1.4064685814643783,0. +9,2,10,0,6,1,6,1,2,0.9225550224273618,1.4100798902221676,0. +7,3,10,0,10,3,3,3,3,2.0695781446955666,1.5382380711682693,0. +10,1,9,2,1,1,5,1,2,1.455835631224204,2.7248703737413296,0. +9,2,1,2,1,3,10,2,3,1.2305634901117068,1.843515243917663,0. +1,0,7,1,9,3,6,3,1,2.0189441049670114,2.6788505388324015,0. +9,0,9,1,7,2,1,2,1,0.880418944472463,1.7864541623640813,0. +4,1,3,1,2,1,10,2,1,0.2568131966228151,1.4326174382286014,0. +9,2,0,1,7,1,2,1,2,0.3375946906999032,1.4650851825800162,0. +8,1,8,0,5,1,4,0,1,0.7030771139768146,2.9101731898758123,0. +7,1,6,2,7,1,0,3,2,0.7443890533093631,2.5695160935961168,0. +7,3,8,0,10,2,2,2,3,1.7095899526352172,2.041267154153453,0. +8,1,5,2,4,2,4,1,3,1.6624368877167415,0.860957927868307,0. +1,2,5,3,6,0,6,2,2,2.7327126811414706,1.1660897093143388,0. +2,2,7,1,7,1,7,3,2,1.2416479064941117,0.3952266148636827,0. +0,2,2,0,3,1,5,1,2,2.3281465027315873,2.769582262100659,0. +3,2,9,3,3,3,1,3,5,0.22059591263399358,1.9402267414371357,0. +5,0,6,2,5,2,6,2,2,0.8310894824345447,1.7668844000131152,0. +2,2,3,1,5,2,9,0,2,1.376360937419828,1.3523177868418532,0. +7,3,3,2,1,1,2,3,4,0.8714716774688922,2.61242425319739,0. +9,2,8,2,0,0,0,2,2,0.5661374274574174,2.2850638118574835,0. +3,3,1,1,4,3,8,2,4,1.1811477366405092,2.9216554332882936,0. +2,0,10,2,2,2,4,1,2,2.766713530453073,1.2399630233469479,0. +5,1,1,2,5,2,1,1,2,2.5921630990239644,1.125612038081088,1.7503309653826904 +3,3,5,2,4,1,0,1,2,2.9618513161732993,2.0714963168920706,0. +5,2,9,2,3,0,1,0,0,0.6247488234161755,2.9979139365471097,0. +4,0,10,3,7,1,2,2,3,0.4600150143717099,2.6389460108158733,0. +5,0,2,2,2,2,6,3,2,1.024489408198098,0.8681904666990428,0. +9,0,4,1,5,2,0,3,1,2.917788309837304,1.7479198046919553,0. +8,1,9,0,2,0,3,1,1,1.8925773533408465,1.572333423887505,0. +10,3,3,2,10,3,6,2,5,0.646682915214416,0.2920739839844786,0. +0,0,3,3,8,1,9,3,3,1.0647661716111814,2.0061620438882377,0. +8,1,6,2,3,1,2,2,1,0.6032958853076407,1.6148118555523574,0. +1,3,3,0,8,2,3,2,3,1.065241366668228,0.49666034346160215,0. +3,0,7,2,9,1,8,1,2,2.6469596213531315,1.2856585452561355,0. +4,3,0,3,8,2,5,3,1,1.3588594477243063,2.475587788147598,0. +5,2,7,0,2,1,0,2,2,1.9947865783043426,0.47779823816652023,0. +5,3,8,0,9,2,8,1,3,0.7961636398455663,2.89063011820879,0. +0,0,2,1,10,3,3,2,1,2.3412446766328507,0.8789250315703252,0. +6,3,6,0,1,3,1,2,3,2.1715024514987267,1.8621212233046265,0. +3,3,10,1,1,1,1,2,3,2.0287630528612963,0.2522220880918984,0. +4,1,4,2,4,0,10,2,2,2.342718587895882,2.349553179861566,0. +4,3,8,1,3,3,4,0,3,1.6690786135742295,2.6921105140387693,0. +8,3,3,3,9,3,1,3,4,0.35610730272570423,1.4754809488277,0. +5,2,7,2,3,0,2,3,3,1.8768601370587348,0.9070910235019696,0. +3,3,4,3,0,2,10,0,2,2.6781489148470854,0.44072558049777744,0. +6,1,9,2,10,1,10,0,1,0.24179377192921736,0.4830808679470908,0. +2,3,0,0,9,2,7,1,3,0.8055170318703277,1.280392358735282,0. +10,3,4,3,10,0,8,1,1,0.2951202091738372,2.4663204568325394,0. +6,3,8,2,5,1,7,2,2,0.7466651858219708,0.39959480533010305,0. +2,2,6,3,2,2,9,0,2,0.3420434020045784,2.5685823942628474,0. +1,3,0,2,7,0,0,3,3,1.8923225515820796,1.4777132033495723,0. +1,3,3,2,7,1,4,1,2,0.7488592055243743,1.1641280879375344,0. +0,1,7,3,3,1,7,2,3,2.4914822307887894,1.6491534700102237,0. +7,1,5,2,9,0,8,3,3,1.415834082760786,1.8882971633318126,0. +10,1,1,2,10,0,4,2,2,0.8145100001849093,2.3062907734363467,0. +10,0,7,1,6,1,9,1,1,2.641046739715316,0.5557877644764537,0. +9,0,0,3,10,2,6,3,3,1.865827183962141,1.872212684094583,0. +4,2,4,2,8,1,2,3,4,1.6655575613674793,1.9923225117046508,0. +3,3,0,3,6,1,3,2,3,1.866224582798278,1.2545747918508572,0. +8,2,0,3,2,1,8,2,3,2.5867113736544125,1.5375482816305022,0. +3,1,9,1,8,2,3,0,2,2.087844938482185,0.3266801282542833,0. +5,3,2,2,3,3,9,1,2,2.3122730670931038,1.1446567637794058,0. +0,3,4,2,8,0,5,1,1,1.3355445968205792,2.6709381682178863,0. +3,1,4,2,2,1,8,1,1,2.694914435245524,1.5834132422798675,0. +1,2,1,3,4,0,9,2,2,2.8302457704324127,2.853816547277007,0. +8,1,1,1,0,1,3,1,2,2.5947827588125927,2.769350435912872,0. +9,1,2,1,3,1,1,2,2,2.1987229474010137,2.7074735075746954,0. +2,1,7,1,1,2,1,0,2,0.6433455202950027,1.0258409319024193,0. +9,2,3,2,10,1,4,1,0,2.553509336483934,2.6481883956473418,-8.492929635442344 +3,1,5,1,0,0,10,1,1,0.2812328987572723,1.2504907057333323,0. +8,3,2,0,8,1,4,3,3,1.638659944035079,2.507996607637442,0. +9,3,0,1,5,1,6,3,4,1.398682429204258,2.2417475022999787,0. +0,0,1,1,2,1,2,1,1,0.5650222155323843,2.353500537790839,0. +3,3,5,3,0,0,10,0,0,2.540866271386877,1.7692406801526737,0. +7,1,5,3,9,0,1,3,3,1.4093673530272648,0.640624893112363,0. +0,2,8,0,6,1,2,1,2,1.1137751124169277,2.525408933377384,0. +2,2,9,3,1,3,3,3,1,1.2072930769239667,0.9787598793544778,0. +10,3,7,0,7,1,4,2,3,0.5339951824313731,0.26407265354179854,0. +0,0,0,2,1,1,10,1,2,2.062311903642824,2.98864281073039,0. +8,3,6,2,6,3,3,3,4,2.3317062410055343,0.4349822012889124,0. +3,0,5,1,1,0,9,1,1,0.4829202772214858,1.5379077424909715,0. +7,3,0,3,0,2,6,1,3,0.7265995210122482,0.20451320503288484,0. +9,2,6,2,5,1,5,3,4,0.8185224009153322,2.5824377350737144,0. +9,0,8,2,1,3,6,1,2,1.1220870830475458,1.4679566672684032,0. +3,1,1,2,2,1,9,0,1,0.40662880334324436,0.6286068410932732,0. +1,1,2,3,3,3,5,2,3,0.8642065809052206,0.9847137852972492,0. +10,2,3,3,2,2,7,0,2,0.9878525750175489,2.772398617484023,0. +10,0,6,2,8,1,0,2,2,2.336807762287619,2.300128436017335,0. +10,3,9,3,7,1,8,3,4,1.4168619301666823,0.8297433047733302,0. +6,0,1,2,10,3,0,3,2,1.6562211319221563,1.293617848847409,0. +8,2,5,2,1,3,0,2,1,2.6265786343365365,1.1700712555120703,0. +10,2,8,1,1,1,2,3,2,1.8062296387954335,1.6934129014532138,0. +4,1,0,2,10,2,1,3,3,2.541127774919153,2.9068516315662727,0. +10,2,4,1,9,1,0,2,2,1.5382108921529491,0.6716835871380327,0. +9,2,2,3,5,2,5,2,1,2.046615536705553,2.761810441990276,0. +6,3,2,1,8,3,0,1,3,2.3903962324894374,2.7788035834809452,0. +2,2,1,1,10,0,1,1,1,1.4937000969333019,2.001278090162284,0. +7,0,5,1,8,1,1,0,1,1.1405348753766331,2.6490448432922777,0. +3,1,5,3,3,3,1,2,3,2.0199840475605866,1.9695774516811957,0. +2,1,7,2,10,0,2,1,1,0.21074803178574797,1.8099638039436643,0. +1,3,10,1,9,2,9,2,2,1.7044632251918923,0.3057832771895339,0. +9,0,1,3,9,3,10,0,3,0.32783863639375443,1.5335275058006692,0. +2,3,0,1,1,3,4,1,4,1.0164731608558069,2.6414535887742447,0. +1,2,4,2,2,0,3,2,2,1.4962741638772457,0.32294537280468827,0. +4,2,5,0,2,2,7,3,2,2.462120767726704,2.2230575478441033,0. +6,2,4,2,10,0,7,2,2,1.4624519434658625,2.4956639467064443,0. +6,3,8,2,4,2,8,2,1,2.836596778937423,0.6043728625602007,0. +10,3,2,2,7,2,2,3,1,1.9426967238763035,1.7871626815287565,0. +4,3,7,3,1,2,7,2,3,2.1798809375789627,2.593925646863351,0. +4,3,0,0,5,2,10,2,3,2.9892896678713,1.2882835594486446,0. +0,0,2,1,7,1,4,2,1,0.29058169957064095,1.960042288421442,0. +6,0,8,1,8,3,5,3,1,0.4329106052758114,1.7611874875932472,0. +5,2,10,1,7,0,8,1,1,1.4638975442022808,0.924322036012593,0. +7,2,7,3,1,0,8,2,2,2.520478950735594,2.3303666690245306,0. +4,1,8,0,4,0,6,1,1,1.459716315718281,2.3870694211843633,0. +5,2,8,1,9,0,9,2,2,1.2529642458423789,2.8348725075160246,0. +3,2,7,0,0,2,7,1,2,0.5690674351838148,1.3777355106176494,0. +8,2,9,2,4,3,10,3,4,1.9299100361421466,0.3966126497233029,0. +3,2,4,0,1,2,5,3,2,0.4651552973289945,1.4685204337943194,0. +3,1,4,2,7,3,10,1,3,2.9044194755035706,1.8703053215284902,0. +5,3,10,2,2,0,6,3,3,0.21842501098625888,2.1796425477229784,0. +4,2,2,2,7,2,8,0,2,0.7886789476118716,1.4018058799983955,0. +1,3,10,2,4,3,6,1,3,1.9446879900832528,1.9295524106856687,0. +10,0,0,1,4,3,3,3,1,1.1565804465990936,1.8732701492977517,0. +4,1,3,0,1,2,2,3,1,2.6895575710672865,1.223735260948045,0. +8,2,5,3,10,1,2,3,2,0.6881515663332318,0.22089648889813684,0. +5,1,1,2,3,0,2,1,1,1.284250287124578,0.9803285689826304,0. +9,2,5,2,9,2,8,1,3,2.588832758149029,2.424676756470613,0. +6,3,7,3,0,1,8,2,1,2.2495956507275823,0.49149467349686127,0. +7,1,10,2,6,2,1,0,2,2.0857689111832842,1.0404958399127437,0. +2,1,2,1,5,2,9,0,2,1.1068162667714687,1.2651264585750686,0. +1,2,8,2,4,0,4,1,1,2.06394450090668,0.6289214940128742,0. +6,2,5,3,9,0,1,2,2,2.8345872642334315,1.8544464533414073,0. +9,2,10,2,7,1,0,2,1,1.408789911118359,2.4008433105852705,0. +10,2,4,2,1,0,8,1,1,0.6134959778388742,2.4449433721530784,0. +8,2,6,1,2,0,10,3,3,1.794586611044986,2.4891313351625364,0. +2,2,9,1,7,2,7,3,3,1.6950266216464565,1.9267314398803421,0. +8,2,2,3,5,2,8,2,1,1.240660729352081,0.614397197033274,0. +10,2,7,0,2,3,1,1,2,0.942161064732737,1.7768239062076931,0. +8,2,2,2,9,2,3,1,3,0.8801070256690937,1.3334106960769039,0. +0,1,3,0,7,0,8,1,1,2.759575651836407,2.2370044561599594,0. +2,0,2,1,1,2,9,2,1,1.0254183581144791,2.38137172597511,0. +2,2,4,0,10,2,8,3,2,1.8112137495609861,2.6613449708817436,0. +7,1,6,2,4,2,9,1,1,1.5940820518066428,1.0983546198249372,0. +8,1,9,0,1,2,1,3,1,0.8932685422132205,2.9473230283991008,0. +9,2,2,2,3,0,1,1,1,0.33570537722771965,2.0374359188831273,0. +9,2,7,1,3,3,2,1,2,0.8073783504615606,1.9841095317741253,0. +2,3,3,1,9,3,1,2,2,2.8250883094896393,2.258440952824621,0. +7,0,1,3,5,1,6,3,3,1.287902963611098,2.3433999040190434,0. +7,0,5,2,9,1,7,2,2,1.1234261485960038,0.3136829770445666,0. +9,3,8,0,7,3,10,3,3,1.0048701834268332,2.6402255736028826,0. +6,0,2,2,4,3,7,1,2,1.759757357100633,2.2623048177547833,0. +4,0,1,1,3,1,4,2,1,2.251256964944865,1.776575907658561,0. +4,0,9,2,8,1,2,2,2,1.936537095453656,1.9097068100347103,0. +4,2,10,0,5,1,3,3,2,0.8590177771821113,1.8394463532255436,0. +0,0,3,0,10,2,2,2,0,2.8640285895042297,0.8791871038094534,0. +9,1,3,3,8,1,9,2,2,1.1834517327814233,2.8239738427124843,0. +2,3,5,0,4,0,0,3,3,0.6805254666938301,0.26557352050621175,0. +5,3,8,2,3,0,10,1,1,1.3910977429097215,1.8741960916665903,0. +7,2,6,3,2,3,7,0,3,1.3872547516547633,1.6963007128362868,0. +6,1,3,2,6,3,4,3,1,1.0626034805404814,2.8060268100430026,0. +5,3,1,3,3,0,4,3,3,0.7430544120091587,1.0777388348239691,0. +5,3,1,2,5,3,1,3,2,1.3542358203080034,0.26106660478213595,0. +4,2,6,1,7,1,1,3,3,2.820371318333427,2.9207841371657253,0. +8,2,5,3,1,2,5,1,1,0.27886042485737006,2.4622975712253945,0. +1,3,9,3,7,1,4,2,1,0.3062576036365292,0.947350388684844,0. +10,1,9,0,1,1,1,2,1,2.842529772037765,1.72598770316766,0. +3,3,0,0,7,0,0,3,3,2.9419931449815655,1.5415649267198361,0. +7,1,7,1,1,3,2,1,2,0.7322040099239033,1.4350899704211022,0. +8,3,1,2,10,2,10,1,3,1.1102251621724681,1.3819727089193692,0. +4,2,8,0,10,2,4,1,2,0.8009382774044647,0.3029995840779338,0. diff --git a/test/racahs_reduction_formula.jl b/test/racahs_reduction_formula.jl new file mode 100644 index 0000000..344a9ee --- /dev/null +++ b/test/racahs_reduction_formula.jl @@ -0,0 +1,39 @@ +using QuadGK +include("../math.jl") + +# Testing ∫dp p u' u where u' and u' may have different l + +function explicit_integral(np, lp, n, l, μω) + integrand(p) = p * (-1)^(n + np) * 1/sqrt(μω) * ho_basis(l, n, 1/sqrt(μω) * p) * ho_basis(lp, np, 1/sqrt(μω) * p) + (integral, _) = quadgk(integrand, 0, Inf; atol=1e-10) + return integral +end + +n_list = 0 : 5 +l_list = 0 : 5 +μω_list = [1, 2.66] + +for np in n_list + for n in n_list + for lp in l_list + for l in l_list + for μω in μω_list + println("Checking n=$n, np=$np, l=$l, lp=$lp, μω=$μω") + expl = explicit_integral(np, lp, n, l, μω) + anal = integral(np, lp, n, l, μω) + @assert isapprox(expl, anal; atol=1e-8) "Explicit=$(expl) and analytical=$(anal)" + end + end + end + end +end + +# Testing the full Racah's reduction formula + +test_data = DelimitedFiles.readdlm("test/racah_test_data.csv", ',') # format = n1p, l1p, n2p, l2p, n1, l1, n2, l2, Λ, μ1ω1, μ2ω2, racah_matrix_element + +for i in 1 : size(test_data)[1] + n1p, l1p, n2p, l2p, n1, l1, n2, l2, Λ, μ1ω1, μ2ω2, racah_matrix_element = test_data[i, :] + val = racahs_reduction_formula(Int(n1p), Int(l1p), Int(n2p), Int(l2p), Int(n1), Int(l1), Int(n2), Int(l2), Int(Λ), μ1ω1, μ2ω2) + @assert isapprox(val, racah_matrix_element; atol=1e-8) "Formula=$(val) and test reference=$racah_matrix_element" +end \ No newline at end of file