diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f6baf90 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +name: Release +on: + push: + tags: + - "v*" + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Build Release Asset + run: | + cp -r src WallGoMatrix + zip WallGoMatrix_${{ github.ref_name }}.zip WallGoMatrix/* + tar -czf WallGoMatrix_${{ github.ref_name }}.tar.gz WallGoMatrix/* + rm -r WallGoMatrix + ls -a + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./WallGoMatrix_${{ github.ref }}.zip + asset_name: WallGoMatrix_${{ github.ref }}.zip + asset_content_type: application/zip diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5eb30c3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_STORE +*.txt \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..62d9e8d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changelog + +## 0.1.0 (2024-10-09) + +* WallGoMatrix alpha version goes public. + +## 0.0.1 (2023-05-18) + +* Project initiated at [How fast does the bubble grow?](https://indico.desy.de/event/37126/) \ No newline at end of file diff --git a/DRalgo/DRalgo.m b/DRalgo/DRalgo.m deleted file mode 100644 index 11ac513..0000000 --- a/DRalgo/DRalgo.m +++ /dev/null @@ -1,650 +0,0 @@ -(* ::Package:: *) - -(* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *) - -(* :Title: DRalgo *) - -(* - This software is covered by the GNU General Public License 3. - Copyright (C) 2021-2022 Andreas Ekstedt - Copyright (C) 2021-2022 Philipp Schicho - Copyright (C) 2021-2022 Tuomas V.I. Tenkanen - -*) - -(* :Summary: DRalgo is an algorithm that constructs - the effective high-temperature field theory for generic models. *) - -(* ------------------------------------------------------------------------ *) - - -BeginPackage["DRalgo`"] (* digital history: at its early days in 2021, DRalgo was called FireStorm *) - - -Unprotect@Definition; -Definition[x_Symbol] /; StringMatchQ[Context[x], "Package`" ~~ ___] := - StringReplace[ToString@FullDefinition[x], - (WordCharacter .. ~~ DigitCharacter ... ~~ "`") .. ~~ s_ :> s - ]; -Protect@Definition; - - -(* - Welcome banner: All credit for this part to GroupMath -*) -TexFor[text_]:=Style[text,{GrayLevel[0.3]}] -result={}; -AppendTo[result,Row[{ - TexFor["DRDRDRDRDRDRDRDRDRDRDRDRDRDR "], - TexFor["DRalgo"], - TexFor[" DRDRDRDRDRDRDRDRDRDRDRDRDRDRD"]}]]; -AppendTo[result,Row[{"Version: "//TexFor,"1.02 beta (16-05-2022)"//TexFor}]]; -AppendTo[result,Row[{"Authors: "//TexFor,"Andreas Ekstedt, Philipp Schicho, Tuomas V.I. Tenkanen"//TexFor}]]; -AppendTo[result,Row[{"Reference: "//TexFor,"2205.08815 [hep-ph]"//TexFor}]]; -AppendTo[result,Row[{"Repository link: "//TexFor, - Hyperlink[Mouseover[TexFor["github.com/DR-algo/DRalgo"],Style["github.com/DR-algo/DRalgo",Bold]], - "https://github.com/DR-algo/DRalgo"]}]]; -(* DRalgoLoad=Import[FileNameJoin[{DirectoryName[$InputFileName],"logo.eps"}],ImageSize->{200.,300.}]; *) -DRalgoLoad=Image[CompressedData["1:eJztXYlbFUe295t57/vee9/Me+8/eFEURERQQNllk0VREETFHfSKRAVlcd8Yo5mMW3DfcIuKu0aTKCouUTQzQaNcMQqKgoKiBFkTkKjvSOHxTHff9tJ3q3bu76uYpm8vp/rXXfU7VaeqOsYnR038jw4dOqT+O/wTNjUuQTPxD2///BP8Myh9qiYlcbx/Skrc7Pg/wo7lbf+93X5jhRUGo6io6IerVyFptVrceffOHbaz8FahBW2zgmHSxIk2//cJpEH9B+DOuLFj2c4hgwdb0DYrGKwc8Q8rR/zDyhH/sHLEP6wc8Q8rR/zDyhH/sHLEP6wc8Q8rR/zDyhFvePr0ac6pnDWZmfPnzk2bngL/hgQFfZCjR2WPck6e2vPV7i2bNn+1c9fXR4/9dP16TU2N5fLxEeL3338/cvhw5MBB7MlLJh8PTzweOfL28Ojr5a3rlJDAoBXLlldUVFguZx8J4BnC5yDDDqZZ6TPYKciRPqmbrd2Gdetfv35t2WyqEVfy8ubMnOXn4yt+qp0/6ejt7hEWHOIv+hUKNDh31IgR+nPEkr2trX0XW8/efUYMG7Zy+Ypr+dcs/QC4xuVLlyIGhEs+SaDm+4sXf/31Vzx4Qnw8PSC0XzDsHBT+/nQo63Zs23b3zp2GhgYoM+vq6kru3z+Xm5u5alWvHk4yrMELsHnTpvr6ess9CR5RV1s7PSlZ/oUHqUBPQV3Xx8X1h6tXX758+YaUdS7OzroeMmgPfb6vno49gGIg1xz55x53fv5ZUHbZ2XTGbQe7rrj94MEDPEuZ9n716pWPp5fEC5CSGh4WJt4fFRFZ/vixqZ8A5wAx7OzoSGsc0NXFxcXk6aXgNuhnPFEZR9qCAryau6sbbj9/9gx+LS8vX7dmLdRNlKbeLq7FRcWmfg7corS0lFYN8DUBZeynAN++bGePbg4uTs5sG6oSPFcZR7lnz9KHzza6d7WnZRoUm7t27qSGQW1YcPNm029NpnkM/AJEL5Qk+BzGjBwF1Tr+mrVlK/4UO3QY2zh86BAeoIyjoqIicYGWNGWK+Ego4qBKooeB/IsbMwaqMygwjfcYuMaJ48cx+04O3e/fu0d/bWlpATHMfvVw6w1lILz2VAYobgtCxvHWDx8+FBwDn9X4cXG65ATUXKBSjPQYOAU8gbWrV1NhwHTCtq1Z9LDGxsZF8xdAQfT2VZ885XbhP4XMKeaourp6kkbDDhsQGgY1lPiYjevX6yII0+KMjKamj7P0gw9k6qeTdWX8wL794uPBwRFfx8A2Vfgkq54/1/UrfLli26IjI6nIhBQzOKqqqqo9uVcH5s6aLfNyQk1NHVUZmK7dGz40tIeSAnoGGJmVPoMaHNDXr7KyUvG9OMSRw4clqenj6orb31+8qM+lJDkaMXw4VhmKjYQSDOSBwELwqlD7nc89h1ITUmhQP8kvXY2A9xOzZtvJ5suVqyT5AuGkz9UkOQr080OZYYipM9PTBVadOX2aHgAyA70DSNOSkgy5HT/IWLAQMwWuIuz5y6IMwaNwtO/2yy+/6HM1MUcgibvZ2eE70NzcrNhUkCtp01O6dOzE6D713UnxMU+fPqVNFlfy8hTfjhM8q3xmb9tWgIQEBrHmNXCRtm7e4tS9rZ0BJFzOyVN6XlDM0YXzFyjdx499baDNL168gO9FlzcExq/JzMTbDY8ZSv07NQI+HF2lGby0eZcvn8vNra2p1f+CYo5wD0vgXhkzA/8M+IioA27zztXavHGjepthQ/sFs4wE+QcY5YICjuA7hfJN8NBK7t83yr0EgEIAHCtd0hR8ZBlVzy2g0MAsgFv6oKSElXWGQMAR/U4xLf3sM2OYL8ShAwd1EcRSv4AA1Qny/B9/FOSim61dWkqqIRmhHEHVIBm94Orc0xRNAVT1QUbYRtfOXWgzbFhwiLoE+cULFyTft94urrRLqF2gHOm6vlGUgxiLM4Ry1Ka1B6q0tBRcWtyTMEFj9FubDsu++ELXMxw3eoyya1KOEhMSZGoH4+YFUHirUNDY6O3hyRqFKioqvPq4434WZcE/wGxU3SzRzjWo6FtaWhRcFjnqHxwiVgs0CVrUjQLwEdx69mLXnzh+Asg8/Emr1WIzBbh7rPeQc6xfu07mAfZ07KHsssiRZPsnTUsWLzZujhjg1QLdCHJI/NP2rCy8+7w5c0xxd+Ni8KAIZi1z2wVp5fIVyi6LHEFlLc+Ri5OzmTsRwO3FACcQFZxHxjY3N+OH//mSpdl794YEtsUAg+gCP11xn6bAY5VPXx89Ztx8fRC0U37/vn1mvnu7AK6Q+EHV1daCy2lgj3O7ODKFctCFx48e/XXp5zTCNnXadLPdXQF+/Mc/0NSrV4zZvyzJEX6z4s4FUygHMXJO5bCOY5p8PL1Alpvh7spAPRfJXmnFEHAEymHH9u1jR41mf0ZHRu7LzqaOrYmUA8XDhw/F7wZL4AkWFRWZ2gBl+P7iRVNxpGnjCFyVnTt2MFUg6IcF6QV1AWPKDMqBuoECd8OmNbaZT/Fw88YNNPLypUvFRcVZW7aCeNiyabOBhU9MVDS7bHhYf9wp2VcOTB3Yt9/P28fUykHQjS5OyVOnmtQAZah6/hwtDPTzpwZ3/qTj2tVrFF95VGzbEAk94xmAKVNPxnX4oERb64S4eJSykPgM+pIZqwUpPz9f2WU5HGsJr8GYkaNo7hImaBobG7VaLbyQbI9Je7UUg3aRs0S9zi9XrvrwJaTAIUdvWkMHDx04OHfW7KWffUZ1bNr091Hrxq2XjYKS+/dpexoQ1KObA/65dfMWZZflkyNdoDHMi+YvsLQ5EqCRTjQ5OzqCM6vsmuriCDBsSAyzrY+rq6VtkYBkk5pXH/fr164rvqbqOAIHAfPOoa/k1suF2QYKJ3Xa9Lmz54AE0jMeVRdUxxH4HcjRsaNHLW2OEOjLRA4cZKxrqoij0tLSs2fOXDh/AdUdCy/kCsv/9jd8hYw1dFEVHAE7I4fHist5xWrWdIB6B81bsWwZ/Qk0w5W8vJ9v327vNfnnqLam1tvdQ1Isbc/K+vD5Zgf62j0de7ChXuXl5eDiodnwVNs1ToR/jsCt0OW5Dx4UwWGoZPbevWjhX5d+XlZWRsdKsDR5UqL+F+Sfo4Xz5mPWMMQLE8g8SxsoxMuXL7FRCFzaIP8A8dtlb2ur/8ww/HNEX0txgmKQw0/pfO45sang3mIclFN3R/2vxj9H4Fz0Dwmlme3SsdPIdyOkIF04d97SNkpg3pw5Mq9Wemqq/pfin6M3rVEBoGmh9gEj58ycVXirEIQEevRQGFraQAm0tLRMHD9BkiB3V7d2tQupgiNJ4Hj5AaHKBxuaFFAIL1m8WEAQPOcHJSWCI8G5yM/Pb2xslLyOejkCycSMhA9KWfynGdDc3ExF3aEDBwUxQk+fPh09YiT71dG+m2TLiXo5Orj/AOb98aNHljZHJ6jvEDEgHMpt/KmmpkY8xdO9YmHHuno5onE4N2/csLQ5OgElHsavspIZQ6YXzJsnrq3Wr10nuIJ6OaLxbLBtaXPkUFFRQWe46u3ievnSpabfmjA+jQ5AgDJccLrqOALXj42Mu5KXh/nCOay4RXFRMSXCpnVmJ9ymzoU4HFdFHAERo2JHMDcQnPf4ceMwX6qYd7e8vFxycj+aQDZUV1fTs+rr62Oio1XB0fVr13UFRoLPrpYZd6F8o01b4rRr5048+MmTJzPT02muOedIZv6uTxMmWdq69qHg5k1B4BPKibKyMnbM2TNnBHPKBfr509nnQG/EDh0GqV1NFiYFjSoUBK+KJ7BSBcCT3bF9u6+XcMpTKMajIiKxH5MmOu0Mh9+RJn68ru8oMSHB0tYpB9SkEeED5SspTOGkRYVDjsADEndMtNVHDt1VPaUkOFB7d+8WhB9LJs7rozetI2TBMAe7rradbMKCQ2jPJkgmS1tnKED2gJeHYUU2rRPKQQ0FskEtuo6CfTXq8o/0wcrlKzBHoJGwcFCRfySAitoZ9EFdbS3OxOju6kanTVMvR7S9DtSspc0xFPuyszE7mzZsoIO81MuRWtq99URaSiqVB+BfTJ6UyKZ6Vi9Hny9Z2padLrbc9h/pidM5OQKPlaVePZyKi4rVy9HwmKFtXoMBk77ygB3btsno7VGxI1TBUU1NDXw1A/v3B8mdnpoKtQ/swXiGjAULLW2gctASG1OQfwAGUnb+pOPECRM456ixsTE0qB/NApg9NHoI/gniwdI2KoS2oICOhRHMcIVeUsK7ue655Qh8cJmiwMfTS6WNDKDcaNtC5qpVhw8dEmdw9oyZ/Jd18nGqu3d9ZWkDFYJOuYmhxceOHqVrJMUMjqqrq+Ofo21bs8RvF5rHYZCqPqivr0cu3Hq50BknGhoavv3mm6wtWy+cO89yxz9H8CKJG/BZ4nPchD6goxHBe5U/mH+O3rQuojRu9BgxRxyOP9ITOKrXw633B507VXDEUF5eDhLuSl4ez+P49AGd6Q40D7gV8m3CKuKIgQ7/53A87AcBBGELCU3g9+maCVx1HO3Yvh3zJQ7p5BzPnz2T6XUVjM1EqI4jkKPMNndXN0vb0j5UVVWJO1ttO9ng5Ku6OpTVxdHdO3cwd39ZlGFpc9oBKMeiI4Ura9i0tpkEBwbin5IrJvPJEUid7D170lJSF81fcOH8+6Yeuor0Le0ti9imDLQOCujrB7kT89UvQHoNEQ45AoLoMD1IcWPGwAtGJ/EbFTvC/IYpRuGtQizQXJyc2YyjtGecfVDncnNvFxaK126Q5ygsONismWmFZFMw+Ed08K+6OsfpK3c65/2KSGfPnBk9YqS3u0fs0GFsbb78/HxX554b16+n48UkORo7um0+1QDfvmbMShvoWiGSoYApydPMb5Vi3PjpJ7Rcn1BA1sgPTG3asIExJeAIqjYoKrHpMioiwuR5EIFO5yKeT9Xfx5cOs+IfdJCRPs4CdS4YU5r4ePbnwLD+wA5dGs9S9VFZWZmYGtTb5pm82ojAxsbwsDB9Vs2oqakRNO9jH5PkxGuW0nVQUNMZFFnq6+WtutgSkAeCXIB/B6Wf/Fl0ussPJgv6RxUVFeB3Y9ACJLDcUsYow4mvj+NCljTZd7H9+w8/yJwoXoyMT44Yzpw+jcaA3rOsMe3C5o0bZR4sCAP50wXhAeKEHeuW5ejVq1c48M3Brmu71uu0LCTnz4GnSsdUCsbrCSAfLAQJqzkzcNTc3Hz3zh3JJSy3bNqMJvE5mYkkCm7epNEjko2ocID8cgOgHHQJJ5aGDRliHo6+OXECY//AcabDH27euIEyxsmhu1rWIYVXjjacrl+7rqGhgbbIsTQjLe2Dl0qdNl03QTHmaQvSFhQIVpfz7N2HTaRT/vgxXdfsg73J/IAu9zb108lsZ2VlJW1qGDk8Vp/FOmWUw9EjR8zDUcbCReK7pyRPe1BS4uftg3tUNEwPnjwWC4JIEsDPt2+fOH68XcNw6PINmHr1cGr6rck8HNG1P9Brg4KaBi+BZtA10xGHoKGA2Xv2GH5BuiIhpsUZbztlzMPRkcOH5aUL6E9VLGeJwAVWXIy06rGkciguKn5jLo5aWlpwSURxgvzKq1PeoC3Q0uUsoTRYsnhxXV2dgZcVKAdQC2y/2fqPQCHQyG2WoEjftjVLXRHCUChJrjca5B9goCKlwxWZWmD7jctRVVXVveJ7ugJKX79+vXb1GqJ5hquoAmKQrDUwTUn81MDrY9MlyGBQC2ynsTgCnTMtKYn1AfV2cQVVIz4GZDadk0q+IYtDXMu/Jl6fekBomLeHJ9uG70sySkF/hAWHtGnFnr1wp7E4EowfhJRz8hQ9AL4vGicMxxtyO/MDqtTQfsHvRQ7ZhvrU990M0nSNbwXAeXhAiuNOo3AEX6W4v4NO9Xzqu5O0WRhktoHrm5gftD8OSgyBVw4ORezQof4+vgbexXQxJy9evKDW4vb1a9efPHkCOaLcwRvSrun9eQC8hO6ubjbv/Eo2Wn9fdjYVD7Bt+BA2AzkCAS8zd5xgVj2WQG8Lvi/QCXwuJyoP6t/RddzgawLBDNmcpNEYJTZGMUcgKePHjYtpVc7BgYGS62TRhmvJBHJi2Rdf6Ipz5hw4vxk4CyYtpRVzxBZjwiWZHO27ldy/LzgGfByZ9dCjIyPVO4dMc3MzFuDz58416b2UcYQxvXQOImzmpXhU9gjKakoNsAk3Ve9AYwZQpJij77791qT3UsbRudxctDAqoi2M2cGuKx3u1NTUtG1rFlVuPp5ed+/eVft8FwxQAmC+TL2gsDKObmlvoYU0LIQ1gZaVlWWuWiVY9AckkLgwVC9owI+p1/dRxtHr168l131Om54i2eUB1RbobZNmxPxgsYgZCxYapYlbBvIc9XJy0hXpkXv2rLxmY8nFyXn3rq/U1UCqJ44dPSpoNjERJDkaNGAAPmRvd4/NGzeC5q+urgaFCZ4a1Ck5p3JWLFtOu7PFqV9AwPasLNU1kHIISY5wJRH9k30XWxBsvl5eY0eNXpOZ+RFMKMcP5Ms6fVL3rvbgq1owCx895Dny9fSCIksXOwNCw1Z/+WVlZaUF7f9XgD66Dlg4n3vu4P4DIDL3ZWeDy6bVag3vBbZCT3A41tIKAawc8Q8rR/zDyhH/sHLEP6wc8Q8rR/zDyhH/sHLEP6wc8Q8rR9H/26FDh5ik1MSEJM2EsKQ0TYImxT3632BnwOw0zcQ/wEbq27+i0qdoUv8bNvynwKFTNUlpkcmJSWmpf4RdQ5KnCQ78L9gITJ6SnBI9LW68JvrtQVEhAYKD/gc2wqbGJWiiNKnJU9LTEpOTUjq8xaJkP8Gh//nu0OjEOcSo8MTUtLZT4vwSl8P/Bef96e15kKmUKZq4GYlJCa2/DElJF2bsz7AxMC4hKXFi4vi4t4a03tE/PS15Kvw5/v8BDtoVaQ=="],"Byte",ColorSpace->"RGB",Interleaving->True]; - -AppendTo[result,Style["DRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRD",{GrayLevel[0.3]}]]; -Print[Grid[{{Image[DRalgoLoad,ImageSize->140],Row[result,"\n",BaseStyle->(FontFamily->"Consolas")]}},Alignment->{Left,Center}]] -(**) - -(* - List of public functions. -*) -ImportModelDRalgo::usage="Loads the model and creates help tensors" -DefineVectorMass::usuage="Defines Custom Vector-Boson masses" -PrintDebyeMass::usuage="Prints Debye Masses in the soft theory" -PrintTemporalScalarCouplings::usage="Prints Temporal-Vector Couplings in the soft theory" -PerformDRhard::usage="Performs the dimensional reduction from hard to soft" -PrintIdentification::usage="Shows dim-red parameters in terms of 4-d ones" -PrintTensorDRalgo::usage="Shows dim-red parameters in terms of 4-d ones" -PrintCouplings::usage="Prints all couplings in the soft theory" -PrintScalarMass::usage="Prints scalar masses in the soft theory" -BetaFunctions3DUS::usage="Prints beta functions in the supersoft theory" -PrintPressure::usage="Prints the preassure in the soft theory" -PrintEffectivePotential::usage="Prints the effective potential in the supersoft theory" -PrintScalarMassUS::usage="Prints scalar masses in the supersoft theory" -AnomDim4D::usage="Prints anomalous dimensions in the 4d theory" -BetaFunctions4D::usage="Prints beta-functions in the 4d theory" -DefineNewTensorsUS::usage="Defines Custom Tensors for Effective-Potential Computations" -SymmetricPhaseEnergy::usage="Prints the energy of the Symmetric Phase" -PrintCouplingsUS::usage="Prints couplings in the supersoft theory" -PrintIdentificationUS::usage="Shows supersoft parameters in terms of soft parameters" -PrintTensorUSDRalgo::usage="Prints tensors in the supersoft theory" -PrintConstants::usage="Prints constants used in the matching" -PrintGenericBasis::usage="Rewrites the results in a different basis" -PrintTensorsVEV::usage="Prints background-field dependent couplings and masses" -DefineVEVS::usuage="Defines background fields for scalars" -RotateTensorsUSPostVEV::usuage="Rotate the field basis. Both for scalar and vector." -RotateTensorsCustomMass::usuage="Creates custom field-dependent masses" -DefineGroup::usuage="Loads the group and names Debye masses" -PerformDRsoft::usage="Perform the reduction from soft to supersoft" -CalculatePotentialUS::usage="Calculates the effective potential" -CompareInvariants::usuage="Finds relations between couplings by calculating basis-invariant tensors" -AllocateTensors::usage="Creates gauge generators" -GradQuartic::usage="Creates Quartic tensors" -GradCubic::usage="Creates Cubic tensors" -GradTadpole::usage="Creates Tadpole tensors" -GradSextic::usage="Creates dim 6 tensors" -GradMass::usage="Creates Mass tensors" -CreateInvariant::usage="Creates an invariant" -CreateInvariantYukawa::usage="Creates Yukawa Tensor" -GradYukawa::usuage="Creates Yukawa tensor" -PrintTadpoles::usuage="Prints Tadpoles" -PrintGaugeRepPositions::usuage="Prints the indices of Gauge reps" -PrintScalarRepPositions::usuage="Prints the indices of Scalar reps" -PrintFermionRepPositions::usuage="Prints the indices of Fermion reps" -DefineNF::usuage="Allows the user to add an arbitrary number of fermion families" -PrintTadpolesUS::usuage="Prints tadpoles in the supersoft theory" -GradMassFermion::usuage="Creates Fermion Invariants" -CreateInvariantFermion::usuage="Creates Fermion Invariants" -SaveModelDRalgo::usuage="Saves a model to a file" -LoadModelDRalgo::usuage="Loads a model from file" -DefineDim6::usuage="Defines a dimension 6 operator" -PrintPressureUS::usuage="Calculates the preassure in the ultrasoft theory" -PrintCouplingsEffective::usuage="Prints higher-order couplings" -CounterTerms4D::usuage="Prints 4d CounterTerms" -DefineTensorsUS::usuage="Uses ultrasoft couplings to construct the potential" - -(* end of public functions*) - - -$DRalgoDic=DirectoryName[$InputFileName]; - - -(* - Functions from groupmath are used to create the model. -*) -If[ Global`$LoadGroupMath, -Get["GroupMath`"]; -Print["GroupMath is an independent package, and is not part of DRalgo"]; -Print["Please Cite GroupMath: Comput.Phys.Commun. 267 (2021) 108085 \[Bullet] e-Print: 2011.01764 [hep-th] -"]; -]; - - -(* - Verbose=True removes progress messages. - Mode=2 calculates everything, Mode=1 only calculates LO masses and couplings - Mode=0 only calculates LO masses -*) -Options[ImportModelDRalgo] = {Verbose -> False,Mode->2,Dim6->False} - - -Begin["`Private`"] - - -(* - Loads all functions. -*) -Get[FileNameJoin[{$DRalgoDic,"Debye.m"}]]; (*Loads additional functions*) -Get[FileNameJoin[{$DRalgoDic,"HardToSoft.m"}]];(*Loads Hard -> Soft functions*) -Get[FileNameJoin[{$DRalgoDic,"SoftToUS.m"}]];(*Loads Soft -> SS functions*) -Get[FileNameJoin[{$DRalgoDic,"EffPot.m"}]];(*Loads Effective Potential Functions*) -Get[FileNameJoin[{$DRalgoDic,"ModelCreation.m"}]];(*Loads Effective Potential Functions*) - - -(* - Defines internal tensors from the loaded model. Also creates help-tensors used for - intermediate calculations. -*) -ImportModelDRalgo[GroupI_,gvvvI_,gvffI_,gvssI_,\[Lambda]1I_,\[Lambda]3I_,\[Lambda]4I_,\[Mu]ijI_,\[Mu]IJFI_,\[Mu]IJFCI_,YsffI_,YsffCI_, OptionsPattern[]]:=Module[{GroupP=GroupI,gvvvP=gvvvI,gvffP=gvffI,gvssP=gvssI,\[Lambda]1IP=\[Lambda]1I,\[Lambda]3P=\[Lambda]3I,\[Lambda]4P=\[Lambda]4I,\[Mu]ijP=\[Mu]ijI,\[Mu]IJFP=\[Mu]IJFI,\[Mu]IJFCP=\[Mu]IJFCI,YsffP=YsffI,YsffCP=YsffCI}, - - -If[ Global`$LoadGroupMath, -If[!GroupMathCleared && !ValueQ[Global`$GroupMathMultipleModels], -Remove["GroupMath`*"]; -GroupMathCleared=True; -]; -]; - -\[Mu]ij=\[Mu]ijP//SparseArray//SimplifySparse; -gvvv=gvvvP//SparseArray//SimplifySparse; -gvss=gvssP//SparseArray//SimplifySparse; -\[Lambda]4=\[Lambda]4P//SparseArray//SimplifySparse; -\[Lambda]3=\[Lambda]3P//SparseArray//SimplifySparse; -Ysff=YsffP//SparseArray//SimplifySparse; -YsffC=YsffCP//SparseArray//SimplifySparse; -gvff=gvffP//SparseArray//SimplifySparse; -\[Mu]IJF=\[Mu]IJFP//SparseArray//SimplifySparse; -\[Mu]IJFC=\[Mu]IJFCP//SparseArray//SimplifySparse; -\[Lambda]1=\[Lambda]1IP//SparseArray//SimplifySparse; -ns=Length[gvss[[1]]]; -nv=Length[gvvv]; -nf=Length[gvff[[1]]]; -\[Lambda]6=EmptyArray[{ns,ns,ns,ns,ns,ns}]; - -(*Options*) -verbose = OptionValue[Verbose]; -mode = OptionValue[Mode]; (*If 2 everthing is calculated. And if 2 only 1-loop contributions are calculated*) -NFMat=IdentityMatrix[nf]//SparseArray; (*This matrix is only relevant if the user wants an arbitrary number of fermion families*) -(*End of Options*) - -CT=False; (*Checks if counter-terms have already been calculated*) -DefineGroup[GroupP]; (*Names Debye masses*) -GroupDR=GroupP; (*For saving purposes*) -CreateHelpTensors[] (*Creates recurring tensors*) -]; - - -(* - Defines a \[Phi]^6 operator -*) -DefineDim6[\[Lambda]6I_]:=Module[{\[Lambda]6P=\[Lambda]6I}, -If[mode>=3, -\[Lambda]6=\[Lambda]6P//SparseArray; -, -Print["Please set mode=3 to use this feature"]; -]; -]; - - -(* - Takes the user-defined group and names debye masses. -*) -DefineGroup[GroupI_]:=Module[{GroupP=GroupI}, -(*The Debye mass matrix is \[Mu]abDef*) -(*At tree-level this matrix is 0. But after DR, thermal masses are named accoording to \[Mu]abDef.*) -\[Mu]abDef=CreateDebyeMasses[GroupP]; -VecMassDefined=True; -]; - - -(* - Enables the user to add an arbitrary number of fermions. - This works by creating a diagonal matrix. Each element NFMatP[[i,i]] corresponds to how many times the - fermion labled by ii appears. -*) -DefineNF[NFMatP_]:=Module[{NFMatI=NFMatP}, -Do[NFMat[[i[[2]],i[[2]]]]*=i[[1]],{i,NFMatI}];(*Each element is multiplied with nF_i*) -]; - - -(* - Performs the dimensional reduction for all couplings and masses. -*) - -PerformDRhard[]:=Module[{}, - -If[mode>=0, -ScalarMass[]; -VectorMass[]; -]; - -If[mode>=1, -CreateBasisVanDeVis[]; - -ScalarSelfEnergy[]; -VectorSelfEnergy[]; -ScalarCubic[]; -ScalarQuartic[]; -TransverseSSVV[]; -LongitudionalSSVV[]; -LongitudionalVVVV[]; -LongitudionalVVS[]; -TadPole[]; -]; - - -If[mode>=2, -CounterTerm[]; -VectorMass2Loop[]; -ScalarMass2Loop[]; -TadPole2Loop[]; -SymmetricPhaseEnergy[]; -]; - -If[mode>=3, -(*Calculates effective dim 6 operators*) -ScalarSextic[]; -]; - - -(* - This step takes all calculations and removes redundancies. For example, if one element is (g^4 Lb) - and another 3(g^4 Lb), the function replaces element 2 by three times the first element. This also - works for linear combinations of elements. -*) - -IdentifyTensorsDRalgo[]; - -]; - - - -(* - Performs the reduction from soft to supersoft. - ListHardP is a list which tells the code which scalars should be integrated out. - By default all Debye-vectors (temporal-vectors) are integrated out. -*) - -PerformDRsoft[ListHardP_]:=Module[{ListHardI=ListHardP}, -(*Options*) - -PrepareSoftToSuperSoft[ListHardI]; -CreateHelpTensorsSS[]; - -ScalarSelfEnergySS[]; -TadPoleSS[];(*Calculates tadpoles*) -HeavyScalarMassSS[];(*Includes self-energies for heavy-lines with soft momenta*) -VectorSelfEnergySS[]; -ScalarVectorCouplingSS[]; -ScalarQuarticSS[]; -ScalarCubicsSS[]; -ScalarMassSS[]; -If[mode>=2, -ScalarMass2LoopSS[]; -SymmetricPhaseEnergyUS[]; -]; - -(* - This step takes all calculations and removes redundancies. For example, if one element is (g^4 Lb) - and another 3(g^4 Lb), the function replaces element 2 by three times the first element. This also - works for linear combinations of elements. -*) -IdentifyTensorsSSDRalgo[] -]; - - -(* - Prints constants that appear in the effective theory. -*) -PrintConstants[]:=Module[{}, -ToExpression[StringReplace[ToString[StandardForm[{Lb->(Log[\[Mu]^2/T^2]-2 Log[4 \[Pi]]+2EulerGamma),Lf->(Log[\[Mu]^2/T^2]-2 Log[4 \[Pi]]+2EulerGamma+4 Log[2])}]],"DRalgo`Private`"->""]] -]; - - -(* - Replaces the Glaisher constant by c, which is sometimes used in the litterature. See for example hep-ph: 9508379 -*) -PrintGenericBasis[]:=Module[{}, -ToExpression[StringReplace[ToString[StandardForm[{Log[Glaisher]->-1/12 (Lb+2cplus-EulerGamma)}]],"DRalgo`Private`"->""]] -]; - - -(* - Checks if two variables are identical up to a numerical factor - For example if a=x^2 y and b=y, then there's no relation, and the function returns nothing. - While if a=x^2 and b=5 x^2 the function returns 5 -*) -CompExp2[a0_,b0_]:=Module[{a=a0,b=b0}, -Comps=Solve[a v[1]- b ==0,v[1]]//Simplify//DeleteDuplicates//Select[#,UnsameQ[#,{}]&]&; -Comps/. {v[x_]->a_}:>a -] - - -(* - Old function: Should maybe be removed. - This function finds linear dependencies between the variables in list. - Only numerical factors are included. - The result is given in Mat. Where Mat[[i,j]]=0 if list[[i]]!=N list[[j]] where N is a number. - Otherwise Mat[[i,j]]=N if list[[i]]=Nlist[[j]] -*) -OverallFac[list_,varMat_]:=Module[{L=list,Mat=varMat}, - -For[i=1,i0,{NumericQ/@help}[[1,1]]&&Equal@@NumericQ/@help,False]; -If[TempIf,a=help[[1]],a=0]; -Mat[[i,j]]=a; -]; -]; -Mat -] - - -(* - Old function:Should maybe be removed. - This function finds linear dependences between the variables in listvar - Only relations between two variables are considered. - This function is only used for the soft->supersoft step where the faster, and more general, - RelationsBVariables3 has problems due to inverse powers of masses. -*) -RelationsBVariables[list_,listVar_]:=Module[{L=list,LV=listVar}, -LVTemp=LV; -If[L[[1]]==0, - L=Delete[L,1]; -]; - -Mat=ConstantArray[0,{Length[L],Length[L]}];(*Linear-dependency matrix*) -Mat1=OverallFac[L,Mat]; -TempVar=ConstantArray[0,{Length[LV]}]; -For[i=1,i1, - Lp=Delete[L,1]; -, - Lp=L; -]; - - -varHelp=Lp//Variables; -varFix=#->0&/@varHelp; (*Trick to ensure that vectors are expanded properly*) - -(* -Expands all elements in Lp in terms of basDR. -*) -setVecs=Table[Coefficient[i,basDR],{i,Lp}]/.varFix; -(*Delete columns with only 0s*) -setVecs=Transpose[DeleteCases[Transpose[setVecs], {0 ..}, Infinity]]; - -(*Finds independent basis*) -rr = setVecs // Transpose // RowReduce; -rr=DeleteCases[rr, {0 ..}, Infinity]; -(*Basis elements*) -basisElements = Flatten[FirstPosition[#, 1, Nothing] & /@ rr]; -varBasis=Table[ \[Lambda]VL[a],{a,1,Length[basisElements]}]; - -(*Puts everything together*) -LVTemp=LVTemp=ConstantArray[0,Length[Lp]]; -Do[LVTemp[[i]]=rr[[;;,i]] . varBasis,{i,1,Length[LVTemp]}]; - -Return[LVTemp]; -] - - -myPrint[args__,{style__}]:=Print[Row[{args},BaseStyle->{style}]] - - -(* - Old function: Should maybe be removed. - This function finds linear dependencies between the variables in list. - Only numerical factors are included. - The result is given in Mat. Where Mat[[i,j]]=0 if list[[i]]!=N list[[j]] where N is a number. - Otherwise Mat[[i,j]]=N if list[[i]]=Nlist[[j]] -*) -OverallFac2[list_,varMat_]:=Module[{L=list,Mat=varMat}, - -TotVar=L//Variables; -DoneList=ConstantArray[0,1]; - -For[i=1,i True]&/@Vars),1, {0, -1}, Heads -> True]; - - -(* - Checks if two variables are identical up to a numerical factor - For example if a=x^2 y and b=y, then there's no relation, and the function returns nothing. - While if a=x^2 and b=5 x^2 the function returns 5. -*) -CompExp3[a0_,b0_]:=Module[{a=a0,b=b0}, -Temp=Simplify[b/a]; -If[NumericQ[Temp],Return[Temp],Return[0]]; -] - - -(* - Converts an array to a saveable form -*) -ConvertToSaveFormat[tens_SparseArray]:=Module[{}, -Return[{tens["NonzeroPositions"],tens["NonzeroValues"],Dimensions[tens]}] -]; - - -(* - Converts imported data, as defined by ConvertToSaveFormat, to a sparse array -*) -ConvertToSparse[arr_]:=Module[{}, -Return[SparseArray[arr[[1]]->arr[[2]],arr[[3]]]] -]; - - -(* - Loads the position of all scalar,gauge, and fermion representations. -*) -LoadRepPositions[repPos_]:=Module[{repPosP=repPos}, -ScalarVariablesIndices=repPosP[[1]]; -GaugeIndices=repPosP[[2]]; -FermionVariablesIndices=repPosP[[3]]; -]; - - -(* - Loads the names of gauge couplings. -*) -LoadCouplingNames[couplingNamesI_]:=Module[{couplingNamesP=couplingNamesI}, -GaugeCouplingNames=couplingNamesP; -]; - - -(* - Saves a model by converting all coupling-tensors to a list. -*) -SaveModelDRalgo[modelInfo_,fileName_]:=Module[{modelInfoP=modelInfo}, - -PosScalar=PrintScalarRepPositions[]; -PosVector=PrintGaugeRepPositions[]; -PosFermion=PrintFermionRepPositions[]; -PosReps={PosScalar,PosVector,PosFermion}; -tensP={modelInfoP,PosReps,GaugeCouplingNames,GroupDR,gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJFC,\[Mu]IJF,Ysff,YsffC}; -SaveFile={tensP[[1]],tensP[[2]],tensP[[3]],tensP[[4]]}; (*The fourth element is the group*) -tensP=Delete[Delete[Delete[Delete[tensP,1],1],1],1]; -Do[ -AppendTo[SaveFile,ConvertToSaveFormat[i]]; -,{i,tensP}]; -Export[fileName,SaveFile]; -]; - - -(* - Loads tensors that are saved by SaveModelDRalgo -*) -LoadModelDRalgo[fileName_]:=Module[{}, -arrImp=ReadList[fileName]; -InfoText=arrImp[[1]];(*The first element is the info*) -arrImp=Delete[arrImp,1]; - -LoadRepPositions[arrImp[[1]]];(*The Second element is the repPositions*) -arrImp=Delete[arrImp,1]; - -LoadCouplingNames[arrImp[[1]]];(*The Third element is the gauge-coupling names*) -arrImp=Delete[arrImp,1]; - -ImportFile={arrImp[[1]]};(*The fourth element is the group*) -arrImp=Delete[arrImp,1]; - -Do[ -AppendTo[ImportFile,ConvertToSparse[i]]; -,{i,arrImp}]; -(*Prints the info text*) -Print[Grid[{{Row[InfoText,"\n",BaseStyle->(FontFamily->"Consolas")]}},Alignment->{Left,Center}]]; -(**) -Return[ImportFile] -]; - - -(* - All private constants. -*) - - -{ZLij,GvvssTSS,\[Lambda]3DSS,\[Mu]ijSSLO,\[Mu]ijSSNLO,\[Mu]ijSNLOSS,\[Lambda]3DSS,\[Lambda]KVecTSS,\[Lambda]3CTot,\[Lambda]3CSSS,ZSij,\[Mu]ijSSNLO2,Ggvvv}; - - -{TadPoleS,ContriTadPoleSoftToHard,GgvvvSS,\[Lambda]4SMod,\[Lambda]4Tot,IdentMatPre}; - - -{\[Beta]gvff,Zgvff,\[Mu]ijEP,gvvvEP,gvssEP,\[Lambda]4EP,\[Lambda]3EP,nsEP,nvEP,CT,HelpSolveEffectiveHardM}; - - -{aS3D,ZijS,aV3D,ZabT,ZabL,\[Lambda]3D,GvvssL,GvvssT,\[Lambda]AA,\[Lambda]3CS,\[Mu]SijNLO,GvvsL};(*DimRed Results*) - - -{\[CapitalLambda]\[Lambda],\[CapitalLambda]g,Hg,Habij,HabIJF,HabIJFC,Ysij,YsijC,YTemp,YTempC,Yhelp,YhelpC};(*Private Variables*) - - -{\[Gamma]ij,\[Beta]mij,\[Beta]\[Lambda]ijkl,Z\[Lambda]ijkl,\[Gamma]ab,\[Beta]vvss,Zgvvss,\[Beta]gvvv,Zgvvv,\[Gamma]IJF,\[Beta]Ysij,ZYsij,\[Beta]YsijC,ZYsijC};(*CounterTerms*) - - -{\[Lambda]3DS,\[Lambda]KVecT,\[Lambda]KVec,\[Lambda]AAS,IdentMat,\[Mu]ijVNLO,\[Mu]ijSNLO,\[Lambda]3CSRed,\[Lambda]1IP,NFMat,NSMat};(*Private Variables*) - - -{nsH,nSl,\[Lambda]K,\[Lambda]4S,\[Lambda]4K,\[Lambda]x,\[Lambda]y,gAvss,gvssL,\[Mu]ijL,\[Mu]ijLight}; - - -{HabijL,HabijVL,HabijA,HabijVA,\[Lambda]3Cx,\[Lambda]3Cy,\[Lambda]3CLight,\[Lambda]3CHeavy,\[Mu]IJF,\[Mu]IJFC,\[Mu]VabNLO,\[Mu]abDef,GroupMathCleared} - - -End[] -EndPackage[] diff --git a/DRalgo/Debye.m b/DRalgo/Debye.m deleted file mode 100644 index 6a86ca3..0000000 --- a/DRalgo/Debye.m +++ /dev/null @@ -1,231 +0,0 @@ -(* ::Package:: *) - -(* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *) - -(* :Title: Debye *) - -(* - This software is covered by the GNU General Public License 3. - Copyright (C) 2021-2022 Andreas Ekstedt - Copyright (C) 2021-2022 Philipp Schicho - Copyright (C) 2021-2022 Tuomas V.I. Tenkanen - -*) - -(* :Summary: Names Debye masses for the dimensionally reduced theory. *) - -(* ------------------------------------------------------------------------ *) - - -(* - This module takes a list of groups and names Debye masses for each group. - If there are multiple groups with the same names, the masses are indexed. - In addition, for such cases there are additional masses created to - represent mixing between the groups. - -*) - -CreateDebyeMasses[GroupI_]:=Module[{GroupP=GroupI}, - -Components=ComponentsOfGroup[GroupP];(*The number of components for each rep*) -Indexing=IndexDuplicateGroups[GroupP]; (*Position of groups with multiple factors*) -If[Length[GroupP]<1, -Return[{}] (*No mass is created if there are no group*) -, -Debye=StringJoin["\[Mu]sq",Indexing[[1]]]IdentityMatrix[Components[[1]]]; (*names each mass \[Mu]sq+"group name"*) -If[Length[GroupP]>1, -Do[ -Temp=StringJoin["\[Mu]sq",Indexing[[i]]]IdentityMatrix[Components[[i]]]; -DebyeTemp=ArrayFlatten[{{Debye,0},{0,Temp}}]; (*Stack the masses on the diagonal*) -Debye=DebyeTemp; -, -{i,2,Length[GroupP]}] -]; -]; - -(* - - Create off-diagonal masses. The convention is that for the group {"U1","U1","U1"}, \[Mu]sqU1Mix1 is the mixing between the first and second group. - \[Mu]sqU1Mix2 is the mixing between the first and third group. And \[Mu]sqU1Mix3 is the mixing between the second and third group etc. -*) -PosDup=Select[positionDuplicates[GroupP],Length[#]>1&]; -Do[ -k=1; -nameHelp=Reps[[l]][[1]]; -PosDupHelp=PosDup[[l]]; -TempList=Drop[PosDupHelp,-1]; -TempList2=Drop[PosDupHelp,1]; -MixVec={}; -Do[ -Do[ -NameTemp=StringJoin[StringJoin[nameHelp,"Mix"],ToString[k]]; -Size=Components[[i]]; -(*Determines where in the mass matrix each group should go*) -HorInd=(Components[[1;;j]]//Total[#]&)-Size+1; -VertInd=(Components[[1;;i]]//Total[#]&)-Size+1; -VecTemp={NameTemp,HorInd,VertInd,Size}; -AppendTo[MixVec,VecTemp]; -k=k+1; -,{j,TempList2}]; -TempList2=Drop[TempList2,1]; -,{i,TempList}]; -Do[ -MixVecHelp=MixVec[[n]]; -MatTemp=StringJoin["\[Mu]",MixVecHelp[[1]]]IdentityMatrix[MixVecHelp[[4]]]; - -Debye[[MixVecHelp[[2]];;MixVecHelp[[2]]+MixVecHelp[[4]]-1,MixVecHelp[[3]];;MixVecHelp[[3]]+MixVecHelp[[4]]-1]]=MatTemp; -Debye[[MixVecHelp[[3]];;MixVecHelp[[3]]+MixVecHelp[[4]]-1,MixVecHelp[[2]];;MixVecHelp[[2]]+MixVecHelp[[4]]-1]]=MatTemp; -,{n,1,Length[MixVec]}]; - -,{l,1,Length[PosDup]}]; -Return[SparseArray[ToExpression[Debye]]] -]; - - -(* - Old routine.This routine should be removed. -*) -CreateDebyeMassesOld[GroupI_]:=Module[{GroupP=GroupI}, -Components=ComponentsOfGroup[GroupP];(*The number of components for each rep*) -Indexing=IndexDuplicateGroups[GroupP]; -If[Length[GroupP]<1, -Return[{}] -, -Debye=StringJoin["\[Mu]",Indexing[[1]]]IdentityMatrix[Components[[1]]]; -If[Length[GroupP]>1, -Do[ -Temp=StringJoin["\[Mu]",Indexing[[i]]]IdentityMatrix[Components[[i]]]; -DebyeTemp=ArrayFlatten[{{Debye,0},{0,Temp}}]; -Debye=DebyeTemp; -, -{i,2,Length[GroupP]}] - -]; -]; -Return[SparseArray[ToExpression[Debye]]] -]; - - -(* - Counts the number of components for the adjoint reps. That is SUReps["SUN"] would correspond to N^2-1. -*) -ComponentsOfGroup[GroupI_]:=Module[{GroupP=GroupI}, -SpRes=SPReps[GroupP]; -SuRes=SUReps[GroupP]; -SoRes=SOReps[GroupP]; -G2Res=G2Reps[GroupP]; -F4Res=F4Reps[GroupP]; -E6Res=E6Reps[GroupP]; -E7Res=E7Reps[GroupP]; -E8Res=E8Reps[GroupP]; -U1Res=U1Reps[GroupP]; -TotRes={SoRes,SuRes,SpRes,G2Res,F4Res,E6Res,E7Res,E8Res,U1Res}//Flatten[#,1]&; -Return[TotRes] -]; - - -U1Reps[GroupI_]:=Module[{GroupP=GroupI}, -Temp=StringReplace[GroupP,{"U1"->""}]; -U1Tensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies U1 groups*) -numTensor=1&/@(Read[StringToStream[#],Number]&/@StringReplace[U1Tensor,{"U1"->""}]);(*Replace the group with the dimension of the adjoint rep*) -Return[numTensor] -]; - - -E8Reps[GroupI_]:=Module[{GroupP=GroupI}, -Temp=StringReplace[GroupP,{"E8"->""}]; -E8Tensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies E8 groups*) -numTensor=248&/@(Read[StringToStream[#],Number]&/@StringReplace[E8Tensor,{"E8"->""}]);(*Replace the group with the dimension of the adjoint rep*) -Return[numTensor] -]; - - -E7Reps[GroupI_]:=Module[{GroupP=GroupI}, -Temp=StringReplace[GroupP,{"E7"->""}]; -E7Tensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies E7 groups*) -numTensor=133&/@(Read[StringToStream[#],Number]&/@StringReplace[E7Tensor,{"E7"->""}]);(*Replace the group with the dimension of the adjoint rep*) -Return[numTensor] -]; - - -E6Reps[GroupI_]:=Module[{GroupP=GroupI}, -Temp=StringReplace[GroupP,{"E6"->""}]; -E6Tensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies E6 groups*) -numTensor=78&/@(Read[StringToStream[#],Number]&/@StringReplace[E6Tensor,{"E6"->""}]);(*Replace the group with the dimension of the adjoint rep*) -Return[numTensor] -]; - - -F4Reps[GroupI_]:=Module[{GroupP=GroupI}, -Temp=StringReplace[GroupP,{"F4"->""}]; -F4Tensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies F4 groups*) -numTensor=52&/@(Read[StringToStream[#],Number]&/@StringReplace[F4Tensor,{"F4"->""}]);(*Replace the group with the dimension of the adjoint rep*) -Return[numTensor] -]; - - -G2Reps[GroupI_]:=Module[{GroupP=GroupI}, -Temp=StringReplace[GroupP,{"G2"->""}]; -G2Tensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies G2 groups*) -numTensor=14&/@(Read[StringToStream[#],Number]&/@StringReplace[G2Tensor,{"G2"->""}]);(*Replace the group with the dimension of the adjoint rep*) -Return[numTensor] -]; - - -SPReps[GroupI_]:=Module[{GroupP=GroupI}, -Temp=StringReplace[GroupP,{"SP"->""}]; -SPTensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies SP groups*) -numTensor=SPAdjoint[#]&/@(Read[StringToStream[#],Number]&/@StringReplace[SPTensor,{"SP"->""}]);(*Replace the group with the dimension of the adjoint rep*) -numTensorS=ToString[#]&/@numTensor;(*Converts to string*) -Return[numTensor] -]; - - -SPAdjoint[n_]:=1/2n(n+1); - - -SUReps[GroupI_]:=Module[{GroupP=GroupI}, -Temp=StringReplace[GroupP,{"SU"->""}]; -SUTensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies SU groups*) -numTensor=SUAdjoint[#]&/@(Read[StringToStream[#],Number]&/@StringReplace[SUTensor,{"SU"->""}]);(*Replace the group with the dimension of the adjoint rep*) -numTensorS=ToString[#]&/@numTensor;(*Converts to string*) -Return[numTensor] -]; - - -SUAdjoint[n_]:=n^2-1; - - -SOReps[GroupI_]:=Module[{GroupP=GroupI}, -Temp=StringReplace[GroupP,{"SO"->""}]; -SOTensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies SO groups*) -numTensor=SOAdjoint[#]&/@(Read[StringToStream[#],Number]&/@StringReplace[SOTensor,{"SO"->""}]);(*Replace the group with the dimension of the adjoint rep*) -numTensorS=ToString[#]&/@numTensor;(*Converts to string*) -Return[numTensor] -]; - - -SOAdjoint[n_]:=n (n-1)/2; - - -positionDuplicates[list_] := GatherBy[Range@Length[list], list[[#]] &] - - -IndexDuplicateGroups[GroupI_]:=Module[{GroupP=GroupI}, -Duplicates=Select[positionDuplicates[GroupP],Length[#]>1&];(*Selects all reccuring groups*) -Reps=Table[GroupP[[Duplicates[[i]]]],{i,Length[Duplicates]}]; -RepsRenamed=Table[IndexDuplicates[Reps[[i]]],{i,Length[Duplicates]}]; -ResTemp=GroupP; -Do[ -Temp=RepsRenamed[[i,;;]]; -ResTemp[[Duplicates[[i]]]]=Temp; -,{i,Length[Duplicates]}]; -Return[ResTemp] -]; - - -IndexDuplicates[GroupI_]:=Module[{GroupP=GroupI}, -Dup=ToString[#]&/@(Table[i,{i,Length[GroupP]}]); -DupFinal=StringJoin["P",#]&/@Dup; -Return[Table[StringJoin[GroupP[[i]],DupFinal[[i]]],{i,Length[GroupP]}]] -]; diff --git a/DRalgo/EffPot.m b/DRalgo/EffPot.m deleted file mode 100644 index fee450c..0000000 --- a/DRalgo/EffPot.m +++ /dev/null @@ -1,342 +0,0 @@ -(* ::Package:: *) - -(* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *) - -(* :Title: EffPot *) - -(* - This software is covered by the GNU General Public License 3. - Copyright (C) 2021-2022 Andreas Ekstedt - Copyright (C) 2021-2022 Philipp Schicho - Copyright (C) 2021-2022 Tuomas V.I. Tenkanen - -*) - -(* :Summary: Compute the effecitve potential. *) - -(* ------------------------------------------------------------------------ *) - - -(* - User-defined model. -*) -DefineNewTensorsUS[\[Mu]ijI_,\[Lambda]4I_,\[Lambda]3I_,gvssI_,gvvvI_]:=Module[{\[Mu]ijP=\[Mu]ijI,\[Lambda]4P=\[Lambda]4I,\[Lambda]3P=\[Lambda]3I,gvssP=gvssI,gvvvP=gvvvI}, -\[Mu]ijEP=\[Mu]ijP//SparseArray; -gvvvEP=gvvvP//SparseArray; -gvssEP=gvssP//SparseArray; -\[Lambda]4EP=\[Lambda]4P//SparseArray; -\[Lambda]3EP=\[Lambda]3P//SparseArray; -nsEP=Length[gvssEP[[1]]]; -nvEP=Length[gvvvEP]; - -]; - - -(* - Defines parameters directly that are used by the effective potential -*) -DefineTensorsUS[]:=Module[{}, -(*We only need to modify the gauge couplings*) -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3dUS"]],{c,GaugeCouplingNames}]; -gvvvEP=gvvv//Normal//ReplaceAll[#,SubGauge]&//SparseArray; - -(*We only need to modify the gauge couplings*) -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3dUS"]],{c,Variables[Normal[\[Lambda]4Light]]}]; -\[Lambda]4EP=\[Lambda]4Light//Normal//ReplaceAll[#,SubGauge]&//SparseArray; -(*We only need to modify the gauge couplings*) -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3dUS"]],{c,Variables[Normal[\[Lambda]3CLight]]}]; -\[Lambda]3EP=\[Lambda]3CLight//Normal//ReplaceAll[#,SubGauge]&//SparseArray; -(*We only need to modify the gauge couplings*) -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3dUS"]],{c,Variables[Normal[\[Mu]ijLight]]}]; -\[Mu]ijEP=\[Mu]ijLight//Normal//ReplaceAll[#,SubGauge]&//SparseArray; - -(*We only need to modify the gauge couplings*) -VarGauge=Table[Symbol[ToString[c]<>ToString["3d"]],{c,GaugeCouplingNames}]; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["US"]],{c,VarGauge}]; -gvssEP=gvssL//Normal//ReplaceAll[#,SubGauge]&//SparseArray; - -nsEP=Length[gvssEP[[1]]]; -nvEP=Length[gvvvEP]; - -]; - - -(* - DiagonalMatrix was only introduced in Mathematica 12. So this is a hack for older versions. - Did I mention that I am a fan of Mathematica? -*) -DiagonalMatrixQAE[matI_]:=Module[{matP=matI}, -VarMat=#->RandomInteger[10000]&/@(Normal[matP]//Variables); -matDia=Normal[DiagonalMatrix[Diagonal[matP]]]/.VarMat; -matT=Normal[matP]/.VarMat; -Return[matDia==matT] -]; - - -{\[Mu]ijEP\[Phi],\[Mu]ijVec\[Phi],Gvvs\[Phi],\[Lambda]3\[Phi],\[Lambda]4\[Phi],gvvv\[Phi],gvss\[Phi],\[Phi]Vev}; - - -(* - Creates field-dependent couplings. These are created from the user's \[Phi]Vecp input. -*) -DefineVEVS[\[Phi]Vecp_]:=Module[{\[Phi]Vec=\[Phi]Vecp}, - -HabijVEP=Transpose[Activate@TensorContract[Inactive@TensorProduct[gvssEP,gvssEP],{{3,5}}],{1,3,2,4}]+Transpose[Transpose[Activate@TensorContract[Inactive@TensorProduct[gvssEP,gvssEP],{{3,5}}],{1,3,2,4}],{2,1,3,4}]; - -\[Phi]Vev=\[Phi]Vecp//SparseArray; -\[Mu]ijEP\[Phi]=\[Mu]ijEP+1/2 Activate@TensorContract[Inactive@TensorProduct[\[Lambda]4EP,\[Phi]Vec,\[Phi]Vec],{{3,5},{4,6}}]+ Activate@TensorContract[Inactive@TensorProduct[\[Lambda]3EP,\[Phi]Vec],{{3,4}}]//SparseArray; -\[Mu]ijVec\[Phi]=-1/2 Activate@TensorContract[Inactive@TensorProduct[HabijVEP,\[Phi]Vec,\[Phi]Vec],{{3,5},{4,6}}]//SparseArray; -Gvvs\[Phi]=-Activate@TensorContract[Inactive@TensorProduct[HabijVEP,\[Phi]Vec],{{4,5}}]; -\[Lambda]3\[Phi]=\[Lambda]3EP+Activate@TensorContract[Inactive@TensorProduct[\[Lambda]4EP,\[Phi]Vec],{{4,5}}]; -\[Lambda]4\[Phi]=\[Lambda]4EP//SparseArray; -gvvv\[Phi]=gvvvEP//SparseArray; -gvss\[Phi]=gvssEP//SparseArray; - -If[DiagonalMatrixQAE[\[Mu]ijVec\[Phi]]==False, -Print["The Vector Mass-Matrix is not Diagonal"]; -]; - - -If[DiagonalMatrixQAE[\[Mu]ijEP\[Phi]]==False, -Print["The Scalar Mass-Matrix is not Diagonal"]; -]; - -]; - - -Options[CalculatePotentialUS] = {CustomMasses -> False} - - -(* - Calculates the effective potential with custom masses -*) -CalculatePotentialUS[ScalMassI_,VecMassI_,OptionsPattern[]]:=Module[{ScalMassP=ScalMassI,VecMassP=VecMassI}, - -CustomMass= OptionValue[CustomMasses]; -If[CustomMass==True, -\[Mu]ijEP\[Phi]=ScalMassP//SparseArray; -\[Mu]ijVec\[Phi]=VecMassP//SparseArray; - -If[DiagonalMatrixQAE[\[Mu]ijEP\[Phi]]==True && DiagonalMatrixQAE[\[Mu]ijVec\[Phi]]==True, -CalculateLOPotentialSS[]; -CalculateNLOPotentialSS[]; - -VTot={VLO,VNLO}; -, -Print["The Mass matrices are not diagonal. Please rotate to the mass-basis using RotateTensorsUSPostVeV[]"]; -]; -, -Print["Please set CustomMasses->True"] -]; - - -]; - - -(* - Calculates the effective potential. -*) -CalculatePotentialUS[OptionsPattern[]]:=Module[{}, - -CustomMass= OptionValue[CustomMasses]; -If[CustomMass==False, -If[DiagonalMatrixQAE[\[Mu]ijEP\[Phi]]==True && DiagonalMatrixQAE[\[Mu]ijVec\[Phi]]==True, -CalculateLOPotentialSS[]; -CalculateNLOPotentialSS[]; -CalculateNNLOPotentialSS[]; - -VTot={VLO,VNLO,VNNLO}; -, -Print["The Mass matrices are not diagonal. Please rotate to the mass-basis using RotateTensorsUSPostVeV[]"]; -]; -, -Print["Please supply scalar and vector mass matrices"] -]; - - -]; - - -(* - Prints the effective potential. -*) -PrintEffectivePotential[optP_]:=Module[{opt=optP}, -EffPotPrint=Switch[opt,"LO",VTot[[1]],"NLO",VTot[[2]],"NNLO",VTot[[3]]]; - -(*Printing Result*) -ToExpression[StringReplace[ToString[StandardForm[EffPotPrint]],"DRalgo`Private`"->""]] -]; - - -{VLO,VNLO,VNNLO}; - - -(* - Calculates the two-loop effective potential. -*) -CalculateNNLOPotentialSS[]:=Module[{}, -If[verbose==True,Print["Calculating the 2-Loop Effective Potential"]]; - -(*The notation follows Martin's convention*) -(*Please see arXiv:1808.07615*) - -Q=\[Mu]3US; (*RG scale*) - -(*Definitions*) -\[Sigma]=1/(16 \[Pi]^2); -f[x_]:=-(1/(12 \[Pi])) x^(3/2); -A[0]=0; -A[x_]:=-(1/(4 \[Pi])) Sqrt[x]; -I2[0,0,0]=0; -I2[x_,y_,z_]:=1/(4 \[Pi])^2 (Log[Q/(Sqrt[x]+Sqrt[y]+Sqrt[z])]+1/2); -I2Div[x_,y_,z_]:=1/(4 \[Pi])^2 1/4; -\[CapitalLambda][x_,y_,z_]:=x^2+y^2+z^2-2x y-2x z-2 y z; -fsss[x_,y_,z_]:=-I2[x,y,z]; -fss[x_,y_]:=A[x]A[y]; -fvs[x_,y_]:=2 A[x]A[y]; -fssv[x_,y_,z_]:=1/z (-\[CapitalLambda][x,y,z]I2[x,y,z]+(x-y)^2 I2[x,y,0]+z A[x] A[y]+(y-x-z)A[x] A[z]+(x-y-z)A[y] A[z]+(x-y)A[x] A[0]+(y-x)A[y] A[0]); -fssv[x_,y_,0]:=(x+4 Sqrt[x] Sqrt[y]+y+4 (x+y) Log[Q/(Sqrt[x]+Sqrt[y])])/(32 \[Pi]^2); -fssv[0,0,0]:=0; - -fvbvbs[x_,y_,z_]:=1/(4 x y) (-(x+y-z)^2I2[x,y,z]+(x-z)^2 I2[x,0,z]+(y-z)^2 I2[0,y,z]-z^2 I2[0,0,z]+(z-x-y)A[x] A[y]+y A[x] A[z]+x A[y] A[z]+z A[0] A[0]+(x-z)A[x]A[0]+(y-z)A[y]A[0]-(x+y)A[z]A[0]); -fvbvbs[0,y_,z_]:=1/(128 \[Pi]^2 y) (-3 y+4 Sqrt[y] Sqrt[z]-4 y Log[Q/(Sqrt[y]+Sqrt[z])]+4 z Log[Q/(Sqrt[y]+Sqrt[z])]-4 z Log[Q/Sqrt[z]]); -fvbvbs[x_,0,z_]:=fvbvbs[0,x,z]; -fvbvbs[0,0,z_]:=(-1-4 Log[Q/Sqrt[z]])/(128 \[Pi]^2); -fvbvbs[0,0,0]:=0; -fvvs[x_,y_,z_]:=fvbvbs[x,y,z]-I2[x,y,z]+2I2Div[x,y,z]; -fvv[x_,y_]:=8/3 A[x]A[y]; -fvvv[x_,y_,z_]:=1/(4x y z) (-\[CapitalLambda][x,y,z](\[CapitalLambda][x,y,z] I2[x,y,z]+4(x y+ x z+ y z)(2 I2[x,y,z]-2 I2Div[x,y,z]))+(x-y)^2 ((x^2+y^2+6x y)I2[x,y,0]-8 x y I2Div[x,y,0])-z^4 I2[z,0,0]+(x-z)^2 ((x^2+z^2+6x z)I2[x,z,0]-8 x z I2Div[x,0,z])-y^4 I2[y,0,0]+(y-z)^2 ((y^2+z^2+6y z)I2[y,z,0]-8y z I2Div[0,y,z])-x^4 I2[x,0,0]+ z A[x]A[y](z^2-5(x^2+y^2-x z -y z)-26/3x y)+ y A[x]A[z](y^2-5(x^2+z^2-x y -y z)-26/3x z)+ x A[z]A[y](x^2-5(z^2+y^2-x z -y x)-26/3z y)-A[x]A[0](-9 x^2 (y+z)+9x (y^2+z^2)+y^3+z^3)-A[y]A[0](-9 y^2 (x+z)+9y (x^2+z^2)+x^3+z^3)-A[z]A[0](-9 z^2 (x+y)+9z (x^2+y^2)+x^3+y^3)+(x^3+y^3+z^3)A[0]A[0]); -fvvv[x_,y_,0]:=1/(384 \[Pi]^2 x y) (-48 x^(5/2) Sqrt[y]+27 x^2 y-18 x^(3/2) y^(3/2)+27 x y^2-48 Sqrt[x] y^(5/2)-136 \[Pi]^2 x^2 y \[Sigma]-136 \[Pi]^2 x y^2 \[Sigma]+26 x y (x+y) Log[(E^EulerGamma Glaisher^12 Q^2)/(16 \[Pi]^2 T^2)]+48 x^3 Log[Q/Sqrt[x]]-48 x^3 Log[Q/(Sqrt[x]+Sqrt[y])]+192 x^2 y Log[Q/(Sqrt[x]+Sqrt[y])]+192 x y^2 Log[Q/(Sqrt[x]+Sqrt[y])]-48 y^3 Log[Q/(Sqrt[x]+Sqrt[y])]+48 y^3 Log[Q/Sqrt[y]]); -fvvv[x_,0,z_]:=fvvv[x,z,0]; -fvvv[0,y_,z_]:=fvvv[y,z,0]; -fvvv[0,0,0]:=0; -fvvv[x_,0,0]:=-(1/(384 \[Pi]^2)) x (-3+136 \[Pi]^2 \[Sigma]-26 Log[(E^EulerGamma Glaisher^12 Q^2)/(16 \[Pi]^2 T^2)]-192 Log[Q/Sqrt[x]]); -fvvv[0,y_,0]:=fvvv[y,0,0]; -fvvv[0,0,z_]:=fvvv[z,0,0]; -fvvv[0,0,0]:=0; -f\[Eta]\[Eta]v[x_,y_,z_]:=2 1/(4z) (\[CapitalLambda][x,y,z]I2[x,y,z]-(x-y)^2 I2[x,y,0]-z A[x]A[y]+(x-y+z) A[x]A[z]+(y-x+z)A[y]A[z]-(x-y)A[0](A[x]-A[y])); -f\[Eta]\[Eta]v[x_,y_,0]:=-(((x+4 Sqrt[x] Sqrt[y]+y+4 (x+y) Log[Q/(Sqrt[x]+Sqrt[y])]))/(64 \[Pi]^2)); -f\[Eta]\[Eta]v[0,0,0]:=0; - -f\[Eta]\[Eta]v[0,0,z]:=(z (Log[Q/Sqrt[z]]+1/2))/(32 \[Pi]^2); - -aS=Table[\[Mu]ijEP\[Phi][[i,i]],{i,1,nsEP}]//SparseArray; -av=Table[\[Mu]ijVec\[Phi][[i,i]],{i,1,nvEP}]//SparseArray; -(*Potential*) -ss=1/8 TensorProduct[\[Lambda]4\[Phi]]; -Vss=Sum[ss[[j,j,k,k]]fss[aS[[j]],aS[[k]]],{j,nsEP},{k,nsEP}]; -sss=1/12 TensorProduct[\[Lambda]3\[Phi],\[Lambda]3\[Phi]]; -Vsss=Sum[sss[[i,j,k,i,j,k]]fsss[aS[[i]],aS[[j]],aS[[k]]],{j,nsEP},{k,nsEP},{i,nsEP}]; -vvs=1/4 TensorProduct[Gvvs\[Phi],Gvvs\[Phi]]; -Vvvs=Sum[vvs[[a,b,i,a,b,i]]fvvs[av[[a]],av[[b]],aS[[i]]],{a,nvEP},{b,nvEP},{i,nsEP}]; -ssv=1/4 TensorProduct[gvss\[Phi],gvss\[Phi]]; -Vssv=Sum[ssv[[a,i,j,a,i,j]]fssv[aS[[i]],aS[[j]],av[[a]]],{a,nvEP},{j,nsEP},{i,nsEP}]; -vs=1/2 TensorProduct[gvss\[Phi],gvss\[Phi]]; -Vvs=Sum[vs[[a,i,j,a,i,j]]fvs[aS[[i]],av[[a]]],{a,nvEP},{j,nsEP},{i,nsEP}]; -vv=1/4 TensorProduct[gvvv\[Phi],gvvv\[Phi]]; -Vvv=Sum[vv[[a,b,c,a,b,c]]fvv[av[[a]],av[[b]]],{a,nvEP},{b,nvEP},{c,nvEP}]; -vvv=1/12 TensorProduct[gvvv\[Phi],gvvv\[Phi]]; -Vvvv=Sum[vvv[[a,b,c,a,b,c]]fvvv[av[[a]],av[[b]],av[[b]]],{a,nvEP},{b,nvEP},{c,nvEP}]; -ggv=1/4 TensorProduct[gvvv\[Phi],gvvv\[Phi]]; -V\[Eta]\[Eta]v=Sum[ggv[[a,b,c,a,b,c]]f\[Eta]\[Eta]v[0,0,av[[b]]],{a,nvEP},{b,nvEP},{c,nvEP}]; - -VNNLO= Vss+ Vsss+ Vvvs+ Vssv+ Vvs+ Vvvv+ Vvv+ V\[Eta]\[Eta]v; - -]; - - -(* - Calculates the one-loop effective potential. -*) -CalculateNLOPotentialSS[]:=Module[{}, -If[verbose==True,Print["Calculating the 1-Loop Effective Potential"]]; - -ALog[x_]:=-(x^(3/2)/(12 \[Pi])); - -V1=Sum[ALog[\[Mu]ijEP\[Phi][[i,i]]],{i,1,nsEP}]; -V2=2*Sum[ALog[\[Mu]ijVec\[Phi][[i,i]]],{i,1,nvEP}]; - -VNLO=V1+V2; -]; - - -(* - Calculates the tree-level effective potential. -*) -CalculateLOPotentialSS[]:=Module[{}, -If[verbose==True,Print["Calculating the Tree-Level Effective Potential"]]; - -V1=\[Lambda]4EP . \[Phi]Vev . \[Phi]Vev . \[Phi]Vev . \[Phi]Vev; -V2=\[Mu]ijEP . \[Phi]Vev . \[Phi]Vev; -V3=\[Lambda]3EP . \[Phi]Vev . \[Phi]Vev . \[Phi]Vev; - -VLO=1/4! V1+V2/2!+V3/3!; -]; - - -(* - Prints field-dependent tensors. -*) -PrintTensorsVEV[]:=Module[{}, -Print["(1) Scalar Mass, (2) Vector Mass, (3) Scalar Quartic, (4) Scalar Cubic, (5) VSS, (6) VVS, (7) VVV"]; - -ToExpression[StringReplace[ToString[StandardForm[Join[\[Mu]ijEP\[Phi],\[Mu]ijVec\[Phi],\[Lambda]4\[Phi],\[Lambda]3\[Phi],gvss\[Phi],Gvvs\[Phi],gvvv\[Phi]]]],"DRalgo`Private`"->""]] - -]; - - -(* - Rotates to a diagonal-mass basis. -*) -RotateTensorsUSPostVEV[DScalarsp_,DVectorsp_]:=Module[{DS=DScalarsp,DV=DVectorsp}, -DS=DS//SparseArray; -DV=DV//SparseArray; - -\[Lambda]4\[Phi]=Transpose[DS] . \[Lambda]4\[Phi] . DS//Activate@TensorContract[Inactive@TensorProduct[DS,#],{{1,4}}]&//Transpose[#,{2,1,3,4}]&//Activate@TensorContract[Inactive@TensorProduct[DS,#],{{1,5}}]&//Transpose[#,{3,2,1,4}]&//SimplifySparse; -\[Lambda]3\[Phi]=Transpose[DS] . \[Lambda]3\[Phi] . DS//Activate@TensorContract[Inactive@TensorProduct[DS,#],{{1,4}}]&//Transpose[#,{2,1,3}]&//SimplifySparse; -gvss\[Phi]=Transpose[DV] . gvss\[Phi] . DS//Activate@TensorContract[Inactive@TensorProduct[DS,#],{{1,4}}]&//Transpose[#,{2,1,3}]&//SimplifySparse; -Gvvs\[Phi]=Transpose[DV] . Gvvs\[Phi] . DS//Activate@TensorContract[Inactive@TensorProduct[DV,#],{{1,4}}]&//Transpose[#,{2,1,3}]&//SimplifySparse; -gvvv\[Phi]=Transpose[DV] . gvvv\[Phi] . DV//Activate@TensorContract[Inactive@TensorProduct[DV,#],{{1,4}}]&//Transpose[#,{2,1,3}]&//SimplifySparse; -\[Mu]ijVec\[Phi]=Activate@TensorContract[Inactive@TensorProduct[DV,DV,\[Mu]ijVec\[Phi]],{{1,5},{3,6}}]//SimplifySparse; -\[Mu]ijEP\[Phi]=Activate@TensorContract[Inactive@TensorProduct[DS,DS,\[Mu]ijEP\[Phi]],{{1,5},{3,6}}]//SimplifySparse; - - -If[DiagonalMatrixQAE[\[Mu]ijVec\[Phi]]==False, -Print["The Vector mass-Matrix is not diagonal"]; -]; - - -If[DiagonalMatrixQAE[\[Mu]ijEP\[Phi]]==False, -Print["The Scalar mass-Matrix is not diagonal"]; -]; - -]; - - -(* - Rotates to a diagonal-mass basis. -*) -RotateTensorsCustomMass[DScalarsp_,DVectorsp_,ScalarMass_,vectorMass_]:=Module[{DS=DScalarsp,DV=DVectorsp}, -DS=DS//SparseArray; -DV=DV//SparseArray; - -\[Lambda]4\[Phi]=Transpose[DS] . \[Lambda]4\[Phi] . DS//Activate@TensorContract[Inactive@TensorProduct[DS,#],{{1,4}}]&//Transpose[#,{2,1,3,4}]&//Activate@TensorContract[Inactive@TensorProduct[DS,#],{{1,5}}]&//Transpose[#,{3,2,1,4}]&//SimplifySparse; -\[Lambda]3\[Phi]=Transpose[DS] . \[Lambda]3\[Phi] . DS//Activate@TensorContract[Inactive@TensorProduct[DS,#],{{1,4}}]&//Transpose[#,{2,1,3}]&//SimplifySparse; -gvss\[Phi]=Transpose[DV] . gvss\[Phi] . DS//Activate@TensorContract[Inactive@TensorProduct[DS,#],{{1,4}}]&//Transpose[#,{2,1,3}]&//SimplifySparse; -Gvvs\[Phi]=Transpose[DV] . Gvvs\[Phi] . DS//Activate@TensorContract[Inactive@TensorProduct[DV,#],{{1,4}}]&//Transpose[#,{2,1,3}]&//SimplifySparse; -gvvv\[Phi]=Transpose[DV] . gvvv\[Phi] . DV//Activate@TensorContract[Inactive@TensorProduct[DV,#],{{1,4}}]&//Transpose[#,{2,1,3}]&//SimplifySparse; - -\[Mu]ijVec\[Phi]=vectorMass//SparseArray; -\[Mu]ijEP\[Phi]=ScalarMass//SparseArray; - - -If[DiagonalMatrixQAE[\[Mu]ijVec\[Phi]]==False, -Print["The Vector mass-Matrix is not diagonal"]; -]; - - -If[DiagonalMatrixQAE[\[Mu]ijEP\[Phi]]==False, -Print["The Scalar mass-Matrix is not diagonal"]; -]; - -]; diff --git a/DRalgo/HardToSoft.m b/DRalgo/HardToSoft.m deleted file mode 100644 index 64804bc..0000000 --- a/DRalgo/HardToSoft.m +++ /dev/null @@ -1,2597 +0,0 @@ -(* ::Package:: *) - -(* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *) - -(* :Title: HardToSoft *) - -(* - This software is covered by the GNU General Public License 3. - Copyright (C) 2021-2022 Andreas Ekstedt - Copyright (C) 2021-2022 Philipp Schicho - Copyright (C) 2021-2022 Tuomas V.I. Tenkanen - -*) - -(* :Summary: Dimensonal reduction from hard to soft scale. *) - -(* ------------------------------------------------------------------------ *) - - -(* - Rewrites short-hand constants with Lb and Lf. -*) -ReplaceLb={ - Lbb->2Lb+2(12Log[Glaisher]-EulerGamma), - Lbbb->Lb/12+1/6(12Log[Glaisher]-EulerGamma), - LBF->5/2Lb-1/2Lf+2(12Log[Glaisher]-EulerGamma), - LFF->1/2Lf+3/2Lb+2(12Log[Glaisher]-EulerGamma), - LFB->Lb+Lf+2(12Log[Glaisher]-EulerGamma), - Lfff->1/2Lf-3/2Lb-2(12Log[Glaisher]-EulerGamma), - LbbM->2Lb+2(12Log[Glaisher]-EulerGamma)}; - - -(* - Calculates the preassure in the soft theory. Only the preassure in the symmetric - phae is calculated. -*) -SymmetricPhaseEnergy[]:=Module[{}, -(* - Counterterms are needed to calculate - SymmetricPhaseNLO and SymmetricPhaseNNLO -*) - -CounterTerm[]; - -(*The minus signs is a convention to get the pressure*) -Tot={-SymmetricPhaseLO[],-SymmetricPhaseNLO[],-SymmetricPhaseNNLO[]}; -SymmEnergy=Tot; -]; - - -(* - Calculates the 1-loop tadpole in the soft theory. -*) -TadPole[]:=Module[{}, -If[verbose,Print["Calculating 1-Loop Tadpoles"]]; - -(*One-loop bubble. Minus sign from feynman rule*) -ContriS=-1/2 T^2/12 TensorContract[\[Lambda]3,{{2,3}}]; - -(*Fermion-mass insertion*) -fac=-(T^2/12); -Temp1=Activate@TensorContract[Inactive@TensorProduct[Ysff,\[Mu]IJFC],{{2,4},{3,5}}]; -Temp1C=Activate@TensorContract[Inactive@TensorProduct[YsffC,\[Mu]IJF],{{2,4},{3,5}}]; -ContriFF=1/2fac*(-1)^2*(Temp1+Temp1C); - -TadPoleLO=- ContriS-ContriFF; (*Minus sign from matching*) -]; - - -{TadPoleLO,TadPoleNLO}; - - -(* - Calculates the 2-loop tadpole in the soft theory. -*) -TadPole2Loop[]:=Module[{}, -If[verbose,Print["Calculating 2-Loop Tadpoles"]]; - -(* - Name of master-integrals appearing -*) -\[Kappa]=1/(16 \[Pi]^2); -I1=T^2/(12 \[Epsilon])+T^2 Lbbb; -I2M2=T^2/(24 )(-1/\[Epsilon]- 12Lbbb+2); -I1I2=\[Kappa] T^2/(12 \[Epsilon]b); -dI1I2=3\[Kappa] T^2/(12 \[Epsilon]b)-\[Kappa] T^2/6; -I211M020=T^2/(192 \[Pi]^2); -I2M2I2=T^2/(192 \[Pi]^2)-T^2/(384 \[Pi]^2 \[Epsilon]bbM); -I3M2I1=T^2/(768 \[Pi]^2 \[Epsilon]bbM)+T^2/(384 \[Pi]^2); -Clear[LbbM]; -I1p=T^2/(12 )+\[Epsilon] T^2 Lbbb; -I3M2p=1/(64 \[Pi]^2 \[Epsilon]bp)+1/(32 \[Pi]^2); -I2p=1/(16 \[Pi]^2 \[Epsilon]bp); -I4M4p=1/(128 \[Pi]^2 \[Epsilon]bp)+1/(48 \[Pi]^2); -I2M2p=-T^2/24+T^2 (((-1/24)LbbM - (-1)*1/24 Lb )+1/12)\[Epsilon]; -IF1p=-T^2/(24)+1/24 T^2 Lfff \[Epsilon]; -IF2p=1/(16 (\[Pi]^2) ) (1/\[Epsilon]+Lf); -IF3M2p=1/(64 \[Pi]^2)(1/\[Epsilon]+Lf+2); -IF2M2p=(-T^2/24-T^2 1/48* Lfff)\[Epsilon]+T^2/48; - -\[Lambda]Help=TensorContract[\[Lambda]4,{3,4}]; - -(* Pure-diagram contributions*) -Contri1=1/4*I2p I1p Activate@TensorContract[Inactive@TensorProduct[\[Lambda]3,\[Lambda]Help],{{2,4},{3,5}}]; -Contri2=-1/4*(D-1)*I2p I1p*2 Activate@TensorContract[Inactive@TensorProduct[\[Lambda]3,\[CapitalLambda]g],{{2,4},{3,5}}]; -Contri3=(-2)/2* I2p IF1p Activate@TensorContract[Inactive@TensorProduct[\[Lambda]3,Ysij],{{2,4},{3,5}}]; - -(*Scalar Mass insertion*) -Contri4=1/2*I2p*Activate@TensorContract[Inactive@TensorProduct[\[Lambda]3,\[Mu]ij],{{2,4},{3,5}}]; - - -(*Fermion Mass insertion*) -Yhelp1=\[Mu]IJF . \[Mu]IJFC . \[Mu]IJF; -Yhelp2=\[Mu]IJFC . \[Mu]IJF . \[Mu]IJFC; -Contri71=Activate@TensorContract[Inactive@TensorProduct[YsffC,Yhelp1],{{2,4},{3,5}}]; -Contri72=Activate@TensorContract[Inactive@TensorProduct[Ysff,Yhelp2],{{2,4},{3,5}}]; -Contri7=-IF2p(Contri71+Contri72); - -(*Fermion-mass contributions*) -YHelp2=Activate@TensorContract[Inactive@TensorProduct[YsffC,Ysff],{{1,4},{2,5}}]; -YHelpC2=Activate@TensorContract[Inactive@TensorProduct[Ysff,YsffC],{{1,4},{2,5}}]; -Temp1=Activate@TensorContract[Inactive@TensorProduct[Ysff,\[Mu]IJFC,YHelp2],{{2,4},{5,7},{3,6}}]; -Temp1C=Activate@TensorContract[Inactive@TensorProduct[YsffC,\[Mu]IJF,YHelpC2],{{2,4},{5,7},{3,6}}]; -Contri5=-(-1)(IF1p IF2p-IF2p I1p)(Temp1C+Temp1); -FHelp=TensorContract[HabIJF,{1,2}]; -Temp1=Activate@TensorContract[Inactive@TensorProduct[Ysff,\[Mu]IJFC,FHelp],{{2,4},{5,6},{3,7}}]; -Temp1C=Activate@TensorContract[Inactive@TensorProduct[YsffC,\[Mu]IJF,FHelp],{{2,4},{5,6},{3,7}}]; -Contri6=-(D-2)(IF1p IF2p-IF2p I1p)(Temp1+Temp1C); - -(*Counterterm contribution*) -ContriCTS=-1/2 I1p \[Epsilon]^-1 ( TensorContract[Z\[Lambda]ijk,{{2,3}}]+1/2Activate@TensorContract[Inactive@TensorProduct[\[Gamma]ij,\[Lambda]3],{{2,3},{4,5}}]); - -temp1=Activate@TensorContract[Inactive@TensorProduct[ZYsij,\[Mu]IJFC],{{2,4},{3,5}}]; -temp2=Activate@TensorContract[Inactive@TensorProduct[ZYsijC,\[Mu]IJF],{{2,4},{3,5}}]; -temp3=Activate@TensorContract[Inactive@TensorProduct[Ysff,Z\[Mu]IJFC],{{2,4},{3,5}}]; -temp4=Activate@TensorContract[Inactive@TensorProduct[YsffC,Z\[Mu]IJF],{{2,4},{3,5}}]; -temp5=1/2Activate@TensorContract[Inactive@TensorProduct[\[Gamma]ij,Ysff,\[Mu]IJFC],{{2,3},{4,6},{5,7}}]; -temp6=1/2Activate@TensorContract[Inactive@TensorProduct[\[Gamma]ij,YsffC,\[Mu]IJF],{{2,3},{4,6},{5,7}}]; -ContriCTFF=1/2*2*IF1p*\[Epsilon]^-1 (-1)^2*(temp1+temp2+temp3+temp4+temp5+temp6); - -(*Self-Energy correction*) -ContriF=-TadPoleLO . ZijS; - -Tot=ContriF-Contri1-Contri2-Contri3-ContriCTS-Contri4-ContriCTFF-Contri5-Contri6-Contri7//Normal; (*minus signs from matching*) - -TadPoleNLO=Series[(Tot)/.D->4-2\[Epsilon]/.\[Epsilon]bp->(1/\[Epsilon]+Lb)^-1/.\[Epsilon]b->(1/\[Epsilon]+Lbb)^-1/.\[Epsilon]BF->(1/\[Epsilon]+LBF)^-1/.\[Epsilon]F->(1/\[Epsilon]+LFF)^-1/.\[Epsilon]FB->(1/\[Epsilon]+LFB)^-1/.\[Epsilon]bbM->(1/\[Epsilon]+LbbM)^-1,{\[Epsilon],0,0}]/.ReplaceLb//Normal//Coefficient[#,\[Epsilon],0]&//Simplify//FullSimplify; - -]; - - -(* - Calculates counter-terms, and beta functions, in the soft theory. -*) -RGRunningHardToSoft[]:=Module[{}, -If[verbose,Print["RG-evolving from \[Mu] to \[Mu]3"]]; - -(* - All calculations are done within the 3d theory. - So effective couplings are used - The module finds all \[Epsilon] poles to determine the scalar-mass counterterm -*) - -I111=1/(4)1/(16 \[Pi]^2);(*All possible divergences comes from I111, which is the scalar sunset in 3-D*) - -(*Help Tensors*) -VarGauge=GaugeCouplingNames//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarGauge}]; -(*VarGauge and SubGauge are used because the running happens in the soft theory*) - - -gvssHeavy=gvvv//Normal//ReplaceAll[#,SubGauge]&//SparseArray; (*Heavy meaning temporal vectors*) -gvssVTot=Table[ArrayFlatten[{{gvssHeavy[[a]],0},{0,gvss[[a]]//Normal//ReplaceAll[#,SubGauge]&}}],{a,1,Length[gvssHeavy]}]//SparseArray; -(* gvssVTot combines temporal vectors with scalars into a single vector-scalar^2 coupling.*) - -VarGauge=Join[\[Lambda]4//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarGauge}]; -(*VarGauge and SubGauge are used because the running happens in the soft theory*) - -(* - Because temporal vectors also talk with scalars, via quartics, - they need to be treated on the same footing. - There are ns+nv scalars in the soft theory - First nv indices are allocated to the temporal scalars -*) - -\[Lambda]4p=\[Lambda]4//Normal//ReplaceAll[#,SubGauge]&//SparseArray; -(*Changes made to \[Lambda]KVLight*) -\[Lambda]KVLight=\[Lambda]KVec//SparseArray;(*Temporal vector^2 times scalar^2 couplings*) -\[Lambda]KVHeavy=\[Lambda]4p//SparseArray;(*Original scalars*) -\[Lambda]4Tot=SymmetrizedArray[{{1,1,1,1}->0},{nv+ns,nv+ns,nv+ns,nv+ns},Symmetric[{1,2,3,4}]]//SparseArray; -\[Lambda]4Tot[[1;;nv,1;;nv,nv+1;;ns+nv,nv+1;;ns+nv]]=\[Lambda]KVLight//SparseArray; (*Populates the scalar quartic and ensures the symmetry*) -\[Lambda]4Tot[[nv+1;;ns+nv,1;;nv,1;;nv,nv+1;;ns+nv]]=Transpose[Transpose[\[Lambda]KVLight[[1;;nv,1;;nv,1;;ns,1;;ns]],{1,3,2,4}],{2,1,3,4}]//SparseArray; -\[Lambda]4Tot[[1;;nv,nv+1;;ns+nv,1;;nv,nv+1;;ns+nv]]=Transpose[\[Lambda]KVLight[[1;;nv,1;;nv,1;;ns,1;;ns]],{1,3,2,4}]//SparseArray; -\[Lambda]4Tot[[1;;nv,nv+1;;ns+nv,nv+1;;ns+nv,1;;nv]]=Transpose[Transpose[\[Lambda]KVLight[[1;;nv,1;;nv,1;;ns,1;;ns]],{1,3,2,4}],{1,2,4,3}]//SparseArray; -\[Lambda]4Tot[[nv+1;;ns+nv,1;;nv,nv+1;;ns+nv,1;;nv]]=Transpose[Transpose[Transpose[\[Lambda]KVLight[[1;;nv,1;;nv,1;;ns,1;;ns]],{1,3,2,4}],{1,2,4,3}],{2,1,3,4}]//SparseArray; -\[Lambda]4Tot[[nv+1;;ns+nv,nv+1;;ns+nv,1;;nv,1;;nv]]=Transpose[Transpose[Transpose[Transpose[\[Lambda]KVLight[[1;;nv,1;;nv,1;;ns,1;;ns]],{1,3,2,4}],{1,2,4,3}],{2,1,3,4}],{1,3,2,4}]//SparseArray; -\[Lambda]4Tot[[nv+1;;ns+nv,nv+1;;ns+nv,nv+1;;ns+nv,nv+1;;ns+nv]]=\[Lambda]KVHeavy//SparseArray; - -(*\[Lambda]4ijkl: S^4,\[Lambda]KVec_abij; V^2(S^2)., ab=1,nv ijkl=1, ns*) -(*\[Lambda]4TotIJKL, I=1,...,nv,....,nv+ns*) - -(*Help tensors*) -\[CapitalLambda]\[Lambda]RG =Transpose[Flatten[\[Lambda]4Tot,{3,4}],{3,2,1}] . Flatten[\[Lambda]4Tot,{1,2}]//SparseArray; -HabijRG=Transpose[Activate @ TensorContract[ - Inactive[TensorProduct][gvssVTot,gvssVTot], { {3, 5}}],{1,3,2,4}]//SparseArray; -HabijVRG=HabijRG+Transpose[HabijRG,{2,1,3,4}]//SparseArray; -GabcdVp=Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][gvssHeavy,gvssHeavy], {{3, 6}}]]//SparseArray; -HijRG=TensorContract[TensorProduct[HabijRG],{{1,2}}]//SparseArray; - - -(**) -Coeff=1/2*2*I111; -Contri1RG=Coeff*Flatten[HijRG] . Flatten[\[Lambda]4Tot,{3,4}]; - -Coeff=-1/4*(-1)*I111; -help1=TensorContract[HabijRG,{3,4}]//SparseArray; -Contri2RG=Coeff*Flatten[help1] . Flatten[HabijVRG,{1,2}]; - -Coeff=1/3!*I111; -Contri3RG=Coeff *TensorContract[\[CapitalLambda]\[Lambda]RG,{{2,3}}]; - - -HijV=Transpose[Transpose[Flatten[HabijVRG,{1,2}],{2,1,3}],{1,3,2}] . Flatten[HabijVRG,{1,2}]; -Coeff=1/2*(I111(1+1/2)); -Contri4RG=Coeff *TensorContract[HijV,{{2,4}}]//Simplify; - -GabcdV2=TensorContract[GabcdVp,{2,4}]; -Contri5RG=(-1/4*I111) /2*(-1)*Flatten[GabcdV2] . Flatten[HabijVRG,{1,2}]; - - Contri6RG=(-1)1/4*(20/4 I111) *(-1)*Flatten[GabcdV2] . Flatten[HabijVRG,{1,2}]; - -\[Delta]\[Mu]3d=Contri1RG+ Contri2RG+ Contri3RG+ Contri4RG+Contri5RG+ Contri6RG; (*All mass-counterterms in the soft theory*) - -\[Beta]\[Mu]3ij=4 \[Delta]\[Mu]3d //Simplify; (*Finds the beta function in the soft theory*) -Contri\[Beta]SoftToHard=\[Beta]\[Mu]3ij[[nv+1;;ns+nv,nv+1;;ns+nv]] Log[\[Mu]3/\[Mu]]//SimplifySparse;(*Running from the hard matching scale to the soft scale \[Mu]3*) -(*In the soft theory temporal scalars don't run. So only the original-scalar running is needed*) - - -(*Tadpoles*) - -Contri10RG=1/3!*I111*Activate@TensorContract[Inactive@TensorProduct[\[Lambda]4//SparseArray,\[Lambda]3//SparseArray],{{2,5},{3,6},{4,7}}]; -Contri11RG=1/2*I111*2Activate@TensorContract[Inactive@TensorProduct[\[Lambda]3//SparseArray,\[CapitalLambda]g//SparseArray],{{2,4},{3,5}}]; - -VarTadpole=(Contri10RG+Contri11RG)//Normal//Variables; - -(*Help Tensors*) -VarGauge=GaugeCouplingNames//DeleteDuplicates; -VarQuartic=\[Lambda]4//Normal//Variables//DeleteDuplicates; -VarCubic=\[Lambda]3//Normal//Variables//DeleteDuplicates; -VarTot=Join[VarGauge,VarQuartic,VarCubic]; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarTot}]; - - -\[Delta]\[Mu]Tadpole3d=Contri10RG+Contri11RG//Normal//ReplaceAll[#,SubGauge]&//SparseArray;(*Same deal for tadpoles*) -\[Beta]\[Mu]Tadpole=4 \[Delta]\[Mu]Tadpole3d //Simplify; -ContriTadPoleSoftToHard=\[Beta]\[Mu]Tadpole Log[\[Mu]3/\[Mu]]//SimplifySparse; - -]; - - -(* -Calculates non-abelian couplings from ghost-renormalization. -*) -NonAbelianCoupling[]:=Module[{}, - -fac=3/4 Lb/(16 \[Pi]^2); -(*This contraction should be sped up*) -ContriVVV=fac Simplify[Table[Sum[gvvv[[a,c,d]]gvvv[[b,c,d]],{c,1,nv},{d,1,nv}],{a,1,nv},{b,1,nv}]]; - -Zab\[Eta]=-1/2(ContriVVV); -(*This contraction should be sped up*) -ContriAnomVV= Simplify[Table[Sum[ ZabT[[c,d]]gvvv[[a,b,d]]+ Zab\[Eta][[a,d]]gvvv[[d,b,c]]+ Zab\[Eta][[b,d]]gvvv[[a,d,c]],{d,1,nv}],{a,1,nv},{b,1,nv},{c,1,nv}]]; -Ggvvv=-ContriAnomVV; - -]; - - -(* - Prints higher-order couplings. -*) -PrintCouplingsEffective[]:=Module[{}, -If[verbose,Print["Printing higher-dimension couplings"]]; - - - - -(*Scalar Sextic*); -VarGauge=Join[\[Lambda]6//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarGauge}]; -\[Lambda]6p=\[Lambda]6//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Lambda]6DS-\[Lambda]6p//Normal; -SexticVar=\[Lambda]6p//Normal//Variables; -ResScalp=Reduce[SolVar==0,SexticVar]//ToRules[#]&; -SolveTemp=SexticVar/.ResScalp; -ResScal=Table[{SexticVar[[i]]->SolveTemp[[i]]},{i,1,Length@SexticVar}]//Flatten[#,1]&//ReplaceAll[#,IdentMatEff]&//Simplify; - - -(*Printing Result*) -PrintPre=Join[ResScal]//Normal//FullSimplify//DeleteDuplicates; - -ToExpression[StringReplace[ToString[StandardForm[PrintPre]],"DRalgo`Private`"->""]] - -]; - - -(* - Prints effective couplings in the soft theory. The module calculates all tensors in the soft theory and matches them with corresponding tensors in the original 4d theory. -*) -PrintCouplings[]:=Module[{}, -If[verbose,Print["Printing 3D vector and quartic couplings in terms of 4D couplings"]]; -(*The world began without knowledge and it shall end without knowledge*) - - - -(*VarGauge=Join[gvvv//Normal//Variables,gvss//Normal//Variables,gvff//Normal//Variables]//DeleteDuplicates;*) -VarGauge=GaugeCouplingNames//Variables; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarGauge}]; -(*VarGauge denotes all possible vector couplings*) - -(* Gauge couplings*) -A1=TensorContract[\[Lambda]KVecT,{{3,4}}]//Normal; -A2=TensorContract[HabijV,{{3,4}}]//Normal//ReplaceAll[#,SubGauge]&; -(*Trick to avoid problems when kinetic mixing*) -A1=DiagonalMatrix[Diagonal[A1]]; -A2=DiagonalMatrix[Diagonal[A2]]; -(*end of trick*) -Var3D=VarGauge//ReplaceAll[#,SubGauge]&//Variables; -RepVar3D=#->Sqrt[#]&/@Var3D; -A2Mod=A2/.RepVar3D; -Sol1=Solve[A2Mod==A1,Var3D]/.IdentMat//Flatten[#,1]&//FullSimplify; -ResGauge=Table[List[Sol1[[c]]]/.{b_->a_}:>b^2->a,{c,1,Length[Sol1]}]; - - -(*Non-Abelian Couplings*) - -NonAbelianCoupling[]; - -GabcdTemp=Ggvvv . gvvv+gvvv . Ggvvv; -GabVTree=TensorContract[GabcdV,{{2,3}}]//Normal; -GabVLoop=TensorContract[GabcdTemp,{{2,3}}]//Normal; - -HelpList=DeleteDuplicates@Flatten@FullSimplify[T (GabVTree+GabVLoop) ]//Sort; -HelpVar=Table[ \[Lambda]VNA[a],{a,1,Delete[HelpList,1]//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveNA=Table[{Delete[HelpList,1][[a]]->ReplaceAll[HelpVarMod[[a]],SubGauge]},{a,1,Delete[HelpList,1]//Length}]//Flatten; -\[Lambda]VecNA=T (GabVTree+GabVLoop)//Normal//FullSimplify//ReplaceAll[#,HelpSolveNA]&//SparseArray; -IdentMatNA=List/@Join[HelpSolveNA]/.{b_->a_}:>a->b//Flatten[#,1]&; - - -A1=\[Lambda]VecNA//Normal; -A2=GabVTree//Normal//ReplaceAll[#,SubGauge]&; -Var3D=A2//Variables; -RepVar3D=#->Sqrt[#]&/@Var3D; -A2Mod=A2/.RepVar3D; -Sol1=Solve[A2Mod==A1,Var3D]/.IdentMatNA//Flatten[#,1]&//FullSimplify; -ResGaugeNA=Table[List[Sol1[[c]]]/.{b_->a_}:>b^2->a,{c,1,Length[Sol1]}]//Simplify; - - -(*Scalar quartics*) -VarGauge=Join[\[Lambda]4//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarGauge}]; -\[Lambda]4p=\[Lambda]4//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Lambda]3DS-\[Lambda]4p//Normal; -QuarticVar=\[Lambda]4p//Normal//Variables; -ResScalp=Reduce[SolVar==0,QuarticVar]//ToRules[#]&; -SolveTemp=QuarticVar/.ResScalp; -ResScal=Table[{QuarticVar[[i]]->SolveTemp[[i]]},{i,1,Length@QuarticVar}]//Flatten[#,1]&//ReplaceAll[#,IdentMat]&//Simplify; - -(* Scalar Cubics*) - -VarGauge=Join[\[Lambda]3//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarGauge}]; - -\[Lambda]3p=\[Lambda]3//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Lambda]3CSRed-\[Lambda]3p//Normal; -CubicVar=\[Lambda]3p//Normal//Variables; -ResCubic=Solve[SolVar==0,CubicVar]/.IdentMat//Flatten[#,1]&; - - - -(*Printing Result*) -PrintPre=Join[ResGauge,ResGaugeNA,ResScal,ResCubic]//Normal//FullSimplify//DeleteDuplicates; - -ToExpression[StringReplace[ToString[StandardForm[PrintPre]],"DRalgo`Private`"->""]] - -]; - - -(* - Prints the result from SymmEnergy. -*) -PrintPressure[optP_]:=Module[{opt=optP}, -SymmPrint=Switch[opt,"LO",SymmEnergy[[1]],"NLO",SymmEnergy[[2]],"NNLO",SymmEnergy[[3]]]; - -(*Printing Result*) -ToExpression[StringReplace[ToString[StandardForm[SymmPrint]],"DRalgo`Private`"->""]] -]; - - -(* - Prints 1-loop and 2-loop effective scalar masses in the soft theory. -*) -PrintScalarMass[optP_]:=Module[{opt=optP}, -If[verbose,Print["Printing Scalar Masses"]]; - -VarGauge=Join[\[Mu]ij//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarGauge}]; - -\[Mu]ijp=\[Mu]ij//Normal//ReplaceAll[#,SubGauge]&; -var=Normal[\[Mu]ijp]//Variables; -helpMass=Normal[\[Mu]ijp-\[Mu]ijSNLO]; -ResScalp=Reduce[helpMass==0,var]//ToRules[#]&; -SolveTemp=var/.ResScalp; -SolMassPre=Table[{var[[i]]->SolveTemp[[i]]},{i,1,Length@var}]//Flatten[#,1]&//ReplaceAll[#,IdentMat]&; - - -SolMass=SolMassPre; -If[opt=="All", -SolMass=SolMassPre/.xLO->1/.xNLO->1/.ReplaceLb//Simplify; -, -If[opt=="LO", -SolMass=SolMassPre/.xLO->1/.xNLO->0/.ReplaceLb//Simplify; -, -SolMass=SolMassPre/.xLO->0/.xNLO->1/.ReplaceLb//Simplify; -]; -]; -(*Printing Result*) -ToExpression[StringReplace[ToString[StandardForm[Join[SolMass]]],"DRalgo`Private`"->""]] - -]; - - -(* - Prints 1-loop and 2-loop effective tadpoles in the soft theory. -*) -PrintTadpoles[optP_]:=Module[{opt=optP}, -If[verbose,Print["Printing Tadpoles"]]; - -VarGauge=Join[\[Lambda]1//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarGauge}]; - -\[Lambda]1p=\[Lambda]1//Normal//ReplaceAll[#,SubGauge]&; -var=Normal[\[Lambda]1p]//Variables; -helpMass=Normal[\[Lambda]1p-TadPoleS]; -ResScalp=Reduce[helpMass==0,var]//ToRules[#]&; -SolveTemp=var/.ResScalp; -SolMassPre=Table[{var[[i]]->SolveTemp[[i]]},{i,1,Length@var}]//Flatten[#,1]&//ReplaceAll[#,IdentMat]&; - -SolTadpole=SolMassPre; -If[opt=="All", -SolTadpole=SolMassPre/.xLO->1/.xNLO->1; -, -If[opt=="LO", -SolTadpole=SolMassPre/.xLO->1/.xNLO->0; -, -SolTadpole=SolMassPre/.xLO->0/.xNLO->1; -]; -]; -(*Printing Result*) -ToExpression[StringReplace[ToString[StandardForm[Join[SolTadpole]]],"DRalgo`Private`"->""]] - -]; - - -(* - Rewrites internal names of effective couplings in terms of 4d parameters. -*) -PrintIdentification[]:=Module[{}, -ToExpression[StringReplace[ToString[StandardForm[IdentMat]],"DRalgo`Private`"->""]] -]; - - -(* - Calculates the 1-loop scalar mass in the soft theory. -*) -ScalarMass[]:=Module[{}, -If[verbose,Print["Calculating 1-Loop Scalar Mass"]]; - -ContriSS=FullSimplify[-T^2/(12)(1/2)TensorContract[\[Lambda]4, {{3, 4}}]//Normal]; -SelfEnergyVV2=T^2/(4)Inactivate[TensorProduct[gvss,gvss]]; -ContriVV=Simplify[ Activate @ TensorContract[SelfEnergyVV2, {{1, 4},{3,5}}]]; - -(*Self-energy contribution*) -SelfEnergyFF=-T^2/(12); -ContriFF=1/2SelfEnergyFF( Ysij+YsijC); - - -If[mode>=3, -(*Minus signs from the matching*) -ContriSS\[Lambda]6=T^4/1152*TensorContract[\[Lambda]6,{{1,2},{3,4}}]; - -aS3D=\[Mu]ij-ContriSS-ContriVV-ContriFF+ContriSS\[Lambda]6//Normal//FullSimplify//Expand; -, -(*Minus signs from the matching*) -aS3D=\[Mu]ij-ContriSS-ContriVV-ContriFF//Normal//FullSimplify//Expand; -]; -]; - - - (* - Calculates 1-loop scalar cubics in the soft theory. -*) - ScalarCubic[]:=Module[{}, -If[verbose,Print["Calculating Scalar-Cubic Couplings"]]; - -(*Let's be honest, nobody cares about cubic couplings*) -SelfEnergySSC=1/(16 \[Pi]^2)Lb *1/2; -ContriSSCTemp=Simplify[Activate @ TensorContract[Inactive[TensorProduct][\[Lambda]4,\[Lambda]3], {{3, 5},{4,6}}]]; -ContriSSC=SelfEnergySSC(ContriSSCTemp+Transpose[ContriSSCTemp,{1,3,2}]+Transpose[ContriSSCTemp,{3,2,1}]); - -(*Self-energy contribution*) -CouplingSE=-Inactivate[TensorProduct[ZijS,\[Lambda]3]]; -ContriSETemp=Simplify[Activate @ TensorContract[CouplingSE, {{2,3}}]]; -ContriSE=ContriSETemp+Transpose[ContriSETemp,{2,1,3}]+Transpose[ContriSETemp,{3,1,2}]//Simplify; -\[Lambda]3CS=-ContriSSC+ContriSE//Simplify; - -]; - - -(* - Calculates temporal-vector quartics ~(V^4). Note that all terms are finite. -*) -LongitudionalVVVV[]:=Module[{}, -If[verbose,Print["Calculating Temporal-Vector Quartics"]]; - -(* - ContriSSSS is the sum of bubbles, triangles, and boxes with internal scalars. -*) -CouplingSSSS=-(1/(24 \[Pi]^2)); -ContriSSSSTemp=Flatten[HabijV,{{1},{2},{3,4}}] . Flatten[HabijV,{3,4}]; -Help=Simplify[ContriSSSSTemp+Transpose[ContriSSSSTemp,{1,3,2,4}]+Transpose[ContriSSSSTemp,{1,4,3,2}]]//SparseArray//SimplifySparse; -ContriSSSS=CouplingSSSS*Help//SparseArray; - - - -CouplingVV=-(1/(6 \[Pi]^2)); -ContriVVTemp=Flatten[GabcdV,{{1},{3},{2,4}}] . Flatten[GabcdV,{2,4}]; -ContriVVTemp2=ContriVVTemp+Transpose[ContriVVTemp,{1,2,4,3}]//Simplify; -Help=Simplify[(ContriVVTemp2+Transpose[ContriVVTemp2,{1,3,2,4}]+Transpose[ContriVVTemp2,{1,4,3,2}])]//SparseArray//SimplifySparse; -ContriVV=CouplingVV*Help//SparseArray; - -(*General nF modification*) -HabIJFnF=HabIJF . NFMat; -(************************) -(* - ContriFFFF is the sum of boxes with internal fermions. -*) -helpF=Flatten[HabIJFnF,{{1},{2},{3,4}}] . Flatten[Transpose[HabIJF,{1,2,4,3}],{3,4}]//SimplifySparse; -ContriFFFF=1/(3 \[Pi]^2)*(helpF+Transpose[helpF,{1,3,2,4}]+Transpose[helpF,{1,2,4,3}])//SparseArray;(*Check this one after changed*) - - (* Minus sign from matching*) - \[Lambda]AA= -(ContriSSSS+ContriVV+ ContriFFFF )//SimplifySparse//SparseArray; - -]; - - - - -(* - Calculates cubics between two temporal-vectors and one scalar. - No tree-level contribution. -*) -LongitudionalVVS[]:=Module[{}, -If[verbose,Print["Calculating Temporal-Vector-Scalar Cubics"]]; - -CouplingSSSS=1/(8 \[Pi]^2); -ContriSSSSTemp=CouplingSSSS*Simplify[Activate @ TensorContract[Inactivate[TensorProduct[Habij,\[Lambda]3]], {{3, 5},{4,6}}]//Normal]; - -(*Minus sign from matching*) -GvvsL=-ContriSSSSTemp; - -]; - - - - -(* - Prints anomalous dimensions of 4d fields. -*) -AnomDim4D[ParticleI_,ComponentsI_]:=Module[{ParticleP=ParticleI,ComponentsP=ComponentsI}, -CounterTerm[]; (*Calculates counterterms if not already done*) -Switch[ParticleP,"S", -Ret=\[Gamma]ij[[ComponentsP[[1]][[1]],ComponentsP[[2]][[1]]]]; -,"F", -Ret=\[Gamma]IJF[[ComponentsP[[1]][[1]],ComponentsP[[2]][[1]]]]; -,"V", -Ret=\[Gamma]ab[[ComponentsP[[1]][[1]],ComponentsP[[2]][[1]]]]; -]; - -ToExpression[StringReplace[ToString[StandardForm[Ret]],"DRalgo`Private`"->""]] -]; - - -(* - Prints beta-functions of 4d couplings and masses. -*) -BetaFunctions4D[]:=Module[{}, -If[verbose,Print["Finding \[Beta]-functions"]]; -CounterTerm[]; - - -(*To make the comparisons easier*) -VarGauge=GaugeCouplingNames//Variables; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->c,{c,VarGauge}]; - -(* - Gauge couplings -*) -A1=TensorContract[\[Beta]vvss//Normal,{{3,4}}]; -A2=TensorContract[HabijV,{{3,4}}]//Normal//ReplaceAll[#,SubGauge]&; -(*Trick to avoid problems when kinetic mixing*) -A1=DiagonalMatrix[Diagonal[A1]]; -A2=DiagonalMatrix[Diagonal[A2]]; -(*end of trick*) -Var3D=VarGauge//ReplaceAll[#,SubGauge]&//Variables; -RepVar3D=#->Sqrt[#]&/@Var3D; -A2Mod=A2/.RepVar3D; - -Sol1=Solve[A2Mod==A1,Var3D]//Flatten[#,1]&//FullSimplify; -ResGauge=Table[List[Sol1[[c]]]/.{b_->a_}:>b^2->a,{c,1,Length[Sol1]}]/.SubGauge2; - -(* - Non-abelian couplings -*) - -GabcdTemp=\[Beta]gvvv . gvvv+gvvv . \[Beta]gvvv//SparseArray; -GabVTree=TensorContract[GabcdV,{{2,3}}]//Normal; -GabVLoop=TensorContract[GabcdTemp,{{2,3}}]//Normal; - -A1=GabVLoop//Normal; -A2=GabVTree//Normal//ReplaceAll[#,SubGauge]&; -Var3D=A2//Variables; -RepVar3D=#->Sqrt[#]&/@Var3D; -A2Mod=A2/.RepVar3D; -Sol1=Solve[A2Mod==A1,Var3D]//Flatten[#,1]&//FullSimplify; -ResGaugeNA=Table[List[Sol1[[c]]]/.{b_->a_}:>b^2->a,{c,1,Length[Sol1]}]/.SubGauge2//Simplify; - -(* - Scalar-quartic couplings -*) - -VarGauge=Join[\[Lambda]4//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->c,{c,VarGauge}]; - - -HelpList=DeleteDuplicates@Flatten@SimplifySparse[\[Beta]\[Lambda]ijkl]//Sort; -HelpVarMod=RelationsBVariables3[HelpList]//ReplaceAll[#,\[Lambda]VL[v1_]->\[Lambda]Beta[v1]]&; -If[HelpList[[1]]==0&&Length[HelpList]>1, - HelpList=Delete[HelpList,1]; -]; -HelpSolve\[Beta]=Table[{HelpList[[a]]->HelpVarMod[[a]]},{a,1,HelpList//Length}]//Flatten//Simplify; -HelpSolve\[Beta]2=Table[{HelpVarMod[[a]]->HelpList[[a]]},{a,1,HelpList//Length}]//Flatten//Simplify; -\[Lambda]4\[Beta]=\[Beta]\[Lambda]ijkl//SimplifySparse//Normal//ReplaceAll[#,HelpSolve\[Beta]]&//SparseArray; - -\[Lambda]4p=\[Lambda]4//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Lambda]4\[Beta]-\[Lambda]4p//Normal; -QuarticVar=\[Lambda]4p//Normal//Variables; -ResScalp=Reduce[SolVar==0,QuarticVar]//ToRules[#]&; -SolveTemp=QuarticVar/.ResScalp; -ResScal=Table[{QuarticVar[[i]]->SolveTemp[[i]]},{i,1,Length@QuarticVar}]/.SubGauge2//Flatten[#,1]&//ReplaceAll[#,HelpSolve\[Beta]2]&//Simplify; - -(* - Scalar-cubic couplings -*) -VarGauge=Join[\[Lambda]3//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->c,{c,VarGauge}]; - -\[Lambda]3p=\[Lambda]3//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Beta]\[Lambda]ijk-\[Lambda]3p//Normal; -CubicVar=\[Lambda]3p//Normal//Variables; -ResCubic=Solve[SolVar==0,CubicVar]/.SubGauge2//Flatten[#,1]&; - -(* - Yukawa couplings -*) -VarGauge=Join[Ysff//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->c,{c,VarGauge}]; - -\[Lambda]4p=Ysff//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Beta]Ysij-\[Lambda]4p//Normal; -QuarticVar=\[Lambda]4p//Normal//Variables; -ResYuk=Solve[SolVar==0,QuarticVar]/.SubGauge2//Flatten[#,1]&; - -(* - Scalar masses -*) - -VarGauge=Join[\[Mu]ij//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->c,{c,VarGauge}]; - -\[Lambda]4p=\[Mu]ij//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Beta]mij-\[Lambda]4p//Normal; -QuarticVar=\[Lambda]4p//Normal//Variables; -ResMass=Solve[SolVar==0,QuarticVar]/.SubGauge2//Flatten[#,1]&; - -(* - Fermion masses -*) - -VarGauge=Join[\[Mu]IJF//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->c,{c,VarGauge}]; - -\[Lambda]4p=\[Mu]IJF//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Beta]\[Mu]IJF-\[Lambda]4p//Normal; -QuarticVar=\[Lambda]4p//Normal//Variables; -ResMassF=Solve[SolVar==0,QuarticVar]/.SubGauge2//Flatten[#,1]&; - - - -(* - Scalar tadpoles -*) -If[Length[\[Lambda]1//Normal//Variables]==0, -ResTadpole={}; -, -VarGauge=Join[\[Lambda]1//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->c,{c,VarGauge}]; - -\[Lambda]4p=\[Lambda]1//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Beta]\[Lambda]1-\[Lambda]4p//Normal; -QuarticVar=\[Lambda]4p//Normal//Variables; -ResTadpole=Solve[SolVar==0,QuarticVar]/.SubGauge2//Flatten[#,1]&; -]; -(*Effective couplings*) -If[mode>=3, - -(* - Scalar-cubic couplings -*) - -VarGauge=Join[\[Lambda]6//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->c,{c,VarGauge}]; - -\[Lambda]6p=\[Lambda]6//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Beta]\[Lambda]6ijklnm-\[Lambda]6p//Normal; -SexticVar=\[Lambda]6p//Normal//Variables; -ResSextic=Solve[SolVar==0,SexticVar]/.SubGauge2//Flatten[#,1]&; - - - -(*Printing Result*) -PrintPre=Join[ResGauge,ResGaugeNA,ResScal,ResCubic,ResYuk,ResMass,ResMassF,ResTadpole,ResSextic]//Normal//FullSimplify//DeleteDuplicates; -, -(*Printing Result*) -PrintPre=Join[ResGauge,ResGaugeNA,ResScal,ResCubic,ResYuk,ResMass,ResMassF,ResTadpole]//Normal//FullSimplify//DeleteDuplicates; -]; - -ToExpression[StringReplace[ToString[StandardForm[PrintPre]],"DRalgo`Private`"->""]] - - -]; - - -(* - Calculates all counterterms required for two-loop calculations. -*) -CounterTerm[]:=Module[{}, - -(*Only performs the calculation once*) -If[CT==False, -CT=True; -CreateBasisVanDeVis[]; -If[verbose,Print["Calculating CounterTerms"]]; -\[Kappa]=1/(16 \[Pi]^2); - -(* - Scalar-field renormalization -*) -SelfEnergySS=-3 \[CapitalLambda]g; -ContriSS=SelfEnergySS; - -SelfEnergyFF=-1; -ContriFF=1/2SelfEnergyFF (Ysij+YsijC); -\[Gamma]ij=(ContriSS+ContriFF) \[Kappa]//SparseArray; (*Scalar anomalous dimension*) - - -(* - Scalar mass renormalization -*) - -(*Scalar-quartic contribution*) -ContriSS=Flatten[\[Mu]ij] . Flatten[\[Lambda]4,{3,4}]; - -(*Fermion-mass contribution*) -Fac=1/(8 \[Pi]^2)*2; -Temp1=Activate@TensorContract[Inactive@TensorProduct[Ysff,\[Mu]IJFC,\[Mu]IJFC,Ysff],{{2,4},{3,6},{5,9},{7,10}}]//Normal; -Temp1C=Activate@TensorContract[Inactive@TensorProduct[YsffC,\[Mu]IJF,\[Mu]IJF,YsffC],{{2,4},{3,6},{5,9},{7,10}}]//Normal; -ContriFFMass1=-1/2Fac*(Temp1+Temp1C)//Simplify//PowerExpand; -Temp1=Activate@TensorContract[Inactive@TensorProduct[Ysff,YsffC,\[Mu]IJFC,\[Mu]IJF],{{3,5},{2,7},{6,10},{8,9}}]//Normal; -Temp1C=Activate@TensorContract[Inactive@TensorProduct[YsffC,Ysff,\[Mu]IJF,\[Mu]IJFC],{{3,5},{2,7},{6,10},{8,9}}]//Normal; -ContriFFMass2=-Fac*(Temp1+Temp1C)//Simplify//PowerExpand; - -(*Cubic-coupling contribution*) -ContriAnom=-\[Mu]ij . \[Gamma]ij-Transpose[\[Mu]ij . \[Gamma]ij]; -ContriCubic=1/2*1/(16 \[Pi]^2)*2 Activate@TensorContract[Inactive@TensorProduct[\[Lambda]3,\[Lambda]3],{{2,5},{3,6}}]; - -\[Beta]mij=(\[Kappa] ContriSS+ContriAnom+ContriFFMass1+ContriFFMass2+ContriCubic)//SparseArray; - -(* - Scalar quartic renormalization -*) - -(*Scalar-quartic contribution*) -ContriSS=\[Kappa](\[CapitalLambda]\[Lambda]+Transpose[\[CapitalLambda]\[Lambda],{1,3,2,4}]+Transpose[\[CapitalLambda]\[Lambda],{1,4,3,2}]); - -(*Gauge contribution*) -CouplingVV2=2*1/(16 \[Pi]^2)(3 1)/2 ; -ContriVVTemp=CouplingVV2*Transpose[Transpose[Flatten[HabijV,{1,2}],{2,1,3}],{1,3,2}] . Flatten[HabijV,{1,2}]; -ContriVV=ContriVVTemp+Transpose[ContriVVTemp,{1,3,2,4}]+Transpose[ContriVVTemp,{1,4,2,3}]//Simplify; - -(*Yukawa contribution*) -CouplingFF=2*2*1/(16 \[Pi]^2)(2 )(-1)*1/4; -ContriFF=CouplingFF*Simplify[Yhelp+Transpose[Yhelp,{1,2,4,3}]+Transpose[Yhelp,{1,3,2,4}]+Transpose[Transpose[Yhelp,{1,3,2,4}],{1,2,4,3}]+Transpose[Yhelp,{1,4,3,2}]+Transpose[Transpose[Yhelp,{1,4,3,2}],{1,2,4,3}]+(YhelpC+Transpose[YhelpC,{1,2,4,3}]+Transpose[YhelpC,{1,3,2,4}]+Transpose[Transpose[YhelpC,{1,3,2,4}],{1,2,4,3}]+Transpose[YhelpC,{1,4,3,2}]+Transpose[Transpose[YhelpC,{1,4,3,2}],{1,2,4,3}])]; - -(*Anomalous dimension contribution*) -ContriSETemp=\[Gamma]ij . \[Lambda]4; -ContriAnom=ContriSETemp+Transpose[ContriSETemp,{2,1,3,4}]+Transpose[ContriSETemp,{3,1,2,4}]+Transpose[ContriSETemp,{4,1,2,3}]//Simplify; - -\[Beta]\[Lambda]ijkl= ContriSS+ ContriVV+ ContriFF- ContriAnom//Simplify//SparseArray; -Z\[Lambda]ijkl=\[Beta]\[Lambda]ijkl/(2 \[Epsilon])//SparseArray;(*renormalization constants*) - - -(* - Scalar cubic renormalization -*) -SelfEnergySSC=1/(16 \[Pi]^2) ; -ContriSSCTemp=Simplify[Activate @ TensorContract[Inactive[TensorProduct][\[Lambda]4,\[Lambda]3], {{3, 5},{4,6}}]]; -ContriSSC=SelfEnergySSC(ContriSSCTemp+Transpose[ContriSSCTemp,{1,3,2}]+Transpose[ContriSSCTemp,{3,2,1}]); - -(*Anomalous dimension contribution*) -ContriAnom=Simplify[Activate @ TensorContract[Inactive[TensorProduct][\[Gamma]ij,\[Lambda]3], {{2, 3}}]]; -\[Beta]\[Lambda]ijk=(-ContriAnom-Transpose[ContriAnom,{2,1,3}]-Transpose[ContriAnom,{3,2,1}]+ContriSSC)//Expand//SparseArray; (*beta function*) -Z\[Lambda]ijk=\[Beta]\[Lambda]ijk/2;(*renormalization constants*) - - -(* - Vector-field renormalization -*) -SelfEnergySS=1/6 Hg; -fac=(1/12 1+1/2(25/6+0*2/3)); -SelfEnergyVV=(fac); -ContriVVV=fac*TensorContract[GabcdV,{2,4}]; -SelfEnergyFF=(-1)(2/3 ); -(*General nF modification*) -HabIJFnF=HabIJF . NFMat; -(************************) -ContriFF=SelfEnergyFF*TensorContract[HabIJFnF,{3,4}]; - -\[Gamma]ab=( SelfEnergySS+1ContriVVV+ ContriFF) \[Kappa]//SparseArray; (*vector anomalous dimension*) - - -(* - Gauge-coupling renormalization -*) -ContriSS=-1/(16 \[Pi]^2)1*1/2*Simplify[Transpose[Transpose[Flatten[HabijV,{3,4}],{2,1,3}],{1,3,2}] . Flatten[\[Lambda]4,{1,2}]]; -CouplingSV= 1/(16 \[Pi]^2)*3/4*1 ; -ContriSVTemp=Transpose[Transpose[Flatten[HabijV,{2,4}],{2,1,3}],{1,3,2}] . Flatten[HabijV,{2,3}]//Transpose[#,{1,3,2,4}]&; -ContriSV=CouplingSV Simplify[(ContriSVTemp+Transpose[ContriSVTemp,{2,1,3,4}])]; - -CouplingSSS=1/(16 \[Pi]^2)1/2 1; -ContriSSS=2*CouplingSSS*Simplify[Transpose[Transpose[Flatten[Habij,{3,4}],{2,1,3}],{1,3,2}] . Flatten[\[Lambda]4,{1,2}]]; - -CouplingVVV= 1/(16 \[Pi]^2)*(-1)/2(9/2 1) ; - ContriVVV=CouplingVVV*Simplify[Transpose[Transpose[Flatten[GabcdV,{2,4}],{2,1,3}],{1,3,2}] . Flatten[HabijV,{1,2}]]; - - CouplingVVVV= 1/(16 \[Pi]^2)*(-1)(3 1) ; - ContriVVVV=CouplingVVVV*Simplify[Transpose[Transpose[Flatten[GabcdV,{2,3}],{2,1,3}],{1,3,2}] . Flatten[HabijV,{1,2}]]; - - (*Fermion contributions*) -CouplingFFFF=(-1) 1/(16 \[Pi]^2)( 1) ; -HabIJFAE=Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][gvff,gvff], {{3, 5}}]]; -YTemp2=Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][Ysff,YsffC], {{3, 5}}]]; -ContriFFFFTemp=Transpose[Transpose[Flatten[HabIJFAE,{2,4}],{2,1,3}],{1,3,2}] . Flatten[Transpose[YTemp2,{1,4,3,2}],{2,4}]; -ContriFFFFTemp2=ContriFFFFTemp+Transpose[Transpose[ContriFFFFTemp,{1,2,4,3}],{2,1,3,4}]; -ContriFFFF=CouplingFFFF*Simplify[ContriFFFFTemp2+Transpose[ContriFFFFTemp2,{2,1,3,4}]]; - - -HgY=Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][gvff,Ysff], {{3, 5}}]]//SparseArray; -HgY4=Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][gvff,YsffC], {{2, 5}}]]//SparseArray; -AE1=Transpose[Transpose[Flatten[Transpose[HgY,{1,4,3,2}],{2,4}],{2,1,3}],{1,3,2}] . Flatten[HgY4,{2,4}]//Transpose[#,{1,3,2,4}]&; -AE2=Transpose[Transpose[Flatten[Transpose[HgY4,{1,4,3,2}],{2,4}],{2,1,3}],{1,3,2}] . Flatten[HgY,{2,4}]//Transpose[#,{1,3,2,4}]&; -CouplingFFFF2=2* (-1)*2*1/2*1/(16 \[Pi]^2)( 1) ; -ContriFFFF2=CouplingFFFF2*Simplify[ AE1 + AE2 ]; - -(*Anomalous-dimension contributions*) -ContriSEScalar=-HabijV . \[Gamma]ij-Transpose[Transpose[HabijV,{1,2,4,3}] . \[Gamma]ij,{1,2,4,3}]//SparseArray//Simplify; -ContriSEVector=-\[Gamma]ab . HabijV-Transpose[\[Gamma]ab . Transpose[HabijV,{2,1,3,4}],{2,1,3,4}]//SparseArray//Simplify; - -\[Beta]vvss=-2(ContriSS+ ContriSV+ContriSSS+ ContriVVV+ ContriVVVV+ ContriFFFF+ContriFFFF2+ -1/2( ContriSEScalar + ContriSEVector))//Simplify//SparseArray; (*beta function*) -Zgvvss=\[Beta]vvss/(2 \[Epsilon])//SparseArray;(*renormalization constant*) - -(* - Ghost-field renormalization -*) -fac=3/4; -ContriVVV=fac TensorContract[GabcdV,{{2,4}}]; -\[Gamma]ab\[Eta]=(1ContriVVV) \[Kappa]//SparseArray; (*Who you gonna call?*) - - -(* - Non-abelian coupling renormalization -*) -(*There are only anomalous-dimension contributions*) -ContriAnomVV=gvvv . \[Gamma]ab+\[Gamma]ab\[Eta] . gvvv+Transpose[\[Gamma]ab\[Eta] . Transpose[gvvv,{2,1,3}],{2,1,3}]//SparseArray//Simplify; - -\[Beta]gvvv=-ContriAnomVV//SparseArray; (*beta functions*) -Zgvvv=\[Beta]gvvv/2//SparseArray; (*Renormalization constants*) -(*For some renormalization constants I decided in my infinite wisdom to not include \[Epsilon] poles. Should probably make the same convention everywhere.*) -(*I blame this inconsistency on flouridation of water.*) - -(* - Fermion-field renormalization -*) -ContriSS=(-1)/2*TensorContract[YTemp,{1,2}]; -\[Gamma]IJF=\[Kappa] (ContriSS)//SparseArray; (*Anomalous dimension*) - - - -(* - Yukawa-coupling renormalization -*) -ContriSS=(-1)2/(16 \[Pi]^2)*Transpose[Transpose[Flatten[YTemp,{1,4}],{2,1,3}],{1,3,2}] . Flatten[Ysff,{1,2}]; -HelpAE=Transpose[Transpose[gvff,{2,1,3}],{1,3,2}] . gvff; -ContriVV=6/(16 \[Pi]^2)*Transpose[Flatten[Ysff,{2,3}]] . Flatten[HelpAE,{2,4}]; - -(*Anomalous dimension contribution*) -ContriAnomSS=-\[Gamma]ij . Ysff; -ContriAnomFF=-(Ysff . \[Gamma]IJF+Transpose[Transpose[Ysff,{1,3,2}] . \[Gamma]IJF,{1,3,2}]); - -\[Beta]Ysij= ContriSS+ ContriVV+ ContriAnomSS+ ContriAnomFF//Simplify//SparseArray; (*beta function*) -ZYsij=\[Beta]Ysij/2//SparseArray;(*renormalization constants*) - -(* - Yukawa-coupling renormalization for conjugated tensor. - A bit redundant, but it's not even close to being a bottleneck. -*) -ContriSS=(-1)2/(16 \[Pi]^2)Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][YTempC,YsffC], {{1, 5},{4,6}}]]; -ContriVV=6/(16 \[Pi]^2)Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][YsffC,gvff,gvff], {{4, 7},{2,6},{3,9}}]]; -ContriAnomSS=-\[Gamma]ij . YsffC; -ContriAnomFF=-(Transpose[YsffC,{1,3,2}] . Transpose[\[Gamma]IJF]+Transpose[YsffC . Transpose[\[Gamma]IJF],{1,3,2}]); - -\[Beta]YsijC= ContriSS+ContriVV+ ContriAnomSS+ContriAnomFF//Simplify//SparseArray; -ZYsijC=\[Beta]YsijC/2//SparseArray; - - -Zij=2*\[Gamma]ij/\[Epsilon] /2//SparseArray ; -Zmij=\[Beta]mij/2//SparseArray; - -(* - Gauge-coupling renormalization. Just in case there are U1's not interacting with the scalars. -*) -Contri2=1/(16 \[Pi]^2) Transpose[Flatten[gvvv,{2,3}]] . Flatten[HabIJF,{1,2}]; -(*Anomalous-dimension contribution*) -ContriSE= \[Gamma]ab . gvff; - -\[Beta]gvff=(I 3 Contri2- ContriSE)//Simplify//SparseArray; (*beta function*) -Zgvff=\[Beta]gvff/2//SparseArray;(*Renormalization-constant*) - - -(* - Fermion-mass renormalization. -*) -YtempMass= Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][Ysff,\[Mu]IJFC], {{3, 5}}]]; -ContriSS=(-1)2/(16 \[Pi]^2)Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][YtempMass,Ysff], {{1,4},{3,5}}]]; -ContriVV=6/(16 \[Pi]^2)Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][\[Mu]IJF,gvff,gvff], {{3,6},{1,5},{2,8}}]]; - - (*Anomalous-dimension contribution*) -ContriAnomFF=-(\[Gamma]IJF . \[Mu]IJF+\[Gamma]IJF . Transpose[\[Mu]IJF]); - -\[Beta]\[Mu]IJF= ContriSS+ ContriVV+ ContriAnomFF//Simplify//SparseArray; (*beta function*) -Z\[Mu]IJF=\[Beta]\[Mu]IJF/2//SparseArray;(*renormalization constant*) - - -(* - Conjugated Fermion-mass renormalization. -*) -YtempMass= Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][YsffC,\[Mu]IJF], {{3, 5}}]]; -ContriSS=(-1)2/(16 \[Pi]^2)Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][YtempMass,YsffC], {{1,4},{3,5}}]]; -ContriVV=6/(16 \[Pi]^2)Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][\[Mu]IJFC,gvff,gvff], {{3,6},{1,5},{2,8}}]]; -ContriAnomFF=-(\[Gamma]IJF . \[Mu]IJFC+Transpose[\[Gamma]IJF . \[Mu]IJFC]); - -\[Beta]\[Mu]IJFC= ContriSS+ ContriVV+ ContriAnomFF//Simplify//SparseArray; -Z\[Mu]IJFC=\[Beta]\[Mu]IJFC/2//SparseArray; - - -(* - Tadpole renormalization -*) -Contri4=1/2*I2p*Activate@TensorContract[Inactive@TensorProduct[\[Lambda]3,\[Mu]ij],{{2,4},{3,5}}]; - - -(*Fermion Mass insertion*) -Yhelp1=\[Mu]IJF . \[Mu]IJFC . \[Mu]IJF; -Yhelp2=\[Mu]IJFC . \[Mu]IJF . \[Mu]IJFC; -Contri71=Activate@TensorContract[Inactive@TensorProduct[YsffC,Yhelp1],{{2,4},{3,5}}]; -Contri72=Activate@TensorContract[Inactive@TensorProduct[Ysff,Yhelp2],{{2,4},{3,5}}]; -ContriF=-1/(16 \[Pi]^2)*2(Contri71+Contri72); -ContriS=1/(16 \[Pi]^2)*Activate@TensorContract[Inactive@TensorProduct[\[Lambda]3,\[Mu]ij],{{2,4},{3,5}}]; - -ContriAnom=\[Gamma]ij . \[Lambda]1; - -\[Beta]\[Lambda]1=ContriF+ContriS-ContriAnom; -Z\[Lambda]1=\[Beta]\[Lambda]1/2; - - -If[mode>=3, -(*Effective higher-order couplings*) - -(*Scalar sextic operator*) -(*Scalar loops*) - -(*Scalar loop with mixed \[Lambda]6 and \[Lambda]4 vertices*) -\[CapitalLambda]\[Lambda]6tot=Flatten[\[Lambda]4,{{1},{2},{3,4}}] . Flatten[\[Lambda]6,{1,2}]//SimplifySparse; -Prefac=15/2*1/(16 \[Pi]^2); -SymHelp=Symmetrize[\[CapitalLambda]\[Lambda]6tot,Symmetric]//SparseArray; -ContriSSS=Prefac*SymHelp; - -(*Field-strength renormalization*) - -ContriSETemp=-1/2*\[Gamma]ij . \[Lambda]6; -ContriSE=6*Symmetrize[ContriSETemp,Symmetric]//SparseArray//SimplifySparse; - -(*Minus sign from matching*) -\[Beta]\[Lambda]6ijklnm=-2*(ContriSE+ContriSSS)//SparseArray; -]; - - - -] - -]; - - -(* - Scalar self-energy in the soft theory. -*) -ScalarSelfEnergy[]:=Module[{}, -If[verbose,Print["Calculating Scalar-Field Renormalization"]]; -(*Scalars are nice. I like scalars. They don't abuse me with twenty-index tensor integrals.*) -(*This is the reason why I never like to adjust prices*) -ContriVV=3/(16 \[Pi]^2 )Lb (-1)* Activate @ TensorContract[Inactivate[TensorProduct[gvss,gvss]], {{1, 4},{3,5}}]; -(**) -SelfEnergyFF=-Lf/(16 \[Pi]^2); -ContriFF=1/2SelfEnergyFF (( Ysij+YsijC)); - -ZijS=-ContriVV/2-ContriFF/2//SimplifySparse; - -]; - - -(* - 1-loop Debye mass in the soft theory. -*) -VectorMass[]:=Module[{}, -If[verbose,Print["Calculating 1-Loop Vector Mass"]]; - - -SelfEnergySS=T^2/(12); -ContriSS=SelfEnergySS*Simplify[TensorContract[Habij,{{3,4}}]]; - -SelfEnergyVV=T^2/(6)*1/2Inactivate[TensorProduct[gvss,gvss]]; -ContriVV=Simplify[ Activate @ TensorContract[ - SelfEnergyVV, {{2, 6},{3,5}}]]; - - -fac=T^2/24-T^2/4-1/2 T^2/4//Simplify; -ContriVVV=fac*TensorContract[GabcdV,{{2,4}}]; - - -SelfEnergyFF=(-1)T^2/(6); -(*General nF modification*) -HabIJFnF=HabIJF . NFMat; -(************************) -ContriFF=SelfEnergyFF*Simplify[TensorContract[HabIJFnF,{{3,4}}]//Normal]; - -(*Minus sign due to matching*) -aV3D=-ContriSS- ContriVV- ContriVVV- ContriFF //Normal//FullSimplify//Expand; - - -]; - - -(* - Vector self-energy in the soft theory. -*) -VectorSelfEnergy[]:=Module[{}, -If[verbose,Print["Calculating Vector-Field Renormalization"]]; - -SelfEnergySS=-1/2*1/(16 \[Pi]^2)*(-1/3 Lb); -ContriSS=SelfEnergySS*Simplify[TensorContract[Habij,{{3,4}}]]; - -fac=1/(16 \[Pi]^2)(1/12 Lb+1/2(25/6Lb+2/3)); -ContriVVV=fac*Simplify[TensorContract[GabcdV,{{2,4}}]]; - -SelfEnergyFF=(-1)(2/3 Lf)/(16 \[Pi]^2); -(*General nF modification*) -HabIJFnF=HabIJF . NFMat; -(************************) -ContriFF=SelfEnergyFF*Simplify[TensorContract[HabIJFnF,{{3,4}}]//Normal]; -ZabT=-(ContriSS+ ContriVVV+ContriFF)/2//Normal//Simplify;(*Transverse vectors*) - - - -SelfEnergySS=-1/2*1/(16 \[Pi]^2)*(-1)(1/3 Lb+2/3); -ContriSS=SelfEnergySS*Simplify[TensorContract[Habij,{{3,4}}]]; - - -fac=1/(16 \[Pi]^2)(1/12 Lb+1/6 +1/2(25/6Lb- 3)); -ContriVVV=fac*Simplify[TensorContract[GabcdV,{{2,4}}]]; - - -SelfEnergyFF=(-1)(2/3 Lf-2/3)/(16 \[Pi]^2); -(*General nF modification*) -HabIJFnF=HabIJF . NFMat; -(************************) -ContriFF=SelfEnergyFF*Simplify[TensorContract[HabIJFnF,{{3,4}}]//Normal]; -ZabL=-( ContriSS +ContriVVV+ContriFF)/2//Normal//Simplify;(*Temporal/Longitudional vectors*) - -]; - - -(* - Calculates Scalar quartics in the soft theory -*) -ScalarQuartic[]:=Module[{}, -If[verbose,Print["Calculating Scalar Quartic"]]; -(*Changes Made*) -ContriSS=1/(16 \[Pi]^2)Lb*1/2*Simplify[(\[CapitalLambda]\[Lambda]+Transpose[\[CapitalLambda]\[Lambda],{1,4,3,2}]+Transpose[\[CapitalLambda]\[Lambda],{1,3,2,4}])]; - -ContriVVTemp=Transpose[Flatten[HabijV,{1,2}],{3,2,1}] . Flatten[HabijV,{1,2}]//SimplifySparse; -ContriVVTemp2=ContriVVTemp+Transpose[ContriVVTemp,{1,3,2,4}]+Transpose[ContriVVTemp,{1,4,2,3}]; -ContriVV=1/(16 \[Pi]^2)(3 Lb-2)/2*ContriVVTemp2; - -CouplingFF=2*1/(16 \[Pi]^2)(2 Lf)(-1)*1/4; -ContriFF=CouplingFF*Simplify[Yhelp+Transpose[Yhelp,{1,2,4,3}]+Transpose[Yhelp,{1,3,2,4}]+Transpose[Transpose[Yhelp,{1,3,2,4}],{1,2,4,3}]+Transpose[Yhelp,{1,4,3,2}]+Transpose[Transpose[Yhelp,{1,4,3,2}],{1,2,4,3}]+(YhelpC+Transpose[YhelpC,{1,2,4,3}]+Transpose[YhelpC,{1,3,2,4}]+Transpose[Transpose[YhelpC,{1,3,2,4}],{1,2,4,3}]+Transpose[YhelpC,{1,4,3,2}]+Transpose[Transpose[YhelpC,{1,4,3,2}],{1,2,4,3}])]; - -ContriSETemp=-ZijS . \[Lambda]4; -ContriSE=ContriSETemp+Transpose[ContriSETemp,{2,1,3,4}]+Transpose[ContriSETemp,{3,1,2,4}]+Transpose[ContriSETemp,{4,1,2,3}]//Simplify; - -If[mode>=3, -(*Minus sign from matching*) -ContriSS\[Lambda]6=-T^2/24*TensorContract[\[Lambda]6,{1,2}]; -\[Lambda]3D=- ContriSS- ContriVV+ ContriSE- ContriFF-ContriSS\[Lambda]6; -, -(*Minus sign from matching*) -\[Lambda]3D=- ContriSS- ContriVV+ ContriSE- ContriFF; -]; - - - -]; - - - -(* - Calculates Scalar quartics in the soft theory -*) -ScalarSextic[]:=Module[{}, -If[verbose,Print["Calculating Scalar Sextic"]]; - -(*Scalar loops*) -\[CapitalLambda]\[Lambda]6tem=Flatten[\[Lambda]4 . \[Lambda]4,{{1},{2},{4},{5},{3,6}}]; -\[CapitalLambda]\[Lambda]6tot=\[CapitalLambda]\[Lambda]6tem . Flatten[\[Lambda]4,{1,2}]; -Prefac=-Zeta[3]15/(128 \[Pi]^4 T^2); -ContriSS=Prefac*Symmetrize[\[CapitalLambda]\[Lambda]6tot,Symmetric]//SparseArray//SimplifySparse; - - -(*Scalar loop with mixed \[Lambda]6 and \[Lambda]4 vertices*) -\[CapitalLambda]\[Lambda]6tot=Flatten[\[Lambda]4,{{1},{2},{3,4}}] . Flatten[\[Lambda]6,{1,2}]//SimplifySparse; -Prefac=15/2*1/(16 \[Pi]^2)Lb; -SymHelp=Symmetrize[\[CapitalLambda]\[Lambda]6tot,Symmetric]//SparseArray; -ContriSSS=Prefac*SymHelp; - -(*Vector loops*) -\[CapitalLambda]\[Lambda]6tem=Flatten[Transpose[HabijV,{1,4,3,2}] . HabijV,{{2},{3},{5},{6},{1,4}}]; -\[CapitalLambda]\[Lambda]6tot=\[CapitalLambda]\[Lambda]6tem . Flatten[HabijV,{{1,2},{3},{4}}]; -Prefac=3*15*Zeta[3]/(128 \[Pi]^4 T^2); -ContriVV=Prefac*Symmetrize[\[CapitalLambda]\[Lambda]6tot,Symmetric]//SparseArray//SimplifySparse; - - -(*Fermion loops*) -\[CapitalLambda]\[Lambda]6tot1=Table[Tr[a . b . c . d . e . f],{a,Ysff},{b,YsffC},{c,Ysff},{d,YsffC},{e,Ysff},{f,YsffC}]//SparseArray; -\[CapitalLambda]\[Lambda]6totC=Table[Tr[a . b . c . d . e . f],{a,YsffC},{b,Ysff},{c,YsffC},{d,Ysff},{e,YsffC},{f,Ysff}]//SparseArray; -\[CapitalLambda]\[Lambda]6tot=\[CapitalLambda]\[Lambda]6tot1+ \[CapitalLambda]\[Lambda]6totC; -Prefac=((7 Zeta[3])*15*4/(64 \[Pi]^4 T^2)); -ContriFF=Prefac*Symmetrize[\[CapitalLambda]\[Lambda]6tot,Symmetric]//SparseArray//SimplifySparse; - - -(*Field-strength renormalization*) - -ContriSETemp=-ZijS . \[Lambda]6; -ContriSE=6*Symmetrize[ContriSETemp,Symmetric]//SparseArray//SimplifySparse; - - -(*Minus sign from matching*) -\[Lambda]6D=ContriSE- ContriSS- ContriVV- ContriFF-ContriSSS//SparseArray; - - - - -]; - - - -(* - Calculates Scalar-Vector gauge couplings in the soft theory. -*) -TransverseSSVV[]:=Module[{}, -If[verbose,Print["Calculating Transverse-Vector Couplings"]]; - -CouplingSV= 1/(16 \[Pi]^2)*3/4Lb ; -ContriSVTemp=Transpose[Simplify[Transpose[Transpose[Flatten[HabijV,{2,3}],{2,1,3}],{1,3,2}] . Flatten[HabijV,{2,4}]],{1,3,2,4}]; -ContriSV=CouplingSV*Simplify[(ContriSVTemp+Transpose[ContriSVTemp,{2,1,3,4}])]//SimplifySparse; - - - CouplingVVVV= -((3 Lb)/(64 \[Pi]^2)); - ContriVVVV=CouplingVVVV*Transpose[Transpose[Flatten[GabcdV,{2,3}],{2,1,3}],{1,3,2}] . Flatten[HabijV,{1,2}]//SimplifySparse; - - - CouplingFFFF=(-1) 1/(16 \[Pi]^2)( Lf) ; -HabIJFAE=gvff . Transpose[gvff,{2,1,3}]; -YTemp2=Ysff . Transpose[YsffC,{2,1,3}]; - -ContriFFFFTemp=Transpose[Transpose[Flatten[HabIJFAE,{2,4}],{2,1,3}],{1,3,2}] . Flatten[Transpose[YTemp2,{1,4,3,2}],{2,4}]; -ContriFFFFTemp2=ContriFFFFTemp+Transpose[Transpose[ContriFFFFTemp,{1,2,4,3}],{2,1,3,4}]; -ContriFFFF=CouplingFFFF*Simplify[ContriFFFFTemp2+ Transpose[ContriFFFFTemp2,{2,1,3,4}]]; - -HgY=gvff . Transpose[Ysff,{2,1,3}]; -HgY4=Transpose[gvff,{1,3,2}] . Transpose[YsffC,{2,1,3}]; -AE1=Transpose[Transpose[Flatten[HgY,{2,4}],{2,1,3}],{1,3,2}] . Flatten[Transpose[HgY4,{1,4,3,2}],{2,4}]//Transpose[#,{1,3,2,4}]&; -AE2=Transpose[Transpose[Flatten[HgY4,{2,4}],{2,1,3}],{1,3,2}] . Flatten[Transpose[HgY,{1,4,3,2}],{2,4}]//Transpose[#,{1,3,2,4}]&; -CouplingFFFF2=2*(-1)*2*1/2*1/(16 \[Pi]^2)( Lf) ; -ContriFFFF2=CouplingFFFF2*Simplify[ AE1 + AE2 ]; - -(*Self-energy contribution*) -ContriSEScalar=-HabijV . ZijS-Transpose[Transpose[HabijV,{1,2,4,3}] . ZijS,{1,2,4,3}]//SparseArray; -ContriSEVector=-ZabT . HabijV-Transpose[ZabT . Transpose[HabijV,{2,1,3,4}],{2,1,3,4}]//SparseArray//SimplifySparse; - -GvvssT=ContriSV+ContriVVVV +ContriFFFF+ ContriFFFF2+ ContriSEScalar+ ContriSEVector//SparseArray; - -]; - - - -(* - Calculates Scalar and temporal-scalar quartics in the soft theory. -*) -LongitudionalSSVV[]:=Module[{}, -If[verbose,Print["Calculating Scalar-Temporal-Vector Couplings"]]; - -CouplingSV= 1/(16 \[Pi]^2)*(3/4Lb-1/2) ; -ContriSVTemp=Transpose[Simplify[Transpose[Transpose[Flatten[HabijV,{2,3}],{2,1,3}],{1,3,2}] . Flatten[HabijV,{2,4}]],{1,3,2,4}]; -ContriSV=CouplingSV*Simplify[(ContriSVTemp+Transpose[ContriSVTemp,{2,1,3,4}])]//SimplifySparse; - -CouplingSSS=1/(8 \[Pi]^2); -ContriSSS=CouplingSSS*Transpose[Transpose[Flatten[Habij,{3,4}],{2,1,3}],{1,3,2}] . Flatten[\[Lambda]4,{1,2}]//SimplifySparse; - -CouplingVVVV= -((3 Lb+22)/(64 \[Pi]^2)); -ContriVVVV=CouplingVVVV*Transpose[Transpose[Flatten[GabcdV,{2,3}],{2,1,3}],{1,3,2}] . Flatten[HabijV,{1,2}]//SimplifySparse; - - CouplingFFFF=(-1) 1/(16 \[Pi]^2)( Lf-2) ; -HabIJFAE=gvff . Transpose[gvff,{2,1,3}]; -YTemp2=Ysff . Transpose[YsffC,{2,1,3}]; -ContriFFFFTemp=Transpose[Transpose[Flatten[HabIJFAE,{2,4}],{2,1,3}],{1,3,2}] . Flatten[Transpose[YTemp2,{1,4,3,2}],{2,4}]; -ContriFFFFTemp2=ContriFFFFTemp+Transpose[Transpose[ContriFFFFTemp,{1,2,4,3}],{2,1,3,4}]//SimplifySparse; -ContriFFFF=CouplingFFFF*Simplify[ContriFFFFTemp2+ Transpose[ContriFFFFTemp2,{2,1,3,4}]]; - -HgY=gvff . Transpose[Ysff,{2,1,3}]; -HgY4=Transpose[gvff,{1,3,2}] . Transpose[YsffC,{2,1,3}]; -AE1=Transpose[Transpose[Flatten[HgY,{2,4}],{2,1,3}],{1,3,2}] . Flatten[Transpose[HgY4,{1,4,3,2}],{2,4}]//Transpose[#,{1,3,2,4}]&; -AE2=Transpose[Transpose[Flatten[HgY4,{2,4}],{2,1,3}],{1,3,2}] . Flatten[Transpose[HgY,{1,4,3,2}],{2,4}]//Transpose[#,{1,3,2,4}]&; -CouplingFFFF2=2* (-1)*2*1/2*1/(16 \[Pi]^2)( Lf) ; -ContriFFFF2=CouplingFFFF2*Simplify[ AE1 + AE2 ]; - -(*Self-energy contribution*) -ContriSEScalar=-HabijV . ZijS-Transpose[Transpose[HabijV,{1,2,4,3}] . ZijS,{1,2,4,3}]//SimplifySparse//SparseArray; -ContriSEVector=-ZabL . HabijV-Transpose[ZabL . Transpose[HabijV,{2,1,3,4}],{2,1,3,4}]//SparseArray//SimplifySparse; - -GvvssL=ContriSV+ContriSSS+ContriVVVV+ ContriFFFF+ContriFFFF2+ ContriSEScalar+ ContriSEVector//SimplifySparse//SparseArray; - - -]; - - -(* - Calculates the scalar mass to 2 loops in the soft theory -*) -ScalarMass2Loop[]:=Module[{}, -If[verbose,Print["Calculating 2-Loop Scalar Mass"]]; - -(*Just temp variables. Except for all the way they're reused throughout the code.*) -(*Sombody should grant me some eys...*) - -\[Kappa]=1/(16 \[Pi]^2); -I1I2=\[Kappa] T^2/(12 \[Epsilon]b); -dI1I2=3\[Kappa] T^2/(12 \[Epsilon]b)-\[Kappa] T^2/6; -I1=T^2/(12 \[Epsilon])+T^2 Lbbb; -I2I3m1=T^2/(512 \[Pi]^2 \[Epsilon]b)-T^2/(768 \[Pi]^2); -I1FI2F=-((T^2) /(384 \[Pi]^2))/\[Epsilon]F; -I1BI2F=((T^2) /(192 \[Pi]^2))/\[Epsilon]FB; -I1FI2B=-((T^2) /(384 \[Pi]^2))/\[Epsilon]BF; -I1FI2FD=(3-2\[Epsilon]F)I1FI2F; -I1BI2FD=(3-2\[Epsilon]FB)I1BI2F; -I1FI2BT1=I1FI2B(-4)-T^2/(96 \[Pi]^2); -I1F=-T^2/(24\[Epsilon])+1/24 T^2 Lfff; (*This one is my favorite*) - - -(* - The indexing of diagrams follow a genius-level system. - It is so genius, words can't properly describe it. -*) - -Contri1=1/4 I1I2 Simplify[TensorContract[\[CapitalLambda]\[Lambda],{3,4}]]; -Contri2=1/2 I1 *Flatten[\[Gamma]ij] . Flatten[\[Lambda]4,{1,2}]; -Contri21=1/(16 \[Pi]^2)Lb *1/2 *Flatten[\[Mu]ij] . Flatten[\[Lambda]4,{1,2}]; -Contri3=-1/2 I1 \[Epsilon] *TensorContract[Z\[Lambda]ijkl,{3,4}]; -Contri31=-1/2 I1 *Flatten[\[Gamma]ij] . Flatten[\[Lambda]4,{1,2}]; -Contri32=-1/4 I1 *(\[Gamma]ij . TensorContract[\[Lambda]4,{1,2}]+TensorContract[\[Lambda]4,{1,2}] . \[Gamma]ij); - - -Contri4=-1/2 dI1I2 *(Flatten[\[CapitalLambda]g] . Flatten[\[Lambda]4,{1,2}]); -Contri5=1/2 dI1I2 Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][Hg,HabijV], {{1,3},{2,4}}]]; -Contri6= (3-2\[Epsilon]) I1 \[Epsilon]*1/2 TensorContract[Zgvvss,{1,2}]; -Contri61=(3-2\[Epsilon]) I1 *1/2 Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][\[Gamma]ab,HabijV], {{1,3},{2,4}}]]; -Contri62=(3-2\[Epsilon]) I1 *1/2 Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][\[Gamma]ij,Habij], {{3,4},{2,5}}]+ Activate @ TensorContract[ - Inactive[TensorProduct][\[Gamma]ij,Habij], {{3,4},{2,6}}]]; -Contri7=-1/2 I1 (3-2\[Epsilon]) Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][\[Gamma]ab,HabijV], {{1,3},{2,4}}]]; -Contri8=-1/2 I1I2 Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][Hg,HabijV], {{1,3},{2,4}}]]; -Contri9=T^2 1/4*(-1)*(9 /(8 \[Epsilon]b)-13 /8)1/(16 \[Pi]^2)Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][GabcdV,HabijV], {{2,4},{1,5},{3,6}}]]; -Contri10=(I1I2/4) *Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][GabcdV,HabijV], {{1,5},{2,3},{4,6}}]]; -Contri11=T^2 (-1)1/4*(13/(24 \[Epsilon]b)-7/24)/(16 \[Pi]^2) Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][GabcdV,HabijV], {{1,5},{2,3},{4,6}}]]; -Contri12= (-1/2)(-1)2(I1FI2F-I1BI2F)*(Flatten[TensorContract[YTemp,{1,2}]] . Flatten[YTemp,{4,3}]+Flatten[TensorContract[YTempC,{1,2}]] . Flatten[YTempC,{4,3}]); -Contri13= (-2 I1FI2B)*1/4*(Flatten[Ysij] . Flatten[\[Lambda]4,{1,2}]+Flatten[YsijC] . Flatten[\[Lambda]4,{1,2}]); - -(*Kos, or some say Kosm*) -help1=Flatten[Ysff,{{1},{2,3}}] . Flatten[ZYsijC,{2,3}]+Flatten[YsffC,{{1},{2,3}}] . Flatten[ZYsij,{2,3}]; -Contri14=I1F*(help1+Transpose[help1,{2,1}])//Simplify; -help1=Ysij . \[Gamma]ij; -Contri141=I1F (help1+Transpose[help1])//Simplify; -(*General nF modifcation*) -help=TensorContract[HabIJF . NFMat,{3,4}]; -(**********************) -Contri15=2I1FI2BT1(-1)*1/4 *(Flatten[help] . Flatten[HabijV,{1,2}]); -help=TensorContract[HabIJF,{1,2}]; -help2=Flatten[help] . Flatten[YTemp,{3,4}]+Flatten[help] . Flatten[YTempC,{3,4}]; -Contri16=(-1)( I1FI2FD-I1BI2FD)(-1)*2/3(1-1 \[Epsilon]/3)*help2; - -(*Self-energy contribution*) -ContriF=-(ZijS . aS3D+Transpose[ZijS . aS3D]); - - -(*Contribution from Cubics*) -ContriCubic=1/2*1/(16 \[Pi]^2)Lb Activate@TensorContract[Inactive@TensorProduct[\[Lambda]3,\[Lambda]3],{{2,5},{3,6}}]; - - -(*Contribution from Fermion Masses*) -Fac=1/(8 \[Pi]^2) Lf; -Temp1=Activate@TensorContract[Inactive@TensorProduct[Ysff,\[Mu]IJFC,\[Mu]IJFC,Ysff],{{2,4},{3,6},{5,9},{7,10}}]//Normal; -Temp1C=Activate@TensorContract[Inactive@TensorProduct[YsffC,\[Mu]IJF,\[Mu]IJF,YsffC],{{2,4},{3,6},{5,9},{7,10}}]//Normal; -ContriFFMass1=-1/2Fac*(Temp1+Temp1C)//Simplify//PowerExpand; -Temp1=Activate@TensorContract[Inactive@TensorProduct[Ysff,YsffC,\[Mu]IJFC,\[Mu]IJF],{{3,5},{2,7},{6,10},{8,9}}]//Normal; -Temp1C=Activate@TensorContract[Inactive@TensorProduct[YsffC,Ysff,\[Mu]IJF,\[Mu]IJFC],{{3,5},{2,7},{6,10},{8,9}}]//Normal; -ContriFFMass2=-Fac*(Temp1+Temp1C)//Simplify//PowerExpand; - - -(*Grant us eyes*) -\[Mu]SijNLO=SerEnergyHelp[ContriF//Normal]-SerEnergyHelp[ContriCubic//Normal]-SerEnergyHelp[(ContriFFMass1+ContriFFMass2)//Normal]-SerEnergyHelp[(Contri1+Contri2+Contri3+Contri31+ Contri32+Contri4+Contri5)//Normal]-SerEnergyHelp[(Contri6+Contri61+Contri62+Contri7+Contri8+ Contri9+ Contri10+ Contri11)//Normal]-SerEnergyHelp[(Contri21+Contri12+Contri13+ Contri14+ Contri141+ Contri15+ Contri16)//Normal]//Simplify; - -]; - - -(* - Calculations of the 2-loop Debye mass in the soft theory. -*) -VectorMass2Loop[]:=Module[{}, -If[verbose,Print["Calculating 2-Loop Debye Mass"]]; - - -(*Contributions are divided into Pure Vector, Scalar-Vector, Scalar-Fermion, and Vector-Fermion*) -(*Next on the nobody-will-ever-read show, This code is well organized, except for all the ways that it isn't.*) - -(*Definitions*) -\[Kappa]=1/(16 \[Pi]^2); -I1=T^2/(12 \[Epsilon])+T^2 Lbbb; -I2M2=T^2/(24 )(-1/\[Epsilon]- 12Lbbb+2); -I1I2=\[Kappa] T^2/(12 \[Epsilon]b); -dI1I2=3\[Kappa] T^2/(12 \[Epsilon]b)-\[Kappa] T^2/6; -I211M020=T^2/(192 \[Pi]^2); -I211M020=x3*0; -I2M2I2=T^2/(192 \[Pi]^2)-T^2/(384 \[Pi]^2 \[Epsilon]bbM); -I3M2I1=T^2/(768 \[Pi]^2 \[Epsilon]bbM)+T^2/(384 \[Pi]^2); -Clear[LbbM]; -I1p=T^2/(12 )+\[Epsilon] T^2 Lbbb; -I3M2p=1/(64 \[Pi]^2 \[Epsilon]bp)+1/(32 \[Pi]^2); -I2p=1/(16 \[Pi]^2 \[Epsilon]bp); -I4M4p=1/(128 \[Pi]^2 \[Epsilon]bp)+1/(48 \[Pi]^2); -I2M2p=-T^2/24+T^2 (((-1/24)LbbM - (-1)*1/24 Lb )+1/12)\[Epsilon]; -I211M200=0; -IF111=0; -IF211M002=0; -IF211M020=0; -IF211M200=0; -IF112M002=0; -IF112M200=0; -I111=0; -IF1p=-T^2/(24)+1/24 T^2 Lfff \[Epsilon]; -IF2p=1/(16 (\[Pi]^2) ) (1/\[Epsilon]+Lf); -IF3M2p=1/(64 \[Pi]^2)(1/\[Epsilon]+Lf+2); -IF2M2p=(-T^2/24-T^2 1/48* Lfff)\[Epsilon]+T^2/48; - - -(* - Yukawa diagrams -*) - - -(*Temp=gvff . Transpose[Ysff,{2,1,3}]; -Temp2=Transpose[gvff,{1,3,2}] . Transpose[YsffC,{2,1,3}]; -ContriFS1=(4 (IF211M002-IF211M020+IF211M200)-2 IF111)*(-1)*(Transpose[Flatten[Temp,{2,4,3}]] . Flatten[Temp2,{4,2,3}]); -I1Temp=2 (-(2 IF112M002)+IF211M002-IF211M020+IF211M200); -Temp0=Ysff . Transpose[YsffC,{2,1,3}]; -Temp1=Flatten[gvff,{{1},{2,3}}] . Flatten[Temp0,{{4,2},{1},{3}}]; -Temp2=Flatten[Temp1,{{1},{2,3}}] . Flatten[gvss,{{2,3}}]; -ContriFS2=I I1Temp*(Temp2+Transpose[Temp2])//Simplify;*) -I1Temp=(I1p-IF1p) (4 IF3M2p-IF2p)-IF111+2 (IF211M002-IF211M020+IF211M200); -I1Temp=T^2/(64 \[Pi]^2); -Temp=Flatten[Ysff,{{3},{1,2}}] . Flatten[YsffC,{{1,2}}]; -ContriFS3=2I1Temp*Flatten[HabIJF,{{1},{2},{3,4}}] . Flatten[Temp,{2,1}]; -Temp=Flatten[Ysff,{{1},{2,3}}] . Flatten[YsffC,{2,3}]+Flatten[YsffC,{{1},{2,3}}] . Flatten[Ysff,{2,3}]; -(*I1Temp=4 (IF112M002-2 I3M2p IF1p);*) -I1Temp=T^2/(96 \[Pi]^2)+(Lb T^2)/(192 \[Pi]^2)-(Lfff T^2)/(192 \[Pi]^2); -ContriFS4=I1Temp*(-1)(-1)/2*(Flatten[Habij,{{1},{2},{3,4}}] . Flatten[Temp]); -(*I1Temp=IF111-2 I2p IF1p;*) -I1Temp=(Lb T^2)/(192 \[Pi]^2)-(Lfff T^2)/(192 \[Pi]^2); -ContriFS5=I1Temp*(-1)/2/2*(Flatten[HabijV,{{1},{2},{3,4}}] . Flatten[Temp]); - - -(* - Counterterms Fermion -*) - - -(*ContriFF=SelfEnergyFF*Simplify[TensorContract[HabIJF,{{3,4}}]];*) -(*I1Temp=4IF2M2p-2IF1p;*) -I1Temp=-(T^2/6)-(Lfff T^2)/6;(*\[Epsilon]^-1included*) - -(*General nF modification*) -HabIJFnF= HabIJF . NFMat; -gvffnF= gvff . NFMat; -(************************) -ContriFSCT1=(-1)(-1) I1Temp*2*Flatten[HabIJFnF,{{1},{2},{3,4}}] . Flatten[\[Gamma]IJF]; -gvIJR=Zgvff+1/2(\[Gamma]ab . gvff+Transpose[\[Gamma]IJF . Transpose[gvff,{2,1,3}],{2,1,3}]+gvff . \[Gamma]IJF); -HabIJFZ=Transpose[gvIJR . Transpose[gvffnF,{2,1,3}]+gvffnF . Transpose[gvIJR,{2,1,3}],{1,3,2,4}]; -ContriFSCT2=(-1)I1Temp*TensorContract[HabIJFZ,{{3,4}}]//SparseArray; -ContriDiaY= ContriFS3+ ContriFS4+ ContriFS5; -ContriCT= ContriFSCT1+ ContriFSCT2; - - - -HabIJFp=HabIJF;(*Fix this later. Just kiddin. Fear the old blood.*) -(*Fermion - Vector Diagrams*) - -(*I1Temp=-(2 (D-3) IF111)+4 (D-2) (IF211M002-IF211M020+IF211M200)-8 I2p IF2M2p-4 IF112M002+8 IF112M200;*) -I1Temp=T^2/(48 \[Pi]^2)-(Lb T^2)/(96 \[Pi]^2)+(Lfff T^2)/(96 \[Pi]^2); -(*Generic nF modification*) -HabIJFnF=HabIJF . NFMat; -(***********************) - -Help1=TensorContract[Flatten[HabIJFnF,{{1},{2},{3,4}}] . Flatten[HabIJF,{4,3}],{2,4}]; -ContriFV1=I1Temp*(-1)Help1; - -(*I1Temp=-(2 (D-2) (2 IF112M002-IF211M002+IF211M020-IF211M200))-4 I3M2p (IF1p-2 IF2M2p);*) -I1Temp=T^2/(192 \[Pi]^2)+(Lb T^2)/(192 \[Pi]^2)-(Lfff T^2)/(192 \[Pi]^2); -(*Generic nF modification*) -HabIJFnF=HabIJF . NFMat; -(***********************) -HelpAE=Flatten[gvff,{{1},{3,2}}] . Flatten[HabIJFnF,{{3,4},{1},{2}}]; -AE=-I/(-2) *(HelpAE-Transpose[HelpAE,{1,3,2}])//SparseArray; (*Yes I like stupid variable names. Youtube made me do it.*) -Temp2AE=Flatten[AE,{{1},{2,3}}] . Flatten[gvvv,{3,2}]; - -ContriFV2=(-1) I1Temp(Temp2AE+Transpose[Temp2AE,{2,1}]); -(*I1Temp=-(D (I1p-IF1p) (IF2p-4 IF3M2p))-(D-3) IF111+2 D (IF211M002-IF211M020+IF211M200)+2 I1p IF2p-8 I1p IF3M2p-4 (I2p IF2M2p+IF211M002-IF211M020+IF211M200)-2 IF1p IF2p+8 IF1p IF3M2p-2 IF112M002+4 IF112M200;*) -I1Temp=T^2/(24 \[Pi]^2)-(Lb T^2)/(192 \[Pi]^2)+(Lfff T^2)/(192 \[Pi]^2); -Temp=TensorContract[HabIJFp,{{1,2}}]; -(*Generic nF modification*) -HabIJFpnF=HabIJFp . NFMat; -(***********************) -ContriFV3=I1Temp*2*(Flatten[HabIJFpnF,{{1},{2},{4,3}}] . Flatten[Temp]); -(*I1Temp=4 (D-2) (2 I3M2p IF1p-IF112M002);*) -I1Temp=-(T^2/(96 \[Pi]^2))-(Lb T^2)/(96 \[Pi]^2)+(Lfff T^2)/(96 \[Pi]^2); -(*Generic nF modification*) -HabIJFpnF=HabIJFp . NFMat; -(***********************) -Temp0=TensorContract[HabIJFpnF,{{3,4}}]//SparseArray; -ContriFV4=(-1)I1Temp*(Flatten[GabcdV,{{1},{4},{2,3}}] . Flatten[Temp0]); -(*I1Temp=(1) (2 (D-3) I2p IF1p-(D-3) IF111-2 IF112M002+4 IF112M200);*) -I1Temp=T^2/(96 \[Pi]^2)-(Lb T^2)/(192 \[Pi]^2)+(Lfff T^2)/(192 \[Pi]^2); -(*Generic nF modification*) -HabIJFpnF=HabIJFp . NFMat; -(***********************) -Temp0=TensorContract[HabIJFpnF,{{3,4}}]//SparseArray; -Temp=Flatten[GabcdV,{{1},{3},{2,4}}] . Flatten[Temp0]+Flatten[GabcdV,{{1},{3},{4,2}}] . Flatten[Temp0]; -ContriFV5=I1Temp*Temp (-1)^2 (-1)/2; -ContriDiaFV=1 ContriFV1+ ContriFV2+1 ContriFV3+ ContriFV4+1 ContriFV5; - - -I1=Lbbb T^2; -I2M2=T^2/12-(Lbbb T^2)/2; -I1I2=(Lbb T^2)/(192 \[Pi]^2); -dI1I2=-(T^2/(96 \[Pi]^2))+(Lbb T^2)/(64 \[Pi]^2); - - - -(* - Abelian-Scalar - *) -Contri1=1/2 I1 \[Epsilon] TensorContract[Zgvvss,{{3,4}}];(*******) -Temp= 2*\[Gamma]ab . Hg; -Contri11p=1/4 I1 ( Temp+Transpose[Temp,{2,1}]); -Contri12p=1/4 I1 *2*Flatten[HabijV,{{1},{2},{3,4}}] . Flatten[\[Gamma]ij]; -Contri2=-I1*1/2 *Flatten[HabijV,{{1},{2},{3,4}}] . Flatten[\[Gamma]ij]; -Contri21p=1/(16 \[Pi]^2)*Flatten[HabijV,{{1},{2},{3,4}}] . Flatten[\[Mu]ij]; -Contri3=-1/2 I2M2 *4\[Epsilon]/2 TensorContract[Zgvvss,{{3,4}}];(********) -Contri31p=-1/4 I2M2 *4/2( Temp+Transpose[Temp,{2,1}]); -Contri32p=-1/4 I2M2 *2*4/2*2*Flatten[HabijV,{{1},{2},{3,4}}] . Flatten[\[Gamma]ij]; -Contri4=(-1)*(-1)*4 I2M2*Flatten[Habij,{{1},{2},{3,4}}] . Flatten[\[Gamma]ij]; -Contri5=-1/4*I1I2*Flatten[HabijV,{{1},{2},{3,4}}] . Flatten[TensorContract[\[Lambda]4,{1,2}],{1,2}]; -(*Contri6=dI1I2/4 Activate@TensorContract[Inactive@TensorProduct[HabijV,HabijV],{{5,6},{3,7},{4,8}}];*) (*New change*) -Contri6=dI1I2/4*2*Flatten[HabijV,{{1},{2},{3,4}}] . Flatten[\[CapitalLambda]g,{1,2}]; -(*Contri7=(-1)/2 2 I111*Flatten[HabijV,{{1},{2},{3,4}}] . Flatten[\[CapitalLambda]g,{1,2}];*) -(*I1Temp=(-4 I211M020+8 I211M200+4 I2p I2M2p);*) -I1Temp=T^2/(48 \[Pi]^2)-(LbbM T^2)/(96 \[Pi]^2); -Contri8=I1Temp*Flatten[Habij,{{1},{2},{3,4}}] . Flatten[\[CapitalLambda]g,{1,2}]; -(*Contri9=1/2*(4 (2 I211M020+I211M200-2 I2p I2M2p))Activate@TensorContract[Inactive@TensorProduct[Habij,Habij],{{2,6},{3,8},{4,7}}]//Simplify;*) -(*I1Temp=1/2*(4 (2 I211M020+I211M200-2 I2p I2M2p));*) -I1Temp=-(T^2/(48 \[Pi]^2))+(LbbM T^2)/(96 \[Pi]^2); -Contri9=I1Temp*Flatten[Habij,{{1},{2,3,4}}] . Flatten[Habij,{{2,4,3}}]; -(*I1Temp=2(-1)/2*4(3-2\[Epsilon]bbM)I3M2I1;*) -I1Temp=-(T^2/(48 \[Pi]^2))-(LbbM T^2)/(64 \[Pi]^2); -Contri10=I1Temp*Flatten[Habij,{{1},{2},{3,4}}] . Flatten[\[CapitalLambda]g]; -(*I1Temp=1/2*4 I3M2I1;*) -I1Temp=T^2/(192 \[Pi]^2)+(LbbM T^2)/(384 \[Pi]^2); -Contri11=I1Temp *Flatten[Habij,{{1},{2},{3,4}}] . Flatten[TensorContract[\[Lambda]4,{1,2}]]; - - -(* - Non -Abelian/Scalar diagrams -*) -(*I1Temp=4 (-1+D) I1p I3M2p;*) -I1Temp=T^2/(48 \[Pi]^2)+(Lb T^2)/(64 \[Pi]^2)+(3 Lbbb T^2)/(16 \[Pi]^2); -ContriS1=1/2*(-1)*2*I1Temp* Flatten[GabcdV,{{1},{4},{2,3}}] . Flatten[Hg]; -(*I1Temp=2 (-(2 I1p I3M2p)+I211M200+4 I2M2p I3M2p);*) -I1Temp=-(T^2/(96 \[Pi]^2))-(Lb T^2)/(192 \[Pi]^2)-(Lbbb T^2)/(16 \[Pi]^2)-(LbbM T^2)/(192 \[Pi]^2); -Temp1=Transpose[Transpose[Flatten[Habij,{3,4}],{2,1,3}],{1,3,2}] . Flatten[Transpose[gvss,{1,3,2}],{{2,3}}]; -Temp=Transpose[Flatten[gvvv,{2,3}]] . Flatten[Temp1,{1,2}]; -ContriS3=1/2*(-1)^2 I1Temp*(Temp+Transpose[Temp,{2,1}]); -(*I1Temp=8 I1p I3M2p-4 I211M200;*) -I1Temp=T^2/(48 \[Pi]^2)+(Lb T^2)/(96 \[Pi]^2)+(Lbbb T^2)/(8 \[Pi]^2); -Help=Transpose[Transpose[Flatten[GabcdV,{2,3}],{2,1,3}],{1,3,2}] . Flatten[Hg,{1,2}]//SparseArray//Simplify; -ContriS4=1/2 (-1)^2 I1Temp*Help; -(*I1Temp=I1p ((-2+D) I2p+I3M2p) (1);*) -I1Temp=-(T^2/(128 \[Pi]^2))+(3 Lb T^2)/(256 \[Pi]^2)+(9 Lbbb T^2)/(64 \[Pi]^2); -ContriS5=(-1)/4*2*2*I1Temp*(-Help); -(*I1Temp=-((I111+4 I211M020-I211M200-2 I1p (I2p+I3M2p)) (1));*) -I1Temp=T^2/(192 \[Pi]^2)+(5 Lb T^2)/(384 \[Pi]^2)+(5 Lbbb T^2)/(32 \[Pi]^2); -ContriS6=(-1)^2/4*2*I1Temp*(-Help); - - -(* - Pure -non-abelian -*) - -(*ITemp=(8 I1p ((D-2) ((D-2) D+2) I3M2p+I4M4p)+8 I2M2p (I3M2p-D I4M4p))/(D-1)//FullSimplify;*) -I1Temp=(23 T^2)/(576 \[Pi]^2)+(41 Lb T^2)/(576 \[Pi]^2)+(41 Lbbb T^2)/(48 \[Pi]^2)+(LbbM T^2)/(576 \[Pi]^2); -GHelp=TensorContract[GabcdV,{{1,3}}]; -Contri13=(-1)*(-1)/2*(-1)*I1Temp*Flatten[TensorContract[GabcdV,{1,3}],{1,2}] . Flatten[GabcdV,{2,4}]//SparseArray//Simplify; -(*ITemp=1/4 (I2p I2M2p-I211M020+2 I211M200);*) -I1Temp=T^2/(768 \[Pi]^2)-(LbbM T^2)/(1536 \[Pi]^2); -Contri18=I1Temp*(-1)*2*Transpose[Flatten[GabcdV,{2,3,4}]] . Flatten[GabcdV,{2,3,4}]; -(*I1Temp=2 I1p I3M2p-I211M200;*) -I1Temp=T^2/(192 \[Pi]^2)+(Lb T^2)/(384 \[Pi]^2)+(Lbbb T^2)/(32 \[Pi]^2); -Contri20=I1Temp*(-1)Transpose[Flatten[GabcdV,{2,3,4}]] . Flatten[GabcdV,{2,3,4}]; -(*I1Temp=3/2 ((4 D-5) I211M200-I2p I2M2p+I211M020);*) -I1Temp=-(T^2/(128 \[Pi]^2))+(LbbM T^2)/(256 \[Pi]^2); -GHelp= Transpose[Flatten[GabcdV,{1,3,4}]] . Transpose[Transpose[Flatten[GabcdV,{2,3,1}]]]-Transpose[Flatten[GabcdV,{1,3,4}]] . Transpose[Transpose[Flatten[GabcdV,{4,3,1}]]]//SparseArray//Simplify; -Contri24=I1Temp*(-1)^2/2(GHelp + Transpose[GHelp,{2,1}]); -(*I1Temp=1/4 (-(2 I2p I2M2p)+2 I211M020+I211M200)//Simplify;*) -I1Temp=-(T^2/(384 \[Pi]^2))+(LbbM T^2)/(768 \[Pi]^2); -Contri14=-I1Temp*(-Transpose[Flatten[GabcdV,{1,2,3}]] . Flatten[GabcdV,{3,2,4}]);(*Careful with this one*) -(*I1Temp=1/4 (2 I3M2p (I1p-2 I2M2p)-I211M200);*) -I1Temp=T^2/(768 \[Pi]^2)+(Lb T^2)/(1536 \[Pi]^2)+(Lbbb T^2)/(128 \[Pi]^2)+(LbbM T^2)/(1536 \[Pi]^2); -TensTemp=(Transpose[Flatten[GabcdV,{1,2,3}]] . Flatten[GabcdV,{3,2,4}]);(*Careful with this one*) -Contri16=-I1Temp*(TensTemp+Transpose[TensTemp,{2,1}])//Simplify; -(*I1Temp=-(2 (4 D-7) (I1p I3M2p+I2p I2M2p-2 I2M2p I3M2p))+2 (4 D-7) I211M020+(8 D-9) I211M200//Simplify;*) -I1Temp=-((9 T^2)/(64 \[Pi]^2))-(3 Lb T^2)/(128 \[Pi]^2)-(9 Lbbb T^2)/(32 \[Pi]^2)+(3 LbbM T^2)/(128 \[Pi]^2); -Contri17=1/2*I1Temp*(-Transpose[Flatten[GabcdV,{1,2,3}]] . Flatten[GabcdV,{3,2,4}]);(*Careful with this one*) -(*I1Temp=1/(D-1) 4 (D^2 (2 I1p I3M2p+2 I2p I2M2p+3 I211M200)-D (3 I1p I3M2p+6 I2p I2M2p+7 I211M200+2 I2M2p I4M4p)-2 (D-2) (D-1) I211M020+2 (I1p I4M4p+I2M2p I3M2p)-I1p I3M2p+4 I2p I2M2p+4 I211M200)//Simplify//FullSimplify;*) -I1Temp=(101 T^2)/(576 \[Pi]^2)+(5 Lb T^2)/(144 \[Pi]^2)+(5 Lbbb T^2)/(12 \[Pi]^2)-(23 LbbM T^2)/(576 \[Pi]^2); -Contri21=1/2I1Temp (Transpose[Flatten[GabcdV,{1,2,3}]] . Flatten[GabcdV,{1,2,3}]); -ContriTemp=GabcdV+Transpose[GabcdV,{1,4,3,2}]; -(*I1Temp=(2 (I1p ((D-2) (((D-3) D+3) I2p+(D-1) I3M2p)+I4M4p)-I2M2p ((D-2) I2p-D I3M2p+D I4M4p+I3M2p)))/(D-1)//Simplify//FullSimplify;*) -I1Temp=-((199 T^2)/(2304 \[Pi]^2))+(125 Lb T^2)/(2304 \[Pi]^2)+(125 Lbbb T^2)/(192 \[Pi]^2)+(7 LbbM T^2)/(2304 \[Pi]^2); -Contri23=1/4 *I1Temp*Flatten[TensorContract[GabcdV,{{1,3}}]] . Flatten[ContriTemp,{2,4}]; -(*I1Temp=-(1/4) (1) (-(2 I1p (I2p+I3M2p))+I111+4 I211M020-I211M200)//Simplify//FullSimplify;*) -I1Temp=T^2/(768 \[Pi]^2)+(5 Lb T^2)/(1536 \[Pi]^2)+(5 Lbbb T^2)/(128 \[Pi]^2); -(*ContriTemp=Table[GabcdV[[c,a,d,b]]+ GabcdV[[d,a,c,b]],{a,1,nv},{c,1,nv},{b,1,nv},{d,1,nv}]//SparseArray;*) -Contri25=(-1)/2*(-1)*(-1)I1Temp*(-Flatten[TensorContract[GabcdV,{{1,3}}]] . Flatten[ContriTemp,{2,4}]); -(*I1Temp=1/(D-1) (1) (D^2 (2 I1p (I2p+I3M2p)-4 I211M020+I211M200)+D (-(I1p (3 I2p+5 I3M2p))-2 I2M2p (I2p-I3M2p+I4M4p)+10 I211M020+3 I211M200)+(D-1) (3 D-8) I111-I1p I2p+3 I1p I3M2p+2 I1p I4M4p+4 I2p I2M2p-6 I211M020-4 I211M200-2 I2M2p I3M2p)//Simplify//FullSimplify;*) -I1Temp=-((49 T^2)/(2304 \[Pi]^2))+(23 Lb T^2)/(576 \[Pi]^2)+(23 Lbbb T^2)/(48 \[Pi]^2)+(7 LbbM T^2)/(2304 \[Pi]^2); -Contri26=(-1)1/4*(-1)*I1Temp (-Flatten[TensorContract[GabcdV,{{1,3}}]] . Flatten[ContriTemp,{2,4}]); - -(* - Remaining Counterterm diagrams -*) - -Help=Transpose[Flatten[GabcdV,{{3,1,2}}]] . Flatten[GabcdV,{1,3,4}]; - -(*I1Temp=3/4 (1) (2 (2 D-5) I111-4 D I211M200-2 I2p I2M2p+2 I211M020+13 I211M200);*) -I1Temp=-(T^2/(128 \[Pi]^2))+(LbbM T^2)/(256 \[Pi]^2); -(*Contri27=I1Temp/6( 2 b1v1- b1v2- b2v1+ 2 b2v2);*) -Contri27=I1Temp/6( 3*Help); - -I1Temp=-(T^2/6)-(Lb T^2)/12+(LbbM T^2)/12; -ContriCT1=I1Temp*(Flatten[\[Gamma]ab\[Eta]] . Flatten[GabcdV,{1,4}])//SparseArray; -GabcdVCT=gvvv . Zgvvv+Zgvvv . gvvv; -I1Temp=T^2/12+(Lb T^2)/24-(LbbM T^2)/24; -ContriCT2=I1Temp*TensorContract[GabcdVCT,{{1,4}}]//SparseArray; -\[Delta]g\[Eta]=1/2(\[Gamma]ab\[Eta] . gvvv+gvvv . \[Gamma]ab\[Eta]+Transpose[\[Gamma]ab . Transpose[gvvv,{2,1,3}],{2,1,3}]); -GabcdVCT2=gvvv . \[Delta]g\[Eta]+\[Delta]g\[Eta] . gvvv; -I1Temp=T^2/12+(Lb T^2)/24-(LbbM T^2)/24; -ContriCT3=I1Temp*TensorContract[GabcdVCT2,{{1,4}}]//SparseArray; - -(*I1Temp=2(D-2)I1p+2 I2M2p ;*) -I1Temp=-(T^2/6)+(Lb T^2)/12+4 Lbbb T^2-(LbbM T^2)/12; -ContriCT4=-1/2 I1Temp*(-1)TensorContract[GabcdVCT,{{1,4}}]//SparseArray; -\[Delta]g\[Eta]=1/2(\[Gamma]ab . gvvv+Transpose[\[Gamma]ab . Transpose[gvvv,{2,1,3}],{2,1,3}]); -GabcdVCT2=gvvv . \[Delta]g\[Eta]+\[Delta]g\[Eta] . gvvv; -ContriCT5=-1/2 I1Temp* (-1)*TensorContract[GabcdVCT2,{{1,4}}]//SparseArray; -ContriCT6=(-1)^2/2*I1Temp Flatten[\[Gamma]ab] . Flatten[GabcdV,{{2,4}}]; - -(*I1Temp=4(D-1)I2M2p//Simplify;*) -I1Temp=(4 T^2)/3+(Lb T^2)/2-(LbbM T^2)/2; -ContriCT7=1/2(-1)*I1Temp*TensorContract[GabcdVCT,{{1,4}}]//SparseArray; -\[Delta]g\[Eta]=1/2(\[Gamma]ab . gvvv+gvvv . \[Gamma]ab+Transpose[\[Gamma]ab . Transpose[gvvv,{2,1,3}],{2,1,3}]); -GabcdVCT2=gvvv . \[Delta]g\[Eta]+\[Delta]g\[Eta] . gvvv; -ContriCT8=1/2(-1)*I1Temp*TensorContract[GabcdVCT2,{{1,4}}]//SparseArray; - -ContriCT9=I1Temp*Flatten[GabcdV,{{2},{3},{1,4}}] . Flatten[\[Gamma]ab]; - - -(* - Self-Energy Corrections -*) - -ContriF=-(ZabL . aV3D+Transpose[ZabL . aV3D]); - -(* - Fermion-mass contributions -*) -Fac=2(1/(32 \[Pi]^2) Lf+1/(16 \[Pi]^2)); -ContriFFMass=Fac*(-1)Activate@TensorContract[Inactive@TensorProduct[gvff,\[Mu]IJF,\[Mu]IJFC,gvff],{{3,4},{5,10},{6,2},{7,9}}]; - - -(*Total*) -CTPoles= ContriCT1+ ContriCT2+ ContriCT3+ ContriCT4+ ContriCT5+ ContriCT6+ ContriCT7+ ContriCT8+ ContriCT9//Normal; -DiaPoles= Contri18+ Contri14+ Contri16+ Contri17+ Contri21+ Contri23+ Contri20+ Contri24+ Contri25+ Contri26+ Contri27+ Contri13//Normal//Simplify; -ContriAS=Contri1+ Contri11p+ Contri12p+ Contri2+ Contri21p+ Contri3 + Contri31p+ Contri32p+ Contri4+ Contri5+ Contri6+ Contri8+ Contri9+ Contri10+ Contri11//Simplify; -ContriNAS= ContriS1+1 ContriS3+ ContriS4+ ContriS5+ ContriS6//Normal; - - -\[Mu]VabNLO=(ContriF- ContriFFMass-ContriDiaFV- ContriDiaY- CTPoles- ContriCT- DiaPoles- ContriAS- ContriNAS)//Normal//Simplify//FullSimplify; - -]; - - -(* - Comparing symbolic with numeric tensors -*) -CompareTensors[mat1I_,mat2I_]:=Module[{mat1P=mat1I,mat2P=mat2I}, -VarMat1=#->RandomInteger[10000]&/@(Normal[mat1P]//Variables); -VarMat2=#->RandomInteger[10000]&/@(Normal[mat2P]//Variables); -mat1P=Normal[mat1P]/.VarMat1; -mat2P=Normal[mat2P]/.VarMat2; -Return[mat1P==mat2P] -]; - - -(* - Calculates the 1-loop pressure in the soft theory. -*) -SymmetricPhaseLO[]:=Module[{}, -If[verbose,Print["Calculating Leading-Order \!\(\*SuperscriptBox[\(T\), \(4\)]\) Terms"]]; - - -(*Scalar Contribution*) -TestQ=NumericQ[#]&/@Flatten[gvss]//Normal; -Test2=ConstantArray[True,Length[TestQ]]; -If[TestQ==Test2, -If[CompareTensors[gvss,EmptyArray[{nv,nf,nf}]]&&CompareTensors[Ysff,EmptyArray[{ns,nf,nf}]]&&CompareTensors[\[Mu]ij,EmptyArray[{ns,ns}]]&&CompareTensors[\[Lambda]4,EmptyArray[{ns,ns,ns,ns}]]&&CompareTensors[\[Lambda]3,EmptyArray[{ns,ns,ns}]]&&CompareTensors[\[Lambda]1,EmptyArray[{ns}]], -ContriScalars=0; -, -ContriScalars=Sum[-( (\[Pi]^2)/90) T^4,{a,1,ns}]; -];, -ContriScalars=Sum[-( (\[Pi]^2)/90) T^4,{a,1,ns}]; -]; - -(*Vector contribution*) - -TestQ=NumericQ[#]&/@Flatten[{gvss,gvff}//Flatten[#,1]&]//Normal; -Test2=ConstantArray[True,Length[TestQ]]; -If[TestQ==Test2, -If[CompareTensors[gvss,EmptyArray[{nv,nf,nf}]]&&CompareTensors[gvvv,EmptyArray[{nv,nv,nv}]]&&CompareTensors[gvff,EmptyArray[{nv,nf,nf}]], -ContriVectors=0; -, -ContriVectors=Sum[-( (\[Pi]^2)/90) T^4*2,{a,1,nv}]; -];, -ContriVectors=Sum[-( (\[Pi]^2)/90) T^4*2,{a,1,nv}]; -]; - -(*Fermion contribution*) -TestQ=NumericQ[#]&/@Flatten[gvff]//Normal; -Test2=ConstantArray[True,Length[TestQ]]; - -If[TestQ==Test2, -If[CompareTensors[gvff,EmptyArray[{nv,nf,nf}]]&&CompareTensors[Ysff,EmptyArray[{ns,nf,nf}]]&&CompareTensors[\[Mu]IJF,EmptyArray[{nf,nf}]], -ContriFermions=0; -, -ContriFermions=Sum[-7 \[Pi]^2/720 T^4*2*NFMat[[a,a]],{a,1,nf}]; -];, -ContriFermions=Sum[-7 \[Pi]^2/720 T^4*2*NFMat[[a,a]],{a,1,nf}]; -]; - -ToExpression[StringReplace[ToString[StandardForm[ContriScalars+ContriVectors+ContriFermions]],"DRalgo`Private`"->""]] -]; - - - -(* - Calculates the 2-loop pressure in the soft theory. -*) -SymmetricPhaseNLO[]:=Module[{}, -If[verbose,Print["Calculating NLO \!\(\*SuperscriptBox[\(T\), \(4\)]\) Terms"]]; -(*Follows Martin's notation arXiv:1808.07615*) - -AA=1/144 T^4; -I1Temp=AA; -Vss=1/8*I1Temp*TensorContract[\[Lambda]4,{{1,2},{3,4}}]; -I1Temp=-(1/144) T^4; -Vssv=1/4I1Temp*Total[Flatten[gvss] Flatten[gvss]]; -I1Temp=1/48 T^4; -Vvs=1/2*I1Temp*Total[Flatten[gvss] Flatten[gvss]]; -I1Temp=3/64 T^4; -Vvv=1/4*I1Temp*Total[Flatten[gvvv] Flatten[gvvv]]; -I1Temp=-(13/192) T^4; -Vvvv=1/12*I1Temp*Total[Flatten[gvvv] Flatten[gvvv]]; -I1Temp=1/288 T^4; -Vggv=1/4*I1Temp*Total[Flatten[gvvv] Flatten[gvvv]]; -I1Temp=5/576 T^4; -VFFs=1/2*I1Temp*TensorContract[Ysij,{{1,2}}]; -I1Temp=5/288 T^4; -(*Generic nF modification*) -HabIJFnF=HabIJF . NFMat; -(************************) -VFFv=1/2*I1Temp*TensorContract[HabIJFnF,{{1,2},{3,4}}]; - - - -ContriMass=1/2Tr[\[Mu]ij]*T^2/12; - -ContriMassFermion=1/2*T^2/12 Tr[\[Mu]IJF . \[Mu]IJFC]; - -If[mode>=3, -(*Contribution from higher-dimensional operators*) -VSS\[Lambda]6=1/82944*T^6*TensorContract[\[Lambda]6,{{1,2},{3,4},{5,6}}]; -, -VSS\[Lambda]6=0; -]; - - - - -ToExpression[StringReplace[ToString[StandardForm[ContriMass+ContriMassFermion+Vss+Vssv+Vvs+Vvv+Vvvv+Vggv+VFFs+VFFv+VSS\[Lambda]6//FullSimplify]],"DRalgo`Private`"->""]] -]; - - -(* - Calculates the 3-loop pressure in the soft theory. -*) -SymmetricPhaseNNLO[]:=Module[{}, -If[verbose,Print["Calculating NNLO \!\(\*SuperscriptBox[\(T\), \(4\)]\) Terms"]]; - - -(*From the fish to you.*) - -\[Kappa]=1/(16 \[Pi]^2); -I1=T^2/(12 \[Epsilon])+T^2 Lbbb; -I2M2=T^2/(24 )(-1/\[Epsilon]- 12Lbbb+2); -I1I2=\[Kappa] T^2/(12 \[Epsilon]b); -dI1I2=3\[Kappa] T^2/(12 \[Epsilon]b)-\[Kappa] T^2/6; -I211M020=T^2/(192 \[Pi]^2); -I2M2I2=T^2/(192 \[Pi]^2)-T^2/(384 \[Pi]^2 \[Epsilon]bbM); -I3M2I1=T^2/(768 \[Pi]^2 \[Epsilon]bbM)+T^2/(384 \[Pi]^2); -Clear[LbbM]; -I1p=T^2/(12 )+\[Epsilon] T^2 Lbbb; -I3M2p=1/(64 \[Pi]^2 \[Epsilon]bp)+1/(32 \[Pi]^2); -I2p=1/(16 \[Pi]^2 \[Epsilon]bp); -I4M4p=1/(128 \[Pi]^2 \[Epsilon]bp)+1/(48 \[Pi]^2); -I2M2p=-T^2/24+T^2 (((-1/24)LbbM - (-1)*1/24 Lb )+1/12)\[Epsilon]; -IF1p=-T^2/(24)+1/24 T^2 Lfff \[Epsilon]; -IF2p=1/(16 (\[Pi]^2) ) (1/\[Epsilon]+Lf); -IF3M2p=1/(64 \[Pi]^2)(1/\[Epsilon]+Lf+2); -IF2M2p=(-T^2/24-T^2 1/48* Lfff)\[Epsilon]+T^2/48; - - -(*These integrals are given in 9408276 and 9410360*) -EPre=1/(24*16 \[Pi]^2) T^4*(\[Mu]/(4 \[Pi])Exp[-EulerGamma])^(6 \[Epsilon]) (1/\[Epsilon]+91/15+8( Derivative[1][Zeta][-1])/Zeta[-1]-2 Derivative[1][Zeta][-3]/Zeta[-3]); -Series[EPre,{\[Epsilon],0,0}]//Normal//FullSimplify; -M00=Series[EPre,{\[Epsilon],0,0}]//Normal; -LInt=(T^4 Log[Glaisher])/(48 \[Pi]^2)+(T^4 Log[\[Mu]^2])/(768 \[Pi]^2)+T^4/(2304 \[Pi]^2 \[Epsilon])+(EulerGamma T^4)/(1152 \[Pi]^2)-(T^4 Log[\[Pi] T])/(384 \[Pi]^2)-(T^4 Log[2])/(192 \[Pi]^2); -EFPre=1/(96*16 \[Pi]^2) T^4*(\[Mu]/(4 \[Pi])Exp[-EulerGamma])^(6 \[Epsilon]) (1/\[Epsilon]+173/30-42/2 Log[2]+8( Derivative[1][Zeta][-1])/Zeta[-1]-2 Derivative[1][Zeta][-3]/Zeta[-3]); -EFInt=Series[EFPre,{\[Epsilon],0,0}]//Normal//FullSimplify//Expand; -N00=EFInt; -MF1M1=Series[-1/(192*16 \[Pi]^2) T^4*(\[Mu]/(4 \[Pi])Exp[-EulerGamma])^(6 \[Epsilon]) (1/\[Epsilon]+361/60+76/5 Log[2]+6EulerGamma-4( Derivative[1][Zeta][-1])/Zeta[-1]-4Derivative[1][Zeta][-3]/Zeta[-3]),{\[Epsilon],0,0}]//Normal; -MF00=Series[-1/(192*16 \[Pi]^2) T^4*(\[Mu]/(4 \[Pi])Exp[-EulerGamma])^(6 \[Epsilon]) (1/\[Epsilon]+179/30-34/5 Log[2]+6EulerGamma+8( Derivative[1][Zeta][-1])/Zeta[-1]-2Derivative[1][Zeta][-3]/Zeta[-3]),{\[Epsilon],0,0}]//Normal; -MFM2P2=Series[-29/(1728*16 \[Pi]^2) T^4*(\[Mu]/(4 \[Pi])Exp[-EulerGamma])^(6 \[Epsilon]) (1/\[Epsilon]+89/29-90/29 Log[2]+48/29EulerGamma+136/29( Derivative[1][Zeta][-1])/Zeta[-1]-10/29Derivative[1][Zeta][-3]/Zeta[-3]),{\[Epsilon],0,0}]//Normal; -N2M2=Series[1/(108*16 \[Pi]^2) T^4*(\[Mu]/(4 \[Pi])Exp[-EulerGamma])^(6 \[Epsilon]) (1/\[Epsilon]+35/8+3/2EulerGamma-63/10 Log[2]+5( Derivative[1][Zeta][-1])/Zeta[-1]-1/2Derivative[1][Zeta][-3]/Zeta[-3]),{\[Epsilon],0,0}]//Normal; -MP2M2=Series[11/(216*16 \[Pi]^2) T^4*(\[Mu]/(4 \[Pi])Exp[-EulerGamma])^(6 \[Epsilon]) (1/\[Epsilon]+73/22+12/11EulerGamma+64/11( Derivative[1][Zeta][-1])/Zeta[-1]-10/11Derivative[1][Zeta][-3]/Zeta[-3]),{\[Epsilon],0,0}]//Normal; - - -(*Note that some contractions are inefficent. Will fix later but they are anyway not bottlenecks*) -(*The names of all diagrams follow Martin's notation arXiv:1709.02397*) - -(* - Pure Scalar -*) -Temp=TensorContract[\[Lambda]4,{3,4}]; -I1Temp=-LInt; -LSSSS=1/16 *I1Temp*Activate@TensorContract[Inactive@TensorProduct[Temp,Temp],{{1,3},{2,4}}]; -I1Temp=-M00; -ESSSS=1/48I1Temp*TensorContract[\[CapitalLambda]\[Lambda],{{1,3},{2,4}}]; - -(* - Scalar-Vector -*) -I1Temp=1/2Activate@TensorContract[Inactive@TensorProduct[\[CapitalLambda]g,\[Lambda]4],{{1,3},{2,4},{5,6}}]; -LSSVS=I1Temp/2*D I1p^2 I2p; -I1Temp= 1/2Activate@TensorContract[Inactive@TensorProduct[\[CapitalLambda]g,\[Lambda]4],{{1,3},{2,4},{5,6}}]; -JSSVSS=-1/2I1Temp I1p^2 I2p; - -(* - Yukawa-Scalar -*) -Temp1=Activate@TensorContract[Inactive@TensorProduct[Ysij,Ysij],{{1,3},{2,4}}]+Activate@TensorContract[Inactive@TensorProduct[Ysij,YsijC],{{1,3},{2,4}}]; -KSSFFFF=-Temp1/8*(4*IF1p^2 I2p + N00); -Help1=Activate@TensorContract[Inactive@TensorProduct[Ysff,YsffC],{{1,4},{3,5}}]; -Temp1=Activate@TensorContract[Inactive@TensorProduct[Help1,Help1],{{1,4},{2,3}}]; -KFFSFSF=-1/2*(-1)*Temp1*( MF1M1+ MF00+(I1p-IF1p)^2 IF2p); - -(* - Yukawa-Scalar \[Lambda] -*) -help1=TensorContract[\[Lambda]4,{{3,4}}]; -help2=Activate@TensorContract[Inactive@TensorProduct[Ysff,YsffC],{{2,5},{3,6}}]//SparseArray; -Temp1=Activate@TensorContract[Inactive@TensorProduct[help1,help2],{{1,3},{2,4}}]; -JSSFFS=1/4*2Temp1*I1p IF1p I2p; - - -(* - Yukawa-Vector -*) - -Temp1=Activate@TensorContract[Inactive@TensorProduct[Ysij,\[CapitalLambda]g],{{1,3},{2,4}}]; -KSSSVFF=-Temp1/2*2*(MF00-I1p IF1p I2p); -JSSFFV=-Temp1*D I1p IF1p I2p/.D->4-2\[Epsilon]; -Help1=Flatten[Ysff,{{3},{1,2}}] . Flatten[YsffC,{1,2}]; -Temp1=Total[Flatten[TensorContract[HabIJF,{1,2}]]Flatten[Help1]]; -KFFFSVF=Temp1/2(2D-4)(MF1M1+MF00+(I1p-IF1p)^2 IF2p)/.D->4-2\[Epsilon]; -Help1=Transpose[Transpose[gvff,{2,1,3}],{1,3,2}] . gvff; -Help2=Transpose[Transpose[Ysff,{2,1,3}],{1,3,2}] . YsffC; -Temp1=Total[Flatten[Help1]Flatten[Help2,{4,1,3,2}]]; -HFFSVFF=Temp1/2*((2D-4)MF00+(3-D)N00)/.D->4-2\[Epsilon]; -Help1=Flatten[TensorProduct[YsffC,Ysff],{{2},{3},{5},{6},{1,4}}] . Flatten[gvss,{2,3}]; -Temp1=-I Flatten[Help1,{{1,4},{5,2,3}}] . Flatten[gvff]//Tr[#]&//Simplify; -HSSFVFF=Temp1*(MF00); -Help1=TensorContract[HabIJF,{3,4}]//SparseArray; - -(* -Fermion-Vector - *) - -(*General nF modification*) -gvffnF=gvff . NFMat; -(***********) -Help1=Flatten[HabIJF,{{1},{2},{4,3}}] . Flatten[gvffnF,{2,3}]; -Temp1=6*I/3*Total[Flatten[Help1]Flatten[gvvv]]; -HFFFVVV=1/2(D-2)Temp1 MF00/.D->4-2\[Epsilon]; - -(*General nF modification*) -gvffnF=gvff . NFMat; -(***********) -Temp1=8*1/4Sum[Tr[gvffnF[[a]] . gvff[[b]] . gvff[[a]] . gvff[[b]]],{a,1,nv},{b,1,nv}]//Simplify//Expand; -HFFVVFF=1/8*(D-2)*(2*(4-D)*MF00+(D-6)N00)*Temp1/.D->4-2\[Epsilon]; -GabV=TensorContract[GabcdV,{{2,4}}]//SparseArray; - -(*General nF modification*) -HabIJFnF=HabIJF . NFMat; -(***********) -Temp1=-4*1/4*Tr[Flatten[GabV] . Flatten[HabIJFnF,{1,2}]]; -KGaugeFF=-1/2*Temp1*(D-2)*(2 MFM2P2+MF00+2(D-6)IF1p I2p I1p)/.D->4-2\[Epsilon]; - -(*General nF modification*) -HabIJFnF=HabIJF . NFMat; -(***********) -Help1=TensorContract[HabIJFnF,{3,4}]//SparseArray; -Temp1=-1*Flatten[Help1] . Flatten[Help1]; -KVVFFFF=Temp1/4*(4N2M2+(D-4)N00-4(6-D)IF1p^2 I2p)/.D->4-2\[Epsilon]; - -(*General nF modification*) -gvffNf=gvff . NFMat; -(***********) -Temp1=-1/2Sum[Tr[gvffNf[[a]] . gvff[[a]] . gvff[[b]] . gvff[[b]]],{a,1,nv},{b,1,nv}]//Simplify//Expand; -KFFFVVF=-(2-D)^2Temp1*(MF1M1+MF00+(IF1p-I1p)^2 IF2p)/.D->4-2\[Epsilon]; - - -(* -Vector-Scalar - *) - -Help1=Table[Tr[gvss[[a]] . gvss[[b]] . gvss[[c]]],{a,1,nv},{b,1,nv},{c,1,nv}]//SparseArray; -Temp1=-1*Total[Flatten[Help1]Flatten[gvvv]]; -HSSSVVV=5/8Temp1 M00; -Temp1=-Sum[Tr[gvss[[a]] . gvss[[b]] . gvss[[a]] . gvss[[b]]],{a,1,nv},{b,1,nv}]; -HSSVVSS=Temp1*5/8*M00; -Temp1=-1/2*Total[Flatten[HabijV]Flatten[HabijV]]; -EVVSS=1/4 D Temp1*M00; -Temp1=-1/2Total[Flatten[HabijV]Flatten[HabijV]]; -GSSVVS=-9/8*Temp1*M00; -GHelp=TensorContract[GabcdV,{2,4}]; -Temp1=1/2Total[Flatten[GHelp]Flatten[Hg]]; -KGaugeSS=Temp1/2*(2*(D-2)MP2M2-(D+2)/2M00-8(D-2)I1p^2 I2p); -KGaugeS=Temp1*(D-2)^2 I1p^2 I2p; -Temp1=-1/4Total[Flatten[Hg]Flatten[Hg]]; -KVVSSSS=Temp1*1/4*(4MP2M2-M00+4(D-6)I1p^2 I2p); -Temp1=-1/2Total[Flatten[\[CapitalLambda]g]Flatten[\[CapitalLambda]g]]; -JSSSVV=Temp1*(-D I1p^2 I2p+2 M00+1/2 I1p^2 I2p+D^2/2 I1p^2 I2p); - - -(* - Pure Vector -*) -Help1=Flatten[GabcdV,{{1},{3},{2,4}}] . Flatten[gvvv,{2,3}]; -Temp1=-2*Total[Flatten[Help1]Flatten[gvvv]]; -HGauge=SerEnergyHelp[(1/8*(5D-5-3/4)-1/16-1/32+3/16(D-1)*D-27/16*(D-1))*M00]*Temp1; -GHelp=TensorContract[GabcdV,{2,4}]; -Temp1=-Total[Flatten[GHelp]Flatten[GHelp]]; -KGauge=Temp1*SerEnergyHelp[1/4*((D-2)^2 MP2M2-((D+2)^2/4-4D)M00+(D-6)(D-2)^2 I1p^2 I2p)]; -KGhost=-1/8 M00*Temp1; - -(* -Fermion-Vector-Scalar - *) - -(*General nF modification*) -HabIJFnF=HabIJF . NFMat; -(***********) -HFab=TensorContract[HabIJFnF,{{3,4}}]; -Temp1=2*Total[Flatten[Hg]Flatten[HFab]]; -KVVFFSS=-1/2*Temp1*(MFM2P2-1/2 MF00+(D-6)I1p IF1p I2p); - - -(* - Counter-Terms - *) -Temp=1/2*\[Gamma]ij . \[Lambda]4; -\[Lambda]4Eff=\[Epsilon]*Z\[Lambda]ijkl; -I1Temp=1/3 T^4 \[Epsilon] Log[Glaisher]+1/72 T^4 \[Epsilon] Log[\[Mu]^2]-1/36 T^4 \[Epsilon] Log[4 \[Pi] T]+T^4/144; -VssZ=1/8* \[Epsilon]^-1 I1Temp*TensorContract[\[Lambda]4Eff,{{1,2},{3,4}}]; - -V2SV=I1p^2 (D+\[Xi]-1)/.\[Xi]->1; -V2SSV=-I1p^2 (2 \[Xi]+1)/.\[Xi]->1; -V2VV=1/2 (2 (I1p (D+\[Xi]-2)+I2M2p (-\[Xi])+I2M2p) (I1p ((D+\[Xi]-2)D -2 \[Xi]+2)+D I2M2p (\[Xi]-1)))/(D-1)/.\[Xi]->1; -V2VVV=-((3 (I1p^2 (2 (D-2) \[Xi]^2+ (4 D-11) \[Xi] D+ (2 D-3)D+11 \[Xi]-1)-2 D I2M2p^2 (\[Xi]-1)^2+4 I1p I2M2p (\[Xi]-1)^2))/(2 (D-1)))/.\[Xi]->1; -V2ggV=2 1/4 I1p^2 (\[Xi]+1)/.\[Xi]->1; -V2FFV=-(D-2) IF1p (2 I1p-IF1p)/.\[Xi]->1; -V2FFS=IF1p (IF1p-2 I1p); -VssvZ=1/4(-1)*2/4V2SSV*TensorContract[Zgvvss,{{1,2},{3,4}}]; -VvsZ=1/2*(-1)*2/4*V2SV*TensorContract[Zgvvss,{{1,2},{3,4}}]; -Temp=2Total[Flatten[Zgvvv]Flatten[gvvv]]; -VvvZ=1/4*\[Epsilon]^-1 V2VV*Temp; -VvvvZ=1/12*\[Epsilon]^-1 V2VVV*Temp; -VggvZ=1/4*\[Epsilon]^-1 V2ggV*Temp; -Temp=Flatten[ZYsij,{{1},{2,3}}] . Flatten[YsffC,{2,3}]+Flatten[Ysff,{{1},{2,3}}] . Flatten[ZYsijC,{2,3}]; -VFFsZ=1/2*\[Epsilon]^-1 V2FFS*Tr[Temp]; - -(*General nF modification*) -gvffnF=gvff . NFMat; -(*************************) -Temp=Transpose[Zgvff . Transpose[gvffnF,{2,1,3}]+gvffnF . Transpose[Zgvff,{2,1,3}],{1,3,2,4}]; -VFFvZ=1/2*\[Epsilon]^-1*V2FFV*Tr[Flatten[Temp,{{1,3},{2,4}}]]; - - - -(* - Contribution from Scalar Mass -*) -\[Lambda]Help=TensorContract[\[Lambda]4,{3,4}]; -V\[Mu]SS=Tr[\[Lambda]Help . \[Mu]ij]/4* I1p I2p*(-1); -V\[Mu]FFS=-2*1/2 IF1p I2p*Tr[Ysij . \[Mu]ij]*(-1); -V\[Mu]SV=-2/4*(D-1)*Tr[\[Mu]ij . \[CapitalLambda]g]I2p I1p*(-1); -VLOtoNLOCT=-1/2Tr[\[Beta]mij]/2*I1p*\[Epsilon]^-1*(-1); -VLOtoNNLO=-1/4Tr[\[Mu]ij . \[Mu]ij]*1/(16 (\[Pi]^2) ) Lb*(-1); - -ContriMass=VLOtoNNLO+ VLOtoNLOCT+V\[Mu]SS+V\[Mu]FFS+ V\[Mu]SV; - -(* - Contribution from Fermion Mass -*) -VLOtoNNLOF=1/2*Tr[\[Mu]IJ . \[Mu]IJC . \[Mu]IJ . \[Mu]IJC]*1/(16 (\[Pi]^2) ) Lf; - -(*Result*) -DiaCT=SerEnergyHelp[VssvZ+ VvsZ+ VssZ+ VvvZ+ VvvvZ+ VggvZ+ VFFsZ + VFFvZ]//Simplify; -DiaScalar\[Lambda]=SerEnergyHelp[LSSSS+ESSSS]//Simplify; -DiaScalarVector\[Lambda]=SerEnergyHelp[LSSVS+JSSVSS]//Simplify; -DiaYukawaScalar=SerEnergyHelp[KSSFFFF+KFFSFSF]//Simplify; -DiaYukawaScalar\[Lambda]=SerEnergyHelp[JSSFFS]//Simplify; -DiaYukawaVector=SerEnergyHelp[KSSSVFF+JSSFFV+KFFFSVF+HFFSVFF+HSSFVFF]//Simplify; -DiaFermionVector= SerEnergyHelp[ HFFFVVV+ HFFVVFF + KGaugeFF + KVVFFFF+ KFFFVVF]//Simplify; -DiaScalarVector=SerEnergyHelp[HSSSVVV+ EVVSS+ GSSVVS+ KGaugeSS+ KGaugeS+ KVVSSSS+ JSSSVV+ HSSVVSS]//Simplify; -DiaPureVector= SerEnergyHelp[HGauge+ KGauge+ KGhost]//Simplify; -DiaFermionScalarVector=SerEnergyHelp[KVVFFSS]//Simplify; -DiaFermionMass=VLOtoNNLOF; -DiaTot=VLOtoNNLOF+ContriMass+DiaCT+DiaFermionScalarVector+DiaPureVector+DiaScalarVector+DiaFermionVector+DiaYukawaVector+DiaYukawaScalar\[Lambda]+DiaScalar\[Lambda]+DiaScalarVector\[Lambda]+DiaYukawaScalar; - -AE=Series[DiaTot/.D->4-2\[Epsilon]/.\[Epsilon]bp->(1/\[Epsilon]+Lb)^-1/.\[Epsilon]b->(1/\[Epsilon]+Lbb)^-1/.\[Epsilon]BF->(1/\[Epsilon]+LBF)^-1/.\[Epsilon]F->(1/\[Epsilon]+LFF)^-1/.\[Epsilon]FB->(1/\[Epsilon]+LFB)^-1/.\[Epsilon]bbM->(1/\[Epsilon]+LbbM)^-1/.ReplaceLb,{\[Epsilon],0,0}]//Normal; - -ToExpression[StringReplace[ToString[StandardForm[Coefficient[Simplify[AE],\[Epsilon],0]]],"DRalgo`Private`"->""]] -]; - - - -(* - Finds the \[Epsilon]^0 coefficient of an expression -*) -SerEnergyHelp[optP_]:=Module[{opt=optP}, -HelpSE=Series[opt/.D->4-2\[Epsilon]/.\[Epsilon]bp->(1/\[Epsilon]+Lb)^-1/.\[Epsilon]b->(1/\[Epsilon]+Lbb)^-1/.\[Epsilon]BF->(1/\[Epsilon]+LBF)^-1/.\[Epsilon]F->(1/\[Epsilon]+LFF)^-1/.\[Epsilon]FB->(1/\[Epsilon]+LFB)^-1/.\[Epsilon]bbM->(1/\[Epsilon]+LbbM)^-1,{\[Epsilon],0,0}]//Normal; -Return[Coefficient[HelpSE//Normal//Expand,\[Epsilon],0]] -]; - - -(* - Prints the debye mass in the soft theory -*) -PrintDebyeMass[optP_]:=Module[{opt=optP}, - -If[verbose,Print["Printing Debye Masses"]]; - -VarGauge=Join[\[Mu]abDef//Normal//Variables]//DeleteDuplicates; - -\[Mu]ijp=\[Mu]abDef//Normal; -var=Normal[\[Mu]ijp]//Variables; -helpMass=Normal[\[Mu]ijp-\[Mu]ijVNLO]; -SolMassPre=Solve[helpMass==0,var]/.IdentMat//Flatten[#,1]&; -SolMass=SolMassPre; -If[optP=="All", -SolMass=SolMassPre/.xLO->1/.xNLO->1/.ReplaceLb//Simplify; -, -If[opt=="LO", -SolMass=SolMassPre/.xLO->1/.xNLO->0/.ReplaceLb//Simplify; -, -SolMass=SolMassPre/.xLO->0/.xNLO->1/.ReplaceLb//Simplify; -]; -]; - -(*Printing Result. May you find your worth in the waking world.*) -Return[ToExpression[StringReplace[ToString[StandardForm[Join[SolMass]]],"DRalgo`Private`"->""]]] -]; - - -(* - Identifies couplings and masses in the soft theory. -*) - -IdentifyTensorsDRalgo[]:=Module[{}, - -If[mode>=1, -If[verbose,Print["Calculating Quartic Tensor"]]; -(* - Scalar quartic couplings -*) -HelpList=DeleteDuplicates@Flatten[T(\[Lambda]4+\[Lambda]3D)]//Sort//Simplify; -HelpVarMod=RelationsBVariables3[HelpList]//ReplaceAll[#,\[Lambda]VL[v1_]->\[Lambda][v1]]&; -If[HelpList[[1]]==0&&Length[HelpList]>1, - HelpList=Delete[HelpList,1]; -]; -HelpSolveQuartic=Table[{HelpList[[a]]->HelpVarMod[[a]]},{a,1,HelpList//Length}]//Flatten//Simplify; -\[Lambda]3DS=T(\[Lambda]4+\[Lambda]3D)//SimplifySparse//Normal//ReplaceAll[#,HelpSolveQuartic]&//SparseArray; - - -If[Length[SparseArray[\[Lambda]3DS]["NonzeroValues"]]!=Length[SparseArray[\[Lambda]4]["NonzeroValues"]], -Print["Detected 1-loop Scalar Quartics not defined at tree-level"]; -Print["Please Check if you defined all couplings allowed by symmetry"]; -]; - -If[verbose,Print["Calculating Cubic Tensor "]]; - -(* - Scalar cubic couplings -*) -HelpList=DeleteDuplicates@SparseArray[Flatten@Simplify[T^(1/2) (\[Lambda]3CS+\[Lambda]3)]]//Sort//FullSimplify; -HelpVar=Table[cSS[a],{a,1,Delete[HelpList,1]//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveCubicS=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten//Simplify; -\[Lambda]3CSRed=T^(1/2) (\[Lambda]3CS+\[Lambda]3)//Normal//Simplify//FullSimplify//ReplaceAll[#,HelpSolveCubicS]&//SparseArray; - -If[Length[SparseArray[\[Lambda]3CSRed]["NonzeroValues"]]!=Length[SparseArray[\[Lambda]3]["NonzeroValues"]], -Print["Detected 1-loop Scalar Cubic not defined at tree-level"]; -Print["Please Check if you defined all couplings allowed by symmetry"]; -]; - -If[verbose,Print["Calculating Vector-Scalar Interaction Tensor "]]; -(* - Vector-scalar couplings -*) - -HelpList=DeleteDuplicates@Flatten@SimplifySparse[T (HabijV+GvvssT)]//Sort; -If[Length[Delete[HelpList,1]]<1,(*Fix for when the tensor is empty*) -\[Lambda]KVecT=T (HabijV+GvvssT)//SparseArray; -HelpSolveVecT={}; -, -HelpVarMod=RelationsBVariables3[HelpList]//ReplaceAll[#,\[Lambda]VL[v1_]->\[Lambda]VT[v1]]&; -HelpSolveVecT=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten//Simplify; -\[Lambda]KVecT=T (HabijV+GvvssT)//SimplifySparse//Normal//ReplaceAll[#,HelpSolveVecT]&//SparseArray; -]; - - - -(* - Temporal-scalar/scalar cross couplings -*) - -HelpList=DeleteDuplicates@Simplify@Flatten[-T(HabijV+GvvssL)]//Sort; -If[Length[Delete[HelpList,1]]<1, -\[Lambda]KVec=-T(HabijV+GvvssL)//Normal//Simplify//SparseArray; -HelpSolveVecL={}; -, -HelpVarMod=RelationsBVariables3[HelpList]; -HelpSolveVecL=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten//Simplify; -\[Lambda]KVec=-T(HabijV+GvvssL)//Normal//Simplify//ReplaceAll[#,HelpSolveVecL]&//SparseArray; -]; - - -If[verbose,Print["Calculating Temporal-Vector Quartics "]]; - -(* - Temporal-Scalar quartics -*) - -HelpList=DeleteDuplicates@SparseArray[Flatten@Simplify[T \[Lambda]AA]]//Sort//FullSimplify; -HelpVar=Table[\[Lambda]VLL[a],{a,1,Delete[HelpList,1]//Length}]; - -If[Length[HelpVar]<1, -HelpVar=\[Lambda]VLL[1]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveQuarticL={HelpList[[1]]->HelpVarMod}//Flatten; - - -\[Lambda]AAS=T \[Lambda]AA//Normal//Simplify//ReplaceAll[#,HelpSolveQuarticL]&//SparseArray; -, -HelpVarMod=RelationsBVariables3[HelpList]//ReplaceAll[#,\[Lambda]VL[v1_]->\[Lambda]VLL[v1]]&; -HelpSolveQuarticL=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten//Simplify; -\[Lambda]AAS=T \[Lambda]AA//Normal//FullSimplify//ReplaceAll[#,HelpSolveQuarticL]&//SparseArray; -]; - -(* - Temporal-Scalar/scalar cross cubic couplings -*) -HelpList=DeleteDuplicates@SparseArray[Flatten@Simplify[Sqrt[T] GvvsL]]//Sort//FullSimplify; -HelpVar=Table[\[Lambda]VVSL[a],{a,1,Delete[HelpList,1]//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveCubicL=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten//Simplify; -\[Lambda]vvsLS=Sqrt[T] GvvsL//Normal//Simplify//ReplaceAll[#,HelpSolveCubicL]&//SparseArray; - -]; - -If[mode>=3, -If[verbose,Print["Calculating Sextic Tensor"]]; - -(* - Scalar sextic couplings -*) -HelpList=DeleteDuplicates@Flatten[T^2 (\[Lambda]6+\[Lambda]6D)]//Sort//Simplify; -HelpVar=Table[ \[Lambda]6d[a],{a,1,Delete[HelpList,1]//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveSextic=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten; -\[Lambda]6DS=T^2 (\[Lambda]6+\[Lambda]6D)//Normal//Simplify//ReplaceAll[#,HelpSolveSextic]&//SparseArray; - -If[Length[SparseArray[\[Lambda]6DS]["NonzeroValues"]]!=Length[SparseArray[\[Lambda]6]["NonzeroValues"]], -Print["Detected 1-loop Scalar Sextic not defined at tree-level"]; -Print["Please Check if you defined all couplings allowed by symmetry"]; -]; -]; - -(* - Debye masses -*); -If[mode>=2, -HelpList=DeleteDuplicates@FullSimplify[Flatten[ xLO aV3D+ xNLO \[Mu]VabNLO]]//Sort; -HelpVar=Table[ \[Mu]ijV[a],{a,1,Delete[HelpList,1]//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveVectorMass=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten; -\[Mu]ijVNLO=Coefficient[ xLO aV3D+ xNLO \[Mu]VabNLO//Normal//FullSimplify//ReplaceAll[#,HelpSolveVectorMass]&,\[Epsilon],0]//SparseArray; -, -HelpList=DeleteDuplicates@FullSimplify[Flatten[ xLO aV3D]]//Sort; -HelpVar=Table[ \[Mu]ijV[a],{a,1,Delete[HelpList,1]//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveVectorMass=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten; -\[Mu]ijVNLO= xLO aV3D//Normal//FullSimplify//ReplaceAll[#,HelpSolveVectorMass]&//SparseArray; -]; - - -If[DiagonalMatrixQAE[Normal[\[Mu]ijVNLO]]==False,Print["Off-Diagonal Debye Matrices Detected"]]; - -(* - Scalar masses -*) -If[mode>=2, -RGRunningHardToSoft[]; (*Runs from the hard to the soft scale in the effective theory*) -HelpList=DeleteDuplicates@Flatten@Simplify[ xLO aS3D+xNLO (\[Mu]SijNLO+Contri\[Beta]SoftToHard)]//Sort; -HelpVar=Table[ \[Mu]ijS[a],{a,1,Delete[HelpList,1]//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveMass=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten; -\[Mu]ijSNLO=xLO aS3D+xNLO (\[Mu]SijNLO+Contri\[Beta]SoftToHard)//Normal//Simplify//ReplaceAll[#,HelpSolveMass]&//SparseArray; -, -HelpList=DeleteDuplicates@Flatten@Simplify[ xLO aS3D]//Sort; -HelpVar=Table[ \[Mu]ijS[a],{a,1,Delete[HelpList,1]//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveMass=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten; -\[Mu]ijSNLO=xLO aS3D//Normal//Simplify//ReplaceAll[#,HelpSolveMass]&//SparseArray; -]; - -(* - Scalar tadpoles -*) -If[mode>=2, -HelpList=DeleteDuplicates@Flatten@Simplify[ xLO*T^(-1/2)(\[Lambda]1+TadPoleLO)+xNLO(TadPoleNLO*T^(-1/2) +ContriTadPoleSoftToHard)]//Sort; -HelpVar=Table[ dS[a],{a,1,Delete[HelpList,1]//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveTadpole=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten; -TadPoleS=xLO*T^(-1/2) (\[Lambda]1+TadPoleLO)+xNLO (TadPoleNLO*T^(-1/2)+ContriTadPoleSoftToHard)//Normal//Simplify//ReplaceAll[#,HelpSolveTadpole]&//SparseArray; -, -HelpList=DeleteDuplicates@Flatten@Simplify[ xLO*T^(-1/2)(\[Lambda]1+TadPoleLO)]//Sort; -HelpVar=Table[ dS[a],{a,1,Delete[HelpList,1]//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveTadpole=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten; -TadPoleS=xLO T^(-1/2) (\[Lambda]1+TadPoleLO)//Normal//Simplify//ReplaceAll[#,HelpSolveTadpole]&//SparseArray; -]; - -If[Length[SparseArray[TadPoleS]["NonzeroValues"]]!=Length[SparseArray[\[Lambda]1]["NonzeroValues"]], -Print["Detected 1-loop Scalar Tadpoles not defined at tree-level"]; -Print["Please Check if you defined all couplings allowed by symmetry"]; -]; - -If[mode>=1, -IdentMat=List/@Join[HelpSolveCubicS,HelpSolveVecT,HelpSolveVecL,HelpSolveQuarticL,HelpSolveVectorMass,HelpSolveMass,HelpSolveCubicL,HelpSolveTadpole,HelpSolveQuartic]/.{b_->a_}:>a->b//Flatten[#,1]&; -, -IdentMat=List/@Join[HelpSolveVectorMass,HelpSolveMass]/.{b_->a_}:>a->b//Flatten[#,1]&; -]; -If[mode>=3, -IdentMatEff=List/@Join[HelpSolveSextic]/.{b_->a_}:>a->b//Flatten[#,1]&; -]; -]; - - -{HelpSolveVecLPrint}; - - -(* - Prints temporal couplings -*) -PrintTemporalScalarCouplings[]:=Module[{}, -If[verbose, -Print["Printing Temporal vector Couplings"]; -Print["\[Lambda]VLL[a] are \!\(\*SuperscriptBox[\(V\), \(4\)]\) Couplings. \[Lambda]vvsLS[a] Are \!\(\*SuperscriptBox[\(V\), \(2\)]\)S Couplings. \[Lambda]VL[a] are \!\(\*SuperscriptBox[\(V\), \(2\)]\)\!\(\*SuperscriptBox[\(S\), \(2\)]\) Couplings "]; -]; -(* -Block[{Print}, - DimRedTensors= PrintTensorDRalgo[]; -]; -*) - -(*Quartics*) -AE2=\[Lambda]AAS//Normal//Variables; -AE=ToExpression[StringReplace[ToString[StandardForm[AE2]],"DRalgo`Private`"->""]]; -QuarticL=#->(ReplaceAll[#,PrintIdentification[]])&/@AE; - - -(*Cubics*) -AE2=\[Lambda]vvsLS//Normal//Variables; -AE=ToExpression[StringReplace[ToString[StandardForm[AE2]],"DRalgo`Private`"->""]]; -CubicsL=#->(ReplaceAll[#,PrintIdentification[]])&/@AE; - -(*S^2V^2 (temporal)*) -AE2=\[Lambda]KVec//Normal//Variables; -AE=ToExpression[StringReplace[ToString[StandardForm[AE2]],"DRalgo`Private`"->""]]; -QuarticT=#->(ReplaceAll[#,PrintIdentification[]])&/@AE; - - - -TemporalCouplings=Join[QuarticL,CubicsL,QuarticT]//Flatten; -ToExpression[StringReplace[ToString[StandardForm[TemporalCouplings]],"DRalgo`Private`"->""]] -]; - - -PrintTensorDRalgo[]:=Module[{}, -Print["Order of Tensors: (1) Scalar Quartic, (2) Vector-Scalar Couplings, (3) Temporal-Vector Scalar Couplings, (4) Temporal-Vector Quartics, (5) Temporal-Vector Mass, (6) Scalar Mass, (7) Scalar Cubics, (8) Temporal Vector-Scalar Cubics, (9) Tadpoles"]; - -ToExpression[StringReplace[ToString[StandardForm[Join[\[Lambda]3DS,\[Lambda]KVecT,\[Lambda]KVec,\[Lambda]AAS,\[Mu]ijVNLO,\[Mu]ijSNLO,\[Lambda]3CSRed,\[Lambda]vvsLS,TadPoleS]]],"DRalgo`Private`"->""]] -]; - - -(* - Creates tensors used in intermediate steps -*) -CreateHelpTensors[]:=Module[{}, -(*Ahh, you were at my side, all along... My true mentor... My guiding moonlight...*) -If[verbose,Print["Creating Help Tensors"]]; - -Habij=Transpose[Activate @ TensorContract[ - Inactive[TensorProduct][gvss,gvss], { {3, 5}}],{1,3,2,4}]//SimplifySparse//SparseArray; - -Hg=TensorContract[Habij,{{3,4}}]//SimplifySparse; -\[CapitalLambda]g=TensorContract[Habij,{{1,2}}]//SimplifySparse; - -HabijV=Habij+Transpose[Habij,{2,1,3,4}]//SparseArray//SimplifySparse; -GabcdV=gvvv . gvvv//SparseArray//SimplifySparse; -HabIJF=Transpose[Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][gvff,gvff], {{3, 5}}]],{1,3,2,4}]//SparseArray//SimplifySparse; -Ysij=Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][Ysff,YsffC], {{2, 5},{3,6}}]]//SparseArray//SimplifySparse; -YsijC=Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][YsffC,Ysff], {{2, 5},{3,6}}]]//SparseArray//SimplifySparse; - -If[mode>=1, -\[CapitalLambda]\[Lambda] =Flatten[\[Lambda]4,{{1},{2},{3,4}}] . Flatten[\[Lambda]4,{1,2}]//SparseArray//SimplifySparse; -YTemp=Transpose[Transpose[Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][Ysff,YsffC], {{3, 5}}]],{1,3,2,4}],{1,2,4,3}]//SparseArray//SimplifySparse; -YTempC=Transpose[Transpose[Simplify[ Activate @ TensorContract[ - Inactive[TensorProduct][YsffC,Ysff], {{3, 5}}]],{1,3,2,4}],{1,2,4,3}]//SparseArray//SimplifySparse; -Yhelp=Flatten[YTemp,{{1},{2},{3,4}}] . Flatten[YTemp,{4,3}]//SparseArray//SimplifySparse; - -YhelpC=Flatten[YTempC,{{1},{2},{3,4}}] . Flatten[YTempC,{4,3}]//SparseArray//SimplifySparse; -]; - - -]; - - -(* - Trick to simplify tensors because Mathematica 13 sucks. -*) -SimplifySparse[s_SparseArray] := With[ - { - elem =Simplify[s["NonzeroValues"]], - pos=s["NonzeroPositions"], - dim = Dimensions[s] - }, -SparseArray[pos->elem,dim,0] - ] - - - -(* - Finds relations between parameters in two different basis. -*) -CompareInvariants[Tens1I_,Tens2I_]:=Module[{Tens1P=Tens1I,Tens2P=Tens2I}, -Sol1=Flatten[Tens1P,{{3},{4},{1,2}}] . Flatten[Tens1P,{{1,2}}]//Normal; -Sol2=Flatten[Tens2P,{{3},{4},{1,2}}] . Flatten[Tens2P,{{1,2}}]//Normal//ReplaceAll[#,PrintIdentification[]]&; - -dimHelp=Dimensions[Tens1P]; - -If[dimHelp[[1]]==dimHelp[[2]], -Sol3=TensorContract[Tens1P,{1,2}]//Normal; -Sol4=TensorContract[Tens2P,{1,2}]//Normal//ReplaceAll[#,PrintIdentification[]]&; -Sol5=Activate@TensorContract[Inactive@TensorProduct[Tens1P,Tens1P,Tens1P],{{2,5},{6,9},{10,1}}]//Normal; -Sol6=Activate@TensorContract[Inactive@TensorProduct[Tens2P,Tens2P,Tens2P],{{2,5},{6,9},{10,1}}]//Normal//ReplaceAll[#,PrintIdentification[]]&; - -SolInvariants=Solve[Sol1==Sol2&&Sol3==Sol4&&Sol5==Sol6,Sol5//Variables][[1]]; -, -SolInvariants=Solve[Sol1==Sol2,Sol1//Variables][[1]]; -]; -Return[SolInvariants] - -]; - - -(* - Prints Counterterms of 4d couplings and masses. -*) -CounterTerms4D[]:=Module[{}, -If[verbose,Print["Finding \[Beta]-functions"]]; -CounterTerm[]; - - -(*To make the comparisons easier*) -VarGauge=GaugeCouplingNames//Variables; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->c,{c,VarGauge}]; - -(* - Gauge couplings -*) -(*Anomalous-dimension contributions*) - -A1=TensorContract[\[Beta]vvss//Normal,{{3,4}}]; -A2=TensorContract[HabijV,{{3,4}}]//Normal//ReplaceAll[#,SubGauge]&; -(*Trick to avoid problems when kinetic mixing*) -A1=DiagonalMatrix[Diagonal[A1]]; -A2=DiagonalMatrix[Diagonal[A2]]; -(*end of trick*) -Var3D=VarGauge//ReplaceAll[#,SubGauge]&//Variables; -RepVar3D=#->Sqrt[#]&/@Var3D; -A2Mod=A2/.RepVar3D; - -Sol1=Solve[A2Mod==A1,Var3D]//Flatten[#,1]&//FullSimplify; -ResGauge=Table[List[Sol1[[c]]]/.{b_->a_}:>b^2->a,{c,1,Length[Sol1]}]/.SubGauge2; - -(* - Non-abelian couplings -*) - -GabcdTemp=(\[Beta]gvvv . gvvv+gvvv . \[Beta]gvvv)//SparseArray; -GabVTree=TensorContract[GabcdV,{{2,3}}]//Normal; -GabVLoop=TensorContract[GabcdTemp,{{2,3}}]//Normal; - -A1=GabVLoop//Normal; -A2=GabVTree//Normal//ReplaceAll[#,SubGauge]&; -Var3D=A2//Variables; -RepVar3D=#->Sqrt[#]&/@Var3D; -A2Mod=A2/.RepVar3D; -Sol1=Solve[A2Mod==A1,Var3D]//Flatten[#,1]&//FullSimplify; -ResGaugeNA=Table[List[Sol1[[c]]]/.{b_->a_}:>b^2->a,{c,1,Length[Sol1]}]/.SubGauge2//Simplify; - - -(* - Scalar-quartic couplings -*) - -VarGauge=Join[\[Lambda]4//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->c,{c,VarGauge}]; - - -HelpList=DeleteDuplicates@Flatten@SimplifySparse[\[Beta]\[Lambda]ijkl]//Sort; -HelpVarMod=RelationsBVariables3[HelpList]//ReplaceAll[#,\[Lambda]VL[v1_]->\[Lambda]Beta[v1]]&; -If[HelpList[[1]]==0&&Length[HelpList]>1, - HelpList=Delete[HelpList,1]; -]; -HelpSolve\[Beta]=Table[{HelpList[[a]]->HelpVarMod[[a]]},{a,1,HelpList//Length}]//Flatten//Simplify; -HelpSolve\[Beta]2=Table[{HelpVarMod[[a]]->HelpList[[a]]},{a,1,HelpList//Length}]//Flatten//Simplify; -\[Lambda]4\[Beta]=\[Beta]\[Lambda]ijkl//SimplifySparse//Normal//ReplaceAll[#,HelpSolve\[Beta]]&//SparseArray; - -\[Lambda]4p=\[Lambda]4//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Lambda]4\[Beta]-\[Lambda]4p//Normal; -QuarticVar=\[Lambda]4p//Normal//Variables; -ResScalp=Reduce[SolVar==0,QuarticVar]//ToRules[#]&; -SolveTemp=QuarticVar/.ResScalp; -ResScal=Table[{QuarticVar[[i]]->SolveTemp[[i]]},{i,1,Length@QuarticVar}]/.SubGauge2//Flatten[#,1]&//ReplaceAll[#,HelpSolve\[Beta]2]&//Simplify; - -(* - Scalar-cubic couplings -*) -VarGauge=Join[\[Lambda]3//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->c,{c,VarGauge}]; - -\[Lambda]3p=\[Lambda]3//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Beta]\[Lambda]ijk-\[Lambda]3p//Normal; -CubicVar=\[Lambda]3p//Normal//Variables; -ResCubic=Solve[SolVar==0,CubicVar]/.SubGauge2//Flatten[#,1]&; - -(* - Yukawa couplings -*) -VarGauge=Join[Ysff//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->c,{c,VarGauge}]; - -\[Lambda]4p=Ysff//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Beta]Ysij-\[Lambda]4p//Normal; -QuarticVar=\[Lambda]4p//Normal//Variables; -ResYuk=Solve[SolVar==0,QuarticVar]/.SubGauge2//Flatten[#,1]&; - - - -(* - Scalar masses -*) - -VarGauge=Join[\[Mu]ij//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->c,{c,VarGauge}]; - -\[Lambda]4p=\[Mu]ij//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Beta]mij-\[Lambda]4p//Normal; -QuarticVar=\[Lambda]4p//Normal//Variables; -ResMass=Solve[SolVar==0,QuarticVar]/.SubGauge2//Flatten[#,1]&; - -(* - Fermion masses -*) - -VarGauge=Join[\[Mu]IJF//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->c,{c,VarGauge}]; - -\[Lambda]4p=\[Mu]IJF//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Beta]\[Mu]IJF-\[Lambda]4p//Normal; -QuarticVar=\[Lambda]4p//Normal//Variables; -ResMassF=Solve[SolVar==0,QuarticVar]/.SubGauge2//Flatten[#,1]&; - - - -(* - Scalar tadpoles -*) -(*Scalar Mass insertion*) -Contri4=1/2*I2p*Activate@TensorContract[Inactive@TensorProduct[\[Lambda]3,\[Mu]ij],{{2,4},{3,5}}]; - - -(*Fermion Mass insertion*) -VarGauge=Join[\[Lambda]1//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->c,{c,VarGauge}]; - -\[Lambda]4p=\[Lambda]1//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Beta]\[Lambda]1-\[Lambda]4p//Normal; -QuarticVar=\[Lambda]4p//Normal//Variables; -ResTadpole=Solve[SolVar==0,QuarticVar]/.SubGauge2//Flatten[#,1]&; - -(*Effective couplings*) -If[mode>=3, - -(* - Scalar-cubic couplings -*) - -VarGauge=Join[\[Lambda]6//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->c,{c,VarGauge}]; - -\[Lambda]6p=\[Lambda]6//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Beta]\[Lambda]6ijklnm-\[Lambda]6p//Normal; -SexticVar=\[Lambda]6p//Normal//Variables; -ResSextic=Solve[SolVar==0,SexticVar]/.SubGauge2//Flatten[#,1]&; - - - -(*Printing Result*) -PrintPre=Join[ResGauge,ResGaugeNA,ResScal,ResCubic,ResYuk,ResMass,ResMassF,ResTadpole,ResSextic]//Normal//FullSimplify//DeleteDuplicates; -, -(*Printing Result*) -PrintPre=Join[ResGauge,ResGaugeNA,ResScal,ResCubic,ResYuk,ResMass,ResMassF,ResTadpole]//Normal//FullSimplify//DeleteDuplicates; -]; - -PrintPre=ReplaceAll[PrintPre,(a_->b_):>a->b/(2 \[Epsilon])]; -ToExpression[StringReplace[ToString[StandardForm[PrintPre]],"DRalgo`Private`"->""]] - -]; diff --git a/DRalgo/ModelCreation.m b/DRalgo/ModelCreation.m deleted file mode 100644 index 6a7b9a7..0000000 --- a/DRalgo/ModelCreation.m +++ /dev/null @@ -1,688 +0,0 @@ -(* ::Package:: *) - -(* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *) - -(* :Title: ModelCreation *) - -(* - This software is covered by the GNU General Public License 3. - Copyright (C) 2021-2022 - Andreas Ekstedt, - Philipp Schicho, - Tuomas V.I. Tenkanen -*) - -(* :Summary: Creating models from model file. *) - -(*This file uses functions from GroupMath. A citation to arXiv:2011.01764 should*) -(*be used if any of these functions are used.*) -(* ------------------------------------------------------------------------ *) - - -(* - This module creates representation matrices for the gauge sector. Other coupling tensors are allocated as zero-tensors. -*) -AllocateTensors[GroupI_,RepNameI_,CouplingNameI_,FermionRepI_,ScalarRepI_]:=Module[{GroupP=GroupI,RepNameP=RepNameI,CouplingNameP=CouplingNameI,FermionRepP=FermionRepI,ScalarRepP=ScalarRepI}, -Clear[a,b,c,d]; -Needs["GroupMath`"]; -GroupMathCleared=False; - -GroupP=ToGM[GroupP]; (*Converts the Group from DR input to GroupMath input*) -gen=RepMatrices[GroupP,RepNameP]; (*The representation matrices*) - -SizeGroups= Quiet[Table[Length[RepMatrices[GroupP[[i]],RepNameP[[i]]]],{i,1,Length[GroupP]}]]; (*The number of components for each group*) -SizeGroupsMod=SizeGroups//ReplaceAll[#,0->1]&; (*Fix for U1 groups*) -TotalComponents=Total[SizeGroupsMod]; (**) -GaugeIndices=ConstantArray[0,{Length[GroupP]}]; (*Position of every gauge rep*) - - -GaugeIndices[[1]]=1;;SizeGroupsMod[[1]]; -Do[ -helpInd=GaugeIndices[[i-1]]/.(a_;;b_)-> b; -GaugeIndices[[i]]=(helpInd+1);;(helpInd+SizeGroupsMod[[i]]); -,{i,2,Length[GroupP]} -]; - - -(*Create coupling matrix. This matrix contains the name of coupling constants, and incorporates correct normalization of generators*) -(*This normalization is required when finding structure constants through commutation relations*) -Components=ConstantArray[0,Length[GroupP]+1]; -Components[[1]]=1; -Do[ -Components[[i]]=Components[[i-1]]+SizeGroupsMod[[i-1]] -, -{i,2,Length[GroupP]+1} -]; - -Do[ -Components[[i]]=Components[[i-1]]+SizeGroupsMod[[i-1]] -, -{i,2,Length[GroupP]+1} -]; - - -CouplingArray=ConstantArray[0,{TotalComponents,TotalComponents}]; -Do[ -(*Multiplies the relevant copupling-constant for each group*) -CouplingArray[[Components[[i]];;Components[[i+1]]-1,Components[[i]];;Components[[i+1]]-1]]=CouplingNameP[[i]]*IdentityMatrix[SizeGroupsMod[[i]]]; -, -{i,1,Length[GroupP]} -]; -(*Structure constants*) -Temp=I GaugeRep[GroupP]//SparseArray; -fabc=Table[ Temp[[a]] CouplingArray[[a,a]],{a,1,TotalComponents}]//SparseArray; - -(*Fix for non-numerical U1s*) -PosU1=Position[GroupP,{}]//Flatten[#]&; -PosU1Components=ConstantArray[0,Length[PosU1]]; -Do[ -PosU1Components[[i-PosU1[[1]]+1]]=Total[SizeGroupsMod[[1;;i]]]; -,{i,PosU1}]; - -ChargeU1F=ConstantArray[0,{Length[FermionRepP],Length[GroupP]}]; -Do[ -Do[ -If[NumericQ[FermionRepP[[j]][[1]][[i]]]==False, -ChargeU1F[[j,i]]=FermionRepP[[j]][[1]][[i]]; -FermionRepP[[j]][[1]][[i]]=1; -] -,{i,PosU1}],{j,1,Length[FermionRepP]}]; - -(********************) - - -(*Fermion Reps*) -If[Length[FermionRepP]<1, -gvffP=SparseArray[{{1,1,1}->0},{TotalComponents,1,1}]//SparseArray; -, -gvffP=FermionRep[GroupP,FermionRepP[[1]]]; -(*Arbitrary U1 charges*) -Do[ -If[NumericQ[ChargeU1F[[1]][[i]]]==False, -h=PosU1Components[[i+1-PosU1[[1]]]]; -gvffP[[h]]=gvffP[[h]]*ChargeU1F[[1,i]]; -] -,{i,PosU1}]; -(*********************) - -If[Length[FermionRepP]>1, -Do[ -Temp=FermionRep[GroupP,FermionRepP[[i]]]; - -(*Arbitrary U1 charges*) -Do[ -If[NumericQ[ChargeU1F[[i,j]]]==False, -h=PosU1Components[[j+1-PosU1[[1]]]]; -Temp[[h]]=Temp[[h]]*ChargeU1F[[i,j]]; -] -,{j,PosU1}]; -(*********************) - - -gvffTemp=Table[ArrayFlatten[{{gvffP[[a]],0},{0,Temp[[a]]}}],{a,1,Length[gvffP]}];(*Stacks all fermions on the diagonal*) -gvffP=gvffTemp; -, -{i,2,Length[FermionRepP]}] - -]; - -]; - -CouplingArray=ConstantArray[0,{TotalComponents,TotalComponents}]; (*Only contains coupling constants. No Dynkin index as generators are properly normalized*) -Do[ -CouplingArray[[Components[[i]];;Components[[i+1]]-1,Components[[i]];;Components[[i+1]]-1]]=CouplingNameP[[i]]IdentityMatrix[SizeGroupsMod[[i]]]; -, -{i,1,Length[GroupP]} -]; -gvffTemp=Table[CouplingArray[[a,a]]gvffP[[a]],{a,1,Length[gvffP]}]; -gvffP=gvffTemp; - - -(*Scalar Reps*) -ChargeU1=ConstantArray[0,{Length[ScalarRepP],Length[GroupP]}]; -Do[ -Do[ -If[NumericQ[ScalarRepP[[j]][[1]][[i]]]==False, -ChargeU1[[j,i]]=ScalarRepP[[j]][[1]][[i]]; -ScalarRepP[[j]][[1]][[i]]=1; -] -,{i,PosU1}],{j,1,Length[ScalarRepP]}]; -(*The above takes care of cases with arbitrary U1 charges*) - -If[Length[ScalarRepP]<1, -gvssP=SparseArray[{{1,1,1}->0},{TotalComponents,1,1}]//SparseArray; -, - -gvssP=ScalarRepCreation[GroupP,ScalarRepP[[1]]]; -(*Arbitrary U1 charges*) -Do[ -If[NumericQ[ChargeU1[[1]][[i]]]==False, -h=PosU1Components[[i+1-PosU1[[1]]]]; -gvssP[[h]]=gvssP[[h]]*ChargeU1[[1,i]]; -] -,{i,PosU1}]; -(*********************) -(*********************) - -If[Length[ScalarRepP]>1, -Do[ -Temp=ScalarRepCreation[GroupP,ScalarRepP[[i]]]; - -(*********************) -(*Arbitrary U1 charges*) -Do[ -If[NumericQ[ChargeU1[[i]][[j]]]==False, -h=PosU1Components[[j+1-PosU1[[1]]]]; -Temp[[h]]=Temp[[h]]*ChargeU1[[i,j]]; -] -,{j,PosU1}]; -(*********************) - - -gvssTemp=Table[ArrayFlatten[{{gvssP[[a]],0},{0,Temp[[a]]}}],{a,1,Length[gvssP]}]; (*Stack scalar reps on the diagonal*) -gvssP=gvssTemp; -, -{i,2,Length[ScalarRepP]}] - -]; -]; - -gvssTemp=Table[CouplingArray[[a,a]]gvssP[[a]],{a,1,Length[gvssP]}]; -gvssP=gvssTemp//SparseArray; - -(* Creates All tensors*) -(*By default all tensors barring gauge ones are empty*) -nsP=Length[gvssP[[1]]]; -nvP=Length[fabc]; -nfP=Length[gvffP[[1]]]; -\[Lambda]1P=EmptyArray[{nsP}]; -\[Lambda]3P=EmptyArray[{nsP,nsP,nsP}]; -\[Lambda]4P=EmptyArray[{nsP,nsP,nsP,nsP}]; -\[Mu]ijP=EmptyArray[{nsP,nsP}]; -\[Mu]IJCP=EmptyArray[{nfP,nfP}]; -\[Mu]IJP=EmptyArray[{nfP,nfP}]; -YsffP=EmptyArray[{nsP,nfP,nfP}]; -YsffCP=EmptyArray[{nsP,nfP,nfP}]; -(* Returns*) - -(*Creates variables for constructing invariants. Basically naming all components*) -CreateScalarComponents[GroupP,ScalarRepP]; -CreateFermionComponents[GroupP,FermionRepP]; - - - -GaugeCouplingNames=CouplingNameI; - -Return[Join[{fabc//SparseArray//SimplifySparse,gvffP//SparseArray//SimplifySparse,gvssP//SparseArray//SimplifySparse,\[Lambda]1P//SparseArray,\[Lambda]3P//SparseArray,\[Lambda]4P//SparseArray,\[Mu]ijP//SparseArray,\[Mu]IJP//SparseArray,\[Mu]IJCP//SparseArray,YsffP//SparseArray,YsffCP//SparseArray}]]; -]; - - -{GaugeCouplingNames}; - - -(* - Creates representation matrices for scalars. It is possible for the representation to be either real or complex. -*) -ScalarRepCreation[GroupI_,ScalarRepI_]:=Module[{GroupP=GroupI,ScalarRepP=ScalarRepI}, -Temp=RepMatrices[GroupP,ScalarRepP[[1]]]; -If[ScalarRepP[[2]]=="C", -(*For complex representations we need to rewrite everything in a real basis*) -help=- Table[{{Im[Temp[[a]]],Re[Temp[[a]]]},{-Re[Temp[[a]]],Im[Temp[[a]]]}}//ArrayFlatten,{a,1,Length[Temp]}]//ArrayFlatten; -, - (*By default real representation matrices are not anti-symmetric. So we need to change basis*) -U=RotationToRealBasis[GroupP,ScalarRepP[[1]]]; -help= I U . # . ConjugateTranspose[U]&/@Temp; - -]; -Return[help] -]; - - -GradH[f_,x_List?VectorQ]:=D[f,{x}]; - - -(* - Creates representation matrices for fermions. It is possible for the representation to be either left- or right-handed. -*) -FermionRep[GroupI_,FermionRepI_]:=Module[{GroupP=GroupI,FermionRepP=FermionRepI}, -If[FermionRepP[[2]]=="L", - help=RepMatrices[GroupP,FermionRepP[[1]]]; (*No change for left-handed fermions*) -, - help=-Conjugate[RepMatrices[GroupP,FermionRepP[[1]]]]; (*Right-handed matrices are charge-conjugated*) -]; -Return[help] -]; - - -(* - Redunant module. This should be removed. -*) -RotateToAdjBasis[GroupI_,ScalarRepI_]:=Module[{GroupP=GroupI,ScalarRepP=ScalarRepI}, -(*This Module maps components from a real basis to the adjoint basis defined by gvss=gvvv*) -(*This mapping is a similarity transformation*) -(*This Module is no longer necessary. Should probably delete it eventually.*) -posGroup=FirstPosition[ScalarRepP, _?(# != 0 &)][[1]]; (*Only simple adjoint reps are allowed*) -OrigRep=RepMatrices[GroupP[[posGroup]],ScalarRepP[[posGroup]]]//ArrayFlatten[#]&//Normal; (*This is the standard rep from GroupMath.*) - -PreFacHelp=DynkinIndex[GroupP[[posGroup]],ScalarRepP[[posGroup]]]; (*Normalization for structure constants*) -fabc=-I PreFacHelp^-1 Table[Tr[(b . c-c . b) . a],{a,OrigRep},{b,OrigRep},{c, OrigRep}]//SparseArray; - -U=RotationToRealBasis[GroupP,ScalarRepP]; (*Rotation matrix from OrigRep to a real basis*) - -(*Choose to find the transformation, for simplicity, via a diagonal matrix.*) -Do[ -If[DiagonalMatrixQAE[OrigRep[[i]]]==True, -RefMat=OrigRep[[i]]//Normal; -AdjMat=fabc[[i]]//Normal; -Break[]; -]; -,{i,1,Length[OrigRep]}]; - -ListHelp=Array[a[##]&,Length[RefMat]]; -U2=DiagonalMatrix[ListHelp]; (**) -E1=U2 . Normalize/@Eigenvectors[AdjMat]; (*The diagonalization matrix is only defined up to a diagonal U(1) matrix*) -E2=Normalize/@Eigenvectors[RefMat]; -ETot=ConjugateTranspose[E1] . E2; (*This matrix maps from fabc to OrigRep up to a U(1) tf*) - -SolveFac=-I ConjugateTranspose[ETot] . # . ETot&/@fabc;(*We now choose U2 to ensure that this is a similarity tf*) -solU=FindInstance[Normal[SolveFac]== Normal[OrigRep],ListHelp][[1]]; -EFinal=ETot/.solU; (*Complete tf from fabc to OrigRep*) - -P=U . ConjugateTranspose[EFinal];(*This is the tf that maps from the real basis to the adjoint basis defined by fabc*) -Return[P] -]; - - -{ScalarVariablesIndices,GaugeIndices}; - - -PrintGaugeRepPositions[]:=Module[{}, -Return[GaugeIndices] -]; - - -PrintFermionRepPositions[]:=Module[{}, -Return[FermionVariablesIndices] -]; - - -PrintScalarRepPositions[]:=Module[{}, -Return[ScalarVariablesIndices] -]; - - -(* - This Module names all scalar components. -*) -CreateScalarComponents[GroupI_,ScalarRepI_]:=Module[{GroupP=GroupI,ScalarRepP=ScalarRepI}, - -GroupHelp=DeleteCases[GroupP,{}]; (*Removes all U1 factors since they don't have individual components*) -PosU1=Position[GroupP,{}];(*Position of all U1:s*) -ScalarComponents=ConstantArray[0,{Length[ScalarRepP]}];(*Contains all subsitution rules*) -ScalarComponentsC=ConstantArray[0,{Length[ScalarRepP]}];(*Conjugated components*) -ScalarVariables=ConstantArray[0,{Length[ScalarRepP]}]; (*Names of all components*) -ScalarVariablesIndices=ConstantArray[0,{Length[ScalarRepP]}]; (*Position of every scalar rep*); - -Do[ -SizeRep=DimR[GroupHelp,ScalarRepP[[i]][[1]]//Delete[#,PosU1]&]; -(*By default GroupMath creates invariants with names a[x], b[x], ...*) -If[ScalarRepP[[i]][[2]]=="C", -(*\[Phi] are real components and \[Psi] ar the imagionary ones*) -ScalarComponents[[i]]=Array[a[##]->1/Sqrt[2]Symbol[ToString[\[Phi]]<>ToString[i]][##]+I 1/Sqrt[2] Symbol[ToString[\[Psi]]<>ToString[i]][##]&,SizeRep]//Flatten[#]&; -ScalarComponentsC[[i]]=Array[a[##]->1/Sqrt[2] Symbol[ ToString[\[Phi]]<>ToString[i]][##]-I 1/Sqrt[2] Symbol[ToString[\[Psi]]<>ToString[i]][##]&,SizeRep]//Flatten[#]&; -ScalarVariables[[i]]={#}&/@Flatten[ScalarComponents[[i]]]/.{a_->b_}->b//Variables; -If[i==1, -ScalarVariablesIndices[[i]]=1;;(Length[ScalarVariables[[i]]]); -, -helpInd=ScalarVariablesIndices[[i-1]]/.(a_;;b_)-> b; -ScalarVariablesIndices[[i]]=(helpInd+1);;(helpInd+Length[ScalarVariables[[i]]]); -]; -, -(*For a real rep we need to rotate it to a real basis*) -If[ScalarRepP[[i]][[2]]=="R", -RotMat=RotationToRealBasis[GroupP,ScalarRepP[[i]][[1]]]; (*Maps to a real basis*) -Components=Array[Symbol[ToString[\[Phi]]<>ToString[i]][##]&,SizeRep]//Flatten[#]&; -BasisChange=MapThread[Rule,{Components,ConjugateTranspose[RotMat] . Components}]; -, -(*This option should be removed*) -RotMat1=RotationToRealBasis[GroupP,ScalarRepP[[i]][[1]]]; (*Maps to a real basis*) -RotMat=RotateToAdjBasis[GroupP,ScalarRepP[[i]][[1]]]; (*Maps to an adjoint basis. Only for simple reps*) -Components=Array[Symbol[ToString[\[Phi]]<>ToString[i]][##]&,SizeRep]//Flatten[#]&; -BasisChange=MapThread[Rule,{Components,ConjugateTranspose[RotMat1] . RotMat . Components}]; -]; - -ScalarComponents[[i]]=Array[a[##]->Symbol[ToString[\[Phi]]<>ToString[i]][##]&,SizeRep]//Flatten[#]&//ReplaceAll[#,BasisChange]&; -ScalarComponentsC[[i]]=Array[a[##]->Symbol[ToString[\[Phi]]<>ToString[i]][##]&,SizeRep]//Flatten[#]&//ReplaceAll[#,BasisChange]&; -ScalarVariables[[i]]={#}&/@Flatten[ScalarComponents[[i]]]/.{a_->b_}->b//Variables; -If[i==1, -ScalarVariablesIndices[[i]]=1;;(Length[ScalarVariables[[i]]]); -, -helpInd=ScalarVariablesIndices[[i-1]]/.(a_;;b_)-> b; -ScalarVariablesIndices[[i]]=(helpInd+1);;(helpInd+Length[ScalarVariables[[i]]]); -]; -]; -, -{i,1,Length[ScalarRepI]}]; - - -(*Check if the group only contains U1s*) -If[Total[Length[#]&/@GroupP]<1, -(*If the group only contains U1s the components don't have an index. so a[x]-> a. This is fixed below*) -ScalarComponents=ScalarComponents//ReplaceAll[#,a[1]->a]&; -ScalarComponentsC=ScalarComponentsC//ReplaceAll[#,a[1]->a]&; -]; -ScalarVariables=ScalarVariables//Flatten[#]&; -]; - - -{ScalarComponents,ScalarComponentsC,ScalarVariables}; - - -(* - Names fermion components. -*) -CreateFermionComponents[GroupI_,FermionRepI_]:=Module[{GroupP=GroupI,FermionRepP=FermionRepI}, - -GroupHelp=DeleteCases[GroupP,{}]; (*Removes all U1 factors since they don't have individual components*) -PosU1=Position[GroupP,{}];(*Position of all U1:s*) - -FermionComponents=ConstantArray[0,{Length[FermionRepP]}]; (*Contains all subsitution rules*) -FermionVariables=ConstantArray[0,{Length[FermionRepP]}];(*Contains the name of all fermion variables*) -FermionVariablesIndices=ConstantArray[0,{Length[FermionRepP]}]; (*Position of every scalar rep*); - - -Do[ -SizeRep=DimR[GroupHelp,FermionRepP[[i]][[1]]//Delete[#,PosU1]&]; -FermionComponents[[i]]=Array[a[##]->Symbol[ToString[\[CapitalPsi]]<>ToString[i]][##]&,SizeRep]//Flatten[#]&; -FermionVariables[[i]]={#}&/@Flatten[FermionComponents[[i]]]/.{a_->b_}->b//Variables; -If[i==1, -FermionVariablesIndices[[i]]=1;;(Length[FermionVariables[[i]]]); -, -helpInd=FermionVariablesIndices[[i-1]]/.(a_;;b_)-> b; -FermionVariablesIndices[[i]]=(helpInd+1);;(helpInd+Length[FermionVariables[[i]]]); -]; -, -{i,1,Length[FermionRepP]}]; - -(*Check if the group only contains U1s*) -If[Total[Length[#]&/@GroupP]<1, -FermionComponents=FermionComponents//ReplaceAll[#,a[1]->a]&; -]; - -FermionVariables=FermionVariables//Flatten[#]&; - -]; - - -{FermionComponents,FermionVariables,FermionVariablesIndices}; - - -(* - Creates invariant scalar operators with ordered components. -*) -CreateInvariant[GroupI_,ScalarRepI_,InvariantI_]:=Module[{GroupP=GroupI,ScalarRepP=ScalarRepI,InvariantP=InvariantI}, - -SubArray=ConstantArray[0,Length[InvariantP[[1]]]]; - -GroupP=ToGM[GroupP]; (*Converts to GroupMath input*) - -(*Fix for non-numeric U1 charges*) -PosU1=Position[GroupP,{}]//Flatten[#]&; - -If[Length[Delete[GroupP,{#}&/@PosU1]]>0, -GroupP=Delete[GroupP,{#}&/@PosU1]; -Do[ -ScalarRepP[[i]][[1]]=Delete[ScalarRepP[[i]][[1]],{#}&/@PosU1]; -,{i,1,Length[ScalarRepP]}]; -, -Do[ -ScalarRepP[[j]][[1]][[i]]=0; (*For arbitrary gauge-charges we set all charges to 0 when creating an invariant. Up to user to ensure that the term is gauge invariant*) -,{j,1,Length[ScalarRepP]},{i,1,Length[GroupP]}] -]; -(********************) - -ComponentsP={ScalarComponents,ScalarComponentsC,ScalarVariables}; -(*This just creates a Sub list*) -j=1; -Do[ -If[ScalarRepP[[i]][[2]]=="C", -If[InvariantP[[2]][[j]]==True, -SubArray[[j]]=ComponentsP[[1]][[i]]/.a->ToExpression[Alphabet[][[j]]] -, -SubArray[[j]]=ComponentsP[[2]][[i]]/.a->ToExpression[Alphabet[][[j]]](*Complex conjugated components*) -]; -, -SubArray[[j]]=ComponentsP[[1]][[i]]/.a->ToExpression[Alphabet[][[j]]](*No conjugated components for real reps*) -]; -j=j+1; -, -{i,InvariantP[[1]]}]; - - -SubArray=SubArray//Flatten[#]&; -InvRepsP=ScalarRepP[[InvariantP[[1]]]];(*These are the reps specified by the user*) -InvReps=Table[InvRepsP[[i]][[1]],{i,1,Length[InvariantP[[1]]]}]; - - -Temp=Invariants[GroupP,InvReps,Conjugations->InvariantP[[2]]]; -InvOperator=ToExpression[StringReplace[ToString[StandardForm[Temp]],"GroupMath`"->""]]//ReplaceAll[#,SubArray]&; -Return[InvOperator] -]; - - -(* - Creates invariant pure-fermion operators. -*) -CreateInvariantFermion[GroupI_,FermionRepI_,InvariantI_]:=Module[{GroupP=GroupI,FermionRepP=FermionRepI,InvariantP=InvariantI}, -(*Here I create an invariant, with ordered components, using the Invariant function from Groupmath*) -SubArray=ConstantArray[0,Length[InvariantP[[1]]]]; - -GroupP=ToGM[GroupP]; (*Converts to groupmath input*) - -(*Fix for non-numeric U1 charges*) -PosU1=Position[GroupP,{}]//Flatten[#]&; -If[Length[Delete[GroupP,{#}&/@PosU1]]>0, -GroupP=Delete[GroupP,{#}&/@PosU1]; -Do[ -FermionRepP[[i]][[1]]=Delete[FermionRepP[[i]][[1]],{#}&/@PosU1]; -,{i,1,Length[FermionRepP]}]; -, -Do[ -FermionRepP[[j]][[1]][[i]]=0; -,{j,1,Length[FermionRepP]},{i,1,Length[GroupP]}] -]; -(********************) - -ComponentsP={FermionComponents,FermionVariables}; -(*This just creates a Sub list*) -j=1; -Do[ -SubArray[[j]]=ComponentsP[[1]][[i]]/.a->ToExpression[Alphabet[][[j]]]; -j=j+1; -, -{i,InvariantP[[1]]}]; - - -SubArray=SubArray//Flatten[#]&; -InvRepsP=FermionRepP[[InvariantP[[1]]]];(*These are the reps specified by the user*) -InvReps=Table[InvRepsP[[i]][[1]],{i,1,Length[InvariantP[[1]]]}]; - - - -Temp=Invariants[GroupP,InvReps,Conjugations->InvariantP[[2]]]; - - -InvOperator=ToExpression[StringReplace[ToString[StandardForm[Temp]],"GroupMath`"->""]]//ReplaceAll[#,SubArray]&; -Return[InvOperator] -]; - - -(* - Create Yukawa couplings. -*) -CreateInvariantYukawa[GroupI_,ScalarRepI_,FermionRepI_,InvariantI_]:=Module[{GroupP=GroupI,ScalarRepP=ScalarRepI,FermionRepP=FermionRepI,InvariantP=InvariantI}, -(*Here I create an invariant, with ordered components, using the Invariant function from Groupmath*) -(*This just creates a Sub list*) - -GroupP=ToGM[GroupP]; (*Converts to GroupMath input*) - - -ComponentsP={ScalarComponents,ScalarComponentsC,ScalarVariables}; -ComponentsFermionP={FermionComponents,FermionVariables}; - - - -(*Fix for non-numeric U1 charges*) -PosU1=Position[GroupP,{}]//Flatten[#]&; -If[Length[Delete[GroupP,{#}&/@PosU1]]>0, -GroupP=Delete[GroupP,{#}&/@PosU1]; -Do[ -ScalarRepP[[i]][[1]]=Delete[ScalarRepP[[i]][[1]],{#}&/@PosU1]; -,{i,1,Length[ScalarRepP]}]; - -Do[ -FermionRepP[[i]][[1]]=Delete[FermionRepP[[i]][[1]],{#}&/@PosU1]; -,{i,1,Length[FermionRepP]}]; - - -, -Do[ -ScalarRepP[[j]][[1]][[i]]=0; -,{j,1,Length[ScalarRepP]},{i,1,Length[GroupP]}]; - -Do[ -FermionRepP[[j]][[1]][[i]]=0; -,{j,1,Length[FermionRepP]},{i,1,Length[GroupP]}]; - -]; - - - -(********************) - -j=1; -i=InvariantP[[1]][[1]]; -If[ScalarRepP[[i]][[2]]=="C", -If[InvariantP[[2]][[j]]==True, -SubArray=ComponentsP[[1]][[i]]/.a->ToExpression[Alphabet[][[j]]] -, -SubArray=ComponentsP[[2]][[i]]/.a->ToExpression[Alphabet[][[j]]] -]; -, -SubArray=ComponentsP[[1]][[i]]/.a->ToExpression[Alphabet[][[j]]] -]; - - -SubArrayFermion=ConstantArray[0,2]; - -i=InvariantP[[1]][[2]]; -SubArrayFermion[[1]]=ComponentsFermionP[[1]][[i]]/.a->ToExpression[Alphabet[][[2]]]; -i=InvariantP[[1]][[3]]; -SubArrayFermion[[2]]=ComponentsFermionP[[1]][[i]]/.a->ToExpression[Alphabet[][[3]]]; - - -SubArray=SubArray//Flatten[#]&; -SubArrayFermion=SubArrayFermion//Flatten[#]&; - - -InvRepsScalar=ScalarRepP[[InvariantP[[1]][[1]]]]; -(*These are the reps specified by the user*) -InvRepsFemion=FermionRepP[[InvariantP[[1]][[2;;3]]]]; - - -InvReps={InvRepsScalar[[1]],InvRepsFemion[[1]][[1]],InvRepsFemion[[2]][[1]]}; -(*//ReplaceAll[#,SubArray]&//ReplaceAll[#,SubArrayFermion]&*) - - -Temp=Invariants[GroupP,InvReps,Conjugations->InvariantP[[2]]]//ReplaceAll[#,SubArray]&//ReplaceAll[#,SubArrayFermion]&; - - -InvOperator=ToExpression[StringReplace[ToString[StandardForm[Temp]],"GroupMath`"->""]]//ReplaceAll[#,SubArray]&//ReplaceAll[#,SubArrayFermion]&; -Return[InvOperator]; -]; - - -GradMass[PotentialI_]:=Module[{PotentialP=PotentialI}, -SparseArray[GradH[PotentialP,ScalarVariables]]//GradH[#,ScalarVariables]& -]; - - -GradMassFermion[PotentialI_]:=Module[{PotentialP=PotentialI}, -SparseArray[GradH[PotentialP,FermionVariables]]//GradH[#,FermionVariables]&//SparseArray -]; - - -GradQuartic[PotentialI_]:=Module[{PotentialP=PotentialI}, -SparseArray[GradH[PotentialP,ScalarVariables]]//GradH[#,ScalarVariables]&//GradH[#,ScalarVariables]&//GradH[#,ScalarVariables]&//SparseArray -]; - - -GradSextic[PotentialI_]:=Module[{PotentialP=PotentialI}, -GradQuartic[PotentialP]//GradH[#,ScalarVariables]&//GradH[#,ScalarVariables]&//SparseArray -]; - - -GradCubic[PotentialI_]:=Module[{PotentialP=PotentialI}, -SparseArray[GradH[PotentialP,ScalarVariables]]//GradH[#,ScalarVariables]&//GradH[#,ScalarVariables]&//SparseArray -]; - - -GradTadpole[PotentialI_]:=Module[{PotentialP=PotentialI}, -SparseArray[GradH[PotentialP,ScalarVariables]]//SparseArray -]; - - -GradYukawa[PotentialI_]:=Module[{PotentialP=PotentialI}, -SparseArray[GradH[PotentialP,ScalarVariables]]//GradH[#,FermionVariables]&//GradH[#,FermionVariables]&//SparseArray -]; - - -(* - Creates an empty array. -*) -EmptyArray[ComponentsI_]:=Module[{ComponentsP=ComponentsI}, -ComponentsMod=ComponentsP; -Do[ -If[ComponentsP[[i]]<1,ComponentsMod[[i]]=1,ComponentsMod[[i]]=ComponentsP[[i]] -]; -,{i,Length[ComponentsP]}]; -SparseArray[{ComponentsMod->0},ComponentsMod] -]; - - -(* - Finds the dimension of all groups. -*) -ToGM[GroupI_]:=Module[{GroupP=GroupI}, -Temp=StringReplace[GroupP,{"SU"->""}]; -SUTensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies SU groups*) -numTensorSU=CartanMatrix["SU",#]&/@(Read[StringToStream[#],Number]&/@StringReplace[SUTensor,{"SU"->""}]);(*Replace the group with the dimension of the adjoint rep*) - -Temp=StringReplace[GroupP,{"SO"->""}]; -SUTensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies SU groups*) -numTensorSO=CartanMatrix["SO",#]&/@(Read[StringToStream[#],Number]&/@StringReplace[SUTensor,{"SO"->""}]);(*Replace the group with the dimension of the adjoint rep*) - -Temp=StringReplace[GroupP,{"SP"->""}]; -SUTensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies SU groups*) -numTensorSP=CartanMatrix["SP",#]&/@(Read[StringToStream[#],Number]&/@StringReplace[SUTensor,{"SP"->""}]);(*Replace the group with the dimension of the adjoint rep*) - -Temp=StringReplace[GroupP,{"E"->""}]; -SUTensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies SU groups*) -numTensorE=CartanMatrix["E",#]&/@(Read[StringToStream[#],Number]&/@StringReplace[SUTensor,{"E"->""}]);(*Replace the group with the dimension of the adjoint rep*) - -Temp=StringReplace[GroupP,{"G"->""}]; -SUTensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies SU groups*) -numTensorG=CartanMatrix["G",#]&/@(Read[StringToStream[#],Number]&/@StringReplace[SUTensor,{"G"->""}]);(*Replace the group with the dimension of the adjoint rep*) - -Temp=StringReplace[GroupP,{"F"->""}]; -SUTensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies SU groups*) -numTensorF=CartanMatrix["F",#]&/@(Read[StringToStream[#],Number]&/@StringReplace[SUTensor,{"F"->""}]);(*Replace the group with the dimension of the adjoint rep*) - -Temp=StringReplace[GroupP,{"U1"->""}]; -SUTensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies SU groups*) -numTensorU1=CartanMatrix["U",#]&/@(Read[StringToStream[#],Number]&/@StringReplace[SUTensor,{"U"->""}]);(*Replace the group with the dimension of the adjoint rep*) - - -{SoRes,SuRes,SpRes,G2Res,F4Res,E6Res,E7Res,E8Res,U1Res}//Flatten[#,1]&; -Return[Join[numTensorSO,numTensorSU,numTensorSP,numTensorG,numTensorF,numTensorE,numTensorU1]]; -]; diff --git a/DRalgo/SoftToUS.m b/DRalgo/SoftToUS.m deleted file mode 100644 index 749991d..0000000 --- a/DRalgo/SoftToUS.m +++ /dev/null @@ -1,1203 +0,0 @@ -(* ::Package:: *) - -(* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *) - -(* :Title: SoftToUS *) - -(* - This software is covered by the GNU General Public License 3. - Copyright (C) 2021-2022 Andreas Ekstedt - Copyright (C) 2021-2022 Philipp Schicho - Copyright (C) 2021-2022 Tuomas V.I. Tenkanen - -*) - -(* :Summary: Dimensonal reduction from soft to supersoft scale. *) - -(* ------------------------------------------------------------------------ *) - - -(* - Prints the result from SymmEnergy. -*) -PrintPressureUS[optP_]:=Module[{opt=optP}, -SymmPrint=Switch[opt,"LO",SymmEnergyUS[[1]],"NLO",SymmEnergyUS[[2]]]; - - -(*Printing Result*) -ToExpression[StringReplace[ToString[StandardForm[SymmPrint]],"DRalgo`Private`"->""]] -]; - - -(* - Calculates the preassure in the ultrasoft theory. Only the preassure in the symmetric - phae is calculated. -*) -SymmetricPhaseEnergyUS[]:=Module[{}, -(* - Counterterms are needed to calculate - SymmetricPhaseNLO and SymmetricPhaseNNLO -*) -(*The minus signs is a convention to get the pressure*) -Tot={-SymmetricPhaseUSLO[],-SymmetricPhaseUSNLO[]}; -SymmEnergyUS=Tot; -]; - - -(* - Calculates the 1-loop pressure in the ultrasoft theory. -*) -SymmetricPhaseUSLO[]:=Module[{}, -If[verbose,Print["Calculating Leading-Order \!\(\*SuperscriptBox[\(T\), \(4\)]\) Terms"]]; - -ContriScalars=Sum[-1/(12 \[Pi]) \[Mu]ijL[[i,i]]^3,{i,1,Length[\[Mu]ijL]}]; - -ToExpression[StringReplace[ToString[StandardForm[ContriScalars]],"DRalgo`Private`"->""]] -]; - - - -(* - Calculates the 2-loop pressure in the ultrasoft theory. -*) -SymmetricPhaseUSNLO[]:=Module[{}, -If[verbose,Print["Calculating NLO \!\(\*SuperscriptBox[\(T\), \(4\)]\) Terms"]]; -(*Definitions*) -fSSV[x_,y_]:=(4 (x^2+y^2) Log[\[Mu]3/(x+y)]+4 Sqrt[x^2] Sqrt[y^2]+x^2+y^2)/(32 \[Pi]^2); - -I1Temp=1/(16^2 \[Pi]); -Vss=1/8*I1Temp*TensorContract[\[Mu]ijL . \[Lambda]KTotal . \[Mu]ijL,{{1,2},{3,4}}]; - -ssv=1/4 TensorProduct[gvssVTot,gvssVTot]; -Vssv=Sum[ssv[[a,i,j,a,i,j]]fSSV[\[Mu]ijL[[i,i]],\[Mu]ijL[[j,j]]],{a,nv},{i,nSH},{j,nSH}]; - - -VNLO= Vss+Vssv; - -ToExpression[StringReplace[ToString[StandardForm[VNLO]],"DRalgo`Private`"->""]] -]; - - - -(* - Prints all the couplings in the supersoft theory. -*) - - - - -(* - Prints all the couplings in the supersoft theory. -*) - -PrintCouplingsUS[]:=Module[{}, - -(*Non-Abelian Couplings*) - -NonAbelianCouplingSS[]; (*Calculates non-abelian couplings*) - -GabcdTemp=GgvvvSS . gvvvSS+gvvvSS . GgvvvSS; - Temp=Activate @ TensorContract[ - Inactive[TensorProduct][gvvvSS,gvvvSS], {{3, 6}}] ; -GabVTree=TensorContract[Temp,{{2,3}}]//Normal; -GabVLoop=TensorContract[GabcdTemp,{{2,3}}]//Normal; - - -HelpList=DeleteDuplicates@Flatten@FullSimplify[GabVTree+GabVLoop ]//Sort; (*Adds the tree-level result*) -HelpVar=Table[ \[Lambda]VNASS[a],{a,1,Delete[HelpList,1]//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; (*Finds a minimal basis of couplings*) -HelpSolveNASS=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten; -\[Lambda]VecNASS=GabVTree+GabVLoop//Normal//FullSimplify//ReplaceAll[#,HelpSolveNASS]&//SparseArray; -IdentMatNASS=List/@HelpSolveNASS/.{b_->a_}:>a->b//Flatten[#,1]&; - - - -VarGauge=Table[Symbol[ToString[c]<>ToString["3d"]],{c,GaugeCouplingNames}]; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["US"]],{c,VarGauge}]; - - -A1=\[Lambda]VecNASS//Normal; -A2=GabVTree//Normal//ReplaceAll[#,SubGauge]&; -Var3D=A2//Variables; -RepVar3D=#->Sqrt[#]&/@Var3D; -A2Mod=A2/.RepVar3D; -Sol1=Solve[A2Mod==A1,Var3D]/.IdentMatNASS//Flatten[#,1]&//FullSimplify; (*Solves ultrasoft couplings in terms of soft ones*) -ResGaugeNASS=Table[List[Sol1[[c]]]/.{b_->a_}:>b^2->a,{c,1,Length[Sol1]}]//Simplify; - - - - -(* Gauge couplings*) -A1=TensorContract[\[Lambda]KVecTSS,{{3,4}}]//Normal; -A2=TensorContract[HabijVL,{{3,4}}]//Normal//ReplaceAll[#,SubGauge]&; -(*Trick to avoid problems when kinetic mixing*) -A1=DiagonalMatrix[Diagonal[A1]]; -A2=DiagonalMatrix[Diagonal[A2]]; - - -Var3D=VarGauge//ReplaceAll[#,SubGauge]&//Variables; -RepVar3D=#->Sqrt[#]&/@Var3D; -A2Mod=A2/.RepVar3D; -Sol1=Solve[A2Mod==A1,Var3D]/.IdentMatSS//Flatten[#,1]&; - -ResGauge=Table[List[Sol1[[c]]]/.{b_->a_}:>b^2->a,{c,1,Length[Sol1]}]; - - - -(* Scalar Quartics*) -QuarticVar=\[Lambda]4S//Normal//Variables; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["US"]],{c,QuarticVar}]; -NonZeroPos=SparseArray[\[Lambda]4S]["NonzeroPositions"]; -SolVar=Extract[\[Lambda]4S-\[Lambda]3DSS,{#}]&/@NonZeroPos//DeleteDuplicates; -ResScalp=Reduce[SolVar==0,QuarticVar]//ToRules[#]&; -SolveTemp=QuarticVar/.ResScalp; -ResScal=Table[{ReplaceAll[QuarticVar[[i]],SubGauge]->SolveTemp[[i]]},{i,1,Length@QuarticVar}]//Flatten[#,1]&//ReplaceAll[#,IdentMatSS]&; - - -(* Scalar Cubics*) -VarGauge=Join[\[Lambda]3CLight//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["US"]],{c,VarGauge}]; -\[Lambda]3p=\[Lambda]3CLight//Normal//ReplaceAll[#,SubGauge]&; -SolVar=\[Lambda]3CSRedSS-\[Lambda]3p//Normal; -CubicVar=\[Lambda]3p//Normal//Variables; -ResCubicSS=Solve[SolVar==0,CubicVar]/.IdentMatSS//Flatten[#,1]&; - - - - -(*Printing Result*) -PrintPre=Join[ResScal,ResGauge,ResGaugeNASS,ResCubicSS]//Normal//FullSimplify//DeleteDuplicates; -PrintPre=DeleteCases[PrintPre,0->0]; - -ToExpression[StringReplace[ToString[StandardForm[PrintPre]],"DRalgo`Private`"->""]] - -]; - - -(* - Creates auxiliary tensors that appear in the matching. -*) -CreateHelpTensorsSS[]:=Module[{}, -If[verbose,Print["Creating Help Tensors"]]; - - -HabijL=Transpose[Activate @ TensorContract[ - Inactive[TensorProduct][gvssL,gvssL], { {3, 5}}],{1,3,2,4}]//SimplifySparse; -HabijVL=HabijL+Transpose[HabijL,{2,1,3,4}]//SimplifySparse; -SelfEnergySS= Inactivate[TensorProduct[gAvss,gAvss]]//SimplifySparse; -HabijA=Transpose[Activate@TensorContract[SelfEnergySS,{{3,5}}],{1,3,2,4}]//SimplifySparse; -HabijVA=HabijA+Transpose[HabijA,{1,2,4,3}]//SimplifySparse; -]; - - -(* - Scalar self-energy in the effective theory. -*) -ScalarSelfEnergySS[]:=Module[{}, -If[verbose,Print["Calculating Scalar Self-Energy"]]; - -SelfEnergySS=-1/(12\[Pi]); -ContriSS=SelfEnergySS/2*Simplify[Table[Sum[\[Lambda]3Cx[[i,ii,jj]]\[Lambda]3Cx[[j,ii,jj]]/(\[Mu]ijL[[ii,ii]]+\[Mu]ijL[[jj,jj]])^3,{ii,1,nSH},{jj,1,nSH}],{i,1,nSL},{j,1,nSL}]]; -ContriSS2=SelfEnergySS*Simplify[Table[Sum[\[Lambda]3Cy[[i,ii,jj]]\[Lambda]3Cy[[j,ii,jj]]/(\[Mu]ijL[[jj,jj]])^3,{ii,1,nSL},{jj,1,nSH}],{i,1,nSL},{j,1,nSL}]]; - - -ZSij=-(ContriSS+ContriSS2)/2; -]; - - -(* - Matching of scalar-cubic couplings. \[Lambda]3Cy corresponds to light*light*heavy scalar cubic, and \[Lambda]3Cx corresponds to light*heavy*heavy scalar coupling. -*) - -ScalarCubicsSS[]:=Module[{}, -If[verbose,Print["Calculating Scalar Cubic Couplings"]]; - -If[Length[\[Lambda]3//Normal//Variables]==0, -\[Lambda]3CSSS=0; -, -MassVec=Table[\[Mu]ijL[[n,n]],{n,1,nSH}]; - -TensHelp=Table[1/n^2,{n,MassVec}]//SparseArray; -TensHelp2=TensorProduct[\[Lambda]3Cy,\[Lambda]3CHeavy]//DiagonalTensor2[#,3,6]&; -Temp=-TensHelp . TensHelp2//Flatten[#,{{3},{4},{1},{2}}]&; -\[Lambda]KTemp=\[Lambda]K+Temp; - -TensHelp=Table[1/n^2,{n,MassVec}]//SparseArray; -TensHelp2=TensorProduct[\[Lambda]3Cx,\[Lambda]3Cy]//DiagonalTensor2[#,3,6]&; -Temp=-TensHelp . TensHelp2//Transpose[#,{1,4,3,2}]&; -Temp=3Symmetrize[Temp,Symmetric[{1,2,3}]]//SparseArray//SimplifySparse; -\[Lambda]yTemp=\[Lambda]y+Temp; - -TensHelp=Table[1/(n+m),{n,MassVec},{m,MassVec}]//SparseArray; -TensHelp2=TensorProduct[\[Lambda]KTemp,\[Lambda]3Cx]//DiagonalTensor2[#,1,6]&//DiagonalTensor2[#,2,6]&; -Contri1Pre=Total[TensHelp TensHelp2,-4]; -Contri1=1/(4 \[Pi]) /2*3*Symmetrize[Contri1Pre,Symmetric[{1,2,3}]]//SparseArray//SimplifySparse; - -TensHelp=Table[1/(n),{n,MassVec}]//SparseArray; -TensHelp2=TensorProduct[\[Lambda]yTemp,\[Lambda]3Cy]//TensorProduct[#,{3,6}]&//DiagonalTensor2[#,4,7]&; -Contri2Pre=TensHelp . TensHelp2; -Contri2=1/(4 \[Pi])*3*Symmetrize[Contri2Pre,Symmetric[{1,2,3}]]//SparseArray//SimplifySparse; - -MassVec2=Table[\[Mu]ijLS[[n,n]],{n,1,ns}]; -TensHelp=Table[MassHelpTriangle[n,m,l],{n,MassVec2},{m,MassVec2},{l,MassVec2}]//SparseArray; -TensHelp2=TensorProduct[\[Lambda]3CTot,\[Lambda]3CTot]//DiagonalTensor2[#,2,6]&//TensorProduct[#,\[Lambda]3CTot]&//DiagonalTensor2[#,5,7]&//DiagonalTensor2[#,3,7]&; -Contri3Pre=Total[TensHelp TensHelp2,-4][[LightScalar[[;;,1]],LightScalar[[;;,1]],LightScalar[[;;,1]]]]; -Contri3=-3*Symmetrize[Contri3Pre,Symmetric[{1,2,3}]]//SparseArray//SimplifySparse; - -TensHelp=Table[n/m^2,{n,MassVec},{m,MassVec}]//SparseArray; -TensHelp2=TensorProduct[\[Lambda]3Cy,\[Lambda]x]//DiagonalTensor2[#,5,6]&//DiagonalTensor2[#,4,6]&; -Temp=TensHelp . TensHelp2//TensorContract[#,{{1,2}}]&; -ContriMixed=-1/(4 \[Pi])*1/2*3 Symmetrize[Temp,Symmetric[{1,2,3}]]//SparseArray//SimplifySparse; - -ContriSE=3 Symmetrize[ZSij . \[Lambda]3CLight,Symmetric[{1,2,3}]]//SparseArray//SimplifySparse; - -\[Lambda]3CSSS=-Contri3-Contri1-Contri2-ContriSE-ContriMixed; -]; - -]; - - -(* - Calculates the 2-loop scalar mass in the ultrasoft theory. -*) -ScalarMass2LoopSS[]:=Module[{}, -If[verbose,Print["Calculating 2-Loop Scalar Mass"]]; - -MassVector=Table[\[Mu]ijL[[n,n]],{n,1,nSH}]; - -TensHelp=Table[(1/2+Log[\[Mu]3/( a+b)]),{a,MassVector},{b,MassVector}]//SparseArray; -AE1=\[Lambda]K . Transpose[\[Lambda]K,{4,2,3,1}]//DiagonalTensor[#,1,4]&//DiagonalTensor[#,1,5]&; -Contri1=-1/(16 \[Pi]^2)1/2AE1 . TensHelp//TensorContract[#,{2,4}]&; - -MassHelp=Table[(1/2+2Log[\[Mu]3/(2 a)]),{a,MassVector}]//SparseArray; -TensHelp=Transpose[Transpose[gAvss,{2,1,3}],{1,3,2}] . gAvss//TensorContract[#,{1,3}]&; -TensHelp2=MassHelp TensHelp . \[Lambda]K//TensorContract[#,{1,2}]&; -Contri2=1/(16 \[Pi]^2)*(1/2)TensHelp2; - -MassHelp=Table[(-Log[\[Mu]3/(2 a)]),{a,MassVector}]//SparseArray; -TensHelp=gAvss . Transpose[gAvss,{2,1,3}]//SparseArray //DiagonalTensor[#,2,4]&//Transpose[#,{3,2,1}]&; -TensHelp2=TensHelp . MassHelp . HabijVL//TensorContract[#,{1,2}]&; -Contri3=1/(16 \[Pi]^2)*(1/4)TensHelp2; - -MassHelp=Table[1/(a+b),{a,MassVector},{b,MassVector}]//SparseArray; -TensHelp=TensorProduct[DiagonalTensor[\[Lambda]4K,3,4] . MassVector,MassHelp]//DiagonalTensor[#,1,3]&//DiagonalTensor[#,1,3]&; -Contri4=1/4*(1/(16 \[Pi]^2))*TensHelp . \[Lambda]K//TensorContract[#,{1,2}]&; - -(* -Contri1=-1/(16 \[Pi]^2)1/2Simplify[Table[Sum[ \[Lambda]K[[a,b,i,n]]\[Lambda]K[[a,b,n,j]](1/2+Log[\[Mu]3US/( \[Mu]ijL[[a,a]]+ \[Mu]ijL[[b,b]])]),{a,1,nSH},{b,1,nSH},{n,1,nSL}],{i,1,nSL},{j,1,nSL}]]; -Contri2=1/(16 \[Pi]^2)*(-1/2)Simplify[Table[Sum[\[Lambda]K[[n,m,i,j]]gAvss[[a,n,l]]gAvss[[a,l,m]](1/2+2Log[\[Mu]3US/(2 \[Mu]ijL[[n,n]])]),{a,1,nv},{l,1,nSH},{n,1,nSH},{m,1,nSH}],{i,1,nSL},{j,1,nSL}]]; -Contri3=1/(16 \[Pi]^2)*(1/4)Simplify[Table[Sum[HabijVL[[a,b,i,j]]gAvss[[a,n,l]]gAvss[[b,l,n]](-Log[\[Mu]3US/(2 \[Mu]ijL[[n,n]])]),{a,1,nv},{b,1,nv},{l,1,nSH},{n,1,nSH}],{i,1,nSL},{j,1,nSL}]]; -Contri4=1/4*(1/(16 \[Pi]^2))Simplify[Table[Sum[\[Lambda]K[[a,b,i,j]]\[Lambda]4K[[a,b,c,c]]\[Mu]ijL[[c,c]]/(\[Mu]ijL[[a,a]]+\[Mu]ijL[[b,b]]),{a,1,nSH},{b,1,nSH},{c,1,nSH}],{i,1,nSL},{j,1,nSL}]]; -*) - -If[Length[\[Lambda]x//Normal//Variables]==0&&Length[\[Lambda]y//Normal//Variables]==0, -Contri5=0; -Contri6=0; -Contri7=0; -, -TensHelp=Table[(1/2+Log[\[Mu]3/(a+b+n)]) ,{a,MassVector},{b,MassVector},{n,MassVector}]//SparseArray; -TensHelp2=TensorProduct[\[Lambda]x,\[Lambda]x]//DiagonalTensor2[#,2,6]&//DiagonalTensor2[#,3,6]&//DiagonalTensor2[#,4,6]&; -Contri5=-1/(16 \[Pi]^2)/3!*Total[TensHelp TensHelp2,-3]; - -TensHelp=Table[(1/2+Log[\[Mu]3/(a)]) ,{a,MassVector}]//SparseArray; -TensHelp2=TensorProduct[\[Lambda]y,\[Lambda]y]//TensorContract[#,{2,6}]&//TensorContract[#,{2,5}]&//DiagonalTensor2[#,2,4]&; -Contri6=-1/(16 \[Pi]^2)/2!*Total[TensHelp TensHelp2,-3]; - -TensHelp=Table[c/b ,{c,MassVector},{b,MassVector}]//SparseArray; -TensHelp2=Transpose[\[Lambda]y,{1,2,4,3}] . \[Lambda]x//DiagonalTensor2[#,3,4]&//DiagonalTensor2[#,4,5]&; -Contri7=(1/(16 \[Pi]^2))/2*Total[TensHelp TensHelp2,-3]; - -]; -TensHelp=Table[n/m^2*l ,{n,MassVector},{m,MassVector},{l,MassVector}]//SparseArray; -TensHelp2=TensorProduct[DiagonalTensor2[\[Lambda]x,2,3],DiagonalTensor2[\[Lambda]x,2,3]]//DiagonalTensor2[#,3,6]&//Flatten[#,{{2},{1},{4}}]&; -ContriMix1=-1/4*1/(4 \[Pi])^2*Total[TensHelp TensHelp2,-3]; - -ContriMix2=-Simplify[Table[Sum[(\[Mu]ijMix[[i,m]])\[Mu]ijL[[m,m]]^-2 \[Mu]ijMix[[j,m]],{m,1,nSH}],{i,1,nSL},{j,1,nSL}]]; - -If[Length[\[Lambda]3//Normal//Variables]||nv>=nSH, -ContriC1=0; -ContriC2=0; -ContriC3=0; -ContriC4=0; -\[Mu]ijSSNLO2=0; -, -(*Check signs*) -MassVector=Table[\[Mu]ijLS[[n,n]],{n,1,ns}]; -TensHelp=Table[MassHelp1[j,i,k,l,m] ,{j,MassVector},{i,MassVector},{k,MassVector},{l,MassVector},{m,MassVector}]//SparseArray//SimplifySparse&; -TensHelp2=TensorProduct[\[Lambda]3CTot,\[Lambda]3CTot]//DiagonalTensor2[#,1,4]&//TensorProduct[#,\[Lambda]3CTot]&//DiagonalTensor2[#,2,6]&//DiagonalTensor2[#,4,6]&; -TensHelp3=TensorProduct[TensHelp2,\[Lambda]3CTot]//DiagonalTensor2[#,4,7]&//DiagonalTensor2[#,5,7]&; -ContriC1=-1/2*Total[TensHelp TensHelp3,-3][[LightScalar[[;;,1]],LightScalar[[;;,1]]]]//SimplifySparse; - -TensHelp=Table[MassHelp2[i,j,m,n] ,{i,MassVector},{j,MassVector},{m,MassVector},{n,MassVector}]//SparseArray//SimplifySparse; -TensHelp2=TensorProduct[\[Lambda]4Tot,\[Lambda]3CTot]//DiagonalTensor2[#,4,6]&//DiagonalTensor2[#,4,5]&; -TensHelp3=TensorProduct[TensHelp2,\[Lambda]3CTot]//DiagonalTensor2[#,4,7]&//DiagonalTensor2[#,5,7]&; -ContriC2=1/2*Total[TensHelp TensHelp3,-3][[LightScalar[[;;,1]],LightScalar[[;;,1]]]]//SimplifySparse; - -TensHelp=Table[MassHelp2[i,j,m,n] ,{i,MassVector},{j,MassVector},{m,MassVector},{n,MassVector}]//SparseArray//SimplifySparse; -TensHelp2=TensorProduct[\[Lambda]3CTot,\[Lambda]3CTot]//DiagonalTensor2[#,3,4]&//DiagonalTensor2[#,3,4]&; -TensHelp3=TensorProduct[TensHelp2,\[Lambda]4Tot]//DiagonalTensor2[#,3,5]&//DiagonalTensor2[#,4,7]&; -ContriC4=-1/4*Total[TensHelp TensHelp3,-3][[LightScalar[[;;,1]],LightScalar[[;;,1]]]]//SimplifySparse; - -\[Mu]ijSSNLO2=(ContriC1+2*ContriC2+ContriC4)//Simplify//SparseArray; -]; - -\[Mu]ijTemp=\[Mu]ijLight+\[Mu]ijSSLO//SparseArray; -ContriF=-ZSij . \[Mu]ijTemp-\[Mu]ijTemp . ZSij; - -\[Mu]ijSSNLO=(Contri1+Contri2+Contri3+ Contri4+Contri5+Contri6+Contri7+ContriMix1+ContriMix2+ContriF)//Simplify//SparseArray; - -]; - - - -(* - These functions appear in the matching. -*) -MassHelp1[0,0,0,0,0]:=0 -MassHelp1[x_,0,0,0,0]:=1/(16 \[Pi]^2 x^4) -MassHelp1[0,x_,0,0,0]:=1/(16 \[Pi]^2 x^4) -MassHelp1[0,0,x_,0,0]:=1/(16 \[Pi]^2 x^4) -MassHelp1[0,0,0,x_,0]:=1/(16 \[Pi]^2 x^4) -MassHelp1[y_,y_,w_,z_,t_]:=1/(16 \[Pi]^2 (t^2+w^2+y^2) (t^2+y^2+z^2)) -MassHelp1[x_,y_,z_,z_,t_]:=1/(16 \[Pi]^2 (t^2+x^2+z^2) (t^2+y^2+z^2)) -MassHelp1[0,y_,0,0,t_]:=1/(16 \[Pi]^2 (t^2) (t^2+y^2)) -MassHelp1[x_,y_,w_,z_,t_]:=(Log[\[Mu]3/(t+w+x)]-Log[\[Mu]3/(t+w+y)]-Log[\[Mu]3/(t+x+z)]+Log[\[Mu]3/(t+y+z)])/(16 \[Pi]^2 (w^2-z^2) (x^2-y^2)) -MassHelp1[0,y_,0,z_,0]:=-((2 Log[\[Mu]3/y]-2 Log[\[Mu]3/(y+z)]+2 Log[\[Mu]3/z]+1)/(32 \[Pi]^2 y^2 z^2)) -MassHelp1[x_,0,w_,0,0]:=-((2 Log[\[Mu]3/x]-2 Log[\[Mu]3/(x+w)]+2 Log[\[Mu]3/w]+1)/(32 \[Pi]^2 x^2 w^2)) -MassHelp1[0,y_,w_,0,0]:=-((2 Log[\[Mu]3/y]-2 Log[\[Mu]3/(y+w)]+2 Log[\[Mu]3/w]+1)/(32 \[Pi]^2 y^2 w^2)) -MassHelp1[x_,0,0,z_,0]:=-((2 Log[\[Mu]3/x]-2 Log[\[Mu]3/(x+z)]+2 Log[\[Mu]3/z]+1)/(32 \[Pi]^2 x^2 z^2)) - - -(* - These functions appear in the matching. -*) -MassHelpTriangle[0,0,0]:=0 -MassHelpTriangle[x_,0,0]:=-(1/(4 \[Pi] x^3)) -MassHelpTriangle[0,y_,0]:=-(1/(4 \[Pi] y^3)) -MassHelpTriangle[0,0,z_]:=-(1/(4 \[Pi] z^3)) -MassHelpTriangle[x_,y_,z_]:=1/(4 \[Pi] (x+y) (x+z) (y+z)) - - -(* - These functions appear in the matching. -*) -MassHelp2[0,0,0,0]:=0 -MassHelp2[0,0,z_,t_]:=1/(16 \[Pi]^2 (t^2+z^2)) -MassHelp2[x_,0,0,0]:=(-(2 Log[\[Mu]3/x])-1)/(32 \[Pi]^2 x^2) -MassHelp2[0,y_,0,0]:=(-(2 Log[\[Mu]3/y])-1)/(32 \[Pi]^2 y^2) -MassHelp2[y_,y_,z_,t_]:=1/(16 \[Pi]^2 (t^2+y^2+z^2)) -MassHelp2[x_,y_,z_,t_]:=(Log[\[Mu]3/(t+y+z)]-Log[\[Mu]3/(t+x+z)])/(16 \[Pi]^2 (x^2-y^2)) - - -(* - Adds tree-level contributions before the matching. -*) -IdentifyTensorsPreSSDRalgo[]:=Module[{}, - - -(*Quartic Tensor*) -HelpList=DeleteDuplicates@SparseArray[Flatten@Simplify[ (\[Lambda]4S)]]//Sort//FullSimplify; -HelpVar=Table[\[Lambda]PSS[a],{a,1,Delete[HelpList,1]//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; - HelpSolveQuarticPreS=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten; -\[Lambda]4S=(\[Lambda]4S)//Normal//Simplify//FullSimplify//ReplaceAll[#,HelpSolveQuarticPreS]&//SparseArray; - - -HelpList=DeleteDuplicates@SparseArray[Flatten@Simplify[ (\[Lambda]K)]]//Sort//FullSimplify; -HelpVar=Table[\[Lambda]PSK[a],{a,1,Delete[HelpList,1]//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; - HelpSolveQuarticPreK=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten; -\[Lambda]K=(\[Lambda]K)//Normal//Simplify//FullSimplify//ReplaceAll[#,HelpSolveQuarticPreK]&//SparseArray; - - -HelpList=DeleteDuplicates@SparseArray[Flatten@Simplify[ (\[Lambda]y)]]//Sort//FullSimplify; -HelpVar=Table[\[Lambda]PSY[a],{a,1,Delete[HelpList,1]//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; - HelpSolveQuarticPreY=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten; -\[Lambda]y=(\[Lambda]y)//Normal//Simplify//FullSimplify//ReplaceAll[#,HelpSolveQuarticPreY]&//SparseArray; - - -HelpList=DeleteDuplicates@SparseArray[Flatten@Simplify[ \[Lambda]x]]//Sort//FullSimplify; -HelpVar=Table[\[Lambda]PSX[a],{a,1,Delete[HelpList,1]//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; - HelpSolveQuarticPreX=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten; -\[Lambda]x=(\[Lambda]x)//Normal//Simplify//FullSimplify//ReplaceAll[#,HelpSolveQuarticPreX]&//SparseArray; - - -HelpList=DeleteDuplicates@SparseArray[Flatten@Simplify[ \[Lambda]4Tot]]//Sort//FullSimplify; -HelpVar=Table[\[Lambda]PST[a],{a,1,Delete[HelpList,1]//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; - HelpSolveQuarticPreTot=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten; -\[Lambda]4Tot=(\[Lambda]4Tot)//Normal//Simplify//FullSimplify//ReplaceAll[#,HelpSolveQuarticPreTot]&//SparseArray; - -IdentMatPre=List/@Join[HelpSolveQuarticPreS,HelpSolveQuarticPreK,HelpSolveQuarticPreY,HelpSolveQuarticPreX,HelpSolveQuarticPreTot]/.{b_->a_}:>a->b//Flatten[#,1]&; - -]; - - -(* - Writes ultrasoft parameters in terms of soft ones. -*) -IdentifyTensorsSSDRalgo[]:=Module[{}, - -If[verbose,Print["Identifying Components"]]; -(*Quartic Tensor*) - - -HelpList=DeleteDuplicates@SparseArray[Simplify@Normal@Flatten[ (\[Lambda]4S+\[Lambda]3DSS)]]//Sort; -If[HelpList[[1]]==0&&Length[HelpList]>1, - HelpList=Delete[HelpList,1]; -]; -HelpVar=Table[\[Lambda]SS[a],{a,1,HelpList//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveQuarticS=Table[{HelpList[[a]]->HelpVarMod[[a]]},{a,1,HelpList//Length}]//Flatten; -\[Lambda]3DSS=(\[Lambda]4S+\[Lambda]3DSS)//Normal//Simplify//ReplaceAll[#,HelpSolveQuarticS]&//SparseArray; - - - -(*Cubic Tensor*) -HelpList=DeleteDuplicates@SparseArray[Flatten@Simplify[(\[Lambda]3CSSS+\[Lambda]3CLight)]]//Sort//FullSimplify; -If[HelpList[[1]]==0&&Length[HelpList]>1, - HelpList=Delete[HelpList,1]; -]; -HelpVar=Table[cSSSS[a],{a,1,HelpList//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveCubicSSS=Table[{HelpList[[a]]->HelpVarMod[[a]]},{a,1,HelpList//Length}]//Flatten//Simplify; -\[Lambda]3CSRedSS=(\[Lambda]3CSSS+\[Lambda]3CLight)//Normal//Simplify//FullSimplify//ReplaceAll[#,HelpSolveCubicSSS]&//SparseArray; -(*Scalar-Vector Tensor*) - -HelpList=DeleteDuplicates@Simplify@Flatten[(HabijVL+GvvssTSS)]//Sort; -If[HelpList[[1]]==0&&Length[HelpList]>1, - HelpList=Delete[HelpList,1]; -]; -HelpVar=Table[ \[Lambda]VTSS[a],{a,1,HelpList//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveVecTS=Table[{HelpList[[a]]->HelpVarMod[[a]]},{a,1,HelpList//Length}]//Flatten; -\[Lambda]KVecTSS= (HabijVL+GvvssTSS)//Normal//Simplify//ReplaceAll[#,HelpSolveVecTS]&//SparseArray; - - -(*Scalar Mass*) -If[mode>=2, -HelpList=DeleteDuplicates@Flatten@Simplify[ xLO \[Mu]ijLight+xLO \[Mu]ijSSLO+xNLO(\[Mu]ijSSNLO+\[Mu]ijSSNLO2)]//Sort; -If[HelpList[[1]]==0&&Length[HelpList]>1, - HelpList=Delete[HelpList,1]; -]; -HelpVar=Table[ \[Mu]ijSS[a],{a,1,HelpList//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveMassS=Table[{HelpList[[a]]->HelpVarMod[[a]]},{a,1,HelpList//Length}]//Simplify//Flatten; -\[Mu]ijSNLOSS=xLO \[Mu]ijLight+xLO \[Mu]ijSSLO+xNLO(\[Mu]ijSSNLO+\[Mu]ijSSNLO2)//Normal//Simplify//ReplaceAll[#,HelpSolveMassS]&//SparseArray; -, -HelpList=DeleteDuplicates@Flatten@Simplify[ xLO \[Mu]ijLight+xLO \[Mu]ijSSLO]//Sort; -If[HelpList[[1]]==0&&Length[HelpList]>1, - HelpList=Delete[HelpList,1]; -]; -HelpVar=Table[ \[Mu]ijSS[a],{a,1,HelpList//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveMassS=Table[{HelpList[[a]]->HelpVarMod[[a]]},{a,1,HelpList//Length}]//Simplify//Flatten; -\[Mu]ijSNLOSS=xLO \[Mu]ijLight+xLO \[Mu]ijSSLO//Normal//Simplify//ReplaceAll[#,HelpSolveMassS]&//SparseArray; -]; - -(*Scalar Tadpoles*) -HelpList=DeleteDuplicates@Flatten@Simplify[ TadPoleLightSS]//Sort; -If[HelpList[[1]]==0&&Length[HelpList]>1, - HelpList=Delete[HelpList,1]; -]; -HelpVar=Table[ dSS[a],{a,1,HelpList//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveTadpoleSS=Table[{HelpList[[a]]->HelpVarMod[[a]]},{a,1,HelpList//Length}]//Flatten; -TadPoleSSSLO=TadPoleLightSS//Normal//Simplify//ReplaceAll[#,HelpSolveTadpoleSS]&//SparseArray; - - - -IdentMatSS=List/@Join[HelpSolveQuarticS,HelpSolveVecTS,HelpSolveMassS,HelpSolveCubicSSS,HelpSolveTadpoleSS]/.{b_->a_}:>a->b//Flatten[#,1]&; - -]; - - -{TadPoleSSSLO}; - - -(* - Prints tadpoles. -*) -PrintTadpolesUS[optP_]:=Module[{opt=optP}, -If[verbose,Print["Printing Scalar Masses"]]; - -VarGauge=Join[TadPoleLight//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["US"]],{c,VarGauge}]; - - -\[Lambda]1p=TadPoleLight//Normal//ReplaceAll[#,SubGauge]&; -var=Normal[\[Lambda]1p]//Variables; -helpMass=Normal[\[Lambda]1p-TadPoleSSSLO]; -ResScalp=Reduce[helpMass==0,var]//ToRules[#]&; -SolveTemp=var/.ResScalp; -SolTadpole=Table[{var[[i]]->SolveTemp[[i]]},{i,1,Length@var}]//Flatten[#,1]&//ReplaceAll[#,IdentMatSS]&; - -ToExpression[StringReplace[ToString[StandardForm[Join[SolTadpole]]],"DRalgo`Private`"->""]] - -]; - - -(* - Prints scalar masses. -*) -PrintScalarMassUS[optP_]:=Module[{opt=optP}, -If[verbose,Print["Printing Scalar Masses"]]; - -VarGauge=Join[\[Mu]ijLight//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["US"]],{c,VarGauge}]; - -\[Mu]ijp=\[Mu]ijLight//Normal//ReplaceAll[#,SubGauge]&; -var=Normal[\[Mu]ijp]//Variables; -helpMass=Normal[\[Mu]ijp-\[Mu]ijSNLOSS]; -ResScalp=Reduce[helpMass==0,var]//ToRules[#]&; -SolveTemp=var/.ResScalp; -SolMassPre=Table[{var[[i]]->SolveTemp[[i]]},{i,1,Length@var}]//Flatten[#,1]&//ReplaceAll[#,IdentMatSS]&; - - -If[opt=="LO", -SolMass=SolMassPre/.xLO->1/.xNLO->0; -, -SolMass=SolMassPre/.xLO->0/.xNLO->1; -]; -(*Printing Result*) -ToExpression[StringReplace[ToString[StandardForm[Join[SolMass]]],"DRalgo`Private`"->""]] - -]; - - -PrintIdentificationUS[]:=Module[{}, -ToExpression[StringReplace[ToString[StandardForm[Join[IdentMatSS]]],"DRalgo`Private`"->""]] -]; - - -PrintTensorUSDRalgo[]:=Module[{}, -Print["Order of Tensors: (1) Scalar Quartic, (2) Vector-Scalar Couplings, (3) Scalar Mass"]; -ToExpression[StringReplace[ToString[StandardForm[Join[\[Lambda]3DSS,\[Lambda]KVecTSS,\[Mu]ijSNLOSS]]],"DRalgo`Private`"->""]] -]; - - -(* - Calculates the 1-loop scalar mass. -*) -ScalarMassSS[]:=Module[{}, -If[verbose,Print["Calculating 1-Loop Scalar Mass"]]; - -SelfEnergySS=1/(4\[Pi]); -ContriSS=SelfEnergySS/2*Simplify[Table[Sum[\[Lambda]3Cx[[i,ii,jj]]\[Lambda]3Cx[[j,ii,jj]]/(\[Mu]ijL[[ii,ii]]+\[Mu]ijL[[jj,jj]]),{ii,1,nSH},{jj,1,nSH}],{i,1,nSL},{j,1,nSL}]]; -ContriSS2=SelfEnergySS*Simplify[Table[Sum[\[Lambda]3Cy[[i,ii,jj]]\[Lambda]3Cy[[j,ii,jj]]/(\[Mu]ijL[[jj,jj]]),{ii,1,nSL},{jj,1,nSH}],{i,1,nSL},{j,1,nSL}]]; - -ContriTadpole=Table[Sum[\[Lambda]3Cy[[i,j,ll]]TadPoleHeavy[[ll]]/(\[Mu]ijL[[ll,ll]]^2),{ll,1,nSH}],{i,1,nSL},{j,1,nSL}]; - -ContriSS3=1/(4 \[Pi])/2 Simplify[Table[Sum[ \[Mu]ijL[[a,a]]\[Lambda]K[[a,a,i,j]],{a,1,nSH}],{i,1,nSL},{j,1,nSL}]]; - - -\[Mu]ijSSLO=-ContriSS3-ContriSS-ContriSS2-ContriTadpole//SparseArray; - -]; - - -(* - Adds tree-level Corrections to Scalar-quartic couplings. -*) -ScalarModifiedSS[]:=Module[{}, -If[verbose,Print["Adding tree-level Corrections to Scalar Quartics"]]; - -ContriTLTemp=-Simplify[Table[Sum[1/(\[Mu]ijL[[n,n]]^2)\[Lambda]3Cy[[i,j,n]]\[Lambda]3Cy[[k,l,n]],{n,1,nSH}],{i,1,nSL},{j,1,nSL},{k,1,nSL},{l,1,nSL}]]; -ContriTL=Table[ContriTLTemp[[i,j,k,l]]+ContriTLTemp[[i,k,j,l]]+ContriTLTemp[[i,l,j,k]],{i,1,nSL},{j,1,nSL},{k,1,nSL},{l,1,nSL}]; -\[Lambda]Mod=\[Lambda]4S+ContriTL; -\[Lambda]4S=\[Lambda]Mod; - -ContriTLTemp=-Simplify[Table[Sum[1/(\[Mu]ijL[[n,n]]^2)\[Lambda]3CHeavy[[ii,jj,n]]\[Lambda]3Cy[[k,l,n]],{n,1,nSH}],{ii,1,nSH},{jj,1,nSH},{k,1,nSL},{l,1,nSL}]]; -ContriTLTemp2=-Simplify[Table[Sum[1/(\[Mu]ijL[[n,n]]^2)\[Lambda]3Cx[[k,ii,n]]\[Lambda]3Cx[[l,jj,n]],{n,1,nSH}],{ii,1,nSH},{jj,1,nSH},{k,1,nSL},{l,1,nSL}]]; -ContriTL=Table[ContriTLTemp[[ii,jj,k,l]]+ContriTLTemp2[[ii,jj,k,l]]+ContriTLTemp2[[jj,ii,k,l]],{ii,1,nSH},{jj,1,nSH},{k,1,nSL},{l,1,nSL}]; -\[Lambda]Mod=\[Lambda]K+ContriTL; -\[Lambda]K=\[Lambda]Mod; - -ContriTLTemp=-Simplify[Table[Sum[1/(\[Mu]ijL[[n,n]]^2)\[Lambda]3Cx[[i,jj,n]]\[Lambda]3Cy[[k,l,n]],{n,1,nSH}],{i,1,nSL},{k,1,nSL},{l,1,nSL},{jj,1,nSH}]]; -ContriTL=Table[ContriTLTemp[[i,k,l,jj]]+ContriTLTemp[[k,i,l,jj]]+ContriTLTemp[[l,k,i,jj]],{i,1,nSL},{k,1,nSL},{l,1,nSL},{jj,1,nSH}]; -\[Lambda]Mod=\[Lambda]y+ContriTL; -\[Lambda]y=\[Lambda]Mod; - - -ContriTLTemp=-Simplify[Table[Sum[1/(\[Mu]ijL[[n,n]]^2)\[Lambda]3CHeavy[[ii,jj,n]]\[Lambda]3Cx[[k,ll,n]],{n,1,nSH}],{k,1,nSL},{ii,1,nSH},{jj,1,nSH},{ll,1,nSH}]]; -ContriTL=Table[ContriTLTemp[[k,ii,jj,ll]]+ContriTLTemp[[k,ii,ll,jj]]+ContriTLTemp[[k,ll,jj,ii]],{k,1,nSL},{ii,1,nSH},{jj,1,nSH},{ll,1,nSH}]; -\[Lambda]Mod=\[Lambda]x+ContriTL; -\[Lambda]x=\[Lambda]Mod; - -MassHelp[0]:=0; -MassHelp[x_]:=1/(x); - -ContriTLTemp=-Simplify[Table[Sum[MassHelp[\[Mu]ijLS[[n,n]]]^2 \[Lambda]3CTot[[i,j,n]]\[Lambda]3CTot[[k,l,n]],{n,1,ns}],{i,1,ns},{j,1,ns},{k,1,ns},{l,1,ns}]]; -ContriTL=Table[ContriTLTemp[[i,j,k,l]]+ContriTLTemp[[i,k,j,l]]+ContriTLTemp[[i,l,k,j]],{i,1,ns},{j,1,ns},{k,1,ns},{l,1,ns}]; -\[Lambda]4Tot=\[Lambda]3DSp+ContriTL; - - -\[Lambda]4Tot[[HeavyScalars[[;;,1]],HeavyScalars[[;;,1]],HeavyScalars[[;;,1]],HeavyScalars[[;;,1]]]]=\[Lambda]3DSp[[HeavyScalars[[;;,1]],HeavyScalars[[;;,1]],HeavyScalars[[;;,1]],HeavyScalars[[;;,1]]]]; - - -]; - - -(* - Calculates the scalar quartic in the ultrasoft theory. -*) -ScalarQuarticSS[]:=Module[{}, -If[verbose,Print["Calculating Scalar Quartics"]]; - - - -(*Maybe include Cubics later*) -(*Temp=0*Simplify[Table[Sum[(1/(\[Mu]ijL[[n,n]]^2))\[Lambda]3Cy[[i,j,n]]\[Lambda]3CHeavy[[k,l,n]],{n,1,nSH}],{k,1,nSH},{l,1,nSH},{i,1,nSL},{j,1,nSL}]];*) -\[Lambda]KEff=\[Lambda]K//SparseArray; -(*Temp=0*Simplify[Table[Sum[(1/(\[Mu]ijL[[n,n]]^2))\[Lambda]3Cy[[i,j,n]]\[Lambda]3Cx[[k,l,n]],{n,1,nSH}],{i,1,nSL},{j,1,nSL},{k,1,nSL},{l,1,nSH}]];*) -\[Lambda]yEff=\[Lambda]y//SparseArray; -(*\[Lambda]yEff2=Table[\[Lambda]y[[i,j,k,l]]-0*Temp[[i,j,k,l]]-0*Temp[[i,k,j,l]]-0*Temp[[k,j,i,l]],{i,1,nSL},{j,1,nSL},{k,1,nSL},{l,1,nSH}]//SparseArray;*) -\[Lambda]yEff2=\[Lambda]y; - -(*Loop level*) -MassVec=Table[\[Mu]ijL[[n,n]],{n,1,nSH}]; -TensHelp=Table[1/(n+m),{n,MassVec},{m,MassVec}]//SparseArray//Flatten[#,{1,2}]&; -AE2=Flatten[\[Lambda]KEff,{{1,2}}]//SparseArray; -Temp=1/2*1/(4 \[Pi])*Transpose[AE2,{3,2,1}] . (TensHelp\[NonBreakingSpace]AE2)//SparseArray; -ContriSS=3Symmetrize[Temp,Symmetric[{1,2,3,4}]]//SparseArray//SimplifySparse; - - -If[Length[\[Lambda]y//Normal//Variables]==0, -ContriSS2=EmptyArray[{nSL,nSL,nSL,nSL}]; -ContriSS3=EmptyArray[{nSL,nSL,nSL,nSL}]; -, -MassVec=Table[\[Mu]ijL[[n,n]],{n,1,nSH}]; -TensHelp=Table[1/(n),{n,MassVec}]//SparseArray; -AE2=TensHelp Transpose[\[Lambda]yEff,{4,2,3,1 }]//Flatten[#,{2,1}]& ; -Temp=1/(4 \[Pi]) Transpose[Flatten[\[Lambda]yEff,{3,4}],{3,2,1}] . AE2; -ContriSS2=3Symmetrize[Temp,Symmetric[{1,2,3,4}]]//SparseArray//SimplifySparse; - -TensHelp=Table[n/m^2,{m,MassVec},{n,MassVec}]//SparseArray; -TensHelp2=Transpose[\[Lambda]x,{4,2,3,1}]//Table[i,{i,#}]&//Table[#[[i,i]],{i,1,Length[#]}]&//SparseArray; -TensHelp3=TensHelp . TensHelp2//Table[i,{i,#}]&//Table[#[[i,i]],{i,1,Length[#]}]&//SparseArray; -ContriSS3=-1/(4 \[Pi])*1/2*4*Symmetrize[\[Lambda]yEff2 . TensHelp3,Symmetric[{1,2,3,4}]]//SparseArray//SimplifySparse; - -]; - - -If[Length[\[Lambda]3//Normal//Variables]==0, -\[Lambda]3DSS=-ContriSS-ContriSS2-ContriSS3; -, -ContriSETemp=ZSij . \[Lambda]4S//SparseArray; -ContriSE=ContriSETemp+Transpose[ContriSETemp,{2,1,3,4}]+Transpose[ContriSETemp,{3,1,2,4}]+Transpose[ContriSETemp,{4,1,2,3}]//SparseArray//SimplifySparse; - -TensHelp=Table[1/(n^2),{n,MassVec}]//SparseArray; -TensHelp2=TensorProduct[\[Lambda]3Cy,\[Lambda]3Cy]//DiagonalTensor2[#,3,6]&; -ContriTLTemp1=TensHelp . TensHelp2; -TensHelp=Table[1/(n^2*m^2),{n,MassVec},{m,MassVec}]//SparseArray; -TensHelp=\[Mu]HEff TensHelp; -ContriTLTemp2=\[Lambda]3Cy . TensHelp . Transpose[\[Lambda]3Cy,{3,2,1}]; -ContriTL=3 Symmetrize[ContriTLTemp1+ContriTLTemp2,Symmetric[{1,2,3,4}]]//SparseArray//SimplifySparse; - -TensHelp=Table[1/(n^2*m^2),{n,MassVec},{m,MassVec}]//SparseArray; -TensHelp2=TensorProduct[\[Lambda]yEff2,\[Lambda]3Cx,TadPoleHeavySS]//DiagonalTensor2[#,4,6]&//DiagonalTensor2[#,6,7]&; -Temp=-TensHelp . TensHelp2//TensorContract[#,{1,2}]&; -CouplingSSTadpole=4 Symmetrize[Temp,Symmetric[{1,2,3,4}]]//SparseArray//SimplifySparse; - - -(*TadPole*) -TensHelp=Table[1/(n^2*m^2),{n,MassVec},{m,MassVec}]//SparseArray; -TensHelp2=TensorProduct[\[Lambda]K,\[Lambda]3Cy,TadPoleHeavySS]//DiagonalTensor2[#,1,7]&//DiagonalTensor2[#,2,7]&; -Temp=-TensHelp . TensHelp2//TensorContract[#,{1,2}]&; -ContriTadpole=2*3 Symmetrize[Temp,Symmetric[{1,2,3,4}]]//SparseArray//SimplifySparse; - -Clear[MassHelp,MassHelp5,MassHelp2,MassHelp3]; -MassHelp5[x_]:=-(1/(4 \[Pi] x^3)); -MassHelp4[x_,y_,z_]:=1/(4 \[Pi] (x+y) (x+z) (y+z)); -MassHelp[x_,y_,w_,z_]:=(w+x+y+z)/(4 \[Pi] (w+x) (w+y) (w+z) (x+y) (x+z) (y+z)); -MassHelp2[w_,z_]:=-((w^2+w z+z^2)/(4 \[Pi] w^3 z^3 (w+z))); -MassHelp3[w_]:=1/(4 \[Pi] w^5); - -If[nSH>nv, -MassVec2=Table[\[Mu]ijL[[n,n]],{n,nv+1,nSH}]; -TensHelp=Table[MassHelp[n,m,l,o],{l,MassVec2},{m,MassVec2},{n,MassVec2},{o,MassVec2}]//SparseArray; -TensHelp=Delete[TensHelp//ArrayRules,-1]//ReplaceAll[#,{x_,y_,z_,w_}->{x+nv,y+nv,z+nv,w+nv}]&//SparseArray; -TensHelp2=TensorProduct[\[Lambda]3Cx,\[Lambda]3Cx]//DiagonalTensor2[#,3,5]&//TensorProduct[#,\[Lambda]3Cx]&//DiagonalTensor2[#,5,7]&//TensorProduct[#,\[Lambda]3Cx]&//DiagonalTensor2[#,7,10]&//DiagonalTensor2[#,5,9]&; -ContriSSSSTemp=Total[TensHelp TensHelp2,-5]; -ContriCubic1=2*3 Symmetrize[ContriSSSSTemp,Symmetric[{1,2,3,4}]]//SparseArray//SimplifySparse; - -TensHelp=Table[MassHelp[n,0,l,o],{l,MassVec2},{n,MassVec2},{o,MassVec2}]//SparseArray; -TensHelp=Delete[TensHelp//ArrayRules,-1]//ReplaceAll[#,{x_,y_,z_}->{x+nv,y+nv,z+nv}]&//SparseArray; -TensHelp2=TensorProduct[\[Lambda]3Cy,\[Lambda]3Cy]//TensorContract[#,{2,5}]&//TensorProduct[#,\[Lambda]3Cx]&//DiagonalTensor2[#,4,6]&//TensorProduct[#,\[Lambda]3Cx]&//DiagonalTensor2[#,6,9]&//DiagonalTensor2[#,4,8]&; -ContriSSSSTemp=Total[TensHelp TensHelp2,-5]; -ContriCubic2=12 Symmetrize[ContriSSSSTemp,Symmetric[{1,2,3,4}]]//SparseArray//SimplifySparse; - -TensHelp=Table[MassHelp2[n,o],{n,MassVec2},{o,MassVec2}]//SparseArray; -TensHelp=Delete[TensHelp//ArrayRules,-1]//ReplaceAll[#,{x_,y_}->{x+nv,y+nv}]&//SparseArray; -TensHelp2=Transpose[\[Lambda]3Cy,{3,2,1}] . \[Lambda]3CLight . \[Lambda]3Cy//TensorProduct[#,\[Lambda]3Cx]&//DiagonalTensor2[#,1,8]&//DiagonalTensor2[#,5,7]&; -ContriSSSSTemp=Total[TensHelp TensHelp2,-5]; -ContriCubic3=4! Symmetrize[ContriSSSSTemp,Symmetric[{1,2,3,4}]]//SparseArray//SimplifySparse; - -TensHelp=Table[MassHelp2[n,o],{n,MassVec2},{o,MassVec2}]//SparseArray; -TensHelp=Delete[TensHelp//ArrayRules,-1]//ReplaceAll[#,{x_,y_}->{x+nv,y+nv}]&//SparseArray; -TensHelp2=TensorProduct[Transpose[\[Lambda]3Cy,{3,2,1}] . \[Lambda]3Cy, Transpose[\[Lambda]3Cy,{3,2,1}] . \[Lambda]3Cy]//DiagonalTensor2[#,1,8]&//DiagonalTensor2[#,4,5]&; -ContriSSSSTemp=Total[TensHelp TensHelp2,-5]; -ContriCubic4=3! Symmetrize[ContriSSSSTemp,Symmetric[{1,2,3,4}]]//SparseArray//SimplifySparse; - -TensHelp=Table[MassHelp3[n],{n,MassVec2}]//SparseArray; -TensHelp=ReplaceAll[#,{y_}->{y+nv}]&/@Delete[TensHelp//ArrayRules,-1]//SparseArray; -TensHelp2=Transpose[\[Lambda]3Cy,{3,2,1}] . \[Lambda]3CLight . \[Lambda]3CLight . \[Lambda]3Cy//DiagonalTensor2[#,1,6]&; -ContriSSSSTemp=TensHelp . TensHelp2; -ContriCubic5=3! Symmetrize[ContriSSSSTemp,Symmetric[{1,2,3,4}]]//SparseArray//SimplifySparse; - -TensHelp=Table[MassHelp4[n,m,l],{n,MassVec2},{m,MassVec2},{l,MassVec2}]//SparseArray; -TensHelp=Delete[TensHelp//ArrayRules,-1]//ReplaceAll[#,{x_,y_,z_}->{x+nv,y+nv,z+nv}]&//SparseArray; -TensHelp2=TensorProduct[\[Lambda]K,\[Lambda]3Cx]//DiagonalTensor2[#,1,6]&//TensorProduct[#,\[Lambda]3Cx]&//DiagonalTensor2[#,2,8]&//DiagonalTensor2[#,6,8]&; -ContriSSSSTemp=Total[TensHelp TensHelp2,-5]; -ContriCubic6=-3! Symmetrize[ContriSSSSTemp,Symmetric[{1,2,3,4}]]//SparseArray//SimplifySparse; - -TensHelp=Table[MassHelp4[n,m,0],{n,MassVec2},{m,MassVec2}]//SparseArray; -TensHelp=Delete[TensHelp//ArrayRules,-1]//ReplaceAll[#,{x_,y_}->{x+nv,y+nv}]&//SparseArray; -TensHelp2=Transpose[\[Lambda]3Cy,{3,2,1}] . \[Lambda]3Cy//TensorProduct[\[Lambda]K,#]&//DiagonalTensor2[#,1,5]&//DiagonalTensor2[#,2,7]&; -ContriSSSSTemp=Total[TensHelp TensHelp2,-5]; -ContriCubic7=-3! Symmetrize[ContriSSSSTemp,Symmetric[{1,2,3,4}]]//SparseArray//SimplifySparse; - -TensHelp=Table[MassHelp5[n],{n,MassVec2}]//SparseArray; -TensHelp=ReplaceAll[#,{y_}->{y+nv}]&/@Delete[TensHelp//ArrayRules,-1]//SparseArray; -TensHelp2=\[Lambda]3CLight . \[Lambda]3Cy//TensorProduct[\[Lambda]y,#]&//TensorContract[#,{3,5}]&//DiagonalTensor2[#,3,6]&; -ContriSSSSTemp=TensHelp . TensHelp2; -ContriCubic8=-3! Symmetrize[ContriSSSSTemp,Symmetric[{1,2,3,4}]]//SparseArray//SimplifySparse; - -TensHelp=Table[MassHelp4[n,m,0],{n,MassVec2},{m,MassVec2}]//SparseArray; -TensHelp=Delete[TensHelp//ArrayRules,-1]//ReplaceAll[#,{x_,y_}->{x+nv,y+nv}]&//SparseArray; -TensHelp2=Transpose[\[Lambda]y,{1,2,4,3}] . \[Lambda]3Cy//TensorProduct[#,\[Lambda]3Cx]&//DiagonalTensor2[#,3,8]&//DiagonalTensor2[#,5,7]&; -ContriSSSSTemp=Total[TensHelp TensHelp2,-5]; -ContriCubic9=-3! Symmetrize[ContriSSSSTemp,Symmetric[{1,2,3,4}]]//SparseArray//SimplifySparse; - -(* -ContriSSSSTemp=-Table[Sum[\[Lambda]4S[[i,j,n,m]]\[Lambda]3Cy[[k,n,l]]\[Lambda]3Cx[[t,m,l]] MassHelp5[\[Mu]ijL[[l,l]]],{n,1,nSL},{m,1,nSL},{l,nv+1,nSH}],{i,1,nSL},{j,1,nSL},{k,1,nSL},{t,1,nSL}]//Simplify//SparseArray; -ContriCubic10=Table[(ContriSSSSTemp[[i,j,k,t]])+(ContriSSSSTemp[[i,k,j,t]])+(ContriSSSSTemp[[i,t,k,j]])+(ContriSSSSTemp[[k,t,i,j]])+(ContriSSSSTemp[[k,j,i,t]])+(ContriSSSSTemp[[j,t,i,k]]),{i,1,nSL},{j,1,nSL},{k,1,nSL},{t,1,nSL}]; -*) -\[Lambda]3DSS=ContriSE-ContriTL-CouplingSSTadpole- ContriSS-ContriSS2-ContriSS3-ContriCubic1-ContriCubic2-ContriCubic3-ContriCubic4-ContriCubic5-ContriCubic6-ContriCubic7-ContriCubic8-ContriCubic9; - -, - -\[Lambda]3DSS=ContriSE-ContriTL-CouplingSSTadpole- ContriSS-ContriSS2-ContriSS3; -]; - -]; - -]; - - -(* - Calculates non-abelian couplings in the ultrasoft theory. -*) -NonAbelianCouplingSS[]:=Module[{}, -ContriAnomVV= gvvvSS . Transpose[ZLij]//SparseArray//SimplifySparse; -(*Simplify[Table[Sum[ ZLij[[c,d]]gvvvSS[[a,b,d]],{d,1,nv}],{a,1,nv},{b,1,nv},{c,1,nv}]];*) -GgvvvSS=-ContriAnomVV; -]; - - -(* - Calculates vector couplings in the ultrasoft theory. -*) -ScalarVectorCouplingSS[]:=Module[{}, -If[verbose,Print["Calculating Vector-Scalar Couplings"]]; - - -(* Self-Energy contribution*) -ContriSEVector=-ZLij . HabijVL-Transpose[ZLij . HabijVL,{2,1,3,4}]; -(*ContriSEVector=-Simplify[Table[Sum[ZLij[[a,c]](HabijVL[[c,b,i,j]])+ZLij[[b,c]](HabijVL[[a,c,i,j]]),{c,1,nv}],{a,1,nv},{b,1,nv},{i,1,nSL},{j,1,nSL}]];*) - - -GvvssTSS= ContriSEVector//Simplify; - -]; - - -(* - Calculates the transverse-vector self energy. -*) -VectorSelfEnergySS[]:=Module[{}, -If[verbose,Print["Calculating Vector Self-Energy"]]; - -SelfEnergySS=-1/2*(-1/(24 \[Pi])); -ContriSS=SelfEnergySS*Simplify[Table[Sum[HabijA[[a,b,i,i]]/\[Mu]ijL[[i,i]],{i,1,nSH}],{a,1,nv},{b,1,nv}]]; -ZLij=-ContriSS/2; -]; - - -{DiaRules,RotRules};(*Diagonalization matrix and masses*) - - -(* - Prepares the reduction to the ultrasoft scale. Here scalars are divided into heavy and soft depending on the user's input. - Heavy scalars are then grouped with temporal scalars and integrated out. -*) -PrepareSoftToSuperSoft[ListHardI_]:=Module[{ListP=ListHardI}, - -(*Fix for Non-diagonal Debye masses*) -(*************************) - -(* - Here we take the "Damn the torpedo, full speed ahead" approach. -*) - -HeavyScalars=Transpose[List@ListP]; (*The list of all heavy scalars*) - -(* - Renames 4d couplings to 3d ones -*) - -VarQuartic=Join[\[Lambda]4//Normal//Variables]//DeleteDuplicates; -SubQuartic=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarQuartic}]; -\[Lambda]3DSp= \[Lambda]4//Normal//ReplaceAll[#,SubQuartic]&//SparseArray; - -VarCubic=Join[\[Lambda]3//Normal//Variables]//DeleteDuplicates; -SubCubic=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarCubic}]; -\[Lambda]3CSRedUS=\[Lambda]3//Normal//ReplaceAll[#,SubCubic]&//SparseArray; - -VarMass=Join[\[Mu]ij//Normal//Variables]//DeleteDuplicates; -SubMass=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarMass}]; -\[Mu]ijSNLOP=\[Mu]ij//Normal//ReplaceAll[#,SubMass]&//SparseArray; - - - -If[Length[HeavyScalars]<1,HScal=False,HScal=True]; - -TotScalar=Table[{i},{i,1,ns}]; -LightScalar=Delete[TotScalar,HeavyScalars]; -nSH=nv+(HeavyScalars//Length); (*Adds heavy scalars to the temporal scalars*) -nSL=ns-(HeavyScalars//Length); (*Removes heavy scalars from the scalars*) - -\[Mu]ijLS=Sqrt[\[Mu]ijSNLOP]//SparseArray; (*Rewrites squared masses as masses. Just a trick to make things easier.*) -\[Mu]ijLS[[LightScalar[[;;,1]],LightScalar[[;;,1]]]]=0; - -VarGauge=GaugeCouplingNames; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarGauge}]; -gvvvSS=gvvv//Normal//ReplaceAll[#,SubGauge]&//SparseArray; - - -If[HScal, -(*Quartic Tensor*) -(* - Here we create couplings between light and heavy scalarws. -*) -\[Lambda]4Light=Table[\[Lambda]3DSp[[a,b,c,d]],{a,LightScalar[[;;,1]]},{b,LightScalar[[;;,1]]},{c,LightScalar[[;;,1]]},{d,LightScalar[[;;,1]]}]//SparseArray; (*Light-scalar part of scalar quartic*) -\[Lambda]4Heavy=Table[\[Lambda]3DSp[[a,b,c,d]],{a,HeavyScalars[[;;,1]]},{b,HeavyScalars[[;;,1]]},{c,HeavyScalars[[;;,1]]},{d,HeavyScalars[[;;,1]]}]//SparseArray; (*Heavy-scalar part of scalar quartic*) -\[Lambda]KHeavy=Table[\[Lambda]KVec[[a,b,c,d]],{a,1,nv},{b,1,nv},{c,HeavyScalars[[;;,1]]},{d,HeavyScalars[[;;,1]]}]//SparseArray; (*Heavy-scalar part of the scalar-temporalScal couplings*) - - -A1=Delete[\[Lambda]4Heavy//ArrayRules,-1]//ReplaceAll[#,{x_,y_,z_,w_}->{x+nv,y+nv,z+nv,w+nv}]&; -A2=ReplaceAll[Delete[\[Lambda]KHeavy//ArrayRules,-1],({x_,y_,z_,w_}->a_)->{x,y,z+nv,w+nv}->a]; -A3=Delete[\[Lambda]AAS//ArrayRules,-1]; -\[Lambda]KTotal=SymmetrizedArray[Join[A1,A2,A3],{nSH,nSH,nSH,nSH},Symmetric[{1,2,3,4}]]//SparseArray; (*Total heavy-scalar tensors: Heavy scalars+Temporal scalars*) - -(*TadPoles*) -VarTadpole=Join[\[Lambda]1//Normal//Variables]//DeleteDuplicates; -SubTadpole=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarTadpole}]; - -TadPoleLight=Table[\[Lambda]1[[a]],{a,LightScalar[[;;,1]]}]//ReplaceAll[#,SubTadpole]&//SparseArray; -TadPoleTemp=Table[\[Lambda]1[[a]],{a,HeavyScalars[[;;,1]]}]//ReplaceAll[#,SubTadpole]&//SparseArray; - - -If[Length[TadPoleTemp//ArrayRules]==1, -TadPoleHeavy=SymmetrizedArray[{{1}->0},{nSH},Symmetric[{1}]]//SparseArray; -, -TadPoleHeavy=Delete[TadPoleTemp//ArrayRules//ReplaceAll[#,{x_}->{x+nv}]&,-1]//SparseArray; -]; - - -\[Lambda]x1=Table[\[Lambda]3DSp[[a,b,c,d]],{a,LightScalar[[;;,1]]},{b,HeavyScalars[[;;,1]]},{c,HeavyScalars[[;;,1]]},{d,HeavyScalars[[;;,1]]}]//SparseArray; -\[Lambda]y1=Table[\[Lambda]3DSp[[a,b,c,d]],{a,LightScalar[[;;,1]]},{b,LightScalar[[;;,1]]},{c,LightScalar[[;;,1]]},{d,HeavyScalars[[;;,1]]}]//SparseArray; - - -If[Length[\[Lambda]x1//ArrayRules]==1, -\[Lambda]x=SymmetrizedArray[{{1,1,1,1}->0},{nSL,nSH,nSH,nSH},Symmetric[{2,3,4}]]//SparseArray; -, -\[Lambda]x=Delete[\[Lambda]x1//ArrayRules//ReplaceAll[#,{x_,y_,z_,w_}->{x,y+nv,z+nv,w+nv}]&,-1]//SparseArray; -]; - -If[Length[\[Lambda]y1//ArrayRules]==1, -\[Lambda]y=SymmetrizedArray[{{1,1,1,1}->0},{nSL,nSL,nSL,nSH},Symmetric[{1,2,3}]]//SparseArray; -, -\[Lambda]y=Delete[\[Lambda]y1//ArrayRules//ReplaceAll[#,{x_,y_,z_,w_}->{x,y,z,w+nv}]&,-1]//SparseArray; -]; - - -(*Mixed Cubic tensors*) -\[Lambda]3CLight=Table[\[Lambda]3CSRedUS[[a,b,c]],{a,LightScalar[[;;,1]]},{b,LightScalar[[;;,1]]},{c,LightScalar[[;;,1]]}]//SparseArray; -\[Lambda]3CHeavy1=Table[\[Lambda]3CSRedUS[[a,b,c]],{a,HeavyScalars[[;;,1]]},{b,HeavyScalars[[;;,1]]},{c,HeavyScalars[[;;,1]]}]//SparseArray; -\[Lambda]3CTot=\[Lambda]3CSRedUS//SparseArray; - -If[Length[\[Lambda]3CHeavy1//ArrayRules]==1, -\[Lambda]3CHeavy=SymmetrizedArray[{{1,1,1}->0},{nSH,nSH,nSH},Symmetric[{2,3}]]//SparseArray; -, -\[Lambda]3CHeavy=Delete[\[Lambda]3CHeavy1//ArrayRules//ReplaceAll[#,{x_,y_,z_}->{x+nv,y+nv,z+nv}]&,-1]//SparseArray; -]; - - -\[Lambda]3Cx1=Table[\[Lambda]3CSRedUS[[a,b,c]],{a,LightScalar[[;;,1]]},{b,HeavyScalars[[;;,1]]},{c,HeavyScalars[[;;,1]]}]//SparseArray; -\[Lambda]3Cy1=Table[\[Lambda]3CSRedUS[[a,b,c]],{a,LightScalar[[;;,1]]},{b,LightScalar[[;;,1]]},{c,HeavyScalars[[;;,1]]}]//SparseArray; - - -If[Length[\[Lambda]3Cx1//ArrayRules]==1, -\[Lambda]3Cx=SymmetrizedArray[{{1,1,1}->0},{nSL,nSH,nSH},Symmetric[{2,3}]]//SparseArray; -, -\[Lambda]3Cx=Delete[\[Lambda]3Cx1//ArrayRules//ReplaceAll[#,{x_,y_,z_}->{x,y+nv,z+nv}]&,-1]//SparseArray; -]; - - - -If[Length[\[Lambda]3Cy1//ArrayRules]==1, -\[Lambda]3Cy=SymmetrizedArray[{{1,1,1}->0},{nSL,nSL,nSH},Symmetric[{1,2}]]//SparseArray; -, -\[Lambda]3Cy=Delete[\[Lambda]3Cy1//ArrayRules//ReplaceAll[#,{x_,y_,z_}->{x,y,z+nv}]&,-1]//SparseArray; -]; - -(*Mixed Hard-Soft mass matrix*) -\[Mu]ijMix1=Table[\[Mu]ij[[a,b]],{a,LightScalar[[;;,1]]},{b,HeavyScalars[[;;,1]]}]//SparseArray; - -If[Length[\[Mu]ijMix1//ArrayRules]==1, -\[Mu]ijMix=SymmetrizedArray[{{1,1}->0},{nSL,nSH},Symmetric[{1}]]//SparseArray; -, -\[Mu]ijMix=Delete[\[Mu]ijMix1//ArrayRules//ReplaceAll[#,{x_,y_}->{x,y+nv}]&,-1]//SparseArray; -]; - - -(*Scalar-Temporal-Vector Tensor*) -\[Lambda]KVLight=Table[\[Lambda]KVec[[a,b,c,d]],{a,1,nv},{b,1,nv},{c,LightScalar[[;;,1]]},{d,LightScalar[[;;,1]]}]//SparseArray; -\[Lambda]KVHeavy=Table[\[Lambda]3DSp[[a,b,c,d]],{a,HeavyScalars[[;;,1]]},{b,HeavyScalars[[;;,1]]},{c,LightScalar[[;;,1]]},{d,LightScalar[[;;,1]]}]//SparseArray; -A1=Delete[\[Lambda]KVLight//ArrayRules,-1]; -A2=Delete[\[Lambda]KVHeavy//ArrayRules//ReplaceAll[#,{x_,y_,z_,w_}->{x+nv,y+nv,z,w}]&,-1]; -\[Lambda]kVTot=SparseArray[Join[A1,A2]]//SparseArray; - - -VarGauge=GaugeCouplingNames; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarGauge}]; - - -(*Heavy-Scalar-Vector Tensor*) -gvssHeavy=Table[gvss[[a,b,c]],{a,1,nv},{b,HeavyScalars[[;;,1]]},{c,HeavyScalars[[;;,1]]}]//ReplaceAll[#,SubGauge]&//SparseArray; -gvssVec=gvvv//Normal//ReplaceAll[#,SubGauge]&//SparseArray; -gvssVTot=Table[ArrayFlatten[{{gvssVec[[a]],0},{0,gvssHeavy[[a]]}}],{a,1,Length[gvssVec]}]//SparseArray; - -(*Light-Scalar-Vector Tensor*) -gvssL=Table[gvss[[a,c,d]],{a,1,nv},{c,LightScalar[[;;,1]]},{d,LightScalar[[;;,1]]}]//Normal//ReplaceAll[#,SubGauge]&//SparseArray; - -(*Heavy-Mass matrix*) -MassHeavy=Table[\[Mu]ijSNLOP[[a,b]],{a,HeavyScalars[[;;,1]]},{b,HeavyScalars[[;;,1]]}]//SparseArray; -\[Mu]ijL=ArrayFlatten[{{Sqrt[\[Mu]abDef],0},{0,Sqrt[MassHeavy]}}]//SparseArray; - -(*Light-Mass matrix*) -MassLight=Table[\[Mu]ijSNLOP[[a,b]],{a,LightScalar[[;;,1]]},{b,LightScalar[[;;,1]]}]//SparseArray; -\[Mu]ijLight=ArrayFlatten[MassLight]//SparseArray; - -\[Lambda]K=\[Lambda]kVTot//SparseArray; -\[Lambda]4S=\[Lambda]4Light//SparseArray; -\[Lambda]4K=\[Lambda]KTotal//SparseArray; -gAvss=gvssVTot//SparseArray; -ToExpression[StringReplace[ToString[StandardForm[Join[\[Lambda]K,\[Lambda]4S,\[Lambda]4K,\[Lambda]x,\[Lambda]y,gAvss,gvssL,\[Mu]ijL]]],"DRalgo`Private`"->""]]; - -, -\[Lambda]3CTot=\[Lambda]3CSRedUS//SparseArray; -A3=Delete[\[Lambda]AAS//ArrayRules,-1]; -\[Lambda]KTotal=SymmetrizedArray[A3,{nSH,nSH,nSH,nSH},Symmetric[{1,2,3,4}]]//SparseArray; -\[Lambda]3Cx=SymmetrizedArray[{{1,1,1}->0},{nSL,nSH,nSH},Symmetric[{2,3}]]//SparseArray; -\[Lambda]3Cx=Table[\[Lambda]vvsLS[[b,c,a]],{a,LightScalar[[;;,1]]},{b,1,nv},{c,nv}]//SparseArray; -\[Lambda]3CHeavy=SymmetrizedArray[{{1,1,1}->0},{nSH,nSH,nSH},Symmetric[{1,2,3}]]//SparseArray; -\[Lambda]3Cy=SymmetrizedArray[{{1,1,1}->0},{nSL,nSL,nSH},Symmetric[{1,2}]]//SparseArray; -\[Lambda]x=SymmetrizedArray[{{1,1,1,1}->0},{nSL,nSH,nSH,nSH},Symmetric[{2,3,4}]]//SparseArray; -\[Lambda]y=SymmetrizedArray[{{1,1,1,1}->0},{nSL,nSL,nSL,nSH},Symmetric[{1,2,3}]]//SparseArray; -\[Mu]ijMix=SymmetrizedArray[{{1,1}->0},{nSL,nSH},Symmetric[{1}]]//SparseArray; -\[Lambda]3CLight=Table[\[Lambda]3CSRedUS[[a,b,c]],{a,LightScalar[[;;,1]]},{b,LightScalar[[;;,1]]},{c,LightScalar[[;;,1]]}]//SparseArray; -\[Lambda]4Light=Table[\[Lambda]3DSp[[a,b,c,d]],{a,LightScalar[[;;,1]]},{b,LightScalar[[;;,1]]},{c,LightScalar[[;;,1]]},{d,LightScalar[[;;,1]]}]//SparseArray; - -(*TadPoles*) -VarTadpole=Join[\[Lambda]1//Normal//Variables]//DeleteDuplicates; -SubTadpole=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarTadpole}]; - -TadPoleLight=Table[\[Lambda]1[[a]],{a,LightScalar[[;;,1]]}]//ReplaceAll[#,SubTadpole]&//SparseArray; -TadPoleHeavy=SymmetrizedArray[{{1}->0},{nSH},Symmetric[{1}]]//SparseArray; - -\[Lambda]KVLight=Table[\[Lambda]KVec[[a,b,c,d]],{a,1,nv},{b,1,nv},{c,LightScalar[[;;,1]]},{d,LightScalar[[;;,1]]}]//SparseArray; -\[Lambda]kVTot=\[Lambda]KVLight//SparseArray; - -VarGauge=GaugeCouplingNames; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarGauge}]; - -gvssVec=gvvv//Normal//ReplaceAll[#,SubGauge]&//SparseArray; -gvssVTot=gvssVec//SparseArray; -gvssL=Table[gvss[[a,c,d]],{a,1,nv},{c,LightScalar[[;;,1]]},{d,LightScalar[[;;,1]]}]//Normal//ReplaceAll[#,SubGauge]&//SparseArray; - -\[Mu]ijL=Sqrt[\[Mu]abDef]//Normal//SparseArray; -\[Mu]ijLight=\[Mu]ijSNLOP//Normal//SparseArray; - -\[Lambda]K=\[Lambda]kVTot//SparseArray; -\[Lambda]4S=\[Lambda]4Light//SparseArray; -\[Lambda]4K=\[Lambda]KTotal//SparseArray; -gAvss=gvssVTot//SparseArray; - -]; - - -]; - - -(* - Prints the beta functions in the ultrasoft theory. -*) -BetaFunctions3DUS[]:=Module[{}, -If[verbose,Print["Finding SuperSoft \[Beta]-functions"]]; - - -VarGauge=Join[\[Mu]ijLight//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["US"]],{c,VarGauge}]; - -(*This is the epsilon pole of the 3d sunset diagram. This is the only divergence in 3d.*) -I111=1/(4)1/(16 \[Pi]^2); - -Coeff=1/2*2; -Contri1=Coeff*Flatten[TensorContract[HabijL,{1,2}]] . Flatten[\[Lambda]4Light,{1,2}]; - -Coeff=-1/4*(-1); -Contri2=Coeff*Flatten[TensorContract[HabijL,{3,4}]] . Flatten[HabijVL,{1,2}]; - -Coeff=1/3!; -Contri3=Coeff *Flatten[\[Lambda]4Light,{{1},{2,3,4}}] . Flatten[\[Lambda]4Light,{{1,2,3}}]; - -Coeff=1/2*((1+1/2)); -Contri4=Coeff *Flatten[HabijVL,{{3},{1,2,4}}] . Flatten[HabijVL,{{1,2,4},{3}}]; - -Coeff=(-1)(-1/4) /2; -GabcdV2=TensorContract[GabcdV,{2,4}]; -Contri5=Coeff*Flatten[GabcdV2] . Flatten[HabijVL,{1,2}]; - -Coeff=(-1)(-1)1/4*(20/4); -Contri6=Coeff*Flatten[GabcdV2] . Flatten[HabijVL,{1,2}]; - - -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,GaugeCouplingNames}]; - -\[Delta]\[Mu]3dS=Contri1+ Contri2+ Contri3+ Contri4+ Contri5+ Contri6;(*Sum of all the diagrams*) -\[Beta]\[Mu]3ijS=4*I111* \[Delta]\[Mu]3dS//Normal //ReplaceAll[#,SubGauge]&//Simplify; (*The scalar-mass counter-term*) - -(*Printing Result*) -(* Scalar Mass*) -VarGauge=Join[\[Mu]ijLight//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->Symbol[ToString[c]<>ToString["US"]],{c,VarGauge}]; - - -GaugeHelp=Table[Symbol[ToString[c]<>ToString["3d"]],{c,GaugeCouplingNames}]; -VarUS=Join[{\[Lambda]3CLight//Normal//Variables,\[Lambda]4Light//Normal//Variables,GaugeHelp//Normal//Variables}]//DeleteDuplicates//Flatten[#,1]&; -SubUS=Table[c->Symbol[ToString[c]<>ToString["US"]],{c,VarUS}]; - - -\[Lambda]4p=\[Mu]ijLight//Normal//ReplaceAll[#,SubGauge]&//SparseArray; -SolVar=\[Beta]\[Mu]3ijS-\[Lambda]4p//Normal; -QuarticVar=\[Lambda]4p//Normal//Variables; -ResMass=Solve[SolVar==0,QuarticVar]/.SubGauge2/.SubUS//Flatten[#,1]&; (*Finds the beta-function for each scalar mass*) - - -(*Printing Result*) -PrintPre=ResMass//Normal//FullSimplify//DeleteDuplicates; - - - - -(*Tadpoles*) -\[CapitalLambda]gHelp=TensorContract[HabijL,{{1,2}}]//SimplifySparse; -Contri10=1/3!*I111*Activate@TensorContract[Inactive@TensorProduct[\[Lambda]4Light//SparseArray,\[Lambda]3CLight//SparseArray],{{2,5},{3,6},{4,7}}]; -Contri11=1/2*I111*2Activate@TensorContract[Inactive@TensorProduct[\[Lambda]3CLight//SparseArray,\[CapitalLambda]gHelp//SparseArray],{{2,4},{3,5}}]; - -VarGauge=GaugeCouplingNames; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["3d"]],{c,VarGauge}]; - -\[Delta]\[Mu]Tadpole3dUS=Contri10+Contri11//Normal//ReplaceAll[#,SubGauge]&//SparseArray;(*Same deal for tadpoles*) -\[Beta]\[Mu]TadpoleUS=4*\[Delta]\[Mu]Tadpole3dUS //Simplify; - -VarGauge=Join[TadPoleLight//Normal//Variables]//DeleteDuplicates; -SubGauge=Table[c->Symbol[ToString[c]<>ToString["temp"]],{c,VarGauge}]; -SubGauge2=Table[Symbol[ToString[c]<>ToString["temp"]]->Symbol[ToString[c]<>ToString["US"]],{c,VarGauge}]; - -\[Lambda]4p=TadPoleLight//Normal//ReplaceAll[#,SubGauge]&//SparseArray; -SolVar=\[Beta]\[Mu]TadpoleUS-\[Lambda]4p//Normal; -QuarticVar=\[Lambda]4p//Normal//Variables; -ResTadpole=Solve[SolVar==0,QuarticVar]/.SubGauge2/.SubUS//Flatten[#,1]&; (*Finds the beta-function for each scalar mass*) - -PrintPre=Join[PrintPre,ResTadpole]//Normal//FullSimplify//DeleteDuplicates; - -ToExpression[StringReplace[ToString[StandardForm[PrintPre]],"DRalgo`Private`"->""]] - - -]; - - -{Contri\[Beta]UltraSoftToSoft,ContriTadPoleUltraSoftToSoft}; - - -(* - Calculates the 1-loop tadpole in the ultrasoft theory. -*) -TadPoleSS[]:=Module[{}, -If[verbose,Print["Calculating 1-Loop Tadpoles"]]; - - -fac=-1/(4 \[Pi]); -ContriL1=-fac/2*Simplify[Table[Sum[\[Mu]ijL[[ii,ii]] \[Lambda]3Cx[[i,ii,ii]],{ii,1,nSH}],{i,1,nSL}]]; -ContriLSE=-ZSij . TadPoleLight; - -TadPoleLightSS=TadPoleLight+ContriLSE-ContriL1; - -ContriH1=-fac/2*Simplify[Table[Sum[\[Mu]ijL[[ii,ii]] \[Lambda]3CHeavy[[i,ii,ii]],{ii,1,nSH}],{i,1,nSH}]]; - -TadPoleHeavySS=TadPoleHeavy-ContriH1; -]; - - -(* - This is the mass that pops up if the heavy-scalar line carry a soft momenta -*) -HeavyScalarMassSS[]:=Module[{}, -fac=1/(4 \[Pi]); -Contri1=1/2 *fac*Simplify[Table[Sum[\[Lambda]3CHeavy[[i,ii,jj]]\[Lambda]3CHeavy[[j,ii,jj]]/(\[Mu]ijL[[ii,ii]]+\[Mu]ijL[[jj,jj]]),{ii,1,nSH},{jj,1,nSH}],{i,1,nSH},{j,1,nSH}]]; -fac=-1/(4 \[Pi]); -Contri2=-1/2*fac*Simplify[Table[Sum[\[Lambda]KTotal[[i,j,ii,ii]] \[Mu]ijL[[ii,ii]],{ii,1,nSH}],{i,1,nSH},{j,1,nSH}]]//FullSimplify; -fac=1/(4 \[Pi]); -Contri3=fac*Simplify[Table[Sum[\[Lambda]3Cx[[jj,ii,i]]\[Lambda]3Cx[[jj,ii,j]]/(\[Mu]ijL[[ii,ii]]),{ii,1,nSH},{jj,1,nSL}],{i,1,nSH},{j,1,nSH}]]; -Contri4=-Simplify[Table[Sum[TadPoleHeavySS[[ii]]\[Lambda]3CHeavy[[i,j,ii]]/(\[Mu]ijL[[ii,ii]]^2),{ii,1,nSH}],{i,1,nSH},{j,1,nSH}]]; - -HeavyScalarMass=Contri1+Contri2+Contri3+Contri4; - -HelpList=DeleteDuplicates@Flatten@Simplify[ HeavyScalarMass]//Sort; -HelpVar=Table[ \[Mu]H[a],{a,1,Delete[HelpList,1]//Length}]; -HelpVarMod=RelationsBVariables[HelpList,HelpVar]; -HelpSolveEffectiveHardM=Table[{Delete[HelpList,1][[a]]->HelpVarMod[[a]]},{a,1,Delete[HelpList,1]//Length}]//Flatten; -\[Mu]HEff=HeavyScalarMass//Normal//ReplaceAll[#,HelpSolveEffectiveHardM]&//SparseArray; - -]; - - -DiagonalTensor2[s_SparseArray,a_Integer,b_Integer] := With[ - { - s1=Flatten[s,{{a},{b}}] - }, - Table[i,{i,s1}]//Table[#[[i,i]],{i,1,Length[#]}]&//SparseArray - ] - - -DiagonalTensor[s_SparseArray,a_Integer,b_Integer]:= Module[{}, -If[a==1&&b==2, - PermTens=Table[i,{i,s}]//Table[#[[i,i]],{i,1,Length[#]}]&//SparseArray -, -If[a==1, - PermTens=Transpose[s,b<->2]; - PermTens=Table[i,{i,PermTens}]//Table[#[[i,i]],{i,1,Length[#]}]&//SparseArray; - Transpose[PermTens,(b-1)<->1] -, - PermTens=Transpose[s,a<->1]//Transpose[#,b<->2]&; - PermTens=Table[i,{i,PermTens}]//Table[#[[i,i]],{i,1,Length[#]}]&//SparseArray; - Transpose[PermTens,(a-1)<->1]//Transpose[#,(b-1)<->2]& -] -] - ] diff --git a/DRalgo/dralgo-manual.pdf b/DRalgo/dralgo-manual.pdf deleted file mode 100644 index 7713b45..0000000 Binary files a/DRalgo/dralgo-manual.pdf and /dev/null differ diff --git a/DRalgo/LICENSE b/LICENSE similarity index 92% rename from DRalgo/LICENSE rename to LICENSE index f288702..e587591 100644 --- a/DRalgo/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -618,57 +618,4 @@ an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/README.md b/README.md index 3efd3a9..1ad9303 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,97 @@ -## Dependencies for the Mathematica matrix elements generator +![WallGo](https://raw.githubusercontent.com/Wall-Go/WallGo/refs/heads/main/docs/source/figures/wallgo.svg) -# Required: +# WallGoMatrix -- DRalgo +**WallGoMatrix** is a Mathematica package for computing 2-to-2 scattering matrix +elements for arbitrary quantum field theories. It is part of the WallGo project +for computing the bubble wall speed for cosmological phase transitions. -- GroupMath +## Status + +**Version** v0.1.0 (alpha) + +## About this project + +[**WallGo**](https://github.com/Wall-Go) is an open source code for the +computation of the bubble wall velocity and bubble wall width in first-order +cosmological phase transitions. There is a main Python package together with +two subsidiary software packages. + +- [**WallGo**](https://github.com/Wall-Go/WallGo) is the name of the main Python +package. This determines the wall velocity and width by +solving the scalar field(s) equation of motion, the Boltzmann equations and +energy-momentum conservation for the fluid velocity and temperature. +- [**WallGoMatrix**](https://github.com/Wall-Go/WallGoMatrix) computes the relevant matrix elements for the +out-of-equilibrium particles, and is written in Mathematica. +It builds on existing Mathematica packages [DRalgo](https://github.com/DR-algo/DRalgo) and [GroupMath](https://renatofonseca.net/groupmath). +- [**WallGoCollision**](https://github.com/Wall-Go/WallGoCollision) performs the higher-dimensional integrals to obtain the + collision terms in the Boltzmann equations, and is written in C++. It also + has Python bindings so that it can be called directly from Python, but + still benefits from the speedup from compiled C++ code. + +Users can implement their own models. For WallGoMatrix, the model building +routines are taken from DRalgo, and involve constructing coupling tensors. +The WallGoMatrix routines then contract these coupling tensors with kinematic +factors appropriately to yield the 2-to-2 scattering matrix elements. + +## Installation + +**WallGoMatrix** can be installed as a Mathematica package by downloading the +zip file from the following link: + +![GitHub Downloads (package, latest release)](https://img.shields.io/github/downloads/Wall-Go/WallGo/latest/total) + +Unpack the zip file and then put the WallGoMatrix directory inside either the base +or the user Mathematica Applications directory. The locations of these directories +can be found by inspecting **$BaseDirectory** or **$UserBaseDirectory** within +Mathematica. For versions of Mathematica before 14.1, the paths are commonly the +following ones + +**Linux** +- /usr/share/Mathematica/Applications +- ~/.Mathematica/Applications + +**macOS** +- ~/Library/Mathematica/Applications/GroupMath + +**Windows** +- C:\ProgramData\Mathematica\Applications +- C:\Users\(computer name)\AppData\Roaming\Mathematica\Applications + +Note that from Mathematica 14.1 onwards this directory contains *Wolfram* rather than +*Mathematica*. + +Once the WallGoMatrix directory has been put inside the Mathematica applications +directory, the package can be loaded from within Mathematica using + + <. diff --git a/examples/2hdm.m b/examples/2hdm.m new file mode 100644 index 0000000..c539e57 --- /dev/null +++ b/examples/2hdm.m @@ -0,0 +1,210 @@ +(* ::Package:: *) + +Quit[]; + + +SetDirectory[NotebookDirectory[]]; +(*Put this if you want to create multiple model-files with the same kernel*) +$GroupMathMultipleModels=True; +$LoadGroupMath=True; +<<../src/WallGoMatrix.m + + +(* ::Chapter:: *) +(*2HDM*) + + +(*See 2211.13142 for implementation details*) + + +(* ::Section::Closed:: *) +(*Model*) + + +Group={"SU3","SU2","U1"}; +RepAdjoint={{1,1},{2},0}; +HiggsDoublet1={{{0,0},{1},1/2},"C"}; +HiggsDoublet2={{{0,0},{1},1/2},"C"}; +RepScalar={HiggsDoublet1,HiggsDoublet2}; +CouplingName={g3,gw,g1}; + + +Rep1={{{1,0},{1},1/6},"L"}; +Rep2={{{1,0},{0},2/3},"R"}; +Rep3={{{1,0},{0},-1/3},"R"}; +Rep4={{{0,0},{1},-1/2},"L"}; +Rep5={{{0,0},{0},-1},"R"}; +RepFermion1Gen={Rep1,Rep2,Rep3,Rep4,Rep5}; + + +(* ::Text:: *) +(*The input for the gauge interactions to DRalgo are then given by*) + + +RepFermion3Gen={RepFermion1Gen,RepFermion1Gen,RepFermion1Gen}//Flatten[#,1]&; + + +(* ::Text:: *) +(*The first element is the vector self-interaction matrix:*) + + +{gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC}=AllocateTensors[Group,RepAdjoint,CouplingName,RepFermion3Gen,RepScalar]; + + +InputInv={{1,1},{True,False}}; +MassTerm1=CreateInvariant[Group,RepScalar,InputInv]//Simplify//FullSimplify; +InputInv={{2,2},{True,False}}; +MassTerm2=CreateInvariant[Group,RepScalar,InputInv]//Simplify//FullSimplify; +InputInv={{1,2},{True,False}}; +MassTerm3=CreateInvariant[Group,RepScalar,InputInv]//Simplify//FullSimplify; +InputInv={{2,1},{True,False}}; +MassTerm4=CreateInvariant[Group,RepScalar,InputInv]//Simplify//FullSimplify; + + +VMass=( + +m1*MassTerm1 + +m2*MassTerm2 + ); + + +\[Mu]ij=GradMass[VMass[[1]]]//Simplify//SparseArray; + + +QuarticTerm1=MassTerm1[[1]]^2; +QuarticTerm2=MassTerm2[[1]]^2; +QuarticTerm3=MassTerm1[[1]]*MassTerm2[[1]]; +QuarticTerm4=MassTerm3[[1]]*MassTerm4[[1]]; +QuarticTerm5=(MassTerm3[[1]]^2+MassTerm4[[1]]^2)//Simplify; + + +VQuartic=( + +lam1H/2*QuarticTerm1 + +lam2H/2*QuarticTerm2 + +lam3H*QuarticTerm3 + +lam4H*QuarticTerm4 + +lam5H/2*QuarticTerm5 + ); + + +\[Lambda]4=GradQuartic[VQuartic]; + + +InputInv={{1,1,2},{False,False,True}}; +YukawaDoublet1=CreateInvariantYukawa[Group,RepScalar,RepFermion3Gen,InputInv]//Simplify; + + +Ysff=-GradYukawa[yt1*YukawaDoublet1[[1]]]; + + +YsffC=SparseArray[Simplify[Conjugate[Ysff]//Normal,Assumptions->{yt1>0}]]; + + +ImportModel[Group,gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC,Verbose->False]; + + +(* ::Section:: *) +(*MatrixElements*) + + +(* +In DRalgo fermions are Weyl. +So to create one Dirac we need +one left-handed and +one right-handed fermoon +*) + + +(* ::Subsection:: *) +(*TopL, TopR*) + + +vev={0,v,0,0,0,0,0,0}; +SymmetryBreaking[vev,VevDependentCouplings->True] (*uncomment if you want vev-dependent couplings*) +(*SymmetryBreaking[vev]*) + + +(*Third generation of fermions*) +ReptL=CreateParticle[{{1,1}},"F"]; +RepbL=CreateParticle[{{1,2}},"F"]; +ReptR=CreateParticle[{{2,1}},"F"]; + + +(*Vector bosons*) +RepGluon=CreateParticle[{1},"V"]; (*Gluons*) +RepW=CreateParticle[{{2,1}},"V"]; (*SU2 gauge bosons*) +RepB=CreateParticle[{3},"V"]; (*U1 gauge boson*) + + +(*Scalars bosons*) +RepHiggs1=CreateParticle[{{1,2}},"S"]; (*Higgs*) +RepGoldstone1=CreateParticle[{{1,1}},"S"]; (*Goldstone*) +RepHiggs2=CreateParticle[{{2,1}},"S"]; (*CP-even inert scalar*) +RepGoldstone21=CreateParticle[{{2,2}},"S"]; (*CP-odd inert scalar*) +RepGoldstone22=CreateParticle[{{2,3}},"S"]; (*charged inert scalar*) + + +(*left+right top-quark*) +Rept=CreateParticle[{{1,1},{2,1}},"F"]; + +(*left-handed bottom-quark*) +Repb=CreateParticle[{{1,2}},"F"]; + +(*scalar reps*) +Reph=CreateParticle[{{1,2}},"S"]; +RepG=CreateParticle[{{1,1}},"S"]; + +RepH=CreateParticle[{{2,2}},"S"]; +RepA=CreateParticle[{{2,3}},"S"]; +RepHpm=CreateParticle[{{2,1}},"S"]; + +(*Vector bosons*) +RepGluon=CreateParticle[{1},"V"]; +RepW=CreateParticle[{{2,1}},"V"]; +RepZ=CreateParticle[{{3,1}},"V"]; + + +(*Defining various masses and couplings*) +VectorMass=Join[ + Table[mg2,{i,1,RepGluon[[1]]//Length}], + Table[mw2,{i,1,RepW[[1]]//Length}],{mb2}]; (*mb2 is the mass of the U(1) gauge field*) +FermionMass=Table[mq2,{i,1,Length[gvff[[1]]]}]; +ScalarMass={mG2,mh2,mG2,mG2,mH2,mA2,mHp,mHp}; +ParticleMasses={VectorMass,FermionMass,ScalarMass}; + +UserMasses={mq2,mg2,mw2,mb2,mG2,mh2,mH2,mA2,mHp}; +UserCouplings=Variables@Normal@{Ysff,gvss,gvff,gvvv,\[Lambda]4,\[Lambda]3}//DeleteDuplicates; + + +ParticleList={ + ReptL,RepbL,ReptR, + RepGluon,RepW,RepB, + RepHiggs1,RepGoldstone1, + RepHiggs2,RepGoldstone21,RepGoldstone22}; +ParticleName={ + "TopL","BotL","TopR", + "Gluon","W","B", + "Higgs","Goldstone", + "Higgs2","Goldstone21","Goldstone22"}; + + +(* + output of matrix elements +*) +SetDirectory[NotebookDirectory[]]; +OutputFile="output/matrixElements.2hdm"; + +MatrixElements=ExportMatrixElements[ + OutputFile, + ParticleList, + UserMasses, + UserCouplings, + ParticleName, + ParticleMasses, + { + TruncateAtLeadingLog->True, + Replacements->{lam4H->0,lam5H->0}, + Format->{"json","txt"}, + NormalizeWithDOF->False}]; + + + diff --git a/examples/SMFull.m b/examples/SMFull.m new file mode 100644 index 0000000..9def40f --- /dev/null +++ b/examples/SMFull.m @@ -0,0 +1,214 @@ +(* ::Package:: *) + +Quit[]; + + +SetDirectory[NotebookDirectory[]]; +(*Put this if you want to create multiple model-files with the same kernel*) +$GroupMathMultipleModels=True; +$LoadGroupMath=True; +<<../src/WallGoMatrix.m + + +(* ::Chapter:: *) +(*Full Standard Model*) + + +(* ::Section::Closed:: *) +(*Model*) + + +Group={"SU3","SU2","U1"}; +RepAdjoint={{1,1},{2},0}; +HiggsDoublet={{{0,0},{1},1/2},"C"}; +RepScalar={HiggsDoublet}; +CouplingName={gs,gw,gY}; + + +Rep1={{{1,0},{1},1/6},"L"}; +Rep2={{{1,0},{0},2/3},"R"}; +Rep3={{{1,0},{0},-1/3},"R"}; +Rep4={{{0,0},{1},-1/2},"L"}; +Rep5={{{0,0},{0},-1},"R"}; +RepFermion1Gen={Rep1,Rep2,Rep3,Rep4,Rep5}; + + +RepFermion3Gen={RepFermion1Gen,RepFermion1Gen,RepFermion1Gen}//Flatten[#,1]&; + + +(* ::Text:: *) +(*The input for the gauge interactions toDRalgo are then given by*) + + +{gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC}=AllocateTensors[Group,RepAdjoint,CouplingName,RepFermion3Gen,RepScalar]; + + +(* ::Text:: *) +(*The first element is the vector self - interaction matrix :*) + + +InputInv={{1,1},{True,False}}; +MassTerm1=CreateInvariant[Group,RepScalar,InputInv][[1]]//Simplify//FullSimplify; + + +VMass=m2*MassTerm1; + + +\[Mu]ij=GradMass[VMass]//Simplify//SparseArray; + + +QuarticTerm1=MassTerm1^2; + + +VQuartic=lam1H*QuarticTerm1; + + +\[Lambda]4=GradQuartic[VQuartic]; + + +InputInv={{1,1,2},{False,False,True}}; +YukawaDoublet=CreateInvariantYukawa[Group,RepScalar,RepFermion3Gen,InputInv]//Simplify; + + +Ysff=-GradYukawa[yt*YukawaDoublet[[1]]]; + + +YsffC=SparseArray[Simplify[Conjugate[Ysff]//Normal,Assumptions->{yt>0}]]; + + +ImportModel[Group,gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC,Verbose->False]; + + +(* ::Section:: *) +(*SM quarks + gauge bosons*) + + +(* ::Subsection:: *) +(*SymmetryBreaking*) + + +vev={0,v,0,0}; +SymmetryBreaking[vev] + + +(* ::Subsection:: *) +(*UserInput*) + + +(*Third generation of fermions*) +ReptL=CreateParticle[{{1,1}},"F"]; +RepbL=CreateParticle[{{1,2}},"F"]; +ReptR=CreateParticle[{{2,1}},"F"]; +RepbR=CreateParticle[{3},"F"]; +RepTauL=CreateParticle[{4},"F"]; +RepTauR=CreateParticle[{5},"F"]; + + +(*Second generation of fermions*) +RepCharmStrangeL=CreateParticle[{6},"F"]; +RepCharmR=CreateParticle[{7},"F"]; +RepStrangeR=CreateParticle[{8},"F"]; +RepMuonL=CreateParticle[{9},"F"]; +RepMuonR=CreateParticle[{10},"F"]; + + +(*First generation of fermions*) +RepUpDownL=CreateParticle[{11},"F"]; +ReUpR=CreateParticle[{12},"F"]; +RepDownR=CreateParticle[{13},"F"]; +RepElectronL=CreateParticle[{14},"F"]; +RepElectronR=CreateParticle[{15},"F"]; + + +(*Vector bosons*) +RepGluon=CreateParticle[{1},"V"]; (*Gluons*) +RepW=CreateParticle[{{2,1}},"V"]; (*SU2 gauge bosons*) +RepB=CreateParticle[{3},"V"]; (*U1 gauge boson*) + + +(*Scalars bosons*) +RepHiggs=CreateParticle[{{1,2}},"S"]; +RepGoldstone=CreateParticle[{{1,1}},"S"]; + + +ParticleList={ + ReptL,RepbL,ReptR,RepbR,RepTauL,RepTauR, + RepCharmStrangeL,RepCharmR,RepStrangeR,RepMuonL,RepMuonR, + RepUpDownL,ReUpR,RepDownR,RepElectronL,RepElectronR, + RepGluon,RepW,RepB,RepHiggs,RepGoldstone}; + + +(*Defining various masses and couplings*) + + +VectorMass=Join[ + Table[mg2,{i,1,RepGluon[[1]]//Length}], + Table[mw2,{i,1,RepW[[1]]//Length}],{mb2}]; (*mb2 is the mass of the U(1) gauge field*) + + +FermionMass=Table[mq2,{i,1,Length[gvff[[1]]]}]; + + +LeptonIndices=Union[ParticleList[[5]][[1]],ParticleList[[6]][[1]],ParticleList[[10]][[1]],ParticleList[[11]][[1]],ParticleList[[15]][[1]],ParticleList[[16]][[1]]]; + + +FermionMass[[LeptonIndices]]=ConstantArray[ml2,Length[LeptonIndices]]; + + +ScalarMass={mG2,mH2,mG2,mG2}; +ParticleMasses={VectorMass,FermionMass,ScalarMass}; + + +(* +up to the user to make sure that the same order is given in the python code +*) +UserMasses={mq2,ml2,mg2,mw2,mb2,mG2,mH2}; +UserCouplings=Variables@Normal@{Ysff,gvss,gvff,gvvv,\[Lambda]4,\[Lambda]3}//DeleteDuplicates; + + +ParticleList={ + ReptL,RepbL,ReptR,RepbR,RepTauL,RepTauR, + RepCharmStrangeL,RepCharmR,RepStrangeR,RepMuonL,RepMuonR, + RepUpDownL,ReUpR,RepDownR,RepElectronL,RepElectronR,RepGluon, + RepW,RepB,RepHiggs,RepGoldstone}; +ParticleName={ + "TopL","BotL","TopR","BotR","tauL","tauR", + "CharmStrangeL","CharmR","StrangeR","MuonL","MuonR", + "UpDownL","UpR","DownR","ElectronL","ElectronR", + "Gluon","W","B","Higgs", + "Goldstone"}; + + +(* + output of matrix elements +*) +SetDirectory[NotebookDirectory[]]; +OutputFile="output/matrixElementsFull"; + +MatrixElements=ExportMatrixElements[ + OutputFile, + ParticleList, + UserMasses, + UserCouplings, + ParticleName, + ParticleMasses, + {TruncateAtLeadingLog->False,Format->{"json","txt"}}]; + + +(* + output of matrix elements +*) +SetDirectory[NotebookDirectory[]]; +OutputFile="output/matrixElementsFull.LL"; + +MatrixElements=ExportMatrixElements[ + OutputFile, + ParticleList, + UserMasses, + UserCouplings, + ParticleName, + ParticleMasses, + {TruncateAtLeadingLog->True,Format->{"json","txt"}}]; + + +MatrixElements diff --git a/examples/SMscalar.m b/examples/SMscalar.m new file mode 100644 index 0000000..3f3eb54 --- /dev/null +++ b/examples/SMscalar.m @@ -0,0 +1,161 @@ +(* ::Package:: *) + +Quit[]; + + +SetDirectory[NotebookDirectory[]]; +(*Put this if you want to create multiple model-files with the same kernel*) +$GroupMathMultipleModels=True; +$LoadGroupMath=True; +<<../src/WallGoMatrix.m + + +(* ::Chapter:: *) +(*SM quarks + gauge bosons*) + + +(* ::Section:: *) +(*Model*) + + +Group={"SU3","SU2"}; +RepAdjoint={{1,1},{2}}; +CouplingName={gs,gw}; + + +Rep1={{{1,0},{1}},"L"}; +Rep2={{{1,0},{0}},"R"}; +Rep3={{{1,0},{0}},"R"}; +RepFermion1Gen={Rep1,Rep2,Rep3}; + + +HiggsDoublet={{{0,0},{1}},"C"}; +RepScalar={HiggsDoublet}; + + +RepFermion3Gen={RepFermion1Gen,RepFermion1Gen,RepFermion1Gen}//Flatten[#,1]&; + + +(* ::Text:: *) +(*The input for the gauge interactions toDRalgo are then given by*) + + +{gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC}=AllocateTensors[Group,RepAdjoint,CouplingName,RepFermion3Gen,RepScalar]; + + +InputInv={{1,1},{True,False}}; +MassTerm1=CreateInvariant[Group,RepScalar,InputInv][[1]]//Simplify//FullSimplify; +VMass=m2*MassTerm1; +\[Mu]ij=GradMass[VMass]//Simplify//SparseArray; +QuarticTerm1=MassTerm1^2; +VQuartic=lam1H*QuarticTerm1; +\[Lambda]4=GradQuartic[VQuartic]; + +InputInv={{1,1,2},{False,False,True}}; +YukawaDoublet=CreateInvariantYukawa[Group,RepScalar,RepFermion3Gen,InputInv]//Simplify; +Ysff=-GradYukawa[yt1*YukawaDoublet[[1]]]; +YsffC=SparseArray[Simplify[Conjugate[Ysff]//Normal,Assumptions->{yt1>0}]]; + + +ImportModel[Group,gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC,Verbose->False]; + + +(* ::Section:: *) +(*MatrixElements*) + + +(* +In DRalgo fermions are Weyl. +So to create one Dirac we need +one left-handed and +one right-handed fermion +*) + + +(* ::Subsection:: *) +(*SymmetryBreaking*) + + +vev={0,v,0,0}; +SymmetryBreaking[vev] + + +(* ::Subsection:: *) +(*UserInput*) + + +(* + Reps 1-4 are quarks, + reps 5,6 are vector bosons +*) +(*left-handed top-quark*) +ReptL=CreateParticle[{{1,1}},"F"]; + +(*right-handed top-quark*) +ReptR=CreateParticle[{2},"F"]; + +(*right-handed bottom-quark*) +RepbR=CreateParticle[{3},"F"]; + +(*Vector bosons*) +RepGluon=CreateParticle[{1},"V"]; +RepW=CreateParticle[{{2,1}},"V"]; + +(*Scalar particles*) +RepHiggs=CreateParticle[{1},"S"]; + + +(*Defining various masses and couplings*) + + +VectorMass=Join[ + Table[mg2,{i,1,RepGluon[[1]]//Length}], + Table[mw2,{i,1,RepW[[1]]//Length}]]; +FermionMass=Table[mq2,{i,1,Length[gvff[[1]]]}]; +ScalarMass=Table[ms2,{i,1,Length[gvss[[1]]]}]; +ParticleMasses={VectorMass,FermionMass,ScalarMass}; +(* +up to the user to make sure that the same order is given in the python code +*) +UserMasses={mq2,mg2,mw2,ms2}; +UserCouplings=Variables@Normal@{Ysff,gvss,gvff,gvvv,\[Lambda]4,\[Lambda]3}//DeleteDuplicates; + + +(* +These particles do not have out-of-eq contributions +*) +ParticleList={ReptL,ReptR,RepbR,RepGluon,RepW,RepHiggs}; +ParticleName={"TopL","TopR","BotR","Gluon","W","Higgs"}; + + +(* + output of matrix elements +*) +SetDirectory[NotebookDirectory[]]; +OutputFile="output/matrixElements.scalar"; +MatrixElements=ExportMatrixElements[ + OutputFile, + ParticleList, + UserMasses, + UserCouplings, + ParticleName, + ParticleMasses, + Format->{"json","txt","hdf5"}]; + + +MatrixElements//Expand + + +Import[OutputFile<>".hdf5"] + + +Import[OutputFile<>".hdf5","CouplingInfo"] + + +Import[OutputFile<>".hdf5","ParticleInfo"] + + +Import[OutputFile<>".hdf5","CouplingInfo"] + + +Import[OutputFile<>".hdf5","ParticleInfo"] diff --git a/examples/matrixElements.ew.m b/examples/electroWeak.m similarity index 63% rename from examples/matrixElements.ew.m rename to examples/electroWeak.m index 1f68fc4..99f4191 100644 --- a/examples/matrixElements.ew.m +++ b/examples/electroWeak.m @@ -7,15 +7,14 @@ (*Put this if you want to create multiple model-files with the same kernel*) $GroupMathMultipleModels=True; $LoadGroupMath=True; -<<../DRalgo/DRalgo.m -<<../src/matrixElements.m +<<../src/WallGoMatrix.m (* ::Chapter:: *) (*QCD+W boson*) -(* ::Section::Closed:: *) +(* ::Section:: *) (*Model*) @@ -34,9 +33,6 @@ RepScalar={HiggsDoublet}; - - - RepFermion3Gen={RepFermion1Gen,RepFermion1Gen,RepFermion1Gen}//Flatten[#,1]&; @@ -52,6 +48,9 @@ Ysff=-GradYukawa[yt*YukawaDoublet[[1]]]; +ImportModel[Group,gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC,Verbose->False]; + + (* ::Section:: *) (*SM quarks + gauge bosons*) @@ -81,27 +80,20 @@ reps 5,6 are vector bosons *) (*left-handed top-quark*) -ReptL=CreateOutOfEq[{1},"F"]; +ReptL=CreateParticle[{{1,1}},"F"]; (*right-handed top-quark*) -ReptR=CreateOutOfEq[{2},"F"]; +ReptR=CreateParticle[{2},"F"]; -(*right-handed bottom-quark*) -RepbR=CreateOutOfEq[{3},"F"]; - -(*light quarks*) -RepLight=CreateOutOfEq[{4,5,6,7,8,9},"F"]; +(*(*right-handed bottom-quark*) +RepbR=CreateParticle[{3},"F"];*) (*Vector bosons*) -RepGluon=CreateOutOfEq[{1},"V"]; -RepW=CreateOutOfEq[{{2,1}},"V"]; - +RepGluon=CreateParticle[{1},"V"]; +RepW=CreateParticle[{{2,1}},"V"]; -ParticleList={ReptL,ReptR,RepbR,RepGluon,RepW,RepLight}; -(* -These particles do not have out-of-eq contributions -*) -LightParticles={6}; +(*Higgs*) +RepH = CreateParticle[{1},"S"]; (*Defining various masses and couplings*) @@ -111,35 +103,36 @@ Table[mg2,{i,1,RepGluon[[1]]//Length}], Table[mw2,{i,1,RepW[[1]]//Length}]]; FermionMass=Table[mq2,{i,1,Length[gvff[[1]]]}]; +ScalarMass=Table[ms2,{i,1,Length[gvss[[1]]]}]; +ParticleMasses={VectorMass,FermionMass,ScalarMass}; (* up to the user to make sure that the same order is given in the python code *) -UserMasses={mq2,mq2,mq2,mg2,mw2}; -UserCouplings=CouplingName; +UserMasses={mq2,mg2,mw2}; +UserCouplings={gs,gw}; + + +(* +These particles do not necessarily have to be out of equilibrium +the remaining particle content is set as light +*) +ParticleList={ReptL,ReptR,(*RepbR,*)RepGluon,RepW,RepH}; +ParticleName={"TopL","TopR",(*"BotR",*)"Gluon","W","H"}; (* output of matrix elements *) -OutputFile="matrixElements.ew"; SetDirectory[NotebookDirectory[]]; -ParticleName={"TopL","TopR","BotR","Gluon","W"}; -MatrixElements=ExportMatrixElements[OutputFile,ParticleList,LightParticles,UserMasses,UserCouplings,ParticleName]; +OutputFile="output/matrixElements.ew"; +MatrixElements=ExportMatrixElements[ + OutputFile, + ParticleList, + UserMasses, + UserCouplings, + ParticleName, + ParticleMasses, + {TruncateAtLeadingLog->True,Format->{"json","txt"}}]; MatrixElements//Expand - - -Import[OutputFile<>".hdf5"] - - -Import[OutputFile<>".hdf5","CouplingInfo"] - - -Import[OutputFile<>".hdf5","ParticleInfo"] - - -Import[OutputFile<>".hdf5","CouplingInfo"] - - -Import[OutputFile<>".hdf5","ParticleInfo"] diff --git a/examples/matrixElements.qcd.m b/examples/matrixElements.qcd.m deleted file mode 100644 index 9b8facd..0000000 --- a/examples/matrixElements.qcd.m +++ /dev/null @@ -1,156 +0,0 @@ -(* ::Package:: *) - -Quit[]; - - -SetDirectory[NotebookDirectory[]]; -(*Put this if you want to create multiple model-files with the same kernel*) -$GroupMathMultipleModels=True; -$LoadGroupMath=True; -<<../DRalgo/DRalgo.m -<<../src/matrixElements.m - - -(* ::Chapter:: *) -(*QCD*) - - -(* ::Section:: *) -(*Model*) - - -Group={"SU3"}; -RepAdjoint={{1,1}}; -RepScalar={}; -CouplingName={gs}; - - -Rep1={{{1,0}},"L"}; -Rep2={{{1,0}},"R"}; -RepFermion1Gen={Rep1,Rep2}; - - -RepFermion3Gen={RepFermion1Gen,RepFermion1Gen,RepFermion1Gen,RepFermion1Gen,RepFermion1Gen,RepFermion1Gen}//Flatten[#,1]&; - - -(* ::Text:: *) -(*The input for the gauge interactions toDRalgo are then given by*) - - -{gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC}=AllocateTensors[Group,RepAdjoint,CouplingName,RepFermion3Gen,RepScalar]; - - -(* ::Section:: *) -(*A model with 6 quarks and 1 gluon*) - - -(* ::Subsection:: *) -(*UserInput*) - - -(* -In DRalgo fermions are Weyl. -So to create one Dirac we need -one left-handed and -one right-handed fermoon -*) - - -(*Below -rep 1-6 are quarks, -rep 7 is a gluon -*) -Rep1=CreateOutOfEq[{1,2},"F"]; -Rep2=CreateOutOfEq[{3,4},"F"]; -Rep3=CreateOutOfEq[{5,6},"F"]; -Rep4=CreateOutOfEq[{7,8},"F"]; -Rep5=CreateOutOfEq[{9,10},"F"]; -Rep6=CreateOutOfEq[{11,12},"F"]; -RepGluon=CreateOutOfEq[{1},"V"]; -(*check*) -(*Rep2=CreateOutOfEq[{3,4,...,12},"F"];*) - - -ParticleList={Rep1,RepGluon,Rep2,Rep3,Rep4,Rep5,Rep6}; -(* -These particles do not have out-of-eq contributions -*) -LightParticles={3,4,5,6,7}; - - -(*Defining various masses and couplings*) - - -VectorMass=Table[mg2,{i,1,Length[gvff]}]; -FermionMass=Table[mq2,{i,1,Length[gvff[[1]]]}]; -(* -up to the user to make sure that the same order is given in the python code -*) -UserMasses={mq2,mg2}; -UserCouplings={gs}; - - -(* - output of matrix elements -*) -OutputFile="matrixElements.qcd"; -SetDirectory[NotebookDirectory[]]; -ParticleName={"Top","Gluon"}; -MatrixElements=ExportMatrixElements[OutputFile,ParticleList,LightParticles,UserMasses,UserCouplings,ParticleName]; - - -MatrixElements - - -(* ::Subsection:: *) -(*Crosschecks*) - - -(*comparison with https://arxiv.org/pdf/hep-ph/0302165.pdf*) -(*q1q2->q1q2*) -(*5 light quarks*) -M[0,2,0,2]/.MatrixElements/.{c[0]->1}(*/.{-u->-t}/.{t*u->-s*t}*) -5*2/(2*CA)*(8*dF^2*CF^2/dA((s^2+u^2)/ttsq))/.{ttsq->(-t+msq[1])^2}/.{Nf->3,CA->3,CF->4/3,dF->3,dA->8} -%-%%//Simplify -(*q1q1->gg*) -M[0,0,1,1]/.MatrixElements/.{c[0]->1}(*/.{-u->-t}/.{t*u->-s*t}*) -1/(2*2*CA)*(8*dF*CF^2(u/tt+t/uu)-8*dF*CF*CA((t^2+u^2)/s^2))/.{tt->(-t+msq[0])^2/t,uu->(-u+msq[0])^2/u}/.{Nf->3,CA->3,CF->4/3,dF->3} -%-%%//Simplify -(*q1 g->q1 g*) -M[0,1,0,1]/.MatrixElements/.{c[0]->1}(*/.{-u->-t}/.{t*u->-s*t}*)//Simplify -1/(2*CA)*(-8*dF*CF^2(u/s +s/uu)+8*dF*CF*CA((s^2+u^2)/ttsq))/.{ttsq->(-t+msq[1])^2,tt->(-t+msq[1])^2/t,uu->(-u+msq[0])^2/u}/.{Nf->3,CA->3,CF->4/3,dF->3}//Simplify -%-%%//Simplify - - -(*crosscheck*) -(*tt->tt*) -M[0,0,0,0]/.MatrixElements/.{c[0]->1}(*/.{-u->-t}/.{t*u->-s*t}*) -(*result from AMY paper*) -(*initial sates and finial states are either particle or anti-particle*) -+8*dF^2*CF^2/dA((s^2+u^2)/ttsq+(s^2+t^2)/uusq)+16*dF*CF(CF-CA/2)(s^2/(t*u)); -(*mixed initial and finial states*) -+8*dF^2*CF^2/dA((s^2+u^2)/ttsq+(u^2+t^2)/s^2)+16*dF*CF(CF-CA/2)(u^2/(t*s)); -1/(2*CA)*(xx*%%+%)/.{ttsq->(-t+msq[1])^2,uusq->(-u+msq[1])^2}/.{Nf->3,CA->3,CF->4/3,dF->3,dA->8} -bb %-%%%%//FullSimplify -(*result only agrees by assuming factor 1/2 for same particles in final state*) -%/.{xx->xx,bb->xx}/.{xx->1} - - -(*g g->g g*) -M[1,1,1,1]/.MatrixElements/.{c[0]->1}//Simplify -(*Final states are the same -> divide out 1/2 symmetry factor*) -1/(2*2(CA^2-1))(16*dA*CA^2(3-s*u/ttsq-s*t/uusq-t*u/s^2)); -%/.{s*t/uusq->1/4-1/4(s-t)^2/(-u+msq[1])^2,s*u/ttsq->1/4-1/4(s-u)^2/(-t+msq[1])^2}/.{Nf->3,dA->8,CA->3,CF->4/3,dF->3}//Simplify -%%%-%//Simplify - - -Import[OutputFile<>".hdf5"] - - -Import[OutputFile<>".hdf5","MatrixElementsTopTop"] - - -Import[OutputFile<>".hdf5","CouplingInfo"] - - -Import[OutputFile<>".hdf5","ParticleInfo"] diff --git a/examples/qcd.m b/examples/qcd.m new file mode 100644 index 0000000..bb18d5b --- /dev/null +++ b/examples/qcd.m @@ -0,0 +1,107 @@ +(* ::Package:: *) + +Quit[]; + + +SetDirectory[NotebookDirectory[]]; +(*Put this if you want to create multiple model-files with the same kernel*) +$GroupMathMultipleModels=True; +$LoadGroupMath=True; +<<../src/WallGoMatrix.m + + +(* ::Chapter:: *) +(*QCD*) + + +(* ::Section::Closed:: *) +(*Model*) + + +Group={"SU3"}; +RepAdjoint={{1,1}}; +RepScalar={}; +CouplingName={gs}; + + +Rep1={{{1,0}},"L"}; +Rep2={{{1,0}},"R"}; +RepFermion1Gen={Rep1,Rep2}; + + +RepFermion3Gen={RepFermion1Gen,RepFermion1Gen,RepFermion1Gen,RepFermion1Gen,RepFermion1Gen,RepFermion1Gen}//Flatten[#,1]&; + + +(* ::Text:: *) +(*The input for the gauge interactions toDRalgo are then given by*) + + +{gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC}=AllocateTensors[Group,RepAdjoint,CouplingName,RepFermion3Gen,RepScalar]; + + +ImportModel[Group,gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC,Verbose->False]; + + +(* ::Section:: *) +(*A model with 6 quarks and 1 gluon*) + + +(* ::Subsection:: *) +(*UserInput*) + + +(* +In DRalgo fermions are Weyl. +So to create one Dirac we need +one left-handed and +one right-handed fermion +*) + + +(*Below +rep 1-6 are quarks, +rep 7 is a gluon +*) +Rep1=CreateParticle[{1,2},"F"]; +RepGluon=CreateParticle[{1},"V"]; + + +(*Defining various masses and couplings*) + + +VectorMass=Table[mg2,{i,1,Length[gvff]}]; +FermionMass=Table[mq2,{i,1,Length[gvff[[1]]]}]; +ScalarMass={}; +ParticleMasses={VectorMass,FermionMass,ScalarMass}; +(* +up to the user to make sure that the same order is given in the python code +*) +UserMasses={mq2,mg2}; +UserCouplings={gs}; + + +(* +These particles do not necessarily have to be out of equilibrium +the remainin particle content is set as light +*) +ParticleList={Rep1,RepGluon}; +ParticleName={"Top", "Gluon"}; + + +(* + output of matrix elements +*) +SetDirectory[NotebookDirectory[]]; +OutputFile="output/matrixElements.qcd"; +MatrixElements=ExportMatrixElements[ + OutputFile, + ParticleList, + UserMasses, + UserCouplings, + ParticleName, + ParticleMasses, + {TruncateAtLeadingLog->True,Format->{"json","txt"}}]; + + + + diff --git a/examples/matrixElements.xsm.m b/examples/xsm.m similarity index 64% rename from examples/matrixElements.xsm.m rename to examples/xsm.m index 587b911..2f4680c 100644 --- a/examples/matrixElements.xsm.m +++ b/examples/xsm.m @@ -1,18 +1,17 @@ (* ::Package:: *) -(*Quit[];*) +Quit[]; SetDirectory[NotebookDirectory[]]; (*Put this if you want to create multiple model-files with the same kernel*) $GroupMathMultipleModels=True; $LoadGroupMath=True; -<<../DRalgo/DRalgo.m -<<../src/matrixElements.m +<<../src/WallGoMatrix.m (* ::Chapter:: *) -(*SM+sr1*) +(*SM+scalar Singlet*) (*see 2102.11145 [hep-ph]*) @@ -66,7 +65,7 @@ VMass=( +m1*MassTerm1 - +\[Mu]\[Sigma]/2*MassTerm2 + +ms/2*MassTerm2 ); @@ -79,9 +78,9 @@ VQuartic=( - +\[Lambda]1H*QuarticTerm1 - +\[Lambda]\[Sigma]/4*QuarticTerm2 - +\[Lambda]m/2*QuarticTerm3 + +lam1H*QuarticTerm1 + +lams/4*QuarticTerm2 + +lamm/2*QuarticTerm3 ); @@ -95,8 +94,8 @@ VCubic=( - +\[Mu]m/2*CubicTerm1 - +\[Mu]3/3*CubicTerm2 + +mum/2*CubicTerm1 + +mu3/3*CubicTerm2 ); @@ -123,6 +122,9 @@ YsffC=SparseArray[Simplify[Conjugate[Ysff]//Normal,Assumptions->{yt1>0}]]; +ImportModel[Group,gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC,Verbose->False]; + + (* ::Section:: *) (*MatrixElements*) @@ -131,7 +133,7 @@ In DRalgo fermions are Weyl. So to create one Dirac we need one left-handed and -one right-handed fermoon +one right-handed fermion *) @@ -144,28 +146,25 @@ (*left-handed top-quark*) -ReptL=CreateOutOfEq[{{1,1}},"F"]; +ReptL=CreateParticle[{{1,1}},"F"]; (*right-handed top-quark*) -ReptR=CreateOutOfEq[{2},"F"]; +ReptR=CreateParticle[{2},"F"]; (*left-handed bottom-quark*) -RepbL=CreateOutOfEq[{{1,2}},"F"]; +RepbL=CreateParticle[{{1,2}},"F"]; (*light quarks*) -RepLight=CreateOutOfEq[Range[3,2*4+3],"F"]; +RepLight=CreateParticle[Range[3,2*4+3],"F"]; (*Vector bosons*) -RepGluon=CreateOutOfEq[{1},"V"]; -RepW=CreateOutOfEq[{{2,1}},"V"]; -RepZ=CreateOutOfEq[{{3,1}},"V"]; - +RepGluon=CreateParticle[{1},"V"]; +RepW=CreateParticle[{{2,1}},"V"]; +RepZ=CreateParticle[{{3,1}},"V"]; -ParticleList={ReptL,ReptR,RepGluon,RepW,RepZ,RepbL,RepLight}; -(* -These particles do not have out-of-eq contributions -*) -LightParticles=Range[4,Length[ParticleList]]; +(*Higgs*) +RepH = CreateParticle[{1},"S"]; +RepS = CreateParticle[{2},"S"]; VectorMass=Join[ @@ -173,21 +172,35 @@ Table[mw2,{i,1,RepW[[1]]//Length}], Table[mz2,{i,1,RepZ[[1]]//Length}]]; FermionMass=Table[mq2,{i,1,Length[gvff[[1]]]}]; +ScalarMass=Table[ms2,{i,1,Length[gvss[[1]]]}]; +ParticleMasses={VectorMass,FermionMass,ScalarMass}; (* up to the user to make sure that the same order is given in the python code *) -UserMasses={mq2,mq2,mg2,mw2,mz2}; -UserCouplings={g3,gw,g1}; +UserMasses={mq2,mg2,mw2,mz2,ms2}; +UserCouplings=Variables@Normal@{Ysff,gvss,gvff,gvvv,\[Lambda]4,\[Lambda]3}//DeleteDuplicates; + + +(* +These particles do not have out-of-eq contributions +*) +ParticleList={ReptL,ReptR,RepGluon,RepW,RepZ,RepH,RepS}; +ParticleName={"TopL","TopR","Gluon","W","Z","H","S"}; (* output of matrix elements *) -OutputFile="matrixElements.xsm"; SetDirectory[NotebookDirectory[]]; -RepOptional={c[1]->0,c[2]->0}; -ParticleName={"TopL","TopR","Gluon"}; -MatrixElements=ExportMatrixElements[OutputFile,ParticleList,LightParticles,UserMasses,UserCouplings,ParticleName,RepOptional]; +OutputFile="output/matrixElements.xsm"; +MatrixElements=ExportMatrixElements[ + OutputFile, + ParticleList, + UserMasses, + UserCouplings, + ParticleName, + ParticleMasses, + {Replacements->{gw->0,g1->0},Format->{"json","txt"}}]; (* ::Subsection:: *) @@ -199,31 +212,28 @@ (*left-handed top-quark*) -ReptL=CreateOutOfEq[{{1,1}},"F"]; +ReptL=CreateParticle[{{1,1}},"F"]; (*right-handed top-quark*) -ReptR=CreateOutOfEq[{2},"F"]; +ReptR=CreateParticle[{2},"F"]; (*join topL and topR into one rep*) Rept={Join[ReptL[[1]],ReptR[[1]]],"F"}; (*left-handed bottom-quark*) -RepbL=CreateOutOfEq[{{1,2}},"F"]; +RepbL=CreateParticle[{{1,2}},"F"]; (*light quarks*) -RepLight=CreateOutOfEq[Range[3,2*4+3],"F"]; +RepLight=CreateParticle[Range[3,2*4+3],"F"]; (*Vector bosons*) -RepGluon=CreateOutOfEq[{1},"V"]; -RepW=CreateOutOfEq[{2},"V"]; -RepZ=CreateOutOfEq[{3},"V"]; - +RepGluon=CreateParticle[{1},"V"]; +RepW=CreateParticle[{2},"V"]; +RepZ=CreateParticle[{3},"V"]; -ParticleList={Rept,RepGluon,RepW,RepZ,RepbL,RepLight}; -(* -These particles do not have out-of-eq contributions -*) -LightParticles=Range[3,Length[ParticleList]]; +(*Higgs*) +RepH = CreateParticle[{1},"S"]; +RepS = CreateParticle[{2},"S"]; VectorMass=Join[ @@ -231,20 +241,35 @@ Table[mw2,{i,1,RepW[[1]]//Length}], Table[mz2,{i,1,RepZ[[1]]//Length}]]; FermionMass=Table[mq2,{i,1,Length[gvff[[1]]]}]; +ScalarMass=Table[ms2,{i,1,Length[gvss[[1]]]}]; +ParticleMasses={VectorMass,FermionMass,ScalarMass}; (* up to the user to make sure that the same order is given in the python code *) -UserMasses={mq2,mg2}; -UserCouplings={g3,gw,g1}; +UserMasses={mq2,mg2,mw2,mz2,ms2}; +UserCouplings=Variables@Normal@{Ysff,gvss,gvff,gvvv,\[Lambda]4,\[Lambda]3}//DeleteDuplicates; + + +(* +These particles do not have out-of-eq contributions +*) +ParticleList={Rept,RepGluon,RepW,RepZ,RepH,RepS}; +ParticleName={"Top","Gluon","W","Z","H","S"}; (* output of matrix elements *) -OutputFile="matrixElements.xsm.qcd"; SetDirectory[NotebookDirectory[]]; -ParticleName={"Top","Gluon"}; -MatrixElements=ExportMatrixElements[OutputFile,ParticleList,LightParticles,UserMasses,UserCouplings,ParticleName]; +OutputFile="output/matrixElements.xsm.qcd"; +MatrixElements=ExportMatrixElements[ + OutputFile, + ParticleList, + UserMasses, + UserCouplings, + ParticleName, + ParticleMasses, + {Replacements->{gw->0,g1->0},Format->{"json","txt"}}]; MatrixElements//Expand diff --git a/examples/yukawa.m b/examples/yukawa.m new file mode 100644 index 0000000..f7d4665 --- /dev/null +++ b/examples/yukawa.m @@ -0,0 +1,178 @@ +(* ::Package:: *) + +Quit[]; + + +SetDirectory[NotebookDirectory[]]; +(*Put this if you want to create multiple model-files with the same kernel*) +$GroupMathMultipleModels=True; +$LoadGroupMath=True; +<<../src/WallGoMatrix.m + + +(* ::Chapter:: *) +(*Yukawa Model*) + + +(* ::Section:: *) +(*Model*) + + +Group={"U1"}; +RepAdjoint={0}; +RepScalar={{{0},"R"}}; +CouplingName={g1}; + + +RepFermion={{{0},"L"},{{0},"R"}}; + + +(* ::Text:: *) +(*The input for the gauge interactions toDRalgo are then given by*) + + +{gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJC,\[Mu]IJ,Ysff,YsffC}=AllocateTensors[Group,RepAdjoint,CouplingName,RepFermion,RepScalar]; + + +(* \[Sigma] \[Phi] *) +InputInv={{1},{True}}; +LinearTerm=CreateInvariant[Group,RepScalar,InputInv][[1]]; +VLinear=0;(* turned off *)\[Sigma] LinearTerm +\[Lambda]1=GradTadpole[VLinear]; + + +(* 1/2m^2\[Phi]^2 *) +InputInv={{1,1},{True,True}}; +MassTerm=CreateInvariant[Group,RepScalar,InputInv][[1]]; +VMass=msq/2 MassTerm +\[Mu]ij=GradMass[VMass]//SparseArray; + + +(* 1/6\[Gamma]\[Phi]^3 *) +InputInv={{1,1,1},{True,True,True}}; +CubicTerm=CreateInvariant[Group,RepScalar,InputInv][[1]]; +VCubic=gamma/6 CubicTerm +\[Lambda]3=GradCubic[VCubic]; + + +(* 1/24\[Lambda]\[Phi]^4 *) +InputInv={{1,1,1,1},{True,True,True,True}}; +QuarticTerm=CreateInvariant[Group,RepScalar,InputInv][[1]]; +VQuartic=lam/24 MassTerm^2 +\[Lambda]4=GradQuartic[VQuartic]; + + +(* m(Subscript[\[Psi], R]Subscript[\[Psi], L]+Subscript[\[Psi]^+, L]Subscript[\[Psi], R]^+)*) +InputInv={{2,1},{True,True}}; (*Subscript[\[Psi], R]^+Subscript[\[Psi], L]*) +MassTerm1=CreateInvariantFermion[Group,RepFermion,InputInv][[1]] +InputInv={{1,2},{False,False}}; (*Subscript[\[Psi]^+, L]Subscript[\[Psi], R]*) +MassTerm2=CreateInvariantFermion[Group,RepFermion,InputInv][[1]] + + +\[Mu]IJ=mpsi*GradMassFermion[MassTerm1]; +\[Mu]IJC=mpsi*GradMassFermion[MassTerm2]; + + +(* y \[Phi](Subscript[\[Psi], R]Subscript[\[Psi], L]+Subscript[\[Psi]^+, L]Subscript[\[Psi], R]^+)*) +InputInv={{1,2,1},{True,True,True}}; +YukawaDoublet1=CreateInvariantYukawa[Group,RepScalar,RepFermion,InputInv][[1]]//Simplify; +InputInv={{1,1,2},{True,False,False}}; +YukawaDoublet2=CreateInvariantYukawa[Group,RepScalar,RepFermion,InputInv][[1]]//Simplify; + + +Ysff= y*GradYukawa[YukawaDoublet1]; +YsffC=y*GradYukawa[YukawaDoublet2]; + + +ImportModel[Group,gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC,Verbose->False]; + + +(* ::Section:: *) +(*A model with 1 Dirac fermions and 1 scalar bosons*) + + +(* ::Subsection:: *) +(*SymmetryBreaking*) + + +gvss//MatrixForm + + +WallGoMatrix`SimplifySparse + + +vev={v}; +(*SymmetryBreaking[vev,VevDependentCouplings->True]*) (*uncomment if you want vev-dependent couplings*) +SymmetryBreaking[vev] + + +(* ::Subsection:: *) +(*UserInput*) + + +(* +In DRalgo fermions are Weyl. +So to create one Dirac we need +one left-handed and +one right-handed fermion +*) + + +(*Below +rep 1-2 are fermions, +(*rep 3 is a scalar*) +*) +(* scalar *) +RepScalar=CreateParticle[{1},"S"]; + +(* left-handed fermion *) +RepFermionL=CreateParticle[{1},"F"]; + +(* right-handed fermion *) +RepFermionR=CreateParticle[{2},"F"]; + +(*Vector bosons*) +RepZ=CreateParticle[{1},"V"]; + + +CreateParticle[{1,2},"F"] + + +(* +These particles do not necessarily have to be out of equilibrium +the remainin particle content is set as light +*) +ParticleList={RepScalar,RepFermionL,RepFermionR}; + + +(*Defining various masses and couplings*) + + +VectorMass=Table[mv2,{i,1,RepZ[[1]]//Length}]; +FermionMass=Table[mf2,{i,1,Length[gvff[[1]]]}]; +ScalarMass=Table[ms2,{i,1,Length[gvss[[1]]]}]; +ParticleMasses={VectorMass,FermionMass,ScalarMass}; +(* +up to the user to make sure that the same order is given in the python code +*) +UserMasses={ms2,mf2,mf2}; +UserCouplings=Variables@Normal@{Ysff,gvss,gvff,gvvv,\[Lambda]4,\[Lambda]3}//DeleteDuplicates; + + +(* + output of matrix elements +*) +SetDirectory[NotebookDirectory[]]; +OutputFile="output/matrixElements.yukawa"; +ParticleName={"Phi","PsiL","PsiR"}; +MatrixElements=ExportMatrixElements[ + OutputFile, + ParticleList, + UserMasses, + UserCouplings, + ParticleName, + ParticleMasses, + {TruncateAtLeadingLog->True,Format->{"json","txt"}}]; + + +MatrixElements diff --git a/src/WallGoMatrix.m b/src/WallGoMatrix.m new file mode 100644 index 0000000..8c8805a --- /dev/null +++ b/src/WallGoMatrix.m @@ -0,0 +1,630 @@ +(* ::Package:: *) + +(* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *) + +(* :Title: WallGoMatrix *) + +(* + This software is covered by the GNU General Public License 3. + Copyright (C) 2024-2024 Andreas Ekstedt + Copyright (C) 2024-2024 Oliver Gould + Copyright (C) 2024-2024 Joonas Hirvonen + Copyright (C) 2024-2024 Benoit Laurent + Copyright (C) 2024-2024 Lauri Niemi + Copyright (C) 2024-2024 Philipp Schicho + Copyright (C) 2024-2024 Jorinde van de Vis +*) + +(* :Summary: WallgoMatirx is an algorithm that constructs + the Matrix Elements at Leading Log and partially NLL for generic models. *) + +(* ------------------------------------------------------------------------ *) + + +BeginPackage["WallGoMatrix`"] + + +Unprotect@Definition; +Definition[x_Symbol] /; StringMatchQ[Context[x], "Package`" ~~ ___] := + StringReplace[ToString@FullDefinition[x], + (WordCharacter .. ~~ DigitCharacter ... ~~ "`") .. ~~ s_ :> s + ]; +Protect@Definition; + + +(* + Welcome banner: All credit for this part to GroupMath +*) +TexFor[text_]:=Style[text,{GrayLevel[0.3]}] +result={}; +AppendTo[result,Row[{ + TexFor["GOGOGOGOGOGOGOGOGOGOGOGO "], + TexFor["WallGoMatrix"], + TexFor[" GOGOGOGOGOGOGOGOGOGOGGOGOGO"]}]]; +AppendTo[result,Row[{"Version: "//TexFor,"0.1.0 (09-10-2024)"//TexFor}]]; +AppendTo[result,Row[{"Authors: "//TexFor, + Hyperlink["Andreas Ekstedt","https://inspirehep.net/authors/1799400"],", "//TexFor, + Hyperlink["Oliver Gould","https://inspirehep.net/authors/1606373"],", "//TexFor, + Hyperlink["Joonas Hirvonen","https://inspirehep.net/authors/1866901"],", "//TexFor, + Hyperlink["Benoit Laurent","https://inspirehep.net/authors/1808372"],", "//TexFor, + Hyperlink["Lauri Niemi","https://inspirehep.net/authors/1764675"],", "//TexFor, + Hyperlink["Philipp Schicho","https://inspirehep.net/authors/1639147"],", "//TexFor, + Hyperlink["Jorinde van de Vis","https://inspirehep.net/authors/1589979"]//TexFor + } + ]]; +AppendTo[result,Row[{"Reference: "//TexFor, + Hyperlink["2410.xxxxx [hep-ph]","https://arxiv.org/abs/2410.xxxxx"]//TexFor}]]; +AppendTo[result,Row[{"Repository link: "//TexFor, + Hyperlink[Mouseover[TexFor["github.com/Wall-Go/WallGoMatrix"],Style["github.com/Wall-Go/WallGoMatrix",Bold]], + "https://github.com/DR-algo/DRalgo"]}]]; +AppendTo[result,Row[{"Existing model files: "//TexFor, + Hyperlink[Mouseover[TexFor["WallGoMatrix/examples"],Style["WallGoMatrix/examples",Bold]], + "https://github.com/Wall-Go/WallGoMatrix/tree/main/examples"]}]]; +WallGoMatrixLoad=Image[CompressedData["1:eJztWnl0lEUSDxERAWN0QV0WMSqyiiKHIrgIaYwQg0GOBJQcM98c3xyaZDLf900yR8Kh+IDlUFYRF41coqyP5WV5ERRQIx646vNYXcV1FSIK+pKVaxHxwP26qqvGSbyfPvRt8scMRXdXV/2qurqqes52hyb5OqalpZmd7Y9cw1UZCHpM/B/5kR80LV8HSZ1ofxTagzdW6KZp3LNy/oyCO1zZvuO+98x0OdbV/hgTLCvTvTkRo0pvtdEJKVQK6zzJeiB8DsZ/f+P4oF/JePpPqm07dj9e2xQv1CVveRrkd6L7utymP7nEbVsPnV9yOCAGvN2n08zRXqYvlvTcgBgovycXiVHa+y+f86WX6V2r734qa7lXLB+94eAXVonYds3QuaOGuZgOLPpPTfabGs//+PySW7fWFTENwhynhHnlnLeOTFvnEc9KJq9pyKzFLbZYt5/RcbdbXDWvbM9nF7h5PEWTOae9+eLhVU7R+Y1VlSP6lYo0+ddHEx+8bHP9yCEe3P+Pce4GnWlbriGOTj6ef16nmYtzpifpLvJ7pEfMap74cO8FftFV0kvdTMP4egfPT9GEJF8jN83yo7oLdHHbkopTb37WKQD2sRrTXx88Up3grO9wCTT2pfB5yTeOX9I+/jONH+sAcqz1bx//KcfbT/uve/xYR4P2aPFrGk+56SGTmJKGmUSRd/iO8SdGMCE76BUysdD2WqIwo//6unN1Ubopr1v6S5boJSfm6uKf0Q/7DlpjiTT5p+kC1s+0RB+Z3iR0Uf3Ysp4Dii3RaH+9PUcXf2h4tuqxIUn6gJ2wZHZL0nKbve+bmHNFddz/SVNoct/rdMxklpvi30em3bBlmC4estktu8nEBLCbLu6yE5zGgInyvuoVD/e+pXniBFPkSz51Xlx/hSmi8rvIK2R2Nu1iEzOnbl5MMLNMsf3FwwW7HvXg/DPU+mCShn0ykjTI2+AWc2XGaq8fJvV0uoX8WjbQxMT0FLfYMX7Bkgqh1m91of5TFD3NhfqG1X6jXUImbI3zTSFkInyyC9PItaY4X+K7S0P6ZZse1Hltr60a4nvIRPus0tAeZ1piu8TrDk3Yme2UjNwkfZLEuzpJS7Pfep+Fue9fNNTvBYtz4FtkOnrIwgyzg0vkNsW7rzs9gniNcKF+l0ZQ/rkuUW5z2b/eakODfx3nFb+5ufG5FW9XtaEhBz9NQ/tsqRKZthjxS524/o4qIaR8Ex1CSrnfVyV2SvlnlaK8w6pQvkdLUN/j7XFbzNxTSrDgeD6CmfCMYjFC5tW3R0SlNNDeIvGM1HNKBO03vQjt0z2C6wcViTMloK9YaK93p4qz643AogWW2GfDcsvmqYwv0cB/h8k06FdL/loksuT6s5X/1BeJkXL+04bIkvYtKEZ9LANxGFwi+s22644BhpjQLf3C2deW4vlrCWNZcIMD5d8QRnkfceJ5WhBG+9Qp+/nD6E9OZb+CMOI/wM00+TfR78lz8YEH/c0XRnwf8qI889T8KnXe/xZG/xvqQ3neCwtL4rvDJ1ZKvfsY6A/lfpzvN1D+o37Ut8HA+aEAnscMhVdjgM837N8jiPb4u/L37CDiPchiGux3U5IGebep+DQgiOc1PYL+lhEUF8rxERGMLy0B5BeKYPzZFhCXS79YosbvCaD825Q/lQXwvH4UEddL4IcG8DxkVLF+EGwLVbCVNmrqHUFlh/vRmN0iort0knF+PLyHLdysxI9g7lTBMuBHcF5QtOVH4zRYyG+6H53xzxYKN8ePwaHWQv6L/HgYnBYGjzv9KOzIJA3yHDCZhsP3oAI/5mdjgHMIPwaPviqYdfKjsVsMpDf4UN4tBs6f4EPw5hkoX4uOwdprYPA2dTwcuYb4r6zi3/ei/hcZaMzrvLhfbwOD+SYP0+S8KbTbjfLb6z+R/J52iaulc+cpfkNdeMh8Bgc/cJ6FBhpzgIb4NBoYfBY5ke8Bxf85B+Ld30T+/R0Y9EPq8tqsgtN6ddivLkXn+9TEHkFGKQcPoh+ReDyYpEH/jipYhdT6QtvZJLADHXh5rI7gZfyJQ4B/7Y6ILHnqjzoR799WiX3ST1ZqTIN+B90cvFvTIP9sNwaPprY0XT6AX0MEL6ehqqESjzBeoM/gCPdE4DA2W0K6Wed8JX+dhXw+TeJBNOiVnqQB3yeUv/VzIB6zVLCd58DDnGfi/vsdeJ56mMhnhhPX71HBtacm7rfdsn6T8s+ohod/iYF47VZdpVoDezK6S0irr/AYiMcel5DL6qcY6jy6mSZ/JBrO8xqVPLgVvyEq2UoYKF+DF+VbrPx/iI54bVTj9+noz+8q+Y+q83KyOo8lPuSXo5KHVT48X9NMDPav+hCPR5LnFeYfMbmNRPGAaFh/fZKGdZUquP7Oj/LNVpfjqX4xR9rjXgvPw4l+vvxB/zQVz56y0N8O+zB+bVfxq9mH9m+2+PKA/T+3WP5WHSuZ20LffYzLo48JGeVf19aU45Nyr8wJlYUMY8PgpiWfHvkw20hTf4bL36Xuje3bs5GZbAKPr3R5glZMTdn3vRrvmW33ba+m/2/H272hfbzdG9rH272hffxbx3U5LocHpWGBCNX7JdWcQBJN1TgkbLnVXI1DwVZRzdU4JIZ3VnM1DgndC9WcUEGBkxnlahwS+slRrlahQFod5WocEuoOMa7GofoujXE1Dt2Cx2NcbUOC+fs401CQLEzSIOe+OK+HBD4/wfxh/poE73+nnP9JguWDxPyKGpYfuicza1i/sfL/N9akdiPeqUnFp1Mt4wcFQM9axpdowp9o2G+Im9fD/ICL+ddIue/XeH8oSJ53snzQnYk5WH4o6K4rZf3q6/Y+8MzwEtYf5k8tZnyoW0T4UTeJ8KVuE+FPNNmHaLIfrSf7En+yP+1P/kHykf+Q/ORfpB/5H+lP/kn4kP8SfuTfhG9r/4eC4ug30BVuLGhPiqK931D8LohiQZ+nuqljolgQPa5hQVERxe7nVaoAXB4VM+y6bvQGp3DIwu7VKBZ4u1QBeZLC6woHNlDGx8Rt8scAT5YiPrfHsHt3jSpg34pxAU/2IBoKNjNJgx6b4rweCqbP48wfGhoiwfvD+kSC5QN9/5pg+UG/nQnWD3A5oYb13yC7031qGB/AfVQN43eR9IfxNYxvCm3jTzTYc52H14P/XOVl/rDfS17eH+Qv0Vk+KJi36yw/+M2VPtYP/GOtj/UHfl/6GB9qoBF+afIv6md8qYFF+BNN9iGa7Efryb7En+xP+5N/kHzkPyQ/+RfpR/5H+pN/Ej7kv4Qf+Tfh29r/Qd4j0TY0NGA2ulE/Os9eNzYcMmNYkPdw47qsGMbT51wo72Uqfs92Ybd6Ygz1udaFDb2yGDYserjwdWO+mr9HQ7o+Jh6W389oiOPrMfSL1Rp2y7+I8WsD2YNo4D8hSQPf6jivhwbD3XHmjw2gOO8P8jbFWT7yD5If9DsjwfpB/OufYP0h3o1IMD5wL4xLMH4QvycnGF+iCX+iIa77PLwe9tvoYf702kH7Q3d+opflg/0Xe1l+8g/SDxqmnXXWP6VBZONDr2WEH72mEb702kb4E032IZrsR+vJvsSf7E/7k3+QfOQ/JD/5F+lH/kf6k38SPuS/hB/5N+Hb2v9JH2oQQgPy3RjTcJ5XxLhhCvx1lb/UOfA+66fOQxcn4nHIPr/ydeBeJ67fZt93sjN4kYb2WRpFOyzQ8H6tVvfhZ+o1rlSdx2rlbzlRfG342IWvV5dFUf9aN9OkD9HwGrXMw+shXvX1Mn9Yv8Kb3F/Kl6WzfBA/FuosPzXcST+IR/k+1h/G7/IxPrD+RR/jB/oe72d8qSFI+BMNDb2yVvTaOK+H+39PnPmD/56b4P2x4Zhg+UCfWQmWvwIaignWD/B6PcH6Q7zcl2B8ANcuNYwfnMfTaxhfogl/osk+tJ7sR/zJvry/sj/JR/5B8pP/kH7kX6Q/+R/hQ/5J+JH/Er7k363939e1bXn5gxqgqb89fmDpa091PG/ZtzVHeSTHVSlbsAXHy+1CkQpvsj07NhSsaDUGknVVY9RT7ZAi/Hf9RPUHVcpQacl/naAqLfhdw7awSJskbdILI19hOSK5aTTeQIuDov7gF69FL5+KT1ShIFrqWq/4l/SQvCC2sr+8Eec/UYYZy5owZua+MFYIXayvtK4nRcp0UB2UzikLmbo3VXUQeeCxxwieL3qZIm36DVusXWMxGvUIixaZ3RcXYDTaHMLqYHOJenYIISYeD94Wfwyp31Kot93dlWK+PM0Dy5F+x8BT0bfyZ8Koww/BiDHoqDCAjO/JYnzCyFRPnJ8XiUx50z3qwae2addjBrJaPYmtLMQTXlHyi9TpanjuHCdaZDSp0IUB1fY1mPXaWU5PGfabxqDdLtcwyhkCf4Pg+2XqlC9lu6wQK8/mYoygh/LFWnkTaW6xUPrczrGYWTT7MUKXT8Sb4PmyX6RO8JPzXXkY/RsnixlSl8wD2ZANT7Kz4eGy/u7dCLfbpiA+iy/Nxqpk5I86T21XjDIrdY81yWUFQ3A7jIpYoXKb8rSaK8fyyl1+vSAY1/UOSgX4y6oV8D2jTRiUiyaUhWz2FX4dfiqR/tWFrRnQn83of7hAVJ8="],"Byte",ColorSpace->"RGB",Interleaving->True]; + +AppendTo[result,Style["GOGOGOGOGOGOGOGOGOGOGOGOGOGOGOGOGOGOGOGOGOGOGOGOGGOGOGOGOGOGOGOGO",{GrayLevel[0.3]}]]; +Print[Grid[{{Image[WallGoMatrixLoad,ImageSize->140],Row[result,"\n",BaseStyle->(FontFamily->"Consolas")]}},Alignment->{Left,Center}]] +(**) + + + +(*List of public functions*) +ImportModel::usage="\ +ImportModel[Group,gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC,Verbose->False,Mode->ModeNumber] \ +Loads the model and creates help tensors. Here, +gvvv: structure constants +gvff: vector-fermion trilinear couplings +gvss: vector-scalar trilinear couplings +\[Lambda]1: scalar tadpole couplings +\[Lambda]3: cubic couplings +\[Lambda]4: quartic couplings +\[Mu]ij: scalar-mass matrix +\[Mu]IJ: fermion-mass matrices +\[Mu]IJC: fermion-mass matrices +Ysff: Yukawa couplings +YsffC: Yukawa couplings. +"; + +CreateParticle::usage= +"CreateOutOfEq[{{\!\(\*SubscriptBox[\(r\), \(1\)]\),\!\(\*SubscriptBox[\(m\), \(1\)]\)},...,{\!\(\*SubscriptBox[\(r\), \(n\)]\),\!\(\*SubscriptBox[\(m\), \(n\)]\)}},\"R\"] is a function that groups n particles into one representation for +Fermions (R=F), +Vector Bosons (R=V), and +Scalars (R=S)." +SymmetryBreaking::usage= +"Classify different scalar, fermion, and vector representations into respective particles using VEV-induced masses. +As an output particle i are given as {\!\(\*SubscriptBox[\(r\), \(i\)]\),\!\(\*SubscriptBox[\(m\), \(i\)]\)} where \!\(\*SubscriptBox[\(r\), \(i\)]\) is the label of the representation and \!\(\*SubscriptBox[\(m\), \(i\)]\) is the label of the particle mass in that representation" +ExportMatrixElements::usage= +"ExportMatrixElements[file,particleList,UserMasses,UserCouplings,ParticleName,ParticleMasses,OptionsPattern[]]\n"<> +"Generates all possible matrix elements with the external particles specified in particleList.\n"<> +"The format can be specified by the option Format, with currently supported options: X=txt,json,hdf5,all,none, "<> +"the last two options exports the result in all possible formats, and in none, respectively.\n"<> +"A list of matrix elements is returned by the function regardless of the choosen format."; + + +AllocateTensors::usage="\ +Creates gauge generators"; +GradQuartic::usage="Creates Quartic tensors"; +GradCubic::usage="Creates Cubic tensors"; +GradTadpole::usage="Creates Tadpole tensors"; +GradSextic::usage="Creates dim 6 tensors"; +GradMass::usage="Creates Mass tensors"; +CreateInvariant::usage="Creates an invariant"; +CreateInvariantYukawa::usage="Creates Yukawa Tensor"; +GradYukawa::usage="Creates Yukawa tensor"; +GradMassFermion::usage="Creates Fermion Invariants"; +CreateInvariantFermion::usage="Creates Fermion Invariants"; + + +PerformDRhard::usage="\ +Performs the dimensional reduction from hard to soft"; + + +PrintFieldRepPositions::usage="Prints the indices of X={Gauge,Fermion,Scalar} reps"; + + +ImportMatrixElements::usage=""; + + +WallGoMatrix::failmsg = +"Error! WallGoMatrix has encountered a fatal problem and must abort the computation. \ +The problem reads: `1`"; +WallGoMatrix::failWarning = +"Error! WallGoMatrix has encountered a problem. \ +The problem reads: `1`"; + + +DefineDim6::usage="Defines a dimension 6 operator"; +CompareInvariants::usage="\ +Finds relations between couplings by calculating basis-invariant tensors"; + + +$WallGoMatrixDirectory=DirectoryName[$InputFileName]; + + +(* + Functions from groupmath are used to create the model. +*) +If[Global`$LoadGroupMath, + Get["GroupMath`"]; + Print["GroupMath is an independent package, and is not part of WallGoMatrix"]; + Print["Please cite GroupMath: Comput.Phys.Commun. 267 (2021) 108085 \[Bullet] e-Print: \!\(\*TemplateBox[{RowBox[{\"2011.01764\", \" \", \"[\", RowBox[{\"hep\", \"-\", \"th\"}], \"]\"}], {URL[\"https://arxiv.org/abs/2011.01764\"], None}, \"https://arxiv.org/abs/2011.01764\", \"HyperlinkActionRecycled\", {\"HyperlinkActive\"}, BaseStyle -> {\"Hyperlink\"}, HyperlinkAction -> \"Recycled\"},\n\"HyperlinkTemplate\"]\)"]; +]; +Print["WallGoMatrix is powered by the DRalgo ModelCreation."] +Print["Please cite \!\(\*TemplateBox[{\"DRalgo\", {URL[\"https://github.com/DR-algo/DRalgo\"], None}, \"https://github.com/DR-algo/DRalgo\", \"HyperlinkActionRecycled\", {\"HyperlinkActive\"}, BaseStyle -> {\"Hyperlink\"}, HyperlinkAction -> \"Recycled\"},\n\"HyperlinkTemplate\"]\): Comput.Phys.Commun. 288 (2023) 108725 \[Bullet] e-Print: \!\(\*TemplateBox[{RowBox[{\"2205.08815\", \" \", \"[\", RowBox[{\"hep\", \"-\", \"ph\"}], \"]\"}], {URL[\"https://arxiv.org/abs/2205.08815\"], None}, \"https://arxiv.org/abs/2205.08815\", \"HyperlinkActionRecycled\", {\"HyperlinkActive\"}, BaseStyle -> {\"Hyperlink\"}, HyperlinkAction -> \"Recycled\"},\n\"HyperlinkTemplate\"]\)"]; + + +(* + Verbose=True removes progress messages. + Mode=2 calculates everything, + Mode=1 only calculates LO masses and couplings + Mode=0 only calculates LO masses +*) +Options[ImportModel]={ + Verbose->False, + Mode->2, + Dim6->False} + + +Begin["`Private`"] + + +(* + Loads all functions. +*) +(*Loads DRalgo model creation*) +Get[FileNameJoin[{$WallGoMatrixDirectory,"modelCreation.m"}]]; +(*Loads matrix element creation*) +Get[FileNameJoin[{$WallGoMatrixDirectory,"matrixelements.m"}]]; + + +(* ::Section::Closed:: *) +(*Model: Initialization*) + + +(* + Defines internal tensors from the loaded model. Also creates help-tensors used for + intermediate calculations. +*) +ImportModel[GroupI_,gvvvI_,gvffI_,gvssI_,\[Lambda]1I_,\[Lambda]3I_,\[Lambda]4I_,\[Mu]ijI_,\[Mu]IJFI_,\[Mu]IJFCI_,YsffI_,YsffCI_, OptionsPattern[]]:= +Module[ +{ + GroupP=GroupI, + gvvvP=gvvvI,gvffP=gvffI,gvssP=gvssI,\[Lambda]1IP=\[Lambda]1I,\[Lambda]3P=\[Lambda]3I,\[Lambda]4P=\[Lambda]4I, + \[Mu]ijP=\[Mu]ijI,\[Mu]IJFP=\[Mu]IJFI,\[Mu]IJFCP=\[Mu]IJFCI,YsffP=YsffI,YsffCP=YsffCI +}, + +If[ Global`$LoadGroupMath, + If[!GroupMathCleared && !ValueQ[Global`$GroupMathMultipleModels], + Remove["GroupMath`*"]; + GroupMathCleared=True; + ]; +]; + \[Mu]ij=\[Mu]ijP//SparseArray//SimplifySparse; + gvvv=gvvvP//SparseArray//SimplifySparse; + gvss=gvssP//SparseArray//SimplifySparse; + \[Lambda]4=\[Lambda]4P//SparseArray//SimplifySparse; + \[Lambda]3=\[Lambda]3P//SparseArray//SimplifySparse; + Ysff=YsffP//SparseArray//SimplifySparse; + YsffC=YsffCP//SparseArray//SimplifySparse; + gvff=gvffP//SparseArray//SimplifySparse; + \[Mu]IJF=\[Mu]IJFP//SparseArray//SimplifySparse; + \[Mu]IJFC=\[Mu]IJFCP//SparseArray//SimplifySparse; + \[Lambda]1=\[Lambda]1IP//SparseArray//SimplifySparse; + ns=Length[gvss[[1]]]; + nv=Length[gvvv]; + nf=Length[gvff[[1]]]; + \[Lambda]6=EmptyArray[{ns,ns,ns,ns,ns,ns}]; + +(*Options*) + verbose=OptionValue[Verbose]; + mode=OptionValue[Mode]; (*If 2 everthing is calculated. And if 2 only 1-loop contributions are calculated*) +(*End of Options*) + + CreateHelpTensors[] (*Creates recurring tensors*) +]; + + +(* + Defines a \[Phi]^6 operator +*) +DefineDim6[\[Lambda]6I_]:=Module[{\[Lambda]6P=\[Lambda]6I}, + If[mode>=3, + \[Lambda]6=\[Lambda]6P//SparseArray; + , + Message[WallGoMatrix::failmsg, "Please set mode=3 to use this feature"]; + Abort[] + ]; +]; + + +(* ::Section::Closed:: *) +(*Model: Functions for loading and printing*) + + +(* + Converts an array to a saveable form +*) +ConvertToSaveFormat[tens_SparseArray]:=Module[{}, + Return[{tens["NonzeroPositions"],tens["NonzeroValues"],Dimensions[tens]}] +]; + + +(* + Converts imported data, as defined by ConvertToSaveFormat, to a sparse array +*) +ConvertToSparse[arr_]:=Module[{}, + Return[SparseArray[arr[[1]]->arr[[2]],arr[[3]]]] +]; + + +(* + Loads the position of all scalar,gauge, and fermion representations. +*) +LoadRepPositions[repPos_]:=Module[{repPosP=repPos}, + ScalarVariablesIndices=repPosP[[1]]; + GaugeIndices=repPosP[[2]]; + FermionVariablesIndices=repPosP[[3]]; +]; + + +(* + Loads the names of gauge couplings. +*) +LoadCouplingNames[couplingNamesI_]:=Module[{couplingNamesP=couplingNamesI}, + GaugeCouplingNames=couplingNamesP; +]; + + +(* + Saves a model by converting all coupling-tensors to a list. +*) +SaveModel[modelInfo_,fileName_]:=Module[{modelInfoP=modelInfo}, + + PosScalar=PrintScalarRepPositions[]; + PosVector=PrintGaugeRepPositions[]; + PosFermion=PrintFermionRepPositions[]; + PosReps={PosScalar,PosVector,PosFermion}; + tensP={modelInfoP,PosReps,GaugeCouplingNames,GroupDR,gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJFC,\[Mu]IJF,Ysff,YsffC}; + SaveFile={tensP[[1]],tensP[[2]],tensP[[3]],tensP[[4]]}; (*The fourth element is the group*) + tensP=Delete[Delete[Delete[Delete[tensP,1],1],1],1]; + + Do[ + AppendTo[SaveFile,ConvertToSaveFormat[i]]; + ,{i,tensP}]; + + Export[fileName,SaveFile]; +]; + + +(* + Loads tensors that are saved by SaveModel +*) +LoadModel[fileName_]:=Module[{}, + arrImp=ReadList[fileName]; + InfoText=arrImp[[1]];(*The first element is the info*) + arrImp=Delete[arrImp,1]; + + LoadRepPositions[arrImp[[1]]];(*The Second element is the repPositions*) + arrImp=Delete[arrImp,1]; + + LoadCouplingNames[arrImp[[1]]];(*The Third element is the gauge-coupling names*) + arrImp=Delete[arrImp,1]; + + ImportFile={arrImp[[1]]};(*The fourth element is the group*) + arrImp=Delete[arrImp,1]; + + Do[ + AppendTo[ImportFile,ConvertToSparse[i]]; + ,{i,arrImp}]; +(*Prints the info text*) + Print[Grid[{{Row[InfoText,"\n",BaseStyle->(FontFamily->"Consolas")]}},Alignment->{Left,Center}]]; +(**) + Return[ImportFile] +]; + + +(* ::Section::Closed:: *) +(*MatrixElements: Export functions for different formats*) + + +(* ::Subsubsection:: *) +(*json matrix elements functions*) + + +makeJsonMatrixElements::usage="makeJsonMatrixElements[particles,parameters,results] converts a list of particle names {'Phi',...}, a list of particle parameters {g,...}, and a list of matrix elements results in the form {M[0,0,0,0]->g^4 s/t,...} to a JSON object in a standard format."; +makeJsonMatrixElements[particles_,parameters_,resultsI_]:=Module[ +{ + particlesJson,matrixElementsJson,toString,getRelevantParameters, + replaceSpecials,results=resultsI +}, + + toString[arg_]:=If[StringQ[arg],arg,ToString[arg,InputForm]]; + replaceSpecials[arg_]:=StringReplace[arg,{"Pi"->"_pi","sReplace"->"_s","tReplace"->"_t","uReplace"->"_u"}]; + getRelevantParameters[arg_]:=Select[parameters,Not[FreeQ[arg,#]]&]; + particlesJson=Table[<|"index"->i-1,"name"->toString[particles[[i]]]|>,{i,1,Length[particles]}]; + results=results/.{s->sReplace,t->tReplace,u->uReplace}; + + matrixElementsJson=Map[<| + "externalParticles"->#[[1]]/.M[a__]->List[a], + "parameters"->Map[toString,getRelevantParameters[#[[2]]]], + "expression"->replaceSpecials[toString[PrintNonPrivate[#[[2]]]]]|>&, + results]; + + Return[<|"particles"->particlesJson,"matrixElements"->matrixElementsJson|>] +]; + + +testJsonMatrixElements::usage="testJsonMatrixElements[json] tests if a JSON object is of the expected form for exporting matrix elements."; +testJsonMatrixElements[json_]:=Module[{testBool,returnString,nParticles,expectedForm}, +testBool=True; +returnString="Json object matches expected schema"; +(* checking head *) +If[Head[json]!=Association, +returnString="Not Association";testBool=False]; +(* checking dimensions *) +If[Dimensions[json]!={2}, +returnString="Dimensions not {2}";testBool=False]; +(* checking top level keys *) +If[Keys[json]!={"particles","matrixElements"}, +returnString="Top level keys not {'particles','matrixElements'}";testBool=False]; +(* checking lower level keys *) +If[Keys[json["particles"][[1]]]!={"index","name"}, +returnString="'particles' keys not {'index','name'}";testBool=False]; +If[Keys[json["matrixElements"][[1]]]!={"externalParticles","parameters","expression"}, +returnString="'matrixElements' keys not {'externalParticles','parameters','expressions'}";testBool=False]; +(* returning results *) +{testBool, returnString} +] + + +splitJsonMatrixElements::usage="splitJsonMatrixElements[json] splits a JSON object containing matrix elements into a list {particleNames,parameters,results}."; +splitJsonMatrixElements[json_]:=Module[ +{ + particles,matrixElements,particleIndices,particleNames, + matrixElementIndices,matrixElementParameters,matrixElementExpressions, + parameters,expressions,results +} +, +particles=json["particles"]; +particleIndices=Map[#["index"]&,json["particles"]]; +particleNames=Map[#["name"]&,json["particles"]]; +matrixElements=json["matrixElements"]; +matrixElementIndices=Map[#["externalParticles"]&,json["matrixElements"]]; +matrixElementParameters=Map[#["parameters"]&,json["matrixElements"]]; +matrixElementExpressions=Map[#["expression"]&,json["matrixElements"]]; +parameters=Map[ToExpression,DeleteDuplicates[Flatten[matrixElementParameters]]]; +expressions=Map[ToExpression,StringReplace[matrixElementExpressions,{RegularExpression["(\\W)_s"]->"$1s",RegularExpression["(\\W)_t"]->"$1t",RegularExpression["(\\W)_u"]->"$1u"}]]; +results=Thread[matrixElementIndices->expressions]; +results=Map[M[#[[1]]/.List->Sequence]->#[[2]]&,results]; +{particleNames,parameters,PrintNonPrivate[results]} +]; + + + +ExportTo["json"][MatrixElement_,ParticleName_,UserCouplings_,file_]:=Block[ +{ + toExportJson, + particleName=ParticleName +}, + +(*Formatting the matrix elements*) + AppendTo[particleName,"LightParticle"]; + toExportJson=makeJsonMatrixElements[particleName,UserCouplings,MatrixElement]; +(*Exporting the result*) + exportJsonMatrixElements[StringJoin[file,".json"],toExportJson]; + Print["Results have been exported to: ", StringJoin[file,".json"]]; +] + + +(* reading JSON matrix elements *) +importJSONMatrixElements::usage="importJSONMatrixElements[file] imports a JSON file of matrix elements into a JSON object."; +importJSONMatrixElements[file_]:=Import[file,"RawJSON"]; +(* export JSONMatrixElements *) +exportJsonMatrixElements::usage="exportJsonMatrixElements[file,jsonMatrixElements] exports a JSON object of matrix elements into a JSON file."; +exportJsonMatrixElements[file_,jsonMatrixElements_]:=Module[{test}, + If[Not[StringQ[file]],Print["File must be a string"];Return[]]; + If[StringTake[file,-5]!=".json",Print["File must end in .json"];Return[]]; + Export[file,jsonMatrixElements] +]; + + +(* ::Subsubsection:: *) +(*hdf5 matrix elements functions*) + + +ExportTo["hdf5"][Cij_,OutOfEqParticles_,ParticleName_,UserCouplings_,file_]:=Block[{ExportH5,writeData,CijName,CijExport,ParticleInfo,CouplingInfo}, + +(*Metadata*) + ParticleInfo=Table[{ToString[OutOfEqParticles[[i]]-1],ParticleName[[i]]},{i,Length[OutOfEqParticles]}]; + AppendTo[ParticleInfo,{ToString[Length[OutOfEqParticles]],"LightParticle"}]; + CouplingInfo=Table[{ToString[UserCouplings[[i]]],ToString[Symbol["c"][i-1]]},{i,1,Length[UserCouplings]}]; + + CijExport=Cij; + Do[CijExport[[i,j]]=Table[MatrixElemToC@k,{k,Cij[[i,j]]}];, + {i,OutOfEqParticles},{j,OutOfEqParticles}]; +(*In the hdf5 file we separate them into Cij components*) + ExportH5=Reap[Do[ + CijName=StringJoin["MatrixElements",ParticleName[[i]],ParticleName[[j]]]; + Sow[ + writeData=Table[{ToString[FortranForm[PrintNonPrivate[a[[1]]]]],ToString[FortranForm[PrintNonPrivate[a[[2]]]]]},{a,CijExport[[i,j]]}]; + If[Length[CijExport[[i,j]]]==0,writeData=""]; + CijName -> {"Data" -> writeData} + ]; + ,{i,OutOfEqParticles},{j,OutOfEqParticles}]]; + + ExportH5=Flatten[ExportH5[[2]][[1]]]; + +(*Adding metadata*) + AppendTo[ExportH5,"ParticleInfo"->{"Data"->ParticleInfo}]; + AppendTo[ExportH5,"CouplingInfo"->{"Data"->CouplingInfo}]; + +(*Exporting the reult*) + Export[StringJoin[file,".hdf5"],ExportH5]; + Print["Results have been exported to: ", StringJoin[file,".hdf5"]]; +] + + +(* ::Subsubsection:: *) +(*txt matrix elements functions*) + + +ExportTo["txt"][MatrixElements_,OutOfEqParticles_,ParticleName_,UserCouplings_,file_]:=Block[ +{ + ParticleInfo,CouplingInfo,ExportTXT,matrixElementsTXT,replaceSpecials,toString, + sReplace,tReplace,uReplace +}, + + (*Creating some metadata*) + ParticleInfo=Table[{ToString[OutOfEqParticles[[i]]-1],ParticleName[[i]]},{i,Length[OutOfEqParticles]}]; + AppendTo[ParticleInfo,{ToString[Length[OutOfEqParticles]],"LightParticle"}]; + CouplingInfo=Table[{ToString[UserCouplings[[i]]],ToString[Symbol["c"][i-1]]},{i,1,Length[UserCouplings]}]; + + ExportTXT=MatrixElements/.{s->sReplace,t->tReplace,u->uReplace}; + + toString[arg_]:=If[StringQ[arg],arg,ToString[arg,InputForm]]; + replaceSpecials[arg_]:=StringReplace[arg,{"Pi"->"_pi","sReplace"->"_s","tReplace"->"_t","uReplace"->"_u"}]; + + matrixElementsTXT=Map[ + toString[PrintNonPrivate[#[[1]]]]<>" -> "<>replaceSpecials[toString[PrintNonPrivate[#[[2]]]]]&, + ExportTXT]; + + (*Adding metadata to the matrix elements*) + PrependTo[matrixElementsTXT,ParticleInfo]; + PrependTo[matrixElementsTXT,CouplingInfo]; + +(*Exporting*) + Export[StringJoin[file,".txt"],matrixElementsTXT]; + Print["Results have been exported to: ", StringJoin[file,".txt"]]; +] + + +(* ::Section::Closed:: *) +(*MatrixElements: Exporting the results*) + + +PrintNonPrivate[PrivateExpression_]:=ToExpression[StringReplace[ToString[StandardForm[PrivateExpression]],"WallGoMatrix`Private`"->""]]; +ReplaceMandelStam[Expression_]:=StringReplace[ToString[Expression],{"s"->"_s","t"->"_t","u"->"_u"}]; + + +Options[ExportMatrixElements]={ + Replacements->{}, + NormalizeWithDOF->True, + TruncateAtLeadingLog->True, + Verbose->False, + Format->"none"}; + + +ExportMatrixElements[file_,particleList_,UserMasses_,UserCouplings_,ParticleName_,ParticleMasses_,OptionsPattern[]]:= +Block[ +{ + ParticleMassesI=ParticleMasses,ExportTXT,ExportH5, + Cij,ParticleInfo,LightParticles,particleListFull, + CouplingInfo,MatrixElements,OutOfEqParticles,RepMasses,RepCouplings, + FormatOptions,userFormat,MatrixElementsList,userParameters +}, + +(*Specifies if the first particle should be normalized by the number of degrees of freedom*) + bNormalizeWithDOF = OptionValue[NormalizeWithDOF]; + +(*Specifies if only leading log terms are taken into account or not*) + bTruncateAtLeadingLog = OptionValue[TruncateAtLeadingLog]; + +(*Specifies if Output should be verbose*) + bVerbose = OptionValue[Verbose]; + +(*Splits ParticleList into out-of-eq and light particles*) + ExtractLightParticles[particleList,OutOfEqParticles,particleListFull,LightParticles]; + +(*Creates an assumption rule for simplifying Conjugate[....] terms*) + VarAsum=#>0&/@Variables@Normal@{Ysff,gvss,gvff,gvvv,\[Lambda]4,\[Lambda]3,ParticleMasses,s,t,u}; (*All variables are assumed to be real*) + +(*Allocates one element for each species mass to avoid errors*) + If[ParticleMasses[[1]]=={},ParticleMassesI[[1]]={msq}]; + If[ParticleMasses[[2]]=={},ParticleMassesI[[2]]={msq}]; + If[ParticleMasses[[3]]=={},ParticleMassesI[[3]]={msq}]; + +(*Extracting all matrix elements*) + GenerateMatrixElements[MatrixElements,Cij,particleListFull,LightParticles,ParticleMassesI,OutOfEqParticles]; +(*Creates a replacement list and shifts the indices to start at 0.*) + MatrixElementsList=Table[MatrixElemToC@i//.OptionValue[Replacements],{i,MatrixElements}]; + +(*Exporting the matrix elements to the choosen format*) + FormatOptions = {"txt", "json", "hdf5", "all", "none"}; + userFormat = OptionValue[Format]; + + (* Convert userFormat to a list if it's a single value *) + userFormatsList = If[ListQ[userFormat], userFormat, {userFormat}]; + + (* Replace "all" with all formats if it is present *) + If[MemberQ[userFormatsList, "all"], userFormatsList = {"txt", "json", "hdf5"}]; + + (* Check if all formats in the list are valid *) + If[AllTrue[userFormatsList, MemberQ[FormatOptions, #] &], + (* Iterate over each format and perform the export *) + Do[ + Switch[fmt, + "txt", ExportTo["txt"][MatrixElementsList, OutOfEqParticles, ParticleName, UserCouplings, file], + "hdf5", ExportTo["hdf5"][Cij, OutOfEqParticles, ParticleName, UserCouplings, file], + "json", + userParameters = Flatten[Join[UserCouplings, ParticleMasses]] // DeleteDuplicates; + ExportTo["json"][MatrixElementsList, ParticleName, userParameters, file] + ], + {fmt, userFormatsList} + ], + Message[WallGoMatrix::failWarning, "The currently allowed formats are: txt, hdf5, and json. Please choose a valid format."]; + ]; + + Return[PrintNonPrivate[MatrixElementsList]] +]; + + +MatrixElemToC[MatrixElem_]:=Block[{Ind}, + Ind=MatrixElem[[2]]; + + Return[M[Ind[[1]]-1,Ind[[2]]-1,Ind[[3]]-1,Ind[[4]]-1]->MatrixElem[[1]]] +] + + +MatrixElemFromC[MatrixElem_]:=Block[{Ind}, + Ind=MatrixElem[[2]]; + + Return[M[Ind[[1]]+1,Ind[[2]]+1,Ind[[3]]+1,Ind[[4]]+1]->MatrixElem[[1]]] +] + + +ImportMatrixElements[file_]:=Module[ +{ + jsonObject,particleNames,parameters,results +}, + (* Only implemented for JSON *) + If[StringTake[file,-5]!=".json",Print["File must end in .json"];Return[]]; + + (* Importing into JSON object *) + jsonObject=importJSONMatrixElements[file]; + + (* Splitting JSON object *) + {particleNames,parameters,results}=splitJsonMatrixElements[jsonObject]; + + (* Returning results *) + Return[{particleNames,parameters,results}] +]; + + +(* ::Section::Closed:: *) +(*Private constants*) + + +{CT} + + +{\[CapitalLambda]\[Lambda],\[CapitalLambda]g,Hg,Habij,HabIJF,HabIJFC,Ysij,YsijC,YTemp,YTempC,Yhelp,YhelpC};(*Private Variables*) + + +{\[Lambda]1IP};(*Private Variables*) + + +{\[Mu]IJF,\[Mu]IJFC,GroupMathCleared} + + +End[] +EndPackage[] diff --git a/src/matrixElements.m b/src/matrixElements.m index b6a7c86..47a66e9 100644 --- a/src/matrixElements.m +++ b/src/matrixElements.m @@ -8,6 +8,62 @@ (*Help functions*) +(* + Trick to simplify tensors because Mathematica 13 sucks. +*) +SimplifySparse[s_SparseArray] := With[ + { + elem =Simplify[s["NonzeroValues"]], + pos=s["NonzeroPositions"], + dim = Dimensions[s] + }, +SparseArray[pos->elem,dim,0] + ] + + + +(* + Creates tensors used in intermediate steps +*) +CreateHelpTensors[]:=Module[{}, +(*Ahh, you were at my side, all along... My true mentor... My guiding moonlight...*) + If[verbose,Print["Creating Help Tensors"]]; + +(*Tensors that are built from two scalar-vector trillinear couplings*) + Habij=Contract[gvss,gvss,{{3,5}}]//Transpose[#,{1,3,2,4}]&//SimplifySparse; + Hg=TensorContract[Habij,{{3,4}}]//SimplifySparse; + \[CapitalLambda]g=TensorContract[Habij,{{1,2}}]//SimplifySparse; + HabijV=Habij+Transpose[Habij,{2,1,3,4}]//SparseArray//SimplifySparse; + +(*Tensor that is built from two structure constants*) + GabcdV=gvvv . gvvv//SparseArray//SimplifySparse; + +(*Tensor that is built from two fermion-vector trillinear couplings*) + HabIJF=Contract[gvff,gvff,{{3,5}}]//Transpose[#,{1,3,2,4}]&//SimplifySparse; + +(*Tensors that is built from two Yukawa couplings*) + Ysij=Contract[Ysff,YsffC,{{2, 5},{3,6}}]//SimplifySparse; + YsijC=Contract[YsffC,Ysff,{{2, 5},{3,6}}]//SimplifySparse; + + If[mode>=1, +(*Tensor that is built from two scalar quartics*) + \[CapitalLambda]\[Lambda] =Flatten[\[Lambda]4,{{1},{2},{3,4}}] . Flatten[\[Lambda]4,{1,2}]//SparseArray//SimplifySparse; + +(*Invariant tensors built from two Yukawa couplings*) + YTemp=Ysff . Transpose[YsffC]//Transpose[#,{1,3,2,4}]&//Transpose[#,{1,2,4,3}]&//SimplifySparse; + YTempC=YsffC . Transpose[Ysff]//Transpose[#,{1,3,2,4}]&//Transpose[#,{1,2,4,3}]&//SimplifySparse; + + Yhelp=Flatten[YTemp,{{1},{2},{3,4}}] . Flatten[YTemp,{4,3}]//SparseArray//SimplifySparse; + YhelpC=Flatten[YTempC,{{1},{2},{3,4}}] . Flatten[YTempC,{4,3}]//SparseArray//SimplifySparse; + ]; + + +]; + + +TotalConj[s_] := Simplify[Total[s,-1],Assumptions->VarAsum] (*Sums all the elements of a tensors and simplifies with the assumption that all variables are real*) + + DiagonalTensor2[s_SparseArray,a_Integer,b_Integer] := With[ { s1=Flatten[s,{{a},{b}}] @@ -16,6 +72,24 @@ ] +OrderArray[s_SparseArray,a_Integer,b_Integer,c_Integer,d_Integer] := Flatten[s,{{a},{b},{c},{d}}] (*Permutes a rank 4 tensor via: Subscript[T, i1 i2 i3 i4]->Subscript[T, a b c d]*) + + +Contract[tensor1_,tensor2_,indices_]:=Activate @ TensorContract[ + Inactive[TensorProduct][tensor1,tensor2], indices] (*Performs tensor contractions on two tensors*) + + +Contract[tensor1_,tensor2_,tensor3_,indices_]:=Activate @ TensorContract[ + Inactive[TensorProduct][tensor1,tensor2,tensor3], indices](*Performs tensor contractions on three tensors*) + + +Contract[tensor1_,tensor2_,tensor3_,tensor4_,indices_]:=Activate @ TensorContract[ + Inactive[TensorProduct][tensor1,tensor2,tensor3,tensor4], indices] (*Performs tensor contractions on four tensors*) + + +ListToMat[list1_] := DiagonalMatrix[list1]//SparseArray (*Takes a 1-d list and turns it into a rank 2 sparse array*) + + RangeToIndices[ListI_]:=Block[{}, (*Creates a list of numbers between i and j when ListI=i;;j*) Table[i,{i,ListI[[1]],ListI[[2]]}] @@ -28,82 +102,56 @@ ]; -CreateOutOfEq[Indices_,Type_]:=Block[{PosScalar,PosVector,PosFermion,temp,Particle}, -(*Combines selected representations and obtain their indices*) - If[Type=="F", - Particle={}; - PosFermion=PrintFermionRepPositions[]; - Do[ - If[Length[i]>=2, - AppendTo[Particle,{FermionMassiveReps[[i[[1]]]][[i[[2]]]][[1]]}] - , - AppendTo[Particle,{RepToIndices[{PosFermion[[i]]}]}] - ]; - ,{i,Indices}]; - Return[{Flatten[Particle],Type}] - ]; +(* ::Subsubsection:: *) +(*CreateParticle*) - If[Type=="V", - Particle={}; - PosVector=PrintGaugeRepPositions[]; - Do[ - If[Length[i]>=2, - AppendTo[Particle,{GaugeMassiveReps[[i[[1]]]][[i[[2]]]][[1]]}] - , - AppendTo[Particle,{RepToIndices[{PosVector[[i]]}]}] - ]; - ,{i,Indices}]; - Return[{Flatten[Particle],Type}] - ]; +CreateParticle[Indices_,Type_]:=Block[ +{ + Field,FieldPosition,temp,Particle +}, +(*Combines selected representations and obtain their indices*) + Particle={}; + Field=Switch[Type, + "V","Vector", + "F","Fermion", + "S","Scalar"]; + FieldPosition=PrintFieldRepPositions[Field]; + Do[ + If[Length[i]>=2, + (*if there is more than 1 argument the SymmetryBreaking["X"] split is assumed*) + AppendTo[Particle,{MassiveReps[Field][[i[[1]]]][[i[[2]]]][[1]]}], + AppendTo[Particle,{RepToIndices[{FieldPosition[[i]]}]}] + ]; + ,{i,Indices}]; + Return[{Flatten[Particle],Type}] ]; -SymmetryBreaking[vev_] :=Block[{PosVector,PosFermion}, -(* - -*) - PosVector=PrintGaugeRepPositions[]; - - GaugeMassiveReps=Table[SymmetryBreakingGauge[i,vev],{i,1,Length[PosVector]}]; - - Do[ - If[!NumericQ[Total[GaugeMassiveReps[[i]][[;;,2]],-1]], - Print[Style[StringJoin["Gauge rep ",ToString[i]," splits into:"],Bold]]; - Do[ - Print["One particle with mass ",particle[[2]] ]; - ,{particle,GaugeMassiveReps[[i]]}] - ] - ,{i,1,Length[PosVector]}]; +(* ::Subsubsection:: *) +(*SymmetryBreaking*) - PosFermion=PrintFermionRepPositions[]; - - FermionMassiveReps=Table[SymmetryBreakingFermion[i,vev],{i,1,Length[PosFermion]}]; - - Do[ - If[!NumericQ[Total[FermionMassiveReps[[i]][[;;,2]],-1]], - Print[Style[StringJoin["Fermion rep ",ToString[i]," splits into:"],Bold]]; - Do[ - Print["One particle with mass ",particle[[2]] ]; - ,{particle,FermionMassiveReps[[i]]}] - ] - ,{i,1,Length[PosFermion]}]; - -] +Options[SymmetryBreaking]={ + VevDependentCouplings->False + }; -SymmetryBreakingGauge[Indices_,vev_] :=Block[{PosVector,Habij,massV,gaugeInd,posHeavy,posLight,rep,val,val2,pos,pos2}, +SymmetryBreakingField["Vector"][Indices_,vev_] :=Module[ +{ + PosVector,Habij,massV,gaugeInd,posHeavy,posLight, + rep,val,val2,pos,pos2 +}, (* Finds the masses for the gauge-representation Indices. *) - PosVector=PrintGaugeRepPositions[]; + PosVector=PrintFieldRepPositions["Vector"]; (*Gauge bosons*) Habij=Contract[gvss,gvss,{{3,5}}]//Transpose[#,{1,3,2,4}]&//SparseArray; - massV=-1/2 Activate@TensorContract[Inactive@TensorProduct[Habij,vev,vev],{{3,5},{4,6}}]//SparseArray; - gaugeInd=Delete[DiagonalTensor2[massV,1,2]//Normal//ArrayRules,-1]/.(({a_}->x_)->a); + massV=-Activate@TensorContract[Inactive@TensorProduct[Habij,vev,vev],{{3,5},{4,6}}]//SparseArray; + gaugeInd=Delete[DiagonalTensor2[massV,1,2]//Normal//ArrayRules,-1]/.(({i1_}->x_)->i1); posHeavy=Intersection[RangeToIndices[PosVector[[Indices]]],gaugeInd]; posLight=Complement[RangeToIndices[PosVector[[Indices]]],gaugeInd]; @@ -130,15 +178,60 @@ ] -SymmetryBreakingFermion[Indices_,vev_] :=Block[{PosFermion,fermionInd,massF,posHeavy,posLight,rep,val,val2,pos,pos2}, +SymmetryBreakingField["Scalar"][Indices_,vev_] :=Module[ +{ + PosScalar,scalarInd,massS,posHeavy,posLight,rep,val,val2,pos,pos2 +}, +(* + Finds the masses for the fermion-representation Indices. +*) + PosScalar=PrintFieldRepPositions["Scalar"]; + +(*Scalars*) + massS=( + + \[Mu]ij + + (vev . \[Lambda]4 . vev/2) + + (vev . \[Lambda]3) + )//Normal//SparseArray; + scalarInd=Delete[massS//ArrayRules,-1]/.(({i1_,i2_}->x_)->i1); + + posHeavy=Intersection[RangeToIndices[PosScalar[[Indices]]],scalarInd]; + posLight=Complement[RangeToIndices[PosScalar[[Indices]]],scalarInd]; + + If[Length[massS[[posHeavy,;;]]]==0, + rep={{posLight,0}}; + , + val=massS[[posHeavy,;;]]["NonzeroValues"]//DeleteDuplicates; + pos=Table[i,{i,Length[posHeavy]}]; + + rep={}; + + Do[ + pos2=Table[posHeavy[[pos[[b]][[1]]]],{b,Position[massS[[posHeavy,posHeavy]]["NonzeroValues"],a]}]; + AppendTo[rep,{pos2,a}]; + ,{a,val}]; + + AppendTo[rep,{posLight,0}]; + If[posLight=={},rep=Drop[rep,-1]]; + ]; + rep +] + + +SymmetryBreakingField["Fermion"][Indices_,vev_] :=Module[ +{ + PosFermion,fermionInd,massF,posHeavy,posLight,rep,val,val2,pos,pos2 +}, (* Finds the masses for the fermion-representation Indices. *) - PosFermion=PrintFermionRepPositions[]; + PosFermion=PrintFieldRepPositions["Fermion"]; (*Fermions*) - massF=\[Mu]IJ+vev . Ysff; - fermionInd=Delete[massF//ArrayRules,-1]/.(({a_,b_}->x_)->a); + massF=( + + \[Mu]IJF + + (vev . Ysff)); + fermionInd=Delete[massF//ArrayRules,-1]/.(({i1_,i2_}->x_)->i1); posHeavy=Intersection[RangeToIndices[PosFermion[[Indices]]],fermionInd]; posLight=Complement[RangeToIndices[PosFermion[[Indices]]],fermionInd]; @@ -159,20 +252,36 @@ AppendTo[rep,{posLight,0}]; If[posLight=={},rep=Drop[rep,-1]]; ]; - rep + Return[rep] ] -Contract[tensor1_,tensor2_,indices_]:=Activate @ TensorContract[ - Inactive[TensorProduct][tensor1,tensor2], indices] - - -Contract[tensor1_,tensor2_,tensor3_,indices_]:=Activate @ TensorContract[ - Inactive[TensorProduct][tensor1,tensor2,tensor3], indices] - - -Contract[tensor1_,tensor2_,tensor3_,tensor4_,indices_]:=Activate @ TensorContract[ - Inactive[TensorProduct][tensor1,tensor2,tensor3,tensor4], indices] +SymmetryBreaking[vev_,OptionsPattern[]]:=Module[ +{ + FieldPosition,PosVector,PosFermion,PosScalar,count(*, + GaugeMassiveReps,FermionMassiveReps,ScalarMassiveReps*) +}, + Do[ + FieldPosition[Field]=PrintFieldRepPositions[Field]; + (* TODO Gauge fix massive reps as internal variables*) + MassiveReps[Field]=Table[SymmetryBreakingField[Field][i,vev],{i,1,Length[FieldPosition[Field]]}]; + Do[ + If[!NumericQ[Total[MassiveReps[Field][[i]][[;;,2]],-1]], + Print[Style[StringJoin[Field<>" rep ",ToString[i]," splits into particles with mass squared:"],Bold]]; + count=0; + Do[ + count++; + Print[{i,count},": ",particle[[2]] ]; + ,{particle,MassiveReps[Field][[i]]}] + ] + ,{i,1,Length[FieldPosition[Field]]}]; + ,{Field,{"Vector","Fermion","Scalar"}} + ]; + + If[OptionValue[VevDependentCouplings]==True, (*Additional terms are added to scalar trillinear coupligs if the VevDependentCouplings option is used*) + \[Lambda]3=\[Lambda]3+\[Lambda]4 . vev; + ] +] (* ::Section:: *) @@ -180,17 +289,16 @@ (* ::Subsubsection::Closed:: *) -(*V1V2toV3V4*) +(*V1V2toV3V4-D*) CreateMatrixElementV1V2toV3V4[particle1_,particle2_,particle3_,particle4_,vectorMass_]:= -Block[{s,t,u,gTensor,leadingLog}, +Block[{s,t,u,gTensor,C1,C2,C3,vectorPropT,vectorPropS,vectorPropU,A1,A2,A3, + Res1,Res2,Res3,Res4}, (* -In QCD this process depends on up to -two Lorentz structures if the particles are all the same; and -one Lorentz structure if they are all different. + This module returns the squared matrix element of VV->VV summed over all quantum numbers of the incoming particles. + If the incoming particles are not of the form FV->FV the routine returns 0. *) -leadingLog=False; If[ particle1[[2]]!="V"|| particle2[[2]]!="V"|| @@ -220,46 +328,44 @@ (*Vector propagators*) vectorPropT=Table[1/(t-i),{i,vectorMass}]; vectorPropU=Table[1/(u-i),{i,vectorMass}]; + vectorPropS=Table[1/(s-i),{i,vectorMass}]; -(*Since there are two diagrams there can be 3 Lorentz structures after squaring and summing over spins*) -(*They are just hardcoded for now*) +(*Lorentz structures that appear*) +(* + Here we use the convention that a term like su/t^2->1/4-1/4 (s-u)^2/(t-msq)^2. See hep-ph/0302165. +*) A1=16(-1/4)(s-u)^2; (*squared t-channel diagram*) A2=16(-1/4)(s-t)^2; (*squared u-channel diagram*) - A3=16*t*u/s^2; (*squared s-channel diagram*) + A3=16(-1/4)(u-t)^2; (*squared s-channel diagram*) -(*We now generate the matrix element for Q1+Q2->Q3+Q4*) Res1=A1*DiagonalMatrix[vectorPropT] . C1 . DiagonalMatrix[vectorPropT]; Res2=A2*DiagonalMatrix[vectorPropU] . C2 . DiagonalMatrix[vectorPropU]; - Res3=A3*C3; + Res3=A3*DiagonalMatrix[vectorPropS] . C3 . DiagonalMatrix[vectorPropS]; (*add terms independent on the mandelstam variables*) - Res4=-16*((C1+C2)*(1-1/4)+C3); + Res4=-16*((C1+C2+C3)*(1-1/4)); -(*Factor 4 from anti-particle contributions*) - Return[-Total[Res1+Res2+If[leadingLog,Res3+Res4,0],-1]] + Return[-Total[Res1+Res2+Res3+Res4,-1]] ] ]; (* ::Subsubsection::Closed:: *) -(*Q1Q2toQ3Q4*) - - -CreateMatrixElementQ1Q2toQ3Q4Pre[particle1_,particle2_,particle3_,particle4_,vectorMass_]:=Block[{}, - Return[1/2*( - +CreateMatrixElementQ1Q2toQ3Q4[particle1,particle2,particle3,particle4,vectorMass] - +CreateMatrixElementQ1Q2toQ3Q4[particle1,particle2,particle4,particle3,vectorMass] - )]; -]; - - -CreateMatrixElementQ1Q2toQ3Q4[particle1_,particle2_,particle3_,particle4_,vectorMass_]:= -Block[{s,t,u,gTensor,leadingLog}, +(*F1F2toF3F4-D*) + + +CreateMatrixElementF1F2toF3F4[particle1_,particle2_,particle3_,particle4_,vectorMass_,scalarMass_]:= +Block[{ + s,t,u,gTensor, + CSy,CTy,CUy,CSyC,CTyC,CUyC,CSyCC,CTyCC,CUyCC, + CS,CT,CU,CSC,CTC,CUC,CSCC,CTCC,CUCC, + CTrS,CTrT,CTrU,A3,A4,A5,A6, + Tensor,YTensorC,scalarPropT,scalarPropU,vectorPropU,vectorPropT, + C5,C1Y,C2Y,A1,A2,vectorPropS,totRes,scalarPropS,YTensor +}, (* -In QCD this process depends on up to -two Lorentz structures if the particles are all the same; and -one Lorentz structure if they are all different. + This module returns the squared matrix element of FF->FF summed over all quantum numbers of the incoming particles. + If the incoming particles are not of the form FF->FF the routine returns 0. *) -leadingLog=False; If[ particle1[[2]]!="F"|| particle2[[2]]!="F"|| @@ -267,83 +373,138 @@ particle4[[2]]!="F", Return[0]; , + +(*Vector propagators*) + vectorPropT=Table[1/(t-i),{i,vectorMass}]//ListToMat; + vectorPropU=Table[1/(u-i),{i,vectorMass}]//ListToMat; + vectorPropS=Table[1/(s-i),{i,vectorMass}]//ListToMat; + + scalarPropT=Table[1/(t-i),{i,scalarMass}]//ListToMat; + scalarPropU=Table[1/(u-i),{i,scalarMass}]//ListToMat; + scalarPropS=Table[1/(s-i),{i,scalarMass}]//ListToMat; + (*Coupling constants that we will need*) gTensor=Table[gvff[[;;,Particle1[[1]],Particle2[[1]]]], {Particle1,{particle1,particle2,particle3,particle4}}, {Particle2,{particle1,particle2,particle3,particle4}}]; -(*Group invariants that multiply various Lorentz Structures*) - C1=Table[ - Tr[gTensor[[1,3]][[a]] . gTensor[[3,1]][[b]]] - Tr[gTensor[[2,4]][[a]] . gTensor[[4,2]][[b]]], - {a,1,Length[gTensor[[1,3]]]},{b,1,Length[gTensor[[2,4]]]}]; - C2=Table[ - Tr[gTensor[[1,4]][[a]] . gTensor[[4,1]][[b]]] - Tr[gTensor[[2,3]][[a]] . gTensor[[3,2]][[b]]], - {a,1,Length[gTensor[[1,3]]]},{b,1,Length[gTensor[[1,3]]]}]; + YTensor=Table[Ysff[[;;,Particle1[[1]],Particle2[[1]]]], + {Particle1,{particle1,particle2,particle3,particle4}}, + {Particle2,{particle1,particle2,particle3,particle4}}]; + + YTensorC=Table[YsffC[[;;,Particle1[[1]],Particle2[[1]]]], + {Particle1,{particle1,particle2,particle3,particle4}}, + {Particle2,{particle1,particle2,particle3,particle4}}]; - C3=Table[ - Tr[gTensor[[1,3]][[a]] . gTensor[[3,2]][[b]] . gTensor[[2,4]][[a]] . gTensor[[4,1]][[b]]], - {a,1,Length[gTensor[[1,3]]]},{b,1,Length[gTensor[[2,4]]]}]; - C3+=Table[ - Tr[gTensor[[3,1]][[a]] . gTensor[[1,4]][[b]] . gTensor[[4,2]][[a]] . gTensor[[2,3]][[b]]], - {a,1,Length[gTensor[[1,4]]]},{b,1,Length[gTensor[[2,3]]]}]; - C4=Table[ - Tr[gTensor[[1,2]][[a]] . gTensor[[2,1]][[b]]] - Tr[gTensor[[3,4]][[a]] . gTensor[[4,3]][[b]]], - {a,1,Length[gTensor[[1,2]]]},{b,1,Length[gTensor[[3,4]]]}]; +(*Group invariants from scalar diagrams*) + CSy=Contract[YTensor[[1,2]],scalarPropS . YTensor[[3,4]],{{1,4}}]//OrderArray[#,1,2,3,4]&; + CTy=Contract[YTensor[[1,3]],scalarPropT . YTensor[[2,4]],{{1,4}}]//OrderArray[#,1,3,2,4]&; + CUy=Contract[YTensor[[1,4]],scalarPropU . YTensor[[2,3]],{{1,4}}]//OrderArray[#,1,3,4,2]&; + + CSyC=Contract[YTensor[[1,2]],scalarPropS . YTensorC[[3,4]],{{1,4}}]//OrderArray[#,1,2,3,4]&; + CTyC=Contract[YTensor[[1,3]],scalarPropT . YTensorC[[2,4]],{{1,4}}]//OrderArray[#,1,3,2,4]&; + CUyC=Contract[YTensor[[1,4]],scalarPropU . YTensorC[[2,3]],{{1,4}}]//OrderArray[#,1,3,4,2]&; + + CSyCC=Contract[YTensorC[[1,2]],scalarPropS . YTensorC[[3,4]],{{1,4}}]//OrderArray[#,1,2,3,4]&; + CTyCC=Contract[YTensorC[[1,3]],scalarPropT . YTensorC[[2,4]],{{1,4}}]//OrderArray[#,1,3,2,4]&; + CUyCC=Contract[YTensorC[[1,4]],scalarPropU . YTensorC[[2,3]],{{1,4}}]//OrderArray[#,1,3,4,2]&; + +(*Group invariants from vector diagrams*) + CS=Contract[gTensor[[1,2]],vectorPropS . gTensor[[3,4]],{{1,4}}]//OrderArray[#,1,2,3,4]&; + CT=Contract[gTensor[[1,3]],vectorPropT . gTensor[[2,4]],{{1,4}}]//OrderArray[#,1,3,2,4]&; + CU=Contract[gTensor[[1,4]],vectorPropU . gTensor[[2,3]],{{1,4}}]//OrderArray[#,1,3,4,2]&; + + CTrS=Contract[gTensor[[2,1]],vectorPropS . gTensor[[4,3]],{{1,4}}]//OrderArray[#,2,1,4,3]&; + CTrT=Contract[gTensor[[3,1]],vectorPropT . gTensor[[4,2]],{{1,4}}]//OrderArray[#,2,4,1,3]&; + CTrU=Contract[gTensor[[4,1]],vectorPropU . gTensor[[3,2]],{{1,4}}]//OrderArray[#,2,4,3,1]&; + + CSC=Contract[gTensor[[1,2]],vectorPropS . gTensor[[4,3]],{{1,4}}]//OrderArray[#,1,2,4,3]&; + CTC=Contract[gTensor[[1,3]],vectorPropT . gTensor[[4,2]],{{1,4}}]//OrderArray[#,1,4,2,3]&; + CUC=Contract[gTensor[[1,4]],vectorPropU . gTensor[[3,2]],{{1,4}}]//OrderArray[#,1,4,3,2]&; + + CSCC=Contract[gTensor[[2,1]],vectorPropS . gTensor[[3,4]],{{1,4}}]//OrderArray[#,2,1,3,4]&; + CTCC=Contract[gTensor[[3,1]],vectorPropT . gTensor[[2,4]],{{1,4}}]//OrderArray[#,2,3,1,4]&; + CUCC=Contract[gTensor[[4,1]],vectorPropU . gTensor[[2,3]],{{1,4}}]//OrderArray[#,2,3,4,1]&; + C5=Table[ Tr[gTensor[[1,3]][[a]] . gTensor[[3,4]][[b]] . gTensor[[4,2]][[a]] . gTensor[[2,1]][[b]]], {a,1,Length[gTensor[[1,3]]]},{b,1,Length[gTensor[[1,3]]]}]; C5+=Table[ Tr[gTensor[[3,1]][[a]] . gTensor[[1,2]][[b]] . gTensor[[2,4]][[a]] . gTensor[[4,3]][[b]]], - {a,1,Length[gTensor[[1,3]]]},{b,1,Length[gTensor[[1,3]]]}]; - -(*Vector propagators*) - vectorPropT=Table[1/(t-i),{i,vectorMass}]; - vectorPropU=Table[1/(u-i),{i,vectorMass}]; - vectorPropS=Table[1/(s-i),{i,vectorMass}]; - -(* -Since there are two diagrams there can be -3 Lorentz structures after squaring and summing over spins -*) -(*They are just hardcoded for now*) + {a,1,Length[gTensor[[1,3]]]},{b,1,Length[gTensor[[1,3]]]}]; + + +(*Lorentz structures that appear in squared vector-exchange diagrams*) A1=2(s^2+u^2); (*squared t-channel diagram*) A2=2(s^2+t^2); (*squared u-channel diagram*) A3=4*s^2; (*Interference between u and t channel diagrams*) - A4=2(t^2+u^2)/s^2; (*Squared s-channel*) + A4=2(t^2+u^2); (*Squared s-channel*) A5=4*u^2; (*Interference between s and t channel diagrams*) - A6=4*s^2; (*Interference between s and u channel diagrams*) + A6=4*t^2; (*Interference between s and u channel diagrams*) + + +(*Result for squared vector-exchange diagrams*) + totRes=A1*Total[CT CTrT,-1]; + totRes+=A2*Total[CU CTrU,-1]; + totRes+=1/2A3*Total[CT CTrU+CU CTrT,-1]; + totRes+=A4*Total[CS CTrS,-1]; + totRes+=1/2*A5 Total[(vectorPropS . C5 . vectorPropT),-1]; + totRes+=1/2*A6 Total[(vectorPropS . C5 . vectorPropU),-1]; + +(*Result for squared scalar-exchange diagrams*) + totRes+= t^2/4*TotalConj[CTy Conjugate[CTy]]; + totRes+= u^2/4*TotalConj[CUy Conjugate[CUy]]; + totRes+= s^2/4*TotalConj[CSy Conjugate[CSy]]; + + totRes+= t^2/2*TotalConj[CTyC Conjugate[CTyC]]; + totRes+= u^2/2*TotalConj[CUyC Conjugate[CUyC]]; + totRes+= s^2/2*TotalConj[CSyC Conjugate[CSyC]]; + + totRes+= t^2/4*TotalConj[CTyCC Conjugate[CTyCC]]; + totRes+= u^2/4*TotalConj[CUyCC Conjugate[CUyCC]]; + totRes+= s^2/4*TotalConj[CSyCC Conjugate[CSyCC]]; + + + totRes+=- 1/8(t^2-s^2+u^2)*TotalConj[CUy Conjugate[CTy] +CTy Conjugate[CUy]]; + totRes+=- 1/8(s^2-t^2+u^2)*TotalConj[CUy Conjugate[CSy] +CSy Conjugate[CUy]]; + totRes+=- 1/8(t^2-u^2+s^2)*TotalConj[CSy Conjugate[CTy] +CTy Conjugate[CSy]]; -(*We now generate the matrix element for Q1+Q2->Q3+Q4*) - Res1=A1*DiagonalMatrix[vectorPropT] . C1 . DiagonalMatrix[vectorPropT]; - Res2=A2*DiagonalMatrix[vectorPropU] . C2 . DiagonalMatrix[vectorPropU]; - Res3=1/2(A3*DiagonalMatrix[vectorPropU] . C3 . DiagonalMatrix[vectorPropT])/.(#->0&/@VectorMass); - Res4=A4*C4; - Res5=1/2*(A5*DiagonalMatrix[vectorPropS] . C5 . DiagonalMatrix[vectorPropT])/.(#->0&/@VectorMass); - Res5+=1/2*(A6*DiagonalMatrix[vectorPropS] . C5 . DiagonalMatrix[vectorPropU])/.(#->0&/@VectorMass); + totRes+=- 1/8(t^2-s^2+u^2)*TotalConj[CUyCC Conjugate[CTyCC] +CTyCC Conjugate[CUyCC]]; + totRes+=- 1/8(s^2-t^2+u^2)*TotalConj[CUyCC Conjugate[CSyCC] +CSyCC Conjugate[CUyCC]]; + totRes+=- 1/8(t^2-u^2+s^2)*TotalConj[CSyCC Conjugate[CTyCC] +CTyCC Conjugate[CSyCC]]; + +(* + Result for interfaces between vector and scalar diagrams--- + Only cross terms between diagrams can contribute +*) + + totRes+=1/2*s*t*TotalConj[CS*Conjugate[CTyC] +CTyC*Conjugate[CS]]; + totRes+=1/2*u*t*TotalConj[CU*Conjugate[CTyC] +CTyC*Conjugate[CU]]; + totRes+=1/2*s*u*TotalConj[CS*Conjugate[CUyC] +CUyC*Conjugate[CS]]; + totRes+=1/2*u*t*TotalConj[CT*Conjugate[CUyC] +CUyC*Conjugate[CT]]; - Return[Total[Res1+Res2+Res3+If[leadingLog,Res4+Res5,0],-1]] + totRes+=1/2*s*t*TotalConj[CT*Conjugate[CSyC] +CSyC*Conjugate[CT]]; + totRes+=1/2*u*s*TotalConj[CU*Conjugate[CSyC] +CSyC*Conjugate[CU]]; + + Return[Refine[4*totRes,Assumptions->VarAsum]] ] ]; (* ::Subsubsection::Closed:: *) -(*Q1V1toQ1V1*) +(*F1V1toF1V1-D*) -CreateMatrixElementQ1V1toQ1V1[particle1_,particle2_,particle3_,particle4_,vectorMass_,fermionMass_]:= -Block[{s,t,u,gTensor,leadingLog}, +CreateMatrixElementF1V1toF1V1[particle1_,particle2_,particle3_,particle4_,vectorMass_,fermionMass_]:= +Block[{s,t,u,gTensor,resTot,t1,s1,u1,p1,p2,p3,p4,temp,kinFlip}, (* -In QCD this process depends on up to -two Lorentz structures if the particles are all the same; and -one Lorentz structure if they are all different. + This module returns the squared matrix element of FV->FV summed over all quantum numbers of the incoming particles. + If the incoming particles are not of the form FV->FV the routine returns 0. *) -leadingLog=False; + kinFlip=0; (*records if the external or incoming legs were swapped, and does a t<->u transformation for each swap*) If[ ( (particle1[[2]]=="F"&&particle2[[2]]=="V")|| (particle1[[2]]=="V"&&particle2[[2]]=="F") @@ -351,79 +512,30 @@ (particle3[[2]]=="F"&&particle4[[2]]=="V")|| (particle3[[2]]=="V"&&particle4[[2]]=="F")), - p1=particle1[[1]]; - p2=particle2[[1]]; - p3=particle3[[1]]; - p4=particle4[[1]]; - symmFac=1; -(*Changing the order of the particles so that it is always QV->QV*) + p1=particle1; + p2=particle2; + p3=particle3; + p4=particle4; +(*Changing the order of the particles so that it is always FV->FV*) If[particle1[[2]]=="V"&&particle2[[2]]=="F", temp=p1; p1=p2; p2=temp; - symmFac=2; + kinFlip+=1; ]; If[particle3[[2]]=="V"&&particle4[[2]]=="F", temp=p3; p3=p4; p4=temp; + kinFlip+=1; ]; -(*Coupling constants that we will need*) - gTensor[1,2]=gvff[[p2,p1,;;]]; - gTensor[2,1]=gvff[[p2,;;,p1]]; - - gTensor[3,4]=gvff[[p4,p3,;;]]; - gTensor[4,3]=gvff[[p4,;;,p3]]; - - gTensor[1,4]=gvff[[p4,p1,;;]]; - gTensor[4,1]=gvff[[p4,;;,p1]]; - - gTensor[2,3]=gvff[[p2,p3,;;]]; - gTensor[3,2]=gvff[[p2,;;,p3]]; - -(*Vector propagators*) - vectorPropT=Table[1/(t-i),{i,vectorMass}]; - -(*Fermion propagators*) - fermionPropU=Table[1/(u-i),{i,fermionMass}]; - fermionPropS=Table[1/(s),{i,fermionMass}]; - -(*Group invariants that multiply various Lorentz Structures*) - C1=Tr[ - Sum[gTensor[2,1][[a]] . gTensor[1,2][[a]],{a,Length[gTensor[1,2]]}] . - Sum[gTensor[4,3][[b]] . gTensor[3,4][[b]],{b,Length[gTensor[3,4]]}]]; - - C2=Tr[ - DiagonalMatrix[fermionPropU] . Sum[gTensor[4,1][[a]] . gTensor[1,4][[a]],{a,Length[gTensor[1,4]]}] . - DiagonalMatrix[fermionPropU] . Sum[gTensor[3,2][[b]] . gTensor[2,3][[b]],{b,Length[gTensor[2,3]]}]]; - - C3=Sum[vectorPropT[[a]]vectorPropT[[b]] - Tr[gTensor[4,1][[b]] . gTensor[1,2][[a]] . gTensor[4,3][[b]] . gTensor[2,3][[a]]], - {a,Length[gTensor[1,2]]},{b,Length[gTensor[1,4]]}]; - C3+=Sum[vectorPropT[[a]]vectorPropT[[b]] - Tr[gTensor[2,1][[b]] . gTensor[1,4][[a]] . gTensor[3,2][[b]] . gTensor[3,4][[a]]], - {a,Length[gTensor[1,4]]},{b,Length[gTensor[3,2]]}]; - C4=Tr[ - Sum[vectorPropT[[a]]gTensor[2,1][[a]] . gTensor[1,2][[a]],{a,Length[gTensor[1,2]]}] . - Sum[vectorPropT[[b]]gTensor[4,3][[b]] . gTensor[3,4][[b]],{b,Length[gTensor[3,4]]}]]; - C5=Tr[ - Sum[vectorPropT[[a]]gTensor[4,1][[a]] . gTensor[1,4][[a]],{a,Length[gTensor[1,4]]}] . - Sum[vectorPropT[[b]]gTensor[3,2][[b]] . gTensor[2,3][[b]],{b,Length[gTensor[2,3]]}]]; + (*The result for FV->FV is the same as FF->VV if we do some renaming of the mandelstam variables*) + resTot=-CreateMatrixElementF1F2toV1V2[p1,p3,p2,p4,fermionMass,vectorMass]/.{s->s1,t->t1,u->u1}; (*Minus sign as we reversed the momentum of a fermion*) + resTot=resTot/.{s1->t,t1->s,u1->u}; -(*Since there are two diagrams there can be 3 Lorentz structures after squaring and summing over spins*) -(*The interference diagram does however not contribute at leading-log, so I omit it*) -(*They are just hardcoded for now*) - A1=-4*u/s; (*squared t-channel diagram*) - A2=-4*s*u; (*squared u-channel diagram*) - A3=4*(s^2+u^2); (*squared s-channel diagram*) - -(*We now generate the matrix element for Q1+Q2->Q3+Q4*) - Res1=A1*C1; - Res2=A2*C2; - Res3=-(A3*C3-8*(C4*s^2+C5*u^2))//Simplify; - - Return[symmFac*(If[leadingLog,Res1,0]+Res2+Res3)] + If[Mod[kinFlip,2]==1,resTot=resTot/.{t->t1,u->u1}/.{t1->u,u1->t};]; + Return[resTot] , Return[0] ] @@ -431,17 +543,19 @@ (* ::Subsubsection::Closed:: *) -(*Q1Q2toV1V2*) +(*F1F2toV1V2-D*) -CreateMatrixElementQ1Q2toV1V2[particle1_,particle2_,particle3_,particle4_,fermionMass_]:= -Block[{s,t,u,gTensor,gTensorT,leadingLog}, +CreateMatrixElementF1F2toV1V2[particle1_,particle2_,particle3_,particle4_,fermionMass_,vectorMass_]:= +Block[{s,t,u,gTensor,gTensorT,vectorPropS,gVTensor,fermionPropU,fermionPropT,CS,CTrS, + fermionIdentity, + C1,C2,C3,C4,C5,C6,p1,p2,p3,p4, + temp,A1,A2,A3,Res1,Res2,Res3,Res4}, (* -In QCD this process depends on up to -two Lorentz structures if the particles are all the same; and -one Lorentz structure if they are all different. + This module returns the squared matrix element of FF->VV summed over all quantum numbers of the incoming particles. + If the incoming particles are not of the form FF->VV the routine returns 0. *) -leadingLog=False; + If[ (particle1[[2]]!="F"||particle2[[2]]!="F"||particle3[[2]]!="V"||particle4[[2]]!="V")&& (particle1[[2]]!="V"||particle2[[2]]!="V"||particle3[[2]]!="F"||particle4[[2]]!="F"), @@ -451,13 +565,12 @@ p2=particle2[[1]]; p3=particle3[[1]]; p4=particle4[[1]]; - symmFac=1; If[ particle1[[2]]=="V"&& particle2[[2]]=="V"&& particle3[[2]]=="F"&& particle4[[2]]=="F", -(*Just changing the order of the particles so that it is always QQ->VV*) +(*Just changing the order of the particles so that it is always FF->VV*) temp=p1; p1=p3; p3=temp; @@ -465,8 +578,8 @@ temp=p2; p2=p4; p4=temp; - symmFac=2; (*for quark final states we have to add vv-> q qbar+vv->qbar q; this overcounting is always compensated for later*) ]; + (*Coupling constants that we will need*) gTensor[1,3]=gvff[[p3,p1,;;]]; gTensor[3,1]=gvff[[p3,;;,p1]]; @@ -479,10 +592,13 @@ gTensor[2,3]=gvff[[p3,p2,;;]]; gTensor[3,2]=gvff[[p3,;;,p2]]; - + (*Fermion propagators*) fermionPropU=Table[1/(u-i),{i,fermionMass}]; fermionPropT=Table[1/(t-i),{i,fermionMass}]; + vectorPropS=Table[1/(s-i),{i,vectorMass}]; + + fermionIdentity=Table[1,{i,fermionMass}]; (*Group invariants that multiply various Lorentz Structures*) C1=Tr[ @@ -498,156 +614,1010 @@ Tr[gTensor[3,1][[b]] . gTensor[1,4][[a]] . gTensor[3,2][[b]] . gTensor[2,4][[a]]], {a,Length[gTensor[1,4]]},{b,Length[gTensor[3,2]]}]; -(*Multiplying with propagators for each particle*) + C4=Tr[ + DiagonalMatrix[fermionIdentity] . Sum[vectorPropS[[a]]gTensor[3,1][[a]] . gTensor[1,3][[a]],{a,Length[gTensor[1,3]]}] . + DiagonalMatrix[fermionIdentity] . Sum[vectorPropS[[b]]gTensor[4,2][[b]] . gTensor[2,4][[b]],{b,Length[gTensor[2,4]]}]]; + C5=Tr[ + DiagonalMatrix[fermionIdentity] . Sum[vectorPropS[[a]] gTensor[4,1][[a]] . gTensor[1,4][[a]],{a,Length[gTensor[1,4]]}] . + DiagonalMatrix[fermionIdentity] . Sum[vectorPropS[[b]]gTensor[3,2][[b]] . gTensor[2,3][[b]],{b,Length[gTensor[2,3]]}]]; + + C6=Sum[ + Tr[vectorPropS[[a]]vectorPropS[[b]]gTensor[4,1][[b]] . gTensor[1,3][[a]] . gTensor[4,2][[b]] . gTensor[2,3][[a]]], + {a,Length[gTensor[1,3]]},{b,Length[gTensor[4,2]]}]; + C6+=Sum[ + Tr[vectorPropS[[a]]vectorPropS[[b]]gTensor[3,1][[b]] . gTensor[1,4][[a]] . gTensor[3,2][[b]] . gTensor[2,4][[a]]], + {a,Length[gTensor[1,4]]},{b,Length[gTensor[3,2]]}]; -(*Since there are two diagrams there can be 3 Lorentz structures after squaring and summing over spins*) -(*The interference diagram does however not contribute at leading-log, so I omit it*) -(*They are hardcoded for now*) +(*Since there are two diagrams there can be 3 Lorentz structures after squaring and summing over spins, + so naturally the final result contains 4 Lorentz structures for consistency.*) A1=4*t*u; (*squared t-channel diagram*) A2=4*t*u; (*squared u-channel diagram*) - A3=4*(t^2+u^2)/s^2; (*squared s-channel diagram*) + A3=4*(t^2+u^2); (*squared s-channel diagram*) -(*Generate the matrix element for Q1+Q2->Q3+Q4*) +(*Collecting everything into the final result*) Res1=A1*C1; Res2=A2*C2; - Res3=A3*C3 - -8*t^2/s^2(t^2 C1/.(#->0&/@fermionMass)) - -8*u^2/s^2(u^2 C2/.(#->0&/@fermionMass))//Simplify; + Res3=A3*C6; + Res3+=-8*t^2 C4; + Res3+=-8*u^2 C5; + -(*Factor of 2 from anti-particles*) - Return[symmFac*(Res1+Res2+If[leadingLog,Res3,0])] + Return[2*(Res1+Res2+Res3)](*Factor of 2 from anti-particles*) ] ]; -(* ::Section:: *) -(*Getting the matrix elements for out-of-Equilibrium particles*) - - -degreeOfFreedom[particle_]:=Block[{dof}, - - dof=Length[particle[[1]]]; - - (*Factor of 2 from helicites, factor of 2 from anti-particles*) - If[particle[[2]]=="F",dof]; - - (*Factor of 2 from spins*) - If[particle[[2]]=="V",dof*=2]; - - Return[dof]; -] - - (* ::Subsubsection::Closed:: *) -(*Q1Q2toQ3Q4*) +(*S1S2toS3S4-D*) -ExtractOutOfEqElementQ1Q2toQ3Q4[particleList_,LightParticles_]:= -Block[{OutOfEqParticles,MatrixElements,Elements,CollElements}, -(*incomingParticle is the particle associated with the momentum p_1*) -(*deltaFparticle is the particles whos deltaF contributions we want*) +CreateMatrixElementS1S2toS3S4[particle1_,particle2_,particle3_,particle4_,vectorMass_,scalarMass_]:= +Block[{s,t,u,gTensor,leadingLog,\[Lambda]3Tensor,\[Lambda]4Tensor,vectorPropT,scalarPropT,vectorPropU,scalarPropU,Particle3,Particle4, + AS,AU,AT,scalarPropS,vectorPropS, + TotRes,CS,CT,CU,CS\[Lambda],CT\[Lambda],CU\[Lambda],C\[Lambda]}, (* - Essentially this is generates the elements going into - Sum_deltaFparticle \[Delta]C[incomingParticle,deltaFparticle]*deltaF[deltaFparticle] + This module returns the squared matrix element of SS->SS summed over all quantum numbers of the incoming particles. + If the incoming particles are not of the form SS->SS the routine returns 0. *) - -(*particleList is the complete list of particles*) - -(*Generate all matrix elements*) - OutOfEqParticles=Complement[Table[i,{i,1,Length[particleList]}],LightParticles]; - -(*Divide the incoming particle by its degree's of freedom*) - MatrixElements=Table[ - 1/degreeOfFreedom[particleList[[a]]] - CreateMatrixElementQ1Q2toQ3Q4Pre[particleList[[a]],b,c,d,VectorMass], - {a,OutOfEqParticles},{b,particleList},{c,particleList},{d,particleList}]//SparseArray; -(*This is a list of all non-zero matrix elements*) - Elements=MatrixElements["NonzeroPositions"]; - -(*If there are no matching matrix elements we return 0*) -If[Length[Elements]==0, - Return[{}]; +If[ + particle1[[2]]!="S"|| + particle2[[2]]!="S"|| + particle3[[2]]!="S"|| + particle4[[2]]!="S", + Return[0]; , +(*Coupling constants that we will need*) + gTensor=Table[gvss[[;;,Particle1[[1]],Particle2[[1]]]], + {Particle1,{particle1,particle2,particle3,particle4}}, + {Particle2,{particle1,particle2,particle3,particle4}}]; -(*Now we add identical contributions*) -(*The Q1Q2->Q1Q2 process is the same as the Q1Q2->Q2Q1 process*) - symmetries=Gather[Elements,(#1[[1;;2]]==#2[[1;;2]])&]; - symmetries=Gather[#,#1[[3;;4]]==Sort[#2[[3;;4]]]&]&/@symmetries//Flatten[#,1]&; - MultiPlicity=Table[Length[a],{a,symmetries}]; - Elements=Table[i[[1]],{i,symmetries}]; - (*MatrixElements is now just a list*) - MatrixElements=Table[MultiPlicity[[i]] Extract[MatrixElements,Elements[[i]]],{i,1,Length[Elements]}]; + \[Lambda]3Tensor=Table[\[Lambda]3[[;;,Particle1[[1]],Particle2[[1]]]], + {Particle1,{particle1,particle2,particle3,particle4}}, + {Particle2,{particle1,particle2,particle3,particle4}}]; + + \[Lambda]4Tensor=Table[\[Lambda]4[[Particle1[[1]],Particle2[[1]],Particle3[[1]],Particle4[[1]]]], + {Particle1,{particle1,particle2,particle3,particle4}}, + {Particle2,{particle1,particle2,particle3,particle4}}, + {Particle3,{particle1,particle2,particle3,particle4}}, + {Particle4,{particle1,particle2,particle3,particle4}}]; + +(*Vector propagators*) + vectorPropT=Table[1/(t-i),{i,vectorMass}]//ListToMat; + vectorPropU=Table[1/(u-i),{i,vectorMass}]//ListToMat; + vectorPropS=Table[1/(s-i),{i,vectorMass}]//ListToMat; + +(*Scalar propagators*) + scalarPropT=Table[1/(t-i),{i,scalarMass}]//ListToMat; + scalarPropU=Table[1/(u-i),{i,scalarMass}]//ListToMat; + scalarPropS=Table[1/(s-i),{i,scalarMass}]//ListToMat; + +(*Lorentz structures for vector exchanges*) + AS=(t-u); (* s-channel diagram*) + AT=(s-u); (* t-channel diagram*) + AU=(s-t); (* u-channel diagram*) -(*We also divide by the number of degrees of freedom of incomingParticle*) -(*The 2 is from the anti-particle contribution. I.e q1 q2->q1 q2 +q1 q2Bar->q1 q2Bar*) -(*Factor of 2 from over-counting ab->cd +ab->dc, or if c=d the 1/2 is a symmetry factor*) - MatrixElements=2*MatrixElements/2; -(*We now select all elements where deltaFparticle is amongst the scattered particles*) -(*deltaF is here a list of 1 and 0s*) -(*Gives all light-particle the label specified by the first lightparticle*) - deltaF=Elements/. x_?NumericQ /;MemberQ[ LightParticles,x ] -> LightParticles[[1]]; +(*Group invariants from vector diagrams*) + CS=AS*Contract[gTensor[[1,2]],vectorPropS . gTensor[[3,4]],{{1,4}}]//OrderArray[#,1,2,3,4]&; + CT=AT*Contract[gTensor[[1,3]],vectorPropT . gTensor[[2,4]],{{1,4}}]//OrderArray[#,1,3,2,4]&; + CU=AU*Contract[gTensor[[1,4]],vectorPropU . gTensor[[2,3]],{{1,4}}]//OrderArray[#,1,3,4,2]&; -(*Now we create the full list of distinct collision elements*) - CollElements=Table[{MatrixElements[[i]],deltaF[[i]]},{i,1,Length[Elements]}]; +(*Group invariants from scalar diagrams. Kos, some say Kosm...*) + + CS\[Lambda]= Contract[\[Lambda]3Tensor[[1,2]] , scalarPropS . \[Lambda]3Tensor[[3,4]],{{1,4}}]//OrderArray[#,1,2,3,4]&; + CT\[Lambda]= Contract[\[Lambda]3Tensor[[1,3]] , scalarPropT . \[Lambda]3Tensor[[2,4]],{{1,4}}]//OrderArray[#,1,3,2,4]&; + CU\[Lambda]= Contract[\[Lambda]3Tensor[[1,4]] , scalarPropU . \[Lambda]3Tensor[[2,3]],{{1,4}}]//OrderArray[#,1,3,4,2]&; + C\[Lambda]=\[Lambda]4[[particle1[[1]],particle2[[1]],particle3[[1]],particle4[[1]]]]; -(*We now add all elements with the same deltaF list*) - symmetries=Gather[CollElements,#1[[2]]==#2[[2]]&]; - CollElements=Table[{symmetries[[i]][[;;,1]]//Total[#,-1]&,symmetries[[i]][[1,2]]},{i,1,Length[symmetries]}]; - Return[CollElements] + +(*Total contribution; as the external legs have no helicities we can just sum and square the amplitudes*) + TotRes=Total[(CS\[Lambda]+CT\[Lambda]+CU\[Lambda]+C\[Lambda]+CS+CT+CU) Conjugate[(CS\[Lambda]+CT\[Lambda]+CU\[Lambda]+C\[Lambda]+CS+CT+CU)],-1]; (*total amplitude-squared contribution from all diagrams*) + + + Return[Refine[TotRes,Assumptions->VarAsum]] ] ]; -(* ::Subsubsection::Closed:: *) -(*Q1V1toQ1V1*) +(* ::Subsubsection:: *) +(*S1S2toF1F2-D*) -ExtractOutOfEqElementQ1V1toQ1V1[particleList_,LightParticles_]:= -Block[{OutOfEqParticles,MatrixElements,Elements,CollElements}, -(*incomingParticle is the particle associated with the momentum p_1*) -(*deltaFparticle is the particles whos deltaF contributions we want*) +CreateMatrixElementS1S2toF1F2[particle1_,particle2_,particle3_,particle4_,vectorMass_,scalarMass_,fermionMass_]:= +Block[{s,t,u,gTensor,gTensorT,gTensorC,gTensorCT,gTensorVF,gTensorVFC,gTensorVS, + Res,CTT,CUU,ATT,AUU,p1,p2,p3,p4,gTensorS,gTensorF,YTensor,YTensorC,particleNull, + \[Lambda]3Tensor,YTensor2,YTensor2C,vectorPropS,scalarPropS,fermionPropT,fermionPropU,CVS, + CYS,CYT,CYU,ASSY,A,TotRes,temp}, (* - Essentially this is generates the elements going into - Sum_deltaFparticle \[Delta]C[incomingParticle,deltaFparticle]*deltaF[deltaFparticle] + This module returns the squared matrix element of SS->FF summed over all quantum numbers of the incoming particles. + If the incoming particles are not of the form SS->FF the routine returns 0. *) - -(*particleList is the complete list of particles*) - -(*First we generate all matrix elements*) - OutOfEqParticles=Complement[Table[i,{i,1,Length[particleList]}],LightParticles]; - -(*Divide the incoming particle by its degree's of freedom*) - MatrixElements=Table[ - 1/degreeOfFreedom[particleList[[a]]] - CreateMatrixElementQ1V1toQ1V1[particleList[[a]],b,c,d,VectorMass,FermionMass], +If[ + (particle1[[2]]!="S"||particle2[[2]]!="S"||particle3[[2]]!="F"||particle4[[2]]!="F")&& + (particle1[[2]]!="F"||particle2[[2]]!="F"||particle3[[2]]!="S"||particle4[[2]]!="S"), + Return[0]; +, + p1=particle1[[1]]; + p2=particle2[[1]]; + p3=particle3[[1]]; + p4=particle4[[1]]; +If[ + particle1[[2]]=="F"&& + particle2[[2]]=="F"&& + particle3[[2]]=="S"&& + particle4[[2]]=="S", +(*Just changing the order of the particles so that it is always SS->FF. Undoubtably this choice of ordering has a deep origin.*) + temp=p1; + p1=p3; + p3=temp; + + temp=p2; + p2=p4; + p4=temp; + ]; + + particleNull={}; (*Just a trick to make the ordering of particles simpler for the benefit of my brain*) +(*Coupling constants that we will need*) + gTensorS=Table[gvss[[;;,Particle1,Particle2]], + {Particle1,{p1,p2,particleNull,particleNull}}, + {Particle2,{p1,p2,particleNull,particleNull}}]; + + gTensorF=Table[gvff[[;;,Particle1,Particle2]], + {Particle1,{particleNull,particleNull,p3,p4}}, + {Particle2,{particleNull,particleNull,p3,p4}}]; + + YTensor=Table[Ysff[[;;,Particle1,Particle2]], + {Particle1,{particleNull,particleNull,p3,p4}}, + {Particle2,{particleNull,particleNull,p3,p4}}]; + + YTensorC=Table[YsffC[[;;,Particle1,Particle2]], + {Particle1,{particleNull,particleNull,p3,p4}}, + {Particle2,{particleNull,particleNull,p3,p4}}]; + + \[Lambda]3Tensor=Table[\[Lambda]3[[;;,Particle1,Particle2]], + {Particle1,{p1,p2,particleNull,particleNull}}, + {Particle2,{p1,p2,particleNull,particleNull}}]; + + YTensor2=Table[Ysff[[Particle1,Particle2,;;]], + {Particle1,{p1,p2,particleNull,particleNull}}, + {Particle2,{particleNull,particleNull,p3,p4}}]; + + YTensor2C=Table[YsffC[[Particle1,Particle2,;;]], + {Particle1,{p1,p2,particleNull,particleNull}}, + {Particle2,{particleNull,particleNull,p3,p4}}]; + +(*Vector propagators*) + vectorPropS=Table[1/(s-i),{i,vectorMass}]//ListToMat; + +(*Scalar propagators*) + scalarPropS=Table[1/(s-i),{i,scalarMass}]//ListToMat; + +(*Fermion propagators*) + fermionPropT=Table[1/(t-i),{i,fermionMass}]//ListToMat; + fermionPropU=Table[1/(u-i),{i,fermionMass}]//ListToMat; + + +(*Group invariants from vector diagrams*) + CVS=Contract[gTensorS[[1,2]],vectorPropS . gTensorF[[3,4]],{{1,4}}]//OrderArray[#,1,2,3,4]&; + +(*Group invariants from Yukawa diagrams*) + CYS=Contract[\[Lambda]3Tensor[[1,2]],scalarPropS . YTensor[[3,4]],{{1,4}}]//OrderArray[#,1,2,3,4]&; + CYT=Contract[YTensor2[[1,3]] . fermionPropT,YTensor2C[[2,4]],{{3,6}}]//OrderArray[#,1,3,2,4]&; + CYU=Contract[YTensor2[[1,4]] . fermionPropU,YTensor2C[[2,3]],{{3,6}}]//OrderArray[#,1,3,4,2]&; + +(*Lorentz structures for vector exchanges*) +(* + Due to angular momentum conservation the SS->S->FF diagram does not mix with the other channels. +*) + ASSY=s; (*Squared SS->S->FF diagram*) + A=t*u; (*All other squared diagrams are proportional to u*t *) + + +(*The result*) + (*SS->S->FF squared*) + TotRes=ASSY * TotalConj[CYS*Conjugate[CYS]]; + + (*Squared Yukawa diagrams with fermion exchanges*) + TotRes+=+A * TotalConj[CYT*Conjugate[CYT]]; (*squared t-channel diagram*) + TotRes+=+A * TotalConj[CYU*Conjugate[CYU]]; (*squared u-channel diagram*) + TotRes+=-A * TotalConj[CYU*CYT+CYT*CYU]; (*mixed u & t-channel diagrams*) + + (*Squared s-channel diagram with a vector boson*) + TotRes+=4*A*TotalConj[CVS*Conjugate[CVS]]; + + (*Mix between vector- and fermion-exchange diagrams*) + TotRes+=-2*A*TotalConj[ + -I(CYT+CYU)*Conjugate[CVS] + +I*CVS*Conjugate[(CYT+CYU)] + ]; + +(*The full result*) + Return[2*Refine[TotRes,Assumptions->VarAsum]] (*factor of 2 from anti-particles*) +] +]; + + +(* ::Subsubsection::Closed:: *) +(*F1S1toF1S1-D*) + + +CreateMatrixElementF1S1toF1S1[particle1_,particle2_,particle3_,particle4_,vectorMass_,scalarMass_,fermionMass_]:= +Block[{s,t,u,p1,p2,p3,p4,temp,resTot,u1,s1,t1,kinFlip}, +(* + This module returns the squared matrix element of FV->FV summed over all quantum numbers of the incoming particles. + If the incoming particles are not of the form FV->FV the routine returns 0. +*) + kinFlip=0; (*records if the external or incoming legs were swapped, and does a t<->u transformation for each swap*) +If[ ( + (particle1[[2]]=="F"&&particle2[[2]]=="S")|| + (particle1[[2]]=="S"&&particle2[[2]]=="F") + )&&( + (particle3[[2]]=="F"&&particle4[[2]]=="S")|| + (particle3[[2]]=="S"&&particle4[[2]]=="F")), + + p1=particle1; + p2=particle2; + p3=particle3; + p4=particle4; +(*Changing the order of the particles so that it is always SF->SF. Incidentally the opposite ordering as given in the name of the routine.*) + If[particle1[[2]]=="S"&&particle2[[2]]=="F", + temp=p1; + p1=p2; + p2=temp; + kinFlip+=1; + ]; + If[particle3[[2]]=="S"&&particle4[[2]]=="F", + temp=p3; + p3=p4; + p4=temp; + kinFlip+=1; + ]; + + (*The result for SF->SF is the same as SS->FF if we do some renaming of the mandelstam variables*) + resTot=-CreateMatrixElementS1S2toF1F2[p1,p3,p2,p4,vectorMass,scalarMass,fermionMass]/.{s->s1,t->t1,u->u1}; (*Minus sign as we reveresed the momentum of a fermion*) + resTot=resTot/.{s1->t,t1->s,u1->u}; + + If[Mod[kinFlip,2]==1,resTot=resTot/.{t->t1,u->u1}/.{t1->u,u1->t};]; + Return[resTot] +, + Return[0] +] +]; + + +(* ::Subsubsection::Closed:: *) +(*F1S1toF1V1-D*) + + +SortF1S1toF1V1[L_]:=Block[{helpList,ordering,kinFlip}, + helpList=L[[;;,2]]; + ordering={1,2,3,4}; + kinFlip=0; + If[helpList[[1]]=="V"||helpList[[2]]=="V",ordering={3,4,1,2};]; + If[helpList[[ordering[[1]]]]=="S", + ordering[[{1,2}]]=ordering[[{2,1}]]; + kinFlip+=1; + ]; + If[helpList[[ordering[[3]]]]=="V", + ordering[[{3,4}]]=ordering[[{4,3}]]; + kinFlip+=1; + ]; + + Return[{L[[ordering]],kinFlip}] +] + + +CreateMatrixElementF1S1toF1V1[particle1_,particle2_,particle3_,particle4_,fermionMass_]:= +Block[{ + s,t,u,gTensor,gTensorC,gTensorVFC,gTensorVF,gTensorVS,SortHelp, + fermionPropS,particleNull,gTensorF,YTensor,CS,resTot, + YTensor2,gTensorF2,fermionPropU,CU,kinFlip,t2,u2 +}, +(* + This module returns the squared matrix element of FS->FV summed over all quantum numbers of the incoming particles. + If the incoming particles are not of the form FSFVFF the routine returns 0. +*) +If[ ( + (particle1[[2]]=="F"&&particle2[[2]]=="S")|| + (particle1[[2]]=="S"&&particle2[[2]]=="F") + )&&( + (particle3[[2]]=="F"&&particle4[[2]]=="V")|| + (particle3[[2]]=="V"&&particle4[[2]]=="F"))||( + (particle1[[2]]=="F"&&particle2[[2]]=="V")|| + (particle1[[2]]=="V"&&particle2[[2]]=="F") + )&&( + (particle3[[2]]=="F"&&particle4[[2]]=="S")|| + (particle3[[2]]=="S"&&particle4[[2]]=="F")), + +(*Changing the order of the particles so that it is always FS->FV*) + {SortHelp,kinFlip}=Join[{particle1},{particle2},{particle3},{particle4}]//SortF1S1toF1V1[#]&; + p1=SortHelp[[1]][[1]]; + p2=SortHelp[[2]][[1]]; + p3=SortHelp[[3]][[1]]; + p4=SortHelp[[4]][[1]]; + +(*Coupling constants that we will need*) + particleNull={}; (*Just a trick to not confuse the ordering of particles. Although it should be mentioned that I am still confused..*) +(*Coupling constants that we will need*) + YTensor=Ysff[[p2,p1,;;]]; + YTensor2=Ysff[[p2,p3,;;]]; + + gTensorF=gvff[[p4,p3,;;]]; + gTensorF2=gvff[[p4,p1,;;]]; + +(*Fermion propagators*) + fermionPropS=Table[1/(s-i),{i,fermionMass}]//ListToMat; + fermionPropU=Table[1/(u-i),{i,fermionMass}]//ListToMat; + +(*Group structures*) + CS=Contract[YTensor . fermionPropS ,gTensorF,{{3,6}}]//OrderArray[#,2,1,4,3]&; + CU=Contract[YTensor2 . fermionPropU ,gTensorF2,{{3,6}}]//OrderArray[#,4,1,2,3]&; + +(*Collecting the final result*) + resTot=+2*s*u* TotalConj[CS*Conjugate[CS]]; (*Squared s-channel*) + resTot+=+2*s*u* TotalConj[CU*Conjugate[CU]]; (*Squared u-channel*) + resTot+=-2*s*u* TotalConj[CS*Conjugate[CU]+CU*Conjugate[CS]]; (*Mixed s & u channel*) + + If[Mod[kinFlip,2]==1,resTot=resTot/.{t->t2,u->u2}/.{t2->u,u2->t};]; + + Return[-2*Refine[resTot,Assumptions->VarAsum]] +, + Return[0] +] +]; + + +(* ::Subsubsection::Closed:: *) +(*F1F1toS1V1-D*) + + +CreateMatrixElementF1F2toS1V1[particle1_,particle2_,particle3_,particle4_,fermionMass_]:= +Block[{s,t,u,s1,t1,u1,resTot}, +(* + This module returns the squared matrix element of FF->SV summed over all quantum numbers of the incoming particles. + If the incoming particles are not of the form FF->SV the routine returns 0. +*) +If[ + (particle3[[2]]=="F"&&particle4[[2]]=="F")&&((particle1[[2]]=="S"&&particle2[[2]]=="V")||(particle1[[2]]=="V"&&particle2[[2]]=="S")) + || + (particle1[[2]]=="F"&&particle2[[2]]=="F")&&((particle3[[2]]=="S"&&particle4[[2]]=="V")||(particle3[[2]]=="V"&&particle4[[2]]=="S")) + , + + (*The result for FF->SV is the same as FS->VS if we do some renaming of the mandelstam variables*) + resTot=-CreateMatrixElementF1S1toF1V1[particle1,particle3,particle2,particle4,fermionMass]/.{s->s1,t->t1,u->u1}; (*Minus sign as we reversed the momentum of a fermion*) + resTot=resTot/.{t1->s,s1->t,u1->u}//Refine; + Return[resTot] +, + Return[0] +] +]; + + +(* ::Subsubsection::Closed:: *) +(*S1S2toV1V2-D*) + + +CreateMatrixElementS1S2toV1V2[particle1_,particle2_,particle3_,particle4_,vectorMass_,scalarMass_]:= +Block[{s,t,u, + p1,p2,p3,p4,temp, + particleNull,gTensorS,gTensorV, + vectorPropS,gTensorS2, + ASS,A,ASU,AST,CT,CU,CTU,CV,totRes, + ATU,scalarPropT,scalarPropU}, +(* + This module returns the squared matrix element of SS->VV summed over all quantum numbers of the incoming particles. + If the incoming particles are not of the form SS->VV the routine returns 0. +*) +If[ + (particle1[[2]]!="S"||particle2[[2]]!="S"||particle3[[2]]!="V"||particle4[[2]]!="V")&& + (particle1[[2]]!="V"||particle2[[2]]!="V"||particle3[[2]]!="S"||particle4[[2]]!="S"), + Return[0]; +, + p1=particle1[[1]]; + p2=particle2[[1]]; + p3=particle3[[1]]; + p4=particle4[[1]]; +If[ + particle1[[2]]=="V"&& + particle2[[2]]=="V"&& + particle3[[2]]=="S"&& + particle4[[2]]=="S", +(*Just changing the order of the particles so that it is always SS->VV*) + temp=p1; + p1=p3; + p3=temp; + + temp=p2; + p2=p4; + p4=temp; + ]; + + particleNull={}; (*Just a trick to make the ordering of particles simpler for the benefit of my brain*) + +(*Coupling constants that we will need; and some some that we will not.*) + gTensorS=Table[gvss[[;;,Particle1,Particle2]], + {Particle1,{p1,p2,particleNull,particleNull}}, + {Particle2,{p1,p2,particleNull,particleNull}}]; + + gTensorS2=Table[gvss[[Particle2,Particle1,;;]], + {Particle1,{p1,p2,particleNull,particleNull}}, + {Particle2,{particleNull,particleNull,p3,p4}}]; + + gTensorV=Table[gvvv[[Particle1,Particle2,;;]], + {Particle1,{particleNull,particleNull,p3,p4}}, + {Particle2,{particleNull,particleNull,p3,p4}}]; + +(*Vector propagators*) + vectorPropS=Table[1/(s-i),{i,vectorMass}]//ListToMat; + +(*Scalar propagators*) + scalarPropT=Table[1/(t-i),{i,scalarMass}]//ListToMat; + scalarPropU=Table[1/(u-i),{i,scalarMass}]//ListToMat; + + +(*Group invariants from vector diagrams*) + CT=-Contract[gTensorS2[[1,3]] . scalarPropT,gTensorS2[[2,4]],{{3,6}}]//OrderArray[#,2,4,1,3]&; + CU=-Contract[gTensorS2[[1,4]] . scalarPropU,gTensorS2[[2,3]],{{3,6}}]//OrderArray[#,2,4,3,1]&; + CV=gTensorV[[3,4]] . vectorPropS . gTensorS[[1,2]]//OrderArray[#,3,4,1,2]&; + +(*Lorentz structures that appear*) + ASS=-1/2(t^2+30 t u+u^2); + A=4 s; + ASU=4 s( t+2 u); + AST=-4 s (u+2 *t); + ATU=8 s^2; + + +(*The full result, just don't think about it.*) + totRes=ASS Total[CV^2,-1]; + totRes+= ASU Total[ CV CU,-1]; + totRes+= AST Total[ CV CT,-1]; + totRes+=ATU Total[CT CU,-1]; + totRes+= A Total[(t*CT+u*CU) CU,-1]; + totRes+= A Total[(t*CT+u*CU) CT,-1]; + totRes+=4 Total[(t*CT+u*CU)^2,-1]; + + Return[Refine[totRes/2,Assumptions->VarAsum]] +] +]; + + +(* ::Subsubsection::Closed:: *) +(*S1V1toS1V1-D*) + + +CreateMatrixElementS1V1toS1V1[particle1_,particle2_,particle3_,particle4_,vectorMass_,scalarMass_]:= +Block[{s,t,u,p1,p2,p3,p4,temp,resTot,u1,s1,t1,kinFlip}, +(* + This module returns the squared matrix element of SV->SV summed over all quantum numbers of the incoming particles. + If the incoming particles are not of the form SV->SV the routine returns 0. +*) + kinFlip=0; (*records if the external or incoming legs were swapped, and does a t<->u transformation for each swap*) +If[ ( + (particle1[[2]]=="V"&&particle2[[2]]=="S")|| + (particle1[[2]]=="S"&&particle2[[2]]=="V") + )&&( + (particle3[[2]]=="V"&&particle4[[2]]=="S")|| + (particle3[[2]]=="S"&&particle4[[2]]=="V")), + + p1=particle1; + p2=particle2; + p3=particle3; + p4=particle4; +(*Changing the order of the particles so that it is always SV->SV*) + If[particle1[[2]]=="S"&&particle2[[2]]=="V", + temp=p1; + p1=p2; + p2=temp; + kinFlip+=1; + ]; + If[particle3[[2]]=="S"&&particle4[[2]]=="V", + temp=p3; + p3=p4; + p4=temp; + kinFlip+=1; + ]; + + (*The result for SV->SV is identical to SS->VV (some would say twice as identical) if we do some renaming of the mandelstam variables*) + resTot=CreateMatrixElementS1S2toV1V2[p1,p3,p2,p4,vectorMass,scalarMass]/.{s->s1,t->t1,u->u1}; + resTot=resTot/.{s1->t,t1->s,u1->u}; + + If[Mod[kinFlip,2]==1,resTot=resTot/.{t->t1,u->u1}/.{t1->u,u1->t};]; + Return[resTot] +, + Return[0] +] +]; + + +(* ::Subsubsection::Closed:: *) +(*S1S2toS3V1-D*) + + +CreateMatrixElementS1S2toS3V1[particle1_,particle2_,particle3_,particle4_,scalarMass_]:= +Block[{s,t,u,p1,p2,p3,p4,temp,resTot,u1,s1,t1,temp1,temp2 + ,particleNull,gTensor,\[Lambda]3Tensor,\[Lambda]4Tensor, + scalarPropT,scalarPropU,A,CT,CU,CS,kinFlip,scalarPropS}, +(* + This module returns the squared matrix element of SS->SV summed over all quantum numbers of the incoming particles. + If the incoming particles are not of the form SS->SV the routine returns 0. + + I maintain that only a lunatic will actually have this matrix element appearing in their model, and if you are actually + reading this you have but proved my point. +*) + kinFlip=0; (*records if the external or incoming legs were swapped, and does a t<->u transformation for each swap*) +If[ ( + (particle1[[2]]=="V"&&particle2[[2]]=="S")|| + (particle1[[2]]=="S"&&particle2[[2]]=="V") + )&&( + (particle3[[2]]=="S"&&particle4[[2]]=="S"))|| + ( + (particle3[[2]]=="V"&&particle4[[2]]=="S")|| + (particle3[[2]]=="S"&&particle4[[2]]=="V") + )&&( + (particle1[[2]]=="S"&&particle2[[2]]=="S")), + + p1=particle1; + p2=particle2; + p3=particle3; + p4=particle4; +(*Changing the order of the particles so that it is always SS->SV*) + If[particle1[[2]]=="V"||particle2[[2]]=="V", + temp1=p1; + temp2=p2; + p1=p3; + p2=p4; + p3=temp1; + p4=temp2; + ]; + If[p3[[2]]=="V", + temp=p3; + p3=p4; + p4=temp; + kinFlip+=1; + ]; + + + + particleNull={{}}; (*Just a trick to not confuse the ordering of particles*) +(*Coupling constants that we will need*) + + gTensor=Table[gvss[[p4[[1]],Particle1[[1]],;;]], + {Particle1,{p1,p2,p3,particleNull}}]; + + \[Lambda]3Tensor=Table[\[Lambda]3[[;;,Particle1[[1]],Particle2[[1]]]], + {Particle1,{p1,p2,p3}}, + {Particle2,{p1,p2,p3}}]; + +(*Scalar propagators*) + scalarPropT=Table[1/(t-i),{i,scalarMass}]//ListToMat; + scalarPropU=Table[1/(u-i),{i,scalarMass}]//ListToMat; + scalarPropS=Table[1/(s-i),{i,scalarMass}]//ListToMat; + +(*Lorentz structures that appear.*) + A=4 t u /s; + +(*Group structures that are used*) + CS=Contract[scalarPropS . \[Lambda]3Tensor[[1,2]], gTensor[[3]],{{1,6}}]//OrderArray[#,1,2,4,3]&; + CT=Contract[scalarPropT . \[Lambda]3Tensor[[1,3]], gTensor[[2]],{{1,6}}]//OrderArray[#,1,4,2,3]&; + CU=Contract[scalarPropU . \[Lambda]3Tensor[[2,3]], gTensor[[1]],{{1,6}}]//OrderArray[#,4,1,2,3]&; + +(*This result is beautiful in much the same way that a carrot isn't. *) + resTot=-4*Total[CS (u*CT+t*CU),-1]; + resTot+=-4 s*Total[CT CU,-1]; + + If[Mod[kinFlip,2]==1,resTot=resTot/.{t->t1,u->u1}/.{t1->u,u1->t};]; + Return[resTot] +, + Return[0] +] +]; + + +(* ::Section:: *) +(*Getting the matrix elements for out-of-Equilibrium particles*) + + +degreeOfFreedom[particle_]:=Block[{dof}, + + dof=Length[particle[[1]]]; + + (*factor of 2 from anti-particles*) + If[particle[[2]]=="F",dof*=2]; + + (*Factor of 2 from spins*) + If[particle[[2]]=="V",dof*=2]; + + If[particle[[2]]=="S",dof]; + + If[bNormalizeWithDOF==False,dof=1]; + + Return[dof]; +] + + +(* ::Subsubsection:: *) +(*F1F2toF3F4*) + + +ExtractOutOfEqElement["F1F2toF3F4"][particleList_,LightParticles_,ParticleMasses_]:= +Block[{ + OutOfEqParticles,MatrixElements,Elements,CollElements, + symmetries,deltaF, + VectorMass,FermionMass,ScalarMass +}, +(*incomingParticle is the particle associated with the momentum p_1*) +(*deltaFparticle is the particles whos deltaF contributions we want*) +(* + Essentially this is generates the elements going into + Sum_deltaFparticle \[Delta]C[incomingParticle,deltaFparticle]*deltaF[deltaFparticle] +*) + + VectorMass=ParticleMasses[[1]]; + FermionMass=ParticleMasses[[2]]; + ScalarMass=ParticleMasses[[3]]; + +(*Generate all matrix elements*) + OutOfEqParticles=Complement[Table[i,{i,1,Length[particleList]}],LightParticles]; + + +(*Divide the incoming particle by its degree's of freedom*) + MatrixElements=Table[ + 1/degreeOfFreedom[particleList[[a]]] + CreateMatrixElementF1F2toF3F4[particleList[[a]],b,c,d,VectorMass,ScalarMass], + {a,OutOfEqParticles},{b,particleList},{c,particleList},{d,particleList}]//SparseArray; + +(*This is a list of all non-zero matrix elements*) + Elements=MatrixElements["NonzeroPositions"]; +(*If there are no matching matrix elements we return 0*) +If[Length[Elements]==0, + Return[{}]; +, + + MatrixElements=Table[Extract[MatrixElements,Elements[[i]]],{i,1,Length[Elements]}]; +(*We now select all elements where deltaFparticle is amongst the scattered particles*) +(*deltaF is here a list of 1 and 0s*) +(*Gives all light-particle the label specified by the first lightparticle*) + If[LightParticles!={}, + deltaF=Elements/. x_?NumericQ /;MemberQ[ LightParticles,x ] -> LightParticles[[1]]; + , + deltaF=Elements; + ]; + +(*Now we create the full list of distinct collision elements*) + CollElements=Table[{MatrixElements[[i]],deltaF[[i]]},{i,1,Length[Elements]}]; + +(*We now add all elements with the same deltaF list*) + symmetries=Gather[CollElements,#1[[2]]==#2[[2]]&]; + CollElements=Table[{symmetries[[i]][[;;,1]]//Total[#,-1]&,symmetries[[i]][[1,2]]},{i,1,Length[symmetries]}]; + + Return[CollElements] +] +]; + + +(* ::Subsubsection:: *) +(*F1V1toF1V1*) + + +ExtractOutOfEqElement["F1V1toF1V1"][particleList_,LightParticles_,ParticleMasses_]:= +Block[{OutOfEqParticles,MatrixElements,Elements,CollElements,VectorMass,FermionMass,ScalarMass}, +(*incomingParticle is the particle associated with the momentum p_1*) +(*deltaFparticle is the particles whos deltaF contributions we want*) +(* + Essentially this is generates the elements going into + Sum_deltaFparticle \[Delta]C[incomingParticle,deltaFparticle]*deltaF[deltaFparticle] +*) + +(*particleList is the complete list of particles*) + + VectorMass=ParticleMasses[[1]]; + FermionMass=ParticleMasses[[2]]; + ScalarMass=ParticleMasses[[3]]; +(*First we generate all matrix elements*) + OutOfEqParticles=Complement[Table[i,{i,1,Length[particleList]}],LightParticles]; + +(*Divide the incoming particle by its degree's of freedom*) + MatrixElements=Table[ + 1/degreeOfFreedom[particleList[[a]]] + CreateMatrixElementF1V1toF1V1[particleList[[a]],b,c,d,VectorMass,FermionMass], + {a,OutOfEqParticles},{b,particleList},{c,particleList},{d,particleList}]//SparseArray; + (*This is a list of all non-zero matrix elements*) + Elements=MatrixElements["NonzeroPositions"]; + +(*If there are no matching matrix elements we return 0*) +If[Length[Elements]==0, + Return[{}]; +, + MatrixElements=Table[Extract[MatrixElements,Elements[[i]]],{i,1,Length[Elements]}]; + +(*We now select all elements where deltaFparticle is amongst the scattered particles*) +(*deltaF is here a list of 1 and 0s*) +(*Gives all light-particle the label specified by the first lightparticle*) + If[LightParticles!={}, + deltaF=Elements/. x_?NumericQ /;MemberQ[ LightParticles,x ] -> LightParticles[[1]]; + , + deltaF=Elements; + ]; +(*Now we create the full list of distinct collision elements*) + CollElements=Table[{MatrixElements[[i]],deltaF[[i]]},{i,1,Length[Elements]}]; + +(*We now add all elements with the same deltaF list*) + symmetries=Gather[CollElements,#1[[2]]==#2[[2]]&]; + CollElements=Table[{symmetries[[i]][[;;,1]]//Total[#,-1]&,symmetries[[i]][[1,2]]},{i,1,Length[symmetries]}]; + + Return[CollElements] + +] +]; + + +(* ::Subsubsection:: *) +(*F1F2toV1V2*) + + +ExtractOutOfEqElement["F1F2toV1V2"][particleList_,LightParticles_,ParticleMasses_]:= +Block[{OutOfEqParticles,MatrixElements,Elements,CollElements,VectorMass,FermionMass,ScalarMass}, +(*incomingParticle is the particle associated with the momentum p_1*) +(*deltaFparticle is the particles whos deltaF contributions we want*) +(* + Essentially this is generates the elements going into + Sum_deltaFparticle \[Delta]C[incomingParticle,deltaFparticle]*deltaF[deltaFparticle] +*) + +(*particleList is the complete list of particles*) + VectorMass=ParticleMasses[[1]]; + FermionMass=ParticleMasses[[2]]; + ScalarMass=ParticleMasses[[3]]; +(*First we generate all matrix elements*) + OutOfEqParticles=Complement[Table[i,{i,1,Length[particleList]}],LightParticles]; + +(*Divide the incoming particle by its degree's of freedom*) + MatrixElements=Table[ + 1/degreeOfFreedom[particleList[[a]]] + CreateMatrixElementF1F2toV1V2[particleList[[a]],b,c,d,FermionMass,VectorMass], + {a,OutOfEqParticles},{b,particleList},{c,particleList},{d,particleList}]//SparseArray; + (*This is a list of all non-zero matrix elements*) + Elements=MatrixElements["NonzeroPositions"]; + +(*If there are no matching matrix elements we return 0*) +If[Length[Elements]==0, + Return[{}]; +, + + MatrixElements=Table[Extract[MatrixElements,Elements[[i]]],{i,1,Length[Elements]}]; + +(*We now select all elements where deltaFparticle is amongst the scattered particles*) +(*deltaF is here a list of 1 and 0s*) +(*Gives all light-particle the label specified by the first lightparticle*) + If[LightParticles!={}, + deltaF=Elements/. x_?NumericQ /;MemberQ[ LightParticles,x ] -> LightParticles[[1]]; + , + deltaF=Elements; + ]; + +(*Now we create the full list of distinct collision elements*) + CollElements=Table[{MatrixElements[[i]],deltaF[[i]]},{i,1,Length[Elements]}]; + +(*We now add all elements with the same deltaF list*) + symmetries=Gather[CollElements,#1[[2]]==#2[[2]]&]; + CollElements=Table[{symmetries[[i]][[;;,1]]//Total[#,-1]&,symmetries[[i]][[1,2]]},{i,1,Length[symmetries]}]; + + Return[CollElements] +] +]; + + +(* ::Subsubsection::Closed:: *) +(*V1V2toV3V4*) + + +ExtractOutOfEqElement["V1V2toV3V4"][particleList_,LightParticles_,ParticleMasses_]:= +Block[{OutOfEqParticles,MatrixElements,Elements,CollElements,VectorMass,FermionMass,ScalarMass}, +(*incomingParticle is the particle associated with the momentum p_1*) +(*deltaFparticle is the particles whos deltaF contributions we want*) +(* + Essentially this is generates the elements going into Sum_deltaFparticle + \[Delta]C[incomingParticle,deltaFparticle]*deltaF[deltaFparticle] +*) + +(*particleList is the complete list of particles*) + VectorMass=ParticleMasses[[1]]; + FermionMass=ParticleMasses[[2]]; + ScalarMass=ParticleMasses[[3]]; +(*Generate all matrix elements*) + OutOfEqParticles=Complement[Table[i,{i,1,Length[particleList]}],LightParticles]; + +(*Divide the incoming particle by its degree's of freedom*) + MatrixElements=Table[ + 1/degreeOfFreedom[particleList[[a]]] + CreateMatrixElementV1V2toV3V4[particleList[[a]],b,c,d,VectorMass], + {a,OutOfEqParticles},{b,particleList},{c,particleList},{d,particleList}]//SparseArray; + (*This is a list of all non-zero matrix elements*) + Elements=MatrixElements["NonzeroPositions"]; + +(*If there are no matching matrix elements we return 0*) +If[Length[Elements]==0, + Return[{}]; +, + + MatrixElements=Table[Extract[MatrixElements,Elements[[i]]],{i,1,Length[Elements]}]; +(*We now select all elements where deltaFparticle is amongst the scattered particles*) +(*deltaF is here a list of 1 and 0s*) +(*Gives all light-particle the label specified by the first lightparticle*) + If[LightParticles!={}, + deltaF=Elements/. x_?NumericQ /;MemberQ[ LightParticles,x ] -> LightParticles[[1]]; + , + deltaF=Elements; + ]; + +(*Now we create the full list of distinct collision elements*) + CollElements=Table[{MatrixElements[[i]],deltaF[[i]]},{i,1,Length[Elements]}]; + +(*We now add all elements with the same deltaF list*) + symmetries=Gather[CollElements,#1[[2]]==#2[[2]]&]; + CollElements=Table[{symmetries[[i]][[;;,1]]//Total[#,-1]&,symmetries[[i]][[1,2]]},{i,1,Length[symmetries]}]; + + Return[CollElements] +] +]; + + +(* ::Subsubsection::Closed:: *) +(*S1S2toS3S4*) + + +ExtractOutOfEqElement["S1S2toS3S4"][particleList_,LightParticles_,ParticleMasses_]:= +Block[{OutOfEqParticles,MatrixElements,Elements,CollElements,VectorMass,FermionMass,ScalarMass}, +(*incomingParticle is the particle associated with the momentum p_1*) +(*deltaFparticle is the particles whos deltaF contributions we want*) +(* + Essentially this is generates the elements going into Sum_deltaFparticle + \[Delta]C[incomingParticle,deltaFparticle]*deltaF[deltaFparticle] +*) + +(*particleList is the complete list of particles*) + VectorMass=ParticleMasses[[1]]; + FermionMass=ParticleMasses[[2]]; + ScalarMass=ParticleMasses[[3]]; +(*Generate all matrix elements*) + OutOfEqParticles=Complement[Table[i,{i,1,Length[particleList]}],LightParticles]; + +(*Divide the incoming particle by its degree's of freedom*) + MatrixElements=Table[ + 1/degreeOfFreedom[particleList[[a]]] + CreateMatrixElementS1S2toS3S4[particleList[[a]],b,c,d,VectorMass,ScalarMass], + {a,OutOfEqParticles},{b,particleList},{c,particleList},{d,particleList}]//SparseArray; + (*This is a list of all non-zero matrix elements*) + Elements=MatrixElements["NonzeroPositions"]; +(*If there are no matching matrix elements we return 0*) +If[Length[Elements]==0, + Return[{}]; +, + + MatrixElements=Table[Extract[MatrixElements,Elements[[i]]],{i,1,Length[Elements]}]; + +(*We now select all elements where deltaFparticle is amongst the scattered particles*) +(*deltaF is here a list of 1 and 0s*) +(*Gives all light-particle the label specified by the first lightparticle*) + If[LightParticles!={}, + deltaF=Elements/. x_?NumericQ /;MemberQ[ LightParticles,x ] -> LightParticles[[1]]; + , + deltaF=Elements; + ]; + +(*Now we create the full list of distinct collision elements*) + CollElements=Table[{MatrixElements[[i]],deltaF[[i]]},{i,1,Length[Elements]}]; + +(*We now add all elements with the same deltaF list*) + symmetries=Gather[CollElements,#1[[2]]==#2[[2]]&]; + CollElements=Table[{symmetries[[i]][[;;,1]]//Total[#,-1]&,symmetries[[i]][[1,2]]},{i,1,Length[symmetries]}]; + + Return[CollElements] +] +]; + + +(* ::Subsubsection::Closed:: *) +(*S1S2toF1F2*) + + +ExtractOutOfEqElement["S1S2toF1F2"][particleList_,LightParticles_,ParticleMasses_]:= +Block[{OutOfEqParticles,MatrixElements,Elements,CollElements,VectorMass,FermionMass,ScalarMass}, +(*incomingParticle is the particle associated with the momentum p_1*) +(*deltaFparticle is the particles whos deltaF contributions we want*) +(* + Essentially this is generates the elements going into + Sum_deltaFparticle \[Delta]C[incomingParticle,deltaFparticle]*deltaF[deltaFparticle] +*) + +(*particleList is the complete list of particles*) + VectorMass=ParticleMasses[[1]]; + FermionMass=ParticleMasses[[2]]; + ScalarMass=ParticleMasses[[3]]; +(*First we generate all matrix elements*) + OutOfEqParticles=Complement[Table[i,{i,1,Length[particleList]}],LightParticles]; + +(*Divide the incoming particle by its degree's of freedom*) + MatrixElements=Table[ + 1/degreeOfFreedom[particleList[[a]]] + CreateMatrixElementS1S2toF1F2[particleList[[a]],b,c,d,VectorMass,ScalarMass,FermionMass], {a,OutOfEqParticles},{b,particleList},{c,particleList},{d,particleList}]//SparseArray; (*This is a list of all non-zero matrix elements*) Elements=MatrixElements["NonzeroPositions"]; - (*If there are no matching matrix elements we return 0*) If[Length[Elements]==0, Return[{}]; , -(*Now we add identical contributions*) -(*The Q1Q2->Q1Q2 process is the same as the Q1Q2->Q2Q1 process*) - symmetries=Gather[Elements,(#1[[1;;2]]==#2[[1;;2]])&]; - symmetries=Gather[#,#1[[3;;4]]==Sort[#2[[3;;4]]]&]&/@symmetries//Flatten[#,1]&; + MatrixElements=Table[Extract[MatrixElements,Elements[[i]]],{i,1,Length[Elements]}]; +(*We now select all elements where deltaFparticle is amongst the scattered particles*) +(*deltaF is here a list of 1 and 0s*) +(*Gives all light-particle the label specified by the first lightparticle*) + If[LightParticles!={}, + deltaF=Elements/. x_?NumericQ /;MemberQ[ LightParticles,x ] -> LightParticles[[1]]; + , + deltaF=Elements; + ]; + +(*Now we create the full list of distinct collision elements*) + CollElements=Table[{MatrixElements[[i]],deltaF[[i]]},{i,1,Length[Elements]}]; + +(*We now add all elements with the same deltaF list*) + symmetries=Gather[CollElements,#1[[2]]==#2[[2]]&]; + CollElements=Table[{symmetries[[i]][[;;,1]]//Total[#,-1]&,symmetries[[i]][[1,2]]},{i,1,Length[symmetries]}]; + + Return[CollElements] +] +]; + + +(* ::Subsubsection::Closed:: *) +(*F1S1toF1S1*) + + +ExtractOutOfEqElement["F1S1toF1S1"][particleList_,LightParticles_,ParticleMasses_]:= +Block[{OutOfEqParticles,MatrixElements,Elements,CollElements,VectorMass,FermionMass,ScalarMass}, +(*incomingParticle is the particle associated with the momentum p_1*) +(*deltaFparticle is the particles whos deltaF contributions we want*) +(* + Essentially this is generates the elements going into + Sum_deltaFparticle \[Delta]C[incomingParticle,deltaFparticle]*deltaF[deltaFparticle] +*) + +(*particleList is the complete list of particles*) + VectorMass=ParticleMasses[[1]]; + FermionMass=ParticleMasses[[2]]; + ScalarMass=ParticleMasses[[3]]; + +(*First we generate all matrix elements*) + OutOfEqParticles=Complement[Table[i,{i,1,Length[particleList]}],LightParticles]; + +(*Divide the incoming particle by its degree's of freedom*) + MatrixElements=Table[ + 1/degreeOfFreedom[particleList[[a]]] + CreateMatrixElementF1S1toF1S1[particleList[[a]],b,c,d,VectorMass,ScalarMass,FermionMass], + {a,OutOfEqParticles},{b,particleList},{c,particleList},{d,particleList}]//SparseArray; + (*This is a list of all non-zero matrix elements*) + Elements=MatrixElements["NonzeroPositions"]; - MultiPlicity=Table[Length[a],{a,symmetries}]; - Elements=Table[i[[1]],{i,symmetries}]; - (*MatrixElements is now just a list*) - MatrixElements=Table[MultiPlicity[[i]] Extract[MatrixElements,Elements[[i]]],{i,1,Length[Elements]}]; - MatrixElements=MatrixElements/2;(*Factor of 2 from over-counting ab->cd +ab->dc, or if c=d the 1/2 is a symmetry factor*) +(*If there are no matching matrix elements we return 0*) +If[Length[Elements]==0, + Return[{}]; +, + MatrixElements=Table[Extract[MatrixElements,Elements[[i]]],{i,1,Length[Elements]}]; (*We now select all elements where deltaFparticle is amongst the scattered particles*) (*deltaF is here a list of 1 and 0s*) (*Gives all light-particle the label specified by the first lightparticle*) - deltaF=Elements/. x_?NumericQ /;MemberQ[ LightParticles,x ] -> LightParticles[[1]]; + If[LightParticles!={}, + deltaF=Elements/. x_?NumericQ /;MemberQ[ LightParticles,x ] -> LightParticles[[1]]; + , + deltaF=Elements; + ]; (*Now we create the full list of distinct collision elements*) CollElements=Table[{MatrixElements[[i]],deltaF[[i]]},{i,1,Length[Elements]}]; @@ -663,11 +1633,11 @@ (* ::Subsubsection::Closed:: *) -(*Q1Q2toV1V2*) +(*F1S1toF1V1*) -ExtractOutOfEqElementQ1Q2toV1V2[particleList_,LightParticles_]:= -Block[{OutOfEqParticles,MatrixElements,Elements,CollElements}, +ExtractOutOfEqElement["F1S1toF1V1"][particleList_,LightParticles_,ParticleMasses_]:= +Block[{OutOfEqParticles,MatrixElements,Elements,CollElements,VectorMass,FermionMass,ScalarMass}, (*incomingParticle is the particle associated with the momentum p_1*) (*deltaFparticle is the particles whos deltaF contributions we want*) (* @@ -676,40 +1646,37 @@ *) (*particleList is the complete list of particles*) - + VectorMass=ParticleMasses[[1]]; + FermionMass=ParticleMasses[[2]]; + ScalarMass=ParticleMasses[[3]]; + (*First we generate all matrix elements*) OutOfEqParticles=Complement[Table[i,{i,1,Length[particleList]}],LightParticles]; (*Divide the incoming particle by its degree's of freedom*) MatrixElements=Table[ 1/degreeOfFreedom[particleList[[a]]] - CreateMatrixElementQ1Q2toV1V2[particleList[[a]],b,c,d,FermionMass], + CreateMatrixElementF1S1toF1V1[particleList[[a]],b,c,d,FermionMass], {a,OutOfEqParticles},{b,particleList},{c,particleList},{d,particleList}]//SparseArray; (*This is a list of all non-zero matrix elements*) Elements=MatrixElements["NonzeroPositions"]; + (*If there are no matching matrix elements we return 0*) If[Length[Elements]==0, Return[{}]; , -(*Now we add identical contributions*) -(*The Q1Q2->Q1Q2 process is the same as the Q1Q2->Q2Q1 process*) - symmetries=Gather[Elements,(#1[[1;;2]]==#2[[1;;2]])&]; - symmetries=Gather[#,#1[[3;;4]]==Sort[#2[[3;;4]]]&]&/@symmetries//Flatten[#,1]&; - MultiPlicity=Table[Length[a],{a,symmetries}]; - Elements=Table[i[[1]],{i,symmetries}]; - (*MatrixElements is now just a list*) - MatrixElements=Table[MultiPlicity[[i]] Extract[MatrixElements,Elements[[i]]],{i,1,Length[Elements]}]; - -(*We also divide by the number of degrees of freedom of incomingParticle*) -(*Factor of 2 from over-counting ab->cd +ab->dc, or if c=d the 1/2 is a symmetry factor*) - MatrixElements=MatrixElements/2; + MatrixElements=Table[ Extract[MatrixElements,Elements[[i]]],{i,1,Length[Elements]}]; (*We now select all elements where deltaFparticle is amongst the scattered particles*) (*deltaF is here a list of 1 and 0s*) (*Gives all light-particle the label specified by the first lightparticle*) - deltaF=Elements/. x_?NumericQ /;MemberQ[ LightParticles,x ] -> LightParticles[[1]]; + If[LightParticles!={}, + deltaF=Elements/. x_?NumericQ /;MemberQ[ LightParticles,x ] -> LightParticles[[1]]; + , + deltaF=Elements; + ]; (*Now we create the full list of distinct collision elements*) CollElements=Table[{MatrixElements[[i]],deltaF[[i]]},{i,1,Length[Elements]}]; @@ -718,59 +1685,57 @@ symmetries=Gather[CollElements,#1[[2]]==#2[[2]]&]; CollElements=Table[{symmetries[[i]][[;;,1]]//Total[#,-1]&,symmetries[[i]][[1,2]]},{i,1,Length[symmetries]}]; - Return[CollElements] + Return[CollElements] + ] ]; (* ::Subsubsection::Closed:: *) -(*V1V2toV3V4*) +(*F1F2toS1V1*) -ExtractOutOfEqElementV1V2toV3V4[particleList_,LightParticles_]:= -Block[{OutOfEqParticles,MatrixElements,Elements,CollElements}, +ExtractOutOfEqElement["F1F2toS1V1"][particleList_,LightParticles_,ParticleMasses_]:= +Block[{OutOfEqParticles,MatrixElements,Elements,CollElements,VectorMass,FermionMass,ScalarMass}, (*incomingParticle is the particle associated with the momentum p_1*) (*deltaFparticle is the particles whos deltaF contributions we want*) (* - Essentially this is generates the elements going into Sum_deltaFparticle - \[Delta]C[incomingParticle,deltaFparticle]*deltaF[deltaFparticle] + Essentially this is generates the elements going into + Sum_deltaFparticle \[Delta]C[incomingParticle,deltaFparticle]*deltaF[deltaFparticle] *) (*particleList is the complete list of particles*) - -(*Generate all matrix elements*) - OutOfEqParticles=Complement[Table[i,{i,1,Length[particleList]}],LightParticles]; + VectorMass=ParticleMasses[[1]]; + FermionMass=ParticleMasses[[2]]; + ScalarMass=ParticleMasses[[3]]; +(*First we generate all matrix elements*) + OutOfEqParticles=Complement[Table[i,{i,1,Length[particleList]}],LightParticles]; + (*Divide the incoming particle by its degree's of freedom*) MatrixElements=Table[ 1/degreeOfFreedom[particleList[[a]]] - CreateMatrixElementV1V2toV3V4[particleList[[a]],b,c,d,VectorMass], + CreateMatrixElementF1F2toS1V1[particleList[[a]],b,c,d,FermionMass], {a,OutOfEqParticles},{b,particleList},{c,particleList},{d,particleList}]//SparseArray; (*This is a list of all non-zero matrix elements*) Elements=MatrixElements["NonzeroPositions"]; + (*If there are no matching matrix elements we return 0*) If[Length[Elements]==0, Return[{}]; , -(*Now we add identical contributions*) -(*The Q1Q2->Q1Q2 process is the same as the Q1Q2->Q2Q1 process*) - symmetries=Gather[Elements,(#1[[1;;2]]==#2[[1;;2]])&]; - symmetries=Gather[#,#1[[3;;4]]==Sort[#2[[3;;4]]]&]&/@symmetries//Flatten[#,1]&; - MultiPlicity=Table[Length[a],{a,symmetries}]; - Elements=Table[i[[1]],{i,symmetries}]; - (*MatrixElements is now just a list*) - MatrixElements=Table[MultiPlicity[[i]] Extract[MatrixElements,Elements[[i]]],{i,1,Length[Elements]}]; - -(*We also divide by the number of degrees of freedom of incomingParticle*) -(*Factor of 2 from over-counting ab->cd +ab->dc, or if c=d the 1/2 is a symmetry factor*) - MatrixElements=MatrixElements/2; + MatrixElements=Table[ Extract[MatrixElements,Elements[[i]]],{i,1,Length[Elements]}]; (*We now select all elements where deltaFparticle is amongst the scattered particles*) (*deltaF is here a list of 1 and 0s*) (*Gives all light-particle the label specified by the first lightparticle*) - deltaF=Elements/. x_?NumericQ /;MemberQ[ LightParticles,x ] -> LightParticles[[1]]; + If[LightParticles!={}, + deltaF=Elements/. x_?NumericQ /;MemberQ[ LightParticles,x ] -> LightParticles[[1]]; + , + deltaF=Elements; + ]; (*Now we create the full list of distinct collision elements*) CollElements=Table[{MatrixElements[[i]],deltaF[[i]]},{i,1,Length[Elements]}]; @@ -779,131 +1744,313 @@ symmetries=Gather[CollElements,#1[[2]]==#2[[2]]&]; CollElements=Table[{symmetries[[i]][[;;,1]]//Total[#,-1]&,symmetries[[i]][[1,2]]},{i,1,Length[symmetries]}]; - Return[CollElements] + Return[CollElements] + ] ]; (* ::Subsubsection::Closed:: *) -(*Extract elements*) +(*S1S2toV1V2*) -ExtractOutOfEqElement[particleList_,LightParticles_]:= -Block[{CollEllQ1Q2toQ3Q4,CollEllQ1V1toQ1V1,CollEllQ1Q2toV1V2,CollEllV1V2toV3V4,CollEllTotal}, +ExtractOutOfEqElement["S1S2toV1V2"][particleList_,LightParticles_,ParticleMasses_]:= +Block[{OutOfEqParticles,MatrixElements,Elements,CollElements,VectorMass,FermionMass,ScalarMass}, (*incomingParticle is the particle associated with the momentum p_1*) (*deltaFparticle is the particles whos deltaF contributions we want*) -(*Essentially this is generates the elements going into Sum_deltaFparticle \[Delta]C[incomingParticle,deltaFparticle]*deltaF[deltaFparticle]*) +(* + Essentially this is generates the elements going into + Sum_deltaFparticle \[Delta]C[incomingParticle,deltaFparticle]*deltaF[deltaFparticle] +*) (*particleList is the complete list of particles*) + VectorMass=ParticleMasses[[1]]; + FermionMass=ParticleMasses[[2]]; + ScalarMass=ParticleMasses[[3]]; + +(*First we generate all matrix elements*) + OutOfEqParticles=Complement[Table[i,{i,1,Length[particleList]}],LightParticles]; +(*Divide the incoming particle by its degree's of freedom*) + MatrixElements=Table[ + 1/degreeOfFreedom[particleList[[a]]] + CreateMatrixElementS1S2toV1V2[particleList[[a]],b,c,d,VectorMass,ScalarMass], + {a,OutOfEqParticles},{b,particleList},{c,particleList},{d,particleList}]//SparseArray; + (*This is a list of all non-zero matrix elements*) + Elements=MatrixElements["NonzeroPositions"]; -(*First we extract the result for all subprocesses*) -CollEllQ1Q2toQ3Q4=ExtractOutOfEqElementQ1Q2toQ3Q4[particleList,LightParticles]; -CollEllQ1V1toQ1V1=ExtractOutOfEqElementQ1V1toQ1V1[particleList,LightParticles]; -CollEllQ1Q2toV1V2=ExtractOutOfEqElementQ1Q2toV1V2[particleList,LightParticles]; -CollEllV1V2toV3V4=ExtractOutOfEqElementV1V2toV3V4[particleList,LightParticles]; - -CollEllTotal=Join[CollEllQ1Q2toQ3Q4,CollEllQ1V1toQ1V1,CollEllQ1Q2toV1V2,CollEllV1V2toV3V4]; +(*If there are no matching matrix elements we return 0*) +If[Length[Elements]==0, + Return[{}]; +, -(*I have so far not added all the terms with the same deltaF indices, which we should of course do*) -(*This is trivial to do, and I'll do it after we have agreed what format we want*) + MatrixElements=Table[ Extract[MatrixElements,Elements[[i]]],{i,1,Length[Elements]}]; -Return[CollEllTotal] +(*We now select all elements where deltaFparticle is amongst the scattered particles*) +(*deltaF is here a list of 1 and 0s*) +(*Gives all light-particle the label specified by the first lightparticle*) + If[LightParticles!={}, + deltaF=Elements/. x_?NumericQ /;MemberQ[ LightParticles,x ] -> LightParticles[[1]]; + , + deltaF=Elements; + ]; + +(*Now we create the full list of distinct collision elements*) + CollElements=Table[{MatrixElements[[i]],deltaF[[i]]},{i,1,Length[Elements]}]; +(*We now add all elements with the same deltaF list*) + symmetries=Gather[CollElements,#1[[2]]==#2[[2]]&]; + CollElements=Table[{symmetries[[i]][[;;,1]]//Total[#,-1]&,symmetries[[i]][[1,2]]},{i,1,Length[symmetries]}]; + + Return[CollElements] + +] ]; -(* ::Section::Closed:: *) -(*Exporting to C++*) - +(* ::Subsubsection::Closed:: *) +(*S1V1toS1V1*) -ExportMatrixElements[file_,particleList_,LightParticles_,UserMasses_,UserCouplings_,ParticleName_,RepOptional_:{}]:= -Block[{ExportTXT,ExportH5, - Cij,ParticleInfo,CouplingInfo,MatrixElements, - OutOfEqParticles,RepMasses,RepCouplings,C - }, +ExtractOutOfEqElement["S1V1toS1V1"][particleList_,LightParticles_,ParticleMasses_]:= +Block[{OutOfEqParticles,MatrixElements,Elements,CollElements,VectorMass,FermionMass,ScalarMass}, +(*incomingParticle is the particle associated with the momentum p_1*) +(*deltaFparticle is the particles whos deltaF contributions we want*) (* -Extracting the out-of-eq particles + Essentially this is generates the elements going into + Sum_deltaFparticle \[Delta]C[incomingParticle,deltaFparticle]*deltaF[deltaFparticle] *) - OutOfEqParticles=Complement[Table[i,{i,1,Length[particleList]}],LightParticles]; -(* -Replacement rules for converting to the format used by the c++ code -*) - RepMasses=Table[UserMasses[[i]]->msq[i-1],{i,1,Length[UserMasses]}]; - RepCouplings=Table[UserCouplings[[i]]->Symbol["c"][i-1],{i,1,Length[UserCouplings]}]; - -(* -Loop over all out-of-eq particles and extracting the matrix elements -*) - MatrixElements=ExtractOutOfEqElement[particleList,LightParticles]; +(*particleList is the complete list of particles*) + VectorMass=ParticleMasses[[1]]; + FermionMass=ParticleMasses[[2]]; + ScalarMass=ParticleMasses[[3]]; -(* -Extract various C^{ij} components -*) - Cij=ConstantArray[0,{Length[OutOfEqParticles],Length[OutOfEqParticles]}]; +(*First we generate all matrix elements*) + OutOfEqParticles=Complement[Table[i,{i,1,Length[particleList]}],LightParticles]; - Do[ - Elem=Extract[MatrixElements,Position[MatrixElements[[;;,2]],{i,___}]]; - Do[ - Cij[[i,j]]=Extract[Elem,#]&/@Union[Position[Elem[[;;,2]],{_,j,__}],Position[Elem[[;;,2]],{_,_,j,_}],Position[Elem[[;;,2]],{_,__,j}]]; - ,{j,OutOfEqParticles}], - {i,OutOfEqParticles} +(*Divide the incoming particle by its degree's of freedom*) + MatrixElements=Table[ + 1/degreeOfFreedom[particleList[[a]]] + CreateMatrixElementS1V1toS1V1[particleList[[a]],b,c,d,VectorMass,ScalarMass], + {a,OutOfEqParticles},{b,particleList},{c,particleList},{d,particleList}]//SparseArray; + (*This is a list of all non-zero matrix elements*) + Elements=MatrixElements["NonzeroPositions"]; + + +(*If there are no matching matrix elements we return 0*) +If[Length[Elements]==0, + Return[{}]; +, + + MatrixElements=Table[ Extract[MatrixElements,Elements[[i]]],{i,1,Length[Elements]}]; + +(*We now select all elements where deltaFparticle is amongst the scattered particles*) +(*deltaF is here a list of 1 and 0s*) +(*Gives all light-particle the label specified by the first lightparticle*) + If[LightParticles!={}, + deltaF=Elements/. x_?NumericQ /;MemberQ[ LightParticles,x ] -> LightParticles[[1]]; + , + deltaF=Elements; ]; + +(*Now we create the full list of distinct collision elements*) + CollElements=Table[{MatrixElements[[i]],deltaF[[i]]},{i,1,Length[Elements]}]; -(*Metadata*) - ParticleInfo=Table[{ToString[OutOfEqParticles[[i]]-1],ParticleName[[i]]},{i,Length[OutOfEqParticles]}]; - AppendTo[ParticleInfo,{ToString[Length[OutOfEqParticles]],"LightParticle"}]; +(*We now add all elements with the same deltaF list*) + symmetries=Gather[CollElements,#1[[2]]==#2[[2]]&]; + CollElements=Table[{symmetries[[i]][[;;,1]]//Total[#,-1]&,symmetries[[i]][[1,2]]},{i,1,Length[symmetries]}]; - CouplingInfo=Table[{ToString[UserCouplings[[i]]],ToString[Symbol["c"][i-1]]},{i,1,Length[UserCouplings]}]; + Return[CollElements] +] +]; + + +(* ::Subsubsection::Closed:: *) +(*S1S2toS3V1*) + + +ExtractOutOfEqElement["S1S2toS3V1"][particleList_,LightParticles_,ParticleMasses_]:= +Block[{OutOfEqParticles,MatrixElements,Elements,CollElements,VectorMass,FermionMass,ScalarMass}, +(*incomingParticle is the particle associated with the momentum p_1*) +(*deltaFparticle is the particles whos deltaF contributions we want*) (* -Rewrite the matrix element to an export format + Essentially this is generates the elements going into + Sum_deltaFparticle \[Delta]C[incomingParticle,deltaFparticle]*deltaF[deltaFparticle] *) - MatrixElements=Table[MatrixElemToC@i/.RepCouplings/.RepMasses/.RepOptional,{i,MatrixElements}]; + +(*particleList is the complete list of particles*) + VectorMass=ParticleMasses[[1]]; + FermionMass=ParticleMasses[[2]]; + ScalarMass=ParticleMasses[[3]]; - Table[ - Cij[[i,j]]=Table[MatrixElemToC@k/.RepCouplings/.RepMasses,{k,Cij[[i,j]]}];, - {i,OutOfEqParticles},{j,OutOfEqParticles}]; +(*First we generate all matrix elements*) + OutOfEqParticles=Complement[Table[i,{i,1,Length[particleList]}],LightParticles]; + +(*Divide the incoming particle by its degree's of freedom*) + MatrixElements=Table[ + 1/degreeOfFreedom[particleList[[a]]] + CreateMatrixElementS1S2toS3V1[particleList[[a]],b,c,d,ScalarMass], + {a,OutOfEqParticles},{b,particleList},{c,particleList},{d,particleList}]//SparseArray; + (*This is a list of all non-zero matrix elements*) + Elements=MatrixElements["NonzeroPositions"]; + + +(*If there are no matching matrix elements we return 0*) +If[Length[Elements]==0, + Return[{}]; +, + + MatrixElements=Table[ Extract[MatrixElements,Elements[[i]]],{i,1,Length[Elements]}]; + +(*We now select all elements where deltaFparticle is amongst the scattered particles*) +(*deltaF is here a list of 1 and 0s*) +(*Gives all light-particle the label specified by the first lightparticle*) + If[LightParticles!={}, + deltaF=Elements/. x_?NumericQ /;MemberQ[ LightParticles,x ] -> LightParticles[[1]]; + , + deltaF=Elements; + ]; - ExportTXT=MatrixElements; +(*Now we create the full list of distinct collision elements*) + CollElements=Table[{MatrixElements[[i]],deltaF[[i]]},{i,1,Length[Elements]}]; + +(*We now add all elements with the same deltaF list*) + symmetries=Gather[CollElements,#1[[2]]==#2[[2]]&]; + CollElements=Table[{symmetries[[i]][[;;,1]]//Total[#,-1]&,symmetries[[i]][[1,2]]},{i,1,Length[symmetries]}]; -(*Adding metadata*) - PrependTo[ExportTXT,ParticleInfo]; - PrependTo[ExportTXT,CouplingInfo]; + Return[CollElements] +] +]; + + +(* ::Subsubsection:: *) +(*Extract elements*) + + +ExtractOutOfEqElement[particleList_,LightParticles_,ParticleMasses_]:= +Block[{ + CollEll,collisions,CollEllTotal +}, +(*incomingParticle is the particle associated with the momentum p_1*) +(*deltaFparticle is the particles whos deltaF contributions we want*) +(*Essentially this is generates the elements going into Sum_deltaFparticle \[Delta]C[incomingParticle,deltaFparticle]*deltaF[deltaFparticle]*) + +(*particleList is the complete list of particles*) +(*First we extract the result for all subprocesses*) +collisions = { + "F1F2toF3F4", + "F1V1toF1V1", "F1F2toV1V2", "V1V2toV3V4", "S1S2toS3S4", + "S1S2toF1F2", "F1S1toF1S1", (*"F1F2toS1S1",*) "F1S1toF1V1", + "F1F2toS1V1", "S1S2toV1V2", "S1V1toS1V1", "S1S2toS3V1" +}; + +CollEllTotal = + Map[(If[bVerbose,Print[#]]; + ExtractOutOfEqElement[#][particleList, LightParticles, ParticleMasses])&, + collisions + ]//Flatten[#,1]&; + +If[bTruncateAtLeadingLog, + CollEllTotal=TruncateAtLeadingLogarithm[CollEllTotal]; + ]; + +Return[CollEllTotal] + +]; + + +(* ::Section:: *) +(*Generating matrix elements*) + + +ExtractLightParticles[particleList_,OutOfEqParticles_,particleListFull_,LightParticles_]:=Block[ +{ + posFermions,NonEqFermions,LightFermions, + posVectors,NonEqVectors,LightVectors, + posScalars,NonEqScalars,LightScalars +}, (* -In the text-file all matrix elements are directly listed +Extracting the out-of-eq particles *) - Export[StringJoin[file,".txt"],ExportTXT]; + OutOfEqParticles=Table[i,{i,1,Length[particleList]}]; + particleListFull=particleList; (*This list includes the light particles which are added below*) + +(*Adding all remaining particles as light*) + posFermions=Position[particleList, _?(# =="F" &)][[;;,1]]; + NonEqFermions=Table[particleList[[i]][[1]],{i,posFermions}]//Flatten[#]&; + LightFermions={Complement[RepToIndices[PrintFieldRepPositions["Fermion"]],NonEqFermions],"F"}; -(*In the hdf5 file we separate them into Cij components*) - ExportH5=Reap[Do[ - CijName=StringJoin["MatrixElements",ParticleName[[i]],ParticleName[[j]]]; - Sow[ - writeData=Table[{ToString[FortranForm[a[[1]]]],ToString[FortranForm[a[[2]]]]},{a,Cij[[i,j]]}]; - If[Length[Cij[[i,j]]]==0,writeData=""]; - CijName -> {"Data" -> writeData} - ]; - ,{i,OutOfEqParticles},{j,OutOfEqParticles}]]; + posVectors=Position[particleList, _?(# =="V" &)][[;;,1]]; + NonEqVectors=Table[particleList[[i]][[1]],{i,posVectors}]//Flatten[#]&; + LightVectors={Complement[RepToIndices[PrintFieldRepPositions["Vector"]],NonEqVectors],"V"}; - ExportH5=Flatten[ExportH5[[2]][[1]]]; - -(*Adding metadata*) - AppendTo[ExportH5,"ParticleInfo"->{"Data"->ParticleInfo}]; - AppendTo[ExportH5,"CouplingInfo"->{"Data"->CouplingInfo}]; + posScalars=Position[particleList, _?(# =="S" &)][[;;,1]]; + NonEqScalars=Table[particleList[[i]][[1]],{i,posScalars}]//Flatten[#]&; + LightScalars={Complement[RepToIndices[PrintFieldRepPositions["Scalar"]],NonEqScalars],"S"}; -(*Writing the final result to file*) - Export[StringJoin[file,".hdf5"],ExportH5]; + If[Length[LightVectors[[1]]]>0,AppendTo[particleListFull,LightVectors]]; + If[Length[LightFermions[[1]]]>0,AppendTo[particleListFull,LightFermions]]; + If[Length[LightScalars[[1]]]>0,AppendTo[particleListFull,LightScalars]]; + + LightParticles=Table[i,{i,Length[particleList]+1,Length[particleListFull]}]; + If[ + Length[LightParticles]>1, + Message[WallGoMatrix::failmsg, + "Multiple species declared as light in "<>ToString[particleListFull[[LightParticles]]]<>". "<> + "Only one species allowed. Solution: make additional species explicit in particleList."]; + Abort[]; + ] +] + + +GenerateMatrixElements[MatrixElements_,Cij_,particleListFull_,LightParticles_,ParticleMasses_,OutOfEqParticles_]:= +Block[{Elem}, + + Do[ + If[item[[1]] === {}, + Message[WallGoMatrix::failmsg, + "Found empty particle species "<>ToString[item]<>" in "<>ToString[particleListFull]]; + Abort[]; + ], + {item, particleListFull} + ]; + + MatrixElements=ExtractOutOfEqElement[particleListFull,LightParticles,ParticleMasses]; + +(*Extract various C^{ij} components*) + Cij=ConstantArray[0,{Length[OutOfEqParticles],Length[OutOfEqParticles]}]; + Do[ + Elem=Extract[MatrixElements,Position[MatrixElements[[;;,2]],{i,___}]]; + Do[ + Cij[[i,j]]=Extract[Elem,#]&/@Union[Position[Elem[[;;,2]],{_,j,__}],Position[Elem[[;;,2]],{_,_,j,_}],Position[Elem[[;;,2]],{_,__,j}]]; + ,{j,OutOfEqParticles}], + {i,OutOfEqParticles} + ]; - Return[MatrixElements] ]; -MatrixElemToC[MatrixElem_]:=Block[{Ind}, - Ind=MatrixElem[[2]]; +TruncateAtLeadingLogarithm[MatrixElements_]:=Module[{MatrixElementsF,U,S,T}, + + MatrixElementsF=MatrixElements/.Flatten[Map[{ + Power[+#[[1]] + msq_, n_?Negative]->#[[2]]^(-n)*Power[+#[[1]] + msq, n], + Power[-#[[1]] + msq_, n_?Negative]->#[[2]]^(-n)*Power[-#[[1]] + msq, n] + }&,{{s,S},{t,T},{u,U}}]]; + + MatrixElementsF=Map[{ + Plus@@Table[ + +SeriesCoefficient[#[[1]]/.{T->xLarge*T,U->xLarge*U},{xLarge,Infinity,-i}] + , + {i,If[#[[2]][[3]]==#[[2]][[4]],2,1],2}], + #[[2]]}&, + MatrixElementsF]; + + MatrixElementsF=Collect[MatrixElementsF,{S,T,U},Simplify]/.{S*T->0,S*U->0,T*U->0}/.Thread[{T,U,S}->1]; + MatrixElementsF=DeleteCases[MatrixElementsF, {0,{a__}}]; - Return[M[Ind[[1]]-1,Ind[[2]]-1,Ind[[3]]-1,Ind[[4]]-1]->MatrixElem[[1]]] + Return[MatrixElementsF]; ] diff --git a/src/modelCreation.m b/src/modelCreation.m new file mode 100644 index 0000000..e408707 --- /dev/null +++ b/src/modelCreation.m @@ -0,0 +1,665 @@ +(* ::Package:: *) + +(* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *) + +(* :Title: ModelCreation *) + +(* + This software is covered by the GNU General Public License 3. + Copyright (C) 2021-2024 Andreas Ekstedt + Copyright (C) 2021-2024 Philipp Schicho + Copyright (C) 2021-2024 Tuomas V.I. Tenkanen +*) + +(* :Summary: Creating models from model file. *) + +(*This file uses functions from GroupMath. A citation to arXiv:2011.01764 should*) +(*be used if any of these functions are used.*) +(* ------------------------------------------------------------------------ *) + + +(* + This module creates representation matrices for the gauge sector. Other coupling tensors are allocated as zero-tensors. +*) +AllocateTensors[GroupI_,RepNameI_,CouplingNameI_,FermionRepI_,ScalarRepI_]:=Module[ + {GroupP=GroupI,RepNameP=RepNameI,CouplingNameP=CouplingNameI,FermionRepP=FermionRepI,ScalarRepP=ScalarRepI}, + Clear[a,b,c,d]; + Needs["GroupMath`"]; + GroupMathCleared=False; + + GroupP=ToGM[GroupP]; (*Converts the Group from DR input to GroupMath input*) + gen=RepMatrices[GroupP,RepNameP]; (*The representation matrices*) + + SizeGroups= Quiet[Table[Length[RepMatrices[GroupP[[i]],RepNameP[[i]]]],{i,1,Length[GroupP]}]]; (*The number of components for each group*) + SizeGroupsMod=SizeGroups//ReplaceAll[#,0->1]&; (*Fix for U1 groups*) + TotalComponents=Total[SizeGroupsMod]; (**) + GaugeIndices=ConstantArray[0,{Length[GroupP]}]; (*Position of every gauge rep*) + + + GaugeIndices[[1]]=1;;SizeGroupsMod[[1]]; + Do[ + helpInd=GaugeIndices[[i-1]]/.(a_;;b_)-> b; + GaugeIndices[[i]]=(helpInd+1);;(helpInd+SizeGroupsMod[[i]]); + ,{i,2,Length[GroupP]} + ]; + + +(*Create coupling matrix. This matrix contains the name of coupling constants, and incorporates correct normalization of generators*) +(*This normalization is required when finding structure constants through commutation relations*) + Components=ConstantArray[0,Length[GroupP]+1]; + Components[[1]]=1; + Do[ + Components[[i]]=Components[[i-1]]+SizeGroupsMod[[i-1]] + , + {i,2,Length[GroupP]+1} + ]; + + Do[ + Components[[i]]=Components[[i-1]]+SizeGroupsMod[[i-1]] + , + {i,2,Length[GroupP]+1} + ]; + + + CouplingArray=ConstantArray[0,{TotalComponents,TotalComponents}]; + Do[ +(*Multiplies the relevant copupling-constant for each group*) + CouplingArray[[Components[[i]];;Components[[i+1]]-1,Components[[i]];;Components[[i+1]]-1]]=CouplingNameP[[i]]*IdentityMatrix[SizeGroupsMod[[i]]]; + , + {i,1,Length[GroupP]} + ]; +(*Structure constants*) + Temp=I GaugeRep[GroupP]//SparseArray; + fabc=Table[ Temp[[a]] CouplingArray[[a,a]],{a,1,TotalComponents}]//SparseArray; + +(*Fix for non-numerical U1s*) + PosU1=Position[GroupP,{}]//Flatten[#]&; + PosU1Components=ConstantArray[0,Length[PosU1]]; + Do[ + PosU1Components[[i-PosU1[[1]]+1]]=Total[SizeGroupsMod[[1;;i]]]; + ,{i,PosU1}]; + + ChargeU1F=ConstantArray[0,{Length[FermionRepP],Length[GroupP]}]; + Do[ + Do[ + If[NumericQ[FermionRepP[[j]][[1]][[i]]]==False, + ChargeU1F[[j,i]]=FermionRepP[[j]][[1]][[i]]; + FermionRepP[[j]][[1]][[i]]=1; + ] + ,{i,PosU1}],{j,1,Length[FermionRepP]}]; + +(********************) + + +(*Fermion Reps*) + If[Length[FermionRepP]<1, + gvffP=SparseArray[{{1,1,1}->0},{TotalComponents,1,1}]//SparseArray; + , + gvffP=FermionRep[GroupP,FermionRepP[[1]]]; +(*Arbitrary U1 charges*) + Do[ + If[NumericQ[ChargeU1F[[1]][[i]]]==False, + h=PosU1Components[[i+1-PosU1[[1]]]]; + gvffP[[h]]=gvffP[[h]]*ChargeU1F[[1,i]]; + ] + ,{i,PosU1}]; +(*********************) + + If[Length[FermionRepP]>1, + Do[ + Temp=FermionRep[GroupP,FermionRepP[[i]]]; + +(*Arbitrary U1 charges*) + Do[ + If[NumericQ[ChargeU1F[[i,j]]]==False, + h=PosU1Components[[j+1-PosU1[[1]]]]; + Temp[[h]]=Temp[[h]]*ChargeU1F[[i,j]]; + ] + ,{j,PosU1}]; +(*********************) + + + gvffTemp=Table[ArrayFlatten[{{gvffP[[a]],0},{0,Temp[[a]]}}],{a,1,Length[gvffP]}];(*Stacks all fermions on the diagonal*) + gvffP=gvffTemp; + , + {i,2,Length[FermionRepP]}] + + ]; + + ]; + + CouplingArray=ConstantArray[0,{TotalComponents,TotalComponents}]; (*Only contains coupling constants. No Dynkin index as generators are properly normalized*) + Do[ + CouplingArray[[Components[[i]];;Components[[i+1]]-1,Components[[i]];;Components[[i+1]]-1]]=CouplingNameP[[i]]IdentityMatrix[SizeGroupsMod[[i]]]; + , + {i,1,Length[GroupP]} + ]; + gvffTemp=Table[CouplingArray[[a,a]]gvffP[[a]],{a,1,Length[gvffP]}]; + gvffP=gvffTemp; + + +(*Scalar Reps*) + ChargeU1=ConstantArray[0,{Length[ScalarRepP],Length[GroupP]}]; + Do[ + Do[ + If[NumericQ[ScalarRepP[[j]][[1]][[i]]]==False, + ChargeU1[[j,i]]=ScalarRepP[[j]][[1]][[i]]; + ScalarRepP[[j]][[1]][[i]]=1; + ] + ,{i,PosU1}],{j,1,Length[ScalarRepP]}]; +(*The above takes care of cases with arbitrary U1 charges*) + + If[Length[ScalarRepP]<1, + gvssP=SparseArray[{{1,1,1}->0},{TotalComponents,1,1}]//SparseArray; + , + + gvssP=ScalarRepCreation[GroupP,ScalarRepP[[1]]]; +(*Arbitrary U1 charges*) + Do[ + If[NumericQ[ChargeU1[[1]][[i]]]==False, + h=PosU1Components[[i+1-PosU1[[1]]]]; + gvssP[[h]]=gvssP[[h]]*ChargeU1[[1,i]]; + ]; + ,{i,PosU1}]; +(*********************) +(*********************) + + If[Length[ScalarRepP]>1, + Do[ + Temp=ScalarRepCreation[GroupP,ScalarRepP[[i]]]; + + +(*********************) +(*Arbitrary U1 charges*) + Do[ + If[NumericQ[ChargeU1[[i]][[j]]]==False, + h=PosU1Components[[j+1-PosU1[[1]]]]; + Temp[[h]]=Temp[[h]]*ChargeU1[[i,j]]; + ]; + ,{j,PosU1}]; +(*********************) + + + gvssTemp=Table[ArrayFlatten[{{gvssP[[a]],0},{0,Temp[[a]]}}],{a,1,Length[gvssP]}]; (*Stack scalar reps on the diagonal*) + gvssP=gvssTemp; + ,{i,2,Length[ScalarRepP]}]; + ]; + ]; + + + gvssTemp=Table[CouplingArray[[a,a]]gvssP[[a]],{a,1,Length[gvssP]}]; + gvssP=gvssTemp//SparseArray; + +(* Creates All tensors*) +(*By default all tensors barring gauge ones are empty*) + nsP=Length[gvssP[[1]]]; + nvP=Length[fabc]; + nfP=Length[gvffP[[1]]]; + \[Lambda]1P=EmptyArray[{nsP}]; + \[Lambda]3P=EmptyArray[{nsP,nsP,nsP}]; + \[Lambda]4P=EmptyArray[{nsP,nsP,nsP,nsP}]; + \[Mu]ijP=EmptyArray[{nsP,nsP}]; + \[Mu]IJCP=EmptyArray[{nfP,nfP}]; + \[Mu]IJP=EmptyArray[{nfP,nfP}]; + YsffP=EmptyArray[{nsP,nfP,nfP}]; + YsffCP=EmptyArray[{nsP,nfP,nfP}]; +(* Returns*) + +(*Creates variables for constructing invariants. Basically naming all components*) + CreateScalarComponents[GroupP,ScalarRepP]; + CreateFermionComponents[GroupP,FermionRepP]; + + GaugeCouplingNames=CouplingNameI; + + Return[Join[{fabc//SparseArray//SimplifySparse,gvffP//SparseArray//SimplifySparse,gvssP//SparseArray//SimplifySparse,\[Lambda]1P//SparseArray,\[Lambda]3P//SparseArray,\[Lambda]4P//SparseArray,\[Mu]ijP//SparseArray,\[Mu]IJP//SparseArray,\[Mu]IJCP//SparseArray,YsffP//SparseArray,YsffCP//SparseArray}]]; +]; + + +{GaugeCouplingNames}; + + +(* + Creates representation matrices for scalars. It is possible for the representation to be either real or complex. +*) +ScalarRepCreation[GroupI_,ScalarRepI_]:=Module[{GroupP=GroupI,ScalarRepP=ScalarRepI}, + Temp=RepMatrices[GroupP,ScalarRepP[[1]]]; + If[ScalarRepP[[2]]=="C", + (*For complex representations we need to rewrite everything in a real basis*) + help=- Table[{{Im[Temp[[a]]],Re[Temp[[a]]]},{-Re[Temp[[a]]],Im[Temp[[a]]]}}//ArrayFlatten,{a,1,Length[Temp]}]//ArrayFlatten; + , + If[ScalarRepP[[2]]=="A", + (*If the representation is the adjoint we choose to give the normal structure constants*) + help=I GaugeRep[GroupP]//SparseArray; + , + (*By default real representation matrices are not anti-symmetric. So we need to change basis*) + U=RotationToRealBasis[GroupP,ScalarRepP[[1]]]; + help= I U . # . ConjugateTranspose[U]&/@Temp; + ]; + ]; + Return[help] +]; + + +GradH[f_,x_List?VectorQ]:=D[f,{x}]; + + +(* + Creates representation matrices for fermions. It is possible for the representation to be either left- or right-handed. +*) +FermionRep[GroupI_,FermionRepI_]:=Module[{GroupP=GroupI,FermionRepP=FermionRepI}, +If[FermionRepP[[2]]=="L", + help=RepMatrices[GroupP,FermionRepP[[1]]]; (*No change for left-handed fermions*) +, + help=-Conjugate[RepMatrices[GroupP,FermionRepP[[1]]]]; (*Right-handed matrices are charge-conjugated*) +]; +Return[help] +]; + + +(* + Redunant module. This should be removed. +*) +RotateToAdjBasis[GroupI_,ScalarRepI_]:=Module[{GroupP=GroupI,ScalarRepP=ScalarRepI}, +(*This Module maps components from a real basis to the adjoint basis defined by gvss=gvvv*) +(*This mapping is a similarity transformation*) +(*This Module is no longer necessary. Should probably delete it eventually.*) + posGroup=FirstPosition[ScalarRepP, _?(# != 0 &)][[1]]; (*Only simple adjoint reps are allowed*) + OrigRep=RepMatrices[GroupP[[posGroup]],ScalarRepP[[posGroup]]]//ArrayFlatten[#]&//Normal; (*This is the standard rep from GroupMath.*) + + PreFacHelp=DynkinIndex[GroupP[[posGroup]],ScalarRepP[[posGroup]]]; (*Normalization for structure constants*) + fabc=-I PreFacHelp^-1 Table[Tr[(b . c-c . b) . a],{a,OrigRep},{b,OrigRep},{c, OrigRep}]//SparseArray; + + U=RotationToRealBasis[GroupP,ScalarRepP]; (*Rotation matrix from OrigRep to a real basis*) + +(*Choose to find the transformation, for simplicity, via a diagonal matrix.*) + Do[ + If[DiagonalMatrixQAE[OrigRep[[i]]]==True, + RefMat=OrigRep[[i]]//Normal; + AdjMat=fabc[[i]]//Normal; + Break[]; + ]; + ,{i,1,Length[OrigRep]}]; + + ListHelp=Array[a[##]&,Length[RefMat]]; + U2=DiagonalMatrix[ListHelp]; (**) + E1=U2 . Normalize/@Eigenvectors[AdjMat]; (*The diagonalization matrix is only defined up to a diagonal U(1) matrix*) + E2=Normalize/@Eigenvectors[RefMat]; + ETot=ConjugateTranspose[E1] . E2; (*This matrix maps from fabc to OrigRep up to a U(1) tf*) + + SolveFac=-I ConjugateTranspose[ETot] . # . ETot&/@fabc;(*We now choose U2 to ensure that this is a similarity tf*) + solU=FindInstance[Normal[SolveFac]== Normal[OrigRep],ListHelp][[1]]; + EFinal=ETot/.solU; (*Complete tf from fabc to OrigRep*) + + P=U . ConjugateTranspose[EFinal];(*This is the tf that maps from the real basis to the adjoint basis defined by fabc*) + Return[P] +]; + + +{ScalarVariablesIndices,GaugeIndices}; + + +PrintFieldRepPositions["Vector"]:=Module[{}, + Return[GaugeIndices] +]; + + +PrintFieldRepPositions["Fermion"]:=Module[{}, + Return[FermionVariablesIndices] +]; + + +PrintFieldRepPositions["Scalar"]:=Module[{}, + Return[ScalarVariablesIndices] +]; + + +(* + This Module names all scalar components. +*) +CreateScalarComponents[GroupI_,ScalarRepI_]:=Module[{GroupP=GroupI,ScalarRepP=ScalarRepI}, + + GroupHelp=DeleteCases[GroupP,{}]; (*Removes all U1 factors since they don't have individual components*) + PosU1=Position[GroupP,{}];(*Position of all U1:s*) + ScalarComponents=ConstantArray[0,{Length[ScalarRepP]}];(*Contains all subsitution rules*) + ScalarComponentsC=ConstantArray[0,{Length[ScalarRepP]}];(*Conjugated components*) + ScalarVariables=ConstantArray[0,{Length[ScalarRepP]}]; (*Names of all components*) + ScalarVariablesIndices=ConstantArray[0,{Length[ScalarRepP]}]; (*Position of every scalar rep*); + + Do[ + SizeRep=DimR[GroupHelp,ScalarRepP[[i]][[1]]//Delete[#,PosU1]&]; +(*By default GroupMath creates invariants with names a[x], b[x], ...*) + If[ScalarRepP[[i]][[2]]=="C", +(*\[Phi] are real components and \[Psi] ar the imagionary ones*) + ScalarComponents[[i]]=Array[a[##]->1/Sqrt[2]Symbol[ToString[\[Phi]]<>ToString[i]][##]+I 1/Sqrt[2] Symbol[ToString[\[Psi]]<>ToString[i]][##]&,SizeRep]//Flatten[#]&; + ScalarComponentsC[[i]]=Array[a[##]->1/Sqrt[2] Symbol[ ToString[\[Phi]]<>ToString[i]][##]-I 1/Sqrt[2] Symbol[ToString[\[Psi]]<>ToString[i]][##]&,SizeRep]//Flatten[#]&; + ScalarVariables[[i]]={#}&/@Flatten[ScalarComponents[[i]]]/.{a_->b_}->b//Variables; + If[i==1, + ScalarVariablesIndices[[i]]=1;;(Length[ScalarVariables[[i]]]); + , + helpInd=ScalarVariablesIndices[[i-1]]/.(a_;;b_)-> b; + ScalarVariablesIndices[[i]]=(helpInd+1);;(helpInd+Length[ScalarVariables[[i]]]); + ]; + , +(*For a real rep we need to rotate it to a real basis*) + RotMat=RotationToRealBasis[GroupP,ScalarRepP[[i]][[1]]]; (*Maps to a real basis*) + Components=Array[Symbol[ToString[\[Phi]]<>ToString[i]][##]&,SizeRep]//Flatten[#]&; + BasisChange=MapThread[Rule,{Components,ConjugateTranspose[RotMat] . Components}]; + + ScalarComponents[[i]]=Array[a[##]->Symbol[ToString[\[Phi]]<>ToString[i]][##]&,SizeRep]//Flatten[#]&//ReplaceAll[#,BasisChange]&; + ScalarComponentsC[[i]]=Array[a[##]->Symbol[ToString[\[Phi]]<>ToString[i]][##]&,SizeRep]//Flatten[#]&//ReplaceAll[#,BasisChange]&; + ScalarVariables[[i]]={#}&/@Flatten[ScalarComponents[[i]]]/.{a_->b_}->b//Variables; + If[i==1, + ScalarVariablesIndices[[i]]=1;;(Length[ScalarVariables[[i]]]); + , + helpInd=ScalarVariablesIndices[[i-1]]/.(a_;;b_)-> b; + ScalarVariablesIndices[[i]]=(helpInd+1);;(helpInd+Length[ScalarVariables[[i]]]); + ]; + ]; + ,{i,1,Length[ScalarRepI]}]; + + +(*Check if the group only contains U1s*) + If[Total[Length[#]&/@GroupP]<1, +(*If the group only contains U1s the components don't have an index. so a[x]-> a. This is fixed below*) + ScalarComponents=ScalarComponents//ReplaceAll[#,a[1]->a]&; + ScalarComponentsC=ScalarComponentsC//ReplaceAll[#,a[1]->a]&; + ]; + ScalarVariables=ScalarVariables//Flatten[#]&; +]; + + +{ScalarComponents,ScalarComponentsC,ScalarVariables}; + + +(* + Names fermion components. +*) +CreateFermionComponents[GroupI_,FermionRepI_]:=Module[{GroupP=GroupI,FermionRepP=FermionRepI}, + + GroupHelp=DeleteCases[GroupP,{}]; (*Removes all U1 factors since they don't have individual components*) + PosU1=Position[GroupP,{}];(*Position of all U1:s*) + + FermionComponents=ConstantArray[0,{Length[FermionRepP]}]; (*Contains all subsitution rules*) + FermionVariables=ConstantArray[0,{Length[FermionRepP]}];(*Contains the name of all fermion variables*) + FermionVariablesIndices=ConstantArray[0,{Length[FermionRepP]}]; (*Position of every scalar rep*); + + Do[ + SizeRep=DimR[GroupHelp,FermionRepP[[i]][[1]]//Delete[#,PosU1]&]; + FermionComponents[[i]]=Array[a[##]->Symbol[ToString[\[CapitalPsi]]<>ToString[i]][##]&,SizeRep]//Flatten[#]&; + FermionVariables[[i]]={#}&/@Flatten[FermionComponents[[i]]]/.{a_->b_}->b//Variables; + If[i==1, + FermionVariablesIndices[[i]]=1;;(Length[FermionVariables[[i]]]); + , + helpInd=FermionVariablesIndices[[i-1]]/.(a_;;b_)-> b; + FermionVariablesIndices[[i]]=(helpInd+1);;(helpInd+Length[FermionVariables[[i]]]); + ]; + , + {i,1,Length[FermionRepP]}]; + +(*Check if the group only contains U1s*) + If[Total[Length[#]&/@GroupP]<1, + FermionComponents=FermionComponents//ReplaceAll[#,a[1]->a]&; + ]; + + FermionVariables=FermionVariables//Flatten[#]&; + +]; + + +{FermionComponents,FermionVariables,FermionVariablesIndices}; + + +(* + Creates invariant scalar operators with ordered components. +*) +CreateInvariant[GroupI_,ScalarRepI_,InvariantI_]:=Module[{GroupP=GroupI,ScalarRepP=ScalarRepI,InvariantP=InvariantI}, + + SubArray=ConstantArray[0,Length[InvariantP[[1]]]]; + + GroupP=ToGM[GroupP]; (*Converts to GroupMath input*) + +(*Fix for non-numeric U1 charges*) + PosU1=Position[GroupP,{}]//Flatten[#]&; + + If[Length[Delete[GroupP,{#}&/@PosU1]]>0, + GroupP=Delete[GroupP,{#}&/@PosU1]; + Do[ + ScalarRepP[[i]][[1]]=Delete[ScalarRepP[[i]][[1]],{#}&/@PosU1]; + ,{i,1,Length[ScalarRepP]}]; + , + Do[ + ScalarRepP[[j]][[1]][[i]]=0; (*For arbitrary gauge-charges we set all charges to 0 when creating an invariant. Up to user to ensure that the term is gauge invariant*) + ,{j,1,Length[ScalarRepP]},{i,1,Length[GroupP]}] + ]; +(********************) + + ComponentsP={ScalarComponents,ScalarComponentsC,ScalarVariables}; +(*This just creates a Sub list*) + j=1; + Do[ + If[ScalarRepP[[i]][[2]]=="C", + If[InvariantP[[2]][[j]]==True, + SubArray[[j]]=ComponentsP[[1]][[i]]/.a->ToExpression[Alphabet[][[j]]] + , + SubArray[[j]]=ComponentsP[[2]][[i]]/.a->ToExpression[Alphabet[][[j]]](*Complex conjugated components*) + ]; + , + SubArray[[j]]=ComponentsP[[1]][[i]]/.a->ToExpression[Alphabet[][[j]]](*No conjugated components for real reps*) + ]; + j=j+1; + , + {i,InvariantP[[1]]}]; + + + SubArray=SubArray//Flatten[#]&; + InvRepsP=ScalarRepP[[InvariantP[[1]]]];(*These are the reps specified by the user*) + InvReps=Table[InvRepsP[[i]][[1]],{i,1,Length[InvariantP[[1]]]}]; + + Temp=Invariants[GroupP,InvReps,Conjugations->InvariantP[[2]]]; + InvOperator=ToExpression[StringReplace[ToString[StandardForm[Temp]],"GroupMath`"->""]]//ReplaceAll[#,SubArray]&; + Return[InvOperator] +]; + + +(* + Creates invariant pure-fermion operators. +*) +CreateInvariantFermion[GroupI_,FermionRepI_,InvariantI_]:=Module[{GroupP=GroupI,FermionRepP=FermionRepI,InvariantP=InvariantI}, +(*Here I create an invariant, with ordered components, using the Invariant function from Groupmath*) + SubArray=ConstantArray[0,Length[InvariantP[[1]]]]; + + GroupP=ToGM[GroupP]; (*Converts to groupmath input*) + +(*Fix for non-numeric U1 charges*) + PosU1=Position[GroupP,{}]//Flatten[#]&; + If[Length[Delete[GroupP,{#}&/@PosU1]]>0, + GroupP=Delete[GroupP,{#}&/@PosU1]; + Do[ + FermionRepP[[i]][[1]]=Delete[FermionRepP[[i]][[1]],{#}&/@PosU1]; + ,{i,1,Length[FermionRepP]}]; + , + Do[ + FermionRepP[[j]][[1]][[i]]=0; + ,{j,1,Length[FermionRepP]},{i,1,Length[GroupP]}] + ]; +(********************) + + ComponentsP={FermionComponents,FermionVariables}; +(*This just creates a Sub list*) + j=1; + Do[ + SubArray[[j]]=ComponentsP[[1]][[i]]/.a->ToExpression[Alphabet[][[j]]]; + j=j+1; + , +{i,InvariantP[[1]]}]; + + + SubArray=SubArray//Flatten[#]&; + InvRepsP=FermionRepP[[InvariantP[[1]]]];(*These are the reps specified by the user*) + InvReps=Table[InvRepsP[[i]][[1]],{i,1,Length[InvariantP[[1]]]}]; + + Temp=Invariants[GroupP,InvReps,Conjugations->InvariantP[[2]]]; + + InvOperator=ToExpression[StringReplace[ToString[StandardForm[Temp]],"GroupMath`"->""]]//ReplaceAll[#,SubArray]&; +Return[InvOperator] +]; + + +(* + Create Yukawa couplings. +*) +CreateInvariantYukawa[GroupI_,ScalarRepI_,FermionRepI_,InvariantI_]:=Module[{GroupP=GroupI,ScalarRepP=ScalarRepI,FermionRepP=FermionRepI,InvariantP=InvariantI}, +(*Here I create an invariant, with ordered components, using the Invariant function from Groupmath*) +(*This just creates a Sub list*) + + GroupP=ToGM[GroupP]; (*Converts to GroupMath input*) + + ComponentsP={ScalarComponents,ScalarComponentsC,ScalarVariables}; + ComponentsFermionP={FermionComponents,FermionVariables}; + +(*Fix for non-numeric U1 charges*) + PosU1=Position[GroupP,{}]//Flatten[#]&; + If[Length[Delete[GroupP,{#}&/@PosU1]]>0, + GroupP=Delete[GroupP,{#}&/@PosU1]; + Do[ + ScalarRepP[[i]][[1]]=Delete[ScalarRepP[[i]][[1]],{#}&/@PosU1]; + ,{i,1,Length[ScalarRepP]}]; + + Do[ + FermionRepP[[i]][[1]]=Delete[FermionRepP[[i]][[1]],{#}&/@PosU1]; + ,{i,1,Length[FermionRepP]}]; + , + Do[ + ScalarRepP[[j]][[1]][[i]]=0; + ,{j,1,Length[ScalarRepP]},{i,1,Length[GroupP]}]; + + Do[ + FermionRepP[[j]][[1]][[i]]=0; + ,{j,1,Length[FermionRepP]},{i,1,Length[GroupP]}]; + + ]; + + + +(********************) + + j=1; + i=InvariantP[[1]][[1]]; + If[ScalarRepP[[i]][[2]]=="C", + If[InvariantP[[2]][[j]]==True, + SubArray=ComponentsP[[1]][[i]]/.a->ToExpression[Alphabet[][[j]]] + , + SubArray=ComponentsP[[2]][[i]]/.a->ToExpression[Alphabet[][[j]]] + ]; + , + SubArray=ComponentsP[[1]][[i]]/.a->ToExpression[Alphabet[][[j]]] + ]; + + SubArrayFermion=ConstantArray[0,2]; + + i=InvariantP[[1]][[2]]; + SubArrayFermion[[1]]=ComponentsFermionP[[1]][[i]]/.a->ToExpression[Alphabet[][[2]]]; + i=InvariantP[[1]][[3]]; + SubArrayFermion[[2]]=ComponentsFermionP[[1]][[i]]/.a->ToExpression[Alphabet[][[3]]]; + + SubArray=SubArray//Flatten[#]&; + SubArrayFermion=SubArrayFermion//Flatten[#]&; + + InvRepsScalar=ScalarRepP[[InvariantP[[1]][[1]]]]; +(*These are the reps specified by the user*) + InvRepsFemion=FermionRepP[[InvariantP[[1]][[2;;3]]]]; + + InvReps={InvRepsScalar[[1]],InvRepsFemion[[1]][[1]],InvRepsFemion[[2]][[1]]}; +(*//ReplaceAll[#,SubArray]&//ReplaceAll[#,SubArrayFermion]&*) + + Temp=Invariants[GroupP,InvReps,Conjugations->InvariantP[[2]]]//ReplaceAll[#,SubArray]&//ReplaceAll[#,SubArrayFermion]&; + + InvOperator=ToExpression[StringReplace[ToString[StandardForm[Temp]],"GroupMath`"->""]]//ReplaceAll[#,SubArray]&//ReplaceAll[#,SubArrayFermion]&; + Return[InvOperator]; +]; + + +GradMass[PotentialI_]:=Module[{PotentialP=PotentialI}, + SparseArray[GradH[PotentialP,ScalarVariables]]//GradH[#,ScalarVariables]& +]; + + +GradMassFermion[PotentialI_]:=Module[{PotentialP=PotentialI}, + SparseArray[GradH[PotentialP,FermionVariables]]//GradH[#,FermionVariables]&//SparseArray +]; + + +GradQuartic[PotentialI_]:=Module[{PotentialP=PotentialI}, + SparseArray[GradH[PotentialP,ScalarVariables]]//GradH[#,ScalarVariables]&//GradH[#,ScalarVariables]&//GradH[#,ScalarVariables]&//SparseArray +]; + + +GradSextic[PotentialI_]:=Module[{PotentialP=PotentialI}, + GradQuartic[PotentialP]//GradH[#,ScalarVariables]&//GradH[#,ScalarVariables]&//SparseArray +]; + + +GradCubic[PotentialI_]:=Module[{PotentialP=PotentialI}, + SparseArray[GradH[PotentialP,ScalarVariables]]//GradH[#,ScalarVariables]&//GradH[#,ScalarVariables]&//SparseArray +]; + + +GradTadpole[PotentialI_]:=Module[{PotentialP=PotentialI}, + SparseArray[GradH[PotentialP,ScalarVariables]]//SparseArray +]; + + +GradYukawa[PotentialI_]:=Module[{PotentialP=PotentialI}, + SparseArray[GradH[PotentialP,ScalarVariables]]//GradH[#,FermionVariables]&//GradH[#,FermionVariables]&//SparseArray +]; + + +(* + Creates an empty array. +*) +EmptyArray[ComponentsI_]:=Module[{ComponentsP=ComponentsI}, + ComponentsMod=ComponentsP; + Do[ + If[ComponentsP[[i]]<1,ComponentsMod[[i]]=1,ComponentsMod[[i]]=ComponentsP[[i]] + ]; + ,{i,Length[ComponentsP]}]; + SparseArray[{ComponentsMod->0},ComponentsMod] +]; + + +(* + Finds the dimension of all groups. +*) +ToGM[GroupI_]:=Module[{GroupP=GroupI}, + Temp=StringReplace[GroupP,{"SU"->""}]; + SUTensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies SU groups*) + numTensorSU=CartanMatrix["SU",#]&/@(Read[StringToStream[#],Number]&/@StringReplace[SUTensor,{"SU"->""}]);(*Replace the group with the dimension of the adjoint rep*) + + Temp=StringReplace[GroupP,{"SO"->""}]; + SUTensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies SU groups*) + numTensorSO=CartanMatrix["SO",#]&/@(Read[StringToStream[#],Number]&/@StringReplace[SUTensor,{"SO"->""}]);(*Replace the group with the dimension of the adjoint rep*) + + Temp=StringReplace[GroupP,{"SP"->""}]; + SUTensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies SU groups*) + numTensorSP=CartanMatrix["SP",#]&/@(Read[StringToStream[#],Number]&/@StringReplace[SUTensor,{"SP"->""}]);(*Replace the group with the dimension of the adjoint rep*) + + Temp=StringReplace[GroupP,{"E"->""}]; + SUTensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies SU groups*) + numTensorE=CartanMatrix["E",#]&/@(Read[StringToStream[#],Number]&/@StringReplace[SUTensor,{"E"->""}]);(*Replace the group with the dimension of the adjoint rep*) + + Temp=StringReplace[GroupP,{"G"->""}]; + SUTensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies SU groups*) + numTensorG=CartanMatrix["G",#]&/@(Read[StringToStream[#],Number]&/@StringReplace[SUTensor,{"G"->""}]);(*Replace the group with the dimension of the adjoint rep*) + + Temp=StringReplace[GroupP,{"F"->""}]; + SUTensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies SU groups*) + numTensorF=CartanMatrix["F",#]&/@(Read[StringToStream[#],Number]&/@StringReplace[SUTensor,{"F"->""}]);(*Replace the group with the dimension of the adjoint rep*) + + Temp=StringReplace[GroupP,{"U1"->""}]; + SUTensor=DeleteCases[GroupP,Alternatives@@Temp];(*Identifies SU groups*) + numTensorU1=CartanMatrix["U",#]&/@(Read[StringToStream[#],Number]&/@StringReplace[SUTensor,{"U"->""}]);(*Replace the group with the dimension of the adjoint rep*) + + + {SoRes,SuRes,SpRes,G2Res,F4Res,E6Res,E7Res,E8Res,U1Res}//Flatten[#,1]&; + Return[Join[numTensorSO,numTensorSU,numTensorSP,numTensorG,numTensorF,numTensorE,numTensorU1]]; +]; diff --git a/tests/FeynCalc/README.rst b/tests/FeynCalc/README.rst new file mode 100644 index 0000000..a04abeb --- /dev/null +++ b/tests/FeynCalc/README.rst @@ -0,0 +1,30 @@ +====================================================== +Matrix elements with FeynRules/Arts/Calc +====================================================== + +Here we present an alternative computation of the matrix elements, which we have +used as a cross check of the WallGo MatrixElements package. + +Requirements +============ +The matrix element calculations presented here use some packages written in +Mathematica. For more information on these packages, please see their +documentation. + +- `FeynRules `_ +- `FeynArts `_ +- `FeynCalc `_ + +Running the computation +======================= +The calculation proceeds in steps as follows. Here we give the example of a +Yukawa model in the directory `yukawa`. + +1. Write a plain text FeynRules model file. The example here is called `yukawa.fr`. +2. Run `feynRules.m` in Mathematica, to compute the Feynman rules, and output for +FeynArts. These are files called `yukawa.mod` and `yukawa.gen`, as well as `yukawa.pars` +which holds the parameters of the model. +3. Run the `matrixElements.m` file to produce the required matrix elements. This file +consists of first constructing the diagrams and amplitudes using FeynArts, and then +computing and simplifying the matrix elements squared, using FeynCalc. Note that +you will need to quit the Mathematica kernel after running `feynRules.m`. \ No newline at end of file diff --git a/tests/FeynCalc/yukawa/feynRules.m b/tests/FeynCalc/yukawa/feynRules.m new file mode 100644 index 0000000..2b62118 --- /dev/null +++ b/tests/FeynCalc/yukawa/feynRules.m @@ -0,0 +1,24 @@ +(* ::Package:: *) + +(* ::Input:: *) +(*$FeynRulesPath=DirectoryName[FindFile["FeynRules`"]];*) +(*<".fr"}];*) +(*LoadModel[modelFile]*) + + +(* ::Input:: *) +(*(* choosing output location *)*) +(*outputFiles=FileNameJoin[NotebookDirectory[]<>model];*) +(*(* writing FeynArts output *)*) +(*WriteFeynArtsOutput[L,Output->outputFiles,CouplingRename->False]*) +(*(* deleting empty directory made by FeynRules *)*) +(*DeleteDirectory[outputFiles]*) + + + diff --git a/tests/FeynCalc/yukawa/matrixElements.m b/tests/FeynCalc/yukawa/matrixElements.m new file mode 100644 index 0000000..f322693 --- /dev/null +++ b/tests/FeynCalc/yukawa/matrixElements.m @@ -0,0 +1,154 @@ +(* ::Package:: *) + +(* ::Title:: *) +(*Matrix elements in a Yukawa Model*) + + +(* ::Chapter:: *) +(*Loading packages*) + + +(* ::Input:: *) +(*$LoadAddOns={"FeynArts"};*) +(*Get["FeynCalc`"];*) +(*$FAVerbose=0;*) +(*SetOptions[FourVector,FeynCalcInternal->False];*) + + +(* ::Chapter:: *) +(*Choosing model*) + + +(* ::Input:: *) +(*(* this is where the FeynArts files made by FeynRules can be found, ending in .gen and .mod *)*) +(*model="yukawa";*) +(*modLoc=FileNameJoin[{NotebookDirectory[],model}];*) +(*genericLoc=modLoc;*) +(*InitializeModel[modLoc,GenericModel->modLoc];*) + + +(* ::Input:: *) +(*(* relevant processes for Boltzmann collision integrals with given particle in position p1 *)*) +(*particleTypes=DeleteCases[F$Particles,U[1]|-U[1]];*) +(*particleNames=Map[ToString[TheLabel[#]]<>If[Head[#]===Times,"bar",""]&,particleTypes]*) +(*makeProcesses[firstParticle_]:=DeleteDuplicates[Flatten[Table[{firstParticle,a}->{b,c},{a,particleTypes},{b,particleTypes},{c,particleTypes}],2]];*) + + +(* ::Input:: *) +(*(* getting expressions for parameters *)*) +(*Get[modLoc<>".pars"]*) +(*parameters=Map[#[[1]]&,M$ExtParams]*) + + +(* ::Input:: *) +(*(* indices for particles *)*) +(*mapParticleToInteger:=Thread[particleTypes->(Range[Length[particleTypes]]-1)];*) +(*mapParticleToInteger*) +(*makeMName[process_]:=M[process[[1,1]],process[[1,2]],process[[2,1]],process[[2,2]]]/.mapParticleToInteger*) + + +(* ::Chapter:: *) +(*Computing matrix elements*) + + +(* ::Input:: *) +(*dimension=4;*) +(*tops=CreateTopologies[0,2->2];*) +(*momenta={Momentum[p1,dimension],Momentum[p2,dimension],Momentum[p3,dimension],Momentum[p4,dimension]};*) +(*indices={{1,1},{1,2},{2,1},{2,2}};*) + + +(* ::Input:: *) +(*ClearAll[makeAmplitude]*) +(*makeAmplitude[process_,channels_:All]:=Module[{diags,ampFA,ampFC,ampSq, ampMsq,ampMsqSummed,masses,i},*) +(*(* assumes 2->2 topology *)*) +(*(* create diagrams for process *)*) +(*diags=InsertFields[tops[[channels]],process,InsertionLevel->{Particles},Model->modLoc];*) +(*(* create FeynArts amplitude from diagrams *)*) +(*ampFA[1]=CreateFeynAmp[diags,PreFactor->1,Truncated->False]; *) +(*(* converting to FeynCalc form *)*) +(*ampFC[1]=FCFAConvert[ampFA[1],*) +(*IncomingMomenta->{Momentum[p1,dimension],Momentum[p2,dimension]},*) +(*OutgoingMomenta->{Momentum[p3,dimension],Momentum[p4,dimension]},*) +(*LorentzIndexNames->{\[Mu],\[Nu],\[Rho],\[Sigma]},*) +(*ChangeDimension->dimension,*) +(*List->False,*) +(*SMP->True,*) +(*Contract->True,*) +(*DropSumOver->True,*) +(*UndoChiralSplittings->True*) +(*];*) +(*Return[ampFC[1]//Contract]*) +(*]*) + + +(* ::Input:: *) +(*ClearAll[makeAmplitudeSquared]*) +(*makeAmplitudeSquared[process_,channels_:All,simplify_:True]:=Module[{ampM,ampSq, ampMsq,masses,stu,i},*) +(*(* assumes 2->2 topology *)*) +(*masses=Join[Map[TheMass,process[[1]]],Map[TheMass,process[[2]]]];*) +(*stu=Plus@@(masses^2);*) +(*ampM[1]=makeAmplitude[process,channels];*) +(*(* making amplitude squared *)*) +(*ampSq[1]=ComplexConjugate[ampM[1]]ampM[1];*) +(*ampSq[2]=FeynAmpDenominatorExplicit[ampSq[1]];*) +(*FCClearScalarProducts[];*) +(*(* insert Mandelstam variables *)*) +(*SetMandelstam[s,t,u,p1,p2,-p3,-p4,(masses/.List->Sequence)];*) +(*ampSq[2]=FermionSpinSum[ampSq[2]]/.DiracTrace[aaa__]->DiracTrace[aaa,Mandelstam->{s,t,u,stu}];*) +(*ampSq[3]=DiracSimplify[ampSq[2]];*) +(*(* simplify *)*) +(*ampMsq[1]=Expand[TrickMandelstam[ampSq[3],{s,t,u,Plus@@(masses)}]];*) +(*FCClearScalarProducts[];*) +(*Return[ampMsq[1]]*) +(*]*) + + +(* ::Input:: *) +(*(* squared summed matrix elements with a scalar on leg 1 *)*) +(*scalar=DeleteCases[*) +(*Table[makeMName[process]->makeAmplitudeSquared[process,All,False],{process,Evaluate[makeProcesses[S[1]]]}]*) +(*,_->0];*) +(*(* setting masses to zero *)*) +(*scalar0=scalar/.Thread[Map[TheMass,particleTypes]->0]*) + + +(* ::Input:: *) +(*(* squared summed matrix elements with a top or anti-top on leg 1 *)*) +(*fermion=DeleteCases[*) +(*Join[*) +(*Table[makeMName[process]->makeAmplitudeSquared[process,All,False],{process,Evaluate[makeProcesses[F[1]]]}],*) +(*Table[makeMName[process]->makeAmplitudeSquared[process,All,False],{process,Evaluate[makeProcesses[-F[1]]]}]*) +(*]*) +(*,_->0];*) +(*(* setting masses to zero *)*) +(*fermion0=fermion/.Thread[Map[TheMass,particleTypes]->0]*) + + +(* ::Input:: *) +(*results=Flatten[{scalar0,fermion0},1];*) + + +(* ::Input:: *) +(*results//MatrixForm*) + + +(* ::Input:: *) +(*feynAssociation=Association[results];*) + + +(* ::Chapter:: *) +(*Exporting to JSON*) + + +(* ::Input:: *) +(*(* writing as JSON *)*) +(*makeJsonObject[fields_,parameters_,results_]:=Module[{fieldsJson,matrixElementsJson,toString,getRelevantParameters,replaceSpecials},(*construct an object which can then be exported to JSON*)toString[arg_]:=If[StringQ[arg],arg,ToString[arg,InputForm]];*) +(*replaceSpecials[arg_]:=StringReplace[arg,{"Pi"->"_pi","s"->"_s","t"->"_t","u"->"_u"}];*) +(*getRelevantParameters[arg_]:=Select[parameters,Not[FreeQ[arg,#]]&];*) +(*fieldsJson=Table[{"index"->i-1,"name"->toString[fields[[i]]]},{i,1,Length[fields]}];*) +(*matrixElementsJson=Map[{"externalParticles"->#[[1]]/.M[a__]->List[a],"parameters"->Map[toString,getRelevantParameters[#[[2]]]],"expression"->replaceSpecials[toString[#[[2]]]]}&,results];*) +(*Return[{"particles"->fieldsJson,"matrixElements"->matrixElementsJson}]]*) +(*(*here for the Yukawa model,where the matrix elements are stored in the object called MatrixElements*)*) +(*toExportAsJSON=makeJsonObject[particleNames,parameters,results//SMPToSymbol];*) +(*Export[FileNameJoin[{NotebookDirectory[],StringJoin[model,".json"]}],toExportAsJSON];*) diff --git a/tests/FeynCalc/yukawa/yukawa.fr b/tests/FeynCalc/yukawa/yukawa.fr new file mode 100644 index 0000000..9eb26f3 --- /dev/null +++ b/tests/FeynCalc/yukawa/yukawa.fr @@ -0,0 +1,112 @@ +(**************************** + Information +****************************) +M$ModelName = "Yukawa"; + +M$Information = { + Authors -> {"O. Gould"}, + Institutions -> {"U. Nottingham"}, + Emails -> {"oliver.gould@nottingham.ac.uk"}, + Date -> "November 19th, 2024" +}; + + +(**************************** + Indices +****************************) +(* only Lorentz *) + + +(**************************** + Particles +****************************) +M$ClassesDescription = { + + (* Real scalar *) + S[1] == { + ClassName -> Phi, + PropagatorLabel -> Phi, + PropagatorArrow -> False, + SelfConjugate -> True, + Mass -> {mPhi, Internal} + }, + + (* Dirac Fermion *) + F[1] == { + ClassName -> Psi, + PropagatorLabel -> Psi, + PropagatorArrow -> True, + SelfConjugate -> False, + Mass -> {mPsi, Internal} + } +}; + + +(**************************** + Parameters +****************************) +M$Parameters = { + + (* Scalar parameters *) + msq == { + ParameterType -> External, + ComplexParameter -> False, + Value -> msq, + Description -> "Scalar mass squared" + }, + g == { + ParameterType -> External, + ComplexParameter -> False, + Value -> g, + Description -> "Scalar cubic coupling" + }, + lam == { + ParameterType -> External, + ComplexParameter -> False, + Value -> lam, + Description -> "Scalar quartic coupling" + }, + mPhi == { + ParameterType -> External, + ComplexParameter -> False, + Value -> Sqrt[msq], + Description -> "Scalar mass" + }, + + (* Fermion parameters *) + mPsi == { + ParameterType -> External, + Value -> mPsi, + ComplexParameter -> False, + Description -> "Fermion mass term" + }, + (* Yukawa coupling *) + y == { + ParameterType -> External, + ComplexParameter -> False, + Value -> y, + Description -> "Yukawa coupling" + } +}; + + +(**************************** + Lagrangian +****************************) + +(* Scalar Lagrangian *) +LScalar := Module[{T, V}, + T = 1/2 * del[Phi, mu] * del[Phi, mu]; + V = msq/2 * Phi^2 + + g/6 * Phi^3 + lam/24 * Phi^4; + T - V +]; + +(* Fermion Lagrangian *) +LFermion := I * Psibar.Ga[mu].del[Psi, mu] - mPsi * Psibar.Psi + +(* Yukawa Lagrangian *) +LYukawa := - y * Phi * Psibar.Psi; + +(* Full Lagrangian *) +L := LScalar + LFermion + LYukawa; diff --git a/tests/qcd.test.json b/tests/qcd.test.json new file mode 100644 index 0000000..1a34f6d --- /dev/null +++ b/tests/qcd.test.json @@ -0,0 +1,205 @@ +{ + "particles":[ + { + "index":0, + "name":"Top" + }, + { + "index":1, + "name":"Gluon" + } + ], + "matrixElements":[ + { + "externalParticles":[ + 0, + 0, + 0, + 0 + ], + "parameters":[ + "gs", + "mg2" + ], + "expression":"((-16*gs^4*_u^2)\/(3*(-mg2 + _s)*(-mg2 + _t)) + (16*gs^4*(_s^2 + _t^2))\/(-mg2 + _u)^2 - (16*gs^4*_t^2)\/(3*(-mg2 + _s)*(-mg2 + _u)) - (16*gs^4*_s^2)\/(3*(-mg2 + _t)*(-mg2 + _u)) + (16*gs^4*(_s^2 + _u^2))\/(-mg2 + _t)^2 + (16*gs^4*(_t^2 + _u^2))\/(-mg2 + _s)^2)\/3" + }, + { + "externalParticles":[ + 0, + 0, + 2, + 2 + ], + "parameters":[ + "gs", + "mg2" + ], + "expression":"(80*gs^4*(_t^2 + _u^2))\/(3*(-mg2 + _s)^2)" + }, + { + "externalParticles":[ + 0, + 2, + 0, + 2 + ], + "parameters":[ + "gs", + "mg2" + ], + "expression":"(80*gs^4*(_s^2 + _u^2))\/(3*(-mg2 + _t)^2)" + }, + { + "externalParticles":[ + 0, + 2, + 2, + 0 + ], + "parameters":[ + "gs", + "mg2" + ], + "expression":"(80*gs^4*(_s^2 + _t^2))\/(3*(-mg2 + _u)^2)" + }, + { + "externalParticles":[ + 0, + 1, + 0, + 1 + ], + "parameters":[ + "gs", + "mg2", + "mq2" + ], + "expression":"((256*gs^4*_s^2)\/(3*(-mg2 + _t)^2) - (128*gs^4*_s*_u)\/(3*(-mq2 + _s)^2) + (256*gs^4*_u^2)\/(3*(-mg2 + _t)^2) - (128*gs^4*_s*_u)\/(3*(-mq2 + _u)^2) + (32*gs^4*(_s^2 + _u^2))\/(3*(-mg2 + _t)^2))\/6" + }, + { + "externalParticles":[ + 0, + 1, + 1, + 0 + ], + "parameters":[ + "gs", + "mg2", + "mq2" + ], + "expression":"((-128*gs^4*_s*_t)\/(3*(-mq2 + _s)^2) - (128*gs^4*_s*_t)\/(3*(-mq2 + _t)^2) + (256*gs^4*_s^2)\/(3*(-mg2 + _u)^2) + (256*gs^4*_t^2)\/(3*(-mg2 + _u)^2) + (32*gs^4*(_s^2 + _t^2))\/(3*(-mg2 + _u)^2))\/6" + }, + { + "externalParticles":[ + 1, + 0, + 0, + 1 + ], + "parameters":[ + "gs", + "mg2", + "mq2" + ], + "expression":"((-128*gs^4*_s*_t)\/(3*(-mq2 + _s)^2) - (128*gs^4*_s*_t)\/(3*(-mq2 + _t)^2) + (256*gs^4*_s^2)\/(3*(-mg2 + _u)^2) + (256*gs^4*_t^2)\/(3*(-mg2 + _u)^2) + (32*gs^4*(_s^2 + _t^2))\/(3*(-mg2 + _u)^2))\/8" + }, + { + "externalParticles":[ + 1, + 0, + 1, + 0 + ], + "parameters":[ + "gs", + "mg2", + "mq2" + ], + "expression":"((256*gs^4*_s^2)\/(3*(-mg2 + _t)^2) - (128*gs^4*_s*_u)\/(3*(-mq2 + _s)^2) + (256*gs^4*_u^2)\/(3*(-mg2 + _t)^2) - (128*gs^4*_s*_u)\/(3*(-mq2 + _u)^2) + (32*gs^4*(_s^2 + _u^2))\/(3*(-mg2 + _t)^2))\/8" + }, + { + "externalParticles":[ + 1, + 2, + 1, + 2 + ], + "parameters":[ + "gs", + "mg2", + "mq2" + ], + "expression":"((1280*gs^4*_s^2)\/(3*(-mg2 + _t)^2) - (640*gs^4*_s*_u)\/(3*(-mq2 + _s)^2) + (1280*gs^4*_u^2)\/(3*(-mg2 + _t)^2) - (640*gs^4*_s*_u)\/(3*(-mq2 + _u)^2) + (160*gs^4*(_s^2 + _u^2))\/(3*(-mg2 + _t)^2))\/8" + }, + { + "externalParticles":[ + 1, + 2, + 2, + 1 + ], + "parameters":[ + "gs", + "mg2", + "mq2" + ], + "expression":"((-640*gs^4*_s*_t)\/(3*(-mq2 + _s)^2) - (640*gs^4*_s*_t)\/(3*(-mq2 + _t)^2) + (1280*gs^4*_s^2)\/(3*(-mg2 + _u)^2) + (1280*gs^4*_t^2)\/(3*(-mg2 + _u)^2) + (160*gs^4*(_s^2 + _t^2))\/(3*(-mg2 + _u)^2))\/8" + }, + { + "externalParticles":[ + 0, + 0, + 1, + 1 + ], + "parameters":[ + "gs", + "mg2", + "mq2" + ], + "expression":"((-256*gs^4*_t^2)\/(3*(-mg2 + _s)^2) + (128*gs^4*_t*_u)\/(3*(-mq2 + _t)^2) - (256*gs^4*_u^2)\/(3*(-mg2 + _s)^2) + (128*gs^4*_t*_u)\/(3*(-mq2 + _u)^2) - (32*gs^4*(_t^2 + _u^2))\/(3*(-mg2 + _s)^2))\/6" + }, + { + "externalParticles":[ + 1, + 1, + 0, + 0 + ], + "parameters":[ + "gs", + "mg2", + "mq2" + ], + "expression":"((-256*gs^4*_t^2)\/(3*(-mg2 + _s)^2) + (128*gs^4*_t*_u)\/(3*(-mq2 + _t)^2) - (256*gs^4*_u^2)\/(3*(-mg2 + _s)^2) + (128*gs^4*_t*_u)\/(3*(-mq2 + _u)^2) - (32*gs^4*(_t^2 + _u^2))\/(3*(-mg2 + _s)^2))\/8" + }, + { + "externalParticles":[ + 1, + 1, + 2, + 2 + ], + "parameters":[ + "gs", + "mg2", + "mq2" + ], + "expression":"((-1280*gs^4*_t^2)\/(3*(-mg2 + _s)^2) + (640*gs^4*_t*_u)\/(3*(-mq2 + _t)^2) - (1280*gs^4*_u^2)\/(3*(-mg2 + _s)^2) + (640*gs^4*_t*_u)\/(3*(-mq2 + _u)^2) - (160*gs^4*(_t^2 + _u^2))\/(3*(-mg2 + _s)^2))\/8" + }, + { + "externalParticles":[ + 1, + 1, + 1, + 1 + ], + "parameters":[ + "gs", + "mg2" + ], + "expression":"(2592*gs^4 + (288*gs^4*(_s - _u)^2)\/(-mg2 + _t)^2 + (288*gs^4*(_s - _t)^2)\/(-mg2 + _u)^2 + (288*gs^4*(-_t + _u)^2)\/(-mg2 + _s)^2)\/16" + } + ] +} \ No newline at end of file diff --git a/tests/qcd.test.m b/tests/qcd.test.m new file mode 100644 index 0000000..8c93a93 --- /dev/null +++ b/tests/qcd.test.m @@ -0,0 +1,227 @@ +(* ::Package:: *) + +(*Quit[];*) + + +(* Check Mathematica version *) +If[$VersionNumber < 13.3, + Print["The Mathematica testing framework requires Mathematica version ", requiredVersion," or higher. You are using version ", currentVersion, "."]; + Abort[] +]; + +SetDirectory[NotebookDirectory[]]; +(*Put this if you want to create multiple model-files with the same kernel*) +$GroupMathMultipleModels=True; +$LoadGroupMath=True; +<<../src/WallgoMatrix.m + + +(* ::Chapter:: *) +(*QCD*) + + +(* ::Section:: *) +(*Model*) + + +Group={"SU3"}; +RepAdjoint={{1,1}}; +RepScalar={}; +CouplingName={gs}; + + +Rep1={{{1,0}},"L"}; +Rep2={{{1,0}},"R"}; +RepFermion1Gen={Rep1,Rep2}; + + +RepFermion3Gen={RepFermion1Gen,RepFermion1Gen,RepFermion1Gen,RepFermion1Gen,RepFermion1Gen,RepFermion1Gen}//Flatten[#,1]&; + + +(* ::Text:: *) +(*The input for the gauge interactions toDRalgo are then given by*) + + +{gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC}=AllocateTensors[Group,RepAdjoint,CouplingName,RepFermion3Gen,RepScalar]; + + +ImportModel[Group,gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC,Verbose->False]; + + +(* ::Section:: *) +(*User Input*) + + +(* +In DRalgo fermions are Weyl. +So to create one Dirac we need +one left-handed and +one right-handed fermion +*) + + +(*Below +rep 1-6 are quarks, +rep 7 is a gluon +*) +Rep1=CreateParticle[{1,2},"F"]; +RepGluon=CreateParticle[{1},"V"]; + + +ParticleList={Rep1,RepGluon}; + + +(*Defining various masses and couplings*) + + +VectorMass=Table[mg2,{i,1,Length[gvff]}]; +FermionMass=Table[mq2,{i,1,Length[gvff[[1]]]}]; +ScalarMass={}; +ParticleMasses={VectorMass,FermionMass,ScalarMass}; +(* +up to the user to make sure that the same order is given in the python code +*) +UserMasses={mq2,mg2}; +UserCouplings={gs}; + + +(* + output of matrix elements +*) +OutputFile="matrixElements.qcd"; +SetDirectory[NotebookDirectory[]]; +ParticleName={"Top","Gluon"}; +MatrixElements=ExportMatrixElements[ + OutputFile, + ParticleList, + UserMasses, + UserCouplings, + ParticleName, + ParticleMasses, + {TruncateAtLeadingLog->False,Format->{"json","txt"}}]; + + +MatrixElements + + +(* ::Section:: *) +(*Tests*) + + +symmetriseTU[arg_]:=1/2 (arg)+1/2 (arg/.{t->tt}/.{u->t, tt->u}) +fixConvention[arg_]:=symmetriseTU[arg/.{s->(-t-u)}]//Expand//Simplify//Expand +removeMissing[arg_]:=arg/.M[__]->0/.Missing["KeyAbsent", _]->0 + + +(* ::Subsection:: *) +(*Test with [hep-ph/0209353]*) + + +testList={}; +replaceSU3={Nf->3,CA->3,CF->4/3,dF->3,dA->8}; + + +(*5 light quarks*) +AppendTo[testList, +TestCreate[ + 1/2*(M[0,2,0,2]+M[0,2,2,0])/.MatrixElements/.{gs->1}//fixConvention//removeMissing, + 5/(2*CA)*(8*dF^2*CF^2/dA((s^2+u^2)/(t-mg2)^2))+5/(2*CA)*(8*dF^2*CF^2/dA((s^2+t^2)/(u-mg2)^2))/.replaceSU3//fixConvention//removeMissing +]]; + + +(*tt->gg*) +AppendTo[testList, +TestCreate[ + 1/2*(M[0,0,1,1])/.MatrixElements/.{gs->1}//fixConvention//removeMissing, + 1/(2*2*CA)*(8*dF*CF^2((t*u)/(-t+mq2)^2+(t*u)/(-u+mq2)^2)-8*dF*CF*CA((t^2+u^2)/(-s+mg2)^2))/.replaceSU3//fixConvention//removeMissing +]]; + + +(*q1 g->q1 g*) +AppendTo[testList, +TestCreate[ + 1/2*(M[0,1,0,1]+M[0,1,1,0])/.MatrixElements/.{gs->1}//fixConvention//removeMissing, + 1/(2*CA)*(-8*dF*CF^2((s*u)/(-s+mq2)^2 +s*u/(-u+mq2)^2)+8*dF*CF*CA((s^2+u^2)/(t-mg2)^2))/.replaceSU3//fixConvention//removeMissing +]]; + + +(*tt->tt*) +AppendTo[testList, +TestCreate[ + 1/2*(M[0,0,0,0])/.MatrixElements/.{gs->1}/.Thread[UserMasses->0]//fixConvention//removeMissing, + 1/(2*CA)/2( + +8*dF^2*CF^2/dA((s^2+u^2)/(-t+mg2)^2+(s^2+t^2)/(-u+mg2)^2)+16*dF*CF(CF-CA/2)(s^2/(t*u)) + +2*(8*dF^2*CF^2/dA((s^2+u^2)/(-t+mg2)^2+(u^2+t^2)/s^2)+16*dF*CF(CF-CA/2)(u^2/(t*s))) + )/.replaceSU3/.Thread[UserMasses->0]//fixConvention//removeMissing +]]; + + +(*g g->g g*) +AppendTo[testList, +TestCreate[ + 1/2*(M[1,1,1,1])/.MatrixElements/.{gs->1}/.Thread[UserMasses->0]//fixConvention//removeMissing, + 1/(2*2(CA^2-1))(16*dA*CA^2(3-s*u/(t-mg2)^2-s*t/(u-mg2)^2-t*u/s^2))/.replaceSU3/.Thread[UserMasses->0]//fixConvention//removeMissing +]]; + + +report=TestReport[testList] +report["ResultsDataset"] + + +(* ::Subsection:: *) +(*Test hard*) + + +file=FileNameJoin[{NotebookDirectory[],"qcd.test.json"}]; +{particleNames,parameters,FeynMatrixElements}=ImportMatrixElements[file]; + + +testList={}; + + +(*5 light quarks*) +AppendTo[testList, +TestCreate[ + 1/2*(M[0,2,0,2]+M[0,2,2,0])/.MatrixElements//fixConvention//removeMissing, + 1/2*(M[0,2,0,2]+M[0,2,2,0])/.FeynMatrixElements//fixConvention//removeMissing +]]; + + +(*tt->gg*) +AppendTo[testList, +TestCreate[ + 1/2*(M[0,0,1,1])/.MatrixElements//fixConvention//removeMissing, + 1/2*(M[0,0,1,1])/.FeynMatrixElements//fixConvention//removeMissing +]]; + + +(*q1 g->q1 g*) +AppendTo[testList, +TestCreate[ + 1/2*(M[0,1,0,1]+M[0,1,1,0])/.MatrixElements//fixConvention//removeMissing, + 1/2*(M[0,1,0,1]+M[0,1,1,0])/.FeynMatrixElements//fixConvention//removeMissing +]]; + + +(*tt->tt*) +AppendTo[testList, +TestCreate[ + 1/2*(M[0,0,0,0])/.MatrixElements//fixConvention//removeMissing, + 1/2*(M[0,0,0,0])/.FeynMatrixElements//fixConvention//removeMissing +]]; + + +(*g g->g g*) +AppendTo[testList, +TestCreate[ + 1/2*(M[1,1,1,1])/.MatrixElements//fixConvention//removeMissing, + 1/2*(M[1,1,1,1])/.FeynMatrixElements//fixConvention//removeMissing +]]; + + +report=TestReport[testList] +report["ResultsDataset"] + + + + diff --git a/tests/u1higgs.test.json b/tests/u1higgs.test.json new file mode 100644 index 0000000..62434b7 --- /dev/null +++ b/tests/u1higgs.test.json @@ -0,0 +1,238 @@ +{ + "matrixElements":[ + { + "externalParticles":[ + 0, + 0, + 0, + 0 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"((2*_s^2)/(_t*_u)+_s^2/_t^2+_s^2/_u^2-(2*_u*_s)/_t^2-(2*_s)/_t-(2*_s)/_u-(2*_t*_s)/_u^2+_u^2/_t^2+_t^2/_u^2+2)*e^4+lam*(-((8*_s)/_t)-(8*_s)/_u+(8*_u)/_t+(8*_t)/_u)*e^2+16*lam^2" + }, + { + "externalParticles":[ + 0, + 1, + 0, + 1 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"(_s^2/_t^2-(2*_u*_s)/_t^2+_u^2/_t^2-(2*_u)/_t+2+(2*_u^2)/(_t*_s)-(2*_u)/_s+_t^2/_s^2+_u^2/_s^2-(2*_t*_u)/_s^2)*e^4+lam*((8*_s)/_t-(8*_u)/_t+(8*_t)/_s-(8*_u)/_s)*e^2+16*lam^2" + }, + { + "externalParticles":[ + 0, + 1, + 1, + 0 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"(_s^2/_u^2-(2*_t*_s)/_u^2-(2*_t)/_u+_t^2/_u^2+2-(2*_t)/_s+(2*_t^2)/(_u*_s)+_t^2/_s^2+_u^2/_s^2-(2*_t*_u)/_s^2)*e^4+lam*((8*_s)/_u-(8*_t)/_u-(8*_t)/_s+(8*_u)/_s)*e^2+16*lam^2" + }, + { + "externalParticles":[ + 0, + 1, + 2, + 2 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"e^4*(_s^2/(2*_t*_u)+_s/_t+_s/_u+_u/(2*_t)+_t/(2*_u)+9)" + }, + { + "externalParticles":[ + 0, + 2, + 0, + 2 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"e^4*(_t^2/(2*_s*_u)+_t/_s+_t/_u+_u/(2*_s)+_s/(2*_u)+9)" + }, + { + "externalParticles":[ + 0, + 2, + 2, + 0 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"e^4*(_u^2/(2*_s*_t)+_u/_s+_u/_t+_t/(2*_s)+_s/(2*_t)+9)" + }, + { + "externalParticles":[ + 1, + 0, + 0, + 1 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"(_s^2/_u^2-(2*_t*_s)/_u^2-(2*_t)/_u+_t^2/_u^2+2-(2*_t)/_s+(2*_t^2)/(_u*_s)+_t^2/_s^2+_u^2/_s^2-(2*_t*_u)/_s^2)*e^4+lam*((8*_s)/_u-(8*_t)/_u-(8*_t)/_s+(8*_u)/_s)*e^2+16*lam^2" + }, + { + "externalParticles":[ + 1, + 0, + 1, + 0 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"(_s^2/_t^2-(2*_u*_s)/_t^2+_u^2/_t^2-(2*_u)/_t+2+(2*_u^2)/(_t*_s)-(2*_u)/_s+_t^2/_s^2+_u^2/_s^2-(2*_t*_u)/_s^2)*e^4+lam*((8*_s)/_t-(8*_u)/_t+(8*_t)/_s-(8*_u)/_s)*e^2+16*lam^2" + }, + { + "externalParticles":[ + 1, + 0, + 2, + 2 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"e^4*(_s^2/(2*_t*_u)+_s/_t+_s/_u+_u/(2*_t)+_t/(2*_u)+9)" + }, + { + "externalParticles":[ + 1, + 1, + 1, + 1 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"((2*_s^2)/(_t*_u)+_s^2/_t^2+_s^2/_u^2-(2*_u*_s)/_t^2-(2*_s)/_t-(2*_s)/_u-(2*_t*_s)/_u^2+_u^2/_t^2+_t^2/_u^2+2)*e^4+lam*(-((8*_s)/_t)-(8*_s)/_u+(8*_u)/_t+(8*_t)/_u)*e^2+16*lam^2" + }, + { + "externalParticles":[ + 1, + 2, + 1, + 2 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"e^4*(_t^2/(2*_s*_u)+_t/_s+_t/_u+_u/(2*_s)+_s/(2*_u)+9)" + }, + { + "externalParticles":[ + 1, + 2, + 2, + 1 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"e^4*(_u^2/(2*_s*_t)+_u/_s+_u/_t+_t/(2*_s)+_s/(2*_t)+9)" + }, + { + "externalParticles":[ + 2, + 0, + 0, + 2 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"e^4*((4*_u^2)/(_s*_t)+(4*_u)/_s+(4*_u)/_t+8)" + }, + { + "externalParticles":[ + 2, + 0, + 2, + 0 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"e^4*((4*_t^2)/(_s*_u)+(4*_t)/_s+(4*_t)/_u+8)" + }, + { + "externalParticles":[ + 2, + 1, + 1, + 2 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"e^4*((4*_u^2)/(_s*_t)+(4*_u)/_s+(4*_u)/_t+8)" + }, + { + "externalParticles":[ + 2, + 1, + 2, + 1 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"e^4*((4*_t^2)/(_s*_u)+(4*_t)/_s+(4*_t)/_u+8)" + }, + { + "externalParticles":[ + 2, + 2, + 0, + 1 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"e^4*((4*_s^2)/(_t*_u)+(4*_s)/_t+(4*_s)/_u+8)" + }, + { + "externalParticles":[ + 2, + 2, + 1, + 0 + ], + "parameters":[ + "e", + "lam" + ], + "expression":"e^4*((4*_s^2)/(_t*_u)+(4*_s)/_t+(4*_s)/_u+8)" + } + ] +} \ No newline at end of file diff --git a/tests/u1higgs.test.m b/tests/u1higgs.test.m new file mode 100644 index 0000000..db750b4 --- /dev/null +++ b/tests/u1higgs.test.m @@ -0,0 +1,213 @@ +(* ::Package:: *) + +Quit[]; + + +(* Check Mathematica version *) +If[$VersionNumber < 13.3, + Print["The Mathematica testing framework requires Mathematica version ", requiredVersion," or higher. You are using version ", currentVersion, "."]; + Abort[] +]; + +SetDirectory[NotebookDirectory[]]; +(*Put this if you want to create multiple model-files with the same kernel*) +$GroupMathMultipleModels=True; +$LoadGroupMath=True; +<<../src/WallGoMatrix.m + + +(* ::Chapter:: *) +(*Abelian Higgs*) + + +(* ::Section:: *) +(*Model*) + + +Group={"U1"}; +CouplingName={g1}; +RepAdjoint={0}; +Higgs={{1},"C"}; (* Y\[Phi] = 1 *) +RepScalar={Higgs}; + + +RepFermion={}; + + +(* ::Text:: *) +(*The first element is the vector self-interaction matrix:*) + + +{gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC}=AllocateTensors[Group,RepAdjoint,CouplingName,RepFermion,RepScalar]; + + +InputInv={{1,1},{True,False}}; (*This specifies that we want a \[Phi]^+\[Phi] term*) +MassTerm1=CreateInvariant[Group,RepScalar,InputInv]//Simplify//FullSimplify; + + +VMass=msq*MassTerm1[[1]];(*This is the \[Phi]^+\[Phi] term written in component form*) + + +\[Mu]ij=GradMass[VMass]//Simplify//SparseArray; + + +QuarticTerm1=MassTerm1[[1]]^2; (*Because MassTerm1=\[Phi]^+\[Phi], we can write (\[Phi]^+\[Phi])^2=MassTerm1^2*) + + +VQuartic=\[Lambda]*QuarticTerm1; + + +\[Lambda]4=GradQuartic[VQuartic]; + + +ImportModel[Group,gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC,Verbose->False]; + + +(* ::Section:: *) +(*User Input*) + + +(* ::Subsection:: *) +(*SymmetryBreaking*) + + +(*vev={v,0}; +SymmetryBreaking[vev]*) + + +(* ::Subsection:: *) +(*UserInput*) + + +(* vector *) +RepVector=CreateParticle[{1},"V"]; + +(* fermion *) +RepFermion={}; + +(* scalar *) +RepScalar=CreateParticle[{1},"S"]; + + + +(* +These particles do not necessarily have to be out of equilibrium +the remainin particle content is set as light +*) +ParticleList={RepScalar,RepVector}; + + +(*Defining various masses and couplings*) + + +VectorMass=Table[mv,{i,1,Length[RepVector[[1]]]}]; +FermionMass={}; +ScalarMass=Table[ms,{i,1,Length[RepScalar[[1]]]}]; +ParticleMasses={VectorMass,FermionMass,ScalarMass}; +(* +up to the user to make sure that the same order is given in the python code +*) +UserMasses={ms,ms,mv}; +UserCouplings={CouplingName,\[Lambda]}//Flatten; + + +(* + output of matrix elements +*) +SetDirectory[NotebookDirectory[]]; +OutputFile="matrixElements.ah"; +ParticleName={"Phi","Vector"}; +MatrixElements=ExportMatrixElements[ + OutputFile, + ParticleList, + UserMasses, + UserCouplings, + ParticleName, + ParticleMasses, + {TruncateAtLeadingLog->False,Format->{"json","txt"}}]; + + +MatrixElements + + +(* ::Section:: *) +(*Tests*) + + +file=FileNameJoin[{NotebookDirectory[],"u1higgs.test.json"}]; +{particleNames,parameters,FeynMatrixElements}=ImportMatrixElements[file]; + + +insertCouplings={g1->e,\[Lambda]->lam}; + + +symmetriseTU[arg_]:=1/2 (arg)+1/2 (arg/.{t->tt}/.{u->t, tt->u}) + + +fixConvention[arg_]:=symmetriseTU[arg/.Thread[UserMasses->0]/.{s->(-t-u)}/.insertCouplings]//Expand//Simplify//Expand + + +removeMissing[arg_]:=arg/.M[__]->0/.Missing["KeyAbsent", _]->0 + + +(* ::Subsection:: *) +(*Test hard*) + + +testList={}; + + +(* scalar-scalar scattering*) +AppendTo[testList, +TestCreate[ + M[0,0,0,0]/.MatrixElements//fixConvention//removeMissing//Simplify, + 1/2 Sum[M[a,b,c,d],{a,0,1},{b,0,1},{c,0,1},{d,0,1}]/.FeynMatrixElements//fixConvention//removeMissing//Simplify(* explicit 1/2 is due to average over leg 1 *) +]]; + + +(* scalar to vector *) +AppendTo[testList, +TestCreate[ + M[0,0,1,1]/.MatrixElements//fixConvention//removeMissing, + 1/2 Sum[M[a,b,2,2],{a,0,1},{b,0,1}]/.FeynMatrixElements//fixConvention//removeMissing(* explicit 1/2 is due to average over leg 1 *) +]]; + + +(* vector to scalar *) +AppendTo[testList, +TestCreate[ + M[1,1,0,0]/.MatrixElements//fixConvention//removeMissing, + 1/2 Sum[M[2,2,a,b],{a,0,1},{b,0,1}]/.FeynMatrixElements//fixConvention//removeMissing (* explicit 1/2 is due to average over leg 1 *) +]]; + + +(* scalar-vector scattering *) +AppendTo[testList, +TestCreate[ + M[0,1,1,0]+M[0,1,0,1]/.MatrixElements//fixConvention//removeMissing, + 1/2 Sum[M[a,2,2,b]+M[a,2,b,2],{a,0,1},{b,0,1}]/.FeynMatrixElements//fixConvention//removeMissing(* explicit 1/2 is due to average over leg 1 *) +]]; + + +(* vector-scalar scattering *) +AppendTo[testList, +TestCreate[ + M[1,0,1,0]+M[1,0,0,1]/.MatrixElements//fixConvention//removeMissing, + 1/2 Sum[M[2,a,2,b]+M[2,a,b,2],{a,0,1},{b,0,1}]/.FeynMatrixElements//fixConvention//removeMissing (* explicit 1/2 is due to average over leg 1 *) +]]; + + +(* vector-vector scattering*) +AppendTo[testList, +TestCreate[ + M[1,1,1,1]/.MatrixElements//fixConvention//removeMissing, + 1/2 M[2,2,2,2]/.FeynMatrixElements//fixConvention//removeMissing (* explicit 1/2 is due to average over leg 1 *) +]]; + + +report=TestReport[testList] +report["ResultsDataset"] + + + + diff --git a/tests/u1higgs_yukawa.test.m b/tests/u1higgs_yukawa.test.m new file mode 100644 index 0000000..25f3537 --- /dev/null +++ b/tests/u1higgs_yukawa.test.m @@ -0,0 +1,321 @@ +(* ::Package:: *) + +Quit[]; + + +(* Check Mathematica version *) +If[$VersionNumber < 13.3, + Print["The Mathematica testing framework requires Mathematica version ", requiredVersion," or higher. You are using version ", currentVersion, "."]; + Abort[] +]; + +SetDirectory[NotebookDirectory[]]; +(*Put this if you want to create multiple model-files with the same kernel*) +$GroupMathMultipleModels=True; +$LoadGroupMath=True; +<<../src/WallGoMatrix.m + + +(* ::Chapter:: *) +(*Abelian-Higgs-Yukawa Model*) + + +(* ::Section::Closed:: *) +(*Model*) + + +Group={"U1"}; +RepAdjoint={0}; +RepScalar={{{1},"C"}, {{0},"R"}}; +CouplingName={g1}; + + +RepFermion={{{1},"L"},{{1},"R"},{{2},"L"},{{2},"R"}}; + + +(* ::Text:: *) +(*The input for the gauge interactions toDRalgo are then given by*) + + +{gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJC,\[Mu]IJ,Ysff,YsffC}=AllocateTensors[Group,RepAdjoint,CouplingName,RepFermion,RepScalar]; + + +(* all cubic scalar terms *) +(* 1/3 b3 \[Chi]^3 *) +InputInv={{2,2,2},{True,True,True}}; +Chi3=CreateInvariant[Group,RepScalar,InputInv][[1]]; +VCubic=b3/3 CubicTerm; +(* a1/2 \[Chi] \[Phi]^2 *) +InputInv={{2,1,1},{True,True,False}}; +ChiPhi2=CreateInvariant[Group,RepScalar,InputInv][[1]]; +(* cubic terms together *) +VCubic=b3/3 Chi3 + a1/2 ChiPhi2; +\[Lambda]3=GradCubic[VCubic]; + + +(* all quartic scalar terms *) +(* lam \[Phi]^4 *) +InputInv={{1,1,1,1},{True,False,True,False}}; +Phi4=CreateInvariant[Group,RepScalar,InputInv][[1]]; +(* 1/4 b4 \[Chi]^4 *) +InputInv={{2,2,2,2},{True,True,True,True}}; +Chi4=CreateInvariant[Group,RepScalar,InputInv][[1]]; +(* a2/2 \[Chi]^2 \[Phi]^2 *) +InputInv={{1,1,2,2},{True,False,True,True}}; +Phi2Chi2=CreateInvariant[Group,RepScalar,InputInv][[1]]; +(* quartic terms together *) +VQuartic=b4/4 Chi4 + lam Phi4 + a2/2 Phi2Chi2; +\[Lambda]4=GradQuartic[VQuartic]; + + +(* y \[Phi]^*(Subscript[\[Psi], L]Subscript[\[Xi], R]^++Subscript[\[Psi], R]Subscript[\[Xi], L]^+)*) +InputInv={{1,1,4},{True,True,False}}; +Yukawa1=CreateInvariantYukawa[Group,RepScalar,RepFermion,InputInv][[1]]//Simplify; +InputInv={{1,2,3},{False,False,True}}; +Yukawa2=CreateInvariantYukawa[Group,RepScalar,RepFermion,InputInv][[1]]//Simplify; +InputInv={{1,1,4},{False,True,False}}; +Yukawa1HC=CreateInvariantYukawa[Group,RepScalar,RepFermion,InputInv][[1]]//Simplify; +InputInv={{1,2,3},{True,False,True}}; +Yukawa2HC=CreateInvariantYukawa[Group,RepScalar,RepFermion,InputInv][[1]]//Simplify; + + +Ysff=y*GradYukawa[Yukawa1+Yukawa2]; +YsffC=y*GradYukawa[Yukawa1HC+Yukawa2HC]; + + +ImportModel[Group,gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC,Verbose->False]; + + +(* ::Section:: *) +(*User Input*) + + +(* ::Subsection:: *) +(*UserInput*) + + +(* +In DRalgo fermions are Weyl. +So to create one Dirac we need +one left-handed and +one right-handed fermion +*) + + +vev={v,0,0}; +SymmetryBreaking[vev] + + +(*Below +rep 1-2 are fermions, +(*rep 3 is a scalar*) +*) +(* scalar *) +RepPhi=CreateParticle[{1},"S"]; +RepChi=CreateParticle[{2},"S"]; + +(* left-handed fermion *) +RepPsi=CreateParticle[{1,2},"F"]; +RepXi=CreateParticle[{3,4},"F"]; + +(*Vector bosons*) +RepA=CreateParticle[{1},"V"]; + + +(* +These particles do not necessarily have to be out of equilibrium +the remainin particle content is set as light +*) +ParticleList={RepPhi,RepChi,RepPsi,RepXi,RepA}; + + +(*Defining various masses and couplings*) + + +VectorMass=Table[mv,{i,1,RepA[[1]]//Length}]; +FermionMass=Table[mf,{i,1,Length[gvff[[1]]]}]; +ScalarMass=Table[ms,{i,1,Length[gvss[[1]]]}]; +ParticleMasses={VectorMass,FermionMass,ScalarMass} +(* +up to the user to make sure that the same order is given in the python code +*) +UserMasses={mv,mf,ms}; +UserCouplings={g1,b3,b4,a1,a2,lam,y}//Flatten; + + +(* + output of matrix elements +*) +OutputFile="matrixElements.u1_higgs_yukawa"; +SetDirectory[NotebookDirectory[]]; +ParticleName={"Phi","Chi","Psi","Xi","A"}; +MatrixElements=ExportMatrixElements[ + OutputFile, + ParticleList, + UserMasses, + UserCouplings, + ParticleName, + ParticleMasses, + {TruncateAtLeadingLog->False, + NormalizeWithDOF->False,Format->{"json","txt"}}]; + + +MatrixElements + + +(* ::Section:: *) +(*Tests*) + + +FeynMatrixElements={M[0, 0, 0, 0] -> 16*lam^2 + (a1^4*(t + u)^2)/(16*t^2*u^2) + (8*g^2*lam*(t^2 + u^2 - s*(t + u)))/(t*u) + (g^4*(t^2 + u^2 - s*(t + u))^2)/(t^2*u^2) + + a1^2*(2*lam*(t^(-1) + u^(-1)) + (g^2*(t + u)*(t^2 + u^2 - s*(t + u)))/(2*t^2*u^2)), M[0, 1, 0, 1] -> 16*lam^2 + (a1^4*(s + t)^2)/(16*s^2*t^2) + (8*g^2*lam*(s^2 + t*(t - u) - s*u))/(s*t) + + (g^4*(s^2 + t*(t - u) - s*u)^2)/(s^2*t^2) + a1^2*(2*lam*(s^(-1) + t^(-1)) + (g^2*(s + t)*(s^2 + t*(t - u) - s*u))/(2*s^2*t^2)), + M[0, 1, 1, 0] -> 16*lam^2 + (a1^4*(s + u)^2)/(16*s^2*u^2) + (8*g^2*lam*(s^2 - s*t + u*(-t + u)))/(s*u) + (g^4*(s^2 - s*t + u*(-t + u))^2)/(s^2*u^2) + + a1^2*(2*lam*(s^(-1) + u^(-1)) + (g^2*(s + u)*(s^2 - s*t + u*(-t + u)))/(2*s^2*u^2)), M[0, 1, 2, 2] -> a2^2 + (2*a1*a2*b3)/s + (a1^3*b3*(t + u))/(2*s*t*u) + (a1^4*(t + u)^2)/(16*t^2*u^2) + + a1^2*(b3^2/s^2 + (a2*(t + u))/(2*t*u)), M[0, 1, 2, 7] -> (a1^2*g^2*(s + t - 3*u)*(t + u))/(4*t*u^2), M[0, 1, 3, 4] -> (8*g^4*t*u)/s^2 - (8*g^2*t*y^2)/s + (2*t*y^4)/u, + M[0, 1, 4, 3] -> (8*g^4*t*u)/s^2 - (8*g^2*u*y^2)/s + (2*u*y^4)/t, M[0, 1, 5, 6] -> (32*g^4*t*u)/s^2 + (16*g^2*u*y^2)/s + (2*u*y^4)/t, M[0, 1, 6, 5] -> (32*g^4*t*u)/s^2 + (16*g^2*t*y^2)/s + (2*t*y^4)/u, + M[0, 1, 7, 2] -> (a1^2*g^2*(s - 3*t + u)*(t + u))/(4*t^2*u), M[0, 1, 7, 7] -> (g^4*(s^2 + t^2 + 18*t*u + u^2 + 2*s*(t + u)))/(2*t*u), + M[0, 2, 0, 2] -> a2^2 + (2*a1*a2*b3)/t + (a1^3*b3*(s + u))/(2*s*t*u) + (a1^4*(s + u)^2)/(16*s^2*u^2) + a1^2*(b3^2/t^2 + (a2*(s + u))/(2*s*u)), M[0, 2, 0, 7] -> (a1^2*g^2*(s + t - 3*u)*(s + u))/(4*s*u^2), + M[0, 2, 2, 0] -> a2^2 + (a1^4*(s + t)^2)/(16*s^2*t^2) + a1^2*((a2*(s + t))/(2*s*t) + b3^2/u^2) + (2*a1*a2*b3)/u + (a1^3*b3*(s + t))/(2*s*t*u), M[0, 2, 4, 5] -> (a1^2*y^2)/(2*s), M[0, 2, 5, 4] -> (a1^2*y^2)/(2*s), + M[0, 2, 7, 0] -> (a1^2*g^2*(s + t)*(s - 3*t + u))/(4*s*t^2), M[0, 3, 0, 3] -> (-8*g^4*s*u)/t^2 + (8*g^2*u*y^2)/t - (2*u*y^4)/s, M[0, 3, 2, 5] -> -1/2*(a1^2*y^2)/t, + M[0, 3, 3, 0] -> (-8*g^4*s*t)/u^2 + (8*g^2*t*y^2)/u - (2*t*y^4)/s, M[0, 3, 5, 2] -> -1/2*(a1^2*y^2)/u, M[0, 3, 5, 7] -> (-4*g^2*(t^3 + 2*s^2*u + 8*t^2*u + 5*t*u^2 + 2*u^3 + s*(t^2 + 8*t*u + 3*u^2))*y^2)/(s*t*u), + M[0, 3, 7, 5] -> (-4*g^2*(2*s^2*t + 2*t^3 + 5*t^2*u + 8*t*u^2 + u^3 + s*(3*t^2 + 8*t*u + u^2))*y^2)/(s*t*u), M[0, 4, 0, 4] -> (-8*g^4*s*u)/t^2 + (8*g^2*s*y^2)/t - (2*s*y^4)/u, + M[0, 4, 4, 0] -> (-8*g^4*s*t)/u^2 + (8*g^2*s*y^2)/u - (2*s*y^4)/t, M[0, 5, 0, 5] -> (-32*g^4*s*u)/t^2 - (16*g^2*s*y^2)/t - (2*s*y^4)/u, M[0, 5, 5, 0] -> (-32*g^4*s*t)/u^2 - (16*g^2*s*y^2)/u - (2*s*y^4)/t, + M[0, 6, 0, 6] -> (-32*g^4*s*u)/t^2 - (16*g^2*u*y^2)/t - (2*u*y^4)/s, M[0, 6, 2, 4] -> -1/2*(a1^2*y^2)/t, M[0, 6, 4, 2] -> -1/2*(a1^2*y^2)/u, + M[0, 6, 4, 7] -> (2*g^2*(t^3 - 16*s^2*u - 4*t^2*u - 7*t*u^2 - 4*u^3 + s*(t^2 - 19*t*u - 12*u^2))*y^2)/(s*t*u), M[0, 6, 6, 0] -> (-32*g^4*s*t)/u^2 - (16*g^2*t*y^2)/u - (2*t*y^4)/s, + M[0, 6, 7, 4] -> (-2*g^2*(16*s^2*t + 4*t^3 + 7*t^2*u + 4*t*u^2 - u^3 + s*(12*t^2 + 19*t*u - u^2))*y^2)/(s*t*u), M[0, 7, 0, 2] -> -1/4*(a1^2*g^2*(3*s - t - u)*(s + u))/(s^2*u), + M[0, 7, 0, 7] -> (g^4*(s^2 + (t + u)^2 + 2*s*(t + 9*u)))/(2*s*u), M[0, 7, 2, 0] -> -1/4*(a1^2*g^2*(s + t)*(3*s - t - u))/(s^2*t), + M[0, 7, 4, 5] -> (2*g^2*(4*s^3 + t^3 + t^2*u - 2*t*u^2 - 2*u^3 + s^2*(5*t + 14*u) + s*(4*t^2 + 19*t*u + 16*u^2))*y^2)/(s*t*u), + M[0, 7, 5, 4] -> (2*g^2*(4*s^3 - 2*t^3 - 2*t^2*u + t*u^2 + u^3 + s^2*(14*t + 5*u) + s*(16*t^2 + 19*t*u + 4*u^2))*y^2)/(s*t*u), M[0, 7, 7, 0] -> (g^4*(s^2 + (t + u)^2 + 2*s*(9*t + u)))/(2*s*t), + M[1, 0, 0, 1] -> 16*lam^2 + (a1^4*(s + u)^2)/(16*s^2*u^2) + (8*g^2*lam*(s^2 - s*t + u*(-t + u)))/(s*u) + (g^4*(s^2 - s*t + u*(-t + u))^2)/(s^2*u^2) + + a1^2*(2*lam*(s^(-1) + u^(-1)) + (g^2*(s + u)*(s^2 - s*t + u*(-t + u)))/(2*s^2*u^2)), M[1, 0, 1, 0] -> 16*lam^2 + (a1^4*(s + t)^2)/(16*s^2*t^2) + (8*g^2*lam*(s^2 + t*(t - u) - s*u))/(s*t) + + (g^4*(s^2 + t*(t - u) - s*u)^2)/(s^2*t^2) + a1^2*(2*lam*(s^(-1) + t^(-1)) + (g^2*(s + t)*(s^2 + t*(t - u) - s*u))/(2*s^2*t^2)), + M[1, 0, 2, 2] -> a2^2 + (2*a1*a2*b3)/s + (a1^3*b3*(t + u))/(2*s*t*u) + (a1^4*(t + u)^2)/(16*t^2*u^2) + a1^2*(b3^2/s^2 + (a2*(t + u))/(2*t*u)), M[1, 0, 2, 7] -> (a1^2*g^2*(s + t - 3*u)*(t + u))/(4*t*u^2), + M[1, 0, 3, 4] -> (8*g^4*t*u)/s^2 - (8*g^2*u*y^2)/s + (2*u*y^4)/t, M[1, 0, 4, 3] -> (8*g^4*t*u)/s^2 - (8*g^2*t*y^2)/s + (2*t*y^4)/u, M[1, 0, 5, 6] -> (32*g^4*t*u)/s^2 + (16*g^2*t*y^2)/s + (2*t*y^4)/u, + M[1, 0, 6, 5] -> (32*g^4*t*u)/s^2 + (16*g^2*u*y^2)/s + (2*u*y^4)/t, M[1, 0, 7, 2] -> (a1^2*g^2*(s - 3*t + u)*(t + u))/(4*t^2*u), M[1, 0, 7, 7] -> (g^4*(s^2 + t^2 + 18*t*u + u^2 + 2*s*(t + u)))/(2*t*u), + M[1, 1, 1, 1] -> 16*lam^2 + (a1^4*(t + u)^2)/(16*t^2*u^2) + (8*g^2*lam*(t^2 + u^2 - s*(t + u)))/(t*u) + (g^4*(t^2 + u^2 - s*(t + u))^2)/(t^2*u^2) + + a1^2*(2*lam*(t^(-1) + u^(-1)) + (g^2*(t + u)*(t^2 + u^2 - s*(t + u)))/(2*t^2*u^2)), M[1, 2, 1, 2] -> a2^2 + (2*a1*a2*b3)/t + (a1^3*b3*(s + u))/(2*s*t*u) + (a1^4*(s + u)^2)/(16*s^2*u^2) + + a1^2*(b3^2/t^2 + (a2*(s + u))/(2*s*u)), M[1, 2, 1, 7] -> (a1^2*g^2*(s + t - 3*u)*(s + u))/(4*s*u^2), + M[1, 2, 2, 1] -> a2^2 + (a1^4*(s + t)^2)/(16*s^2*t^2) + a1^2*((a2*(s + t))/(2*s*t) + b3^2/u^2) + (2*a1*a2*b3)/u + (a1^3*b3*(s + t))/(2*s*t*u), M[1, 2, 3, 6] -> (a1^2*y^2)/(2*s), M[1, 2, 6, 3] -> (a1^2*y^2)/(2*s), + M[1, 2, 7, 1] -> (a1^2*g^2*(s + t)*(s - 3*t + u))/(4*s*t^2), M[1, 3, 1, 3] -> (-8*g^4*s*u)/t^2 + (8*g^2*s*y^2)/t - (2*s*y^4)/u, M[1, 3, 3, 1] -> (-8*g^4*s*t)/u^2 + (8*g^2*s*y^2)/u - (2*s*y^4)/t, + M[1, 4, 1, 4] -> (-8*g^4*s*u)/t^2 + (8*g^2*u*y^2)/t - (2*u*y^4)/s, M[1, 4, 2, 6] -> -1/2*(a1^2*y^2)/t, M[1, 4, 4, 1] -> (-8*g^4*s*t)/u^2 + (8*g^2*t*y^2)/u - (2*t*y^4)/s, M[1, 4, 6, 2] -> -1/2*(a1^2*y^2)/u, + M[1, 4, 6, 7] -> (-4*g^2*(t^3 + 2*s^2*u + 8*t^2*u + 5*t*u^2 + 2*u^3 + s*(t^2 + 8*t*u + 3*u^2))*y^2)/(s*t*u), M[1, 4, 7, 6] -> (-4*g^2*(2*s^2*t + 2*t^3 + 5*t^2*u + 8*t*u^2 + u^3 + s*(3*t^2 + 8*t*u + u^2))*y^2)/(s*t*u), + M[1, 5, 1, 5] -> (-32*g^4*s*u)/t^2 - (16*g^2*u*y^2)/t - (2*u*y^4)/s, M[1, 5, 2, 3] -> -1/2*(a1^2*y^2)/t, M[1, 5, 3, 2] -> -1/2*(a1^2*y^2)/u, + M[1, 5, 3, 7] -> (2*g^2*(t^3 - 16*s^2*u - 4*t^2*u - 7*t*u^2 - 4*u^3 + s*(t^2 - 19*t*u - 12*u^2))*y^2)/(s*t*u), M[1, 5, 5, 1] -> (-32*g^4*s*t)/u^2 - (16*g^2*t*y^2)/u - (2*t*y^4)/s, + M[1, 5, 7, 3] -> (-2*g^2*(16*s^2*t + 4*t^3 + 7*t^2*u + 4*t*u^2 - u^3 + s*(12*t^2 + 19*t*u - u^2))*y^2)/(s*t*u), M[1, 6, 1, 6] -> (-32*g^4*s*u)/t^2 - (16*g^2*s*y^2)/t - (2*s*y^4)/u, + M[1, 6, 6, 1] -> (-32*g^4*s*t)/u^2 - (16*g^2*s*y^2)/u - (2*s*y^4)/t, M[1, 7, 1, 2] -> -1/4*(a1^2*g^2*(3*s - t - u)*(s + u))/(s^2*u), M[1, 7, 1, 7] -> (g^4*(s^2 + (t + u)^2 + 2*s*(t + 9*u)))/(2*s*u), + M[1, 7, 2, 1] -> -1/4*(a1^2*g^2*(s + t)*(3*s - t - u))/(s^2*t), M[1, 7, 3, 6] -> (2*g^2*(4*s^3 + t^3 + t^2*u - 2*t*u^2 - 2*u^3 + s^2*(5*t + 14*u) + s*(4*t^2 + 19*t*u + 16*u^2))*y^2)/(s*t*u), + M[1, 7, 6, 3] -> (2*g^2*(4*s^3 - 2*t^3 - 2*t^2*u + t*u^2 + u^3 + s^2*(14*t + 5*u) + s*(16*t^2 + 19*t*u + 4*u^2))*y^2)/(s*t*u), M[1, 7, 7, 1] -> (g^4*(s^2 + (t + u)^2 + 2*s*(9*t + u)))/(2*s*t), + M[2, 0, 0, 2] -> a2^2 + (a1^4*(s + t)^2)/(16*s^2*t^2) + a1^2*((a2*(s + t))/(2*s*t) + b3^2/u^2) + (2*a1*a2*b3)/u + (a1^3*b3*(s + t))/(2*s*t*u), M[2, 0, 0, 7] -> (a1^2*g^2*u)/(s*t), + M[2, 0, 2, 0] -> a2^2 + (2*a1*a2*b3)/t + (a1^3*b3*(s + u))/(2*s*t*u) + (a1^4*(s + u)^2)/(16*s^2*u^2) + a1^2*(b3^2/t^2 + (a2*(s + u))/(2*s*u)), M[2, 0, 4, 5] -> (a1^2*y^2)/(2*s), M[2, 0, 5, 4] -> (a1^2*y^2)/(2*s), + M[2, 0, 7, 0] -> (a1^2*g^2*t)/(s*u), M[2, 1, 1, 2] -> a2^2 + (a1^4*(s + t)^2)/(16*s^2*t^2) + a1^2*((a2*(s + t))/(2*s*t) + b3^2/u^2) + (2*a1*a2*b3)/u + (a1^3*b3*(s + t))/(2*s*t*u), M[2, 1, 1, 7] -> (a1^2*g^2*u)/(s*t), + M[2, 1, 2, 1] -> a2^2 + (2*a1*a2*b3)/t + (a1^3*b3*(s + u))/(2*s*t*u) + (a1^4*(s + u)^2)/(16*s^2*u^2) + a1^2*(b3^2/t^2 + (a2*(s + u))/(2*s*u)), M[2, 1, 3, 6] -> (a1^2*y^2)/(2*s), M[2, 1, 6, 3] -> (a1^2*y^2)/(2*s), + M[2, 1, 7, 1] -> (a1^2*g^2*t)/(s*u), M[2, 2, 0, 1] -> a2^2 + (2*a1*a2*b3)/s + (a1^3*b3*(t + u))/(2*s*t*u) + (a1^4*(t + u)^2)/(16*t^2*u^2) + a1^2*(b3^2/s^2 + (a2*(t + u))/(2*t*u)), + M[2, 2, 1, 0] -> a2^2 + (2*a1*a2*b3)/s + (a1^3*b3*(t + u))/(2*s*t*u) + (a1^4*(t + u)^2)/(16*t^2*u^2) + a1^2*(b3^2/s^2 + (a2*(t + u))/(2*t*u)), + M[2, 2, 2, 2] -> 36*b4^2 + 48*b3^2*b4*(s^(-1) + t^(-1) + u^(-1)) + (16*b3^4*(t*u + s*(t + u))^2)/(s^2*t^2*u^2), M[2, 3, 1, 5] -> -1/2*(a1^2*y^2)/t, M[2, 3, 5, 1] -> -1/2*(a1^2*y^2)/u, M[2, 4, 0, 6] -> -1/2*(a1^2*y^2)/t, + M[2, 4, 6, 0] -> -1/2*(a1^2*y^2)/u, M[2, 5, 0, 3] -> -1/2*(a1^2*y^2)/t, M[2, 5, 3, 0] -> -1/2*(a1^2*y^2)/u, M[2, 6, 1, 4] -> -1/2*(a1^2*y^2)/t, M[2, 6, 4, 1] -> -1/2*(a1^2*y^2)/u, M[2, 7, 0, 1] -> (a1^2*g^2*s)/(t*u), + M[2, 7, 1, 0] -> (a1^2*g^2*s)/(t*u), M[3, 0, 0, 3] -> (-8*g^4*s*t)/u^2 + (8*g^2*t*y^2)/u - (2*t*y^4)/s, M[3, 0, 2, 5] -> -1/2*(a1^2*y^2)/u, M[3, 0, 3, 0] -> (-8*g^4*s*u)/t^2 + (8*g^2*u*y^2)/t - (2*u*y^4)/s, + M[3, 0, 5, 2] -> -1/2*(a1^2*y^2)/t, M[3, 0, 5, 7] -> (2*g^2*(s^3 + 8*t^3 - 4*t^2*u - 24*t*u^2 - 4*u^3 + s^2*(-10*t + 4*u) - s*(t^2 + 26*t*u + u^2))*y^2)/(s*t*u), + M[3, 0, 7, 5] -> (2*g^2*(s^3 + 2*s^2*(2*t - 5*u) - s*(t^2 + 26*t*u + u^2) - 4*(t^3 + 6*t^2*u + t*u^2 - 2*u^3))*y^2)/(s*t*u), M[3, 1, 1, 3] -> (-8*g^4*s*t)/u^2 + (8*g^2*s*y^2)/u - (2*s*y^4)/t, + M[3, 1, 3, 1] -> (-8*g^4*s*u)/t^2 + (8*g^2*s*y^2)/t - (2*s*y^4)/u, M[3, 2, 1, 5] -> -1/2*(a1^2*y^2)/u, M[3, 2, 5, 1] -> -1/2*(a1^2*y^2)/t, M[3, 3, 3, 3] -> (8*g^4*(t^4 + u^4 + s^2*(t + u)^2))/(t^2*u^2), + M[3, 4, 0, 1] -> (8*g^4*t*u)/s^2 - (8*g^2*t*y^2)/s + (2*t*y^4)/u, M[3, 4, 1, 0] -> (8*g^4*t*u)/s^2 - (8*g^2*u*y^2)/s + (2*u*y^4)/t, M[3, 4, 3, 4] -> (8*g^4*(s^4 + t^4 + s^2*u^2 + 2*s*t*u^2 + t^2*u^2))/(s^2*t^2), + M[3, 4, 4, 3] -> (8*g^4*(s^4 + s^2*t^2 + 2*s*t^2*u + t^2*u^2 + u^4))/(s^2*u^2), M[3, 4, 5, 6] -> (32*g^4*(t^2 + u^2))/s^2 + (16*g^2*t*y^2)/s + 4*y^4, M[3, 4, 6, 5] -> (32*g^4*(t^2 + u^2))/s^2 + (16*g^2*u*y^2)/s + 4*y^4, + M[3, 4, 7, 7] -> (8*g^4*(-2*s^2 + 7*t^2 + 12*t*u + 7*u^2 + 4*s*(t + u)))/(t*u), M[3, 5, 3, 5] -> (32*g^4*(s^2 + u^2))/t^2 + (16*g^2*u*y^2)/t + 4*y^4, M[3, 5, 5, 3] -> (32*g^4*(s^2 + t^2))/u^2 + (16*g^2*t*y^2)/u + 4*y^4, + M[3, 6, 1, 2] -> (a1^2*y^2)/(2*s), M[3, 6, 1, 7] -> (-2*g^2*(6*s^3 + t^3 + 8*t^2*u + 11*t*u^2 + 4*u^3 - s^2*(3*t + 10*u) - 2*s*(5*t^2 + 13*t*u + 10*u^2))*y^2)/(s*t*u), M[3, 6, 2, 1] -> (a1^2*y^2)/(2*s), + M[3, 6, 3, 6] -> (32*g^4*(s^2 + u^2))/t^2 + (16*g^2*s*y^2)/t + 4*y^4, M[3, 6, 6, 3] -> (32*g^4*(s^2 + t^2))/u^2 + (16*g^2*s*y^2)/u + 4*y^4, + M[3, 6, 7, 1] -> (-2*g^2*(6*s^3 + 4*t^3 + 11*t^2*u + 8*t*u^2 + u^3 - s^2*(10*t + 3*u) - 2*s*(10*t^2 + 13*t*u + 5*u^2))*y^2)/(s*t*u), + M[3, 7, 1, 5] -> (2*g^2*(t^3 + s^2*(5*t - 22*u) - 10*t^2*u - 5*t*u^2 + 4*u^3 + 2*s*(3*t^2 - 13*t*u - 5*u^2))*y^2)/(s*t*u), M[3, 7, 3, 7] -> (-8*g^4*(6*s^2 - 2*t^2 + 2*t*u + 5*u^2 + 3*s*(t + 3*u)))/(s*u), + M[3, 7, 5, 1] -> (2*g^2*(4*t^3 - 5*t^2*u - 10*t*u^2 + u^3 + s^2*(-22*t + 5*u) - 2*s*(5*t^2 + 13*t*u - 3*u^2))*y^2)/(s*t*u), M[3, 7, 7, 3] -> (-8*g^4*(6*s^2 + 5*t^2 + 2*t*u - 2*u^2 + 3*s*(3*t + u)))/(s*t), + M[4, 0, 0, 4] -> (-8*g^4*s*t)/u^2 + (8*g^2*s*y^2)/u - (2*s*y^4)/t, M[4, 0, 4, 0] -> (-8*g^4*s*u)/t^2 + (8*g^2*s*y^2)/t - (2*s*y^4)/u, M[4, 1, 1, 4] -> (-8*g^4*s*t)/u^2 + (8*g^2*t*y^2)/u - (2*t*y^4)/s, + M[4, 1, 2, 6] -> -1/2*(a1^2*y^2)/u, M[4, 1, 4, 1] -> (-8*g^4*s*u)/t^2 + (8*g^2*u*y^2)/t - (2*u*y^4)/s, M[4, 1, 6, 2] -> -1/2*(a1^2*y^2)/t, + M[4, 1, 6, 7] -> (2*g^2*(s^3 + 8*t^3 - 4*t^2*u - 24*t*u^2 - 4*u^3 + s^2*(-10*t + 4*u) - s*(t^2 + 26*t*u + u^2))*y^2)/(s*t*u), + M[4, 1, 7, 6] -> (2*g^2*(s^3 + 2*s^2*(2*t - 5*u) - s*(t^2 + 26*t*u + u^2) - 4*(t^3 + 6*t^2*u + t*u^2 - 2*u^3))*y^2)/(s*t*u), M[4, 2, 0, 6] -> -1/2*(a1^2*y^2)/u, M[4, 2, 6, 0] -> -1/2*(a1^2*y^2)/t, + M[4, 3, 0, 1] -> (8*g^4*t*u)/s^2 - (8*g^2*u*y^2)/s + (2*u*y^4)/t, M[4, 3, 1, 0] -> (8*g^4*t*u)/s^2 - (8*g^2*t*y^2)/s + (2*t*y^4)/u, M[4, 3, 3, 4] -> (8*g^4*(s^4 + s^2*t^2 + 2*s*t^2*u + t^2*u^2 + u^4))/(s^2*u^2), + M[4, 3, 4, 3] -> (8*g^4*(s^4 + t^4 + s^2*u^2 + 2*s*t*u^2 + t^2*u^2))/(s^2*t^2), M[4, 3, 5, 6] -> (32*g^4*(t^2 + u^2))/s^2 + (16*g^2*u*y^2)/s + 4*y^4, M[4, 3, 6, 5] -> (32*g^4*(t^2 + u^2))/s^2 + (16*g^2*t*y^2)/s + 4*y^4, + M[4, 3, 7, 7] -> (8*g^4*(-2*s^2 + 7*t^2 + 12*t*u + 7*u^2 + 4*s*(t + u)))/(t*u), M[4, 4, 4, 4] -> (8*g^4*(t^4 + u^4 + s^2*(t + u)^2))/(t^2*u^2), M[4, 5, 0, 2] -> (a1^2*y^2)/(2*s), + M[4, 5, 0, 7] -> (-2*g^2*(6*s^3 + t^3 + 8*t^2*u + 11*t*u^2 + 4*u^3 - s^2*(3*t + 10*u) - 2*s*(5*t^2 + 13*t*u + 10*u^2))*y^2)/(s*t*u), M[4, 5, 2, 0] -> (a1^2*y^2)/(2*s), + M[4, 5, 4, 5] -> (32*g^4*(s^2 + u^2))/t^2 + (16*g^2*s*y^2)/t + 4*y^4, M[4, 5, 5, 4] -> (32*g^4*(s^2 + t^2))/u^2 + (16*g^2*s*y^2)/u + 4*y^4, + M[4, 5, 7, 0] -> (-2*g^2*(6*s^3 + 4*t^3 + 11*t^2*u + 8*t*u^2 + u^3 - s^2*(10*t + 3*u) - 2*s*(10*t^2 + 13*t*u + 5*u^2))*y^2)/(s*t*u), M[4, 6, 4, 6] -> (32*g^4*(s^2 + u^2))/t^2 + (16*g^2*u*y^2)/t + 4*y^4, + M[4, 6, 6, 4] -> (32*g^4*(s^2 + t^2))/u^2 + (16*g^2*t*y^2)/u + 4*y^4, M[4, 7, 0, 6] -> (2*g^2*(t^3 + s^2*(5*t - 22*u) - 10*t^2*u - 5*t*u^2 + 4*u^3 + 2*s*(3*t^2 - 13*t*u - 5*u^2))*y^2)/(s*t*u), + M[4, 7, 4, 7] -> (-8*g^4*(6*s^2 - 2*t^2 + 2*t*u + 5*u^2 + 3*s*(t + 3*u)))/(s*u), M[4, 7, 6, 0] -> (2*g^2*(4*t^3 - 5*t^2*u - 10*t*u^2 + u^3 + s^2*(-22*t + 5*u) - 2*s*(5*t^2 + 13*t*u - 3*u^2))*y^2)/(s*t*u), + M[4, 7, 7, 4] -> (-8*g^4*(6*s^2 + 5*t^2 + 2*t*u - 2*u^2 + 3*s*(3*t + u)))/(s*t), M[5, 0, 0, 5] -> (-32*g^4*s*t)/u^2 - (16*g^2*s*y^2)/u - (2*s*y^4)/t, M[5, 0, 5, 0] -> (-32*g^4*s*u)/t^2 - (16*g^2*s*y^2)/t - (2*s*y^4)/u, + M[5, 1, 1, 5] -> (-32*g^4*s*t)/u^2 - (16*g^2*t*y^2)/u - (2*t*y^4)/s, M[5, 1, 2, 3] -> -1/2*(a1^2*y^2)/u, M[5, 1, 3, 2] -> -1/2*(a1^2*y^2)/t, + M[5, 1, 3, 7] -> (-4*g^2*(s^3 - 4*t^3 - 4*t^2*u - u^3 + s^2*(8*t + u) - s*(t^2 - 7*t*u + u^2))*y^2)/(s*t*u), M[5, 1, 5, 1] -> (-32*g^4*s*u)/t^2 - (16*g^2*u*y^2)/t - (2*u*y^4)/s, + M[5, 1, 7, 3] -> (-4*g^2*(s^3 - t^3 - 4*t*u^2 - 4*u^3 + s^2*(t + 8*u) - s*(t^2 - 7*t*u + u^2))*y^2)/(s*t*u), M[5, 2, 0, 3] -> -1/2*(a1^2*y^2)/u, M[5, 2, 3, 0] -> -1/2*(a1^2*y^2)/t, + M[5, 3, 3, 5] -> (32*g^4*(s^2 + t^2))/u^2 + (16*g^2*t*y^2)/u + 4*y^4, M[5, 3, 5, 3] -> (32*g^4*(s^2 + u^2))/t^2 + (16*g^2*u*y^2)/t + 4*y^4, M[5, 4, 0, 2] -> (a1^2*y^2)/(2*s), + M[5, 4, 0, 7] -> (4*g^2*(-3*s^3 + t^3 - s^2*u + 2*t^2*u + 2*t*u^2 + u^3 + 2*s*(4*t^2 + 5*t*u + 2*u^2))*y^2)/(s*t*u), M[5, 4, 2, 0] -> (a1^2*y^2)/(2*s), M[5, 4, 4, 5] -> (32*g^4*(s^2 + t^2))/u^2 + (16*g^2*s*y^2)/u + 4*y^4, + M[5, 4, 5, 4] -> (32*g^4*(s^2 + u^2))/t^2 + (16*g^2*s*y^2)/t + 4*y^4, M[5, 4, 7, 0] -> (4*g^2*(-3*s^3 - s^2*t + t^3 + 2*t^2*u + 2*t*u^2 + u^3 + 2*s*(2*t^2 + 5*t*u + 4*u^2))*y^2)/(s*t*u), + M[5, 5, 5, 5] -> (128*g^4*(t^4 + u^4 + s^2*(t + u)^2))/(t^2*u^2), M[5, 6, 0, 1] -> (32*g^4*t*u)/s^2 + (16*g^2*u*y^2)/s + (2*u*y^4)/t, M[5, 6, 1, 0] -> (32*g^4*t*u)/s^2 + (16*g^2*t*y^2)/s + (2*t*y^4)/u, + M[5, 6, 3, 4] -> (32*g^4*(t^2 + u^2))/s^2 + (16*g^2*t*y^2)/s + 4*y^4, M[5, 6, 4, 3] -> (32*g^4*(t^2 + u^2))/s^2 + (16*g^2*u*y^2)/s + 4*y^4, M[5, 6, 5, 6] -> (128*g^4*(s^4 + t^4 + s^2*u^2 + 2*s*t*u^2 + t^2*u^2))/(s^2*t^2), + M[5, 6, 6, 5] -> (128*g^4*(s^4 + s^2*t^2 + 2*s*t^2*u + t^2*u^2 + u^4))/(s^2*u^2), M[5, 6, 7, 7] -> (128*g^4*(-2*s^2 + 7*t^2 + 12*t*u + 7*u^2 + 4*s*(t + u)))/(t*u), + M[5, 7, 0, 3] -> (-2*g^2*(s^2*(t + 4*u) + s*(3*t^2 + 17*t*u - 2*u^2) + 2*(t^3 + 8*t^2*u + t*u^2 - 2*u^3))*y^2)/(s*t*u), + M[5, 7, 3, 0] -> (-2*g^2*(s^2*(4*t + u) + s*(-2*t^2 + 17*t*u + 3*u^2) + 2*(-2*t^3 + t^2*u + 8*t*u^2 + u^3))*y^2)/(s*t*u), M[5, 7, 5, 7] -> (-128*g^4*(6*s^2 - 2*t^2 + 2*t*u + 5*u^2 + 3*s*(t + 3*u)))/(s*u), + M[5, 7, 7, 5] -> (-128*g^4*(6*s^2 + 5*t^2 + 2*t*u - 2*u^2 + 3*s*(3*t + u)))/(s*t), M[6, 0, 0, 6] -> (-32*g^4*s*t)/u^2 - (16*g^2*t*y^2)/u - (2*t*y^4)/s, M[6, 0, 2, 4] -> -1/2*(a1^2*y^2)/u, M[6, 0, 4, 2] -> -1/2*(a1^2*y^2)/t, + M[6, 0, 4, 7] -> (-4*g^2*(s^3 - 4*t^3 - 4*t^2*u - u^3 + s^2*(8*t + u) - s*(t^2 - 7*t*u + u^2))*y^2)/(s*t*u), M[6, 0, 6, 0] -> (-32*g^4*s*u)/t^2 - (16*g^2*u*y^2)/t - (2*u*y^4)/s, + M[6, 0, 7, 4] -> (-4*g^2*(s^3 - t^3 - 4*t*u^2 - 4*u^3 + s^2*(t + 8*u) - s*(t^2 - 7*t*u + u^2))*y^2)/(s*t*u), M[6, 1, 1, 6] -> (-32*g^4*s*t)/u^2 - (16*g^2*s*y^2)/u - (2*s*y^4)/t, + M[6, 1, 6, 1] -> (-32*g^4*s*u)/t^2 - (16*g^2*s*y^2)/t - (2*s*y^4)/u, M[6, 2, 1, 4] -> -1/2*(a1^2*y^2)/u, M[6, 2, 4, 1] -> -1/2*(a1^2*y^2)/t, M[6, 3, 1, 2] -> (a1^2*y^2)/(2*s), + M[6, 3, 1, 7] -> (4*g^2*(-3*s^3 + t^3 - s^2*u + 2*t^2*u + 2*t*u^2 + u^3 + 2*s*(4*t^2 + 5*t*u + 2*u^2))*y^2)/(s*t*u), M[6, 3, 2, 1] -> (a1^2*y^2)/(2*s), M[6, 3, 3, 6] -> (32*g^4*(s^2 + t^2))/u^2 + (16*g^2*s*y^2)/u + 4*y^4, + M[6, 3, 6, 3] -> (32*g^4*(s^2 + u^2))/t^2 + (16*g^2*s*y^2)/t + 4*y^4, M[6, 3, 7, 1] -> (4*g^2*(-3*s^3 - s^2*t + t^3 + 2*t^2*u + 2*t*u^2 + u^3 + 2*s*(2*t^2 + 5*t*u + 4*u^2))*y^2)/(s*t*u), + M[6, 4, 4, 6] -> (32*g^4*(s^2 + t^2))/u^2 + (16*g^2*t*y^2)/u + 4*y^4, M[6, 4, 6, 4] -> (32*g^4*(s^2 + u^2))/t^2 + (16*g^2*u*y^2)/t + 4*y^4, M[6, 5, 0, 1] -> (32*g^4*t*u)/s^2 + (16*g^2*t*y^2)/s + (2*t*y^4)/u, + M[6, 5, 1, 0] -> (32*g^4*t*u)/s^2 + (16*g^2*u*y^2)/s + (2*u*y^4)/t, M[6, 5, 3, 4] -> (32*g^4*(t^2 + u^2))/s^2 + (16*g^2*u*y^2)/s + 4*y^4, M[6, 5, 4, 3] -> (32*g^4*(t^2 + u^2))/s^2 + (16*g^2*t*y^2)/s + 4*y^4, + M[6, 5, 5, 6] -> (128*g^4*(s^4 + s^2*t^2 + 2*s*t^2*u + t^2*u^2 + u^4))/(s^2*u^2), M[6, 5, 6, 5] -> (128*g^4*(s^4 + t^4 + s^2*u^2 + 2*s*t*u^2 + t^2*u^2))/(s^2*t^2), + M[6, 5, 7, 7] -> (128*g^4*(-2*s^2 + 7*t^2 + 12*t*u + 7*u^2 + 4*s*(t + u)))/(t*u), M[6, 6, 6, 6] -> (128*g^4*(t^4 + u^4 + s^2*(t + u)^2))/(t^2*u^2), + M[6, 7, 1, 4] -> (-2*g^2*(s^2*(t + 4*u) + s*(3*t^2 + 17*t*u - 2*u^2) + 2*(t^3 + 8*t^2*u + t*u^2 - 2*u^3))*y^2)/(s*t*u), + M[6, 7, 4, 1] -> (-2*g^2*(s^2*(4*t + u) + s*(-2*t^2 + 17*t*u + 3*u^2) + 2*(-2*t^3 + t^2*u + 8*t*u^2 + u^3))*y^2)/(s*t*u), M[6, 7, 6, 7] -> (-128*g^4*(6*s^2 - 2*t^2 + 2*t*u + 5*u^2 + 3*s*(t + 3*u)))/(s*u), + M[6, 7, 7, 6] -> (-128*g^4*(6*s^2 + 5*t^2 + 2*t*u - 2*u^2 + 3*s*(3*t + u)))/(s*t), M[7, 0, 0, 2] -> (a1^2*g^2*(s + t)*(s^2 + s*(-2*t + u) + t*(t + u)))/(4*s^2*t^2), M[7, 0, 0, 7] -> (4*g^4*(u*(t + u) + s*(2*t + u)))/(s*t), + M[7, 0, 2, 0] -> (a1^2*g^2*(s + u)*(s^2 + s*(t - 2*u) + u*(t + u)))/(4*s^2*u^2), M[7, 0, 4, 5] -> 2*g^2*(9 + (8*t)/u + (2*u)/t + (t + u)/s)*y^2, M[7, 0, 5, 4] -> 2*g^2*(9 + (2*t)/u + (8*u)/t + (t + u)/s)*y^2, + M[7, 0, 7, 0] -> (4*g^4*(t*(t + u) + s*(t + 2*u)))/(s*u), M[7, 1, 1, 2] -> (a1^2*g^2*(s + t)*(s^2 + s*(-2*t + u) + t*(t + u)))/(4*s^2*t^2), M[7, 1, 1, 7] -> (4*g^4*(u*(t + u) + s*(2*t + u)))/(s*t), + M[7, 1, 2, 1] -> (a1^2*g^2*(s + u)*(s^2 + s*(t - 2*u) + u*(t + u)))/(4*s^2*u^2), M[7, 1, 3, 6] -> 2*g^2*(9 + (8*t)/u + (2*u)/t + (t + u)/s)*y^2, M[7, 1, 6, 3] -> 2*g^2*(9 + (2*t)/u + (8*u)/t + (t + u)/s)*y^2, + M[7, 1, 7, 1] -> (4*g^4*(t*(t + u) + s*(t + 2*u)))/(s*u), M[7, 2, 0, 1] -> (a1^2*g^2*(t + u)*((t - u)^2 + s*(t + u)))/(4*t^2*u^2), M[7, 2, 1, 0] -> (a1^2*g^2*(t + u)*((t - u)^2 + s*(t + u)))/(4*t^2*u^2), + M[7, 3, 1, 5] -> g^2*(-18 - (2*s)/t - (16*s)/u - (4*u)/s - (2*u)/t)*y^2, M[7, 3, 3, 7] -> (-4*g^4*(5*s^2 + 3*s*(2*t + u) + t*(5*t + 3*u)))/(s*t), M[7, 3, 5, 1] -> g^2*(-18 - (16*s)/t - (4*t)/s - (2*s)/u - (2*t)/u)*y^2, + M[7, 3, 7, 3] -> (-4*g^4*(5*s^2 + 3*s*(t + 2*u) + u*(3*t + 5*u)))/(s*u), M[7, 4, 0, 6] -> g^2*(-18 - (2*s)/t - (16*s)/u - (4*u)/s - (2*u)/t)*y^2, M[7, 4, 4, 7] -> (-4*g^4*(5*s^2 + 3*s*(2*t + u) + t*(5*t + 3*u)))/(s*t), + M[7, 4, 6, 0] -> g^2*(-18 - (16*s)/t - (4*t)/s - (2*s)/u - (2*t)/u)*y^2, M[7, 4, 7, 4] -> (-4*g^4*(5*s^2 + 3*s*(t + 2*u) + u*(3*t + 5*u)))/(s*u), M[7, 5, 0, 3] -> g^2*(-18 - (2*s)/t - (4*s)/u - (16*u)/s - (2*u)/t)*y^2, + M[7, 5, 3, 0] -> g^2*(-18 - (4*s)/t - (16*t)/s - (2*s)/u - (2*t)/u)*y^2, M[7, 5, 5, 7] -> (-64*g^4*(5*s^2 + 3*s*(2*t + u) + t*(5*t + 3*u)))/(s*t), M[7, 5, 7, 5] -> (-64*g^4*(5*s^2 + 3*s*(t + 2*u) + u*(3*t + 5*u)))/(s*u), + M[7, 6, 1, 4] -> g^2*(-18 - (2*s)/t - (4*s)/u - (16*u)/s - (2*u)/t)*y^2, M[7, 6, 4, 1] -> g^2*(-18 - (4*s)/t - (16*t)/s - (2*s)/u - (2*t)/u)*y^2, M[7, 6, 6, 7] -> (-64*g^4*(5*s^2 + 3*s*(2*t + u) + t*(5*t + 3*u)))/(s*t), + M[7, 6, 7, 6] -> (-64*g^4*(5*s^2 + 3*s*(t + 2*u) + u*(3*t + 5*u)))/(s*u), M[7, 7, 0, 1] -> (4*g^4*(s^2 + 2*t*u + s*(t + u)))/(t*u), M[7, 7, 1, 0] -> (4*g^4*(s^2 + 2*t*u + s*(t + u)))/(t*u), + M[7, 7, 3, 4] -> (4*g^4*(5*t^2 + 6*t*u + 5*u^2 + 3*s*(t + u)))/(t*u), M[7, 7, 4, 3] -> (4*g^4*(5*t^2 + 6*t*u + 5*u^2 + 3*s*(t + u)))/(t*u), M[7, 7, 5, 6] -> (64*g^4*(5*t^2 + 6*t*u + 5*u^2 + 3*s*(t + u)))/(t*u), + M[7, 7, 6, 5] -> (64*g^4*(5*t^2 + 6*t*u + 5*u^2 + 3*s*(t + u)))/(t*u)}; + + +feynAssociation=Association[feynResults]; + + +insertCouplings:={g1->g}; + + +symmetriseTU[arg_]:=1/2 (arg)+1/2 (arg/.{t->tt}/.{u->t, tt->u}) + + +fixConvention[arg_]:=symmetriseTU[arg/.insertCouplings/.{s->(-t-u)}]//Expand//Simplify//Expand + + +removeMissing[arg_]:=arg/.M[__]->0/.Missing["KeyAbsent", _]->0 + + +(* ::Subsection:: *) +(*Test hard*) + + +totalDRalgo=Sum[M[a,b,c,d],{a,0,4},{b,0,4},{c,0,4},{d,0,4}]/.MatrixElements/.Thread[UserMasses->0]//removeMissing//fixConvention; +totalFeyn=Sum[M[a,b,c,d],{a,0,7},{b,0,7},{c,0,7},{d,0,7}]/.FeynMatrixElements//removeMissing//fixConvention; + + +Collect[totalFeyn,{g,y,a1,a2,b3,b4,lam}]; + + +Collect[totalDRalgo-totalFeyn,{g,y,a1}] + + +testList={}; + + +(* everything *) +AppendTo[testList, +TestCreate[ + totalDRalgo, + totalFeyn +]]; + + +report=TestReport[testList] +report["ResultsDataset"] diff --git a/tests/xsm.test.m b/tests/xsm.test.m new file mode 100644 index 0000000..d39357b --- /dev/null +++ b/tests/xsm.test.m @@ -0,0 +1,516 @@ +(* ::Package:: *) + +(*Quit[];*) + + +SetDirectory[NotebookDirectory[]]; +(*Put this if you want to create multiple model-files with the same kernel*) +$GroupMathMultipleModels=True; +$LoadGroupMath=True; +<<../src/WallGoMatrix.m + + +(* ::Chapter:: *) +(*SM+sr1*) + + +(*see 1506.04741 [hep-ph]*) + + +(* ::Section:: *) +(*Model*) + + +HypY={Yl,Ye,Yq,Yu,Yd,Y\[Phi],Y\[Eta]}; +repY=Thread[HypY->{-1,-2,1/3,4/3,-(2/3),1,2}]; + + +Group={"SU3","SU2","U1"}; +RepAdjoint={{1,1},{2},0}; +scalar1={{{0,0},{1},Y\[Phi]/2},"C"}; +scalar2={{{0,0},{0},0},"R"}; +RepScalar={scalar1,scalar2}/.repY; +CouplingName={g3,gw,g1}; + + +Rep1={{{1,0},{1},Yq/2},"L"}; +Rep2={{{1,0},{0},Yu/2},"R"}; +Rep3={{{1,0},{0},Yd/2},"R"}; +Rep4={{{0,0},{1},Yl/2},"L"}; +Rep5={{{0,0},{0},Ye/2},"R"}; +RepFermion1Gen={Rep1,Rep2,Rep3,Rep4,Rep5}/.repY; + + +(* ::Text:: *) +(*The input for the gauge interactions to DRalgo are then given by*) + + +RepFermion1Gen={Rep1,Rep2,Rep3,Rep1,Rep2,Rep3,Rep1,Rep2,Rep3,Rep4,Rep5}/.repY; +RepFermion3Gen={RepFermion1Gen}//Flatten[#,1]&; +(*RepFermion3Gen={RepFermion1Gen,RepFermion1Gen,RepFermion1Gen}//Flatten[#,1]&;*) + + +(* ::Text:: *) +(*The first element is the vector self-interaction matrix:*) + + +{gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC}=AllocateTensors[Group,RepAdjoint,CouplingName,RepFermion3Gen,RepScalar]/.repY; + + +InputInv={{1,1},{True,False}}; +MassTerm1=CreateInvariant[Group,RepScalar,InputInv]//Simplify//FullSimplify; +InputInv={{2,2},{True,True}}; +MassTerm2=CreateInvariant[Group,RepScalar,InputInv]//Simplify//FullSimplify; + + +VMass=( + +m1*MassTerm1 + +b2/2*MassTerm2 + ); + + +\[Mu]ij=GradMass[VMass[[1]]]//Simplify//SparseArray; + + +QuarticTerm1=MassTerm1[[1]]^2; +QuarticTerm2=MassTerm2[[1]]^2; +QuarticTerm3=MassTerm1[[1]]*MassTerm2[[1]]; + + +VQuartic=( + +lam*QuarticTerm1 + +b4/4*QuarticTerm2 + +a2/2*QuarticTerm3 + ); + + +\[Lambda]4=GradQuartic[VQuartic]; + + +InputInv={{1,1,2},{True,False,True}}; +CubicTerm1=CreateInvariant[Group,RepScalar,InputInv][[1]]//Simplify; +InputInv={{2,2,2},{True,True,True}}; +CubicTerm2=CreateInvariant[Group,RepScalar,InputInv][[1]]//Simplify; + + +VCubic=( + +a1/2*CubicTerm1 + +b3/3*CubicTerm2 + ); + + +\[Lambda]3=GradCubic[VCubic]; + + +InputInv={{1,1,2},{False,False,True}}; +YukawaDoublet1=CreateInvariantYukawa[Group,RepScalar,RepFermion3Gen,InputInv]//Simplify; + + +Ysff=-yt*GradYukawa[YukawaDoublet1[[1]]]; + + +YsffC=SparseArray[Simplify[Conjugate[Ysff]//Normal,Assumptions->{yt>0}]]; + + +ImportModel[Group,gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC,Verbose->False]; + + +(* ::Section:: *) +(*MatrixElements*) + + +(* +In DRalgo fermions are Weyl. +So to create one Dirac we need +one left-handed and +one right-handed fermion +*) + + +(* ::Subsection:: *) +(*TopL, TopR*) + + +vev={0,v,0,0,0}; +SymmetryBreaking[vev]; + + +(*left-handed top-quark*) +ReptL=CreateParticle[{{1,1}},"F"]; + +(*right-handed top-quark*) +ReptR=CreateParticle[{2},"F"]; + +(*join topL and topR into one rep*) +Rept={Join[ReptL[[1]],ReptR[[1]]],"F"}; + +(*left-handed bottom-quark*) +RepbL=CreateParticle[{{1,2}},"F"]; + +(*right-handed bottom-quark*) +RepbR=CreateParticle[{3},"F"]; + +(*join bottomL and bottomR into one rep*) +Repb={Join[RepbL[[1]],RepbR[[1]]],"F"}; + +(*scalar reps*) +Reph=CreateParticle[{{1,2}},"S"]; +Rep\[Phi]0=CreateParticle[{{1,1}},"S"]; +Rep\[Phi]pm=CreateParticle[{{1,3}},"S"]; +Rep\[Phi]0={{1},"S"}; +Rep\[Phi]p={{4},"S"}; +Rep\[Phi]m={{3},"S"}; + +Reps=CreateParticle[{2},"S"]; + +(*Vector bosons*) +RepGluon=CreateParticle[{1},"V"]; +RepW=CreateParticle[{{2,1}},"V"]; +RepB=CreateParticle[{{3,1}},"V"]; + + +VectorMass=Join[ + Table[mg2,{i,1,RepGluon[[1]]//Length}], + Table[mw2,{i,1,RepW[[1]]//Length}], + Table[mb2,{i,1,RepB[[1]]//Length}]]; +FermionMass=Table[mq2,{i,1,Length[gvff[[1]]]}]; +ScalarMass={mG2,mh2,mGm2,mGp2,ms2}; +ParticleMasses={VectorMass,FermionMass,ScalarMass}; +(* +up to the user to make sure that the same order is given in the python code +*) +UserMasses={mq2,mg2,mw2,mb2,mG2,mh2,mGm2,mGp2,ms2}; +UserCouplings=Variables@Normal@{Ysff,gvss,gvff,gvvv,\[Lambda]4,\[Lambda]3}//DeleteDuplicates; + + +ParticleList={ + Rept,Repb, + RepGluon,RepW,RepB, + Reph,Rep\[Phi]0,Rep\[Phi]p,Rep\[Phi]m, + Reps + }; +ParticleName={ + "Top","Bottom", + "Gluon","W","B", + "Higgs","Goldstone0","GoldStoneMinus","GoldstonePlus", + "Singlet"}; + + +(* + output of matrix elements +*) +OutputFile="matrixElements.xsm"; +SetDirectory[NotebookDirectory[]]; +MatrixElements=ExportMatrixElements[ + OutputFile, + ParticleList, + UserMasses, + UserCouplings, + ParticleName, + ParticleMasses, + { + Verbose->True, + TruncateAtLeadingLog->True, + Replacements->{gw->0,g1->0}, + NormalizeWithDOF->False, + Format->{"json","txt"}}]; + + +(* ::Section:: *) +(*Tests try*) + + +(* ::Subsubsection::Closed:: *) +(*O(g3^4)*) + + +1/2*M[0,0,2,2]/.MatrixElements/.{mq2->0}//Expand +1/2*M[0,2,0,2]/.MatrixElements/.{mq2->0}//Expand +1/2*(M[0,1,0,1]+M[0,10,0,10])/.MatrixElements/.{mq2->0,yt->0}//Expand + + +(* ::Subsubsection::Closed:: *) +(*O(g3^2*yt^2)*) + + +1/2*M[0,0,5,2]/.MatrixElements/.{mq2->0}//Expand +1/2*M[0,0,6,2]/.MatrixElements/.{mq2->0}//Expand + + +1/2*M[0,1,8,2]/.MatrixElements/.{mq2->0}//Expand + + +1/2*M[0,2,0,5]/.MatrixElements/.{mq2->0}//Expand +1/2*M[0,2,0,6]/.MatrixElements/.{mq2->0}//Expand + + +1/2*M[0,2,1,8]/.MatrixElements/.{mq2->0}//Expand + + +1/2*M[0,8,1,2]/.MatrixElements/.{mq2->0}//Expand + + +(* ::Subsubsection:: *) +(*O(yt^4)*) + + +1/2*M[0,0,5,5]/.MatrixElements/.{mq2->0}//Expand +1/2*M[0,0,6,6]/.MatrixElements/.{mq2->0}//Expand + + +1/2*(M[0,0,7,7]+M[0,0,8,8])/.MatrixElements/.{mq2->0}//Expand + + +1/2*M[0,0,5,6]/.MatrixElements/.{mq2->0}//Expand + + +1/2*M[0,1,5,8]/.MatrixElements/.{mq2->0}//Expand +1/2*M[0,1,6,7]/.MatrixElements/.{mq2->0}//Expand + + +1/2*M[0,5,5,0]/.MatrixElements/.{mq2->0}//Expand +1/2*M[0,5,6,0]/.MatrixElements/.{mq2->0}//Expand +1/2*M[0,6,5,0]/.MatrixElements/.{mq2->0}//Expand +1/2*M[0,6,6,0]/.MatrixElements/.{mq2->0}//Expand + + +1/2*M[0,8,5,1]/.MatrixElements/.{mq2->0}//Expand +1/2*M[0,7,6,1]/.MatrixElements/.{mq2->0}//Expand + + +1/2*M[0,7,7,0]/.MatrixElements/.{mq2->0}//Expand + + +(* ::Section:: *) +(*Tests*) + + +symmetriseTU[arg_]:=1/2 (arg)+1/2 (arg/.{t->tt}/.{u->t, tt->u}) +fixConvention[arg_]:=symmetriseTU[arg/.{s->(-t-u)}]//Expand//Simplify//Expand +removeMissing[arg_]:=arg/.M[__]->0/.Missing["KeyAbsent", _]->0 + + +(* ::Subsection:: *) +(*Test with [Hyperlink[1506.04741,{URL["https://arxiv.org/pdf/1506.04741"], None},Apply[Sequence, {ActiveStyle -> {"HyperlinkActive"}, BaseStyle -> {"Hyperlink"}, HyperlinkAction -> "Recycled"}]]]*) + + +testList={}; + + +(* ::Subsubsection::Closed:: *) +(*O(g3^4)*) + + +(*tt->gg*) +AppendTo[testList, +TestCreate[ + 1/2*M[0,0,2,2]/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + 128/3 g3^4(u/t+t/u)//fixConvention//removeMissing, + TestID->"tt->gg" +]]; + + +(*tg->tg*) +AppendTo[testList, +TestCreate[ + 1/2*M[0,2,0,2]/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + -(128/3)g3^4 s/u+96*g3^4 (s^2+u^2)/t^2//fixConvention//removeMissing, + TestID->"tg->tg" +]]; + + +(*tq->tq*) +(*has additional yt^2 g3^2 term than reference*) +AppendTo[testList, +TestCreate[ + 1/2*(M[0,1,0,1]+M[0,10,0,10])/.MatrixElements/.{yt->0}/.Thread[UserMasses->0]//fixConvention//removeMissing, + 160*g3^4 (u^2+s^2)/t^2//fixConvention//removeMissing, + TestID->"tq->tq" +]]; + + +(* ::Subsubsection::Closed:: *) +(*O(g3^2*yt^2)*) + + + 1/2*M[0,0,5,2]/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing + 8*yt^2*g3^2(u/t+t/u)//fixConvention//removeMissing + + +(*tt->hg*) +AppendTo[testList, +TestCreate[ + 1/2*M[0,0,5,2]/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + 8*yt^2*g3^2(u/t+t/u)//fixConvention//removeMissing, + TestID->"tt->hg" +]]; +(*tt->\[Phi]0 g*) +AppendTo[testList, +TestCreate[ + 1/2*M[0,0,6,2]/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + 8*yt^2*g3^2(u/t+t/u)//fixConvention//removeMissing, + TestID->"tt->\[Phi]0g" +]]; + + +(*tt->\[Phi]+ g*) +AppendTo[testList, +TestCreate[ + 1/2*(M[0,1,2,8]+M[0,1,8,2])/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + 8*yt^2*g3^2(u/t+t/u)//fixConvention//removeMissing, + TestID->"tt->\!\(\*SuperscriptBox[\(\[Phi]\), \(+\)]\)g" +]]; + + +(*tg->th*) +AppendTo[testList, +TestCreate[ + 1/2*M[0,2,0,5]/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + -8*yt^2*g3^2*s/t//fixConvention//removeMissing, + TestID->"tg->th" +]]; +(*tg->t\[Phi]0*) +AppendTo[testList, +TestCreate[ + 1/2*M[0,2,0,6]/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + -8*yt^2*g3^2*s/t//fixConvention//removeMissing, + TestID->"tg->t\[Phi]0" +]]; + + +(*tg->b\[Phi]+*) +AppendTo[testList, +TestCreate[ + 1/2*(M[0,2,1,8]+M[0,2,8,1])/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + -8*yt^2*g3^2*s/t//fixConvention//removeMissing, + TestID->"tg->\!\(\*SuperscriptBox[\(b\[Phi]\), \(+\)]\)" +]]; + + +(*t\[Phi]-->bg*) +AppendTo[testList, +TestCreate[ + 1/2*(M[0,8,1,2]+M[0,8,2,1])/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + -8*yt^2*g3^2*s/t//fixConvention//removeMissing, + TestID->"\!\(\*SuperscriptBox[\(t\[Phi]\), \(-\)]\)->bg" +]]; + + +(* ::Subsubsection:: *) +(*O(yt^4)*) + + +(*tt->hh*) +AppendTo[testList, +TestCreate[ + 1/2*M[0,0,5,5]/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + (3 t yt^4)/(2 u)+(3 u yt^4)/(2 t)//fixConvention//removeMissing, + TestID->"tt->hh" +]]; +(*tt->\[Phi]0\[Phi]0*) +AppendTo[testList, +TestCreate[ + 1/2*M[0,0,6,6]/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + (3 t yt^4)/(2 u)+(3 u yt^4)/(2 t)//fixConvention//removeMissing, + TestID->"tt->\[Phi]0\[Phi]0" +]]; + + +(*tt->\[Phi]^+\[Phi]^-*) +AppendTo[testList, +TestCreate[ + 1/2*(M[0,0,7,7]+M[0,0,8,8])/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + 3*yt^4*u/t//fixConvention//removeMissing, + TestID->"tt->\!\(\*SuperscriptBox[\(\[Phi]\), \(+\)]\)\!\(\*SuperscriptBox[\(\[Phi]\), \(-\)]\)" +]]; + + +(*tt->h\[Phi]0*) +AppendTo[testList, +TestCreate[ + 1/2*M[0,0,5,6]/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + (3 t yt^4)/(2 u)+(3 u yt^4)/(2 t)//fixConvention//removeMissing, + TestID->"tt->h\[Phi]0" +]]; + + +(*tt->h\[Phi]+*) +AppendTo[testList, +TestCreate[ + 1/2*(M[0,1,5,8]+M[0,1,8,5])/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + 3/2*yt^4*u/t//fixConvention//removeMissing, + TestID->"tt->\!\(\*SuperscriptBox[\(h\[Phi]\), \(+\)]\)" +]]; +(*tt->\[Phi]0\[Phi]+*) +AppendTo[testList, +TestCreate[ + 1/2*(M[0,1,6,8]+M[0,1,8,6])/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + 3/2*yt^4*u/t//fixConvention//removeMissing, + TestID->"tt->\!\(\*SuperscriptBox[\(\[Phi]0\[Phi]\), \(+\)]\)" +]]; + + +(*th->ht*) +AppendTo[testList, +TestCreate[ + 1/2*M[0,5,5,0]/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + -3/2*yt^4*s/t//fixConvention//removeMissing, + TestID->"th->th" +]]; +(*th->\[Phi]0t*) +AppendTo[testList, +TestCreate[ + 1/2*M[0,5,6,0]/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + -3/2*yt^4*s/t//fixConvention//removeMissing, + TestID->"th->\[Phi]0t" +]]; +(*t\[Phi]0->ht*) +AppendTo[testList, +TestCreate[ + 1/2*M[0,6,5,0]/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + -3/2*yt^4*s/t//fixConvention//removeMissing, + TestID->"t\[Phi]0->ht" +]]; +(*t\[Phi]0->\[Phi]0t*) +AppendTo[testList, +TestCreate[ + 1/2*M[0,6,6,0]/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + -3/2*yt^4*s/t//fixConvention//removeMissing, + TestID->"t\[Phi]0->\[Phi]0t" +]]; + + +(*t\[Phi]-->hb*) +AppendTo[testList, +TestCreate[ + 1/2*M[0,8,5,1]/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + 3/2*yt^4*u/t//fixConvention//removeMissing, + TestID->"\!\(\*SuperscriptBox[\(t\[Phi]\), \(-\)]\)->hb" +]]; +(*t\[Phi]-->\[Phi]0b*) +AppendTo[testList, +TestCreate[ + 1/2*M[0,8,6,1]/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + 3/2*yt^4*u/t//fixConvention//removeMissing, + TestID->"\!\(\*SuperscriptBox[\(t\[Phi]\), \(-\)]\)->\[Phi]0b" +]]; + + +(*t\[Phi]+->\[Phi]+t*) +AppendTo[testList, +TestCreate[ + 1/2*M[0,7,7,0]/.MatrixElements/.Thread[UserMasses->0]//fixConvention//removeMissing, + 3*yt^4*u/t//fixConvention//removeMissing, + TestID->"\!\(\*SuperscriptBox[\(t\[Phi]\), \(+\)]\)->\!\(\*SuperscriptBox[\(\[Phi]\), \(+\)]\)t" +]]; + + +(* ::Subsection:: *) +(*Report*) + + +report=TestReport[testList] +report["ResultsDataset"] + + + diff --git a/tests/yukawa.test.json b/tests/yukawa.test.json new file mode 100644 index 0000000..3d634ea --- /dev/null +++ b/tests/yukawa.test.json @@ -0,0 +1,259 @@ +{ + "particles":[ + { + "index":0, + "name":"Phi" + }, + { + "index":1, + "name":"Psi" + }, + { + "index":2, + "name":"Psibar" + } + ], + "matrixElements":[ + { + "externalParticles":[ + 0, + 0, + 0, + 0 + ], + "parameters":[ + "g", + "lam" + ], + "expression":"lam^2 + (3*g^4)\/_s^2 - (2*g^2*lam)\/_s + (g^4*_t^2)\/(_s^2*_u^2) + (2*g^4*_t)\/(_s^2*_u) - (2*g^2*lam*_t)\/(_s*_u) + (2*g^4*_u)\/(_s^2*_t) - (2*g^2*lam*_u)\/(_s*_t) + (g^4*_u^2)\/(_s^2*_t^2)" + }, + { + "externalParticles":[ + 0, + 0, + 1, + 2 + ], + "parameters":[ + "g", + "y" + ], + "expression":"(2*g^2*y^2)\/_s - 4*y^4 + (2*_t*y^4)\/_u + (2*_u*y^4)\/_t" + }, + { + "externalParticles":[ + 0, + 0, + 2, + 1 + ], + "parameters":[ + "g", + "y" + ], + "expression":"(2*g^2*y^2)\/_s - 4*y^4 + (2*_t*y^4)\/_u + (2*_u*y^4)\/_t" + }, + { + "externalParticles":[ + 0, + 1, + 0, + 1 + ], + "parameters":[ + "g", + "y" + ], + "expression":"(-2*g^2*y^2)\/_t + 4*y^4 - (2*_s*y^4)\/_u - (2*_u*y^4)\/_s" + }, + { + "externalParticles":[ + 0, + 1, + 1, + 0 + ], + "parameters":[ + "g", + "y" + ], + "expression":"(-2*g^2*y^2)\/_u + 4*y^4 - (2*_s*y^4)\/_t - (2*_t*y^4)\/_s" + }, + { + "externalParticles":[ + 0, + 2, + 0, + 2 + ], + "parameters":[ + "g", + "y" + ], + "expression":"(-2*g^2*y^2)\/_t + 4*y^4 - (2*_s*y^4)\/_u - (2*_u*y^4)\/_s" + }, + { + "externalParticles":[ + 0, + 2, + 2, + 0 + ], + "parameters":[ + "g", + "y" + ], + "expression":"(-2*g^2*y^2)\/_u + 4*y^4 - (2*_s*y^4)\/_t - (2*_t*y^4)\/_s" + }, + { + "externalParticles":[ + 1, + 0, + 0, + 1 + ], + "parameters":[ + "g", + "y" + ], + "expression":"(-2*g^2*y^2)\/_u + 4*y^4 - (2*_s*y^4)\/_t - (2*_t*y^4)\/_s" + }, + { + "externalParticles":[ + 1, + 0, + 1, + 0 + ], + "parameters":[ + "g", + "y" + ], + "expression":"(-2*g^2*y^2)\/_t + 4*y^4 - (2*_s*y^4)\/_u - (2*_u*y^4)\/_s" + }, + { + "externalParticles":[ + 1, + 1, + 1, + 1 + ], + "parameters":[ + "y" + ], + "expression":"12*y^4" + }, + { + "externalParticles":[ + 1, + 2, + 0, + 0 + ], + "parameters":[ + "g", + "y" + ], + "expression":"(2*g^2*y^2)\/_s - 4*y^4 + (2*_t*y^4)\/_u + (2*_u*y^4)\/_t" + }, + { + "externalParticles":[ + 1, + 2, + 1, + 2 + ], + "parameters":[ + "y" + ], + "expression":"12*y^4" + }, + { + "externalParticles":[ + 1, + 2, + 2, + 1 + ], + "parameters":[ + "y" + ], + "expression":"12*y^4" + }, + { + "externalParticles":[ + 2, + 0, + 0, + 2 + ], + "parameters":[ + "g", + "y" + ], + "expression":"(-2*g^2*y^2)\/_u + 4*y^4 - (2*_s*y^4)\/_t - (2*_t*y^4)\/_s" + }, + { + "externalParticles":[ + 2, + 0, + 2, + 0 + ], + "parameters":[ + "g", + "y" + ], + "expression":"(-2*g^2*y^2)\/_t + 4*y^4 - (2*_s*y^4)\/_u - (2*_u*y^4)\/_s" + }, + { + "externalParticles":[ + 2, + 1, + 0, + 0 + ], + "parameters":[ + "g", + "y" + ], + "expression":"(2*g^2*y^2)\/_s - 4*y^4 + (2*_t*y^4)\/_u + (2*_u*y^4)\/_t" + }, + { + "externalParticles":[ + 2, + 1, + 1, + 2 + ], + "parameters":[ + "y" + ], + "expression":"12*y^4" + }, + { + "externalParticles":[ + 2, + 1, + 2, + 1 + ], + "parameters":[ + "y" + ], + "expression":"12*y^4" + }, + { + "externalParticles":[ + 2, + 2, + 2, + 2 + ], + "parameters":[ + "y" + ], + "expression":"12*y^4" + } + ] +} \ No newline at end of file diff --git a/tests/yukawa.test.m b/tests/yukawa.test.m new file mode 100644 index 0000000..58d5051 --- /dev/null +++ b/tests/yukawa.test.m @@ -0,0 +1,256 @@ +(* ::Package:: *) + +(*Quit[];*) + + +(* Check Mathematica version *) +If[$VersionNumber < 13.3, + Print["The Mathematica testing framework requires Mathematica version ", requiredVersion," or higher. You are using version ", currentVersion, "."]; + Abort[] +]; + +SetDirectory[NotebookDirectory[]]; +(*Put this if you want to create multiple model-files with the same kernel*) +$GroupMathMultipleModels=True; +$LoadGroupMath=True; +<<../src/WallGoMatrix.m + + +(* ::Chapter:: *) +(*Yukawa Model*) + + +(* ::Section:: *) +(*Model*) + + +Group={"U1"}; +RepAdjoint={0}; +RepScalar={{{0},"R"}}; +CouplingName={g1}; + + +RepFermion={{{0},"L"},{{0},"R"}}; + + +(* ::Text:: *) +(*The input for the gauge interactions toDRalgo are then given by*) + + +{gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJC,\[Mu]IJ,Ysff,YsffC}=AllocateTensors[Group,RepAdjoint,CouplingName,RepFermion,RepScalar]; + + +(* \[Sigma] \[Phi] *) +InputInv={{1},{True}}; +LinearTerm=CreateInvariant[Group,RepScalar,InputInv][[1]]; +VLinear=0;(* turned off *)\[Sigma] LinearTerm +\[Lambda]1=GradTadpole[VLinear]; + + +(* 1/2m^2\[Phi]^2 *) +InputInv={{1,1},{True,True}}; +MassTerm=CreateInvariant[Group,RepScalar,InputInv][[1]]; +VMass=msq/2 MassTerm +\[Mu]ij=GradMass[VMass]//SparseArray; + + +(* 1/6\[Gamma]\[Phi]^3 *) +InputInv={{1,1,1},{True,True,True}}; +CubicTerm=CreateInvariant[Group,RepScalar,InputInv][[1]]; +VCubic=\[Gamma]/6 CubicTerm +\[Lambda]3=GradCubic[VCubic]; + + +(* 1/24\[Lambda]\[Phi]^4 *) +InputInv={{1,1,1,1},{True,True,True,True}}; +QuarticTerm=CreateInvariant[Group,RepScalar,InputInv][[1]]; +VQuartic=\[Lambda]/24 MassTerm^2 +\[Lambda]4=GradQuartic[VQuartic]; + + +(* m(Subscript[\[Psi], R]Subscript[\[Psi], L]+Subscript[\[Psi]^+, L]Subscript[\[Psi], R]^+)*) +InputInv={{2,1},{True,True}}; (*Subscript[\[Psi], R]^+Subscript[\[Psi], L]*) +MassTerm1=CreateInvariantFermion[Group,RepFermion,InputInv][[1]] +InputInv={{1,2},{False,False}}; (*Subscript[\[Psi]^+, L]Subscript[\[Psi], R]*) +MassTerm2=CreateInvariantFermion[Group,RepFermion,InputInv][[1]] + + +\[Mu]IJ=m\[Psi]*GradMassFermion[MassTerm1]; +\[Mu]IJC=m\[Psi]*GradMassFermion[MassTerm2]; + + +(* y \[Phi](Subscript[\[Psi], R]Subscript[\[Psi], L]+Subscript[\[Psi]^+, L]Subscript[\[Psi], R]^+)*) +InputInv={{1,2,1},{True,True,True}}; +YukawaDoublet1=CreateInvariantYukawa[Group,RepScalar,RepFermion,InputInv][[1]]//Simplify; +InputInv={{1,1,2},{True,False,False}}; +YukawaDoublet2=CreateInvariantYukawa[Group,RepScalar,RepFermion,InputInv][[1]]//Simplify; + + +Ysff= y*GradYukawa[YukawaDoublet1]; +YsffC=y*GradYukawa[YukawaDoublet2]; + + +ImportModel[Group,gvvv,gvff,gvss,\[Lambda]1,\[Lambda]3,\[Lambda]4,\[Mu]ij,\[Mu]IJ,\[Mu]IJC,Ysff,YsffC,Verbose->False]; + + +(* ::Section:: *) +(*User Input*) + + +(* ::Subsection:: *) +(*SymmetryBreaking*) + + +vev={v}; +SymmetryBreaking[vev] + + +(* ::Subsection:: *) +(*UserInput*) + + +(* +In DRalgo fermions are Weyl. +So to create one Dirac we need +one left-handed and +one right-handed fermion +*) + + +(*Below +rep 1-2 are fermions, +(*rep 3 is a scalar*) +*) +(* scalar *) +RepScalar=CreateParticle[{1},"S"]; + +(* left-handed fermion *) +RepFermionL=CreateParticle[{1},"F"]; + +(* right-handed fermion *) +RepFermionR=CreateParticle[{2},"F"]; + +(*Vector bosons*) +RepZ=CreateParticle[{1},"V"]; + + +(* +These particles do not necessarily have to be out of equilibrium +the remainin particle content is set as light +*) +ParticleList={RepScalar,RepFermionL,RepFermionR}; + + +(*Defining various masses and couplings*) + + +VectorMass=Table[mv,{i,1,RepZ[[1]]//Length}]; +FermionMass=Table[mf,{i,1,Length[gvff[[1]]]}]; +ScalarMass=Table[ms,{i,1,Length[gvss[[1]]]}]; +ParticleMasses={VectorMass,FermionMass,ScalarMass}; +(* +up to the user to make sure that the same order is given in the python code +*) +UserMasses={ms,mf,mf}; +UserCouplings={CouplingName,\[Lambda],\[Gamma],y}//Flatten; + + +(* + output of matrix elements +*) +OutputFile="matrixElements.yukawa"; +SetDirectory[NotebookDirectory[]]; +ParticleName={"Phi","PsiL","PsiR"}; +MatrixElements=ExportMatrixElements[ + OutputFile, + ParticleList, + UserMasses, + UserCouplings, + ParticleName, + ParticleMasses, + {TruncateAtLeadingLog->False,Format->{"json","txt"}}]; + + +MatrixElements + + +(* ::Section:: *) +(*Tests*) + + +file=FileNameJoin[{NotebookDirectory[],"yukawa.test.json"}]; +{particleNames,parameters,FeynMatrixElements}=ImportMatrixElements[file]; + + +insertCouplings={\[Lambda]->lam,\[Gamma]->(g+lam v),y->y}; + + +symmetriseTU[arg_]:=1/2 (arg)+1/2 (arg/.{t->tt}/.{u->t, tt->u}) + + +fixConvention[arg_]:=symmetriseTU[arg/.Thread[UserMasses->0]/.{s->(-t-u)}/.insertCouplings/.v->0]//Expand//Simplify//Expand + + +removeMissing[arg_]:=arg/.M[__]->0/.Missing["KeyAbsent", _]->0 + + +(* ::Subsection:: *) +(*Test hard*) + + +testList={}; + + +(* scalar-scalar scattering*) +AppendTo[testList, +TestCreate[ + M[0,0,0,0]/.MatrixElements//fixConvention//removeMissing, + M[0,0,0,0]/.FeynMatrixElements//fixConvention//removeMissing +]]; + + +(* scalar to fermions *) +AppendTo[testList, +TestCreate[ + Sum[M[0,0,c,d],{c,1,2},{d,1,2}]/.MatrixElements//fixConvention//removeMissing, + Sum[M[0,0,c,d],{c,1,2},{d,1,2}]/.FeynMatrixElements//fixConvention//removeMissing +]]; + + +(* fermions to scalar *) +AppendTo[testList, +TestCreate[ + Sum[M[c,d,0,0],{c,1,2},{d,1,2}]/.MatrixElements//fixConvention//removeMissing, + Sum[1/2 M[c,d,0,0],{c,1,2},{d,1,2}]/.FeynMatrixElements//fixConvention//removeMissing (* explicit 1/2 is due to average over leg 1 *) +]]; + + +(* scalar-fermion scattering *) +AppendTo[testList, +TestCreate[ + Sum[M[0,c,d,0]+M[0,c,0,d],{c,1,2},{d,1,2}]/.MatrixElements//fixConvention//removeMissing, + Sum[M[0,c,d,0]+M[0,c,0,d],{c,1,2},{d,1,2}]/.FeynMatrixElements//fixConvention//removeMissing +]]; + + +(* fermion-scalar scattering *) +AppendTo[testList, +TestCreate[ + Sum[M[c,0,d,0]+M[c,0,0,d],{c,1,2},{d,1,2}]/.MatrixElements//fixConvention//removeMissing, + Sum[1/2 (M[c,0,d,0]+M[c,0,0,d]),{c,1,2},{d,1,2}]/.FeynMatrixElements//fixConvention//removeMissing (* explicit 1/2 is due to average over leg 1 *) +]]; + + +(* fermion-fermion scattering*) +AppendTo[testList, +TestCreate[ + Sum[M[a,b,c,d],{a,1,2},{b,1,2},{c,1,2},{d,1,2}]/.MatrixElements//fixConvention//removeMissing, + Sum[1/2 M[a,b,c,d],{a,1,2},{b,1,2},{c,1,2},{d,1,2}]/.FeynMatrixElements//fixConvention//removeMissing (* explicit 1/2 is due to average over leg 1 *) +]]; + + +report=TestReport[testList] +report["ResultsDataset"] + + +