diff --git a/.clang-tidy b/.clang-tidy index 154c1689d7..cbc43c8bb6 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -20,3 +20,4 @@ Checks: > -readability-else-after-return, -readability-implicit-bool-conversion, -readability-isolate-declaration, + -llvm-include-order diff --git a/.gitattributes b/.gitattributes index 5e1d0cc8ee..bfcfeca423 100644 --- a/.gitattributes +++ b/.gitattributes @@ -84,7 +84,8 @@ model_files/TensorCoupling export-ignore model_files/THDMIIMSSMBCApprox export-ignore model_files/THDMIIEWSBAtMZSemiAnalytic export-ignore model_files/HGTHDMIIMSSMBCApprox export-ignore -model_files/SMtower export-ignore +model_files/SMEFTHiggs export-ignore +model_files/SMEFTHiggsTopDown export-ignore models/fmssm export-ignore models/fmssmn export-ignore diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 0000000000..357b7747c4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,17 @@ +--- +name: Bug +about: Use this template for reporting a bug. +title: "[BUG DESCRIPTION]" +labels: bug +assignees: expander,wkotlarski +--- +### Bug description + +### Steps to reproduce + +### Context information +* Operating system: +* FlexibleSUSY version: +* SARAH version: + +### Anything else diff --git a/.github/ISSUE_TEMPLATE/feature-proposal.md b/.github/ISSUE_TEMPLATE/feature-proposal.md new file mode 100644 index 0000000000..28226923a1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-proposal.md @@ -0,0 +1,10 @@ +--- +name: Feature proposal +about: Use this template to propose a new feature. +title: "[FEATURE DESCRIPTION]" +labels: enhancement +assignees: expander,pathron,wkotlarski +--- +### Feature description + +### Why it is important diff --git a/.github/ISSUE_TEMPLATE/npointfunctions---new-observable-request.md b/.github/ISSUE_TEMPLATE/npointfunctions---new-observable-request.md new file mode 100644 index 0000000000..7c94b4960c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/npointfunctions---new-observable-request.md @@ -0,0 +1,10 @@ +--- +name: NPointFunctions - new observable request +about: Request adding a new observable +title: "[NPointFunctions]" +labels: '' +assignees: uukhas + +--- + +**Specify the observable you'd like to see computed** diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..a64febb26f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +# Set update schedule for GitHub Actions + +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every weekday + interval: "daily" + target-branch: "development" + diff --git a/.github/workflows/package-models.yml b/.github/workflows/package-models.yml index 5a0c86cef6..e4be713a1b 100644 --- a/.github/workflows/package-models.yml +++ b/.github/workflows/package-models.yml @@ -1,4 +1,4 @@ -name: Package models +name: package models on: release: @@ -11,20 +11,21 @@ env: jobs: package-models: name: Create model packages - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest container: - image: navir/opensuseleap-for-flexiblesusy + image: navir/opensuseleap-for-flexiblesusy:latest strategy: matrix: part: [1, 2] env: + FORMCALC_VERSION: '9.10' MODELS: 'E6SSM E6SSMEFTHiggs CE6SSM CMSSM CMSSMSemiAnalytic CMSSMNoFV MSSM MSSMatMGUT MSSMNoFV MSSMNoFVatMGUT SplitMSSM MSSMNoFVatMGUTHimalaya MSSMEFTHiggs NUHMSSMNoFVHimalaya MSSMNoFVHimalaya lowMSSM NUHMSSM HSSUSY NMSSM CNMSSM lowNMSSM lowNMSSMTanBetaAtMZ NUTNMSSM NMSSMEFTHiggs NUTSMSSM SMSSM UMSSM MRSSM2 MRSSMEFTHiggs MSSMRHN TMSSM SM THDMII THDMIIMSSMBC HTHDMIIMSSMBC HGTHDMIIMSSMBC' steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v5 - name: Activate Wolfram Engine env: @@ -40,34 +41,43 @@ jobs: printf "Checking if math command is workings... "; if [[ $(math -run "Print[7 673, $SystemID]; Exit[]" < /dev/null) =~ 4711([^$"\r\n"]*) ]]; then echo ok; else echo fail && exit 1; fi + - name: Install FormCalc + run: | + cd /fs_dependencies/gcc + wget -q -O - https://feynarts.de/formcalc/FormCalc-$FORMCALC_VERSION.tar.gz | tar xzf - + cd FormCalc-$FORMCALC_VERSION + ./compile + echo "AppendTo[\$Path, \"/fs_dependencies/gcc/FormCalc-$FORMCALC_VERSION\"];" >> /root/.WolframEngine/Kernel/init.m + - name: Generate models and SLHA output env: PART: ${{ matrix.part }} run: | models=$(ruby -e "MODELS=ARGV.drop(1); puts MODELS.each_slice(MODELS.length/2).to_a[ARGV[0].to_i-1].join(',')" -- $PART $MODELS) + FS_DEPENDENCIES_DIR="/fs_dependencies/gcc" ./release/generate-models.sh \ --number-of-jobs=2 \ --directory=release/$FS_TAG \ --with-models=$models \ - --with-himalaya-incdir=/Himalaya-g++/include \ - --with-himalaya-libdir=/Himalaya-g++/lib64 \ - --with-tsil-incdir=/tsil-g++ \ - --with-tsil-libdir=/tsil-g++ \ + --with-himalaya-incdir=$FS_DEPENDENCIES_DIR/Himalaya/include \ + --with-himalaya-libdir=$FS_DEPENDENCIES_DIR/Himalaya/lib64 \ + --with-tsil-incdir=$FS_DEPENDENCIES_DIR/tsil \ + --with-tsil-libdir=$FS_DEPENDENCIES_DIR/tsil \ --with-loop-libraries=collier,looptools \ - --with-looptools-incdir=/LoopTools-g++/include \ - --with-looptools-libdir=/LoopTools-g++/lib64 \ - --with-collier-incdir=/COLLIER/include \ - --with-collier-libdir=/COLLIER/lib + --with-looptools-incdir=$FS_DEPENDENCIES_DIR/LoopTools/include \ + --with-looptools-libdir=$FS_DEPENDENCIES_DIR/LoopTools/lib64 \ + --with-collier-incdir=$FS_DEPENDENCIES_DIR/COLLIER/include \ + --with-collier-libdir=$FS_DEPENDENCIES_DIR/COLLIER/lib ./release/generate-slha-output.sh --directory=release/${FS_TAG}-slha - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v5 with: name: models-artifacts_${{ matrix.part }} path: ${{ github.workspace }}/release/${{ env.FS_TAG }} - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v5 with: name: slha-output-artifacts_${{ matrix.part }} path: ${{ github.workspace }}/release/${{ env.FS_TAG }}-slha @@ -75,21 +85,21 @@ jobs: upload-models: name: Upload packages to git needs: package-models - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v5 with: repository: FlexibleSUSY/FlexibleSUSY-generated token: ${{ secrets.PAT }} - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v6 with: name: models-artifacts_1 path: /tmp/models-artifacts - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v6 with: name: models-artifacts_2 path: /tmp/models-artifacts @@ -109,21 +119,21 @@ jobs: upload-slha-outputs: name: Upload SLHA to git needs: package-models - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v5 with: repository: FlexibleSUSY/FlexibleSUSY-slha token: ${{ secrets.PAT }} - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v6 with: name: slha-output-artifacts_1 path: /tmp/slha-output-artifacts - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v6 with: name: slha-output-artifacts_2 path: /tmp/slha-output-artifacts @@ -143,18 +153,18 @@ jobs: upload-release: name: Upload to release needs: package-models - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v5 - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v6 with: name: models-artifacts_1 path: /tmp/models-artifacts - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v6 with: name: models-artifacts_2 path: /tmp/models-artifacts diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml new file mode 100644 index 0000000000..ec182594bb --- /dev/null +++ b/.github/workflows/static-analysis.yml @@ -0,0 +1,43 @@ +name: static analysis + +on: + push: + paths: + - '.github/workflows/static-analysis.yml' + - 'configure' + - 'createmodel' + - 'install-sarah' + - 'createaddon' + - 'config/*.sh' + - 'utils/*.sh' + - 'test/test_*.sh' + + pull_request: + paths: + - '.github/workflows/static-analysis.yml' + - 'configure' + - 'createmodel' + - 'install-sarah' + - 'createaddon' + - 'config/*.sh' + - 'utils/*.sh' + - 'test/test_*.sh' + +jobs: + check-scripts: + runs-on: ubuntu-22.04 + + steps: + + - name: Install shellcheck + run: | + sudo apt-get update -y + sudo apt-get install -y shellcheck + + - name: Checkout + uses: actions/checkout@v5 + + - name: Check scripts + run: | + echo "We assume, that shell understands 'local' command!" + shellcheck -e SC3037 -e SC3043 -S warning configure createmodel install-sarah createaddon config/*.sh utils/*.sh test/test_*.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b343a37116..e125a4b0cd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,9 +10,14 @@ on: - development paths-ignore: - '*.rst' + - '.clang-tidy' + - '.clang-format' - 'AUTHORS' + - 'CITATION.cff' - 'COPYING' - 'doc/**' + - 'install-sarah' + - '.github/ISSUE_TEMPLATE/*' pull_request: branches: @@ -20,9 +25,14 @@ on: - development paths-ignore: - '*.rst' + - '.clang-tidy' + - '.clang-format' - 'AUTHORS' + - 'CITATION.cff' - 'COPYING' - 'doc/**' + - 'install-sarah' + - '.github/ISSUE_TEMPLATE/*' jobs: no-meta: @@ -43,7 +53,7 @@ jobs: brew install gsl - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v5 - name: Install conan run: | @@ -70,7 +80,6 @@ jobs: CXXCOMPILER: ${{ matrix.CXXCOMPILER }} run: | ./configure \ - --with-cxxflags="-std=c++14 -fPIC" \ --with-cxx=$CXXCOMPILER \ --with-optional-modules=test \ --with-loop-libraries=collier,looptools \ @@ -117,24 +126,26 @@ jobs: # forks FS github doesn't try to run tests on their code. if: (!github.event.pull_request && github.repository == 'FlexibleSUSY/FlexibleSUSY') || github.event.pull_request.head.repo.url == 'https://api.github.com/repos/FlexibleSUSY/FlexibleSUSY' - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest container: - image: navir/opensuseleap-for-flexiblesusy:0.6.1 + image: navir/opensuseleap-for-flexiblesusy:0.18.9 strategy: + fail-fast: false matrix: CXXCOMPILER: [g++, clang++] PART: [1, 2] env: - FORMCALC_VERSION: '9.9' - MODELS: 'MSSM CMSSM CMSSMCKM MSSMCPV MSSMNoFV NUHMSSMNoFVHimalaya ScalarLeptoquarks LRLR E6SSM SM THDMII MRSSM2 MRSSM2CKM' + FORMCALC_VERSION: '9.10' + MODELS1: 'MSSM THDMII ScalarLeptoquarks MSSMCPV CMSSM E6SSM CMSSMNoFV CMSSMCPV CMSSMCKM MSSMNoFV NUHMSSMNoFVHimalaya CMSSMSemiAnalytic MSSMNoFVEFTHiggs UMSSM' + MODELS2: 'MRSSM2 LRLR SM MRSSM2CKM S3 NMSSMCPV' steps: # action checks-out our repository directly under $GITHUB_WORKSPACE - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v5 - name: Activate Wolfram Engine env: @@ -146,53 +157,96 @@ jobs: $MY_MATH_PASS EOF printf "Checking if wolframscript command is workings... "; if [ $(wolframscript -code 1+2) -eq 3 ]; then echo OK; else echo fail && exit 1; fi - printf "Checking if math command is workings... "; if [[ $(math -run "Print[7 673, $SystemID]; Exit[]" < /dev/null) =~ 4711([^$"\r\n"]*) ]]; then echo OK; else echo fail && exit 1; fi - name: Install FormCalc run: | - cd / - wget -q -O - http://www.feynarts.de/formcalc/FormCalc-$FORMCALC_VERSION.tar.gz | tar xzf - + cd /fs_dependencies/gcc + wget -q -O - https://feynarts.de/formcalc/FormCalc-$FORMCALC_VERSION.tar.gz | tar xzf - cd FormCalc-$FORMCALC_VERSION ./compile - echo 'AppendTo[$Path, "/FormCalc-$FORMCALC_VERSION"];' >> /root/.WolframEngine/Kernel/init.m + echo "AppendTo[\$Path, \"/fs_dependencies/gcc/FormCalc-$FORMCALC_VERSION\"];" >> /root/.WolframEngine/Kernel/init.m - name: Create models env: PART: ${{ matrix.PART }} run: | - models=$(ruby -e "MODELS=ARGV.drop(1); puts MODELS.each_slice(MODELS.length/2).to_a[ARGV[0].to_i-1].join(' ')" -- $PART $MODELS) + case "$PART" in + "1") models=${MODELS1} ;; + "2") models=${MODELS2} ;; + esac for m in $models; do ./createmodel --name=$m; done + - name: "Set FS dependency directory" + env: + compiler: ${{ matrix.CXXCOMPILER }} + run: | + case "$compiler" in + "g++") echo "FS_DEPENDENCIES_DIR=/fs_dependencies/gcc" >> $GITHUB_ENV ;; + "clang++") echo "FS_DEPENDENCIES_DIR=/fs_dependencies/clang" >> $GITHUB_ENV ;; + *) exit 1 ;; + esac + - name: Configure env: CXXCOMPILER: ${{ matrix.CXXCOMPILER }} PART: ${{ matrix.PART }} run: | - models=$(ruby -e "MODELS=ARGV.drop(1); puts MODELS.each_slice(MODELS.length/2).to_a[ARGV[0].to_i-1].join(',')" -- $PART $MODELS) + case "$PART" in + "1") models=${MODELS1} ;; + "2") models=${MODELS2} ;; + esac + models=$(ruby -e "puts ARGV.join(',')" -- $models) ./configure \ --with-cxx=$CXXCOMPILER \ --with-models=$models \ --with-loop-libraries=collier,looptools \ - --with-looptools-incdir=/LoopTools-$CXXCOMPILER/include \ - --with-looptools-libdir=/LoopTools-$CXXCOMPILER/lib64 \ - --with-collier-incdir=/COLLIER/include \ - --with-collier-libdir=/COLLIER/lib \ + --with-looptools-incdir=$FS_DEPENDENCIES_DIR/LoopTools/include \ + --with-looptools-libdir=$FS_DEPENDENCIES_DIR/LoopTools/lib64 \ + --with-collier-incdir=/fs_dependencies/gcc/COLLIER/include \ + --with-collier-libdir=/fs_dependencies/gcc/COLLIER/lib \ + --enable-higgstools \ + --with-higgstools-incdir=$FS_DEPENDENCIES_DIR/HiggsTools/include \ + --with-higgstools-libdir=$FS_DEPENDENCIES_DIR/HiggsTools/lib64 \ + --enable-lilith \ + --with-lilith=/fs_dependencies/Lilith \ --enable-himalaya \ - --with-himalaya-incdir=/Himalaya-$CXXCOMPILER/include \ - --with-himalaya-libdir=/Himalaya-$CXXCOMPILER/lib64 \ + --with-himalaya-incdir=$FS_DEPENDENCIES_DIR/Himalaya/include \ + --with-himalaya-libdir=$FS_DEPENDENCIES_DIR/Himalaya/lib64 \ --enable-gm2calc \ - --with-gm2calc-incdir=/GM2Calc-$CXXCOMPILER/include \ - --with-gm2calc-libdir=/GM2Calc-$CXXCOMPILER/lib64 \ - --with-tsil-incdir=/tsil-$CXXCOMPILER \ - --with-tsil-libdir=/tsil-$CXXCOMPILER \ + --with-gm2calc-incdir=$FS_DEPENDENCIES_DIR/GM2Calc/include \ + --with-gm2calc-libdir=$FS_DEPENDENCIES_DIR/GM2Calc/lib64 \ + --with-tsil-incdir=$FS_DEPENDENCIES_DIR/tsil \ + --with-tsil-libdir=$FS_DEPENDENCIES_DIR/tsil \ --with-optional-modules=test \ - --enable-librarylink \ - --with-cxxflags="-std=c++14 -O2 -fPIC -Wall -Wpedantic -pipe" + --enable-feynarts \ + --enable-formcalc \ + --enable-librarylink make showbuild + - name: Check if SARAH has changed + run: | + out=$(find /fs_dependencies/mathematica/SARAH-* sarah -type f | xargs -d'\n' -P0 -n1 sha512sum | sort -k 2 | sha512sum | awk '{print $1}') + echo "SARAH_HASH=${out}" >> $GITHUB_ENV + + # If SARAH checksum didn't change + # restore content of Output directory from previous run + - name: Restore cached SARAH outputs + id: cache-sarah-output-restore + uses: actions/cache/restore@v4 + with: + path: Output + key: sarah-outputs-${{ matrix.PART }}-${{ env.SARAH_HASH }} + - name: Make run: make -j2 + - name: Save SARAH outputs + id: cache-sarah-output-save + uses: actions/cache/save@v4 + with: + path: Output + key: ${{ steps.cache-sarah-output-restore.outputs.cache-primary-key }} + - name: Run Mathematica tests run: make -j2 execute-meta-tests @@ -224,11 +278,104 @@ jobs: FLEXIBLESUSY_LOOP_LIBRARY=3 make -j2 execute-compiled-tests execute-shell-tests make clean-test-log + - name: Testing without FormCalc + if: ${{ matrix.PART == 2 }} + env: + CXXCOMPILER: ${{ matrix.CXXCOMPILER }} + run: | + ./configure \ + --with-cxx=$CXXCOMPILER \ + --with-models=SM,MRSSM2 \ + --with-loop-libraries=collier,looptools \ + --with-looptools-incdir=$FS_DEPENDENCIES_DIR/LoopTools/include \ + --with-looptools-libdir=$FS_DEPENDENCIES_DIR/LoopTools/lib64 \ + --with-collier-incdir=/fs_dependencies/gcc/COLLIER/include \ + --with-collier-libdir=/fs_dependencies/gcc/COLLIER/lib \ + --enable-higgstools \ + --with-higgstools-incdir=$FS_DEPENDENCIES_DIR/HiggsTools/include \ + --with-higgstools-libdir=$FS_DEPENDENCIES_DIR/HiggsTools/lib64 \ + --enable-lilith \ + --with-lilith=/fs_dependencies/Lilith \ + --enable-himalaya \ + --with-himalaya-incdir=$FS_DEPENDENCIES_DIR/Himalaya/include \ + --with-himalaya-libdir=$FS_DEPENDENCIES_DIR/Himalaya/lib64 \ + --enable-gm2calc \ + --with-gm2calc-incdir=$FS_DEPENDENCIES_DIR/GM2Calc/include \ + --with-gm2calc-libdir=$FS_DEPENDENCIES_DIR/GM2Calc/lib64 \ + --with-tsil-incdir=$FS_DEPENDENCIES_DIR/tsil \ + --with-tsil-libdir=$FS_DEPENDENCIES_DIR/tsil \ + --with-optional-modules=test \ + --enable-feynarts \ + --disable-formcalc \ + --enable-librarylink + make -j2 + make -j2 execute-meta-tests + make -j2 alltest + for i in {0..3} + do + FLEXIBLESUSY_LOOP_LIBRARY=$i make -j2 execute-compiled-tests execute-shell-tests + make clean-test-log + done + + - name: Testing without Feynarts and FormCalc + if: ${{ matrix.PART == 2 }} + env: + CXXCOMPILER: ${{ matrix.CXXCOMPILER }} + run: | + ./configure \ + --with-cxx=$CXXCOMPILER \ + --with-models=SM,MRSSM2 \ + --with-loop-libraries=collier,looptools \ + --with-looptools-incdir=$FS_DEPENDENCIES_DIR/LoopTools/include \ + --with-looptools-libdir=$FS_DEPENDENCIES_DIR/LoopTools/lib64 \ + --with-collier-incdir=/fs_dependencies/gcc/COLLIER/include \ + --with-collier-libdir=/fs_dependencies/gcc/COLLIER/lib \ + --enable-higgstools \ + --with-higgstools-incdir=$FS_DEPENDENCIES_DIR/HiggsTools/include \ + --with-higgstools-libdir=$FS_DEPENDENCIES_DIR/HiggsTools/lib64 \ + --enable-lilith \ + --with-lilith=/fs_dependencies/Lilith \ + --enable-himalaya \ + --with-himalaya-incdir=$FS_DEPENDENCIES_DIR/Himalaya/include \ + --with-himalaya-libdir=$FS_DEPENDENCIES_DIR/Himalaya/lib64 \ + --enable-gm2calc \ + --with-gm2calc-incdir=$FS_DEPENDENCIES_DIR/GM2Calc/include \ + --with-gm2calc-libdir=$FS_DEPENDENCIES_DIR/GM2Calc/lib64 \ + --with-tsil-incdir=$FS_DEPENDENCIES_DIR/tsil \ + --with-tsil-libdir=$FS_DEPENDENCIES_DIR/tsil \ + --with-optional-modules=test \ + --disable-feynarts \ + --disable-formcalc \ + --enable-librarylink + make -j2 + make -j2 execute-meta-tests + make -j2 alltest + for i in {0..3} + do + FLEXIBLESUSY_LOOP_LIBRARY=$i make -j2 execute-compiled-tests execute-shell-tests + make clean-test-log + done + - name: Testing pack-SM-src if: ${{ matrix.PART == 2 }} env: CXXCOMPILER: ${{ matrix.CXXCOMPILER }} run: | + rm -rf models/SM + ./createmodel --name=SM + ./configure \ + --with-cxx=$CXXCOMPILER \ + --with-models=SM \ + --with-loop-libraries=collier,looptools \ + --with-looptools-incdir=$FS_DEPENDENCIES_DIR/LoopTools/include \ + --with-looptools-libdir=$FS_DEPENDENCIES_DIR/LoopTools/lib64 \ + --with-collier-incdir=/fs_dependencies/gcc/COLLIER/include \ + --with-collier-libdir=/fs_dependencies/gcc/COLLIER/lib \ + --with-optional-modules=test \ + --enable-feynarts \ + --enable-formcalc \ + --disable-compile + make -j2 make pack-SM-src rm -rf models/SM tar -xf SM.tar.gz @@ -236,12 +383,14 @@ jobs: --with-cxx=$CXXCOMPILER \ --with-models=SM \ --with-loop-libraries=collier,looptools \ - --with-looptools-incdir=/LoopTools-$CXXCOMPILER/include \ - --with-looptools-libdir=/LoopTools-$CXXCOMPILER/lib64 \ - --with-collier-incdir=/COLLIER/include \ - --with-collier-libdir=/COLLIER/lib \ - --disable-meta \ - --with-optional-modules=test + --with-looptools-incdir=$FS_DEPENDENCIES_DIR/LoopTools/include \ + --with-looptools-libdir=$FS_DEPENDENCIES_DIR/LoopTools/lib64 \ + --with-collier-incdir=/fs_dependencies/gcc/COLLIER/include \ + --with-collier-libdir=/fs_dependencies/gcc/COLLIER/lib \ + --with-optional-modules=test \ + --enable-feynarts \ + --enable-formcalc \ + --disable-meta make -j2 make -j2 execute-meta-tests make -j2 alltest @@ -252,10 +401,10 @@ jobs: done - name: (Optional) Save logs in case of an error - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v5 if: failure() with: - name: ${{matrix.CXXCOMPILER}}-${{matrix.LOOPLIBRARY}}_test-logs + name: ${{matrix.CXXCOMPILER}}-${{matrix.PART}}_test-logs path: | config.* test/test_*.log diff --git a/.gitignore b/.gitignore index ff5194e0a5..67e457bb8c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ *.pc *.x *.json +**/*.swp src/loop_libraries/libcollier_wrapper.mod src/loop_libraries/libcollier_wrapper.f90 @@ -92,7 +93,7 @@ test/test_MSSM_matching_selfenergy_Fd.cpp test/test_SM_cxxdiagrams.cpp test/FlexibleDecay.mk test/test_MRSSM2_FFMassiveV_form_factors.hpp -test/test_MRSSM2_f_to_f_conversion.cpp +test/test_MRSSM2_l_to_l_conversion.cpp test/test_looplibrary_*.cpp !test/test_looplibrary_environment.cpp diff --git a/AUTHORS b/AUTHORS index e98f260cc7..bba60e1848 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,12 +2,17 @@ FlexibleSUSY authors ==================== Peter Athron peter.athron@coepp.org.au -Markus Bach Markus.Bach1@mailbox.tu-dresden.de -Dylan Harries harries@ipnp.mff.cuni.cz -Wojciech Kotlarski wojciech.kotlarski@tu-dresden.de -Thomas Kwasnitza Thomas.Kwasnitza@mailbox.tu-dresden.de +Wojciech Kotlarski wojciech.kotlarski@ncbj.gov.pl Jae-hyeon Park jhpark@kias.re.kr -Tom Steudtner T.Steudtner@sussex.ac.uk -Dominik Stöckinger Dominik.Stoeckinger@tu-dresden.de -Alexander Voigt Alexander.Voigt@physik.rwth-aachen.de -Jobst Ziebell Jobst.Ziebell@tu-dresden.de +Dominik Stöckinger dominik.stoeckinger@tu-dresden.de +Alexander Voigt alexander.voigt@physik.rwth-aachen.de + +former authors +==================== + +Markus Bach +Dylan Harries +Uladzimir Khasianevich +Thomas Kwasnitza +Tom Steudtner +Jobst Ziebell diff --git a/CHANGES.rst b/CHANGES.rst index f652b2f082..59fdde8b0b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,11 +1,294 @@ +FlexibleSUSY 2.9.1 [??, ?? 2025] +=================================== + +New features +------------ + +* Moved to C++20. This increased the minimal supported version of compilers to + g++ >= 8.0.0 or clang++ >= 10.0.0. + +Fixed bugs +---------- + +* [commit 23011a7]: Fixed clean fall-back to 2-loop precision if an + error in the calculation of the 3-loop contributions occurs in + FlexibleEFTHiggs. + + +FlexibleSUSY 2.9.0 [April, 06 2025] +=================================== + +New features +------------ + +* Option to validate a neutral Higgs sector of the model by linking + FlexibleSUSY with HiggsTools_ or Lilith_. + + Example in ``THDMII``:: + + HIGGSTOOLS_DIR=/path/to/HiggsTools + LILITH_DIR=/path/to/Lilith + HSDATABASE_DIR=/path/to/HiggsSignals/Database + HBDATABASE_DIR=/path/to/HiggsBounds/Database + + ./createmodel --name=THDMII -f + + ./configure --with-models=THDMII \ + --enable-himalaya \ + --with-higgstools-incdir=${HIGGSTOOLS_DIR}/include \ + --with-higgstools-libdir=${HIGGSTOOLS_DIR}/lib64 \ + --with-lilith=${LILITH_DIR} + + make + + models/THDMII/run_THDMII.x \ + --slha-input-file=models/THDMII/LesHouches.in.THDMII \ + --higgssignals-dataset=${HSDATABASE_DIR} \ + --higgsbounds-dataset=${HBDATABASE_DIR} + + Decays computation requires use of a dedicated loop library (here Collier). + HiggsTools and Lilith are called only if appropriate flags in FlexibleDecay + block have been turned on. By default we use a default Lilith database file. + This can be changed by using the ``--lilith-db`` option of ``run_${MODEL}.x`` + and providing the full path to Lilith's ``.list`` file (e.g. ``run_THDMII.x + --lilith-db=/path/latestRun2.list``). + +* Calculate unitarity constraints in :math:`$s\to \infty$` limit. This is a wrapper + over SARAH results [`1805.07306 `_]. + +* Added shooting algorithm to solve the boundary value problem for + FlexibleEFTHiggs models. The shooting algorithm allows for + resummation of certain higher-order contributions (such as + :math:`$x_t$` in the MSSM) and for the inclusion of 2- and 3-loop + contributions to the Higgs pole mass in FlexibleEFTHiggs models, + leading to an improved precision of the lightest Higgs pole mass + prediction in supersymmetric models such as the MSSM or NMSSM + [`arXiv:2003.04639 `_]. + + To enable the shooting algorithm for a FlexibleEFTHiggs model, add + to the FlexibleSUSY model file (see + e.g. ``NUHMSSMNoFVHimalayaEFTHiggs``):: + + FSBVPSolvers = { ShootingSolver }; + + To use 2- and 3-loop contributions to the Higgs boson pole mass in + the MSSM-limit (in non-minimal supersymmetric models such as the + NMSSM), add the following lines to the FlexibleSUSY model file (see + e.g. ``NMSSMEFThiggs``):: + + FSMSSMLimit = { + {\[Kappa], FSGaugeLess}, + {\[Lambda], FSGaugeLess}, + {vS, Sqrt[2] MuInput/FSGaugeLess}, + {T[\[Lambda]], ALambdaInput FSGaugeLess}, + {T[\[Kappa]], AKappaInput FSGaugeLess} + }; + + Supported models: ``NUHMSSMNoFVHimalayaEFTHiggs`` (3-loop precision, + requires Himalaya) and ``NMSSMEFTHiggs`` (3-loop precision). + + Example (``NUHMSSMNoFVHimalayaEFTHiggs``):: + + HIMALAYA_DIR=/path/to/Himalaya-4.2.3 + + ./createmodel --name=NUHMSSMNoFVHimalayaEFTHiggs -f + + ./configure --with-models=NUHMSSMNoFVHimalayaEFTHiggs \ + --enable-himalaya \ + --with-himalaya-incdir=${HIMALAYA_DIR}/include \ + --with-himalaya-libdir=${HIMALAYA_DIR}/build + + make + + models/NUHMSSMNoFVHimalayaEFTHiggs/run_NUHMSSMNoFVHimalayaEFTHiggs.x \ + --slha-input-file=models/NUHMSSMNoFVHimalayaEFTHiggs/LesHouches.in.NUHMSSMNoFVHimalayaEFTHiggs + + Thanks to Thomas Kwasnitza, Dominik Stöckinger and Alexander Voigt. + +Fixed bugs +---------- + +* Fixed wrong colour factor in decays with an external color octet, triplet, + anti-triplet combination, e.g. squark to quark and gluino or sgluon to squark + anti-squark. + +* Fixed problem with linking with python3 library if it was installed in + a non-standard location. + +FlexibleSUSY 2.8.0 [February, 23 2024] +====================================== + +New features +------------ + +* Added an option to calculate new, user defined observables using + NPointFunctions module [`2402.14630 `_]. + Example application is the calculation of leptonic processes :math:`$l \to + l'$` conversion in the nuclei and :math:`$l \to 3l'$` decay, which now can be + trivially enabled in all supported models. In general, NPointFunctions allows + to compute tree-level and loop amplitudes from within FlexibleSUSY and employ + them in the calculation of a user-requested observable. Potential further + applications include calculation of amplitudes relevant to :math:`$B_s \to + \mu^+ \mu^-$` or Higgs boson decays. + +* Moved to C++17. This increased the minimal supported version of compilers to + g++ >= 7.0.0 or clang++ >= 4.0.0 or icpc >= 18.0.0. + +* Allow user to calculate the anomalous magnetic moment of the muon + :math:`$a_\mu$` in 2HDM-like models with `GM2Calc 2`_ + [`2110.13238 `_]. See the + FlexibleSUSY model `THDMII` (`model_files/THDMII/FlexibleSUSY.m.in`) + for an example. + +* Allow user to calculate anomalous magnetic moment of electron and tau. + + The old syntax for requesting calculation of muon g-2:: + + ExtraSLHAOutputBlock s = { + {FlexibleSUSYLowEnergy, { + {21, FlexibleSUSYObservable`aMuon}} + } + }; + + has been replaced with syntax analogues to requesting calculation of electric + dipole moments:: + + ExtraSLHAOutputBlocks = { + {FlexibleSUSYLowEnergy, { + {20, FlexibleSUSYObservable`AMM[Fe[1]]}, + {21, FlexibleSUSYObservable`AMM[Fe[2]]}, + {22, FlexibleSUSYObservable`AMM[Fe[3]]} + } + }; + +* Added 1-loop vector diagram contributions to leptons + :math:`$(g-2)/2$`, EDMs and to :math:`$b \to s \gamma$`. + + Thanks to Douglas Jacob. + +* Added 2-loop Barr-Zee contributions to leptons :math:`$(g-2)/2$`. + + Thanks to Felix Reichenbach and Alexander Voigt. + +* SLHA output now includes the `EFFHIGGSCOUPLINGS` block containing + loop-induced couplings of neutral Higgses. This block can be used by a SARAH + generated UFO and CalcHEP models (the latter one being also used by + micrOMEGAs). + +Fixed bugs +---------- + +* [commit 1ffb4f7]: Fixed incorrect quark charge in some higher order QED + corrections to up-type quark decays of :math:`$H$` and :math:`$A$`. + +* [commit c90028444]: Fixed wrong vertex in 2-loop corrections to :math:`$A\to d\bar{d}$` + (see Eq. 20 of `2106.05038 `_). Numerical + impact negligible. + +* [commit d5911ca7a]: Higher order corrections to :math:`$A\to gg$` were not applied. + +* [commit 626fdf5]: Widths of pseudoscalar and singly charged Higgses were computed + incorectly for Higgses lighter than respective Goldstone bosons. + +FlexibleSUSY 2.7.1 [June, 07 2022] +================================== + +Fixed bugs +---------- + +* [commit b80d8821e]: Fixed compilation error in models with + semi-analytic RGE solver. + + +FlexibleSUSY 2.7.0 [June, 06 2022] +================================== + +New features +------------ + +* Improved W boson pole mass prediction with decoupling property, see + [`2204.05285 `_] + + +FlexibleSUSY 2.6.2 [April, 29 2022] +====================================== + +New features +------------ + +* Parallelized calculation of decay amplitudes during the mathematica phase. + + Example speedup: + + .. list-table:: + :widths: 25 25 50 + :header-rows: 1 + + * - model + - sequential + - parallel + * - `MSSM` + - 190s + - 140s + * - `MRSSM2` + - 555s + - 395s + +Changes +------- + +* [commit ae1eae8e4d]: Mathematica-style indexing (starting from 1) of + leptons in :math:`$l' \to l \gamma$` via the mathlink interface. + +Fixed bugs +---------- + +* [commit 26f5262ad3]: Branching ratio of :math:`$l' \to l \gamma$` + was breaking printing of observables via the mathlink interface. + +* [commit fd8d59dda8]: Fixed wrong calculation of :math:`$A \to Z \gamma$`. + +* [commit b82d0d2123]: Set SSV decay amplitude to zero if vector boson + is massless. + +* [commit 768c092dff]: Handle colour deltas in models where there are + fundamental (i.e. unconjugated) fields in 3 and -3 representations. + +* [commit 102ae79f0f]: Temporarily enforce calculation of pole masses + in ``FSFindRoot`` and ``FSMinimize``. + +* [commit d16a9b68f1]: Use user-provided precision goal in + ``FSFindRoot`` and ``FSMinimize``. + +FlexibleSUSY 2.6.1 [July, 08 2021] +================================== + +Changes +------- + +* Removed code computing Higgs effective couplings. This code has been + superseded by FlexibleDecay. +* FlexibleDecay: 2-loop QCD corrections to :math:`$\Phi \to \gamma Z$` applied + only if :math:`$m_Z/m_\Phi < 0.75$`. + +Fixed bugs +---------- + +* [commit 21ed4cc6b]: Fix error in FFV form factors module cased by models where + SARAH generates non zero photon (gluon) couplings to QED (QCD) singlets. + +* [commit a0bbda569]: Correcting check for required Mathematica version + 11.0, needed by FlexibleDecay. + FlexibleSUSY 2.6.0 [June, 10 2021] ================================== New features ------------ -* FlexibleDecay [`arXiv:2106.05038 `_] - calculation of scalar decays with an emphasis on - Higgs decays and featuring decoupling behaviour for large BSM masses. +* FlexibleDecay [`arXiv:2106.05038 `_] + - calculation of scalar decays with an emphasis on Higgs decays and + featuring decoupling behaviour for large BSM masses. Changes ------- @@ -2261,8 +2544,11 @@ FlexibleSUSY-0.5 [November 18, 2013] .. _Conan: https://conan.io/ .. _Eigen 3: http://eigen.tuxfamily.org .. _GM2Calc: https://arxiv.org/abs/1510.08071 +.. _GM2Calc 2: https://arxiv.org/abs/2110.13238 .. _MhEFT: https://gabrlee.com/code/ .. _FeynArts: http://www.feynarts.de .. _FormCalc: http://www.feynarts.de/formcalc .. _LoopTools: http://www.feynarts.de/looptools/ .. _TSIL: https://www.niu.edu/spmartin/tsil/ +.. _HiggsTools: https://gitlab.com/higgsbounds/higgstools +.. _Lilith: https://github.com/sabinekraml/Lilith-2 diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000000..e07b3b4c3b --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,37 @@ +cff-version: 1.2.0 +title: FlexibleSUSY +type: software +authors: + - given-names: Peter + family-names: Athron + email: peter.athron@coepp.org.au + orcid: 'https://orcid.org/0000-0003-2966-5914' + - given-names: Wojciech + family-names: Kotlarski + email: wojciech.kotlarski@ncbj.gov.pl + orcid: 'https://orcid.org/0000-0002-1191-6343' + affiliation: National Centre for Nuclear Research + - given-names: Jae-hyeon + family-names: Park + email: jhpark@kias.re.kr + - given-names: Dominik + family-names: Stöckinger + email: dominik.stoeckinger@tu-dresden.de + affiliation: TU Dresden + - given-names: Alexander + family-names: Voigt + email: alexander.voigt@physik.rwth-aachen.de + orcid: 'https://orcid.org/0000-0001-8963-6512' +identifiers: + - type: doi + value: 10.1016/j.cpc.2014.12.020 + description: Comput. Phys. Commun. 190 (2015) 139-172 + - type: doi + value: 10.1016/j.cpc.2018.04.016 + description: Comput. Phys. Commun. 230 (2018) 145-217 +repository-code: 'https://github.com/FlexibleSUSY/FlexibleSUSY' +url: 'https://github.com/FlexibleSUSY/FlexibleSUSY' +license: GPL-3.0 +commit: 70b351f4c760c3794109a432f7457a6dc82d85a2 +version: 2.8.0 +date-released: '2024-02-28' diff --git a/README.rst b/README.rst index 49299e38b3..e3c98e93ef 100644 --- a/README.rst +++ b/README.rst @@ -4,11 +4,15 @@ FlexibleSUSY ============ -|release| |tests| +|release| |commits-since| |static-analysis| |tests| .. |release| image:: https://img.shields.io/github/v/release/FlexibleSUSY/FlexibleSUSY -.. |tests| image:: https://github.com/FlexibleSUSY/FlexibleSUSY/workflows/tests/badge.svg?branch=development - :target: https://github.com/FlexibleSUSY/FlexibleSUSY/actions +.. |commits-since| image:: https://img.shields.io/github/commits-since/FlexibleSUSY/FlexibleSUSY/latest/development + :alt: GitHub commits since latest release (by SemVer including pre-releases) +.. |static-analysis| image:: https://github.com/FlexibleSUSY/FlexibleSUSY/workflows/static%20analysis/badge.svg?branch=development + :target: https://github.com/FlexibleSUSY/FlexibleSUSY/actions/workflows/static-analysis.yml +.. |tests| image:: https://github.com/FlexibleSUSY/FlexibleSUSY/actions/workflows/tests.yml/badge.svg?branch=development + :target: https://github.com/FlexibleSUSY/FlexibleSUSY/actions/workflows/tests.yml .. image:: doc/images/FS-logo.png :align: right @@ -22,7 +26,7 @@ modification, extension and reuse. * Mailing list: flexiblesusy@projects.hepforge.org * Source code repository: https://github.com/FlexibleSUSY * Bug reports: https://github.com/FlexibleSUSY/FlexibleSUSY/issues -* References: [1406.2319]_, [1609.00371]_, [1710.03760]_ +* References: [1406.2319]_, [1609.00371]_, [1710.03760]_, [2204.05285]_ If you use **FlexibleSUSY** in your work please cite [1406.2319]_ and [1710.03760]_. @@ -34,8 +38,21 @@ modification, extension and reuse. please cite [1005.5709]_, [1708.05720]_, [1807.03509]_ and [1910.03595]_. - If you use **FlexibleDecay** in your work, please cite - [2106.05038]_. + If you use **FlexibleSUSY+GM2Calc** in your work, please cite + [1510.08071]_ and (if appropriate) [2110.13238]_. + + If you use **FlexibleDecay** in your work, please cite [2106.05038]_ and + [1211.2099]_. If you compute Higgs-physics constrainst using HiggsTools or + Lilith please also cite [2502.XXXXX]_ and (as appropriate) [2210.09332]_ or + [1502.04138]_, [1908.03952]_, [2012.11408]_. + + If you use the W boson pole mass prediction in FlexibleSUSY 2.7.0 + (or later), please cite [2204.05285]_. + + If you use **NPointFunctions** in your work, please cite [2402.14630]_. + + If you use unitarity constraints please cite [XXXX.XXXXX]_ and necessarily + [1805.07306_]. FlexibleSUSY depends on SARAH_ and contains components from SOFTSUSY_. Therefore, please also cite the following publications @@ -54,7 +71,9 @@ modification, extension and reuse. Quick start =========== -Install required libraries and packages (if not already done):: +Install required libraries and packages (if not already done) + +.. code-block:: shell pip install conan conan install . --build=missing @@ -62,13 +81,17 @@ Install required libraries and packages (if not already done):: ./install-sarah Build a spectrum generator (here: HSSUSY [1710.03760]_ -[1804.09410]_):: +[1804.09410]_) + +.. code-block:: shell ./createmodel --name=HSSUSY ./configure --with-models=HSSUSY make -j4 -Run the spectrum generator:: +Run the spectrum generator + +.. code-block:: shell ./models/HSSUSY/run_HSSUSY.x --slha-input-file=model_files/HSSUSY/LesHouches.in.HSSUSY @@ -79,9 +102,9 @@ Building FlexibleSUSY Requirements ------------ -* C++ compiler (g++ >= 5.0.0 or clang++ >= 3.8.1 or icpc >= 17.0.0) +* C++20 compiler (g++ >= 8.0.0 or clang++ >= 10.0.0 or icpc >= 18.0.0) * Fortran compiler (gfortran, ifort) -* Mathematica (version 7.0 or higher) +* `Mathematica/Wolfram Engine`_ (version 11.0 or higher) * SARAH_ (version 4.11.0 or higher) * Boost_ (version 1.37.0 or higher) * `Eigen 3`_ (version 3.1 or higher) @@ -89,10 +112,12 @@ Requirements Optional: -* FeynArts_ (version 3.9 or higher) -* FormCalc_ (version 9.5 or higher) -* GM2Calc_ (version 1.7.0 or higher) +* FeynArts_ (version 3.10 or higher) +* FormCalc_ (version 9.8 or higher) +* GM2Calc_ (version 2.1.0 or higher) * LoopTools_ (version 2.8 or higher) +* HiggsTools_ (version 1.1.4 or higher) +* Lilith_ (requires Python3 development files) * COLLIER_ * Himalaya_ * TSIL_ @@ -100,22 +125,32 @@ Optional: Installation of required/optional libraries ------------------------------------------- +The required libraries Boost_, `Eigen 3`_ and `GNU scientific library`_ and the +optionally required Python3 development files can usually be installed via the +package manager of the operating system. +On Debian/Ubuntu one may run for example + +.. code-block:: shell + + sudo apt-get install libboost-all-dev libeigen3-dev libgsl-dev python3-dev + The required and optional libraries Boost_, `Eigen 3`_, GM2Calc_, -LoopTools_, Himalaya_ and TSIL_ can be installed using the Conan_ +LoopTools_, Himalaya_ and TSIL_ can be also installed using the Conan_ package manager. If not already installed, Conan can be installed -with pip:: +with pip + +.. code-block:: shell pip install conan -To install the libraries required by FlexibleSUSY, run:: +To install the libraries required by FlexibleSUSY, run + +.. code-block:: shell conan install . --build=missing The `GNU scientific library`_ can currently not be installed via -Conan_. One may use the package manager of the operating system to -install it. On Debian/Ubuntu one may run for example:: - - sudo apt-get install libgsl-dev +Conan_. If the required libraries are installed via Conan or the operating system's package manager, they will be found automatically by @@ -126,9 +161,11 @@ Installation of SARAH FlexibleSUSY requires SARAH to be installed and to be loadable with the ``Needs["SARAH`"]`` command from inside Mathematica. We recommend -the following setup:: +the following setup + +.. code-block:: shell - SARAH_VERSION=4.14.3 + SARAH_VERSION=4.15.4 cd ~/.Mathematica/Applications/ wget https://sarah.hepforge.org/downloads/SARAH-${SARAH_VERSION}.tar.gz tar -xf SARAH-${SARAH_VERSION}.tar.gz @@ -138,7 +175,9 @@ the following setup:: echo "AppendTo[\$Path, \"${HOME}/.Mathematica/Applications/SARAH/\"];" >> init.m All the above steps can be executed at once with the ``install-sarah`` -script:: +script + +.. code-block:: shell ./install-sarah @@ -151,7 +190,9 @@ If you want FlexibleSUSY to use FeynArts_ or FormCalc_ you will need to install these packages first. Also — as with SARAH — they need to be loadable with the ``Needs[]`` command from inside Mathematica. We recommend using the installation script ``FeynInstall`` provided on -the FeynArts web page. e.g.:: +the FeynArts web page. e.g. + +.. code-block:: shell cd ~/.local wget http://www.feynarts.de/FeynInstall @@ -175,7 +216,9 @@ Building a FlexibleSUSY model already plenty of pre-installed model files in FlexibleSUSY's and SARAH's model directories that can be used. -1. Create a new or re-initialize an existing FlexibleSUSY model:: +1. Create a new or re-initialize an existing FlexibleSUSY model + + .. code-block:: shell ./createmodel --name= @@ -193,7 +236,9 @@ Building a FlexibleSUSY model documentation of the `FlexibleSUSY model file`_ and `FlexibleEFTHiggs`_. -2. Create the Makefile and register your model(s):: +2. Create the Makefile and register your model(s) + + .. code-block:: shell ./configure --with-models= @@ -214,7 +259,9 @@ Building a FlexibleSUSY model * ``models//run_.x``: command line spectrum generator * ``models//run_.m``: Mathematica interface -Example:: +Example + +.. code-block:: shell ./createmodel --name=HSSUSY ./configure --with-models=HSSUSY @@ -252,13 +299,17 @@ Command line For each model FlexibleSUSY creates an executable ``models//run_.x`` that can be run from the command line. The executable accepts the input in the SLHA format, for -example in form of a file:: +example in form of a file + +.. code-block:: shell ./models/MSSM/run_MSSM.x \ --slha-input-file=models/MSSM/LesHouches.in.MSSM \ --slha-output-file=LesHouches.out.MSSM -or as a stream:: +or as a stream + +.. code-block:: shell cat models/MSSM/LesHouches.in.MSSM \ | ./models/MSSM/run_MSSM.x --slha-input-file=- --slha-output-file=LesHouches.out.MSSM @@ -267,7 +318,9 @@ For a documentation of FlexibleSUSY-specific switches in the SLHA input see the section on `SLHA input parameters`_. By default the executable writes the output in SLHA format to stdout. -The output can also be appended to an SQLite database:: +The output can also be appended to an SQLite database + +.. code-block:: shell ./models/MSSM/run_MSSM.x \ --slha-input-file=models/MSSM/LesHouches.in.MSSM \ @@ -282,7 +335,9 @@ Mass spectrum and renormalization group running The pole mass spectrum and the RG flow can be written to text files for easy plotting. In the MSSM for example these text files can be -generated via:: +generated via + +.. code-block:: shell ./models/MSSM/run_MSSM.x \ --slha-input-file=model_files/MSSM/LesHouches.in.MSSM \ @@ -291,7 +346,9 @@ generated via:: The generated files ``MSSM_rgflow.dat`` and ``MSSM_spectrum.dat`` can be plotted for example with the gnuplot scripts in the model -directory:: +directory + +.. code-block:: shell gnuplot -persist -e "filename='MSSM_spectrum.dat'" \ models/MSSM/MSSM_plot_spectrum.gnuplot @@ -330,10 +387,10 @@ Example ]; (* calculate pole mass spectrum *) - FSCMSSMCalculateSpectrum[handle] + FSCMSSMCalculateSpectrum[handle]; (* calculate observables *) - FSCMSSMCalculateObservables[handle] + FSCMSSMCalculateObservables[handle]; (* close the model handle *) FSCMSSMCloseHandle[handle]; @@ -341,7 +398,9 @@ Example For each model, FlexibleSUSY creates an example Mathematica script which illustrates the use of the Mathematica interface. The generated example can be found in ``models//run_.m`` which can be -run for example as:: +run for example as + +.. code-block:: shell math -run "<< \"models//run_.m\"" @@ -375,7 +434,9 @@ Examples: To perform a scan over :math:`\tan\beta(M_Z)` in the CMSSM (given in the SLHA input file in the ``MINPAR[3]`` field) and print out the the values of :math:`\tan\beta(M_Z)`, :math:`M_h` (``MASS[25]``) and -:math:`y_t(M_{\text{SUSY}})` (``YU[2,2]``) run:: +:math:`y_t(M_{\text{SUSY}})` (``YU[2,2]``) run + +.. code-block:: shell utils/scan-slha.sh \ --spectrum-generator=models/CMSSM/run_CMSSM.x \ @@ -384,7 +445,8 @@ values of :math:`\tan\beta(M_Z)`, :math:`M_h` (``MASS[25]``) and --output=MINPAR[3],MASS[25],YU[2:2] Alternatively, the SLHA input can be piped into the script as -:: + +.. code-block:: shell cat model_files/CMSSM/LesHouches.in.CMSSM \ | utils/scan-slha.sh \ @@ -395,7 +457,9 @@ Alternatively, the SLHA input can be piped into the script as The spectrum generator executable is specified using the ``--spectrum-generator=`` option. The parameter to be scanned over as well as the scan range and the number of steps must be specified using -the ``--scan-range=`` option. The syntax is:: +the ``--scan-range=`` option. The syntax is + +.. code-block:: shell --scan-range=[]=~: @@ -407,7 +471,9 @@ size is linear. Alternatively, a logarithmic step size can be chosen by passing ``--step-size=log`` to the script. See also ``utils/scan-slha.sh --help``. The parameters to print to the output stream must be defined using the ``--output=`` option. The syntax -is:: +is + +.. code-block:: shell --output=[] @@ -423,7 +489,9 @@ Database output As an alternative, all parameters calculated during a scan can be written to a SQLite database using the ``scan-database.sh`` script. -Examples:: +Examples + +.. code-block:: shell utils/scan-database.sh \ --spectrum-generator=models/CMSSM/run_CMSSM.x \ @@ -431,7 +499,9 @@ Examples:: --scan-range=MINPAR[3]=1~30:10 \ --database-output-file=scan.db -or:: +or + +.. code-block:: shell cat model_files/CMSSM/LesHouches.in.CMSSM \ | ./utils/scan-database.sh \ @@ -451,7 +521,9 @@ file (``FlexibleSUSY.m.in``). The conversion is not perfect, because it is usually not unique. Therefore one should check the generated ``FlexibleSUSY.m.in`` file. -Example:: +Example + +.. code-block:: shell cat << EOF | math -noprompt > FlexibleSUSY.m.in sphenoFile = "~/.Mathematica/Applications/SARAH/Models/MSSM/SPheno.m"; @@ -467,7 +539,9 @@ Generating source code files only (no compilation) If you want to only create the C++ source files for your model, but do not want to compile the code, you can use the ``--disable-compile`` -configure option:: +configure option + +.. code-block:: shell ./configure --with-models=MSSM --disable-compile make @@ -482,7 +556,9 @@ Compile only (don't generate source code) ----------------------------------------- If you want to only compile already created the C++ source files for -your model, you can use the ``--disable-meta`` configure option:: +your model, you can use the ``--disable-meta`` configure option + +.. code-block:: shell ./configure --with-models=MSSM --disable-meta make @@ -508,12 +584,15 @@ code for the specified model(s) (but without the Mathematica meta code), can be exported to a new directory. The exported source code is a complete standalone package, with it's own build system. To export the code, one has to set the target directory during -configuration via the ``--with-install-dir=`` option. For example:: +configuration via the ``--with-install-dir=`` option. For example + +.. code-block:: shell ./configure --with-models= --with-install-dir=/path/to/export/directory Afterwards -:: + +.. code-block:: shell make install-src @@ -521,7 +600,9 @@ must be executed, which will copy the generated C++ source code for all ```` to ``/path/to/export/directory``, together with the non-model specific source code from ``config/``, ``doc/``, ``slhaea/`` and ``src/``. Afterwards, the standalone package can be build like -this:: +this + +.. code-block:: shell cd /path/to/export/directory ./configure @@ -532,7 +613,8 @@ the generated source code for a given model, but does not contain the whole FlexibleSUSY build system. This is useful when the source code for a model should be generated on one computer and later transferred to another one to be compiled. To create such a "model package" run -:: + +.. code-block:: shell make pack--src @@ -550,7 +632,9 @@ libraries, which is the default) you need to pass the name extension for the shared libraries as well as the command to build them can be overwritten using the ``--with-shared-lib-ext=`` ``--with-shared-lib-cmd=``. parameters. For example, when Intel -compilers should be used, replace gcc by icc or icpc:: +compilers should be used, replace gcc by icc or icpc + +.. code-block:: shell ./configure --with-models=CMSSM,NMSSM \ --enable-shared-libs \ @@ -564,7 +648,8 @@ This means that, if you for example move the FlexibleSUSY directory to another location, the executables will no longer find the libraries. To make the executables find the libraries again, you have to relink them via -:: + +.. code-block:: shell make clean-executables make allexec @@ -578,12 +663,16 @@ executables by passing ``--enable-static`` to configure. This is useful when the executable should be transferred to another computer, where some libraries are not available. -Example:: +Example + +.. code-block:: shell ./configure --with-models=CMSSM --enable-static If ``--enable-static`` is used, the following linker flags and -additional libraries will be used:: +additional libraries will be used + +.. code-block:: shell LDFLAGS = -static LDLIBS = -ldl @@ -592,7 +681,9 @@ These linker-specific flags and additional libraries can be overwritten using ``--with-static-ldflags=`` and ``--with-static-ldlibs=`` -Example:: +Example + +.. code-block:: shell ./configure --with-models=CMSSM \ --enable-static \ @@ -617,14 +708,18 @@ functions can be used: * FFlite (a thread-safe variant of LoopTools_, shipped with FlexibleSUSY) The loop function libraries can be enabled by passing -``--with-loop-libraries=`` to the ``configure`` script:: +``--with-loop-libraries=`` to the ``configure`` script + +.. code-block:: shell ./configure --with-loop-libraries= where ```` can be any (or a combination) of ``collier``, ``looptools`` or ``fflite``. -Example:: +Example + +.. code-block:: shell ./configure --with-loop-libraries=collier,looptools @@ -657,11 +752,15 @@ LoopTools support It is possible to use LoopTools_ for calculating the loop functions, instead of using SOFTSUSY's loop functions. To enable LoopTools, -configure FlexibleSUSY via :: +configure FlexibleSUSY via + +.. code-block:: shell ./configure --enable-looptools -or:: +or + +.. code-block:: shell ./configure --with-loop-libraries=looptools @@ -670,7 +769,8 @@ automatically find the paths to the LoopTools library. To use the LoopTools library and header files from a specific directory, run ``configure`` via -:: + +.. code-block:: shell LOOPTOOL_DIR=/path/to/looptools/build @@ -681,21 +781,26 @@ directory, run ``configure`` via Note: LoopTools 2.8 or higher is required. Also, if FlexibleSUSY is compiled with LibraryLink (default) then LoopTools has to be compiled with ``-fPIC`` option. This is achieved by setting the ``FFLAGS`` variable during LoopTools configuration as -:: - FFLAGS=-fPIC ./configure +.. code-block:: shell + + FFLAGS="-O3 -fPIC" ./configure COLLIER support ``````````````` It is possible to use COLLIER_ for calculating the loop functions, instead of using SOFTSUSY's loop functions. To enable COLLIER -configure FlexibleSUSY via :: +configure FlexibleSUSY via + +.. code-block:: shell ./configure --with-loop-libraries=collier To use the COLLIER library and header files from a specific -directory configure via :: +directory configure via + +.. code-block:: shell COLLIER_DIR=/path/to/COLLIER-x.y.z @@ -715,7 +820,9 @@ such models are activated (via ``./configure --with-models=``), FlexibleSUSY requires TSIL to be available. If TSIL is installed in a system directory or installed via Conan_, FlexibleSUSY will find the TSIL automatically. To use TSIL from a a non-standard directory, -configure FlexibleSUSY like this:: +configure FlexibleSUSY like this + +.. code-block:: shell $TSIL_DIR=/path/to/tsil @@ -724,17 +831,63 @@ configure FlexibleSUSY like this:: --with-tsil-libdir=$TSIL_DIR Note also that TSIL must be compiled with ``-fPIC``, which can be -achieved by setting in the TSIL ``Makefile``:: +achieved by setting in the TSIL ``Makefile`` + +.. code-block:: shell TSIL_OPT = -O3 -funroll-loops -fPIC +Linking with other external libraries +------------------------------------- + +HiggsTools support +`````````````````` + +It is possible to check consistency of a BSM Higgs sector with experimental +data using HiggsTools_. To enable HiggsTools, configure FlexibleSUSY as + +.. code-block:: shell + + HIGGSTOOLS_DIR=/path/to/higgstools + ./configure --with-higgstools-incdir=$HIGGSTOOLS_DIR/include \ + --with-higgstools-libdir=$HIGGSTOOLS_DIR/lib64 + +Note that depending on the system, HiggsTools library is installed either in +`lib` or `lib64` directory. At runtime user has to provide directories +containing HiggsSignals and HiggsBounds datasets (which are downloaded +separatelly from HiggsTools) as + +.. code-block:: shell + + models//run_.x --higgsbounds-dataset=/path/to/HB/datasetdir \ + --higgssignals-dataset=/path/to/HS/datasetdir + +Lilith support +`````````````` + +It is possible to check consistency of a BSM Higgs sector with experimental +data using Lilith_. To enable Lilith, configure FlexibleSUSY as + +.. code-block:: shell + + ./configure --with-lilith=/path/to/Lilith + +At runtime user can provide the Lilith database `.list` file + +.. code-block:: shell + + models//run_.x --lilith-db=/path/to/Lilith/database/file + +If not provided, the default file will be used. Creating an addon ----------------- A FlexibleSUSY addon is a program or library, which uses parts of the FlexibleSUSY libraries or the generated models or is integrated into -FlexibleSUSY. An addon can be created via :: +FlexibleSUSY. An addon can be created via + +.. code-block:: shell ./createaddon --name= @@ -744,20 +897,24 @@ module ``addons//module.mk``. If an addon has been created with the above script, the user may edit the makefile module (``addons//module.mk``) to add source files in to the three variables -:: + +.. code-block:: shell LIB@ADDON@_SRC # list of source files to be included in library EXE@ADDON@_SRC # list of source files with a main() LIB@ADDON@_HDR # list of header files -Example:: +Example + +.. code-block:: shell LIB@ADDON@_SRC := $(DIR)/file1.cpp EXE@ADDON@_SRC := $(DIR)/run.cpp LIB@ADDON@_HDR := $(DIR)/file1.hpp To configure and compile the addon run -:: + +.. code-block:: shell ./configure --with-addons= make @@ -773,23 +930,29 @@ Creating the source code documentation FlexibleSUSY's source code documentation (including the generated source code files) can be generated with Doxygen in HTML or man -format. To generate the HTML documentation please run:: +format. To generate the HTML documentation please run + +.. code-block:: shell make doc-html The generated HTML index file can then be found in ``doc/html/index.html`` and can be viewed with any HTML browser, e.g. -:: + +.. code-block:: shell firefox doc/html/index.html -To generate the man documentation please run:: +To generate the man documentation please run + +.. code-block:: shell make doc-man The generated man pages can then be found in ``doc/man/man3/`` and can be viewed as -:: + +.. code-block:: shell man doc/man/man3/model_file_options.3 @@ -865,6 +1028,8 @@ are listed: * ``models/`` This is the output directory where the generated C++ code for the spectrum generators will be stored. +* ``nlohmann/`` contains the nlohmann_ JSON library + * ``Output/`` contains SARAHs model-specific output files * ``sarah/`` contains SARAH model files shipped with FlexibleSUSY @@ -896,7 +1061,7 @@ References ========== .. _slhaea: https://github.com/fthomas/slhaea -.. _GM2Calc: https://arxiv.org/abs/1510.08071 +.. _GM2Calc: https://github.com/GM2Calc/GM2Calc .. _SARAH: http://sarah.hepforge.org .. _SOFTSUSY: http://softsusy.hepforge.org .. _Boost: http://www.boost.org @@ -904,11 +1069,15 @@ References .. _Eigen 3: http://eigen.tuxfamily.org .. _FeynArts: http://www.feynarts.de .. _FormCalc: http://www.feynarts.de/formcalc -.. _GNU scientific library: http://www.gnu.org/software/gsl/ -.. _LoopTools: http://www.feynarts.de/looptools/ -.. _COLLIER: https://collier.hepforge.org/ +.. _GNU scientific library: http://www.gnu.org/software/gsl +.. _HiggsTools: https://gitlab.com/higgsbounds/higgstools +.. _Lilith: https://github.com/sabinekraml/Lilith-2 +.. _`Mathematica/Wolfram Engine`: https://www.wolfram.com +.. _LoopTools: http://www.feynarts.de/looptools +.. _COLLIER: https://collier.hepforge.org .. _Himalaya: https://github.com/Himalaya-Library/Himalaya -.. _TSIL: https://www.niu.edu/spmartin/tsil/ +.. _TSIL: https://www.niu.edu/spmartin/tsil +.. _nlohmann: https://github.com/nlohmann/json .. _`FlexibleSUSY model file`: doc/model_file.rst .. _`FlexibleEFTHiggs`: doc/FlexibleEFTHiggs.rst @@ -919,15 +1088,26 @@ References .. [hep-ph:0104145] `CPC 143 (2002) 305-331 `_ [`arxiv:hep-ph/0104145 `_] .. [0909.2863] `CPC 181 (2010) 1077-1086 `_ [`arxiv:0909.2863 `_] .. [1002.0840] `CPC 182 (2011) 808-833 `_ [`arxiv:1002.0840 `_] -.. [1005.5709] `JHEP 1008 (2010) 104 `_ [`arxiv:1005.5709 `_] +.. [1005.5709] `JHEP 1008 (2010) 104 `_ [`arxiv:1005.5709 `_] .. [1207.0906] `CPC 184 (2013) 1792-1809 `_ [`arxiv:1207.0906 `_] +.. [1211.2099] `Eur. Phys. J. C73 (2013) no. 2, 2310 `_ [`arxiv:1211.2099 `_] .. [1309.7223] `CPC 185 (2014) 1773-1790 `_ [`arxiv:1309.7223 `_] .. [1311.7659] `CPC 185 (2014) 2322 `_ [`arxiv:1311.7659 `_] .. [1406.2319] `CPC 190 (2015) 139-172 `_ [`arxiv:1406.2319 `_] +.. [1510.08071] `Eur. Phys. J. C76 (2016) no. 2, 62 `_ [`arXiv:1510.08071 `_] .. [1609.00371] `JHEP 1701 (2017) 079 `_ [`arxiv:1609.00371 `_] -.. [1708.05720] `Eur.Phys.J. C77 (2017) no.12, 814 `_ [`arxiv:1708.05720 `_] +.. [1708.05720] `Eur. Phys. J. C77 (2017) no. 12, 814 `_ [`arxiv:1708.05720 `_] .. [1710.03760] `CPC 230 (2018) 145-217 `_ [`arXiv:1710.03760 `_] -.. [1804.09410] `Eur.Phys.J. C78 (2018) no.7, 573 `_ [`arxiv:1804.09410 `_] -.. [1807.03509] `Eur.Phys.J. C78 (2018) no.10, 874 `_ [`arxiv:1807.03509 `_] -.. [1910.03595] `Eur.Phys.J. `_ [`arxiv:1910.03595 `_] -.. [2106.05038] [`arxiv:2106.05038 `_] +.. [1804.09410] `Eur. Phys. J. C78 (2018) no. 7, 573 `_ [`arxiv:1804.09410 `_] +.. [1805.07306] `Eur. Phys. J. C78 (2018) no. 8, 649 `_ [`arxiv:1805.07306 `_] +.. [1807.03509] `Eur. Phys. J. C78 (2018) no. 10, 874 `_ [`arxiv:1807.03509 `_] +.. [1910.03595] `Eur. Phys. J. C80 (2020) no. 3, 186 `_ [`arxiv:1910.03595 `_] +.. [2106.05038] `CPC 283 (2023) 108584 `_ [`arxiv:2106.05038 `_] +.. [2110.13238] `Eur. Phys. J. C82 (2022) no. 3, 229 `_ [`arxiv:2110.13238 `_] +.. [2204.05285] `Phys. Rev. D 106 (2022) 9, 095023 `_ [`arxiv:2204.05285 `_] +.. [2402.14630] `CPC 302 (2024) 109244 `_ [`arxiv:2402.14630 `_] +.. [2210.09332] `CPC 291 (2023) 108803 `_ [`arxiv:2210.09332 `_] +.. [1502.04138] `Eur. Phys. J. C75 (2015) no. 9, 440 `_ [`arxiv:1502.04138 `_] +.. [1908.03952] `SciPost Phys. 7 (2019) 4, 052 `_ [`arxiv:1908.03952 `_] +.. [2012.11408] [`arxiv:2012.11408 `_] +.. [2502.XXXXX] `CPC`_ [`arxiv:2502.XXXX <>`_] diff --git a/conanfile.txt b/conanfile.txt index a62892401e..08669f48e0 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -1,10 +1,7 @@ [requires] boost/1.75.0 eigen/[>=3.1] -gm2calc/[>=1.7.0] -himalaya/[>=4.0.0] -looptools/[>=2.15] -collier/[>=1.2.3] +gm2calc/[>=2.1.0] tsil/[>=1.44] [options] @@ -56,13 +53,6 @@ boost:zstd=False gm2calc:fPIC=True -himalaya:fPIC=True - -looptools:fPIC=True - -collier:shared=False -collier:fPIC=True - tsil:fPIC=True [generators] diff --git a/config/Makefile.in b/config/Makefile.in index 3004e1efcc..078fc842f3 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -15,8 +15,10 @@ OPERATING_SYSTEM := @OPERATING_SYSTEM@ ENABLE_COMPILE := @ENABLE_COMPILE@ ENABLE_FFLITE := @ENABLE_FFLITE@ ENABLE_GM2CALC := @ENABLE_GM2CALC@ +ENABLE_HIGGSTOOLS := @ENABLE_HIGGSTOOLS@ ENABLE_HIMALAYA := @ENABLE_HIMALAYA@ ENABLE_LIBRARYLINK := @ENABLE_LIBRARYLINK@ +ENABLE_LILITH := @ENABLE_LILITH@ ENABLE_LOOPTOOLS := @ENABLE_LOOPTOOLS@ ENABLE_COLLIER := @ENABLE_COLLIER@ ENABLE_META := @ENABLE_META@ @@ -38,7 +40,7 @@ ENABLE_VERBOSE := @ENABLE_VERBOSE@ # Makefile modules MODELS := @MODELS@ ADDONS := @ADDONS@ -MODULES := config src fflite slhaea doc +MODULES := config src fflite slhaea doc nlohmann # BEGIN: NOT EXPORTED ########################################## MODULES += meta templates # END: NOT EXPORTED ########################################## @@ -81,6 +83,9 @@ COLLIERFLAGS := @COLLIERFLAGS@ COLLIERLIBS := @COLLIERLIBS@ GM2CALCFLAGS := @GM2CALCFLAGS@ GM2CALCLIBS := @GM2CALCLIBS@ +HIGGSTOOLSFLAGS := @HIGGSTOOLSFLAGS@ +HIGGSTOOLSLIBS := @HIGGSTOOLSLIBS@ +LILITHFLAGS := @LILITHFLAGS@ HIMALAYAFLAGS := @HIMALAYAFLAGS@ HIMALAYALIBS := @HIMALAYALIBS@ SQLITEFLAGS := @SQLITEFLAGS@ @@ -88,6 +93,8 @@ SQLITELIBS := @SQLITELIBS@ THREADLIBS := @THREADLIBS@ TSILFLAGS := @TSILFLAGS@ TSILLIBS := @TSILLIBS@ +PYTHONFLAGS := @PYTHONFLAGS@ +PYTHONLIBS := @PYTHONLIBS@ ifeq ($(VERBOSE),1) Q := @@ -280,37 +287,42 @@ showbuild: @echo "ADDONS = $(ADDONS)" @echo "SOLVERS = $(SOLVERS)" @echo "" - @echo "CXX = $(CXX)" - @echo "CPPFLAGS = $(CPPFLAGS)" - @echo "CXXFLAGS = $(CXXFLAGS)" - @echo "FC = $(FC)" - @echo "FFLAGS = $(FFLAGS)" - @echo "FLIBS = $(FLIBS)" - @echo "LDFLAGS = $(LDFLAGS)" - @echo "LDLIBS = $(LDLIBS)" - @echo "LLFLAGS = $(LLFLAGS)" - @echo "LLLIBS = $(LLLIBS)" - @echo "BOOSTTESTLIBS = $(BOOSTTESTLIBS)" - @echo "BOOSTTHREADLIBS = $(BOOSTTHREADLIBS)" - @echo "BOOSTFLAGS = $(BOOSTFLAGS)" - @echo "EIGENFLAGS = $(EIGENFLAGS)" - @echo "GM2CALCFLAGS = $(GM2CALCFLAGS)" - @echo "GM2CALCLIBS = $(GM2CALCLIBS)" - @echo "GSLLIBS = $(GSLLIBS)" - @echo "GSLFLAGS = $(GSLFLAGS)" - @echo "HIMALAYAFLAGS = $(HIMALAYAFLAGS)" - @echo "HIMALAYALIBS = $(HIMALAYALIBS)" - @echo "LIBLNK_MAKE_LIB_CMD= $(LIBLNK_MAKE_LIB_CMD)" - @echo "LIBLNK_LIBEXT = $(LIBLNK_LIBEXT)" - @echo "LOOPFUNCFLAGS = $(LOOPFUNCFLAGS)" - @echo "LOOPFUNCLIBS = $(LOOPFUNCLIBS)" - @echo "MODULE_MAKE_LIB_CMD= $(MODULE_MAKE_LIB_CMD)" - @echo "MODULE_LIBEXT = $(MODULE_LIBEXT)" - @echo "SQLITELIBS = $(SQLITELIBS)" - @echo "SQLITEFLAGS = $(SQLITEFLAGS)" - @echo "THREADLIBS = $(THREADLIBS)" - @echo "TSILLIBS = $(TSILLIBS)" - @echo "TSILFLAGS = $(TSILFLAGS)" + @echo "CXX = $(CXX)" + @echo "CPPFLAGS = $(CPPFLAGS)" + @echo "CXXFLAGS = $(CXXFLAGS)" + @echo "FC = $(FC)" + @echo "FFLAGS = $(FFLAGS)" + @echo "FLIBS = $(FLIBS)" + @echo "LDFLAGS = $(LDFLAGS)" + @echo "LDLIBS = $(LDLIBS)" + @echo "LLFLAGS = $(LLFLAGS)" + @echo "LLLIBS = $(LLLIBS)" + @echo "BOOSTTESTLIBS = $(BOOSTTESTLIBS)" + @echo "BOOSTTHREADLIBS = $(BOOSTTHREADLIBS)" + @echo "BOOSTFLAGS = $(BOOSTFLAGS)" + @echo "EIGENFLAGS = $(EIGENFLAGS)" + @echo "GM2CALCFLAGS = $(GM2CALCFLAGS)" + @echo "GM2CALCLIBS = $(GM2CALCLIBS)" + @echo "GSLLIBS = $(GSLLIBS)" + @echo "GSLFLAGS = $(GSLFLAGS)" + @echo "HIGGSTOOLSFLAGS = $(HIGGSTOOLSFLAGS)" + @echo "HIGGSTOOLSLIBS = $(HIGGSTOOLSLIBS)" + @echo "HIMALAYAFLAGS = $(HIMALAYAFLAGS)" + @echo "HIMALAYALIBS = $(HIMALAYALIBS)" + @echo "LIBLNK_MAKE_LIB_CMD = $(LIBLNK_MAKE_LIB_CMD)" + @echo "LIBLNK_LIBEXT = $(LIBLNK_LIBEXT)" + @echo "LILITHFLAGS = $(LILITHFLAGS)" + @echo "LOOPFUNCFLAGS = $(LOOPFUNCFLAGS)" + @echo "LOOPFUNCLIBS = $(LOOPFUNCLIBS)" + @echo "MODULE_MAKE_LIB_CMD = $(MODULE_MAKE_LIB_CMD)" + @echo "MODULE_LIBEXT = $(MODULE_LIBEXT)" + @echo "PYTHONFLAGS = $(PYTHONFLAGS)" + @echo "PYTHONLIBS = $(PYTHONLIBS)" + @echo "SQLITELIBS = $(SQLITELIBS)" + @echo "SQLITEFLAGS = $(SQLITEFLAGS)" + @echo "THREADLIBS = $(THREADLIBS)" + @echo "TSILLIBS = $(TSILLIBS)" + @echo "TSILFLAGS = $(TSILFLAGS)" @echo "" @echo "ENABLE_COLORS = $(ENABLE_COLORS)" @echo "ENABLE_COMPILE = $(ENABLE_COMPILE)" @@ -318,8 +330,10 @@ showbuild: @echo "ENABLE_CHECK_EIGENVALUE_ERROR = $(ENABLE_CHECK_EIGENVALUE_ERROR)" @echo "ENABLE_FFLITE = $(ENABLE_FFLITE)" @echo "ENABLE_GM2CALC = $(ENABLE_GM2CALC)" + @echo "ENABLE_HIGGSTOOLS = $(ENABLE_HIGGSTOOLS)" @echo "ENABLE_HIMALAYA = $(ENABLE_HIMALAYA)" @echo "ENABLE_LIBRARYLINK = $(ENABLE_LIBRARYLINK)" + @echo "ENABLE_LILITH = $(ENABLE_LILITH)" @echo "ENABLE_FEYNARTS = $(ENABLE_FEYNARTS)" @echo "ENABLE_FORMCALC = $(ENABLE_FORMCALC)" @echo "ENABLE_LOOPTOOLS = $(ENABLE_LOOPTOOLS)" diff --git a/config/config.h.in b/config/config.h.in index ad3f7cb12a..fddfab75eb 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -43,6 +43,8 @@ #define FUTILIBS "@FUTILIBS@" #define GM2CALCFLAGS "@GM2CALCFLAGS@" #define GM2CALCLIBS "@GM2CALCLIBS@" +#define HIGGSTOOLSFLAGS "@HIGGSTOOLSFLAGS@" +#define HIGGSTOOLSLIBS "@HIGGSTOOLSLIBS@" #define HIMALAYAFLAGS "@HIMALAYAFLAGS@" #define HIMALAYALIBS "@HIMALAYALIBS@" #define GSLFLAGS "@GSLFLAGS@" @@ -84,6 +86,12 @@ /* Enable GM2Calc */ @DEFINE_ENABLE_GM2CALC@ +/* Enable HiggsTools */ +@DEFINE_ENABLE_HIGGSTOOLS@ + +/* Enable Lilith */ +@DEFINE_ENABLE_LILITH@ + /* Enable Himalaya */ @DEFINE_ENABLE_HIMALAYA@ @@ -120,7 +128,16 @@ /* Enable semi-analytic BVP solver */ @DEFINE_ENABLE_SEMI_ANALYTIC_SOLVER@ +/* Enable shooting BVP solver */ +@DEFINE_ENABLE_SHOOTING_SOLVER@ + /* Enable statements for addons */ @DEFINE_ENABLE_ADDONS@ +/* Enable FeynArts */ +@DEFINE_ENABLE_FEYNARTS@ + +/* Enable FormCalc */ +@DEFINE_ENABLE_FORMCALC@ + #endif diff --git a/config/flexiblesusy-config.in b/config/flexiblesusy-config.in index 5b095d58ea..8f49ece0d1 100644 --- a/config/flexiblesusy-config.in +++ b/config/flexiblesusy-config.in @@ -24,6 +24,8 @@ gm2calcflags="@GM2CALCFLAGS@" gm2calclibs="@GM2CALCLIBS@" gslflags="@GSLFLAGS@" gsllibs="@GSLLIBS@" +higgstoolsflags="@HIGGSTOOLSFLAGS@" +higgstoolslibs="@HIGGSTOOLSLIBS@" himalayaflags="@HIMALAYAFLAGS@" himalayalibs="@HIMALAYALIBS@" ldflags="@LDFLAGS@" @@ -38,6 +40,8 @@ models="@MODELS@" module_make_lib_cmd="@MODULE_MAKE_LIB_CMD@" module_lib_ext="@MODULE_LIBEXT@" optional_modules="@OPTIONAL_MODULES@" +pythonflags="@PYTHONFLAGS@" +pythonlibs="@PYTHONLIBS@" shared_lib_cmd="@SHARED_LIB_CMD@" solvers="@SOLVERS@" sqliteflags="@SQLITEFLAGS@" @@ -109,7 +113,7 @@ create_model_specific_modules_list() { } create_module_list() { - echo "config src fflite slhaea doc $models $addons $model_specific_modules $optional_modules" + echo "config src fflite slhaea doc nlohmann $models $addons $model_specific_modules $optional_modules" } create_include_directives_for_FS_modules() { @@ -128,6 +132,9 @@ create_include_directives_for_external_modules() { [ "x@ENABLE_GM2CALC@" = xyes ] && \ incl="$incl $gm2calcflags" + [ "x@ENABLE_HIGGSTOOLS@" = xyes ] && \ + incl="$incl $higgstoolsflags" + [ "x@ENABLE_HIMALAYA@" = xyes ] && \ incl="$incl $himalayaflags" @@ -184,7 +191,7 @@ cppflags_without_modules="" cppflags="" flexiblesusy_libs="$(create_flexiblesusy_libs)" compile_cmd="" -libs="$ldflags $flexiblesusy_libs $loopfunclibs $gm2calclibs $himalayalibs $gsllibs $boostthreadlibs $flibs $sqlitelibs $tsillibs $threadlibs $ldlibs $futilibs" +libs="$ldflags $flexiblesusy_libs $loopfunclibs $gm2calclibs $higgstoolslibs $himalayalibs $gsllibs $boostthreadlibs $flibs $sqlitelibs $tsillibs $threadlibs $ldlibs $futilibs $pythonlibs" modules="$(create_module_list)" help() { @@ -210,6 +217,7 @@ Options: --enable-debug Test if debug mode is enabled --enable-fflite Test if FFlite is enabled --enable-gm2calc Test if GM2Calc is enabled + --enable-higgstools Test if HiggsTools is enabled --enable-himalaya Test if Himalaya is enabled --enable-librarylink Test if LibraryLink is enabled --enable-looptools Test if LoopTools is enabled @@ -230,6 +238,8 @@ Options: --gm2calclibs Print GM2Calc library, GM2CALCLIBS --gslflags Print compiler flags for GSL, GSLFLAGS --gsllibs Print GSL libraries, GSLLIBS + --higgstoolsflags Print compiler flags for HiggsTools, HIGGSTOOLSFLAGS + --higgstoolslibs Print HiggsTools library, HIGGSTOOLSLIBS --himalayaflags Print compiler flags for Himalaya, HIMALAYAFLAGS --himalayalibs Print Himalaya library, HIMALAYALIBS --ldflags Print flags for optional libraries, LDFLAGS @@ -286,6 +296,8 @@ while test $# -gt 0; do --flibs) out="$out $flibs" ;; --gslflags) out="$out $gslflags" ;; --gsllibs) out="$out $gsllibs" ;; + --higgstoolsflags) out="$out $higgstoolsflags" ;; + --higgstoolslibs) out="$out $higgstoolslibs" ;; --himalayaflags) out="$out $himalayaflags" ;; --himalayalibs) out="$out $himalayalibs" ;; --ldflags) out="$out $ldflags" ;; @@ -329,6 +341,7 @@ while test $# -gt 0; do --enable-debug) out="$out @ENABLE_DEBUG@" ;; --enable-fflite) out="$out @ENABLE_FFLITE@" ;; --enable-gm2calc) out="$out @ENABLE_GM2CALC@" ;; + --enable-higgstools) out="$out @ENABLE_HIGGSTOOLS@" ;; --enable-himalaya) out="$out @ENABLE_HIMALAYA@" ;; --enable-librarylink) out="$out @ENABLE_LIBRARYLINK@" ;; --enable-looptools) out="$out @ENABLE_LOOPTOOLS@" ;; diff --git a/config/mathematica_include_paths.sh b/config/mathematica_include_paths.sh index b683240c57..47e7f94ba7 100755 --- a/config/mathematica_include_paths.sh +++ b/config/mathematica_include_paths.sh @@ -7,28 +7,25 @@ math_cmd=math find_math_dirs() { - eval eval `printf "%s" ' + # shellcheck disable=SC2046 + eval eval $(printf "%s" ' Print["sysid=\"", $SystemID, "\""]; Print["topdir=\"", $TopDirectory, "\""]; - Exit[]' | "${math_cmd}" -noprompt | tr '\r' ' ' | tail -2` + Exit[]' | "${math_cmd}" -noprompt | tr '\r' ' ' | tail -2) # check whether Cygwin's dlltool can handle 64-bit DLLs test "$sysid" = Windows-x86-64 && { ${DLLTOOL:-dlltool} --help | grep x86-64 > /dev/null || sysid=Windows } - topdir=`cd "$topdir" ; echo $PWD` + topdir=`cd "$topdir" && echo $PWD` } get_librarylink_incpath() { find_math_dirs - for p in \ - "$topdir/SystemFiles/IncludeFiles/C" ; do - test -d "$p" && break - done - - echo "$p" + [ -d "${topdir}/SystemFiles/IncludeFiles/C" ] && \ + echo "${topdir}/SystemFiles/IncludeFiles/C" } get_mathlink_incpath() { diff --git a/configure b/configure index 2997024cdd..779cf1f68d 100755 --- a/configure +++ b/configure @@ -5,7 +5,7 @@ PROGRAM_NAME=FlexibleSUSY FLEXIBLESUSY_MAJOR=2 -FLEXIBLESUSY_MINOR=6 +FLEXIBLESUSY_MINOR=9 FLEXIBLESUSY_PATCH=0 FLEXIBLESUSY_EXTRA="" FLEXIBLESUSY_VERSION="${FLEXIBLESUSY_MAJOR}.${FLEXIBLESUSY_MINOR}.${FLEXIBLESUSY_PATCH}${FLEXIBLESUSY_EXTRA}" @@ -17,7 +17,7 @@ HIMALAYA_VERSION="unknown" BASEDIR=$(dirname $0) # absolute path to this script -ABSBASEDIR=$(cd "$BASEDIR"; pwd | sed 's/ /\\\\ /g') +ABSBASEDIR=$(cd "$BASEDIR" && pwd | sed 's/ /\\\\ /g') # config directory CONFIGDIR="${BASEDIR}/config" @@ -95,8 +95,10 @@ options=" \ enable_debug \ enable_fflite \ enable_gm2calc \ + enable_higgstools \ enable_himalaya \ enable_librarylink \ + enable_lilith \ enable_looptools \ enable_mass_error_check \ enable_shared_libs \ @@ -123,8 +125,10 @@ enable_debug="" enable_mass_error_check="no" enable_fflite="no" enable_gm2calc="automatic" +enable_higgstools="automatic" enable_himalaya="automatic" enable_librarylink="automatic" +enable_lilith="automatic" enable_looptools="no" enable_collier="no" enable_meta="no" @@ -147,6 +151,7 @@ DEFINE_ENABLE_DEBUG="#undef ENABLE_DEBUG" DEFINE_ENABLE_CHECK_EIGENVALUE_ERROR="#undef CHECK_EIGENVALUE_ERROR" DEFINE_ENABLE_FFLITE="#undef ENABLE_FFLITE" DEFINE_ENABLE_GM2CALC="#undef ENABLE_GM2CALC" +DEFINE_ENABLE_HIGGSTOOLS="#undef ENABLE_HIGGSTOOLS" DEFINE_ENABLE_HIMALAYA="#undef ENABLE_HIMALAYA" DEFINE_ENABLE_LIBRARYLINK="#undef ENABLE_LIBRARYLINK" DEFINE_ENABLE_LOOPTOOLS="#undef ENABLE_LOOPTOOLS" @@ -161,7 +166,10 @@ DEFINE_ENABLE_VERBOSE="#undef ENABLE_VERBOSE" DEFINE_ENABLE_TWO_SCALE_SOLVER="#undef ENABLE_TWO_SCALE_SOLVER" DEFINE_ENABLE_LATTICE_SOLVER="#undef ENABLE_LATTICE_SOLVER" DEFINE_ENABLE_SEMI_ANALYTIC_SOLVER="#undef ENABLE_SEMI_ANALYTIC_SOLVER" +DEFINE_ENABLE_SHOOTING_SOLVER="#undef ENABLE_SHOOTING_SOLVER" DEFINE_ENABLE_ADDONS="" +DEFINE_ENABLE_FEYNARTS="#undef ENABLE_FEYNARTS" +DEFINE_ENABLE_FORMCALC="#undef ENABLE_FORMCALC" boost_lib_dir="" boost_inc_dir="" @@ -174,7 +182,7 @@ collier_lib_dir="" collier_inc_dir="" GSLFLAGS="" CPPFLAGS="" -CXXFLAGS="-std=c++14 -O2 -fPIC" +CXXFLAGS="-std=c++20 -O2 -fPIC" FFLAGS="-O2 -fPIC" FLIBS="" FMOD="" @@ -211,6 +219,11 @@ LDFLAGS="$SHARED_LDFLAGS" LDLIBS="$SHARED_LDLIBS" LLFLAGS="" LLLIBS="" +higgstools_inc_dir="" +higgstools_lib_dir="" +HIGGSTOOLSFLAGS="-Imodel_specific/SM" +HIGGSTOOLSLIBS="model_specific/SM/libmodel_specific_SM${MODULE_LIBEXT}" +lilith_dir="" himalaya_lib_dir="" himalaya_inc_dir="" sqlite_lib_dir="" @@ -218,8 +231,8 @@ sqlite_inc_dir="" tsil_lib_dir="" tsil_inc_dir="" # available RG solvers -SOLVERS="two_scale semi_analytic" -available_solvers="two_scale lattice semi_analytic" +SOLVERS="two_scale semi_analytic shooting" +available_solvers="two_scale lattice semi_analytic shooting" # models that will be compiled MODELS="all" # BEGIN: NOT EXPORTED ########################################## @@ -237,15 +250,15 @@ cxx_compiler_version="unknown" # required C++ compiler versions required_cxx_compiler_version="unknown" -required_gpp_compiler_version="5.0.0" -required_clang_compiler_version="3.8.1" -required_icpc_compiler_version="17.0.0" +required_gpp_compiler_version="8.0.0" +required_clang_compiler_version="10.0.0" +required_icpc_compiler_version="18.0.0" # required boost version required_boost_version="1.37.0" # required Mathematica version -required_mathematica_version="7" +required_mathematica_version="11.0" # required SARAH version required_sarah_major="4" @@ -258,11 +271,11 @@ SARAH_MINOR="0" SARAH_PATCH="0" # required FeynArts version -required_feynarts_version="3.9.0" +required_feynarts_version="3.10.0" FEYNARTS_VERSION="unknown" # required FormCalc version -required_formcalc_version="9.5.0" +required_formcalc_version="9.8.0" FORMCALC_VERSION="unknown" # Mathematica version (0 = unknown) @@ -344,7 +357,8 @@ log_package_information() { #_____________________________________________________________________ guess_machine_word_size() { - local chip="$(uname -m | tr '[A-Z]' '[a-z]')" + local chip + chip="$(uname -m | tr '[A-Z]' '[a-z]')" exists_in_path getconf && chip="${chip}$(getconf LONG_BIT)" case "$chip" in *32|i[36]86) @@ -630,12 +644,7 @@ check_symbol() { # Check if we got a specific argument as to where the library # is to be found symbolfile=$symbollib - exts=".so .lib .dylib" - if test ! "x$shared" = "xno" ; then - exts="$exts .a" - else - exts=".a $exts" - fi + exts=".so .lib .dylib .a" usrlib="/usr/lib" if test "x$machine_word_size" = "x32" ; then @@ -704,8 +713,9 @@ split_version() { local minor_var="$3" local patch_var="$4" + # shellcheck disable=SC2046 set -- $(printf "%s" "$version" | - sed 's/^\([[:digit:].]*\).*$/\1/' | tr . ' ') + sed 's/^\([[:digit:].]*\).*$/\1/' | tr . ' ') eval "$major_var=\"${1:-0}\"" eval "$minor_var=\"${2:-0}\"" eval "$patch_var=\"${3:-0}\"" @@ -780,7 +790,7 @@ try_compile_run_cpp_program() { # output through stdout and stderr is stored in cpp_output # and whose exit code is stored in cpp_exit. - if [ $# -lt 1 -o $# -gt 3 ]; then + if [ $# -lt 1 ] || [ $# -gt 3 ]; then echo "try_compile_run_cpp_program: 1, 2, or 3 arguments required!" exit 1 fi @@ -875,6 +885,7 @@ exists_in_path () { fi cmd=$(command -v -- "$1") + logmsg "(command -v -- $1 gave: $cmd)" case "$cmd" in /*) return 0 ;; alias\ *) return 1 ;; # alias @@ -889,7 +900,11 @@ is_empty_dir() { return 1 fi - find "$1" -maxdepth 0 -empty | read v + if [ -n "$(ls -A "$1")" ]; then + return 1 + else + return 0 + fi } #_____________________________________________________________________ @@ -960,13 +975,14 @@ check_solvers() { fi checking_msg "RGE solvers" - local algs="$(echo $SOLVERS | tr ',' ' ')" + local algs + algs="$(echo $SOLVERS | tr ',' ' ')" SOLVERS="" for a in ${algs}; do case "$a" in all) SOLVERS="$available_solvers"; break ;; - two_scale|lattice|semi_analytic) + two_scale|lattice|semi_analytic|shooting) SOLVERS="$SOLVERS $a" continue ;; *) @@ -992,7 +1008,8 @@ check_models() { fi checking_msg "models" - local models="$(echo $MODELS | tr ',' ' ')" + local models + models="$(echo $MODELS | tr ',' ' ')" MODELS="" for a in ${models}; do case "$a" in @@ -1036,7 +1053,8 @@ check_models() { fi done - local model_names="$(echo ${MODELS} | sed -e 's|models/||g' -e 's/^ *//' -e 's/ *$//')" + local model_names + model_names="$(echo ${MODELS} | sed -e 's|models/||g' -e 's/^ *//' -e 's/ *$//')" result "ok (${model_names})" logmsg " Models: ${MODELS}" @@ -1050,7 +1068,8 @@ check_addons() { fi checking_msg "addons" - local addons="$(echo $ADDONS | tr ',' ' ')" + local addons + addons="$(echo $ADDONS | tr ',' ' ')" ADDONS="" for a in ${addons}; do case "$a" in @@ -1080,7 +1099,8 @@ check_addons() { fi done - local addon_names="$(echo ${ADDONS} | sed -e 's|addons/||g' -e 's/^ *//' -e 's/ *$//')" + local addon_names + addon_names="$(echo ${ADDONS} | sed -e 's|addons/||g' -e 's/^ *//' -e 's/ *$//')" result "ok (${addon_names})" logmsg " Addons: ${ADDONS}" @@ -1094,7 +1114,8 @@ check_optional_modules() { fi checking_msg "optional modules" - local optional_modules="$(echo $OPTIONAL_MODULES | tr ',' ' ')" + local optional_modules + optional_modules="$(echo $OPTIONAL_MODULES | tr ',' ' ')" OPTIONAL_MODULES="" for a in ${optional_modules}; do if test -d "$BASEDIR/$a" ; then @@ -1118,7 +1139,8 @@ check_optional_modules() { fi done - local module_names="$(echo ${OPTIONAL_MODULES} | sed -e 's|addons/||g' -e 's/^ *//' -e 's/ *$//')" + local module_names + module_names="$(echo ${OPTIONAL_MODULES} | sed -e 's|addons/||g' -e 's/^ *//' -e 's/ *$//')" result "ok (${module_names})" logmsg " Optional modules: ${OPTIONAL_MODULES}" @@ -1126,11 +1148,13 @@ check_optional_modules() { #_____________________________________________________________________ check_librarylink_incl() { + # sysid is defined in config/mathematica_include_paths.sh + # shellcheck disable=SC2154 local default_llincdir="\ ${MATH_INSTDIR}/SystemFiles/IncludeFiles/C:\ ${MATH_INSTDIR}/SystemFiles/Links/MathLink/DeveloperKit/${MATH_SYSTEMID}/CompilerAdditions:\ ${MATH_INSTDIR}/SystemFiles/Links/MathLink/DeveloperKit/CompilerAdditions:\ -${MATH_INSTDIR}/AddOns/MathLink/DeveloperKit/$sysid/CompilerAdditions" +${MATH_INSTDIR}/AddOns/MathLink/DeveloperKit/${sysid}/CompilerAdditions" check_header "WolframLibrary.h" "$default_llincdir" \ "$default_inc_paths" @@ -1229,7 +1253,8 @@ ${MATH_INSTDIR}/SystemFiles/Links/MathLink/DeveloperKit/CompilerAdditions" exit 1 fi - local mathlink_lib=-l$(echo "$found_lib" | sed 's/^lib\(.*\)\..*$/\1/') + local mathlink_lib + mathlink_lib=-l$(echo "$found_lib" | sed 's/^lib\(.*\)\..*$/\1/') mathlink_lib_flags="-L${found_dir} ${mathlink_lib} -lc++ -framework Foundation" ;; esac @@ -1311,11 +1336,12 @@ check_platform() { #_____________________________________________________________________ reset_default_static_linker_cmd() { - local os_=$( (uname -s) 2>/dev/null || echo unknown) - case "$os_" in - Linux) - STATIC_LIB_CMD="ar cruU";; - esac + local os_ + os_=$( (uname -s) 2>/dev/null || echo unknown) + case "$os_" in + Linux) + STATIC_LIB_CMD="ar cruU";; + esac } #_____________________________________________________________________ @@ -1332,6 +1358,7 @@ check_multiarch() { if test "x$linuxdist" = "xmultiarch"; then if type dpkg-architecture > /dev/null 2>&1 ; then + # shellcheck disable=SC2091 if $(dpkg-architecture -qDEB_HOST_MULTIARCH > /dev/null 2>&1) ; then checking_msg "dpkg-architecture" debmultiarch=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null) @@ -1431,8 +1458,8 @@ check_boost_test_libs() { message "Warning: libboost_unit_test_framework(-mt) must be installed" message " to compile and run the tests, see http://www.boost.org" else - local BOOSTTESTLIBS_=-l$( - echo "$found_lib" | sed 's/^lib\(.*\)\..*$/\1/') + local BOOSTTESTLIBS_ + BOOSTTESTLIBS_=-l$(echo "$found_lib" | sed 's/^lib\(.*\)\..*$/\1/') if [ -z "$boost_lib_dir" ]; then # assume that the linker will look in the default paths BOOSTTESTLIBS="$BOOSTTESTLIBS_" @@ -1462,7 +1489,8 @@ check_boost_thread_libs() { message " You can disable the lattice method with the --with-solvers= flag." exit 1 fi - local BOOSTTHREADLIBS_=-l$(echo "$found_lib" | sed 's/^lib\(.*\)\..*$/\1/') + local BOOSTTHREADLIBS_ + BOOSTTHREADLIBS_=-l$(echo "$found_lib" | sed 's/^lib\(.*\)\..*$/\1/') check_library "libboost_system libboost_system-mt" \ "$boost_lib_dir" "$default_lib_paths" @@ -1560,14 +1588,11 @@ check_cxx_compiler_type() { case "$cxx_compiler_type" in gnu) result "GNU" - required_cxx_compiler_version="$required_gpp_compiler_version" - std_cxx11_compiler_version="$std_cxx11_gpp_version" ;; + required_cxx_compiler_version="$required_gpp_compiler_version" ;; clang) result "Clang" - required_cxx_compiler_version="$required_clang_compiler_version" - std_cxx11_compiler_version="$std_cxx11_clang_version" ;; + required_cxx_compiler_version="$required_clang_compiler_version" ;; intel) result "Intel" - required_cxx_compiler_version="$required_icpc_compiler_version" - std_cxx11_compiler_version="$std_cxx11_icpc_version" ;; + required_cxx_compiler_version="$required_icpc_compiler_version" ;; *) result "unknown" ;; esac @@ -1611,7 +1636,7 @@ check_icpc_features() { # disable multi-threading for versions < 14.0.0 if ! major_minor_patch_at_least $major $minor $patch "14" "0" "0" && - [ "$enable_threads" = "yes" -o "$enable_threads" = "automatic" ]; then + { [ "$enable_threads" = "yes" ] || [ "$enable_threads" = "automatic" ] ;} ; then message "" message " Warning: multi-threading support requires $compiler 14.0.0 or newer." enable_threads="no" @@ -1668,14 +1693,15 @@ get_gpp_version() { output=$($compiler -dM -E -x c++ /dev/null) || { message "Warning: could not determine $compiler version because" message " execution of $compiler failed." - return 1 + return 1 } - local major=$(printf "%s" "$output" | - sed 's/^.*__GNUC__[[:space:]]*\([[:digit:]]*\).*$/\1/p;d') - local minor=$(printf "%s" "$output" | - sed 's/^.*__GNUC_MINOR__[[:space:]]*\([[:digit:]]*\).*$/\1/p;d') - local patch=$(printf "%s" "$output" | - sed 's/^.*__GNUC_PATCHLEVEL__[[:space:]]*\([[:digit:]]*\).*$/\1/p;d') + local major minor patch + major=$(printf "%s" "$output" | + sed 's/^.*__GNUC__[[:space:]]*\([[:digit:]]*\).*$/\1/p;d') + minor=$(printf "%s" "$output" | + sed 's/^.*__GNUC_MINOR__[[:space:]]*\([[:digit:]]*\).*$/\1/p;d') + patch=$(printf "%s" "$output" | + sed 's/^.*__GNUC_PATCHLEVEL__[[:space:]]*\([[:digit:]]*\).*$/\1/p;d') eval "$ret_var=\"$major.$minor.$patch\"" } @@ -1694,10 +1720,11 @@ get_icpc_version() { output=$($compiler -dM -E -x c++ /dev/null) || { message "Warning: could not determine $compiler version because" message " execution of $compiler failed." - return 1 + return 1 } - local version=$(printf "%s" "$output" | - sed 's/^.*__INTEL_COMPILER[[:space:]]*\([[:digit:]]*\)\([[:digit:]]\)\([[:digit:]]\).*$/\1.\2.\3/p;d') + local version + version=$(printf "%s" "$output" | + sed 's/^.*__INTEL_COMPILER[[:space:]]*\([[:digit:]]*\)\([[:digit:]]\)\([[:digit:]]\).*$/\1.\2.\3/p;d') eval "$ret_var=\"$version\"" } @@ -1725,12 +1752,13 @@ get_clang_version() { message " execution of $compiler failed." return 1 } - local major=$(printf "%s" "$output" | - sed 's/^.*__clang_major__[[:space:]]*\([[:digit:]]*\).*$/\1/p;d') - local minor=$(printf "%s" "$output" | - sed 's/^.*__clang_minor__[[:space:]]*\([[:digit:]]*\).*$/\1/p;d') - local patch=$(printf "%s" "$output" | - sed 's/^.*__clang_patchlevel__[[:space:]]*\([[:digit:]]*\).*$/\1/p;d') + local major minor patch + major=$(printf "%s" "$output" | + sed 's/^.*__clang_major__[[:space:]]*\([[:digit:]]*\).*$/\1/p;d') + minor=$(printf "%s" "$output" | + sed 's/^.*__clang_minor__[[:space:]]*\([[:digit:]]*\).*$/\1/p;d') + patch=$(printf "%s" "$output" | + sed 's/^.*__clang_patchlevel__[[:space:]]*\([[:digit:]]*\).*$/\1/p;d') eval "$ret_var=\"$major.$minor.$patch\"" } @@ -1756,12 +1784,15 @@ check_cxxflags() { CXXFLAGS="${CXXFLAGS} -Wall -pedantic -Wextra\ -Wcast-align -Woverloaded-virtual -Wnon-virtual-dtor\ -Wno-unused-local-typedefs" + elif test "x${cxx_compiler_type}" = "xclang"; then + CXXFLAGS="${CXXFLAGS} -Wall -pedantic -Wextra\ + -Wcast-align -Woverloaded-virtual -Wnon-virtual-dtor" elif test "x${cxx_compiler_type}" = "xintel"; then CXXFLAGS="${CXXFLAGS} -w3 -Wnon-virtual-dtor" fi fi - if [ "x$enable_shared_libs" = "xyes" -o "x$enable_librarylink" = "xyes" ] ; then + if [ "x$enable_shared_libs" = "xyes" ] || [ "x$enable_librarylink" = "xyes" ] ; then # check if -fPIC is in CXXFLAGS case "${CXX}" in g++*|clang++*|icpc*) @@ -1792,7 +1823,7 @@ check_eigen_incl() { [ -z "$eigen_inc_dir" ] && \ type pkg-config > /dev/null && \ - [ -n ${eigen_name} ] && \ + [ -n "${eigen_name}" ] && \ [ -f ${eigen_name}.pc ] && \ { message -n "Checking for Eigen library using local ${eigen_name}.pc ... " @@ -1865,9 +1896,17 @@ check_gsl_config() { message " use $0 --with-gsl-config=" exit 1 else - result "found $cmd" + local GSL_VERSION + GSL_VERSION=$($cmd --version) + result "found $cmd (version ${GSL_VERSION})" GSLFLAGS=$($cmd --cflags) GSLLIBS=$($cmd --libs) + + version_at_least "$GSL_VERSION" "2.0.0" || { + message "Error: An old version of GSL has been detected ($GSL_VERSION)." + message " Please upgrade to version 2.0.0 (or higher)." + exit 1 + } fi } @@ -1928,7 +1967,7 @@ check_fflags() { esac # check if -fPIC is in FFLAGS - if [ "x$enable_shared_libs" = "xyes" -o "x$enable_librarylink" = "xyes" ] ; then + if [ "x$enable_shared_libs" = "xyes" ] || [ "x$enable_librarylink" = "xyes" ] ; then case "${FC}" in gfortran*|ifort*) if contains_not "${FFLAGS}" "-fPIC" ; then @@ -2007,13 +2046,14 @@ int main() { local GM2CALC_VERSION="$cpp_output" + version_at_least "$GM2CALC_VERSION" "2.1.0" || { + message "Error: An old version of GM2Calc has been detected ($GM2CALC_VERSION)." + message " Please upgrade to version 2.1.0 (or higher)." + exit 1 + } + result "ok (version ${GM2CALC_VERSION})" logmsg " GM2Calc version found: ${GM2CALC_VERSION}" - - version_at_least "$GM2CALC_VERSION" "1.7.0" || { - message "Warning: An old version of GM2Calc has been detected ($GM2CALC_VERSION)." - message " Please consider upgrading to version 1.7.0 (or higher)." - } } #_____________________________________________________________________ @@ -2076,7 +2116,7 @@ check_gm2calc() { [ -z "$gm2calc_inc_dir" ] && \ [ -z "$gm2calc_lib_dir" ] && \ type pkg-config > /dev/null && \ - [ -n ${gm2calc_name} ] && \ + [ -n "${gm2calc_name}" ] && \ [ -f ${gm2calc_name}.pc ] && \ { message -n "Checking GM2Calc using local ${gm2calc_name}.pc ... " @@ -2127,6 +2167,103 @@ int main() { } } +check_higgstools_incl() { + check_header "Higgs/Predictions.hpp" "$higgstools_inc_dir" + if test "x$found_hdr" = "x" ; then + if test "x$enable_higgstools" = "xyes" ; then + message "Error: HiggsTools's Predictions.hpp must be installed if you want" + message " to use HiggsTools, see https://gitlab.com/higgsbounds/higgstools" + message " You can use the --with-higgstools-incdir= option to specify the" + message " location of Higgs/Predictions.hpp and the other headers." + exit 1 + else + return 1 + fi + else + HIGGSTOOLSFLAGS="$HIGGSTOOLSFLAGS -I$higgstools_inc_dir" + return 0 + fi + return 0 +} + +check_higgstools_libs() { + check_library "libHiggsTools" "$higgstools_lib_dir" "$default_lib_paths" + if test "x$found_lib" = "x" ; then + if test "x$enable_higgstools" = "xyes" ; then + message "Error: The HiggsTools library must be installed if you want" + message " to use HiggsTools, see https://gitlab.com/higgsbounds/higgstools" + message " You can use the --with-higgstools-libdir option to specify the" + message " location of the HiggsTools library." + exit 1 + else + return 1 + fi + else + local filename + filename=$(basename -- "$found_lib") + local extension="${filename##*.}" + local HIGGSTOOLSLIBS_="-lHiggsTools" + if [ ! "$extension" = "a" ] && [ ! "$extension" = "so" ] && [ ! "$extension" = "dylib" ]; then + message "Error: Cannot identify the type (static or shared) of" + message " HiggsTools library." + exit 1 + fi + if [ -z "$higgstools_lib_dir" ]; then + HIGGSTOOLSLIBS="-L$higgstools_lib_dir ${HIGGSTOOLSLIBS_}" + else + if [ "x$enable_static" = xyes ]; then + HIGGSTOOLSLIBS="-L$higgstools_lib_dir -Wl,-Bstatic $HIGGSTOOLSLIBS_ -Wl,-Bdynamic" + else + HIGGSTOOLSLIBS="-L$higgstools_lib_dir -Wl,-rpath,$higgstools_lib_dir,-Bdynamic $HIGGSTOOLSLIBS_" + fi + fi + HIGGSTOOLSLIBS="${HIGGSTOOLSLIBS} model_specific/SM/libmodel_specific_SM${MODULE_LIBEXT}" + fi + return 0 +} + +check_higgstools() { + if check_higgstools_incl && check_higgstools_libs ; then + enable_higgstools=yes + else + enable_higgstools=no + fi +} + +check_python() { + checking_msg "C++ python embedding" + path_split=$(echo "$PATH" | sed -e 's/:/ /g') + python3config_cmd=$(find $path_split -name "python3*-config" 2>/dev/null) + if test -z "$python3config_cmd" ; then + result "no" + message "Warning! Cannot find python3*-config. Some features (like the Lilith interface)" + message " will be disabled." + enable_lilith=no + else + # pick 1st one that was found + python3config_cmd=$(echo $python3config_cmd | cut -d ' ' -f 1) + # on my system python3-includes returns -I/usr/include/python3.11 -I/usr/include/python3.11 + # remove duplicates + PYTHONFLAGS=$(echo "$(${python3config_cmd} --includes)" | xargs -n1 | sort -u) + PYTHONLIBS="$(${python3config_cmd} --ldflags --embed)" + result "found $python3config_cmd" + fi +} + +check_lilith() { + if test -n "$lilith_dir" && test ! "x$enable_lilith" = "xno" ; then + check_header "lilith/c-api/lilith.h" "$lilith_dir" + if test "x$found_dir" = "x" ; then + enable_lilith=no + else + LILITHFLAGS="-I$lilith_dir/lilith/c-api" + enable_lilith=yes + fi + else + enable_lilith=no + fi +} + #_____________________________________________________________________ check_himalaya_incl() { check_header "himalaya/version.hpp" "$himalaya_inc_dir" @@ -2188,7 +2325,7 @@ check_himalaya() { [ -z "$himalaya_inc_dir" ] && \ [ -z "$himalaya_lib_dir" ] && \ type pkg-config > /dev/null && \ - [ -n ${himalaya_name} ] && \ + [ -n "${himalaya_name}" ] && \ [ -f ${himalaya_name}.pc ] && \ { message -n "Checking Himalaya using local ${himalaya_name}.pc ... " @@ -2210,18 +2347,19 @@ check_himalaya() { #_____________________________________________________________________ check_required_libs() { - if [ "$enable_meta" = yes -a -n "${MATH}" ] ; then + if [ "$enable_meta" = yes ] && [ -n "${MATH}" ] ; then message "Checking model files for required third party libraries" for m in ${MODELS}; do - local model_name=$(echo ${m} | sed -e 's|models/||') + local model_name + model_name=$(echo ${m} | sed -e 's|models/||') local model_file="models/${model_name}/FlexibleSUSY.m" [ -e "${model_file}" ] || continue # early continue to skip expensive Mathematica kernel # calls, if possible - grep 'UseSMYukawa2Loop\|aMuonGM2Calc\|aMuonGM2CalcUncertainty\|UseHiggs3LoopMSSM\|FSHimalayaMh23L' "${model_file}" > /dev/null 2>&1 || continue + grep 'UseSMYukawa2Loop\|aMuonGM2Calc\|aMuonGM2CalcUncertainty\|FSHimalayaMh23L' "${model_file}" > /dev/null 2>&1 || continue mma_symbol_is "${model_file}" "${MATH}" "UseSMYukawa2Loop" "True" && { message " TSIL is required to build $model_name" @@ -2243,6 +2381,11 @@ check_required_libs() { enable_himalaya=yes } + mma_symbol_is "${model_file}" "${MATH}" "UseHiggs3LoopNMSSM" "True" && { + message " Himalaya is required to build $model_name"; + enable_himalaya=yes + } + cat < /dev/null 2>&1 Get["${model_file}"] @@ -2295,7 +2438,8 @@ check_looptools_libs() { fi case "$operating_system" in Darwin) - local gcc_=$(${CXX} -print-search-dirs | sed -n -e '/libraries:/s/libraries: *=//p') + local gcc_ + gcc_=$(${CXX} -print-search-dirs | sed -n -e '/libraries:/s/libraries: *=//p') check_library "libgcc" "$gcc_" "$default_lib_paths" if test "x$found_lib" = "x" ; then message "Error: libgcc not found in $gcc_ $default_lib_paths" @@ -2340,7 +2484,7 @@ check_looptools() { [ -z "$looptools_inc_dir" ] && \ [ -z "$looptools_lib_dir" ] && \ type pkg-config > /dev/null && \ - [ -n ${looptools_name} ] && \ + [ -n "${looptools_name}" ] && \ [ -f ${looptools_name}.pc ] && \ { message -n "Checking LoopTools using local ${looptools_name}.pc ... " @@ -2413,7 +2557,7 @@ check_collier() { [ -z "$collier_inc_dir" ] && \ [ -z "$collier_lib_dir" ] && \ type pkg-config > /dev/null && \ - [ -n ${collier_name} ] && \ + [ -n "${collier_name}" ] && \ [ -f ${collier_name}.pc ] && \ { message -n "Checking COLLIER using local ${collier_name}.pc ... " @@ -2606,11 +2750,13 @@ check_tsil_incl() { #_____________________________________________________________________ check_tsil_size() { - local tsil_dir=$([ -n "$tsil_inc_dir" ] && echo "$tsil_inc_dir" || echo "$tsil_lib_dir") + local tsil_dir + tsil_dir=$([ -n "$tsil_inc_dir" ] && echo "$tsil_inc_dir" || echo "$tsil_lib_dir") if [ -f "${tsil_dir}/Makefile" ] ; then - local tsil_makefile="${tsil_dir}/Makefile" - local tsil_size=$({ echo "first: ; @echo \$(TSIL_SIZE)" + local tsil_makefile tsil_size + tsil_makefile="${tsil_dir}/Makefile" + tsil_size=$({ echo "first: ; @echo \$(TSIL_SIZE)" cat "$tsil_makefile" } | make -f - first ) @@ -2635,7 +2781,7 @@ check_tsil() { [ -z "$tsil_inc_dir" ] && \ [ -z "$tsil_lib_dir" ] && \ type pkg-config > /dev/null && \ - [ -n ${tsil_name} ] && \ + [ -n "${tsil_name}" ] && \ [ -f ${tsil_name}.pc ] && \ { message -n "Checking TSIL using local ${tsil_name}.pc ... " @@ -2659,35 +2805,30 @@ check_tsil() { #_____________________________________________________________________ find_symbol_using_pkgconfig() { - local symbol - local pkg - local ldpaths - local libnames - local pkg_flags=$([ "x$enable_static" = xyes ] && echo "--static") + local symbol pkg ldpaths libnames pkg_flags + pkg_flags=$([ "x$enable_static" = xyes ] && echo "--static") pkg="$1" - linker_flags="" type pkg-config > /dev/null 2>&1 || { - logmsg "pkg-config not found" - return 1 + logmsg "pkg-config not found" + return 1 } pkg-config --exists "$pkg" || { - logmsg "pkg-config does not manage $pkg" - return 1 + logmsg "pkg-config does not manage $pkg" + return 1 } ldpaths=$(pkg-config ${pkg_flags} --libs-only-L "$pkg") libnames=$(pkg-config ${pkg_flags} --libs-only-l "$pkg") shift for symbol; do - for dopt in $default_lib_paths $ldpaths; do - for lopt in $libnames; do - if check_symbol "$symbol" "$lopt" "$dopt"; then - logmsg "found $symbol in $dopt $lopt" - linker_flags=$(pkg-config ${pkg_flags} --libs "$pkg") - continue 3 - fi - done - done - return 1 + for dopt in $default_lib_paths $ldpaths; do + for lopt in $libnames; do + if check_symbol "$symbol" "$lopt" "$dopt"; then + logmsg "found $symbol in $dopt $lopt" + continue 3 + fi + done + done + return 1 done return 0 } @@ -2732,10 +2873,13 @@ check_math_cmd() { exists_in_path "$MATH" if [ -z "$cmd" ] ; then result "not found" - MATH="" - [ "${enable_meta}" = "yes" -o "$enable_librarylink" = "yes" ] || return + MATH="" + if [ ! "${enable_meta}" = "yes" ] || [ ! "$enable_librarylink" = "yes" ]; then + return + fi - message "Error: Mathematica needs to be installed to run the meta code or to enable LibraryLink!" + message "Error: Mathematica kernel ${MATH} was not found or is not executable or is an alias." + message " Mathematica needs to be installed to run the meta code or to enable LibraryLink!" message " You can use the --with-math-cmd= option to specify the location of" message " the math kernel. It is usually installed in " case "$operating_system" in @@ -2786,13 +2930,15 @@ EOF if $_ok; then result "ok (version ${MATH_VERSION} for ${MATH_SYSTEMID} in ${MATH_INSTDIR})" else - if [ "$_exit_status" = 2 ]; then - result "not ok (version ${MATH_VERSION} for ${MATH_SYSTEMID} in ${MATH_INSTDIR})" - else - result "not ok" - fi - MATH="" - [ "${enable_meta}" = "yes" -o "$enable_librarylink" = "yes" ] || return + if [ "$_exit_status" = 2 ]; then + result "not ok (version ${MATH_VERSION} for ${MATH_SYSTEMID} in ${MATH_INSTDIR})" + else + result "not ok" + fi + MATH="" + if [ ! "${enable_meta}" = "yes" ] || [ ! "$enable_librarylink" = "yes" ]; then + return + fi message "Error: Mathematica ${required_mathematica_version} or higher needs to be installed!" exit 1 @@ -2860,7 +3006,8 @@ WriteString["stderr", \$sarahModelDir]; EOF ) - if [ -z "$SARAH_MODEL_DIR" ] ; then + if [ -z "$SARAH_MODEL_DIR" ] || \ + { [ ! -z "$SARAH_MODEL_DIR" ] && [ ! -d "$SARAH_MODEL_DIR" ] ;} ;then message "Error: Could not determine the SARAH model directory." message " Please check that Mathematica and SARAH are installed correctly." message " To do that, you may run \`${MATH}' and then copy and paste:\n" @@ -2878,6 +3025,8 @@ check_feynarts() { if test "x$enable_feynarts" = "xno"; then return; fi checking_msg "FeynArts installation" + local oldVersion="" + [ -f "${feynartsconfig}" ] && oldVersion=$(cat "${feynartsconfig}") rm -f ${feynartsconfig} "$MATH" < /dev/null Needs["FeynArts\`"]; @@ -2896,6 +3045,7 @@ EOF if version_at_least $FEYNARTS_VERSION "${required_feynarts_version}"; then enable_feynarts="yes" result "ok (version ${FEYNARTS_VERSION})" + DEFINE_ENABLE_FEYNARTS="#define ENABLE_FEYNARTS 1" elif test "x$enable_feynarts" = "xautomatic"; then enable_feynarts="no" result "ok (version ${FEYNARTS_VERSION} too old -- support disabled)" @@ -2922,6 +3072,30 @@ EOF message " Please make sure Needs[\"FeynArts\`\"] works correctly." exit 1 fi + + # Removing NPointFunctions, FormCalc, FeynArts output folders + [ "${enable_feynarts}" = "yes" ] && { + [ "${FEYNARTS_VERSION}" = "${oldVersion}" ] || { + for m in "models"/*; do + [ -e "$m/FlexibleSUSY.m" ] || continue + [ -e "$m/start.m" ] || continue + local eigenstate output dir + eigenstate=$(grep 'FSEigenstates' "$m/FlexibleSUSY.m" \ + | sed 's/ //g' \ + | sed 's/.*`\(.*\);/\1/') + output=$(grep -m1 'OutputDirectory' "$m/start.m" \ + | sed 's/ //g' \ + | sed 's/.*\"\(.*\)\".*/\1/') + output=$(echo $m | sed "s/models/${output}/") + dir="${output}/${eigenstate}/FeynArts" + [ -d "${dir}" ] && { rm -rf ${dir}; } + dir="${output}/${eigenstate}/FormCalc" + [ -d "${dir}" ] && { rm -rf ${dir}; } + dir="${output}/${eigenstate}/NPointFunctions" + [ -d "${dir}" ] && { rm -rf ${dir}; } + done + } + } } #_____________________________________________________________________ @@ -2929,6 +3103,8 @@ check_formcalc() { if test "x$enable_formcalc" = "xno"; then return; fi checking_msg "FormCalc installation" + local oldVersion="" + [ -f "${formcalcconfig}" ] && oldVersion=$(cat "${formcalcconfig}") rm -f ${formcalcconfig} "$MATH" < /dev/null Needs["FormCalc\`"]; @@ -2946,6 +3122,7 @@ EOF if version_at_least $FORMCALC_VERSION "${required_formcalc_version}"; then result "ok (version ${FORMCALC_VERSION})" + DEFINE_ENABLE_FORMCALC="#define ENABLE_FORMCALC 1" elif test "x$enable_formcalc" = "xautomatic"; then enable_formcalc="no" result "ok (version ${FORMCALC_VERSION} too old -- support disabled)" @@ -2973,6 +3150,29 @@ EOF exit 1 fi + # Removing NPointFunctions, FormCalc output folders + + [ "${enable_formcalc}" = "yes" ] && { + [ "${FORMCALC_VERSION}" = "${oldVersion}" ] || { + for m in "models"/*; do + [ -e "$m/FlexibleSUSY.m" ] || continue + [ -e "$m/start.m" ] || continue + local eigenstate output dir + eigenstate=$(grep 'FSEigenstates' "models/$m/FlexibleSUSY.m" \ + | sed 's/ //g' \ + | sed 's/.*`\(.*\);/\1/') + output=$(grep -m1 'OutputDirectory' "models/$m/start.m" \ + | sed 's/ //g' \ + | sed 's/.*\"\(.*\)\".*/\1/') + output=$(echo $m | sed "s/models/${output}/") + dir="${output}/$m/${eigenstate}/FormCalc" + [ -d "${dir}" ] && { rm -rf ${dir}; } + dir="${output}/$m/${eigenstate}/NPointFunctions" + [ -d "${dir}" ] && { rm -rf ${dir}; } + done + } + } + if test "x$enable_formcalc" != "xno"; then checking_msg "working FormCalc" @@ -3085,22 +3285,37 @@ get_model_specific_corrections() { return 1 } - mma_symbol_is "$model_file" "$math_cmd" "UseHiggs2LoopSM" "True" && ho="${ho} SM" - mma_symbol_is "$model_file" "$math_cmd" "UseHiggs3LoopSM" "True" && ho="${ho} SM" - mma_symbol_is "$model_file" "$math_cmd" "UseHiggs4LoopSM" "True" && ho="${ho} SM" - mma_symbol_is "$model_file" "$math_cmd" "UseSMAlphaS3Loop" "True" && ho="${ho} SM" - mma_symbol_is "$model_file" "$math_cmd" "UseSMAlphaS4Loop" "True" && ho="${ho} SM" - mma_symbol_is "$model_file" "$math_cmd" "FlexibleEFTHiggs" "True" && ho="${ho} SM" - mma_symbol_is "$model_file" "$math_cmd" "UseSMYukawa2Loop" "True" && ho="${ho} SM_thresholds" + grep -q 'UseSMYukawa2Loop' "${model_file}" && \ + mma_symbol_is "$model_file" "$math_cmd" "UseSMYukawa2Loop" "True" && \ + ho="${ho} SM_thresholds" - mma_symbol_is "$model_file" "$math_cmd" "UseHiggs2LoopMSSM" "True" && ho="${ho} MSSM_higgs" - mma_symbol_is "$model_file" "$math_cmd" "UseHiggs3LoopMSSM" "True" && ho="${ho} MSSM_higgs" - mma_symbol_is "$model_file" "$math_cmd" "UseMSSMAlphaS2Loop" "True" && ho="${ho} MSSM_thresholds" - mma_symbol_is "$model_file" "$math_cmd" "UseMSSMYukawa2Loop" "True" && ho="${ho} MSSM_thresholds" + grep -q 'UseHiggs2LoopMSSM' "${model_file}" && \ + mma_symbol_is "$model_file" "$math_cmd" "UseHiggs2LoopMSSM" "True" && \ + ho="${ho} MSSM_higgs" - mma_symbol_is "$model_file" "$math_cmd" "UseHiggs2LoopNMSSM" "True" && ho="${ho} MSSM_higgs NMSSM_higgs" + grep -q 'UseHiggs3LoopMSSM' "${model_file}" && \ + mma_symbol_is "$model_file" "$math_cmd" "UseHiggs3LoopMSSM" "True" && \ + ho="${ho} MSSM_higgs" - mma_symbol_is "$model_file" "$math_cmd" "UseHiggs3LoopSplit" "True" && ho="${ho} SplitMSSM" + grep -q 'UseMSSMAlphaS2Loop' "${model_file}" && \ + mma_symbol_is "$model_file" "$math_cmd" "UseMSSMAlphaS2Loop" "True" && \ + ho="${ho} MSSM_thresholds" + + grep -q 'UseMSSMYukawa2Loop' "${model_file}" && \ + mma_symbol_is "$model_file" "$math_cmd" "UseMSSMYukawa2Loop" "True" && \ + ho="${ho} MSSM_thresholds" + + grep -q 'UseHiggs2LoopNMSSM' "${model_file}" && \ + mma_symbol_is "$model_file" "$math_cmd" "UseHiggs2LoopNMSSM" "True" && \ + ho="${ho} MSSM_higgs NMSSM_higgs" + + grep -q 'UseHiggs3LoopNMSSM' "${model_file}" && \ + mma_symbol_is "$model_file" "$math_cmd" "UseHiggs3LoopNMSSM" "True" && \ + ho="${ho} MSSM_higgs NMSSM_higgs" + + grep -q 'UseHiggs3LoopSplit' "${model_file}" && \ + mma_symbol_is "$model_file" "$math_cmd" "UseHiggs3LoopSplit" "True" && \ + ho="${ho} SplitMSSM" ho=$(make_unique "${ho}") ho=$(string_trim "${ho}") @@ -3115,12 +3330,12 @@ update_module_mk() { local math_cmd="${4:-math}" [ -e "$model_file" ] || return - { find "$mkfile" -newer "$model_file" | grep ^; } > /dev/null 2>&1 && - return message -n " Updating model-specific modules in $mkfile ... " - local ho="$(get_model_specific_corrections "$model_file" "$math_cmd")" + local ho + ho="$(get_model_specific_corrections "$model_file" "$math_cmd")" sed -i -e "s|^\(MOD${name}_MOD[[:space:]]*:=\).*$|\1 $ho|" "$mkfile" + touch "${mkfile}" "${model_file}" message "($ho)" logmsg " Depends on model-specific modules: ${ho}" } @@ -3129,16 +3344,18 @@ update_module_mk() { update_model_makefiles() { # If Mathematica is disabled, dependences on model-specific # modules should have been already resolved. - [ "$enable_meta" != yes -o -z "${MATH}" ] && return + if [ "$enable_meta" != yes ] || [ -z "${MATH}" ]; then + return + fi message "Checking model makefiles" + local model_name model_file mkfile for m in ${MODELS}; do - local model_name=$(echo ${m} | sed -e 's|models/||') - local model_file="${m}/FlexibleSUSY.m" - local mkfile="$m/module.mk" - - update_module_mk "$model_name" "$mkfile" "$model_file" "$MATH" + model_name="$(echo ${m} | sed -e 's|models/||')" + model_file="${m}/FlexibleSUSY.m" + mkfile="$m/module.mk" + update_module_mk "$model_name" "$mkfile" "$model_file" "$MATH" done } @@ -3211,6 +3428,24 @@ enable_defines() { fi logmsg " ${DEFINE_ENABLE_HIMALAYA}" + if test "x$enable_higgstools" = "xyes" ; then + DEFINE_ENABLE_HIGGSTOOLS="#define ENABLE_HIGGSTOOLS 1" + message "Enabling HiggsTools" + else + DEFINE_ENABLE_HIGGSTOOLS="#undef ENABLE_HIGGSTOOLS" + message "Disabling HiggsTools" + fi + logmsg " ${DEFINE_ENABLE_HIGGSTOOLS}" + + if test "x$enable_lilith" = "xyes" ; then + DEFINE_ENABLE_LILITH="#define ENABLE_LILITH 1" + message "Enabling Lilith" + else + DEFINE_ENABLE_LILITH="#undef ENABLE_LILITH" + message "Disabling Lilith" + fi + logmsg " ${DEFINE_ENABLE_LILITH}" + if test "x$enable_librarylink" = "xyes" ; then DEFINE_ENABLE_LIBRARYLINK="#define ENABLE_LIBRARYLINK 1" logmsg "Enabling LibraryLink" @@ -3308,9 +3543,11 @@ enable_defines() { DEFINE_ENABLE_TWO_SCALE_SOLVER="#define ENABLE_TWO_SCALE_SOLVER 1" DEFINE_ENABLE_LATTICE_SOLVER="#define ENABLE_LATTICE_SOLVER 1" DEFINE_ENABLE_SEMI_ANALYTIC_SOLVER="#define ENABLE_SEMI_ANALYTIC_SOLVER 1" + DEFINE_ENABLE_SHOOTING_SOLVER="#define ENABLE_SHOOTING_SOLVER 1" logmsg " ${DEFINE_ENABLE_TWO_SCALE_SOLVER}" logmsg " ${DEFINE_ENABLE_LATTICE_SOLVER}" logmsg " ${DEFINE_ENABLE_SEMI_ANALYTIC_SOLVER}" + logmsg " ${DEFINE_ENABLE_SHOOTING_SOLVER}" break ;; two_scale) DEFINE_ENABLE_TWO_SCALE_SOLVER="#define ENABLE_TWO_SCALE_SOLVER 1"; @@ -3324,6 +3561,10 @@ enable_defines() { DEFINE_ENABLE_SEMI_ANALYTIC_SOLVER="#define ENABLE_SEMI_ANALYTIC_SOLVER 1"; logmsg " ${DEFINE_ENABLE_SEMI_ANALYTIC_SOLVER}" continue ;; + shooting) + DEFINE_ENABLE_SHOOTING_SOLVER="#define ENABLE_SHOOTING_SOLVER 1"; + logmsg " ${DEFINE_ENABLE_SHOOTING_SOLVER}" + continue ;; *) message "Error: unknown solver: $a"; message "Available solvers: $available_solvers"; @@ -3332,25 +3573,37 @@ enable_defines() { done for a in ${ADDONS}; do - local addon_name="$(basename ${a})" + local addon_name + addon_name="$(basename ${a})" DEFINE_ENABLE_ADDONS="${DEFINE_ENABLE_ADDONS}@n@#define ENABLE_${addon_name} 1" done } #_____________________________________________________________________ add_metaflags() { - local tlib_='FSLoopLibraries = { FSSOFTSUSY' - local lib_="$tlib_" - test $enable_looptools = 'yes' && lib_="${lib_}, FSLoopTools" - test $enable_fflite = 'yes' && lib_="${lib_}, FSFFlite" - test $enable_collier = 'yes' && lib_="${lib_}, FSCOLLIER" + local tlib_ lib_ + tlib_='FSLoopLibraries = { FSSOFTSUSY' + lib_="${tlib_}" + test ${enable_looptools} = 'yes' && lib_="${lib_}, FSLoopTools" + test ${enable_fflite} = 'yes' && lib_="${lib_}, FSFFlite" + test ${enable_collier} = 'yes' && lib_="${lib_}, FSCOLLIER" lib_="${lib_} };" - local tfa_='FSFeynArtsAvailable = ' - local fa_="${tfa_}$(test $enable_feynarts = 'yes' && echo 'True' || echo 'False');" + local tfa_ fa_ + tfa_='FSFeynArtsAvailable = ' + fa_="${tfa_}$(test ${enable_feynarts} = 'yes' && echo 'True' || echo 'False');" - local tfc_='FSFormCalcAvailable = ' - local fc_="${tfc_}$(test $enable_formcalc = 'yes' && echo 'True' || echo 'False');" + local tfc_ fc_ + tfc_='FSFormCalcAvailable = ' + fc_="${tfc_}$(test ${enable_formcalc} = 'yes' && echo 'True' || echo 'False');" + + local tcol_ col_ + tcol_='FSEnableColors = ' + col_="${tcol_}$(test ${enable_colors} = 'yes' && echo 'True' || echo 'False');" + + local tcom_ com_ + tcom_='FSEnableCompile = ' + com_="${tcom_}$(test ${enable_compile} = 'yes' && echo 'True' || echo 'False');" local c_='' local fs_='' @@ -3374,18 +3627,28 @@ add_metaflags() { [ "$c_" != '' ] && sed -i "s/${tfc_}.*/${fc_}/g" $fs_ || echo "$fc_" >> $fs_ fi + c_=$(grep "$tcol_" $fs_) + if [ "$c_" != "$col_" ]; then + [ "$c_" != '' ] && sed -i "s/${tcol_}.*/${col_}/g" $fs_ || echo "$col_" >> $fs_ + fi + + c_=$(grep "$tcom_" $fs_) + if [ "$c_" != "$com_" ]; then + [ "$c_" != '' ] && sed -i "s/${tcom_}.*/${com_}/g" $fs_ || echo "$com_" >> $fs_ + fi + done } #_____________________________________________________________________ replace_markers() { sed -e "s|@FLEXIBLESUSY_VERSION@|$FLEXIBLESUSY_VERSION|" \ - -e "s|@OPERATING_SYSTEM@|$operating_system|" \ + -e "s|@OPERATING_SYSTEM@|$operating_system|" \ -e "s|@FLEXIBLESUSY_MAJOR@|$FLEXIBLESUSY_MAJOR|" \ -e "s|@FLEXIBLESUSY_MINOR@|$FLEXIBLESUSY_MINOR|" \ -e "s|@FLEXIBLESUSY_PATCH@|$FLEXIBLESUSY_PATCH|" \ -e "s|@FLEXIBLESUSY_EXTRA@|$FLEXIBLESUSY_EXTRA|" \ - -e "s|@GIT_COMMIT@|$GIT_COMMIT|" \ + -e "s|@GIT_COMMIT@|$GIT_COMMIT|" \ -e "s|@PKGNAME@|$PROGRAM_NAME|" \ -e "s|@ABSBASEDIR@|$ABSBASEDIR|" \ -e "s|@ADDONS@|$ADDONS|" \ @@ -3405,16 +3668,16 @@ replace_markers() { -e "s|@FFLAGS@|$FFLAGS|" \ -e "s|@FLIBS@|$FLIBS|" \ -e "s|@FUTILIBS@|$FUTILIBS|" \ - -e "s|@FMOD@|$FMOD|" \ - -e "s|@FSTD@|$FSTD|" \ + -e "s|@FMOD@|$FMOD|" \ + -e "s|@FSTD@|$FSTD|" \ -e "s|@FSCONFIG@|$FSCONFIG|" \ -e "s|@EIGENFLAGS@|$EIGENFLAGS|" \ -e "s|@GSLLIBS@|$GSLLIBS|" \ -e "s|@GSLFLAGS@|$GSLFLAGS|" \ - -e "s|@LDFLAGS@|$LDFLAGS|" \ - -e "s|@LDLIBS@|$LDLIBS|" \ - -e "s|@LLFLAGS@|$LLFLAGS|" \ - -e "s|@LLLIBS@|$LLLIBS|" \ + -e "s|@LDFLAGS@|$LDFLAGS|" \ + -e "s|@LDLIBS@|$LDLIBS|" \ + -e "s|@LLFLAGS@|$LLFLAGS|" \ + -e "s|@LLLIBS@|$LLLIBS|" \ -e "s|@ENABLE_COLORS@|$enable_colors|" \ -e "s|@ENABLE_COMPILE@|$enable_compile|" \ -e "s|@ENABLE_COMPILER_WARNINGS@|$enable_compiler_warnings|" \ @@ -3422,6 +3685,7 @@ replace_markers() { -e "s|@ENABLE_DEBUG@|$enable_debug|" \ -e "s|@ENABLE_FFLITE@|$enable_fflite|" \ -e "s|@ENABLE_GM2CALC@|$enable_gm2calc|" \ + -e "s|@ENABLE_HIGGSTOOLS@|$enable_higgstools|" \ -e "s|@ENABLE_HIMALAYA@|$enable_himalaya|" \ -e "s|@ENABLE_LIBRARYLINK@|$enable_librarylink|" \ -e "s|@ENABLE_FEYNARTS@|$enable_feynarts|" \ @@ -3432,20 +3696,26 @@ replace_markers() { -e "s|@ENABLE_THREADS@|$enable_threads|" \ -e "s|@ENABLE_TSIL@|$enable_tsil|" \ -e "s|@ENABLE_VERBOSE@|$enable_verbose|" \ - -e "s|@GM2CALCLIBS@|$GM2CALCLIBS|" \ - -e "s|@GM2CALCFLAGS@|$GM2CALCFLAGS|" \ - -e "s|@HIMALAYALIBS@|$HIMALAYALIBS|" \ - -e "s|@HIMALAYAFLAGS@|$HIMALAYAFLAGS|" \ + -e "s|@GM2CALCLIBS@|$GM2CALCLIBS|" \ + -e "s|@GM2CALCFLAGS@|$GM2CALCFLAGS|" \ + -e "s|@HIGGSTOOLSLIBS@|$HIGGSTOOLSLIBS|" \ + -e "s|@HIGGSTOOLSFLAGS@|$HIGGSTOOLSFLAGS|" \ + -e "s|@HIMALAYALIBS@|$HIMALAYALIBS|" \ + -e "s|@HIMALAYAFLAGS@|$HIMALAYAFLAGS|" \ -e "s|@LOOPFUNCLIBS@|$LOOPFUNCLIBS|" \ -e "s|@LOOPFUNCFLAGS@|$LOOPFUNCFLAGS|" \ + -e "s|@LILITHFLAGS@|$LILITHFLAGS|" \ + -e "s|@PYTHONFLAGS@|$PYTHONFLAGS|" \ + -e "s|@PYTHONLIBS@|$PYTHONLIBS|" \ + -e "s|@ENABLE_LILITH@|$enable_lilith|" \ -e "s|@ENABLE_LOOPTOOLS@|$enable_looptools|" \ -e "s|@LOOPTOOLSLIBS@|$LOOPTOOLSLIBS|" \ -e "s|@LOOPTOOLSFLAGS@|$LOOPTOOLSFLAGS|" \ -e "s|@OPTIONAL_MODULES@|$OPTIONAL_MODULES|" \ -e "s|@SARAH_DEP_GEN@|$SARAH_DEP_GEN|" \ -e "s|@SARAH_MODEL_DIR@|$SARAH_MODEL_DIR|" \ - -e "s|@SHARED_LIB_CMD@|$SHARED_LIB_CMD|" \ - -e "s|@STATIC_LIB_CMD@|$STATIC_LIB_CMD|" \ + -e "s|@SHARED_LIB_CMD@|$SHARED_LIB_CMD|" \ + -e "s|@STATIC_LIB_CMD@|$STATIC_LIB_CMD|" \ -e "s|@SQLITELIBS@|$SQLITELIBS|" \ -e "s|@SQLITEFLAGS@|$SQLITEFLAGS|" \ -e "s|@TSILLIBS@|$TSILLIBS|" \ @@ -3477,7 +3747,9 @@ enable/disable options, prefix with either --enable- or --disable- debug Debug messages and assertions (no default) fflite Use fflite to compute the loop functions (default: $enable_fflite) gm2calc Enable GM2Calc (default: $enable_gm2calc) + higgstools Enable HiggsTools (default: $enable_higgstools) himalaya Enable Himalaya (default: $enable_himalaya) + lilith Enable Lilith (default: $enable_lilith) librarylink Build LibraryLink library for Mathematica interface (default: $enable_librarylink) looptools Use LoopTools to compute the loop functions (default: $enable_looptools) mass-error-check Check mass eigenvalue precision (default: $enable_mass_error_check) @@ -3504,7 +3776,7 @@ Package directories, compilation settings and model selection (default: $ADDONS) --with-boost-libdir= Path to search for BOOST libraries --with-boost-incdir= Path to search for BOOST headers - --with-cppflags C preprocessor flags (default: $CPPFLAGS) + --with-cppflags= C preprocessor flags (default: $CPPFLAGS) --with-cxx= C++ compiler (default: $CXX) --with-cxxflags= C++ compiler flags (default: $CXXFLAGS) --with-eigen-incdir= Path to search for Eigen headers @@ -3517,7 +3789,10 @@ Package directories, compilation settings and model selection --with-gsl-config= Path to gsl-config (default: $gsl_config) --with-himalaya-libdir= Path to search for Himalaya library --with-himalaya-incdir= Path to search for Himalaya header + --with-higgstools-libdir= Path to search for HiggsTools library + --with-higgstools-incdir= Path to search for HiggsTools header --with-install-dir= Path to source code installation directory + --with-lilith= Path to Lilith --with-llflags= Preprocessor flags for compiling with LibraryLink (default: $LLFLAGS) --with-lllibs= Linker flags for linking LibraryLink libraries (default: $LLLIBS) --with-loop-libraries= Comma separated list of loop libraries to be enabled @@ -3585,7 +3860,8 @@ if test $# -gt 0 ; then case $1 in --enable-*) f=$(echo "$1" | sed -e 's/--//' -e 's/-/_/g') - eval prev='$'$(echo "${f}") + eval prev='$'"$(echo "${f}")" + # shellcheck disable=SC2154 if test "x${prev}" = "xyes"; then echo "INFO: $1: already enabled by default." fi @@ -3609,7 +3885,7 @@ if test $# -gt 0 ; then ;; --disable-*) f=$(echo "$1" | sed -e 's/--disable/enable/' -e 's/-/_/g') - eval prev='$'$(echo "${f}") + eval prev='$'"$(echo "${f}")" if test "x${prev}" = "xno"; then echo "INFO: $1: already disabled by default." fi @@ -3628,7 +3904,10 @@ if test $# -gt 0 ; then --with-boost-libdir=*) boost_lib_dir=$optarg ;; --with-boost-incdir=*) boost_inc_dir=$optarg ;; --with-cppflags=*) CPPFLAGS=$optarg ;; - --with-cxx=*) CXX=$optarg ;; + --with-cxx=*) CXX=$optarg + SHARED_LIB_CMD="$CXX -shared -o" + LIBLNK_MAKE_LIB_CMD="$SHARED_LIB_CMD" + ;; --with-cxxflags=*) CXXFLAGS=$optarg ;; --with-collier-libdir=*) collier_lib_dir=$optarg ;; --with-collier-incdir=*) collier_inc_dir=$optarg ;; @@ -3639,9 +3918,12 @@ if test $# -gt 0 ; then --with-gm2calc-incdir=*) gm2calc_inc_dir=$optarg ;; --with-gm2calc-libdir=*) gm2calc_lib_dir=$optarg ;; --with-gsl-config=*) gsl_config=$optarg ;; + --with-higgstools-incdir=*) higgstools_inc_dir=$optarg ;; + --with-higgstools-libdir=*) higgstools_lib_dir=$optarg ;; --with-himalaya-incdir=*) himalaya_inc_dir=$optarg ;; --with-himalaya-libdir=*) himalaya_lib_dir=$optarg ;; --with-install-dir=*) INSTALL_DIR=$optarg ;; + --with-lilith=*) lilith_dir=$optarg ;; --with-llflags=*) LLFLAGS=$optarg ;; --with-lllibs=*) LLLIBS=$optarg ;; --with-loop-libraries=*) LOOP_LIBRARIES=$optarg ;; @@ -3680,7 +3962,8 @@ check_install_dir # check for Mathematica if meta code generation is enabled or we # compile with LibraryLink -if [ "$enable_meta" = yes -o \( "$enable_compile" = yes -a "$enable_librarylink" != no \) ]; then +if [ "$enable_meta" = yes ] || \ + { [ "$enable_compile" = yes ] && [ "$enable_librarylink" != no ] ;} ; then check_math_cmd check_mathematica_info else @@ -3695,6 +3978,8 @@ if test "x${enable_meta}" = "xyes"; then check_feynarts check_formcalc else + if [ ! "${enable_feynarts}" = "no" ]; then DEFINE_ENABLE_FEYNARTS="#define ENABLE_FEYNARTS 1"; fi + if [ ! "${enable_formcalc}" = "no" ]; then DEFINE_ENABLE_FORMCALC="#define ENABLE_FORMCALC 1"; fi enable_feynarts=no enable_formcalc=no fi @@ -3726,10 +4011,13 @@ if test "x${enable_compile}" = "xyes"; then check_gsl_config check_gm2calc check_himalaya + check_higgstools if use_solver "lattice"; then check_boost_thread_incl check_boost_thread_libs fi + check_python + check_lilith check_looplibrary check_odeint check_sqlite @@ -3791,6 +4079,8 @@ sed -e "s|@FLEXIBLESUSY_VERSION@|$FLEXIBLESUSY_VERSION|" \ -e "s|@GSLFLAGS@|$GSLFLAGS|" \ -e "s|@GM2CALCLIBS@|$GM2CALCLIBS|" \ -e "s|@GM2CALCFLAGS@|$GM2CALCFLAGS|" \ + -e "s|@HIGGSTOOLSLIBS@|$HIGGSTOOLSLIBS|" \ + -e "s|@HIGGSTOOLSFLAGS@|$HIGGSTOOLSFLAGS|" \ -e "s|@HIMALAYALIBS@|$HIMALAYALIBS|" \ -e "s|@HIMALAYAFLAGS@|$HIMALAYAFLAGS|" \ -e "s|@LDFLAGS@|$LDFLAGS|" \ @@ -3819,7 +4109,9 @@ sed -e "s|@FLEXIBLESUSY_VERSION@|$FLEXIBLESUSY_VERSION|" \ -e "s|@DEFINE_ENABLE_FFLITE@|$DEFINE_ENABLE_FFLITE|" \ -e "s|@DEFINE_ENABLE_GM2CALC@|$DEFINE_ENABLE_GM2CALC|" \ -e "s|@DEFINE_ENABLE_HIMALAYA@|$DEFINE_ENABLE_HIMALAYA|" \ + -e "s|@DEFINE_ENABLE_HIGGSTOOLS@|$DEFINE_ENABLE_HIGGSTOOLS|" \ -e "s|@DEFINE_ENABLE_LIBRARYLINK@|$DEFINE_ENABLE_LIBRARYLINK|" \ + -e "s|@DEFINE_ENABLE_LILITH@|$DEFINE_ENABLE_LILITH|" \ -e "s|@DEFINE_ENABLE_LOOPTOOLS@|$DEFINE_ENABLE_LOOPTOOLS|" \ -e "s|@DEFINE_ENABLE_COLLIER@|$DEFINE_ENABLE_COLLIER|" \ -e "s|@DEFINE_ENABLE_RANDOM@|$DEFINE_ENABLE_RANDOM|" \ @@ -3832,7 +4124,10 @@ sed -e "s|@FLEXIBLESUSY_VERSION@|$FLEXIBLESUSY_VERSION|" \ -e "s|@DEFINE_ENABLE_TWO_SCALE_SOLVER@|$DEFINE_ENABLE_TWO_SCALE_SOLVER|" \ -e "s|@DEFINE_ENABLE_LATTICE_SOLVER@|$DEFINE_ENABLE_LATTICE_SOLVER|" \ -e "s|@DEFINE_ENABLE_SEMI_ANALYTIC_SOLVER@|$DEFINE_ENABLE_SEMI_ANALYTIC_SOLVER|" \ + -e "s|@DEFINE_ENABLE_SHOOTING_SOLVER@|$DEFINE_ENABLE_SHOOTING_SOLVER|" \ -e "s|@DEFINE_ENABLE_ADDONS@|$DEFINE_ENABLE_ADDONS|" \ + -e "s|@DEFINE_ENABLE_FEYNARTS@|$DEFINE_ENABLE_FEYNARTS|" \ + -e "s|@DEFINE_ENABLE_FORMCALC@|$DEFINE_ENABLE_FORMCALC|" \ -e 's|@n@|\ |g' \ < $CONFIGHDR_TMPL > $CONFIGHDR diff --git a/createaddon b/createaddon index d0941363bc..a8ce3d8103 100755 --- a/createaddon +++ b/createaddon @@ -3,9 +3,6 @@ # addon creation script for FlexibleSUSY # Author: Alexander Voigt -# directory of this script -BASEDIR=$(dirname $0) - overwrite="no" name="" @@ -13,7 +10,6 @@ name="" exit_ok="0" exit_syntax_error="1" exit_addon_dir_exists="2" -exit_no_default_addon="3" #_____________________________________________________________________ help() { diff --git a/createmodel b/createmodel index 8805c11a65..43e3ccfaaa 100755 --- a/createmodel +++ b/createmodel @@ -6,22 +6,6 @@ # directory of this script BASEDIR=$(dirname $0) -# absolute path to this script -ABSBASEDIR=$(cd $BASEDIR; pwd) - -# operating system -operating_system="`(uname -s) 2>/dev/null || echo unknown`" - -# determine Mathematica user directory -case "$operating_system" in - Darwin) mathematica_dir="${HOME}/Library/Mathematica" ;; - CYGWIN_NT*) mathematica_dir="${USERPROFILE}/AppData/Roaming/Mathematica" ;; - # Linux, *BSD - *) mathematica_dir="${HOME}/.Mathematica" ;; -esac - -mathematica_applications_dir="${mathematica_dir}/Applications" -sarah_default_dir="${mathematica_applications_dir}/SARAH" flexiblesusy_sarah_dir="${BASEDIR}/sarah" mathematica_kernel="math" @@ -179,7 +163,14 @@ is_executable () { return 1 fi + # shellcheck disable=SC2034 cmd=$(command -v -- "$1") + logmsg "(command -v -- $1 gave: $cmd)" + case "$cmd" in + /*) return 0 ;; + alias\ *) return 1 ;; # alias + *) return 1 ;; # built-in or function + esac } #_____________________________________________________________________ @@ -218,7 +209,7 @@ check_model_name() { local _model="$1" - if [ -z $(echo "${_model}" | grep -E "^[a-zA-Z][0-9a-zA-Z_]*$") ]; then + if [ -z "$(echo "${_model}" | grep -E "^[a-zA-Z][0-9a-zA-Z_]*$")" ]; then printf "Error: invalid model name ${_model}. " if [ -n "$(echo "${_model}" | grep -E -o "^[0-9]")" ]; then printf "Model name must start with a letter. " @@ -251,7 +242,7 @@ check_sarah_model() { if ! is_executable "$mathematica_kernel" ; then message "error" - message "Error: could not find Mathematica kernel \"${mathematica_kernel}\"" + message "Error: Mathematica kernel ${mathematica_kernel} was not found or is not executable or is an alias." message " Please specify the Mathematica kernel via --with-math-cmd=" exit 1 fi @@ -388,31 +379,32 @@ if test $# -gt 0 ; then case $1 in --enable-*) f=`echo $1 | sed -e 's/--//' -e 's/-/_/g'` - eval prev='$'`echo ${f}` + eval prev='$'"$(echo "${f}")" + # shellcheck disable=SC2154 if test "x${prev}" = "xyes"; then message "INFO: $1: already enabled by default." fi - if test ! "x`message ${deprecated_options} | grep ${f}`" = "x"; then - message "WARNING: option $1 is deprecated and ignored"'!' - fi + #if test ! "x`message ${deprecated_options} | grep ${f}`" = "x"; then + # message "WARNING: option $1 is deprecated and ignored"'!' + #fi eval ${f}=yes for c in $options ; do if test "x$c" = "x$f" ; then f="" fi done - for c in $deprecated_options ; do - if test "x$c" = "x$f" ; then - f="" - fi - done + #for c in $deprecated_options ; do + # if test "x$c" = "x$f" ; then + # f="" + # fi + #done if test "x$f" != "x" ; then message "Invalid option '$1'. Try $0 --help" ; exit 1 ; fi ;; --disable-*) f=`echo $1 | sed -e 's/--disable/enable/' -e 's/-/_/g'` - eval prev='$'`echo ${f}` + eval prev='$'"$(echo "${f}")" if test "x${prev}" = "xno"; then message "INFO: $1: already disabled by default." fi @@ -462,6 +454,9 @@ message -n "Searching for ${model_file} model file ... " if test -r "$model_file_dir/FlexibleSUSY.m.in"; then message "found ${model_file_dir}/FlexibleSUSY.m.in" +elif test -r "test/$model_file_dir/FlexibleSUSY.m.in"; then + message "found test/${model_file_dir}/FlexibleSUSY.m.in" + model_file_dir="test/${model_file_dir}" else message "no found in ${model_file_dir}" echo "Error: No FlexibleSUSY model file found in ${model_file_dir}/" @@ -504,7 +499,8 @@ if test ! -d "$targetdir" ; then message "done" fi -set -- $(find $model_file_dir -type f -iname LesHouches.in\* -not -iname \*~ -exec basename {} \; | tr '\n' ' ') +# shellcheck disable=SC2046 +set -- $(find -L $model_file_dir -type f -iname LesHouches.in\* -not -iname \*~ -exec basename {} \; | tr '\n' ' ') SLHA_input_files="$*" SLHA_input_files_in_mk=$(echo "$SLHA_input_files" | @@ -539,6 +535,7 @@ sed -e "s|@DIR@|$targetdir|g" \ -e "s|@CLASSNAME@|$name|g" \ -e "s|FSModelName\([[:blank:]]*=[[:blank:]]*\)[^;][^;]*|FSModelName\1\"$name\"|g" \ < $model_file_dir/FlexibleSUSY.m.in > $targetdir/FlexibleSUSY.m +touch -d "1 min ago" "${targetdir}/FlexibleSUSY.m" message "done" for slha_in in $SLHA_input_files; do diff --git a/doc/librarylink.rst b/doc/librarylink.rst index 494473cf50..c12fe3d107 100644 --- a/doc/librarylink.rst +++ b/doc/librarylink.rst @@ -575,7 +575,7 @@ Output: ``spectrum.slha`` 12 0.00000000E+00 # force output 13 1.00000000E+00 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) 14 1.00000000E-11 # beta-function zero threshold - 15 0.00000000E+00 # calculate observables (a_muon, ...) + 15 0.00000000E+00 # calculate all observables 16 0.00000000E+00 # force positive majorana masses 17 0.00000000E+00 # pole mass renormalization scale (0 = SUSY scale) 18 0.00000000E+00 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/doc/manuals/flexiblesusy-2.0.tex b/doc/manuals/flexiblesusy-2.0.tex index ae64e271cd..1ee75dd6e2 100644 --- a/doc/manuals/flexiblesusy-2.0.tex +++ b/doc/manuals/flexiblesusy-2.0.tex @@ -609,7 +609,7 @@ \subsection{Downloading \fs and generating a first spectrum generator} $ cd FlexibleSUSY-2.0.1 \end{lstlisting}%% $ % -\fstwo is distributed with a huge selection of predefined ``models'', +\fstwo is distributed with a huge selection of predefined ``models'', including several MSSM and NMSSM scenarios such as the CMSSM (called \modelname{CMSSM}), high-scale SUSY and split-SUSY (called \HSSUSY and \modelname{SplitMSSM}; these models have been created for @@ -619,9 +619,9 @@ \subsection{Downloading \fs and generating a first spectrum generator} $R$-symmetric MSSM (\modelname{MRSSM}; for a definition of the model see Ref.~\cite{Kribs:2007ac}), the NUHM \ESSM (\modelname{E6SSM}, see \cite{King:2005jy,King:2005my,Athron:2010zz, - Athron:2009ue,Athron:2009bs,Athron:2007en}) and the two-Higgs + Athron:2009ue,Athron:2009bs,Athron:2007en}) and the two-Higgs doublet model type II -(\modelname{THDMII}). See the +(\modelname{THDMII}). See the contents of \code{model_files/} for all predefined model files. A spectrum generator for any of these models can be built with just @@ -1228,19 +1228,19 @@ \subsubsection{SM-specific higher-order contributions} % The 2-loop and 3-loop contributions enter the mass of the Higgs boson as -\begin{align} +\begin{align} \begin{split} M_h^2 &= m_h^2 + (\Delta m_h^2)_{1L}(p^2) + (\Delta m_h^2)_{2L}(p^2) +(\Delta m_h^2)_{3L} \,, \end{split} \label{eq:Mh_polp^2} \end{align} -where $m_h^2$ and $(\Delta m_h)_{1L}(p^2)$ correspond to the tree-level +where $m_h^2$ and $(\Delta m_h)_{1L}(p^2)$ correspond to the tree-level and a 1-loop expression, respectively. The enabled 2-loop SM contributions of $O(\at^2 + \at \as)$ to the Higgs mass read % \begin{align} - (\Delta m_h^2)_{2L}(p^2) &= (\Delta m_h^2)_{2L}^{(\at^2)} + + (\Delta m_h^2)_{2L}(p^2) &= (\Delta m_h^2)_{2L}^{(\at^2)} + (\Delta m_h^2)_{2L}^{(\at\as)}(p^2) \,, \\ (\Delta m_h^2)_{2L}^{(\at^2)} &= \frac{2 t}{(4\pi)^4} \left[ @@ -1258,22 +1258,22 @@ \subsubsection{SM-specific higher-order contributions} \end{align} % In Eqs.~\eqref{eq:2L_Mh_atat} ff.\ the abbreviations $t \equiv m_t^2$ -and $\barlog(t) \equiv \log(t/Q^2)$ have been used for brevity, -analogous to the notation of Ref.~\cite{Martin:2014cxa}, where $m_t$ -is the \MSbar top mass in the SM\@. -By performing a momentum iteration in the computation of the Higgs -pole mass, the momentum entering the 1-loop self energy in -Eq.~\eqref{eq:Mh_polp^2} consists of a tree-level part and a loop +and $\barlog(t) \equiv \log(t/Q^2)$ have been used for brevity, +analogous to the notation of Ref.~\cite{Martin:2014cxa}, where $m_t$ +is the \MSbar top mass in the SM\@. +By performing a momentum iteration in the computation of the Higgs +pole mass, the momentum entering the 1-loop self energy in +Eq.~\eqref{eq:Mh_polp^2} consists of a tree-level part and a loop correction. -In combination with Eq.~\eqref{eq:2L_Mh_atat}, the latter yields the -complete Higgs mass contribution at $O(\at^2 t)$ which is identical +In combination with Eq.~\eqref{eq:2L_Mh_atat}, the latter yields the +complete Higgs mass contribution at $O(\at^2 t)$ which is identical to the corresponding correction given in Ref.~\cite{Degrassi:2012ry}. The 2-loop self energy at $O(\at\as)$ \cite{Martin:2014cxa} together with the occurring integral functions from Ref.~\cite{Martin:2003qz} have been evaluated for a small external momentum argument. Neglecting higher orders, the expansion in powers of the momentum over the \MSbar -top mass up to $O(p^4/t)$ results in the Eq.~\eqref{eq:2L_Mh_atas}. -Note that the momentum dependence is included in the 2-loop expression +top mass up to $O(p^4/t)$ results in the Eq.~\eqref{eq:2L_Mh_atas}. +Note that the momentum dependence is included in the 2-loop expression in order to generate implicit 3-loop $O(\at^2\as)$ terms. % The explicit 3-loop effective potential contributions of @@ -6042,7 +6042,7 @@ \section{FlexibleSUSY configuration options} 12 0 # force output 13 1 # Top quark 2L corrections QCD 14 1e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT diff --git a/doc/model_file.rst b/doc/model_file.rst index c67f967032..a9bf16056d 100644 --- a/doc/model_file.rst +++ b/doc/model_file.rst @@ -934,6 +934,46 @@ If ``FSSolveEWSBFor[EWSBOutputParameters]`` is not given in any boundary condition, then it is added to ``SUSYScaleInput``. This implies, that by default, the EWSB conditions are imposed at the scale ``SUSYScale``. +In some models FlexibleSUSY cannot solve the EWSB conditions for the +desired parameter(s) given in ``EWSBOutputParameters``. In this case +one can implement the solution of the EWSB conditions by hand in the +FlexibleSUSY model file using the variable ``TreeLevelEWSBSolution``. +The variable ``TreeLevelEWSBSolution`` must be a list. The list +elements are two-component lists, where the first entry is the symbol +of the parameter to be fixed, and the second entry is the expression +used to fix the value of the parameter:: + + TreeLevelEWSBSolution = { + {, }, + {, }, + ... + }; + +Example: (``CMSSMSemiAnalytic``):: + + TreeLevelEWSBSolution = { + {m0Sq, ((mHd2Coeff2 vd^2 - mHu2Coeff2 vu^2) m12^2 + + (mHd2Coeff3 vd^2 - mHu2Coeff3 vu^2) m12 Azero + + (mHd2Coeff4 vd^2 - mHu2Coeff4 vu^2) Azero^2 + + (Abs[\[Mu]]^2 + (g2^2 + GUTNormalization[g1]^2 g1^2) + ( vd^2 + vu^2) / 8) (vd^2 - vu^2) + - vd tadpole[1] + vu tadpole[2]) + / (mHu2Coeff1 vu^2 - mHd2Coeff1 vd^2)}, + {BMu0, vd vu ((mHd2Coeff1 + mHu2Coeff1) m0Sq + + (mHd2Coeff2 + mHu2Coeff2) m12^2 + + (mHd2Coeff3 + mHu2Coeff3) m12 Azero + + (mHd2Coeff4 + mHu2Coeff4) Azero^2 + 2 Abs[\[Mu]]^2 + - tadpole[1] / vd - tadpole[2] / vu) + / (BMuCoeff1 (vd^2 + vu^2)) - BMuCoeff2 MuBV m12 / BMuCoeff1 + - BMuCoeff3 MuBV Azero / BMuCoeff1} + }; + +Note: To express the tadpole loop expressions the symbol +``tadpole[n]`` can be used, where ``n`` is a positive integer (``n > 0``) +enumerating the tadpole expressions. The order of the enumeration +refers to the order of the list ``DEFINITION[EWSB][VEVs]`` in the +SARAH model file. + Automatic input of unspecified model parameters ''''''''''''''''''''''''''''''''''''''''''''''' diff --git a/doc/models/HSSUSY.rst b/doc/models/HSSUSY.rst index a8a5156da1..f1d337835c 100644 --- a/doc/models/HSSUSY.rst +++ b/doc/models/HSSUSY.rst @@ -93,7 +93,7 @@ threshold corrections in FlexibleSUSY. EWSB scale `````````` -The Higgs and W boson pole masses, :math:`M_h` and :math:`M_Z` are +The Higgs and W boson pole masses, :math:`M_h` and :math:`M_W` are calculated at the scale :math:`M_{\text{EWSB}}`, which is an input parameter. We recommend to set :math:`M_{\text{EWSB}} = M_t`. @@ -189,7 +189,7 @@ an SLHA input file we recommend to use:: 12 0 # force output 13 3 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) 14 1.0e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/doc/models/MSSMEFTHiggs.rst b/doc/models/MSSMEFTHiggs.rst index ebb8541ee8..fdfdaa5e98 100644 --- a/doc/models/MSSMEFTHiggs.rst +++ b/doc/models/MSSMEFTHiggs.rst @@ -196,7 +196,7 @@ an SLHA input file we recommend to use:: 12 0 # force output 13 3 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) 14 1.0e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/doc/models/NUHMSSMNoFVHimalaya.rst b/doc/models/NUHMSSMNoFVHimalaya.rst index a85c6893ed..76b41786fb 100644 --- a/doc/models/NUHMSSMNoFVHimalaya.rst +++ b/doc/models/NUHMSSMNoFVHimalaya.rst @@ -20,13 +20,14 @@ Building the NUHMSSMNoFVHimalaya -------------------------------- In order to use the 3-loop contributions to the light CP-even Higgs -mass from the `Himalaya library`_, the NUHMSSMNoFVHimalaya must be -configured with the ``--enable-himalaya`` flag:: +mass from the `Himalaya library`_ version 4.0.0 (or higher), the +NUHMSSMNoFVHimalaya must be configured with the ``--enable-himalaya`` +flag:: ./createmodel --name=NUHMSSMNoFVHimalaya ./configure --with-models=NUHMSSMNoFVHimalaya \ --enable-himalaya \ - --with-himalaya-incdir=${HIMALAYA_DIR}/source/include \ + --with-himalaya-incdir=${HIMALAYA_DIR}/include \ --with-himalaya-libdir=${HIMALAYA_DIR}/build make @@ -102,7 +103,7 @@ configuration flags: In an SLHA input file we recommend to use:: 12 0 # force output 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) 14 1.0e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/doc/module.mk b/doc/module.mk index cc17f4f08c..56c8cec294 100644 --- a/doc/module.mk +++ b/doc/module.mk @@ -27,6 +27,7 @@ INDEX_PAGE := $(HTML_OUTPUT_DIR)/index.html MAN_PAGE := $(MAN_OUTPUT_DIR)/index.html DOXYFILE := $(DIR)/Doxyfile DOXYGEN_MAINPAGE:= $(DIR)/mainpage.dox +DOXYGEN ?= doxygen .PHONY: all-$(MODNAME) clean-$(MODNAME) distclean-$(MODNAME) \ $(INDEX_PAGE) $(MAN_PAGE) doc doc-html doc-man doc-pdf @@ -63,7 +64,7 @@ clean:: clean-$(MODNAME) distclean:: distclean-$(MODNAME) $(INDEX_PAGE): - ( cat $(DOXYFILE) ; \ + $(Q)( cat $(DOXYFILE) ; \ echo "INPUT = $(MODULES) $(README_FILE)" ; \ echo "OUTPUT_DIRECTORY = $(HTML_OUTPUT_DIR)" ; \ echo "EXCLUDE = $(ALLDEP) $(META_SRC) $(TEMPLATES) \ @@ -71,10 +72,10 @@ $(INDEX_PAGE): echo "EXCLUDE_PATTERNS = */meta/* */test/*"; \ echo "IMAGE_PATH = $(IMAGE_DIR)"; \ echo "INCLUDE_PATH = $(MODULES)"; \ - ) | doxygen - + ) | $(DOXYGEN) - $(MAN_PAGE): - ( cat $(DOXYFILE) ; \ + $(Q)( cat $(DOXYFILE) ; \ echo "INPUT = $(MODULES) $(README_FILE)" ; \ echo "OUTPUT_DIRECTORY = $(MAN_OUTPUT_DIR)" ; \ echo "EXCLUDE = $(ALLDEP) $(META_SRC) $(TEMPLATES) \ @@ -84,4 +85,4 @@ $(MAN_PAGE): echo "INCLUDE_PATH = $(MODULES)"; \ echo "GENERATE_MAN = YES"; \ echo "GENERATE_HTML = NO"; \ - ) | doxygen - + ) | $(DOXYGEN) - diff --git a/doc/observables.rst b/doc/observables.rst index 0817e4eb5d..cb23593480 100644 --- a/doc/observables.rst +++ b/doc/observables.rst @@ -6,17 +6,17 @@ List of observables computed by ``FlexibleSUSY`` - `lepton physics `_: - - muon anomalous magnetic moment :math:`a_\mu` - - leptons electric dipole moments + - leptons anomalous magnetic moments :math:`$a_l$` + - leptons electric dipole moments :math:`$d_l$` - `lepton flavour violation `_: - - :math:`\mu \to e \gamma` *(in preparation)* - - :math:`\mu \to e` conversion in nucleus *(in preparation)* + - LFV decays of leptons: :math:`$l \to l' \gamma$` and :math:`$l \to 3l'$` + - :math:`$l \to l'$` conversion in nucleus - `b-physics `_: - - :math:`b \to s \gamma` + - :math:`$b \to s \gamma$` - `FlexibleDecay `_ @@ -24,3 +24,4 @@ List of observables computed by ``FlexibleSUSY`` - LO order (tree-level or loop-induced) decays of Higgs scalars into non-SM state - LO order (tree-level or loop-induced) decays of non-Higgs scalars +- Unitarity constraints diff --git a/doc/observables/FlexibleDecay.rst b/doc/observables/FlexibleDecay.rst index 2af666d913..094dcb982f 100644 --- a/doc/observables/FlexibleDecay.rst +++ b/doc/observables/FlexibleDecay.rst @@ -13,7 +13,7 @@ Creating model with decays Whether decays are created for a given model is controled by the viariable .. code-block:: mathematica - + FSCalculateDecays = True; in the model's ``FlexibleSUSY.m.in`` file. @@ -23,7 +23,7 @@ In models distributed with FlexibleSUSY which support decays we do set it explic Which decays are included is controled by :mathematica:`FSDecayParticles` variable. It's possible values are :mathematica:`Automatic` or a list of scalars present in the model. -By default it's set to +By default it's set to .. code-block:: mathematica @@ -35,7 +35,7 @@ As an example, in SARAH's THDM-II, :mathematica:`Automatic` is equivalen to sett .. code-block:: mathematica FSDecayParticles = {hh, Ah, Hpm}; - + One can also add other scalar. For example, to add squark decays in the SARAH's MSSM one would write @@ -74,7 +74,7 @@ The flags are: 0. Turn calculation of decay on/off (default = 1). #. Minimal branching ratio to print (default = 1e-5). -#. Maximal order of included higher order corrections (default = 4). Note that not all such corrections. +#. Maximal order of included higher order corrections (default = 4). Note that corrections up to a given order are not avaliable for all processes. #. Use α in the Thomson limit instead of a running one in decays to γγ and γZ. This should minimize higher order corrections. Flag 4 controls treatment of Higgs decay to gauge bosons @@ -152,7 +152,7 @@ SLHA 1.44211112E-03 2 22 23 # BR(hh -> VP VZ) 2.63348187E-04 2 -3 3 # BR(hh -> barFd(2) Fd(2)) 2.20054695E-04 2 -13 13 # BR(hh -> barFe(2) Fe(2)) - + The output conforms to the SLHA standard. LibraryLink @@ -162,16 +162,16 @@ LibraryLink { SM -> { - hh -> { + hh -> { 25, 0.00198076, { - {25, {-15,15}, 0.000157635}, - {25, {23,23}, 3.16863*10^-7}, - {25, {-24,24}, 1.14636*10^-6}, + {25, {-15,15}, 0.000157635}, + {25, {23,23}, 3.16863*10^-7}, + {25, {-24,24}, 1.14636*10^-6}, {25, {-3,3}, 7.44681*10^-7}, - {25, {22,22}, 1.8801*10^-6}, - {25, {-13,13}, 5.58985*10^-7}, - {25, {-5,5}, 0.00164052}, - {25, {-4,4}, 0.0000812031}, + {25, {22,22}, 1.8801*10^-6}, + {25, {-13,13}, 5.58985*10^-7}, + {25, {-5,5}, 0.00164052}, + {25, {-4,4}, 0.0000812031}, {25, {21,21}, 0.0000967487} } } @@ -184,5 +184,5 @@ The output for every channel, e.g. .. code-block:: mathematica {25, {-15,15}, 0.000157635} - + contains PDG identifiers for in and out particles and a partial width in GeV. diff --git a/doc/observables/unitarity.rst b/doc/observables/unitarity.rst new file mode 100644 index 0000000000..add310f7d4 --- /dev/null +++ b/doc/observables/unitarity.rst @@ -0,0 +1,5 @@ +=========== +Unitarity constraints +=========== + +Calculation relies on expression provided by SARAH and requires SARAH >= 4.13.0. diff --git a/doc/references.bib b/doc/references.bib index 0e69c09dbf..4688db56a8 100644 --- a/doc/references.bib +++ b/doc/references.bib @@ -76,6 +76,38 @@ @article{Harlander:2017kuc SLACcitation = "%%CITATION = ARXIV:1708.05720;%%" } +% FlexibleDecay +% \cite{Athron:2021kve} +@article{Athron:2021kve, + author = {Athron, Peter and B\"uchner, Adam and Harries, Dylan and Kotlarski, Wojciech and St\"ockinger, Dominik and Voigt, Alexander}, + title = "{FlexibleDecay: An automated calculator of scalar decay widths}", + eprint = "2106.05038", + archivePrefix = "arXiv", + primaryClass = "hep-ph", + doi = "10.1016/j.cpc.2022.108584", + journal = "Comput. Phys. Commun.", + volume = "283", + pages = "108584", + year = "2023" +} + +% ColorMath +% \cite{Sjodahl:2012nk} +@article{Sjodahl:2012nk, + author = {Sj\"odahl, Malin}, + title = "{ColorMath - A package for color summed calculations in SU(Nc)}", + eprint = "1211.2099", + archivePrefix = "arXiv", + primaryClass = "hep-ph", + reportNumber = "LU-TP-12-40, MCNET-13-04", + doi = "10.1140/epjc/s10052-013-2310-4", + journal = "Eur. Phys. J. C", + volume = "73", + number = "2", + pages = "2310", + year = "2013" +} + % \cite{Harlander:2018yhj} @article{Harlander:2018yhj, author = "Harlander, R. V. and Klappert, J. and Ochoa Franco, A. D. @@ -227,3 +259,18 @@ @article{Allanach:2013kza reportNumber = "ADP-13-33-T853", SLACcitation = "%%CITATION = ARXIV:1311.7659;%%", } + +@article{Athron:2022isz, + author = {Athron, Peter and Bach, Markus and Jacob, Douglas H. J. and Kotlarski, Wojciech and St\"ockinger, Dominik and Voigt, Alexander}, + title = "{Precise calculation of the W boson pole mass beyond the standard model with FlexibleSUSY}", + eprint = "2204.05285", + archivePrefix = "arXiv", + primaryClass = "hep-ph", + doi = "10.1103/PhysRevD.106.095023", + journal = "Phys. Rev. D", + volume = "106", + number = "9", + pages = "095023", + year = "2022" +} + diff --git a/doc/slha_input.rst b/doc/slha_input.rst index 5b6071829a..7165e7e5e1 100644 --- a/doc/slha_input.rst +++ b/doc/slha_input.rst @@ -28,7 +28,7 @@ FlexibleSUSY configuration block (FlexibleSUSY) 12 0 # force output 13 3 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.0e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, effective couplings) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass scale 18 0 # pole mass scale in the EFT (0 = min(SUSY scale, Mt)) @@ -574,14 +574,14 @@ loop Passarino-Veltman integrals via the following command:: Where ```` is a list of comma separated names for desired libraries. Currently the following set is available for usage: -======= =========== =========== ============== ================================= +======= =========== ============ ============== ============================================ index name library thread-safety commentary -======= =========== =========== ============== ================================= - 0 softsusy SOFTSUSY_ yes default value; always enabled - 1 collier COLLIER_ no optional; see **specific** below - 2 looptools LoopTools_ no optional; see **specific** below - 3 fflite FFlite yes optional; build in; see **specific** below -======= =========== =========== ============== ================================= +======= =========== ============ ============== ============================================ + 0 softsusy SOFTSUSY_ yes default value; always enabled + 1 collier COLLIER_ no optional; see **specific** below + 2 looptools LoopTools_ no optional; see **specific** below + 3 fflite FFlite yes optional; build in; see **specific** below +======= =========== ============ ============== ============================================ If the entry ``FlexibleSUSY[31]`` is absent, the loop functions from SOFTSUSY are used. If the entry ``FlexibleSUSY[31]`` is set to diff --git a/examples/customized-betas/LesHouches.in.MSSMcbs b/examples/customized-betas/LesHouches.in.MSSMcbs index 09c4c092bb..02e994c950 100644 --- a/examples/customized-betas/LesHouches.in.MSSMcbs +++ b/examples/customized-betas/LesHouches.in.MSSMcbs @@ -19,7 +19,7 @@ Block FlexibleSUSY 12 0 # force output 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/examples/new-observable/btosmumu/BrDLToDL/FlexibleSUSY.m b/examples/new-observable/btosmumu/BrDLToDL/FlexibleSUSY.m new file mode 100644 index 0000000000..74ca00d0cb --- /dev/null +++ b/examples/new-observable/btosmumu/BrDLToDL/FlexibleSUSY.m @@ -0,0 +1,115 @@ +FlexibleSUSY`WriteClass[obs:FlexibleSUSYObservable`BrDLToDL, slha_, files_] := +Module[ + { + observables = DeleteDuplicates@Cases[Observables`GetRequestedObservables@slha, _obs], + prototypes = "", definitions = "", npfHeaders = "", npfDefinitions = "", + fieldsFFV = {}, verticesFFV = {}, additionalVertices = {} + }, + + If[observables =!= {} && FlexibleSUSY`FSFeynArtsAvailable && FlexibleSUSY`FSFormCalcAvailable, + Utils`PrintHeadline["Creating " <> SymbolName@obs <> " class ..."]; + observables = DeleteDuplicates[observables /. f_@_Integer -> f@_]; + fieldsFFV = Cases[observables, Rule[{q_[_], _}, _] :> q, Infinity]; + verticesFFV = Cases[observables, Rule[{_, l_[_]}, _] :> {SARAH`bar@l, l, TreeMasses`GetPhoton[]}, Infinity]; + {additionalVertices, npfDefinitions, prototypes, definitions} = create@observables; + npfHeaders = NPointFunctions`CreateCXXHeaders[]; + ]; + + WriteOut`ReplaceInFiles[ + files, + { + "@calculate_prototypes@" -> prototypes, + "@calculate_definitions@" -> definitions, + "@npf_headers@" -> npfHeaders, + "@npf_definitions@" -> npfDefinitions, + "@include_guard@" -> SymbolName@obs, + "@namespace@" -> Observables`GetObservableNamespace@obs, + "@filename@" -> Observables`GetObservableFileName@obs, + Sequence@@FlexibleSUSY`Private`GeneralReplacementRules[] + } + ]; + + { + "FFV fields" -> DeleteDuplicates@fieldsFFV, + "C++ vertices" -> DeleteDuplicates@Join[verticesFFV, additionalVertices] + } +]; + +create[manyObservables:{__FlexibleSUSYObservable`BrDLToDL}] := { + DeleteDuplicates[Join@@#[[All,1]]], + StringRiffle[#[[All, 2]], "\n\n"], + StringRiffle[#[[All, 3]], "\n\n"], + StringRiffle[#[[All, 4]], "\n\n"] +}&[create/@DeleteDuplicates[manyObservables /. Rule[_Integer, _Integer] -> Rule[_, _]]]; + +create[obs:FlexibleSUSYObservable`BrDLToDL[{qd_[_], lep_[_]} -> _, contr_, loopN_]] := +Module[{npfVertices, npfDefinition, calculateDefinition, prototype, + keep, npf, fields, sp, dc, basis}, + keep = If[Head@contr === List, contr, {contr}]; + Print["Contributions: ", SymbolName/@keep]; + Print["Loop level: ", loopN]; + npf = NPointFunctions`NPointFunction[ + {qd, lep}, + {qd, lep}, + NPointFunctions`UseCache -> True, + NPointFunctions`OnShellFlag -> True, + NPointFunctions`ZeroExternalMomenta -> NPointFunctions`ExceptLoops, + NPointFunctions`LoopLevel -> loopN, + NPointFunctions`Regularize -> FlexibleSUSY`FSRenormalizationScheme, + NPointFunctions`Observable -> obs, + NPointFunctions`KeepProcesses -> keep + ]; + npf = npf /. { + SARAH`sum[__] -> 0, + LoopTools`B0i[i_, _, mm__] :> LoopTools`B0i[i, 0, mm], + LoopTools`C0i[i_, Repeated[_, {3}], mm__] :> LoopTools`C0i[i, Sequence@@Array[0&, 3], mm], + LoopTools`D0i[i_, Repeated[_, {6}], mm__] :> LoopTools`D0i[i, Sequence@@Array[0&, 6], mm] + }; + fields = Flatten@NPointFunctions`GetProcess@npf; + sp[i_] := SARAH`DiracSpinor[fields[[i]], 0, 0]; + dc[a_, b__, c_] := NPointFunctions`DiracChain[sp@a, b, sp@c]; + basis = With[{l = SARAH`Lorentz, R = 6, L = 7}, + { + "S_LL" -> dc[3,L,1] dc[4,L,2], + "S_LR" -> dc[3,L,1] dc[4,R,2], + "S_RL" -> dc[3,R,1] dc[4,L,2], + "S_RR" -> dc[3,R,1] dc[4,R,2], + "V_LL" -> dc[3,R,l@1,1] dc[4,R,l@1,2], + "V_LR" -> dc[3,R,l@1,1] dc[4,L,l@1,2], + "V_RL" -> dc[3,L,l@1,1] dc[4,R,l@1,2], + "V_RR" -> dc[3,L,l@1,1] dc[4,L,l@1,2], + "T_LL" -> dc[3,-L,l@1,l@2,1] dc[4,-L,l@1,l@2,2], + "T_RR" -> dc[3,-R,l@1,l@2,1] dc[4,-R,l@1,l@2,2] + } + ]; + npf = WilsonCoeffs`InterfaceToMatching[npf, basis]; + npfVertices = NPointFunctions`VerticesForNPointFunction@npf; + npfDefinition = NPointFunctions`CreateCXXFunctions[npf, "@class@", SARAH`Delta, basis, True][[2]]; + prototype = CConversion`CreateCType@Observables`GetObservableType@obs <> + " " <> Observables`GetObservablePrototype@obs; + + {calculateDefinition, npfDefinition} = FixedPoint[ + StringReplace[#, + { + "@Qd@" -> CConversion`ToValidCSymbolString@qd, + "@Lep@" -> CConversion`ToValidCSymbolString@lep, + "@Ph@" -> CConversion`ToValidCSymbolString@SARAH`Photon, + "@loopN@" -> CConversion`ToValidCSymbolString@loopN, + "@contr@" -> CConversion`ToValidCSymbolString@contr, + "@class@" -> "@Qd@@Lep@_to_@Qd@@Lep@_@contr@@loopN@", + "@photon_penguin@" -> If[loopN === 1, "calculate_@Qd@_@Qd@_@Ph@_form_factors", "zero"] + } + ]&, + { + prototype <> " { + return forge< + fields::@Qd@, fields::@Lep@, fields::@Ph@, + @photon_penguin@, + npointfunctions::@class@ + >(qi, qo, li, model, qedqcd);\n}", + npfDefinition + } + ]; + + {npfVertices, npfDefinition, prototype <> ";", calculateDefinition} +]; diff --git a/examples/new-observable/btosmumu/BrDLToDL/NPointFunctions.m b/examples/new-observable/btosmumu/BrDLToDL/NPointFunctions.m new file mode 100644 index 0000000000..31e8751ebc --- /dev/null +++ b/examples/new-observable/btosmumu/BrDLToDL/NPointFunctions.m @@ -0,0 +1,79 @@ +topologies[0] = { + {Vectors, Scalars} -> treeAll +}; + +topologies[1] = { + {Vectors, Scalars} -> penguinT, + Boxes -> boxAll +}; + +diagrams[0, Absent] = { + Vectors -> { + treeAll -> {"remove vector bosons", FreeQ[TreeFields@##, FeynArts`V]&} + }, + Scalars -> { + treeAll -> {"remove scalar bosons", FreeQ[TreeFields@##, FeynArts`S]&} + } +}; + +diagrams[1, Present] = { + Vectors -> { + penguinT -> {"remove external quarks", FreeQ[LoopFields@##, FieldPattern[#, 1|3]]&}, + penguinT -> {"remove loop vectors", FreeQ[LoopFields@##, FeynArts`V]&} + }, + Scalars -> { + penguinT -> {"remove external quarks", FreeQ[LoopFields@##, FieldPattern[#, 1|3]]&}, + penguinT -> {"remove loop vectors", FreeQ[LoopFields@##, FeynArts`V]&} + }, + Boxes -> { + boxAll -> {"remove external quarks", FreeQ[LoopFields@##, FieldPattern[#, 1|2|3|4]]&}, + boxAll -> {"remove loop vectors", FreeQ[LoopFields@##, FeynArts`V]&} + } +}; + +diagrams[1, Absent] = { + Vectors -> { + penguinT -> {"remove tree vectors", FreeQ[TreeFields@##, FeynArts`V]&} + }, + Scalars -> { + penguinT -> {"remove tree scalars", FreeQ[TreeFields@##, FeynArts`S]&} + } +}; + +amplitudes[0, Present] = { + Vectors -> { + treeAll -> {"remove photons", FreeQ[{##}, InternalMass[FeynArts`V, 5] -> 0]&} + } +}; + +amplitudes[1, Present] = { + Vectors -> { + penguinT -> {"remove tree photons", FreeQ[{##}, InternalMass[FeynArts`V, 5] -> 0]&} + } +}; + +order[] = {3, 1, 4, 2}; + +regularization[1] = { + boxS -> D, + boxU -> D +}; + +momenta[1] = { + penguinT -> 2, + boxS -> 2, + boxU -> 2 +}; + +sum[1] = { + inSelfT -> {"skip initial quark", {6, Field[#, 1]&}}, + outSelfT -> {"skip final quark", {6, Field[#, 3]&}} +}; + +chains[1] = { + {ExceptLoops} -> {1[k[4], ___] -> 0, 2[k[1], ___] -> 0} +}; + +mass[1] = { + inSelfT -> {"keep initial quark mass untouched", Hold :> ExternalMass[1]} +}; diff --git a/examples/new-observable/btosmumu/BrDLToDL/Observables.m b/examples/new-observable/btosmumu/BrDLToDL/Observables.m new file mode 100644 index 0000000000..da041dee0b --- /dev/null +++ b/examples/new-observable/btosmumu/BrDLToDL/Observables.m @@ -0,0 +1,8 @@ +Observables`DefineObservable[ +FlexibleSUSYObservable`BrDLToDL[{qd_[qI_], lep_[lI_]} -> {qd_[qO_], lep_[lI_]}, contr_, loopN_], + GetObservableType -> {13}, + GetObservableName -> "qdqIleplI_to_qdqOleplI_contr_loopN", + GetObservableDescription -> "qd$(qI+1) lep$(lI+1) -> qd$(qO+1) lep$(lI+1) contr at loopN loops", + CalculateObservable -> "calculate_qdlep_qdlep_contr_loopN(qI, qO, lI, model, qedqcd)", + GetObservablePrototype -> "calculate_qdlep_qdlep_contr_loopN(int qi, int qo, int li, auto model, auto qedqcd)" +]; diff --git a/examples/new-observable/btosmumu/BrDLToDL/WriteOut.m b/examples/new-observable/btosmumu/BrDLToDL/WriteOut.m new file mode 100644 index 0000000000..297bfe5dc6 --- /dev/null +++ b/examples/new-observable/btosmumu/BrDLToDL/WriteOut.m @@ -0,0 +1,26 @@ +WriteOut`WriteObservable[ + "FWCOEF", + obs:FlexibleSUSYObservable`BrDLToDL[{qd_[qI_], lep_[lI_]} -> {_[qO_], _}, __] +] := +StringReplace[ + { + "qd, 4322, exp, num_value, \"D_L\"", + "qd, 4422, exp, num_value, \"D_R\"", + "qdlep, 3131, exp, num_value, \"S_LL\"", + "qdlep, 3132, exp, num_value, \"S_LR\"", + "qdlep, 3231, exp, num_value, \"S_RL\"", + "qdlep, 3232, exp, num_value, \"S_RR\"", + "qdlep, 4141, exp, num_value, \"V_LL\"", + "qdlep, 4142, exp, num_value, \"V_LR\"", + "qdlep, 4241, exp, num_value, \"V_RL\"", + "qdlep, 4242, exp, num_value, \"V_RR\"", + "qdlep, 4343, exp, num_value, \"T_LL\"", + "qdlep, 4444, exp, num_value, \"T_RR\"" + }, + { + "num_value" -> "Re(observables." <> Observables`GetObservableName@obs <> ")", + "exp" -> "9, 9, 2", + "qd" -> StringJoin[{qO, qI} /. {0 -> "01", 1 -> "03", 2 -> "05"}], + "lep" -> StringJoin[{lI, lI} /. {0 -> "11", 1 -> "13", 2 -> "15"}] + } +]; diff --git a/examples/new-observable/btosmumu/br_d_l_to_d_l.cpp.in b/examples/new-observable/btosmumu/br_d_l_to_d_l.cpp.in new file mode 100644 index 0000000000..9ddfb52948 --- /dev/null +++ b/examples/new-observable/btosmumu/br_d_l_to_d_l.cpp.in @@ -0,0 +1,267 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + +/** + * @file @ModelName@_@filename@.cpp + * + * This file was generated at @DateAndTime@ with FlexibleSUSY + * @FlexibleSUSYVersion@ and SARAH @SARAHVersion@ + */ + +#include +#include +#include +#include + +#include "@ModelName@_mass_eigenstates.hpp" +#include "cxx_qft/@ModelName@_qft.hpp" + +#include "@ModelName@_@filename@.hpp" +#include "@ModelName@_FFV_form_factors.hpp" +#include "json.hpp" +#include "wrappers.hpp" + +@npf_headers@ + +namespace flexiblesusy { + +namespace @ModelName@_cxx_diagrams { +namespace npointfunctions { + +@npf_definitions@ + +} // namespace npointfunctions +} // namespace @ModelName@_cxx_diagrams + +namespace { + +std::valarray> zero( + int generationIndex1, + int generationIndex2, + const @ModelName@_mass_eigenstates&, + bool){ + std::valarray> res {0.0, 0.0, 0.0, 0.0}; + return res; +} + +/** + * @brief Writes Wilson coefficients in a WCxf format [1712.05298] for + * WET [https://wcxf.github.io/assets/pdf/WET.flavio.pdf]. + * @tparam Down Type of a down quark. + */ +template +void write_btosmumu( + const Eigen::Array, 10, 1>& coeffs, + const @ModelName@_cxx_diagrams::context_base& context, + const softsusy::QedQcd& qedqcd) { + + const auto complex_CKM = qedqcd.get_complex_ckm(); + + const std::complex Vtb (complex_CKM(2, 2)); + const std::complex Vts (complex_CKM(2, 1)); + const auto GF = qedqcd.displayFermiConstant(); + const auto normalization = 4.*GF/Sqrt(2.) * Vtb*Conj(Vts) * + Sqr(unit_charge(context))*oneOver16PiSqr; + + if (is_zero(std::abs(normalization))) { + ERROR("btosmumu: Normalization factor is vanishing."); + exit(EXIT_FAILURE); + } + + const auto mb = context.mass({2}); + + // Dear reader, be aware of vector bosons (in loops) for b -> s mu mu. + // Some scheme dependence might be important. + + // Compare to the basis in . + // They put SL on the first positions, we put BL. + + // Here is the place for C7_bs = -1/2 A2R / normalization + // Here is the place for C7p_bs = -1/2 A2L / normalization + + const auto C9_bsmumu = (coeffs[5] + coeffs[4])/2. / normalization; + const auto C9p_bsmumu = (coeffs[7] + coeffs[6])/2. / normalization; + + const auto C10_bsmumu = (coeffs[5] - coeffs[4])/2. / normalization; + const auto C10p_bsmumu = (coeffs[7] - coeffs[6])/2. / normalization; + + const auto CS_bsmumu = (coeffs[3] + coeffs[2])/2. / normalization / mb; + const auto CSp_bsmumu = (coeffs[1] + coeffs[0])/2. / normalization / mb; + + const auto CP_bsmumu = (coeffs[3] - coeffs[2])/2. / normalization / mb; + const auto CPp_bsmumu = (coeffs[1] - coeffs[0])/2. / normalization / mb; + + // TODO(all): Where are sigma-sigma operators? + + nlohmann::json j; + j["eft"] = "WET"; + j["basis"] = "flavio"; + j["scale"] = dynamic_cast<@ModelName@_mass_eigenstates const&>(context.model).get_scale(); + j["values"] = { + {"C9_bsmumu", {{"Re", Re(C9_bsmumu)}, {"Im", Im(C9_bsmumu)}}}, + {"C9p_bsmumu", {{"Re", Re(C9p_bsmumu)}, {"Im", Im(C9p_bsmumu)}}}, + {"C10_bsmumu", {{"Re", Re(C10_bsmumu)}, {"Im", Im(C10_bsmumu)}}}, + {"C10p_bsmumu", {{"Re", Re(C10p_bsmumu)}, {"Im", Im(C10p_bsmumu)}}}, + {"CS_bsmumu", {{"Re", Re(CS_bsmumu)}, {"Im", Im(CS_bsmumu)}}}, + {"CSp_bsmumu", {{"Re", Re(CSp_bsmumu)}, {"Im", Im(CSp_bsmumu)}}}, + {"CP_bsmumu", {{"Re", Re(CP_bsmumu)}, {"Im", Im(CP_bsmumu)}}}, + {"CPp_bsmumu", {{"Re", Re(CPp_bsmumu)}, {"Im", Im(CPp_bsmumu)}}}, + }; + std::ofstream wc_json("WET_bsmumu.json"); + wc_json << std::setw(4) << j << std::endl; + wc_json.close(); + +} + +} // anonymous namespace + +using namespace @ModelName@_cxx_diagrams; +using namespace @ModelName@_FFV_form_factors; + +namespace @namespace@ { + +typedef std::valarray> (*ffv_function) + (int, int, const @ModelName@_mass_eigenstates&, bool); + +typedef std::array, 10> (*npf_function) + (const @ModelName@_mass_eigenstates&, const std::array&, const std::array&); + +/** + * @tparam L Type of a lepton field. + * @tparam A Type of a photon field. + * @tparam T Type of a form factors. + * @param[in] model Mass eigenstates. + * @param[in] ff Lepton-photon form factors. + * @param[in] g Generation index for quarks. + * @return Set of four-fermion coefficients from photon penguin amplitudes + * (without overall i; with appropriate embedding). + */ +template +Eigen::Array,10,1> embed_photon( + const @ModelName@_mass_eigenstates& model, const T& ff, int g) { + + // Get lepton-photon couplings (without i): + context_base context {model}; + using vertex = Vertex; + const auto value = vertex::evaluate({g, g}, context); + const auto lL = value.left(); + const auto lR = value.right(); + + Eigen::Array,10,1> res{}; + // Term from eq. (t.1) will contribute to four-fermion vector coefficients. + // Minus comes from the form_factors embedding into four-fermion amplitude: + res[4] = - ff[0] * lL; + res[5] = - ff[0] * lR; + res[6] = - ff[1] * lL; + res[7] = - ff[1] * lR; + return res; +}; + +/** + * @tparam Name Function name for npf function. + * @param[in] model Mass eigenstates. + * @param[in] in Generation index for incoming quark. + * @param[in] out Generation index for outgoing quark. + * @param[in] g Generation index for leptons. + * @return Set of four-fermion coefficients for amplitudes without photon + * penguins (without overall i; with fixed signs for tensor operators + * defined in meta/NPointFunctions/DLDL/main.m). + */ +template +Eigen::Array,10,1> fix_tensors_sign( + const @ModelName@_mass_eigenstates& model, int in, int out, int g) { + const auto npf = Name(model, + std::array{in, g, out, g}, + std::array{}); + Eigen::Array,10,1> res(npf.data()); + res[8] = - res[8]; + res[9] = - res[9]; + return res; +}; + +/** + * Form factors are defined via the following formula (q = pj - pi > 0; see + * eq. (3.4) of 1902.06650 (up to electric charge); + * pi - momenta[going from blob] of outgoing lepton, + * pj - momenta[going into blob] of incoming lepton): + * = + * i * ubari + * q^2 gamma_mu (A1_X * P_X) (t.1) + * + (zero after embedding term) (t.2) + * + i mj sigma_munu q^nu (A2_X * P_X) (t.3) + * uj e^*mu + * @note Form factors below are ordered as A1_L, A1_R, A2_L, A2_R. + * @note NPF function returns such result, that G4 = i * npf. + * @note Match to a low energy effective model with the same covariant derivative + * for photon, as in @ModelName@, using eq. (t.3). + * Minus comes from the form_factors embedding into four-fermion + * amplitude, because we use descending ordering for external fermions + * =: G4 + * @note For four fermion coefficient matching minus comes from the G4 + * definition, because + * = -i * C_XY [3X1]*[4Y2]. + * @tparam Lepton Type of a lepton fields. + * @tparam Photon Type of a photon field. + * @tparam photon Function name for photon form factors. + * @tparam npf Function name for npf function for up-quark contribution. + * @param[in] dIn Generation index for incoming quark. + * @param[in] dOut Generation index for outgoing quark. + * @param[in] lInOut Generation index for leptons. + * @param[in] model Mass eigenstates. + * @param[in] parameters Parameters for the observable calculation. + * @param[in] qedqcd Reference to low-energy data. + * @return A dummy zero observable and Wilson coefficients. + */ +template +Eigen::Array, 13, 1> forge( + int dIn, int dOut, int lInOut, + const @ModelName@_mass_eigenstates& model, + const softsusy::QedQcd& qedqcd) { + + context_base context {model}; + + const auto form_factors = photon(dIn, dOut, model, true); + const auto photon_l = embed_photon(model, form_factors, lInOut); + const auto npf_l = fix_tensors_sign(model, dIn, dOut, lInOut); + + // Matching + const auto DL = - 0.5 * form_factors[2]; + const auto DR = - 0.5 * form_factors[3]; + const auto CXY = - photon_l - npf_l; + + if (dIn == 2 && dOut == 1 && lInOut == 1) { + write_btosmumu(CXY, context, qedqcd); + } else { + // TODO(all): Implement :) + ERROR("dltodl: Unimplemented combination of external particles."); + exit(EXIT_FAILURE); + } + + + Eigen::Array,13,1> res; + res << 0.0, // We need only Wilson coefficients now. + DL, DR, + CXY[0], CXY[1], CXY[2], CXY[3], + CXY[4], CXY[5], CXY[6], CXY[7], + CXY[8], CXY[9]; + return res; +} +@calculate_definitions@ + +} // namespace @namespace@ +} // namespace flexiblesusy diff --git a/examples/new-observable/btosmumu/br_d_l_to_d_l.hpp.in b/examples/new-observable/btosmumu/br_d_l_to_d_l.hpp.in new file mode 100644 index 0000000000..2d62f7635b --- /dev/null +++ b/examples/new-observable/btosmumu/br_d_l_to_d_l.hpp.in @@ -0,0 +1,38 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + +/** + * @file @ModelName@_@filename@.hpp + * + * This file was generated at @DateAndTime@ with FlexibleSUSY + * @FlexibleSUSYVersion@ and SARAH @SARAHVersion@ . + */ + +#ifndef @ModelName@_@include_guard@_H +#define @ModelName@_@include_guard@_H +#include "lowe.h" + +namespace flexiblesusy { +namespace @namespace@ { + +@calculate_prototypes@ + +} // namespace @namespace@ +} // namespace flexiblesusy + +#endif diff --git a/examples/new-observable/constant-observable/ExampleConstantObservable/FlexibleSUSY.m b/examples/new-observable/constant-observable/ExampleConstantObservable/FlexibleSUSY.m new file mode 100644 index 0000000000..9cf36ac15f --- /dev/null +++ b/examples/new-observable/constant-observable/ExampleConstantObservable/FlexibleSUSY.m @@ -0,0 +1,48 @@ +FlexibleSUSY`WriteClass[obs:FlexibleSUSYObservable`ExampleConstantObservable, slha_, files_] := +Module[ + { + observables = DeleteDuplicates@Cases[Observables`GetRequestedObservables@slha, _obs], + prototypes = {}, definitions = {}, npfDefinitions = {}, cxxVertices = {}, npfHeaders = "" + }, + + If[observables =!= {}, + Utils`PrintHeadline["Creating " <> SymbolName@obs <> " class ..."]; + prototypes = TextFormatting`ReplaceCXXTokens[ + "@type@ @prototype@;", + { + "@type@" -> CConversion`CreateCType@Observables`GetObservableType@observables[[1]], + "@prototype@" -> Observables`GetObservablePrototype@observables[[1]] + } + ] &/@ observables; + + (* Task 1: filling definitions. *) + definitions = TextFormatting`ReplaceCXXTokens[" + @type@ @prototype@ { + @type@ res {num}; + return res; + }", + { + "@type@" -> CConversion`CreateCType@Observables`GetObservableType[#], + "@prototype@" -> Observables`GetObservablePrototype[#] + } + ] &/@ observables; + ]; + + (* Task 2: filling templates and moving them into models/Ma/observables/. *) + WriteOut`ReplaceInFiles[ + files, + { + "@npf_headers@" -> npfHeaders, + "@npf_definitions@" -> StringRiffle[DeleteDuplicates[npfDefinitions], "\n\n"], + "@calculate_prototypes@" -> StringRiffle[DeleteDuplicates[prototypes], "\n\n"], + "@calculate_definitions@" -> StringRiffle[DeleteDuplicates[definitions], "\n\n"], + "@include_guard@" -> SymbolName@obs, + "@namespace@" -> Observables`GetObservableNamespace@obs, + "@filename@" -> Observables`GetObservableFileName@obs, + Sequence@@FlexibleSUSY`Private`GeneralReplacementRules[] + } + ]; + + (* Task 3: returning something to the outside world. *) + {} +]; diff --git a/examples/new-observable/constant-observable/ExampleConstantObservable/Observables.m b/examples/new-observable/constant-observable/ExampleConstantObservable/Observables.m new file mode 100644 index 0000000000..792773a896 --- /dev/null +++ b/examples/new-observable/constant-observable/ExampleConstantObservable/Observables.m @@ -0,0 +1,5 @@ +Observables`DefineObservable[ + FlexibleSUSYObservable`ExampleConstantObservable[num_], + GetObservableType -> {1}, + GetObservablePrototype -> "calculate_example_constant_observable(double num)" +]; diff --git a/examples/new-observable/constant-observable/ExampleConstantObservable/WriteOut.m b/examples/new-observable/constant-observable/ExampleConstantObservable/WriteOut.m new file mode 100644 index 0000000000..b506dda205 --- /dev/null +++ b/examples/new-observable/constant-observable/ExampleConstantObservable/WriteOut.m @@ -0,0 +1,4 @@ +WriteOut`WriteObservable[ + "FlexibleSUSYLowEnergy", + obs:FlexibleSUSYObservable`ExampleConstantObservable[_] +] := "Re(observables." <> Observables`GetObservableName@obs <> "(0))"; diff --git a/examples/new-observable/constant-observable/example_constant_observable.cpp.in b/examples/new-observable/constant-observable/example_constant_observable.cpp.in new file mode 100644 index 0000000000..899fc2768e --- /dev/null +++ b/examples/new-observable/constant-observable/example_constant_observable.cpp.in @@ -0,0 +1,34 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + +/** + * @file @ModelName@_@filename@.cpp + * + * This file was generated at @DateAndTime@ with FlexibleSUSY + * @FlexibleSUSYVersion@ and SARAH @SARAHVersion@ + */ + +#include "@ModelName@_@filename@.hpp" + +namespace flexiblesusy { +namespace @namespace@ { + +@calculate_definitions@ + +} // namespace @namespace@ +} // namespace flexiblesusy diff --git a/examples/new-observable/constant-observable/example_constant_observable.hpp.in b/examples/new-observable/constant-observable/example_constant_observable.hpp.in new file mode 100644 index 0000000000..2d62f7635b --- /dev/null +++ b/examples/new-observable/constant-observable/example_constant_observable.hpp.in @@ -0,0 +1,38 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + +/** + * @file @ModelName@_@filename@.hpp + * + * This file was generated at @DateAndTime@ with FlexibleSUSY + * @FlexibleSUSYVersion@ and SARAH @SARAHVersion@ . + */ + +#ifndef @ModelName@_@include_guard@_H +#define @ModelName@_@include_guard@_H +#include "lowe.h" + +namespace flexiblesusy { +namespace @namespace@ { + +@calculate_prototypes@ + +} // namespace @namespace@ +} // namespace flexiblesusy + +#endif diff --git a/examples/new-observable/fermion-mass-observable/ExampleFermionMass/FlexibleSUSY.m b/examples/new-observable/fermion-mass-observable/ExampleFermionMass/FlexibleSUSY.m new file mode 100644 index 0000000000..14f29ef352 --- /dev/null +++ b/examples/new-observable/fermion-mass-observable/ExampleFermionMass/FlexibleSUSY.m @@ -0,0 +1,48 @@ +FlexibleSUSY`WriteClass[obs:FlexibleSUSYObservable`ExampleFermionMass, slha_, files_] := +Module[ + { + observables = DeleteDuplicates@Cases[Observables`GetRequestedObservables@slha, _obs], + prototypes = {}, definitions = {}, npfDefinitions = {}, cxxVertices = {}, npfHeaders = "" + }, + + If[observables =!= {}, + Utils`PrintHeadline["Creating " <> SymbolName@obs <> " class ..."]; + prototypes = TextFormatting`ReplaceCXXTokens[ + "@type@ @prototype@;", + { + "@type@" -> CConversion`CreateCType@Observables`GetObservableType@#, + "@prototype@" -> Observables`GetObservablePrototype@# + } + ]&/@observables; + + (* Task 1: filling definitions. *) + definitions = TextFormatting`ReplaceCXXTokens[" + @type@ @prototype@ { + return forge<@type@, fields::@fermion@>(gen, model, qedqcd); + }", + { + "@fermion@" -> SymbolName@Head@#[[1]], + "@type@" -> CConversion`CreateCType@Observables`GetObservableType@#, + "@prototype@" -> Observables`GetObservablePrototype@# + } + ]&/@observables; + ]; + + (* Task 2: filling templates and moving them into models/Ma/observables/. *) + WriteOut`ReplaceInFiles[ + files, + { + "@npf_headers@" -> npfHeaders, + "@npf_definitions@" -> StringRiffle[DeleteDuplicates[npfDefinitions], "\n\n"], + "@calculate_prototypes@" -> StringRiffle[DeleteDuplicates[prototypes], "\n\n"], + "@calculate_definitions@" -> StringRiffle[DeleteDuplicates[definitions], "\n\n"], + "@include_guard@" -> SymbolName@obs, + "@namespace@" -> Observables`GetObservableNamespace@obs, + "@filename@" -> Observables`GetObservableFileName@obs, + Sequence@@FlexibleSUSY`Private`GeneralReplacementRules[] + } + ]; + + (* Task 3: returning something to the outside world. *) + {} +]; diff --git a/examples/new-observable/fermion-mass-observable/ExampleFermionMass/Observables.m b/examples/new-observable/fermion-mass-observable/ExampleFermionMass/Observables.m new file mode 100644 index 0000000000..a224698336 --- /dev/null +++ b/examples/new-observable/fermion-mass-observable/ExampleFermionMass/Observables.m @@ -0,0 +1,6 @@ +Observables`DefineObservable[ + FlexibleSUSYObservable`ExampleFermionMass[fermion_@gen_], + GetObservableType -> {2}, + GetObservablePrototype -> "ex_fermion_mass(int gen, auto model, auto qedqcd)", + GetObservableDescription -> "fermion[gen] (lepton[gen] if in Block ExampleLeptonMass) mass" +]; diff --git a/examples/new-observable/fermion-mass-observable/ExampleFermionMass/WriteOut.m b/examples/new-observable/fermion-mass-observable/ExampleFermionMass/WriteOut.m new file mode 100644 index 0000000000..a3230648e0 --- /dev/null +++ b/examples/new-observable/fermion-mass-observable/ExampleFermionMass/WriteOut.m @@ -0,0 +1,9 @@ +WriteOut`WriteObservable[ + "FlexibleSUSYLowEnergy", + obs:FlexibleSUSYObservable`ExampleFermionMass[_] +] := "Re(observables." <> Observables`GetObservableName@obs <> "(0))"; + +WriteOut`WriteObservable[ + "ExampleLeptonMass", + obs:FlexibleSUSYObservable`ExampleFermionMass[_] +] := "Re(observables." <> Observables`GetObservableName@obs <> "(1))"; diff --git a/examples/new-observable/fermion-mass-observable/example_fermion_mass.cpp.in b/examples/new-observable/fermion-mass-observable/example_fermion_mass.cpp.in new file mode 100644 index 0000000000..c86c5a928c --- /dev/null +++ b/examples/new-observable/fermion-mass-observable/example_fermion_mass.cpp.in @@ -0,0 +1,57 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + +/** + * @file @ModelName@_@filename@.cpp + * + * This file was generated at @DateAndTime@ with FlexibleSUSY + * @FlexibleSUSYVersion@ and SARAH @SARAHVersion@ + */ + +#include "@ModelName@_mass_eigenstates.hpp" +#include "cxx_qft/@ModelName@_qft.hpp" +#include "@ModelName@_@filename@.hpp" +#include "error.hpp" + +namespace flexiblesusy { +using namespace @ModelName@_cxx_diagrams; +namespace @namespace@ { + +template +auto forge(int idx, const @ModelName@_mass_eigenstates& model, const softsusy::QedQcd& qedqcd) { + context_base context {model}; + auto context_mass = context.mass({idx}); + + std::complex lepton_mass; + switch (idx) { + case 0: lepton_mass = qedqcd.displayPoleMel(); + break; + case 1: lepton_mass = qedqcd.displayPoleMmuon(); + break; + case 2: lepton_mass = qedqcd.displayPoleMtau(); + break; + default: throw OutOfBoundsError("fermion index out of bounds"); + } + RTYPE res {context_mass, lepton_mass}; + return res; +} + +@calculate_definitions@ + +} // namespace @namespace@ +} // namespace flexiblesusy diff --git a/examples/new-observable/fermion-mass-observable/example_fermion_mass.hpp.in b/examples/new-observable/fermion-mass-observable/example_fermion_mass.hpp.in new file mode 100644 index 0000000000..2d62f7635b --- /dev/null +++ b/examples/new-observable/fermion-mass-observable/example_fermion_mass.hpp.in @@ -0,0 +1,38 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + +/** + * @file @ModelName@_@filename@.hpp + * + * This file was generated at @DateAndTime@ with FlexibleSUSY + * @FlexibleSUSYVersion@ and SARAH @SARAHVersion@ . + */ + +#ifndef @ModelName@_@include_guard@_H +#define @ModelName@_@include_guard@_H +#include "lowe.h" + +namespace flexiblesusy { +namespace @namespace@ { + +@calculate_prototypes@ + +} // namespace @namespace@ +} // namespace flexiblesusy + +#endif diff --git a/examples/new-observable/lepton-se/ExampleLeptonSE/FlexibleSUSY.m b/examples/new-observable/lepton-se/ExampleLeptonSE/FlexibleSUSY.m new file mode 100644 index 0000000000..dc12bb99c3 --- /dev/null +++ b/examples/new-observable/lepton-se/ExampleLeptonSE/FlexibleSUSY.m @@ -0,0 +1,84 @@ +FlexibleSUSY`WriteClass[obs:FlexibleSUSYObservable`ExampleLeptonSE, slha_, files_] := +Module[ + { + observables = DeleteDuplicates@Cases[Observables`GetRequestedObservables@slha, _obs], + prototypes = {}, definitions = {}, npfDefinitions = {}, cxxVertices = {}, npfHeaders = "" + }, + + If[observables =!= {}, + Utils`PrintHeadline["Creating " <> SymbolName@obs <> " class ..."]; + prototypes = TextFormatting`ReplaceCXXTokens[ + "@type@ @prototype@;", + { + "@type@" -> CConversion`CreateCType@Observables`GetObservableType@#, + "@prototype@" -> Observables`GetObservablePrototype@# + } + ] &/@ observables; + + (* Task 1: filling definitions. *) + observables = DeleteDuplicates[observables /. f_@_Integer -> f@_]; + + Module[{field, contr, npf, basis, name}, + field = Head@First@#; + contr = Last@#; + npf = NPointFunctions`NPointFunction[ + {field}, (* Incoming particles *) + {field}, (* Outgoing particles *) + NPointFunctions`UseCache -> False, + NPointFunctions`OnShellFlag -> True, + NPointFunctions`ZeroExternalMomenta -> True, + NPointFunctions`LoopLevel -> 1, + NPointFunctions`Regularize -> FlexibleSUSY`FSRenormalizationScheme, + NPointFunctions`Observable -> obs[], + NPointFunctions`KeepProcesses -> If[Head@contr === List, contr, {contr}] + ]; + + basis = + { + "left_wilson" -> NPointFunctions`DiracChain[SARAH`DiracSpinor[field[{SARAH`gt2}], 0, 0], 7, SARAH`DiracSpinor[field[{SARAH`gt1}], 0, 0]], + "right_wilson" -> NPointFunctions`DiracChain[SARAH`DiracSpinor[field[{SARAH`gt2}], 0, 0], 6, SARAH`DiracSpinor[field[{SARAH`gt1}], 0, 0]] + }; + + npf = WilsonCoeffs`InterfaceToMatching[npf, basis]; + name = "se_"<>CConversion`ToValidCSymbolString[contr]; + + AppendTo[cxxVertices, NPointFunctions`VerticesForNPointFunction@npf]; + AppendTo[npfDefinitions, NPointFunctions`CreateCXXFunctions[npf, name, Identity, basis][[2]]]; + AppendTo[definitions, + TextFormatting`ReplaceCXXTokens[" + @type@ @prototype@ { + const auto npf = npointfunctions::@name@(model, {gen, gen}, {}); + return {npf[0], npf[1]}; + }", + { + "@type@" -> CConversion`CreateCType@Observables`GetObservableType@#, + "@prototype@" -> Observables`GetObservablePrototype@#, + "@name@" -> name + } + ] + ]; + ] &/@ observables; + + npfHeaders = NPointFunctions`CreateCXXHeaders[]; + ]; + + (* Task 2: filling templates and moving them into models/Ma/observables/. *) + WriteOut`ReplaceInFiles[ + files, + { + "@npf_headers@" -> npfHeaders, + "@npf_definitions@" -> StringRiffle[DeleteDuplicates[npfDefinitions], "\n\n"], + "@calculate_prototypes@" -> StringRiffle[DeleteDuplicates[prototypes], "\n\n"], + "@calculate_definitions@" -> StringRiffle[DeleteDuplicates[definitions], "\n\n"], + "@include_guard@" -> SymbolName@obs, + "@namespace@" -> Observables`GetObservableNamespace@obs, + "@filename@" -> Observables`GetObservableFileName@obs, + Sequence@@FlexibleSUSY`Private`GeneralReplacementRules[] + } + ]; + + (* Task 3: returning something to the outside world. *) + { + "C++ vertices" -> Flatten[cxxVertices, 1] + } +]; diff --git a/examples/new-observable/lepton-se/ExampleLeptonSE/NPointFunctions.m b/examples/new-observable/lepton-se/ExampleLeptonSE/NPointFunctions.m new file mode 100644 index 0000000000..a28984c7fc --- /dev/null +++ b/examples/new-observable/lepton-se/ExampleLeptonSE/NPointFunctions.m @@ -0,0 +1,5 @@ +topologies[1] = { + Tadpoles -> tadpole, + Sunsets -> sunset, + Fermi -> all +}; diff --git a/examples/new-observable/lepton-se/ExampleLeptonSE/Observables.m b/examples/new-observable/lepton-se/ExampleLeptonSE/Observables.m new file mode 100644 index 0000000000..19fd018e64 --- /dev/null +++ b/examples/new-observable/lepton-se/ExampleLeptonSE/Observables.m @@ -0,0 +1,5 @@ +Observables`DefineObservable[ + FlexibleSUSYObservable`ExampleLeptonSE[field_@gen_, contr_], + GetObservableType -> {2}, + GetObservablePrototype -> "ex_lepton_se_contr(int gen, auto model)" +]; diff --git a/examples/new-observable/lepton-se/ExampleLeptonSE/WriteOut.m b/examples/new-observable/lepton-se/ExampleLeptonSE/WriteOut.m new file mode 100644 index 0000000000..11547d0604 --- /dev/null +++ b/examples/new-observable/lepton-se/ExampleLeptonSE/WriteOut.m @@ -0,0 +1,14 @@ +WriteOut`WriteObservable[ + "FWCOEF", + obs:FlexibleSUSYObservable`ExampleLeptonSE[_@gen_, _] +] := +StringReplace[ + { + "leptons, 31, 0, 0, 2, num_value, \"left\"", (* P_L *) + "leptons, 32, 0, 0, 2, num_value, \"right\"" (* P_R *) + }, + { + "num_value" -> "Re(observables." <> Observables`GetObservableName@obs <> ")", + "leptons" -> Switch[gen, 0, "1111", 1, "1313", 2, "1515"] + } +]; diff --git a/examples/new-observable/lepton-se/example_lepton_s_e.cpp.in b/examples/new-observable/lepton-se/example_lepton_s_e.cpp.in new file mode 100644 index 0000000000..3e0f33c650 --- /dev/null +++ b/examples/new-observable/lepton-se/example_lepton_s_e.cpp.in @@ -0,0 +1,46 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + +/** + * @file @ModelName@_@filename@.cpp + * + * This file was generated at @DateAndTime@ with FlexibleSUSY + * @FlexibleSUSYVersion@ and SARAH @SARAHVersion@ + */ + +#include "@ModelName@_mass_eigenstates.hpp" +#include "cxx_qft/@ModelName@_qft.hpp" +#include "@ModelName@_@filename@.hpp" +@npf_headers@ + +namespace flexiblesusy { +namespace @ModelName@_cxx_diagrams { +namespace npointfunctions { + +@npf_definitions@ + +} // namespace npointfunctions +} // namespace @ModelName@_cxx_diagrams + +using namespace @ModelName@_cxx_diagrams; +namespace @namespace@ { + +@calculate_definitions@ + +} // namespace @namespace@ +} // namespace flexiblesusy diff --git a/examples/new-observable/lepton-se/example_lepton_s_e.hpp.in b/examples/new-observable/lepton-se/example_lepton_s_e.hpp.in new file mode 100644 index 0000000000..1c6b72ba8e --- /dev/null +++ b/examples/new-observable/lepton-se/example_lepton_s_e.hpp.in @@ -0,0 +1,38 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + +/** + * @file @ModelName@_@filename@.hpp + * + * This file was generated at @DateAndTime@ with FlexibleSUSY + * @FlexibleSUSYVersion@ and SARAH @SARAHVersion@ + */ + +#ifndef @ModelName@_@include_guard@_H +#define @ModelName@_@include_guard@_H +#include "lowe.h" + +namespace flexiblesusy { +namespace @namespace@ { + +@calculate_prototypes@ + +} // namespace @namespace@ +} // namespace flexiblesusy + +#endif diff --git a/examples/new-observable/make-observable b/examples/new-observable/make-observable new file mode 100755 index 0000000000..9f5a7d8e7b --- /dev/null +++ b/examples/new-observable/make-observable @@ -0,0 +1,100 @@ +#!/bin/sh + +# directory of this script +BASEDIR=$(dirname $0) + +if [ -z "$2" ]; then + MODELNAME="SM" +else + MODELNAME="$2" +fi + +# absolute path to this script +DIR=$(cd "$BASEDIR" && pwd | sed 's/ /\\\\ /g') + +setvariables() { + TEMPLATES=$(echo ${DIR}/${EXAMPLEDIR}/*hpp.in) + TEMPLATES=${TEMPLATES#"${DIR}/${EXAMPLEDIR}/"} + TEMPLATES=${TEMPLATES%.hpp.in} + + META=$(echo ${DIR}/${EXAMPLEDIR}/*/) + META=${META#"${DIR}/${EXAMPLEDIR}/"} + META=${META%/} + + FSMETA=${DIR}/../../meta/Observables/${META} +} + +clean() { + setvariables + + for FILE in ${DIR}/../../templates/observables/${TEMPLATES}.*.in; do + if [ -f ${FILE} ]; then + rm ${FILE} + fi + done + + for FILE in ${DIR}/../../models/${MODELNAME}/observables/${MODELNAME}_${TEMPLATES}.*; do + if [ -f ${FILE} ]; then + rm ${FILE} + fi + done + + if [ -d ${FSMETA} ]; then + rm -rf ${FSMETA} + fi +} + +copythings(){ + setvariables + cp ${DIR}/${EXAMPLEDIR}/${TEMPLATES}* ${DIR}/../../templates/observables + mkdir ${FSMETA} + cp ${DIR}/${EXAMPLEDIR}/${META}/*.m ${FSMETA} +} + +cleanall() { + for _dir in ${DIR}/*; do + if [ -d ${_dir} ]; then + EXAMPLEDIR=$(echo ${_dir#"${DIR}/"}) + clean + fi + done + + sed -i "s/(\*RESTORE \(.*\)\*)/\1/g" ${DIR}/../../meta/NPointFunctions/Topologies.m + sed -i '/(\*REMOVE\*)/d' ${DIR}/../../meta/NPointFunctions/Topologies.m + sed -i '/(\*REMOVE\*)/d' ${DIR}/../../models/${MODELNAME}/FlexibleSUSY.m +} + +# MAIN begin +FSMODELDIR=${DIR}/../../models/${MODELNAME}/FlexibleSUSY.m +cleanall +case $1 +in + SM-example-1) EXAMPLEDIR=constant-observable + copythings + echo '(*REMOVE*)ExtraSLHAOutputBlocks = {{FlexibleSUSYLowEnergy,{{1, FlexibleSUSYObservable`ExampleConstantObservable[3]},{2, FlexibleSUSYObservable`ExampleConstantObservable[4]}}}};' >> ${FSMODELDIR} + ;; + SM-example-2) EXAMPLEDIR=fermion-mass-observable + copythings + echo '(*REMOVE*)ExtraSLHAOutputBlocks = {{FlexibleSUSYLowEnergy,{{1, FlexibleSUSYObservable`ExampleFermionMass[Fe@2]},{2, FlexibleSUSYObservable`ExampleFermionMass[Fd@2]}}},{ExampleLeptonMass,{{1, FlexibleSUSYObservable`ExampleFermionMass[Fe@2]},{2, FlexibleSUSYObservable`ExampleFermionMass[Fd@2]}}}};' >> ${FSMODELDIR} + ;; + SM-example-3) EXAMPLEDIR=lepton-se + copythings + echo '(*REMOVE*)ExtraSLHAOutputBlocks = {{FWCOEF,{{1, FlexibleSUSYObservable`ExampleLeptonSE[Fe@1, {Sunsets}]}}}};' >> ${FSMODELDIR} + cd ${DIR}/../../meta/NPointFunctions + sed -i 's/End\[\];/(*RESTORE End\[\];*)/g' Topologies.m + sed -i 's/EndPackage\[\];/(*RESTORE EndPackage\[\];*)/g' Topologies.m + echo '(*REMOVE*)AllTopologies[{1, 1}] = {sunset->{1,0,0,1,0,2,0},tadpole->{1,0,1,0,0,1,1},fermi->{tadpole,sunset}};End[];EndPackage[];' >> Topologies.m + ;; + example-4) EXAMPLEDIR=post-processing + copythings + echo '(*REMOVE*)ExtraSLHAOutputBlocks = {{FlexibleSUSYLowEnergy,{{1, FlexibleSUSYObservable`HiggsTo2Gluons[hh -> {VG, VG}, All]}}}};' >> ${FSMODELDIR} + ;; + example-5) EXAMPLEDIR=btosmumu + copythings + echo '(*REMOVE*)ExtraSLHAOutputBlocks = {{FWCOEF,{{1, FlexibleSUSYObservable`BrDLToDL[{Fd[3], Fe[2]} -> {Fd[2], Fe[2]}, {Boxes}, 1]}}}};' >> ${FSMODELDIR} + ;; + clean-all) cleanall + ;; + *) exit 0; +esac +# MAIN end diff --git a/examples/new-observable/post-processing/HiggsTo2Gluons/FlexibleSUSY.m b/examples/new-observable/post-processing/HiggsTo2Gluons/FlexibleSUSY.m new file mode 100644 index 0000000000..2426c885d5 --- /dev/null +++ b/examples/new-observable/post-processing/HiggsTo2Gluons/FlexibleSUSY.m @@ -0,0 +1,100 @@ +FlexibleSUSY`WriteClass[obs:FlexibleSUSYObservable`HiggsTo2Gluons, slha_, files_] := +Module[ + { + observables = DeleteDuplicates@Cases[Observables`GetRequestedObservables[slha], _obs], + prototypes = {}, definitions = {}, npfDefinitions = {}, npfVertices = {}, npfHeaders = "" + }, + + If[observables =!= {}, + Utils`PrintHeadline["Creating " <> SymbolName[obs] <> " class ..."]; + prototypes = TextFormatting`ReplaceCXXTokens[ + "@type@ @prototype@;", + { + "@type@" -> CConversion`CreateCType[Observables`GetObservableType[#]], + "@prototype@" -> Observables`GetObservablePrototype[#] + } + ] &/@ observables; + + (* Task 1: filling definitions. *) + + observables = DeleteDuplicates[observables /. f_[_Integer] -> f[_]]; + + Module[{higgs, gluon, contr, npf, npfName}, + higgs = #[[1, 1]]; + gluon = #[[1, 2, 1]]; + contr = #[[2]]; + npf = NPointFunctions`NPointFunction[ + {higgs}, (* Incoming particles *) + {gluon, gluon}, (* Outgoing particles *) + NPointFunctions`UseCache -> False, + NPointFunctions`OnShellFlag -> True, + NPointFunctions`ZeroExternalMomenta -> False, + NPointFunctions`LoopLevel -> 1, + NPointFunctions`Regularize -> FlexibleSUSY`FSRenormalizationScheme, + NPointFunctions`Observable -> obs[], + NPointFunctions`KeepProcesses -> If[Head[contr] === List, contr, {contr}] + ]; + npf = NPointFunctions`ApplySubexpressions[npf]; + npf = npf /. { + SARAH`sum[__, FormCalc`ec[2, l_] FormCalc`ec[3, l_] SARAH`g[__]] :> "e2e3", + SARAH`sum[__, FormCalc`ec[2, l_] SARAH`Mom[3, l_] SARAH`g[__]] :> "e2m3", + SARAH`sum[__, FormCalc`ec[3, l_] SARAH`Mom[2, l_] SARAH`g[__]] :> "e3m2", + FormCalc`Eps[FormCalc`ec[2], FormCalc`ec[3], SARAH`Mom[2], SARAH`Mom[3]] :> "eps", + SARAH`sum[__, SARAH`Mom[2, l_] SARAH`Mom[3, l_] SARAH`g[__]] :> SARAH`Mass[higgs]^2/2 + }; + + npf = WilsonCoeffs`InterfaceToMatching[npf, {"eps", "e2e3", "e2m3" "e3m2"}]; + + npfName = TextFormatting`ReplaceCXXTokens[ + "@higgs@to2@gluon@@contr@", + { + "@higgs@" -> SymbolName@higgs, + "@gluon@" -> SymbolName@gluon, + "@contr@" -> CConversion`ToValidCSymbolString@contr + } + ]; + AppendTo[npfDefinitions, + NPointFunctions`NPFDefinitions[npf, npfName, SARAH`Delta, {"eps", "e2e3", "e2m3_e3m2"}] + ]; + AppendTo[npfVertices, NPointFunctions`VerticesForNPointFunction@npf]; + + AppendTo[definitions, + TextFormatting`ReplaceCXXTokens[" + @type@ @prototype@ { + const auto npf = npointfunctions::@npf_name@(model, {}, {}); + // Calculations go here + @type@ res {}; + return res; + }", + { + "@type@" -> CConversion`CreateCType@Observables`GetObservableType@#, + "@prototype@" -> Observables`GetObservablePrototype@#, + "@npf_name@" -> npfName + } + ] + ]; + ] &/@ observables; + + npfHeaders = NPointFunctions`CreateCXXHeaders[]; + ]; + + (* Task 2: filling templates and moving them into models/Ma/observables/. *) + WriteOut`ReplaceInFiles[ + files, + { + "@npf_headers@" -> npfHeaders, + "@npf_definitions@" -> StringRiffle[DeleteDuplicates[npfDefinitions], "\n\n"], + "@calculate_prototypes@" -> StringRiffle[DeleteDuplicates[prototypes], "\n\n"], + "@calculate_definitions@" -> StringRiffle[DeleteDuplicates[definitions], "\n\n"], + "@include_guard@" -> SymbolName[obs], + "@namespace@" -> Observables`GetObservableNamespace[obs], + "@filename@" -> Observables`GetObservableFileName[obs], + Sequence@@FlexibleSUSY`Private`GeneralReplacementRules[] + } + ]; + + (* Task 3: returning something to the outside world. *) + { + "C++ vertices" -> Flatten[npfVertices, 1] + } +]; diff --git a/examples/new-observable/post-processing/HiggsTo2Gluons/NPointFunctions.m b/examples/new-observable/post-processing/HiggsTo2Gluons/NPointFunctions.m new file mode 100644 index 0000000000..f8d82d93a0 --- /dev/null +++ b/examples/new-observable/post-processing/HiggsTo2Gluons/NPointFunctions.m @@ -0,0 +1,7 @@ +topologies[1] = { + All -> triangle +}; + +momenta[1] = { + triangle -> 1 +}; diff --git a/examples/new-observable/post-processing/HiggsTo2Gluons/Observables.m b/examples/new-observable/post-processing/HiggsTo2Gluons/Observables.m new file mode 100644 index 0000000000..07f0b4f519 --- /dev/null +++ b/examples/new-observable/post-processing/HiggsTo2Gluons/Observables.m @@ -0,0 +1,8 @@ +Observables`DefineObservable[ + FlexibleSUSYObservable`HiggsTo2Gluons[higgs_ -> {gl_, gl_}, contr_], + GetObservableType -> {1}, + GetObservableName -> "higgs_glgl_contr", + GetObservableDescription -> "higgs -> gl gl for contr", + CalculateObservable -> "calculate_higgstoglgl_contr(model, qedqcd)", + GetObservablePrototype -> "calculate_higgstoglgl_contr(auto model, auto qedqcd)" +]; diff --git a/examples/new-observable/post-processing/HiggsTo2Gluons/WriteOut.m b/examples/new-observable/post-processing/HiggsTo2Gluons/WriteOut.m new file mode 100644 index 0000000000..c56f3548bc --- /dev/null +++ b/examples/new-observable/post-processing/HiggsTo2Gluons/WriteOut.m @@ -0,0 +1,4 @@ +WriteOut`WriteObservable[ + "FlexibleSUSYLowEnergy", + obs:FlexibleSUSYObservable`HiggsTo2Gluons[__] +] := "Re(observables." <> Observables`GetObservableName[obs] <> "(0))"; diff --git a/examples/new-observable/post-processing/higgs_to_2gluons.cpp.in b/examples/new-observable/post-processing/higgs_to_2gluons.cpp.in new file mode 100644 index 0000000000..37d2068a1c --- /dev/null +++ b/examples/new-observable/post-processing/higgs_to_2gluons.cpp.in @@ -0,0 +1,48 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + +/** + * @file @ModelName@_@filename@.cpp + * + * This file was generated at @DateAndTime@ with FlexibleSUSY + * @FlexibleSUSYVersion@ and SARAH @SARAHVersion@ + */ + +#include "@ModelName@_mass_eigenstates.hpp" +#include "cxx_qft/@ModelName@_qft.hpp" +#include "@ModelName@_@filename@.hpp" +@npf_headers@ +/* Auxiliary #include directives. */ + +namespace flexiblesusy { +namespace @ModelName@_cxx_diagrams { +namespace npointfunctions { + +@npf_definitions@ + +} // namespace npointfunctions +} // namespace @ModelName@_cxx_diagrams + +using namespace @ModelName@_cxx_diagrams; +namespace @namespace@ { + +/* Auxiliary observable-specific expressions. */ +@calculate_definitions@ + +} // namespace @namespace@ +} // namespace flexiblesusy diff --git a/examples/new-observable/post-processing/higgs_to_2gluons.hpp.in b/examples/new-observable/post-processing/higgs_to_2gluons.hpp.in new file mode 100644 index 0000000000..f2a53e62ed --- /dev/null +++ b/examples/new-observable/post-processing/higgs_to_2gluons.hpp.in @@ -0,0 +1,38 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + +/** + * @file @ModelName@_@filename@.hpp + * + * This file was generated at @DateAndTime@ with FlexibleSUSY + * @FlexibleSUSYVersion@ and SARAH @SARAHVersion@ + */ + +#ifndef @ModelName@_@include_guard@_H +#define @ModelName@_@include_guard@_H +#include "lowe.h" +/* Auxiliary #include directives. */ +namespace flexiblesusy { +namespace @namespace@ { + +/* Auxiliary observable-specific expressions. */ +@calculate_prototypes@ + +} // namespace @namespace@ +} // namespace flexiblesusy +#endif diff --git a/examples/tower/LesHouches.in.tower b/examples/tower/LesHouches.in.tower index 5e97b28ca3..57c4f58594 100644 --- a/examples/tower/LesHouches.in.tower +++ b/examples/tower/LesHouches.in.tower @@ -19,7 +19,7 @@ Block FlexibleSUSY 12 0 # force output 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/install-sarah b/install-sarah index 23714dab59..8e03d8404f 100755 --- a/install-sarah +++ b/install-sarah @@ -3,48 +3,55 @@ # SARAH installation script # Author: Alexander Voigt -# directory of this script -BASEDIR=$(dirname $0) - -# absolute path to this script -ABSBASEDIR=$(cd $BASEDIR; pwd) - # operating system operating_system="`(uname -s) 2>/dev/null || echo unknown`" # default SARAH version -sarah_version="4.14.3" +sarah_version="4.15.4" -# determine Mathematica user directory -case "$operating_system" in - Darwin) mathematica_dir="${HOME}/Library/Mathematica" ;; - CYGWIN_NT*) mathematica_dir="${USERPROFILE}/AppData/Roaming/Mathematica" ;; - # Linux, *BSD - *) mathematica_dir="${HOME}/.Mathematica" ;; -esac +# Mathematica or WolframEngine flavour +flavour="Mathematica" +# Mathematica kernel mathematica_kernel="math" -mathematica_kernel_dir="${mathematica_dir}/Kernel" -mathematica_applications_dir="${mathematica_dir}/Applications" -mathematica_init="${mathematica_kernel_dir}/init.m" -install_path="${mathematica_applications_dir}" -sarah_link="${install_path}/SARAH" -sarah_link_for_math="$sarah_link" +# installation flags +overwrite="no" -case "$operating_system" in CYGWIN_NT*) - mathematica_kernel_dir=$(cygpath -u "$mathematica_kernel_dir") - mathematica_applications_dir=$(cygpath -u "$mathematica_applications_dir") - mathematica_init=$(cygpath -u "$mathematica_init") - install_path=$(cygpath -u "$install_path") - sarah_link=$(cygpath -u "$sarah_link") - sarah_link_for_math=$(cygpath -w "$sarah_link_for_math") -esac +# exit codes +exit_ok="0" +exit_syntax_error="1" -escaped_sarah_link_for_math=$(echo "$sarah_link_for_math" | sed 's,\\,\\\\,g') +#_____________________________________________________________________ +initialize_dirs() { + # determine Mathematica user directory + case "$operating_system" in + Darwin) mathematica_dir="${HOME}/Library/${flavour}" ;; + CYGWIN_NT*) mathematica_dir="${USERPROFILE}/AppData/Roaming/${flavour}" ;; + # Linux, *BSD + *) mathematica_dir="${HOME}/.${flavour}" ;; + esac -# installation flags -overwrite="no" + mathematica_kernel_dir="${mathematica_dir}/Kernel" + mathematica_applications_dir="${mathematica_dir}/Applications" + mathematica_init="${mathematica_kernel_dir}/init.m" + + install_path="${mathematica_applications_dir}" + sarah_link="${install_path}/SARAH" + sarah_link_for_math="$sarah_link" + + case "$operating_system" in + CYGWIN_NT*) + mathematica_kernel_dir=$(cygpath -u "$mathematica_kernel_dir") + mathematica_applications_dir=$(cygpath -u "$mathematica_applications_dir") + mathematica_init=$(cygpath -u "$mathematica_init") + install_path=$(cygpath -u "$install_path") + sarah_link=$(cygpath -u "$sarah_link") + sarah_link_for_math=$(cygpath -w "$sarah_link_for_math") ;; + esac + + escaped_sarah_link_for_math=$(echo "$sarah_link_for_math" | sed 's,\\,\\\\,g') +} #_____________________________________________________________________ create_symlink() { @@ -96,6 +103,8 @@ cat <. + ==================================================================== + +*) + +BeginPackage["AMM`", {"SARAH`", "CXXDiagrams`", "TextFormatting`", "TreeMasses`", "LoopMasses`"}]; + +AMMGetMLCP::usage=""; +AMMContributingGraphs::usage=""; +AMMContributingDiagramsForGraph::usage=""; +CXXEvaluatorForDiagramFromGraph::usage=""; +AMMForwardDeclaration::usage = ""; + +Begin["`Private`"]; + +barZeeGraph = {{0,0,0,1,0,0,0,0}, + {0,0,0,0,1,0,0,0}, + {0,0,0,0,0,0,0,1}, + {1,0,0,0,1,1,0,0}, + {0,1,0,1,0,0,1,0}, + {0,0,0,1,0,0,1,1}, + {0,0,0,0,1,1,0,1}, + {0,0,1,0,0,1,1,0}}; + +contributingGraphs = {barZeeGraph}; + +AMMContributingGraphs[] := contributingGraphs; + +AMMContributingDiagramsForGraph[graph_, field_] := + Module[{diagrams}, + diagrams = CXXDiagrams`FeynmanDiagramsOfType[graph, + {1 -> field, 2 -> SARAH`AntiField[field], 3 -> GetPhoton[]}]; + + Select[diagrams,IsDiagramSupported[graph,#] &] + ] + +IsDiagramSupported[barZeeGraph, diagram_] := + Module[{photonEmitter,exchangeParticle1,exchangeParticle2}, + + photonEmitter = diagram[[8,3]]; + exchangeParticle1 = diagram[[4,3]]; + exchangeParticle2 = diagram[[5,3]]; + If[diagram[[8]] =!= {TreeMasses`GetPhoton[],CXXDiagrams`LorentzConjugate[photonEmitter],photonEmitter}, + Return[False]]; + If[exchangeParticle1 == TreeMasses`GetPhoton[] && TreeMasses`IsScalar[exchangeParticle2] && TreeMasses`IsFermion[photonEmitter] && photonEmitter == diagram[[7,2]], + Return[True]]; + If[exchangeParticle1 == TreeMasses`GetZBoson[] && TreeMasses`IsScalar[exchangeParticle2] && TreeMasses`IsFermion[photonEmitter] && photonEmitter == diagram[[7,2]], + Return[True]]; + If[exchangeParticle1 == TreeMasses`GetPhoton[] && TreeMasses`IsScalar[exchangeParticle2] && TreeMasses`IsScalar[photonEmitter] && photonEmitter == diagram[[7,2]], + Return[True]]; + If[exchangeParticle1 == TreeMasses`GetPhoton[] && TreeMasses`IsScalar[exchangeParticle2] && TreeMasses`IsVector[photonEmitter] && photonEmitter == diagram[[7,2]], + Return[True]]; + + Return[False]; + ]; + +CXXEvaluatorForDiagramFromGraph[diagram_, barZeeGraph] := + Module[{photonEmitter,exchangeParticle1,exchangeParticle2}, + + photonEmitter = diagram[[8,3]]; + exchangeParticle1 = diagram[[4,3]]; + exchangeParticle2 = diagram[[5,3]]; + If[diagram[[8]] =!= {TreeMasses`GetPhoton[],CXXDiagrams`LorentzConjugate[photonEmitter],photonEmitter}, + Return["(unknown diagram)"]]; + If[exchangeParticle1 == TreeMasses`GetPhoton[] && TreeMasses`IsScalar[exchangeParticle2] && TreeMasses`IsFermion[photonEmitter], + Return[CXXEvaluatorBZFL[photonEmitter,exchangeParticle2]]]; + If[exchangeParticle1 == TreeMasses`GetZBoson[] && TreeMasses`IsScalar[exchangeParticle2] && TreeMasses`IsFermion[photonEmitter], + Return[CXXEvaluatorBZFLZ[photonEmitter,exchangeParticle2]]]; + If[exchangeParticle1 == TreeMasses`GetPhoton[] && TreeMasses`IsScalar[exchangeParticle2] && TreeMasses`IsScalar[photonEmitter], + Return[CXXEvaluatorBZSL[photonEmitter,exchangeParticle2]]]; + If[exchangeParticle1 == TreeMasses`GetPhoton[] && TreeMasses`IsScalar[exchangeParticle2] && TreeMasses`IsVector[photonEmitter], + Return[CXXEvaluatorBZVL[photonEmitter,exchangeParticle2]]]; + + Return["(unknown diagram)"]; + ]; + +CXXEvaluatorBZFL[photonEmitter_,exchangeParticle_] := + "AMMBarrZeeFermionLoop + CXXDiagrams`CXXNameOfField[photonEmitter] <> ", " <> + CXXDiagrams`CXXNameOfField[exchangeParticle] <> ">"; + +CXXEvaluatorBZFLZ[photonEmitter_,exchangeParticle_] := + "AMMBarrZeeFermionLoopZ + CXXDiagrams`CXXNameOfField[photonEmitter] <> ", " <> + CXXDiagrams`CXXNameOfField[exchangeParticle] <> ">"; + +CXXEvaluatorBZSL[photonEmitter_,exchangeParticle_] := + "AMMBarrZeeScalarLoop + CXXDiagrams`CXXNameOfField[photonEmitter] <> ", " <> + CXXDiagrams`CXXNameOfField[exchangeParticle] <> ">"; + +CXXEvaluatorBZVL[photonEmitter_,exchangeParticle_] := + "AMMBarrZeeVectorLoop + CXXDiagrams`CXXNameOfField[photonEmitter] <> ", " <> + CXXDiagrams`CXXNameOfField[exchangeParticle] <> ">"; + +GetMinMass[particle_] := + Module[{dim = TreeMasses`GetDimension[particle], + mStr = CConversion`ToValidCSymbolString[FlexibleSUSY`M[particle]], + tail}, + If[dim == 1, + "model.get_" <> mStr <> "()", + tail = ToString[GetDimension[particle] - GetDimensionStartSkippingGoldstones[particle] + 1]; + "model.get_" <> mStr <> "().tail<" <> tail <> ">().minCoeff()" + ] + ]; + +AMMGetMLCP[] := + Module[{chargedBSMParticles}, + chargedBSMParticles = Select[TreeMasses`GetSusyParticles[], IsElectricallyCharged]; + If[chargedBSMParticles === {}, + "return 0.;", + "return Min(" <> + StringRiffle[GetMinMass /@ chargedBSMParticles, ", "] <> + ");" + ] + ]; + +AMMForwardDeclaration[field_Symbol, functionName_String] := +"template double " <> FlexibleSUSY`FSModelName <> "_amm::" <> functionName <> "<" <> + CXXDiagrams`CXXNameOfField[field, prefixNamespace -> FlexibleSUSY`FSModelName <> "_cxx_diagrams::fields"] <> + ">(" <> + "const " <> FlexibleSUSY`FSModelName <> "_mass_eigenstates&, const softsusy::QedQcd&, const Spectrum_generator_settings&" <> If[TreeMasses`GetDimension[field] =!= 1, ", int", ""] <> ");" + +End[]; +EndPackage[]; + diff --git a/meta/AMuon.m b/meta/AMuon.m deleted file mode 100644 index 6797f09b22..0000000000 --- a/meta/AMuon.m +++ /dev/null @@ -1,64 +0,0 @@ -(* :Copyright: - - ==================================================================== - This file is part of FlexibleSUSY. - - FlexibleSUSY 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. - - FlexibleSUSY 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 FlexibleSUSY. If not, see - . - ==================================================================== - -*) - -BeginPackage["AMuon`", {"SARAH`", "CXXDiagrams`", "TextFormatting`", "TreeMasses`", "LoopMasses`"}]; - -AMuonGetMuon::usage=""; -AMuonGetMSUSY::usage=""; - -Begin["`Private`"]; - -AMuonGetMuon[] := If[TreeMasses`GetDimension[TreeMasses`GetSMMuonLeptonMultiplet[]] =!= 1, - TreeMasses`GetSMMuonLeptonMultiplet[], - Cases[SARAH`ParticleDefinitions[FlexibleSUSY`FSEigenstates], - {p_, {Description -> "Muon", ___}} -> p, 1][[1]] - ] - -GetCXXMuonIndex[] := If[TreeMasses`GetDimension[TreeMasses`GetSMMuonLeptonMultiplet[]] =!= 1, - 1, - Null] - -GetMinMass[particle_] := - Module[{dim = TreeMasses`GetDimension[particle], - mStr = CConversion`ToValidCSymbolString[FlexibleSUSY`M[particle]], - tail}, - If[dim == 1, - "model.get_" <> mStr <> "()", - tail = ToString[GetDimension[particle] - GetDimensionStartSkippingGoldstones[particle] + 1]; - "model.get_" <> mStr <> "().tail<" <> tail <> ">().minCoeff()" - ] - ]; - -AMuonGetMSUSY[] := - Module[{susyParticles}, - susyParticles = Select[TreeMasses`GetSusyParticles[], IsElectricallyCharged]; - If[susyParticles === {}, - "return 0.;", - "return Min(" <> - StringJoin[Riffle[GetMinMass /@ susyParticles, ", "]] <> - ");" - ] - ]; - -End[]; -EndPackage[]; - diff --git a/meta/AMuon/Analytic_Loop_Functions.m b/meta/AMuon/Analytic_Loop_Functions.m new file mode 100644 index 0000000000..771bddb164 --- /dev/null +++ b/meta/AMuon/Analytic_Loop_Functions.m @@ -0,0 +1,331 @@ +(* ::Package:: *) + +(* :Copyright: + + ==================================================================== + This file is part of FlexibleSUSY. + + FlexibleSUSY 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. + + FlexibleSUSY 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 FlexibleSUSY. If not, see + . + ==================================================================== + +*) + +(*One Loop Functions*) +OneLoopFunctionA[0] = 2 +OneLoopFunctionA[1] = 3/2 +OneLoopFunctionA[Infinity] = 0 +OneLoopFunctionA[x_] := (2 - 9*x + 18*x^2 - 11*x^3 + 6*x^3*Log[x])/(1 - x)^4 + +OneLoopFunctionB[0] = 2 +OneLoopFunctionB[1] = 1 +OneLoopFunctionB[Infinity] = 0 +OneLoopFunctionB[x_] := (2 (1 - 6 x + 3 x^2 + 2 x^3 - 6 x^2 Log[x]))/(1 - x)^4 + +OneLoopFunctionC[0] = 3 +OneLoopFunctionC[1] = 1 +OneLoopFunctionC[Infinity] = 0 +OneLoopFunctionC[x_] := (3 (1 - x^2 + 2 x Log[x]))/(1 - x)^3 + +OneLoopFunctionD[0] = -Infinity +OneLoopFunctionD[1] = -(9/2) +OneLoopFunctionD[Infinity] = 0 +OneLoopFunctionD[x_] := (16 - 45 x + 36 x^2 - 7 x^3 + 6 (2 - 3 x)*Log[x])/(1 - x)^4 + +OneLoopFunctionE[0] = 4 +OneLoopFunctionE[1] = 1 +OneLoopFunctionE[Infinity] = 0 +OneLoopFunctionE[x_] := (2 (2 + 3 x - 6 x^2 + x^3 + 6 x Log[x]))/(1 - x)^4 + +OneLoopFunctionF[0] = Infinity +OneLoopFunctionF[1] = 1 +OneLoopFunctionF[Infinity] = 0 +OneLoopFunctionF[x_] := (3 (-3 + 4 x - x^2 - 2 Log[x]))/(2 (1 - x)^3) + +OneLoopFunctionH[0] = 5 +OneLoopFunctionH[1] = 3 +OneLoopFunctionH[Infinity] = 0 +OneLoopFunctionH[x_] := (5 - 27*x + 27*x^2 - 5*x^3 + 6*(x - 3)*x^2*Log[x])/(1 - x)^4 + +OneLoopFunctionI[0] = 1 +OneLoopFunctionI[1] = 1/2 +OneLoopFunctionI[Infinity] = 0 +OneLoopFunctionI[x_] := (1 - x + x*Log[x])/(1 - x)^2 + +OneLoopFunctionJ[0] = 7 +OneLoopFunctionJ[1] = 5 +OneLoopFunctionJ[Infinity] = 0 +OneLoopFunctionJ[x_] := (7 - 33 x + 57 x^2 - 31 x^3 + 6 x^2 (3 x - 1) Log[x])/(1 - x)^4 + +OneLoopFunctionK[0] = 1 +OneLoopFunctionK[1] = 2/3 +OneLoopFunctionK[Infinity] = 0 +OneLoopFunctionK[x_] := (1 - 4 x + 3 x^2 - 2 x^2 Log[x])/(1 - x)^3 + +OneLoopFunctionL[0] = Infinity +OneLoopFunctionL[1] = 21/2 +OneLoopFunctionL[Infinity] = 0 +OneLoopFunctionL[x_] := (2 + 27*x - 54*x^2 + 25*x^3 - 6*(2 - 9*x + 6*x^2)*Log[x])/(1 - x)^4 + +OneLoopFunctionM[0] = 4 +OneLoopFunctionM[1] = 3/2 +OneLoopFunctionM[Infinity] = 0 +OneLoopFunctionM[x_] := (4 - 9 x + 5 x^3 + 6 (1 - 2 x) x Log[x])/(1 - x)^4 + +OneLoopFunctionN[0,0] = 1/2 +OneLoopFunctionN[1,1] = 1/3 +OneLoopFunctionN[x_, y_] := + If[x == y, + (1 - 4 x + 3 x^2 - 2 x^2 Log[x])/ ((1 - x)^3), + y/(y - 1) (x (x - y)^2 Log[x] + (x - 1) ((x - y) (y - 1) - x (x - 1) Log[x/y]))/((1 - x)^2 (x - y)^2)] + +(*SSF Diagram + - mi mass of the outgoing fermion + - mj mass of the incoming fermion + - mF mass of the fermion in the loop + - mS mass of the scalar in the loop + - SFinleft left-chirality of the incoming fermion-fermion-scalar vertex + - SFinright right-chirality of the incoming fermion-fermion-scalar vertex + - SFoutleft left-chirality of the outcoming fermion-fermion-scalar vertex + - SFoutright right-chirality of the outcoming fermion-fermion-scalar vertex + - r ratio of loop masses which we expand over in the simplified case + *) + +SSFA2L[mi_,mj_,mF_,mS_,SFinleft_,SFoutleft_,SFinright_,SFoutright_]:=Module[{r}, + r=Power[mF/mS,2]; + (*eq.16 of hep-ph/9510309 (possibly with different sign) *) + Return[-SFoutleft*SFinright*OneLoopFunctionB[r]/12-SFoutleft*SFinleft*mF/mj*OneLoopFunctionC[r]/3-mi/mj*SFoutright*SFinleft*OneLoopFunctionB[r]/12] +] +SSFA2LPV[mi_,mj_,mF_,mS_,SFinleft_,SFoutleft_,SFinright_,SFoutright_]:=Module[{r,mS2}, + (*Massless emitter (in this case mS==0,mi==mj==mF) will fail *) + (*Massless mediator (in this case mF==0) case can be calculated*) + mS2=Power[mS,2]; + If[mi==mj&&mi==mS&&mF==0, + Return[-0.5*mS2*(SFinright*SFoutleft+SFinleft*SFoutright)/Power[mi,2]], + Return[2 mS^2/mj (mF (PVC[0,0,0,mj^2,0,mi^2,mF,mS,mS]+PVC[0,0,1,mj^2,0,mi^2,mF,mS,mS]+PVC[0,1,0,mj^2,0,mi^2,mF,mS,mS]) SFinleft SFoutleft-mj (PVC[0,1,0,mj^2,0,mi^2,mF,mS,mS]+PVC[0,1,1,mj^2,0,mi^2,mF,mS,mS]+PVC[0,2,0,mj^2,0,mi^2,mF,mS,mS]) SFinright SFoutleft-mi (PVC[0,0,1,mj^2,0,mi^2,mF,mS,mS]+PVC[0,0,2,mj^2,0,mi^2,mF,mS,mS]+PVC[0,1,1,mj^2,0,mi^2,mF,mS,mS]) SFinleft SFoutright)] + ] +] + +SSFA2R[mi_,mj_,mF_,mS_,SFinleft_,SFoutleft_,SFinright_,SFoutright_]:=Module[{r}, + r=Power[mF/mS,2]; + (*eq.15 of hep-ph/9510309 after replacement L<->R (possibly with different sign) *) + Return[-SFoutright*SFinleft*OneLoopFunctionB[r]/12-SFoutright*SFinright*mF/mj*OneLoopFunctionC[r]/3-mi/mj*SFoutleft*SFinright*OneLoopFunctionB[r]/12] +] +SSFA2RPV[mi_,mj_,mF_,mS_,SFinleft_,SFoutleft_,SFinright_,SFoutright_]:=Module[{r,mS2}, + (*Massless emitter (in this case mS==0,mi==mj==mF) will fail *) + (*Massless mediator (in this case mF==0) case can be calculated*) + mS2=Power[mS,2]; + If[mi==mj&&mi==mS&&mF==0, + Return[-0.5*mS2*(SFinright*SFoutleft+SFinleft*SFoutright)/Power[mi,2]], + Return[mS^2/mj (-mi (PVC[0,0,1,mj^2,0,mi^2,mF,mS,mS]+PVC[0,0,2,mj^2,0,mi^2,mF,mS,mS]+PVC[0,1,1,mj^2,0,mi^2,mF,mS,mS]) SFinright SFoutleft-mj (PVC[0,1,0,mj^2,0,mi^2,mF,mS,mS]+PVC[0,1,1,mj^2,0,mi^2,mF,mS,mS]+PVC[0,2,0,mj^2,0,mi^2,mF,mS,mS]) SFinleft SFoutright+mF (PVC[0,0,0,mj^2,0,mi^2,mF,mS,mS]+PVC[0,0,1,mj^2,0,mi^2,mF,mS,mS]+PVC[0,1,0,mj^2,0,mi^2,mF,mS,mS]) SFinright SFoutright)] + ] +] + +(*FFS Diagram + - mi mass of the outgoing fermion + - mj mass of the incoming fermion + - mF mass of the fermion in the loop + - mS mass of the scalar in the loop + - SFinleft left-chirality of the incoming fermion-fermion-scalar vertex + - SFinright right-chirality of the incoming fermion-fermion-scalar vertex + - SFoutleft left-chirality of the outcoming fermion-fermion-scalar vertex + - SFoutright right-chirality of the outcoming fermion-fermion-scalar vertex + - r ratio of loop masses which we expand over in the simplified case + *) + +FSA2L[mi_,mj_,mF_,mS_,SFinleft_,SFoutleft_,SFinright_,SFoutright_]:=Module[{r}, + r=Power[mF/mS,2]; + (*eq.19 of hep-ph/9510309 (possibly with different sign)*) + Return[-SFoutleft*SFinright*OneLoopFunctionE[r]/12-SFoutleft*SFinleft*mF/mj*OneLoopFunctionF[r]*2/3-mi/mj*SFoutright*SFinleft*OneLoopFunctionE[r]/12] +] +FFSA2LPV[mi_,mj_,mF_,mS_,SFinleft_,SFoutleft_,SFinright_,SFoutright_]:=Module[{r,mS2}, + (*Massless emitter (in this case mF==0) will fail*) + (*Massless mediator (in this case mS==0) case can be calculated*) + mS2=Power[mS,2]; + If[mi==mj&&mi==mF&&mS==0, + Return[-0.5*mS2*(SFinright*SFoutleft+SFinleft*(4*SFoutleft+SFoutright))/Power[mi,2]], + Return[2 mS2/mj (mF (-PVC[0,0,1,mj^2,0,mi^2,mS,mF,mF]-PVC[0,1,0,mj^2,0,mi^2,mS,mF,mF]) SFinleft[] SFoutleft[]-mj (PVC[0,1,0,mj^2,0,mi^2,mS,mF,mF]+PVC[0,1,1,mj^2,0,mi^2,mS,mF,mF]+PVC[0,2,0,mj^2,0,mi^2,mS,mF,mF]) SFinright[] SFoutleft[]-mi (PVC[0,0,1,mj^2,0,mi^2,mS,mF,mF]+PVC[0,0,2,mj^2,0,mi^2,mS,mF,mF]+PVC[0,1,1,mj^2,0,mi^2,mS,mF,mF]) SFinleft[] SFoutright[])]; + ] +] + +FFSA2R[mi_,mj_,mF_,mS_,SFinleft_,SFoutleft_,SFinright_,SFoutright_]:=Module[{r}, + r=Power[mF/mS,2]; + (*eq.19 of hep-ph/9510309after replacement L<->R (possibly with different sign) *) + Return[-SFoutright*SFinleft*OneLoopFunctionE[r]/12-SFoutright*SFinright*mF/mj*OneLoopFunctionF[r]*2/3-mi/mj*SFoutleft*SFinright*OneLoopFunctionE[r]/12] +] +FFSA2RPV[mi_,mj_,mF_,mS_,SFinleft_,SFoutleft_,SFinright_,SFoutright_]:=Module[{r,mS2}, + (*Massless emitter (in this case mF==0) will fail*) + (*Massless mediator (in this case mS==0) case can be calculated*) + mS2=Power[mS,2]; + If[mi==mj&&mi==mF&&mS==0, + Return[-0.5*mS2*(SFinleft*SFoutright+SFinright*(SFoutleft+4*SFoutright))/Power[mi,2]], + Return[2 mS2/mj(-mi (PVC[0,0,1,mj^2,0,mi^2,mS,mF,mF]+PVC[0,0,2,mj^2,0,mi^2,mS,mF,mF]+PVC[0,1,1,mj^2,0,mi^2,mS,mF,mF]) SFinright SFoutleft-mj (PVC[0,1,0,mj^2,0,mi^2,mS,mF,mF]+PVC[0,1,1,mj^2,0,mi^2,mS,mF,mF]+PVC[0,2,0,mj^2,0,mi^2,mS,mF,mF]) SFinleft SFoutright+mF (-PVC[0,0,1,mj^2,0,mi^2,mS,mF,mF]-PVC[0,1,0,mj^2,0,mi^2,mS,mF,mF]) SFinright SFoutright)] + ] +] + +(*VVF Diagram + - mi mass of the outgoing fermion + - mj mass of the incoming fermion + - mF mass of the fermion in the loop + - mV mass of the vector in the loop + - VFinleft left-chirality of the incoming fermion-fermion-vector vertex + - VFinright right-chirality of the incoming fermion-fermion-vector vertex + - VFoutleft left-chirality of the outcoming fermion-fermion-vector vertex + - VFoutright right-chirality of the outcoming fermion-fermion-vector vertex + - r ratio of loop masses which we expand over in the simplified case + - dim the number of spacetime dimensions, used for dimensional regularization, equivalent to dim = 4 - 2 Eps + *) + +VVFA2L[mi_,mj_,mF_,mV_,VFinleft_,VFoutleft_,VFinright_,VFoutright_]:=Module[{r}, + r=Power[mF/mV,2]; + Return[3*mF/mj*VFinleft*VFoutright*OneLoopFunctionK[r]+mi/mj*VFinleft*VFoutleft*OneLoopFunctionJ[r]/6+VFinright*VFoutright*OneLoopFunctionJ[r]/6] +] +VVFA2LPV[mi_,mj_,mF_,mV_,VFinleft_,VFoutleft_,VFinright_,VFoutright_]:=Module[{r,mV2,dim}, + (*Massless emitter (in this case mV==0,mi==mj==mF) will fail*) + (*Massless mediator (in this case mF==0) case can be calculated*) + mV2=Power[mV,2]; + If[mi==mj&&mi==mV&&mF==0, + 2*mV2*(VFinleft*VFoutleft+VFinright*VFoutright)/Power[mi,2], + Return[2 mV2/mj (mi (-(-4+dim) PVC[0,0,1,mj^2,0,mi^2,mF,mV,mV]-(-2+dim) PVC[0,0,2,mj^2,0,mi^2,mF,mV,mV]+PVC[0,1,0,mj^2,0,mi^2,mF,mV,mV]+2 PVC[0,1,1,mj^2,0,mi^2,mF,mV,mV]-dim PVC[0,1,1,mj^2,0,mi^2,mF,mV,mV]) VFinleft[] VFoutleft[]+mF ((-4+dim) PVC[0,0,0,mj^2,0,mi^2,mF,mV,mV]+(-1+dim) (PVC[0,0,1,mj^2,0,mi^2,mF,mV,mV]+PVC[0,1,0,mj^2,0,mi^2,mF,mV,mV])) VFinleft[] VFoutright[]+mj (PVC[0,0,1,mj^2,0,mi^2,mF,mV,mV]-(-4+dim) PVC[0,1,0,mj^2,0,mi^2,mF,mV,mV]-(-2+dim) (PVC[0,1,1,mj^2,0,mi^2,mF,mV,mV]+PVC[0,2,0,mj^2,0,mi^2,mF,mV,mV])) VFinright[] VFoutright[])] + ] +] + +VVFA2R[mi_,mj_,mF_,mV_,VFinleft_,VFoutleft_,VFinright_,VFoutright_]:=Module[{r}, + r=Power[mF/mV,2]; + Return[3*mF/mj*VFinright*VFoutleft*OneLoopFunctionK[r]+mi/mj*VFinright*VFoutright*OneLoopFunctionJ[r]/6+VFinleft*VFoutleft*OneLoopFunctionJ[r]/6] +] +VVFA2RPV[mi_,mj_,mF_,mV_,VFinleft_,VFoutleft_,VFinright_,VFoutright_]:=Module[{r,mV2,dim}, + (*Massless emitter (in this case mV==0,mi==mj==mF) will fail*) + (*Massless mediator (in this case mF==0) case can be calculated*) + mV2=Power[mV,2]; + If[mi==mj&&mi==mV&&mF==0, + 2*mV2*(VFinleft*VFoutleft+VFinright*VFoutright)/Power[mi,2], + Return[2 mV2/mj (mj (PVC[0,0,1,mj^2,0,mi^2,mF,mV,mV]-(-4+dim) PVC[0,1,0,mj^2,0,mi^2,mF,mV,mV]-(-2+dim) (PVC[0,1,1,mj^2,0,mi^2,mF,mV,mV]+PVC[0,2,0,mj^2,0,mi^2,mF,mV,mV])) VFinleft VFoutleft+mF ((-4+dim) PVC[0,0,0,mj^2,0,mi^2,mF,mV,mV]+(-1+dim) (PVC[0,0,1,mj^2,0,mi^2,mF,mV,mV]+PVC[0,1,0,mj^2,0,mi^2,mF,mV,mV])) VFinright VFoutleft+mi (-(-4+dim) PVC[0,0,1,mj^2,0,mi^2,mF,mV,mV]-(-2+dim) PVC[0,0,2,mj^2,0,mi^2,mF,mV,mV]+PVC[0,1,0,mj^2,0,mi^2,mF,mV,mV]+2 PVC[0,1,1,mj^2,0,mi^2,mF,mV,mV]- dim PVC[0,1,1,mj^2,0,mi^2,mF,mV,mV]) VFinright VFoutright)] + ] +] + +(*FFV Diagram + - mi mass of the outgoing fermion + - mj mass of the incoming fermion + - mF mass of the fermion in the loop + - mV mass of the vector in the loop + - VFinleft left-chirality of the incoming fermion-fermion-vector vertex + - VFinright right-chirality of the incoming fermion-fermion-vector vertex + - VFoutleft left-chirality of the outcoming fermion-fermion-vector vertex + - VFoutright right-chirality of the outcoming fermion-fermion-vector vertex + - r ratio of loop masses which we expand over in the simplified case + - dim the number of spacetime dimensions, used for dimensional regularization, equivalent to dim = 4 - 2 Eps +*) + +FFVA2L[mi_,mj_,mF_,mV_,VFinleft_,VFoutleft_,VFinright_,VFoutright_]:=Module[{r}, + r=Power[mF/mV,2]; + Return[-4*mF/mj*VFinleft*VFoutright*OneLoopFunctionC[r]/3+mi/mj*VFinleft*VFoutleft*OneLoopFunctionM[r]/3+VFinright*VFoutright*OneLoopFunctionM[r]/3] +] +FFVA2LPV[mi_,mj_,mF_,mV_,VFinleft_,VFoutleft_,VFinright_,VFoutright_]:=Module[{r,mV2,dim}, + mV2=Power[mV,2]; + Return[2 mV2/mj (-mi (2 PVC[0,0,0,mj^2,0,mi^2,mV,mF,mF]+dim PVC[0,0,1,mj^2,0,mi^2,mV,mF,mF]-2 PVC[0,0,2,mj^2,0,mi^2,mV,mF,mF]+dim PVC[0,0,2,mj^2,0,mi^2,mV,mF,mF]+2 PVC[0,1,0,mj^2,0,mi^2,mV,mF,mF]-2 PVC[0,1,1,mj^2,0,mi^2,mV,mF,mF]+dim PVC[0,1,1,mj^2,0,mi^2,mV,mF,mF]) VFinleft VFoutleft+mF (4 PVC[0,0,0,mj^2,0,mi^2,mV,mF,mF]+dim (PVC[0,0,1,mj^2,0,mi^2,mV,mF,mF]+PVC[0,1,0,mj^2,0,mi^2,mV,mF,mF])) VFinleft VFoutright-mj (2 PVC[0,0,0,mj^2,0,mi^2,mV,mF,mF]+2 PVC[0,0,1,mj^2,0,mi^2,mV,mF,mF]+dim PVC[0,1,0,mj^2,0,mi^2,mV,mF,mF]-2 PVC[0,1,1,mj^2,0,mi^2,mV,mF,mF]+dim PVC[0,1,1,mj^2,0,mi^2,mV,mF,mF]-2 PVC[0,2,0,mj^2,0,mi^2,mV,mF,mF]+dim PVC[0,2,0,mj^2,0,mi^2,mV,mF,mF]) VFinright VFoutright)] +] + +FFVA2R[mi_,mj_,mF_,mV_,VFinleft_,VFoutleft_,VFinright_,VFoutright_]:=Module[{r}, + r=Power[mF/mV,2]; + Return[-4*mF/mj*VFinright*VFoutleft*OneLoopFunctionC[r]/3+mi/mj*VFinright*VFoutright*OneLoopFunctionM[r]/3+VFinleft*VFoutleft*OneLoopFunctionM[r]/3] +] +FFVA2RPV[mi_,mj_,mF_,mV_,VFinleft_,VFoutleft_,VFinright_,VFoutright_]:=Module[{r,mV2,dim}, + mV2=Power[mV,2]; + Return[2 mV2/mj (-mj (2 PVC[0,0,0,mj^2,0,mi^2,mV,mF,mF]+2 PVC[0,0,1,mj^2,0,mi^2,mV,mF,mF]+dim PVC[0,1,0,mj^2,0,mi^2,mV,mF,mF]-2 PVC[0,1,1,mj^2,0,mi^2,mV,mF,mF]+dim PVC[0,1,1,mj^2,0,mi^2,mV,mF,mF]-2 PVC[0,2,0,mj^2,0,mi^2,mV,mF,mF]+dim PVC[0,2,0,mj^2,0,mi^2,mV,mF,mF]) VFinleft VFoutleft+mF (4 PVC[0,0,0,mj^2,0,mi^2,mV,mF,mF]+dim (PVC[0,0,1,mj^2,0,mi^2,mV,mF,mF]+PVC[0,1,0,mj^2,0,mi^2,mV,mF,mF])) VFinright VFoutleft-mi (2 PVC[0,0,0,mj^2,0,mi^2,mV,mF,mF]+dim PVC[0,0,1,mj^2,0,mi^2,mV,mF,mF]-2 PVC[0,0,2,mj^2,0,mi^2,mV,mF,mF]+dim PVC[0,0,2,mj^2,0,mi^2,mV,mF,mF]+2 PVC[0,1,0,mj^2,0,mi^2,mV,mF,mF]-2 PVC[0,1,1,mj^2,0,mi^2,mV,mF,mF]+dim PVC[0,1,1,mj^2,0,mi^2,mV,mF,mF]) VFinright VFoutright)] +] + +(*VSF Diagram + - mi mass of the outgoing fermion + - mj mass of the incoming fermion + - mF mass of the fermion in the loop + - mV mass of the vector in the loop + - mG mass of the Goldstone boson (corresponding to the vector) in the loop + - VFinleft left-chirality of the incoming fermion-fermion-vector vertex + - VFinright right-chirality of the incoming fermion-fermion-vector vertex + - SFoutleft left-chirality of the outcoming fermion-fermion-scalar vertex + - SFoutright right-chirality of the outcoming fermion-fermion-scalar vertex + - r ratio of loop masses mF and mV which we expand over in the simplified case + - s ratio of loop masses mF and mG which we expand over in the simplified case + *) + +VSFA2L[mi_,mj_,mF_,mV_,mG_,VFinleft_,SFoutleft_,VFinright_,SFoutright_]:=Module[{r,s}, + r=Power[mF/mV,2]; + s=Power[mF/mG,2]; + Return[1/mj*VFinleft*SFoutleft*OneLoopFunctionN[r,s]] +] +VSFA2LPV[mi_,mj_,mF_,mV_,mG_,VFinleft_,SFoutleft_,VFinright_,SFoutright_]:=Module[{r,mV2}, + mV2=Power[mV,2]; + If[mi==mj&&mi==mF&&mV==0&&mG==0, + mV2, + Return[(2 mV2 PVC[0,1,0,mj^2,0,mi^2,mF,mV,mG] SFoutleft VFinleft)/mj] + ] +] + +VSFA2R[mi_,mj_,mF_,mV_,mG_,VFinleft_,SFoutleft_,VFinright_,SFoutright_]:=Module[{r,s}, + r=Power[mF/mV,2]; + s=Power[mF/mG,2]; + Return[1/mj*VFinright*SFoutright*OneLoopFunctionN[r,s]] +] +VSFA2RPV[mi_,mj_,mF_,mV_,mG_,VFinleft_,SFoutleft_,VFinright_,SFoutright_]:=Module[{r,mV2}, + mV2=Power[mV,2]; + If[mi==mj&&mi==mF&&mV==0&&mG==0, + mV2, + Return[(2 mV2 PVC[0,1,0,mj^2,0,mi^2,mF,mV,mG] SFoutright VFinright)/mj] + ] +] + +(*SVF Diagram + - mi mass of the outgoing fermion + - mj mass of the incoming fermion + - mF mass of the fermion in the loop + - mV mass of the vector in the loop + - mG mass of the Goldstone boson (corresponding to the vector) in the loop + - SFinleft left-chirality of the incoming fermion-fermion-scalar vertex + - SFinright right-chirality of the incoming fermion-fermion-scalar vertex + - VFoutleft left-chirality of the outcoming fermion-fermion-vector vertex + - VFoutright right-chirality of the outcoming fermion-fermion-vector vertex + - r ratio of loop masses mF and mV which we expand over in the simplified case + - s ratio of loop masses mF and mG which we expand over in the simplified case + *) + +SVFA2L[mi_,mj_,mF_,mV_,mG_,SFinleft_,VFoutleft_,SFinright_,VFoutright_]:=Module[{r,s}, + r=Power[mF/mV,2]; + s=Power[mF/mG,2]; + Return[1/mj*SFinleft*VFoutright*OneLoopFunctionN[r,s]] +] +SVFA2LPV[mi_,mj_,mF_,mV_,mG_,SFinleft_,VFoutleft_,SFinright_,VFoutright_]:=Module[{r,mV2}, + (*Massless emitter (in this case mV==0,mi==mj==mF) will fail*) + (*Massless mediator (in this case mF==0) case can be calculated*) + mV2=Power[mV,2]; + If[mi==mj&&mi==mV&&mF==0, + mV2, + Return[(2 mV2 PVC[0,0,1,mj^2,0,mi^2,mF,mG,mV] SFinleft VFoutright)/mj] + ] +] + +SVFA2R[mi_,mj_,mF_,mV_,mG_,SFinleft_,VFoutleft_,SFinright_,VFoutright_]:=Module[{r,s}, + r=Power[mF/mV,2]; + s=Power[mF/mG,2]; + Return[1/mj*SFinright*VFoutleft*OneLoopFunctionN[r,s]] +] +SVFA2RPV[mi_,mj_,mF_,mV_,mG_,SFinleft_,VFoutleft_,SFinright_,VFoutright_]:=Module[{r,mV2}, + (*Massless emitter (in this case mV==0,mi==mj==mF) will fail*) + (*Massless mediator (in this case mF==0) case can be calculated*) + mV2=Power[mV,2]; + If[mi==mj&&mi==mV&&mF==0, + mV2, + Return[(2 mV^2 PVC[0,0,1,mj^2,0,mi^2,mF,mG,mV] SFinright VFoutleft)/mj] + ] +] diff --git a/meta/BetaFunction.m b/meta/BetaFunction.m index fec302e30f..fca46d14c5 100644 --- a/meta/BetaFunction.m +++ b/meta/BetaFunction.m @@ -184,7 +184,7 @@ ]; result = StringJoin[result] <> "\n" <> target <> " = " <> - StringJoin[Riffle[MapIndexed[(target <> "_" <> ToString[#2[[1]]])&, splitExpr], " + "]] <> + StringRiffle[MapIndexed[(target <> "_" <> ToString[#2[[1]]])&, splitExpr], " + "] <> ";\n"; , result = target <> " = " <> CastTo[RValueToCFormString[expr], type] <> ";\n"; @@ -311,7 +311,7 @@ (* beta[[k,1]] == name, beta[[k,2]] == 1 loop beta function *) name = beta[[k,1]]; type = GuessType[name]; - expr = Drop[beta[[k]], 1]; + expr = Drop[beta[[k]], 1] /. Indeterminate -> 0; (* protect tensor products *) expr = CConversion`ProtectTensorProducts[#, name]& /@ expr; (* simplify expressions *) diff --git a/meta/BtoSGamma.m b/meta/BtoSGamma.m index a3abd9ccf9..9efbe0fa7d 100644 --- a/meta/BtoSGamma.m +++ b/meta/BtoSGamma.m @@ -61,7 +61,7 @@ outFermion = GetStrangeQuark[], dimensionInFermion = TreeMasses`GetDimension[TreeMasses`GetSMBottomQuarkMultiplet[]], dimensionOutFermion = TreeMasses`GetDimension[TreeMasses`GetSMStrangeQuarkMultiplet[]]}, - Utils`AssertWithMessage[Utils`FSBooleanQ[matchingOn], + Utils`AssertWithMessage[BooleanQ[matchingOn], "BtoSGamma`CreateInterfaceBtoSGamma[]: Error, argument must be either True or False."]; If[matchingOn, @@ -73,8 +73,10 @@ ""] <> "const auto mW = context.mass<" <> CXXDiagrams`CXXNameOfField[TreeMasses`GetWBoson[]] <> ">(" <> If[TreeMasses`GetDimension[TreeMasses`GetWBoson[]] =!= 1, - Print["Warning: b->s gamma module does not work reliable with multiple W bosons.\n" <> - "We assume the first element is SM W boson"]; + Utils`FSFancyWarning[ + "b->s gamma module does not work reliable with multiple W bosons.", + " We assume the first element is SM W boson" + ]; "{0}", "{}"] <> ");\n" <> "constexpr bool discard_SM_contribution = true;\n" <> diff --git a/meta/CXXDiagrams.m b/meta/CXXDiagrams.m index c2fc766fbf..ba5d39765b 100644 --- a/meta/CXXDiagrams.m +++ b/meta/CXXDiagrams.m @@ -178,9 +178,9 @@ * \returns the name of the c++ type corresponding to a * given vertex. **) -CXXNameOfVertex[fields_List] := "Vertex<" <> StringJoin[Riffle[ +CXXNameOfVertex[fields_List] := "Vertex<" <> StringRiffle[ CXXNameOfField[#, prefixNamespace -> "fields"] & /@ fields, - ", "]] <> ">" + ", "] <> ">" (** \brief Returns the appropriate c++ typename to conjugate a * given field as it would be used by ``SARAH`AntiField[]``. @@ -231,9 +231,8 @@ ]; (** \brief Creates c++ code that makes all fields and their properties - * available as c++ types. Also creates two using declarations for - * the following fields: - * - Photon + * available as c++ types. Also creates one using declaration for + * the following field: * - Electron * Furthermore create the necessary boilerplate code to conjugate any * given c++ field as well as convenience `boost::mpl::vector<>` @@ -256,7 +255,7 @@ ] ]; -CreateFields[] := +CreateFields[potentialLSPParticles_List] := Module[{fields, scalars, fermions, vectors, ghosts}, fields = TreeMasses`GetParticles[]; scalars = Select[fields, TreeMasses`IsScalar]; @@ -264,11 +263,12 @@ vectors = Select[fields, TreeMasses`IsVector]; ghosts = Select[fields, TreeMasses`IsGhost]; - StringJoin @ Riffle[ + { + StringRiffle[ ("struct " <> CXXNameOfField[#] <> " {\n" <> TextFormatting`IndentText[ - "static constexpr auto particle_type = ParticleType::" <> ParticleTypeAsString[#] <> ";\n" <> - "static constexpr auto color_rep = ParticleColorRep::" <> ParticleColorRepAsString[#] <> ";\n" <> + "static constexpr auto particleType = ParticleType::" <> ParticleTypeAsString[#] <> ";\n" <> + "static constexpr auto colorRep = ParticleColorRep::" <> ParticleColorRepAsString[#] <> ";\n" <> "static constexpr auto massless = " <> CConversion`CreateCBoolValue @ TreeMasses`IsMassless[#] <> ";\n" <> "using index_bounds = boost::mpl::pair<\n" <> " boost::mpl::vector_c @@ -283,37 +283,40 @@ "using sm_flags = boost::mpl::vector_c If[TreeMasses`GetDimension[#] === 1, CConversion`CreateCBoolValue @ TreeMasses`IsSMParticle[#], - StringJoin @ Riffle[CConversion`CreateCBoolValue /@ + StringRiffle[CConversion`CreateCBoolValue /@ TreeMasses`IsSMParticleElementwise[#], ", "] ] <> ">;\n" <> "static constexpr int numberOfFieldIndices = " <> ToString @ NumberOfFieldIndices[#] <> ";\n" <> - "static constexpr double electric_charge = " <> + "static constexpr double electricCharge = " <> CConversion`RValueToCFormString[TreeMasses`GetElectricCharge[#]] <> ";\n" <> + "static constexpr auto pdgids = boost::hana::make_tuple(" <> + (* in SARAH particles.m PDG is sometimes a list of integers, and sometimes just an integer *) + ToString@If[IntegerQ[SARAH`getPDGList[#]], SARAH`getPDGList[#], StringRiffle[SARAH`getPDGList[#], ","]] <> ");\n" <> "using lorentz_conjugate = " <> CXXNameOfField[LorentzConjugate[#]] <> ";\n"] <> - "};" &) /@ fields, "\n\n"] <> "\n\n" <> + "};")& /@ fields, "\n\n"] <> "\n\n" <> "// Named fields\n" <> - "using Photon = " <> CXXNameOfField[SARAH`Photon] <> ";\n" <> "using Electron = " <> CXXNameOfField[AtomHead @ TreeMasses`GetSMElectronLepton[]] <> ";\n\n" <> - "// Fields that are their own Lorentz conjugates.\n" <> - StringJoin @ Riffle[ - ("template<> struct " <> LorentzConjugateOperation[#] <> "<" <> CXXNameOfField[#] <> ">" <> - " { using type = " <> CXXNameOfField[#] <> "; };" - &) /@ Select[fields, (# == LorentzConjugate[#] &)], - "\n"] <> "\n\n" <> - "using scalars = boost::mpl::vector<" <> - StringJoin[Riffle[CXXNameOfField /@ scalars, ", "]] <> ">;\n" <> + StringRiffle[CXXNameOfField /@ scalars, ", "] <> ">;\n" <> "using fermions = boost::mpl::vector<" <> - StringJoin[Riffle[CXXNameOfField /@ fermions, ", "]] <> ">;\n" <> + StringRiffle[CXXNameOfField /@ fermions, ", "] <> ">;\n" <> "using vectors = boost::mpl::vector<" <> - StringJoin[Riffle[CXXNameOfField /@ vectors, ", "]] <> ">;\n" <> + StringRiffle[CXXNameOfField /@ vectors, ", "] <> ">;\n" <> "using ghosts = boost::mpl::vector<" <> - StringJoin[Riffle[CXXNameOfField /@ ghosts, ", "]] <> ">;" + StringRiffle[CXXNameOfField /@ ghosts, ", "] <> ">;\n" <> + "using potentialLSPparticles = boost::mpl::vector<" <> StringRiffle[CXXNameOfField /@ potentialLSPParticles, ", "] <> ">;", + "// Fields that are their own Lorentz conjugates.\n" <> + StringRiffle[ + ("template<> struct " <> LorentzConjugateOperation[#] <> "<" <> CXXNameOfField[#, prefixNamespace -> "flexiblesusy::" <> FlexibleSUSY`FSModelName <> "_cxx_diagrams::fields"] <> ">" <> + " { using type = " <> CXXNameOfField[#, prefixNamespace -> "flexiblesusy::" <> FlexibleSUSY`FSModelName <> "_cxx_diagrams::fields"] <> "; };" + &) /@ Select[fields, (# == LorentzConjugate[#] &)], + "\n"] <> "\n\n" + } ] (** \brief Get the lorentz index of a given indexed field @@ -517,7 +520,7 @@ ConvertColourStructureToColorMathConvention[indexedFields_List, KroneckerDeltaColourVertex[cIndex1_, cIndex2_]] := - Module[{colouredField1, colouredField2, colourRep1, colourRep2}, + Module[{colouredField1, colouredField2, colourRep1, colourRep2, errorMessage}, (* If the result has a color Delta, we need to find out if it's adj. or fundamental because they are represented by different symbols in ColorMath. Also, in ColorMath the order of indices matters. As stated in ColorMath tutorial notebook: @@ -533,26 +536,65 @@ colourRep1 = SARAH`getColorRep[colouredField1]; colourRep2 = SARAH`getColorRep[colouredField2]; - Utils`AssertWithMessage[colourRep1 == colourRep2, - "CXXDiagrams`ConvertColourStructureToColorMathConvention[]: " <> - "Two colour indices in Kronecker delta that come from fields " <> - "of incompatible representations."]; - - (* FIXME: Are these orderings correct? *) - Switch[{colourRep1}, - {SARAH`T}, If[RemoveLorentzConjugation[colouredField1] === colouredField1, - ColorMath`CMdelta[cIndex2, cIndex1], - ColorMath`CMdelta[cIndex1, cIndex2] - ], - {O}, ColorMath`CMDelta[cIndex2, cIndex1], - _, - Print["CXXDiagrams`ConvertColourStructureToColorMathConvention[]: " <> - "Two colour indices in Kronecker delta that come from fields " <> - "or representations we cannot handle: " <> - ToString[{colourRep1, colourRep2}]]; - Quit[1]; - ] - ]; + errorMessage = "CXXDiagrams`ConvertColourStructureToColorMathConvention[]: " <> + "Two colour indices in Kronecker delta that come from fields " <> + "of incompatible representations: Field1 = " <> + ToString[{colouredField1, colourRep1}] <> ", Field2 = " <> + ToString[{colouredField2, colourRep2}]; + + (* FIXME: Are these orderings correct? *) + Switch[{colourRep1, colourRep2}, + {SARAH`T, SARAH`T}, + (* 2 is conjugated, 1 is not *) + If[RemoveLorentzConjugation[colouredField1] === colouredField1 && RemoveLorentzConjugation[colouredField2] =!= colouredField2, + ColorMath`CMdelta[cIndex2, cIndex1], + (* 1 is conjugated, 2 is not *) + If[RemoveLorentzConjugation[colouredField2] === colouredField2 && RemoveLorentzConjugation[colouredField1] =!= colouredField1, + ColorMath`CMdelta[cIndex1, cIndex2], + Utils`AssertWithMessage[False, errorMessage] + ] + ], + {-SARAH`T, -SARAH`T}, + (* 2 is conjugated, 1 is not *) + If[RemoveLorentzConjugation[colouredField1] === colouredField1 && RemoveLorentzConjugation[colouredField2] =!= colouredField2, + ColorMath`CMdelta[cIndex1, cIndex2], + (* 1 is conjugated, 2 is not *) + If[RemoveLorentzConjugation[colouredField2] === colouredField2 && RemoveLorentzConjugation[colouredField1] =!= colouredField1, + ColorMath`CMdelta[cIndex2, cIndex1], + Utils`AssertWithMessage[False, errorMessage] + ] + ], + {SARAH`T, -SARAH`T}, + (* none is conjugated *) + If[RemoveLorentzConjugation[colouredField1] === colouredField1 && RemoveLorentzConjugation[colouredField2] === colouredField2, + ColorMath`CMdelta[cIndex2, cIndex1], + (* both are conjugated *) + If[RemoveLorentzConjugation[colouredField1] =!= colouredField1 && RemoveLorentzConjugation[colouredField2] =!= colouredField2, + ColorMath`CMdelta[cIndex1, cIndex2], + (* error if only one is conjugated *) + Utils`AssertWithMessage[False, errorMessage] + ] + ], + {-SARAH`T, SARAH`T}, + (* none is conjugated *) + If[RemoveLorentzConjugation[colouredField1] === colouredField1 && RemoveLorentzConjugation[colouredField2] === colouredField2, + ColorMath`CMdelta[cIndex1, cIndex2], + (* both are conjugated *) + If[RemoveLorentzConjugation[colouredField1] =!= colouredField1 && RemoveLorentzConjugation[colouredField2] =!= colouredField2, + ColorMath`CMdelta[cIndex2, cIndex1], + (* error if only one is conjugated *) + Utils`AssertWithMessage[False, errorMessage] + ] + ], + {O, O}, ColorMath`CMDelta[cIndex2, cIndex1], + _, + Print["CXXDiagrams`ConvertColourStructureToColorMathConvention[]: " <> + "Two colour indices in Kronecker delta that come from fields " <> + "or representations we cannot handle: " <> + ToString[{colourRep1, colourRep2}]]; + Quit[1]; + ] +]; ConvertColourStructureToColorMathConvention[fields_List, AdjointlyColouredVertex[cIndex1_, cIndex2_, cIndex3_] GellMannVertex[cIndex3_, cIndex4_, cIndex5_]] := @@ -674,14 +716,11 @@ If[(Times @@ colorMathExpressions) === 1, 1, ColorMathToSARAHConvention[ With[{colorFac = ColorMath`CSimplify[Times @@ colorMathExpressions]}, - If[!FreeQ[colorFac, Superscript[CMo, {__}]], - (* RemoveFD converts f and d color structures into a sum of ColorMath`o *) - ColorMath`CSimplify[Times @@ colorMathExpressions, RemoveFD -> False], - (* on the other hand, without RemoveFD -> True expression - {ct94450, ct94453}ct94448 {ct94450, ct94453, ct94454} - 4 CMt CMf - ct94455 - is not simplified *) + If[ColorMath`ContainsO[colorFac], + ColorMath`SortIndices[ + colorFac /. + Superscript[ColorMath`CMo, idx_List] /; Length[idx]===3 :> ColorMath`TR/2 (0 I Superscript[ColorMath`CMf, idx] + Superscript[ColorMath`CMd, idx]) + ], colorFac ] ] @@ -1157,19 +1196,15 @@ vertices:{{__}...}, OptionsPattern[{MaximumVerticesLimit -> 500}]] := Module[{cxxVertices, vertexPartition, - contextsToDistribute = {"SARAH`", "Susyno`LieGroups`", "FlexibleSUSY`", "CConversion`", "Himalaya`"}}, + contextsToDistribute = {"SARAH`", "Susyno`LieGroups`", "FlexibleSUSY`", "CConversion`"}}, If[FlexibleSUSY`FSEnableParallelism, + LaunchKernels[]; (* without this CForm includes context in name of symbols such that we get for example SARAH_g1 instead of g1 in generated C++ code *) ParallelEvaluate[ - (BeginPackage[#];EndPackage[]; - (* prevent shdw warning with Susyno`LieGroups`M: *) - Off[Remove::remal]; - Remove[Susyno`LieGroups`M]; - On[Remove::remal]; - )& /@ contextsToDistribute, + (BeginPackage[#];EndPackage[];)& /@ contextsToDistribute, DistributedContexts->Automatic ]; (* without this CForm converts complex numbers using @@ -1203,20 +1238,27 @@ , DistributedContexts->None ]; - cxxVertices = - AbsoluteTiming@ParallelMap[ - CreateVertex, - DeleteDuplicates[vertices], DistributedContexts->All - ], - cxxVertices = - AbsoluteTiming@Map[ - CreateVertex, - DeleteDuplicates[vertices] - ], + Off[Part::pkspec1]; + cxxVertices = AbsoluteTiming@ParallelMap[ + CreateVertex, + DeleteDuplicates[vertices] + ]; + On[Part::pkspec1]; + Needs["Parallel`Developer`"]; + Parallel`Developer`ClearDistributedDefinitions[]; + Parallel`Developer`ClearKernels[]; + CloseKernels[] + , + Off[Part::pkspec1]; + cxxVertices = AbsoluteTiming@Map[ + CreateVertex, + DeleteDuplicates[vertices] + ]; + On[Part::pkspec1];, Print["Error in CXXDiagrams. Variable FSEnableParallelism not defined."]; Quit[1]; ]; Print[""]; - Print["The creation of C++ vertices took ", Round[First@cxxVertices, 0.1], "s"]; + Print["The creation of C++ vertices took", FSRound[First@cxxVertices, 1], "s"]; cxxVertices = Last@cxxVertices; (* Mathematica 7 does not support the `UpTo[n]` notation *) @@ -1228,7 +1270,7 @@ Utils`AssertOrQuit[Sort[cxxVertices] === Sort[Join@@vertexPartition],CreateVertices::errLostVertices]; - Map[StringJoin[Riffle[#, "\n\n"]] &, Transpose /@ vertexPartition, {2}] + Map[StringRiffle[#, "\n\n"] &, Transpose /@ vertexPartition, {2}] ] /; Utils`AssertOrQuit[And[IntegerQ@OptionValue@MaximumVerticesLimit, OptionValue@MaximumVerticesLimit>0],CreateVertices::errMaximumVerticesLimit]; Utils`MakeUnknownInputDefinition@CreateVertices; (** \brief Creates c++ code that makes a function available that @@ -1239,19 +1281,19 @@ **) CreateVertex[fields_List] := Module[{fieldSequence}, - fieldSequence = StringJoin @ Riffle[ - CXXNameOfField[#, prefixNamespace -> "fields"] & /@ fields, ", "]; + fieldSequence = StringRiffle[ + CXXNameOfField[#, prefixNamespace -> FlexibleSUSY`FSModelName <> "_cxx_diagrams::fields"] & /@ fields, ", "]; { "template<> struct VertexImpl<" <> fieldSequence <> ">" <> "\n" <> "{\n" <> TextFormatting`IndentText[ - "static " <> SymbolName[VertexTypeForFields[fields]] <> + "static cxx_diagrams::" <> SymbolName[VertexTypeForFields[fields]] <> " evaluate(const std::array ToString[Total[NumberOfFieldIndices /@ fields]] <> ">& indices, const context_base& context);"] <> "\n" <> "};" , - SymbolName[VertexTypeForFields[fields]] <> + "cxx_diagrams::" <> SymbolName[VertexTypeForFields[fields]] <> " VertexImpl<" <> fieldSequence <> ">::evaluate(\n" <> TextFormatting`IndentText["const std::array ToString[Total[NumberOfFieldIndices /@ fields]] <> ">& indices, " <> @@ -1260,7 +1302,7 @@ VertexFunctionBodyForFields[fields] <> "\n"] <> "}" } - ] + ]; (** \brief Returns the Lorentz structure of a given vertex. * param fields a vertex given as a list of fields @@ -1360,8 +1402,8 @@ (RotateLeft[{lIndex1, lIndex2, lIndex3}, #] === LorentzIndexOfField /@ gaugeStructure[[3]])) & /@ {0, 1, 2}), - "TripleVectorVertex::even_permutation{}", - "TripleVectorVertex::odd_permutation{}"] <> + "cxx_diagrams::TripleVectorVertex::even_permutation{}", + "cxx_diagrams::TripleVectorVertex::odd_permutation{}"] <> "};", _QuadrupleVectorVertex, @@ -1477,7 +1519,7 @@ ghostMappings = SelfEnergies`ReplaceGhosts[FlexibleSUSY`FSEigenstates]}, massiveFields = TreeMasses`GetParticles[]; - StringJoin @ Riffle[ + StringRiffle[ Module[{fieldInfo = TreeMasses`FieldInfo[#], numberOfIndices}, numberOfIndices = Length @ fieldInfo[[5]]; @@ -1500,7 +1542,7 @@ ghostMappings = SelfEnergies`ReplaceGhosts[FlexibleSUSY`FSEigenstates]}, massiveFields = TreeMasses`GetParticles[]; - StringJoin @ Riffle[ + StringRiffle[ Module[{fieldInfo = TreeMasses`FieldInfo[#], numberOfIndices}, numberOfIndices = Length @ fieldInfo[[5]]; @@ -1528,7 +1570,7 @@ numberOfElectronIndices = NumberOfFieldIndices[electron]; numberOfPhotonIndices = NumberOfFieldIndices[photon]; - "ChiralVertex unit_charge(const context_base& context)\n" <> + "cxx_diagrams::ChiralVertex unit_charge(const context_base& context)\n" <> "{\n" <> TextFormatting`IndentText @ ("std::array ToString @ numberOfElectronIndices <> "> electron_indices = {" <> @@ -1538,7 +1580,7 @@ StringJoin @ Table[", 0", {numberOfElectronIndices-1}], ""] <> " ", If[numberOfElectronIndices =!= 0, - StringJoin @ Riffle[Table[" 0", {numberOfElectronIndices}], ","] <> " ", + StringRiffle[Table[" 0", {numberOfElectronIndices}], ","] <> " ", ""] ] <> "};\n") <> @@ -1550,7 +1592,7 @@ StringJoin @ Table[", 0", {numberOfPhotonIndices-1}], ""] <> " ", If[numberOfPhotonIndices =!= 0, - StringJoin @ Riffle[Table[" 0", {numberOfPhotonIndices}], ","] <> " ", + StringRiffle[Table[" 0", {numberOfPhotonIndices}], ","] <> " ", ""] ] <> "};\n") <> @@ -1655,9 +1697,10 @@ ExtractColourFactor[colourfactor_ * SARAH`Delta[ctIndex1_, ctIndex2_] /; NumericQ[colourfactor]] := colourfactor; ExtractColourFactor[SARAH`Delta[ctIndex1_, ctIndex2_]] := 1; ExtractColourFactor[colourfactor_ /; NumericQ[colourfactor]] := colourfactor; +(* currently from 8->88 we only handle symmetric structure (i.e d, not f) *) +(* ExtractColourFactor[colourfactor_ * Superscript[CMf, {ctIndex1_, ctIndex2_, ctIndex3_}] /; NumericQ[colourfactor]] := colourfactor; *) +ExtractColourFactor[colourfactor_ * Superscript[CMd, {ctIndex1_, ctIndex2_, ctIndex3_}] /; NumericQ[colourfactor]] := colourfactor; (* cases for 8->88 amplitudes -ExtractColourFactor[colourfactor_ * Superscript[CMf, {ctIndex1_, ctIndex2_, ctIndex3_}] /; NumericQ[colourfactor]] := ?; -ExtractColourFactor[colourfactor_ * Superscript[CMd, {ctIndex1_, ctIndex2_, ctIndex3_}] /; NumericQ[colourfactor]] := ?; ExtractColourFactor[colourfactor1_ * Superscript[CMf, {ctIndex1_, ctIndex2_, ctIndex3_} + colourfactor2_ * Superscript[CMd, {ctIndex1_, ctIndex2_, ctIndex3_}] /; NumericQ[colourfactor1]] && NumericQ[colourfactor2]] := ?; *) ExtractColourFactor[args___] := diff --git a/meta/ColorMath.m b/meta/ColorMath.m index f828b2f8c3..2afdaaff7e 100644 --- a/meta/ColorMath.m +++ b/meta/ColorMath.m @@ -22,6 +22,8 @@ CMDelta::usage = ""; CMo::usage = ""; CMd::usage = ""; +ContainsO::usage = ""; +SortIndices::usage = ""; Begin["Private`"]; Unprotect[Conjugate]; @@ -135,9 +137,9 @@ all gluon indices (external and dummy) in the expression Expr." CMf[G1$_, G2$_, G3$_] := Superscript[CMf, {G1$, G2$, G3$}] -d[G1$_, G2$_, G3$_] := Superscript[CMd, {G1$, G2$, G3$}] +CMd[G1$_, G2$_, G3$_] := Superscript[CMd, {G1$, G2$, G3$}] -o[Gs$_] := Superscript[CMo, Gs$] +CMo[Gs$_] := Superscript[CMo, Gs$] AllPairs[CMExpr$_] := Select[FindSymbols[CMExpr$], Count[FindSymbols[CMExpr$], #1] == 2 & ] diff --git a/meta/Constraint.m b/meta/Constraint.m index 7b51eb1a6f..8ba6595e5e 100644 --- a/meta/Constraint.m +++ b/meta/Constraint.m @@ -129,6 +129,8 @@ type = CConversion`CreateCType[CConversion`MatrixType[CConversion`realScalarCType, dim, 1]]; stype = CConversion`CreateCType[CConversion`ScalarType[CConversion`realScalarCType]]; "auto " <> functionName <> " = [&](const "<> type <> "& x) { +" <> TextFormatting`IndentText[CreateTemporaryForceOutputRAII[modelPrefix]] <> " + " <> TextFormatting`IndentText[SetModelParametersFromVector[modelPrefix,"x",parameters]] <> " " <> modelPrefix <> "calculate_DRbar_masses(); " <> TextFormatting`IndentText[Parameters`CreateLocalConstRefs[function]] <> " @@ -150,18 +152,36 @@ functionWrapper = CreateMinimizationFunctionWrapper[functionName,dim,parameters, Parameters`DecreaseIndexLiterals[function], modelPrefix]; - callMinimizer = functionWrapper <> "\n" <> startPoint <> - "Minimizer<" <> dimStr <> - "> minimizer(" <> functionName <> ", 100, 1.0e-2);\n" <> - "const int status = minimizer.minimize(start_point);\n" <> - "VERBOSE_MSG(\"\\tminimizer status: \" << gsl_strerror(status));\n"; - "\n{" <> TextFormatting`IndentText[callMinimizer] <> "}\n" + callMinimizer = functionWrapper <> " +const char* par_str = \"" <> ToString[CConversion`ToValidCSymbol /@ parameters] <> "\"; +MODEL->get_problems().unflag_no_minimum(par_str); + +" <> startPoint <> +"Minimizer<" <> dimStr <> "> minimizer(" <> functionName <> ", 100, " <> modelPrefix <> "get_precision()); + +const int status = minimizer.minimize(start_point); + +VERBOSE_MSG(\"\\tminimizer status: \" << gsl_strerror(status)); + +if (status != GSL_SUCCESS) { + MODEL->get_problems().flag_no_minimum(par_str, status); +} +"; + "\n{\n" <> TextFormatting`IndentText[callMinimizer] <> "}\n\n" ]; +CreateTemporaryForceOutputRAII[modelPrefix_String] := "\ +// temporarily enforce calculation of pole masses +const bool force_output = " <> modelPrefix <> "do_force_output(); +const auto tmp_force_output = make_raii_guard([&] { " <> modelPrefix <> "do_force_output(force_output); }); +" <> modelPrefix <> "do_force_output(true);"; + CreateRootFinderFunctionWrapper[functionName_String, dim_Integer, parameters_List, function_List, modelPrefix_String] := Module[{type}, type = CConversion`CreateCType[CConversion`MatrixType[CConversion`realScalarCType, dim, 1]]; "auto " <> functionName <> " = [&](const "<> type <> "& x) { +" <> TextFormatting`IndentText[CreateTemporaryForceOutputRAII[modelPrefix]] <> " + " <> TextFormatting`IndentText[SetModelParametersFromVector[modelPrefix,"x",parameters]] <> " " <> modelPrefix <> "calculate_DRbar_masses(); " <> TextFormatting`IndentText[Parameters`CreateLocalConstRefs[function]] <> " @@ -181,11 +201,20 @@ functionWrapper = CreateRootFinderFunctionWrapper[functionName,dim,parameters, Parameters`DecreaseIndexLiterals[function], modelPrefix]; - callRootFinder = functionWrapper <> "\n" <> startPoint <> - "Root_finder<" <> dimStr <> - "> root_finder(" <> functionName <> ", 100, 1.0e-2);\n" <> - "const int status = root_finder.find_root(start_point);\n" <> - "VERBOSE_MSG(\"\\troot finder status: \" << gsl_strerror(status));\n"; + callRootFinder = functionWrapper <> " +const char* par_str = \"" <> ToString[CConversion`ToValidCSymbol /@ parameters] <> "\"; +MODEL->get_problems().unflag_no_root(par_str); + +" <> startPoint <> +"Root_finder<" <> dimStr <> "> root_finder(" <> functionName <> ", 100, " <> modelPrefix <> "get_precision()); +const int status = root_finder.find_root(start_point); + +VERBOSE_MSG(\"\\troot finder status: \" << gsl_strerror(status)); + +if (status != GSL_SUCCESS) { + MODEL->get_problems().flag_no_root(par_str, status); +} +"; "\n{\n" <> TextFormatting`IndentText[callRootFinder] <> "}\n\n" ]; @@ -396,10 +425,13 @@ If[isInitial, modelPars = Parameters`FSModelParameters /. Parameters`FindAllParametersClassified[value]; If[Intersection[modelPars, Parameters`GetModelParameters[]] =!= {}, - Print["Warning: In constraint ", constraintName, ": ", InputForm[patt]]; - Print[" ", modelPars, " on the r.h.s. are model parameters, which may initially be zero!"]; - ]; - ]; + Utils`FSFancyWarning[ + "In constraint ", constraintName, ": ", InputForm[patt], + " ", ToString@modelPars, + " on the r.h.s. are model parameters, which may initially be zero!" + ]; + ]; + ]; True ]; @@ -436,12 +468,12 @@ For[y = 1, y <= Length[yukawas], y++, If[(ValueQ /@ yukawas)[[y]] && FreeQ[setParameters, yukawas[[y]]], - Print["Warning: Yukawa coupling ", yukawas[[y]], - " not set", - If[constraintName != "", " in the " <> constraintName, ""], - "."]; - ]; - ]; + Utils`FSFancyWarning[ + "Yukawa coupling ", yukawas[[y]], + " not set"<> If[constraintName != ""," in the " <> constraintName, ""] + ]; + ]; + ]; ]; CalculateScale[Null, _] := ""; diff --git a/meta/Decays.m b/meta/Decays.m index 40be6b5210..7f846f9da5 100644 --- a/meta/Decays.m +++ b/meta/Decays.m @@ -37,7 +37,6 @@ GetDecaysForParticle::usage = "Creates 'objects' FSParticleDecay"; GetVerticesForDecays::usage="gets required vertices for a list of decays"; -CreateSMParticleAliases::usage="creates aliases for SM particles present in model."; CreateBSMParticleAliasList::usage=""; CallDecaysCalculationFunctions::usage="creates calls to functions calculating @@ -195,42 +194,23 @@ GenericFermionName[] := "fermion"; GenericGhostName[] := "ghost"; -SimplifiedName[Susyno`LieGroups`conj[particle_]] := - Susyno`LieGroups`conj[SimplifiedName[particle]]; -SimplifiedName[SARAH`bar[particle_]] := - SARAH`bar[SimplifiedName[particle]]; - -SimplifiedName[particle_?TreeMasses`IsSMLepton] := "lep"; -SimplifiedName[particle_?TreeMasses`IsSMDownQuark] := "dq"; -SimplifiedName[particle_?TreeMasses`IsSMUpQuark] := "uq"; +SimplifiedName[particle_ /; TreeMasses`IsSMLepton[particle] && Head[particle] =!= SARAH`bar] := "l"; +SimplifiedName[particle_ /; TreeMasses`IsSMLepton[particle] && Head[particle] === SARAH`bar] := "lbar"; +SimplifiedName[particle_ /; TreeMasses`IsSMDownQuark[particle] && Head[particle] =!= SARAH`bar] := "d"; +SimplifiedName[particle_ /; TreeMasses`IsSMDownQuark[particle] && Head[particle] === SARAH`bar] := "dbar"; +SimplifiedName[particle_ /; TreeMasses`IsSMUpQuark[particle] && Head[particle] =!= SARAH`bar] := "u"; +SimplifiedName[particle_ /; TreeMasses`IsSMUpQuark[particle] && Head[particle] === SARAH`bar] := "ubar"; SimplifiedName[particle_ /; TreeMasses`GetHiggsBoson[] =!= Null && particle === TreeMasses`GetHiggsBoson[]] := "H"; -SimplifiedName[particle_ /; TreeMasses`GetPseudoscalarHiggsBoson[] =!= Null && particle === TreeMasses`GetPseudoscalarHiggsBoson[]] := "AH"; -SimplifiedName[particle_ /; TreeMasses`GetWBoson[] =!= Null && particle === TreeMasses`GetWBoson[]] := "W"; +SimplifiedName[particle_ /; TreeMasses`GetPseudoscalarHiggsBoson[] =!= Null && particle === TreeMasses`GetPseudoscalarHiggsBoson[]] := "Ah"; +SimplifiedName[particle_ /; TreeMasses`GetWBoson[] =!= Null && particle === If[GetElectricCharge[TreeMasses`GetWBoson[]] < 0, TreeMasses`GetWBoson[], Susyno`LieGroups`conj[TreeMasses`GetWBoson[]]]] := "Wm"; +SimplifiedName[particle_ /; TreeMasses`GetWBoson[] =!= Null && particle === If[GetElectricCharge[TreeMasses`GetWBoson[]] < 0, Susyno`LieGroups`conj[TreeMasses`GetWBoson[]], TreeMasses`GetWBoson[]]] := "Wp"; SimplifiedName[particle_ /; TreeMasses`GetZBoson[] =!= Null && particle === TreeMasses`GetZBoson[]] := "Z"; SimplifiedName[particle_ /; TreeMasses`GetPhoton[] =!= Null && particle === TreeMasses`GetPhoton[]] := "A"; -SimplifiedName[particle_ /; TreeMasses`GetGluon[] =!= Null && particle === TreeMasses`GetGluon[]] := "G"; +SimplifiedName[particle_ /; TreeMasses`GetGluon[] =!= Null && particle === TreeMasses`GetGluon[]] := "g"; +SimplifiedName[particle_ /; TreeMasses`GetChargedHiggsBoson[] =!= Null && particle === If[GetElectricCharge[TreeMasses`GetChargedHiggsBoson[]] < 0, TreeMasses`GetChargedHiggsBoson[], Susyno`LieGroups`conj[TreeMasses`GetChargedHiggsBoson[]]]] := "Hm"; +SimplifiedName[particle_ /; TreeMasses`GetChargedHiggsBoson[] =!= Null && particle === If[GetElectricCharge[TreeMasses`GetChargedHiggsBoson[]] < 0, Susyno`LieGroups`conj[TreeMasses`GetChargedHiggsBoson[]], TreeMasses`GetChargedHiggsBoson[]]] := "Hp"; SimplifiedName[particle_] := particle; -CreateParticleAlias[particle_, namespace_String] := - "using " <> SimplifiedName[particle] <> " = " <> - CXXDiagrams`CXXNameOfField[particle, prefixNamespace -> namespace] <> ";"; - -CreateParticleAliases[particles_, namespace_:""] := - Utils`StringJoinWithSeparator[CreateParticleAlias[#, namespace]& /@ particles, "\n"]; - -CreateSMParticleAliases[namespace_:""] := - Module[{smParticlesToAlias}, - smParticlesToAlias = Select[{TreeMasses`GetHiggsBoson[], - TreeMasses`GetPseudoscalarHiggsBoson[], - TreeMasses`GetWBoson[], TreeMasses`GetZBoson[], - TreeMasses`GetGluon[], TreeMasses`GetPhoton[], - TreeMasses`GetDownLepton[1] /. field_[generation_] :> field, - TreeMasses`GetUpQuark[1] /. field_[generation_] :> field, - TreeMasses`GetDownQuark[1] /.field_[generation_] :> field - }, (# =!= Null)&]; - CreateParticleAliases[smParticlesToAlias, namespace] - ]; - CreateBSMParticleAliasList[namespace_:""] := Module[{bsmForZdecay, bsmForWdecay}, bsmForZdecay = @@ -252,7 +232,7 @@ ] ]; bsmForWdecay = - Select[Prepend[#, TreeMasses`GetWBoson[]]& /@ + Select[Prepend[#, If[GetElectricCharge[TreeMasses`GetWBoson[]] < 0, Susyno`LieGroups`conj[TreeMasses`GetWBoson[]], TreeMasses`GetWBoson[]]] & /@ DeleteDuplicates@Sort@Tuples[Join[TreeMasses`GetSusyParticles[], SARAH`AntiField /@ TreeMasses`GetSusyParticles[]], 2], IsPossibleNonZeroVertex[#, True]& ]; @@ -260,7 +240,7 @@ Join[ bsmForWdecay, Select[ - Prepend[#, TreeMasses`GetWBoson[]]& /@ + Prepend[#, If[GetElectricCharge[TreeMasses`GetWBoson[]] < 0, Susyno`LieGroups`conj[TreeMasses`GetWBoson[]], TreeMasses`GetWBoson[]]]& /@ DeleteDuplicates@Sort@Tuples[{ Join[TreeMasses`GetSusyParticles[], SARAH`AntiField /@ TreeMasses`GetSusyParticles[]], Join[TreeMasses`GetSMParticles[], SARAH`AntiField /@ TreeMasses`GetSMParticles[]] @@ -273,12 +253,12 @@ Join[bsmForZdecay, bsmForWdecay], "// List of potential Z boson decay products excluding pure SM decays\n" <> "typedef boost::mpl::list<\n" <> - TextFormatting`IndentText@StringJoin@Riffle[ + TextFormatting`IndentText@StringRiffle[ ("boost::mpl::list<" <> CXXDiagrams`CXXNameOfField[#1, prefixNamespace -> namespace] <> ", " <> CXXDiagrams`CXXNameOfField[#2, prefixNamespace -> namespace] <> ">")& @@@ (Drop[#, {1}]& /@ bsmForZdecay), ",\n" ] <> If[Length@bsmForZdecay > 0, "\n", ""] <> "> BSMForZdecay;\n\n" <> "// List of potential W boson decay products excluding pure SM decays\n" <> "typedef boost::mpl::list<\n" <> - TextFormatting`IndentText@StringJoin@Riffle[ + TextFormatting`IndentText@StringRiffle[ ("boost::mpl::list<" <> CXXDiagrams`CXXNameOfField[#1, prefixNamespace -> namespace] <> ", " <> CXXDiagrams`CXXNameOfField[#2, prefixNamespace -> namespace] <> ">")& @@@ (Drop[#, {1}]& /@ bsmForWdecay), ",\n" ] <> If[Length@bsmForWdecay > 0, "\n", ""] <> "> BSMForWdecay;" } @@ -324,23 +304,16 @@ finalStateReps = Sort[TreeMasses`GetColorRepresentation /@ finalState]; Switch[initialStateRep, S, result = ((finalStateReps === {S, S}) || - (finalStateReps === {T, T}) || - (finalStateReps === {-T, -T}) || (finalStateReps === Sort[{-T, T}]) || (finalStateReps === {O, O}));, - T|-T, result = ((finalStateReps === Sort[{T, S}]) || - (finalStateReps === Sort[{-T, S}]) || + T|-T, result = ((finalStateReps === Sort[{initialStateRep, S}]) || (finalStateReps === Sort[{O, T}]) || (finalStateReps === Sort[{O, -T}]));, O, result = ((finalStateReps === Sort[{O, S}]) || - (finalStateReps === {T, T}) || - (finalStateReps === {-T, -T}) || (finalStateReps === Sort[{-T, T}]) - (* uncomment to enable O -> OO decays once - the handling of multiple color structures - is introduced - || (finalStateReps === Sort[{O, O}])*));, - _, result = True; (* unhandled case *) + (* for now we only handle octet decays to symmetric final state *) + || (finalStateReps === {O, O} && SameQ@@finalState));, + _, result = False; (* unhandled case *) ]; ]; result @@ -380,12 +353,12 @@ to fail on unsuported color structure. We generated tree and 1-loop amplitude all at once and then select the lowest order one. For the process we considered so far the amplitudes with - unsuported vertices don't contribitu in the end. *) + unsuported vertices don't contribute in the end. *) vertexTypes = CXXDiagrams`VertexTypeForFields /@ vertices; unsupportedVertices = Complement[vertexTypes, CXXDiagrams`VertexTypes[]]; If[unsupportedVertices =!= {}, MapIndexed[(If[!MemberQ[CXXDiagrams`VertexTypes[], vertexTypes[[First[#2]]]], - Print["Warning: vertex with fields ", #1, " is not currently supported."]; + Utils`FSFancyWarning["vertex with fields " <> ToString[#1] <> " is not currently supported."]; Print[" Diagrams involving this vertex will be discarded."]; ];)&, vertices]; ]; @@ -424,9 +397,13 @@ would violate Ward identity (as at the level of dim 4 is such a coupling, it must be 0. So for those processes we start generating amplitudes from the 1-loop level. *) minLoops = - If[MemberQ[{TreeMasses`GetHiggsBoson[], TreeMasses`GetPseudoscalarHiggsBoson}, initialParticle] && + If[(MemberQ[{TreeMasses`GetHiggsBoson[], TreeMasses`GetPseudoscalarHiggsBoson}, initialParticle] && (Sort@finalParticles === Sort[{TreeMasses`GetPhoton[], TreeMasses`GetPhoton[]}] || - Sort@finalParticles === Sort[{TreeMasses`GetPhoton[], TreeMasses`GetZBoson[]}]), + Sort@finalParticles === Sort[{TreeMasses`GetPhoton[], TreeMasses`GetZBoson[]}])) + || + (* a photon or a gluon always couples diagonally at the tree-level - e.g. no γXY coupling when X =! Y *) + (MemberQ[finalParticles, TreeMasses`GetPhoton[]] && !MemberQ[finalParticles, initialParticle]) || + (MemberQ[finalParticles, TreeMasses`GetGluon[]] && !MemberQ[finalParticles, initialParticle]), 1, 0 ]; @@ -438,8 +415,11 @@ would violate Ward identity (as at the level of dim 4 {#[[1]], With[{toposAndDiags = #[[2]]}, {#[[1]], Select[#[[2]], IsSupportedDiagram]}& /@ toposAndDiags]}& /@ diagrams ]; +(* in the MRSSM this 1-loop decay amplitude for Fu crashes the code + {Fu, bar[Fd], conj[SRdp], {Fu, Chi, conj[Su]}, {bar[Fd], bar[Chi], Sd}, {conj[SRdp], Su, conj[Sd]}} + Temporarily disable 1-loop Fu decay *) GetContributingGraphsForDecay[initialParticle_, finalParticles_List] := - GetContributingGraphsForDecay[initialParticle, finalParticles, 1]; + GetContributingGraphsForDecay[initialParticle, finalParticles, If[initialParticle === First@TreeMasses`GetSMUpQuarks[], 0, 1]]; (* defines a fixed ordering for final state particles *) (* @todo decide on what this ordering actually will be *) @@ -460,7 +440,11 @@ would violate Ward identity (as at the level of dim 4 ]; If[TreeMasses`IsVector[orderedFinalState[[1]]] && TreeMasses`IsVector[orderedFinalState[[2]]], If[Head[orderedFinalState[[2]]] === Susyno`LieGroups`conj && !Head[orderedFinalState[[1]]] === Susyno`LieGroups`conj, + If[ + {If[GetElectricCharge[TreeMasses`GetWBoson[]] < 0, Susyno`LieGroups`conj[TreeMasses`GetWBoson[]], TreeMasses`GetWBoson[]], + Susyno`LieGroups`conj[If[GetElectricCharge[TreeMasses`GetWBoson[]] < 0, Susyno`LieGroups`conj[TreeMasses`GetWBoson[]], TreeMasses`GetWBoson[]]]} =!= orderedFinalState, orderedFinalState = Reverse[orderedFinalState]; + ] ]; ]; ]; @@ -584,21 +568,21 @@ would violate Ward identity (as at the level of dim 4 concreteFinalStates = Join @@ (GetParticleCombinationsOfType[#, allowedFinalStateParticles, isPossibleDecay]& /@ genericFinalStates); concreteFinalStates = OrderFinalState[particle, #] & /@ concreteFinalStates; - Print[""]; - Print["Creating amplitudes for ", particle, " decays..."]; - (*ParallelEvaluate[Get["/home/wojciech/HEP-software/mathematica/SARAH-4.14.3/SARAH.m"]] - ParallelEvaluate[Start["MSSM"]];*) + If[!FlexibleSUSY`FSEnableParallelism, + Print[""]; + Print["Creating amplitudes for ", particle, " decays..."]; + ]; decays = Map[ ( - (* @todo StringPadRigh was introduced only in 10.1 *) - WriteString["stdout", StringPadRight[" - Creating amplitude for " <> ToString@particle <> " -> " <> ToString@#, 64, "."]]; + If[!FlexibleSUSY`FSEnableParallelism, + WriteString["stdout", StringPadRight[" - Creating amplitude for " <> ToString@particle <> " -> " <> ToString@#, 64, "."]]; + ]; temp = FSParticleDecay[particle, #, GetContributingGraphsForDecay[particle, #]]; - Print[" Done."]; + If[!FlexibleSUSY`FSEnableParallelism, Print[" Done."]]; temp )&, - concreteFinalStates(*, - DistributedContexts -> All*) + concreteFinalStates ]; decays = Select[decays, GetDecayTopologiesAndDiagrams[#] =!= {}&]; @@ -751,7 +735,7 @@ would violate Ward identity (as at the level of dim 4 StringJoin[If[# > 1, ", int", ""]& /@ finalStateDims]; functionName = CreatePartialWidthCalculationName[decay]; returnType = CConversion`CreateCType[CConversion`ScalarType[CConversion`realScalarCType]]; - returnType <> " " <> functionName <> "(" <> functionArgs <> ") const;" + returnType <> " " <> functionName <> "(" <> functionArgs <> ");" ]; CreatePartialWidthCalculationFunction[decay_FSParticleDecay, fieldsNamespace_] := @@ -773,7 +757,7 @@ would violate Ward identity (as at the level of dim 4 If[numIndices == 0 || dim <= 1, result = result <> " {};\n";, result = result <> " {{" <> ToString[indexVal] <> - StringJoin[Table[", 0", {i, 1, numIndices - 1}]] <> "}};\n"; + StringJoin[ConstantArray[", 0", numIndices - 1]] <> "}};\n"; ]; result ]; @@ -784,7 +768,7 @@ would violate Ward identity (as at the level of dim 4 If[finalStateDims[[First[#2]]] > 1, "gO" <> ToString[First[#2]], ""]}&, finalState]]]; body = body <> "\nreturn " <> CreateSpecializedPartialWidthCalculationName[initialState, finalState] <> "(context, in_indices" <> StringJoin[Table[", out_" <> ToString[i] <> "_indices", {i, 1, Length[finalState]}]] <> ");\n"; - returnType <> " " <> functionName <> "(" <> functionArgs <> ") const\n{\n" <> + returnType <> " " <> functionName <> "(" <> functionArgs <> ")\n{\n" <> TextFormatting`IndentText[body] <> "}\n" ]; @@ -833,8 +817,8 @@ would violate Ward identity (as at the level of dim 4 CheckOffShellDecay[x_, y_] := ( initialState === x && ( - finalState === {y, SARAH`AntiField[y]} || - finalState === {SARAH`AntiField[y], y} + finalState === {y, TreeMasses`FSAntiField[y]} || + finalState === {TreeMasses`FSAntiField[y], y} )); (* skip decays of a particle into itself *) @@ -846,10 +830,10 @@ would violate Ward identity (as at the level of dim 4 ]]&, finalState ] <> If[ - CheckOffShellDecay[TreeMasses`GetHiggsBoson[], TreeMasses`GetWBoson[]] || CheckOffShellDecay[TreeMasses`GetHiggsBoson[], TreeMasses`GetZBoson[]], "", + CheckOffShellDecay[TreeMasses`GetHiggsBoson[], TreeMasses`GetWBoson[]] || CheckOffShellDecay[TreeMasses`GetHiggsBoson[], TreeMasses`GetZBoson[]] || CheckOffShellDecay[TreeMasses`GetHiggsBoson[], First@TreeMasses`GetSMUpQuarks[]] || CheckOffShellDecay[TreeMasses`GetPseudoscalarHiggsBoson[], First@TreeMasses`GetSMUpQuarks[]], "", "if (context.physical_mass<" <> CXXNameOfField[initialState] <> ">(std::array If[initialStateDim > 1, "1", "0"] <> ">{" <> If[initialStateDim > 1, "gI1", ""] <> "}) < " <> - StringJoin @ Riffle[ + StringRiffle[ MapIndexed[ With[{idx = First[#2]}, "context.physical_mass<" <> CXXNameOfField[#1] <> ">(" <> @@ -863,7 +847,7 @@ would violate Ward identity (as at the level of dim 4 body = "decays.set_decay(" <> CreatePartialWidthCalculationName[decay] <> "(" <> functionArgs <> "), " <> pdgsList <> ", create_process_string<" <> CXXNameOfField[initialState] <> ", " <> StringRiffle[CXXNameOfField/@finalState, ", "] <> ">(" <> If[initialStateDim > 1, "{gI1}", "{}"] <> "," <> - StringJoin @ Riffle[ + StringRiffle[ MapIndexed[ With[{idx = First[#2]}, If[finalStateDims[[idx]] > 1, "{gO" <> ToString[idx] <> "}", "{}"] @@ -889,7 +873,7 @@ would violate Ward identity (as at the level of dim 4 "\nif (context.physical_mass<" <> CXXNameOfField[initialState] <> ">(std::array If[initialStateDim > 1, "1", "0"] <> ">{" <> If[initialStateDim > 1, "gI1", ""] <> "}) > " <> - StringJoin @ Riffle[ + StringRiffle[ MapIndexed[ With[{idx = First[#2]}, "context.physical_mass<" <> CXXNameOfField[#1] <> ">(" <> @@ -927,11 +911,10 @@ would violate Ward identity (as at the level of dim 4 runToScale = "auto decay_mass = PHYSICAL(" <> - CConversion`ToValidCSymbolString[TreeMasses`GetMass[particle]] <> ");\n" <> + CConversion`ToValidCSymbolString[TreeMasses`GetMass[particle /. SARAH`bar|Susyno`LieGroups`conj->Identity]] <> ");\n" <> "if (decay_mass" <> If[particleDim > 1, "(gI1)", ""] <> " > qedqcd.displayPoleMZ()) {\n" <> TextFormatting`IndentText[ - "model.run_to(decay_mass" <> If[particleDim > 1, "(gI1)", ""] <> ");\n" <> - "model.solve_ewsb();\n" + "model.run_to(decay_mass" <> If[particleDim > 1, "(gI1)", ""] <> ");\n" ] <> "}\n"; body = StringJoin[CallPartialWidthCalculation /@ decayChannels]; @@ -945,6 +928,14 @@ would violate Ward identity (as at the level of dim 4 "case 1: {\n" <> TextFormatting`IndentText[ "auto dm = std::make_unique<" <> FlexibleSUSY`FSModelName <> "_mass_eigenstates_decoupling_scheme>(model.get_input());\n" <> + If[ + MemberQ[ + DeleteCases[{TreeMasses`GetHiggsBoson[], TreeMasses`GetPseudoscalarHiggsBoson[], TreeMasses`GetChargedHiggsBoson[] /. Susyno`LieGroups`conj->Identity}, Null], + particle /. Susyno`LieGroups`conj->Identity + ], + "dm->set_use_pole_higgs_mixings(flexibledecay_settings.get(FlexibleDecay_settings::use_pole_higgs_mixings) != 0.0 ? true : false);\n", + "" + ] <> "// fill_from BSM model has to be called before fill_from SM\n" <> "// both calls are required\n" <> "dm->fill_from(model);\n" <> @@ -956,7 +947,7 @@ would violate Ward identity (as at the level of dim 4 "if (run_to_decay_particle_scale) {\n" <> TextFormatting`IndentText[ "auto decay_mass = PHYSICAL(" <> - CConversion`ToValidCSymbolString[TreeMasses`GetMass[particle]] <> ");\n" <> + CConversion`ToValidCSymbolString[TreeMasses`GetMass[particle /. SARAH`bar|Susyno`LieGroups`conj->Identity]] <> ");\n" <> "if (decay_mass" <> If[particleDim > 1, "(gI1)", ""] <> " > qedqcd.displayPoleMZ()) {\n" <> TextFormatting`IndentText[ "sm.run_to(decay_mass" <> If[particleDim > 1, "(gI1)", ""] <> ");\n" @@ -970,12 +961,18 @@ would violate Ward identity (as at the level of dim 4 "break;\n" ] <> "}\n" <> - "case 2:\n" <> + "case 2: {\n" <> TextFormatting`IndentText[ + "model.solve_ewsb_tree_level();\n" <> + "model.calculate_DRbar_masses();\n" <> + "// decoupling scheme automatically reorders Goldstones to first\n" <> + "// positions in tree-level mass and mixing matrices. The\n" <> + "// non-decoupled model does not.\n" <> + "model.reorder_DRbar_masses();\n" <> "return std::make_unique<" <> FlexibleSUSY`FSModelName <> "_mass_eigenstates>(model);\n" <> "break;\n" ] <> - "default:\n" <> + "}\ndefault:\n" <> TextFormatting`IndentText[ "throw SetupError(\"flag value is not supported\");\n" ] @@ -986,14 +983,31 @@ would violate Ward identity (as at the level of dim 4 "context_base context {dec_model.get()};\n" <> body; - body = "\nif (run_to_decay_particle_scale) {\n" <> - TextFormatting`IndentText[runToScale] <> "}\n\n" <> body; + body = IndentText["\nif (run_to_decay_particle_scale) {\n" <> + TextFormatting`IndentText[runToScale] <> "}\n\n" <> body ]<> + If[MemberQ[Join[{TreeMasses`GetHiggsBoson[], TreeMasses`GetPseudoscalarHiggsBoson[]}], particle], + TextFormatting`IndentText["if (flexibledecay_settings.get(FlexibleDecay_settings::call_higgstools) || flexibledecay_settings.get(FlexibleDecay_settings::call_lilith) || flexibledecay_settings.get(FlexibleDecay_settings::calculate_normalized_effc)) {\n" <> + TextFormatting`IndentText[ + "auto found = std::find_if(std::begin(neutral_higgs_effc), std::end(neutral_higgs_effc), [" <> If[particleDim > 1, "&gI1", ""] <> "](NeutralHiggsEffectiveCouplings const& effC) {return effC.particle == field_as_string<" <> ToString@particle <> ">({" <> + If[particleDim > 1, "gI1", ""] <> "});});\n" <> + "found->width = decays.get_total_width();\n" <> + "found->mass = context.physical_mass<" <> ToString@particle <> ">({" <> If[particleDim > 1, "gI1", ""] <> "});\n" <> + "found->calculate_undetected_br(found->mass/2 > context.physical_mass<" <> ToString@TreeMasses`GetSMTopQuarkMultiplet[] <> ">({2}));\n" <> + (* 1 == even, -1 == odd, 0 == undefined - see test/test_HiggsTools_CP.cpp *) + "found->CP = " <> ToString@If[MemberQ[SA`ScalarsCPeven, particle], If[MemberQ[SA`ScalarsCPodd, particle], 0, 1], -1] <> ";\n" <> + "found->pdgid = boost::hana::unpack(" <> ToString@particle <> "::pdgids, _to_array<" <> ToString@particle <> "::numberOfGenerations>).at(" <> If[particleDim > 1, "gI1", "0"] <> ");\n"] <> + "const auto _indices = concatenate(" <> StringRiffle[Table["typename cxx_diagrams::field_indices<" <> ToString@particle <> ">::type {" <> If[particleDim > 1, "gI1", ""] <> "}", {i, 4}], ", "] <> ");\n" <> + "const auto h4vertex = Vertex<" <> StringRiffle[Table[ToString@particle, {i, 4}], ", "] <> ">::evaluate(_indices, context);\n" <> + "found->lam = std::real(h4vertex.value());\n" <> + "}\n"], + "" + ]; If[particleDim > 1, body = LoopOverIndexCollection[body, {{"gI1", Utils`MathIndexToCPP@particleStart, particleDim}}] <> "\n"; ]; "void " <> CreateDecaysCalculationFunctionName[particle, "CLASSNAME"] <> "()\n{\n" - <> TextFormatting`IndentText[body] <> "\n}\n" + <> body <> "\n}\n" ]; CreateDecaysCalculationFunctions[particleDecays_List] := @@ -1027,7 +1041,7 @@ would violate Ward identity (as at the level of dim 4 ChiralVertex, "Decay_amplitude_SFF", MomentumDifferenceVertex, "Decay_amplitude_SSV", InverseMetricVertex, "Decay_amplitude_SVV", - _, Print["Warning: decay ", initialParticle, " -> ", finalState, " is not supported."]; + _, Utils`FSFancyWarning["decay " <> ToString[initialParticle] <> " -> " <> ToString[finalState] <> " is not supported."]; "Unknown_amplitude_type" ] ]; @@ -1038,7 +1052,7 @@ would violate Ward identity (as at the level of dim 4 Switch[{vertexType, GetFeynArtsTypeName@Last@finalState}, {ChiralVertex, S}, "Decay_amplitude_FFS", {ChiralVertex, V}, "Decay_amplitude_FFV", - _, Print["Warning: decay ", initialParticle, " -> ", finalState, " is not supported."]; + _, Utils`FSFancyWarning["decay " <> ToString[initialParticle] <> " -> " <> ToString[finalState] <> " is not supported."]; "Unknown_amplitude_type" ] ]; @@ -1047,7 +1061,7 @@ would violate Ward identity (as at the level of dim 4 GetDecayAmplitudeType[GetInitialState[decay], GetFinalState[decay]]; CreateFieldIndices[particle_String] := - "typename " <> FlexibleSUSY`FSModelName <> "_cxx_diagrams::field_indices<" <> particle <> " >::type"; + "typename cxx_diagrams::field_indices<" <> particle <> ">::type"; CreateFieldIndices[particle_, fieldsNamespace_] := CreateFieldIndices[CXXDiagrams`CXXNameOfField[particle, prefixNamespace -> fieldsNamespace]]; @@ -1115,18 +1129,28 @@ would violate Ward identity (as at the level of dim 4 assignments ]; -(* replace 'physical_mass' with 'mass' to check Ward identity *) +(* For tests: replace 'physical_mass' with 'mass' to check Ward identity *) FillSVVDecayAmplitudeMasses[decay_FSParticleDecay, modelName_, structName_, paramsStruct_] := Module[{assignments = ""}, assignments = assignments <> structName <> ".m_decay = " <> paramsStruct <> ".physical_mass<" <> CXXDiagrams`CXXNameOfField[GetInitialState[decay]] <> ">(idx_1);\n"; - assignments = assignments <> structName <> ".m_vector_1 = " <> paramsStruct <> ".physical_mass<" <> - CXXDiagrams`CXXNameOfField[First[GetFinalState[decay]]] <> - ">(idx_2);\n"; - assignments = assignments <> structName <> ".m_vector_2 = " <> paramsStruct <> ".physical_mass<" <> - CXXDiagrams`CXXNameOfField[Last[GetFinalState[decay]]] <> - ">(idx_3);\n"; + assignments = assignments <> structName <> ".m_vector_1 = " <> + If[IsMassless[First[GetFinalState[decay]]], + "0.", + If[IsZBoson[First[GetFinalState[decay]]], + "qedqcd.displayPoleMZ()", + paramsStruct <> ".physical_mass<" <> CXXDiagrams`CXXNameOfField[First[GetFinalState[decay]]] <> ">(idx_2)" + ] + ] <> ";\n"; + assignments = assignments <> structName <> ".m_vector_2 = " <> + If[IsMassless[Last[GetFinalState[decay]]], + "0.", + If[IsZBoson[Last[GetFinalState[decay]]], + "qedqcd.displayPoleMZ()", + paramsStruct <> ".physical_mass<" <> CXXDiagrams`CXXNameOfField[Last[GetFinalState[decay]]] <> ">(idx_3)" + ] + ] <> ";\n"; assignments ]; @@ -1189,40 +1213,6 @@ would violate Ward identity (as at the level of dim 4 _, "" ]; -ZeroDecayAmplitudeFormFactors[decay_FSParticleDecay /; GetDecayAmplitudeType[decay] == "Decay_amplitude_SSS", - structName_] := - structName <> ".form_factor = std::complex(0., 0.);\n"; - -ZeroDecayAmplitudeFormFactors[decay_FSParticleDecay /; GetDecayAmplitudeType[decay] == "Decay_amplitude_SSV", - structName_] := - structName <> ".form_factor = std::complex(0., 0.);\n"; - -ZeroDecayAmplitudeFormFactors[decay_FSParticleDecay /; GetDecayAmplitudeType[decay] == "Decay_amplitude_SVV", - structName_] := - structName <> ".form_factor_g = std::complex(0., 0.);\n" <> - structName <> ".form_factor_11 = std::complex(0., 0.);\n" <> - structName <> ".form_factor_12 = std::complex(0., 0.);\n" <> - structName <> ".form_factor_21 = std::complex(0., 0.);\n" <> - structName <> ".form_factor_22 = std::complex(0., 0.);\n" <> - structName <> ".form_factor_eps = std::complex(0., 0.);\n"; - -ZeroDecayAmplitudeFormFactors[decay_FSParticleDecay /; GetDecayAmplitudeType[decay] == "Decay_amplitude_SFF", - structName_] := - structName <> ".form_factor_left = std::complex(0., 0.);\n" <> - structName <> ".form_factor_right = std::complex(0., 0.);\n"; - -ZeroDecayAmplitudeFormFactors[decay_FSParticleDecay /; GetDecayAmplitudeType[decay] == "Decay_amplitude_FFS", - structName_] := - structName <> ".form_factor_left = std::complex(0., 0.);\n" <> - structName <> ".form_factor_right = std::complex(0., 0.);\n"; - -ZeroDecayAmplitudeFormFactors[decay_FSParticleDecay /; GetDecayAmplitudeType[decay] == "Decay_amplitude_FFV", - structName_] := - structName <> ".form_factor_gam_left = std::complex(0., 0.);\n" <> - structName <> ".form_factor_gam_right = std::complex(0., 0.);\n" <> - structName <> ".form_factor_p_1 = std::complex(0., 0.);\n" <> - structName <> ".form_factor_p_2 = std::complex(0., 0.);\n"; - GetTreeLevelTwoBodyDecayVertex[decay_FSParticleDecay] := Module[{treeLevelDiags, vertices = {}}, treeLevelDiags = GetDecayDiagramsOnlyAtLoopOrder[decay, 0]; @@ -1499,8 +1489,8 @@ would violate Ward identity (as at the level of dim 4 + g[lt1, lt3] (Mom[i1_] - Mom[i3_]) + g[lt2, lt3] (-Mom[i2_] + Mom[i3_]) :> ( Switch[Signature[{i1, i2, i3}], - 1, "value(TripleVectorVertex::odd_permutation {})", - -1, "value(TripleVectorVertex::even_permutation {})", + 1, "value(cxx_diagrams::TripleVectorVertex::odd_permutation {})", + -1, "value(cxx_diagrams::TripleVectorVertex::even_permutation {})", _, (Print["Can't find TripleVectorVertex permutation"]; Quit[1]) ] @@ -1561,7 +1551,7 @@ would violate Ward identity (as at the level of dim 4 @todo: There is an ambiguity whether Field[n] -> somefield or Field[n] -> AntiField[somefield] *) GetFieldsAssociations[concreteFieldOnEdgeBetweenVertices_, fieldNumberOnEdgeBetweenVertices_, fieldTypes_, diagram_, verticesInFieldTypesForFACp_] := - Module[{temp = {}, concreteFieldOnEdgeBetweenVerticesLocal, verticesForFACp, temp2}, + Module[{temp = {}, concreteFieldOnEdgeBetweenVerticesLocal}, concreteFieldOnEdgeBetweenVerticesLocal = concreteFieldOnEdgeBetweenVertices; temp = SortBy[Reverse /@ fieldNumberOnEdgeBetweenVertices, Last]; @@ -1631,7 +1621,7 @@ would violate Ward identity (as at the level of dim 4 externalEdges, matchExternalFieldIndicesCode, matchInternalFieldIndicesCode = "", functionBody = "", verticesInFieldTypesForFACp, verticesForFACp, colorFac = "colorFac", symmetryFac = "symmetryFac", FinitePart = False, - whereToConj, verticesForFACp2, + verticesForFACp2, (* colour triplet fermions *) quarkLike = Select[GetColoredParticles[], IsFermion[#] && (GetColorRepresentation[#] == T || GetColorRepresentation[#] == -T) &] }, @@ -1700,7 +1690,7 @@ would violate Ward identity (as at the level of dim 4 verticesForFACp2 = If[Length[#] == 2, List@@Last@#, List@@#]& /@ verticesForFACp2; cppVertices = "using vertex" <> ToString@#1 <> " = Vertex<" <> - (StringJoin@Riffle[CXXDiagrams`CXXNameOfField /@ #2 ,", "] <> ">;\n")& @@@ Transpose[{indices, verticesForFACp2}]; + (StringRiffle[CXXDiagrams`CXXNameOfField /@ #2 ,", "] <> ">;\n")& @@@ Transpose[{indices, verticesForFACp2}]; (* List of {integer, integer} -> Field[integer] *) externalEdges = @@ -1802,7 +1792,7 @@ would violate Ward identity (as at the level of dim 4 "vertex" <> # <> "::evaluate(index" <> # <> ", context);\n" )& /@ indices] <> - "\nif (" <> StringJoin@Riffle[("!vertex" <> # <> "Val.isZero()")& /@ indices, " && "] <> ") {\n" <> + "\nif (" <> StringRiffle[("!vertex" <> # <> "Val.isZero()")& /@ indices, " && "] <> ") {\n" <> TextFormatting`IndentText[ "// internal masses\n" <> mass <> "\n" <> @@ -1814,10 +1804,10 @@ would violate Ward identity (as at the level of dim 4 (* the quark loop amplitude *) Length[fieldsInLoop] === 1 && ContainsAll[quarkLike, fieldsInLoop], "auto temp_result = " <> ampCall <> ";\n" <> - "if (static_cast(flexibledecay_settings.get(FlexibleDecay_settings::include_higher_order_corrections)) > 0 &&\n" <> + "if (flexibledecay_settings.get_decay_corrections().sm > 0 &&\n" <> TextFormatting`IndentText[ - Module[{pos1, post2, res}, - StringJoin@Riffle[ + Module[{pos1, pos2}, + StringRiffle[ MapIndexed[ (pos1 = Position[#1, First@fieldsInLoop, 1]; pos2 = Position[#1, SARAH`bar[First@fieldsInLoop], 1]; @@ -1839,10 +1829,10 @@ would violate Ward identity (as at the level of dim 4 "result += temp_result;\n", (* colored scalar loop *) If[!SA`CPViolationHiggsSector && Length[fieldsInLoop] === 1 && And@@Join[TreeMasses`IsScalar /@ fieldsInLoop, TreeMasses`ColorChargedQ /@ fieldsInLoop], - "\nif (static_cast(flexibledecay_settings.get(FlexibleDecay_settings::include_higher_order_corrections)) > 0 &&\n" <> + "\nif (flexibledecay_settings.get_decay_corrections().bsm > 0 &&\n" <> TextFormatting`IndentText[ - Module[{pos1, post2, res}, - StringJoin@Riffle[ + Module[{pos1, pos2}, + StringRiffle[ MapIndexed[ (pos1 = Position[#1, First@fieldsInLoop, 1]; pos2 = Position[#1, Susyno`LieGroups`conj[First@fieldsInLoop], 1]; @@ -1879,10 +1869,10 @@ would violate Ward identity (as at the level of dim 4 (* the quark loop amplitude *) Length[fieldsInLoop] === 1 && ContainsAll[quarkLike, fieldsInLoop], "auto temp_result = " <> ampCall <> ";\n" <> - "if (static_cast(flexibledecay_settings.get(FlexibleDecay_settings::include_higher_order_corrections)) > 0 &&\n" <> + "if (flexibledecay_settings.get_decay_corrections().sm > 0 &&\n" <> TextFormatting`IndentText[ - Module[{pos1, post2, res}, - StringJoin@Riffle[ + Module[{pos1, pos2}, + StringRiffle[ MapIndexed[ (pos1 = Position[#1, First@fieldsInLoop, 1]; pos2 = Position[#1, SARAH`bar[First@fieldsInLoop], 1]; @@ -1890,7 +1880,10 @@ would violate Ward identity (as at the level of dim 4 "vertexId" <> ToString@First@#2 <> "::template indices_of_field<" <> ToString@Utils`MathIndexToCPP@First@First@pos1 <> ">(indexId" <> ToString@First@#2 <> ") == " <> "vertexId" <> ToString@First@#2 <> "::template indices_of_field<" <> ToString@Utils`MathIndexToCPP@First@First@pos2 <> ">(indexId" <> ToString@First@#2 <> ")" ])&, verticesForFACp]," &&\n"] <> - "\n&& result.m_decay/mInternal1 < 0.8\n" + (* mPhi/mq < 0.8 *) + "\n&& result.m_decay/mInternal1 < 0.8" <> + (* mZ/mPhi < 0.75 *) + " && " <> If[TreeMasses`IsZBoson[diagram[[2]]], "result.m_vector_1", "result.m_vector_2"] <> "/result.m_decay < 0.75\n" ] <> ") {\n" <> (* eq. 2.57 of hep-ph/0503172 *) @@ -1914,7 +1907,7 @@ would violate Ward identity (as at the level of dim 4 (* diagram information *) "\n// topology " <> FeynArtsTopologyName[topology] <> - "\n// internal particles in the diagram: " <> StringJoin[Riffle[ToString@Part[#, 2]& /@Drop[fieldAssociation, 3], ", "]] <> "\n" <> + "\n// internal particles in the diagram: " <> StringRiffle[ToString@Part[#, 2]& /@Drop[fieldAssociation, 3], ", "] <> "\n" <> "{\n" <> TextFormatting`IndentText[ @@ -1922,7 +1915,7 @@ would violate Ward identity (as at the level of dim 4 cppVertices <> (* diagram symmetry factor *) - "\nconstexpr double " <> ToString@symmetryFac <> " {" <> + "\nstatic constexpr double " <> ToString@symmetryFac <> " {" <> ToString @ N[With[{topoName = FeynArtsTopologyName[topology]}, @@ -1936,13 +1929,13 @@ would violate Ward identity (as at the level of dim 4 "};\n" <> (* color factor *) - "\nconstexpr " <> + "\nstatic constexpr " <> With[{cf = CXXDiagrams`ExtractColourFactor @ CXXDiagrams`ColorFactorForDiagram[topology, diagram]}, If[Head[cf] === Complex, (* complex colour factor *) "std::complex " <> ToString@colorFac <> " " <> - ToString[N[#, 16]& /@ FSReIm @ cf], + ToString[N[#, 16]& /@ ReIm @ cf], (* real color factor *) "double " <> ToString@colorFac <> " {" <> @@ -1981,9 +1974,6 @@ that returns a total (sumed over internal insertions) 1-loop amplitude for a giv externalFieldsList, templatePars = "", args = "", body = ""}, - (* @todo StringPadRigh was introduced only in 10.1 *) - (*WriteString["stdout", StringPadRight[" - Creating code for " <> ToString@initialParticle <> " -> " <> ToString@finalState, 64, "."]];*) - (* decay amplitude type, e.g. Decay_amplitude_FSS *) returnType = GetDecayAmplitudeType[decay]; @@ -2008,24 +1998,20 @@ that returns a total (sumed over internal insertions) 1-loop amplitude for a giv body = body <> "\n// external particles' masses\n"; body = body <> FillDecayAmplitudeMasses[decay, modelName, returnVar, paramsStruct]; - (* @todo: it might be less verbose to by default initialize amplitude to 0 *) - body = body <> "\n// set the initial value of an amplitude to 0\n"; - body = body <> ZeroDecayAmplitudeFormFactors[decay, returnVar]; - If[IsPossibleTreeLevelDecay[decay, True], - body = body <> "// @todo correct prefactors\n" <> FillTreeLevelDecayAmplitudeFormFactors[decay, modelName, returnVar, paramsStruct] <> "\n"; + body = body <> "\n// @todo correct prefactors\n" <> FillTreeLevelDecayAmplitudeFormFactors[decay, modelName, returnVar, paramsStruct] <> "\n"; ]; If[!IsPossibleTreeLevelDecay[decay, True] && IsPossibleOneLoopDecay[decay], With[{res = FillOneLoopDecayAmplitudeFormFactors[decay, modelName, returnVar, paramsStruct]}, If[res[[1]], body = body <> "\n// FormCalc's Finite variable\n"; - body = body <>"constexpr double Finite {1.};\n" + body = body <>"static constexpr double Finite {1.};\n" ]; body = body <>"\nconst double ren_scale {result.m_decay};\n"; body = body <> Last@res <> "\n"; ] - ]; + ]; body = body <> "return " <> returnVar <> ";\n"; @@ -2234,18 +2220,24 @@ that returns a total (sumed over internal insertions) 1-loop amplitude for a giv CreateTotalAmplitudeSpecializations[particleDecays_List, modelName_] := Module[{specializations, vertices = {}, listing = {}, - contextsToDistribute = {"SARAH`", "Susyno`LieGroups`", "FlexibleSUSY`", "CConversion`", "Himalaya`"}}, + contextsToDistribute = {"SARAH`", "Susyno`LieGroups`", "FlexibleSUSY`", "CConversion`"}}, Print[""]; FSFancyLine[]; Print["Creating a C++ code for decay amplitudes..."]; If[FlexibleSUSY`FSEnableParallelism, + LaunchKernels[]; ParallelEvaluate[(BeginPackage[#];EndPackage[];)& /@ contextsToDistribute, DistributedContexts->All]; specializations = AbsoluteTiming@ParallelMap[ CreateTotalAmplitudeSpecialization[#, modelName]&, - Flatten[Last @@@ particleDecays, 1], + Flatten[Last /@ particleDecays, 1], DistributedContexts -> All, Method -> "FinestGrained" - ], + ]; + Needs["Parallel`Developer`"]; + Parallel`Developer`ClearDistributedDefinitions[]; + Parallel`Developer`ClearKernels[]; + CloseKernels[] + , specializations = AbsoluteTiming@Map[ ( @@ -2255,10 +2247,10 @@ that returns a total (sumed over internal insertions) 1-loop amplitude for a giv ]; CreateTotalAmplitudeSpecialization[#, modelName] )&, - Flatten[Last @@@ particleDecays, 1] + Flatten[Last /@ particleDecays, 1] ] ]; - Print["The creation of C++ code for decays took ", Round[First@specializations, 0.1], "s"]; + Print["The creation of C++ code for decays took", FSRound[First@specializations, 1], "s"]; specializations = Last@specializations; specializations = Select[specializations, (# =!= {} && # =!= {"", ""})&]; Utils`StringJoinWithSeparator[#, "\n"]& /@ Transpose[specializations] @@ -2274,16 +2266,16 @@ that returns a total (sumed over internal insertions) 1-loop amplitude for a giv "template <>\n" <> "double " <> modelName <> "_decays::" <> CreateSpecializedPartialWidthCalculationName[initialParticle, finalState, fieldsNamespace] <> - "(" <> args <> ") const;" + "(" <> args <> ");" ]; CreateIncludedPartialWidthSpecialization[decay_FSParticleDecay, modelName_] := Module[{initialParticle = GetInitialState[decay], finalState = GetFinalState[decay], declaration = "", includeStatement = ""}, declaration = CreatePartialWidthSpecializationDecl[decay, modelName]; - includeStatement = "#include \"decays/H_SM_decays/decay_" <> + includeStatement = "#include \"decays/specializations/" <> SimplifiedName[initialParticle] <> "/decay_" <> SimplifiedName[initialParticle] <> "_to_" <> - StringJoin[SimplifiedName[# /. SARAH`bar|Susyno`LieGroups`conj -> Identity]& /@ finalState] <> + StringJoin[SimplifiedName[#]& /@ finalState] <> ".inc\""; {declaration, includeStatement} ]; diff --git a/meta/EDM.m b/meta/EDM.m index 94a2a851d4..0605edf82d 100644 --- a/meta/EDM.m +++ b/meta/EDM.m @@ -22,140 +22,17 @@ *) -BeginPackage["EDM`", {"SARAH`", "TextFormatting`", "TreeMasses`", "Vertices`", "CXXDiagrams`"}]; +BeginPackage["EDM`"]; -EDMCreateInterfaceFunctionForField::usage=""; -EDMContributingDiagramsForFieldAndGraph::usage=""; -EDMContributingGraphs::usage=""; +EDMForwardDeclaration::usage = "Create forward declarations for EDM functions"; Begin["`Private`"]; -(* The graphs that contribute to the EDM are precisely those with three - external lines given by the field in question, its Lorentz conjugate - and a photon. - They are given as a List of undirected adjacency matrices where - 1 is the field itself - 2 is its Lorentz conjugate - 3 is the photon - and all other indices unspecified. *) -vertexCorrectionGraph = {{0,0,0,1,0,0}, - {0,0,0,0,1,0}, - {0,0,0,0,0,1}, - {1,0,0,0,1,1}, - {0,1,0,1,0,1}, - {0,0,1,1,1,0}}; -contributingGraphs = {vertexCorrectionGraph}; - -EDMContributingGraphs[] := contributingGraphs - -EDMContributingDiagramsForFieldAndGraph[field_,graph_] := - Module[{diagrams}, - diagrams = CXXDiagrams`FeynmanDiagramsOfType[graph, - {1 -> field, 2 -> CXXDiagrams`LorentzConjugate[field], 3 -> TreeMasses`GetPhoton[]}]; - - Select[diagrams,IsDiagramSupported[field,graph,#] &] - ] - -IsDiagramSupported[field_,vertexCorrectionGraph,diagram_] := - Module[{photonEmitter,exchangeParticle}, - photonEmitter = diagram[[4,3]]; (* Edge between vertices 4 and 6 (3rd edge of vertex 4) *) - exchangeParticle = diagram[[4,2]]; (* Edge between vertices 4 and 5 (2nd edge of vertex 4) *) - - If[diagram[[6]] =!= {TreeMasses`GetPhoton[],CXXDiagrams`LorentzConjugate[photonEmitter],photonEmitter}, - Return[False]]; - If[TreeMasses`IsFermion[photonEmitter] && TreeMasses`IsScalar[exchangeParticle], - Return[True]]; - If[TreeMasses`IsFermion[exchangeParticle] && TreeMasses`IsScalar[photonEmitter], - Return[True]]; - - Return[False]; - ] - -EDMCreateInterfaceFunctionForField[field_,gTaggedDiagrams_List] := - Module[{prototype,definition,numberOfIndices = CXXDiagrams`NumberOfFieldIndices[field]}, - prototype = "double calculate_edm_" <> CXXNameOfField[field] <> - "(" <> If[TreeMasses`GetDimension[field] =!= 1, - " int generationIndex, ", - " "] <> - "const " <> FlexibleSUSY`FSModelName <> "_mass_eigenstates& model );"; - - definition = "double calculate_edm_" <> CXXNameOfField[field] <> - "(" <> If[TreeMasses`GetDimension[field] =!= 1, - " int generationIndex, ", - " "] <> - "const " <> FlexibleSUSY`FSModelName <> "_mass_eigenstates& model )\n" <> - "{\n" <> IndentText[ - "context_base context{ model };\n" <> - "std::array ToString @ numberOfIndices <> "> indices = {" <> - If[TreeMasses`GetDimension[field] =!= 1, - " generationIndex" <> - If[numberOfIndices =!= 1, - StringJoin @ Table[", 0", {numberOfIndices-1}], - ""] <> " ", - If[numberOfIndices =!= 0, - StringJoin @ Riffle[Table[" 0", {numberOfIndices}], ","] <> " ", - ""] - ] <> "};\n\n" <> - - "double val = 0.0;\n\n" <> - - "using namespace " <> FlexibleSUSY`FSModelName <> "_cxx_diagrams::fields;\n\n" <> - - StringJoin @ Riffle[Module[{graph = #[[1]], diagrams = #[[2]]}, - StringJoin @ Riffle[Module[{diagram = #, indexedDiagram}, - indexedDiagram = CXXDiagrams`IndexDiagramFromGraph[diagram, graph]; - - "val += " <> - ToString @ ProjectColourFactor[field, - CXXDiagrams`ColourFactorForIndexedDiagramFromGraph[indexedDiagram, graph]] <> - " * " <> - CXXEvaluatorForFieldAndDiagramFromGraph[field, diagram, graph] <> - "::value(indices, context);" - ] & /@ diagrams, "\n"] - ] & /@ gTaggedDiagrams, "\n"] <> "\n\n" <> - - "return val;" - ] <> "\n}"; - - {prototype, definition} - ]; - -(* Because of colour conservation, we know that the resulting colour - * structure is either trivial or a ``SARAH`Delta[]``. - * A more general approach should use Coefficient[] instead. - *) -ProjectColourFactor[field_, colourFactor_] := colourFactor /; - !TreeMasses`ColorChargedQ[field] - -ProjectColourFactor[field_, colourFactor_ * SARAH`Delta[cIndex1, cIndex2]] := - colourFactor /; - TreeMasses`ColorChargedQ[field] && - Vertices`SarahColorIndexQ[cIndex1] && Vertices`SarahColorIndexQ[cIndex2] - -CXXEvaluatorForFieldAndDiagramFromGraph[field_,diagram_,vertexCorrectionGraph] := - Module[{photonEmitter,exchangeParticle}, - photonEmitter = diagram[[4,3]]; (* Edge between vertices 4 and 6 (3rd edge of vertex 4) *) - exchangeParticle = diagram[[4,2]]; (* Edge between vertices 4 and 5 (2nd edge of vertex 4) *) - - If[diagram[[6]] =!= {TreeMasses`GetPhoton[],CXXDiagrams`LorentzConjugate[photonEmitter],photonEmitter}, - Return["(unknown diagram)"]]; - If[TreeMasses`IsFermion[photonEmitter] && TreeMasses`IsScalar[exchangeParticle], - Return[CXXEvaluatorFS[field,photonEmitter,exchangeParticle]]]; - If[TreeMasses`IsFermion[exchangeParticle] && TreeMasses`IsScalar[photonEmitter], - Return[CXXEvaluatorSF[field,photonEmitter,exchangeParticle]]]; - - Return["(unknown diagram)"]; - ] - -CXXEvaluatorFS[field_,photonEmitter_,exchangeParticle_] := - "EDMVertexCorrectionFS<" <> CXXDiagrams`CXXNameOfField[field] <> ", " <> - CXXDiagrams`CXXNameOfField[photonEmitter] <> ", " <> - CXXDiagrams`CXXNameOfField[exchangeParticle] <> ">" - -CXXEvaluatorSF[field_,photonEmitter_,exchangeParticle_] := - "EDMVertexCorrectionSF<" <> CXXDiagrams`CXXNameOfField[field] <> ", " <> - CXXDiagrams`CXXNameOfField[photonEmitter] <> ", " <> - CXXDiagrams`CXXNameOfField[exchangeParticle] <> ">" +EDMForwardDeclaration[field_Symbol, functionName_String] := +"template double " <> FlexibleSUSY`FSModelName <> "_edm::" <> functionName <> "<" <> + CXXDiagrams`CXXNameOfField[field, prefixNamespace -> FlexibleSUSY`FSModelName <> "_cxx_diagrams::fields"] <> + ">(" <> + "const " <> FlexibleSUSY`FSModelName <> "_mass_eigenstates&, const softsusy::QedQcd&" <> If[TreeMasses`GetDimension[field] =!= 1, ", int", ""] <> ");" End[]; EndPackage[]; diff --git a/meta/EWSB.m b/meta/EWSB.m index 934800edac..5a4a7c9f0e 100644 --- a/meta/EWSB.m +++ b/meta/EWSB.m @@ -99,10 +99,6 @@ Begin["`Private`"]; -DebugPrint[msg___] := - If[FlexibleSUSY`FSDebugOutput, - Print["Debug: ", Sequence @@ InputFormOfNonStrings /@ {msg}]]; - AppearsInEquationOnlyAs[parameter_, equation_, function_] := FreeQ[equation /. function[parameter] :> Unique[CConversion`ToValidCSymbolString[parameter]], parameter]; @@ -184,17 +180,21 @@ type = CConversion`ScalarType[CConversion`realScalarCType]; ctype = CConversion`CreateCType[type]; If[dim < dimEq, - Print["Warning: number of Higgs bosons (", dim, - ") < number of EWSB eqs. (",dimEq,")." - "The EWSB eqs. ", dim, "...", dimEq, - " will be ignored"]; - ]; + Utils`FSFancyWarning[ + "Number of Higgs bosons (", dim, + ") < number of EWSB eqs. (", dimEq, ").", + " The EWSB eqs. ", dim, "...", dimEq, + " will be ignored" + ]; + ]; If[dim > dimEq, - Print["Warning: number of physical Higgs bosons (", dim, - ") > number of EWSB eqs. (",dimEq,").", - "The EWSB eqs. for the fields ", higgs, "(n), n >= ", - dimEq, ", will be set to zero."]; - ]; + Utils`FSFancyWarning[ + "Number of physical Higgs bosons (", dim, + ") > number of EWSB eqs. (", dimEq, ").", + " The EWSB eqs. for the fields ", higgs, + "(n), n >= ", dimEq, ", will be set to zero." + ]; + ]; For[i = 1, i <= dim, i++, result = result <> ctype <> " CLASSNAME::get_ewsb_eq_" <> @@ -249,9 +249,11 @@ Module[{i}, For[i = 1, i <= Length[initialGuess], i++, If[!MatchQ[initialGuess[[i]], {_,_}], - Print["Warning: ignoring invalid initial guess: ", initialGuess[[i]]]; - ]; - ]; + Utils`FSFancyWarning[ + "Ignoring invalid initial guess: ", initialGuess[[i]] + ]; + ]; + ]; Cases[initialGuess, {_,_}] ]; @@ -259,9 +261,11 @@ Module[{i}, For[i = 1, i <= Length[substitutions], i++, If[!MatchQ[substitutions[[i]], {_,_}], - Print["Warning: ignoring invalid EWSB substitution: ", substitutions[[i]]]; - ]; - ]; + Utils`FSFancyWarning[ + "Ignoring invalid EWSB substitution: ", substitutions[[i]] + ]; + ]; + ]; Cases[substitutions, {_,_}] ]; @@ -271,10 +275,12 @@ If[Parameters`IsRealParameter[par], guess = par, guess = Abs[par]];, guess = Cases[initialGuesses, {p_ /; p === par, val_} :> val]; If[Length[guess] > 1, - Print["Warning: multiple initial guesses given for ", par]; - ]; + Utils`FSFancyWarning[ + "Multiple initial guesses given for ", par + ]; + ]; guess = First[guess]; - ]; + ]; guess ]; @@ -342,26 +348,26 @@ SimplifyEwsbEqs[equations_List, parametersFixedByEWSB_List] := Module[{realParameters, complexParameters, simplificationRules, renamedEqs, splitEqs}, - DebugPrint["Splitting Re[] and Im[] within EWSB eqs. ..."]; + FSDebugPrint["EWSB", "Splitting Re[] and Im[] within EWSB eqs. ..."]; splitEqs = SplitRealAndImagParts[equations, parametersFixedByEWSB]; realParameters = Select[parametersFixedByEWSB, Parameters`IsRealParameter[#]&]; - DebugPrint["real parameters: ", realParameters]; + FSDebugPrint["EWSB", "real parameters: ", realParameters]; complexParameters = Complement[parametersFixedByEWSB, realParameters]; - DebugPrint["complex parameters: ", complexParameters]; + FSDebugPrint["EWSB", "complex parameters: ", complexParameters]; (* make parameters unique *) uniqueParameters = MakeParametersUnique[parametersFixedByEWSB]; - DebugPrint["Making parameters unique via: ", uniqueParameters]; + FSDebugPrint["EWSB", "Making parameters unique via: ", uniqueParameters]; realParameters = realParameters /. uniqueParameters; complexParameters = complexParameters /. uniqueParameters; renamedEqs = splitEqs /. uniqueParameters; - DebugPrint["EWSB eqs. with unique parameters: ", renamedEqs]; + FSDebugPrint["EWSB", "EWSB eqs. with unique parameters: ", renamedEqs]; simplificationRules = Flatten[Join[{Rule[SARAH`Conj[#],#], Rule[Susyno`LieGroups`conj[#],#]}& /@ realParameters, ComplexParameterReplacementRules[renamedEqs, complexParameters] ] ]; - DebugPrint["Simplification rules: ", simplificationRules]; + FSDebugPrint["EWSB", "Simplification rules: ", simplificationRules]; (* substitute back *) uniqueParameters = Reverse /@ uniqueParameters; renamedEqs /. simplificationRules /. uniqueParameters @@ -421,7 +427,7 @@ result = TimeConstrained[Eliminate[eqs, par], FlexibleSUSY`FSSolveEWSBTimeConstraint, {}]; If[result === {}, - DebugPrint["unable to eliminate ", par, ": ", eqs]; + FSDebugPrint["EWSB", "unable to eliminate ", par, ": ", eqs]; ]; result ]; @@ -460,7 +466,7 @@ EliminateOneParameter[{eq_}, {p_}] := Block[{}, - DebugPrint["eliminating ", p, ": ", eq]; + FSDebugPrint["EWSB", "eliminating ", p, ": ", eq]; {TimeConstrainedSolve[eq, p]} ]; @@ -468,22 +474,22 @@ SolveRest[eq1_, eq2_, par_] := Module[{rest = {}, solution}, If[FreeQ[eq1, par], - DebugPrint[par, " does not appear in equation: ", eq1];, - DebugPrint["solving rest for ", par, ": ", eq1]; + FSDebugPrint["EWSB", par, " does not appear in equation: ", eq1];, + FSDebugPrint["EWSB", "solving rest for ", par, ": ", eq1]; solution = TimeConstrainedSolve[eq1, par]; If[IsNoSolution[solution], - DebugPrint["Failed"];, - DebugPrint["Solution found: ", solution]; + FSDebugPrint["EWSB", "Failed"];, + FSDebugPrint["EWSB", "Solution found: ", solution]; AppendTo[rest, solution]; ]; ]; If[FreeQ[eq2, par], - DebugPrint[par, " does not appear in equation: ", eq2];, - DebugPrint["solving rest for ", par, ": ", eq2]; + FSDebugPrint["EWSB", par, " does not appear in equation: ", eq2];, + FSDebugPrint["EWSB", "solving rest for ", par, ": ", eq2]; solution = TimeConstrainedSolve[eq2, par]; If[IsNoSolution[solution], - DebugPrint["Failed"];, - DebugPrint["Solution found: ", solution]; + FSDebugPrint["EWSB", "Failed"];, + FSDebugPrint["EWSB", "Solution found: ", solution]; AppendTo[rest, solution]; ]; ]; @@ -492,7 +498,7 @@ EliminateOneParameter[{eq1_, eq2_}, {p1_, p2_}] := Module[{reduction = {{}, {}}, solution, rest}, - DebugPrint["Trying to eliminate one of the parameters ", + FSDebugPrint["EWSB", "Trying to eliminate one of the parameters ", {p1,p2}, " from the eqs.: ", {eq1,eq2}]; If[FreeQ[{eq1, eq2}, p1], @@ -506,69 +512,69 @@ (* special case: no elimination needed *) If[!FreeQ[{eq1},p1] && FreeQ[{eq1},p2] && !FreeQ[{eq2},p2] && FreeQ[{eq2},p1], - DebugPrint["The two equations are independent of each other."]; - DebugPrint["Step 1: solving for ", p1, ": ", eq1]; + FSDebugPrint["EWSB", "The two equations are independent of each other."]; + FSDebugPrint["EWSB", "Step 1: solving for ", p1, ": ", eq1]; reduction[[1]] = TimeConstrainedSolve[{eq1}, p1]; If[IsNoSolution[reduction[[1]]], - DebugPrint["Failed"]; + FSDebugPrint["EWSB", "Failed"]; Return[{}];, - DebugPrint["Solution: ", reduction[[1]]]; + FSDebugPrint["EWSB", "Solution: ", reduction[[1]]]; ]; - DebugPrint["Step 2: solving for ", p2, ": ", eq2]; + FSDebugPrint["EWSB", "Step 2: solving for ", p2, ": ", eq2]; reduction[[2]] = TimeConstrainedSolve[{eq2}, p2]; If[IsNoSolution[reduction[[2]]], - DebugPrint["Failed"]; + FSDebugPrint["EWSB", "Failed"]; Return[{}];, - DebugPrint["Solution: ", reduction[[2]]]; + FSDebugPrint["EWSB", "Solution: ", reduction[[2]]]; ]; - DebugPrint["Full solution: ", reduction]; + FSDebugPrint["EWSB", "Full solution: ", reduction]; Return[reduction]; ]; If[!FreeQ[{eq1},p2] && FreeQ[{eq1},p1] && !FreeQ[{eq2},p1] && FreeQ[{eq2},p2], - DebugPrint["The two equations are independent of each other."]; - DebugPrint["Step 1: solving for ", p2, ": ", eq1]; + FSDebugPrint["EWSB", "The two equations are independent of each other."]; + FSDebugPrint["EWSB", "Step 1: solving for ", p2, ": ", eq1]; reduction[[1]] = TimeConstrainedSolve[{eq1}, p2]; If[IsNoSolution[reduction[[1]]], - DebugPrint["Failed"]; + FSDebugPrint["EWSB", "Failed"]; Return[{}];, - DebugPrint["Solution: ", reduction[[1]]]; + FSDebugPrint["EWSB", "Solution: ", reduction[[1]]]; ]; - DebugPrint["Step 2: solving for ", p1, ": ", eq2]; + FSDebugPrint["EWSB", "Step 2: solving for ", p1, ": ", eq2]; reduction[[2]] = TimeConstrainedSolve[{eq2}, p1]; If[IsNoSolution[reduction[[2]]], - DebugPrint["Failed"]; + FSDebugPrint["EWSB", "Failed"]; Return[{}];, - DebugPrint["Solution: ", reduction[[2]]]; + FSDebugPrint["EWSB", "Solution: ", reduction[[2]]]; ]; - DebugPrint["Full solution: ", reduction]; + FSDebugPrint["EWSB", "Full solution: ", reduction]; Return[reduction]; ]; - DebugPrint["eliminate ", p1, " and solve for ", p2, ": ", {eq1, eq2}]; + FSDebugPrint["EWSB", "eliminate ", p1, " and solve for ", p2, ": ", {eq1, eq2}]; reduction[[1]] = TimeConstrainedSolve[TimeConstrainedEliminate[{eq1, eq2}, p1], p2]; - DebugPrint["eliminate ", p2, " and solve for ", p1, ": ", {eq1, eq2}]; + FSDebugPrint["EWSB", "eliminate ", p2, " and solve for ", p1, ": ", {eq1, eq2}]; reduction[[2]] = TimeConstrainedSolve[TimeConstrainedEliminate[{eq1, eq2}, p2], p1]; If[IsNoSolution[reduction[[1]]] || IsNoSolution[reduction[[2]]], - DebugPrint["Failed"]; + FSDebugPrint["EWSB", "Failed"]; Return[{}]; ]; If[ByteCount[reduction[[1]]] <= ByteCount[reduction[[2]]], - DebugPrint["continue with solution 1, because it is simpler:", + FSDebugPrint["EWSB", "continue with solution 1, because it is simpler:", reduction[[1]]]; rest = SolveRest[eq1, eq2, p1]; If[IsNoSolution[rest], - DebugPrint["could not solve rest for solution 1"]; + FSDebugPrint["EWSB", "could not solve rest for solution 1"]; Return[{}]; ]; Return[{reduction[[1]], rest}]; , - DebugPrint["continue with solution 2, because it is simpler:", + FSDebugPrint["EWSB", "continue with solution 2, because it is simpler:", reduction[[2]]]; rest = SolveRest[eq1, eq2, p2]; If[IsNoSolution[rest], - DebugPrint["could not solve rest for solution 2"]; + FSDebugPrint["EWSB", "could not solve rest for solution 2"]; Return[{}]; ]; Return[{reduction[[2]], rest}]; @@ -581,7 +587,7 @@ largestIndependentSubset, s}, independentSubset = FindIndependentSubset[equations, parameters]; If[independentSubset === {}, - DebugPrint["EWSB equations are not reducible"]; + FSDebugPrint["EWSB", "EWSB equations are not reducible"]; Return[{}]; ]; (* search for the largest independent equation subset *) @@ -598,17 +604,17 @@ reducedPars = largestIndependentSubset[[2]]; reducedSolution = EliminateOneParameter[reducedEqs, reducedPars]; If[reducedSolution === {}, - DebugPrint["Could not solve reduced EWSB eqs. subset"]; + FSDebugPrint["EWSB", "Could not solve reduced EWSB eqs. subset"]; Return[{}]; ]; complementEq = Complement[equations, reducedEqs]; complementPar = Complement[parameters, reducedPars]; complementSolution = EliminateOneParameter[complementEq, complementPar]; If[complementSolution === {}, - DebugPrint["Could not solve remaining EWSB eqs. subset"]; + FSDebugPrint["EWSB", "Could not solve remaining EWSB eqs. subset"]; Return[{}]; ]; - DebugPrint["Solution = ", Join[reducedSolution, complementSolution]]; + FSDebugPrint["EWSB", "Solution = ", Join[reducedSolution, complementSolution]]; Join[reducedSolution, complementSolution] ]; @@ -620,18 +626,18 @@ FindSolution[equations_List, parametersFixedByEWSB_List] := Module[{simplifiedEqs, makeParsUnique, solution, uniquePars, uniqueEqs}, - DebugPrint["Simplifying the EWSB eqs. ..."]; + FSDebugPrint["EWSB", "Simplifying the EWSB eqs. ..."]; simplifiedEqs = SimplifyEwsbEqs[equations, parametersFixedByEWSB]; simplifiedEqs = (# == 0)& /@ simplifiedEqs; - DebugPrint["Simplified EWSB eqs.: ", simplifiedEqs]; + FSDebugPrint["EWSB", "Simplified EWSB eqs.: ", simplifiedEqs]; (* replace non-symbol parameters by unique symbols *) makeParsUnique = MakeParametersUnique[parametersFixedByEWSB]; uniquePars = parametersFixedByEWSB /. makeParsUnique; uniqueEqs = simplifiedEqs /. makeParsUnique; - DebugPrint["Eliminating the parameters ", uniquePars]; + FSDebugPrint["EWSB", "Eliminating the parameters ", uniquePars]; solution = ToMathematicaSolutionFormat @ EliminateOneParameter[uniqueEqs, uniquePars]; If[solution === {}, - DebugPrint["Trying Mathematica's Solve[] with time constraint of ", + FSDebugPrint["EWSB", "Trying Mathematica's Solve[] with time constraint of ", FlexibleSUSY`FSSolveEWSBTimeConstraint, " seconds"]; solution = TimeConstrainedSolve[uniqueEqs, uniquePars]; ]; @@ -656,24 +662,26 @@ ReduceTwoSolutions[sol1_, sol2_] := Module[{par, signOrPhase, reducedSolution}, par = sol1[[1]]; - DebugPrint["Reducing solutions for ", par, "..."]; + FSDebugPrint["EWSB", "Reducing solutions for ", par, "..."]; signOrPhase = SignOrPhase[par]; If[PossibleZeroQ[sol1[[2]] - sol2[[2]]], - DebugPrint["The two solutions for ", par, " are identical"]; + FSDebugPrint["EWSB", "The two solutions for ", par, " are identical"]; Return[{sol1}]; ]; If[!PossibleZeroQ[sol1[[2]] + sol2[[2]]], - Print["Warning: cannot reduce solution for ", par]; - Print[" because the two solutions are not related by a global sign."]; + Utils`FSFancyWarning[ + "Cannot reduce solution for ", par, + " because the two solutions are not related by a global sign." + ]; Return[{}]; ]; - DebugPrint["The two solutions for ", par, + FSDebugPrint["EWSB", "The two solutions for ", par, " are related by a global sign/phase: ", sol1, ", ", sol2]; reducedSolution = sol1 /. Rule[p_, expr_] :> Rule[p, signOrPhase StripSign[expr]]; - DebugPrint["=> the reduced solution is: ", + FSDebugPrint["EWSB", "=> the reduced solution is: ", {reducedSolution, signOrPhase}]; {reducedSolution, signOrPhase} ]; @@ -682,7 +690,7 @@ ReduceSolution[{sol1_, sol2_}] := Module[{reducedSolution = {}, freePhases = {}, s, red}, - DebugPrint["Reducing the two solutions: ", {sol1,sol2}]; + FSDebugPrint["EWSB", "Reducing the two solutions: ", {sol1,sol2}]; For[s = 1, s <= Length[sol1], s++, red = ReduceTwoSolutions[sol1[[s]], sol2[[s]]]; Switch[Length[red], @@ -692,7 +700,7 @@ ]; ]; If[Length[reducedSolution] != Length[sol1], - Print["Warning: analytic reduction of EWSB solutions failed."]; + Utils`FSFancyWarning["Analytic reduction of EWSB solutions failed."]; Return[{{},{}}]; ]; Return[{reducedSolution, freePhases}]; @@ -713,13 +721,13 @@ ]; solution = FindSolution[eqsToSolve, parametersFixedByEWSB]; {reducedSolution, freePhases} = ReduceSolution[solution]; - DebugPrint["The full, reduced solution to the EWSB eqs. is:", + FSDebugPrint["EWSB", "The full, reduced solution to the EWSB eqs. is:", reducedSolution]; If[outputFile != "", If[reducedSolution === {}, - DebugPrint["Writing full, non-reduced solution to file ", outputFile]; + FSDebugPrint["EWSB", "Writing full, non-reduced solution to file ", outputFile]; Put[solution, outputFile];, - DebugPrint["Writing reduced solution to file ", outputFile]; + FSDebugPrint["EWSB", "Writing reduced solution to file ", outputFile]; Put[reducedSolution, outputFile]; ]; ]; diff --git a/meta/EffectiveCouplings.m b/meta/EffectiveCouplings.m deleted file mode 100644 index 4bb390198f..0000000000 --- a/meta/EffectiveCouplings.m +++ /dev/null @@ -1,801 +0,0 @@ -(* :Copyright: - - ==================================================================== - This file is part of FlexibleSUSY. - - FlexibleSUSY 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. - - FlexibleSUSY 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 FlexibleSUSY. If not, see - . - ==================================================================== - -*) - -BeginPackage["EffectiveCouplings`", {"SARAH`", "CConversion`", "Parameters`", "SelfEnergies`", "TreeMasses`", "TextFormatting`", "Utils`", "Vertices`", "Constraint`"}]; - -InitializeEffectiveCouplings::usage=""; -InitializeMixingFromModelInput::usage=""; -GetMixingMatrixFromModel::usage=""; -GetNeededVerticesList::usage=""; -CalculatePartialWidths::usage=""; -CalculateQCDAmplitudeScalingFactors::usage=""; -CalculateQCDScalingFactor::usage=""; -CreateEffectiveCouplingsGetters::usage=""; -CreateEffectiveCouplingsDefinitions::usage=""; -CreateEffectiveCouplingsInit::usage=""; -CreateEffectiveCouplingsCalculation::usage=""; -CreateEffectiveCouplings::usage=""; - -(* @todo error handle when e.g. the strong coupling is not defined *) - -Begin["`Private`"]; - -InitializeMixingFromModelInput[massMatrix_TreeMasses`FSMassMatrix] := - Module[{i, macro, symbol, result = ""}, - symbol = TreeMasses`GetMixingMatrixSymbol[massMatrix]; - If[SARAH`SupersymmetricModel, - macro = "MODELPARAMETER";, - macro = "PHYSICAL"; - ]; - If[symbol === Null, - Return[""]; - ]; - If[Length[symbol] > 1, - (result = result <> ", " <> CConversion`ToValidCSymbolString[#] <> "(" <> macro <> "(" - <> CConversion`ToValidCSymbolString[#] <> "))")& /@ symbol;, - result = ", " <> CConversion`ToValidCSymbolString[symbol] - <> "(" <> macro <> "(" <> CConversion`ToValidCSymbolString[symbol] <> "))"; - ]; - result - ]; - -GetMixingMatrixFromModel[massMatrix_TreeMasses`FSMassMatrix] := - Module[{i, macro, symbol, result = ""}, - symbol = TreeMasses`GetMixingMatrixSymbol[massMatrix]; - If[symbol === Null, - Return[""]; - ]; - If[SARAH`SupersymmetricModel, - macro = "MODELPARAMETER";, - macro = "PHYSICAL"; - ]; - If[Length[symbol] > 1, - (result = result <> CConversion`ToValidCSymbolString[#] <> " = " <> macro <> "(" - <> CConversion`ToValidCSymbolString[#] <> ");\n")& /@ symbol;, - result = CConversion`ToValidCSymbolString[symbol] <> " = " <> macro <> "(" - <> CConversion`ToValidCSymbolString[symbol] <> ");\n"; - ]; - result - ]; - -CalculateQCDAmplitudeScalingFactors[] := - Module[{coeff, scalarQCD, fermionQCD, pseudoscalarQCD, body = "", - scalarScalarLoopFactor = "", scalarFermionLoopFactor = "", - pseudoscalarFermionLoopFactor = ""}, - scalarQCD = 1 + 2 SARAH`strongCoupling^2 / (3 Pi^2); - body = "result = " <> CConversion`RValueToCFormString[scalarQCD] <> ";"; - scalarScalarLoopFactor = Parameters`CreateLocalConstRefs[{SARAH`strongCoupling}] - <> "if (m_loop > m_decay) {\n" - <> TextFormatting`IndentText[body] <> "\n}"; - scalarFermionLoopFactor = Parameters`CreateLocalConstRefs[{SARAH`strongCoupling}] - <> "result = 1.0 + " - <> CConversion`RValueToCFormString[SARAH`strongCoupling^2 / (4 Pi^2)] - <> " * scalar_diphoton_fermion_loop(m_decay, m_loop);\n"; - pseudoscalarFermionLoopFactor = Parameters`CreateLocalConstRefs[{SARAH`strongCoupling}] - <> "result = 1.0 + " - <> CConversion`RValueToCFormString[SARAH`strongCoupling^2 / (4 Pi^2)] - <> " * pseudoscalar_diphoton_fermion_loop(m_decay, m_loop);\n"; - scalarScalarLoopFactor = TextFormatting`IndentText[scalarScalarLoopFactor]; - scalarFermionLoopFactor = TextFormatting`IndentText[scalarFermionLoopFactor]; - pseudoscalarFermionLoopFactor = TextFormatting`IndentText[pseudoscalarFermionLoopFactor]; - {scalarScalarLoopFactor, scalarFermionLoopFactor, pseudoscalarFermionLoopFactor} - ]; - -CalculateQCDScalingFactor[] := - Module[{nloQCD, nnloQCD, nnnloQCD, scalarFactor = "", pseudoscalarFactor = ""}, - (* NLO, NNLO and NNNLO contributions to scalar coupling *) - nloQCD = (95 / 4 - 7 / 6 Symbol["Nf"]) SARAH`strongCoupling^2 / (4 Pi^2); - nnloQCD = 149533 / 288 - 363 Zeta[2] / 8 - 495 Zeta[3] / 8 + 19 Symbol["l"] / 8; - nnloQCD = nnloQCD + Symbol["Nf"] (-4157 / 72 + 11 Zeta[2] / 2 + 5 Zeta[3] / 4 + 2 Symbol["l"] / 3); - nnloQCD = nnloQCD + Symbol["Nf"]^2 (127 / 108 - Zeta[2] / 6); - nnloQCD = nnloQCD SARAH`strongCoupling^4 / (16 Pi^4); - nnnloQCD = 467.683620788 + 122.440972222 Symbol["l"] + 10.9409722222 Symbol["l"]^2; - nnnloQCD = nnnloQCD SARAH`strongCoupling^6 / (64 Pi^6); - scalarFactor = scalarFactor <> "const double nlo_qcd = " <> CConversion`RValueToCFormString[nloQCD] <> ";\n"; - scalarFactor = scalarFactor <> "const double nnlo_qcd = " <> CConversion`RValueToCFormString[nnloQCD] <> ";\n"; - scalarFactor = scalarFactor <> "const double nnnlo_qcd = " <> CConversion`RValueToCFormString[nnnloQCD] <> ";\n"; - scalarFactor = Parameters`CreateLocalConstRefs[{nloQCD, nnloQCD, nnnloQCD}] <> "\n" <> scalarFactor; - (* NLO, NNLO and NNNLO contributions to pseudoscalar coupling *) - nloQCD = (97 / 4 - 7 / 6 Symbol["Nf"]) SARAH`strongCoupling^2 / (4 Pi^2); - nnloQCD = (237311 / 864 - 529 Zeta[2] / 24 - 445 Zeta[3] / 8 + 5 Symbol["l"]); - nnloQCD = nnloQCD SARAH`strongCoupling^4 / (16 Pi^4); - nnnloQCD = 0; - pseudoscalarFactor = pseudoscalarFactor <> "const double nlo_qcd = " - <> CConversion`RValueToCFormString[nloQCD] <> ";\n"; - pseudoscalarFactor = pseudoscalarFactor <> "const double nnlo_qcd = " - <> CConversion`RValueToCFormString[nnloQCD] <> ";\n"; - pseudoscalarFactor = pseudoscalarFactor <> "const double nnnlo_qcd = " - <> CConversion`RValueToCFormString[nnnloQCD] <> ";\n"; - pseudoscalarFactor = Parameters`CreateLocalConstRefs[{nloQCD, nnloQCD, nnnloQCD}] <> "\n" <> pseudoscalarFactor; - {scalarFactor, pseudoscalarFactor} - ]; - -GetAllowedCouplingsForModel[] := - Module[{dim, - valid = {FlexibleSUSYObservable`CpHiggsPhotonPhoton, - FlexibleSUSYObservable`CpHiggsGluonGluon, - FlexibleSUSYObservable`CpPseudoScalarPhotonPhoton, - FlexibleSUSYObservable`CpPseudoScalarGluonGluon} - }, - If[FreeQ[TreeMasses`GetParticles[], SARAH`HiggsBoson], - valid = DeleteCases[valid, a_ /; (a === FlexibleSUSYObservable`CpHiggsPhotonPhoton || - a === FlexibleSUSYObservable`CpHiggsGluonGluon)]; - ]; - If[FreeQ[TreeMasses`GetParticles[], SARAH`PseudoScalar], - valid = DeleteCases[valid, a_ /; (a === FlexibleSUSYObservable`CpPseudoScalarPhotonPhoton || - a === FlexibleSUSYObservable`CpPseudoScalarGluonGluon)]; - ]; - valid - ]; - -GetExternalStates[couplingSymbol_] := - Module[{particle, vectorBoson}, - Which[couplingSymbol === FlexibleSUSYObservable`CpHiggsPhotonPhoton, - particle = SARAH`HiggsBoson; - vectorBoson = SARAH`VectorP;, - couplingSymbol === FlexibleSUSYObservable`CpHiggsGluonGluon, - particle = SARAH`HiggsBoson; - vectorBoson = SARAH`VectorG;, - couplingSymbol === FlexibleSUSYObservable`CpPseudoScalarPhotonPhoton, - particle = SARAH`PseudoScalar; - vectorBoson = SARAH`VectorP;, - couplingSymbol === FlexibleSUSYObservable`CpPseudoScalarGluonGluon, - particle = SARAH`PseudoScalar; - vectorBoson = SARAH`VectorG;, - True, particle = Null; vectorBoson = Null - ]; - {particle, vectorBoson} - ]; - -CalculatePartialWidths[couplings_List] := - Module[{couplingSymbol, dim, particle, vectorBoson, particlesStr, - massStr, functionName, couplingName, - body, prototypes = {}, functions = {}}, - For[i = 1, i <= Length[couplings], i++, - couplingSymbol = couplings[[i,1]]; - {particle, vectorBoson} = GetExternalStates[couplingSymbol]; - particlesStr = CConversion`ToValidCSymbolString[particle] - <> CConversion`ToValidCSymbolString[vectorBoson] - <> CConversion`ToValidCSymbolString[vectorBoson]; - dim = TreeMasses`GetDimension[particle]; - functionName = "get_" <> particlesStr <> "_partial_width("; - If[dim == 1, - functionName = functionName <> ") const";, - functionName = functionName <> "int gO1) const"; - ]; - couplingName = "eff_Cp" <> particlesStr; - massStr = CConversion`ToValidCSymbolString[FlexibleSUSY`M[particle]]; - body = "const double mass = PHYSICAL(" <> massStr <> ")"; - If[dim != 1, - body = body <> "(gO1)"; - ]; - body = body <> ";\n"; - If[vectorBoson === SARAH`VectorP, - body = body <> "return " <> CConversion`RValueToCFormString[1 / (64 Pi)] - <> " * Power(mass, 3.0) * AbsSqr(" <> couplingName - <> If[dim != 1, "(gO1)", ""] <> ");";, - body = body <> "return " <> CConversion`RValueToCFormString[1 / (8 Pi)] - <> " * Power(mass, 3.0) * AbsSqr(" <> couplingName - <> If[dim != 1, "(gO1)", ""] <> ");"; - ]; - functions = Append[functions, - "double " <> FlexibleSUSY`FSModelName <> "_effective_couplings::" - <> functionName <> "\n{\n" <> TextFormatting`IndentText[body] - <> "\n}\n"]; - prototypes = Append[prototypes, - "double " <> functionName <> ";"]; - ]; - Utils`StringJoinWithSeparator[#, "\n"]& /@ {prototypes, functions} - ]; - -NonZeroVertexQ[vertex_] := MemberQ[vertex[[2 ;;]][[All, 1]], Except[0]]; - -(* @todo extend to multiple non-Abelian groups *) -IsColorOrLorentzIndex[index_] := Vertices`SarahColorIndexQ[index] || - Vertices`SarahLorentzIndexQ[index]; -StripColorAndLorentzIndices[p_Symbol] := p; -StripColorAndLorentzIndices[SARAH`bar[p_]] := SARAH`bar[StripColorAndLorentzIndices[p]]; -StripColorAndLorentzIndices[Susyno`LieGroups`conj[p_]] := Susyno`LieGroups`conj[StripColorAndLorentzIndices[p]]; -StripColorAndLorentzIndices[p_] := - Module[{remainingIndices}, - remainingIndices = Select[p[[1]], (!IsColorOrLorentzIndex[#])&]; - If[Length[remainingIndices] === 0, - Head[p], - Head[p][remainingIndices] - ] - ]; -SetAttributes[StripColorAndLorentzIndices, {Listable}]; - -(* @todo this is very slow because each possible vertex must be calculated, - this can be improved by either pre-calculating all vertices or saving - previous results (e.g. define along the lines of f[p] := f[p] = ...) *) -GetTwoBodyDecays[particle_] := - Module[{i, j, allParticles, combinations, vertex, fields, couplings, - candidate, found = {}, decays = {}}, - allParticles = Select[TreeMasses`GetParticles[], !TreeMasses`IsGhost[#]&]; - combinations = Table[Sort[{SARAH`AntiField[particle], - SARAH`AntiField[allParticles[[i]]], - allParticles[[j]]}], - {i, 1, Length[allParticles]}, {j, 1, Length[allParticles]}]; - combinations = DeleteDuplicates[Flatten[combinations, 1]]; - For[i = 1, i <= Length[combinations], i++, - vertex = SARAH`Vertex[combinations[[i]], UseDependences -> True]; - If[NonZeroVertexQ[vertex], - fields = First[vertex]; - coupling = Rest[vertex]; - If[Length[coupling] > 1, - coupling = Vertices`SortCp[SARAH`Cp @@ (StripColorAndLorentzIndices @ fields)][SARAH`PL];, - coupling = Vertices`SortCp[SARAH`Cp @@ (StripColorAndLorentzIndices @ fields)]; - ]; - candidate = Append[DeleteCases[fields /. head_[{__}] :> head, p_ /; p === SARAH`AntiField[particle], {0, Infinity}, 1], coupling]; - If[FreeQ[found, C[candidate[[1]], candidate[[2]]]] && - FreeQ[found, C[SARAH`AntiField[candidate[[1]]], SARAH`AntiField[candidate[[2]]]]] || - SARAH`AntiField[particle] =!= particle, - If[((!TreeMasses`IsMassless[candidate[[1]]] || !TreeMasses`IsVector[candidate[[1]]]) && - (!TreeMasses`IsMassless[candidate[[2]]] || !TreeMasses`IsVector[candidate[[2]]])) || - !FreeQ[SARAH`AllowDecaysMasslessVectors, SARAH`RE[particle]], - decays = Append[decays, candidate]; - found = Append[found, C[candidate[[1]], candidate[[2]]]]; - ]; - ]; - ]; - ]; - decays - ]; - -GetParticlesCouplingToVectorBoson[vector_] := - Module[{i, charge, allParticles, particles = {}}, - allParticles = Select[TreeMasses`GetParticles[], !TreeMasses`IsGhost[#]&]; - For[i = 1, i <= Length[allParticles], i++, - If[vector === SARAH`VectorG, - (* @note could use defined functions in e.g. TreeMasses, plus check - for undefined group factors, but will do it this way for now - to ensure consistency with SARAH *) - charge = SARAH`Vertex[{SARAH`AntiField[allParticles[[i]]], - allParticles[[i]], SARAH`VectorG}, - UseDependences -> True][[2,1]]; - If[charge =!= 0, - particles = Append[particles, allParticles[[i]]]; - ];, - charge = TreeMasses`GetElectricCharge[allParticles[[i]]]; - If[NumericQ[charge], - charge = {charge}, - charge = Cases[SARAH`Vertex[{SARAH`AntiField[allParticles[[i]]], - allParticles[[i]], SARAH`VectorP}, - UseDependences -> True][[2,1]], _?NumberQ]; - ]; - If[charge =!= {} && SARAH`AntiField[allParticles[[i]]] =!= allParticles[[i]] && - charge =!= {0}, - particles = Append[particles, allParticles[[i]]]; - ]; - ]; - ]; - particles - ]; - -IsMasslessOrGoldstone[SARAH`bar[p_]] := IsMasslessOrGoldstone[p]; -IsMasslessOrGoldstone[Susyno`LieGroups`conj[p_]] := IsMasslessOrGoldstone[p]; -IsMasslessOrGoldstone[particle_] := - Module[{result}, - result = TreeMasses`IsMassless[particle] || - (TreeMasses`IsGoldstone[particle] && TreeMasses`GetDimension[particle] == 1); - result - ]; - -InitializeEffectiveCouplings[] := - Module[{i, couplings, particle, vectorBoson, - allParticles = {}, allVectorBosons = {}, - twoBodyDecays, vectorBosonInteractions, - neededTwoBodyDecays, neededVectorBosonInteractions, - neededCoups, result = {}}, - couplings = GetAllowedCouplingsForModel[]; - {allParticles, allVectorBosons} = DeleteDuplicates /@ {(#[[1]])& /@ (GetExternalStates[#]& /@ couplings), - (#[[2]])& /@ (GetExternalStates[#]& /@ couplings)}; - twoBodyDecays = {#, GetTwoBodyDecays[#]}& /@ allParticles; - vectorBosonInteractions = {#, GetParticlesCouplingToVectorBoson[#]}& /@ allVectorBosons; - For[i = 1, i <= Length[couplings], i++, - {particle, vectorBoson} = GetExternalStates[couplings[[i]]]; - neededTwoBodyDecays = First[Select[twoBodyDecays, (#[[1]] === particle)&]]; - neededVectorBosonInteractions = First[Select[vectorBosonInteractions, (#[[1]] === vectorBoson)&]]; - neededCoups = Select[neededTwoBodyDecays[[2]], - (MemberQ[neededVectorBosonInteractions[[2]], #[[1]]] || - MemberQ[neededVectorBosonInteractions[[2]], #[[2]]])&]; - (* only keep vertices of the form pD -> p SARAH`AntiField[p] *) - neededCoups = Cases[neededCoups, {p1_, p2_, _} /; p1 === SARAH`AntiField[p2]]; - (* filter out massless states and Goldstones *) - neededCoups = Select[neededCoups, (!IsMasslessOrGoldstone[#[[1]]] && !IsMasslessOrGoldstone[#[[2]]])&]; - result = Append[result, {couplings[[i]], #[[3]]& /@ neededCoups}]; - ]; - result - ]; - -GetNeededVerticesList[couplings_List] := - {Null[Null, Join[(#[[2]])& /@ couplings]]}; - -CreateEffectiveCouplingName[pIn_, pOut_] := - "eff_Cp" <> CConversion`ToValidCSymbolString[pIn] <> CConversion`ToValidCSymbolString[pOut] <> CConversion`ToValidCSymbolString[pOut]; - -CreateEffectiveCouplingsGetters[couplings_List] := - Module[{i, couplingSymbols, type, particle, - vectorBoson, dim, couplingName, getters = ""}, - couplingSymbols = #[[1]]& /@ couplings; - type = CConversion`CreateCType[CConversion`ScalarType[CConversion`complexScalarCType]]; - For[i = 1, i <= Length[couplingSymbols], i++, - {particle, vectorBoson} = GetExternalStates[couplingSymbols[[i]]]; - dim = TreeMasses`GetDimension[particle]; - couplingName = CreateEffectiveCouplingName[particle, vectorBoson]; - getters = getters <> type <> " get_" <> couplingName; - If[dim == 1, - getters = getters <> "() const { return " <> couplingName <> "; }\n";, - getters = getters <> "(int gO1) const { return " <> couplingName <> "(gO1); }\n"; - ]; - ]; - getters - ]; - -CreateEffectiveCouplingsDefinitions[couplings_List] := - Module[{i, couplingSymbols, dim, type, particle, vectorBoson, - couplingName, defs = ""}, - couplingSymbols = #[[1]]& /@ couplings; - For[i = 1, i <= Length[couplingSymbols], i++, - {particle, vectorBoson} = GetExternalStates[couplingSymbols[[i]]]; - couplingName = CreateEffectiveCouplingName[particle, vectorBoson]; - dim = TreeMasses`GetDimension[particle]; - If[dim == 1, - type = CConversion`CreateCType[CConversion`ScalarType[CConversion`complexScalarCType]];, - type = CConversion`CreateCType[CConversion`ArrayType[CConversion`complexScalarCType, dim]]; - ]; - defs = defs <> type <> " " <> couplingName <> ";\n"; - ]; - defs - ]; - -CreateEffectiveCouplingsInit[couplings_List] := - Module[{i, couplingSymbols, particle, - vectorBoson, couplingName, dim, type, init = ""}, - couplingSymbols = #[[1]]& /@ couplings; - For[i = 1, i <= Length[couplingSymbols], i++, - {particle, vectorBoson} = GetExternalStates[couplingSymbols[[i]]]; - couplingName = CreateEffectiveCouplingName[particle, vectorBoson]; - dim = TreeMasses`GetDimension[particle]; - If[dim == 1, - type = CConversion`ScalarType[CConversion`complexScalarCType];, - type = CConversion`ArrayType[CConversion`complexScalarCType, dim]; - ]; - init = init <> ", " <> CConversion`CreateDefaultConstructor[couplingName, type]; - ]; - init - ]; - -RunToDecayingParticleScale[scale_] := - Module[{body, result = ""}, - If[SARAH`SupersymmetricModel, - body = "model.run_to(" <> scale <> ");\n"; - result = "if (rg_improve && scale > " <> scale <> ") {\n" - <> TextFormatting`IndentText[body] <> "}\n"; - ]; - result - ]; - -RunStrongCouplingToScale[scale_] := - Module[{result = ""}, - If[ValueQ[SARAH`hyperchargeCoupling] && ValueQ[SARAH`leftCoupling] && - ValueQ[SARAH`strongCoupling], - result = result <> "run_SM_strong_coupling_to(sm, " <> scale <> ");\n"; - ]; - result - ]; - -CallEffectiveCouplingCalculation[couplingSymbol_] := - Module[{particle, vectorBoson, savedMass, dim, start, idx = "", - body, couplingName, call = ""}, - {particle, vectorBoson} = GetExternalStates[couplingSymbol]; - savedMass = CConversion`RValueToCFormString[FlexibleSUSY`M[particle]]; - dim = TreeMasses`GetDimension[particle]; - start = TreeMasses`GetDimensionStartSkippingGoldstones[particle]; - If[dim != 1 && start <= dim, - idx = "gO1"; - savedMass = savedMass <> "(" <> idx <> ")"; - ]; - If[vectorBoson === SARAH`VectorP, - body = RunStrongCouplingToScale["0.5 * " <> savedMass];, - body = RunStrongCouplingToScale[savedMass]; - ]; - call = call <> body; - couplingName = CreateEffectiveCouplingName[particle, vectorBoson]; - call = call <> "calculate_" <> couplingName; - If[idx != "", - call = call <> "(" <> idx <> ");";, - call = call <> "();"; - ]; - call - ]; - -CreateEffectiveCouplingsCalculation[couplings_List] := - Module[{i, couplingSymbols, particle, couplingsForParticles = {}, - pos, couplingList, mass, - savedMass, dim, start, body, result = ""}, - couplingSymbols = #[[1]]& /@ couplings; - For[i = 1, i <= Length[couplingSymbols], i++, - particle = GetExternalStates[couplingSymbols[[i]]][[1]]; - If[FreeQ[couplingsForParticles, particle], - couplingsForParticles = Append[couplingsForParticles, {particle, {couplingSymbols[[i]]}}];, - pos = Position[couplingsForParticles, {particle, _List}][[1,1]]; - couplingList = couplingsForParticles[[pos]] /. {p_, coups_} :> {p, Append[coups, couplingSymbols[[i]]]}; - couplingsForParticles = ReplacePart[couplingsForParticles, pos -> couplingList]; - ]; - ]; - For[i = 1, i <= Length[couplingsForParticles], i++, - particle = couplingsForParticles[[i,1]]; - mass = CConversion`ToValidCSymbolString[FlexibleSUSY`M[particle]]; - savedMass = "const auto " <> mass <> " = PHYSICAL(" <> mass <> ");\n"; - dim = TreeMasses`GetDimension[particle]; - start = TreeMasses`GetDimensionStartSkippingGoldstones[particle]; - If[dim == 1 && !TreeMasses`IsGoldstone[particle], - body = RunToDecayingParticleScale[mass]; - If[SARAH`SupersymmetricModel, - body = body <> "model.calculate_DRbar_masses();\n" - <> "copy_mixing_matrices_from_model();\n"; - ]; - result = result <> savedMass <> body <> Utils`StringJoinWithSeparator[CallEffectiveCouplingCalculation[#]& /@ couplingsForParticles[[i,2]], "\n"] <> "\n\n"; - , - If[start <= dim, - body = RunToDecayingParticleScale[mass <> "(gO1)"]; - If[SARAH`SupersymmetricModel, - body = body <> "model.calculate_DRbar_masses();\n" - <> "copy_mixing_matrices_from_model();\n"; - ]; - result = result <> savedMass - <> "for (int gO1 = " <> ToString[start-1] <> "; gO1 < " <> ToString[dim] <> "; ++gO1) {\n"; - body = body <> Utils`StringJoinWithSeparator[CallEffectiveCouplingCalculation[#]& /@ couplingsForParticles[[i,2]], "\n"] <> "\n"; - result = result <> TextFormatting`IndentText[body] <> "}\n\n"; - ]; - ]; - ]; - - result = "const double scale = model.get_scale();\nconst Eigen::ArrayXd saved_parameters(model.get());\n\n" - <> "const double saved_mt = PHYSICAL(" - <> CConversion`RValueToCFormString[TreeMasses`GetThirdGenerationMass[TreeMasses`GetSMTopQuarkMultiplet[]]] - <> ");\nPHYSICAL(" - <> CConversion`RValueToCFormString[TreeMasses`GetThirdGenerationMass[TreeMasses`GetSMTopQuarkMultiplet[]]] - <> ") = qedqcd.displayPoleMt();\n\n" - <> result; - result = result <> "PHYSICAL(" - <> CConversion`RValueToCFormString[TreeMasses`GetThirdGenerationMass[TreeMasses`GetSMTopQuarkMultiplet[]]] - <> ") = saved_mt;\n"; - result = result <> "model.set_scale(scale);\nmodel.set(saved_parameters);\n"; - - result - ]; - -CreateEffectiveCouplingPrototype[coupling_] := - Module[{couplingSymbol = coupling[[1]], particle, vectorBoson, - dim, name, result = ""}, - {particle, vectorBoson} = GetExternalStates[couplingSymbol]; - If[particle =!= Null && vectorBoson =!= Null, - dim = TreeMasses`GetDimension[particle]; - name = CreateEffectiveCouplingName[particle, vectorBoson]; - result = "void calculate_" <> name <> If[dim == 1, "();\n", "(int gO1);\n"]; - ]; - result - ]; - -GetEffectiveVEV[] := - Module[{vev, parameters = {}, result = ""}, - If[SARAH`SupersymmetricModel, - vev = Simplify[2 Sqrt[-SARAH`Vertex[{SARAH`VectorW, Susyno`LieGroups`conj[SARAH`VectorW]}][[2,1]] - / SARAH`leftCoupling^2] /. SARAH`sum[a_,b_,c_,d_] :> Sum[d,{a,b,c}]]; - vev = Parameters`DecreaseIndexLiterals[vev]; - parameters = Parameters`FindAllParameters[vev]; - result = "const auto vev = " <> CConversion`RValueToCFormString[vev] <> ";\n";, - result = "const auto vev = 1.0 / Sqrt(qedqcd.displayFermiConstant() * Sqrt(2.0));\n"; - ]; - {result, parameters} - ]; - -GetMultiplicity[vectorBoson_, internal_] := SARAH`ChargeFactor[vectorBoson, internal, internal]; - -GetParticleGenerationIndex[particle_, coupling_] := - Module[{dim, indexList, result = {}}, - dim = TreeMasses`GetDimension[particle]; - If[dim != 1, - indexList = Flatten[Cases[Vertices`GetParticleList[coupling], - p_[a_List] /; p === particle :> a, {0, Infinity}]]; - result = Select[indexList, StringMatchQ[ToString[#], "gt" ~~ __] &]; - If[Length[result] > 1, - result = {result[[1]]}; - ]; - ]; - result - ]; - -(* @todo these are basically identical to those in SelfEnergies, - it would be better to reuse the definitions there if possible *) -GetParticleIndicesInCoupling[SARAH`Cp[a__]] := Flatten[Cases[{a}, List[__], Infinity]]; - -GetParticleIndicesInCoupling[SARAH`Cp[a__][_]] := GetParticleIndicesInCoupling[SARAH`Cp[a]]; - -CreateCouplingSymbol[coupling_] := - Module[{symbol, indices}, - indices = GetParticleIndicesInCoupling[coupling]; - symbol = ToValidCSymbol[coupling /. a_[List[__]] :> a]; - symbol[Sequence @@ indices] - ]; - -CreateLocalConstRefsIgnoringMixings[expr_, mixings_List] := - Module[{symbols, poleMasses}, - symbols = Parameters`FindAllParameters[expr]; - poleMasses = { - Cases[expr, FlexibleSUSY`Pole[FlexibleSUSY`M[a_]] /; MemberQ[Parameters`GetOutputParameters[],FlexibleSUSY`M[a]] :> FlexibleSUSY`M[a], {0,Infinity}], - Cases[expr, FlexibleSUSY`Pole[FlexibleSUSY`M[a_[__]]] /; MemberQ[Parameters`GetOutputParameters[],FlexibleSUSY`M[a]] :> FlexibleSUSY`M[a], {0,Infinity}] - }; - symbols = DeleteDuplicates[Flatten[symbols]]; - symbols = Complement[symbols, mixings]; - Parameters`CreateLocalConstRefs[symbols] - ]; - -CreateNeededCouplingFunction[coupling_, expr_, mixings_List] := - Module[{symbol, prototype = "", definition = "", - indices = {}, localExpr, body = "", functionName = "", i, - type, typeStr}, - indices = GetParticleIndicesInCoupling[coupling]; - symbol = CreateCouplingSymbol[coupling]; - functionName = CConversion`ToValidCSymbolString[CConversion`GetHead[symbol]]; - functionName = functionName <> "("; - For[i = 1, i <= Length[indices], i++, - If[i > 1, functionName = functionName <> ", ";]; - functionName = functionName <> "int "; - If[!IntegerQ[indices[[i]]] && !FreeQ[expr, indices[[i]]], - functionName = functionName <> CConversion`ToValidCSymbolString[indices[[i]]]; - ]; - ]; - functionName = functionName <> ")"; - If[Parameters`IsRealExpression[expr], - type = CConversion`ScalarType[CConversion`realScalarCType];, - type = CConversion`ScalarType[CConversion`complexScalarCType];]; - typeStr = CConversion`CreateCType[type]; - prototype = typeStr <> " " <> functionName <> " const;\n"; - definition = typeStr <> " " <> FlexibleSUSY`FSModelName - <> "_effective_couplings::" <> functionName <> " const\n{\n"; - localExpr = expr /. (Rule[#[],#]& /@ Parameters`GetDependenceSPhenoSymbols[]); - localExpr = localExpr /. Parameters`GetDependenceSPhenoRules[]; - body = CreateLocalConstRefsIgnoringMixings[localExpr, mixings] <> "\n" <> - "const " <> typeStr <> " result = " <> - Parameters`ExpressionToString[localExpr] <> ";\n\n" <> - "return result;\n"; - body = TextFormatting`IndentText[TextFormatting`WrapLines[body]]; - definition = definition <> body <> "}\n"; - {prototype, definition} - ]; - -CreateNeededVertexExpressions[vertexRules_List, mixings_List] := - Module[{k, prototypes = "", defs = "", coupling, expr, - p, d}, - For[k = 1, k <= Length[vertexRules], k++, - coupling = Vertices`ToCp[vertexRules[[k,1]]]; - expr = vertexRules[[k,2]]; - {p, d} = CreateNeededCouplingFunction[coupling, expr, mixings]; - prototypes = prototypes <> p; - defs = defs <> d <> "\n"; - ]; - {prototypes, defs} - ]; - -HasColorCharge[particle_] := - Module[{dynkin}, - dynkin = SA`Dynkin[particle,Position[SARAH`Gauge, SARAH`strongCoupling][[1,1]]]; - If[!NumericQ[dynkin], dynkin = 0]; - dynkin == 1/2 - ]; - -CreateCouplingContribution[particle_, vectorBoson_, coupling_] := - Module[{i, internal, particleIndex, indices, dim, start, factor, qcdfactor, - mass, massStr, couplingSymbol, couplingName, - scaleFunction, body = "", result = "", parameters = {}}, - internal = DeleteCases[Vertices`GetParticleList[coupling] /. field_[{__}] :> field, - p_ /; p === particle, 1]; - internal = First[internal /. {SARAH`bar[p_] :> p, Susyno`LieGroups`conj[p_] :> p}]; - dim = TreeMasses`GetDimension[internal]; - mass = FlexibleSUSY`M[internal]; - massStr = CConversion`ToValidCSymbolString[mass]; - If[dim != 1, - massStr = massStr <> "(gI1)"; - ]; - parameters = Append[parameters, mass]; - Which[TreeMasses`IsScalar[internal], - factor = 1/2; - If[particle === SARAH`HiggsBoson, - scaleFunction = "AS0"; - If[vectorBoson === SARAH`VectorP && HasColorCharge[internal], - qcdfactor = "scalar_scalar_qcd_factor(decay_mass, " <> massStr <> ")";, - qcdfactor = ""; - ];, - Return[{"",{}}]; - ];, - TreeMasses`IsVector[internal], - factor = -1/2; - If[particle === SARAH`HiggsBoson, - scaleFunction = "AS1"; - qcdfactor = "";, - Return[{"",{}}]; - ];, - TreeMasses`IsFermion[internal], - factor = 1; - If[particle === SARAH`HiggsBoson, - scaleFunction = "AS12"; - If[vectorBoson === SARAH`VectorP && HasColorCharge[internal], - qcdfactor = "scalar_fermion_qcd_factor(decay_mass, " <> massStr <> ")";, - qcdfactor = ""; - ];, - scaleFunction = "AP12"; - If[vectorBoson === SARAH`VectorP && HasColorCharge[internal], - qcdfactor = "pseudoscalar_fermion_qcd_factor(decay_mass, " <> massStr <> ")";, - qcdfactor = ""; - ]; - ]; - ]; - If[vectorBoson === SARAH`VectorP, - factor = factor * TreeMasses`GetElectricCharge[internal]^2 GetMultiplicity[vectorBoson, internal]; - ]; - indices = GetParticleIndicesInCoupling[coupling]; - particleIndex = GetParticleGenerationIndex[particle, coupling]; - indices = Replace[indices, p_ /; !MemberQ[particleIndex, p] -> SARAH`gI1, 1]; - indices = Replace[indices, p_ /; MemberQ[particleIndex, p] -> SARAH`gO1, 1]; - couplingSymbol = CConversion`ToValidCSymbol[coupling /. a_[List[__]] :> a]; - couplingSymbol = couplingSymbol[Sequence @@ indices]; - couplingName = CConversion`ToValidCSymbolString[CConversion`GetHead[couplingSymbol]]; - couplingName = couplingName <> "("; - For[i = 1, i <= Length[indices], i++, - If[i > 1, couplingName = couplingName <> ", ";]; - If[!IntegerQ[indices[[i]]], - couplingName = couplingName <> CConversion`ToValidCSymbolString[indices[[i]]]; - ]; - ]; - couplingName = couplingName <> ")"; - body = "result += " <> If[factor != 1, CConversion`RValueToCFormString[factor] <> " * ", ""] - <> If[qcdfactor != "", qcdfactor <> " * ", ""] <> couplingName - <> " * vev * " <> scaleFunction <> "(decay_scale / Sqr(" <> massStr <> ")) / " - <> If[IsFermion[internal], massStr, "Sqr(" <> massStr <> ")"] <> ";"; - If[dim == 1, - result = body <> "\n";, - start = TreeMasses`GetDimensionStartSkippingGoldstones[internal]; - result = "for (int gI1 = " <> ToString[start - 1] <> "; gI1 < " <> ToString[dim] <> "; ++gI1) {\n"; - result = result <> TextFormatting`IndentText[body] <> "\n}\n"; - ]; - {result, parameters} - ]; - -CreateEffectiveCouplingFunction[coupling_] := - Module[{i, couplingSymbol = coupling[[1]], neededCouplings = coupling[[2]], - particle, vectorBoson, dim, type, name, savedMass, mass, mixingSymbol, - mixingName, parameters = {}, poleMasses, currentLine, body = "", result = ""}, - {particle, vectorBoson} = GetExternalStates[couplingSymbol]; - If[particle =!= Null && vectorBoson =!= Null, - name = CreateEffectiveCouplingName[particle, vectorBoson]; - dim = TreeMasses`GetDimension[particle]; - result = result <> "void " <> FlexibleSUSY`FSModelName - <> "_effective_couplings::calculate_" <> name <> "("; - If[dim == 1, - result = result <> ")\n{\n";, - result = result <> "int gO1)\n{\n"; - ]; - - mass = CConversion`ToValidCSymbolString[FlexibleSUSY`M[particle]]; - savedMass = "const auto decay_mass = PHYSICAL(" <> mass <> ")"; - If[dim == 1, - savedMass = savedMass <> ";\n";, - savedMass = savedMass <> "(gO1);\n"; - ]; - body = body <> savedMass; - body = body <> "const auto decay_scale = 0.25 * Sqr(decay_mass);\n"; - (* use physical mixing matrices for decaying particle *) - mixingSymbol = TreeMasses`FindMixingMatrixSymbolFor[particle]; - If[mixingSymbol =!= Null, - mixingName = CConversion`ToValidCSymbolString[mixingSymbol]; - body = body <> "const auto saved_" <> mixingName <> " = " <> mixingName <> ";\n"; - body = body <> mixingName <> " = PHYSICAL(" <> mixingName <> ");\n\n";, - body = body <> "\n"; - ]; - {currentLine, parameters} = {#[[1]], Join[parameters, #[[2]]]}& @ (GetEffectiveVEV[]); - body = body <> currentLine <> "\n"; - body = body <> CConversion`CreateDefaultDefinition["result", CConversion`ScalarType[CConversion`complexScalarCType]] <> ";\n"; - - For[i = 1, i <= Length[neededCouplings], i++, - {currentLine, parameters} = {#[[1]], Join[parameters, #[[2]]]}& @ (CreateCouplingContribution[particle, vectorBoson, neededCouplings[[i]]]); - body = body <> currentLine; - ]; - - Which[particle === SARAH`HiggsBoson && vectorBoson === SARAH`VectorG, - body = body <> "result *= 0.75;\n\n"; - body = body <> "if (include_qcd_corrections) {\n" - <> TextFormatting`IndentText["result *= scalar_scaling_factor(decay_mass);"] <> "\n}\n";, - particle === SARAH`PseudoScalar && vectorBoson === SARAH`VectorP, - body = body <> "result *= 2.0;\n";, - particle === SARAH`PseudoScalar && vectorBoson === SARAH`VectorG, - body = body <> "result *= 1.5;\n\n"; - body = body <> "if (include_qcd_corrections) {\n" - <> TextFormatting`IndentText["result *= pseudoscalar_scaling_factor(decay_mass);"] <> "\n}\n"; - ]; - - If[vectorBoson === SARAH`VectorG, - parameters = Append[parameters, SARAH`strongCoupling]; - body = "const double alpha_s = " <> CConversion`RValueToCFormString[SARAH`strongCoupling^2 / (4 Pi)] - <> ";\n" <> body; - ]; - - (* use pole masses in loop functions *) - If[SARAH`SupersymmetricModel, - body = Parameters`CreateLocalConstRefs[DeleteDuplicates[parameters]] <> body <> "\n";, - poleMasses = DeleteDuplicates[Select[parameters, Parameters`IsOutputParameter]]; - body = Parameters`CreateLocalConstRefsForPhysicalParameters[poleMasses] <> body <> "\n"; - body = Parameters`CreateLocalConstRefs[DeleteDuplicates[Complement[parameters, poleMasses]]] <> body <> "\n"; - ]; - - If[vectorBoson === SARAH`VectorP, - body = body <> "result *= " - <> CConversion`RValueToCFormString[1 / (2^(3/4) Pi)] - <> " * physical_input.get(Physical_input::alpha_em_0) * Sqrt(qedqcd.displayFermiConstant());\n\n";, - body = body <> "result *= " - <> CConversion`RValueToCFormString[2^(1/4) / (3 Pi)] - <> " * alpha_s * Sqrt(qedqcd.displayFermiConstant());\n\n"; - ]; - - (* restore saved mixing *) - If[mixingSymbol =!= Null, - body = body <> mixingName <> " = saved_" <> mixingName <> ";\n"; - ]; - body = body <> name <> If[dim != 1, "(gO1) = ", " = "] <> "result;\n"; - - result = result <> TextFormatting`IndentText[TextFormatting`WrapLines[body]] <> "\n}\n"; - ]; - result - ]; - -CreateEffectiveCouplingsPrototypes[couplings_List] := - Module[{result = ""}, - (result = result <> CreateEffectiveCouplingPrototype[#])& /@ couplings; - result - ]; - -CreateEffectiveCouplingsFunctions[couplings_List] := - Module[{result = ""}, - (result = result <> CreateEffectiveCouplingFunction[#] <> "\n")& /@ couplings; - result - ]; - -CreateEffectiveCouplings[couplings_List, massMatrices_List, vertexRules_List] := - Module[{mixings, relevantVertexRules, verticesPrototypes, - verticesFunctions,prototypes = "", functions = ""}, - mixings = Cases[Flatten[TreeMasses`GetMixingMatrixSymbol[#]& /@ massMatrices], Except[Null]]; - relevantVertexRules = Cases[vertexRules, r:(Rule[a_,b_] /; !FreeQ[couplings,a]) :> r]; - {verticesPrototypes, verticesFunctions} = - CreateNeededVertexExpressions[relevantVertexRules, mixings]; - prototypes = prototypes <> verticesPrototypes - <> CreateEffectiveCouplingsPrototypes[couplings]; - functions = functions <> verticesFunctions - <> CreateEffectiveCouplingsFunctions[couplings]; - {prototypes, functions} - ]; - -End[]; - -EndPackage[]; diff --git a/meta/FFVFormFactors.m b/meta/FFVFormFactors.m index c2ff3bba88..2498307073 100644 --- a/meta/FFVFormFactors.m +++ b/meta/FFVFormFactors.m @@ -34,8 +34,12 @@ why such a weird numbering? because some procedure uses this order for fermion number flow."; FFVContributingDiagramsForGraph::usage = ""; +IsDiagramSupported::usage = "For the input FFV graph, determines whether +the input diagram is valid, by checking whether the internal structure is +supported and the emitting fields can in fact emit the vector." +IsChargedUnder::usage="Returns whether or not a field is charged under a given vectors gauge"; -Begin["Private`"]; +Begin["`Private`"]; vertexCorrectionGraph = { {0, 1, 0, 0, 0, 0}, @@ -51,6 +55,7 @@ EmitterL[diagram_] := diagram[[3,2]]; EmitterR[diagram_] := diagram[[2,2]]; Spectator[diagram_] := diagram[[2,3]]; +EmittedV[diagram_] := diagram[[3,3]]; FFVContributingDiagramsForGraph[graph_, Fj_ -> {Fi_, V_}] := Module[{diagrams}, @@ -65,35 +70,67 @@ ]; IsDiagramSupported[graph_, diagram_] := - Module[{photonEmitter, exchangeParticle, photonEmitterAfter}, + Module[{vectorEmitter, exchangeParticle, vectorEmitterAfter, vectorBoson}, - photonEmitter = diagram[[3,2]]; (* Edge between vertices ? and ? (3rd edge of vertex 4) *) - photonEmitterAfter = diagram[[2,2]]; - exchangeParticle = diagram[[2,3]]; (* Edge between vertices ? and ? (2nd edge of vertex 4) *) + vectorEmitter = EmitterL[diagram]; (* Edge between vertices ? and ? (3rd edge of vertex 4) *) + vectorEmitterAfter = EmitterR[diagram]; + exchangeParticle = Spectator[diagram]; (* Edge between vertices ? and ? (2nd edge of vertex 4) *) + vectorBoson = EmittedV[diagram]; - If[TreeMasses`IsFermion[photonEmitter] && - TreeMasses`IsFermion[photonEmitterAfter] - && TreeMasses`IsScalar[exchangeParticle], + If[Not[IsChargedUnder[vectorEmitter,vectorBoson] && IsChargedUnder[vectorEmitterAfter,vectorBoson]], + Return[False]; + ]; + + If[TreeMasses`IsFermion[vectorEmitter] && TreeMasses`IsFermion[vectorEmitterAfter] && TreeMasses`IsScalar[exchangeParticle], + Return[True] + ]; + + If[TreeMasses`IsFermion[exchangeParticle] && TreeMasses`IsScalar[vectorEmitter] &&TreeMasses`IsScalar[vectorEmitterAfter], + Return[True] + ]; + + If[TreeMasses`IsFermion[vectorEmitter] && TreeMasses`IsFermion[vectorEmitterAfter] && TreeMasses`IsVector[exchangeParticle], + Return[True] + ]; + + If[TreeMasses`IsFermion[exchangeParticle] && TreeMasses`IsVector[vectorEmitter] && TreeMasses`IsVector[vectorEmitterAfter], + Return[True] + ]; + + If[TreeMasses`IsFermion[exchangeParticle] && TreeMasses`IsVector[vectorEmitter] && TreeMasses`IsScalar[vectorEmitterAfter], Return[True] ]; - If[TreeMasses`IsFermion[exchangeParticle] && TreeMasses`IsScalar[photonEmitter] &&TreeMasses`IsScalar[photonEmitterAfter], + If[TreeMasses`IsFermion[exchangeParticle] && TreeMasses`IsScalar[vectorEmitter] && TreeMasses`IsVector[vectorEmitterAfter], Return[True] ]; - Print["Warning: Diagram with internal particles of type ", - StringJoin @@ (ToString /@ SARAH`getType /@ {EmitterL[diagram], EmitterR[diagram], Spectator[diagram]})]; - Print[" is currently not supported."]; - Print[" Discarding diagram with particles ", - {EmitterL[diagram], EmitterR[diagram], Spectator[diagram]}, "."]; + Utils`FSFancyWarning[ + "Diagram with internal particles of type ", + StringJoin[ToString/@ SARAH`getType/@ {EmitterL[diagram], EmitterR[diagram], Spectator[diagram]}], + " is currently not supported. Discarding diagram with particles ", + ToString@{EmitterL[diagram], EmitterR[diagram], Spectator[diagram]}, + "." + ]; Return[False]; ]; +IsChargedUnder[field_, vector_?IsVector] := + Which[(*Check 2 special cases first which are quicker*) + TreeMasses`IsPhoton[vector], TreeMasses`IsElectricallyCharged[field], + TreeMasses`IsGluon[vector], TreeMasses`ColorChargedQ[field], + (*Else check that this field coupled with its anti-field can emit this vector*) + (*Note this will not work for vectors that couple to two different fields, e.g. W-bosons*) + True, SARAH`Vertex[{SARAH`AntiField[field], field, + vector}, UseDependences -> True][[2, 1]] =!= 0 + ] + FFVFormFactorsCreateInterfaceFunction[Fj_ -> {Fi_, V_}, topologies_, diagrams_] := - Module[{prototype, definition, + Module[{prototype, definition, templateWrapperDecl, templateWrapperDef, numberOfIndices1 = CXXDiagrams`NumberOfFieldIndices[Fj], numberOfIndices2 = CXXDiagrams`NumberOfFieldIndices[Fi], - numberOfIndices3 = CXXDiagrams`NumberOfFieldIndices[V], temp = {}}, + numberOfIndices3 = CXXDiagrams`NumberOfFieldIndices[V], temp = {}, + defPrefix = FlexibleSUSY`FSModelName <> "_cxx_diagrams::fields"}, Utils`AssertWithMessage[Length[topologies] === Length[diagrams], "Length of diagrams should be the same as length of topologies"]; @@ -103,6 +140,73 @@ temp = temp <> CreateCall[Fj, Fi, V, topologies[[i]], diagrams[[i,j]]]; ]; ]; + + templateWrapperDecl = + "template \n" <> + "std::enable_if_t<\n" <> + IndentText[ + "std::is_same_v CXXNameOfField[Fj, prefixNamespace->defPrefix] <> "> && std::is_same_v CXXNameOfField[Fi, prefixNamespace->defPrefix] <> "> && std::is_same_v CXXNameOfField[V, prefixNamespace->defPrefix] <> ">,\n" <> + "std::valarray>\n" + ] <> ">\n" <> + "calculate_form_factors(" <> + IndentText[ + If[TreeMasses`GetDimension[Fj] =!= 1, + "int, ", + " " + ] <> + If[TreeMasses`GetDimension[Fi] =!= 1, + "int,\n", + " " + ] + ] <> + "const " <> FlexibleSUSY`FSModelName <> "_mass_eigenstates&, bool);"; + + templateWrapperDef = + "template \n" <> + "std::enable_if_t<\n" <> + IndentText[ + "std::is_same_v CXXNameOfField[Fj] <> "> && std::is_same_v CXXNameOfField[Fi] <> "> && std::is_same_v CXXNameOfField[V] <> ">,\n" <> + "std::valarray>\n" + ] <> ">\n" <> + "calculate_form_factors(" <> + IndentText[ + If[TreeMasses`GetDimension[Fj] =!= 1, + "int generationIndex1, ", + " " + ] <> + If[TreeMasses`GetDimension[Fi] =!= 1, + "int generationIndex2,\n", + " " + ] <> + "const " <> FlexibleSUSY`FSModelName <> "_mass_eigenstates& model, bool discard_SM_contributions) {\n" + ] <> + "return calculate_" <> CXXNameOfField[Fj] <> + "_" <> CXXNameOfField[Fi] <> "_" <> CXXNameOfField[V] <> "_form_factors(" <> + IndentText[ + If[TreeMasses`GetDimension[Fj] =!= 1, + "generationIndex1, ", + " " + ] <> + If[TreeMasses`GetDimension[Fi] =!= 1, + "generationIndex2,\n", + " " + ] <> + "model, discard_SM_contributions);" + ] <> "\n}\n" <> + "template std::valarray> calculate_form_factors<" <> + StringRiffle[CXXNameOfField /@ {Fj, Fi, V}, ","] <> ">(" <> + IndentText[ + If[TreeMasses`GetDimension[Fj] =!= 1, + "int, ", + " " + ] <> + If[TreeMasses`GetDimension[Fi] =!= 1, + "int,\n", + " " + ] <> + "const " <> FlexibleSUSY`FSModelName <> "_mass_eigenstates&, bool);" + ]; + prototype = "std::valarray> calculate_" <> CXXNameOfField[Fj] <> "_" <> CXXNameOfField[Fi] <> "_" <> CXXNameOfField[V] <> "_form_factors (\n" <> @@ -129,7 +233,7 @@ StringJoin @ Table[", 0", {numberOfIndices1-1}], ""] <> " ", If[numberOfIndices1 =!= 0, - StringJoin @ Riffle[Table[" 0", {numberOfIndices1}], ", "], + StringRiffle[Table[" 0", {numberOfIndices1}], ", "], ""] ] <> "};\n" <> "std::array ToString @ numberOfIndices2 <> @@ -140,7 +244,7 @@ StringJoin @ Table[", 0", {numberOfIndices2-1}], ""] <> " ", If[numberOfIndices2 =!= 0, - StringJoin @ Riffle[Table[" 0", {numberOfIndices2}], ", "] <> " ", + StringRiffle[Table[" 0", {numberOfIndices2}], ", "] <> " ", ""] ] <> "};\n\n" <> @@ -153,15 +257,19 @@ ] <> "\n}\n\n"; - {prototype <> ";", definition} + {prototype <> ";", definition, templateWrapperDecl, templateWrapperDef} ]; CreateCall[Fj_, Fi_, V_, topology_, diagram_] := "val += std::complex " <> - ToString @ N @ FSReIm @ CXXDiagrams`ExtractColourFactor @ CXXDiagrams`ColorFactorForDiagram[topology, diagram] <> " * FFV_" <> + ToString @ N @ ReIm @ CXXDiagrams`ExtractColourFactor @ CXXDiagrams`ColorFactorForDiagram[topology, diagram] <> " * FFV_" <> StringJoin @@ (ToString /@ SARAH`getType /@ {EmitterL[diagram], EmitterR[diagram], Spectator[diagram]}) <> "<" <> - StringJoin @ Riffle[CXXDiagrams`CXXNameOfField /@ {Fj, Fi, V, EmitterL[diagram], EmitterR[diagram], Spectator[diagram]}, ","] <> + StringRiffle[CXXDiagrams`CXXNameOfField /@ {Fj, Fi, V, EmitterL[diagram], EmitterR[diagram], Spectator[diagram]}, ","] <> ">::value(indices1, indices2, context, discard_SM_contributions);\n"; +CalculateFormFactorsForwardDeclaration[Fj_, Fi_, V_] := +"template calculate_form_factors<" <> StringRiffle[CXXDiagrams`CXXNameOfField /@ {Fj, Fi, V}, ","] <> ">(" <> +"int, int, const " <> FlexibleSUSY`FSModelName <> " _mass_eigenstates&, bool);" + End[]; EndPackage[]; diff --git a/meta/FSMathLink.m b/meta/FSMathLink.m index 3594962493..c12dbecc20 100644 --- a/meta/FSMathLink.m +++ b/meta/FSMathLink.m @@ -20,7 +20,7 @@ *) -BeginPackage["FSMathLink`", {"CConversion`", "Parameters`", "Utils`"}]; +BeginPackage["FSMathLink`", {"CConversion`", "Parameters`", "Utils`", "TreeMasses`", "TextFormatting`"}]; GetNumberOfInputParameterRules::usage = ""; GetNumberOfSpectrumEntries::usage = ""; @@ -34,10 +34,15 @@ CreateSpectrumDecaysGetter::usage=""; CreateSpectrumDecaysInterface::usage=""; CreateSpectrumDecaysCalculation::usage=""; +CreateSpectrumDecaysEffCCalculation::usage=""; CreateModelDecaysCalculation::usage=""; +CreateSpectrumDecaysEffCInterface::usage=""; +CreateModelDecaysEffCCalculation::usage = ""; CreateMathLinkDecaysCalculation::usage=""; FillDecaysSLHAData::usage=""; PutDecays::usage=""; +PutEffCouplings::usage=""; +CalculateNormalizedEffectiveCouplings::usage = ""; Begin["`Private`"]; @@ -202,7 +207,7 @@ HeadToStr[sym_] := "\"" <> ToString[sym] <> "\""; HeadsToStr[{}] := ""; -HeadsToStr[l_List] := ", {" <> StringJoin[Riffle[HeadToStr /@ l, ", "]] <> "}"; +HeadsToStr[l_List] := ", {" <> StringRiffle[HeadToStr /@ l, ", "] <> "}"; PutObservable[obs_[sub_], type_, link_String, heads_:{}] := PutObservable[sub, type, link, Join[heads, {obs}]]; @@ -212,8 +217,12 @@ Observables`GetObservableName[Composition[Sequence @@ heads][obs]] <> "), " <> ObsToStr[obs] <> HeadsToStr[heads] <> ");\n"; -PutObservables[obs_List, link_String] := - StringJoin[PutObservable[#, Observables`GetObservableType[#], link]& /@ obs]; +PutObservables[obs_List, link_String] := ( + If[FlexibleSUSY`FSFeynArtsAvailable && FlexibleSUSY`FSFormCalcAvailable, + Utils`DynamicInclude@FlexibleSUSY`$observablesWildcard@"FSMathLink.m"; + ]; + StringJoin[PutObservable[#, Observables`GetObservableType@#, link]& /@ obs] +); CreateSeparatorLine[len_:66] := Module[{i}, "/" <> StringJoin[Table["*", {i, 1, len}]] <> "/"]; @@ -233,10 +242,13 @@ CreateSpectrumDecaysInterface[modelName_] := "virtual void " <> CreateSpectrumDecaysCalculationName[] <> "(const softsusy::QedQcd&, const Physical_input&, const FlexibleDecay_settings&) = 0;"; +CreateSpectrumDecaysEffCInterface[modelName_] := + "virtual void calculate_normalized_effc(const Physical_input&, const softsusy::QedQcd&, const Spectrum_generator_settings&, const FlexibleDecay_settings&) = 0;"; + CreateSpectrumDecaysCalculation[modelName_] := Module[{prototype = "", args = "", body = "", function = ""}, prototype = "virtual void " <> CreateSpectrumDecaysCalculationName[] <> - "(const softsusy::QedQcd&, const Physical_input&, const FlexibleDecay_settings&) override;\n"; + "(const softsusy::QedQcd&, const Physical_input&, const FlexibleDecay_settings&) override;"; args = "const softsusy::QedQcd& qedqcd, const Physical_input& physical_input, const FlexibleDecay_settings& flexibledecay_settings"; body = "decays = " <> modelName <> "_decays(std::get<0>(models), qedqcd, physical_input, flexibledecay_settings);\n" <> "decays.calculate_decays();\n"; @@ -249,9 +261,22 @@ {prototype, function} ]; +CreateSpectrumDecaysEffCCalculation[modelName_] := + Module[{prototype = "", args = "", body = "", function = ""}, + prototype = "virtual void calculate_normalized_effc(const Physical_input&, const softsusy::QedQcd&, const Spectrum_generator_settings&, const FlexibleDecay_settings&) override;"; + args = "const Physical_input& physical_input, const softsusy::QedQcd& qedqcd, const Spectrum_generator_settings& settings, const FlexibleDecay_settings& flexibledecay_settings"; + body = "normalized_higgs_effc = get_normalized_effective_couplings(decays.get_neutral_higgs_effc(), physical_input, qedqcd, settings, flexibledecay_settings);\n"; + function = "template \n" <> + "void " <> modelName <> "_spectrum_impl::calculate_normalized_effc(\n" <> + TextFormatting`IndentText[args <> ")\n"] <> "{\n" <> + TextFormatting`IndentText[body] <> "}\n"; + function = "\n" <> CreateSeparatorLine[] <> "\n\n" <> function; + {prototype, function} + ]; + CreateModelDecaysCalculation[modelName_] := Module[{prototype = "", body = "", function = ""}, - prototype = "void " <> CreateModelDecaysCalculationName[] <> "();\n"; + prototype = "void " <> CreateModelDecaysCalculationName[] <> "();"; body = "check_spectrum_pointer();\n" <> "const bool loop_library_for_decays =\n" <> TextFormatting`IndentText[ @@ -274,6 +299,30 @@ {prototype, function} ]; +CreateModelDecaysEffCCalculation[modelName_] := + Module[{prototype = "", body = "", function = ""}, + prototype = "void calculate_normalized_effc();"; + body = "check_spectrum_pointer();\n" <> + "const bool loop_library_for_decays =\n" <> + TextFormatting`IndentText[ + "(Loop_library::get_type() == Loop_library::Library::Collier) ||\n" <> + "(Loop_library::get_type() == Loop_library::Library::Looptools);\n" + ] <> + "if (flexibledecay_settings.get(FlexibleDecay_settings::calculate_decays)) {\n" <> + TextFormatting`IndentText[ + "if (loop_library_for_decays) {\n" <> + TextFormatting`IndentText["spectrum->calculate_normalized_effc(physical_input, qedqcd, settings, flexibledecay_settings);\n"] <> "}\n" <> + "else if (!loop_library_for_decays) {\n" <> + TextFormatting`IndentText[ + "WARNING(\"Decay module requires a dedicated loop library. Configure FlexibleSUSY with Collier or LoopTools and set appropriately flag 31 in Block FlexibleSUSY of the LesHouches input.\");\n" + ] <> "}\n" + ] <> "}\n"; + function = "\n" <> CreateSeparatorLine[] <> "\n\n" <> + "void Model_data::calculate_normalized_effc()\n{\n" <> + TextFormatting`IndentText[body] <> "}\n"; + {prototype, function} + ]; + FillDecaysSLHAData[] := "const auto& decays_problems = decays.get_problems();\n" <> "const bool loop_library_for_decays =\n" <> @@ -284,7 +333,28 @@ "if ((!decays_problems.have_problem() && loop_library_for_decays) || force_output) {\n" <> TextFormatting`IndentText[ "slha_io.set_dcinfo(decays_problems);\n" <> - "slha_io.set_decays(decays.get_decay_table(), flexibledecay_settings);\n" + "slha_io.set_decays(decays.get_decay_table(), flexibledecay_settings);\n" <> + "if (flexibledecay_settings.get(FlexibleDecay_settings::print_effc_block)) {\n" <> + TextFormatting`IndentText["slha_io.set_effectivecouplings_block(decays.get_effhiggscouplings_block_input());\n"] <> + "}\n" <> + "if (flexibledecay_settings.get(FlexibleDecay_settings::calculate_normalized_effc)) {\n" <> + TextFormatting`IndentText[ + "slha_io.set_normalized_effectivecouplings_block(get_normalized_higgs_effc());\n" <> + "slha_io.set_imnormalized_effectivecouplings_block(get_normalized_higgs_effc());\n" + ] <> + "}\n" <> + "if (flexibledecay_settings.get(FlexibleDecay_settings::call_higgstools)) {\n" <> + TextFormatting`IndentText[ + "const SignalResult& hs = get_higgssignals_output();\n" <> + "slha_io.set_hs_or_lilith(\"HIGGSSIGNALS\", hs.ndof, hs.chi2BSM, hs.chi2SM, hs.mhRef, hs.pval);\n" + ] <> + "}\n" <> + "if (flexibledecay_settings.get(FlexibleDecay_settings::call_lilith)) {\n" <> + TextFormatting`IndentText[ + "const std::vector>& hb = get_higgsbounds_output();\n" <> + "slha_io.set_higgsbounds(hb);\n" + ] <> + "}\n" ] <> "}"; @@ -299,6 +369,65 @@ TextFormatting`IndentText["MLPut(link, id);\n"] <> "}\n" <> "MLPut(link, " <> decayName <> ".get_width());\n"; +PutEffCTableEntries[modelName_] := + Module[{body = "", particleList = {}}, + body = "for (const auto& d : effc) {\n" <> + IndentText[ + "const auto multiplet_and_index_pair = " <> modelName <> "_info::get_multiplet_and_index_from_pdg(d.pdgid);\n" <> + "if (multiplet_and_index_pair.second) {\n" <> + TextFormatting`IndentText[ + "MLPutFunction(link, \"Rule\", 2);\n" <> + "MLPutFunction(link, multiplet_and_index_pair.first.c_str(), 1);\n" <> + "MLPutInteger(link, multiplet_and_index_pair.second.value());\n" + ] <> + "}\n" <> + "else {\n" <> + TextFormatting`IndentText["MLPutRule(link, multiplet_and_index_pair.first.c_str());\n"] <> + "}\n" <> + "MLPutFunction(link, \"List\", 2);\n" <> + "MLPut(link, d.pdgid);\n" <> + "MLPutFunction(link, \"List\", 14);\n\n" <> + "std::array, double>, 5> bosonChannel {\n" <> + IndentText[ + StringRiffle[ + ("std::pair, double> {" <> #[[1]] <> ", d." <> #[[2]] <> ".second}")& /@ { {"{-24, 24}", "WW"}, {"{23, 23}", "ZZ"}, {"{22, 23}", "Zgam"}, {"{21, 21}", "gg"}, {"{22, 22}", "gamgam"} }, + ",\n" + ] + ] <> "\n};\n" <> + "for (const auto& el : bosonChannel) {\n" <> + IndentText[ + "MLPutFunction(link, \"List\", 3);\n" <> + "MLPut(link, d.pdgid);\n" <> + "MLPutFunction(link, \"List\", 2);\n" <> + "MLPut(link, el.first.first);\n" <> + "MLPut(link, el.first.second);\n" <> + "MLPut(link, el.second);\n" + ] <> "}\n" <> + "std::array>, 9> fermionChannel {\n" <> + IndentText[ + StringRiffle[ + ("std::pair> {" <> ToString[#[[1]]] <> ", d." <> #[[2]] <> ".second}")& /@ { + {1, "dd"}, {2, "uu"}, {3, "ss"}, {4, "cc"}, {5, "bb"}, {6, "tt"}, + {11, "ee"}, {13, "mumu"}, {15, "tautau"} + }, + ",\n" + ] + ] <> "\n};\n" <> + "for (const auto& el : fermionChannel) {\n" <> + IndentText[ + "MLPutFunction(link, \"List\", 3);\n" <> + "MLPut(link, d.pdgid);\n" <> + "MLPutFunction(link, \"List\", 2);\n" <> + "MLPut(link, -el.first);\n" <> + "MLPut(link, el.first);\n" <> + "MLPut(link, el.second);" + ] <> "\n}\n" + ] <> + "}\n"; + + body + ]; + PutDecayTableEntries[modelName_] := Module[{body = ""}, body = "const auto pid = decays_list.get_particle_id();\n" <> @@ -316,7 +445,7 @@ TextFormatting`IndentText[ "MLPutFunction(link, \"Rule\", 2);\n" <> "MLPutFunction(link, multiplet_and_index_pair.first.c_str(), 1);\n" <> - "MLPutInteger(link, multiplet_and_index_pair.second.get());\n" + "MLPutInteger(link, multiplet_and_index_pair.second.value());\n" ] <> "}\n" <> "else {\n" <> @@ -345,6 +474,26 @@ "}\n" ]; + +PutEffCouplings[modelName_] := + Module[{prototype = "", body = "", function = ""}, + prototype = "void put_eff_couplings(MLINK link) const;\n"; + + body = "check_spectrum_pointer();\n" <> + "auto const& effc = get_normalized_higgs_effc();\n\n" <> + "const auto number_of_states = effc.size();\n" <> + "MLPutFunction(link, \"List\", 1);\n" <> + "MLPutRule(link, " <> modelName <> "_info::model_name);\n" <> + "MLPutFunction(link, \"List\", number_of_states);\n\n" <> + PutEffCTableEntries[modelName] <> "\n" <> + "MLEndPacket(link);\n"; + + function = "\n" <> CreateSeparatorLine[] <> "\n\n" <> + "void Model_data::put_eff_couplings(MLINK link) const\n{\n" <> + TextFormatting`IndentText[body] <> "}\n"; + {prototype, function} + ]; + PutDecays[modelName_] := Module[{prototype = "", body = "", function = ""}, prototype = "void " <> PutDecaysFunctionName[] <> "(MLINK link) const;\n"; @@ -389,14 +538,17 @@ { Redirect_output crd(link); - auto setting = data.get_settings(); - if (!static_cast(setting.get(flexiblesusy::Spectrum_generator_settings::calculate_sm_masses)) || - !static_cast(setting.get(flexiblesusy::Spectrum_generator_settings::calculate_bsm_masses))) { + auto settings = data.get_settings(); + auto fdSettings = data.get_fd_settings(); + if (settings.get(flexiblesusy::Spectrum_generator_settings::calculate_sm_masses) == 0 || + settings.get(flexiblesusy::Spectrum_generator_settings::calculate_bsm_masses) == 0) { put_message(link, \"FSSMCalculateDecays\", \"warning\", \"Need SM and BSM masses. Setting flags FlexlibleSUSY[3] = FlexlibleSUSY[23] = 1.\"); - setting.set(flexiblesusy::Spectrum_generator_settings::calculate_sm_masses, 1.0); - setting.set(flexiblesusy::Spectrum_generator_settings::calculate_bsm_masses, 1.0); - data.set_settings(setting); + settings.set(flexiblesusy::Spectrum_generator_settings::calculate_sm_masses, 1.0); + settings.set(flexiblesusy::Spectrum_generator_settings::calculate_bsm_masses, 1.0); + data.set_settings(settings); + fdSettings.set(flexiblesusy::FlexibleDecay_settings::calculate_normalized_effc, 1.0); + data.set_fd_settings(fdSettings); data.calculate_spectrum(); } data.calculate_model_decays(); @@ -411,6 +563,30 @@ return LIBRARY_NO_ERROR; }\n"; +CalculateNormalizedEffectiveCouplings[modelName_] := + "\n" <> CreateSeparatorLine[] <> "\n\n" <> "\ +DLLEXPORT int FS" <> modelName <> "CalculateNormalizedEffectiveCouplings( + WolframLibraryData /* libData */, MLINK link) +{ + using namespace flexiblesusy::" <> modelName <> "_librarylink; + + if (!check_number_of_args(link, 1, \"FS" <> modelName <> "CalculateNormalizedEffectiveCouplings\")) + return LIBRARY_TYPE_ERROR; + + const auto hid = get_handle_from(link); + + try { + auto& data = find_data(hid); + data.calculate_normalized_effc(); + data.put_eff_couplings(link); + } catch (const flexiblesusy::Error& e) { + put_message(link, \"FS" <> modelName <> "CalculateNormalizedEffectiveCouplings\", \"error\", e.what()); + put_error_output(link); + } + + return LIBRARY_NO_ERROR; +}\n"; + End[]; EndPackage[]; diff --git a/meta/FToFConversionInNucleus.m b/meta/FToFConversionInNucleus.m deleted file mode 100644 index 124839b46b..0000000000 --- a/meta/FToFConversionInNucleus.m +++ /dev/null @@ -1,214 +0,0 @@ -(* ::Package:: *) - -(* :Copyright: - - ==================================================================== - This file is part of FlexibleSUSY. - - FlexibleSUSY 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. - - FlexibleSUSY 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 FlexibleSUSY. If not, see - . - ==================================================================== - -*) - -BeginPackage["FToFConversionInNucleus`", - {"SARAH`", "TextFormatting`", "TreeMasses`", "Vertices`", "CXXDiagrams`", "Utils`"} -]; - -FToFConversionInNucleusCreateInterface::usage = ""; - -Begin["`Private`"]; - -FToFConversionInNucleusCreateInterface[inFermion_ -> outFermion_] := -Module[ - { - inName = CXXNameOfField@inFermion, - outName = CXXNameOfField@outFermion, - prototype, definition, n=2 - }, - - Utils`AssertWithMessage[ - Count[GetVectorBosons[], el_ /; IsMassless[el]] === 2, - "We assume that there are only 2 massless vector bosons, i.e. photon and gluon" - ]; - - Utils`AssertWithMessage[ - TreeMasses`GetDimension[SARAH`UpQuark] === 3, - "We assume that up quarks have three generations" - ]; - - Utils`AssertWithMessage[ - TreeMasses`GetDimension[SARAH`DownQuark] === 3, - "We assume that down quarks have three generations" - ]; - - If[TreeMasses`GetDimension[inFermion] =!= 1,n=n+1]; - If[TreeMasses`GetDimension[outFermion] =!= 1,n=n+1]; - - prototype = - "double calculate_"<>inName<>"_to_"<>outName<>"_in_nucleus (\n"<> - If[TreeMasses`GetDimension[inFermion] =!= 1,"int generationIndex1, "," "]<> - If[TreeMasses`GetDimension[outFermion] =!= 1," int generationIndex2, "," "]<> - "const " <> FlexibleSUSY`FSModelName <> "_f_to_f_conversion::Nucleus nucleus,\n" <> - "const " <> FlexibleSUSY`FSModelName <> "_mass_eigenstates& model, const softsusy::QedQcd& qedqcd)"; - - definition = - prototype<> - " {\n"<> - IndentText[ - "\n" <> - "context_base context {model};\n" <> - "// get Fermi constant from Les Houches input file\n" <> - "const auto GF = qedqcd.displayFermiConstant();\n" <> - "constexpr bool discard_SM_contributions = false;\n" <> - - "const auto photon_penguin = calculate_"<>inName<>"_"<>outName<>"_" <> CXXNameOfField[SARAH`Photon]<>"_form_factors (" <> - If[TreeMasses`GetDimension[inFermion] =!= 1, "generationIndex1, ", " "]<> - If[TreeMasses`GetDimension[outFermion] =!= 1, " generationIndex2, ", " "]<>"model, discard_SM_contributions);\n" <> - - "\n// translate from the convention of Hisano, Moroi & Tobe to Kitano, Koike & Okada\n" <> - (* TODO: check the statement below *) - "// Hisano defines form factors A2 through a matrix element in eq. 14\n" <> - "// Kitano uses a lagrangian with F_munu. There is a factor of 2 from translation\n" <> - "// because Fmunu = qeps - eps q\n" <> - "const auto A2L = -0.5 * photon_penguin[2]/(4.*GF/sqrt(2.));\n" <> - "const auto A2R = -0.5 * photon_penguin[3]/(4.*GF/sqrt(2.));\n" <> - - "\n// ------ penguins ------\n" <> - "// 2 up and 1 down quark in proton (gp couplings)\n" <> - "// 1 up and 2 down in neutron (gn couplings)\n" <> - - "\n// mediator: massless vector\n" <> - "\n// construct 4-fermion operators from A1 form factors\n" <> - "// i q^2 A1 * (- i gmunu/q^2) * (-i Qq e) = GF/sqrt2 * gpV\n" <> - "// VP\n" <> - - "const auto uEMVectorCurrent =\n" <> - IndentText["vectorCurrent(model);\n"] <> - "const auto dEMVectorCurrent =\n" <> - IndentText["vectorCurrent(model);\n"] <> - "\n" <> - - "// the A1 term if the factor in front of q^2, the photon propagator is -1/q^2, we need only factor -1\n" <> - "auto gpLV = -sqrt(2.0)/GF * photon_penguin[0] * (2.*uEMVectorCurrent + dEMVectorCurrent);\n" <> - "auto gpRV = -sqrt(2.0)/GF * photon_penguin[1] * (2.*uEMVectorCurrent + dEMVectorCurrent);\n" <> - "auto gnLV = -sqrt(2.0)/GF * photon_penguin[0] * (uEMVectorCurrent + 2.*dEMVectorCurrent);\n" <> - "auto gnRV = -sqrt(2.0)/GF * photon_penguin[1] * (uEMVectorCurrent + 2.*dEMVectorCurrent);\n" <> - - "\n// all contributions\n" <> - - "auto "<>FlexibleSUSY`FSModelName<>"_npf_up = "<>FlexibleSUSY`FSModelName<> - "_cxx_diagrams::npointfunctions::zpinguins_u"<>ToString@inFermion<>ToString@outFermion<>"_1loop("<> - "model, std::arrayToString@n<>">{"<> - If[TreeMasses`GetDimension[inFermion] =!= 1, "generationIndex1,", ""]<>"0,"<> - If[TreeMasses`GetDimension[outFermion] =!= 1, "generationIndex2,", ""]<>"0}, std::array{});\n"<> - - "auto "<>FlexibleSUSY`FSModelName<>"_npf_down = "<>FlexibleSUSY`FSModelName<> - "_cxx_diagrams::npointfunctions::zpinguins_d"<>inName<>outName<>"_1loop("<> - "model, std::arrayToString@n<>">{"<> - If[TreeMasses`GetDimension[inFermion] =!= 1, "generationIndex1,", ""]<>"0,"<> - If[TreeMasses`GetDimension[outFermion] =!= 1, "generationIndex2,", ""]<>"0}, std::array{});\n"<> - - "auto "<>FlexibleSUSY`FSModelName<>"_npf_strange = "<>FlexibleSUSY`FSModelName<> - "_cxx_diagrams::npointfunctions::zpinguins_d"<>inName<>outName<>"_1loop("<> - "model, std::arrayToString@n<>">{"<> - If[TreeMasses`GetDimension[inFermion] =!= 1, "generationIndex1,", ""]<>"1,"<> - If[TreeMasses`GetDimension[outFermion] =!= 1, "generationIndex2,", ""]<>"1}, std::array{});\n"<> - "\n"<> - "// PDG 2018 data\n"<> - "double m_p = 0.938272081, m_n = 0.939565413;\n"<> - "//data from my notes\n"<> - "double m_init = context.mass<"<>ToString@inFermion<>">({generationIndex1});\n"<> - "double m_u = context.mass<"<>ToString@SARAH`UpQuark<>">({0});\n"<> - "double m_d = context.mass<"<>ToString@SARAH`DownQuark<>">({0});\n"<> - "double m_s = context.mass<"<>ToString@SARAH`DownQuark<>">({1});\n"<> - "\n"<> - "double GSpu = 0.021*m_p/m_u, GSpd = 0.041*m_p/m_d, GSps = 0.043*m_p/m_s;\n"<> - "double GSnu = 0.019*m_n/m_u, GSnd = 0.045*m_n/m_d, GSns = 0.043*m_n/m_s;\n"<> - "\n"<> - "double GVpu = 2., GVpd = 1.;\n"<> - "double GVnu = 1., GVnd = 2.;\n"<> - "\n"<> - "double GTpu = 0.77, GTpd = -0.23, GTps = 0.008;\n"<> - "double GTnu = 0.77, GTnd = -0.23, GTns = 0.008;\n"<> - "\n"<> - "//minus because of descending order in FormCalc spinor chains\n"<> - "std::complex CSLu = -( "<>FlexibleSUSY`FSModelName<>"_npf_up.at(0)+"<>FlexibleSUSY`FSModelName<>"_npf_up.at(1) )/2.;\n"<> - "std::complex CSRu = -( "<>FlexibleSUSY`FSModelName<>"_npf_up.at(2)+"<>FlexibleSUSY`FSModelName<>"_npf_up.at(3) )/2.;\n"<> - "std::complex CSLd = -( "<>FlexibleSUSY`FSModelName<>"_npf_down.at(0)+"<>FlexibleSUSY`FSModelName<>"_npf_down.at(1) )/2.;\n"<> - "std::complex CSRd = -( "<>FlexibleSUSY`FSModelName<>"_npf_down.at(2)+"<>FlexibleSUSY`FSModelName<>"_npf_down.at(3) )/2.;\n"<> - "std::complex CSLs = -( "<>FlexibleSUSY`FSModelName<>"_npf_strange.at(0)+"<>FlexibleSUSY`FSModelName<>"_npf_strange.at(1) )/2.;\n"<> - "std::complex CSRs = -( "<>FlexibleSUSY`FSModelName<>"_npf_strange.at(2)+"<>FlexibleSUSY`FSModelName<>"_npf_strange.at(3) )/2.;\n"<> - "\n"<> - "//minus because of descending order in FormCalc spinor chains\n"<> - "std::complex CVLu = -( "<>FlexibleSUSY`FSModelName<>"_npf_up.at(4)+"<>FlexibleSUSY`FSModelName<>"_npf_up.at(5) )/2.;\n"<> - "std::complex CVRu = -( "<>FlexibleSUSY`FSModelName<>"_npf_up.at(6)+"<>FlexibleSUSY`FSModelName<>"_npf_up.at(7) )/2.;\n"<> - "std::complex CVLd = -( "<>FlexibleSUSY`FSModelName<>"_npf_down.at(4)+"<>FlexibleSUSY`FSModelName<>"_npf_down.at(5) )/2.;\n"<> - "std::complex CVRd = -( "<>FlexibleSUSY`FSModelName<>"_npf_down.at(6)+"<>FlexibleSUSY`FSModelName<>"_npf_down.at(7) )/2.;\n"<> - "\n"<> - "//plus because of descending order in FormCalc spinor chains and definition of tensor operators\n"<> - "std::complex CTLu = +"<>FlexibleSUSY`FSModelName<>"_npf_up.at(8);\n"<> - "std::complex CTRu = +"<>FlexibleSUSY`FSModelName<>"_npf_up.at(9);\n"<> - "std::complex CTLd = +"<>FlexibleSUSY`FSModelName<>"_npf_down.at(8);\n"<> - "std::complex CTRd = +"<>FlexibleSUSY`FSModelName<>"_npf_down.at(8);\n"<> - "std::complex CTLs = +"<>FlexibleSUSY`FSModelName<>"_npf_strange.at(8);\n"<> - "std::complex CTRs = +"<>FlexibleSUSY`FSModelName<>"_npf_strange.at(8);\n"<> - "\n"<> - "gpLV += (-sqrt(2.0)/GF)*( GVpu*CVLu + GVpd*CVLd );\n" <> - "gpRV += (-sqrt(2.0)/GF)*( GVpu*CVRu + GVpd*CVRd );\n" <> - "gnLV += (-sqrt(2.0)/GF)*( GVnu*CVLu + GVnd*CVLd );\n" <> - "gnRV += (-sqrt(2.0)/GF)*( GVnu*CVRu + GVnd*CVRd );\n" <> - "\n//scalar contribution from scalar coefficients\n"<> - "std::complex gpLS = (-sqrt(2.0)/GF)*( GSpu*CSLu + GSpd*CSLd + GSps*CSLs );\n" <> - "std::complex gpRS = (-sqrt(2.0)/GF)*( GSpu*CSRu + GSpd*CSRd + GSps*CSRs );\n" <> - "std::complex gnLS = (-sqrt(2.0)/GF)*( GSnu*CSLu + GSnd*CSLd + GSns*CSLs );\n" <> - "std::complex gnRS = (-sqrt(2.0)/GF)*( GSnu*CSRu + GSnd*CSRd + GSns*CSRs );\n" <> - "\n//scalar contribution from tensor coefficients\n"<> - "gpLS += (-sqrt(2.0)/GF)*(2*m_init/m_p)*( GTpu*CTLu + GTpd*CTLd + GTps*CTLs );\n" <> - "gpRS += (-sqrt(2.0)/GF)*(2*m_init/m_p)*( GTpu*CTRu + GTpd*CTRd + GTps*CTRs );\n" <> - "gnLS += (-sqrt(2.0)/GF)*(2*m_init/m_n)*( GTnu*CTLu + GTnd*CTLd + GTns*CTLs );\n" <> - "gnRS += (-sqrt(2.0)/GF)*(2*m_init/m_n)*( GTnu*CTRu + GTnd*CTRd + GTns*CTRs );\n" <> - "\nconst auto nuclear_form_factors =\n" <> - IndentText@"get_overlap_integrals(nucleus, qedqcd);\n"<> - - "\nconst auto left =\n" <> IndentText[ - "A2R*nuclear_form_factors.D\n" <> - "+ gpLV*nuclear_form_factors.Vp\n" <> - "+ gnLV*nuclear_form_factors.Vn\n" <> - "+ gpRS*nuclear_form_factors.Sp\n" <> - "+ gnRS*nuclear_form_factors.Sn" - ] <> ";\n" <> - "\nconst auto right =\n" <> IndentText[ - "A2L*nuclear_form_factors.D\n" <> - "+ gpRV*nuclear_form_factors.Vp\n" <> - "+ gnRV*nuclear_form_factors.Vn\n" <> - "+ gpLS*nuclear_form_factors.Sp\n" <> - "+ gnLS*nuclear_form_factors.Sn" - ] <> ";\n" <> - - "\n// eq. 14 of Kitano, Koike and Okada\n" <> - "const double conversion_rate = 2.*pow(GF,2)*(std::norm(left) + std::norm(right));\n" <> - - "\n// normalize to capture\n" <> - "const double capture_rate = get_capture_rate(nucleus);\n\n" <> - - "return conversion_rate/capture_rate;\n" - ] <> - "}\n"; - - {prototype <> ";", definition} -]; - -End[]; -EndPackage[]; diff --git a/meta/FlexibleEFTHiggsMatching.m b/meta/FlexibleEFTHiggsMatching.m index 91698defc2..0ca5f40188 100644 --- a/meta/FlexibleEFTHiggsMatching.m +++ b/meta/FlexibleEFTHiggsMatching.m @@ -22,30 +22,420 @@ BeginPackage["FlexibleEFTHiggsMatching`", {"CConversion`", "TreeMasses`", "LoopMasses`", "Constraint`", "ThresholdCorrections`", "Parameters`", "Utils`"}]; -CalculateMHiggsPoleOneMomentumIteration::usage = ""; +CalculateMHiggs2LoopShift::usage = "Calculates 2-loop shift to the Higgs pole mass in the BSM model."; +CalculateMHiggs3LoopShift::usage = "Calculates 3-loop shift to the Higgs pole mass in the BSM model."; +Create2LoopMatching::usage = "Creates function body to calculate SM parameters from BSM parameters at 2-loop level."; +Create3LoopMatching::usage = "Creates function body to calculate SM parameters from BSM parameters at 3-loop level."; +CallMatch2LoopTopMass::usage = "Sets SM top Yukawa coupling to 2-loop value, determined from BSM model"; +CreateSMMtop2LoopFunction::usage = "Creates a function that calculates the running MS-bar top quark mass in the SM from the BSM parameters"; CalculateRunningUpQuarkMasses::usage = ""; CalculateRunningDownQuarkMasses::usage = ""; CalculateRunningDownLeptonMasses::usage = ""; CalculateMUpQuarkPole1L::usage = ""; CalculateMDownQuarkPole1L::usage = ""; CalculateMDownLeptonPole1L::usage = ""; -FillSMFermionPoleMasses::usage = ""; +FillSMFermionPoleMasses::usage = "Set SM fermion pole masses from BSM fermion pole masses"; GetFixedBSMParameters::usage="Returns a list of the BSM parameters fixed by matching SM -> BSM."; SetBSMParameters::usage = ""; +SetLimit::usage = "applies a given limit to given model"; Begin["`Private`"]; -CalculateMHiggsPoleOneMomentumIteration[particle_] := - If[GetDimension[particle] == 1, - "Mh2_pole = mh2_tree - self_energy - tadpole(0);" - , -"const auto M_loop = (mh2_tree - self_energy - " <> CreateCType[TreeMasses`GetMassMatrixType[particle]] <> "(tadpole.asDiagonal())).eval(); +CalculateMHiggs2LoopShift[inputModel_String, higgsBoson_, higgsIndex_String] := + Module[{modelNameStr = ToString[FlexibleSUSY`FSModelName], + higgsBosonStr = CConversion`RValueToCFormString[higgsBoson], + higgsMassStr = CConversion`RValueToCFormString[FlexibleSUSY`M[higgsBoson]]}, +"const auto mh2_tree = calculate_mh2_0l(model); +const double mh2_0l = Sqr(model.get_" <> higgsMassStr <> "(" <> higgsIndex <> ")); +const double p = 0.; -" <> CreateCType[CConversion`ArrayType[CConversion`realScalarCType, GetDimension[particle]]] <> " M_pole; -fs_diagonalize_hermitian(M_loop, M_pole); +// calculate 2-loop self-energy using tree-level parameters in the +// gauge-less limit (g1 = g2 = 0) +const auto self_energy_2l = Re(model.self_energy_" <> higgsBosonStr <> "_2loop()); -Mh2_pole = M_pole(idx);" - ]; +// calculate 2-loop contribution from momentum iteration using +// tree-level parameters in the gauge-less limit (g1 = g2 = 0) and +// Yukawa-less limit +decltype(model.self_energy_" <> higgsBosonStr <> "_1loop_deriv_p2(p)) self_energy_2l_mom; +self_energy_2l_mom.setZero(); + +if (mh2_1l_bsm_shift != 0.) { + self_energy_2l_mom += Re(model.self_energy_" <> higgsBosonStr <> "_1loop_deriv_p2(p) * mh2_1l_bsm_shift); +} + +const auto self_energy = (self_energy_2l + self_energy_2l_mom).eval(); +const auto tadpole = calculate_tadpole_over_vevs(model, 2); +const auto mass_matrix = compose_loop_corrections(mh2_tree, self_energy, tadpole); + +const double Mh2_pole = calculate_eigenvalue(mass_matrix, idx); + +const double mh2_shift_2l = Mh2_pole - mh2_0l; + +return mh2_shift_2l;" +]; + + +CalculateMHiggs3LoopShift[inputModel_String, outputModel_String, higgsBoson_, higgsIndex_String] := + Module[{modelNameStr = ToString[FlexibleSUSY`FSModelName], + higgsMassStr = CConversion`RValueToCFormString[FlexibleSUSY`M[higgsBoson]]}, +"double mh2_shift_3l = std::numeric_limits::quiet_NaN(); + +try { + // 3-loop self-energy, calculated using tree-level parameters + const auto self_energy_3l = Re(model." <> SelfEnergies`CreateSelfEnergyFunctionName[{higgsBoson, higgsBoson}, 3] <> "()); + const auto mass_matrix = (calculate_mh2_0l(model) - self_energy_3l).eval(); + const double Mh2_pole = calculate_eigenvalue(mass_matrix, idx); + const double mh2_tree = Sqr(model.get_" <> higgsMassStr <> "(idx)); + + // calculate 3-loop Higgs mass loop correction in the gauge-less limit + mh2_shift_3l = Mh2_pole - mh2_tree; +} catch (const flexiblesusy::Error& e) { + VERBOSE_MSG(\"Error: Calculation of 3-loop Higgs pole mass in the gauge-less limit in the " <> modelNameStr <> " at the matching scale failed: \" << e.what()); + " <> outputModel <> ".get_problems().flag_bad_mass(standard_model_info::hh); +} + +return mh2_shift_3l;" + ]; + + +Create2LoopMatching[inputModel_String, outputModel_String, higgsBoson_, higgsIndex_String] := + Module[{modelNameStr = ToString[FlexibleSUSY`FSModelName], + higgsMassStr = CConversion`RValueToCFormString[FlexibleSUSY`M[higgsBoson]]}, +"// calculate running parameters of BSM model +const auto model = [] (const auto& model_input) { + auto model = model_input; + model.calculate_DRbar_masses(); + return model; +}(model_input); +const auto model_gl = make_gaugeless_g1_g2(model_input); +const auto model_gl_no_g3 = make_gaugeless_g3(model_gl); +const auto model_gl_yl = make_yukawaless(model_gl); + +const auto sm_0l = match_high_to_low_scale_sm_0l_copy(sm, model, idx); +const auto sm_1l = match_high_to_low_scale_sm_1l_copy(sm, model, idx); +const auto sm_0l_gl = match_high_to_low_scale_sm_0l_copy(sm, model_gl, idx); +const auto sm_1l_gl = match_high_to_low_scale_sm_1l_copy(sm, model_gl, idx); +const auto sm_0l_gl_no_g3 = match_high_to_low_scale_sm_0l_copy(sm, model_gl_no_g3, idx); +const auto sm_1l_gl_no_g3 = match_high_to_low_scale_sm_1l_copy(sm, model_gl_no_g3, idx); +const auto sm_0l_gl_yl = make_yukawaless(sm_0l_gl); + +double delta_yt = 0; +double delta_yb = 0; +double delta_ytau = 0; +double delta_v_gl = 0; +double p = 0; + +if (model.HIGGS_2LOOP_CORRECTION_AT_AS) { + delta_yt += sm_1l_gl.get_Yu(2,2) - sm_1l_gl_no_g3.get_Yu(2,2); +} + +if (model.HIGGS_2LOOP_CORRECTION_AB_AS) { + delta_yb += sm_1l_gl.get_Yd(2,2) - sm_1l_gl_no_g3.get_Yd(2,2); +} + +if (model.HIGGS_2LOOP_CORRECTION_AT_AT) { + delta_yt += sm_1l_gl_no_g3.get_Yu(2,2) - sm_0l_gl.get_Yu(2,2); + delta_yb += sm_1l_gl_no_g3.get_Yd(2,2) - sm_0l_gl.get_Yd(2,2); + delta_ytau += sm_1l.get_Ye(2,2) - sm_0l_gl.get_Ye(2,2); + delta_v_gl += sm_1l.get_v() - sm_0l.get_v(); +} + +const double Q = sm_0l_gl.get_scale(); +const double mt = sm_0l_gl.get_MFu(2); +const double mb = sm_0l_gl.get_MFd(2); +const double mtau = sm_0l_gl.get_MFe(2); +const double yt = sm_0l_gl.get_Yu(2,2); +const double yb = sm_0l_gl.get_Yd(2,2); +const double ytau = sm_0l_gl.get_Ye(2,2); +const double v = sm_0l.get_v(); +const double v2 = Sqr(v); +const double lambda_1l = sm_1l.get_Lambdax(); + +// 2-loop parameter conversion terms from the sum in Eq.(4.26b) +// [arxiv:2003.04639] for P = {yt, yb, ytau, g3, v}. The terms in +// the sum that involve a derivative w.r.t. p^2 are not included +// here. +const double mh2_2l_parameter_conversion = + + delta_yt * sm_twoloophiggs::delta_mh_1loop_at_sm_deriv_yt(p, Q, mt, yt) + + delta_yb * sm_twoloophiggs::delta_mh_1loop_ab_sm_deriv_yb(p, Q, mb, yb) + + delta_ytau * sm_twoloophiggs::delta_mh_1loop_atau_sm_deriv_ytau(p, Q, mtau, ytau) + + delta_v_gl * (+ sm_twoloophiggs::delta_mh_1loop_at_sm_deriv_v(p, Q, mt, yt) + + sm_twoloophiggs::delta_mh_1loop_ab_sm_deriv_v(p, Q, mb, yb) + + sm_twoloophiggs::delta_mh_1loop_atau_sm_deriv_v(p, Q, mtau, ytau)); + +// Eq.(4.21) [arxiv:2003.04639] for n=1 +const double mh2_1l_bsm_shift = calculate_Mh2_1l_shift(model_gl_yl, idx); +// Eq.(4.26a) [arxiv:2003.04639] +const double mh2_1l_sm_shift = calculate_Mh2_1l_shift(sm_0l_gl_yl); +// Eq.(4.21) [arxiv:2003.04639] for n=2, including derivative term w.r.t. p^2 (momentum iteration) +const double mh2_2l_bsm_shift = calculate_Mh2_2l_shift(model_gl_yl, idx, model.HIGGS_2LOOP_CORRECTION_AT_AT ? mh2_1l_bsm_shift : 0.); +// Eq.(4.26b) [arxiv:2003.04639], including derivative term w.r.t. p^2 (momentum iteration) +const double mh2_2l_sm_shift = calculate_Mh2_2l_shift(sm_0l_gl_yl, model.HIGGS_2LOOP_CORRECTION_AT_AT ? mh2_1l_bsm_shift : 0.); + +// Eq.(4.28c) [arxiv:2003.04639] +const double delta_lambda_2l = + (mh2_2l_bsm_shift - mh2_2l_sm_shift - mh2_2l_parameter_conversion)/v2 + + 2*delta_v_gl/(v*v2)*(mh2_1l_sm_shift - mh2_1l_bsm_shift); + +// Eq.(4.28a) [arxiv:2003.04639] up to (including) 2-loop terms +const double lambda_2l = lambda_1l + delta_lambda_2l; + +sm = sm_1l; +sm.set_Lambdax(lambda_2l); +sm.calculate_DRbar_masses();" +]; + +AttachBrackets[FlexibleSUSY`M[sym_[idx_]]] := FlexibleSUSY`M[sym][idx]; +AttachBrackets[FlexibleSUSY`M[sym_]] := FlexibleSUSY`M[sym][]; +AttachBrackets[sym_] := sym; + +Create3LoopMatching[inputModel_String, outputModel_String, higgsBoson_, higgsIndex_String] := + Module[{modelNameStr = ToString[FlexibleSUSY`FSModelName], + higgsMassStr = CConversion`RValueToCFormString[FlexibleSUSY`M[higgsBoson]], + mtstr = CConversion`RValueToCFormString[AttachBrackets[TreeMasses`GetMass[TreeMasses`GetUpQuark[3,True]]]]}, +"// calculate running masses of the input model +const auto model = [] (const auto& model_input) { + auto model = model_input; + model.calculate_DRbar_masses(); + return model; +}(" <> inputModel <> "); +const auto model_gl = make_gaugeless_g1_g2(model); +const auto model_gl_no_g3 = make_gaugeless_g3(model_gl); + +const auto sm_0l = match_high_to_low_scale_sm_0l_copy(" <> outputModel <> ", model, " <> higgsIndex <> "); +const auto sm_1l = match_high_to_low_scale_sm_1l_copy(" <> outputModel <> ", model, " <> higgsIndex <> "); +const auto sm_0l_gl = match_high_to_low_scale_sm_0l_copy(" <> outputModel <> ", model_gl, " <> higgsIndex <> "); +const auto sm_1l_gl = match_high_to_low_scale_sm_1l_copy(" <> outputModel <> ", model_gl, " <> higgsIndex <> "); +const auto sm_1l_gl_no_g3 = match_high_to_low_scale_sm_1l_copy(" <> outputModel <> ", model_gl_no_g3, " <> higgsIndex <> "); +const auto sm_2l = match_high_to_low_scale_sm_2l_copy(" <> outputModel <> ", model, " <> higgsIndex <> "); + +// calculation of 3-loop threshold corrections below + +const double lambda_2l = sm_2l.get_Lambdax(); + +const double v2 = Sqr(sm_0l_gl.get_v()); +const double yt = sm_0l_gl.get_Yu(2, 2); +const double yt2 = Sqr(yt); +const double yt_2l = calculate_yt_sm_2l(sm_0l, sm_1l, model); +const double g3 = sm_0l_gl.get_g3(); +const double g32 = Sqr(g3); +const double g34 = Sqr(g32); +const double Q = sm_0l_gl.get_scale(); +const double Q2 = Sqr(Q); +const double mt = model_gl.get_" <> mtstr <> "; +const double mt2 = Sqr(mt); +const double logmt = Log(mt2 / Q2); +const double logmt2 = Sqr(logmt); +const double logmt3 = logmt * logmt2; +const double k = oneOver16PiSqr; +const double k2 = twoLoop; +const double k3 = threeLoop; + +const double delta_yt_1l = sm_1l_gl.get_Yu(2, 2) - sm_1l_gl_no_g3.get_Yu(2, 2); +const double delta_yt_2l = yt_2l - sm_1l.get_Yu(2, 2); +const double delta_g3_1l = sm_1l.get_g3() - g3; + +// 1st derivative of 1-loop SM contribution to Mh w.r.t. yt, times Delta yt(2l) +const double S1_deriv_yt = + delta_yt_2l * sm_twoloophiggs::delta_mh_1loop_at_sm_deriv_yt(0, Q, sm_0l_gl.get_MFu(2), yt); +// 2nd derivative of 1-loop SM contribution to Mh w.r.t. yt, times [Delta yt(1l)]^2 +const double S1_deriv_yt2 = + -0.5*(24*k*mt2*(7 + 6*logmt)) * Sqr(delta_yt_1l); +// 1st derivative of 2-loop SM contribution to Mh w.r.t. yt, times Delta yt(1l) +const double S2_deriv_yt = + 64*k2*g32*mt2*yt*(1 + 8*logmt + 6*logmt2) * delta_yt_1l; +// 1st derivative of 2-loop SM contribution to Mh w.r.t. g3, times Delta g3(1l) +const double S2_deriv_g3 = + 64*k2*g3*mt2*yt2*logmt*(1 + 3*logmt) * delta_g3_1l; + +// 3-loop parameter conversion terms from thesum on the r.h.s. +// of Eq.(4.26c) [arxiv:2003.04639] +const double mh2_3l_parameter_conversion = S1_deriv_yt + S1_deriv_yt2 + S2_deriv_yt + S2_deriv_g3; + +// Eq.(4.26c) [arxiv:2003.04639] w/o the sum +const double mh2_3l_sm_shift = -Re(sm_0l_gl.self_energy_hh_3loop()); + +// Eq.(4.21) [arxiv:2003.04639] for n=3 +const double mh2_3l_bsm_shift = calculate_Mh2_3l_shift(sm, model_gl, idx); + +const bool no_error = std::isfinite(mh2_3l_bsm_shift); + +// Eq.(4.28d) [arxiv:2003.04639], Delta lambda^(3l) +const double delta_lambda_3l = no_error ? (mh2_3l_bsm_shift - mh2_3l_sm_shift - mh2_3l_parameter_conversion)/v2 : 0.0; + +// Eq.(4.28a) [arxiv:2003.04639] up to (including) 3-loop terms +const double lambda_3l = lambda_2l + delta_lambda_3l; + +" <> outputModel <> " = sm_2l; +if (no_error) { +" <> TextFormatting`IndentText[FlexibleEFTHiggsMatching`CallMatch2LoopTopMass[outputModel <> "."]] <> " +} +" <> outputModel <> ".set_Lambdax(lambda_3l); +" <> outputModel <> ".calculate_DRbar_masses();" +]; + +CallMatch2LoopTopMass[smStr_:"sm."] := +smStr <> "set_Yu(2, 2, calculate_yt_sm_2l(sm_0l, sm_1l, model));" + +CreateSMMtop2LoopFunction[] := +Module[{g3str = ToString[TreeMasses`GetStrongCoupling[]], + mglustr = CConversion`RValueToCFormString[FlexibleSUSY`M[SARAH`Gluino]], + md2str = CConversion`RValueToCFormString[SARAH`SoftDown], + mq2str = CConversion`RValueToCFormString[SARAH`SoftSquark], + mtstr = CConversion`RValueToCFormString[TreeMasses`GetMass[TreeMasses`GetUpQuark[3,True]]]}, +"/** + * Calculates SM top quark masses at tree-level and 2-loop level. + * Returns the tuple (mt, Mt) with mt being the SM tree-level top + * quark mass and Mt being the SM top quark pole mass calculated + * at 2-loop level (including 2-loop QCD contributions). + * + * @param sm Standard Model parameters + * @return tuple (mt, Mt) + */ +std::tuple calculate_mt_sm_2l( + const standard_model::Standard_model& sm) +{ + auto sm_2l = sm; + auto loop_corrections = sm_2l.get_loop_corrections(); + loop_corrections.top_qcd = 1; // enable 2-loop QCD contributions + + sm_2l.set_pole_mass_loop_order(2); + sm_2l.set_loop_corrections(loop_corrections); + + sm_2l.calculate_MFu_pole(); + + const auto Mt = sm_2l.get_physical().MFu(2); + const auto mt = sm_2l.get_MFu(2); + + return std::make_tuple(mt, Mt); +} + +/** + * Calculates stop masses and stop mixing angle. + * + * @param model BSM model parameters + * @return tuple (mst_1, mst_2, theta_t) + */ +std::tuple calculate_mstop( + const " <> ToString[FlexibleSUSY`FSModelName] <> "_mass_eigenstates& model) +{ + double mst_1, mst_2, theta_t; + model." <> TreeMasses`CallGenerationHelperFunctionName[3, SARAH`TopSquark, "mst_1", "mst_2", "theta_t"] <> "; + + return std::make_tuple(mst_1, mst_2, theta_t); +} + +/** + * Calculates top quark pole in the BSM model at 2-loop level, including + * 2-loop QCD contributions. + * + * @param model BSM model parameters + * @return 2-loop top quark mass in the BSM + */ +double calculate_Mt_bsm_2l( + const " <> ToString[FlexibleSUSY`FSModelName] <> "_mass_eigenstates& model) +{ + auto model_2l = model; + auto loop_corrections = model_2l.get_loop_corrections(); + loop_corrections.top_qcd = 1; // enable 2-loop QCD contributions + + model_2l.set_pole_mass_loop_order(2); + model_2l.set_loop_corrections(loop_corrections); + + model_2l." <> CreateLoopMassFunctionName[Parameters`StripIndices[TreeMasses`GetUpQuark[3,True]]] <> "(); + + const auto Mt_bsm = model_2l.get_physical()." <> mtstr <> "; + + return Mt_bsm; +} + +/** + * Calculates running MS-bar SM top quark mass, given the BSM model parameters. + * + * @note The given SM and BSM model parameters should be in the + * gauge-less limit (g1 = g2 = 0). + * + * @param sm Standard Model parameters + * @param model BSM model parameters + * @param idx Higgs index (from the mass ordered Higgs multiplet in the high-scale model) + */ +double calculate_MFt_MSbar_sm_2l( + const standard_model::Standard_model& sm, + const " <> ToString[FlexibleSUSY`FSModelName] <> "_mass_eigenstates& model) +{ + const double Q = model.get_scale(); + const double Q2 = Sqr(Q); + const double mt = sm.get_MFu(2); // is equal to the top quark mass in the MSSM + const double mt2 = Sqr(mt); + const double g3 = model.get_" <> g3str <> "(); + const double g32 = Sqr(g3); + const double alpha_s = g32*oneOver4Pi; + + const double k = oneOver16PiSqr; + const double logmt = Log(mt2 / Q2); + const double yt_SM = sm.get_Yu(2, 2); + + const auto [mst_1, mst_2, theta_t] = calculate_mstop(model); + + const mssm_twoloop_mt::Parameters pars{ + .g3 = g3, + .mt = mt, + .mg = model.get_" <> mglustr <> "(), + .mst1 = mst_1, + .mst2 = mst_2, + .msusy = Sqrt(Sqrt(Abs(model.get_" <> md2str <> "(2, 2)))) * + Sqrt(Sqrt(Abs(model.get_" <> mq2str <> "(2, 2)))), + .xt = Sin(2*theta_t)*(Sqr(mst_1) - Sqr(mst_2))/(2*mt), + .Q = Q + }; + + // top mass contribution at O(as) in MSSM and SM + const double sqcd_1l_over_mt = mssm_twoloop_mt::dMt_over_mt_1loop(pars); + const double qcd_1l_SM_over_mt = k * g32 * 4./3 * (4 - 3*Log(mt2 / Q2)); + + // top mass contribution at O(as) in the SM + const double qcd1l_mt = -4./3 * k * g32 * mt * (2 + 3*logmt); + const double qcd1l_g3 = 8./3 * k * g32 * mt * (4 - 3*logmt); + + const double delta_alpha_s = calculate_delta_alpha_s(alpha_s, model); + const double delta_mt_over_mt = sqcd_1l_over_mt - qcd_1l_SM_over_mt; + const double delta_g3_over_g3 = -0.5 * delta_alpha_s; + + // 2-loop contribution from parameter conversion + const double mt_con = delta_mt_over_mt * qcd1l_mt + delta_g3_over_g3 * qcd1l_g3; + + // calculate top quark pole masses in the BSM and in the SM + const double Mt_bsm = calculate_Mt_bsm_2l(model); + const auto [mt_sm_0l, Mt_sm] = calculate_mt_sm_2l(sm); + + // determine SM MS-bar top quark mass from top quark pole mass matching, + // Eq.(4.18b) [arxiv:2003.04639] + const double mt_sm = Mt_bsm - Mt_sm + mt_sm_0l - mt_con; + + return Abs(mt_sm); +} + +/** + * Calculates SM top quark Yukawa coupling at 2-loop level. + * + * @param sm_0l SM parameters (determined from BSM parameters at tree-level) + * @param sm_1l SM parameters (determined from BSM parameters at 1-loop level) + * @param model BSM parameters + */ +double calculate_yt_sm_2l( + const standard_model::Standard_model& sm_0l, + const standard_model::Standard_model& sm_1l, + const " <> ToString[FlexibleSUSY`FSModelName] <> "_mass_eigenstates& model) +{ + const double delta_vev = sm_1l.get_v() - sm_0l.get_v(); + const double yt_0l = sm_0l.get_Yu(2,2); + const double mt_2l = calculate_MFt_MSbar_sm_2l(sm_0l, model); + const double v = sm_0l.get_v(); + const double yt_2l = sqrt2 * mt_2l / v - yt_0l * delta_vev / v; + + return yt_2l; +}" +]; CalculateRunningUpQuarkMasses[] := Module[{result = "", i, iStr, mq, mqFun}, @@ -90,8 +480,7 @@ mq = CConversion`RValueToCFormString[GetEntry[i + 1, True]]; iStr = ToString[i]; result = result <> -"\ -if (i == " <> iStr <> ") { +"if (i == " <> iStr <> ") { const double p = model_0l.get_M" <> mq <> "(); const auto self_energy_1 = Re(model_0l.self_energy_" <> mq <> "_1loop_1(p)); const auto self_energy_PL = Re(model_0l.self_energy_" <> mq <> "_1loop_PL(p)); @@ -106,8 +495,7 @@ , mq = CConversion`RValueToCFormString[GetParticleFromDescription[name]]; result = -"\ -const double p = model_0l.get_M" <> mq <> "(i); +"const double p = model_0l.get_M" <> mq <> "(i); const auto self_energy_1 = Re(model_0l.self_energy_" <> mq <> "_1loop_1(p)); const auto self_energy_PL = Re(model_0l.self_energy_" <> mq <> "_1loop_PL(p)); const auto self_energy_PR = Re(model_0l.self_energy_" <> mq <> "_1loop_PR(p)); @@ -133,25 +521,25 @@ TreeMasses`GetSMChargedLeptons, TreeMasses`GetDownLepton]; -FillSMFermionPoleMasses[] := +FillSMFermionPoleMasses[eftStr_:"eft.", bsmStr_:"this->model."] := Module[{result = "", i, mq}, For[i = 0, i < 3, i++, mq = CConversion`RValueToCFormString[TreeMasses`GetUpQuark[i + 1, True]]; result = result <> - "this->model.get_physical().M" <> mq <> " = " <> - "eft.get_physical().MFu(" <> ToString[i] <> ");\n"; + bsmStr <> "get_physical().M" <> mq <> " = " <> + eftStr <> "get_physical().MFu(" <> ToString[i] <> ");\n"; ]; For[i = 0, i < 3, i++, mq = CConversion`RValueToCFormString[TreeMasses`GetDownQuark[i + 1, True]]; result = result <> - "this->model.get_physical().M" <> mq <> " = " <> - "eft.get_physical().MFd(" <> ToString[i] <> ");\n"; + bsmStr <> "get_physical().M" <> mq <> " = " <> + eftStr <> "get_physical().MFd(" <> ToString[i] <> ");\n"; ]; For[i = 0, i < 3, i++, mq = CConversion`RValueToCFormString[TreeMasses`GetDownLepton[i + 1, True]]; result = result <> - "this->model.get_physical().M" <> mq <> " = " <> - "eft.get_physical().MFe(" <> ToString[i] <> ");\n"; + bsmStr <> "get_physical().M" <> mq <> " = " <> + eftStr <> "get_physical().MFe(" <> ToString[i] <> ");\n"; ]; result ]; @@ -199,6 +587,38 @@ StringJoin[SetBSMParameterAtLoopOrder[#[[1]], #[[2]], struct]& /@ Utils`Zip[pars, loopOrder]] ]; +(* set `parameter' to `value' for given model `struct' *) +FEFTApplyParameterSetting[{parameter_, value_}, struct_String] := + Which[Parameters`IsModelParameter[parameter], + Parameters`SetParameter[parameter, value, struct], + Parameters`IsInputParameter[parameter], + Parameters`SetInputParameter[parameter, value, "INPUTPARAMETER"], + Parameters`IsPhase[parameter], + Parameters`SetPhase[parameter, value, struct], + Parameters`IsExtraParameter[parameter], + Parameters`SetParameter[parameter, value, struct], + True, + Print["Error: ", parameter, " cannot be set for the MSSM-limit,", + " because it is neither a model nor an input parameter!"]; + Quit[1]; + "" + ]; + +(* @todo: Set all dimensionless parameters to zero except (yt, yb, ytau, g3) in the MSSM. + @todo: Check which 2-loop contributions to Mh are available. + *) +SetLimit[struct_String, limit_List] := + Switch[limit, + {}, "", + {{_,_}..}, + Parameters`CreateLocalConstRefs[(#[[2]])& /@ limit] <> "\n" <> + StringJoin[FEFTApplyParameterSetting[#, struct]& /@ limit], + _, + Print["Error: The list is malformed (neither empty nor a list of 2-component lists): ", limit]; + Quit[1]; + "" + ]; + End[]; EndPackage[]; diff --git a/meta/FlexibleSUSY.m b/meta/FlexibleSUSY.m index aa23f302f6..9a7e1dde28 100644 --- a/meta/FlexibleSUSY.m +++ b/meta/FlexibleSUSY.m @@ -49,32 +49,33 @@ "TerminalFormatting`", "ThreeLoopMSSM`", "CXXDiagrams`", - "AMuon`", + "AMM`", "Decays`", "EDM`", "FFVFormFactors`", - "BrLToLGamma`", - "FToFConversionInNucleus`", "BtoSGamma`", - "EffectiveCouplings`", "FlexibleEFTHiggsMatching`", "FSMathLink`", "FlexibleTower`", "WeinbergAngle`", - "Himalaya`" + "Wrappers`", + "Himalaya`", + "GM2Calc`", + "Unitarity`" }]; $flexiblesusyMetaDir = DirectoryName[FindFile[$Input]]; $flexiblesusyConfigDir = FileNameJoin[{ParentDirectory[$flexiblesusyMetaDir], "config"}]; $flexiblesusyTemplateDir = FileNameJoin[{ParentDirectory[$flexiblesusyMetaDir], "templates"}]; +$observablesWildcard[file:_:""] := FileNameJoin@{$flexiblesusyMetaDir, "Observables", "*", file}; FS`Version = StringTrim[FSImportString[FileNameJoin[{$flexiblesusyConfigDir,"flexiblesusy-version"}]]]; FS`GitCommit = StringTrim[FSImportString[FileNameJoin[{$flexiblesusyConfigDir,"git_commit"}]]]; -FS`Authors = {"P. Athron", "M. Bach", "D. Harries", "W. Kotlarski", - "T. Kwasnitza", "J.-h. Park", "T. Steudtner", +FS`Authors = {"P. Athron", "M. Bach", "D. Harries", "U. Khasianevich", + "W. Kotlarski", "T. Kwasnitza", "J.-h. Park", "T. Steudtner", "D. St\[ODoubleDot]ckinger", "A. Voigt", "J. Ziebell"}; FS`Contributors = {}; -FS`Years = "2013-2021"; +FS`Years = "2013-2025"; FS`References = Get[FileNameJoin[{$flexiblesusyConfigDir,"references"}]]; Print[""]; @@ -99,6 +100,7 @@ SetupModelParameters::usage=""; SetupMassMatrices::usage=""; SetupOutputParameters::usage=""; +WriteClass::usage="Writes a C++ class for an observable"; MakeFlexibleSUSY::usage="Creates a spectrum generator given a FlexibleSUSY model file (FlexibleSUSY.m). @@ -184,6 +186,7 @@ FlexibleSUSY model file (FlexibleSUSY.m). VEV::usage = "running SM-like VEV in the full model"; UseHiggs2LoopNMSSM = False; UseHiggs3LoopMSSM = False; +UseHiggs3LoopNMSSM = False; EffectiveMu; EffectiveMASqr; UseSM3LoopRGEs = False; @@ -203,34 +206,55 @@ FlexibleSUSY model file (FlexibleSUSY.m). UseYukawa4LoopQCD = Automatic; FSRGELoopOrder = 2; (* RGE loop order (0, 1 or 2) *) PotentialLSPParticles = {}; -ExtraSLHAOutputBlocks::usage = "@note -this List is rewritten during the runnig of start.m script -in the directory FlexibleSUSY/models/@CLASSNAME@ by -the Get[FlexibleSUSY.m] inside FlexibleSUSY`MakeFlexibleSUSY[ ... ]"; -ExtraSLHAOutputBlocks = { - { - FlexibleSUSYLowEnergy, - { - {1, FlexibleSUSYObservable`aMuon} - } - }, - { - EFFHIGGSCOUPLINGS, - NoScale, - { - {1, FlexibleSUSYObservable`CpHiggsPhotonPhoton}, - {2, FlexibleSUSYObservable`CpHiggsGluonGluon}, - {3, FlexibleSUSYObservable`CpPseudoScalarPhotonPhoton}, - {4, FlexibleSUSYObservable`CpPseudoScalarGluonGluon} - } - } -}; +ExtraSLHAOutputBlocks; +FWCOEF ~ SetAttributes ~ {Protected, Locked}; (*reserved for a Block name*) +IMFWCOEF ~ SetAttributes ~ {Protected, Locked}; (*reserved for a Block name*) + FSAuxiliaryParameterInfo = {}; IMMINPAR = {}; IMEXTPAR = {}; FSCalculateDecays = False; FSDecayParticles = Automatic; FSEnableParallelism = True; +FSUnitarityConstraints = True; +FSEnableCompile; +FSGaugeLess::usage = "Symbol to represent a small number to impose the gauge-less limit."; +FSGaugeLessLimit = { + {SARAH`hyperchargeCoupling, FSGaugeLess/Parameters`GetGUTNormalization[SARAH`hyperchargeCoupling]}, + {SARAH`leftCoupling, FSGaugeLess/Parameters`GetGUTNormalization[SARAH`leftCoupling]} +}; +FSGaugeLessLimit::usage = "List of 2-component lists {parameter, value} to set parameter to obtain the gauge-less limit."; +FSYukawaLessLimit = { + {SARAH`UpYukawa[1, 1], 0}, + {SARAH`UpYukawa[1, 2], 0}, + {SARAH`UpYukawa[1, 3], 0}, + {SARAH`UpYukawa[2, 1], 0}, + {SARAH`UpYukawa[2, 2], 0}, + {SARAH`UpYukawa[2, 3], 0}, + {SARAH`UpYukawa[3, 1], 0}, + {SARAH`UpYukawa[3, 2], 0}, + (* *) + {SARAH`DownYukawa[1, 1], 0}, + {SARAH`DownYukawa[1, 2], 0}, + {SARAH`DownYukawa[1, 3], 0}, + {SARAH`DownYukawa[2, 1], 0}, + {SARAH`DownYukawa[2, 2], 0}, + {SARAH`DownYukawa[2, 3], 0}, + {SARAH`DownYukawa[3, 1], 0}, + {SARAH`DownYukawa[3, 2], 0}, + (* *) + {SARAH`ElectronYukawa[1, 1], 0}, + {SARAH`ElectronYukawa[1, 2], 0}, + {SARAH`ElectronYukawa[1, 3], 0}, + {SARAH`ElectronYukawa[2, 1], 0}, + {SARAH`ElectronYukawa[2, 2], 0}, + {SARAH`ElectronYukawa[2, 3], 0}, + {SARAH`ElectronYukawa[3, 1], 0}, + {SARAH`ElectronYukawa[3, 2], 0} +}; +FSYukawaLessLimit::usage = "List of 2-component lists {parameter, value} to set parameter to obtain the yukawa-less limit (leaving only the 3rd generation Yukawa couplings non-zero)."; +FSMSSMLimit = {}; +FSMSSMLimit::usage = "List of 2-component lists {parameter, value} to set parameter to obtain the MSSM-limit."; (* Standard Model input parameters (SLHA input parameters) *) (* {parameter, {"block", entry}, type} *) @@ -304,6 +328,7 @@ FlexibleSUSY model file (FlexibleSUSY.m). TwoScaleSolver; (* two-scale algorithm *) LatticeSolver; (* lattice algorithm *) SemiAnalyticSolver; (* semi-analytic algorithm *) +ShootingSolver; (* shooting method, can be used for FlexibleEFTHiggs *) FSBVPSolvers = { TwoScaleSolver }; (* macros *) @@ -339,6 +364,29 @@ FlexibleSUSY model file (FlexibleSUSY.m). CurrentScale::usage="placeholder indicating the current renormalization scale of the model."; +(* input parameters for GM2Calc, see [arxiv:2110.13238] *) +FSGM2CalcInput = { + yukawaType -> 0, + lambda1 -> 0, + lambda2 -> 0, + lambda3 -> 0, + lambda4 -> 0, + lambda5 -> 0, + lambda6 -> 0, + lambda7 -> 0, + tanBeta -> SARAH`VEVSM2 / SARAH`VEVSM1, + m122 -> 0, + zetau -> 0, + zetad -> 0, + zetal -> 0, + deltau -> ZEROMATRIX[3,3], + deltad -> ZEROMATRIX[3,3], + deltal -> ZEROMATRIX[3,3], + piu -> ZEROMATRIX[3,3], + pid -> ZEROMATRIX[3,3], + pil -> ZEROMATRIX[3,3] +}; + (* input parameters for Himalaya *) FSHimalayaInput = { RenormalizationScheme -> DRbar, @@ -377,6 +425,7 @@ FlexibleSUSY model file (FlexibleSUSY.m). FSFeynArtsAvailable = False; FSFormCalcAvailable = False; +FSEnableColors = False; Begin["`Private`"]; @@ -393,22 +442,15 @@ FlexibleSUSY model file (FlexibleSUSY.m). allEWSBSolvers = { GSLHybrid, GSLHybridS, GSLBroyden, GSLNewton, FPIRelative, FPIAbsolute, FPITadpole }; -allBVPSolvers = { TwoScaleSolver, LatticeSolver, SemiAnalyticSolver }; +allBVPSolvers = { TwoScaleSolver, LatticeSolver, SemiAnalyticSolver, ShootingSolver }; HaveEWSBSolver[solver_] := MemberQ[FlexibleSUSY`FSEWSBSolvers, solver]; HaveBVPSolver[solver_] := MemberQ[FlexibleSUSY`FSBVPSolvers, solver]; -DecomposeVersionString[version_String] := - ToExpression /@ StringSplit[version, "."]; - ToVersionString[{major_Integer, minor_Integer, patch_Integer}] := ToString[major] <> "." <> ToString[minor] <> "." <> ToString[patch]; -DebugPrint[msg___] := - If[FlexibleSUSY`FSDebugOutput, - Print["Debug: ", Sequence @@ InputFormOfNonStrings /@ {msg}]]; - ReplaceSymbolsInUserInput[rules_] := Module[{}, (* input/output blocks *) @@ -418,6 +460,7 @@ FlexibleSUSY model file (FlexibleSUSY.m). IMEXTPAR = IMEXTPAR /. rules; FlexibleSUSY`ExtraSLHAOutputBlocks = FlexibleSUSY`ExtraSLHAOutputBlocks /. rules; FlexibleSUSY`FSCalculateDecays = FlexibleSUSY`FSCalculateDecays /. rules; + FlexibleSUSY`FSUnitarityConstraints = FlexibleSUSY`FSUnitarityConstraints /. rules; FlexibleSUSY`FSDecayParticles = FlexibleSUSY`FSDecayParticles /. rules; FlexibleSUSY`FSExtraInputParameters = FlexibleSUSY`FSExtraInputParameters /. rules; FlexibleSUSY`FSAuxiliaryParameterInfo = FlexibleSUSY`FSAuxiliaryParameterInfo /. rules; @@ -472,21 +515,36 @@ FlexibleSUSY model file (FlexibleSUSY.m). SetAttributes[CheckParticleInPrecision, HoldFirst]; CheckParticleInPrecision[precision_] := If[!SubsetQ[TreeMasses`GetParticles[], precision], - Print["Warning: Particle(s) ", Complement[precision, TreeMasses`GetParticles[]], - " cannot be used in ", Unevaluated@precision, " as it is not part of ", FSModelName, ". Removing it/them."]; + Utils`FSFancyWarning["Particle(s) ", + Complement[precision, TreeMasses`GetParticles[]], + " cannot be used in ", Unevaluated@precision, + " as it is not part of ", ToString@FSModelName, + ". Removing it/them." + ]; precision = Intersection[precision, TreeMasses`GetParticles[]] ]; CheckParticleInPrecision /@ {Unevaluated@FlexibleSUSY`HighPoleMassPrecision, Unevaluated@FlexibleSUSY`MediumPoleMassPrecision, Unevaluated@FlexibleSUSY`LowPoleMassPrecision}; (* decay calculation require 3- and 4-point loop functions *) - If[FlexibleSUSY`FSCalculateDecays && DisjointQ[FSLoopLibraries, {FSLoopTools, FSCOLLIER}], - Print["Warning: Decay calculation requires a dedicated loop library. Currently it's either ", - "LoopTools or Collier but FlexibleSUSY was only configured with internal libraries. ", - "Disabling decays." + If[FlexibleSUSY`FSCalculateDecays && DisjointQ[FSLoopLibraries, {FSLoopTools, FSCOLLIER}] && FSEnableCompile, + Utils`FSFancyWarning[ + "Decay calculation requires a dedicated loop library.", + " Currently it's either LoopTools or Collier but", + " FlexibleSUSY was only configured with internal libraries.", + " Disabling decays." ]; FlexibleSUSY`FSCalculateDecays = False ]; + + With[{sarahVersion = DecomposeVersionString[SA`Version], + minimRequired = {4, 13, 0}}, + If[!TrueQ@Utils`VersionOrderGtEqThan[sarahVersion, minimRequired], + Print["Warning: using SARAH version ", SA`Version, " but unitarity calculation requires ", StringRiffle[ToString/@minimRequired, "."]]; + Print[" Disabling unitarity calculation."]; + FlexibleSUSY`FSUnitarityConstraints = False; + ]; + ]; ]; CheckSARAHVersion[] := @@ -502,13 +560,8 @@ FlexibleSUSY model file (FlexibleSUSY.m). Print[" Did you run configure?"]; Quit[1]; ]; - sarahVersion = DecomposeVersionString[SA`Version]; - If[sarahVersion[[1]] < minimRequired[[1]] || - (sarahVersion[[1]] == minimRequired[[1]] && - sarahVersion[[2]] < minimRequired[[2]]) || - (sarahVersion[[1]] == minimRequired[[1]] && - sarahVersion[[2]] == minimRequired[[2]] && - sarahVersion[[3]] < minimRequired[[3]]), + sarahVersion = Utils`DecomposeVersionString[SA`Version]; + If[!TrueQ@Utils`VersionOrderGtEqThan[sarahVersion, minimRequired], Print["Error: SARAH version ", SA`Version, " no longer supported!"]; Print["Please use version ", ToVersionString[minimRequired], " or higher"]; @@ -536,20 +589,27 @@ FlexibleSUSY model file (FlexibleSUSY.m). CheckDecaysOptions[] := If[FlexibleSUSY`FSDecayParticles =!= Automatic && FlexibleSUSY`FSDecayParticles =!= All && !ListQ[FlexibleSUSY`FSDecayParticles], - Print["Warning: Allowed values for FSDecayParticles are Automatic, All or list of particles. Got ", FlexibleSUSY`FSDecayParticles, ". Disabling decays. "]; + Utils`FSFancyWarning[ + "Allowed values for FSDecayParticles are Automatic, All or", + " list of particles. Got ", FlexibleSUSY`FSDecayParticles, + ". Disabling decays." + ]; FlexibleSUSY`FSCalculateDecays = False, If[FlexibleSUSY`FSDecayParticles === Automatic, FlexibleSUSY`FSDecayParticles = DeleteCases[{TreeMasses`GetHiggsBoson[], TreeMasses`GetChargedHiggsBoson[], TreeMasses`GetPseudoscalarHiggsBoson[]}, Null], If[FlexibleSUSY`FSDecayParticles === All, FlexibleSUSY`FSDecayParticles = TreeMasses`GetParticles[], + FlexibleSUSY`FSDecayParticles = FlexibleSUSY`FSDecayParticles /. SARAH`bar|Susyno`LieGroups`conj -> Identity; If[!SubsetQ[TreeMasses`GetParticles[], FlexibleSUSY`FSDecayParticles], - Print["Warning: Requested decay of particles ", Complement[FlexibleSUSY`FSDecayParticles, TreeMasses`GetParticles[]], - " which are not part of the model. Removing them."]; + Utils`FSFancyWarning[ + "Requested decay of particles ", + Complement[FlexibleSUSY`FSDecayParticles, TreeMasses`GetParticles[]], + " which are not part of the model. Removing them."]; FlexibleSUSY`FSDecayParticles = Intersection[TreeMasses`GetParticles[], FlexibleSUSY`FSDecayParticles] ] ] - ] + ]; ]; (* sets model file variables to default values, after SARAH`Start[] has been called *) @@ -562,8 +622,10 @@ FlexibleSUSY model file (FlexibleSUSY.m). Module[{}, (* FlexibleSUSY model name *) If[!ValueQ[FlexibleSUSY`FSModelName] || Head[FlexibleSUSY`FSModelName] =!= String, - Print["Warning: FlexibleSUSY`FSModelName not defined!", - " I'm using Model`Name from SARAH: ", Model`Name]; + Utils`FSFancyWarning[ + "FlexibleSUSY`FSModelName not defined!", + " I'm using Model`Name from SARAH: ", Model`Name + ]; FlexibleSUSY`FSModelName = Model`Name; ]; (* Set OnlyLowEnergyFlexibleSUSY to False by default *) @@ -584,16 +646,18 @@ FlexibleSUSY model file (FlexibleSUSY.m). (* HighScale *) If[!ValueQ[FlexibleSUSY`HighScale], If[!FlexibleSUSY`OnlyLowEnergyFlexibleSUSY, - Print["Warning: FlexibleSUSY`HighScale should be", - " set in the model file!"]; - ]; + Utils`FSFancyWarning[ + "FlexibleSUSY`HighScale should be set in the model file!" + ]; + ]; FlexibleSUSY`HighScale := 2 10^16; ]; If[!ValueQ[FlexibleSUSY`HighScaleFirstGuess], If[!FlexibleSUSY`OnlyLowEnergyFlexibleSUSY, - Print["Warning: FlexibleSUSY`HighScaleFirstGuess should be", - " set in the model file!"]; - ]; + Utils`FSFancyWarning[ + "FlexibleSUSY`HighScaleFirstGuess should be set in the model file!" + ]; + ]; FlexibleSUSY`HighScaleFirstGuess = 2.0 10^16; ]; If[Head[FlexibleSUSY`HighScaleInput] =!= List, @@ -601,13 +665,15 @@ FlexibleSUSY model file (FlexibleSUSY.m). ]; (* LowScale *) If[!ValueQ[FlexibleSUSY`LowScale], - Print["Warning: FlexibleSUSY`LowScale should be", - " set in the model file!"]; + Utils`FSFancyWarning[ + "FlexibleSUSY`LowScale should be set in the model file!" + ]; FlexibleSUSY`LowScale := LowEnergyConstant[MZ]; ]; If[!ValueQ[FlexibleSUSY`LowScaleFirstGuess], - Print["Warning: FlexibleSUSY`LowScaleFirstGuess should be", - " set in the model file!"]; + Utils`FSFancyWarning[ + "FlexibleSUSY`LowScaleFirstGuess should be set in the model file!" + ]; FlexibleSUSY`LowScaleFirstGuess = LowEnergyConstant[MZ]; ]; If[Head[FlexibleSUSY`LowScaleInput] =!= List, @@ -615,13 +681,15 @@ FlexibleSUSY model file (FlexibleSUSY.m). ]; (* SUSYScale *) If[!ValueQ[FlexibleSUSY`SUSYScale], - Print["Warning: FlexibleSUSY`SUSYScale should be", - " set in the model file!"]; + Utils`FSFancyWarning[ + "FlexibleSUSY`SUSYScale should be set in the model file!" + ]; FlexibleSUSY`SUSYScale := 1000; ]; If[!ValueQ[FlexibleSUSY`SUSYScaleFirstGuess], - Print["Warning: FlexibleSUSY`SUSYScaleFirstGuess should be", - " set in the model file!"]; + Utils`FSFancyWarning[ + "FlexibleSUSY`SUSYScaleFirstGuess should be set in the model file!" + ]; FlexibleSUSY`SUSYScaleFirstGuess = 1000; ]; If[Head[FlexibleSUSY`SUSYScaleInput] =!= List, @@ -629,7 +697,9 @@ FlexibleSUSY model file (FlexibleSUSY.m). ]; If[Head[FlexibleSUSY`SUSYScaleMatching] === List && Head[FlexibleSUSY`MatchingScaleInput] =!= List, - Print["Warning: SUSYScaleMatching is deprecated. Please use MatchingScaleInput instead!"]; + Utils`FSFancyWarning[ + "SUSYScaleMatching is deprecated. Please use MatchingScaleInput instead!" + ]; FlexibleSUSY`MatchingScaleInput = FlexibleSUSY`SUSYScaleMatching; ]; @@ -651,6 +721,14 @@ FlexibleSUSY model file (FlexibleSUSY.m). If[Head[FlexibleSUSY`ExtraSLHAOutputBlocks] =!= List, FlexibleSUSY`ExtraSLHAOutputBlocks = {}; ]; + If[MemberQ[FlexibleSUSY`ExtraSLHAOutputBlocks, {FlexibleSUSY`EFFHIGGSCOUPLINGS, __}], + Utils`FSFancyWarning[ + "Effective coupling module has been disabled since v2.6.0.", + " Please use FlexibleDecay instead." + ]; + FlexibleSUSY`ExtraSLHAOutputBlocks = + DeleteCases[FlexibleSUSY`ExtraSLHAOutputBlocks, {FlexibleSUSY`EFFHIGGSCOUPLINGS, __}]; + ]; If[Head[FlexibleSUSY`EWSBOutputParameters] =!= List, Print["Error: EWSBOutputParameters has to be set to a list", " of model parameters chosen to be output of the EWSB eqs."]; @@ -695,9 +773,10 @@ FlexibleSUSY model file (FlexibleSUSY.m). usedCases = Function[par, !FreeQ[#, par]& /@ boundaryConditions] /@ parameters; multiplyUsedPars = Position[Count[#, True]& /@ usedCases, n_ /; n > 1]; If[multiplyUsedPars =!= {}, - Print["Warning: the following auxiliary parameters appear at"]; - Print[" multiple scales, but do not run:"]; - Print[" ", Extract[parameters, multiplyUsedPars]]; + Utils`FSFancyWarning[ + "The following auxiliary parameters appear at multiple", + " scales, but do not run: ", Extract[parameters, multiplyUsedPars] + ]; ]; ]; @@ -901,12 +980,12 @@ FlexibleSUSY model file (FlexibleSUSY.m). "@printInputParameters@" -> IndentText[printInputParameters], "@get@" -> IndentText[get], "@set@" -> IndentText[set], - Sequence @@ GeneralReplacementRules[] - } ]; - ]; + Sequence @@ GeneralReplacementRules[] + } ]; + ]; WriteConstraintClass[condition_, settings_List, scaleFirstGuess_, - {minimumScale_, maximumScale_}, files_List] := + {minimumScale_, maximumScale_}, files_List] := Module[{applyConstraint = "", calculateScale, scaleGuess, restrictScale, initialSetting, @@ -914,7 +993,7 @@ FlexibleSUSY model file (FlexibleSUSY.m). calculateDRbarMasses, calculateDeltaAlphaEm, calculateDeltaAlphaS, calculateGaugeCouplings, - calculateThetaW, + calculateThetaW, calculateSMHiggsPoleMass, fillHimalayaInput, checkPerturbativityForDimensionlessParameters = "", twoLoopThresholdHeaders = "" }, @@ -966,6 +1045,7 @@ FlexibleSUSY model file (FlexibleSUSY.m). ]; ]; calculateThetaW = ThresholdCorrections`CalculateThetaW[FlexibleSUSY`FSWeakMixingAngleInput]; + calculateSMHiggsPoleMass = LoopMasses`CalculateSMHiggsPoleMass[FlexibleSUSY`FSWeakMixingAngleInput]; fillHimalayaInput = Himalaya`FillHimalayaInput[FSHimalayaInput]; twoLoopThresholdHeaders = ThresholdCorrections`GetTwoLoopThresholdHeaders[]; WriteOut`ReplaceInFiles[files, @@ -978,6 +1058,7 @@ FlexibleSUSY model file (FlexibleSUSY.m). "@calculateDeltaAlphaEm@" -> IndentText[WrapLines[calculateDeltaAlphaEm]], "@calculateDeltaAlphaS@" -> IndentText[WrapLines[calculateDeltaAlphaS]], "@calculateThetaW@" -> IndentText[WrapLines[calculateThetaW]], + "@calculateSMHiggsPoleMass@" -> IndentText[WrapLines[calculateSMHiggsPoleMass]], "@calculateDRbarMassUp@" -> IndentText[IndentText[calculateDRbarMasses[[1]]]], "@calculateDRbarMassCharm@" -> IndentText[IndentText[calculateDRbarMasses[[2]]]], "@calculateDRbarMassTop@" -> IndentText[IndentText[calculateDRbarMasses[[3]]]], @@ -1011,7 +1092,7 @@ FlexibleSUSY model file (FlexibleSUSY.m). calculateDRbarMasses, calculateDeltaAlphaEm, calculateDeltaAlphaS, calculateGaugeCouplings, - calculateThetaW, + calculateThetaW, calculateSMHiggsPoleMass, checkPerturbativityForDimensionlessParameters = "", saveBoundaryValueParameters = "", usingSemiAnalyticScaleGetter = "", @@ -1081,6 +1162,7 @@ FlexibleSUSY model file (FlexibleSUSY.m). ]; ]; calculateThetaW = ThresholdCorrections`CalculateThetaW[FlexibleSUSY`FSWeakMixingAngleInput]; + calculateSMHiggsPoleMass = LoopMasses`CalculateSMHiggsPoleMass[FlexibleSUSY`FSWeakMixingAngleInput]; If[isBoundaryConstraint, saveBoundaryValueParameters = SemiAnalytic`SaveBoundaryValueParameters[semiAnalyticSolns]; ]; @@ -1112,6 +1194,7 @@ FlexibleSUSY model file (FlexibleSUSY.m). "@calculateDeltaAlphaEm@" -> IndentText[WrapLines[calculateDeltaAlphaEm]], "@calculateDeltaAlphaS@" -> IndentText[WrapLines[calculateDeltaAlphaS]], "@calculateThetaW@" -> IndentText[WrapLines[calculateThetaW]], + "@calculateSMHiggsPoleMass@" -> IndentText[WrapLines[calculateSMHiggsPoleMass]], "@calculateDRbarMassUp@" -> IndentText[IndentText[calculateDRbarMasses[[1]]]], "@calculateDRbarMassCharm@" -> IndentText[IndentText[calculateDRbarMasses[[2]]]], "@calculateDRbarMassTop@" -> IndentText[IndentText[calculateDRbarMasses[[3]]]], @@ -1229,7 +1312,7 @@ FlexibleSUSY model file (FlexibleSUSY.m). ]; FindVEV[gauge_] := - Module[{result, vev}, + Module[{vev}, vev = Cases[SARAH`DEFINITION[FlexibleSUSY`FSEigenstates][SARAH`VEVs], {_,{v_,_},{gauge,_},{p_,_},___} | {_,{v_,_},{s_,_},{gauge,_},___} :> v]; If[vev === {}, @@ -1241,7 +1324,7 @@ FlexibleSUSY model file (FlexibleSUSY.m). (* returns VEV normalization w.r.t. the corresponding gauge eigenstate *) FindVEVNormalization[gauge_] := - Module[{result, vev}, + Module[{vev}, vev = Cases[SARAH`DEFINITION[FlexibleSUSY`FSEigenstates][SARAH`VEVs], {_,{v_,n_},{gauge,m_},{p_,_},___} | {_,{v_,n_},{s_,_},{gauge,m_},___} :> Abs[n/m]]; If[vev === {}, @@ -1410,7 +1493,15 @@ corresponding tadpole is real or imaginary (only in models with CP setRunningDownLeptonMasses = "", setYukawas = "", calculateMUpQuarkPole1L = "", calculateMDownQuarkPole1L = "", calculateMDownLeptonPole1L = "", - calculateMHiggsPoleOneMomentumIteration = ""}, + calculateMHiggs2LoopShift = "throw SetupError(\"2-loop Higgs self-energy not enabled.\");", + calculateMHiggs3LoopShift = "throw SetupError(\"3-loop Higgs self-energy not enabled.\");", + threeLoopLambdaMatching = "throw SetupError(\"3-loop matching not enabled.\");", + twoLoopLambdaMatching = "throw SetupError(\"2-loop matching not enabled.\");", + setGaugeLessLimit = "", + setYukawaLessLimit = "", + setMSSMLimit = "", + includeMSSMTwoLoopTopMassHeader = "", + createSMMt2LoopFunction = ""}, If[FlexibleSUSY`FlexibleEFTHiggs === True, If[Head[susyScaleMatching] === List, userMatching = Constraint`ApplyConstraints[susyScaleMatching]; @@ -1431,11 +1522,24 @@ corresponding tadpole is real or imaginary (only in models with CP setRunningDownQuarkMasses = FlexibleEFTHiggsMatching`CalculateRunningDownQuarkMasses[]; setRunningDownLeptonMasses = FlexibleEFTHiggsMatching`CalculateRunningDownLeptonMasses[]; setYukawas = ThresholdCorrections`SetDRbarYukawaCouplings[]; - calculateMHiggsPoleOneMomentumIteration = FlexibleEFTHiggsMatching`CalculateMHiggsPoleOneMomentumIteration[SARAH`HiggsBoson]; + setGaugeLessLimit = FlexibleEFTHiggsMatching`SetLimit["model.", Parameters`DecreaseIndexLiterals @ FlexibleSUSY`FSGaugeLessLimit]; + setYukawaLessLimit = FlexibleEFTHiggsMatching`SetLimit["model.", Parameters`DecreaseIndexLiterals @ FlexibleSUSY`FSYukawaLessLimit]; + setMSSMLimit = FlexibleEFTHiggsMatching`SetLimit["model.", Parameters`DecreaseIndexLiterals @ FlexibleSUSY`FSMSSMLimit]; + If[SARAH`UseHiggs2LoopMSSM === True || FlexibleSUSY`UseHiggs2LoopNMSSM === True, + twoLoopLambdaMatching = FlexibleEFTHiggsMatching`Create2LoopMatching["model_input", "sm", SARAH`HiggsBoson, "idx"]; + calculateMHiggs2LoopShift = FlexibleEFTHiggsMatching`CalculateMHiggs2LoopShift["model", SARAH`HiggsBoson, "idx"]; + ]; + If[FlexibleSUSY`UseHiggs3LoopMSSM === True || FlexibleSUSY`UseHiggs3LoopNMSSM === True, + threeLoopLambdaMatching = FlexibleEFTHiggsMatching`Create3LoopMatching["model_input", "sm", SARAH`HiggsBoson, "idx"]; + calculateMHiggs3LoopShift = FlexibleEFTHiggsMatching`CalculateMHiggs3LoopShift["model", "sm", SARAH`HiggsBoson, "idx"]; + createSMMt2LoopFunction = FlexibleEFTHiggsMatching`CreateSMMtop2LoopFunction[]; + includeMSSMTwoLoopTopMassHeader = "#include \"mssm_twoloop_mt.hpp\""; + ]; + calculateMUpQuarkPole1L = FlexibleEFTHiggsMatching`CalculateMUpQuarkPole1L[]; calculateMDownQuarkPole1L = FlexibleEFTHiggsMatching`CalculateMDownQuarkPole1L[]; calculateMDownLeptonPole1L = FlexibleEFTHiggsMatching`CalculateMDownLeptonPole1L[]; - ]; + ]; WriteOut`ReplaceInFiles[files, { "@alphaS1Lmatching@" -> IndentText[WrapLines[alphaS1Lmatching]], "@alphaEM1Lmatching@" -> IndentText[WrapLines[alphaEM1Lmatching]], @@ -1447,9 +1551,17 @@ corresponding tadpole is real or imaginary (only in models with CP "@calculateMDownQuarkPole1L@" -> IndentText[calculateMDownQuarkPole1L], "@calculateMDownLeptonPole1L@" -> IndentText[calculateMDownLeptonPole1L], "@setYukawas@" -> IndentText[WrapLines[setYukawas]], - "@applyUserMatching@" -> IndentText[IndentText[WrapLines[userMatching]]], - "@calculateMHiggsPoleOneMomentumIteration@" -> IndentText[calculateMHiggsPoleOneMomentumIteration], + "@applyUserMatching@" -> IndentText[WrapLines[userMatching]], + "@calculateMHiggs2LoopShift@" -> IndentText[calculateMHiggs2LoopShift], + "@calculateMHiggs3LoopShift@" -> IndentText[calculateMHiggs3LoopShift], "@numberOfEWSBEquations@" -> ToString[TreeMasses`GetDimension[SARAH`HiggsBoson]], + "@threeLoopLambdaMatching@" -> IndentText[threeLoopLambdaMatching], + "@twoLoopLambdaMatching@" -> IndentText[twoLoopLambdaMatching], + "@createSMMt2LoopFunction@" -> createSMMt2LoopFunction, + "@setGaugeLessLimit@" -> IndentText[setGaugeLessLimit], + "@setYukawaLessLimit@" -> IndentText[setYukawaLessLimit], + "@setMSSMLimit@" -> IndentText[setMSSMLimit], + "@includeMSSMTwoLoopTopMassHeader@" -> includeMSSMTwoLoopTopMassHeader, Sequence @@ GeneralReplacementRules[] } ]; ]; @@ -1611,13 +1723,13 @@ corresponding tadpole is real or imaginary (only in models with CP slhaPoleMassGetters = "", slhaPoleMixingMatrixGetters = "", higgsMassGetters = "", higgsToEWSBEqAssociation, tadpoleEqPrototypes = "", tadpoleEqFunctions = "", - numberOfEWSBEquations = Length[ewsbEquations], calculateTreeLevelTadpoles = "", divideTadpoleByVEV = "", calculateOneLoopTadpoles = "", calculateTwoLoopTadpoles = "", physicalMassesDef = "", mixingMatricesDef = "", massCalculationPrototypes = "", massCalculationFunctions = "", calculateAllMasses = "", selfEnergyPrototypes = "", selfEnergyFunctions = "", + selfEnergyDerivPrototypes = "", selfEnergyDerivFunctions = "", twoLoopTadpolePrototypes = "", twoLoopTadpoleFunctions = "", twoLoopSelfEnergyPrototypes = "", twoLoopSelfEnergyFunctions = "", threeLoopSelfEnergyPrototypes = "", threeLoopSelfEnergyFunctions = "", @@ -1700,28 +1812,37 @@ corresponding tadpole is real or imaginary (only in models with CP calculateTwoLoopTadpoles = SelfEnergies`FillArrayWithTwoLoopTadpoles[SARAH`HiggsBoson, "tadpole", "-"]; ]; If[FlexibleSUSY`UseHiggs2LoopSM === True, - {twoLoopSelfEnergyPrototypes, twoLoopSelfEnergyFunctions} = SelfEnergies`CreateTwoLoopSelfEnergiesSM[{SARAH`HiggsBoson}]; + {twoLoopSelfEnergyPrototypes, twoLoopSelfEnergyFunctions} = SelfEnergies`CreateTwoLoopSelfEnergiesSM[{{SARAH`HiggsBoson, SARAH`HiggsBoson}}]; twoLoopHiggsHeaders = "#include \"sm_twoloophiggs.hpp\"\n"; ]; If[FlexibleSUSY`UseHiggs3LoopSM === True, - {threeLoopSelfEnergyPrototypes, threeLoopSelfEnergyFunctions} = SelfEnergies`CreateThreeLoopSelfEnergiesSM[{SARAH`HiggsBoson}]; + {threeLoopSelfEnergyPrototypes, threeLoopSelfEnergyFunctions} = SelfEnergies`CreateThreeLoopSelfEnergiesSM[{{SARAH`HiggsBoson, SARAH`HiggsBoson}}]; threeLoopHiggsHeaders = "#include \"sm_threeloophiggs.hpp\"\n"; ]; If[FlexibleSUSY`UseHiggs4LoopSM === True, - {fourLoopSelfEnergyPrototypes, fourLoopSelfEnergyFunctions} = SelfEnergies`CreateFourLoopSelfEnergiesSM[{SARAH`HiggsBoson}]; + {fourLoopSelfEnergyPrototypes, fourLoopSelfEnergyFunctions} = SelfEnergies`CreateFourLoopSelfEnergiesSM[{{SARAH`HiggsBoson, SARAH`HiggsBoson}}]; fourLoopHiggsHeaders = "#include \"sm_fourloophiggs.hpp\"\n"; ]; If[FlexibleSUSY`UseHiggs3LoopSplit === True, - {threeLoopSelfEnergyPrototypes, threeLoopSelfEnergyFunctions} = SelfEnergies`CreateThreeLoopSelfEnergiesSplit[{SARAH`HiggsBoson}]; + {threeLoopSelfEnergyPrototypes, threeLoopSelfEnergyFunctions} = SelfEnergies`CreateThreeLoopSelfEnergiesSplit[{{SARAH`HiggsBoson, SARAH`HiggsBoson}}]; threeLoopHiggsHeaders = "#include \"splitmssm_threeloophiggs.hpp\"\n"; ]; If[SARAH`UseHiggs2LoopMSSM === True, {twoLoopTadpolePrototypes, twoLoopTadpoleFunctions} = SelfEnergies`CreateTwoLoopTadpolesMSSM[SARAH`HiggsBoson]; - {twoLoopSelfEnergyPrototypes, twoLoopSelfEnergyFunctions} = SelfEnergies`CreateTwoLoopSelfEnergiesMSSM[{SARAH`HiggsBoson, SARAH`PseudoScalar}]; + {twoLoopSelfEnergyPrototypes, twoLoopSelfEnergyFunctions} = SelfEnergies`CreateTwoLoopSelfEnergiesMSSM[{{SARAH`HiggsBoson, SARAH`HiggsBoson}, {SARAH`PseudoScalar, SARAH`PseudoScalar}}]; twoLoopHiggsHeaders = "#include \"sfermions.hpp\"\n#include \"mssm_twoloophiggs.hpp\"\n"; ]; If[FlexibleSUSY`UseHiggs3LoopMSSM === True, - {threeLoopSelfEnergyPrototypes, threeLoopSelfEnergyFunctions} = SelfEnergies`CreateThreeLoopSelfEnergiesMSSM[{SARAH`HiggsBoson}]; + {threeLoopSelfEnergyPrototypes, threeLoopSelfEnergyFunctions} = SelfEnergies`CreateThreeLoopSelfEnergiesMSSM[{{SARAH`HiggsBoson, SARAH`HiggsBoson}}]; + threeLoopHiggsHeaders = threeLoopHiggsHeaders <> "\ +#ifdef ENABLE_HIMALAYA +#include \"himalaya/HierarchyCalculator.hpp\" +#include \"himalaya/version.hpp\" +#endif +"; + ]; + If[FlexibleSUSY`UseHiggs3LoopNMSSM === True, + {threeLoopSelfEnergyPrototypes, threeLoopSelfEnergyFunctions} = SelfEnergies`CreateThreeLoopSelfEnergiesNMSSM[{{SARAH`HiggsBoson,SARAH`HiggsBoson}}]; threeLoopHiggsHeaders = threeLoopHiggsHeaders <> "\ #ifdef ENABLE_HIMALAYA #include \"himalaya/HierarchyCalculator.hpp\" @@ -1731,7 +1852,13 @@ corresponding tadpole is real or imaginary (only in models with CP ]; If[FlexibleSUSY`UseHiggs2LoopNMSSM === True, {twoLoopTadpolePrototypes, twoLoopTadpoleFunctions} = SelfEnergies`CreateTwoLoopTadpolesNMSSM[SARAH`HiggsBoson]; - {twoLoopSelfEnergyPrototypes, twoLoopSelfEnergyFunctions} = SelfEnergies`CreateTwoLoopSelfEnergiesNMSSM[{SARAH`HiggsBoson, SARAH`PseudoScalar}]; + {twoLoopSelfEnergyPrototypes, twoLoopSelfEnergyFunctions} = + SelfEnergies`CreateTwoLoopSelfEnergiesNMSSM[ + { + {SARAH`HiggsBoson, SARAH`HiggsBoson}, + {SARAH`PseudoScalar, SARAH`PseudoScalar} + } + ]; twoLoopHiggsHeaders = "#include \"sfermions.hpp\"\n#include \"mssm_twoloophiggs.hpp\"\n#include \"nmssm_twoloophiggs.hpp\"\n"; ]; twoLoopThresholdHeaders = ThresholdCorrections`GetTwoLoopThresholdHeaders[]; @@ -1739,7 +1866,8 @@ corresponding tadpole is real or imaginary (only in models with CP FlexibleSUSY`UseHiggs2LoopNMSSM === True || FlexibleSUSY`UseMSSMYukawa2Loop === True || FlexibleSUSY`UseMSSMAlphaS2Loop === True || - FlexibleSUSY`UseHiggs3LoopMSSM === True, + FlexibleSUSY`UseHiggs3LoopMSSM === True || + FlexibleSUSY`UseHiggs3LoopNMSSM === True, {secondGenerationHelperPrototypes, secondGenerationHelperFunctions} = TreeMasses`CreateGenerationHelpers[2]; {thirdGenerationHelperPrototypes, thirdGenerationHelperFunctions} = TreeMasses`CreateGenerationHelpers[3]; ]; @@ -1841,7 +1969,8 @@ corresponding tadpole is real or imaginary (only in models with CP reorderPoleMasses = TreeMasses`ReorderGoldstoneBosons["PHYSICAL"]; checkPoleMassesForTachyons = TreeMasses`CheckPoleMassesForTachyons["PHYSICAL"]; WriteOut`ReplaceInFiles[files, - { "@lspGetters@" -> IndentText[lspGetters], + { "@[abstract]lspGetters@" -> IndentText[FunctionModifiers`MakeAbstract[lspGetters]], + "@[override]lspGetters@" -> IndentText[FunctionModifiers`MakeOverride[lspGetters]], "@lspFunctions@" -> lspFunctions, "@[abstract]parameterGetters@" -> IndentText[FunctionModifiers`MakeAbstract[StringJoin[Parameters`CreateModelParameterGetter /@ Parameters`GetModelParameters[]]]], "@[abstract]parameterSetters@" -> IndentText[FunctionModifiers`MakeAbstract[StringJoin[Parameters`CreateModelParameterSetter /@ Parameters`GetModelParameters[]]]], @@ -1905,6 +2034,15 @@ corresponding tadpole is real or imaginary (only in models with CP "@setDecouplingYukawaDownLeptons@" -> IndentText @ IndentText[ ThresholdCorrections`SetDRbarYukawaCouplingElectron[FlexibleSUSY`LowScaleInput] ], + "@overrideTreeHiggsMixings@" -> IndentText@IndentText@StringRiffle[ + With[{mixingMatrix = FindMixingMatrixSymbolFor[#]}, + If[mixingMatrix =!= Null, + ToString@mixingMatrix <> " = this->get_physical()." <> ToString@mixingMatrix <> ";", + "" + ] + ]& /@ DeleteCases[{TreeMasses`GetHiggsBoson[], TreeMasses`GetPseudoscalarHiggsBoson[], TreeMasses`GetChargedHiggsBoson[]}, Null], + "\n" + ], "@copyRunningBSMMassesToDecouplingMasses@" -> IndentText[copyRunningBSMMassesToDecouplingMasses], "@reorderDRbarMasses@" -> IndentText[reorderDRbarMasses], "@reorderPoleMasses@" -> IndentText[reorderPoleMasses], @@ -1920,6 +2058,10 @@ corresponding tadpole is real or imaginary (only in models with CP "@[abstract]selfEnergyPrototypes@" -> IndentText[FunctionModifiers`MakeAbstract[selfEnergyPrototypes]], "@[override]selfEnergyPrototypes@" -> IndentText[FunctionModifiers`MakeOverride[selfEnergyPrototypes]], "@selfEnergyFunctions@" -> selfEnergyFunctions, + "@selfEnergyDerivPrototypes@" -> selfEnergyDerivPrototypes, + "@[abstract]selfEnergyDerivPrototypes@" -> IndentText[FunctionModifiers`MakeAbstract[selfEnergyDerivPrototypes]], + "@[override]selfEnergyDerivPrototypes@" -> IndentText[FunctionModifiers`MakeOverride[selfEnergyDerivPrototypes]], + "@selfEnergyDerivFunctions@" -> selfEnergyDerivFunctions, "@twoLoopTadpolePrototypes@" -> IndentText[twoLoopTadpolePrototypes], "@twoLoopTadpoleFunctions@" -> twoLoopTadpoleFunctions, "@twoLoopSelfEnergyPrototypes@" -> IndentText[twoLoopSelfEnergyPrototypes], @@ -1991,25 +2133,88 @@ corresponding tadpole is real or imaginary (only in models with CP partialWidthCalculationPrototypes = "", partialWidthCalculationFunctions = "", calcAmplitudeSpecializationDecls = "", calcAmplitudeSpecializationDefs = "", partialWidthSpecializationDecls = "", partialWidthSpecializationDefs = "", - smParticleAliases, solverIncludes = "", solver = ""}, + solverIncludes = "", solver = "", contentOfPath = $Path, modelName, bsmParticleAliasList}, + + modelName = + If[SARAH`submodeldir =!= False, + SARAH`modelDir <> "/" <> SARAH`submodeldir, + SARAH`modelDir + ]; (solverIncludes = solverIncludes <> EnableSpectrumGenerator[#])& /@ FlexibleSUSY`FSBVPSolvers; numberOfDecayParticles = Plus @@ (TreeMasses`GetDimensionWithoutGoldstones /@ decayParticles); - (* create list containing elements {field, {FSParticleDecay 'objects'}} *) - decaysLists = - AbsoluteTiming@Map[ - {#, Decays`GetDecaysForParticle[#, maxFinalStateParticles, finalStateParticles]}&, - decayParticles - ]; + (* in parallel model decay of every particle is computed in a separate theread + but if we have only one particle then turning parallelism on only introduces + an overhead with no speed up *) + Block[{FlexibleSUSY`FSEnableParallelism = If[Length[decayParticles] < 2, False, FlexibleSUSY`FSEnableParallelism]}, + (* create list containing elements {field, {FSParticleDecay 'objects'}} *) + If[FlexibleSUSY`FSEnableParallelism, + If[Head[SARAH`VertexList3] === Symbol || Length[SARAH`VertexList3] === 0, + SA`CurrentStates = FlexibleSUSY`FSEigenstates; + SARAH`InitVertexCalculation[FlexibleSUSY`FSEigenstates, False]; + SARAH`partDefinition = ParticleDefinitions[FlexibleSUSY`FSEigenstates]; + SARAH`Particles[SARAH`Current] = SARAH`Particles[FlexibleSUSY`FSEigenstates]; + SARAH`ReadVertexList[FlexibleSUSY`FSEigenstates, False, False, True]; + SARAH`MakeCouplingLists; + ]; + LaunchKernels[]; + DistributeDefinitions[contentOfPath, modelName]; + ParallelEvaluate[ + (* subkernels have different $Path variable than the main kernel + https://mathematica.stackexchange.com/questions/11595/package-found-with-needs-but-not-with-parallelneeds *) + $Path = contentOfPath; + (* don't pollute terminal with SARAH initialization message *) + Block[{Print,workingDirectory = Directory[]}, + << SARAH`; + SARAH`SARAH[OutputDirectory] = FileNameJoin[{workingDirectory, "Output"}]; + SARAH`SARAH[InputDirectories] = { + FileNameJoin[{workingDirectory, "sarah"}], + ToFileName[{$sarahDir, "Models"}] + }; + (* SARAH looks for models in dirs in SARAH`SARAH[InputDirectories] list. + If the model doesn't exist in any particular location mathematica prints a + FileByteCount::fdnfnd warning. This is harmless because at this point in + the code we know that the model does exist at least somewhere. *) + Off[FileByteCount::fdnfnd]; + Off[Superpotential::ViolationGlobal]; + Start@modelName; + On[FileByteCount::fdnfnd]; + On[Superpotential::ViolationGlobal]; + ];, + DistributedContexts -> None + ]; + DistributeDefinitions[SARAH`VertexList3, SARAH`VertexList4]; + decaysLists = + AbsoluteTiming @ ParallelMap[ + {#, Decays`GetDecaysForParticle[#, maxFinalStateParticles, finalStateParticles]}&, + decayParticles, + DistributedContexts -> All, + Method -> "FinestGrained" + ]; + Needs["Parallel`Developer`"]; + Parallel`Developer`ClearDistributedDefinitions[]; + Parallel`Developer`ClearKernels[]; + CloseKernels[]; + , + decaysLists = + AbsoluteTiming @ Map[ + {#, Decays`GetDecaysForParticle[#, maxFinalStateParticles, finalStateParticles]}&, + decayParticles + ]; + ] + ]; Print[""]; - Print["Creation of decay amplitudes took ", Round[First@decaysLists, 0.1], "s"]; + Print["Creation of decay amplitudes took", FSRound[First@decaysLists, 1], "s"]; decaysLists = Last@decaysLists; (* get from generated FSParticleDecay 'objects' vertices needed in decay calculation *) decaysVertices = DeleteDuplicates[Flatten[Decays`GetVerticesForDecays[Last[#]]& /@ decaysLists, 1]]; decaysVertices = SortFieldsInCp /@ decaysVertices; + With[{Wm = If[GetElectricCharge[TreeMasses`GetWBoson[]] < 0, Susyno`LieGroups`conj[TreeMasses`GetWBoson[]], Susyno`LieGroups`conj[TreeMasses`GetWBoson[]]]}, + AppendTo[decaysVertices, {TreeMasses`GetHiggsBoson[], Susyno`LieGroups`conj[Wm], Wm}] + ]; enableDecaysCalculationThreads = False; callAllDecaysFunctions = Decays`CallDecaysCalculationFunctions[decayParticles, enableDecaysCalculationThreads]; @@ -2033,14 +2238,9 @@ corresponding tadpole is real or imaginary (only in models with CP ] ]; - smParticleAliases = Decays`CreateSMParticleAliases["fields"]; bsmParticleAliasList = Decays`CreateBSMParticleAliasList["fields"]; - solver = - Switch[First@FlexibleSUSY`FSBVPSolvers, - TwoScaleSolver, "Two_scale", - SemiAnalyticSolver, "Semi_analytic" - ]; + solver = GetBVPSolverTemplateParameter[First@FlexibleSUSY`FSBVPSolvers]; WriteOut`ReplaceInFiles[files, { "@callAllDecaysFunctions@" -> IndentText[callAllDecaysFunctions], @@ -2048,7 +2248,7 @@ corresponding tadpole is real or imaginary (only in models with CP "@decaysGetters@" -> IndentText[WrapLines[decaysGetters]], "@decaysCalculationPrototypes@" -> IndentText[decaysCalculationPrototypes], "@decaysCalculationFunctions@" -> WrapLines[decaysCalculationFunctions], - "@partialWidthCalculationPrototypes@" -> partialWidthCalculationPrototypes, + "@partialWidthCalculationPrototypes@" -> TextFormatting`IndentText[partialWidthCalculationPrototypes], "@partialWidthCalculationFunctions@" -> partialWidthCalculationFunctions, "@calcAmplitudeSpecializationDecls@" -> calcAmplitudeSpecializationDecls, "@calcAmplitudeSpecializationDefs@" -> calcAmplitudeSpecializationDefs, @@ -2058,11 +2258,11 @@ corresponding tadpole is real or imaginary (only in models with CP "@decaysListGettersFunctions@" -> decaysListGettersFunctions, "@initDecayTable@" -> IndentText[WrapLines[initDecayTable]], "@numberOfDecayParticles@" -> ToString[numberOfDecayParticles], - "@create_SM_particle_usings@" -> smParticleAliases, "@create_BSM_particle_list@" -> Last@bsmParticleAliasList, "@gs_name@" -> ToString[TreeMasses`GetStrongCoupling[]], "@solver@" -> solver, "@solverIncludes@" -> solverIncludes, + "@isCPodd@" -> If[TreeMasses`GetPseudoscalarHiggsBoson[] =!= Null && GetDimensionWithoutGoldstones[TreeMasses`GetPseudoscalarHiggsBoson[]] > 0, " || std::is_same_v FSModelName <> "_cxx_diagrams::fields::PseudoscalarHiggs>", ""], Sequence @@ GeneralReplacementRules[] } ]; @@ -2072,9 +2272,6 @@ corresponding tadpole is real or imaginary (only in models with CP WriteBVPSolverTemplates[files_List] := WriteOut`ReplaceInFiles[files, { Sequence @@ GeneralReplacementRules[] }]; -WriteSolverMatchingClass[files_List] := - WriteOut`ReplaceInFiles[files, { Sequence @@ GeneralReplacementRules[] } ]; - WriteTwoScaleModelClass[files_List] := WriteOut`ReplaceInFiles[files, { Sequence @@ GeneralReplacementRules[] }]; @@ -2131,6 +2328,16 @@ corresponding tadpole is real or imaginary (only in models with CP } ]; ]; +WriteShootingSpectrumGeneratorClass[files_List] := + Module[{fillSMFermionPoleMasses = ""}, + fillSMFermionPoleMasses = FlexibleEFTHiggsMatching`FillSMFermionPoleMasses[]; + WriteOut`ReplaceInFiles[files, + { + "@fillSMFermionPoleMasses@" -> IndentText[fillSMFermionPoleMasses], + Sequence @@ GeneralReplacementRules[] + } ]; + ]; + WriteSemiAnalyticSpectrumGeneratorClass[files_List] := Module[{boundaryConstraint = "", semiAnalyticConstraint = "", getBoundaryScale = ""}, Which[SemiAnalytic`IsBoundaryConstraint[FlexibleSUSY`HighScaleInput], @@ -2164,64 +2371,11 @@ corresponding tadpole is real or imaginary (only in models with CP } ]; ]; -WriteEffectiveCouplings[couplings_List, settings_List, massMatrices_List, vertexRules_List, files_List] := - Module[{i, partialWidthGetterPrototypes, partialWidthGetters, - loopCouplingsGetters, loopCouplingsDefs, mixingMatricesDefs = "", - loopCouplingsInit, mixingMatricesInit = "", copyMixingMatrices = "", - setSMStrongCoupling = "", - calculateScalarScalarLoopQCDFactor, calculateScalarFermionLoopQCDFactor, - calculatePseudocalarFermionLoopQCDFactor, - calculateScalarQCDScalingFactor, calculatePseudoscalarQCDScalingFactor, - calculateLoopCouplings, loopCouplingsPrototypes, - loopCouplingsFunctions}, - {partialWidthGetterPrototypes, partialWidthGetters} = EffectiveCouplings`CalculatePartialWidths[couplings]; - If[ValueQ[SARAH`strongCoupling], - setSMStrongCoupling = "model.set_" <> CConversion`ToValidCSymbolString[SARAH`strongCoupling] <> "(sm.get_g3());\n"; - ]; - loopCouplingsGetters = EffectiveCouplings`CreateEffectiveCouplingsGetters[couplings]; - For[i = 1, i <= Length[massMatrices], i++, - mixingMatricesDefs = mixingMatricesDefs <> TreeMasses`CreateMixingMatrixDefinition[massMatrices[[i]]]; - mixingMatricesInit = mixingMatricesInit <> EffectiveCouplings`InitializeMixingFromModelInput[massMatrices[[i]]]; - copyMixingMatrices = copyMixingMatrices <> EffectiveCouplings`GetMixingMatrixFromModel[massMatrices[[i]]]; - ]; - loopCouplingsDefs = EffectiveCouplings`CreateEffectiveCouplingsDefinitions[couplings]; - loopCouplingsInit = EffectiveCouplings`CreateEffectiveCouplingsInit[couplings]; - {calculateScalarScalarLoopQCDFactor, calculateScalarFermionLoopQCDFactor, - calculatePseudoscalarFermionLoopQCDFactor} = - EffectiveCouplings`CalculateQCDAmplitudeScalingFactors[]; - {calculateScalarQCDScalingFactor, calculatePseudoscalarQCDScalingFactor} = - EffectiveCouplings`CalculateQCDScalingFactor[]; - calculateLoopCouplings = EffectiveCouplings`CreateEffectiveCouplingsCalculation[couplings]; - {loopCouplingsPrototypes, loopCouplingsFunctions} = - EffectiveCouplings`CreateEffectiveCouplings[couplings, massMatrices, vertexRules]; - WriteOut`ReplaceInFiles[files, - { "@partialWidthGetterPrototypes@" -> IndentText[partialWidthGetterPrototypes], - "@partialWidthGetters@" -> partialWidthGetters, - "@loopCouplingsGetters@" -> IndentText[loopCouplingsGetters], - "@loopCouplingsPrototypes@" -> IndentText[loopCouplingsPrototypes], - "@mixingMatricesDefs@" -> IndentText[mixingMatricesDefs], - "@loopCouplingsDefs@" -> IndentText[loopCouplingsDefs], - "@mixingMatricesInit@" -> IndentText[WrapLines[mixingMatricesInit]], - "@loopCouplingsInit@" -> IndentText[WrapLines[loopCouplingsInit]], - "@copyMixingMatrices@" -> IndentText[copyMixingMatrices], - "@setSMStrongCoupling@" -> IndentText[setSMStrongCoupling], - "@calculateScalarScalarLoopQCDFactor@" -> IndentText[WrapLines[calculateScalarScalarLoopQCDFactor]], - "@calculateScalarFermionLoopQCDFactor@" -> IndentText[WrapLines[calculateScalarFermionLoopQCDFactor]], - "@calculatePseudoscalarFermionLoopQCDFactor@" -> IndentText[WrapLines[calculatePseudoscalarFermionLoopQCDFactor]], - "@calculateScalarQCDScalingFactor@" -> IndentText[WrapLines[calculateScalarQCDScalingFactor]], - "@calculatePseudoscalarQCDScalingFactor@" -> IndentText[WrapLines[calculatePseudoscalarQCDScalingFactor]], - "@calculateLoopCouplings@" -> IndentText[calculateLoopCouplings], - "@loopCouplingsFunctions@" -> loopCouplingsFunctions, - Sequence @@ GeneralReplacementRules[] - } ]; - ]; - (* Write the observables files *) WriteObservables[extraSLHAOutputBlocks_, files_List] := Module[{requestedObservables, numberOfObservables, observablesDef, observablesInit, getObservables, getObservablesNames, - clearObservables, setObservables, calculateObservables, - loopCouplingsPrototypes, loopCouplingsFunctions}, + clearObservables, setObservables, calculateObservables}, requestedObservables = Observables`GetRequestedObservables[extraSLHAOutputBlocks]; numberOfObservables = Observables`CountNumberOfObservables[requestedObservables]; observablesDef = Observables`CreateObservablesDefinitions[requestedObservables]; @@ -2230,6 +2384,8 @@ corresponding tadpole is real or imaginary (only in models with CP Observables`CreateSetAndDisplayObservablesFunctions[requestedObservables]; clearObservables = Observables`CreateClearObservablesFunction[requestedObservables]; calculateObservables = Observables`CalculateObservables[requestedObservables, "observables"]; + + WriteOut`ReplaceInFiles[files, { "@numberOfObservables@" -> ToString[numberOfObservables], "@observablesDef@" -> IndentText[observablesDef], @@ -2239,6 +2395,7 @@ corresponding tadpole is real or imaginary (only in models with CP "@clearObservables@" -> IndentText[clearObservables], "@setObservables@" -> IndentText[setObservables], "@calculateObservables@" -> IndentText @ IndentText[calculateObservables], + "@observablesHeaders@" -> Observables`GetObservablesHeaders[], Sequence @@ GeneralReplacementRules[] } ]; ]; @@ -2253,14 +2410,14 @@ corresponding tadpole is real or imaginary (only in models with CP defineFieldTraits, sarahOutputDir = SARAH`$sarahCurrentOutputMainDir, outputDir, cxxDiagramsDir, createdVerticesFile, fileHandle, - cxxQFTVerticesFiles}, + cxxQFTVerticesFiles, realFieldsconjtraits}, massFunctions = CXXDiagrams`CreateMassFunctions[]; physicalMassFunctions = CXXDiagrams`CreatePhysicalMassFunctions[]; - fields = CXXDiagrams`CreateFields[]; + {fields, realFieldsconjtraits} = CXXDiagrams`CreateFields[PotentialLSPParticles]; defineFieldTraits = CXXDiagrams`CreateFieldTraitsDefinitions[ - TreeMasses`GetParticles[], FlexibleSUSY`FSModelName <> "_cxx_diagrams::fields" + TreeMasses`GetParticles[], "flexiblesusy::" <> FlexibleSUSY`FSModelName <> "_cxx_diagrams::fields" ]; If[vertices =!= {}, @@ -2288,11 +2445,12 @@ corresponding tadpole is real or imaginary (only in models with CP WriteOut`ReplaceInFiles[files, {"@CXXDiagrams_Fields@" -> fields, + "@CXXDiagrams_realFields@" -> realFieldsconjtraits, "@CXXDiagrams_MassFunctions@" -> massFunctions, "@CXXDiagrams_PhysicalMassFunctions@" -> physicalMassFunctions, "@defineFieldTraits@" -> defineFieldTraits, "@CXXDiagrams_VertexPrototypes@" -> - StringJoin[Riffle[cxxVerticesParts[[All, 1]], "\n\n"]], + StringRiffle[cxxVerticesParts[[All, 1]], "\n\n"], Sequence @@ GeneralReplacementRules[] }]; @@ -2310,30 +2468,37 @@ corresponding tadpole is real or imaginary (only in models with CP }] & /@ Transpose[{cxxQFTVerticesFiles, cxxVerticesParts}]; WriteOut`ReplaceInFiles[cxxQFTVerticesMakefileTemplates, {"@generatedCXXVerticesFiles@" -> - "\t" <> StringJoin[Riffle[cxxQFTVerticesFiles[[All, 2]], " \\\n\t"]], + "\t" <> StringRiffle[cxxQFTVerticesFiles[[All, 2]], " \\\n\t"], Sequence @@ GeneralReplacementRules[] }]; ]; (* Write the EDM c++ files *) -WriteEDMClass[edmFields_List,files_List] := - Module[{graphs,diagrams,vertices, - interfacePrototypes,interfaceDefinitions}, - graphs = EDM`EDMContributingGraphs[]; - diagrams = Outer[EDM`EDMContributingDiagramsForFieldAndGraph,edmFields,graphs,1]; - - vertices = Flatten[CXXDiagrams`VerticesForDiagram /@ Flatten[diagrams,2],1]; +WriteEDMClass[fields_List, files_List] := + Module[{(* in models without flavour violation (no FV models) lepton does not have an index *) + leptonIndex = If[Length[fields] > 0, If[TreeMasses`GetDimension[First@fields] =!= 1, "idx", ""], ""], + (* we want to calculate an offset of g-2 compared to the SM *) + discardSMcontributions = CConversion`CreateCBoolValue[False], + calculation, calculateForwadDeclaration}, + + calculation = + If[Length[fields] =!= 0, + "const auto form_factors = " <> + FSModelName <> "_FFV_form_factors::calculate_form_factors + CXXDiagrams`CXXNameOfField[TreeMasses`GetPhoton[]] <> ">(" <> + leptonIndex <> If[leptonIndex === "", "", ", "] <> + leptonIndex <> If[leptonIndex === "", "", ", "] <> + "model, " <> discardSMcontributions <> ");", + "const std::valarray> form_factors {0., 0., 0., 0.};" + ]; - {interfacePrototypes,interfaceDefinitions} = - If[diagrams === {}, - {"",""}, - StringJoin @@@ - (Riffle[#, "\n\n"] & /@ Transpose[EDM`EDMCreateInterfaceFunctionForField @@@ - Transpose[{edmFields,Transpose[{graphs,#}] & /@ diagrams}]])]; + calculateForwadDeclaration = StringRiffle[EDM`EDMForwardDeclaration[#, "calculate_edm"]& /@ fields, "\n"]; WriteOut`ReplaceInFiles[files, - {"@EDM_InterfacePrototypes@" -> interfacePrototypes, - "@EDM_InterfaceDefinitions@" -> interfaceDefinitions, + {"@EDMCalculation@" -> TextFormatting`IndentText[calculation], + "@extraIdxDecl@" -> If[GetParticleFromDescription["Leptons"] =!= Null, ", int idx", ""], + "@calculateForwadDeclaration@" -> calculateForwadDeclaration, + "@extraIdxUsageNoComma@" -> If[GetParticleFromDescription["Leptons"] =!= Null, "idx", ""], Sequence @@ GeneralReplacementRules[] }]; @@ -2343,7 +2508,7 @@ corresponding tadpole is real or imaginary (only in models with CP (* Write the FFV c++ files *) WriteFFVFormFactorsClass[extParticles_List, files_List] := Module[{ - interfacePrototypes = "", interfaceDefinitions = "", + interfacePrototypes = "", interfaceDefinitions = "", templateWrapperDecl = "", templateWrapperDef = "", graphs, diagrams, vertices = {} }, @@ -2359,7 +2524,7 @@ corresponding tadpole is real or imaginary (only in models with CP vertices = Flatten[CXXDiagrams`VerticesForDiagram /@ Flatten[diagrams,2], 1]; - {interfacePrototypes, interfaceDefinitions} = + {interfacePrototypes, interfaceDefinitions, templateWrapperDecl, templateWrapperDef} = StringJoin /@ (Riffle[#, "\n\n"]& /@ Transpose[ FFVFormFactors`FFVFormFactorsCreateInterfaceFunction[#1, graphs, #2]& @@@ Transpose[{extParticles, diagrams}] @@ -2369,30 +2534,14 @@ corresponding tadpole is real or imaginary (only in models with CP WriteOut`ReplaceInFiles[files, {"@FFVFormFactors_InterfacePrototypes@" -> interfacePrototypes, "@FFVFormFactors_InterfaceDefinitions@" -> interfaceDefinitions, + "@TemplateWrapper_InterfacePrototypes@" -> templateWrapperDecl, + "@TemplateWrapper_InterfaceDefinitions@" -> templateWrapperDef, Sequence @@ GeneralReplacementRules[]} ]; vertices ]; -WriteLToLGammaClass[decays_List, files_List] := - Module[{interfacePrototypes, interfaceDefinitions}, - - {interfacePrototypes, interfaceDefinitions} = - If[decays === {}, - {"",""}, - StringJoin @@@ - (Riffle[#, "\n\n"]& /@ Transpose[BrLToLGamma`CreateInterfaceFunctionForBrLToLGamma /@ decays]) - ]; - - WriteOut`ReplaceInFiles[files, { - "@LToLGamma_InterfacePrototypes@" -> interfacePrototypes, - "@LToLGamma_InterfaceDefinitions@" -> interfaceDefinitions, - Sequence @@ GeneralReplacementRules[] - } - ]; - ]; - WriteBToSGammaClass[decays_List, files_List] := Module[{createInterface = False, btosgammaInterfaceDefinitions}, @@ -2406,90 +2555,127 @@ corresponding tadpole is real or imaginary (only in models with CP Sequence @@ GeneralReplacementRules[]}]; ]; -(* Write c++ files for the F -> F conversion in nucleus *) -(* leptonPairs is a list of lists, sth like {{Fe -> Fe, Au}, {Fe -> Fe, Al}} etc *) -WriteFToFConversionInNucleusClass[leptonPairs:{{_->_,_}...}, files_List] := - Module[{interfacePrototypes = "", interfaceDefinitions = "", - massiveNeutralVectorBosons, masslessNeutralVectorBosons, externalFermions, - vertices = {},processesUnderInterest,npfVertices = {},npfHeaders = "",npfCode = "" - }, - - If[leptonPairs =!= {}, - - (* additional vertices needed for the calculation *) - (* coupling of vector bosons to quarks *) - massiveNeutralVectorBosons = Select[GetVectorBosons[], - !(TreeMasses`IsMassless[#] || TreeMasses`IsElectricallyCharged[#])& - ]; - (* @todo: should we include gluons or not? *) - masslessNeutralVectorBosons = Select[GetVectorBosons[], - (TreeMasses`IsMassless[#] && !TreeMasses`IsElectricallyCharged[#] && !TreeMasses`ColorChargedQ[#])& - ]; - (* drop nucleon, convert rule to list (so {Fe -> Fe, Au} into {Fe,Fe} *) - externalFermions = DeleteDuplicates@Flatten[ - {TreeMasses`GetSMQuarks[], Drop[leptonPairs, None, -1] /. Rule[a_, b_] :> Sequence[a, b]} - ]; - vertices = Flatten /@ Tuples[ - {{CXXDiagrams`LorentzConjugate[#], #}& /@ externalFermions, - Join[masslessNeutralVectorBosons, massiveNeutralVectorBosons]} - ]; - processesUnderInterest = DeleteDuplicates@Transpose[Drop[Transpose@leptonPairs, -1]]; - {npfVertices,npfHeaders,npfCode} = NPointFunctions`CreateCXXFToFConversionInNucleus@processesUnderInterest; - {interfacePrototypes, interfaceDefinitions} = - StringJoin @@@ - (Riffle[#, "\n\n"] & /@ Transpose[FToFConversionInNucleus`FToFConversionInNucleusCreateInterface @@@ - processesUnderInterest - ] ); - ]; - +WriteUnitarityClass[files_List] := + Module[{res}, + res = If[FSUnitarityConstraints, Unitarity`GetScatteringMatrix[], {0, ""}]; WriteOut`ReplaceInFiles[files, - { - "@npf_headers@" -> npfHeaders, - "@npf_definitions@" -> npfCode, - "@FToFConversion_InterfacePrototypes@" -> interfacePrototypes, - "@FToFConversion_InterfaceDefinitions@" -> interfaceDefinitions, - Sequence @@ GeneralReplacementRules[]} - ]; - - DeleteDuplicates@Join[vertices,npfVertices] - ]; + {"@scatteringPairsLength@" -> ToString@res[[1]], + "@infiniteSMatrix@" -> res[[2]], + Sequence @@ GeneralReplacementRules[] + }]; + ]; -(* Write the AMuon c++ files *) -WriteAMuonClass[calcAMu_, files_List] := - Module[{calculation, getMSUSY, - (* in models without flavour violation (no FV models) muon does not have an index, - otherwise we assume it's the second particle in the lepton multiplet *) - muonIndex = If[TreeMasses`GetDimension[AMuon`AMuonGetMuon[]] =!= 1, "1", ""], +(* Write the AMM c++ files *) +WriteAMMClass[fields_List, files_List] := + Module[{calculation, getMLCP, + (* in models without flavour violation (no FV models) lepton does not have an index *) + leptonIndex = If[Length[fields] > 0, If[TreeMasses`GetDimension[First@fields] =!= 1, "idx", ""], ""], (* we want to calculate an offset of g-2 compared to the SM *) - discardSMcontributions = CConversion`CreateCBoolValue[True]}, + discardSMcontributions = CConversion`CreateCBoolValue[True], + graphs, diagrams, vertices, barZee = "", calculateForwadDeclaration, uncertaintyForwadDeclaration, leptonPoleMass, + ammWrapperDecl, ammWrapperDef, ammUncWrapperDecl, ammUncWrapperDef}, calculation = - If[calcAMu, + If[Length[fields] =!= 0, "const auto form_factors = " <> - FSModelName <> "_FFV_form_factors::calculate_" <> CXXDiagrams`CXXNameOfField[AMuon`AMuonGetMuon[]] <> "_" <> - CXXDiagrams`CXXNameOfField[AMuon`AMuonGetMuon[]] <> "_" <> CXXDiagrams`CXXNameOfField[TreeMasses`GetPhoton[]] <> "_form_factors(" <> - muonIndex <> If[muonIndex === "", "", ", "] <> - muonIndex <> If[muonIndex === "", "", ", "] <> + FSModelName <> "_FFV_form_factors::calculate_form_factors + CXXDiagrams`CXXNameOfField[TreeMasses`GetPhoton[]] <> ">(" <> + leptonIndex <> If[leptonIndex === "", "", ", "] <> + leptonIndex <> If[leptonIndex === "", "", ", "] <> "model, " <> discardSMcontributions <> ");", "const std::valarray> form_factors {0., 0., 0., 0.};" ]; - getMSUSY = AMuon`AMuonGetMSUSY[]; + getMLCP = AMM`AMMGetMLCP[]; + + (* only Barr-Zee graphs + 1-loop diagrams will be provided by the FFMasslessV module and are taken care of elsewhere *) + graphs = If[Length[fields] > 0, AMM`AMMContributingGraphs[], {}]; + diagrams = If[Length[fields] > 0, Flatten[Outer[AMM`AMMContributingDiagramsForGraph, graphs, fields, 1], 1], {}]; + + vertices = Flatten[CXXDiagrams`VerticesForDiagram /@ Flatten[diagrams, 1], 1]; + calculateForwadDeclaration = StringRiffle[AMM`AMMForwardDeclaration[#, "calculate_amm"]& /@ fields, "\n"]; + uncertaintyForwadDeclaration = StringRiffle[AMM`AMMForwardDeclaration[#, "calculate_amm_uncertainty"]& /@ fields, "\n"]; + + For[i = 1, i <= Length[graphs], i++, + For[j = 1, j <= Length[diagrams[[i]]], j++, + barZee = barZee <> + "val += " <> ToString @ N[ + With[{colFac = CXXDiagrams`ColourFactorForIndexedDiagramFromGraph[ + CXXDiagrams`IndexDiagramFromGraph[diagrams[[i,j]], graphs[[i]]], + graphs[[i]] + ]}, + If[Im[colFac] == 0, colFac, Print["Error: Colour prefactor of a Barr-Zee diagram should be real!"]; Quit[1]] + ], 16] <> " * " <> + ToString @ AMM`CXXEvaluatorForDiagramFromGraph[diagrams[[i,j]], graphs[[i]]] <> + "::value({" <> leptonIndex <> "}, context, ml_pole);\n" + ]; + ]; + + leptonPoleMass = + If[GetParticleFromDescription["Leptons"] =!= Null, +"template +double lepton_pole_mass(const softsusy::QedQcd& qedqcd, int idx) +{ + return qedqcd.displayLeptonPoleMass(idx); +}", +StringRiffle[ +( +"template +std::enable_if_t CXXDiagrams`CXXNameOfField[#, prefixNamespace-> FlexibleSUSY`FSModelName <> "_cxx_diagrams::fields"] <> ">, double> +lepton_pole_mass(const softsusy::QedQcd& qedqcd) +{\n" <> +TextFormatting`IndentText[ + Switch[#, + GetParticleFromDescription["Electron"], "return qedqcd.displayPoleMel()", + GetParticleFromDescription["Muon"], "return qedqcd.displayPoleMmuon()", + GetParticleFromDescription["Tau"], "return qedqcd.displayPoleMtau()" + ] <> ";\n" +] <> +"}")& /@ If[fields =!= {}, fields, {GetParticleFromDescription["Electron"], GetParticleFromDescription["Muon"], GetParticleFromDescription["Tau"]}], +"\n\n" +] + ]; + + ammWrapperDecl = StringRiffle[("double calculate_" <> CXXDiagrams`CXXNameOfField[#] <> "_amm(const " <> FlexibleSUSY`FSModelName <> "_mass_eigenstates& model, const softsusy::QedQcd& qedqcd, const Spectrum_generator_settings& settings" <> If[GetParticleFromDescription["Leptons"] =!= Null, ", int idx", ""] <> ");")& /@ fields, "\n"]; + ammUncWrapperDecl = StringRiffle[("double calculate_" <> CXXDiagrams`CXXNameOfField[#] <> "_amm_uncertainty(const " <> FlexibleSUSY`FSModelName <> "_mass_eigenstates& model, const softsusy::QedQcd& qedqcd, const Spectrum_generator_settings& settings" <> If[GetParticleFromDescription["Leptons"] =!= Null, ", int idx", ""] <> ");")& /@ fields, "\n"]; + ammWrapperDef = StringRiffle[ +("double calculate_" <> CXXDiagrams`CXXNameOfField[#] <> "_amm(const " <> FlexibleSUSY`FSModelName <> "_mass_eigenstates& model, const softsusy::QedQcd& qedqcd, const Spectrum_generator_settings& settings" <> If[GetParticleFromDescription["Leptons"] =!= Null, ", int idx", ""] <> ") { + return " <> FlexibleSUSY`FSModelName <> "_amm::calculate_amm CXXDiagrams`CXXNameOfField[#] <> ">(model, qedqcd, settings" <> If[GetParticleFromDescription["Leptons"] =!= Null, ", idx", ""] <> "); +}")& /@ fields, "\n" + ]; + ammUncWrapperDef = StringRiffle[ +("double calculate_" <> CXXDiagrams`CXXNameOfField[#] <> "_amm_uncertainty(const " <> FlexibleSUSY`FSModelName <> "_mass_eigenstates& model, const softsusy::QedQcd& qedqcd, const Spectrum_generator_settings& settings" <> If[GetParticleFromDescription["Leptons"] =!= Null, ", int idx", ""] <> ") { + return " <> FlexibleSUSY`FSModelName <> "_amm::calculate_amm_uncertainty CXXDiagrams`CXXNameOfField[#] <> ">(model, qedqcd, settings" <> If[GetParticleFromDescription["Leptons"] =!= Null, ", idx", ""] <> "); +}")& /@ fields, "\n" + ]; WriteOut`ReplaceInFiles[files, - {"@AMuon_MuonField@" -> CXXDiagrams`CXXNameOfField[AMuon`AMuonGetMuon[]], - "@AMuon_Calculation@" -> TextFormatting`IndentText[calculation], - "@AMuon_GetMSUSY@" -> TextFormatting`IndentText[WrapLines[getMSUSY]], - "@AMuon_MuonIndex@" -> muonIndex, + {"@AMMZBosonField@" -> CXXDiagrams`CXXNameOfField[TreeMasses`GetZBoson[]], + "@AMMCalculation@" -> Nest[TextFormatting`IndentText, calculation, 1], + "@AMMGetMLCP@" -> TextFormatting`IndentText[WrapLines[getMLCP]], + "@calculateAForwardDeclaration@" -> calculateForwadDeclaration, + "@calculateAUncertaintyForwardDeclaration@" -> uncertaintyForwadDeclaration, + "@extraIdxDecl@" -> If[GetParticleFromDescription["Leptons"] =!= Null, ", int idx", ""], + "@extraIdxUsage@" -> If[GetParticleFromDescription["Leptons"] =!= Null, ", idx", ""], + "@extraIdxUsageNoComma@" -> If[GetParticleFromDescription["Leptons"] =!= Null, "idx", ""], + "@leptonPoleMass@" -> leptonPoleMass, + "@AMMBarrZeeCalculation@" -> Nest[TextFormatting`IndentText, barZee, 1], + "@ammWrapperDecl@" -> ammWrapperDecl, + "@ammWrapperDef@" -> ammWrapperDef, + "@ammUncWrapperDecl@" -> ammUncWrapperDecl, + "@ammUncWrapperDef@" -> ammUncWrapperDef, Sequence @@ GeneralReplacementRules[] }]; + vertices ]; GetBVPSolverHeaderName[solver_] := Switch[solver, FlexibleSUSY`TwoScaleSolver, "two_scale", FlexibleSUSY`SemiAnalyticSolver, "semi_analytic", + FlexibleSUSY`ShootingSolver, "shooting", FlexibleSUSY`LatticeSolver, "lattice", _, Print["Error: invalid BVP solver requested: ", solver]; Quit[1]; @@ -2499,6 +2685,7 @@ corresponding tadpole is real or imaginary (only in models with CP Switch[solver, FlexibleSUSY`TwoScaleSolver, "ENABLE_TWO_SCALE_SOLVER", FlexibleSUSY`SemiAnalyticSolver, "ENABLE_SEMI_ANALYTIC_SOLVER", + FlexibleSUSY`ShootingSolver, "ENABLE_SHOOTING_SOLVER", FlexibleSUSY`LatticeSolver, "ENABLE_LATTICE_SOLVER", _, Print["Error: invalid BVP solver requested: ", solver]; Quit[1]; @@ -2509,6 +2696,7 @@ corresponding tadpole is real or imaginary (only in models with CP FlexibleSUSY`TwoScaleSolver, "1", FlexibleSUSY`SemiAnalyticSolver, "2", FlexibleSUSY`LatticeSolver, "3", + FlexibleSUSY`ShootingSolver, "4", _, Print["Error: invalid BVP solver requested: ", solver]; Quit[1]; ]; @@ -2517,6 +2705,7 @@ corresponding tadpole is real or imaginary (only in models with CP Switch[solver, FlexibleSUSY`TwoScaleSolver, "Two_scale", FlexibleSUSY`SemiAnalyticSolver, "Semi_analytic", + FlexibleSUSY`ShootingSolver, "Shooting", FlexibleSUSY`LatticeSolver, "Lattice", _, Print["Error: invalid BVP solver requested: ", solver]; Quit[1]; @@ -2533,7 +2722,7 @@ corresponding tadpole is real or imaginary (only in models with CP ]; RunEnabledSpectrumGenerator[solver_] := - Module[{key = "", class = "", macro = "", body = "", result = ""}, + Module[{key = "", class = "", body = "", result = ""}, key = GetBVPSolverSLHAOptionKey[solver]; class = GetBVPSolverTemplateParameter[solver]; body = "exit_code = run_solver<" <> class <> ">(\n" @@ -2541,28 +2730,31 @@ corresponding tadpole is real or imaginary (only in models with CP "slha_io, spectrum_generator_settings, " <> If[FSCalculateDecays, "flexibledecay_settings, ", ""] <> "slha_output_file,\n"] - <> IndentText["database_output_file, spectrum_file, rgflow_file);\n"] - <> "if (!exit_code || solver_type != 0) break;\n"; + <> IndentText["database_output_file, spectrum_file, rgflow_file, higgsbounds_dataset, higgssignals_dataset, lilith_db);\n"] + <> "if (!exit_code || solver_type != 0) break;\n" + <> "[[fallthrough]];\n"; result = "case " <> key <> ":\n" <> IndentText[body]; EnableForBVPSolver[solver, IndentText[result]] <> "\n" ]; ScanEnabledSpectrumGenerator[solver_] := - Module[{key = "", class = "", macro = "", body = "", result = ""}, + Module[{key = "", class = "", body = "", result = ""}, key = GetBVPSolverSLHAOptionKey[solver]; class = GetBVPSolverTemplateParameter[solver]; body = "result = run_parameter_point<" <> class <> ">(loop_library, qedqcd, input);\n" - <> "if (!result.problems.have_problem() || solver_type != 0) break;\n"; + <> "if (!result.problems.have_problem() || solver_type != 0) break;\n" + <> "[[fallthrough]];\n"; result = "case " <> key <> ":\n" <> IndentText[body]; EnableForBVPSolver[solver, IndentText[IndentText[result]]] <> "\n" ]; RunCmdLineEnabledSpectrumGenerator[solver_] := - Module[{key = "", class = "", macro = "", body = "", result = ""}, + Module[{key = "", class = "", body = "", result = ""}, key = GetBVPSolverSLHAOptionKey[solver]; class = GetBVPSolverTemplateParameter[solver]; body = "exit_code = run_solver<" <> class <> ">(loop_library,input);\n" - <> "if (!exit_code || solver_type != 0) break;\n"; + <> "if (!exit_code || solver_type != 0) break;\n" + <> "[[fallthrough]];\n"; result = "case " <> key <> ":\n" <> IndentText[body]; EnableForBVPSolver[solver, IndentText[result]] <> "\n" ]; @@ -2578,16 +2770,45 @@ corresponding tadpole is real or imaginary (only in models with CP ]; ExampleCalculateDecaysForModel[] := +IndentText[ "if (flexibledecay_settings.get(FlexibleDecay_settings::calculate_decays) && (spectrum_generator_settings.get(Spectrum_generator_settings::force_output) || !problems.have_problem())) { if (loop_library_for_decays) { - decays.calculate_decays(); - } - else if (!loop_library_for_decays) { - WARNING(\"Decay module requires a dedicated loop library. Configure FlexibleSUSY with Collier or LoopTools and set appropriately flag 31 in Block FlexibleSUSY of the LesHouches input.\"); - } -}"; + decays.calculate_decays();\n" +] <> +IndentText@IndentText@IndentText[ +"effc = + get_normalized_effective_couplings(decays.get_neutral_higgs_effc(), physical_input, qedqcd, spectrum_generator_settings, flexibledecay_settings);\n" <> +IndentText[ + "try {\n" <> + IndentText[ + "// structured bindings creates new variables - need to use std::tie +#ifdef ENABLE_HIGGSTOOLS +if (flexibledecay_settings.get(FlexibleDecay_settings::call_higgstools)) { + std::tie(hs, higgsbounds_v) = + call_higgstools(effc, physical_input, higgsbounds_dataset, higgssignals_dataset); +} +#endif +#ifdef ENABLE_LILITH +if (flexibledecay_settings.get(FlexibleDecay_settings::call_lilith)) { + lilith = call_lilith(effc, physical_input, lilith_db); +} +#endif\n" + ] <> + "}\n" <> + "catch (const std::exception& error) {\n" <> + IndentText["ERROR(error.what());\n"] <> + "}\n" +] +] <> +IndentText[IndentText[ +"} +else if (!loop_library_for_decays) { + WARNING(\"Decay module requires a dedicated loop library. Configure FlexibleSUSY with Collier or LoopTools and set appropriately flag 31 in Block FlexibleSUSY of the LesHouches input.\"); +}" +] <> "\n}" +]; ExampleSetDecaysSLHAOutput[] := "\ const bool show_decays = !decays.get_problems().have_problem() || @@ -2596,12 +2817,39 @@ corresponding tadpole is real or imaginary (only in models with CP if (show_decays && flexibledecay_settings.get(FlexibleDecay_settings::calculate_decays) && loop_library_for_decays) { slha_io.set_dcinfo(decays.get_problems()); slha_io.set_decays(decays.get_decay_table(), flexibledecay_settings); + if (flexibledecay_settings.get(FlexibleDecay_settings::print_effc_block)) { + slha_io.set_effectivecouplings_block(decays.get_effhiggscouplings_block_input()); + } + if (flexibledecay_settings.get(FlexibleDecay_settings::calculate_normalized_effc)) { + slha_io.set_normalized_effectivecouplings_block(effc);\n" <> + If[SA`CPViolationHiggsSector || GetDimensionWithoutGoldstones@TreeMasses`GetPseudoscalarHiggsBoson[] != 0, IndentText@IndentText["slha_io.set_imnormalized_effectivecouplings_block(effc);\n"], ""] <> +" } +#ifdef ENABLE_HIGGSTOOLS + if (flexibledecay_settings.get(FlexibleDecay_settings::call_higgstools)) { + if (hs.has_value()) { + SignalResult hs_ = hs.value(); + slha_io.set_hs_or_lilith(\"HIGGSSIGNALS\", hs_.ndof, hs_.chi2BSM, hs_.chi2SM, hs_.mhRef, hs_.pval); + } + if (higgsbounds_v.size() > 0) { + slha_io.set_higgsbounds(higgsbounds_v); + } + } +#endif +#ifdef ENABLE_LILITH + if (flexibledecay_settings.get(FlexibleDecay_settings::call_lilith) && lilith.has_value()) { + slha_io.set_hs_or_lilith(\"LILITH\", lilith.value().ndof, lilith.value().chi2BSM, lilith.value().chi2SM, lilith.value().mhRef, lilith.value().pval); + } +#endif }"; ExampleCalculateCmdLineDecays[] := -FlexibleSUSY`FSModelName <> "_decays decays;" <> -"if (settings.get(Spectrum_generator_settings::calculate_sm_masses)) { - decays = " <> FlexibleSUSY`FSModelName <> "_decays(std::get<0>(models), qedqcd, physical_input, flexibledecay_settings); +FlexibleSUSY`FSModelName <> "_decays decays " <> +"= " <> FlexibleSUSY`FSModelName <> "_decays(std::get<0>(models), qedqcd, physical_input, flexibledecay_settings); +const bool loop_library_for_decays = + (Loop_library::get_type() == Loop_library::Library::Collier) || + (Loop_library::get_type() == Loop_library::Library::Looptools); +if (spectrum_generator.get_exit_code() == 0 && loop_library_for_decays) { + decays.calculate_decays(); }"; WriteExampleCmdLineOutput[enableDecays_] := @@ -2662,6 +2910,10 @@ corresponding tadpole is real or imaginary (only in models with CP spectrum_generator_settings.set( Spectrum_generator_settings::calculate_bsm_masses, 1.0); } + if (flexibledecay_settings.get(FlexibleDecay_settings::print_effc_block) && " <> FlexibleSUSY`FSModelName <> "_info::is_CP_violating_Higgs_sector) { + WARNING(\"Printing of EFFHIGGSCOUPLINGS block is disabled in models with CP-violating Higgs sector\"); + flexibledecay_settings.set(FlexibleDecay_settings::print_effc_block, 0.); + } }", fillSLHAIO = "slha_io.fill(models, qedqcd, scales, observables, settings, flexibledecay_settings);" ]; @@ -2680,12 +2932,17 @@ corresponding tadpole is real or imaginary (only in models with CP "@fillDecaySettings@" -> IndentText@IndentText@fillDecaySettings, "@flexibleDecaySettingsVarInDef@" -> flexibleDecaySettingsVarInDef, "@flexibleDecaySettingsVarInDecl@" -> flexibleDecaySettingsVarInDecl, - "@calculateDecaysForModel@" -> IndentText[calculateDecaysForModel], + "@calculateDecaysForModel@" -> calculateDecaysForModel, "@setDecaysSLHAOutput@" -> IndentText[IndentText[setDecaysSLHAOutput]], "@calculateCmdLineDecays@" -> IndentText[calculateCmdLineDecays], "@writeCmdLineOutput@" -> IndentText[writeCmdLineOutput], "@fillSLHAIO@" -> fillSLHAIO, "@decaySetttingsOverride@" -> IndentText[decaySetttingsOverride], + "@calculateUnitarity@" -> If[FSUnitarityConstraints, + "const auto unitarityStruct = " <> FSModelName <> "_unitarity::max_scattering_eigenvalue_infinite_s(std::get<0>(models));\n" <> + "slha_io.set_unitarity_infinite_s(spectrum_generator_settings, unitarityStruct);", + "" + ], Sequence @@ GeneralReplacementRules[] } ]; ]; @@ -2705,7 +2962,8 @@ corresponding tadpole is real or imaginary (only in models with CP body = "spectrum.reset(new " <> FlexibleSUSY`FSModelName <> "_spectrum_impl<" <> class <> ">());\n" <> "spectrum->calculate_spectrum(settings, modsel, qedqcd, input);\n" - <> "if (!spectrum->get_problems().have_problem() || solver_type != 0) break;\n"; + <> "if (!spectrum->get_problems().have_problem() || solver_type != 0) break;\n" + <> "[[fallthrough]];\n"; result = "case " <> key <> ":\n" <> IndentText[body]; EnableForBVPSolver[solver, IndentText[result]] <> "\n" ]; @@ -2719,11 +2977,14 @@ corresponding tadpole is real or imaginary (only in models with CP numberOfObservables, putObservables, inputPars, outPars, requestedObservables, defaultSolverType, solverIncludes = "", runEnabledSolvers = "", - decaysData = "", calculateDecaysVirtualFunc = "", calculateSpectrumDecaysPrototype = "", - calculateSpectrumDecaysFunction = "", calculateModelDecaysPrototype = "", + decaysData = "", calculateDecaysVirtualFunc = "", calculateDecaysEffCVirtualFunc = "", calculateSpectrumDecaysPrototype = "", calculateSpectrumDecaysEffCPrototype = "", + calculateSpectrumDecaysFunction = "", calculateModelDecaysPrototype = "", calculateModelDecaysEffCFunction = "", + calculateSpectrumDecaysEffCFunction = "", calculateModelDecaysEffCPrototype = "", calculateModelDecaysFunction = "", fillDecaysSLHA = "", getDecaysVirtualFunc = "", - getSpectrumDecays = "", putDecaysPrototype = "", putDecaysFunction = "", + getSpectrumDecays = "", putDecaysPrototype = "", putDecaysFunction = "", putEffCPrototype = "", putEffCFunction = "", callLilithMessages = "", mathlinkDecaysCalculationFunction = "", loadCalculateDecaysFunction = "", + mathlinkCalcNormalizedEffC = "", loadCalculateEffCFunction = "", loadCallHiggsToolsFunction = "", loadCallLilithFunction = "", + setUnitarity = "", loadCalculateUnitarityFunction = "", calculateUnitarityMessages = "", calculateDecaysMessages = "", calculateDecaysExample = "", decaysIncludes = "", fdDefaultSettings = "", addFDOptions1 = "", addFDOptions2 = "", setFDOptions = "", setDecayOptions = "", fillFDSettings = "", decayIndex = "const Index_t n_fd_settings = 0;"}, @@ -2749,31 +3010,62 @@ corresponding tadpole is real or imaginary (only in models with CP defaultSolverType = "-1", defaultSolverType = GetBVPSolverSLHAOptionKey[FlexibleSUSY`FSBVPSolvers[[1]]]; ]; + If[FSUnitarityConstraints, + loadCalculateUnitarityFunction = "FS" <> FlexibleSUSY`FSModelName <> "CalculateUnitarity = LibraryFunctionLoad[lib" <> + FlexibleSUSY`FSModelName <> ", \"FS" <> FlexibleSUSY`FSModelName <> + "CalculateUnitarity\", LinkObject, LinkObject];\n"; + calculateUnitarityMessages = "\n" <> "FS" <> FlexibleSUSY`FSModelName <> "CalculateUnitarity::error = \"`1`\";\n" <> + "FS" <> FlexibleSUSY`FSModelName <> "CalculateUnitarity::warning = \"`1`\";\n"; + setUnitarity = "slha_io.set_unitarity_infinite_s(settings, unitarityData);"; + ]; If[FlexibleSUSY`FSCalculateDecays, decaysData = FlexibleSUSY`FSModelName <> "_decays decays{}; ///< decays"; getDecaysVirtualFunc = FSMathLink`CreateSpectrumDecaysGetterInterface[FlexibleSUSY`FSModelName]; getSpectrumDecays = CreateSpectrumDecaysGetter[FlexibleSUSY`FSModelName]; calculateDecaysVirtualFunc = FSMathLink`CreateSpectrumDecaysInterface[FlexibleSUSY`FSModelName]; + calculateDecaysEffCVirtualFunc = FSMathLink`CreateSpectrumDecaysEffCInterface[FlexibleSUSY`FSModelName]; {calculateSpectrumDecaysPrototype, calculateSpectrumDecaysFunction} = FSMathLink`CreateSpectrumDecaysCalculation[FlexibleSUSY`FSModelName]; + {calculateSpectrumDecaysEffCPrototype, calculateSpectrumDecaysEffCFunction} = + FSMathLink`CreateSpectrumDecaysEffCCalculation[FlexibleSUSY`FSModelName]; {calculateModelDecaysPrototype, calculateModelDecaysFunction} = FSMathLink`CreateModelDecaysCalculation[FlexibleSUSY`FSModelName]; + {calculateModelDecaysEffCPrototype, calculateModelDecaysEffCFunction} = + FSMathLink`CreateModelDecaysEffCCalculation[FlexibleSUSY`FSModelName]; fillDecaysSLHA = FSMathLink`FillDecaysSLHAData[]; {putDecaysPrototype, putDecaysFunction} = FSMathLink`PutDecays[FlexibleSUSY`FSModelName]; + {putEffCPrototype, putEffCFunction} = FSMathLink`PutEffCouplings[FlexibleSUSY`FSModelName]; mathlinkDecaysCalculationFunction = FSMathLink`CreateMathLinkDecaysCalculation[FlexibleSUSY`FSModelName]; loadCalculateDecaysFunction = "FS" <> FlexibleSUSY`FSModelName <> "CalculateDecays = LibraryFunctionLoad[lib" <> FlexibleSUSY`FSModelName <> ", \"FS" <> FlexibleSUSY`FSModelName <> "CalculateDecays\", LinkObject, LinkObject];\n"; + loadCalculateEffCFunction = "FS" <> FlexibleSUSY`FSModelName <> "CalculateNormalizedEffectiveCouplings = LibraryFunctionLoad[lib" <> + FlexibleSUSY`FSModelName <> ", \"FS" <> FlexibleSUSY`FSModelName <> + "CalculateNormalizedEffectiveCouplings\", LinkObject, LinkObject];"; + loadCallHiggsToolsFunction = "FS" <> FlexibleSUSY`FSModelName <> "CallHiggsTools = LibraryFunctionLoad[lib" <> + FlexibleSUSY`FSModelName <> ", \"FS" <> FlexibleSUSY`FSModelName <> + "CallHiggsTools\", LinkObject, LinkObject];"; + loadCallLilithFunction = "FS" <> FlexibleSUSY`FSModelName <> "CallLilith = LibraryFunctionLoad[lib" <> + FlexibleSUSY`FSModelName <> ", \"FS" <> FlexibleSUSY`FSModelName <> + "CallLilith\", LinkObject, LinkObject];"; calculateDecaysMessages = "\n" <> "FS" <> FlexibleSUSY`FSModelName <> "CalculateDecays::error = \"`1`\";\n" <> "FS" <> FlexibleSUSY`FSModelName <> "CalculateDecays::warning = \"`1`\";\n"; + callLilithMessages = "\n" <> "FS" <> FlexibleSUSY`FSModelName <> "CallLilith::error = \"`1`\";\n" <> + "FS" <> FlexibleSUSY`FSModelName <> "CallLilith::warning = \"`1`\";\n"; calculateDecaysExample = "decays = FS" <> FlexibleSUSY`FSModelName <> "CalculateDecays[handle];\n"; decaysIncludes = "#include \"loop_libraries/loop_library.hpp\""; + mathlinkCalcNormalizedEffC = FSMathLink`CalculateNormalizedEffectiveCouplings[FlexibleSUSY`FSModelName]; fdDefaultSettings = "\nfdDefaultSettings = { minBRtoPrint -> 1*^-5, - maxHigherOrderCorrections -> 4, + maxHigherOrderCorrections -> 41, alphaThomson -> 1, - offShellVV -> 2 + offShellVV -> 2, + printEffCBlock -> 1, + calcNormalizedEffC -> 0, + callHiggsTools -> 0, + callLilith -> 0, + usePoleHiggsMixings -> 1 };\n"; addFDOptions1 = ", Sequence @@ fdDefaultSettings"; addFDOptions2 = "| fdSettings"; @@ -2782,15 +3074,25 @@ corresponding tadpole is real or imaginary (only in models with CP OptionValue[minBRtoPrint], OptionValue[maxHigherOrderCorrections], OptionValue[alphaThomson], -OptionValue[offShellVV]"; +OptionValue[offShellVV], +OptionValue[printEffCBlock], +OptionValue[calcNormalizedEffC], +OptionValue[callHiggsTools], +OptionValue[callLilith], +OptionValue[usePoleHiggsMixings]"; setDecayOptions = "FlexibleDecay_settings flexibledecay_settings; flexibledecay_settings.set(FlexibleDecay_settings::min_br_to_print, pars[c++]); -flexibledecay_settings.set(FlexibleDecay_settings::include_higher_order_corrections , pars[c++]); -flexibledecay_settings.set(FlexibleDecay_settings::use_Thomson_alpha_in_Phigamgam_and_PhigamZ , pars[c++]); -flexibledecay_settings.set(FlexibleDecay_settings::offshell_VV_decays , pars[c++]); +flexibledecay_settings.set(FlexibleDecay_settings::include_higher_order_corrections, pars[c++]); +flexibledecay_settings.set(FlexibleDecay_settings::use_Thomson_alpha_in_Phigamgam_and_PhigamZ, pars[c++]); +flexibledecay_settings.set(FlexibleDecay_settings::offshell_VV_decays, pars[c++]); +flexibledecay_settings.set(FlexibleDecay_settings::print_effc_block, pars[c++]); +flexibledecay_settings.set(FlexibleDecay_settings::calculate_normalized_effc, pars[c++]); +flexibledecay_settings.set(FlexibleDecay_settings::call_higgstools, pars[c++]); +flexibledecay_settings.set(FlexibleDecay_settings::call_lilith, pars[c++]); +flexibledecay_settings.set(FlexibleDecay_settings::use_pole_higgs_mixings, pars[c++]); "; -decayIndex = "const Index_t n_fd_settings = 4;"; +decayIndex = "const Index_t n_fd_settings = 9;"; fillFDSettings = "data.set_fd_settings(flexibledecay_settings);\n" ]; WriteOut`ReplaceInFiles[files, @@ -2809,18 +3111,29 @@ corresponding tadpole is real or imaginary (only in models with CP "@runEnabledSolvers@" -> runEnabledSolvers, "@defaultSolverType@" -> defaultSolverType, "@calculateDecaysVirtualFunc@" -> IndentText[calculateDecaysVirtualFunc], + "@calculateDecaysEffCVirtualFunc@" -> IndentText[calculateDecaysEffCVirtualFunc], "@calculateSpectrumDecaysPrototype@" -> IndentText[calculateSpectrumDecaysPrototype], + "@calculateSpectrumDecaysEffCPrototype@" -> IndentText[calculateSpectrumDecaysEffCPrototype], "@calculateSpectrumDecaysFunction@" -> calculateSpectrumDecaysFunction, + "@calculateSpectrumDecaysEffCFunction@" -> calculateSpectrumDecaysEffCFunction, "@calculateModelDecaysPrototype@" -> IndentText[calculateModelDecaysPrototype], "@calculateModelDecaysFunction@" -> calculateModelDecaysFunction, + "@calculateModelDecaysEffCPrototype@" -> IndentText[calculateModelDecaysEffCPrototype], + "@calculateModelDecaysEffCFunction@" -> calculateModelDecaysEffCFunction, "@decaysData@" -> IndentText[decaysData], "@fillDecaysSLHA@" -> IndentText[fillDecaysSLHA], "@getDecaysVirtualFunc@" -> IndentText[getDecaysVirtualFunc], "@getSpectrumDecays@" -> IndentText[getSpectrumDecays], "@putDecaysPrototype@" -> IndentText[putDecaysPrototype], "@putDecaysFunction@" -> putDecaysFunction, + "@putEffCPrototype@" -> IndentText[putEffCPrototype], + "@putEffCFunction@" -> putEffCFunction, "@mathlinkDecaysCalculationFunction@" -> mathlinkDecaysCalculationFunction, "@loadCalculateDecaysFunction@" -> loadCalculateDecaysFunction, + "@loadCalculateEffCFunction@" -> loadCalculateEffCFunction, + "@loadCallHiggsToolsFunction@" -> loadCallHiggsToolsFunction, + "@callLilithMessages@" -> callLilithMessages, + "@loadCallLilithFunction@" -> loadCallLilithFunction, "@calculateDecaysMessages@" -> calculateDecaysMessages, "@calculateDecaysExample@" -> calculateDecaysExample, "@decaysIncludes@" -> decaysIncludes, @@ -2831,6 +3144,10 @@ corresponding tadpole is real or imaginary (only in models with CP "@setDecayOptions@" -> IndentText @ setDecayOptions, "@fillFDSettings@" -> fillFDSettings, "@decayIndex@" -> decayIndex, + "@mathlinkCalcNormalizedEffC@" -> mathlinkCalcNormalizedEffC, + "@loadCalculateUnitarityFunction@" -> loadCalculateUnitarityFunction, + "@calculateUnitarityMessages@" -> calculateUnitarityMessages, + "@setUnitarity@" -> setUnitarity, Sequence @@ GeneralReplacementRules[] } ]; ]; @@ -2863,18 +3180,20 @@ corresponding tadpole is real or imaginary (only in models with CP WriteBVPSolverMakefile[files_List] := Module[{twoScaleSource = "", twoScaleHeader = ""}, If[FlexibleSUSY`FlexibleEFTHiggs === True, - twoScaleSource = "\t\t" <> FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_two_scale_matching.cpp"}]; - twoScaleHeader = "\t\t" <> FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_two_scale_matching.hpp"}]; + twoScaleSource = "\t\t" <> FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_two_scale_matching_interface.cpp"}]; + twoScaleHeader = "\t\t" <> FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_two_scale_matching_interface.hpp"}]; ]; WriteOut`ReplaceInFiles[files, { "@FlexibleEFTHiggsTwoScaleSource@" -> twoScaleSource, "@FlexibleEFTHiggsTwoScaleHeader@" -> twoScaleHeader, + "@FlexibleEFTHiggsShootingSource@" -> "", + "@FlexibleEFTHiggsShootingHeader@" -> "", Sequence @@ GeneralReplacementRules[] } ]; ]; WriteUtilitiesClass[massMatrices_List, betaFun_List, inputParameters_List, extraParameters_List, - lesHouchesParameters_List, extraSLHAOutputBlocks_List, + lesHouchesParameters_List, extraSLHAOutputBlocks_List, decaysSLHAIncludeFiles_List, files_List] := Module[{k, particles, susyParticles, smParticles, minpar, extpar, imminpar, imextpar, extraSLHAInputParameters, @@ -2889,7 +3208,7 @@ corresponding tadpole is real or imaginary (only in models with CP isLowEnergyModel = "false", isSupersymmetricModel = "false", isFlexibleEFTHiggs = "false", - getPDGCodeFromParticleEnumNoIndex = "", getPDGCodeFromParticleEnumIndex = "", + getPDGCodeFromParticleEnumNoIndex = "", getPDGCodeFromParticleEnumIndex = "", setParticleMultipletNameAndIndexFromPDG = "", fillInputParametersFromMINPAR = "", fillInputParametersFromEXTPAR = "", fillInputParametersFromIMMINPAR = "", @@ -2906,7 +3225,8 @@ corresponding tadpole is real or imaginary (only in models with CP numberOfDRbarBlocks, drBarBlockNames, setDecaysPrototypes = "", setDecaysFunctions = "", fillDecaysDataPrototypes = "", fillDecaysDataFunctions = "", - decaysHeaderIncludes = "", useDecaysData = "" + decaysHeaderIncludes = "", useDecaysData = "", + unitarityIncludes = "" }, particles = DeleteDuplicates @ Flatten[TreeMasses`GetMassEigenstate /@ massMatrices]; susyParticles = Select[particles, (!TreeMasses`IsSMParticle[#])&]; @@ -2963,6 +3283,9 @@ corresponding tadpole is real or imaginary (only in models with CP drBarBlockNames = WriteOut`GetDRbarBlockNames[lesHouchesParameters]; gaugeCouplingNormalizationDecls = WriteOut`GetGaugeCouplingNormalizationsDecls[SARAH`Gauge]; gaugeCouplingNormalizationDefs = WriteOut`GetGaugeCouplingNormalizationsDefs[SARAH`Gauge]; + If[FSUnitarityConstraints, + unitarityIncludes = "#include \"" <> FlexibleSUSY`FSModelName <> "_unitarity.hpp\"" + ]; If[FlexibleSUSY`FSCalculateDecays, setDecaysPrototypes = WriteOut`CreateSetDecaysPrototypes[FlexibleSUSY`FSModelName]; setDecaysFunctions = WriteOut`CreateSetDecaysFunctions[FlexibleSUSY`FSModelName]; @@ -3024,6 +3347,9 @@ corresponding tadpole is real or imaginary (only in models with CP "@setParticleMultipletNameAndIndexFromPDG@" -> IndentText[setParticleMultipletNameAndIndexFromPDG], "@isCPViolatingHiggsSector@" -> CreateCBoolValue @ SA`CPViolationHiggsSector, "@useDecaysData@" -> useDecaysData, + "@numberOfNeutralGoldstones@" -> IndentText["static constexpr int number_of_neutral_goldstones = " <> ToString[TreeMasses`GetDimensionStartSkippingGoldstones[TreeMasses`GetPseudoscalarHiggsBoson[]]-1] <> ";"], + "@numberOfChargedGoldstones@" -> IndentText["static constexpr int number_of_charged_goldstones = " <> ToString[TreeMasses`GetDimensionStartSkippingGoldstones[TreeMasses`GetChargedHiggsBoson[]]-1] <> ";"], + "@unitarityIncludes@" -> unitarityIncludes, Sequence @@ GeneralReplacementRules[] } ]; ]; @@ -3036,6 +3362,71 @@ corresponding tadpole is real or imaginary (only in models with CP } ]; ]; +WriteSMParticlesAliases[files_List] := Module[{}, + SimplifiedName[particle_ /; TreeMasses`IsSMChargedLepton[particle] && Head[particle] =!= SARAH`bar && Length@TreeMasses`GetSMChargedLeptons[] === 1] := "ChargedLepton"; + SimplifiedName[particle_ /; TreeMasses`GetSMElectronLeptonMultiplet[] === particle && Head[particle] =!= SARAH`bar && Length@TreeMasses`GetSMChargedLeptons[] > 1] := "Electron"; + SimplifiedName[particle_ /; TreeMasses`GetSMMuonLeptonMultiplet[] === particle && Head[particle] =!= SARAH`bar && Length@TreeMasses`GetSMChargedLeptons[] > 1] := "Muon"; + SimplifiedName[particle_ /; TreeMasses`GetSMTauLeptonMultiplet[] === particle && Head[particle] =!= SARAH`bar && Length@TreeMasses`GetSMChargedLeptons[] > 1] := "Tauon"; + SimplifiedName[particle_ /; TreeMasses`IsSMNeutralLepton[particle] && Head[particle] =!= SARAH`bar && Length@TreeMasses`GetSMNeutralLeptons[] === 1] := "Neutrino"; + SimplifiedName[particle_ /; particle === TreeMasses`GetSMNeutrino1[] && Head[particle] =!= SARAH`bar && Length@TreeMasses`GetSMNeutralLeptons[] > 1] := "ElectronNeutrino"; + SimplifiedName[particle_ /; particle === TreeMasses`GetSMNeutrino2[] && Head[particle] =!= SARAH`bar && Length@TreeMasses`GetSMNeutralLeptons[] > 1] := "MuonNeutrino"; + SimplifiedName[particle_ /; particle === TreeMasses`GetSMNeutrino3[] && Head[particle] =!= SARAH`bar && Length@TreeMasses`GetSMNeutralLeptons[] > 1] := "TauNeutrino"; + SimplifiedName[particle_ /; TreeMasses`IsSMDownQuark[particle] && Head[particle] =!= SARAH`bar && Length@TreeMasses`GetSMDownQuarks[] === 1] := "DownTypeQuark"; + SimplifiedName[particle_ /; TreeMasses`IsSMDownQuark[particle] && Head[particle] === SARAH`bar] := "AntiDownQuark"; + SimplifiedName[particle_ /; TreeMasses`IsSMUpQuark[particle] && Head[particle] =!= SARAH`bar && Length@TreeMasses`GetSMUpQuarks[] === 1] := "UpTypeQuark"; + SimplifiedName[particle_ /; TreeMasses`IsSMUpQuark[particle] && Head[particle] === SARAH`bar] := "AntiUpQuark"; + SimplifiedName[particle_ /; TreeMasses`GetHiggsBoson[] =!= Null && particle === TreeMasses`GetHiggsBoson[]] := "Higgs"; + SimplifiedName[particle_ /; TreeMasses`GetPseudoscalarHiggsBoson[] =!= Null && particle === TreeMasses`GetPseudoscalarHiggsBoson[]] := "PseudoscalarHiggs"; + SimplifiedName[particle_ /; TreeMasses`GetWBoson[] =!= Null && particle === If[GetElectricCharge[TreeMasses`GetWBoson[]] < 0, TreeMasses`GetWBoson[], Susyno`LieGroups`conj[TreeMasses`GetWBoson[]]]] := "WmBoson"; + SimplifiedName[particle_ /; TreeMasses`GetWBoson[] =!= Null && particle === If[GetElectricCharge[TreeMasses`GetWBoson[]] < 0, Susyno`LieGroups`conj[TreeMasses`GetWBoson[]], TreeMasses`GetWBoson[]]] := "WpBoson"; + SimplifiedName[particle_ /; TreeMasses`GetZBoson[] =!= Null && particle === TreeMasses`GetZBoson[]] := "ZBoson"; + SimplifiedName[particle_ /; TreeMasses`GetPhoton[] =!= Null && particle === TreeMasses`GetPhoton[]] := "Photon"; + SimplifiedName[particle_ /; TreeMasses`GetGluon[] =!= Null && particle === TreeMasses`GetGluon[]] := "Gluon"; + SimplifiedName[particle_ /; TreeMasses`GetChargedHiggsBoson[] =!= Null && particle === If[GetElectricCharge[TreeMasses`GetChargedHiggsBoson[]] < 0, TreeMasses`GetChargedHiggsBoson[], Susyno`LieGroups`conj[TreeMasses`GetChargedHiggsBoson[]]]] := "Hm"; + SimplifiedName[particle_ /; TreeMasses`GetChargedHiggsBoson[] =!= Null && particle === If[GetElectricCharge[TreeMasses`GetChargedHiggsBoson[]] < 0, Susyno`LieGroups`conj[TreeMasses`GetChargedHiggsBoson[]], TreeMasses`GetChargedHiggsBoson[]]] := "Hp"; + SimplifiedName[particle_] := particle; + + CreateParticleAlias[particle_, namespace_String] := + "using " <> SimplifiedName[particle] <> " = " <> + CXXDiagrams`CXXNameOfField[particle] <> ";"; + + CreateParticleAliases[particles_, namespace_:""] := + Utils`StringJoinWithSeparator[CreateParticleAlias[#, namespace]& /@ particles, "\n"]; + + CreateSMParticleAliases[namespace_:""] := + Module[{smParticlesToAlias}, + smParticlesToAlias = Select[Flatten[{ + (* neutral Higgs bosons *) + TreeMasses`GetHiggsBoson[], + If[GetDimensionWithoutGoldstones[TreeMasses`GetPseudoscalarHiggsBoson[]] > 0, TreeMasses`GetPseudoscalarHiggsBoson[]], + (* charged Higgs bosons *) + If[GetDimensionWithoutGoldstones[TreeMasses`GetChargedHiggsBoson[]] > 0, + {TreeMasses`GetChargedHiggsBoson[], Susyno`LieGroups`conj[TreeMasses`GetChargedHiggsBoson[]]} + ], + (* W bosons *) + TreeMasses`GetWBoson[], Susyno`LieGroups`conj[TreeMasses`GetWBoson[]], + (* neutral gauge bosons *) + TreeMasses`GetPhoton[], TreeMasses`GetZBoson[], TreeMasses`GetGluon[], + (* leptons *) + TreeMasses`GetSMChargedLeptons[], TreeMasses`GetSMNeutralLeptons[], + If[Length@TreeMasses`GetSMUpQuarks[] === 1, + TreeMasses`GetSMUpQuarks[] + ], + If[Length@TreeMasses`GetSMDownQuarks[] === 1, + TreeMasses`GetSMDownQuarks[] + ] + }, 1], (# =!= Null)&]; + CreateParticleAliases[smParticlesToAlias, namespace] + ]; + + WriteOut`ReplaceInFiles[files, + { + "@ModelName@" -> FlexibleSUSY`FSModelName, + "@SMParticlesAliases@" -> CreateSMParticleAliases[FlexibleSUSY`FSModelName <> "_cxx_diagrams::fields"] + } + ]; + ]; + FilesExist[fileNames_List] := And @@ (FileExistsQ /@ fileNames); @@ -3104,15 +3495,10 @@ corresponding tadpole is real or imaginary (only in models with CP FileNameJoin[{outputDir, ToString[eigenstates], "Vertices", "FSVertexRules.m"}]; -GetEffectiveCouplingsFileName[outputDir_String, eigenstates_] := - FileNameJoin[{outputDir, ToString[eigenstates], "Vertices", - "FSEffectiveCouplings.m"}]; - NeedToCalculateVertices[eigenstates_] := NeedToUpdateTarget[ "vertex", - { GetVertexRuleFileName[$sarahCurrentOutputMainDir, eigenstates], - GetEffectiveCouplingsFileName[$sarahCurrentOutputMainDir, eigenstates] }]; + { GetVertexRuleFileName[$sarahCurrentOutputMainDir, eigenstates] }]; NeedToUpdateTarget[name_String, targets_List] := Module[{ targetsExist = FilesExist[targets], @@ -3185,7 +3571,8 @@ corresponding tadpole is real or imaginary (only in models with CP ]; FSCheckLoopCorrections[eigenstates_] := - Module[{needToCalculateLoopCorrections}, + Module[{needToCalculateLoopCorrections, selfEnergies, + fileName = GetSelfEnergyFileNames[$sarahCurrentOutputMainDir, eigenstates]}, needToCalculateLoopCorrections = Or[ NeedToCalculateSelfEnergies[eigenstates], NeedToCalculateTadpoles[eigenstates], @@ -3193,6 +3580,11 @@ corresponding tadpole is real or imaginary (only in models with CP ]; If[needToCalculateLoopCorrections, SARAH`CalcLoopCorrections[eigenstates]; + selfEnergies = Get[fileName]; + selfEnergies = {{#1, #1}, #2}& @@@ selfEnergies; + Get["createVPVZ.m"]; + AppendTo[selfEnergies, {{TreeMasses`GetPhoton[], TreeMasses`GetZBoson[]}, Global`GetVPVZSelfEnergy /. C->Cp}]; + Put[selfEnergies, fileName]; ]; ]; @@ -3205,6 +3597,13 @@ corresponding tadpole is real or imaginary (only in models with CP FlexibleSUSY`UseMSSM3LoopRGEs = True; ]; + If[FlexibleSUSY`UseHiggs3LoopNMSSM === True, + FlexibleSUSY`UseHiggs2LoopNMSSM === True; + FlexibleSUSY`UseMSSMYukawa2Loop = True; + FlexibleSUSY`UseMSSMAlphaS2Loop = True; + FlexibleSUSY`UseMSSM3LoopRGEs = True; + ]; + If[FlexibleSUSY`UseHiggs3LoopSM === True, FlexibleSUSY`UseHiggs2LoopSM = True; FlexibleSUSY`UseSMAlphaS3Loop = True; @@ -3238,6 +3637,11 @@ corresponding tadpole is real or imaginary (only in models with CP References`AddReference["Athron:2016fuq"]; ]; + If[FlexibleSUSY`FSCalculateDecays, + References`AddReference["Athron:2021kve"]; + References`AddReference["Sjodahl:2012nk"]; + ]; + If[FlexibleSUSY`UseYukawa3LoopQCD || FlexibleSUSY`FlexibleEFTHiggs, Print["Adding 3-loop SM QCD corrections to yt from ", "[arxiv:hep-ph/9911434, arxiv:hep-ph/9912391]"]; @@ -3330,7 +3734,7 @@ corresponding tadpole is real or imaginary (only in models with CP References`AddReference["Benakli:2013msa"]; ]; - If[FlexibleSUSY`UseHiggs3LoopMSSM, + If[FlexibleSUSY`UseHiggs3LoopMSSM || FlexibleSUSY`UseHiggs3LoopNMSSM, Print["Adding 3-loop MSSM Higgs mass contributions from ", "[arxiv:hep-ph/0803.0672, arxiv:hep-ph/1005.5709,", " arxiv:1409.2297, arxiv:1708.05720]"]; @@ -3414,7 +3818,7 @@ corresponding tadpole is real or imaginary (only in models with CP ]; Print["Reading unrotated particles from file ", nonMixedParticlesFile, " ..."]; nonMixedParticles = Get[nonMixedParticlesFile]; - DebugPrint["unrotated particles: ", nonMixedParticles]; + FSDebugPrint["FlexibleSUSY", "unrotated particles: ", nonMixedParticles]; TreeMasses`SetUnrotatedParticles[nonMixedParticles]; ]; @@ -3510,15 +3914,19 @@ corresponding tadpole is real or imaginary (only in models with CP If[solution === {}, (* Fixed-point iteration can only be used if an analytic EWSB solution exists *) If[MemberQ[validSolvers, FlexibleSUSY`FPIRelative], - Print["Warning: FPIRelative was selected, but no analytic"]; - Print[" solution to the EWSB eqs. is provided."]; - Print[" FPIRelative will be removed from the list of EWSB solvers."]; + Utils`FSFancyWarning[ + "FPIRelative was selected, but no analytic solution", + " to the EWSB eqs. is provided. FPIRelative will be", + " removed from the list of EWSB solvers." + ]; validSolvers = Cases[validSolvers, Except[FlexibleSUSY`FPIRelative]]; ]; If[MemberQ[validSolvers, FlexibleSUSY`FPIAbsolute], - Print["Warning: FPIAbsolute was selected, but no analytic"]; - Print[" solution to the EWSB eqs. is provided."]; - Print[" FPIAbsolute will be removed from the list of EWSB solvers."]; + Utils`FSFancyWarning[ + "FPIAbsolute was selected, but no analytic solution", + " to the EWSB eqs. is provided. FPIAbsolute will be", + " removed from the list of EWSB solvers." + ]; validSolvers = Cases[validSolvers, Except[FlexibleSUSY`FPIAbsolute]]; ]; ]; @@ -3939,7 +4347,7 @@ corresponding tadpole is real or imaginary (only in models with CP susyBreakingBetaFunctions = DeleteBuggyBetaFunctions @ (Join @@ susyBreakingBetaFunctions); {susyBetaFunctions, susyBreakingBetaFunctions} - ] + ]; (* disable tensor couplings *) FSDisableTensorCouplings[parameters_] := @@ -3962,7 +4370,7 @@ corresponding tadpole is real or imaginary (only in models with CP (* store all model parameters *) allParameters = StripSARAHIndices[((#[[1]])& /@ Join[susyBetaFunctions, susyBreakingBetaFunctions])]; Parameters`SetModelParameters[allParameters]; - DebugPrint["Model parameters: ", allParameters]; + FSDebugPrint["FlexibleSUSY", "Model parameters: ", allParameters]; (* collect all phases from SARAH *) phases = DeleteDuplicates @ Join[ @@ -3973,7 +4381,7 @@ corresponding tadpole is real or imaginary (only in models with CP FSDisableTensorCouplings[allParameters]; allParameters - ] + ]; ConvertBetaFunctions[susyBetaFunctionsSARAH_, susyBreakingBetaFunctionsSARAH_] := Module[{susyBetaFunctions, susyBreakingBetaFunctions, @@ -4014,7 +4422,7 @@ corresponding tadpole is real or imaginary (only in models with CP allIntermediateOutputParameters = Parameters`GetIntermediateOutputParameterDependencies[ TreeMasses`GetMassMatrix /@ massMatrices]; - DebugPrint["intermediate output parameters = ", allIntermediateOutputParameters]; + FSDebugPrint["FlexibleSUSY", "intermediate output parameters = ", allIntermediateOutputParameters]; (* decrease index literals of intermediate output parameters in mass matrices *) allIntermediateOutputParameterIndexReplacementRules = @@ -4023,7 +4431,7 @@ corresponding tadpole is real or imaginary (only in models with CP massMatrices = massMatrices /. allIntermediateOutputParameterIndexReplacementRules; {massMatrices, Lat$massMatrices} - ] + ]; SetupOutputParameters[massMatrices_] := Module[{allParticles, allOutputParameters}, @@ -4033,9 +4441,41 @@ corresponding tadpole is real or imaginary (only in models with CP Flatten[TreeMasses`GetMixingMatrixSymbol[#]& /@ massMatrices]]], Null]; Parameters`SetOutputParameters[allOutputParameters]; - DebugPrint["output parameters = ", allOutputParameters]; - ] + FSDebugPrint["FlexibleSUSY", "output parameters = ", allOutputParameters]; + ]; +CheckObsDependencies[requested_List] := +Module[{allObs, dir, filtered = requested}, + Needs@"NPointFunctions`"; + If[FlexibleSUSY`FSFeynArtsAvailable && FlexibleSUSY`FSFormCalcAvailable, + Needs@"WilsonCoeffs`"; + Return[filtered]; + ]; + + allObs = Cases[ + requested, + x_/; Context@Evaluate@Head@x === "FlexibleSUSYObservable`" :> x, + Infinity, + Heads -> True + ]; + allObs = DeleteDuplicates[SymbolName@*Head/@allObs]; + + Do[ + dir = FileNameJoin@{$flexiblesusyMetaDir, "Observables", obs}; + If[DirectoryQ@dir, + If[TextSearch[dir, "NPointFunctions" | "WilsonCoeffs", "Count"] > 0, + Utils`FSFancyWarning[obs, + " is requested but FeynArts or FormCalc are disabled. ", + "Removing ", obs, " from calculated observables." + ]; + filtered = filtered /. Symbol["FlexibleSUSYObservable`"<>obs][___] :> Null; + ]; + ];, + {obs, allObs} + ]; + + filtered /. {_Integer, Null} :> Sequence[] /. {_Symbol, {}} :> Sequence[] +]; Options[MakeFlexibleSUSY] := { @@ -4045,10 +4485,11 @@ corresponding tadpole is real or imaginary (only in models with CP }; MakeFlexibleSUSY[OptionsPattern[]] := - Module[{nPointFunctions, runInputFile, initialGuesserInputFile, - edmVertices, edmFields, + Module[{nPointFunctions, initialGuesserInputFile, + aMMVertices, edmFields, ammFields, QToQGammaFields = {}, - LToLGammaFields = {}, LToLConversionFields = {}, FFMasslessVVertices = {}, conversionVertices = {}, + FFMasslessVVertices = {}, + ObservablesExtraOutput, observablesExtraVertices = {}, cxxQFTTemplateDir, cxxQFTOutputDir, cxxQFTFiles, cxxQFTVerticesTemplate, cxxQFTVerticesMakefileTemplates, susyBetaFunctions, susyBreakingBetaFunctions, @@ -4064,10 +4505,10 @@ corresponding tadpole is real or imaginary (only in models with CP treeLevelEwsbSolutionOutputFiles = {}, treeLevelEwsbEqsOutputFile, solverEwsbSolvers = {}, fixedParameters, lesHouchesInputParameters, - extraSLHAOutputBlocks, effectiveCouplings = {}, extraVertices = {}, + extraSLHAOutputBlocks, deltaVBwave, deltaVBvertex, deltaVBbox, - vertexRules, vertexRuleFileName, effectiveCouplingsFileName, - Lat$massMatrices, spectrumGeneratorFiles = {}, spectrumGeneratorInputFile, + vertexRules, vertexRuleFileName, + Lat$massMatrices, spectrumGeneratorInputFile, semiAnalyticBCs, semiAnalyticSolns, semiAnalyticHighScaleFiles, semiAnalyticSUSYScaleFiles, semiAnalyticLowScaleFiles, semiAnalyticSolnsOutputFile, semiAnalyticEWSBSubstitutions = {}, semiAnalyticInputScale = "", @@ -4075,9 +4516,9 @@ corresponding tadpole is real or imaginary (only in models with CP decaysSources = {}, decaysHeaders = {}, decaysSLHAIncludeFiles = {}}, Utils`PrintHeadline["Starting FlexibleSUSY"]; - FSDebugOutput["meta code directory: ", $flexiblesusyMetaDir]; - FSDebugOutput["config directory : ", $flexiblesusyConfigDir]; - FSDebugOutput["templates directory: ", $flexiblesusyTemplateDir]; + FSDebugPrint["FlexibleSUSY", "meta code directory: ", $flexiblesusyMetaDir]; + FSDebugPrint["FlexibleSUSY", "config directory : ", $flexiblesusyConfigDir]; + FSDebugPrint["FlexibleSUSY", "templates directory: ", $flexiblesusyTemplateDir]; (* check if SARAH`Start[] was called *) If[!ValueQ[Model`Name], @@ -4112,17 +4553,12 @@ corresponding tadpole is real or imaginary (only in models with CP Join[PrepareSelfEnergies[FSEigenstates], PrepareTadpoles[FSEigenstates]]; PrepareUnrotatedParticles[FSEigenstates]; - DebugPrint["particles (mass eigenstates): ", TreeMasses`GetParticles[]]; + FSDebugPrint["FlexibleSUSY", "particles (mass eigenstates): ", TreeMasses`GetParticles[]]; allParameters = SetupModelParameters[susyBetaFunctionsSARAH, susyBreakingBetaFunctionsSARAH]; Needs@"Observables`"; - - (* load additional packages if prerequisites are met *) - If[FSFeynArtsAvailable && FSFormCalcAvailable, - Needs@"NPointFunctions`"; - Needs@"WilsonCoeffs`"; - ]; + FlexibleSUSY`ExtraSLHAOutputBlocks = CheckObsDependencies[FlexibleSUSY`ExtraSLHAOutputBlocks]; Print["Converting SARAH beta functions ..."]; {susyBetaFunctions, susyBreakingBetaFunctions} = @@ -4158,8 +4594,10 @@ corresponding tadpole is real or imaginary (only in models with CP If[FlexibleSUSY`FSUnfixedParameters =!= {} && FlexibleSUSY`AutomaticInputAtMSUSY =!= True, - Print["Warning: the following parameters are not fixed by any constraint:"]; - Print[" ", FlexibleSUSY`FSUnfixedParameters]; + Utils`FSFancyWarning[ + "The following parameters are not fixed by any constraint: ", + FlexibleSUSY`FSUnfixedParameters + ]; ]; (* add the unfixed parameters to the susy scale constraint *) @@ -4211,8 +4649,8 @@ corresponding tadpole is real or imaginary (only in models with CP inputParameters = Parameters`GetInputParametersAndTypes[]; - DebugPrint["input parameters: ", Parameters`GetInputParameters[]]; - DebugPrint["auxiliary parameters: ", Parameters`GetExtraParameters[]]; + FSDebugPrint["FlexibleSUSY", "input parameters: ", Parameters`GetInputParameters[]]; + FSDebugPrint["FlexibleSUSY", "auxiliary parameters: ", Parameters`GetExtraParameters[]]; On[Assert]; @@ -4414,8 +4852,10 @@ corresponding tadpole is real or imaginary (only in models with CP FlexibleSUSY`FSDecayParticles = Select[FlexibleSUSY`FSDecayParticles, Decays`IsSupportedDecayParticle]; If[FlexibleSUSY`FSDecayParticles === {}, - Print["Warning: no supported particles to calculate decays for were found."]; - Print[" Generation of decays code will be skipped."]; + Utils`FSFancyWarning[ + "No supported particles to calculate decays for were found.", + " Generation of decays code will be skipped." + ]; FlexibleSUSY`FSCalculateDecays = False; , decaysSLHAIncludeFiles = {FlexibleSUSY`FSModelName <> "_decays.hpp"}; @@ -4424,22 +4864,14 @@ corresponding tadpole is real or imaginary (only in models with CP vertexRuleFileName = GetVertexRuleFileName[$sarahCurrentOutputMainDir, FSEigenstates]; - effectiveCouplingsFileName = - GetEffectiveCouplingsFileName[$sarahCurrentOutputMainDir, FSEigenstates]; If[NeedToCalculateVertices[FSEigenstates], - (* effectiveCouplings = {{coupling, {needed couplings}}, ...} *) - Put[effectiveCouplings = - SortCps @ EffectiveCouplings`InitializeEffectiveCouplings[], - effectiveCouplingsFileName]; - extraVertices = EffectiveCouplings`GetNeededVerticesList[effectiveCouplings]; Put[vertexRules = Vertices`VertexRules[Join[nPointFunctions, - extraVertices, deltaVBwave, - deltaVBvertex, deltaVBbox], Lat$massMatrices], - vertexRuleFileName], + deltaVBwave, deltaVBvertex, deltaVBbox], + Lat$massMatrices], + vertexRuleFileName], vertexRules = Get[vertexRuleFileName]; - effectiveCouplings = Get[effectiveCouplingsFileName]; - ]; + ]; (* apply user-defined rules *) vertexRules = vertexRules /. FlexibleSUSY`FSVertexRules; @@ -4502,16 +4934,6 @@ corresponding tadpole is real or imaginary (only in models with CP FileNameJoin[{FSOutputDir, "FlexibleEFTHiggs.mk"}]} }]; - If[FlexibleSUSY`FlexibleEFTHiggs === True, - Print["Creating matching class ..."]; - WriteMatchingClass[FlexibleSUSY`MatchingScaleInput, massMatrices, - {{FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_matching.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_matching.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_matching.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_matching.cpp"}]} - }]; - ]; - Print["Creating list of references to be cited ..."]; WriteReferences[ {{FileNameJoin[{$flexiblesusyTemplateDir, "references.tex.in"}], @@ -4646,11 +5068,16 @@ corresponding tadpole is real or imaginary (only in models with CP If[FlexibleSUSY`FlexibleEFTHiggs === True, Print["Creating two-scale matching class ..."]; - WriteSolverMatchingClass[{{FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_two_scale_matching.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_two_scale_matching.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_two_scale_matching.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_two_scale_matching.cpp"}]} - }]; + WriteMatchingClass[FlexibleSUSY`MatchingScaleInput, massMatrices, + {{FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_two_scale_matching.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_matching.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_two_scale_matching.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_matching.cpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_two_scale_matching_interface.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_two_scale_matching_interface.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_two_scale_matching_interface.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_two_scale_matching_interface.cpp"}]} + }]; ]; spectrumGeneratorInputFile = "two_scale_high_scale_spectrum_generator"; @@ -4831,6 +5258,116 @@ corresponding tadpole is real or imaginary (only in models with CP Parameters`RemoveExtraParameters[SemiAnalytic`CreateCoefficientParameters[semiAnalyticSolns]]; ]; (* If[HaveBVPSolver[FlexibleSUSY`SemiAnalyticSolver] *) + If[HaveBVPSolver[FlexibleSUSY`ShootingSolver], + Print["Creating FlexibleEFTHiggs.mk ..."]; + WriteFlexibleEFTHiggsMakefileModule[ + {{FileNameJoin[{$flexiblesusyTemplateDir, "FlexibleEFTHiggs.mk.in"}], + FileNameJoin[{FSOutputDir, "FlexibleEFTHiggs.mk"}]} + }]; + + Print["Creating makefile module for shooting solver ..."]; + WriteBVPSolverMakefile[{{FileNameJoin[{$flexiblesusyTemplateDir, "shooting.mk.in"}], + FileNameJoin[{FSOutputDir, "shooting.mk"}]}}]; + + Print["Creating class for shooting model ..."]; + WriteTwoScaleModelClass[{{FileNameJoin[{$flexiblesusyTemplateDir, "shooting_model.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_shooting_model.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "shooting_model.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_shooting_model.cpp"}]}}]; + + Print["Creating class for shooting EWSB solver ..."]; + WriteEWSBSolverClass[ewsbEquations, FlexibleSUSY`EWSBOutputParameters, FlexibleSUSY`EWSBInitialGuess, + FlexibleSUSY`ShootingSolver /. solverEwsbSubstitutions, + FlexibleSUSY`ShootingSolver /. solverEwsbSolutions, + FlexibleSUSY`ShootingSolver /. solverFreePhases, + FlexibleSUSY`ShootingSolver /. solverEwsbSolvers, + {{FileNameJoin[{$flexiblesusyTemplateDir, "shooting_ewsb_solver.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_shooting_ewsb_solver.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "shooting_ewsb_solver.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_shooting_ewsb_solver.cpp"}]}}]; + + Print["Creating class for high-scale constraint ..."]; + WriteConstraintClass[FlexibleSUSY`HighScale, + FlexibleSUSY`HighScaleInput, + FlexibleSUSY`HighScaleFirstGuess, + {FlexibleSUSY`HighScaleMinimum, FlexibleSUSY`HighScaleMaximum}, + {{FileNameJoin[{$flexiblesusyTemplateDir, "shooting_high_scale_constraint.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_shooting_high_scale_constraint.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "shooting_high_scale_constraint.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_shooting_high_scale_constraint.cpp"}]} + } + ]; + + Print["Creating class for susy-scale constraint ..."]; + WriteConstraintClass[FlexibleSUSY`SUSYScale, + FlexibleSUSY`SUSYScaleInput, + FlexibleSUSY`SUSYScaleFirstGuess, + {FlexibleSUSY`SUSYScaleMinimum, FlexibleSUSY`SUSYScaleMaximum}, + {{FileNameJoin[{$flexiblesusyTemplateDir, "shooting_susy_scale_constraint.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_shooting_susy_scale_constraint.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "shooting_susy_scale_constraint.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_shooting_susy_scale_constraint.cpp"}]} + } + ]; + + Print["Creating class for low-scale constraint ..."]; + WriteConstraintClass[FlexibleSUSY`LowScale, + FlexibleSUSY`LowScaleInput, + FlexibleSUSY`LowScaleFirstGuess, + {FlexibleSUSY`LowScaleMinimum, FlexibleSUSY`LowScaleMaximum}, + {{FileNameJoin[{$flexiblesusyTemplateDir, "shooting_low_scale_constraint.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_shooting_low_scale_constraint.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "shooting_low_scale_constraint.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_shooting_low_scale_constraint.cpp"}]} + } + ]; + + initialGuesserInputFile = "shooting_initial_guesser"; + If[FlexibleSUSY`FlexibleEFTHiggs === True, + initialGuesserInputFile = "standard_model_" <> initialGuesserInputFile; + ]; + + WriteInitialGuesserClass[FlexibleSUSY`InitialGuessAtLowScale, + FlexibleSUSY`InitialGuessAtSUSYScale, + FlexibleSUSY`InitialGuessAtHighScale, + {{FileNameJoin[{$flexiblesusyTemplateDir, initialGuesserInputFile <> ".hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_shooting_initial_guesser.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, initialGuesserInputFile <> ".cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_shooting_initial_guesser.cpp"}]} + } + ]; + + If[FlexibleSUSY`FlexibleEFTHiggs === True, + Print["Creating shooting matching class ..."]; + WriteMatchingClass[FlexibleSUSY`MatchingScaleInput, massMatrices, + {{FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_shooting_matching.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_matching.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "standard_model_shooting_matching.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_standard_model_matching.cpp"}]} + }]; + ]; + + spectrumGeneratorInputFile = + If[FlexibleSUSY`FlexibleEFTHiggs, + "standard_model_", + "" + ] <> + If[FlexibleSUSY`OnlyLowEnergyFlexibleSUSY, + "shooting_low_scale_spectrum_generator", + "shooting_high_scale_spectrum_generator"]; + + Print["Creating class for shooting spectrum generator ..."]; + WriteShootingSpectrumGeneratorClass[ + {{FileNameJoin[{$flexiblesusyTemplateDir, spectrumGeneratorInputFile <> ".hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_shooting_spectrum_generator.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, spectrumGeneratorInputFile <> ".cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_shooting_spectrum_generator.cpp"}]} + }]; + + ]; (* If[HaveBVPSolver[FlexibleSUSY`ShootingSolver] *) + + Utils`PrintHeadline["Creating observables"]; + (* @todo: should all FlexibleDecay tests be moved into FlexibleDecay.mk instead of just a variable that controlls wheter we call them or not? *) With[{f = FileNameJoin[{"test", "FlexibleDecay.mk"}]}, @@ -4865,8 +5402,6 @@ corresponding tadpole is real or imaginary (only in models with CP FileNameJoin[{FSOutputDir, "decays", FlexibleSUSY`FSModelName <> "_decays.hpp"}]}, {FileNameJoin[{$flexiblesusyTemplateDir, "decays", "decays.cpp.in"}], FileNameJoin[{FSOutputDir, "decays", FlexibleSUSY`FSModelName <> "_decays.cpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "decays", "decay_amplitudes.hpp.in"}], - FileNameJoin[{FSOutputDir, "decays", FlexibleSUSY`FSModelName <> "_decay_amplitudes.hpp"}]}, {FileNameJoin[{$flexiblesusyTemplateDir, "run_decays.cpp.in"}], FileNameJoin[{FSOutputDir, "run_decays_" <> FlexibleSUSY`FSModelName <> ".cpp"}]} @@ -4880,7 +5415,7 @@ corresponding tadpole is real or imaginary (only in models with CP ]; With[{f = FileNameJoin[{"test", "FlexibleDecay.mk"}]}, - If[FileExistsQ[f], DeleteFile[f]] + If[FileExistsQ[f], DeleteFile[f]]; WriteString[f, "ENABLE_FLEXIBLEDECAY := yes"] ]; , @@ -4889,25 +5424,7 @@ corresponding tadpole is real or imaginary (only in models with CP ]; (* If[FSCalculateDecays] *) - Utils`PrintHeadline["Creating other observables"]; - Print["Creating class for effective couplings ..."]; - (* @note separating this out for now for simplicity *) - (* @todo maybe implement a flag (like for addons) to turn on/off? *) - WriteEffectiveCouplings[effectiveCouplings, FlexibleSUSY`LowScaleInput, massMatrices, vertexRules, - {{FileNameJoin[{$flexiblesusyTemplateDir, "effective_couplings.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_effective_couplings.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "effective_couplings.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_effective_couplings.cpp"}]} - }]; - - Print["Creating class for observables ..."]; - WriteObservables[extraSLHAOutputBlocks, - {{FileNameJoin[{$flexiblesusyTemplateDir, "observables.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_observables.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "observables.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_observables.cpp"}]}}]; - - Print["Creating EDM class ..."]; + Print["Creating lepton EDM class ..."]; edmFields = DeleteDuplicates @ Cases[Observables`GetRequestedObservables[extraSLHAOutputBlocks], FlexibleSUSYObservable`EDM[p_[__]|p_] :> p]; edmVertices = @@ -4917,38 +5434,9 @@ corresponding tadpole is real or imaginary (only in models with CP {FileNameJoin[{$flexiblesusyTemplateDir, "edm.cpp.in"}], FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_edm.cpp"}]}}]; - (* OBSERVABLE: l -> l gamma *) - - LToLGammaFields = - DeleteDuplicates @ Cases[Observables`GetRequestedObservables[extraSLHAOutputBlocks], - FlexibleSUSYObservable`BrLToLGamma[ - pIn_[_Integer]|pIn_?AtomQ -> {pOut_[_Integer]|pOut_?AtomQ, spectator_} - ] :> (pIn -> {pOut, spectator}) - ]; - Block[{properStates, wrongFields}, - properStates = Cases[LToLGammaFields, - Rule[a_?IsLepton, {b_?IsLepton, c_ /; c === GetPhoton[]}] -> (a -> {b, c}) - ]; - wrongFields = Complement[LToLGammaFields, properStates]; - If[wrongFields =!= {}, - Print[ - "Warning: BrLToLGamma function works only for leptons and a photon. Removing requested process(es): " <> - StringJoin@Riffle[ToString /@ wrongFields, ", "] - ]; - LToLGammaFields = properStates; - ]; - ]; - - Print["Creating l->l'A class ..."]; - WriteLToLGammaClass[LToLGammaFields, - {{FileNameJoin[{$flexiblesusyTemplateDir, "l_to_lgamma.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_l_to_lgamma.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "l_to_lgamma.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_l_to_lgamma.cpp"}]}}]; - (* b -> s gamma *) If[MemberQ[Observables`GetRequestedObservables[extraSLHAOutputBlocks], FlexibleSUSYObservable`bsgamma], - Print["Creating b->s'A class ..."]; + Print["Creating b->sγ class ..."]; QToQGammaFields = Join[{BtoSGamma`GetBottomQuark[] -> {BtoSGamma`GetStrangeQuark[], TreeMasses`GetPhoton[]}}, {BtoSGamma`GetBottomQuark[] -> {BtoSGamma`GetStrangeQuark[], TreeMasses`GetGluon[]}}], QToQGammaFields = {}]; @@ -4958,22 +5446,66 @@ corresponding tadpole is real or imaginary (only in models with CP {FileNameJoin[{$flexiblesusyTemplateDir, "b_to_s_gamma.cpp.in"}], FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_b_to_s_gamma.cpp"}]}}]; - (* OBSERVABLE: l -> l conversion *) + (* Load and evaluate NPointFunctions write classes for observables *) + Module[{files, obs, newRules = {}, down, dir, observablesExtraEntity}, + dir = FileNameJoin@{FSOutputDir, "observables"}; + If[!DirectoryQ@dir, CreateDirectory@dir]; - Print["Creating FToFConversionInNucleus class ..."]; - LToLConversionFields = - DeleteDuplicates @ Cases[Observables`GetRequestedObservables[extraSLHAOutputBlocks], - FlexibleSUSYObservable`FToFConversionInNucleus[ - pIn_[_Integer] -> pOut_[_Integer], nucleus_ - ] :> {pIn -> pOut, nucleus} - ]; + files = Utils`DynamicInclude@$observablesWildcard@"FlexibleSUSY.m"; + obs = StringSplit[files, $PathnameSeparator][[All, -2]]; + + files = { + FileNameJoin@{$flexiblesusyTemplateDir, "observables", #<>".in"}, + FileNameJoin@{dir, FSModelName<>"_"<>#} + } &/@ {#<>".hpp", #<>".cpp"} &/@ (Observables`GetObservableFileName/@obs); + + Do[ + ObservablesExtraOutput@obs[[i]] = WriteClass[Symbol["FlexibleSUSYObservable`"<>obs[[i]]], extraSLHAOutputBlocks, files[[i]]]; + + observablesExtraEntity = FilterRules[ObservablesExtraOutput@obs[[i]], "C++ vertices"]; + Switch[observablesExtraEntity, + {_ -> _}, observablesExtraVertices = Join[observablesExtraVertices, observablesExtraEntity[[1, 2]]], + _, Null + ]; - conversionVertices = - WriteFToFConversionInNucleusClass[LToLConversionFields, - {{FileNameJoin[{$flexiblesusyTemplateDir, "f_to_f_conversion.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_f_to_f_conversion.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "f_to_f_conversion.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_f_to_f_conversion.cpp"}]}}]; + observablesExtraEntity = FilterRules[ObservablesExtraOutput@obs[[i]], "C++ replacements"]; + Switch[observablesExtraEntity, + {_ -> _}, newRules = Join[newRules, observablesExtraEntity[[1, 2]]], + _, Null + ];, + {i, Length@obs} + ]; + ObservablesExtraOutput@_ = {}; + + (* Inserting new rules before default ones *) + down = DownValues@GeneralReplacementRules; + down = Insert[down, newRules, {1,2,-1}]; + DownValues@GeneralReplacementRules = down; + + observablesExtraVertices = DeleteDuplicates@observablesExtraVertices; + ]; + + Print["Creating lepton AMM class ..."]; + ammFields = DeleteDuplicates @ Cases[Observables`GetRequestedObservables[extraSLHAOutputBlocks], + FlexibleSUSYObservable`AMM[p_[__]|p_] :> p]; + aMMVertices = WriteAMMClass[ + ammFields, + {{FileNameJoin[{$flexiblesusyTemplateDir, "amm.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_amm.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "lepton_amm_wrapper.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_lepton_amm_wrapper.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "amm.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_amm.cpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "lepton_amm_wrapper.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_lepton_amm_wrapper.cpp"}]}}]; + + Utils`PrintHeadline["Creating other observables"]; + Print["Creating class for observables ..."]; + WriteObservables[extraSLHAOutputBlocks, + {{FileNameJoin[{$flexiblesusyTemplateDir, "observables.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_observables.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "observables.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_observables.cpp"}]}}]; Print["Creating FFMasslessV form factor class for other observables ..."]; FFMasslessVVertices = @@ -4981,25 +5513,39 @@ corresponding tadpole is real or imaginary (only in models with CP (* collect external states from observables needing massless triangles *) DeleteDuplicates @ Join[ - (* muon g-2 *) - If[MemberQ[Observables`GetRequestedObservables[extraSLHAOutputBlocks], FlexibleSUSYObservable`aMuon], - Block[{muon = TreeMasses`GetSMMuonLepton[], muonWithoutIndex}, - muonWithoutIndex = If[AtomQ[muon], TreeMasses`GetSMMuonLepton[], Head@muon]; - {muonWithoutIndex -> {muonWithoutIndex, TreeMasses`GetPhoton[]}} - ], - {} - ], + (* lepton g-2 *) + (# -> {#, TreeMasses`GetPhoton[]})& /@ ammFields, + + (* lepton edm *) + (# -> {#, TreeMasses`GetPhoton[]})& /@ edmFields, (* Br(L -> L Gamma) *) - LToLGammaFields, + Module[{fields = Cases[ObservablesExtraOutput@"BrLToLGamma", ("FFV fields" -> x_) :> x]}, + Switch[fields, {{}}, {}, _, First/@fields] + ], + + Module[{fields = Flatten@Cases[ObservablesExtraOutput@"BrDLToDL", ("FFV fields" -> x_) :> x]}, + Switch[fields, + {__Symbol}, (# -> {#, TreeMasses`GetPhoton[]})& /@ fields, + _, {} + ] + ], (* b -> s gamma *) QToQGammaFields, - (* L -> L conversion in nucleus *) - If[LToLConversionFields === {}, - {}, - (#[[1, 1]] -> {#[[1, 2]], TreeMasses`GetPhoton[]})& /@ Transpose[Drop[Transpose[LToLConversionFields],-1]] + Module[{npfFields = FilterRules[ObservablesExtraOutput@"LToLConversion", "FFV fields"]}, + Switch[npfFields, + {_ -> _}, (#[[1]] -> {#[[2]], TreeMasses`GetPhoton[]}) &/@ npfFields[[1, 2]], + _, {} + ] + ], + + Module[{npfFields = FilterRules[ObservablesExtraOutput@"BrLTo3L", "FFV fields"]}, + Switch[npfFields, + {_ -> _}, (#[[1]] -> {#[[2]], TreeMasses`GetPhoton[]}) &/@ npfFields[[1, 2]], + _, {} + ] ] ], @@ -5009,12 +5555,12 @@ corresponding tadpole is real or imaginary (only in models with CP FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_FFV_form_factors.cpp"}]}} ]; - Print["Creating AMuon class ..."]; - WriteAMuonClass[MemberQ[Observables`GetRequestedObservables[extraSLHAOutputBlocks], FlexibleSUSYObservable`aMuon], - {{FileNameJoin[{$flexiblesusyTemplateDir, "a_muon.hpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_a_muon.hpp"}]}, - {FileNameJoin[{$flexiblesusyTemplateDir, "a_muon.cpp.in"}], - FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_a_muon.cpp"}]}}]; + Print["Creating unitarity class..."]; + WriteUnitarityClass[{{FileNameJoin[{$flexiblesusyTemplateDir, "unitarity.hpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_unitarity.hpp"}]}, + {FileNameJoin[{$flexiblesusyTemplateDir, "unitarity.cpp.in"}], + FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> "_unitarity.cpp"}]}} + ]; Print["Creating C++ QFT class..."]; cxxQFTTemplateDir = FileNameJoin[{$flexiblesusyTemplateDir, "cxx_qft"}]; @@ -5036,13 +5582,18 @@ corresponding tadpole is real or imaginary (only in models with CP If[DirectoryQ[cxxQFTOutputDir] === False, CreateDirectory[cxxQFTOutputDir]]; + WriteCXXDiagramClass[ - Join[edmVertices, FFMasslessVVertices, conversionVertices, decaysVertices], + Join[aMMVertices, FFMasslessVVertices, decaysVertices, observablesExtraVertices], cxxQFTFiles, cxxQFTVerticesTemplate, cxxQFTOutputDir, cxxQFTVerticesMakefileTemplates ]; + WriteSMParticlesAliases[{{FileNameJoin[{cxxQFTTemplateDir, "particle_aliases.hpp.in"}], + FileNameJoin[{cxxQFTOutputDir, FlexibleSUSY`FSModelName <> "_particle_aliases.hpp"}]}} + ]; + Utils`PrintHeadline["Creating Mathematica interface"]; Print["Creating LibraryLink ", FileNameJoin[{FSOutputDir, FlexibleSUSY`FSModelName <> ".mx"}], " ..."]; WriteMathLink[inputParameters, extraSLHAOutputBlocks, diff --git a/meta/Format.m b/meta/Format.m index 640a78d852..0877c9ab39 100644 --- a/meta/Format.m +++ b/meta/Format.m @@ -412,7 +412,7 @@ useful when assigning large arrays in ANSI C (default values dexp::usage="The symbol dexp is used in the test for ANSI compatible functions in FortranAssign."; diff::usage="The symbol diff is used to format D in MapleAssign."; -dilog::usage="The symbol dilog is used to format PolyLog in MapleAssign."; +Li2::usage="The symbol Li2 is used to format PolyLog in MapleAssign."; dim::usage="The symbol dim is used in the test for ANSI compatible functions in FortranAssign."; dint::usage="The symbol dint is used in the test for ANSI compatible @@ -582,7 +582,7 @@ useful when assigning large arrays in ANSI C (default values amod,and,anint,arccos,arccosh,arccot,arccoth,arccsc,arccsch,arcsec,arcsech,arcsin, arcsinh,arctan,arctanh,asin,asinh,atan,atan2,atanh,bernoulli,Bi,binomial,cabs, ccos,ceil,cexp,char,Ci,clog,cmplx,collect,conjg,cos,cosh,cot,coth,csc,csch,csin, -csqrt,dabs,dacos,dasin,datan,datan2,dble,dcos,dcosh,ddim,denom,dexp,dilog,dim, +csqrt,dabs,dacos,dasin,datan,datan2,dble,dcos,dcosh,ddim,denom,dexp,Li2,dim, dint,dlog,dlog10,dmax1,dmin1,dmod,dnint,dprod,dsign,dsin,dsinh,dsqrt,dtan,dtanh, Ei,erf,erfc,euler,evalf,exp,expand,factor,factorial,false,float,fsolve,GAMMA,iabs, ichar,idim,idint,idnint,ifix,index,infinity,int,isign,len,lge,lgt,lle,llt,log,log10,lnGAMMA, @@ -1268,7 +1268,7 @@ useful when assigning large arrays in ANSI C (default values MD[Length]=nops; MD[Log]=log; MD[LogGamma]=lnGAMMA; MD[Map]=map; MD[Max]=max; MD[Min]=min; MD[Mod]=mod; MD[N]=evalf; MD[NIntegrate]=int; MD[NSolve]=fsolve; MD[Not]=not; MD[Null]=NULL; MD[Numerator]=num; MD[Or]=or; MD[Part]=op; MD[PolyGamma]=Psi; - MD[PolyLog]=dilog; MD[Product]=product; MD[Replace]=subs; MD[ReplaceAll]=subs; + MD[PolyLog]=Li2; MD[Product]=product; MD[Replace]=subs; MD[ReplaceAll]=subs; MD[Roots]=RootOf; MD[Round]=round; MD[Sec]=sec; MD[Sech]=sech; MD[Series]=series; MD[Sign]=sign; MD[Simplify]=simplify; MD[Sin]=sin; MD[Sinh]=sinh; MD[SinIntegral]=Si; MD[Solve]=solve; MD[Sqrt]=sqrt; MD[Sum]=sum; @@ -1798,7 +1798,7 @@ useful when assigning large arrays in ANSI C (default values amod,and,anint,arccos,arccosh,arccot,arccoth,arccsc,arccsch,arcsec,arcsech,arcsin, arcsinh,arctan,arctanh,asin,asinh,atan,atan2,atanh,bernoulli,Bi,binomial,cabs, ccos,ceil,cexp,char,Ci,clog,cmplx,collect,conjg,cos,cosh,cot,coth,csc,csch,csin, -csqrt,dabs,dacos,dasin,datan,datan2,dble,dcos,dcosh,ddim,denom,dexp,dilog,dim, +csqrt,dabs,dacos,dasin,datan,datan2,dble,dcos,dcosh,ddim,denom,dexp,Li2,dim, dint,dlog,dlog10,dmax1,dmin1,dmod,dnint,dprod,dsign,dsin,dsinh,dsqrt,dtan,dtanh, Ei,erf,erfc,euler,evalf,exp,expand,factor,factorial,false,float,fsolve,GAMMA,iabs, ichar,idim,idint,idnint,ifix,index,infinity,int,isign,len,lge,lgt,lle,llt,log,log10,lnGAMMA, diff --git a/meta/GM2Calc.m b/meta/GM2Calc.m new file mode 100644 index 0000000000..45deb5e83a --- /dev/null +++ b/meta/GM2Calc.m @@ -0,0 +1,216 @@ +(* :Copyright: + + ==================================================================== + This file is part of FlexibleSUSY. + + FlexibleSUSY 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. + + FlexibleSUSY 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 FlexibleSUSY. If not, see + . + ==================================================================== + +*) + +BeginPackage["GM2Calc`", {"Parameters`", "CConversion`", "TextFormatting`"}]; + +(* GM2Calc interface parameters (gauge basis) *) +{ yukawaType, lambda1, lambda2, lambda3, lambda4, lambda5, lambda6, + lambda7, tanBeta, m122, zetau, zetad, zetal, deltau, deltad, deltal, + piu, pid, pil }; + +FillGM2CalcInterfaceData::usage="Fills GM2Calc interface struct with model parameters."; + +Begin["Private`"]; + +(* fill struct with model parameters to be passed to GM2Calc *) +FillGM2CalcInterfaceData[struct_String] := + Which[ + IsGM2CalcCompatibleMSSM[], FillGM2CalcMSSMNoFVInterfaceData[struct], + IsGM2CalcCompatibleTHDM[], FillGM2CalcTHDMInterfaceData[struct, FlexibleSUSY`FSGM2CalcInput], + True, Print["Error: This model is neither a MSSM-like nor a 2HDM-like model compatible with GM2Calc."]; Quit[1] + ]; + +(* returns true, if model is an MSSM-like model compatible with GM2Calc *) +IsGM2CalcCompatibleMSSM[] := + Module[{w, pseudoscalar, smuon, muonsneutrino, chargino, neutralino, + mu, m1, m2, m3, mq2, mu2, md2, ml2, me2, tu, td, te, yu, yd, ye}, + w = Parameters`GetParticleFromDescription["W-Boson"]; + pseudoscalar = Parameters`GetParticleFromDescription["Pseudo-Scalar Higgs"]; + smuon = Parameters`GetParticleFromDescription["Smuon"]; + muonsneutrino = Parameters`GetParticleFromDescription["Muon Sneutrino"]; + chargino = Parameters`GetParticleFromDescription["Charginos"]; + neutralino = Parameters`GetParticleFromDescription["Neutralinos"]; + mu = Parameters`GetParameterFromDescription["Mu-parameter"]; + m1 = Parameters`GetParameterFromDescription["Bino Mass parameter"]; + m2 = Parameters`GetParameterFromDescription["Wino Mass parameter"]; + m3 = Parameters`GetParameterFromDescription["Gluino Mass parameter"]; + mq2 = Parameters`GetParameterFromDescription["Softbreaking left Squark Mass"]; + mu2 = Parameters`GetParameterFromDescription["Softbreaking right Up-Squark Mass"]; + md2 = Parameters`GetParameterFromDescription["Softbreaking right Down-Squark Mass"]; + ml2 = Parameters`GetParameterFromDescription["Softbreaking left Slepton Mass"]; + me2 = Parameters`GetParameterFromDescription["Softbreaking right Slepton Mass"]; + tu = Parameters`GetParameterFromDescription["Trilinear-Up-Coupling"]; + td = Parameters`GetParameterFromDescription["Trilinear-Down-Coupling"]; + te = Parameters`GetParameterFromDescription["Trilinear-Lepton-Coupling"]; + yu = Parameters`GetParameterFromDescription["Up-Yukawa-Coupling"]; + yd = Parameters`GetParameterFromDescription["Down-Yukawa-Coupling"]; + ye = Parameters`GetParameterFromDescription["Lepton-Yukawa-Coupling"]; + Not[MemberQ[{w, pseudoscalar, smuon, muonsneutrino, + chargino, neutralino, mu, m1, m2, m3, mq2, mu2, + md2, ml2, me2, tu, td, te, yu, yd, ye}, Null]] + ]; + +(* fill struct with MSSM parameters to be passed to GM2Calc *) +FillGM2CalcMSSMNoFVInterfaceData[struct_String] := + Module[{mwStr, w, pseudoscalar, smuon, muonsneutrino, chargino, neutralino, + mu, m1, m2, m3, mq2, mu2, md2, ml2, me2, tu, td, te, yu, yd, ye}, + w = Parameters`GetParticleFromDescription["W-Boson"]; + pseudoscalar = Parameters`GetParticleFromDescription["Pseudo-Scalar Higgs"]; + smuon = Parameters`GetParticleFromDescription["Smuon"]; + muonsneutrino = Parameters`GetParticleFromDescription["Muon Sneutrino"]; + chargino = Parameters`GetParticleFromDescription["Charginos"]; + neutralino = Parameters`GetParticleFromDescription["Neutralinos"]; + mu = Parameters`GetParameterFromDescription["Mu-parameter"]; + m1 = Parameters`GetParameterFromDescription["Bino Mass parameter"]; + m2 = Parameters`GetParameterFromDescription["Wino Mass parameter"]; + m3 = Parameters`GetParameterFromDescription["Gluino Mass parameter"]; + mq2 = Parameters`GetParameterFromDescription["Softbreaking left Squark Mass"]; + mu2 = Parameters`GetParameterFromDescription["Softbreaking right Up-Squark Mass"]; + md2 = Parameters`GetParameterFromDescription["Softbreaking right Down-Squark Mass"]; + ml2 = Parameters`GetParameterFromDescription["Softbreaking left Slepton Mass"]; + me2 = Parameters`GetParameterFromDescription["Softbreaking right Slepton Mass"]; + tu = Parameters`GetParameterFromDescription["Trilinear-Up-Coupling"]; + td = Parameters`GetParameterFromDescription["Trilinear-Down-Coupling"]; + te = Parameters`GetParameterFromDescription["Trilinear-Lepton-Coupling"]; + yu = Parameters`GetParameterFromDescription["Up-Yukawa-Coupling"]; + yd = Parameters`GetParameterFromDescription["Down-Yukawa-Coupling"]; + ye = Parameters`GetParameterFromDescription["Lepton-Yukawa-Coupling"]; + mwStr = "MODEL.get_physical()." <> CConversion`RValueToCFormString[FlexibleSUSY`M[w]]; + (* compose string *) + "#ifdef ENABLE_GM2CALC\n" <> + "GM2Calc_MSSMNoFV_data " <> struct <> ";\n" <> + struct <> ".scale = MODEL.get_scale();\n" <> + struct <> ".alpha_em_MZ = ALPHA_EM_MZ;\n" <> + struct <> ".alpha_em_0 = ALPHA_EM_0;\n" <> + struct <> ".alpha_s_MZ = ALPHA_S_MZ;\n" <> + struct <> ".MZ = MZPole;\n" <> + "if (!is_zero(" <> mwStr <> ")) {\n" <> + TextFormatting`IndentText[struct <> ".MW = " <> mwStr <> ";"] <> "\n" <> + "} else if (!is_zero(MWPole)) {\n" <> + TextFormatting`IndentText[struct <> ".MW = MWPole;"] <> "\n}\n" <> + struct <> ".mb_mb = MBMB;\n" <> + struct <> ".MT = MTPole;\n" <> + struct <> ".MTau = MTauPole;\n" <> + struct <> ".MM = MMPole;\n" <> + struct <> ".MA0 = MODEL.get_physical()." <> CConversion`RValueToCFormString[FlexibleSUSY`M[pseudoscalar][1]] <> ";\n" <> + struct <> ".MSvm = MODEL.get_physical()." <> CConversion`RValueToCFormString[FlexibleSUSY`M[muonsneutrino]] <> ";\n" <> + struct <> ".TB = MODEL.get_" <> CConversion`RValueToCFormString[SARAH`VEVSM2] <> "() / " <> + "MODEL.get_" <> CConversion`RValueToCFormString[SARAH`VEVSM1] <> "();\n" <> + struct <> ".Mu = MODEL.get_" <> CConversion`RValueToCFormString[mu] <> "();\n" <> + struct <> ".M1 = MODEL.get_" <> CConversion`RValueToCFormString[m1] <> "();\n" <> + struct <> ".M2 = MODEL.get_" <> CConversion`RValueToCFormString[m2] <> "();\n" <> + struct <> ".M3 = MODEL.get_" <> CConversion`RValueToCFormString[m3] <> "();\n" <> + struct <> ".MSm = MODEL.get_physical()." <> CConversion`RValueToCFormString[FlexibleSUSY`M[smuon]] <> ";\n" <> + struct <> ".MCha = MODEL.get_physical()." <> CConversion`RValueToCFormString[FlexibleSUSY`M[chargino]] <> ";\n" <> + struct <> ".MChi = MODEL.get_physical()." <> CConversion`RValueToCFormString[FlexibleSUSY`M[neutralino]] <> ";\n" <> + struct <> ".mq2 = MODEL.get_" <> CConversion`RValueToCFormString[mq2] <> "();\n" <> + struct <> ".mu2 = MODEL.get_" <> CConversion`RValueToCFormString[mu2] <> "();\n" <> + struct <> ".md2 = MODEL.get_" <> CConversion`RValueToCFormString[md2] <> "();\n" <> + struct <> ".ml2 = MODEL.get_" <> CConversion`RValueToCFormString[ml2] <> "();\n" <> + struct <> ".me2 = MODEL.get_" <> CConversion`RValueToCFormString[me2] <> "();\n" <> + struct <> ".Au = div_safe(MODEL.get_" <> CConversion`RValueToCFormString[tu] <> "(), MODEL.get_" <> CConversion`RValueToCFormString[yu] <> "());\n" <> + struct <> ".Ad = div_safe(MODEL.get_" <> CConversion`RValueToCFormString[td] <> "(), MODEL.get_" <> CConversion`RValueToCFormString[yd] <> "());\n" <> + struct <> ".Ae = div_safe(MODEL.get_" <> CConversion`RValueToCFormString[te] <> "(), MODEL.get_" <> CConversion`RValueToCFormString[ye] <> "());\n" <> + "#endif\n\n" + ]; + +(* returns true, if model is an THDM-like model compatible with GM2Calc *) +IsGM2CalcCompatibleTHDM[] := + Module[{w, h, a, hp, yu, yd, ye}, + w = Parameters`GetParticleFromDescription["W-Boson"]; + h = Parameters`GetParticleFromDescription["Higgs"]; + a = Parameters`GetParticleFromDescription["Pseudo-Scalar Higgs"]; + hp = Parameters`GetParticleFromDescription["Charged Higgs"]; + yu = Parameters`GetParameterFromDescription["Up-Yukawa-Coupling"]; + yd = Parameters`GetParameterFromDescription["Down-Yukawa-Coupling"]; + ye = Parameters`GetParameterFromDescription["Lepton-Yukawa-Coupling"]; + Not[MemberQ[{w, h, a, hp, yu, yd, ye}, Null]] + ]; + +(* fill struct with THDM parameters to be passed to GM2Calc *) +FillGM2CalcTHDMInterfaceData[struct_String, inputPars_List] := + Module[{w, mwStr, higgs, mhStr, + inPars = Parameters`DecreaseIndexLiterals[inputPars], + pars = First /@ Reverse /@ inputPars + }, + w = Parameters`GetParticleFromDescription["W-Boson"]; + higgs = Parameters`GetParticleFromDescription["Higgs"]; + mwStr = "MODEL.get_physical()." <> CConversion`RValueToCFormString[FlexibleSUSY`M[w]]; + mhStr = "MODEL.get_physical()." <> CConversion`RValueToCFormString[FlexibleSUSY`M[higgs][0]]; + (* compose string *) + "#ifdef ENABLE_GM2CALC\n" <> + "GM2Calc_THDM_data " <> struct <> ";\n" <> + "{\n" <> + TextFormatting`IndentText[Parameters`CreateLocalConstRefs[pars]] <> "\n" <> + TextFormatting`IndentText[ + struct <> ".alpha_em_mz = ALPHA_EM_MZ;\n" <> + struct <> ".alpha_em_0 = ALPHA_EM_0;\n" <> + struct <> ".alpha_s_mz = ALPHA_S_MZ;\n" <> + "if (!is_zero(" <> mhStr <> ")) {\n" <> + TextFormatting`IndentText[struct <> ".mh = " <> mhStr <> ";"] <> "\n" <> + "} else if (!is_zero(MHPole)) {\n" <> + TextFormatting`IndentText[struct <> ".mh = MHPole;"] <> "\n}\n" <> + "if (!is_zero(" <> mwStr <> ")) {\n" <> + TextFormatting`IndentText[struct <> ".mw = " <> mwStr <> ";"] <> "\n" <> + "} else if (!is_zero(MWPole)) {\n" <> + TextFormatting`IndentText[struct <> ".mw = MWPole;"] <> "\n}\n" <> + struct <> ".mz = MZPole;\n" <> + struct <> ".mu(0) = MU2GeV;\n" <> + struct <> ".mu(1) = MCMC;\n" <> + struct <> ".mu(2) = MTPole;\n" <> + struct <> ".md(0) = MD2GeV;\n" <> + struct <> ".md(1) = MS2GeV;\n" <> + struct <> ".md(2) = MBMB;\n" <> + struct <> ".mv(0) = Mv1Pole;\n" <> + struct <> ".mv(1) = Mv2Pole;\n" <> + struct <> ".mv(2) = Mv3Pole;\n" <> + struct <> ".ml(0) = MEPole;\n" <> + struct <> ".ml(1) = MMPole;\n" <> + struct <> ".ml(2) = MTauPole;\n" <> + struct <> ".ckm = CKMInput;\n" <> + struct <> ".yukawa_type = " <> CConversion`RValueToCFormString[FlexibleSUSY`yukawaType /. inPars] <> ";\n" <> + struct <> ".lambda(0) = " <> CConversion`RValueToCFormString[FlexibleSUSY`lambda1 /. inPars] <> ";\n" <> + struct <> ".lambda(1) = " <> CConversion`RValueToCFormString[FlexibleSUSY`lambda2 /. inPars] <> ";\n" <> + struct <> ".lambda(2) = " <> CConversion`RValueToCFormString[FlexibleSUSY`lambda3 /. inPars] <> ";\n" <> + struct <> ".lambda(3) = " <> CConversion`RValueToCFormString[FlexibleSUSY`lambda4 /. inPars] <> ";\n" <> + struct <> ".lambda(4) = " <> CConversion`RValueToCFormString[FlexibleSUSY`lambda5 /. inPars] <> ";\n" <> + struct <> ".lambda(5) = " <> CConversion`RValueToCFormString[FlexibleSUSY`lambda6 /. inPars] <> ";\n" <> + struct <> ".lambda(6) = " <> CConversion`RValueToCFormString[FlexibleSUSY`lambda7 /. inPars] <> ";\n" <> + struct <> ".tan_beta = " <> CConversion`RValueToCFormString[FlexibleSUSY`tanBeta /. inPars] <> ";\n" <> + struct <> ".m122 = " <> CConversion`RValueToCFormString[FlexibleSUSY`m122 /. inPars] <> ";\n" <> + struct <> ".zeta_u = " <> CConversion`RValueToCFormString[FlexibleSUSY`zetau /. inPars] <> ";\n" <> + struct <> ".zeta_d = " <> CConversion`RValueToCFormString[FlexibleSUSY`zetad /. inPars] <> ";\n" <> + struct <> ".zeta_l = " <> CConversion`RValueToCFormString[FlexibleSUSY`zetal /. inPars] <> ";\n" <> + struct <> ".delta_u = " <> CConversion`RValueToCFormString[FlexibleSUSY`deltau /. inPars] <> ";\n" <> + struct <> ".delta_d = " <> CConversion`RValueToCFormString[FlexibleSUSY`deltad /. inPars] <> ";\n" <> + struct <> ".delta_l = " <> CConversion`RValueToCFormString[FlexibleSUSY`deltal /. inPars] <> ";\n" <> + struct <> ".pi_u = " <> CConversion`RValueToCFormString[FlexibleSUSY`piu /. inPars] <> ";\n" <> + struct <> ".pi_d = " <> CConversion`RValueToCFormString[FlexibleSUSY`pid /. inPars] <> ";\n" <> + struct <> ".pi_l = " <> CConversion`RValueToCFormString[FlexibleSUSY`pil /. inPars] <> ";\n" + ] <> + "}\n" <> + "#endif\n\n" + ]; + +End[]; + +EndPackage[]; diff --git a/meta/Himalaya.m b/meta/Himalaya.m index 05d9c38bb7..2d62645ca3 100644 --- a/meta/Himalaya.m +++ b/meta/Himalaya.m @@ -27,7 +27,7 @@ struct."; { RenormalizationScheme, Lambda3L, Lambda3LUncertainty, - \[Mu], SARAH`g1, Susyno`LieGroups`g2, g3, vd, vu, + \[Mu], SARAH`g1, Susyno`LieGroups`g2, SARAH`g3, SARAH`vd, SARAH`vu, MSQ2, MSD2, MSU2, MSL2, MSE2, Au, Ad, Ae, Yu, Yd, Ye, M1, M2, M3, mA }; diff --git a/meta/LoopMasses.m b/meta/LoopMasses.m index cf455d4f72..5cc1a8525a 100644 --- a/meta/LoopMasses.m +++ b/meta/LoopMasses.m @@ -35,6 +35,8 @@ CallThreadedPoleMassFunction::usage=""; CreateLoopMassFunctionName::usage=""; +CalculateSMHiggsPoleMass::usage="Calculates SM Higgs pole mass on a model"; + GetLoopCorrectedParticles::usage="Returns list of all particles that get loop corrected masses. These are all particles, except for ghosts."; @@ -43,6 +45,25 @@ Begin["`Private`"]; +CalculateSMHiggsPoleMass[FlexibleSUSY`FSMassW] := ""; + +CalculateSMHiggsPoleMass[FlexibleSUSY`FSFermiConstant] := + Module[{mhStr = CConversion`ToValidCSymbolString[FlexibleSUSY`M[TreeMasses`GetHiggsBoson[]]]}, + "\ +// calculate SM-like Higgs pole mass +// for usage in MW calculation at low-energy scale +{ + auto tmp = *MODEL; + tmp.do_force_output(true); // enforce calculation of pole masses + tmp.solve_ewsb(); + " <> CallPoleMassFunction[TreeMasses`GetHiggsBoson[], "tmp."] <> "\ + MODEL->get_physical()." <> mhStr <> " = tmp.get_physical()." <> mhStr <> "; +} +" + ]; + +CalculateSMHiggsPoleMass[_] := ""; + GetLoopCorrectedParticles[states_] := Module[{particles}, particles = GetParticles[states]; @@ -81,15 +102,16 @@ double mst_1, mst_2, theta_t; " <> TreeMasses`CallGenerationHelperFunctionName[3, SARAH`TopSquark, "mst_1", "mst_2", "theta_t"] <> "; -mssm_twoloop_mt::Parameters pars; -pars.g3 = " <> CConversion`RValueToCFormString[SARAH`strongCoupling /. Parameters`ApplyGUTNormalization[]] <> "; -pars.mt = " <> CConversion`RValueToCFormString[TreeMasses`GetThirdGenerationMass[TreeMasses`GetSMTopQuarkMultiplet[]]] <> "; -pars.mg = " <> CConversion`RValueToCFormString[FlexibleSUSY`M[SARAH`Gluino]] <> "; -pars.mst1 = mst_1; -pars.mst2 = mst_2; -pars.msusy = " <> CConversion`RValueToCFormString[Sqrt[Sqrt[Abs[SARAH`SoftSquark[2,2]] Abs[SARAH`SoftDown[2,2]]]]] <> "; -pars.xt = Sin(2*theta_t) * (Sqr(mst_1) - Sqr(mst_2)) / (2. * pars.mt); -pars.Q = get_scale();"; +const mssm_twoloop_mt::Parameters pars{ + .g3 = " <> CConversion`RValueToCFormString[SARAH`strongCoupling /. Parameters`ApplyGUTNormalization[]] <> ", + .mt = " <> CConversion`RValueToCFormString[TreeMasses`GetThirdGenerationMass[TreeMasses`GetSMTopQuarkMultiplet[]]] <> ", + .mg = " <> CConversion`RValueToCFormString[FlexibleSUSY`M[SARAH`Gluino]] <> ", + .mst1 = mst_1, + .mst2 = mst_2, + .msusy = " <> CConversion`RValueToCFormString[Sqrt[Sqrt[Abs[SARAH`SoftSquark[2,2]] Abs[SARAH`SoftDown[2,2]]]]] <> ", + .xt = Sin(2*theta_t) * (Sqr(mst_1) - Sqr(mst_2)) / (2. * pars.mt), + .Q = get_scale() +};"; AddMtPoleQCDCorrections[1, expr_] := @@ -269,9 +291,9 @@ qcdOneLoop, qcdTwoLoop, qcdThreeLoop, qcdFourLoop }, massName = ToValidCSymbolString[FlexibleSUSY`M[particle]]; - topSelfEnergyFunctionS = SelfEnergies`CreateHeavySelfEnergyFunctionName[particle[1], 1]; - topSelfEnergyFunctionPL = SelfEnergies`CreateHeavySelfEnergyFunctionName[particle[PL], 1]; - topSelfEnergyFunctionPR = SelfEnergies`CreateHeavySelfEnergyFunctionName[particle[PR], 1]; + topSelfEnergyFunctionS = SelfEnergies`CreateHeavySelfEnergyFunctionName[{particle, particle}[1], 1]; + topSelfEnergyFunctionPL = SelfEnergies`CreateHeavySelfEnergyFunctionName[{particle, particle}[PL], 1]; + topSelfEnergyFunctionPR = SelfEnergies`CreateHeavySelfEnergyFunctionName[{particle, particle}[PR], 1]; qcdOneLoop = N[SimpQCD[-TwoLoopQCD`GetDeltaMPoleOverMRunningQCDOneLoop[particle, Global`currentScale, FlexibleSUSY`FSRenormalizationScheme]]]; qcdTwoLoop = N[SimpQCD[-TwoLoopQCD`GetDeltaMPoleOverMRunningQCDTwoLoop[particle, Global`currentScale, FlexibleSUSY`FSRenormalizationScheme]]]; qcdThreeLoop = If[FlexibleSUSY`FSRenormalizationScheme === FlexibleSUSY`MSbar, @@ -327,7 +349,7 @@ massNameReordered = massName <> "_reordered"; mixingMatrix = FindMixingMatrixSymbolFor[particle]; massMatrixStr = "get_mass_matrix_" <> ToValidCSymbolString[particle]; - selfEnergyFunction = SelfEnergies`CreateSelfEnergyFunctionName[particle, 1]; + selfEnergyFunction = SelfEnergies`CreateSelfEnergyFunctionName[{particle, particle}, 1]; selfEnergyMatrixType = TreeMasses`GetMassMatrixType[particle]; selfEnergyMatrixCType = CreateCType[selfEnergyMatrixType]; tadpoleMatrix = FillTadpoleMatrix[tadpoles, "tadpoles"]; @@ -400,9 +422,9 @@ mixingMatrix = FindMixingMatrixSymbolFor[particle]; selfEnergyMatrixType = TreeMasses`GetMassMatrixType[particle]; selfEnergyMatrixCType = CreateCType[selfEnergyMatrixType]; - selfEnergyFunctionS = SelfEnergies`CreateSelfEnergyFunctionName[particle[1], 1]; - selfEnergyFunctionPL = SelfEnergies`CreateSelfEnergyFunctionName[particle[PL], 1]; - selfEnergyFunctionPR = SelfEnergies`CreateSelfEnergyFunctionName[particle[PR], 1]; + selfEnergyFunctionS = SelfEnergies`CreateSelfEnergyFunctionName[{particle,particle}[1], 1]; + selfEnergyFunctionPL = SelfEnergies`CreateSelfEnergyFunctionName[{particle,particle}[PL], 1]; + selfEnergyFunctionPR = SelfEnergies`CreateSelfEnergyFunctionName[{particle,particle}[PR], 1]; reorderMasses = CreateCType[CConversion`ArrayType[realScalarCType, dim]] <> " " <> massNameReordered <> "(" <> massName <> ");\n" <> "reorder_vector(" <> massNameReordered <> ", " <> @@ -481,7 +503,7 @@ be set to the (positive) tree-level mass. M_tree particleName = ToValidCSymbolString[particle]; massName = ToValidCSymbolString[FlexibleSUSY`M[particle]]; mixingMatrix = ToValidCSymbolString[FindMixingMatrixSymbolFor[particle]]; - selfEnergyFunction = SelfEnergies`CreateSelfEnergyFunctionName[particle, 1]; + selfEnergyFunction = SelfEnergies`CreateSelfEnergyFunctionName[{particle, particle}, 1]; selfEnergyMatrixType = TreeMasses`GetMassMatrixType[particle]; selfEnergyMatrixCType = CreateCType[selfEnergyMatrixType]; If[IsUnmixed[particle] && GetMassOfUnmixedParticle[particle] === 0, @@ -550,21 +572,24 @@ be set to the (positive) tree-level mass. M_tree IndentText["PHYSICAL(" <> U <> ") = " <> Utemp <> ";\n"]; ]; ]; - selfEnergyFunction = SelfEnergies`CreateSelfEnergyFunctionName[particle, 1]; + selfEnergyFunction = SelfEnergies`CreateSelfEnergyFunctionName[{particle, particle}, 1]; tadpoleMatrix = FillTadpoleMatrix[tadpole, "tadpoles"]; massMatrixStr = "get_mass_matrix_" <> ToValidCSymbolString[particle]; (* fill self-energy and do diagonalisation *) If[dim > 1, If[(SARAH`UseHiggs2LoopMSSM === True || FlexibleSUSY`UseHiggs2LoopNMSSM === True || - FlexibleSUSY`UseHiggs3LoopMSSM === True) && + FlexibleSUSY`UseHiggs3LoopMSSM === True || + FlexibleSUSY`UseHiggs3LoopNMSSM === True) && MemberQ[{SARAH`HiggsBoson, SARAH`PseudoScalar}, particle], addHigherLoopHiggsContributions = "self_energy += self_energy_2l;\n"; If[calcEffPot, calcHigherLoopHiggsContributions = CalcEffPot2L[particle]; ]; ]; - If[FlexibleSUSY`UseHiggs3LoopMSSM === True && MemberQ[{SARAH`HiggsBoson}, particle], + If[(FlexibleSUSY`UseHiggs3LoopMSSM === True || + FlexibleSUSY`UseHiggs3LoopNMSSM === True) && + MemberQ[{SARAH`HiggsBoson}, particle], addHigherLoopHiggsContributions = addHigherLoopHiggsContributions <> "self_energy += self_energy_3l;\n"; If[calcEffPot, calcHigherLoopHiggsContributions = calcHigherLoopHiggsContributions <> CalcEffPot3L[particle]; @@ -620,9 +645,9 @@ be set to the (positive) tree-level mass. M_tree eigenArrayType = CreateCType[CConversion`ArrayType[CConversion`realScalarCType, dim]]; topTwoLoop = particle === TreeMasses`GetSMTopQuarkMultiplet[]; If[topTwoLoop, - topSelfEnergyFunctionS = SelfEnergies`CreateHeavySelfEnergyFunctionName[particle[1], 1]; - topSelfEnergyFunctionPL = SelfEnergies`CreateHeavySelfEnergyFunctionName[particle[PL], 1]; - topSelfEnergyFunctionPR = SelfEnergies`CreateHeavySelfEnergyFunctionName[particle[PR], 1]; + topSelfEnergyFunctionS = SelfEnergies`CreateHeavySelfEnergyFunctionName[{particle, particle}[1], 1]; + topSelfEnergyFunctionPL = SelfEnergies`CreateHeavySelfEnergyFunctionName[{particle, particle}[PL], 1]; + topSelfEnergyFunctionPR = SelfEnergies`CreateHeavySelfEnergyFunctionName[{particle, particle}[PR], 1]; thirdGenMass = TreeMasses`GetThirdGenerationMass[particle]; qcdOneLoop = N[SimpQCD[-TwoLoopQCD`GetDeltaMPoleOverMRunningQCDOneLoop[particle, Global`currentScale, FlexibleSUSY`FSRenormalizationScheme]]]; qcdTwoLoop = N[SimpQCD[-TwoLoopQCD`GetDeltaMPoleOverMRunningQCDTwoLoop[particle, Global`currentScale, FlexibleSUSY`FSRenormalizationScheme]]]; @@ -643,9 +668,9 @@ be set to the (positive) tree-level mass. M_tree AddMtPoleQCDCorrections[3, qcdThreeLoop /. FlexibleSUSY`M[particle] -> thirdGenMass] <> "\n" <> AddMtPoleQCDCorrections[4, qcdFourLoop /. FlexibleSUSY`M[particle] -> thirdGenMass] <> "\n"; ]; - selfEnergyFunctionS = SelfEnergies`CreateSelfEnergyFunctionName[particle[1], 1]; - selfEnergyFunctionPL = SelfEnergies`CreateSelfEnergyFunctionName[particle[PL], 1]; - selfEnergyFunctionPR = SelfEnergies`CreateSelfEnergyFunctionName[particle[PR], 1]; + selfEnergyFunctionS = SelfEnergies`CreateSelfEnergyFunctionName[{particle,particle}[1], 1]; + selfEnergyFunctionPL = SelfEnergies`CreateSelfEnergyFunctionName[{particle,particle}[PL], 1]; + selfEnergyFunctionPR = SelfEnergies`CreateSelfEnergyFunctionName[{particle,particle}[PR], 1]; If[dim > 1, result = qcdCorrections <> "const " <> selfEnergyMatrixCType <> " M_tree(" <> massMatrixStr <> "());\n" <> @@ -764,7 +789,7 @@ be set to the (positive) tree-level mass. M_tree massName = ToValidCSymbolString[FlexibleSUSY`M[particle]]; If[inputMomentum == "", momentum = massName]; mixingMatrix = ToValidCSymbolString[FindMixingMatrixSymbolFor[particle]]; - selfEnergyFunction = SelfEnergies`CreateSelfEnergyFunctionName[particle, 1]; + selfEnergyFunction = SelfEnergies`CreateSelfEnergyFunctionName[{particle, particle}, 1]; selfEnergyMatrixType = TreeMasses`GetMassMatrixType[particle]; selfEnergyMatrixCType = CreateCType[selfEnergyMatrixType]; If[IsUnmixed[particle] && GetMassOfUnmixedParticle[particle] === 0, @@ -847,7 +872,8 @@ be set to the (positive) tree-level mass. M_tree effPot = effPot <> CalcEffPot2L[particle]; ]; If[dim > 1 && - FlexibleSUSY`UseHiggs3LoopMSSM === True && + (FlexibleSUSY`UseHiggs3LoopMSSM === True || + FlexibleSUSY`UseHiggs3LoopNMSSM === True) && MemberQ[{SARAH`HiggsBoson}, particle], effPot = effPot <> CalcEffPot3L[particle]; ]; @@ -912,9 +938,10 @@ be set to the (positive) tree-level mass. M_tree (* return pole mass of a singlet as a function of p *) Create1DimPoleMassPrototype[particle_Symbol] := If[GetDimension[particle] > 1, - Print["Warning: cannot generate extra pole mass" - " calculation function for ", particle, ", because" - " it has more than 1 generation"]; + Utils`FSFancyWarning[ + "Cannot generate extra pole mass calculation function for", + " ", particle, ", because it has more than 1 generation" + ]; "", "double " <> CreateLoopMassFunctionName[particle] <> "(double);\n" ]; @@ -923,9 +950,10 @@ be set to the (positive) tree-level mass. M_tree Create1DimPoleMassFunction[particle_Symbol] := Module[{result, body = "", particleName, massName, mTree}, If[GetDimension[particle] > 1, - Print["Warning: cannot generate extra pole mass" - " calculation function for ", particle, ", because" - " it has more than 1 generation"]; + Utils`FSFancyWarning[ + "Cannot generate extra pole mass calculation function for", + " ", particle, ", because it has more than 1 generation" + ]; Return[""]; ]; If[!(IsUnmixed[particle] && GetMassOfUnmixedParticle[particle] === 0), @@ -935,7 +963,7 @@ be set to the (positive) tree-level mass. M_tree If[!IsMassless[particle], particleName = ToValidCSymbolString[particle]; massName = ToValidCSymbolString[FlexibleSUSY`M[particle]]; - selfEnergyFunction = SelfEnergies`CreateSelfEnergyFunctionName[particle, 1]; + selfEnergyFunction = SelfEnergies`CreateSelfEnergyFunctionName[{particle, particle}, 1]; (* vector bosons are always unmixed -> make sure the right mass eigenvalue is used. The mass matrix might contain mixing matrix elements, which can result in @@ -1008,22 +1036,33 @@ be set to the (positive) tree-level mass. M_tree susyParticles = Complement[particles, smParticles]; If[enablePoleMassThreads =!= True, callSusy = StringJoin[CallPoleMassFunction /@ susyParticles]; - callSM = StringJoin[CallPoleMassFunction /@ smParticles]; + callSM = StringJoin[CallPoleMassFunction /@ Select[smParticles, #=!=GetWBoson[]&]]; result = "if (calculate_bsm_pole_masses) {\n" <> IndentText[callSusy] <> "}\n\n" <> "if (calculate_sm_pole_masses) {\n" <> - IndentText[callSM] <> + IndentText[callSM <> + "if (PHYSICAL(M" <> ToString@GetWBoson[] <> ") == 0.) {\n" <> + IndentText[LoopMasses`CreateLoopMassFunctionName[GetWBoson[]] <> "();\n"] <> + "}\n" + ] <> "}\n"; , callSusy = StringJoin[CallThreadedPoleMassFunction /@ susyParticles]; - callSM = StringJoin[CallThreadedPoleMassFunction /@ smParticles]; + callSM = StringJoin[CallThreadedPoleMassFunction /@ Select[smParticles, #=!=GetWBoson[]&]]; result = "Thread_pool tp(std::min(std::thread::hardware_concurrency(), " <> ToString[Length[susyParticles] + Length[smParticles]] <> "u));\n\n" <> "if (calculate_bsm_pole_masses) {\n" <> IndentText[callSusy] <> "}\n\n" <> "if (calculate_sm_pole_masses) {\n" <> - IndentText[callSM] <> + IndentText[callSM <> + "tp.run_task([this] () {\n" <> + IndentText[ + "if (PHYSICAL(M" <> ToString@GetWBoson[] <> ") == 0.) {\n" <> + IndentText[LoopMasses`CreateLoopMassFunctionName[GetWBoson[]] <> "();\n"] <> + "}\n" + ] <> "});\n" + ] <> "}\n"; ]; result @@ -1091,9 +1130,9 @@ be set to the (positive) tree-level mass. M_tree dimParticle, treeLevelMass}, dimParticle = TreeMasses`GetDimension[particle]; treeLevelMass = TreeMasses`GetThirdGenerationMass[particle] /. a_[i_?IntegerQ] :> a[Global`idx]; - selfEnergyFunctionS = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[particle[1], 1]; - selfEnergyFunctionPL = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[particle[PL], 1]; - selfEnergyFunctionPR = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[particle[PR], 1]; + selfEnergyFunctionS = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[{particle, particle}[1], 1]; + selfEnergyFunctionPL = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[{particle, particle}[PL], 1]; + selfEnergyFunctionPR = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[{particle, particle}[PR], 1]; name = ToValidCSymbolString[FlexibleSUSY`M[particle]]; If[IsMassless[particle], If[dimParticle == 1, @@ -1137,9 +1176,9 @@ be set to the (positive) tree-level mass. M_tree selfEnergyFunctionPR, name, drbarConversion, gPrime, dimParticle}, dimParticle = TreeMasses`GetDimension[particle]; - selfEnergyFunctionS = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[particle[1], 1]; - selfEnergyFunctionPL = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[particle[PL], 1]; - selfEnergyFunctionPR = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[particle[PR], 1]; + selfEnergyFunctionS = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[{particle, particle}[1], 1]; + selfEnergyFunctionPL = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[{particle, particle}[PL], 1]; + selfEnergyFunctionPR = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[{particle, particle}[PR], 1]; name = ToValidCSymbolString[FlexibleSUSY`M[particle]]; If[IsMassless[particle], If[dimParticle == 1, @@ -1209,9 +1248,9 @@ be set to the (positive) tree-level mass. M_tree dimParticle, treeLevelMass}, dimParticle = TreeMasses`GetDimension[particle]; treeLevelMass = TreeMasses`GetThirdGenerationMass[particle] /. a_[i_?IntegerQ] :> a[Global`idx]; - selfEnergyFunctionS = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[particle[1], 1]; - selfEnergyFunctionPL = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[particle[PL], 1]; - selfEnergyFunctionPR = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[particle[PR], 1]; + selfEnergyFunctionS = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[{particle, particle}[1], 1]; + selfEnergyFunctionPL = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[{particle, particle}[PL], 1]; + selfEnergyFunctionPR = SelfEnergies`CreateHeavyRotatedSelfEnergyFunctionName[{particle, particle}[PR], 1]; name = ToValidCSymbolString[FlexibleSUSY`M[particle]]; If[IsMassless[particle], If[dimParticle == 1, @@ -1228,13 +1267,19 @@ be set to the (positive) tree-level mass. M_tree ]; If[FlexibleSUSY`UseYukawa3LoopQCD === True && FlexibleSUSY`FSRenormalizationScheme =!= FlexibleSUSY`MSbar, - Print["Warning: UseYukawa3LoopQCD == True, but the renormalization scheme is not MSbar!"]; - Print[" The 3-loop QCD corrections to the top Yukawa coupling will be disabled."]; - ]; + Utils`FSFancyWarning[ + "UseYukawa3LoopQCD == True, but the", + " renormalization scheme is not MSbar! The 3-loop QCD", + " corrections to the top Yukawa coupling will be disabled." + ]; + ]; If[FlexibleSUSY`UseYukawa4LoopQCD === True && FlexibleSUSY`FSRenormalizationScheme =!= FlexibleSUSY`MSbar, - Print["Warning: UseYukawa4LoopQCD == True, but the renormalization scheme is not MSbar!"]; - Print[" The 4-loop QCD corrections to the top Yukawa coupling will be disabled."]; + Utils`FSFancyWarning[ + "UseYukawa4LoopQCD == True, but the renormalization", + " scheme is not MSbar! The 4-loop QCD corrections to the", + " top Yukawa coupling will be disabled." + ]; ]; If[FlexibleSUSY`UseYukawa3LoopQCD === True || FlexibleSUSY`UseYukawa3LoopQCD === Automatic, @@ -1314,9 +1359,9 @@ be set to the (positive) tree-level mass. M_tree Module[{result, body, selfEnergyFunctionS, selfEnergyFunctionPL, selfEnergyFunctionPR, name, dimParticle}, dimParticle = TreeMasses`GetDimension[particle]; - selfEnergyFunctionS = SelfEnergies`CreateSelfEnergyFunctionName[particle[1], 1]; - selfEnergyFunctionPL = SelfEnergies`CreateSelfEnergyFunctionName[particle[PL], 1]; - selfEnergyFunctionPR = SelfEnergies`CreateSelfEnergyFunctionName[particle[PR], 1]; + selfEnergyFunctionS = SelfEnergies`CreateSelfEnergyFunctionName[{particle, particle}[1], 1]; + selfEnergyFunctionPL = SelfEnergies`CreateSelfEnergyFunctionName[{particle, particle}[PL], 1]; + selfEnergyFunctionPR = SelfEnergies`CreateSelfEnergyFunctionName[{particle, particle}[PR], 1]; name = ToValidCSymbolString[FlexibleSUSY`M[particle]]; If[IsMassless[particle], If[dimParticle == 1, @@ -1348,7 +1393,7 @@ be set to the (positive) tree-level mass. M_tree CreateRunningDRbarMassFunction[particle_, _] := Module[{result, body, selfEnergyFunction, name, particleName}, - selfEnergyFunction = SelfEnergies`CreateSelfEnergyFunctionName[particle, 1]; + selfEnergyFunction = SelfEnergies`CreateSelfEnergyFunctionName[{particle, particle}, 1]; particleName = ToValidCSymbolString[particle]; name = ToValidCSymbolString[FlexibleSUSY`M[particle]]; If[IsMassless[particle], @@ -1361,7 +1406,7 @@ be set to the (positive) tree-level mass. M_tree "const double mass_sqr = Sqr(m_pole) + self_energy;\n\n" <> "if (mass_sqr < 0.) {\n" <> IndentText[TreeMasses`FlagPoleTachyon[particleName] <> - "return m_pole;"] <> "\n}\n\n" <> + "\nreturn m_pole;"] <> "\n}\n\n" <> "return AbsSqrt(mass_sqr);\n"; ]; Return[result <> IndentText[body] <> "}\n\n"]; @@ -1420,7 +1465,7 @@ be set to the (positive) tree-level mass. M_tree * This function finds the lightest supersymmetric particle (LSP) and * returns it's mass. The corresponding particle type is retured in * the reference parameter. The list of potential LSPs is set in the - * model file varible PotentialLSPParticles. For this model it is set + * model file variable PotentialLSPParticles. For this model it is set * to: * " <> ToString[masses] <> " * diff --git a/meta/MSSM/Mh2_3loop_DR_SQCD_to_cpp.m b/meta/MSSM/Mh2_3loop_DR_SQCD_to_cpp.m index 4854a803e8..d2578f1415 100644 --- a/meta/MSSM/Mh2_3loop_DR_SQCD_to_cpp.m +++ b/meta/MSSM/Mh2_3loop_DR_SQCD_to_cpp.m @@ -58,7 +58,7 @@ Power[x_,-5] :> 1/Symbol["pow" <> ToString[5]][x], Power[x_,-6] :> 1/Symbol["pow" <> ToString[6]][x], Log[x_] :> log[x], - PolyLog[2,x_] :> dilog[x], + PolyLog[2,x_] :> Li2[x], PolyLog[4,1/2] -> N[PolyLog[4,1/2]] }; @@ -70,7 +70,7 @@ Inactive -> Identity; impl = "\ -#include \"dilog.hpp\" +#include \"Li2.hpp\" #include #include diff --git a/meta/MSSM/as2_to_cpp.m b/meta/MSSM/as2_to_cpp.m index 81a448b191..80a7f0e139 100644 --- a/meta/MSSM/as2_to_cpp.m +++ b/meta/MSSM/as2_to_cpp.m @@ -238,11 +238,11 @@ // with the script \"as2_to_cpp.m\". #include \"" <> headerName <> "\" -#include \"dilog.hpp\" +#include \"Cl2.hpp\" +#include \"Li2.hpp\" #include #include #include -#include #include #include @@ -298,14 +298,6 @@ Real LambdaSquared(Real x, Real y) noexcept return power2(1 - x - y) - 4*x*y; } - /// ClausenCl[2,x] - Real ClausenCl2(Real x) noexcept - { - const std::complex img(0.0l, 1.0l); - - return std::imag(dilog(std::exp(img*x))); - } - /// x < 1 && y < 1, LambdaSquared(x,y) > 0 Real PhiPos(Real x, Real y) noexcept { @@ -313,8 +305,8 @@ Real PhiPos(Real x, Real y) noexcept return (-(std::log(x)*std::log(y)) + 2*std::log((1 - lambda + x - y)/2)*std::log((1 - lambda - x + y)/2) - - 2*dilog((1 - lambda + x - y)/2) - - 2*dilog((1 - lambda - x + y)/2) + - 2*Li2((1 - lambda + x - y)/2) + - 2*Li2((1 - lambda - x + y)/2) + power2(Pi)/3)/lambda; } @@ -323,9 +315,9 @@ Real PhiNeg(Real x, Real y) noexcept { const Real lambda = std::sqrt(-LambdaSquared(x,y)); - return 2*(+ ClausenCl2(2*std::acos((1 + x - y)/(2*std::sqrt(x)))) - + ClausenCl2(2*std::acos((1 - x + y)/(2*std::sqrt(y)))) - + ClausenCl2(2*std::acos((-1 + x + y)/(2*std::sqrt(x*y)))))/lambda; + return 2*(+ Cl2(2*std::acos((1 + x - y)/(2*std::sqrt(x)))) + + Cl2(2*std::acos((1 - x + y)/(2*std::sqrt(y)))) + + Cl2(2*std::acos((-1 + x + y)/(2*std::sqrt(x*y)))))/lambda; } Real Phi(Real x, Real y) noexcept diff --git a/meta/MSSM/bquark_to_cpp.m b/meta/MSSM/bquark_to_cpp.m index 0021c927d1..079b4bcc24 100644 --- a/meta/MSSM/bquark_to_cpp.m +++ b/meta/MSSM/bquark_to_cpp.m @@ -154,11 +154,11 @@ // with the script \"bquark_to_cpp.m\". #include \"" <> headerName <> "\" -#include \"dilog.hpp\" +#include \"Cl2.hpp\" +#include \"Li2.hpp\" #include #include #include -#include #include namespace flexiblesusy { @@ -205,7 +205,7 @@ bool is_equal(T a, T b, T prec = std::numeric_limits::epsilon()) noexcept return (6*(mm1*log1u + mm2*log2u) + (-mm1 - mm2)*(7 + pow2(Pi)/6) + - (mm1 - mm2)*(2*dilog(1 - mm1/mm2) + + (mm1 - mm2)*(2*Li2(1 - mm1/mm2) + pow2(log12)/2) + ((mm1 + mm2)*pow2(log12))/2 - 2*(mm1*pow2(log1u) + mm2*pow2(log2u)))/2; @@ -216,14 +216,6 @@ bool is_equal(T a, T b, T prec = std::numeric_limits::epsilon()) noexcept return pow2(1 - x - y) - 4*x*y; } - /// ClausenCl[2,x] - double ClausenCl2(double x) noexcept - { - const std::complex img(0.0, 1.0); - - return std::imag(dilog(std::exp(img*x))); - } - /// x < 1 && y < 1, LambdaSquared(x,y) > 0 double PhiPos(double x, double y) noexcept { @@ -231,8 +223,8 @@ bool is_equal(T a, T b, T prec = std::numeric_limits::epsilon()) noexcept return (-(std::log(x)*std::log(y)) + 2*std::log((1 - lambda + x - y)/2)*std::log((1 - lambda - x + y)/2) - - 2*dilog((1 - lambda + x - y)/2) - - 2*dilog((1 - lambda - x + y)/2) + - 2*Li2((1 - lambda + x - y)/2) + - 2*Li2((1 - lambda - x + y)/2) + pow2(Pi)/3)/lambda; } @@ -241,9 +233,9 @@ bool is_equal(T a, T b, T prec = std::numeric_limits::epsilon()) noexcept { const double lambda = std::sqrt(-LambdaSquared(x,y)); - return 2*(+ ClausenCl2(2*std::acos((1 + x - y)/(2*std::sqrt(x)))) - + ClausenCl2(2*std::acos((1 - x + y)/(2*std::sqrt(y)))) - + ClausenCl2(2*std::acos((-1 + x + y)/(2*std::sqrt(x*y)))))/lambda; + return 2*(+ Cl2(2*std::acos((1 + x - y)/(2*std::sqrt(x)))) + + Cl2(2*std::acos((1 - x + y)/(2*std::sqrt(y)))) + + Cl2(2*std::acos((-1 + x + y)/(2*std::sqrt(x*y)))))/lambda; } double Phi(double x, double y) noexcept diff --git a/meta/MSSM/tau_to_cpp.m b/meta/MSSM/tau_to_cpp.m index a4386acc26..5ad8053aeb 100644 --- a/meta/MSSM/tau_to_cpp.m +++ b/meta/MSSM/tau_to_cpp.m @@ -204,11 +204,11 @@ // with the script \"tau_to_cpp.m\". #include \"" <> headerName <> "\" -#include \"dilog.hpp\" +#include \"Cl2.hpp\" +#include \"Li2.hpp\" #include #include #include -#include #include #include @@ -276,7 +276,7 @@ bool is_equal_rel(T a, T b, T prec = std::numeric_limits::epsilon()) return (6*(mm1*log1u + mm2*log2u) + (-mm1 - mm2)*(7 + power2(Pi)/6) + - (mm1 - mm2)*(2*dilog(1 - mm1/mm2) + + (mm1 - mm2)*(2*Li2(1 - mm1/mm2) + power2(log12)/2) + ((mm1 + mm2)*power2(log12))/2 - 2*(mm1*power2(log1u) + mm2*power2(log2u)))/2; @@ -287,14 +287,6 @@ Real LambdaSquared(Real x, Real y) noexcept return power2(1 - x - y) - 4*x*y; } - /// ClausenCl[2,x] - Real ClausenCl2(Real x) noexcept - { - const std::complex img(0.0l, 1.0l); - - return std::imag(dilog(std::exp(img*x))); - } - /// x < 1 && y < 1, LambdaSquared(x,y) > 0 Real PhiPos(Real x, Real y) noexcept { @@ -302,8 +294,8 @@ Real PhiPos(Real x, Real y) noexcept return (-(std::log(x)*std::log(y)) + 2*std::log((1 - lambda + x - y)/2)*std::log((1 - lambda - x + y)/2) - - 2*dilog((1 - lambda + x - y)/2) - - 2*dilog((1 - lambda - x + y)/2) + - 2*Li2((1 - lambda + x - y)/2) + - 2*Li2((1 - lambda - x + y)/2) + power2(Pi)/3)/lambda; } @@ -312,9 +304,9 @@ Real PhiNeg(Real x, Real y) noexcept { const Real lambda = std::sqrt(-LambdaSquared(x,y)); - return 2*(+ ClausenCl2(2*std::acos((1 + x - y)/(2*std::sqrt(x)))) - + ClausenCl2(2*std::acos((1 - x + y)/(2*std::sqrt(y)))) - + ClausenCl2(2*std::acos((-1 + x + y)/(2*std::sqrt(x*y)))))/lambda; + return 2*(+ Cl2(2*std::acos((1 + x - y)/(2*std::sqrt(x)))) + + Cl2(2*std::acos((1 - x + y)/(2*std::sqrt(y)))) + + Cl2(2*std::acos((-1 + x + y)/(2*std::sqrt(x*y)))))/lambda; } Real Phi(Real x, Real y) noexcept diff --git a/meta/MSSM/tquark_to_cpp.m b/meta/MSSM/tquark_to_cpp.m index 9acb4a2367..cf8728a55c 100644 --- a/meta/MSSM/tquark_to_cpp.m +++ b/meta/MSSM/tquark_to_cpp.m @@ -32,7 +32,7 @@ (* SX = 2 mt Xt; s2t = SX / (mmst1 - mmst2); *) fin[0, args__] := fin[args, mmu]; -Simp[expr_] := Simplify[expr] //. +Simp[expr_, Op_:Simplify] := Op[expr] //. { Power[x_,n_] /; n > 0 :> Symbol["pow" <> ToString[n]][x], Power[x_,-2] :> 1/Symbol["pow" <> ToString[2]][x], @@ -43,7 +43,7 @@ Log[x_/y_] :> Symbol["log" <> ToString[x] <> ToString[y]] }; -ToCPP[expr_] := ToString[Simp[expr], CForm]; +ToCPP[expr_, Op_:Simplify] := ToString[Simp[expr, Op], CForm]; (* ******* calculate limits ******* *) @@ -193,7 +193,7 @@ // with the script \"tquark_to_cpp.m\". #include \"" <> headerName <> "\" -#include \"dilog.hpp\" +#include \"Li2.hpp\" #include #include @@ -258,7 +258,7 @@ bool is_equal_rel(double a, double b, double prec) noexcept return (6*(mm1*log1u + mm2*log2u) + (-mm1 - mm2)*(7 + pow2(Pi)/6.) + - (mm1 - mm2)*(2*dilog(1 - mm1/mm2) + pow2(log12)/2.) + + (mm1 - mm2)*(2*Li2(1 - mm1/mm2) + pow2(log12)/2.) + ((mm1 + mm2)*pow2(log12))/2. - 2*(mm1*pow2(log1u) + mm2*pow2(log2u)))/2.; } @@ -374,7 +374,6 @@ bool is_equal_rel(double a, double b, double prec) noexcept double dMt_over_mt_2loop_susy(const Parameters& pars) { const double g34 = pow4(pars.g3); - const double Xt = pars.xt; const double mt = pars.mt; const double mgl = shift_mg(pars.mg, pars.mst1, pars.mst2); const double mmu = pow2(pars.Q); @@ -386,8 +385,8 @@ bool is_equal_rel(double a, double b, double prec) noexcept const double SX = 2*mt*pars.xt; const double s2t = SX / (mmst1 - mmst2); - if (is_equal(mmst1, mmst2, mmt) && is_equal(mmst1, mmgl, mmt) && - is_equal(mmst1, mmsusy, mmt) && is_equal(std::abs(Xt), 0., 1e-1)) { + if (is_equal(mmst1, mmst2, mmt) && is_equal(mmst1, pow2(pars.mg), mmt) && + is_equal(mmst1, mmsusy, mmt)) { const double logmmsusymmu = std::log(mmsusy/mmu); const double logmmtmmu = std::log(mmt/mmu); @@ -404,7 +403,7 @@ bool is_equal_rel(double a, double b, double prec) noexcept const double logmmglmmu = std::log(mmgl/mmu ); const double result = -" <> WrapLines @ IndentText[ToCPP[t2l - t2lqcd] <> ";"] <> " +" <> WrapLines @ IndentText[ToCPP[t2l - t2lqcd, Collect[#, {g3}]&] <> ";"] <> " return result * g34 * twoLoop; } diff --git a/meta/NPointFunctions.m b/meta/NPointFunctions.m index 02121976b6..4b5bb85562 100644 --- a/meta/NPointFunctions.m +++ b/meta/NPointFunctions.m @@ -20,1057 +20,475 @@ *) -(*@assumptions: -1) there are no quartic gluon vertices inside diagrams => one can calculate -colour factor for diagram separately from Lorentz factor -2) 4-point vertices are not supported *) BeginPackage@"NPointFunctions`"; -If[!ValueQ[Model`Name], - Print["Error: Model`Name is not defined. Did you call SARAH`Start[\"Model\"]?"]; - Quit[1]; -]; - -LoopLevel::usage= -"Option for NPointFunctions`NPointFunction[]. -Encodes the loop level at which to calculate amplitudes. - -def. 1 | 0"; -Regularize::usage= -"Option for NPointFunctions`NPointFunction[]. -Encodes the regularization scheme to be used. - -DimensionalReduction | DimensionalRegularization"; -UseCache::usage= -"Option for NPointFunctions`NPointFunction[]. -Cache and reuse the expressions generated by FeynArts/FormCalc. -@note @todo there is no difference between different KeepProcesses and -OnShellFlag values - -def. True | False"; -ZeroExternalMomenta::usage= -"Option for NPointFunctions`NPointFunction[]. -Encodes whether to set the external momenta to zero or leave them undetermined. - -def. True | False | OperatorsOnly"; -OnShellFlag::usage= -"Option for NPointFunctions`NPointFunction[]. -Use on-shell external fields or not. - -def. True | False"; - -KeepProcesses::usage= -"Option for NPointFunctions`NPointFunction[]. -Keep specific processes in FeynArts. - -def. {} | Any sublist of @todo"; -Irreducible::usage= -"Possible value for KeepProcesses. -Exclude irreducible topologies."; -Triangles::usage= -"Possible value for KeepProcesses. -Exclude all topologies except triangle ones."; -FourFermionScalarPenguins::usage= -"Possible value for KeepProcesses. -Exclude all processes except 4-fermion penguins with scalar propagating from -one fermionic chain to another one. -Keep -1) triangle-like topologies; -2) \"self-energy\" diagrams on external fermionic lines -amplitudes."; -FourFermionMassiveVectorPenguins::usage= -"Possible value for KeepProcesses. -Exclude all processes except 4-fermion penguins with massive vector propagating -from one fermionic chain to another one. -Keep -1) triangle-like topologies; -2) \"self-energy\" diagrams on external fermionic lines -amplitudes."; -FourFermionFlavourChangingBoxes::usage= -"Possible value for KeepProcesses. -Exclude all processes except 4-fermion boxes with massive vector bosons."; - -DimensionalReduction::usage= -"Possible value for the Regularize option - -(Technically, a wrapper for FlexibleSUSY`.`DRbar)"; -DimensionalRegularization::usage= -"Possible value for the Regularize option - -(Technically, a wrapper for FlexibleSUSY`.`MSbar)"; - -GenericS::usage= -"A symbol that acts as a placeholder for any scalar field."; -GenericF::usage= -"A symbol that acts as a placeholder for any fermion field."; -GenericV::usage= -"A symbol that acts as a placeholder for any vector field."; -GenericU::usage= -"A symbol that acts as a placeholder for any ghost field."; - -GenericSum::usage= -"Represent a sum over a set of generic fields."; -GenericIndex::usage= -"Represent an index of a generic field."; -LorentzIndex::usage= -"Represent a Lorentz index of a generic field."; - -(*functions*) -{NPointFunction,VerticesForNPointFunction,CreateCXXHeaders,CreateCXXFunctions, -CreateCXXFToFConversionInNucleus}; +VerticesForNPointFunction; +CreateCXXHeaders; +CreateCXXFunctions; +NPFDefinitions; +GetProcess; +GetSubexpressions; +GetGenericSums; +GetParticleName; +NPointFunction; +IsNPointFunction; +ApplySubexpressions; SetAttributes[ { - LoopLevel,Regularize,UseCache,ZeroExternalMomenta,OnShellFlag,OperatorsOnly, - KeepProcesses, - DimensionalReduction,DimensionalRegularization, - Irreducible,Triangles, - GenericS,GenericF,GenericV,GenericU, - GenericSum,GenericIndex,LorentzIndex - }, - {Locked,Protected}]; - -NPointFunctions`internal`contextPath = $ContextPath; -$ContextPath = {"NPointFunctions`","System`"}; -Begin["`internal`"]; -(* ============================== Type definitions ========================== *) -Module[ - { - allParticles = TreeMasses`GetParticles[], - dimensionfullConverter = If[TreeMasses`GetDimension@#>1,#[{_Symbol}],#] &, - conjConverter = Through[Sequence[Susyno`LieGroups`conj,#&][#]] &, - barConverter = Through[Sequence[SARAH`bar,#&][#]] &, - scalarList,fermionList,vectorList + LoopLevel, Regularize, UseCache, ZeroExternalMomenta, OnShellFlag, + OperatorsOnly, ExceptLoops, KeepProcesses, Irreducible, Triangles, + GenericS, GenericF, GenericV, GenericU, GenericSum, GenericIndex, + LorentzIndex, Mat, DiracChain, Observable }, - scalarList = Join[ - dimensionfullConverter /@ Cases[allParticles, _?TreeMasses`IsRealScalar], - conjConverter /@ dimensionfullConverter /@ Cases[allParticles, _?TreeMasses`IsComplexScalar] - ]; - fermionList = Join[ - dimensionfullConverter /@ Cases[allParticles, _?TreeMasses`IsMajoranaFermion], - barConverter /@ dimensionfullConverter /@ Cases[allParticles, _?TreeMasses`IsDiracFermion] - ]; - vectorList = Join[ - dimensionfullConverter /@ Cases[allParticles, _?TreeMasses`IsRealVector], - conjConverter /@ dimensionfullConverter /@ Cases[allParticles, _?TreeMasses`IsComplexVector] - ]; - `type`scalarField = Alternatives @@ scalarList; - `type`fermionField = Alternatives @@ fermionList; - `type`vectorField = Alternatives @@ vectorList; - `type`physicalField = Alternatives @@ Join[scalarList,fermionList,vectorList]; - {`type`scalarField,`type`fermionField,`type`vectorField,`type`physicalField} ~ SetAttributes ~ {Locked,Protected}; + {Protected} ]; -`type`wilsonBasis = {Rule[_String,_]..}; -`type`colourProjector = Identity|SARAH`Delta; +Begin@"`Private`"; + +IsWilsonBasis[list_] := MatchQ[list, {Rule[_String,_]..}]; -`type`genericField = +IsParticle[p_] := Or[TreeMasses`IsScalar@p, TreeMasses`IsFermion@p, TreeMasses`IsVector@p, TreeMasses`IsGhost@p]; + +IsGenericParticle[field_] := MatchQ[field, (GenericS | GenericF | GenericV | GenericU)[GenericIndex[_Integer]] | SARAH`bar[(GenericF | GenericU)[GenericIndex[_Integer]]] | - Susyno`LieGroups`conj[(GenericS | GenericV)[GenericIndex[_Integer]]]; -`type`process = {{__},{__}}; -`type`subexpressions = {Rule[_Symbol,_]...}; -`type`summation = {{`type`genericField,_}..}; -`type`genericSum = GenericSum[{__},`type`summation]; -`type`classFields = {{__}..}; -`type`classCombinatoricalFactors = {__Integer}; -`type`classColorFactors = {__}; -`type`npf = - { - `type`process, - { - { - {`type`genericSum..}, - {`type`classFields..}, - {`type`classCombinatoricalFactors..}, - {`type`classColorFactors..} - }, - `type`subexpressions - } -}; + Susyno`LieGroups`conj[(GenericS | GenericV)[GenericIndex[_Integer]]] +]; -`type`cxxToken = _String?(StringMatchQ[#,RegularExpression@"@[^@\n]+@"]&); -`type`cxxReplacementRules = {Rule[`type`cxxToken,_String]..}; +IsSubexpressions[list_] := MatchQ[list, {Rule[_Symbol,_]...}]; -`subkernel`message::errNoTopologies = -"No topologies are generated for a given set of options."; -`subkernel`message::errNoDiagrams = -"No diagrams are generated for a given set of options."; +IsSummation[list_] := MatchQ[list, {{_?IsGenericParticle, _}..}]; -`subkernel`error[message_] := Utils`AssertOrQuit[False,message]; -`subkernel`error // Utils`MakeUnknownInputDefinition; -`subkernel`error ~ SetAttributes ~ {Locked,Protected,HoldFirst}; +IsGenericSum[sum_] := MatchQ[sum, GenericSum[{__}, _?IsSummation]]; -`cxx`getLength[obj:`type`wilsonBasis] := ToString@Length@obj; -`cxx`getLength // Utils`MakeUnknownInputDefinition; -`cxx`getLength ~ SetAttributes ~ {Locked,Protected}; +IsClassFields[list_] := MatchQ[list, {{__}..}]; -getDirectories[] := -Module[{}, - { - { - #1, - #3, - FlexibleSUSY`$flexiblesusyMetaDir - }, - { - FileNameJoin@{#2,SARAH`ModelName<>ToString@FlexibleSUSY`FSEigenstates}, - FileNameJoin@{#2,"ParticleNamesFeynArts.dat"}, - FileNameJoin@{#2,"ParticleNamespaces.m"}, - FileNameJoin@{#2,StringJoin["Substitutions-",SARAH`ModelName,ToString@FlexibleSUSY`FSEigenstates,".m"]} - } - }&@@({FileNameJoin@{#,"NPointFunctions"},FileNameJoin@{#,"FeynArts"},FileNameJoin@{#,"FormCalc"}}&[FileNameJoin@{SARAH`$sarahCurrentOutputMainDir,ToString@FlexibleSUSY`FSEigenstates}]) -]; -getDirectories // Utils`MakeUnknownInputDefinition; -getDirectories ~ SetAttributes ~ {Locked,Protected}; - -getIndent[obj:_String] := -First@StringCases[obj,StartOfString~~"\n"...~~indent:" "...:>indent]; -getIndent[obj:{__String}] := -First/@StringCases[obj,StartOfString~~"\n"...~~indent:" "...:>indent]; -getIndent // Utils`MakeUnknownInputDefinition; -getIndent ~ SetAttributes ~ {Locked,Protected}; - -getConjugated[obj:`type`genericField] := Switch[Head@obj, - SARAH`bar | Susyno`LieGroups`conj, obj[[1]], - GenericS | GenericV, Susyno`LieGroups`conj@obj, - GenericF | GenericU, SARAH`bar@obj -]; -getConjugated[obj:`type`scalarField|`type`vectorField] := - Susyno`LieGroups`conj@obj; -getConjugated[obj:`type`fermionField] := - SARAH`bar@obj; -getConjugated // Utils`MakeUnknownInputDefinition; -getConjugated ~ SetAttributes ~ {Locked,Protected}; - -getIndex[obj:`type`genericField] := -(obj /. {SARAH`bar->Identity,Susyno`LieGroups`conj->Identity})[[1,1]]; -getIndex // Utils`MakeUnknownInputDefinition; -getIndex ~ SetAttributes ~ {Locked,Protected}; - -removeIndent[obj:_String] := StringReplace[obj,StartOfLine~~getIndent[obj]->""]; -removeIndent // Utils`MakeUnknownInputDefinition; -removeIndent ~ SetAttributes ~ {Locked,Protected}; - -replaceTokens[code:_String, rules:`type`cxxReplacementRules] := -StringJoin[ - StringReplace[#,"\n"->StringJoin["\n",getIndent@#]] &/@ StringReplace[StringSplit[removeIndent@code,"\n"],rules]~Riffle~"\n"]; -replaceTokens // Utils`MakeUnknownInputDefinition; -replaceTokens ~ SetAttributes ~ {Locked,Protected}; - -getProcess[obj:`type`npf] := obj[[1]]; -getProcess // Utils`MakeUnknownInputDefinition; -getProcess ~ SetAttributes ~ {Locked,Protected}; - -getExternalMomenta[obj:`type`npf] := -DeleteDuplicates@Cases[{getGenericSums@obj,getSubexpressions@obj},HoldPattern@SARAH`Mom[_Integer,___],Infinity]; -getExternalMomenta // Utils`MakeUnknownInputDefinition; -getExternalMomenta ~ SetAttributes ~ {Locked,Protected}; - -getExternalIndices[obj:`type`npf] := -DeleteDuplicates@Flatten@Level[getProcess@obj,{4,5}]; -getExternalIndices // Utils`MakeUnknownInputDefinition; -getExternalIndices ~ SetAttributes ~ {Locked,Protected}; - -getGenericSums::errSimpleOnly = -"Only the case without subexpressions is supported."; -getGenericSums::errBadIndex = -"Specified index(es) `1` is (are) outside the allowed region `2`."; -getGenericSums[obj:`type`npf] := obj[[2,1,1]]; -getGenericSums[obj:`type`npf, int:{__Integer}] := -Module[{unique = DeleteDuplicates@int}, - { - getProcess@obj, - { - { - getGenericSums[obj][[unique]], - getClassFields[obj][[unique]], - getClassCombinatoricalFactors[obj][[unique]], - getClassColorFactors[obj][[unique]] - }, - getSubexpressions@obj - } - } -] /; And[ - Utils`AssertOrQuit[getSubexpressions@obj == {},getGenericSums::errSimpleOnly], - Utils`AssertOrQuit[containsQ[#,int],getGenericSums::errBadIndex,int,#]&[getIndexRange[getClassCombinatoricalFactors@obj]] -]; -getGenericSums // Utils`MakeUnknownInputDefinition; -getGenericSums ~ SetAttributes ~ {Locked,Protected}; +IsCombinatoricalFactors[list_] := MatchQ[list, {__Integer}]; -getIndexRange[obj:{___}] := {1, Length@obj}; -getIndexRange // Utils`MakeUnknownInputDefinition; -getIndexRange ~ SetAttributes ~ {Locked,Protected}; +IsColorProjector[function_] := MatchQ[function, Identity|SARAH`Delta]; -containsQ[obj:{_Integer,_Integer}, int:_Integer] := IntervalMemberQ[Interval@obj,int]; -containsQ[obj:{_Integer,_Integer}, int:{__Integer}] := And@@(containsQ[obj,#]&/@int); -containsQ // Utils`MakeUnknownInputDefinition; -containsQ ~ SetAttributes ~ {Locked,Protected}; +IsColorFactors[list_] := MatchQ[list, {__}]; -getClassFields[obj:`type`npf] := obj[[2,1,2]]; -getClassFields // Utils`MakeUnknownInputDefinition; -getClassFields ~ SetAttributes ~ {Locked,Protected}; +IsNPointFunction[e_] := MatchQ[e, {{{__}, {__}}, {{{__?IsGenericSum}, {__?IsClassFields}, {__?IsCombinatoricalFactors}, {__?IsColorFactors}}, _?IsSubexpressions}}]; -getClassCombinatoricalFactors[obj:`type`npf] := obj[[2,1,3]]; -getClassCombinatoricalFactors // Utils`MakeUnknownInputDefinition; -getClassCombinatoricalFactors ~ SetAttributes ~ {Locked,Protected}; +secure::usage = "Make sure that imput of important functions is secured."; +secure[sym_Symbol] := Protect@Evaluate@Utils`MakeUnknownInputDefinition@sym; +secure // secure; -getClassColorFactors[obj:`type`npf] := obj[[2,1,4]]; -getClassColorFactors // Utils`MakeUnknownInputDefinition; -getClassColorFactors ~ SetAttributes ~ {Locked,Protected}; +GetIndex[obj_?IsGenericParticle] := First@Level[obj, {-1}]; +GetIndex // secure; -getSubexpressions[obj:`type`npf] := obj[[2,2]]; -getSubexpressions // Utils`MakeUnknownInputDefinition; -getSubexpressions ~ SetAttributes ~ {Locked,Protected}; +GetLength[obj_?IsWilsonBasis] := ToString@Length@obj; +GetLength // secure; -getName[obj:`type`physicalField] := -Module[{nakedField=obj /. {SARAH`bar->Identity,Susyno`LieGroups`conj->Identity}}, - Switch[nakedField, - _Symbol,nakedField, - (_Symbol)[{_Symbol}],Head@nakedField] -]; -getName[obj:`type`genericField] := -Head[obj /. {SARAH`bar->Identity,Susyno`LieGroups`conj->Identity}]; -getName // Utils`MakeUnknownInputDefinition; -getName ~ SetAttributes ~ {Locked,Protected}; +GetProcess[obj_?IsNPointFunction] := obj[[1]]; +GetProcess // secure; -cxxName[obj:`type`genericField] := -Switch[Head@obj, - SARAH`bar,"typename bar<"<>ToString[obj[[1,0]]]<>ToString[obj[[1,1,1]]]<>">::type", - Susyno`LieGroups`conj,"typename conj<"<>ToString[obj[[1,0]]]<>ToString[obj[[1,1,1]]]<>">::type", - _,ToString[obj[[0]]]<>ToString[obj[[1,1]]] +GetExternalMomenta[obj_?IsNPointFunction] := +DeleteDuplicates@Cases[ + {GetGenericSums@obj, GetSubexpressions@obj}, + HoldPattern@SARAH`Mom[_Integer, ___], + Infinity ]; -cxxName // Utils`MakeUnknownInputDefinition; -cxxName ~ SetAttributes ~ {Locked,Protected}; +GetExternalMomenta // secure; -`cxx`getIndex[obj:`type`physicalField] := -Module[{nakedField=obj /. {SARAH`bar->Identity,Susyno`LieGroups`conj->Identity}}, - Switch[nakedField, - _Symbol,"", - (_Symbol)[{_Symbol}],StringDrop[ToString[nakedField[[1, 1]]],2]] +GetExternalIndices[obj_?IsNPointFunction] := DeleteDuplicates@Flatten@Level[GetProcess@obj, {4, 5}]; +GetExternalIndices // secure; + +GetIndexRange[obj_List] := {1, Length@obj}; +GetIndexRange // secure; + +GetClassFields[obj_?IsNPointFunction] := obj[[2, 1, 2]]; +GetClassFields // secure; + +GetCombinatoricalFactors[obj_?IsNPointFunction] := obj[[2, 1, 3]]; +GetCombinatoricalFactors // secure; + +GetColorFactors[obj_?IsNPointFunction] := obj[[2, 1, 4]]; +GetColorFactors // secure; + +GetSubexpressions[obj_?IsNPointFunction] := obj[[2, 2]]; +GetSubexpressions // secure; + +GetGenericSums[obj_?IsNPointFunction] := obj[[2, 1, 1]]; +GetGenericSums // secure; + +GetParticleName[particle_?IsParticle] := + CXXDiagrams`RemoveLorentzConjugation[particle] /. {_@n_@_List :> n, n_@_List :> n, _@n_ :> n}; +GetParticleName[particle_?IsGenericParticle] := + CXXDiagrams`RemoveLorentzConjugation[particle] /. {n_@_ :> n}; +GetParticleName // secure; + +GetGenericFields[obj_?IsSummation] := First/@obj; +GetGenericFields[obj_?IsGenericSum] := First/@Last[obj]; +GetGenericFields[list:{__?IsGenericSum}] := GetGenericFields/@list; +GetGenericFields // secure; + +GetSumExpression[obj_?IsGenericSum] := First@obj; +GetSumExpression // secure; + +GetSumParticles[obj_?IsGenericSum] := Last@obj; +GetSumParticles // secure; + +GetClassFieldRules[obj_?IsNPointFunction] := +MapThread[ + Function[fields,MapThread[Rule,{#1,fields}]]/@#2&, + {GetGenericFields@GetGenericSums@obj, GetClassFields@obj} ]; -`cxx`getIndex // Utils`MakeUnknownInputDefinition; -`cxx`getIndex ~ SetAttributes ~ {Locked,Protected}; - -cxxIndex[obj:`type`genericField] := -"indices"<>StringTake[SymbolName[obj[[0]]],-1]<>ToString[obj[[1,1]]] &@ CXXDiagrams`RemoveLorentzConjugation[obj]; -cxxIndex // Utils`MakeUnknownInputDefinition; -cxxIndex ~ SetAttributes ~ {Locked,Protected}; - -getGenericFields[obj:`type`genericSum] := First/@Last[obj]; -getGenericFields[obj:`type`summation] := First/@obj; -getGenericFields[objs:{`type`genericSum..}] := (First/@Last@#)&/@objs; -getGenericFields // Utils`MakeUnknownInputDefinition; -getGenericFields ~ SetAttributes ~ {Locked,Protected}; - -getExpression[obj:`type`genericSum] := First@obj; -getExpression // Utils`MakeUnknownInputDefinition; -getExpression ~ SetAttributes ~ {Locked,Protected}; - -getSummationData[obj:`type`genericSum] := Last@obj; -getSummationData // Utils`MakeUnknownInputDefinition; -getSummationData ~ SetAttributes ~ {Locked,Protected}; - -getClassFieldRules[obj:`type`npf] := -MapThread[Function[fields,MapThread[Rule,{#1,fields}]]/@#2&,{getGenericFields@getGenericSums@obj,getClassFields@obj}]; -getClassFieldRules // Utils`MakeUnknownInputDefinition; -getClassFieldRules ~ SetAttributes ~ {Locked,Protected}; - -setSubexpressions[obj:`type`npf, newsubs:`type`subexpressions] := ReplacePart[obj,{2,2}->newsubs]; -setSubexpressions // Utils`MakeUnknownInputDefinition; -setSubexpressions ~ SetAttributes ~ {Locked,Protected}; - -applySubexpressions[obj:`type`npf] := +GetClassFieldRules // secure; + +SetSubexpressions[old_?IsNPointFunction, new_?IsSubexpressions] := ReplacePart[old, {2, 2} -> new]; +SetSubexpressions // secure; + +ApplySubexpressions[obj_?IsNPointFunction] := Module[{result}, - WriteString["stdout"~OutputStream~1,"Applying subexpressions ... "]; - result = ReplacePart[obj,{2,1,1}->ReplaceRepeated[getGenericSums@obj,getSubexpressions@obj]]~setSubexpressions~{}; - WriteString["stdout"~OutputStream~1,"done\n"]; + If[{} === GetSubexpressions@obj, Return@obj]; + WriteString[$Output, "Applying subexpressions ... "]; + result = SetSubexpressions[ + ReplacePart[ + obj, + {2, 1, 1} -> ReplaceRepeated[GetGenericSums@obj, GetSubexpressions@obj] + ], + {} + ]; + WriteString[$Output, "done\n"]; result ]; -applySubexpressions // Utils`MakeUnknownInputDefinition; -applySubexpressions ~ SetAttributes ~ {Locked,Protected}; - -CreateCXXFToFConversionInNucleus::usage= -"@todo"; -CreateCXXFToFConversionInNucleus::errFermion= -"Input should be - -> or { { -> }.. } -and not -`1`"; -CreateCXXFToFConversionInNucleus[{{}}] := {{},"",""}; -CreateCXXFToFConversionInNucleus[arg:{{_->_}..}] := -Module[ - { - data = CreateCXXFToFConversionInNucleus@@#&/@arg, - vertices,header,code - }, - vertices = DeleteDuplicates[Join@@(data[[All,1]])]; - header = data[[1,2]]; - code = StringRiffle[data[[All,3]],"\n\n"]; - {vertices,header,code} -]; -CreateCXXFToFConversionInNucleus[inF_->outF_] := -Module[ - { - nameForUpQuarkClass = "zpinguins_u"<>ToString@inF<>ToString@outF<>"_1loop", - nameForUpDownClass = "zpinguins_d"<>ToString@inF<>ToString@outF<>"_1loop", - header, - fiG, foG, uiG, uoG, (* particle | incoming/outgoing | with generation *) - regulator, - inner = SARAH`sum[i_,1,4,SARAH`g[i_,i_]*SARAH`Mom[#1,i_]*SARAH`Mom[#2,i_]]&, - uQ=SARAH`UpQuark,uNPF, - dQ=SARAH`DownQuark, dNPF, - dimension6Template, - l=SARAH`Lorentz, p=SARAH`Mom, m=SARAH`Mass, - sp, - codeU,codeD, - dressedU,dressedD,assumptionReplacements - }, - header=CreateCXXHeaders[]; - sp[particle_,num_] := SARAH`DiracSpinor[#,p@num,m@#] &@ particle@{Symbol["SARAH`gt"<>ToString@num]}; - - Print["Analytical calculation for ",inF,"->",outF," started ..."]; - uNPF = NPointFunction[{inF,uQ},{outF,uQ}, - OnShellFlag -> True, - UseCache -> False, - ZeroExternalMomenta -> OperatorsOnly, - KeepProcesses -> - {FourFermionMassiveVectorPenguins,FourFermionScalarPenguins,FourFermionFlavourChangingBoxes}]; - dNPF = NPointFunction[{inF,dQ},{outF,dQ}, - OnShellFlag -> True, - UseCache -> False, - ZeroExternalMomenta -> OperatorsOnly, - KeepProcesses -> - {FourFermionMassiveVectorPenguins,FourFermionScalarPenguins,FourFermionFlavourChangingBoxes}]; - - { fiG, uiG, foG, uoG } = Flatten@getProcess@uNPF; - { fiG, diG, foG, doG } = Flatten@getProcess@dNPF; - regulator = m@fiG^2; - assumptionReplacements = - { - inner[fiG,foG] :> m@fiG^2, - inner[uiG,fiG] :> m@fiG*Sqrt[m@uiG^2+regulator], - inner[uoG,fiG] :> inner[uiG,fiG], - inner[uoG,foG] :> m@fiG^2/2+inner[uiG,fiG], - inner[diG,fiG] :> m@fiG*Sqrt[m@diG^2+regulator], - inner[doG,fiG] :> inner[diG,fiG], - inner[doG,foG] :> m@fiG^2/2+inner[diG,fiG] - }; - {uNPF,dNPF} = {uNPF,dNPF} //. assumptionReplacements; - - Print["Analytical calculation for ",inF,"->",outF," done."]; - dimension6Template[i_,o_,q_] := - { - (*@note 6 means PR, 7 means PL.*) - ("S_LL_via_"<>ToString@q) -> dc[o~sp~3,7,i~sp~1] dc[q~sp~4,7,q~sp~2], - ("S_LR_via_"<>ToString@q) -> dc[o~sp~3,7,i~sp~1] dc[q~sp~4,6,q~sp~2], - ("S_RL_via_"<>ToString@q) -> dc[o~sp~3,6,i~sp~1] dc[q~sp~4,7,q~sp~2], - ("S_RR_via_"<>ToString@q) -> dc[o~sp~3,6,i~sp~1] dc[q~sp~4,6,q~sp~2], - (*@note Q: why names of coeffients are not correct? A: they are - *correct, one just need to commute projectors with Dirac matrices, - *what changes 6 to 7 or 7 to 6.*) - ("V_LL_via_"<>ToString@q) -> dc[o~sp~3,6,l@1,i~sp~1] dc[q~sp~4,6,l@1,q~sp~2], - ("V_LR_via_"<>ToString@q) -> dc[o~sp~3,6,l@1,i~sp~1] dc[q~sp~4,7,l@1,q~sp~2], - ("V_RL_via_"<>ToString@q) -> dc[o~sp~3,7,l@1,i~sp~1] dc[q~sp~4,6,l@1,q~sp~2], - ("V_RR_via_"<>ToString@q) -> dc[o~sp~3,7,l@1,i~sp~1] dc[q~sp~4,7,l@1,q~sp~2], - (*@note Q: why minus? A: because FormCalc`s -6,Lor[1],Lor[2] is ours - *-I*sigma[1,2] (according to FC definition of antisymmetrization), when - *taking this twice we get I*I=-1. @todo one really need to check "I conventions" - *for FC because it cites [Ni05] for Fierz identities, where our - *conventions are used, but in FC manual on the page 20 weird convention for sigma_munu is shown.*) - ("minus_T_LL_via_"<>ToString@q) -> dc[o~sp~3,-7,l@1,l@2,i~sp~1] dc[q~sp~4,-7,l@1,l@2,q~sp~2], - ("minus_T_RR_via_"<>ToString@q) -> dc[o~sp~3,-6,l@1,l@2,i~sp~1] dc[q~sp~4,-6,l@1,l@2,q~sp~2] - }; - uNPF = uNPF~WilsonCoeffs`InterfaceToMatching~dimension6Template[inF,outF,uQ]; - dNPF = dNPF~WilsonCoeffs`InterfaceToMatching~dimension6Template[inF,outF,dQ]; - - Print["C++ code calculation for ",inF,"->",outF," started ..."]; - codeU = CreateCXXFunctions[uNPF, - nameForUpQuarkClass, - SARAH`Delta, - dimension6Template[inF,outF,uQ] ][[2]]; - codeD = CreateCXXFunctions[dNPF, - nameForUpDownClass, - SARAH`Delta, - dimension6Template[inF,outF,dQ] ][[2]]; - Print["C++ code calculation for ",inF,"->",outF," done."]; +ApplySubexpressions // secure; + +subWrite[str_String] := WriteString[$Output, str]; +subWrite // secure; + +OutputPaths[] := Module[{outputPath, eigenstates = ToString@FlexibleSUSY`FSEigenstates}, + outputPath = {SARAH`$sarahCurrentOutputMainDir, eigenstates}; + FileNameJoin@*Flatten /@ { - DeleteDuplicates@Join[VerticesForNPointFunction@uNPF,VerticesForNPointFunction@dNPF], - header, - codeU<>"\n\n"<>codeD + {outputPath, "NPointFunctions"}, + {outputPath, "FormCalc"}, + {outputPath, "FeynArts", SARAH`ModelName<>eigenstates}, + {outputPath, "FeynArts", "ParticleNamesFeynArts.dat"}, + {outputPath, "FeynArts", "ParticleNamespaces.m"} } -] /; Utils`AssertOrQuit[ - TrueQ@@And/@TreeMasses`IsFermion@{inF,outF}, - CreateCXXFToFConversionInNucleus::errFermion, - inF->outF]; -CreateCXXFToFConversionInNucleus // Utils`MakeUnknownInputDefinition; -CreateCXXFToFConversionInNucleus ~ SetAttributes ~ {Locked,Protected}; - -Options[NPointFunction]={ - LoopLevel -> 1, - Regularize -> Switch[FlexibleSUSY`FSRenormalizationScheme, - FlexibleSUSY`DRbar, DimensionalReduction, - FlexibleSUSY`MSbar, DimensionalRegularization], - UseCache -> True, - ZeroExternalMomenta -> True, - OnShellFlag -> True, - KeepProcesses -> {} -}; -NPointFunction::usage= -"@brief Calculate the n-point correlation function for a List of incoming and -a List of outgoing fields. -@param inFields a List of incoming fields -@param outFields a List of outgoing fields -@param LoopLevel the loop level at which to perform the calculation -@param Regularize the regularization scheme to apply -@param UseCache whether to attempt to read and write the result from and to -the cache. -@param ZeroExternalMomenta whether to set the external momenta to zero or leave -them undetermined. -@param KeepProcesses a list or single symbol of topologies to keep when -calculation the n-point correlation function -@returns the corresponding n-point correlation function -@note only a loop level of 1 is currently supported -@note the recognized regularization schemes are: - - DimensionalReduction - - DimensionalRegularization -@note when not setting the external momenta to zero one should use LoopTools -for the evaluation of the loop functions."; -NPointFunction::errinFields= -"The element '`1`' of inFields is an incorrect one. - -inFields should contain only names from the list of `2` particles -`3`. -(SARAH`.`bar for fermions and Susyno`.`LieGroups`.`conj for scalars is -acceptable as well) -@note now only restricted set is supported"; -NPointFunction::erroutFields= -"The element '`1`' of outFields is an incorrect one. - -outFields should contain only names from the list of `2` particles -`3`. -@note now only restricted set is supported"; -NPointFunction::errLoopLevel= -"Incorrect number of loops. - -Only loop level 1 is supported"; -NPointFunction::errRegularize= -"Unknown regularization scheme `1`. - -Currently DimensionalReduction, DimensionalRegularization are supported."; -NPointFunction::errUseCache= -"UseCache must be either True or False."; -NPointFunction::errZeroExternalMomenta= -"ZeroExternalMomenta must be True, False or OperatorsOnly."; -NPointFunction::errOnShellFlag= -"OnShellFlag must be either True or False."; -NPointFunction::errKeepProcesses= -"KeepProcesses must be sublist of -{ - `1` -}."; -NPointFunction::errInputFields= (* @utodo modify it for usage of bosons also *) -"Only external scalars/fermions are supported (@todo FOR NOW)."; -NPointFunction::errUnknownOptions= -"Unknown option(s): -`1`. - -Currently supported options are: -`2`."; -NPointFunction[inFields_,outFields_,opts:OptionsPattern[]] := -Module[ +]; + +CheckOptionValues[opts___] := ( + Cases[{opts}, + Rule[First@#, v_] :> + Utils`AssertOrQuit[MatchQ[v, Alternatives@@Last@#], NPointFunction::errOption, v, First@#, Last@#] + ] &/@ { - loopLevel = OptionValue[LoopLevel], - regularizationScheme = OptionValue[Regularize], - zeroExternalMomenta = OptionValue[ZeroExternalMomenta], - excludeProcesses = OptionValue[KeepProcesses], (*@todo is not checked yet!*) - onShellFlag = OptionValue[OnShellFlag], - nPointFunctionsDir,feynArtsModel,particleNamesFile, - particleNamespaceFile,substitutionsFile,formCalcDir,fsMetaDir, - subKernel, - currentPath, currentDirectory, - inFANames,outFANames, - nPointFunction + OnShellFlag -> {True, False}, + UseCache -> {True, False}, + ZeroExternalMomenta -> {True, False, OperatorsOnly, ExceptLoops}, + KeepProcesses -> {{__Symbol}}, + LoopLevel -> {0, 1}, + Observable -> {None, _[___]}, + Regularize -> {FlexibleSUSY`MSbar, FlexibleSUSY`DRbar} + }; + True +); + +NPointFunction::errOption = "Value `1` for `2` option must match any from `3`."; +NPointFunction[ + inFields: {__?(TreeMasses`IsScalar@# || TreeMasses`IsFermion@# || TreeMasses`IsVector@# &)}, + outFields:{__?(TreeMasses`IsScalar@# || TreeMasses`IsFermion@# || TreeMasses`IsVector@# &)}, + opts:___ /; CheckOptionValues@opts +] := +Module[{ + npfDir, fcDir, faModel, particleNamesFile, + particleNamespaceFile, kernel, currentDirectory, + npf, metaInfo = {{inFields, outFields}, {opts}} }, - { - {nPointFunctionsDir,formCalcDir,fsMetaDir}, - {feynArtsModel,particleNamesFile,particleNamespaceFile,substitutionsFile} - } = getDirectories[]; - - If[!DirectoryQ@nPointFunctionsDir,CreateDirectory@nPointFunctionsDir]; - If[OptionValue@UseCache, - nPointFunction = CachedNPointFunction[ - inFields,outFields,nPointFunctionsDir, - OptionValue[NPointFunction,Options[NPointFunction][[All, 1]]]]; - If[nPointFunction =!= Null, Return@nPointFunction] + {npfDir, fcDir, faModel, particleNamesFile, particleNamespaceFile} = OutputPaths[]; + If[DirectoryQ@npfDir === False, CreateDirectory@npfDir]; + If[Utils`FSGetOption[{opts}, UseCache], + npf = GetCache[inFields, outFields, npfDir, metaInfo]; + If[npf =!= Null, Return@npf]; ]; - - If[!FileExistsQ[feynArtsModel <> ".mod"], - subKernel = LaunchSubkernelFor@"creation of FeynArts model file"; - GenerateFAModelFileOnKernel@subKernel; (*generates .dat .mod .m files insiide FeynArts directory*) - WriteParticleNamespaceFile@particleNamespaceFile; - CloseKernels@subKernel; + If[FileExistsQ[faModel <> ".mod"] === False, + {kernel} = LaunchKernels@1; + WriteModelFile@kernel; + WriteNamespaceFile@particleNamespaceFile; + CloseKernels@kernel; ]; - subKernel = LaunchSubkernelFor@"FormCalc code generation"; - - inFANames = FANamesForFields[inFields, particleNamesFile]; - outFANames = FANamesForFields[outFields, particleNamesFile]; - - currentPath = $Path; - currentDirectory = Directory[]; + {kernel} = LaunchKernels@1; + SetSharedFunction[subWrite, Print]; + With[{path = $Path, + data = {fcDir, faModel, particleNamesFile, particleNamespaceFile, + ToFeynArtsFields[inFields, particleNamesFile], + ToFeynArtsFields[outFields, particleNamesFile] + }, + options = {Utils`FSGetOption[{opts}, Observable], + Utils`FSGetOption[{opts}, LoopLevel], + SymbolName/@If[List=!=Head@#, {#}, #]&@Utils`FSGetOption[{opts}, KeepProcesses], + Utils`FSGetOption[{opts}, ZeroExternalMomenta], + Utils`FSGetOption[{opts}, OnShellFlag], + Utils`FSGetOption[{opts}, Regularize] + }, + meta = FlexibleSUSY`$flexiblesusyMetaDir + }, + npf = DeleteZeroGenericSum@ParallelEvaluate[ + $Path = path; + Get@FileNameJoin@{meta, "NPointFunctions", "NPointFunction.m"}; + NPointFunction[data, options], + kernel, + DistributedContexts -> None + ]; + ]; + CloseKernels@kernel; + UnsetShared[subWrite, Print]; - DistributeDefinitions[currentPath, currentDirectory, - fsMetaDir, formCalcDir, feynArtsModel, - particleNamesFile, substitutionsFile, particleNamespaceFile, - inFANames, outFANames, loopLevel, regularizationScheme, - zeroExternalMomenta, excludeProcesses, onShellFlag]; + WriteCache[npf, npfDir, metaInfo]; + npf +]; +NPointFunction // secure; - SetSharedFunction[subWrite,Print]; - nPointFunction = RemoveEmptyGenSums@ParallelEvaluate[ - $Path = currentPath; - SetDirectory@currentDirectory; - Get@FileNameJoin@{fsMetaDir, "NPointFunctions", "internal.m"}; - - NPointFunctions`SetInitialValues[formCalcDir, feynArtsModel, - particleNamesFile, substitutionsFile, particleNamespaceFile]; - - NPointFunctions`NPointFunctionFAFC[ - ToExpression@inFANames, ToExpression@outFANames, - LoopLevel -> loopLevel, - Regularize -> regularizationScheme, - ZeroExternalMomenta -> zeroExternalMomenta, - KeepProcesses -> excludeProcesses, - OnShellFlag -> onShellFlag], - subKernel +VerticesForNPointFunction[obj_?IsNPointFunction] := +Module[{v, getVertex}, + getVertex[vertGen_, rules_] := vertGen/.#&/@rules; + v = DeleteDuplicates[ + Cases[#, SARAH`Cp[f__] :> {f}, Infinity, Heads->True] &/@ GetGenericSums@obj ]; - CloseKernels@subKernel; - UnsetShared[subWrite,Print]; - - If[OptionValue@UseCache,CacheNPointFunction[ - nPointFunction,nPointFunctionsDir, - OptionValue[NPointFunction,Options[NPointFunction][[All,1]]]]]; - - nPointFunction -] /; internalNPointFunctionInputCheck[inFields,outFields,opts]; -NPointFunction // Utils`MakeUnknownInputDefinition; -NPointFunction ~ SetAttributes ~ {Locked,Protected}; - -subWrite::usage = -"@brief Prints a string. -@note SetSharedFunction is not working with Locked or ReadProtected attributes. -@note SetSharedFunction does not cause names leaking."; -subWrite[str_String] := WriteString["stdout"~OutputStream~1,str]; -subWrite ~ SetAttributes ~ {Protected}; - -internalNPointFunctionInputCheck[inFields:{__},outFields:{__},opts___] := -Module[ - { - aoq = Utils`AssertOrQuit, - ip = TreeMasses`IsParticle, - allowedParticles = Cases[TreeMasses`GetParticles[],_?TreeMasses`IsScalar|_?TreeMasses`IsFermion],(*@todo add |_?TreeMasses`IsVector*) - definedOptions = Part[Options@NPointFunction,All,1], - unknownOptions = FilterRules[{opts},Except@Part[Options@NPointFunction,All,1]], - allProcesses={Irreducible,FourFermionFlavourChangingBoxes,Triangles,FourFermionScalarPenguins,FourFermionMassiveVectorPenguins,FourFermionFlavourChangingBoxes} - }, - aoq[ip@#,NPointFunction::errinFields,#,GetSARAHModelName[],allowedParticles]&/@inFields; - aoq[ip@#,NPointFunction::erroutFields,#,GetSARAHModelName[],allowedParticles]&/@outFields; - aoq[TreeMasses`IsScalar@#||TreeMasses`IsFermion@#,NPointFunction::errInputFields]&/@Join[inFields,outFields];(*@todo add vector bosons.*) - aoq[unknownOptions === {},NPointFunction::errUnknownOptions,unknownOptions,definedOptions]; - (*Now we know that all options are iside allowed list.*) - Cases[{opts},Rule[LoopLevel,x_]:> - aoq[x===1,NPointFunction::errLoopLevel]]; - Cases[{opts},Rule[Regularize,x_]:> - aoq[MemberQ[{DimensionalReduction,DimensionalRegularization},x],NPointFunction::errRegularize,x]]; - Cases[{opts},Rule[UseCache,x_]:> - aoq[x===True || x===False,NPointFunction::errUseCache]]; - Cases[{opts},Rule[ZeroExternalMomenta,x_]:> - aoq[MemberQ[{True,False,OperatorsOnly},x],NPointFunction::errZeroExternalMomenta]]; - Cases[{opts},Rule[OnShellFlag,x_]:> - aoq[x===True || x===False,NPointFunction::errOnShellFlag]]; - Cases[{opts},Rule[KeepProcesses,x_]:> - aoq[And@@Map[MemberQ[allProcesses~Append~Null,#]&,If[Head@x===List,x,{x}]],NPointFunction::errKeepProcesses,StringJoin@Riffle[ToString/@allProcesses,",\n "]]]; - True -]; -internalNPointFunctionInputCheck // Utils`MakeUnknownInputDefinition; -internalNPointFunctionInputCheck ~ SetAttributes ~ {Locked,Protected}; - -VerticesForNPointFunction::usage= -"@brief Return a list of all vertices needed to calculate a given -n-point correlation function. -@param nPointFunction the given n-point correlation function -@returns a list of all vertices needed to calculate a given -n-point correlation function.temp"; -VerticesForNPointFunction[obj:`type`npf] := -Module[ - { - genSums = getGenericSums@obj, - substitutions = getSubexpressions@obj, - classRules = getClassFieldRules@obj, - positionsSubsWithVert = - DeleteDuplicates[#[[1]] &/@ Position[getSubexpressions@obj, SARAH`Cp[__]]], - rulesWithVertices,vertsGen,GetVertex - }, - rulesWithVertices = substitutions[[positionsSubsWithVert]]; - GetVertex[vertGen_,rules_] := vertGen/.#&/@rules; - vertsGen = DeleteDuplicates@Cases[#, SARAH`Cp[fields__] :> {fields}, - Infinity,Heads -> True] &/@ (genSums/.rulesWithVertices); - DeleteDuplicates[Vertices`StripFieldIndices/@#&/@Flatten[MapThread[GetVertex,{vertsGen,classRules}],2]] -]; -VerticesForNPointFunction // Utils`MakeUnknownInputDefinition; -VerticesForNPointFunction ~ SetAttributes ~ {Locked,Protected}; - -GetSARAHModelName::usage= -"@brief Return the SARAH model name as to be passed to SARAH`.`Start[]. -@returns the SARAH model name as to be passed to SARAH`.`Start[]."; -GetSARAHModelName[] := -If[SARAH`submodeldir =!= False, - SARAH`modelDir <> "-" <> SARAH`submodeldir, - SARAH`modelDir + DeleteDuplicates[ + Vertices`StripFieldIndices/@ #&/@ Flatten[MapThread[getVertex, {v, GetClassFieldRules@obj}], 2] + ] ]; -GetSARAHModelName // Utils`MakeUnknownInputDefinition; -GetSARAHModelName ~ SetAttributes ~ {Locked,Protected}; - -LaunchSubkernelFor::usage= -"@brief Tries to launch a subkernel without errors. -If it fails, tries to explain the reason using message for specifying its -activity. -@param message String, which contains description of activity for which this -subkernel is launched for. -@returns subkernel name. -@note Mathematica 7 returns KernelObject[__], 11.3 returns {KernelObject[__]} -@note for Mathematica 7 some functions have the same names as in SARAH`.`"; -LaunchSubkernelFor::errKernelLaunch= -"Unable to launch subkernel(s) during calculations for -`1` -because of error:"; -LaunchSubkernelFor[message_String] /; $VersionNumber===7.0 := -Module[{kernelName}, - Off[Parallel`Preferences`add::shdw, - Parallel`Preferences`set::shdw, - Parallel`Preferences`list::shdw, - Parallel`Preferences`tr::shdw, - Parallel`Protected`processes::shdw, - SubKernels`Description::shdw]; - kernelName = Utils`EvaluateOrQuit[ - LaunchKernels[1], - LaunchSubkernelFor::errKernelLaunch, message]; - On[Parallel`Preferences`add::shdw, - Parallel`Preferences`set::shdw, - Parallel`Preferences`list::shdw, - Parallel`Preferences`tr::shdw, - Parallel`Protected`processes::shdw, - SubKernels`Description::shdw]; - kernelName +VerticesForNPointFunction // secure; + +With[{dir = DirectoryName@$InputFileName}, +CacheNameForMeta[meta:{__}] := +Module[{inFields, outFields, dirMod = "", obsDir}, + inFields = meta[[1, 1]]; + outFields = meta[[1, 2]]; + opts = SortBy[Cases[meta[[2]], _Rule], First]; + obsDir = FileNameJoin@{dir, "Observables", SymbolName@Head@Utils`FSGetOption[opts, Observable]}; + If[DirectoryQ@obsDir, + dirMod = "modtime" <> DateString@FileDate[obsDir, "Modification"]; + ]; + StringReplace[ + Utils`StringJoinWithSeparator[ + Flatten@{inFields, "to", outFields, (#/.x_Symbol :> SymbolName@x)&/@Last/@opts , dirMod}, + "_", + ToString + ] <> ".m", + {" " -> "", ":" -> "-", "Blank[]" -> "_"} + ] ]; -LaunchSubkernelFor[message_String] := -Module[{kernelName}, - kernelName = Utils`EvaluateOrQuit[ - LaunchKernels[1], - LaunchSubkernelFor::errKernelLaunch, message]; - If[Head@kernelName === List, kernelName[[1]], kernelName] +CacheNameForMeta // secure; ]; -LaunchSubkernelFor // Utils`MakeUnknownInputDefinition; -LaunchSubkernelFor ~ SetAttributes ~ {Locked,Protected}; - -CacheNameForMeta::usage= -"@brief Return the name of the cache file for given meta information -@param nPointMeta the given meta information -@returns the name of the cache file for given meta information. -"; -CacheNameForMeta[nPointMeta:{__}] := - StringJoin["cache_",Riffle[ToString/@Flatten@nPointMeta, "_"],".m"]; -CacheNameForMeta // Utils`MakeUnknownInputDefinition; -CacheNameForMeta ~ SetAttributes ~ {Locked,Protected}; - -CacheNPointFunction::usage= -"@brief Write a given n-point correlation function to the cache -@param nPointFunction the given n-point correlation function -@param cacheDir the directory to save cache -@param nPointMeta the meta information about the given n-point correlation -function"; -CacheNPointFunction[nPointFunction_,cacheDir_,nPointMeta:{__}] := -Module[ - { - nPointFunctionsFile = FileNameJoin@{cacheDir,CacheNameForMeta@nPointMeta}, - fileHandle, - nPointFunctions, - position - }, - If[FileExistsQ@nPointFunctionsFile, - nPointFunctions = Get@nPointFunctionsFile, - nPointFunctions = {} - ]; - position = Position[nPointFunctions[[All,1]],nPointFunction[[1]]]; +WriteCache[new_, dir_, meta_] := +Module[{path, file, npfs, iosition}, + path = FileNameJoin@{dir, CacheNameForMeta@meta}; + If[FileExistsQ@path, + npfs = Get@path;, + npfs = {}; + ]; + position = Position[npfs[[All,1]], new[[1]]]; If[Length@position === 1, - nPointFunctions[[position[[1]]]] = nPointFunction, - AppendTo[nPointFunctions, nPointFunction] + npfs[[position[[1]]]] = new;, + AppendTo[npfs, new]; ]; - - fileHandle = OpenWrite@nPointFunctionsFile; - Write[fileHandle,nPointFunctions]; - Close@fileHandle; + file = OpenWrite@path; + Write[file, npfs]; + Close@file; ]; -CacheNPointFunction // Utils`MakeUnknownInputDefinition; -CacheNPointFunction ~ SetAttributes ~ {Locked,Protected}; - -CachedNPointFunction::usage= -"@brief Retrieve an n-point correlation function from the cache -@param inFields the incoming fields of the n-point correlation function -@param outFields the outgoing fields of the n-point correlation function -@param cacheDir the directory to save cache -@param nPointMeta the meta information of the n-point correlation function -@returns the corresponding n-point correalation function from the -cache or `Null` if such a function could not be found. -"; -CachedNPointFunction[inFields_,outFields_,cacheDir_,nPointMeta:{__}] := -Module[ - { - nPointFunctionsFile = FileNameJoin@{cacheDir,CacheNameForMeta@nPointMeta}, - nPointFunctions, - position - }, - If[!FileExistsQ@nPointFunctionsFile,Return@Null]; +WriteCache // secure; + +GetCache[inFields_, outFields_, cacheDir_, meta_] := +Module[{nPointFunctionsFile, nPointFunctions, position}, + nPointFunctionsFile = FileNameJoin@{cacheDir, CacheNameForMeta@meta}; + If[FileExistsQ@nPointFunctionsFile === False, + Return@Null + ]; nPointFunctions = Get@nPointFunctionsFile; - position = Position[Vertices`StripFieldIndices[ nPointFunctions[[All,1]] ], - {inFields, outFields}]; - If[Length@position == 1,nPointFunctions[[ position[[1,1]] ]],Null] + position = Position[ + Vertices`StripFieldIndices@nPointFunctions[[All,1]], + {inFields, outFields} + ]; + If[Length@position == 1, nPointFunctions[[position[[1,1]]]], Null] ]; -CachedNPointFunction // Utils`MakeUnknownInputDefinition; -CachedNPointFunction ~ SetAttributes ~ {Locked,Protected}; +GetCache // secure; -GenerateFAModelFileOnKernel::usage= -"@brief Generate the FeynArts model file on a given subkernel."; -GenerateFAModelFileOnKernel[kernel:_Parallel`Kernels`kernel|_KernelObject] := -Module[ - { - currentPath = $Path, +WriteModelFile[kernel_] := +With[{currentPath = $Path, currentDir = Directory[], - fsMetaDir = FlexibleSUSY`$flexiblesusyMetaDir, + metaDir = FlexibleSUSY`$flexiblesusyMetaDir, sarahInputDirs = SARAH`SARAH@SARAH`InputDirectories, sarahOutputDir = SARAH`SARAH@SARAH`OutputDirectory, - SARAHModelName = GetSARAHModelName[], + SARAHModelName = If[SARAH`submodeldir =!= False, + SARAH`modelDir <> "-" <> SARAH`submodeldir, + SARAH`modelDir + ], eigenstates = FlexibleSUSY`FSEigenstates }, - DistributeDefinitions[currentPath, currentDir, fsMetaDir, sarahInputDirs, - sarahOutputDir, SARAHModelName, eigenstates]; - + Print["Generating FeynArts model file ..."]; + SetSharedFunction[Print]; ParallelEvaluate[ $Path = currentPath; SetDirectory@currentDir; - Get@FileNameJoin@{fsMetaDir, "NPointFunctions", "createFAModelFile.m"}; - NPointFunctions`CreateFAModelFile[sarahInputDirs,sarahOutputDir, - SARAHModelName, eigenstates];, - kernel]; + Get@FileNameJoin@{metaDir, "NPointFunctions", "MakeModelFile.m"}; + NPointFunctions`MakeModelFile[sarahInputDirs,sarahOutputDir, SARAHModelName, eigenstates];, + kernel, + DistributedContexts -> None + ]; + UnsetShared[Print]; + Print["Generating FeynArts model file ... done"]; ]; -GenerateFAModelFileOnKernel // Utils`MakeUnknownInputDefinition; -GenerateFAModelFileOnKernel ~ SetAttributes ~ {Locked,Protected}; - -WriteParticleNamespaceFile::usage= -"@brief Write a file containing all field names and the contexts in which they -live in Mathematica. -@note This is necessary because SARAH puts fields into different contexts."; -WriteParticleNamespaceFile[fileName_String] := + +WriteNamespaceFile[fileName_String] := Module[{fileHandle = OpenWrite@fileName}, - Write[fileHandle, {ToString@#, Context@#} & /@ TreeMasses`GetParticles[]]; + Write[fileHandle, {ToString@#, Context@#}&/@ TreeMasses`GetParticles[]]; Close@fileHandle; ]; -WriteParticleNamespaceFile // Utils`MakeUnknownInputDefinition; -WriteParticleNamespaceFile ~ SetAttributes ~ {Locked,Protected}; - -FANamesForFields::usage= -"@brief Translate SARAH-style fields to FeynArts-style fields -@param fields List of SARAH-style fields -@param particleNamesFile the path to the SARAH-created FeynArts -particle names file. -@returns A list of the FeynArts names (as strings) for the given -SARAH-style fields."; -FANamesForFields::errSARAH= -"NpointFunctions`.`Private`.`FANamesForFields[]: SARAH`.`: -It seems that SARAH`.` has changed conventions for -.dat file."; -FANamesForFields[fields_,particleNamesFile_String] := -Module[ - { - uniqueFields = DeleteDuplicates[ - CXXDiagrams`RemoveLorentzConjugation@# &/@ fields], - faFieldNames - }, - faFieldNames = - Flatten[ - StringCases[Utils`ReadLinesInFile@particleNamesFile, - ToString@# ~~ ": " ~~ x__ ~~ "]" ~~ ___ :> "FeynArts`" <> x <> "]" - ] & /@ uniqueFields - ]; - Utils`AssertWithMessage[Length@faFieldNames > 0, - FANamesForFields::errSARAH]; - fields /. MapThread[Rule, {uniqueFields, faFieldNames}] /. +ToFeynArtsFields[fields_, namesFile_String] := +Module[{unique, faNames}, + unique = DeleteDuplicates[CXXDiagrams`RemoveLorentzConjugation/@fields]; + faNames = Flatten[ + StringCases[Utils`ReadLinesInFile@namesFile, + SymbolName@# ~~ ": " ~~ x__ ~~ "]" ~~ ___ :> "FeynArts`" <> x <> "]" + ]&/@ unique + ]; + fields /. MapThread[Rule, {unique, faNames}] /. { SARAH`bar@field_String :> "-" <> field, Susyno`LieGroups`conj@field_String :> "-" <> field } ]; -FANamesForFields // Utils`MakeUnknownInputDefinition; -FANamesForFields ~ SetAttributes ~ {Locked,Protected}; - -RemoveEmptyGenSums::usage= -"@brief Sometimes after FA+FC calculation some generic sums are empty. This -means that one can simply remove them (as well as corresponding -colour/combinatoric factors and field substitution rules). This work is done by -this function. -@param npfObject NPF object to clean. -@returns cleaned from empty GenericSums npfObject."; -RemoveEmptyGenSums[npfObject:`type`npf]:=npfObject; -RemoveEmptyGenSums[ - {fields:{{__},{__}}, - { - { - sums:{GenericSum[_,{___}]..}, - rules:{{{__}..}..}, - comb:{{__Integer}..}, - col:{{__}..} - }, - subs:{Rule[_,_]...} - } - }]:= -Module[{poss=Position[sums,GenericSum[{0},{}]]}, - Print["Removing zero GenericSum at positions ", - StringRiffle[ToString/@Flatten@poss,", "],"."]; - {fields,{Delete[#,poss]&/@{sums,rules,comb,col},subs}} + +DeleteZeroGenericSum[npf_?IsNPointFunction] := npf; +DeleteZeroGenericSum[{fields_, {{sums_, rules_, comb_, col_}, subs_}}]:= +Module[{pos = Position[sums, GenericSum[{0}, {}]]}, + Print["Removing zero GenericSum"]; + {fields, {Delete[#,pos]&/@{sums,rules,comb,col}, subs}} +]; +DeleteZeroGenericSum // secure; + +LorentzConjugation[obj_?IsGenericParticle] := +Switch[Head@obj, + SARAH`bar | Susyno`LieGroups`conj, CXXDiagrams`RemoveLorentzConjugation@obj, + GenericS | GenericV, Susyno`LieGroups`conj@obj, + GenericF | GenericU, SARAH`bar@obj +]; +LorentzConjugation[obj_?TreeMasses`IsScalar|_?TreeMasses`IsVector] := Susyno`LieGroups`conj@obj; +LorentzConjugation[obj_?TreeMasses`IsFermion] := SARAH`bar@obj; +LorentzConjugation // secure; + +CXXIndex[obj_?IsGenericParticle] := + "i"<>StringTake[SymbolName[obj[[0]]], -1]<>ToString[obj[[1, 1]]] &@ LorentzConjugation@obj; +CXXIndex[obj:_?IsParticle] := +Module[{nakedField}, + nakedField = CXXDiagrams`RemoveLorentzConjugation@obj; + Switch[nakedField, + _Symbol, "", + (_Symbol)[{_Symbol}], StringDrop[ToString[nakedField[[1, 1]]], 2]] ]; -RemoveEmptyGenSums // Utils`MakeUnknownInputDefinition; -RemoveEmptyGenSums ~ SetAttributes ~ {Locked,Protected}; +CXXIndex // secure; -CreateCXXHeaders::usage= -"@brief Create the c++ code for the necessary headers. -@returns The c++ code for the necessary headers."; CreateCXXHeaders[] := -replaceTokens[" +TextFormatting`ReplaceCXXTokens[" #include \"loop_libraries/loop_library.hpp\" #include \"cxx_qft/@ModelName@_npointfunctions_wilsoncoeffs.hpp\" #include \"concatenate.hpp\" #include + #include #include - #include ", - { - "@ModelName@"->FlexibleSUSY`FSModelName - } + #include \"wrappers.hpp\" + ", + {"@ModelName@" -> FlexibleSUSY`FSModelName} ]; -CreateCXXHeaders // Utils`MakeUnknownInputDefinition; -CreateCXXHeaders ~ SetAttributes ~ {Locked,Protected}; - -CreateCXXFunctions::usage= -"@brief Given a list of n-point correllation functions, a list -of c++ function names and a list of colour factor projections -create the c++ code for the numerical evaluation of the -n-point correllation functions. -@param npf n-point correlation function object. -@param name function name -@param colourProjector Colour projection function that represents color structure -of ampitudes. -@param wilsonBasis Basis for matching. -@returns a list of the form `{prototypes, definitions}` containing -the corresponding c++ code."; -CreateCXXFunctions::errNoMatch= -"Length of basis and the given NPF one does not match." +CreateCXXHeaders // secure; + CreateCXXFunctions[ - npf:`type`npf, - name:_String, - colourProjector:`type`colourProjector, - wilsonBasis:`type`wilsonBasis:{"value"->"dummy string"} -] := -Module[ + npf_?IsNPointFunction, + functionName_String, + colorProjector_?IsColorProjector, + wilsonBasis:_?IsWilsonBasis:{"value"->"dummy string"}, + skipSM:True|False:False] := +Module[{GetFunctionPrototype, prototype, definition}, + GetFunctionPrototype = StringReplace[ + "std::array, L> name(arg)", + {"L" -> GetLength@wilsonBasis, "name" -> functionName, "arg" -> #} + ]&; + SetHelperClassName@npf; + SetBasis@wilsonBasis; + SetColorProjector@colorProjector; + SetSkipSM@skipSM; + prototype = GetFunctionPrototype@GetCXXArguments[npf, Default]<>";"; + definition = TextFormatting`ReplaceCXXTokens[" + @class_body@ + + @npf_function@ { + @class_name@ helper{model, indices, momenta}; + return helper.calculate(); + }", + { + "@class_name@" -> GetHelperClassName[], + "@class_body@" -> CreateClassBody@ApplySubexpressions@npf, + "@npf_function@" -> GetFunctionPrototype@GetCXXArguments@npf + } + ]; + {prototype, definition} +]; + +CreateCXXFunctions // secure; + +NPFDefinitions[first__, basis:{__String}] := + CreateCXXFunctions[first, Rule[#, "dummy"]&/@basis][[2]]; +NPFDefinitions // secure; + +GetCXXArguments[npf_?IsNPointFunction, control_:Null] := +TextFormatting`ReplaceCXXTokens[" + const @eigenstates@ &model, + const std::array &indices, + const std::array &momenta + @default@", { - mainFunction = "std::array,"<>`cxx`getLength@wilsonBasis<>"> "<>name<>"("<>#<>")"&, - prototype,definition - }, - `current`setHelperClassName@npf; - `current`setWilsonBasis@wilsonBasis; + "@eigenstates@" -> FlexibleSUSY`FSModelName<>"_mass_eigenstates", + "@indices_length@" -> ToString@Length@GetExternalIndices@npf, + "@momenta_length@" -> ToString@Length@GetExternalMomenta@npf, + "@default@" -> If[control === Default, + "= { "<> Utils`StringJoinWithReplacement@Array["Eigen::Vector4d::Zero()", Length@GetExternalMomenta@npf]<>" }", "" + ] + } +]; +GetCXXArguments // secure; + +Module[{helperClassName, basis, projector, skipSM}, +SetHelperClassName[obj_?IsNPointFunction] := +Module[{fieldNames = Vertices`StripFieldIndices/@Join@@GetProcess[obj]}, + helperClassName = "nPoint" <> + StringJoin@Map[ToString, fieldNames/.a_[b_] :> Sequence@@{a,b}] <> "_" <> + ToString@Ceiling[10^6*AbsoluteTime[]]; +]; +SetHelperClassName // secure; +GetHelperClassName[] := helperClassName; - prototype = mainFunction@`cxx`arguments[npf,Default]<>";"; +SetBasis[obj_?IsWilsonBasis] := (basis = obj); +SetBasis // secure; +GetBasis[] := basis; - definition = - `cxx`npfClass[applySubexpressions@npf,colourProjector] <> "\n\n" <> - mainFunction@`cxx`arguments@npf <> - "{\n "<>`current`helperClassName<>" helper{ model, indices, momenta };\n return helper.calculate();\n}"; +SetColorProjector[colorProjector_?IsColorProjector] := (projector = colorProjector); +SetColorProjector // secure; +GetColorProjector[] := projector; - {prototype, definition} -] /; -And@@(Utils`AssertOrQuit[Length@wilsonBasis === Length@#,CreateCXXFunctions::errNoMatch]&/@getExpression/@getGenericSums@npf); -CreateCXXFunctions // Utils`MakeUnknownInputDefinition; -CreateCXXFunctions ~ SetAttributes ~ {Locked,Protected}; - -`cxx`arguments::usage= -"@brief Returns the c++ arguments that the c++ version of the given n-point -correlation function shall take. -Default value of zero for all external momenta is chosen if the second parameter -is Default. -@param npf The given n-point correlation function -@param control String that sets up the type of argument string -@return the c++ arguments that the c++ version of the given n-point -correlation function shall take."; -`cxx`arguments[npf:`type`npf,control:Null|Default:Null] := - "const "<>#1<>" &model,"<> - " const std::array#2<>"> &indices,"<> - " const std::array#3<>"> &momenta"<> - If[control === Default," = { "<>#4<>" }",""]& [ - FlexibleSUSY`FSModelName<>"_mass_eigenstates", - ToString@Length@getExternalIndices@npf, - ToString@#, - Utils`StringJoinWithReplacement@Array["Eigen::Vector4d::Zero()",#] - ] &@ Length@getExternalMomenta@npf; -`cxx`arguments // Utils`MakeUnknownInputDefinition; -`cxx`arguments ~ SetAttributes ~ {Locked,Protected}; - -`current`wilsonBasis = {"value"->"dummy string"}; -`current`wilsonBasis ~ SetAttributes ~ {Protected}; - -`current`setWilsonBasis[obj:`type`wilsonBasis] := -( - Unprotect[`current`wilsonBasis]; - `current`wilsonBasis = obj; - Protect[`current`wilsonBasis]; -); -`current`setWilsonBasis // Utils`MakeUnknownInputDefinition; -`current`setWilsonBasis ~ SetAttributes ~ {Locked,Protected}; - -`current`helperClassName = ""; -`current`helperClassName ~ SetAttributes ~ {Protected}; - -`current`setHelperClassName::usage= -"@brief Sets the c++ name for the helper class of the c++ -version of a given n-point correlation function. -@param obj NPointFunction object -@returns the c++ name for the helper class of the c++ version of a given n-point -correlation function."; -`current`setHelperClassName[obj:`type`npf] := -Module[{fieldNames = Vertices`StripFieldIndices/@Join@@getProcess[obj]}, - Unprotect@`current`helperClassName; - `current`helperClassName = "nPoint" <> StringJoin@Map[ToString,fieldNames/.a_[b_]:>Sequence@@{a,b}] <> "_" <> ToString@Ceiling[10^6*AbsoluteTime[]]; - Protect@`current`helperClassName; +SetSkipSM[b:True|False] := (skipSM = b); +SetSkipSM // secure; +GetSkipSM[] := skipSM; ]; -`current`setHelperClassName // Utils`MakeUnknownInputDefinition; -`current`setHelperClassName ~ SetAttributes ~ {Locked,Protected}; - -`cxx`npfClass::usage= -"@brief Return the c++ code for the helper class of the c++ version of a given -n-point correlation function. -@param npf The given n-point correlation function. -@param projCol The colour factor projection to be applied for the -given n-point correlation function. -@returns The c++ code for the helper class of the c++ version of a given -n-point correlation function."; -`cxx`npfClass[npf:`type`npf, projCol:`type`colourProjector] := -Module[ - { - genSums = getGenericSums@npf, - extIndices = getExternalIndices@npf, - numberOfMomenta = Length[getExternalMomenta@npf], - genFields = DeleteDuplicates[Flatten@getClassFieldRules@npf /. Rule[x_,_] :> x], - genSumNames, - code = " + +CreateClassBody[npf_?IsNPointFunction] := +Module[{genSums, extIndices, numberOfMomenta, genFields, genSumNames}, + genSums = GetGenericSums@npf; + extIndices = GetExternalIndices@npf; + numberOfMomenta = Length[GetExternalMomenta@npf]; + genFields = DeleteDuplicates[Flatten@GetClassFieldRules@npf /. Rule[x_,_] :> x]; + genSumNames = Array["genericSum"<>ToString@#&, Length@genSums]; + SetCXXRules[extIndices, genFields]; + TextFormatting`ReplaceCXXTokens[" class @ClassName@ : public @Context@ { using generic_sum_base = @Context@; @@ -1098,704 +516,566 @@ means that one can simply remove them (as well as corresponding @CalculateFunction@ }; // End of @ClassName@" - }, - genSumNames = Array["genericSum"<>ToString@#&,Length@genSums]; - `current`setCxxRules[extIndices,genFields]; - - replaceTokens[code,{ - "@ClassName@"->`current`helperClassName, - "@Context@"->"correlation_function_context<"<>ToString@Length@extIndices<>","<>ToString@numberOfMomenta<>">", - "@KeyStructsInitialization@"->`cxx`initializeKeyStructs@genFields, - "@GenericSums@"->`cxx`genericSum[npf,projCol,genSumNames], - "@Arguments@"->`cxx`arguments@npf, - "@CalculateFunction@"->`cxx`calculateFunction@genSumNames}] + , + { + "@ClassName@" -> GetHelperClassName[], + "@Context@" -> "correlation_function_context<"<>ToString@Length@extIndices<>","<>ToString@numberOfMomenta<>">", + "@KeyStructsInitialization@" -> InitializeKeyStructs@genFields, + "@GenericSums@" -> CXXGenericSum[npf, genSumNames], + "@Arguments@" -> GetCXXArguments@npf, + "@CalculateFunction@" -> CXXCalculateFunction@genSumNames + } + ] ]; -`cxx`npfClass // Utils`MakeUnknownInputDefinition; -`cxx`npfClass ~ SetAttributes ~ {Locked,Protected}; - -`cxx`initializeKeyStructs::usage = -"@brief Generates required c++ code for key structs initialization. -@param fields List of generic fields. -@returns c++ code for subexpression if generic fields present there."; -`cxx`initializeKeyStructs[fields:{`type`genericField..}]:= - StringRiffle["struct "<>#<>" {};"&/@`cxx`genericFieldKey/@fields,"\n"]; -`cxx`initializeKeyStructs // Utils`MakeUnknownInputDefinition; -`cxx`initializeKeyStructs ~ SetAttributes ~ {Locked,Protected}; - -`current`cxxRules = {{}}; -`current`cxxRules ~ SetAttributes ~ {Protected}; - -`current`setCxxRules::usage= -"@brief Generate a list of rules for translating Mathematica expressions of -n-point correlation functions to c++ ones. -@param extIndices The external indices of an n-point correlation function. -@param genericFields The generic fields appearing in an n-point correlation function. -@returns a list of rules for translating Mathematica expressions of n-point -correlation functions to c++ ones."; -`current`setCxxRules[extIndices:{___Symbol},genericFields:{`type`genericField..}] := -Module[ - { - externalIndexRules = MapThread[Rule,{extIndices, - Array["this->external_indices("<>ToString[#-1]<>")"&,Length@extIndices]}], - AuxVertexType, - genericRules,massRules,couplingRules - }, - genericRules=Flatten[Thread@Rule[ - {getConjugated[#],#}, +CreateClassBody // secure; + +InitializeKeyStructs[fields:{__?IsGenericParticle}]:= +Utils`StringJoinWithSeparator[ + "struct "<>#<>" {};" &/@ CXXGenericKey/@fields, + "\n" +]; +InitializeKeyStructs // secure; + +Module[{rules = {{}}}, +SetCXXRules[extIdx:{___Symbol}, genericFields:{__?IsGenericParticle}] := +Module[{externalIndexRules, short, index, genericRules, massRules, couplingRules}, + externalIndexRules = MapIndexed[#1 -> "i"<>ToString@@#2&, extIdx]; + genericRules = Flatten[ { - cxxName[getConjugated@#][cxxIndex@#], - cxxName[#][cxxIndex@#] - }] &/@ genericFields]; - - AuxVertexType[fields__]:= StringRiffle[ - If[MatchQ[#,`type`genericField], - cxxName@#, - `cxx`fieldName@#]&/@{fields},", "]; - couplingRules = { - SARAH`Cp[fields__][1] :> - I*StringTemplate["context.vertex<`1`>(lorentz_scalar{}, concatenate(`2`))"][ - AuxVertexType@fields, - StringRiffle[`cxx`fieldIndices/@{fields},", "] - ], - SARAH`Cp[fields__][SARAH`PL] :> - I*StringTemplate["context.vertex<`1`>(lorentz_left{}, concatenate(`2`))"][ - AuxVertexType@fields, - StringRiffle[`cxx`fieldIndices/@{fields},", "] - ], - SARAH`Cp[fields__][SARAH`PR] :> - I*StringTemplate["context.vertex<`1`>(lorentz_right{}, concatenate(`2`))"][ - AuxVertexType@fields, - StringRiffle[`cxx`fieldIndices/@{fields},", "] - ], - SARAH`Cp[fields___][SARAH`Mom[f1_] - SARAH`Mom[f2_]] :> - I*StringTemplate["context.vertex<`1`>(lorentz_momentum_diff{`2`,`3`}, concatenate(`4`))"][ - AuxVertexType@fields, - First@@Position[{fields},f1,{1}]-1, (*@note hope that nobody call particle List*) - First@@Position[{fields},f2,{1}]-1, (*@note hope that nobody call particle List*) - StringRiffle[`cxx`fieldIndices/@{fields},", "] - ], - SARAH`Cp[fields__][SARAH`g[_,_]] :> - I*StringTemplate["context.vertex<`1`>(lorentz_inverse_metric{}, concatenate(`2`))"][ - AuxVertexType@fields, - StringRiffle[`cxx`fieldIndices/@{fields},", "] - ], - SARAH`Cp[fields__][(SARAH`Mom[f2_, _]-SARAH`Mom[f1_, _])*SARAH`g[_,_], + LorentzConjugation@# -> CXXFullFieldName[LorentzConjugation@#][CXXIndex@#], + # -> CXXFullFieldName[#][CXXIndex@#] + } &/@ genericFields + ]; + + short[fields__] := Utils`StringJoinWithSeparator[CXXShortFieldName/@{fields}, ", "]; + index[fields__] := Utils`StringJoinWithSeparator[CXXFieldIndices/@{fields}, ", "]; + couplingRules = + { + SARAH`Cp[fields__][1] :> StringJoin["NPF_S(", short@fields, ") NPF_I(", index@fields, ")"], + SARAH`Cp[fields__][SARAH`PL] :> StringJoin["NPF_L(", short@fields, ") NPF_I(", index@fields, ")"], + SARAH`Cp[fields__][SARAH`PR] :> StringJoin["NPF_R(", short@fields, ") NPF_I(", index@fields, ")"], + SARAH`Cp[s1_, s2_, v_][SARAH`Mom@s1_-SARAH`Mom@s2_] :> StringJoin["NPF_SSV(", short[s1, s2, v], ") NPF_D(0, 1) NPF_I(", index[s1, s2, v], ")"], + SARAH`Cp[s1_, s2_, v_][SARAH`Mom@s2_-SARAH`Mom@s1_] :> StringJoin["NPF_SSV(", short[s1, s2, v], ") NPF_D(1, 0) NPF_I(", index[s1, s2, v], ")"], + SARAH`Cp[fields__][SARAH`g[_,_]] :> StringJoin["NPF_G(", short@fields, ") NPF_I(", index@fields, ")"], + SARAH`Cp[fields__][ + (SARAH`Mom[f2_,_]-SARAH`Mom[f1_,_])*SARAH`g[_,_], (SARAH`Mom[f1_,_]-SARAH`Mom[f3_,_])*SARAH`g[_,_], - (SARAH`Mom[f3_,_]-SARAH`Mom[f2_,_])*SARAH`g[_,_]] :> - I*StringTemplate["context.vertex<`1`>(triple_vector{}, concatenate(`2`))"][ - AuxVertexType@fields, - StringRiffle[`cxx`fieldIndices/@{fields},", "] - ] + (SARAH`Mom[f3_,_]-SARAH`Mom[f2_,_])*SARAH`g[_,_]] :> StringJoin["NPF_T(", short@fields, ") NPF_I(", index@fields, ")"] }; + massRules = { - SARAH`Mass[genField_String[genIndex_String]] :> - "context.mass<"<>genField<>">("<>genIndex<>")", - - SARAH`Mass[extField_Symbol[{extIndex_String}]] :> - "context.massToString@extField<>">(std::array {"<>extIndex<>"})", - - SARAH`Mass[extField_Symbol] :> - "context.massToString@extField<>">(std::array {})" + SARAH`Mass[f_] :> StringJoin["context.mass<", CXXShortFieldName@f, ">(", CXXFieldIndices@f, ")"] }; - Unprotect@`current`cxxRules; - `current`cxxRules={externalIndexRules,couplingRules,genericRules,massRules}; - Protect@`current`cxxRules; + rules = {externalIndexRules, massRules, couplingRules, genericRules}; +]; +SetCXXRules // secure; + +ApplyCXXRules[obj_] := +StringReplace[ + Parameters`ExpressionToString[Fold[ReplaceAll, obj, rules]], + "\"" -> "" + ]; ]; -`current`setCxxRules // Utils`MakeUnknownInputDefinition; -`current`setCxxRules ~ SetAttributes ~ {Locked,Protected}; - -`current`applyCxxRules[obj_] := -Parameters`ExpressionToString[Fold[ReplaceAll,obj,`current`cxxRules]]; -`current`applyCxxRules // Utils`MakeUnknownInputDefinition; -`current`applyCxxRules ~ SetAttributes ~ {Locked,Protected}; - -`cxx`fieldName::usage = -"@brief Given an explicit field (possibly conjugated), returns its c++ representation. -@param The given generic field -@returns String Name of the c++ representation for a field (possibly conjugate)."; -`cxx`fieldName[SARAH`bar[head_]] := - StringJoin["typename bar<",`cxx`fieldName@head,">::type"]; -`cxx`fieldName[Susyno`LieGroups`conj[head_]] := - StringJoin["typename conj<",`cxx`fieldName@head,">::type"] -`cxx`fieldName[fieldName_Symbol[_?VectorQ] | fieldName_Symbol] := - StringJoin["fields::",SymbolName@fieldName]; -`cxx`fieldName // Utils`MakeUnknownInputDefinition; -`cxx`fieldName ~ SetAttributes ~ {Locked,Protected}; - -`cxx`fieldIndices::usage= -"@brief Return the c++ expression for the given field. -@param field The given field -@returns The c++ expression for the given field. -@note function saves its previous calls to improve the speed."; -`cxx`fieldIndices[SARAH`bar[field_]] := `cxx`fieldIndices[SARAH`bar[field]] = - `cxx`fieldIndices@field; -`cxx`fieldIndices[Susyno`LieGroups`conj[field_]] := `cxx`fieldIndices[Susyno`LieGroups`conj[field]] = - `cxx`fieldIndices@field; -`cxx`fieldIndices[head_[GenericIndex[index_Integer]]] := `cxx`fieldIndices[head[GenericIndex[index]]] = - "indices"<>StringTake[SymbolName@head,-1]<>ToString@index; -`cxx`fieldIndices[field_] := `cxx`fieldIndices[field] = -If[Length@field === 0, - "std::array()", - "std::array{"<>ToString@First@field<>"}" + +Module[{sandwich, n}, + +sandwich[f_] = Switch[Head@f, + SARAH`bar, "typename cxx_diagrams::bar<" <> # <> ">::type", + Susyno`LieGroups`conj, "typename cxx_diagrams::conj<" <> # <> ">::type", + _, #]&; + +CXXFullFieldName[f_?IsParticle] := ( + n = CXXDiagrams`RemoveLorentzConjugation@f; + sandwich[f]["fields::" <> ToString@Switch[n, _Symbol, n, _, Head@n]] +); + +CXXFullFieldName[f_?IsGenericParticle] := ( + n = CXXDiagrams`RemoveLorentzConjugation@f; + sandwich[f]["g"<>StringTake[ToString@Head@n, -1] <> ToString@GetIndex@n] +); + +CXXFullFieldName // secure; ]; -`cxx`fieldIndices // Utils`MakeUnknownInputDefinition; -`cxx`fieldIndices ~ SetAttributes ~ {Locked}; - -`cxx`genericFieldKey::usage= -"@brief Given a generic field(s), determine its key type used in the c++ code to -uniquely label it. -@param genericField given generic field. -@param {genericField..} given generic fields. -@returns c++ key type of a generic field(s)."; -`cxx`genericFieldKey[fields:{__}] := - StringRiffle[`cxx`genericFieldKey/@fields,", "]; -`cxx`genericFieldKey[head_[GenericIndex[index_Integer]]] := - ToString@head<>ToString@index<>"Key"; -`cxx`genericFieldKey // Utils`MakeUnknownInputDefinition; -`cxx`genericFieldKey ~ SetAttributes ~ {Locked,Protected}; - -getColourFactor::usage= -"@brief Extracts the colour factor for a given colour structure."; -getColourFactor::errMultipleColourStructures= -"There are different colour projectors inside colour factors: -`1`."; -getColourFactor::errNotNumber= -"After projection element -`1` -still is not a number." -getColourFactor::warnTryingIdentity= -"Warning: There are no colour projectors of the given type. Trying to apply Identity." -getColourFactor[colourfactors:{`type`classColorFactors..}, projection:`type`colourProjector] := -Module[ - { - projectedFactors,uniqueColourStructs - }, - projectedFactors= - If[projection === Identity, - colourfactors, - uniqueColourStructs=DeleteDuplicates@Cases[colourfactors,projection[__],Infinity]; - Utils`AssertOrQuit[Length@uniqueColourStructs<=1,getColourFactor::errMultipleColourStructures,uniqueColourStructs]; - If[Length@uniqueColourStructs===0, - Print[getColourFactor::warnTryingIdentity]; - colourfactors, - colourfactors/.Rule[uniqueColourStructs[[1]],1] - ] - ]; - Utils`AssertOrQuit[NumericQ@#,getColourFactor::errNotNumber,#]&/@Flatten[projectedFactors,2]; +CXXFieldIndices[SARAH`bar[field_]] := + CXXFieldIndices[SARAH`bar[field]] = + CXXFieldIndices@field; + +CXXFieldIndices[Susyno`LieGroups`conj[field_]] := + CXXFieldIndices[Susyno`LieGroups`conj[field]] = + CXXFieldIndices@field; + +CXXFieldIndices[head_[GenericIndex[index_Integer]]] := + CXXFieldIndices[head[GenericIndex[index]]] = + "i"<>StringTake[SymbolName@head, -1]<>ToString@index; + +CXXFieldIndices[field_] := CXXFieldIndices[field] = + If[Length@field === 0, "i0", field[[1, 1]]]; + +CXXFieldIndices // Utils`MakeUnknownInputDefinition; + +CXXGenericKey[fields:{__}] := Utils`StringJoinWithSeparator[fields, ", ", CXXGenericKey]; + +CXXGenericKey[head_[GenericIndex[index_Integer]]] := SymbolName@head<>ToString@index<>"Key"; + +CXXGenericKey // secure; + +RemoveNumbers[expr_] := expr /. {_Integer-> 1, _Rational-> 1, _Complex-> 1, Pi-> 1}; + +ExtractColorFactor[colorfactors:{__?IsColorFactors}, projection_?IsColorProjector] := +Module[{projectedFactors}, + projectedFactors = Switch[projection, + Identity, + colorfactors, + _, + Utils`AssertOrQuit[ + And@@Flatten[MatchQ[#, _projection]&/@#&/@ RemoveNumbers@colorfactors], + ExtractColorFactor::errMultipleStructures, + colorfactors, + projection + ]; + colorfactors /. _projection -> 1 + ]; + Utils`AssertOrQuit[ + And@@Flatten[NumericQ/@#&/@ projectedFactors], + ExtractColorFactor::errNotNumber, + projectedFactors + ]; projectedFactors ]; -getColourFactor // Utils`MakeUnknownInputDefinition; -getColourFactor ~ SetAttributes ~ {Locked,Protected}; - -`cxx`genericSum::usage= -"@brief Create the c++ code form of a generic sums. -@param obj nPointFunction object. -@param colourProjector -@param genSumNames Set of names for generic sums."; -`cxx`genericSum::errColours= -"Colour factor is not a number after projection: `1`"; -`cxx`genericSum[ - obj:`type`npf, - colourProjector:`type`colourProjector, - genSumNames:{__String} -] := -StringRiffle[MapThread[ - `cxx`genericSum[##,getSubexpressions@obj]&, +ExtractColorFactor::errMultipleStructures = "Some color factors in `1` have no head `2`."; +ExtractColorFactor::errNotNumber = "Some color factors in `1` are not numbers."; +ExtractColorFactor // secure; + +CXXGenericSum[npf_?IsNPointFunction, genSumNames:{__String}] := +Utils`StringJoinWithSeparator[ + MapThread[ + CXXGenericSum[##, GetSubexpressions@npf, npf]&, { - getGenericSums@obj, - getClassFields@obj, - getClassCombinatoricalFactors@obj, - getColourFactor[getClassColorFactors@obj,colourProjector], + GetGenericSums@npf, + GetClassFields@npf, + GetCombinatoricalFactors@npf, + ExtractColorFactor[GetColorFactors@npf, GetColorProjector[]], genSumNames } ], -"\n\n"]; -`cxx`genericSum[ - sum:`type`genericSum, - genericInsertions:`type`classFields, - combinatorialFactors:`type`classCombinatoricalFactors, - colourFactors:{__?NumericQ}, + "\n\n" +]; + +CXXGenericSum[ + sum_?IsGenericSum, + genericInsertions_?IsClassFields, + combinatorialFactors_?IsCombinatoricalFactors, + colorFactors:{__?NumericQ}, genSumName_String, - subexpressions:`type`subexpressions + subexpressions_?IsSubexpressions, + npf_?IsNPointFunction ] := -Module[ +TextFormatting`ReplaceCXXTokens[" + template + struct @GenericSum_NAME@_impl : generic_sum_base { + @GenericSum_NAME@_impl( const generic_sum_base &base ) : + generic_sum_base( base ) { + } // End of constructor @GenericSum_NAME@_impl + + std::array,@WilsonBasisLength@> operator()( void ) { + using boost::mpl::at; + using boost::fusion::at_key; + @GenericFieldShortNames@ + + @ExternalIndices@ + typename field_index_map::type index_map; + const context_with_vertices &context = *this; + @InitializeOutputVars@ + + @SummationOverGenericFields@ + + return @ReturnOutputVars@; + } // End of operator()( void ) + }; // End of struct @GenericSum_NAME@_impl + + std::array,@WilsonBasisLength@> @GenericSum_NAME@( void ) { + using GenericKeys = boost::mpl::vector< @GenericKeys@ >; + using GenericInsertions = boost::mpl::vector< + @ClassInsertions@ + >; + using combinatorial_factors = boost::mpl::vector< + @CombinatoricalFactors@ + >; + using color_factors = boost::mpl::vector< + @ColorFactors@ + >; + return accumulate_generic< + GenericKeys, + GenericInsertions, + combinatorial_factors, + color_factors, + boost::mpl::int_<@WilsonBasisLength@>, + @GenericSum_NAME@_impl + >( *this ); + } // End of function @GenericSum_NAME@()", { - code = " - template - struct @GenericSum_NAME@_impl : generic_sum_base { - @GenericSum_NAME@_impl( const generic_sum_base &base ) : - generic_sum_base( base ) { - } // End of constructor @GenericSum_NAME@_impl - - std::array,@WilsonBasisLength@> operator()( void ) { - using boost::mpl::at; - using boost::fusion::at_key; - @GenericFieldShortNames@ - - typename field_index_map::type index_map; - const context_with_vertices &context = *this; - @InitializeOutputVars@ - - @SummationOverGenericFields@ - - return @ReturnOutputVars@; - } // End of operator()( void ) - }; // End of struct @GenericSum_NAME@_impl - - std::array,@WilsonBasisLength@> @GenericSum_NAME@( void ) { - using GenericKeys = boost::mpl::vector< @GenericKeys@ >; - using GenericInsertions = boost::mpl::vector< - @ClassInsertions@ - >; - using combinatorial_factors = boost::mpl::vector< - @CombinatoricalFactors@ - >; - using colour_factors = boost::mpl::vector< - @ColorFactors@ - >; - return accumulate_generic< - GenericKeys, - GenericInsertions, - combinatorial_factors, - colour_factors, - boost::mpl::int_<@WilsonBasisLength@>, - @GenericSum_NAME@_impl - >( *this ); - } // End of function @GenericSum_NAME@()" - }, - replaceTokens[code, - { - "@GenericSum_NAME@"->genSumName, - "@GenericFieldShortNames@"->`cxx`shortNames@getGenericFields@sum, - "@InitializeOutputVars@"->StringRiffle["std::complex "<>#<>" = 0.0;"&/@First/@`current`wilsonBasis,"\n"], - "@SummationOverGenericFields@"->`cxx`changeGenericExpressions[getSummationData@sum,getExpression@sum], - "@ReturnOutputVars@"->ToString[First/@`current`wilsonBasis], - "@GenericKeys@"->`cxx`genericFieldKey@getGenericFields@sum, - "@ClassInsertions@"->`cxx`insertFields@genericInsertions, - "@CombinatoricalFactors@"->`cxx`insertFactors@combinatorialFactors, - "@ColorFactors@"->`cxx`insertColours@colourFactors, - "@WilsonBasisLength@"->`cxx`getLength@`current`wilsonBasis - } - ] + "@GenericSum_NAME@" -> genSumName, + "@GenericFieldShortNames@" -> CXXGenericAbbreviations@GetGenericFields@sum, + "@ExternalIndices@" -> InitializeExternalIndices@npf, + "@InitializeOutputVars@" -> Utils`StringJoinWithSeparator["std::complex "<>#<>" = 0.0;"&/@First/@GetBasis[],"\n"], + "@SummationOverGenericFields@" -> CXXSumOverGeneric[GetSumParticles@sum, GetSumExpression@sum], + "@ReturnOutputVars@" -> ToString[First/@GetBasis[]], + "@GenericKeys@" -> CXXGenericKey@GetGenericFields@sum, + "@ClassInsertions@" -> CXXInsertFields@genericInsertions, + "@CombinatoricalFactors@" -> CXXInsertFactors@combinatorialFactors, + "@ColorFactors@" -> CXXInsertColors@colorFactors, + "@WilsonBasisLength@" -> GetLength@GetBasis[] + } ]; -`cxx`genericSum // Utils`MakeUnknownInputDefinition; -`cxx`genericSum ~ SetAttributes ~ {Locked,Protected}; - -`cxx`changeGenericExpressions::usage = -"@brief Generates c++ code for output value updating inside generic sum. -@param summation Summation structure of generic index. -@param expr List of expressions to be converted into c++ code. -@returns c++ code for output value initializations inside generic sum."; -`cxx`changeGenericExpressions::errUnimplementedLoops = -"Unsupported loop functions -`1` -were detected."; -`cxx`changeGenericExpressions[summation:`type`summation, expr:{__}] := -Module[ - { - code =" - // The following definitions are repeated in the GenericSum multiple times. +CXXGenericSum // secure; +CXXGenericSum::errColors = "Color factor is not a number after projection: `1`"; + +InitializeExternalIndices[npf_?IsNPointFunction] := +Module[{extIndices = GetExternalIndices@npf}, + indices = Array[ + "std::array i" <> ToString@# <> + " {this->external_indices("<>ToString[#-1]<>")};\n"&, + Length@extIndices]; + If[Length@extIndices < Length[Flatten@GetProcess@npf], + PrependTo[indices, "std::array i0 {};\n"];]; + StringJoin@indices]; +InitializeExternalIndices // secure; + +CXXSumOverGeneric[summation_?IsSummation, expr:{__}] := +Module[{modifiedExpr = expr, + masses,massDefine,codeMass,massRules, + couplings,couplingDefine,codeCoupling,couplingRules, + loopRules,loopArrayDefine,loopArraySet, + cxxExpr,updatingVars, loopIdentifiers + }, + masses = Cases[modifiedExpr, _SARAH`Mass, Infinity, Heads -> True]; + {massDefine, codeMass, massRules} = NameMasses@masses; + modifiedExpr = modifiedExpr /. massRules; + + couplings = Cases[modifiedExpr, SARAH`Cp[__][___], Infinity, Heads -> True]; + {couplingDefine, codeCoupling, couplingRules} = NameCouplings@couplings; + modifiedExpr = modifiedExpr /. couplingRules; + + modifiedExpr = modifiedExpr /. LoopTools`A0[args__] :> LoopTools`A0i[LoopTools`aa0, args]; + {loopRules, loopArrayDefine, loopArraySet, loopIdentifiers} = CreateLoopFunctions@modifiedExpr; + modifiedExpr = modifiedExpr /. loopRules; + + cxxExpr = ApplyCXXRules/@modifiedExpr; + updatingVars = MapThread[#1<>" += "<>#2<>";"&, {First/@GetBasis[], cxxExpr}]; + + TextFormatting`ReplaceCXXTokens[" + // Shorter aliases for large types + @fieldAliases@ + // Aliases for loop function identifiers + @loopIdentifiers@ + @defineMasses@ @defineCouplings@ @defineLoopFunctions@ - // Start of summation over generic fields. @BeginSum@ + + @skipSMContributions@ + @setMasses@ @setCouplings@ @skipZeroAmplitude@ @setLoopFunctions@ + @ChangeOutputValues@ + @EndSum@", - modifiedExpr = expr, - masses,massDefine,codeMass,massRules, - couplings,couplingDefile,codeCoupling,couplingRules, - loopRules,loopArrayDefine,loopArraySet, - cxxExpr,updatingVars - }, - masses = Tally@Cases[modifiedExpr,_SARAH`Mass,Infinity,Heads->True]; - {massDefine,codeMass,massRules} = createUniqueDefinitions[masses,{"double","m"}]; - modifiedExpr = modifiedExpr /. massRules; + { + "@loopIdentifiers@" -> loopIdentifiers, + "@fieldAliases@" -> CXXSetFieldAliases@couplings, + "@defineMasses@" -> massDefine, + "@defineCouplings@" -> couplingDefine, + "@defineLoopFunctions@" -> loopArrayDefine, + "@BeginSum@" -> CXXGenericSumBegin@summation, + "@skipSMContributions@" -> CXXSkipSM@summation, + "@setMasses@" -> codeMass, + "@setCouplings@" -> codeCoupling, + "@skipZeroAmplitude@" -> CXXSkipZeroAmplitude[modifiedExpr, loopRules, massRules], + "@setLoopFunctions@" -> loopArraySet, + "@ChangeOutputValues@" -> Utils`StringJoinWithSeparator[updatingVars,"\n"], + "@EndSum@" -> CXXGenericSumEnd@GetGenericFields@summation + } + ] +]; +CXXSumOverGeneric::errUnimplementedLoops = "Loop functions `1` are not supported."; +CXXSumOverGeneric // secure; - couplings = Tally@Cases[modifiedExpr,SARAH`Cp[__][___],Infinity,Heads->True]; - {couplingDefile,codeCoupling,couplingRules} = createUniqueDefinitions[couplings,{"std::complex","g"}]; - modifiedExpr = modifiedExpr /. couplingRules; +CXXSetFieldAliases[couplings:{SARAH`Cp[__][___]..}] := +Module[{l = Sort@DeleteDuplicates[(Sequence@@Head@#&)/@couplings], func}, + func = If[#1 =!= #2, "using " <> #1 <> " = " <> #2 <> ";\n", ""]&; + StringJoin@MapThread[func, {CXXShortFieldName/@l, CXXFullFieldName/@l}] +]; +CXXSetFieldAliases // secure; - {loopRules,loopArrayDefine,loopArraySet,modifiedExpr} = createLoopFunctions@modifiedExpr; - - cxxExpr = `current`applyCxxRules/@modifiedExpr; - cxxExpr = StringReplace[#, "\"" -> ""]&/@cxxExpr; - updatingVars = MapThread[#1<>" += "<>#2<>";"&, {First/@`current`wilsonBasis, cxxExpr}]; - - replaceTokens[code,{ - "@defineMasses@"->massDefine, - "@defineCouplings@"->couplingDefile, - "@defineLoopFunctions@"->loopArrayDefine, - "@BeginSum@"->`cxx`beginSum@summation, - "@setMasses@"->codeMass, - "@setCouplings@"->codeCoupling, - "@skipZeroAmplitude@"->`cxx`skipZeroAmplitude[modifiedExpr,loopRules,massRules], - "@setLoopFunctions@"->loopArraySet, - "@ChangeOutputValues@"->StringRiffle[updatingVars,"\n"], - "@EndSum@"->`cxx`endSum@getGenericFields@summation - }] +Module[{c, name}, +c[f_] := Switch[Head@f, SARAH`bar|Susyno`LieGroups`conj, "_"<>#, _, #]&; +name[f_] := ToString@Switch[f, _Symbol, f, _, Head@f]; + +CXXShortFieldName[f_?IsParticle] := + c[f][name@CXXDiagrams`RemoveLorentzConjugation@f]; +CXXShortFieldName[f_?IsGenericParticle] := + c[f][CXXFullFieldName@CXXDiagrams`RemoveLorentzConjugation@f]; +CXXShortFieldName // secure; ]; -`cxx`changeGenericExpressions // Utils`MakeUnknownInputDefinition; -`cxx`changeGenericExpressions ~ SetAttributes ~ {Locked,Protected}; -createLoopFunctions[modifiedExpr:{__}] := -Module[ - { - onePoint, - onePointTemplate = - { - LoopTools`A0@@#2 -> "a"<>#1<>".at(0)", - LoopTools`A0i[LoopTools`aa0,Sequence@@#2] -> "a"<>#1<>".at(0)" - }&, +CXXLoopArray[num_Integer] := "l"<>ToString@num; +CXXLoopArray // secure; - twoPoint, - twoPointTemplate = - { - LoopTools`B0@@#2 -> "b"<>#1<>".at(0)", - LoopTools`B1@@#2 -> "b"<>#1<>".at(1)", - LoopTools`B00@@#2 -> "b"<>#1<>".at(2)", - LoopTools`B0i[LoopTools`bb0,Sequence@@#2] -> "b"<>#1<>".at(0)", - LoopTools`B0i[LoopTools`bb1,Sequence@@#2] -> "b"<>#1<>".at(1)", - LoopTools`B0i[LoopTools`bb00,Sequence@@#2] -> "b"<>#1<>".at(2)" - }&, - - threePoint, - threePointTemplate = - { - LoopTools`C0@@#2 -> "c"<>#1<>".at(0)", - LoopTools`C0i[LoopTools`cc0,Sequence@@#2] -> "c"<>#1<>".at(0)", - LoopTools`C0i[LoopTools`cc1,Sequence@@#2] -> "c"<>#1<>".at(1)", - LoopTools`C0i[LoopTools`cc2,Sequence@@#2] -> "c"<>#1<>".at(2)", - LoopTools`C0i[LoopTools`cc00,Sequence@@#2] -> "c"<>#1<>".at(3)", - LoopTools`C0i[LoopTools`cc11,Sequence@@#2] -> "c"<>#1<>".at(4)", - LoopTools`C0i[LoopTools`cc12,Sequence@@#2] -> "c"<>#1<>".at(5)", - LoopTools`C0i[LoopTools`cc22,Sequence@@#2] -> "c"<>#1<>".at(6)" - }&, - - fourPoint, - fourPointTemplate = - { - LoopTools`D0@@#2 -> "d"<>#1<>".at(0)", - LoopTools`D0i[LoopTools`dd0,Sequence@@#2] -> "d"<>#1<>".at(0)", - LoopTools`D0i[LoopTools`dd1,Sequence@@#2] -> "d"<>#1<>".at(1)", - LoopTools`D0i[LoopTools`dd2,Sequence@@#2] -> "d"<>#1<>".at(2)", - LoopTools`D0i[LoopTools`dd3,Sequence@@#2] -> "d"<>#1<>".at(3)", - LoopTools`D0i[LoopTools`dd00,Sequence@@#2] -> "d"<>#1<>".at(4)", - LoopTools`D0i[LoopTools`dd11,Sequence@@#2] -> "d"<>#1<>".at(5)", - LoopTools`D0i[LoopTools`dd12,Sequence@@#2] -> "d"<>#1<>".at(6)", - LoopTools`D0i[LoopTools`dd13,Sequence@@#2] -> "d"<>#1<>".at(7)", - LoopTools`D0i[LoopTools`dd22,Sequence@@#2] -> "d"<>#1<>".at(8)", - LoopTools`D0i[LoopTools`dd23,Sequence@@#2] -> "d"<>#1<>".at(9)", - LoopTools`D0i[LoopTools`dd33,Sequence@@#2] -> "d"<>#1<>"[10]" - }&, - - append, - loopRules = {}, - loopArrayDefine = {}, - loopArraySet = {} +CXXLoopType[sym_Symbol] := +sym /. { + LoopTools`A0i -> "looplibrary::Acoeff_t", + LoopTools`B0i -> "looplibrary::Bcoeff_t", + LoopTools`C0i -> "looplibrary::Ccoeff_t", + LoopTools`D0i -> "looplibrary::Dcoeff_t" +}; +CXXLoopType // secure; + +CXXLoopLibrary[sym_Symbol] := +sym /. { + LoopTools`A0i -> "A", + LoopTools`B0i -> "B", + LoopTools`C0i -> "C", + LoopTools`D0i -> "D" +}; +CXXLoopLibrary // secure; + +CreateLoopFunctions[modifiedExpr:{__}] := +Module[{ + all, gathered, using, loopIdentifiers, abbreviate, abbreviations, loopRules, + define, loopArrayDefine, set, loopArraySet }, - Utils`AssertOrQuit[#==={},`cxx`changeGenericExpressions::errUnimplementedLoops,Utils`StringJoinWithSeparator[#,", "]] &@ - DeleteDuplicates@Cases[modifiedExpr,Alternatives[ - _LoopTools`A00, - _LoopTools`B00,_LoopTools`B11,_LoopTools`B001,_LoopTools`B111, - _LoopTools`DB0,_LoopTools`DB1, - _LoopTools`DB00,_LoopTools`DB11, - _LoopTools`E0i,_LoopTools`E0, - _LoopTools`F0i,_LoopTools`F0],Infinity,Heads->True]; - append[loopFunctions_List,function_,functionName_String,arrayName_String] := If[loopFunctions=!={}, - AppendTo[loopArrayDefine,Array[ - "looplibrary::"<>functionName<>"coeff_t "<>arrayName<>ToString@#<>"{}"&, - Length@loopFunctions] - ]; - AppendTo[loopArraySet,Array[ - Parameters`ExpressionToString[StringJoin["Loop_library::get().",functionName][arrayName<>ToString@#,Sequence@@loopFunctions[[#,1]],"Sqr(context.scale())"]]<> - "; // It is repeated "<>ToString@loopFunctions[[#,2]]<>" times."&, - Length@loopFunctions] - ]; - AppendTo[loopRules,Join@@function@@@Array[{ToString@#,loopFunctions[[#,1]]}&,Length@loopFunctions]]; - ]; + all = DeleteDuplicates@Cases[modifiedExpr, h_@__ /; Context@h == "LoopTools`", Infinity]; + gathered = GatherBy[all, # /. _[_, a___] :> {a}&]; - onePoint = Tally@Join[ - Cases[modifiedExpr,LoopTools`A0i[_,args:__]:>{args},Infinity], - Cases[modifiedExpr,LoopTools`A0[args:__]:>{args},Infinity] - ]; + using[i_List] := i /. h_[id_, __] /; h =!= List :> "using looplibrary::" <> SymbolName@id <> ";"; + loopIdentifiers = StringRiffle[DeleteDuplicates@Flatten@Map[using, gathered], "\n"]; - twoPoint = Tally@Join[ - Cases[modifiedExpr,LoopTools`B0i[_,args:__]:>{args},Infinity], - Cases[modifiedExpr,(LoopTools`B0|LoopTools`B0)[args:__]:>{args},Infinity] - ]; + abbreviate[i_List, {num_}] := i /. h_[id_, __] /; h =!= List :> CXXLoopArray@num <> "[" <> SymbolName@id <> "]"; + abbreviations = MapIndexed[abbreviate, gathered]; + loopRules = MapThread[Rule, Flatten/@{gathered, abbreviations}]; - threePoint = Tally@Join[ - Cases[modifiedExpr,LoopTools`C0i[_,args:__]:>{args},Infinity], - Cases[modifiedExpr,(LoopTools`C0)[args:__]:>{args},Infinity] - ]; + define[{h_@__, ___}, {num_}] := CXXLoopType@h <> " " <> CXXLoopArray@num <> " {};"; + loopArrayDefine = StringRiffle[MapIndexed[define, gathered], "\n"]; + + set[{h_[_, args__], ___}, {num_}] := Parameters`ExpressionToString[StringJoin["Loop_library::get().", CXXLoopLibrary@h][CXXLoopArray@num, args, "Sqr(context.scale())"]] <> ";"; + loopArraySet = Utils`StringJoinWithReplacement[MapIndexed[set, gathered], "\n", "\""->""]; + + {loopRules, loopArrayDefine, loopArraySet, loopIdentifiers} +]; +CreateLoopFunctions // secure; - fourPoint = Tally@Join[ - Cases[modifiedExpr,LoopTools`D0i[_,args:__]:>{args},Infinity], - Cases[modifiedExpr,(LoopTools`D0)[args:__]:>{args},Infinity] +CXXSkipZeroAmplitude[ + modifiedExpr:{__}, + loopRules:{Rule[_,_]...}, + massRules:{Rule[_,_]..} +] := +Module[{massesToOne = Rule[#,1] & /@ massRules[[All,2]], + loopsToOne = {}, + result, func = "z[" <> # <> "]"& + }, + If[0 < Length@loopRules, + loopsToOne = Rule[#,1] & /@ loopRules[[All,2]] + ]; + result = RemoveNumbers[ExpandAll[modifiedExpr]] /.Plus->List/. + massesToOne/.loopsToOne; + result = DeleteDuplicates[Flatten@DeleteCases[result,1]]; + If[2 === LeafCount@result, + result = func@@result, + result = Plus@@(result/.HoldPattern[Times[x__]]:>Times@@(func@#&/@{x})) ]; + result = "if( "<> + StringReplace[Parameters`ExpressionToString@result,"\""->""]<> + " == 0 ) continue;"; + StringReplace[result, + RegularExpression["g(\\d+)"]:> ToString[ToExpression@"$1"-1] + ] +]; +CXXSkipZeroAmplitude // secure; + +CXXMassAbbreviation[(m_/; m === SARAH`Mass)[obj_?IsGenericParticle]] := +Switch[GetParticleName@obj, + GenericS, "mS", + GenericF, "mF", + GenericV, "mV", + GenericU, "mU" +]<>ToString@GetIndex@obj; + +CXXMassAbbreviation[(m_/; m === SARAH`Mass)[obj_?IsParticle]] := "m"<>ToString@GetParticleName@obj<>CXXIndex@obj; - append[onePoint,onePointTemplate,"A","a"]; - append[twoPoint,twoPointTemplate,"B","b"]; - append[threePoint,threePointTemplate,"C","c"]; - append[fourPoint,fourPointTemplate,"D","d"]; +CXXMassAbbreviation // secure; +NameMasses[masses:{__}] := +Module[{info, i, r, sortedMasses, abbr, full}, + sortedMasses = Sort@DeleteDuplicates@masses; + abbr = CXXMassAbbreviation /@ sortedMasses; + full = ApplyCXXRules /@ sortedMasses; { - Flatten@loopRules, - Utils`StringJoinWithSeparator[Join@@loopArrayDefine,";\n"]<>";\n", - Utils`StringJoinWithReplacement[Join@@loopArraySet,"\n","\""->""], - modifiedExpr/.Flatten@loopRules + "double "<>Utils`StringJoinWithSeparator[abbr, ", "]<>";", + StringJoin@MapThread[#1<>" = "<>#2<>";\n"&, {abbr, full}], + MapThread[Rule, {sortedMasses, abbr}] } ]; -createLoopFunctions // Utils`MakeUnknownInputDefinition; -createLoopFunctions ~ SetAttributes ~ {Locked,Protected}; +NameMasses // secure; -`cxx`skipZeroAmplitude[modifiedExpr:{__},loopRules:{Rule[_,_]..},massRules:{Rule[_,_]..}] := -Module[ +NameCouplings[couplings:{__}] := +Module[{sortedCpl, abbr, full, initCpl, initZero}, + sortedCpl = Sort@DeleteDuplicates@couplings; + abbr = Table["g"<>ToString@n, {n, Length@sortedCpl}]; + full = ApplyCXXRules/@sortedCpl; + + initCpl = StringJoin@MapThread[#1<>" = "<>#2<>";\n"&, {abbr, full}]; + initZero = Table["z[" <> ToString[n-1] <> "] = (std::abs(g" <> ToString@n <> ") < std::numeric_limits::epsilon())?0:1;\n", {n, Length@sortedCpl}]; + + + info = {"g"<>ToString@#, ApplyCXXRules@sort[[#,1]], sort[[#,1]], + sort[[#,2]]}&; { - numbersToOne = {_Integer->1,_Rational->1,_Complex->1,Pi->1}, - massesToOne = Rule[#,1] & /@ massRules[[All,2]], - loopsToOne = Rule[#,1] & /@ loopRules[[All,2]], - result - }, - result=ExpandAll[modifiedExpr]/.numbersToOne/.Plus->List/.massesToOne/.loopsToOne; - result = DeleteDuplicates[Flatten@DeleteCases[result,1]]; - If[ 1 === Length@result, - result = "std::abs"@@result, - result = Plus@@(result/.HoldPattern[Times[x__]]:>Times@@("std::abs"@#&/@{x})) - ]; - "if( "<>StringReplace[Parameters`ExpressionToString@result,"\""->""]<>" < std::numeric_limits::epsilon() ) continue;" + "std::complex "<>Utils`StringJoinWithSeparator[abbr, ", "]<>";\nstd::array ToString@Length@sortedCpl <> "> z{};", + initCpl <> "\n" <> initZero, + MapThread[#1 -> I*#2&, {sortedCpl, abbr}] + } ]; -`cxx`skipZeroAmplitude // Utils`MakeUnknownInputDefinition; -`cxx`skipZeroAmplitude ~ SetAttributes ~ {Locked,Protected}; - -`cxx`getVariableName[SARAH`Mass[obj:`type`genericField]] := -`cxx`getVariableName[SARAH`Mass[obj]] = -Switch[getName@obj,GenericS,"mS",GenericF,"mF",GenericV,"mV",GenericU,"mU"]<>ToString@getIndex@obj; -`cxx`getVariableName[SARAH`Mass[obj:`type`physicalField]] := -`cxx`getVariableName[SARAH`Mass[obj]] = -"m"<>ToString@getName@obj<>`cxx`getIndex@obj; -`cxx`getVariableName // Utils`MakeUnknownInputDefinition; -`cxx`getVariableName ~ SetAttributes ~ {Locked,Protected}; - -createUniqueDefinitions[expr:{{_,_Integer}..},{type_String,name_String}] := -Module[{names,namedExpr,code,rules}, - namedExpr = Array[ - { - name<>ToString@#, - `current`applyCxxRules@expr[[#,1]], - expr[[#,1]], - expr[[#,2]] - }&, - Length@expr - ]; - names = type<>" "<>StringRiffle[First/@namedExpr,", "]<>";"; - code = StringRiffle[#1<>" = "<>#2<>"; // It is repeated "<>ToString@#4<>" times."&@@@namedExpr,"\n"]; - rules = Rule@@@namedExpr[[All,{3,1}]]; - {names,StringReplace[code,"\""->""],rules} +NameCouplings // secure; + +CXXGenericAbbreviations[genFields:{__?IsGenericParticle}] := +Utils`StringJoinWithSeparator[ + Apply[ + "using "<>#1<>" = typename atToString@#2<>">::type;"&, + {CXXFullFieldName@#, CXXGenericKey@#} &/@ genFields, + {1} + ], + "\n" ]; -createUniqueDefinitions // Utils`MakeUnknownInputDefinition; -createUniqueDefinitions ~ SetAttributes ~ {Locked,Protected}; - -`cxx`shortNames::usage = -"@brief Generates c++ code for type abbreviations stored in GenericFieldMap -(Associative Sequence) at Key positions. -@param genFields List of generic fields. -@returns String c++ code for type abbreviations stored in GenericFieldMap -(Associative Sequence) at Key positions."; -`cxx`shortNames[genFields:{`type`genericField..}] := - StringRiffle[Apply[ - "using "<>ToString@#1<>" = typename atToString@#2<>">::type;"&, - {cxxName@#,`cxx`genericFieldKey@#}&/@genFields, - {1}],"\n"]; -`cxx`shortNames // Utils`MakeUnknownInputDefinition; -`cxx`shortNames ~ SetAttributes ~ {Locked,Protected}; - -`cxx`beginSum::usage = -"@brief Generates c++ code for sum beginning used inside GenericSum. -@param <{{generic field, restriction}..}> summation List of generic index -restriction rules pares, which, if are true should lead to a skip of summation. -@returns String c++ code for sum beginning used inside generic sums."; -`cxx`beginSum[summation:`type`summation]:= +CXXGenericAbbreviations // secure; + +CXXGenericSumBegin[summation_?IsSummation] := Module[{beginsOfFor}, - beginsOfFor = - "for( const auto &"<>cxxIndex[#[[1]]]<>" : "<>"index_range<"<>cxxName[#[[1]]]<>">() ) {\n"<> - "at_key<"<>`cxx`genericFieldKey@#[[1]]<>">( index_map ) = "<>cxxIndex[#[[1]]]<>";"<>parseRestrictionRule[#] &/@summation; - StringRiffle[beginsOfFor,"\n"] + beginsOfFor = "for( const auto &"<>CXXIndex[#[[1]]]<>" : "<> + "index_range<"<> CXXFullFieldName[#[[1]]]<>">() ) {\n"<> + "at_key<"<>CXXGenericKey@#[[1]]<>">( index_map ) = "<> + CXXIndex[#[[1]]]<>";"<>parseRestrictionRule[#] &/@summation; + Utils`StringJoinWithSeparator[beginsOfFor, "\n"] ]; -`cxx`beginSum // Utils`MakeUnknownInputDefinition; -`cxx`beginSum ~ SetAttributes ~ {Locked,Protected}; - -parseRestrictionRule[{genericField:`type`genericField,rule_}] := -Module[{f1,f2,getIndexOfExternalField,OrTwoDifferent}, - getIndexOfExternalField[_[_[{ind_}]]] := "std::array {"<>`current`applyCxxRules@ind<>"}"; - getIndexOfExternalField[_[{ind_}]] := "std::array {"<>`current`applyCxxRules@ind<>"}"; - getIndexOfExternalField[_] := "std::array {}"; - - OrTwoDifferent[] := Module[ - { - type1 = `cxx`fieldName@First@rule, - type2 = `cxx`fieldName@Last@rule, - ind = getIndexOfExternalField@First@rule, - typeGen = cxxName@genericField, - indGen = cxxIndex@genericField - }, - "\nif( (boost::core::is_same<"<>typeGen<>","<>type1<>">::value || boost::core::is_same<"<>typeGen<>","<>type2<>">::value) && "<>indGen<>" == "<>ind<>" ) continue;" +CXXGenericSumBegin // secure; + +CXXSkipSM[summation_?IsSummation] := +Module[{fields, indices, conditions}, + If[GetSkipSM[] === False, Return@""]; + fields = (CXXFullFieldName@First@#) &/@ summation; + indices = (CXXIndex@First@#) &/@ summation; + conditions = MapThread["cxx_diagrams::isSMField<"<>#1<>">("<>#2<>")"&, + {fields, indices} ]; - + "if (" <> + Utils`StringJoinWithSeparator[conditions, " &&\n "] <> + ") continue;" +]; +CXXSkipSM // secure; + + +parseRestrictionRule[{genericField_?IsGenericParticle,rule_}] := +Module[{f1,f2,GetIndexOfExternalField,OrTwoDifferent}, + GetIndexOfExternalField[_[_[{ind_}]]] := ApplyCXXRules@ind; + GetIndexOfExternalField[_[{ind_}]] := ApplyCXXRules@ind; + GetIndexOfExternalField[_] := "i0"; + OrTwoDifferent[] := + Module[{type1 = CXXFullFieldName@First@rule, + type2 = CXXFullFieldName@Last@rule, + ind = GetIndexOfExternalField@First@rule, + typeGen = CXXFullFieldName@genericField, + indGen = CXXIndex@genericField}, + "\nif( (std::is_same_v<"<>typeGen<>","<>type1<> + "> || std::is_same_v<"<>typeGen<>","<>type2<> + ">) && "<>indGen<>" == "<>ind<>" ) continue;"]; Switch[rule, - Or[f1_,f2_],OrTwoDifferent[], - False,"", - _,"@todo This rule is ununderstandable!";Quit[1]] + Or[f1_,f2_], + OrTwoDifferent[], + False, + "", + _, + "@todo This rule is not implemented yet!";Quit[1]]]; +parseRestrictionRule // secure; + +CXXGenericSumEnd[genFields:{__?IsGenericParticle}] := +StringJoin[ + Array["}"&,Length@genFields], + " // End of summation over generic fields" ]; -parseRestrictionRule // Utils`MakeUnknownInputDefinition; -parseRestrictionRule ~ SetAttributes ~ {Locked,Protected}; - -`cxx`endSum::usage = -"@brief Generates c++ code for end of sum over generic fields inside GenericSum. -@param genFields List of generic fields. -@returns String c++ code for end of sum over generic fields inside GenericSum."; -`cxx`endSum[genFields:{`type`genericField..}] := - StringJoin[ - Array["}"&,Length@genFields], - " // End of summation over generic fields"]; -`cxx`endSum // Utils`MakeUnknownInputDefinition; -`cxx`endSum ~ SetAttributes ~ {Locked,Protected}; - -`cxx`calculateFunction::usage = -"@brief Generates c++ code for functions which return result of generic sum -calculation. -@param genSumNames list of strings with names of generic sums. -@returns String Generates c++ code for functions which return result of generic sum -calculation."; -`cxx`calculateFunction[genSumNames:{__String}] := -Module[ - { - varName = "genericsum" (* Feel free to change me to another c++ name *), - varNames,initVars,sumOfSums - }, +CXXGenericSumEnd // secure; + +CXXCalculateFunction[genSumNames:{__String}] := +Module[{ + varName = "genericsum" (* Feel free to change me to another C++ name *), + varNames,initVars,sumOfSums}, varNames = Array[varName<>ToString@#&,Length@genSumNames]; - initVars = MapThread["const auto "<>#1<>" = "<>#2<>"();"&,{varNames,genSumNames}]~StringRiffle~"\n"; - sumOfSums = StringRiffle[#<>".at(i)"&/@varNames,"+"]; - replaceTokens[" - std::array,@BasisLength@> calculate( void ) { - std::array,@BasisLength@> genericSummation; - constexpr int coeffsLength = genericSummation.size(); - @InitializeVariablesWhichStoreGenericSumsOutput@ - - for ( std::size_t i=0; i#1<>" = "<>#2<>"();"&, {varNames, genSumNames}], + "\n" + ]; + sumOfSums = Utils`StringJoinWithSeparator[#<>"[i]"&/@varNames, "+"]; + TextFormatting`ReplaceCXXTokens[" + std::array,@BasisLength@> calculate( void ) { + std::array,@BasisLength@> genericSummation; + constexpr int coeffsLength = genericSummation.size(); + @InitializeVariablesWhichStoreGenericSumsOutput@ + + for ( std::size_t i=0; iGetLength@GetBasis[], + "@InitializeVariablesWhichStoreGenericSumsOutput@"->initVars, + "@SumOfVariables@"->sumOfSums } - return genericSummation; - } // End of calculate()", - { - "@BasisLength@"->`cxx`getLength@`current`wilsonBasis, - "@InitializeVariablesWhichStoreGenericSumsOutput@"->initVars, - "@SumOfVariables@"->sumOfSums - }] + ] ]; -`cxx`calculateFunction // Utils`MakeUnknownInputDefinition; -`cxx`calculateFunction ~ SetAttributes ~ {Locked,Protected}; - -`cxx`insertFields::usage = -"@brief Generates c++ code for class insertions inside GenericSum. -@param genInsertions list of list with SARAH particle names. -@returns String c++ code for class insertions inside GenericSum."; -`cxx`insertFields[genInsertions:`type`classFields] := - StringRiffle["boost::mpl::vector<"<>StringRiffle[`cxx`fieldName@#&/@#,", "]<>">"&/@genInsertions,",\n"]; -`cxx`insertFields // Utils`MakeUnknownInputDefinition; -`cxx`insertFields ~ SetAttributes ~ {Locked,Protected}; - -`cxx`insertFactors::usage = -"@brief Generates c++ code for combinatorical factor insertions inside GenericSum. -@param combinatorialFactors List of integers. -@returns String c++ code for combinatorical factor insertions inside GenericSum."; -`cxx`insertFactors[combinatorialFactors:`type`classCombinatoricalFactors] := - StringRiffle["boost::mpl::int_<"<>ToString@#<>">"&/@combinatorialFactors,",\n"]; -`cxx`insertFactors // Utils`MakeUnknownInputDefinition; -`cxx`insertFactors ~ SetAttributes ~ {Locked,Protected}; - -`cxx`insertColours::usage = -"@brief Generates c++ code for colour factor insertions inside GenericSum. -@param colourFactors list of numbers. -@returns String c++ code for colour factor insertions inside GenericSum."; -`cxx`insertColours[colourFactors:{__?NumberQ}] := -Module[ - { - ReRatioColourFactors = {Numerator@#,Denominator@#} &/@ Re@colourFactors, - ImRatioColourFactors = {Numerator@#,Denominator@#} &/@ Im@colourFactors +CXXCalculateFunction // secure; + +CXXInsertFields[genInsertions_?IsClassFields] := +Utils`StringJoinWithSeparator["boost::mpl::vector<"<> + Utils`StringJoinWithSeparator[CXXFullFieldName@#&/@#, ", "]<> + ">"&/@genInsertions, + ",\n" +]; +CXXInsertFields // secure; + +CXXInsertFactors[combinatorialFactors_?IsCombinatoricalFactors] := +Utils`StringJoinWithSeparator["boost::mpl::int_<"<>ToString@#<> + ">"&/@combinatorialFactors, + ",\n" +]; +CXXInsertFactors // secure; + +CXXInsertColors[colorFactors:{__?NumberQ}] := +Module[{ + ReRatioColorFactors = {Numerator@#, Denominator@#} &/@ Re@colorFactors, + ImRatioColorFactors = {Numerator@#, Denominator@#} &/@ Im@colorFactors }, - StringRiffle[ + Utils`StringJoinWithSeparator[ StringReplace[ MapThread[ "detail::complex_helper<"<> "detail::ratio_helper<"<>ToString@#1<>">,"<> "detail::ratio_helper<"<>ToString@#2 <> ">>"&, - {ReRatioColourFactors, ImRatioColourFactors}], - {"{" -> "", "}" -> ""}], - ",\n"] -]; -`cxx`insertColours // Utils`MakeUnknownInputDefinition; -`cxx`insertColours ~ SetAttributes ~ {Locked,Protected}; - -(*auxiliary functions with names of newer Mathematica versions*) -If[TrueQ[$VersionNumber<10], -StringTemplate::usage= -"This is not a full replacement of Mathematica's StringTemplate. -It works correctly only for string, containing `i` insertions with i>0"; -StringTemplate::errFailed= -"Failed for this input string -`1`"; -StringTemplate[str_String] := -Module[ - { - args = DeleteDuplicates@StringCases[str, - HoldPattern["`"~~DigitCharacter..~~"`"]], - noControlStrs = DeleteDuplicates@StringSplit[str, - "`"~~DigitCharacter~~"`"], - argRules,noControlRules,preControl,return - }, - argRules = Rule[#,"<>ToString@#"<>StringDrop[StringDrop[#,1],-1]<>"<>"] &/@ - args; - noControlRules = Rule[#,"\""<>#<>"\""] &/@ noControlStrs; - preControl = StringReplace[StringReplace[StringReplace[str, - argRules], noControlRules],"<><>"->"<>"]; - If[StringTake[str,1] === "`",preControl = StringDrop[preControl,2]]; - If[StringTake[str,-1] === "`",preControl = StringDrop[preControl,-2]]; - return=ToExpression[preControl <> "&"]; - If[return===$Failed, - Utils`AssertOrQuit[False,StringTemplate::errFailed,str], - return] -]; -StringTemplate[___] := - Utils`AssertOrQuit[False,StringTemplate::usage]; - -SetAttributes[{StringTemplate},{Protected, Locked}] -]; -If[TrueQ[$VersionNumber<10.1], -StringRiffle::usage= -"This is not a full replacement of Mathematica's StringRiffle. -It works only for [{___String},_String] input."; -StringRiffle::err="`1`"; -StringRiffle[strs:{___String},sep_String] := - StringJoin@Riffle[strs,sep]; -StringRiffle[strs:{___String},{in_String,sep_String,fin_String}] := - in<>StringJoin@Riffle[strs,sep]<>fin; -StringRiffle[x___] := - Utils`AssertOrQuit[False,StringRiffle::err,{x}]; - -SetAttributes[{StringRiffle},{Protected, Locked}] + {ReRatioColorFactors, ImRatioColorFactors} + ], + {"{" -> "", "}" -> ""} + ], + ",\n" + ] ]; +CXXInsertColors // secure; End[]; -$ContextPath = NPointFunctions`internal`contextPath; -Clear[NPointFunctions`internal`contextPath]; EndPackage[]; +$ContextPath = DeleteCases[$ContextPath, "NPointFunctions`"]; diff --git a/meta/NPointFunctions/DiracChains.m b/meta/NPointFunctions/DiracChains.m new file mode 100644 index 0000000000..e21013e8a6 --- /dev/null +++ b/meta/NPointFunctions/DiracChains.m @@ -0,0 +1,141 @@ +(* :Copyright: + + ==================================================================== + This file is part of FlexibleSUSY. + + FlexibleSUSY 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. + + FlexibleSUSY 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 FlexibleSUSY. If not, see + . + ==================================================================== + +*) + +BeginPackage@"NPointFunctions`"; +Begin@"`Private`"; + +ProceedChains[tree:_?IsTree, g:_] := +Module[{abbr, subs, chains, generic}, + abbr = FormCalc`Abbr[] //. FormCalc`GenericList[]; + {chains, abbr} = {#, Complement[abbr, #]}&@ ExtractDiracChains@abbr; + subs = FormCalc`Subexpr[] //. FormCalc`GenericList[] //. abbr; + chains = SimplifyOnShellChains@chains; + chains = ModifyDiracChains@chains; + {generic, chains} = MakeChainsUnique@{g /. abbr, chains}; + chains = InsertFermionNames[tree, chains]; + If[chains =!= {}, + {generic, chains, subs}, + {generic, chains, Join[subs, abbr]} + ] +]; +ProceedChains // secure; + +ModifyDiracChains[expression_] := +Module[{i = 0, rules, sp, L, reveal}, + If[Not@MatchQ[chains@$loopNumber, {__Rule}], + Return@expression + ]; + + Block[{k = FormCalc`k, l = FormCalc`Lor, ch = DiracChain}, + sp[mom_] := FormCalc`Spinor[k@mom, _, _]; + L[a_, e___ , b_] := + L[a, + Switch[{e}, + {}, {}, + {_Integer, ___}, {e}, + {__}, {6|7|-6|-7, e} + ], + b + ]; + L[a_, {e___}, b_] := ch[sp@a, e, sp@b]; + reveal@{a_, b_, c___} := Flatten@{i++; i[e___] :> L[a, e, b], reveal@{c}}; + reveal@{} := Sequence[]; + chainRules = reveal@GetObservableSetting@order; + rules = $zeroExternalMomenta /. Utils`UnzipRules@chains@$loopNumber /. chainRules; + ]; + Expand@expression //. rules +]; +ModifyDiracChains // secure; + +SimplifyOnShellChains[expr_] := +If[$onShell, + expr /. ch:DiracChain[__] :> SimplifyOnShellChains@ch, + expr +]; + +SimplifyOnShellChains[chain_DiracChain] := +If[$onShell, + Module[{s = 6|7, a = -6|-7, ch = DiracChain, k = FormCalc`k, m, pair, sp, flip}, + m[FormCalc`Spinor[_, mass_, type_]] = type*mass; + pair = FormCalc`Pair[k@#1, k@#2]&; + sp[mom:_:_] = FormCalc`Spinor[k@mom, _, _]; + flip[7|-7] = 6; + flip[6|-6] = 7; + + chain //. + { + ch[l:sp[j_],p:a,k[n_],k[i_],r:sp[n_]] :> pair[i,n]*ch[l,-p,r]-m[r]*ch[l,-p,k[i],r], + ch[l:sp[n_],p:a,k[i_],k[n_],r:sp[j_]] :> pair[i,n]*ch[l,-p,r]-m[l]*ch[l,flip@p,k[i],r], + ch[l:sp[],p:s,k[n_],r:sp[n_]] :> m[r]*ch[l,p,r], + ch[l:sp[n_],p:s,k[n_],r:sp[]] :> m[l]*ch[l,flip@p,r] + } + ], + chain +]; +SimplifyOnShellChains // secure; + +ExtractDiracChains[rules:{Rule[_Symbol, _]...}] := +Module[{regex}, + regex = RegularExpression@"[F][1-9][\\d]*"; + Cases[rules, e:Rule[_?(StringMatchQ[ToString@#, regex]&), _] :> e] +]; +ExtractDiracChains // secure; + +MakeChainsUnique[list:{expression_, rules:{Rule[_Symbol, _]...}}] := +Module[{chains, chain, name, old, zero, rest, unique, erules}, + chains = Longest@HoldPattern@Times[DiracChain[__]..]; + chain = DiracChain[__]; + name = Rule[Symbol["NPointFunctions`DiracChain"<>ToString@#2[[1]]], #1]&; + old = ExtractDiracChains@rules; + zero = Cases[old, e:Rule[_, 0] :> e]; + rest = Complement[rules, old]; + old = Complement[old, zero]; + unique = MapIndexed[name, DeleteDuplicates@Cases[old, chains, Infinity]]; + If[unique == {}, + unique = MapIndexed[name, DeleteDuplicates@Cases[old, chain, Infinity]];]; + erules = (old /. (unique /. Rule[x_, y_] :> Rule[y, x])); + { + expression /. zero /. erules, + Join[unique, rest] + } /. FormCalc`Mat -> Mat +]; +MakeChainsUnique // secure; + +Mat[0] = 0; +Mat[HoldPattern@Times[e__]] := Times@@Mat/@{e}; +Mat[mass:_FeynArts`Mass] := mass; + +InsertFermionNames[tree:_?IsTree, rules:{Rule[_Symbol, _]...}] := +Module[{id, idf, ch = DiracChain, s = FormCalc`Spinor, k = FormCalc`k}, + id = FieldRules@MapIndexed[#2[[1]]->#1&, GetFields[tree, Flatten]]; + idf[ch[s[k[i1_], m1_, _], e___, s[k[i2_], m2_, _]]] := + ch[s[i1 /. id, k[i1], m1], e, s[i2 /. id, k[i2], m2]]; + rules /. ch:DiracChain[__] :> idf@ch +]; +InsertFermionNames // secure; + +ZeroMomentaInChains[expression_] := + expression /. e:DiracChain[__] :> (e /. FormCalc`k[_] :> 0); +ZeroMomentaInChains // secure; + +End[]; +EndPackage[]; diff --git a/meta/NPointFunctions/createFAModelFile.m b/meta/NPointFunctions/MakeModelFile.m similarity index 70% rename from meta/NPointFunctions/createFAModelFile.m rename to meta/NPointFunctions/MakeModelFile.m index e740959c95..9f3003601a 100644 --- a/meta/NPointFunctions/createFAModelFile.m +++ b/meta/NPointFunctions/MakeModelFile.m @@ -22,23 +22,15 @@ BeginPackage["NPointFunctions`", {"SARAH`"}]; -CreateFAModelFile::usage= -"@brief Create the FeynArts model file using SARAH`.`MakeFeynArts[]. -@param sarahInputDirectories the SARAH input directories -@param sarahOutputDirectory the SARAH output directory -@param sarahModelName the model name used by SARAH -@param eigenstates the option to forward to SARAH`.`MakeFeynArts[] -@note Effectively Private function hence there are no checks for input"; +CreateFAModelFile::usage = ""; Begin["`Private`"]; -CreateFAModelFile[sarahInputDirs_, sarahOutputDir_, sarahModelName_, - eigenstates_] := -( +MakeModelFile[sarahInputDirs_, sarahOutputDir_, sarahModelName_, eigenstates_] := ( SARAH`SARAH@SARAH`InputDirectories = sarahInputDirs; SARAH`SARAH@SARAH`OutputDirectory = sarahOutputDir; SARAH`Start@sarahModelName; - SA`CurrentStates = eigenstates; + SA`CurrentStates = eigenstates; SARAH`InitVertexCalculation[eigenstates, False]; SARAH`partDefinition = SARAH`ParticleDefinitions@eigenstates; SARAH`Particles@SARAH`Current = SARAH`Particles@eigenstates; @@ -46,7 +38,6 @@ SARAH`MakeCouplingLists; SARAH`MakeFeynArts[SARAH`Eigenstates -> eigenstates]; ); -SetAttributes[CreateFAModelFile,{Protected, Locked}]; End[]; EndPackage[]; diff --git a/meta/NPointFunctions/ModifyMasses.m b/meta/NPointFunctions/ModifyMasses.m new file mode 100644 index 0000000000..67f512c051 --- /dev/null +++ b/meta/NPointFunctions/ModifyMasses.m @@ -0,0 +1,98 @@ +(* :Copyright: + + ==================================================================== + This file is part of FlexibleSUSY. + + FlexibleSUSY 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. + + FlexibleSUSY 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 FlexibleSUSY. If not, see + . + ==================================================================== + +*) + +Utils`DynamicInclude@"PatternChecks.m"; + +BeginPackage@"NPointFunctions`"; +Begin@"`Private`"; + +ExternalMasses[tree_?IsTree] := FeynArts`Mass[# /. -1 -> 1]&/@ GetFields[tree, Flatten]; +ExternalMasses[set_?IsFormCalcSet] := Flatten[List@@GetProcess@set, 1][[All, 3]]; +ExternalMasses // secure; + + +Module[{data}, +MassRules[tree_?IsTree, fc_?IsFormCalcSet] := +data = Partition[ + RuleDelayed[#, 0]&/@ Riffle[ExternalMasses@tree, ExternalMasses@fc], + 2 +]; +MassRules[] := ( + Utils`AssertOrQuit[Head@data =!= Symbol, MassRules::errNotSet]; + data +); +]; +MassRules // secure; +MassRules::errNotSet = "Call MassRules[...] first."; + +ModifyMasses[{generic_, chains_, subs_}, tree_?IsTree, NPointFunctions`ExceptLoops] := +Module[{names, loops, uniqueIntegrals, hideInt, showInt, massRules, new}, + subWrite@"Applying subexpressions ... "; + new = generic //. subs; + subWrite@"done\n"; + + names = ToExpression/@ Names@RegularExpression@"LoopTools`[ABCD]\\d+i*"; + loops = Alternatives@@ ( #[__] &/@ names ); + uniqueIntegrals = DeleteDuplicates@Cases[new, loops, Infinity]; + hideInt = Rule[#, Unique@"loopIntegral"] &/@ uniqueIntegrals; + showInt = hideInt /. Rule[x_, y_] -> Rule[y, x]; + + massRules = Through[(Composition@@ #&/@ ApplyObservableSetting[tree, mass])@MassRules[]]; + + { + MapThread[ + (#1//. Flatten@#2/. showInt)&, + {new/. hideInt/. FormCalc`Pair[_, _]-> 0, massRules} + ], + ZeroMomentaInChains@chains /. Flatten@MassRules[], + {} + } +]; + +ModifyMasses[{generic_, chains_, subs_}, _, True] := +Module[{zeroedRules, new}, + zeroedRules = Cases[subs, Rule[_, pair:FormCalc`Pair[_, _]] :> (pair->0)]; + {new, zeroedRules} = ZeroRules[subs, zeroedRules]; + { + generic /. zeroedRules, + ZeroMomentaInChains@chains, + new + } +]; + +ModifyMasses[e:{_, _, _}, __] := e; + +ModifyMasses // secure; + +ZeroRules[nonzeroRules:{Rule[_, _]...}, zeroRules:{Rule[_, 0]...}] := +Module[{newNonzero, newZeroRules}, + newNonzero = Thread[ + Rule[nonzeroRules[[All,1]], nonzeroRules[[All,2]]/. zeroRules]]; + If[newNonzero === nonzeroRules, Return[{nonzeroRules, zeroRules}]]; + newZeroRules = Cases[newNonzero, HoldPattern[_-> 0]]; + newNonzero = Complement[newNonzero, newZeroRules]; + ZeroRules[newNonzero, Join[zeroRules, newZeroRules]] +]; +ZeroRules // secure; + +End[]; +EndPackage[]; diff --git a/meta/NPointFunctions/NPointFunction.m b/meta/NPointFunctions/NPointFunction.m new file mode 100644 index 0000000000..6c7ae75d3e --- /dev/null +++ b/meta/NPointFunctions/NPointFunction.m @@ -0,0 +1,228 @@ +(* :Copyright: + + ==================================================================== + This file is part of FlexibleSUSY. + + FlexibleSUSY 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. + + FlexibleSUSY 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 FlexibleSUSY. If not, see + . + ==================================================================== + +*) + +Needs["Utils`", FileNameJoin@{ParentDirectory@DirectoryName@$InputFileName, "Utils.m"}]; + +Block[{Format}, + Needs@"FeynArts`"; + Needs@"FormCalc`"; + Print[]; +]; + +BeginPackage@"NPointFunctions`"; + +Off[General::shdw]; + DiracChain; + Mat; +On[General::shdw]; + +NPointFunction; +SetAttributes[ + { + LorentzIndex, GenericSum, GenericIndex, OperatorsOnly, ExceptLoops, + GenericS, GenericF, GenericV, GenericU, Present, Absent + }, + Protected +]; + +Begin@"`Private`"; + +secure[sym_Symbol] := + Protect@Evaluate@Utils`MakeUnknownInputDefinition@sym; +secure // secure; + +subWrite // Protect; + +Utils`DynamicInclude/@{ + "PatternChecks.m", + "Rules.m", + "Settings.m", + "DiracChains.m", + "Topologies.m", + "TreeWrapper.m", + "ModifyMasses.m" +}; + +NPointFunction[ + { + FCOutputDir_String, + FAModelName_String, + particleNamesFile_?FileExistsQ, + particleNamespaceFile_?FileExistsQ, + FAIncomingFields:{__String}, + FAOutgoingFields:{__String} + }, + { + observable:None | _?(Context@Evaluate@Head@# == "FlexibleSUSYObservable`"&), + loops_, + processes:{___String}, + momenta_Symbol, + onShell_Symbol, + mainRegularization_Symbol + } +] := +Module[{tree}, + BeginPackage["NPointFunction`"]; + Begin["`Private`"]; + $particleNamesFile = particleNamesFile; + $particleNamespaceFile = particleNamespaceFile; + + $observableName = SymbolName@Head@observable; + $externalFieldNumbers = {Length@FAIncomingFields, Length@FAOutgoingFields}; + $loopNumber = loops; + $expressionsToDerive = processes; + $zeroExternalMomenta = momenta; + $onShell = onShell; + $regularizationScheme = Switch[mainRegularization, FlexibleSUSY`DRbar, 4, FlexibleSUSY`MSbar, D]; + End[]; + EndPackage[]; + + FeynArts`$FAVerbose = 0; + FeynArts`InitializeModel@FAModelName; + SetOptions[FeynArts`InsertFields, + FeynArts`Model -> FAModelName, + FeynArts`InsertionLevel -> FeynArts`Classes + ]; + FormCalc`$FCVerbose = 0; + If[!DirectoryQ@FCOutputDir, CreateDirectory@FCOutputDir]; + SetDirectory@FCOutputDir; + + DefineAllowedTopologies[]; + LoadAllSettings[]; + tree = GenerateDiagrams[FAIncomingFields, FAOutgoingFields]; + tree = ApplyObservableSetting[tree, diagrams]; + tree = GenerateColorlessAmplitudes[tree]; + tree = ApplyObservableSetting[tree, amplitudes]; + ExportFeynArtsPaint@tree; + {FieldRules@GetFields@tree, CalculateAmplitudes@tree} +]; +NPointFunction // secure; + +CalculateAmplitudes[tree_?IsTree] := +Module[{ampsGen, feynAmps, generic, chains, subs, zeroedRules}, + ampsGen = FeynArts`PickLevel[Generic][ExtractAmplitudes@tree]; + If[$zeroExternalMomenta, + ampsGen = FormCalc`OffShell[ampsGen, Sequence@@Array[#->0&, Tr@$externalFieldNumbers]] + ]; + feynAmps = MapThreadWithBar[ + FormCalc`CalcFeynAmp[ + Head[ampsGen][#1], + FormCalc`Dimension -> #2, + FormCalc`OnShell -> $onShell, + FormCalc`FermionChains -> FormCalc`Chiral, + FormCalc`FermionOrder -> GetObservableSetting@order, + FormCalc`Invariants -> False, + FormCalc`MomElim -> #3 + ]&, + { + ampsGen, + ApplyObservableSetting[tree, regularization], + ApplyObservableSetting[tree, momenta] + }, + "Amplitude calculation" + ] //. FormCalc`GenericList[]; + generic = MapThread[GetGenericSum, {feynAmps, ApplyObservableSetting[tree, sum]}]; + {generic, chains, subs} = ProceedChains[tree, generic]; + + MassRules[tree, feynAmps]; + {generic, chains, subs} = ModifyMasses[{generic, chains, subs}, tree, $zeroExternalMomenta]; + + ConvertToFS[ + { + generic, + GetFieldInsertions@tree, + CombinatoricalFactors@tree, + ColorFactors@tree + }, + chains, + subs + ] /. ExternalMomentaRules[tree, $zeroExternalMomenta] +]; +CalculateAmplitudes // secure; + +GetProcess[set:_?IsDiagramSet|_?IsAmplitudeSet] := + FirstCase[Head@set, (FeynArts`Process -> e_) :> e]; +GetProcess[set_?IsFormCalcSet] := + Part[Head@Part[set, 1], 1]; +GetProcess // secure; + +GetFieldInsertions[tree_?IsTree] := + Map[Last, #, {3}]&@Flatten[GetFieldInsertions/@ List@@ExtractDiagrams@tree, 1]; +GetFieldInsertions[diag_?IsDiagram, keepNumQ:True|False:False] := + GetFieldInsertions[#, keepNumQ]&/@ Apply[List, Last@diag, {0, 1}]; +GetFieldInsertions[{graph_, insert_}, keepNumQ_] := +Module[{toGenericIndexConventionRules, fieldsGen, genericInsertions, stripIndices}, + stripIndices[Times[-1, field_]] := -stripIndices@field; + stripIndices[name_[class_, ___]] := name@class; + toGenericIndexConventionRules = Cases[graph, + Rule[FeynArts`Field[index_Integer],type_Symbol] :> + Rule[FeynArts`Field@index, type[FeynArts`Index[Generic,index]]] + ]; + fieldsGen = toGenericIndexConventionRules[[All,1]]; + genericInsertions = Cases[#, + Rule[genericField_,classesField_] /; MemberQ[fieldsGen, genericField] :> + Rule[genericField, stripIndices@classesField] + ] &/@ insert; + SortBy[#,First]&/@ If[keepNumQ, + List @@ genericInsertions, + List @@ genericInsertions /. toGenericIndexConventionRules + ] +]; +GetFieldInsertions // secure; + +MapThreadWithBar[func_, exprs:{__}, text_String] := +Module[{printed = 0, delta, out, tot, print, def = 70}, + tot = Length@First@exprs; + print[i_] := + ( + delta = Floor[(def-StringLength[text]-4)*i/tot] - printed; + subWrite[StringJoin@@Array["."&, delta]]; + printed += delta; + ); + subWrite[text<>": ["]; + out = Table[print@i; func@@exprs[[All, i]], {i, tot}]; + subWrite@"]\n"; + out +]; +MapThreadWithBar // secure; + +GetGenericFields[expr_] := Sort@DeleteDuplicates[Cases[expr, _?IsGenericField, Infinity]]; +GetGenericFields // secure; + +GetGenericSum[amplitude_?IsFormCalcAmplitude, sumRules:{Rule[_Integer, _]...}] := +Module[{sort, rules}, + sort = GetGenericFields@amplitude; + rules = Append[sumRules, _Integer -> False]; + GenericSum[ + List@@amplitude, + sort /. f_[_[_,i_]] :> {f@GenericIndex@i, i /. rules}]]; +GetGenericSum // secure; + +ConvertToFS[amplitudes_, abbreviations_, subexpressions_] := +{ + AmplitudeRules@amplitudes, + SubexpressionRules /@ Join[abbreviations, subexpressions] +}; +ConvertToFS // secure; + +End[]; +Block[{$ContextPath}, EndPackage[]]; diff --git a/meta/NPointFunctions/PatternChecks.m b/meta/NPointFunctions/PatternChecks.m new file mode 100644 index 0000000000..cafa0c68ba --- /dev/null +++ b/meta/NPointFunctions/PatternChecks.m @@ -0,0 +1,70 @@ +(* :Copyright: + + ==================================================================== + This file is part of FlexibleSUSY. + + FlexibleSUSY 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. + + FlexibleSUSY 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 FlexibleSUSY. If not, see + . + ==================================================================== + +*) + +BeginPackage@"NPointFunctions`"; +Begin@"`Private`"; + +IsVertex[e_] := MatchQ[e, FeynArts`Vertex[_Integer][_Integer]]; +IsMass[e_] := MatchQ[e, Repeated[FeynArts`Loop|FeynArts`Internal, {0, 1}]]; +IsPropagator[e_] := MatchQ[e, FeynArts`Propagator[ FeynArts`External|FeynArts`Incoming| + FeynArts`Outgoing|FeynArts`Internal|FeynArts`Loop[_Integer] ][ + _?IsVertex, _?IsVertex, Repeated[FeynArts`Field[_Integer],{0,1}]] +]; +IsAmplitude[e_] := MatchQ[e, + FeynArts`FeynAmp[ + FeynArts`GraphID[FeynArts`Topology==_Integer,Generic==_Integer], + (* For 1loop. *)Integral[FeynArts`FourMomentum[FeynArts`Internal,_Integer]]| + (* For 0loop. *)Integral[], + _, + {__}->FeynArts`Insertions[FeynArts`Classes][{__}..] + ] +]; + +IsTopology[e_] := MatchQ[e, FeynArts`Topology[_Integer][__?IsPropagator]]; +IsDiagram[e_] := MatchQ[e, Rule[_?IsTopology, FeynArts`Insertions[Generic][__]]]; +IsGeneric[e_] := MatchQ[e, FeynArts`Insertions[Generic][__]]; +IsClasses[e_] := MatchQ[e, FeynArts`Insertions[FeynArts`Classes][__]]; +IsTreeHead[e_] := MatchQ[e, {_FeynArts`TopologyList, ___}]; +IsTree[e_] := MatchQ[e, + node[_?IsTreeHead, node[_?IsTopology, node[_?IsGeneric, node[_?IsClasses]..]..]..] +]; + +IsTopologyListHead[e_] := MatchQ[e, FeynArts`TopologyList[_]]; +IsDiagramSet[e_] := MatchQ[e, FeynArts`TopologyList[_][__?IsDiagram]]; +IsAmplitudeSet[e_] := MatchQ[e, FeynArts`FeynAmpList[__][__?IsAmplitude]]; + +IsColorIndex[e_] := MatchQ[e, FeynArts`Index[Global`Colour, _Integer]]; +IsGluonIndex[e_] := MatchQ[e, FeynArts`Index[Global`Gluon, _Integer]]; +IsGenerationIndex[e_] := !IsColorIndex[e] && !IsGluonIndex[e] && MatchQ[e, FeynArts`Index[_Symbol, _Integer]]; + +IsFeynArtsField[e_] := MatchQ[e, FeynArts`S|FeynArts`F|FeynArts`V|FeynArts`U]; +IsGenericField[e_] := MatchQ[e, (_?IsFeynArtsField)[FeynArts`Index[Generic, _Integer]]]; + +IsFormCalcField[e_] := MatchQ[e, (_?IsFeynArtsField)[_Integer, Repeated[{_Symbol}, {0, 1}]]]; +IsFormCalcMass[e_] := MatchQ[e, 0|_Symbol|_Symbol@_Symbol]; +IsFormCalcExternal[e_] := MatchQ[e, {_?IsFormCalcField|(-1*_?IsFormCalcField), FormCalc`k@_Integer, _?IsFormCalcMass, {}}]; +IsFormCalcProcess[e_] := MatchQ[e, {__?IsFormCalcExternal} -> {__?IsFormCalcExternal}]; +IsFormCalcAmplitude[e_] := MatchQ[e, FormCalc`Amp[_?IsFormCalcProcess][_]]; +IsFormCalcSet[e_] := MatchQ[e, {__?IsFormCalcAmplitude}]; + +End[]; +EndPackage[]; diff --git a/meta/NPointFunctions/Rules.m b/meta/NPointFunctions/Rules.m new file mode 100644 index 0000000000..a6ff747705 --- /dev/null +++ b/meta/NPointFunctions/Rules.m @@ -0,0 +1,186 @@ +(* :Copyright: + + ==================================================================== + This file is part of FlexibleSUSY. + + FlexibleSUSY 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. + + FlexibleSUSY 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 FlexibleSUSY. If not, see + . + ==================================================================== + +*) + +BeginPackage@"NPointFunctions`"; +Begin@"`Private`"; + +Module[{once}, +FieldData[] := once@_; +once[arg_] := once@arg = +Module[{regex, lines, rules, names}, + regex = "(\\w+): ([SFVU])\\[(\\d+)\\]"; + lines = Utils`ReadLinesInFile@$particleNamesFile; + rules = Rule[First@#, Sequence[Last@#, First@#]] &/@ Get@$particleNamespaceFile; + names = StringCases[lines, RegularExpression@regex :> {"$1","FeynArts`$2","$3"}]; + Flatten[names, 1] /. rules +]; +FieldData // secure; +]; + +Module[{once}, +FieldRules[expression_] := expression //. FieldRules[]; +FieldRules[] := once@_; +once[arg_] := once@arg = +Module[{bose = FeynArts`S|FeynArts`V, fermi = FeynArts`U|FeynArts`F, data}, + data = Map[ToExpression, {#1<>#2, #3, #4}&@@#&/@FieldData[], 2]; + Join[ + data /. {n_, t_, i_} :> Rule[t@i, n], + data /. {n_, t_, i_} :> RuleDelayed[t[i, {ind__}], n@{ind}], + data /. + { + {n_, t:bose, _} :> RuleDelayed[Times[-1,f:n], Susyno`LieGroups`conj@n], + {n_, t:fermi, _} :> RuleDelayed[Times[-1,f:n], SARAH`bar@n] + }, + data /. + { + {n_, t:bose, _} :> RuleDelayed[Times[-1,f:n@{ind__}], Susyno`LieGroups`conj@n@{ind}], + {n_, t:fermi, _} :> RuleDelayed[Times[-1,f:n@{ind__}], SARAH`bar@n@{ind}] + }, + { + ind_?IsGenerationIndex :> Symbol["SARAH`gt" <> ToString@Last@ind], + (* Color structures are handled separately *) + (h_)[{_?IsColorIndex}] :> h(*Symbol["SARAH`ct" <> ToString@Last@ind]*), + (h_)[{_?IsGluonIndex}] :> h(*Symbol["SARAH`ct" <> ToString@Last@ind]*) + }, + { + FeynArts`S -> GenericS, + FeynArts`F -> GenericF, + FeynArts`V -> GenericV, + FeynArts`U -> GenericU + }, + { + Times[-1,field:_GenericS|_GenericV] :> Susyno`LieGroups`conj@field, + Times[-1,field:_GenericF|_GenericU] :> SARAH`bar@field + } + ] +]; +FieldRules // secure; +]; + +Module[{once}, +SubexpressionMassRules[] := once@_; +once[arg_] := once@arg = +Module[{faMasses, sarahNames, massRules}, + faMasses = Symbol["Global`Mass" <> #[[2]]] &/@ FieldData[]; + sarahNames = Symbol[#[[1]] <> #[[2]]] &/@ FieldData[]; + massRules = MapThread[ + { + #1[index_] :> SARAH`Mass@#2@{Symbol["SARAH`gt" <> StringTake[SymbolName@index, -1]]}, + #1[indices__] :> SARAH`Mass@#2@indices, + #1 :> SARAH`Mass@#2 + }&, + {faMasses, sarahNames} + ]; + Append[Flatten@massRules, FeynArts`Mass[field_, _ : Null] :> SARAH`Mass@field] +]; +SubexpressionMassRules // secure; +]; + +SubexpressionCouplingRules[] := +Module[{PL, PR, MT, FV, g, md, v, i, p}, + v = Global`FourVector; + p = FeynArts`Mom; + i = FeynArts`KI1; + l = NPointFunctions`LorentzIndex; + {PL, PR} = FeynArts`NonCommutative@Global`ChiralityProjector@#| + FeynArts`NonCommutative[Global`DiracMatrix@i@3, + Global`ChiralityProjector@#] &/@ {-1, 1}; + Off@RuleDelayed::rhs; + MT[i1_, i2_] := Global`MetricTensor[i@i1_Integer, i@i2_Integer]; + If[Head@FormCalc`$FormCalc === Real, + FV[i1_, i2_, Repeated[_, {0, 1}]] := p@i1_Integer - p@i2_Integer;, + FV[i1_, i2_] := v[p@i1_Integer - p@i2_Integer, i@3]; + FV[i1_, i2_, i3_] := v[p@i1_Integer - p@i2_Integer, i@i3_Integer]; + ]; + On@RuleDelayed::rhs; + g[f_, i1:_Integer, i2:_Integer] := SARAH`g[l@f[[i1]], l@f[[i2]]]; + md[f_, i1:_Integer, i2:_Integer] := SARAH`Mom@f[[i1]] - SARAH`Mom@f[[i2]]; + md[f_, i1:_Integer, i2:_Integer, i3:_Integer] := + SARAH`Mom[f[[i1]], l@f[[i3]]] - SARAH`Mom[f[[i2]], l@f[[i3]]]; + + With[{F = FeynArts`G[_][0][f__], S = SARAH`Cp@f}, + { + F@1 :> S@1, + F@PL :> S@SARAH`PL, + F@PR :> S@SARAH`PR, + F@MT[i1, i2] :> S@g[{f}, i1, i2], + F@FV[i1, i2] :> S@md[{f}, i1, i2], + F[FV[i2, i1, i3]*MT[i1, i2]+FV[i1, i3, i2]*MT[i1, i3]+FV[i3, i2, i1]*MT[i2, i3]] :> + S[ + md[{f}, i2, i1, i3] * g[{f}, i1, i2], + md[{f}, i1, i3, i2] * g[{f}, i1, i3], + md[{f}, i3, i2, i1] * g[{f}, i2, i3] + ] + } + ] +]; +SubexpressionCouplingRules // secure; + +With[{lt = Unique@"SARAH`lt"}, +SubexpressionRules[expression_] := +expression //. Join[ + FieldRules[], + SubexpressionMassRules[], + SubexpressionCouplingRules[], + { + FormCalc`Finite -> 1, + FormCalc`Den[a_, b_] :> 1/(a-b), + FormCalc`Pair[a_, b_] :> SARAH`sum[lt, 1, 4, SARAH`g[lt, lt]*Append[a, lt]*Append[b, lt]], + f_?IsGenericField :> Head[f][GenericIndex@Last@Last@f], + FormCalc`k[i_Integer, pairIndex___] :> SARAH`Mom[i, pairIndex] + }, + { + FormCalc`Spinor -> SARAH`DiracSpinor, + FormCalc`Lor -> SARAH`Lorentz + } +]; +SubexpressionRules // secure; +]; + +AmplitudeRules[expression_] := +SubexpressionRules[expression] //. +{ + FeynArts`SumOver[_, _, FeynArts`External] :> Sequence[], + Times[e_, FeynArts`SumOver[i_, max_]] :> SARAH`sum[i, 1, max, e], + Times[e_, FeynArts`SumOver[i, {min, max}]] :> SARAH`sum[i, min, max, e], + SARAH`sum[i_, min_, max_, FeynArts`SumOver[_, n1_]] :> SARAH`sum[i, min, max, n1], + SARAH`sum[i_, min_, max_, FeynArts`SumOver[_, {n1_, n2_}]] :> SARAH`sum[i, min, max, n2-n1], + FeynArts`IndexSum -> Sum +}; +AmplitudeRules // secure; + +ExternalMomentaRules[tree_?IsTree, option:True|False|OperatorsOnly|ExceptLoops] := +Module[{fsFields}, + Switch[option, + True, + {SARAH`Mom[_Integer,_] :> 0}, + OperatorsOnly|ExceptLoops, + fsFields = FieldRules@GetFields[tree, Flatten]; + {SARAH`Mom[i_Integer, lorIndex_] :> SARAH`Mom[fsFields[[i]], lorIndex]}, + False, + {} + ] +]; +ExternalMomentaRules // secure; + +End[]; +EndPackage[]; diff --git a/meta/NPointFunctions/Settings.m b/meta/NPointFunctions/Settings.m new file mode 100644 index 0000000000..a856594cc4 --- /dev/null +++ b/meta/NPointFunctions/Settings.m @@ -0,0 +1,175 @@ +(* :Copyright: + + ==================================================================== + This file is part of FlexibleSUSY. + + FlexibleSUSY 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. + + FlexibleSUSY 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 FlexibleSUSY. If not, see + . + ==================================================================== + +*) + +Utils`DynamicInclude@"PatternChecks.m"; +Utils`DynamicInclude@"ModifyMasses.m"; + +BeginPackage@"NPointFunctions`"; +Begin@"`Private`"; + +With[{dir = DirectoryName@$InputFileName}, +LoadAllSettings[] := +( + BeginPackage@"NPointFunctions`"; + Begin@"`Private`"; + If[FileExistsQ@#, Get@#]&@FileNameJoin@ + {ParentDirectory@dir, "Observables", $observableName, "NPointFunctions.m"}; + End[]; + EndPackage[]; +); +]; + +ApplyObservableSetting[tree_?IsTree, settingName:diagrams|amplitudes] := +Module[{doPresent, doAbsent, absent, todos, res = tree}, + {doPresent, doAbsent} = If[Head@# === List, #, {}]&@ settingName[$loopNumber, #] &/@ {Present, Absent}; + {doPresent, doAbsent} = Utils`UnzipRules/@ {doPresent, doAbsent}; + {doPresent, doAbsent} = Rule[SymbolName@First@#, Last@#] &/@ #&/@ {doPresent, doAbsent}; + absent = Complement[First/@doAbsent, $expressionsToDerive]; + todos = DeleteDuplicates@Flatten[ + Join[$expressionsToDerive /. doPresent, absent /. doAbsent] + ]; + todos = Select[todos, Head@# === Rule&]; + Set[res, ApplySetting[res, settingName, #]] &/@ todos; + res +]; + +ApplySetting[tree_?IsTree, settingName:diagrams|amplitudes, tQ_ -> {str_String, fun_}] := +Module[{res, isReplaced = False}, + res = tree /. e:node[t:_?IsTopology /; tQ@t, __] :> + ( + isReplaced = True; + RemoveNode[e, fun, t, TreeHead@tree] + ); + If[isReplaced, + PrintInfo[tQ, settingName, str, + ToString@Length@Cases[res, _?IsGeneric, Infinity] <> "g, " <> + ToString@Length@Cases[res, _?IsClasses, Infinity] <> "c" + ] + ]; + res +]; + +GetObservableSetting[order] := +If[Head@order[] === List, + order[], + Reverse@Range@Tr@$externalFieldNumbers +]; + +ApplyObservableSetting[tree:_?IsTree, settingName:regularization|momenta|sum|mass] := +Module[{res = {tree}, default, head}, + If[Head@settingName@$loopNumber === List, + AppendTo[res, ApplySetting[tree, settingName, #]] &/@ Utils`UnzipRules@settingName@$loopNumber; + ]; + default = Switch[settingName, + regularization, $regularizationScheme, + momenta, Automatic, + sum, {}, + mass, {} + ]; + head = Switch[settingName, + regularization|momenta|sum, First, + mass, Identity + ]; + res = res /. + node[_?IsGeneric, __] -> default /. + node[_?IsTopology, rest__] :> rest /. + node[_?IsTreeHead, rest__] :> {rest}; + DeleteDuplicates/@Transpose@res /. + {default, rest__} :> head@{rest} /. {default} -> default +]; + +ApplyObservableSetting // secure; + +ApplySetting[tree_?IsTree, settingName:regularization|momenta, tQ_ -> res_] := +Module[{}, + tree /. node[t:_?IsTopology /; tQ@t, rest__] :> + ( + (*PrintInfo[tQ, settingName, ""];*) + node[t, rest] /. node[g_?IsGeneric, __] :> res + ) +]; + +ApplySetting[tree_?IsTree, settingName:sum, tQ_ -> {str_String, {int_Integer, fun_}}] := +Module[{res}, + res = {int -> Or[fun@TreeHead@tree, -fun@TreeHead@tree]}; + tree /. node[t:_?IsTopology /; tQ@t, rest__] :> + ( + PrintInfo[tQ, settingName, str]; + node[t, rest] /. node[g_?IsGeneric, __] :> res + ) +]; + +ApplySetting[tree_?IsTree, settingName:mass, tQ_ -> {str_String, mass_ :> _[i_Integer]}] := +Module[{res}, + res = With[{rhs = MassRules[][[i, 1, 1]]}, Append[#, mass :> rhs]&]; + tree /. node[t:_?IsTopology/; tQ@t, rest__] :> + ( + PrintInfo[tQ, settingName, str]; + node[t, rest] /. node[g_?IsGeneric, __] :> res + ) +]; + +ApplySetting[tree_?IsTree, settingName:mass, tQ_ -> {str_String, Hold :> _[i_Integer]}] := +Module[{res}, + res = With[{pos = i}, ReplacePart[#, pos -> {}]&]; + tree /. node[t:_?IsTopology/; tQ@t, rest__] :> + ( + PrintInfo[tQ, settingName, str]; + node[t, rest] /. node[g_?IsGeneric, __] :> res + ) +]; + +ApplySetting // secure; + +PrintInfo[tQ_Symbol, settingName_Symbol, str_String, finalStr_String:""] := +Module[{set, top, inf, n}, + set = "Setting " <> SymbolName@settingName <> ": "; + top = SymbolName@tQ; + inf = If[str == "", "", ": "<>str]; + n = Tr[StringLength/@{set, top, inf, finalStr}]; + Print[set, top, inf, StringJoin@Array[" " &, 70-n]<>finalStr]; +]; + +PrintInfo // secure; + +LoopFields[tH_, t_, node[id_, ___]] := FeynArts`LoopFields[First@id, t, tH]; +LoopFields // secure; + +TreeFields[tH_, t_, node[id_, ___]] := FeynArts`TreeFields[First@id, t, tH]; +TreeFields // secure; + +Field[d_?IsTopologyListHead, i_Integer] := Flatten[List@@(FeynArts`Process /. List@@d), 1][[i]]; +Field // secure; + +FieldPattern[d_?IsTopologyListHead, i_Integer] := Flatten[List@@(FeynArts`Process /. List@@d), 1][[i]] /. _?IsGenerationIndex :> Blank[]; + +FieldPattern[d_?IsTopologyListHead, a:HoldPattern@Alternatives@__] := FieldPattern[d, #] &/@ a; +FieldPattern // secure; + +InternalMass[f_?IsFeynArtsField, index:_Integer] := FeynArts`Mass[f@FeynArts`Index[Generic, index], _?IsMass]; +InternalMass // secure; + +ExternalMass[index:_Integer] := {index}; +ExternalMass // secure; + +End[]; +EndPackage[]; diff --git a/meta/NPointFunctions/Topologies.m b/meta/NPointFunctions/Topologies.m new file mode 100644 index 0000000000..22b2805a20 --- /dev/null +++ b/meta/NPointFunctions/Topologies.m @@ -0,0 +1,101 @@ +(* :Copyright: + + ==================================================================== + This file is part of FlexibleSUSY. + + FlexibleSUSY 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. + + FlexibleSUSY 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 FlexibleSUSY. If not, see + . + ==================================================================== + +*) + +BeginPackage@"NPointFunctions`"; +Begin@"`Private`"; + +AllTopologies[{2, 2}] = { + treeS -> {1,0,1,0,0,1,0,1,0,1,0}, + treeT -> {1,0,0,1,1,0,0,1,0,1,0}, + treeU -> {1,0,0,1,0,1,1,0,0,1,0}, + treeAll -> {treeS, treeT, treeU}, + triangleT -> {1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,1,0,0,1,0,1,0}, + inSelfT -> {1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,0,2,0,1,0,0,1,0}, + outSelfT -> {1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,1,0,1,0,0,0,0,2,0}, + penguinT -> {triangleT, inSelfT, outSelfT}, + boxS -> {1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,1,1,0,0,0,1,0,1,0}, + boxT -> {1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,0,1,0}, + boxU -> {1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,1,0,1,1,0,0,0}, + boxAll -> {boxS, boxT, boxU} +}; + +AllTopologies[{1, 2}] = { + triangle -> {1,0,0,0,1,0,0,0,1,0,1,1,0,1,0}, + quartic -> {1,0,0,1,0,1,0,2,0} +}; + +AdjaceTopology::usage = "Archivates the adjacency matrix of a given topology: +In[1]:= << FeynArts`; + topologies = CreateTopologies[0, 1 -> 2]; + AdjaceTopology[topologies[[1]]] +Out[1]= {1, 1, 1, 0}"; +AdjaceTopology[topology:_?IsTopology] := +Module[{external, simple, graph, ordering, matrix}, + external = Tr@$externalFieldNumbers; + simple = (#/. h_[i_, j_, _] :> h[i, j])&/@ topology; + graph = List@@ (UndirectedEdge@@@ FeynArts`TopologySort@simple)/. + FeynArts`Vertex[_][i_] :> i; + ordering = Ordering@VertexList@graph; + matrix = Normal[AdjacencyMatrix[graph]][[ordering, ordering]]; + Flatten@MapIndexed[Drop[#1, Max[external, #2-1]]&, matrix] +]; +AdjaceTopology // secure; + +DefineAllowedTopologies[] := +Module[{allTopologies, single, combined}, + allTopologies = AllTopologies@$externalFieldNumbers; + If[Head@allTopologies =!= List, Return[]]; + combined = Select[allTopologies, FreeQ[#, _Integer]&]; + single = Complement[allTopologies, combined]; + If[single =!= {}, DefineSingle/@ single]; + If[combined =!= {}, DefineCombined/@ combined]; +]; + +DefineSingle[name_Symbol -> adjacencyVector:{__Integer}] := +With[{function = name, vector = adjacencyVector}, + function[t:_?IsTopology] := AdjaceTopology@t === vector; + function // secure; +]; + +DefineCombined[name_Symbol -> singleTopologies:{__Symbol}] := +With[{function = name, list = singleTopologies}, + function[t:_?IsTopology] := Or@@ Through@list@t; + function // secure; +]; + +GetExcludeTopologies[] := +Once@Module[{all, name, default, loaded}, + default = { + "Irreducible" -> (FreeQ[#, FeynArts`Internal]&), + "Triangles" -> (FreeQ[FeynArts`ToTree@#, FeynArts`Centre@Except@3]&) + }; + loaded = If[MatchQ[#, {__}], #, {}]&[topologies@$loopNumber]; + loaded = Rule[SymbolName@First@#, With[{fun = Last@#}, fun@#&]] &/@ Utils`UnzipRules@loaded; + + all = Join[default, loaded]; + FeynArts`$ExcludeTopologies[name] = Function[Or@@Through[($expressionsToDerive/.all)@#]]; + name +]; +GetExcludeTopologies // secure; + +End[]; +EndPackage[]; diff --git a/meta/NPointFunctions/TreeWrapper.m b/meta/NPointFunctions/TreeWrapper.m new file mode 100644 index 0000000000..26f758f16f --- /dev/null +++ b/meta/NPointFunctions/TreeWrapper.m @@ -0,0 +1,162 @@ +(* :Copyright: + + ==================================================================== + This file is part of FlexibleSUSY. + + FlexibleSUSY 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. + + FlexibleSUSY 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 FlexibleSUSY. If not, see + . + ==================================================================== + +*) + +BeginPackage@"NPointFunctions`"; +Begin@"`Private`"; + +RemoveColors[expr_] := Delete[expr, Position[expr, _?IsColorIndex]]; +RemoveColors // secure; + +GenerateDiagrams[in_, out_] := +Module[{topologies, diagrams}, + topologies = FeynArts`CreateTopologies[ + $loopNumber, + Length@in -> Length@out, + FeynArts`ExcludeTopologies -> GetExcludeTopologies[] + ]; + Utils`AssertOrQuit[Length@topologies > 0, GenerateDiagrams::topologies]; + + diagrams = FeynArts`InsertFields[ + topologies, + ToExpression@in -> ToExpression@out + ]; + Utils`AssertOrQuit[Length@diagrams > 0, GenerateDiagrams::diagrams]; + + node[{Head@#}, Sequence@@#]&[diagrams] /. + Rule[t_?IsTopology, rest_] :> node[t, rest] /. + (h:_@Generic)[a__] :> Sequence@@(node@*h@@#&/@{a}) /. + (h:_@Generic)[a_, rest__] :> Sequence[h@a, rest] /. + (h:_@FeynArts`Classes)[a__] :> Sequence@@(node@*h/@{a}) +]; +GenerateDiagrams // secure; +GenerateDiagrams::topologies = "CreateTopologies generated zero topologies."; +GenerateDiagrams::diagrams = "InsertFields generated zero field insertions."; + +GenerateColorlessAmplitudes[tree_?IsTree] := +Module[{amps, generic, classes, i = 1, j = 1}, + amps = RemoveColors@FeynArts`CreateFeynAmp@ExtractDiagrams@tree; + generic = Most/@List@@amps; + classes = (Last/@List@@amps) /. (lhs_ -> _@rhs__) :> Sequence@@(Thread[lhs -> #]&/@{rhs}); + RemoveColors@tree /. + node[e_?IsTreeHead, r__] :> node[Append[e, Head@amps], r] /. + node[e_?IsGeneric, r__] :> node[Append[e, generic[[i++]]], r] /. + node[e_?IsClasses] :> node@Append[e, classes[[j++]]] +]; +GenerateColorlessAmplitudes // secure; + +ExtractDiagrams[tree_?IsTree] := +tree /. + node[e_?IsTreeHead, rest__] :> First[e][rest] /. + node[e_?IsTopology, rest__] :> Rule[e, FeynArts`Insertions[Generic][rest]] /. + node[e_?IsGeneric, rest__] :> First[e] -> FeynArts`Insertions[FeynArts`Classes][rest] /. + node[e_?IsClasses] :> First[e]; + +ExtractAmplitudes[tree_?IsTree] := +tree /. + node[e_?IsTreeHead, rest__] :> Part[e, 2]@rest /. + node[e_?IsTopology, rest__] :> rest /. + node[e_?IsClasses] :> Last@e /. + node[e_?IsGeneric, rest__] :> Append[Part[e, 2], wrap@rest]; + +wrap[data:{Rule[_, _]..}..] := + Module[{lhs, rhs}, + lhs = First/@First@{data}; + rhs = FeynArts`Insertions[FeynArts`Classes]@@(Last/@#&/@{data}); + lhs -> rhs]; +wrap // secure; + +GetFields[tree_?IsTree, Flatten] := + Flatten[GetFields@tree, 1]; +GetFields[tree_?IsTree] := + tree /. node[e_?IsTreeHead, __] :> List@@(FeynArts`Process /. List@@First@e); +GetFields // secure; + +ExportFeynArtsPaint[tree_?IsTree] := +Module[{out = {}, directory, name}, + name = StringJoin[ToString /@ ( + FieldRules@Join[GetFields[tree, Flatten], + $expressionsToDerive] /. e_@{_} :> e) + ]; + directory = DirectoryName[FeynArts`$Model<>".mod"]; + FeynArts`Paint[ExtractDiagrams@tree, + FeynArts`PaintLevel -> {Generic}, + FeynArts`ColumnsXRows -> 1, + FeynArts`FieldNumbers -> True, + FeynArts`SheetHeader -> None, + FeynArts`Numbering -> FeynArts`Simple, + DisplayFunction :> (AppendTo[out, #] &/@ Render[##, "JPG"] &) + ]; + Put[out, FileNameJoin@{directory, name<>".m"}] +]; +ExportFeynArtsPaint // secure; + +RemoveNode::usage = "Removes node if both tQ[id] is True and fun[node, info] is True."; +RemoveNode[n:node[_?IsTopology, __], fun_, t_, tH_] := + n /. e:node[_?IsGeneric, __] :> RemoveNode[e, fun, t, tH] /. + node@_?IsTopology :> Sequence[]; +RemoveNode[n:node[_?IsGeneric, __], fun_, t_, tH_] := + If[fun[tH, t, #], # /. node[_?IsGeneric] :> Sequence[], ##&[]]&[n /. e:node[_?IsClasses] :> RemoveNode[e, fun, t, tH]]; +RemoveNode[n:node[_?IsClasses], fun_, t_, tH_] := If[fun[tH, t, n], n, ##&[]]; +RemoveNode // secure; + +TreeHead[tree_?IsTree] := tree[[1, 1]]; +TreeHead // secure; + +CombinatoricalFactors[tree_?IsTree] := CombinatoricalFactors /@ List@@ExtractAmplitudes@tree; +CombinatoricalFactors[_[_,_,_, generic_ -> _[_][classes__]]] := +{classes}[[All, #[[1, 1]]]] /. + {FeynArts`IndexDelta[___] -> 1, FeynArts`SumOver[__] -> 1} &@ + Position[generic, FeynArts`RelativeCF]; +CombinatoricalFactors // secure; + +ColorFactors[tree:_?IsTree] := FieldRules@Flatten[ColorFactors /@ List@@ExtractDiagrams@tree, 1]; +ColorFactors[diagram:Rule[_[_][props__], _[_][_[__][rules__]->_,___]]] := +Module[{propPatt, adjacencyMatrix, externalRules, genericDiagram}, + propPatt[i_, j_, f_] := _[_][_[_][i], _[_][j], f]; + adjacencyMatrix = Module[{adjs}, + adjs = Tally[{props} /. propPatt[i_, j_, _] :> {{i, j}, {j, i}}]; + Normal@SparseArray@Flatten[ + {#[[1,1]] -> #[[2]], #[[1,2]] -> #[[2]]} &/@ adjs] + ]; + externalRules = Cases[{rules}, HoldPattern[_ -> _@__]]; + genericDiagram = Module[{fld}, + fld = Flatten[{props} /. propPatt[i_, j_, f_] :> + {{j, i, -f},{i, j, f}}, 1]; + GatherBy[SortBy[fld, First], First] /. {_Integer, _Integer, f_} :> + f + ] /. Join[ {#} -> #&/@ First/@externalRules]; + Map[ + CXXDiagrams`ColourFactorForIndexedDiagramFromGraph[ + CXXDiagrams`IndexDiagramFromGraph[ + genericDiagram /. externalRules /. #, + adjacencyMatrix + ], + adjacencyMatrix + ]&, + GetFieldInsertions[diagram, True], + {2} + ] +]; +ColorFactors // secure; + +End[]; +EndPackage[]; diff --git a/meta/NPointFunctions/internal.m b/meta/NPointFunctions/internal.m deleted file mode 100644 index 2842127035..0000000000 --- a/meta/NPointFunctions/internal.m +++ /dev/null @@ -1,1367 +0,0 @@ -(* ::Package:: *) - -(* :Copyright: - - ==================================================================== - This file is part of FlexibleSUSY. - - FlexibleSUSY 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. - - FlexibleSUSY 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 FlexibleSUSY. If not, see - . - ==================================================================== - -*) - -(* There is a problem with Global`args which comes from mathematica paclets.*) -Quiet[Needs["FeynArts`"],{FeynArts`args::shdw}]; -(* Change this to 2 to see more output (if 1 then less). *) -FeynArts`$FAVerbose = 0; - -Needs["FormCalc`"]; -(* Change this to 1,2 or 3 to see more output. *) -FormCalc`$FCVerbose = 0; - -(* Next Format makes some pattern generate mistakes. *) -Format[FormCalc`DiracChain[FormCalc`Private`s1_FormCalc`Spinor,FormCalc`Private`om_,FormCalc`Private`g___,FormCalc`Private`s2_FormCalc`Spinor]] =.; -Needs["Utils`"]; - -BeginPackage["NPointFunctions`"]; - -{SetInitialValues,NPointFunctionFAFC} - -Off[General::shdw] -{ - LorentzIndex,GenericSum,GenericIndex, - GenericS,GenericF,GenericV,GenericU, - LoopLevel,Regularize,ZeroExternalMomenta,OnShellFlag,KeepProcesses, - - - DimensionalReduction,DimensionalRegularization,OperatorsOnly, - (*for further details inspect topologyReplacements*) - Irreducible,Triangles,FourFermionScalarPenguins, - FourFermionMassiveVectorPenguins,FourFermionFlavourChangingBoxes -} ~ SetAttributes ~ {Locked,Protected}; -On[General::shdw] - -Begin["`internal`"]; - -`type`vertex = FeynArts`Vertex[_Integer][_Integer]; -`type`propagator = FeynArts`Propagator[ FeynArts`External|FeynArts`Incoming|FeynArts`Outgoing|FeynArts`Internal|FeynArts`Loop[_Integer] ][`type`vertex,`type`vertex,Repeated[FeynArts`Field[_Integer],{0,1}]]; -`type`topology = FeynArts`Topology[_Integer][`type`propagator..]; -`type`diagramSet = FeynArts`TopologyList[_][Rule[`type`topology,FeynArts`Insertions[Generic][__]]..]; -`type`nullableDiagramSet = FeynArts`TopologyList[_][Rule[`type`topology,FeynArts`Insertions[Generic][___]]...]; - -`type`indexCol = - FeynArts`Index[Global`Colour,_Integer]; - -`type`indexGlu = - FeynArts`Index[Global`Gluon,_Integer]; - -`type`indexGeneric = - FeynArts`Index[Generic, _Integer]; -indexGeneric[index:_Integer] := - FeynArts`Index[Generic, index]; -indexGeneric // Utils`MakeUnknownInputDefinition; -indexGeneric ~ SetAttributes ~ {Protected,Locked}; - -`type`fieldFA = FeynArts`S|FeynArts`F|FeynArts`V|FeynArts`U; - -(*sec 6.1 of manual*) -`type`amplitude = FeynArts`FeynAmp[ - FeynArts`GraphID[FeynArts`Topology==_Integer,Generic==_Integer],(*name of the amplitude*) - Integral[FeynArts`FourMomentum[FeynArts`Internal,_Integer]],(*momentum of integration*) - _,(*generic analytic expression of the amplitude*) - {__}->FeynArts`Insertions[FeynArts`Classes][{__}..](*replacement rules to obtain the class level*) -]; - -`type`FAfieldGeneric = `type`fieldFA[`type`indexGeneric]; - -getProcess[diagrams:`type`diagramSet] := Cases[Head@diagrams, (FeynArts`Process->x_) :> x][[1]]; -getProcess // Utils`MakeUnknownInputDefinition; -getProcess ~ SetAttributes ~ {Protected,Locked}; - -getField[diagrams:`type`diagramSet,number:_Integer] := - Cases[diagrams[[1,2,1,2,1]],Rule[FeynArts`Field@number,x_] :> x][[1]] /; - 0FAModel,FeynArts`InsertionLevel->FeynArts`Classes]; - - (*Which index types do we load with the model?*) - `type`indexGen = FeynArts`Index[Alternatives@@Cases[MakeBoxes@Definition@FeynArts`IndexRange,RowBox@{"Index","[",name:Except["Colour"|"Gluon"],"]"}:>ToExpression["Global`"<>name],Infinity],_Integer]; - - (* Define type of masses *) - genericMass::usage=" - @note In FeynArts 3.11 the pattern for a generic mass was changed and now - contains Loop and Internal as well."; - With[{new=Repeated[Alternatives[FeynArts`Loop, FeynArts`Internal], {0, 1}]}, - `type`genericMass = - FeynArts`Mass[`type`fieldFA[`type`indexGeneric], new]; - genericMass[field:`type`fieldFA, index:_Integer] := - FeynArts`Mass[field@indexGeneric@index, new]; - genericMass[field:`type`fieldFA] := - FeynArts`Mass[field[`type`indexGeneric], new]; - genericMass // Utils`MakeUnknownInputDefinition; - genericMass ~ SetAttributes ~ {Protected,Locked}; - ]; - - `type`specificMass = - FeynArts`Mass[`type`fieldFA[_Integer, {Alternatives[`type`indexCol, `type`indexGlu, `type`indexGen]..}]]; - - {particleNamesFile,substitutionsFile,particleNamespaceFile}~ClearAttributes~{Protected}; - particleNamesFile = particleNamesFileS; - substitutionsFile = substitutionsFileS; - particleNamespaceFile = particleNamespaceFileS; - {particleNamesFile,substitutionsFile,particleNamespaceFile}~SetAttributes~{Protected, Locked}; - - SetFSConventionRules[]; -] /; Utils`AssertOrQuit[ - And@@(TrueQ[#=={Protected}] &/@ Attributes@{particleNamesFile,substitutionsFile,particleNamespaceFile}), - SetInitialValues::errOnce]; -SetInitialValues // Utils`MakeUnknownInputDefinition; -SetInitialValues ~ SetAttributes ~ {Protected,Locked}; - -SetFSConventionRules::usage= -"@brief Set the translation rules from FeynArts/FormCalc to FlexibleSUSY -language."; -SetFSConventionRules[] := -Module[ - { - pairSumIndex=Unique@"SARAH`lt", - fieldNames,indexRules,massRules,couplingRules,generalFCRules, - sumOverRules - }, - fieldNames = - Flatten[ - StringCases[ - Utils`ReadLinesInFile@particleNamesFile, - x__ ~~ ": " ~~ y:"S"|"V"|"U"|"F" ~~ "[" ~~ int__ ~~ "]" ~~ ___ :> {x,y,int}], - 1] /. - Apply[Rule, {#[[1]], #[[2]] <> #[[1]]} &/@ Get@particleNamespaceFile, 2]; - massRules = Append[Flatten[Module[ - {P="SARAH`Mass@"<>#,MassP=StringReplace[#,__~~"`"->"Global`Mass"]}, - { - ToExpression[MassP <> "@indices_:>" <> P <> - "@{Symbol[\"SARAH`gt\"<>StringTake[SymbolName@indices,-1]]}"], - ToExpression[MassP <> "@indices__:>" <> P <> "@{indices}"], - ToExpression[MassP <> "->" <> P] - } - ] &/@ fieldNames[[All, 1]] ], - FeynArts`Mass[field_, _ : Null] :> SARAH`Mass[field] - ]; - - couplingRules = - { - FeynArts`G[_][0][fields__][1] :> - SARAH`Cp[fields][1], - - FeynArts`G[_][0][fields__][ - FeynArts`NonCommutative[ - Global`ChiralityProjector[-1] - ] - ] :> - SARAH`Cp[fields][SARAH`PL], - - FeynArts`G[_][0][fields__][ - FeynArts`NonCommutative[ - Global`ChiralityProjector[1] - ] - ] :> - SARAH`Cp[fields][SARAH`PR], - - FeynArts`G[_][0][fields__][ - FeynArts`NonCommutative[ - Global`DiracMatrix@FeynArts`KI1@3, - Global`ChiralityProjector[-1] - ] - ] :> - SARAH`Cp[fields][SARAH`PL], - - FeynArts`G[_][0][fields__][ - FeynArts`NonCommutative[ - Global`DiracMatrix@FeynArts`KI1@3, - Global`ChiralityProjector[1] - ] - ] :> - SARAH`Cp[fields][SARAH`PR], - - FeynArts`G[_][0][fields__][ Global`MetricTensor[FeynArts`KI1[i1_Integer],FeynArts`KI1[i2_Integer]] ] :> - SARAH`Cp[fields][SARAH`g[ LorentzIndex[{fields}[[i1]]],LorentzIndex[{fields}[[i2]]]] ], - - FeynArts`G[_][0][fields__][ - FeynArts`Mom[ i1_Integer ] - FeynArts`Mom[ i2_Integer ] - ] :> - SARAH`Cp[fields][ - SARAH`Mom[ {fields}[[i1]] ] - SARAH`Mom[ {fields}[[i2]] ] - ], - - (*Since FormCalc-9.7*) - FeynArts`G[_][0][fields__][ - Global`FourVector[ - FeynArts`Mom[ i1_Integer ] - FeynArts`Mom[ i2_Integer ], - FeynArts`KI1[3] - ] - ] :> - SARAH`Cp[fields][ - SARAH`Mom[ {fields}[[i1]] ] - SARAH`Mom[ {fields}[[i2]] ] - ], - - (*VVV couplings*) - FeynArts`G[_][0][fields__][ - (-FeynArts`Mom[i1_Integer] + FeynArts`Mom[i2_Integer])* - Global`MetricTensor[FeynArts`KI1[i1_Integer],FeynArts`KI1[i2_Integer]] - + - (+FeynArts`Mom[i1_Integer] - FeynArts`Mom[i3_Integer])* - Global`MetricTensor[FeynArts`KI1[i1_Integer],FeynArts`KI1[i3_Integer]] - + - (-FeynArts`Mom[i2_Integer] + FeynArts`Mom[i3_Integer])* - Global`MetricTensor[FeynArts`KI1[i2_Integer],FeynArts`KI1[i3_Integer]] - ] :> - SARAH`Cp[fields][ - (SARAH`Mom[{fields}[[i2]], LorentzIndex[{fields}[[i3]]]] - - SARAH`Mom[{fields}[[i1]], LorentzIndex[{fields}[[i3]]]]) * - SARAH`g[LorentzIndex[ {fields}[[i1]] ],LorentzIndex[ {fields}[[i2]] ] ] - , - (SARAH`Mom[{fields}[[i1]], LorentzIndex[{fields}[[i2]]]] - - SARAH`Mom[{fields}[[i3]], LorentzIndex[{fields}[[i2]]]]) * - SARAH`g[LorentzIndex[ {fields}[[i1]] ],LorentzIndex[ {fields}[[i3]] ] ] - , - (SARAH`Mom[{fields}[[i3]], LorentzIndex[{fields}[[i1]]]] - - SARAH`Mom[{fields}[[i2]], LorentzIndex[{fields}[[i1]]]]) * - SARAH`g[LorentzIndex[ {fields}[[i2]] ],LorentzIndex[ {fields}[[i3]] ] ] - ], - - (* Since FormCalc-9.7 *) - FeynArts`G[_][0][fields__][ - Global`FourVector[-FeynArts`Mom[i1_Integer] + FeynArts`Mom[i2_Integer], FeynArts`KI1[i3_Integer]]* - Global`MetricTensor[FeynArts`KI1[i1_Integer], FeynArts`KI1[i2_Integer]] - + - Global`FourVector[+FeynArts`Mom[i1_Integer] - FeynArts`Mom[i3_Integer], FeynArts`KI1[i2_Integer]]* - Global`MetricTensor[FeynArts`KI1[i1_Integer], FeynArts`KI1[i3_Integer]] - + - Global`FourVector[-FeynArts`Mom[i2_Integer] + FeynArts`Mom[i3_Integer], FeynArts`KI1[i1_Integer]]* - Global`MetricTensor[FeynArts`KI1[i2_Integer], FeynArts`KI1[i3_Integer]] - ] :> - SARAH`Cp[fields][ - (SARAH`Mom[{fields}[[i2]], LorentzIndex[{fields}[[i3]]]] - - SARAH`Mom[{fields}[[i1]], LorentzIndex[{fields}[[i3]]]]) * - SARAH`g[LorentzIndex[ {fields}[[i1]] ],LorentzIndex[ {fields}[[i2]] ] ] - , - (SARAH`Mom[{fields}[[i1]], LorentzIndex[{fields}[[i2]]]] - - SARAH`Mom[{fields}[[i3]], LorentzIndex[{fields}[[i2]]]]) * - SARAH`g[LorentzIndex[ {fields}[[i1]] ],LorentzIndex[ {fields}[[i3]] ] ] - , - (SARAH`Mom[{fields}[[i3]], LorentzIndex[{fields}[[i1]]]] - - SARAH`Mom[{fields}[[i2]], LorentzIndex[{fields}[[i1]]]]) * - SARAH`g[LorentzIndex[ {fields}[[i2]] ],LorentzIndex[ {fields}[[i3]] ] ] - ] - }; - - (* @note Sec 4.4 of FormCalc manual *) - generalFCRules = - { - FormCalc`Finite -> 1, - FormCalc`Den[a_,b_] :> 1/(a-b), - FormCalc`Pair[a_,b_] :> SARAH`sum[ - pairSumIndex,1,4, - SARAH`g[pairSumIndex,pairSumIndex]*Append[a,pairSumIndex]*Append[b,pairSumIndex]], - fieldType_?(FAFieldQ)[FeynArts`Index[Generic,number_Integer]] :> fieldType@GenericIndex@number, - FormCalc`k[i_Integer,indexInPair___] :> SARAH`Mom[i,indexInPair] - }; - - indexRules = (* @note These index rules are specific to SARAH generated FeynArts model files.*) - { - index:`type`indexGen :> Symbol["SARAH`gt" <> ToString@Last@index], - index:`type`indexCol :> Symbol["SARAH`ct" <> ToString@Last@index], - index:`type`indexGlu :> (Print["Warning: check indexRules of internal.m"];Symbol["SARAH`ct" <> ToString@Last@index]) - }; - - sumOverRules = - { - FeynArts`SumOver[_,_,FeynArts`External] :> Sequence[], - Times[expr_,FeynArts`SumOver[index_,max_Integer]] :> - SARAH`sum[index,1,max,expr], - Times[expr_,FeynArts`SumOver[index_,{min_Integer,max_Integer}]] :> - SARAH`sum[index,min,max,expr], - SARAH`sum[index_,_Integer,max_Integer,FeynArts`SumOver[_,max2_Integer]] :> (* @todo check these weird convention rules *) - SARAH`sum[index,1,max,max2], (* *) - SARAH`sum[index_,_Integer,max_Integer,FeynArts`SumOver[_,{min2_Integer,max2_Integer}]](* *) - :> SARAH`sum[index,1,max,max2-min2] (* *) -}; - - Unprotect@fieldNameToFSRules; - fieldNameToFSRules = Join[ - Map[ToExpression,fieldNames,2] /. {name_,type_,number_}:>Rule[type@number,name], - Map[ToExpression,fieldNames,2] /. {name_,type_,number_}:>RuleDelayed[type[number,{indices__}],name@{indices}], - Map[ToExpression,fieldNames,2] /. - { - {name_,type:FeynArts`S|FeynArts`V,_}:>RuleDelayed[Times[-1,field:name],Susyno`LieGroups`conj@name], - {name_,type:FeynArts`U|FeynArts`F,_}:>RuleDelayed[Times[-1,field:name],SARAH`bar@name] - }, - Map[ToExpression,fieldNames,2] /. - { - {name_,type:FeynArts`S|FeynArts`V,_}:>RuleDelayed[Times[-1,field:name@{indices__}],Susyno`LieGroups`conj@name@{indices}], - {name_,type:FeynArts`U|FeynArts`F,_}:>RuleDelayed[Times[-1,field:name@{indices__}],SARAH`bar@name@{indices}] - }, - indexRules, - {FeynArts`S->GenericS,FeynArts`F->GenericF,FeynArts`V->GenericV,FeynArts`U->GenericU}, - { - Times[-1,field:_GenericS|_GenericV]:>Susyno`LieGroups`conj@field, - Times[-1,field:_GenericF|_GenericU]:>SARAH`bar@field - } - ]; - Protect@fieldNameToFSRules; - - Unprotect@subexpressionToFSRules; - subexpressionToFSRules = Join[ - massRules, - fieldNameToFSRules, - couplingRules, - generalFCRules - ]; - Protect@subexpressionToFSRules; - - Unprotect@amplitudeToFSRules; - amplitudeToFSRules = Join[ - subexpressionToFSRules, - sumOverRules, - {FeynArts`IndexSum -> Sum} - ]; - Protect@amplitudeToFSRules; -]; -SetFSConventionRules // Utils`MakeUnknownInputDefinition; -SetFSConventionRules ~ SetAttributes ~ {Protected,Locked}; - -Options[NPointFunctionFAFC]={ - LoopLevel -> 1, - Regularize -> DimensionalReduction, - ZeroExternalMomenta -> True, - OnShellFlag -> False, - KeepProcesses -> {} -}; -NPointFunctionFAFC::usage= -"@todo"; -NPointFunctionFAFC[inFields_,outFields_,OptionsPattern[]] := -Module[ - { - settingsForGenericSums,settingsForMomElim, - topologies, diagrams, amplitudes, genericInsertions, colourFactors, - fsFields, fsInFields, fsOutFields, externalMomentumRules, nPointFunction - }, - topologies = FeynArts`CreateTopologies[ - OptionValue@LoopLevel, - Length@inFields -> Length@outFields, - FeynArts`ExcludeTopologies -> getExcludedTopologies@OptionValue@KeepProcesses - ]; - If[List@@topologies === {},Return@`subkernel`error@`subkernel`message::errNoTopologies]; - diagrams = FeynArts`InsertFields[topologies,inFields->outFields]; - If[List@@diagrams === {},Return@`subkernel`error@`subkernel`message::errNoDiagrams]; - - diagrams = getModifiedDiagrams[diagrams,OptionValue@KeepProcesses]; - If[List@@diagrams === {},Return@`subkernel`error@`subkernel`message::errNoDiagrams]; - - amplitudes = FeynArts`CreateFeynAmp@diagrams; - amplitudes = Delete[amplitudes,Position[amplitudes,FeynArts`Index[Global`Colour,_Integer]]];(* @note Remove colour indices following assumption 1. *) - {diagrams,amplitudes} = getModifiedDA[{diagrams,amplitudes},OptionValue@KeepProcesses]; - - settingsForGenericSums = getRestrictionsOnGenericSumsByTopology@diagrams; - settingsForMomElim = getMomElimForAmplitudesByTopology@diagrams; - - genericInsertions = Map[Last,#,{3}] &@ Flatten[ (* Everything is sorted already, so we need only field-replacement names *) - GenericInsertionsForDiagram /@ (List @@ diagrams), 1]; - - colourFactors = Flatten[ - ColourFactorForDiagram /@ (List @@ diagrams), 1] //. - fieldNameToFSRules; - - fsInFields = Head[amplitudes][[1,2,1,All,1]] //. fieldNameToFSRules; - fsOutFields = Head[amplitudes][[1,2,2,All,1]] //. fieldNameToFSRules; - - fsFields = Join[fsInFields,fsOutFields]; - externalMomentumRules = Switch[OptionValue@ZeroExternalMomenta, - True, {SARAH`Mom[_Integer,_] :> 0}, - False|OperatorsOnly, {SARAH`Mom[i_Integer, lorIndex_] :> SARAH`Mom[fsFields[[i]], lorIndex]}]; - - nPointFunction = { - {fsInFields, fsOutFields}, - Insert[ - CalculateAmplitudes[amplitudes,settingsForMomElim,settingsForGenericSums,genericInsertions, - OptionValue@Regularize, - OptionValue@ZeroExternalMomenta, - OptionValue@OnShellFlag - ] /. externalMomentumRules, - colourFactors, - {1, -1}] - } -]; - -getRestrictionsOnGenericSumsByTopology[diagrams:`type`diagramSet] := -Module[ - { - processParticles = Delete[#,Position[#,FeynArts`Index[Global`Colour,_Integer]]] &/@ Flatten[List@@(getProcess@diagrams)], - newDiagrams = diagrams - }, - newDiagrams = If[`topologyQ`self1pinguinT@First@#, - (* Skip sum if FeynArts`Field@6 is the same as external particle 1 *) - First@# -> Table[{6 -> Or[ processParticles[[1]],-processParticles[[1]] ]},{Length@Last@#}], - #] &/@ diagrams; - - newDiagrams = If[`topologyQ`self3pinguinT@First@#, - (* Skip sum if FeynArts`Field@6 is the same as external particle 3 *) - First@# -> Table[{6 -> Or[ processParticles[[3]],-processParticles[[3]] ]},{Length@Last@#}], - #] &/@ newDiagrams; - - (*No more rules*) - newDiagrams = If[MatchQ[#,Rule[`type`topology,{__}]], - #, - (* Empty rules to skip *) - First@#->Table[{},{Length@Last@#}] - ] &/@ newDiagrams; - (* Simpler external form. *) - newDiagrams = Last /@ newDiagrams; - newDiagrams = Flatten[List@@newDiagrams,1]; - If[MatchQ[newDiagrams,{{Rule[_Integer,_]...}..}],newDiagrams,Print@"@todo FAILED";Quit[1]] -]; -getRestrictionsOnGenericSumsByTopology // Utils`MakeUnknownInputDefinition; -getRestrictionsOnGenericSumsByTopology ~ SetAttributes ~ {Protected,Locked}; - -getAdjacencyMatrix[topology:`type`topology] := -Module[ - { - propagatorPattern,needNewNumbers,adjacencies,adjacencyMatrix - }, - propagatorPattern[i_,j_,f___] := _[_][_[_][i],_[_][j],f]; - needNewNumbers = And[Max@@(topology/.propagatorPattern[i_,j_,___]:>Sequence[i,j])>100,MatchQ[List@@topology,{propagatorPattern[_,_]..}]]; - adjacencies = Tally[(List@@#)/.propagatorPattern[i_,j_,___]:>{{i,j},{j,i}}] &@ If[needNewNumbers,FeynArts`TopologySort@#,#] &@ topology; - adjacencyMatrix=Normal@SparseArray@Flatten[{#[[1,1]]->#[[2]],#[[1,2]]->#[[2]]} &/@ adjacencies] -]; -getAdjacencyMatrix // Utils`MakeUnknownInputDefinition; -getAdjacencyMatrix ~ SetAttributes ~ {Protected,Locked}; - -`restrictions`momenta = -{ - { - `topologyQ`pinguinT->2, - `topologyQ`boxS->2, - `topologyQ`boxT->2, - `topologyQ`boxU->2 - }, - Default->Automatic -}; - -getMomElimForAmplitudesByTopology::usage= -"@brief Uses internally defined replacement list funMomRules for definition of -momenta to eliminate in specific topologies. -@param diagrams Set of topologies with class insertions. -@returns {_Integer... | Automatic...} List of option values for FormCalc`MomElim -for every generic amplitude."; -getMomElimForAmplitudesByTopology::errOverlap= -"Some topology rules inside funMomRules overlap. Criteria should be defined in a -way, which gives unique distinction of topology."; -getMomElimForAmplitudesByTopology[ - diagrams:`type`diagramSet -] := -Module[ - { - replacements - }, - replacements = (getTopologyAmplitudeRulesByTopologyCriterion[diagrams,First@#]/.x_Integer:>Last@#) &/@ `restrictions`momenta[[1]]; - replacements = Transpose@replacements; - replacements = Switch[ Count[First/@#,True], - 0,First@#, - 1,#~Extract~Position[#,True][[1,1]], - _,Utils`AssertOrQuit[False,getMomElimForAmplitudesByTopology::errOverlap] - ] &/@ replacements; - replacements = If[First@#===False,#/.x_Integer:>`restrictions`momenta[[2,2]],#] &/@ replacements; - Flatten[Last/@replacements] -]; -getMomElimForAmplitudesByTopology // Utils`MakeUnknownInputDefinition; -getMomElimForAmplitudesByTopology ~ SetAttributes ~ {Protected,Locked}; - -getModifiedDA::usage = -"@brief Changes amplitudes and diagrams according to excudeProcess list. -@param {,} set of topology-insertion and -amplitude-insertion rules to modify. -@param set of names which specify the process to consider. -@returns {,} modified set, which specifies process."; -getModifiedDA[{diagrams:`type`diagramSet,amplitudes:`type`amplitudeSet},excludeProcesses_] := getModifiedDA[{diagrams,amplitudes},{excludeProcesses}]; -getModifiedDA[ - { - diagrams:`type`diagramSet, - amplitudes:`type`amplitudeSet - }, - excludeProcesses:{___} -] := -Module[ - { - i,numAmp,daPairs,numbersOfAmplitudes,massesOfVector,currentAmplitude,massPosition, - rulesForClassesToSave, newDiagrams = diagrams, newAmplitudes = amplitudes - }, - If[MemberQ[excludeProcesses,FourFermionMassiveVectorPenguins], - Print@"t-pinguins: tree-like massless vector bosons were removed"; - (* Step 1: Get positions of topologies and amplitudes to change. *) - daPairs = getTopologyAmplitudeRulesByTopologyCriterion[newDiagrams,`topologyQ`pinguinT]; - numbersOfAmplitudes = Flatten@Cases[daPairs,Rule[True,nums_]:>nums]; - (* Step 2: Get positions of classes to save. {->{classes to save}..}*) - rulesForClassesToSave=Reap[ - Do[ - numAmp = Part[numbersOfAmplitudes,i]; - currentAmplitude = newAmplitudes[[numAmp]]; - massPosition = Position[currentAmplitude[[4,1]],genericMass[FeynArts`V, 5]]; - If[massPosition=!={}, - massesOfVector = (And@@(#=!=0&/@#)&@Extract[#,massPosition]) &/@ currentAmplitude[[4,2]]; - Sow[numbersOfAmplitudes[[i]]->Array[If[massesOfVector[[#]],#,(##&)[]]&,Length@massesOfVector]];, - Sow[numbersOfAmplitudes[[i]]->All]; - ]; - ,{i,Length@numbersOfAmplitudes}] - ][[2,1]]; - newAmplitudes = deleteClasses[newAmplitudes,daPairs,rulesForClassesToSave]; - newDiagrams = deleteClasses[newDiagrams,daPairs,rulesForClassesToSave]; - printDiagramsInfo@newDiagrams; - ]; - If[MemberQ[excludeProcesses,FourFermionFlavourChangingBoxes], - Print@"boxes: massless vector bosons were removed"; - (* Step 1: Get positions of topologies and amplitudes to change. *) - daPairs = getTopologyAmplitudeRulesByTopologyCriterion[newDiagrams,`topologyQ`box]; - numbersOfAmplitudes = Flatten@Cases[daPairs,Rule[True,nums_]:>nums]; - (* Step 2: Get positions of classes to save. {->{classes to save}..}*) - rulesForClassesToSave=Reap[ - Do[ - numAmp = numbersOfAmplitudes[[i]]; - currentAmplitude = newAmplitudes[[numAmp]]; - massPosition = Position[currentAmplitude[[4,1]],genericMass@FeynArts`V]; - If[massPosition=!={}, - massesOfVector = (And@@(#=!=0&/@#)&@Extract[#,massPosition]) &/@ currentAmplitude[[4,2]]; - Sow[numbersOfAmplitudes[[i]]->Array[If[massesOfVector[[#]],#,(##&)[]]&,Length@massesOfVector]];, - Sow[numbersOfAmplitudes[[i]]->All]; - ]; - ,{i,Length@numbersOfAmplitudes}] - ][[2,1]]; - newAmplitudes = deleteClasses[newAmplitudes,daPairs,rulesForClassesToSave]; - newDiagrams = deleteClasses[newDiagrams,daPairs,rulesForClassesToSave]; - printDiagramsInfo@newDiagrams; - ]; - {newDiagrams,newAmplitudes} -]; -getModifiedDA // Utils`MakeUnknownInputDefinition; -getModifiedDA ~ SetAttributes ~ {Protected,Locked}; - -deleteClasses[amplitudes:`type`amplitudeSet,topoAmpList:`type`pickTopoAmp,classesToSave:`type`saveAmpClass] := -Module[{i,numbersOfAmplitudes,numAmp,result = amplitudes}, - numbersOfAmplitudes = Flatten@Cases[topoAmpList,Rule[True,nums_]:>nums]; - Do[ - numAmp = Part[numbersOfAmplitudes,i]; - result[[numAmp,4,2]] = result[[numAmp,4,2]][[numAmp/.classesToSave]]; - ,{i,Length@numbersOfAmplitudes}]; - result -]; -deleteClasses[diagrams:`type`diagramSet,topoAmpList:`type`pickTopoAmp,classesToSave:`type`saveAmpClass] := -Module[{i,currentClasses,result = diagrams}, - Do[ - If[topoAmpList[[i,1]]===True, - currentClasses = topoAmpList[[i,2]]/.classesToSave; - currentClasses = Array[Rule[{#,2},result[[i,2,#,2]][[Part[currentClasses,#]]]]&,Length@currentClasses]; - result[[i,2]] = ReplacePart[result[[i,2]],currentClasses]; - ]; - ,{i,Length@topoAmpList}]; - result -]; -deleteClasses // Utils`MakeUnknownInputDefinition; -deleteClasses ~ SetAttributes ~ {Protected,Locked}; - -getTopologyAmplitudeRulesByTopologyCriterion::usage= -"@brief Gives numbers of amplitudes which are accepted by a criterion on topology. -@param diagrams Set of diagrams to select from. -@param critFunction Function for topology selection. If -critFunction[] gives True, then topology is accepted. -@returns {} List of rules of the form ->{..}. LHS -stands for the topology, RHS gives numbers of classes (and the numbers of -amplitudes the same time)."; -getTopologyAmplitudeRulesByTopologyCriterion::errResult= -"Output -`1` -does not match desired pattern. - -Input values -`2` -`3`"; -getTopologyAmplitudeRulesByTopologyCriterion[ - diagrams:`type`diagramSet, - critFunction_ -] := -Module[ - { - topologies = List@@First/@diagrams, - genNums = Length/@(List@@Last/@diagrams), - numRegions,takeOrNot,res - }, - numRegions = Array[Range[Plus@@genNums[[1;;#-1]]+1,Plus@@genNums[[1;;#]]]&,Length@genNums]; - takeOrNot = Array[TrueQ@critFunction@Part[topologies,#]&,Length@topologies]; - res = MapThread[#1->#2&,{takeOrNot,numRegions}]; - If[MatchQ[res, {Rule[_?(# === True || # === False &), {__Integer}] ..}], - res, - Utils`AssertOrQuit[False,getTopologyAmplitudeRulesByTopologyCriterion::errResult,res,Unevaluated@diagrams,Unevaluated@critFunction]; - ] -]; -getTopologyAmplitudeRulesByTopologyCriterion // Utils`MakeUnknownInputDefinition; -getTopologyAmplitudeRulesByTopologyCriterion ~ SetAttributes ~ {Protected,Locked}; - -topologyReplacements::usage = -"@brief List of topology replacement rules for a processes to keep. -@note R.h.s. should be pure functions of one argument."; -topologyReplacements = -{ - Irreducible -> (FreeQ[#,FeynArts`Internal]&), (*@todo something weird with this definition*) - Triangles -> (FreeQ[FeynArts`ToTree@#,FeynArts`Centre@Except@3]&), - FourFermionFlavourChangingBoxes -> (`topologyQ`box@#&), - FourFermionScalarPenguins -> (`topologyQ`pinguinT@#&), - FourFermionMassiveVectorPenguins -> (`topologyQ`pinguinT@#&) -}; -topologyReplacements ~ SetAttributes ~ {Protected,Locked}; - -getExcludedTopologies::usage = -"@brief Registers and returns a function, whose outcome - True or everything -else - determines whether the topology is kept or discarded (see FeynArts -manual). -@param {} or _Symbol or {_Symbol} or {__Symbol} Name(s) of processes to hold. -@returns _Symbol Generated name of topologies to hold."; -getExcludedTopologies[{}] := {}; -getExcludedTopologies[{sym_Symbol}] := getExcludedTopologies@sym; -getExcludedTopologies[syms:{__Symbol}] := -Module[{excludeTopologyName}, - FeynArts`$ExcludeTopologies[excludeTopologyName] = (Or @@ Through[(syms/.topologyReplacements)@#])&; - excludeTopologyName]; -getExcludedTopologies[sym_Symbol] := -Module[{excludeTopologyName}, - FeynArts`$ExcludeTopologies[excludeTopologyName] = sym/.topologyReplacements; - excludeTopologyName]; -getExcludedTopologies // Utils`MakeUnknownInputDefinition; -getExcludedTopologies ~ SetAttributes ~ {Protected,Locked}; - -`topologyQ`pinguinT[topology:`type`topology] := -Or[ - `topologyQ`trianglepinguinT@topology, - `topologyQ`self1pinguinT@topology, - `topologyQ`self3pinguinT@topology -]; -`topologyQ`pinguinT // Utils`MakeUnknownInputDefinition; -`topologyQ`pinguinT ~ SetAttributes ~ {Protected,Locked}; - -`topologyQ`trianglepinguinT[topology:`type`topology] := -getAdjacencyMatrix@topology === {{0,0,0,0,1,0,0,0},{0,0,0,0,0,1,0,0},{0,0,0,0,0,0,1,0},{0,0,0,0,0,1,0,0},{1,0,0,0,0,0,1,1},{0,1,0,1,0,0,0,1},{0,0,1,0,1,0,0,1},{0,0,0,0,1,1,1,0}}; -`topologyQ`trianglepinguinT // Utils`MakeUnknownInputDefinition; -`topologyQ`trianglepinguinT ~ SetAttributes ~ {Protected,Locked}; - -`topologyQ`self1pinguinT[topology:`type`topology] := -getAdjacencyMatrix@topology === {{0,0,0,0,1,0,0,0},{0,0,0,0,0,1,0,0},{0,0,0,0,0,0,1,0},{0,0,0,0,0,1,0,0},{1,0,0,0,0,0,0,2},{0,1,0,1,0,0,1,0},{0,0,1,0,0,1,0,1},{0,0,0,0,2,0,1,0}}; -`topologyQ`self1pinguinT // Utils`MakeUnknownInputDefinition; -`topologyQ`self1pinguinT ~ SetAttributes ~ {Protected,Locked}; - -`topologyQ`self3pinguinT[topology:`type`topology] := -getAdjacencyMatrix@topology === {{0,0,0,0,1,0,0,0},{0,0,0,0,0,1,0,0},{0,0,0,0,0,0,1,0},{0,0,0,0,0,1,0,0},{1,0,0,0,0,1,0,1},{0,1,0,1,1,0,0,0},{0,0,1,0,0,0,0,2},{0,0,0,0,1,0,2,0}}; -`topologyQ`self3pinguinT // Utils`MakeUnknownInputDefinition; -`topologyQ`self3pinguinT ~ SetAttributes ~ {Protected,Locked}; - -`topologyQ`boxS[topology:`type`topology] := -getAdjacencyMatrix@topology === {{0,0,0,0,1,0,0,0},{0,0,0,0,0,1,0,0},{0,0,0,0,0,0,1,0},{0,0,0,0,0,0,0,1},{1,0,0,0,0,1,1,0},{0,1,0,0,1,0,0,1},{0,0,1,0,1,0,0,1},{0,0,0,1,0,1,1,0}}; -`topologyQ`boxS // Utils`MakeUnknownInputDefinition; -`topologyQ`boxS ~ SetAttributes ~ {Protected,Locked}; - -`topologyQ`boxT[topology:`type`topology] := -getAdjacencyMatrix@topology === {{0,0,0,0,1,0,0,0},{0,0,0,0,0,1,0,0},{0,0,0,0,0,0,1,0},{0,0,0,0,0,0,0,1},{1,0,0,0,0,1,0,1},{0,1,0,0,1,0,1,0},{0,0,1,0,0,1,0,1},{0,0,0,1,1,0,1,0}}; -`topologyQ`boxT // Utils`MakeUnknownInputDefinition; -`topologyQ`boxT ~ SetAttributes ~ {Protected,Locked}; - -`topologyQ`boxU[topology:`type`topology] := -getAdjacencyMatrix@topology === {{0,0,0,0,1,0,0,0},{0,0,0,0,0,1,0,0},{0,0,0,0,0,0,1,0},{0,0,0,0,0,0,0,1},{1,0,0,0,0,0,1,1},{0,1,0,0,0,0,1,1},{0,0,1,0,1,1,0,0},{0,0,0,1,1,1,0,0}}; -`topologyQ`boxU // Utils`MakeUnknownInputDefinition; -`topologyQ`boxU ~ SetAttributes ~ {Protected,Locked}; - -`topologyQ`box[topology:`type`topology] := -Or[`topologyQ`boxS@topology,`topologyQ`boxT@topology,`topologyQ`boxU@topology]; -`topologyQ`box // Utils`MakeUnknownInputDefinition; -`topologyQ`box ~ SetAttributes ~ {Protected,Locked}; - -getModifiedDiagrams::usage = -"@brief Modifies diagrams according to excudeProcess list. -@param set of topology-insertion rules to modify. -@param set of names which specify the process to consider. -@returns modified set of diagrams."; -getModifiedDiagrams[ - inserted:`type`diagramSet, - excludeProcesses_ -] := -getModifiedDiagrams[inserted,{excludeProcesses}]; -getModifiedDiagrams[ - inserted:`type`diagramSet, - excludeProcesses:{___}] := -Module[ - { - newInserted = inserted,leptonPattern - }, - If[Not[MemberQ[excludeProcesses,FourFermionScalarPenguins]&& - MemberQ[excludeProcesses,FourFermionMassiveVectorPenguins]], - If[MemberQ[excludeProcesses,FourFermionScalarPenguins], - newInserted = If[`topologyQ`pinguinT[#[[1]]], - #[[1]]->FeynArts`DiagramSelect[#[[2]],FreeQ[#,FeynArts`Field@5->FeynArts`V]&], - #] &/@ newInserted; - newInserted = removeTopologiesWithoutInsertions@newInserted; - Print@"t-penguins: tree-like vector bosons were removed"; - printDiagramsInfo@newInserted; - ]; - If[MemberQ[excludeProcesses,FourFermionMassiveVectorPenguins], - newInserted = If[`topologyQ`pinguinT[#[[1]]], - #[[1]]->FeynArts`DiagramSelect[#[[2]],FreeQ[#,FeynArts`Field@5->FeynArts`S]&], - #] &/@ newInserted; - newInserted = removeTopologiesWithoutInsertions@newInserted; - Print@"t-penguins: tree-like scalar bosons were removed"; - printDiagramsInfo@newInserted; - ]; - ]; - If[Or@@(MemberQ[excludeProcesses,#]&/@{FourFermionScalarPenguins,FourFermionMassiveVectorPenguins}), - leptonPattern = getField[newInserted,1]/.index:`type`indexGen:>Blank[]; - newInserted = If[`topologyQ`self1pinguinT[#[[1]]], - #[[1]]->removeGenericInsertionsBy[#[[2]],FeynArts`Field[7|8]->leptonPattern], - #] &/@ newInserted; - newInserted = removeTopologiesWithoutInsertions@newInserted; - leptonPattern = getField[newInserted,3]/.index:`type`indexGen:>Blank[]; - newInserted = If[`topologyQ`self3pinguinT[#[[1]]], - #[[1]]->removeGenericInsertionsBy[#[[2]],FeynArts`Field[7|8]->leptonPattern], - #] &/@ newInserted; - newInserted = removeTopologiesWithoutInsertions@newInserted; - Print@"t-penguins: external leptons in sed-like processes were removed"; - printDiagramsInfo@newInserted; - - leptonPattern = getField[newInserted,1]/.index:`type`indexGen:>Blank[]; - newInserted = If[`topologyQ`trianglepinguinT[#[[1]]], - #[[1]]->removeGenericInsertionsBy[#[[2]],FeynArts`Field[6|7]->leptonPattern], - #] &/@ newInserted; - newInserted = removeTopologiesWithoutInsertions@newInserted; - Print@"t-penguins: external leptons in triangle loop were removed"; - printDiagramsInfo@newInserted; - ]; - If[MemberQ[excludeProcesses,FourFermionFlavourChangingBoxes], - leptonPattern = getField[newInserted,1]/.index:`type`indexGen:>Blank[]; - newInserted = If[`topologyQ`boxS[#[[1]]], - #[[1]]->removeGenericInsertionsBy[#[[2]],FeynArts`Field[6]->leptonPattern], - #] &/@ newInserted; - newInserted = removeTopologiesWithoutInsertions@newInserted; - Print["s-boxes: loops with initial lepton are removed"]; - printDiagramsInfo@newInserted; - ]; - If[MemberQ[excludeProcesses,FourFermionFlavourChangingBoxes], - - newInserted = If[`topologyQ`boxT[#[[1]]], - Print["Warning: t-boxes are non-zero: @todo implement rules"];#, - #] &/@ newInserted; - - leptonPattern = getField[newInserted,1]/.index:`type`indexGen:>Blank[]; - newInserted = If[`topologyQ`boxU[#[[1]]], - #[[1]]->removeGenericInsertionsBy[#[[2]],FeynArts`Field[5]->leptonPattern], - #] &/@ newInserted; - newInserted = removeTopologiesWithoutInsertions@newInserted; - Print["u-boxes: loops with initial lepton were deleted"]; - printDiagramsInfo@newInserted; - ]; - newInserted -]; -getModifiedDiagrams // Utils`MakeUnknownInputDefinition; -getModifiedDiagrams ~ SetAttributes ~ {Protected,Locked}; - -removeTopologiesWithoutInsertions[diagrams:`type`nullableDiagramSet] := - diagrams /. (FeynArts`Topology[_][__]->FeynArts`Insertions[Generic][]):>(##&[]); -removeTopologiesWithoutInsertions // Utils`MakeUnknownInputDefinition; -removeTopologiesWithoutInsertions ~ SetAttributes ~ {Protected,Locked}; - -removeClassInsertionsBy[classInsertions:FeynArts`Insertions[FeynArts`Classes][__],pattern___] := -Module[{i,classList}, - classList = Cases[classInsertions,Except[FeynArts`FeynmanGraph[_Integer,FeynArts`Classes==_Integer][___,Sequence@@{pattern},___]]]; - If[classList=!={}, - classList=Table[classList[[i]]/.Equal[FeynArts`Classes,x_Integer]:>FeynArts`Classes==i,{i,Length@classList}] - ]; - Head[classInsertions]@@classList -]; -removeClassInsertionsBy // Utils`MakeUnknownInputDefinition; -removeClassInsertionsBy ~ SetAttributes ~ {Protected,Locked}; - -removeGenericInsertionsBy[genericInsertions:FeynArts`Insertions[Generic][__],pattern___] := -Module[{i,genericList}, - genericList = Rule[#[[1]],removeClassInsertionsBy[#[[2]],pattern]] &/@ genericInsertions; - genericList = genericList /. Rule[FeynArts`FeynmanGraph[_Integer,Generic==_Integer][__],FeynArts`Insertions[FeynArts`Classes][]] :> (##&[]); - If[genericList=!=FeynArts`Insertions[Generic][], - genericList = Table[genericList[[i]]/.Equal[Generic,x_Integer]:>Generic==i,{i,Length@genericList}] - ]; - Head[genericInsertions]@@genericList -]; -removeGenericInsertionsBy // Utils`MakeUnknownInputDefinition; -removeGenericInsertionsBy ~ SetAttributes ~ {Protected,Locked}; - -printDiagramsInfo[ - diagrams:`type`diagramSet, - where_String:" " -] := -Module[ - { - nGeneric = Length@Cases[diagrams,Generic==_Integer:>1,Infinity,Heads -> True], - nClasses = Length@Cases[diagrams,FeynArts`Classes==_Integer:>1,Infinity,Heads -> True] - }, - Print[where,"in total: ",nGeneric," Generic, ",nClasses," Classes insertions"]; -]; -printAmplitudesInfo[ - amplitudes:FeynArts`FeynAmpList[__][FeynArts`FeynAmp[__,{__}->FeynArts`Insertions[FeynArts`Classes][{__}..]]..], - where_String:"new" -] := -Module[ - { - nGeneric = Length@amplitudes, - nClasses = Plus@@(Length[#[[4,2]]]&/@amplitudes) - }, - Print[where,": in total: ",nGeneric," Generic, ",nClasses," Classes amplitudes"]; -]; - -debugMakePictures[ - diagrams:`type`diagramSet, - name_String:"classes" -] := -Module[ - { - directory = FileNameJoin[Most[FileNameSplit@@FeynArts`$Model]] - }, - DeleteFile[FileNames[FileNameJoin@{directory, name<>"*"}]]; - Export[FileNameJoin@{directory,name<>".png"},FeynArts`Paint[diagrams, - FeynArts`PaintLevel->{FeynArts`Classes}, - FeynArts`SheetHeader->name, - FeynArts`Numbering->FeynArts`Simple]]; -]; - -GenericInsertionsForDiagram::usage= -"@brief applies FindGenericInsertions[] to a -(Topology[_]->Insertions[Generic][__]) rule. -@returns list (for a given topology) of list (for all generic fields) -of list (for all class fields) of rules {{{x->y,..},..},..} -@param 1st argument is of the form Topology[_]->Insertions[Generic][__] -from FeynArts TopologyList[__][Topology[_]->Insertions[Generic][__],___] -@param 2nd argument changes the type of output field names -@note all indices in rhs. of rules are removed"; -GenericInsertionsForDiagram[_->insertGen_, keepFieldNum_:False]:= -Map[FindGenericInsertions[#,keepFieldNum]&, Apply[List,insertGen,{0,1}]]; - -FindGenericInsertions::usage= -"@brief generic FeynmanGraph has rules Field[num]->particleType, -class FeynmanGraph has rules Field[num]->particleClass. -This function gives pairs particleType[gen,num]->particleClass, avoiding -Field[_] mediator (if keepFieldNum==True then Field[_]->particleClass is given) -@param 1st argument is of the form -{FeynmanGraph[__][__],Insertions[Classes][__]} -@param 2nd argument changes the type of output field names -True gives Field[_] names, False gives particleClass names -@returns list (sorted; for all generic fields) of list (for all class fields) -of rules {{x->y,..},..} -@note this function is called by GenericInsertionsForDiagram[] -@note this function doesn't look at external particles -@note all indices in rhs. of rules are removed"; -FindGenericInsertions[{graphGen_,insertCl_}, keepFieldNum_]:= -Module[ - { - toGenericIndexConventionRules = Cases[graphGen, - Rule[FeynArts`Field[index_Integer],type_Symbol] :> - Rule[FeynArts`Field@index, type[FeynArts`Index[Generic,index]]] - ], - fieldsGen, genericInsertions - }, - fieldsGen = toGenericIndexConventionRules[[All,1]]; - genericInsertions = Cases[#, - Rule[genericField_,classesField_] /; MemberQ[fieldsGen, genericField] :> - Rule[genericField, StripParticleIndices@classesField]] &/@ insertCl; - SortBy[#,First]&/@ If[keepFieldNum, - List @@ genericInsertions, - List @@ genericInsertions /. toGenericIndexConventionRules - ] -]; - -StripParticleIndices::usage= -"@brief Remove particle indices from a given (possibley generic) field -@param field the given field -@returns the given field with all indices removed"; -StripParticleIndices[Times[-1,field_]] := - Times[-1, StripParticleIndices[field]]; -StripParticleIndices[genericType_[classIndex_, ___]] := - genericType[classIndex]; - -ColourFactorForDiagram::usage= -"@brief acts on a (Topology[_]->Insertions[Generic][__]) rule. -creates adjacency matrix and field array for this topology and uses this -information for creation of colour factors for a given topology -@param diagram (Topology[_]->Insertions[Generic][__]) rule -@returns list (for a given topology) of lists (for all generic fields) of -(potentially) colour factors -@note during generation of genericDiagram at 1-loop level the ii-type loop -propagators have the largest number because of FeynArts -@note in seqProp numbers of the first vertices inside propagators are sorted -by FeynArts -@note external fields always come at first places in adjacency matrix -@note this function doesn't know anything about CXXDiagrams`.` context"; -ColourFactorForDiagram[ - diagram:(_[_][seqProp__]->_[_][_[__][rulesFields__]->_,___])] := -Module[ - { - propPatt,adjacencyMatrix,externalRules,genericDiagram,genericInsertions - }, - propPatt[i_, j_, f_] := _[_][_[_][i], _[_][j], f]; - - adjacencyMatrix = Module[ - {adjs = Tally[{seqProp}/.propPatt[i_,j_,_]:>{{i,j},{j,i}}] }, - Normal@SparseArray@Flatten[{#[[1,1]]->#[[2]],#[[1,2]]->#[[2]]} &/@ adjs]]; - - externalRules = Cases[{rulesFields}, HoldPattern[_[_]->_Symbol[__]]]; - - genericDiagram = Module[ - {fld = Flatten[{seqProp}/.propPatt[i_,j_,f_]:>{{j,i,-f},{i,j,f}}, 1] }, - GatherBy[SortBy[fld,First],First] /. {_Integer, _Integer, f_} :> f - ] /. Join[ {#} -> # &/@ externalRules[[All, 1]]]; - - genericInsertions = GenericInsertionsForDiagram[diagram,True]; - - Map[CXXDiagrams`ColourFactorForIndexedDiagramFromGraph[ - CXXDiagrams`IndexDiagramFromGraph[ - genericDiagram /. externalRules /. #, adjacencyMatrix], - adjacencyMatrix] &, - genericInsertions, - {2}] -]; - -CalculateAmplitudes::usage= -"@brief Calculate a given set of amplitudes. -@param amps A set of class level amplitudes as generated by -FeynArts`.`CreateFeynAmp[] (with colour indices removed) -form: -FeynAmpList[___][FeynAmp[ - GraphID[__], - Integral[mom_], - amp_, - {whatIsInAmp___}->Insertion[Classes][{howToReplace___}..]]..] -@param settingsForMomElim Sets up the MomElim option. -@param @todo. -@param genericInsertions the list of generic insertions for the amplitudes -@param regularizationScheme the regularization scheme for the calculation -@param zeroExternalMomenta True if external momenta should be set to zero and -False otherwise -@returns a list of the format {fsAmplitudes, subexpressions} where -fsAmplitudes denote the calculated amplitudes and subexpressions denote -the subexpressions used to simplify the expressions"; -CalculateAmplitudes[ - amps:FeynArts`FeynAmpList[___,FeynArts`Process->proc_,___][feynAmps:_[__]..], - settingsForMomElim_List, - settingsForGenericSums:{{Rule[_Integer,_]...}..}, - genericInsertions_List, - regularizationScheme_, - zeroExternalMomenta_, - onShellFlag_] := -Module[ - { - combinatorialFactors = CombinatorialFactorsForClasses /@ {feynAmps}, - ampsGen = FeynArts`PickLevel[Generic][amps], - numExtParticles = Plus@@Length/@proc, - calculatedAmplitudes,abbreviations,subexpressions, - zeroedRules - }, - ampsGen = If[zeroExternalMomenta===True, - FormCalc`OffShell[ampsGen, Sequence@@Array[#->0&,numExtParticles] ], (* Relations Mom[i]^2 = 0 are true now. *) - ampsGen]; - - subWrite["\nAmplitude calculation started ...\n"]; - `time`set[]; - calculatedAmplitudes = applyAndPrint[ - FormCalc`CalcFeynAmp[Head[ampsGen][#1], - FormCalc`Dimension -> Switch[regularizationScheme, - DimensionalReduction, 4, - DimensionalRegularization, D], - FormCalc`OnShell -> onShellFlag, - FormCalc`FermionChains -> FormCalc`Chiral, - FormCalc`FermionOrder -> Switch[numExtParticles,4,{4,2,3,1},2,{2,1},_,None], - FormCalc`Invariants -> False, - FormCalc`MomElim -> #2]&, - {ampsGen,settingsForMomElim}] //. FormCalc`GenericList[]; - subWrite["Amplitude calculation started ... done in "<>`time`get[]<>" seconds.\n"]; - - calculatedAmplitudes = ToGenericSum ~ MapThread ~ {calculatedAmplitudes,settingsForGenericSums}; - - abbreviations=FormCalc`Abbr[] //. FormCalc`GenericList[] /. ch:FormCalc`DiracChain[__]:>simplifySimpleChain[ch,numExtParticles]; - If[zeroExternalMomenta === OperatorsOnly, abbreviations = Expand@abbreviations /. ch:FormCalc`DiracChain[x__]*FormCalc`DiracChain[y__] :> nullifyMomentaChains@ch]; - {calculatedAmplitudes,abbreviations} = uniqueChains[calculatedAmplitudes,abbreviations]; - - abbreviations = identifySpinors[abbreviations,ampsGen]; - subexpressions = FormCalc`Subexpr[] //. FormCalc`GenericList[]; - - If[zeroExternalMomenta, - abbreviations = setZeroExternalMomentaInChains@abbreviations; - zeroedRules = Cases[FormCalc`Abbr[], - Rule[_,pair:FormCalc`Pair[FormCalc`k[_], FormCalc`k[_]]] - :> (pair->0)]; - {abbreviations, zeroedRules} = ZeroRules[abbreviations, zeroedRules]; - {subexpressions, zeroedRules} = ZeroRules[subexpressions, zeroedRules]; - calculatedAmplitudes = calculatedAmplitudes /. zeroedRules;]; - - FCAmplitudesToFSConvention[ - {calculatedAmplitudes, genericInsertions, combinatorialFactors}, - abbreviations, subexpressions] -]; - -`time`time = AbsoluteTime[]; -`time`time ~ SetAttributes ~ {Protected}; - -`time`set[] := ( - Unprotect@`time`time; - `time`time = AbsoluteTime[]; - Protect@`time`time; -); -`time`set // Utils`MakeUnknownInputDefinition; -`time`set ~ SetAttributes ~ {Locked,Protected}; - -`time`get[] := - ToString@N[AbsoluteTime[]-`time`time,{Infinity,3}]; -`time`get // Utils`MakeUnknownInputDefinition; -`time`get ~ SetAttributes ~ {Locked,Protected}; - - -(*@Todo think how to implement this in an elegant way.*) -uniqueChains[calculatedAmplitudes_,rules:{}] := -{calculatedAmplitudes,rules}; -uniqueChains[calculatedAmplitudes_,rules:{Rule[_Symbol,_]..}] := -Module[{chainRules,otherRules,zeroChainRules,uniqueChains,amplitudeRules}, - chainRules = Cases[rules,chain:Rule[_?(StringMatchQ[ToString@#,RegularExpression@"[F][1-9][\\d]*"]&),_]:>chain]; - otherRules = rules ~ Complement ~ chainRules; - zeroChainRules = Cases[chainRules,chain:Rule[_,0]:>chain]; - chainRules = chainRules ~ Complement ~ zeroChainRules; - uniqueChains = DeleteDuplicates@Cases[chainRules,FormCalc`DiracChain[x__]*FormCalc`DiracChain[y__],Infinity]; - If[uniqueChains === {},uniqueChains = DeleteDuplicates@Cases[chainRules,FormCalc`DiracChain[__],Infinity]]; - uniqueChains = MapThread[Rule[Symbol["NPointFunctions`internal`dc"<>ToString@#1],#2]&,{Range@Length@#,#}] & [uniqueChains]; - amplitudeRules = Rule[FormCalc`Mat@First@#,Last@#] &/@ (chainRules/.(uniqueChains/.Rule[x_,y_]:>Rule[y,NPointFunctions`internal`mat@x])); - {calculatedAmplitudes/.zeroChainRules/.amplitudeRules,Join[uniqueChains,otherRules]} -]; - -(*@Todo think how to implement this in an elegant way.*) -simplifySimpleChain[chain_FormCalc`DiracChain,numExtParticles_Integer] := -Module[ - { - ch=FormCalc`DiracChain,spinor,flip,k=FormCalc`k,result - }, - spinor[mom_:_,mass_:_,type_:1|-1] := FormCalc`Spinor[k[mom],mass,type]; - flip@7 = 6; - flip@6 = 7; - result = If[numExtParticles === 4, - chain //. - { - ch[s1:spinor[3],proj:6|7,k@2,s2:spinor[1]] :> ch[s1,proj,k@1,s2]+ch[s1,proj,k@4,s2]-ch[s1,proj,k@3,s2], - ch[s1:spinor[3],proj:-6|-7,k@1,k@4,s2:spinor[1,mass_]] :> FormCalc`Pair[k@4,k@1]*ch[s1,-proj,s2]-Last[s2]*mass*ch[s1,-proj,k@4,s2], - ch[s1:spinor[4,mass_],proj:-6|-7,k@1,k@4,s2:spinor[2]] :> FormCalc`Pair[k@4,k@1]*ch[s1,-proj,s2]-Last[s1]*mass*ch[s1,flip[-proj],k@1,s2] - }, - chain - ]; - result //. - { - ch[s1:spinor[],proj:6|7,k[number_],s2:spinor[number_,mass_]] :> Last[s2]*mass*ch[s1,proj,s2], - ch[s1:spinor[number_,mass_],proj:6|7,k[number_],s2:spinor[]] :> Last[s2]*mass*ch[s1,flip@proj,s2] - } -]; - -(*@Todo think how to implement this in an elegant way.*) -nullifyMomentaChains[Times[chain1_FormCalc`DiracChain,chain2_FormCalc`DiracChain]] := -Module[ - { - ch=FormCalc`DiracChain,spinor,flip,k=FormCalc`k,l=FormCalc`Lor - }, - spinor[mom_:_,mass_:_,type_:1|-1] := FormCalc`Spinor[k[mom],mass,type]; - flip@7 = 6; - flip@6 = 7; - chain1*chain2 /. - { - ch[spinor[3],6|7,k@4,spinor[1]] -> 0, - ch[spinor[4],6|7,k@1,spinor[2]] -> 0, - ch[spinor[3],6|7,l@1,spinor[1]]*ch[spinor[4],-6|-7,k@1,l@1,spinor[2]] -> 0, - ch[spinor[3],-6|-7,k@4,l@1,spinor[1]]*ch[spinor[4],6|7,l@1,spinor[2]] -> 0, - ch[spinor[3],-6|-7,k@4,l@1,spinor[1]]*ch[spinor[4],-6|-7,k@1,l@1,spinor[2]] -> 0, - ch[spinor[3],-6|-7,k@4,l@1,l@2,spinor[1]]*ch[spinor[4],-6|-7,k@1,l@1,l@2,spinor[2]] -> 0, - - ch[spinor[3],-6|-7,k@1,k@4,l@1,spinor[1]]*ch[spinor[4],6|7,l@1,spinor[2]] -> 0, - ch[spinor[3],6|7,l@1,spinor[1]]*ch[spinor[4],-6|-7,k@1,k@4,l@1,spinor[2]] -> 0 - } -]; - -setZeroExternalMomentaInChains::usage = -"@brief Sets FormCalc`k[i] to zero inside fermioinic chains. -@param abbreviations list of rules. -@returns Changed list of rules."; -setZeroExternalMomentaInChains::errUnknownInput = -"Input should be -setZeroExternalMomentaInChains@@{ } -and not -setZeroExternalMomentaInChains@@`1`"; -setZeroExternalMomentaInChains[abbreviations:{Rule[_,_]...}] := -Module[ - { - replaceMomenta,temp,setZeroChainToZero - }, - replaceMomenta[expr_] := expr/.FormCalc`k[_Integer]:>0; - temp = abbreviations/.chain:FormCalc`DiracChain[__] :> replaceMomenta@chain; - setZeroChainToZero[FormCalc`DiracChain[__,0,__]] := 0; - setZeroChainToZero[chain:FormCalc`DiracChain[__]] := chain; - temp/.chain:FormCalc`DiracChain[__] :> setZeroChainToZero@chain -]; -setZeroExternalMomentaInChains[x___] := -Utils`AssertOrQuit[False,setZeroExternalMomentaInChains::errUnknownInput,{x}]; -SetAttributes[setZeroExternalMomentaInChains,{Protected,Locked}]; - -identifySpinors::usage = -"@brief Inserts the names of fermionic fields inside FormCalc`DicaChain structures. -@param inp List of abbreviations to modify | FormCalc`DiracChain chain to modify. -@param ampsGen FeynArts`FeynAmpList with information of process -@returns DiracChain with inserted fermion names | Expression with new DiracChains. -@note DiracChains live only inside FormCalc`Abbr. -@note Should NOT be used for Automatic FormCalc`FermionOrder."; -identifySpinors[ - inp:{Rule[_,_]...}, - ampsGen:FeynArts`FeynAmpList[ - ___, - (FeynArts`Process->Rule[{{__}..},{{__}..}]), - ___, - FeynArts`AmplitudeLevel->{Generic}, - ___][___]] := -inp/.ch:FormCalc`DiracChain[__]:>identifySpinors[ch,ampsGen]; -identifySpinors[ - FormCalc`DiracChain[ - FormCalc`Spinor[FormCalc`k[fermion1_Integer],mass1_,1|-1], - seqOfElems___, - FormCalc`Spinor[FormCalc`k[fermion2_Integer],mass2_,1|-1]], - FeynArts`FeynAmpList[ - ___, - process:(FeynArts`Process->Rule[{{__}..},{{__}..}]), - ___, - FeynArts`AmplitudeLevel->{Generic}, - ___][___] -] := -Module[ - { - identificationRules = getFieldPositionRules@process - }, - FormCalc`DiracChain[ - FormCalc`Spinor[fermion1/.identificationRules,FormCalc`k[fermion1],mass1], - seqOfElems, - FormCalc`Spinor[fermion2/.identificationRules,FormCalc`k[fermion2],mass2]] -]; -identifySpinors // Utils`MakeUnknownInputDefinition; -identifySpinors ~ SetAttributes ~ {Protected,Locked}; - -getFieldPositionRules::usage = -"@brief Gives rules of the form number_of_input_field->name_of_fermion. -@param FeynArts`Process->Rule[_,_]. -@returns Rules of the form number_of_input_field->name_of_fermion."; -getFieldPositionRules[ - FeynArts`Process->Rule[in:{{__}..},out:{{__}..}] -] := -MapThread[Rule,{Range@Length@#,#//.fieldNameToFSRules}] & [Part[in,All,1]~Join~Part[out,All,1]]; -getFieldPositionRules // Utils`MakeUnknownInputDefinition; -getFieldPositionRules ~ SetAttributes ~ {Protected,Locked}; - -getNumberOfChains::usage = -"@brief Is used to calculate number of opened fermion chains. -@param FeynArts`FeynAmpList[..][..] -@returns Number of opened fermion chains."; -getNumberOfChains::errNumberOfFermions = -"During evaluation unexpected value of fermions `1` was calculated."; -getNumberOfChains::errUnknownInput = -"Input should be -getNumberOfExternalFermions@@{ FeynArts`FeynAmpList[___][___] } -and not -getNumberOfExternalFermions@@`1`"; -getNumberOfChains[ - FeynArts`FeynAmpList[ - ___, - FeynArts`Process->Rule[in:{{__}..},out:{{__}..}], - ___, - FeynArts`AmplitudeLevel->{Generic}, - ___][___] -] := -Module[{numberOfChains = 0}, - Cases[Join[in[[All,1]],out[[All,1]]],FeynArts`F[__]|-FeynArts`F[__]:>numberOfChains++,{1}]; - numberOfChains /= 2; - If[IntegerQ@numberOfChains && numberOfChains >= 0, - numberOfChains, - Utils`AssertOrQuit[False,getNumberOfChains::errNumberOfFermions,numberOfChains] - ] -]; -getNumberOfChains[x___] := -Utils`AssertOrQuit[False,getNumberOfChains::errUnknownInput,{x}] -SetAttributes[getNumberOfChains,{Protected,Locked}]; - -applyAndPrint[func_,{expr_,opts_List},defLength_Integer:70] := -Module[ - { - now, - totL = Length@expr, - write, - percent, - numOfEq, - restL, - result - }, - restL=defLength-2*IntegerLength@totL-11; - result=Reap[ - Do[ - percent = now/totL; - numOfEq = If[#<0,0,#]&[ Floor[percent*restL]-1 ]; - subWrite@StringJoin[ - "[",StringJoin@@Array[" "&,IntegerLength@totL-IntegerLength@now],ToString@now,"/",ToString@totL,"]"," ", - "[",StringJoin@@Array["="&,numOfEq],">",StringJoin@@Array[" "&,restL-numOfEq-1],"] ",ToString@Floor[100*percent],"%\r"]; - Sow@func[ expr[[now]], opts[[now]] ];, - {now,totL}] - ][[2,1]]; - subWrite@"\033[K\033[A"; - result -]; - -CombinatorialFactorsForClasses::usage=" -@brief Takes generic amplitude and finds numerical combinatirical factors - which arise at class level. -@returns list of combinatorical factors for a given generic amplitude -@param FeynArts`.`FeynAmp[__]"; -CombinatorialFactorsForClasses[ - FeynArts`FeynAmp[_,_,_,rules_->_[_][classReplacements__]] -]:= - {classReplacements}[[ All,#[[1,1]] ]] /. - { - FeynArts`IndexDelta[___] -> 1, - FeynArts`SumOver[__] -> 1 - } &@ - Position[rules, FeynArts`RelativeCF]; -CombinatorialFactorsForClasses // Utils`MakeUnknownInputDefinition; -CombinatorialFactorsForClasses ~ SetAttributes ~ {Locked,Protected}; - -ToGenericSum::usage= -"@todo -@brief Given a generic amplitude, determine the generic fields over which it -needs to be summed and return a corresponding GenericSum[] object. -@param FormCalc`Amp[_->_][amp_] the given generic amplitude -@returns {S|F|V|U|T[GenericIndex[number of index]]...}."; -ToGenericSum[FormCalc`Amp[_->_][amp_],genericSumRestictions:{Rule[_Integer,_]...}] := -Module[ - { - sortSumFields = Sort@DeleteDuplicates[Cases[amp,`type`FAfieldGeneric,Infinity]], - replSumFields - }, - replSumFields = sortSumFields /. f_[_[_,i_]]:>{f@GenericIndex@i,Replace[i,genericSumRestictions~Join~{_Integer->False}]}; - GenericSum[{amp}, replSumFields] -]; -SetAttributes[ToGenericSum,{Protected,Locked}]; - -FAFieldQ::usage= -"@brief Checks whether symbol belongs to FeynArts` field names or not. -@param Symbol to check. -@returns True if symbol belongs to FeynArts` field names, False otherwise."; -FAFieldQ = MatchQ[#,`type`fieldFA]&; -SetAttributes[FAFieldQ,{Protected,Locked}]; - -ZeroRules::usage= -"@brief Given a set of rules that map to zero and a set that does -not map to zero, apply the zero rules to the non-zero ones -recursively until the non-zero rules do not change anymore. -@param nonzeroRules the list of nonzero rules -@param zeroRules the list of zero rules -@returns a list of rules that map the same expressions as the initial rules. -The return value is of the form {{Rule[_,_]...},{Rule[_,0]...}}"; -ZeroRules[nonzeroRules:{Rule[_,_]...}, zeroRules:{Rule[_,0]...}] := -Module[{newNonzero, newZeroRules}, - newNonzero = Thread[ - Rule[nonzeroRules[[All,1]],nonzeroRules[[All,2]] /. zeroRules]]; - - If[newNonzero === nonzeroRules, Return[{nonzeroRules, zeroRules}]]; - - newZeroRules = Cases[newNonzero,HoldPattern[_->0]]; - newNonzero = Complement[newNonzero, newZeroRules]; - - ZeroRules[newNonzero, Join[zeroRules,newZeroRules]] -]; - -FCAmplitudesToFSConvention::usage= -"@brief Tranlate a list of FormCalc amplitudes and their abbreviations and -subexpressions into FlexibleSUSY language. -@param amplitudes the given list of amplitudes -@param abbreviations list of abbreviations -@param aubexpressions list of subexpressions -@returns a list of the form -`{fsAmplitudes, Join[fsAbbreviations,fsSubexpressions]}` -where all FlexibleSUSY conventions have been applied."; -FCAmplitudesToFSConvention[amplitudes_, abbreviations_, subexpressions_] := -Module[{fsAmplitudes, fsAbbreviations, fsSubexpressions}, - fsAmplitudes = amplitudes //. amplitudeToFSRules; - fsAbbreviations = abbreviations //. subexpressionToFSRules //. {FormCalc`DiracChain->NPointFunctions`internal`dc,FormCalc`Spinor->SARAH`DiracSpinor,FormCalc`Lor->SARAH`Lorentz}; - fsSubexpressions = subexpressions //. subexpressionToFSRules; - {fsAmplitudes, Join[fsAbbreviations,fsSubexpressions]} -]; - -SetAttributes[ - { - NPointFunctionFAFC, - GenericInsertionsForDiagram,FindGenericInsertions,StripParticleIndices, - ColourFactorForDiagram, - ZeroRules,FCAmplitudesToFSConvention - }, - {Protected, Locked}]; - -End[]; -EndPackage[]; diff --git a/meta/Observables.m b/meta/Observables.m index cc8a0b2777..00c59fca90 100644 --- a/meta/Observables.m +++ b/meta/Observables.m @@ -20,21 +20,19 @@ *) -BeginPackage["Observables`", {"FlexibleSUSY`", "SARAH`", "BetaFunction`", "Parameters`", "TreeMasses`", "Utils`", "CConversion`", "TextFormatting`"}]; +BeginPackage["Observables`", {"FlexibleSUSY`", "SARAH`", "BetaFunction`", "Parameters`", "TreeMasses`", "Utils`", "CConversion`", "TextFormatting`", "GM2Calc`"}]; (* observables *) Begin["FlexibleSUSYObservable`"]; -FSObservables = { aMuon, aMuonUncertainty, aMuonGM2Calc, aMuonGM2CalcUncertainty, - CpHiggsPhotonPhoton, CpHiggsGluonGluon, - CpPseudoScalarPhotonPhoton, CpPseudoScalarGluonGluon, - EDM, BrLToLGamma, bsgamma }; - -If[FlexibleSUSY`FSFeynArtsAvailable && FlexibleSUSY`FSFormCalcAvailable, - AppendTo[FSObservables, FToFConversionInNucleus] -]; - +FSObservables = { AMM, AMMUncertainty, aMuonGM2Calc, aMuonGM2CalcUncertainty, + EDM, bsgamma}; End[]; +DefineObservable::usage="Defines all C++ names for an observable"; +GetObservablesHeaders::usage="Return the names of C++ headers with #include"; +GetObservableNamespace::usage="Return the C++ context name of an observable"; +GetObservableFileName::usage="Returns the C++ file name of a given observable"; +GetObservablePrototype::usage="Returns the C++ prototype as string"; GetRequestedObservables::usage=""; CountNumberOfObservables::usage=""; CreateObservablesDefinitions::usage=""; @@ -56,144 +54,49 @@ GetRequestedObservables[blocks_] := Module[{observables, dim, test}, observables = DeleteDuplicates[Cases[blocks, a_?IsObservable :> a, {0, Infinity}]]; - If[MemberQ[observables, FlexibleSUSYObservable`CpHiggsPhotonPhoton] || - MemberQ[observables, FlexibleSUSYObservable`CpHiggsGluonGluon], - dim = TreeMasses`GetDimensionWithoutGoldstones[SARAH`HiggsBoson] - If[FreeQ[TreeMasses`GetParticles[], SARAH`HiggsBoson] || - TreeMasses`GetDimensionWithoutGoldstones[SARAH`HiggsBoson] == 0, - Print["Warning: no physical Higgs boson found."]; - Print[" Effective couplings for Higgs boson will not"]; - Print[" be calculated."]; - observables = DeleteCases[observables, a_ /; (a === FlexibleSUSYObservable`CpHiggsPhotonPhoton || - a === FlexibleSUSYObservable`CpHiggsGluonGluon)]; - ]; - ]; - If[MemberQ[observables, FlexibleSUSYObservable`CpPseudoScalarPhotonPhoton] || - MemberQ[observables, FlexibleSUSYObservable`CpPseudoScalarGluonGluon], - If[FreeQ[TreeMasses`GetParticles[], SARAH`PseudoScalar] || - TreeMasses`GetDimensionWithoutGoldstones[SARAH`PseudoScalar] == 0, - Print["Warning: no physical pseudoscalar boson found."]; - Print[" Effective couplings for pseudoscalar boson will not"]; - Print[" be calculated."]; - observables = DeleteCases[observables, a_ /; (a === FlexibleSUSYObservable`CpPseudoScalarPhotonPhoton || - a === FlexibleSUSYObservable`CpPseudoScalarGluonGluon)]; - ]; - ]; -test = Complement[ - Cases[observables, _FlexibleSUSYObservable`BrLToLGamma], - Cases[observables, FlexibleSUSYObservable`BrLToLGamma[fin_?IsLepton -> {fout_?IsLepton, vout_ /; vout === GetPhoton[]}]] - ]; - If[test =!= {}, - Print["Warning: BrLToLGamma function works only for leptons and a photon."]; - Print[" Removing requested process(es):"]; - Print[" " <> ToString@test]; - observables = Complement[observables, test]; - ]; observables ]; -GetObservableName[obs_ /; obs === FlexibleSUSYObservable`aMuon] := "a_muon"; -GetObservableName[obs_ /; obs === FlexibleSUSYObservable`aMuonUncertainty] := "a_muon_uncertainty"; +GetObservableName[FlexibleSUSYObservable`AMM[p_[idx_]]] := GetObservableName[FlexibleSUSYObservable`AMM[p]] <> "_" <> ToString[idx]; +GetObservableName[FlexibleSUSYObservable`AMM[p_]] := "amm_" <> CConversion`ToValidCSymbolString[p]; +GetObservableName[FlexibleSUSYObservable`AMMUncertainty[p_]] := "amm_uncertainty_" <> CConversion`ToValidCSymbolString[p]; +GetObservableName[FlexibleSUSYObservable`AMMUncertainty[p_[idx_]]] := GetObservableName[FlexibleSUSYObservable`AMMUncertainty[p]] <> "_" <> ToString[idx]; GetObservableName[obs_ /; obs === FlexibleSUSYObservable`aMuonGM2Calc] := "a_muon_gm2calc"; GetObservableName[obs_ /; obs === FlexibleSUSYObservable`aMuonGM2CalcUncertainty] := "a_muon_gm2calc_uncertainty"; -GetObservableName[obs_ /; obs === FlexibleSUSYObservable`CpHiggsPhotonPhoton] := "eff_cp_higgs_photon_photon"; -GetObservableName[obs_ /; obs === FlexibleSUSYObservable`CpHiggsGluonGluon] := "eff_cp_higgs_gluon_gluon"; -GetObservableName[obs_ /; obs === FlexibleSUSYObservable`CpPseudoScalarPhotonPhoton] := "eff_cp_pseudoscalar_photon_photon"; -GetObservableName[obs_ /; obs === FlexibleSUSYObservable`CpPseudoScalarGluonGluon] := "eff_cp_pseudoscalar_gluon_gluon"; GetObservableName[FlexibleSUSYObservable`EDM[p_[idx_]]] := GetObservableName[FlexibleSUSYObservable`EDM[p]] <> "_" <> ToString[idx]; GetObservableName[FlexibleSUSYObservable`EDM[p_]] := "edm_" <> CConversion`ToValidCSymbolString[p]; -GetObservableName[FlexibleSUSYObservable`BrLToLGamma[pIn_[_] -> {pOut_[_], spectator_}]] := CConversion`ToValidCSymbolString[pIn] <> "_to_" <> CConversion`ToValidCSymbolString[pOut] <> "_" <> CConversion`ToValidCSymbolString[spectator]; -GetObservableName[FlexibleSUSYObservable`BrLToLGamma[pIn_ -> {pOut_, spectator_}]] := CConversion`ToValidCSymbolString[pIn] <> "_to_" <> CConversion`ToValidCSymbolString[pOut] <> "_" <> CConversion`ToValidCSymbolString[spectator]; -GetObservableName[FlexibleSUSYObservable`FToFConversionInNucleus[pIn_[idxIn_] -> pOut_[idxOut_], nucleus_]] := CConversion`ToValidCSymbolString[pIn] <> "_to_" <> CConversion`ToValidCSymbolString[pOut] <> "_in_" <> ToString@nucleus; + GetObservableName[obs_ /; obs === FlexibleSUSYObservable`bsgamma] := "b_to_s_gamma"; -GetObservableDescription[obs_ /; obs === FlexibleSUSYObservable`aMuon] := "a_muon = (g-2)/2 of the muon (calculated with FlexibleSUSY)"; -GetObservableDescription[obs_ /; obs === FlexibleSUSYObservable`aMuonUncertainty] := "uncertainty of a_muon = (g-2)/2 of the muon (calculated with FlexibleSUSY)"; +GetObservableDescription[FlexibleSUSYObservable`AMM[p_[idx_]]] := "Delta(g-2)/2 of " <> CConversion`ToValidCSymbolString[p] <> "(" <> ToString[idx+1] <> ") (calculated with FlexibleSUSY)"; +GetObservableDescription[FlexibleSUSYObservable`AMM[p_]] := "Delta(g-2)/2 of " <> CConversion`ToValidCSymbolString[p] <> " (calculated with FlexibleSUSY)"; +GetObservableDescription[FlexibleSUSYObservable`AMMUncertainty[p_]] := "uncertainty of Delta(g-2)/2 of " <> CConversion`ToValidCSymbolString[p] <> " (calculated with FlexibleSUSY)"; +GetObservableDescription[FlexibleSUSYObservable`AMMUncertainty[p_[idx_]]] := "uncertainty of Delta(g-2)/2 of " <> CConversion`ToValidCSymbolString[p] <> "(" <> ToString[idx+1] <> ") (calculated with FlexibleSUSY)"; GetObservableDescription[obs_ /; obs === FlexibleSUSYObservable`aMuonGM2Calc] := "a_muon = (g-2)/2 of the muon (calculated with GM2Calc)"; GetObservableDescription[obs_ /; obs === FlexibleSUSYObservable`aMuonGM2CalcUncertainty] := "uncertainty of (g-2)/2 of the muon (calculated with GM2Calc)"; -GetObservableDescription[obs_ /; obs === FlexibleSUSYObservable`CpHiggsPhotonPhoton] := "effective H-Photon-Photon coupling"; -GetObservableDescription[obs_ /; obs === FlexibleSUSYObservable`CpHiggsGluonGluon] := "effective H-Gluon-Gluon coupling"; -GetObservableDescription[obs_ /; obs === FlexibleSUSYObservable`CpPseudoScalarPhotonPhoton] := "effective A-Photon-Photon coupling"; -GetObservableDescription[obs_ /; obs === FlexibleSUSYObservable`CpPseudoScalarGluonGluon] := "effective A-Gluon-Gluon coupling"; -GetObservableDescription[FlexibleSUSYObservable`EDM[p_[idx_]]] := "electric dipole moment of " <> CConversion`ToValidCSymbolString[p] <> "(" <> ToString[idx] <> ") [1/GeV]"; +GetObservableDescription[FlexibleSUSYObservable`EDM[p_[idx_]]] := "electric dipole moment of " <> CConversion`ToValidCSymbolString[p] <> "(" <> ToString[idx+1] <> ") [1/GeV]"; GetObservableDescription[FlexibleSUSYObservable`EDM[p_]] := "electric dipole moment of " <> CConversion`ToValidCSymbolString[p] <> " [1/GeV]"; -GetObservableDescription[FlexibleSUSYObservable`BrLToLGamma[pIn_ -> {pOut_, _}]] := - "BR(" <> CConversion`ToValidCSymbolString[pIn] <> " -> " <> - CConversion`ToValidCSymbolString[pOut] <> " " <> - CConversion`ToValidCSymbolString[V] <> ")" ; -GetObservableDescription[FlexibleSUSYObservable`BrLToLGamma[pIn_[idxIn_] -> {pOut_[idxOut_], V_}]] := - "BR(" <> CConversion`ToValidCSymbolString[pIn] <> ToString[idxIn] <> " -> " <> - CConversion`ToValidCSymbolString[pOut] <> ToString[idxOut] <> " " <> - CConversion`ToValidCSymbolString[V] <> ")" ; -GetObservableDescription[FlexibleSUSYObservable`FToFConversionInNucleus[pIn_ -> pOut_, nuc_]] := - "CR(" <> CConversion`ToValidCSymbolString[pIn] <> " -> " <> - CConversion`ToValidCSymbolString[pOut] <> ", " <> - ToString[nuc] <> ")/capture rate"; -GetObservableDescription[FlexibleSUSYObservable`FToFConversionInNucleus[pIn_[idxIn_] -> pOut_[idxOut_], nuc_]] := - "CR(" <> CConversion`ToValidCSymbolString[pIn] <> ToString[idxIn] <> " -> " <> - CConversion`ToValidCSymbolString[pOut] <> ToString[idxOut] <> ", " <> - ToString[nuc] <> ")/capture rate"; + GetObservableDescription[obs_ /; obs === FlexibleSUSYObservable`bsgamma] := "calculates the Wilson coefficients C7 and C8 for b -> s gamma"; -GetObservableType[obs_ /; obs === FlexibleSUSYObservable`aMuon] := CConversion`ScalarType[CConversion`realScalarCType]; -GetObservableType[obs_ /; obs === FlexibleSUSYObservable`aMuonUncertainty] := CConversion`ScalarType[CConversion`realScalarCType]; +GetObservableType[FlexibleSUSYObservable`AMM[_]] := CConversion`ScalarType[CConversion`realScalarCType]; +GetObservableType[FlexibleSUSYObservable`AMMUncertainty[_]] := CConversion`ScalarType[CConversion`realScalarCType]; GetObservableType[obs_ /; obs === FlexibleSUSYObservable`aMuonGM2Calc] := CConversion`ScalarType[CConversion`realScalarCType]; GetObservableType[obs_ /; obs === FlexibleSUSYObservable`aMuonGM2CalcUncertainty] := CConversion`ScalarType[CConversion`realScalarCType]; GetObservableType[FlexibleSUSYObservable`EDM[p_]] := CConversion`ScalarType[CConversion`realScalarCType]; -GetObservableType[FlexibleSUSYObservable`BrLToLGamma[pIn_ -> {pOut_, _}]] := CConversion`ScalarType[CConversion`realScalarCType]; -GetObservableType[FlexibleSUSYObservable`FToFConversionInNucleus[pIn_[idxIn_] -> pOut_[idxOut_], _]] := CConversion`ScalarType[CConversion`realScalarCType]; -GetObservableType[obs_ /; obs === FlexibleSUSYObservable`bsgamma] := CConversion`ScalarType[CConversion`realScalarCType]; -GetObservableType[obs_ /; obs === FlexibleSUSYObservable`CpHiggsPhotonPhoton] := - Module[{dim, type}, - dim = TreeMasses`GetDimensionWithoutGoldstones[SARAH`HiggsBoson]; - If[dim == 1, - type = CConversion`ScalarType[CConversion`complexScalarCType], - type = CConversion`ArrayType[CConversion`complexScalarCType, dim] - ]; - type - ]; - -GetObservableType[obs_ /; obs === FlexibleSUSYObservable`CpHiggsGluonGluon] := - Module[{dim, type}, - dim = TreeMasses`GetDimensionWithoutGoldstones[SARAH`HiggsBoson]; - If[dim == 1, - type = CConversion`ScalarType[CConversion`complexScalarCType], - type = CConversion`ArrayType[CConversion`complexScalarCType, dim] - ]; - type - ]; - -GetObservableType[obs_ /; obs === FlexibleSUSYObservable`CpPseudoScalarPhotonPhoton] := - Module[{dim, type}, - dim = TreeMasses`GetDimensionWithoutGoldstones[SARAH`PseudoScalar]; - If[dim == 1, - type = CConversion`ScalarType[CConversion`complexScalarCType], - type = CConversion`ArrayType[CConversion`complexScalarCType, dim] - ]; - type - ]; - -GetObservableType[obs_ /; obs === FlexibleSUSYObservable`CpPseudoScalarGluonGluon] := - Module[{dim, type}, - dim = TreeMasses`GetDimensionWithoutGoldstones[SARAH`PseudoScalar]; - If[dim == 1, - type = CConversion`ScalarType[CConversion`complexScalarCType], - type = CConversion`ArrayType[CConversion`complexScalarCType, dim] - ]; - type - ]; +GetObservableType[obs_ /; obs === FlexibleSUSYObservable`bsgamma] := CConversion`ScalarType[CConversion`realScalarCType]; CountNumberOfObservables[observables_List] := Module[{i, number = 0}, For[i = 1, i <= Length[observables], i++, If[IsObservable[observables[[i]]], number += BetaFunction`CountNumberOfParameters[GetObservableType[observables[[i]]]];, - Print["Warning: ignoring invalid observable ", observables[[i]]]; - ]; - ]; + Utils`FSFancyWarning["Ignoring invalid observable ", observables[[i]]]; + ]; + ]; number - ]; + ]; CreateObservablesDefinitions[observables_List] := Module[{i, type, name, description, definitions = ""}, @@ -203,11 +106,11 @@ description = GetObservableDescription[observables[[i]]]; type = CConversion`CreateCType[GetObservableType[observables[[i]]]]; definitions = definitions <> type <> " " <> name <> "; ///< " <> description <> "\n";, - Print["Warning: ignoring invalid observable ", observables[[i]]]; - ]; - ]; + Utils`FSFancyWarning["Ignoring invalid observable ", observables[[i]]]; + ]; + ]; definitions - ]; + ]; CreateObservablesInitialization[observables_List] := Module[{i, name, type, init = ""}, @@ -219,11 +122,11 @@ init = ": " <> CConversion`CreateDefaultConstructor[name, type] <> "\n";, init = init <> ", " <> CConversion`CreateDefaultConstructor[name, type] <> "\n"; ];, - Print["Warning: ignoring invalid observable ", observables[[i]]]; - ]; - ]; + Utils`FSFancyWarning["Ignoring invalid observable ", observables[[i]]]; + ]; + ]; init - ]; + ]; CreateSetAndDisplayObservablesFunctions[observables_List] := Module[{numObservables, i, name, type, paramCount = 0, nAssignments, assignment, @@ -248,9 +151,9 @@ {assignment, nAssignments} = Parameters`CreateStdVectorNamesAssignment[name, paramCount, type]; displayNames = displayNames <> assignment; paramCount += nAssignments;, - Print["Warning: ignoring invalid observable ", observables[[i]]]; - ]; - ];, + Utils`FSFancyWarning["Ignoring invalid observable ", observables[[i]]]; + ]; + ];, display = "Eigen::ArrayXd vec(1);\n\nvec(0) = 0.;\n"; set = ""; displayNames = "std::vector names(1);\n\n" @@ -266,17 +169,25 @@ name = GetObservableName[observables[[i]]]; type = GetObservableType[observables[[i]]]; result = result <> CConversion`SetToDefault[name, type];, - Print["Warning: ignoring invalid observable ", observables[[i]]]; - ]; - ]; + Utils`FSFancyWarning["Ignoring invalid observable ", observables[[i]]]; + ]; + ]; result ]; -CalculateObservable[obs_ /; obs === FlexibleSUSYObservable`aMuon, structName_String] := - structName <> ".AMU = " <> FlexibleSUSY`FSModelName <> "_a_muon::calculate_a_muon(MODEL, qedqcd);"; +CalculateObservable[FlexibleSUSYObservable`AMM[p_], structName_String] := + structName <> ".AMM0(" <> CConversion`ToValidCSymbolString[p] <> ") = " <> + FlexibleSUSY`FSModelName <> "_amm::calculate_amm<" <> CXXDiagrams`CXXNameOfField[p, prefixNamespace -> FlexibleSUSY`FSModelName <> "_cxx_diagrams::fields"] <> ">(MODEL, qedqcd, settings);"; + +CalculateObservable[FlexibleSUSYObservable`AMM[p_[idx_]], structName_String] := + structName <> ".AMM1(" <> CConversion`ToValidCSymbolString[p] <> ", " <> ToString[idx] <> ") = " <> + FlexibleSUSY`FSModelName <> "_amm::calculate_amm<" <> CXXDiagrams`CXXNameOfField[p, prefixNamespace -> FlexibleSUSY`FSModelName <> "_cxx_diagrams::fields"] <> ">(MODEL, qedqcd, settings," <> ToString[idx] <> ");"; -CalculateObservable[obs_ /; obs === FlexibleSUSYObservable`aMuonUncertainty, structName_String] := - structName <> ".AMUUNCERTAINTY = " <> FlexibleSUSY`FSModelName <> "_a_muon::calculate_a_muon_uncertainty(MODEL, qedqcd);"; +CalculateObservable[FlexibleSUSYObservable`AMMUncertainty[p_], structName_String] := + structName <> ".AMMUNCERTAINTY0(" <> CConversion`ToValidCSymbolString[p] <> ") = " <> FlexibleSUSY`FSModelName <> "_amm::calculate_amm_uncertainty<" <> CXXDiagrams`CXXNameOfField[p, prefixNamespace -> FlexibleSUSY`FSModelName <> "_cxx_diagrams::fields"] <> ">(MODEL, qedqcd, settings);"; + +CalculateObservable[FlexibleSUSYObservable`AMMUncertainty[p_[idx_]], structName_String] := + structName <> ".AMMUNCERTAINTY1(" <> CConversion`ToValidCSymbolString[p] <> ", " <> ToString[idx] <> ") = " <> FlexibleSUSY`FSModelName <> "_amm::calculate_amm_uncertainty<" <> CXXDiagrams`CXXNameOfField[p, prefixNamespace -> FlexibleSUSY`FSModelName <> "_cxx_diagrams::fields"] <> ">(MODEL, qedqcd, settings, " <> ToString[idx] <> ");"; CalculateObservable[obs_ /; obs === FlexibleSUSYObservable`aMuonGM2Calc, structName_String] := "#ifdef ENABLE_GM2CALC\n" <> @@ -288,281 +199,30 @@ structName <> ".AMUGM2CALCUNCERTAINTY = gm2calc_calculate_amu_uncertainty(gm2calc_data);\n" <> "#endif"; -CalculateObservable[obs_ /; obs === FlexibleSUSYObservable`CpHiggsPhotonPhoton, structName_String] := - Module[{i, type, dim, start, result = ""}, - type = GetObservableType[obs]; - dim = TreeMasses`GetDimensionWithoutGoldstones[SARAH`HiggsBoson]; - If[dim != 1, - start = TreeMasses`GetDimensionStartSkippingGoldstones[SARAH`HiggsBoson] - 1; - For[i = 1, i <= dim, i++, - result = result <> structName <> ".EFFCPHIGGSPHOTONPHOTON(" - <> ToString[i-1] <> ") = effective_couplings.get_eff_Cp" - <> CConversion`ToValidCSymbolString[SARAH`HiggsBoson] - <> CConversion`ToValidCSymbolString[SARAH`VectorP] - <> CConversion`ToValidCSymbolString[SARAH`VectorP] <> "(" - <> ToString[start+i-1] <> If[i != dim, ");\n", ");"]; - ];, - dim = TreeMasses`GetDimension[SARAH`HiggsBoson]; - If[dim == 1, - result = structName <> ".EFFCPHIGGSPHOTONPHOTON = effective_couplings.get_eff_Cp" - <> CConversion`ToValidCSymbolString[SARAH`HiggsBoson] - <> CConversion`ToValidCSymbolString[SARAH`VectorP] - <> CConversion`ToValidCSymbolString[SARAH`VectorP] <> "();", - start = TreeMasses`GetDimensionStartSkippingGoldstones[SARAH`HiggsBoson] - 1; - result = structName <> ".EFFCPHIGGSPHOTONPHOTON = effective_couplings.get_eff_Cp" - <> CConversion`ToValidCSymbolString[SARAH`HiggsBoson] - <> CConversion`ToValidCSymbolString[SARAH`VectorP] - <> CConversion`ToValidCSymbolString[SARAH`VectorP] <> "(" - <> ToString[start] <> ");" - ]; - ]; - result - ]; - -CalculateObservable[obs_ /; obs === FlexibleSUSYObservable`CpHiggsGluonGluon, structName_String] := - Module[{i, type, dim, start, result = ""}, - type = GetObservableType[obs]; - dim = TreeMasses`GetDimensionWithoutGoldstones[SARAH`HiggsBoson]; - If[dim != 1, - start = TreeMasses`GetDimensionStartSkippingGoldstones[SARAH`HiggsBoson] - 1; - For[i = 1, i <= dim, i++, - result = result <> structName <> ".EFFCPHIGGSGLUONGLUON(" - <> ToString[i-1] <> ") = effective_couplings.get_eff_Cp" - <> CConversion`ToValidCSymbolString[SARAH`HiggsBoson] - <> CConversion`ToValidCSymbolString[SARAH`VectorG] - <> CConversion`ToValidCSymbolString[SARAH`VectorG] <> "(" - <> ToString[start+i-1] <> If[i != dim, ");\n", ");"]; - ];, - dim = TreeMasses`GetDimension[SARAH`HiggsBoson]; - If[dim == 1, - result = structName <> ".EFFCPHIGGSGLUONGLUON = effective_couplings.get_eff_Cp" - <> CConversion`ToValidCSymbolString[SARAH`HiggsBoson] - <> CConversion`ToValidCSymbolString[SARAH`VectorG] - <> CConversion`ToValidCSymbolString[SARAH`VectorG] <> "();", - start = TreeMasses`GetDimensionStartSkippingGoldstones[SARAH`HiggsBoson] - 1; - result = structName <> ".EFFCPHIGGSGLUONGLUON = effective_couplings.get_eff_Cp" - <> CConversion`ToValidCSymbolString[SARAH`HiggsBoson] - <> CConversion`ToValidCSymbolString[SARAH`VectorG] - <> CConversion`ToValidCSymbolString[SARAH`VectorG] <> "(" - <> ToString[start] <> ");" - ]; - ]; - result - ]; - -CalculateObservable[obs_ /; obs === FlexibleSUSYObservable`CpPseudoScalarPhotonPhoton, structName_String] := - Module[{i, type, dim, start, result = ""}, - type = GetObservableType[obs]; - dim = TreeMasses`GetDimensionWithoutGoldstones[SARAH`PseudoScalar]; - If[dim != 1, - start = TreeMasses`GetDimensionStartSkippingGoldstones[SARAH`PseudoScalar] - 1; - For[i = 1, i <= dim, i++, - result = result <> structName <> ".EFFCPPSEUDOSCALARPHOTONPHOTON(" - <> ToString[i-1] <> ") = effective_couplings.get_eff_Cp" - <> CConversion`ToValidCSymbolString[SARAH`PseudoScalar] - <> CConversion`ToValidCSymbolString[SARAH`VectorP] - <> CConversion`ToValidCSymbolString[SARAH`VectorP] <> "(" - <> ToString[start+i-1] <> If[i != dim, ");\n", ");"]; - ];, - dim = TreeMasses`GetDimension[SARAH`PseudoScalar]; - If[dim == 1, - result = structName <> ".EFFCPPSEUDOSCALARPHOTONPHOTON = effective_couplings.get_eff_Cp" - <> CConversion`ToValidCSymbolString[SARAH`PseudoScalar] - <> CConversion`ToValidCSymbolString[SARAH`VectorP] - <> CConversion`ToValidCSymbolString[SARAH`VectorP] <> "();", - start = TreeMasses`GetDimensionStartSkippingGoldstones[SARAH`PseudoScalar] - 1; - result = structName <> ".EFFCPPSEUDOSCALARPHOTONPHOTON = effective_couplings.get_eff_Cp" - <> CConversion`ToValidCSymbolString[SARAH`PseudoScalar] - <> CConversion`ToValidCSymbolString[SARAH`VectorP] - <> CConversion`ToValidCSymbolString[SARAH`VectorP] <> "(" - <> ToString[start] <> ");" - ]; - ]; - result - ]; - -CalculateObservable[obs_ /; obs === FlexibleSUSYObservable`CpPseudoScalarGluonGluon, structName_String] := - Module[{i, type, dim, start, result = ""}, - type = GetObservableType[obs]; - dim = TreeMasses`GetDimensionWithoutGoldstones[SARAH`PseudoScalar]; - If[dim != 1, - start = TreeMasses`GetDimensionStartSkippingGoldstones[SARAH`PseudoScalar] - 1; - For[i = 1, i <= dim, i++, - result = result <> structName <> ".EFFCPPSEUDOSCALARGLUONGLUON(" - <> ToString[i-1] <> ") = effective_couplings.get_eff_Cp" - <> CConversion`ToValidCSymbolString[SARAH`PseudoScalar] - <> CConversion`ToValidCSymbolString[SARAH`VectorG] - <> CConversion`ToValidCSymbolString[SARAH`VectorG] <> "(" - <> ToString[start+i-1] <> If[i != dim, ");\n", ");"]; - ];, - dim = TreeMasses`GetDimension[SARAH`PseudoScalar]; - If[dim == 1, - result = structName <> ".EFFCPPSEUDOSCALARGLUONGLUON = effective_couplings.get_eff_Cp" - <> CConversion`ToValidCSymbolString[SARAH`PseudoScalar] - <> CConversion`ToValidCSymbolString[SARAH`VectorG] - <> CConversion`ToValidCSymbolString[SARAH`VectorG] <> "();", - start = TreeMasses`GetDimensionStartSkippingGoldstones[SARAH`PseudoScalar] - 1; - result = structName <> ".EFFCPPSEUDOSCALARGLUONGLUON = effective_couplings.get_eff_Cp" - <> CConversion`ToValidCSymbolString[SARAH`PseudoScalar] - <> CConversion`ToValidCSymbolString[SARAH`VectorG] - <> CConversion`ToValidCSymbolString[SARAH`VectorG] <> "(" - <> ToString[start] <> ");" - ]; - ]; - result - ]; - CalculateObservable[FlexibleSUSYObservable`EDM[p_], structName_String] := Module[{pStr = CConversion`ToValidCSymbolString[p]}, structName <> ".EDM0(" <> pStr <> ") = " <> - FlexibleSUSY`FSModelName <> "_edm::calculate_edm_" <> pStr <> "(MODEL);" + FlexibleSUSY`FSModelName <> "_edm::calculate_edm<" <> CXXDiagrams`CXXNameOfField[p, prefixNamespace -> FlexibleSUSY`FSModelName <> "_cxx_diagrams::fields"] <> ">(MODEL, qedqcd);" ]; CalculateObservable[FlexibleSUSYObservable`EDM[p_[idx_]], structName_String] := Module[{pStr = CConversion`ToValidCSymbolString[p], idxStr = ToString[idx]}, structName <> ".EDM1(" <> pStr <> ", " <> idxStr <> ") = " <> - FlexibleSUSY`FSModelName <> "_edm::calculate_edm_" <> pStr <> "(" <> idxStr <> ", MODEL);" - ]; - -CalculateObservable[FlexibleSUSYObservable`BrLToLGamma[pIn_ -> {pOut_, spectator_}], structName_String] := - Module[{pInStr = CConversion`ToValidCSymbolString[pIn], pOutStr = CConversion`ToValidCSymbolString[pOut], - spec = CConversion`ToValidCSymbolString[spectator]}, - structName <> ".LToLGamma0(" <> pInStr <> ", " <> pOutStr <> ", " <> spec <> ") = " <> - FlexibleSUSY`FSModelName <> "_l_to_lgamma::calculate_" <> pInStr <> "_to_" <> pOutStr <> "_" <> spec <> "(MODEL, qedqcd, physical_input);" - ]; - -CalculateObservable[FlexibleSUSYObservable`BrLToLGamma[pIn_[idxIn_] -> {pOut_[idxOut_], spectator_}], structName_String] := - Module[{pInStr = CConversion`ToValidCSymbolString[pIn], - pOutStr = CConversion`ToValidCSymbolString[pOut], - idxInStr = ToString[idxIn], - idxOutStr = ToString[idxOut], - specStr = ToString[spectator] - }, - structName <> ".LToLGamma1(" <> pInStr <> ", " <> idxInStr <> ", " <> pOutStr <> ", " <> idxOutStr <> ", " <> specStr <> ") = " <> - FlexibleSUSY`FSModelName <> "_l_to_lgamma::calculate_" <> pInStr <> "_to_" <> pOutStr <> "_" <> specStr <> "(" <> idxInStr <> ", " <> idxOutStr <> ", MODEL, qedqcd, physical_input);" - ]; - -CalculateObservable[FlexibleSUSYObservable`FToFConversionInNucleus[pIn_ -> pOut_, nucleai_], structName_String] := - Module[{pInStr = CConversion`ToValidCSymbolString[pIn], pOutStr = CConversion`ToValidCSymbolString[pOut], - nuc = CConversion`ToValidCSymbolString[nucleai]}, - structName <> ".FToFConversion0(" <> pInStr <> ") = " <> - FlexibleSUSY`FSModelName <> "_f_to_f_conversion::calculate_" <> pInStr <> "_to_" <> pOutStr <> "_in_nucleus(MODEL);" - ]; - -CalculateObservable[FlexibleSUSYObservable`FToFConversionInNucleus[pIn_[idxIn_] -> pOut_[idxOut_], nucleus_], structName_String] := - Module[{pInStr = CConversion`ToValidCSymbolString[pIn], - pOutStr = CConversion`ToValidCSymbolString[pOut], - idxInStr = ToString[idxIn], - idxOutStr = ToString[idxOut], - nucleiStr = ToString[nucleus] - }, - structName <> ".FToFConversion1(" <> pInStr <> ", " <> idxInStr <> ", " <> pOutStr <> ", " <> idxOutStr <> ", " <> nucleiStr <> ", " <> "qedqcd) = " <> - FlexibleSUSY`FSModelName <> "_f_to_f_conversion::calculate_" <> pInStr <> "_to_" <> pOutStr <> "_in_nucleus(" <> idxInStr <> ", " <> idxOutStr <> ", "<> FlexibleSUSY`FSModelName <> "_f_to_f_conversion::Nucleus::" <> nucleiStr <> ", MODEL, qedqcd);" + FlexibleSUSY`FSModelName <> "_edm::calculate_edm<" <> CXXDiagrams`CXXNameOfField[p, prefixNamespace -> FlexibleSUSY`FSModelName <> "_cxx_diagrams::fields"] <> ">(MODEL, qedqcd, " <> idxStr <> ");" ]; (* TODO: move Wilson Coefficients to a different block *) CalculateObservable[obs_ /; obs === FlexibleSUSYObservable`bsgamma, structName_String] := structName <> ".BSGAMMA = Re(" <> FlexibleSUSY`FSModelName <> "_b_to_s_gamma::calculate_b_to_s_gamma(MODEL, qedqcd)[0]);"; -FillGM2CalcInterfaceData[struct_String] := - Module[{filling, mwStr, - w, pseudoscalar, smuon, muonsneutrino, chargino, neutralino, - mu, m1, m2, m3, mq2, mu2, md2, ml2, me2, tu, td, te, yu, yd, ye}, - w = Parameters`GetParticleFromDescription["W-Boson"]; - pseudoscalar = Parameters`GetParticleFromDescription["Pseudo-Scalar Higgs"]; - smuon = Parameters`GetParticleFromDescription["Smuon"]; - muonsneutrino = Parameters`GetParticleFromDescription["Muon Sneutrino"]; - chargino = Parameters`GetParticleFromDescription["Charginos"]; - neutralino = Parameters`GetParticleFromDescription["Neutralinos"]; - mu = Parameters`GetParameterFromDescription["Mu-parameter"]; - m1 = Parameters`GetParameterFromDescription["Bino Mass parameter"]; - m2 = Parameters`GetParameterFromDescription["Wino Mass parameter"]; - m3 = Parameters`GetParameterFromDescription["Gluino Mass parameter"]; - mq2 = Parameters`GetParameterFromDescription["Softbreaking left Squark Mass"]; - mu2 = Parameters`GetParameterFromDescription["Softbreaking right Up-Squark Mass"]; - md2 = Parameters`GetParameterFromDescription["Softbreaking right Down-Squark Mass"]; - ml2 = Parameters`GetParameterFromDescription["Softbreaking left Slepton Mass"]; - me2 = Parameters`GetParameterFromDescription["Softbreaking right Slepton Mass"]; - tu = Parameters`GetParameterFromDescription["Trilinear-Up-Coupling"]; - td = Parameters`GetParameterFromDescription["Trilinear-Down-Coupling"]; - te = Parameters`GetParameterFromDescription["Trilinear-Lepton-Coupling"]; - yu = Parameters`GetParameterFromDescription["Up-Yukawa-Coupling"]; - yd = Parameters`GetParameterFromDescription["Down-Yukawa-Coupling"]; - ye = Parameters`GetParameterFromDescription["Lepton-Yukawa-Coupling"]; - - If[MemberQ[{w, pseudoscalar, smuon, muonsneutrino, - chargino, neutralino, mu, m1, m2, m3, mq2, mu2, - md2, ml2, me2, tu, td, te, yu, yd, ye}, Null], - Print["Error: The GM2Calc addon cannot be used in this model, because it is not a MSSM-like model with sfermion flavour conservation. ", - "Please remove aMuonGM2Calc and aMuonGM2CalcUncertainty from the model file."]; - Quit[1]; - ]; - - mwStr = "MODEL.get_physical()." <> CConversion`RValueToCFormString[FlexibleSUSY`M[w]]; - filling = \ - struct <> ".alpha_s_MZ = ALPHA_S_MZ;\n" <> - struct <> ".MZ = MZPole;\n" <> - "if (!is_zero(" <> mwStr <> "))\n" <> - TextFormatting`IndentText[struct <> ".MW = " <> mwStr <> ";"] <> "\n" <> - "else if (!is_zero(MWPole))\n" <> - TextFormatting`IndentText[struct <> ".MW = MWPole;"] <> "\n" <> - struct <> ".mb_mb = MBMB;\n" <> - struct <> ".MT = MTPole;\n" <> - struct <> ".MTau = MTauPole;\n" <> - struct <> ".MM = MMPole;\n" <> - struct <> ".MA0 = MODEL.get_physical()." <> - CConversion`RValueToCFormString[FlexibleSUSY`M[pseudoscalar][1]] <> ";\n" <> - struct <> ".MSvm = MODEL.get_physical()." <> - CConversion`RValueToCFormString[FlexibleSUSY`M[muonsneutrino]] <> ";\n" <> - struct <> ".MSm = MODEL.get_physical()." <> - CConversion`RValueToCFormString[FlexibleSUSY`M[smuon]] <> ";\n" <> - struct <> ".MCha = MODEL.get_physical()." <> - CConversion`RValueToCFormString[FlexibleSUSY`M[chargino]] <> ";\n" <> - struct <> ".MChi = MODEL.get_physical()." <> - CConversion`RValueToCFormString[FlexibleSUSY`M[neutralino]] <> ";\n" <> - struct <> ".scale = MODEL.get_scale();\n" <> - struct <> ".TB = MODEL.get_" <> CConversion`RValueToCFormString[SARAH`VEVSM2] <> "() / " <> - "MODEL.get_" <> CConversion`RValueToCFormString[SARAH`VEVSM1] <> "();\n" <> - struct <> ".Mu = MODEL.get_" <> CConversion`RValueToCFormString[mu] <> "();\n" <> - struct <> ".M1 = MODEL.get_" <> CConversion`RValueToCFormString[m1] <> "();\n" <> - struct <> ".M2 = MODEL.get_" <> CConversion`RValueToCFormString[m2] <> "();\n" <> - struct <> ".M3 = MODEL.get_" <> CConversion`RValueToCFormString[m3] <> "();\n" <> - struct <> ".mq2 = MODEL.get_" <> CConversion`RValueToCFormString[mq2] <> "();\n" <> - struct <> ".mu2 = MODEL.get_" <> CConversion`RValueToCFormString[mu2] <> "();\n" <> - struct <> ".md2 = MODEL.get_" <> CConversion`RValueToCFormString[md2] <> "();\n" <> - struct <> ".ml2 = MODEL.get_" <> CConversion`RValueToCFormString[ml2] <> "();\n" <> - struct <> ".me2 = MODEL.get_" <> CConversion`RValueToCFormString[me2] <> "();\n" <> - struct <> ".Au = div_safe(MODEL.get_" <> CConversion`RValueToCFormString[tu] <> - "(), MODEL.get_" <> CConversion`RValueToCFormString[yu] <> "());\n" <> - struct <> ".Ad = div_safe(MODEL.get_" <> CConversion`RValueToCFormString[td] <> - "(), MODEL.get_" <> CConversion`RValueToCFormString[yd] <> "());\n" <> - struct <> ".Ae = div_safe(MODEL.get_" <> CConversion`RValueToCFormString[te] <> - "(), MODEL.get_" <> CConversion`RValueToCFormString[ye] <> "());"; - "#ifdef ENABLE_GM2CALC\n" <> - "GM2Calc_data " <> struct <> ";\n" <> filling <> "\n" <> - "#endif\n\n" - ]; - -FillEffectiveCouplingsInterfaceData[struct_String] := - Module[{result}, - result = FlexibleSUSY`FSModelName <> "_effective_couplings " <> struct <> "(model, qedqcd, physical_input);\n"; - result = result <> "effective_couplings.calculate_effective_couplings();\n" - ]; - FillInterfaceData[{}] := ""; FillInterfaceData[obs_List] := Module[{filled = ""}, If[MemberQ[obs,FlexibleSUSYObservable`aMuonGM2Calc] || MemberQ[obs,FlexibleSUSYObservable`aMuonGM2CalcUncertainty], - filled = filled <> FillGM2CalcInterfaceData["gm2calc_data"]; - ]; - If[MemberQ[obs,FlexibleSUSYObservable`CpHiggsPhotonPhoton] || - MemberQ[obs,FlexibleSUSYObservable`CpHiggsGluonGluon] || - MemberQ[obs, FlexibleSUSYObservable`CpPseudoScalarPhotonPhoton] || - MemberQ[obs, FlexibleSUSYObservable`CpPseudoScalarGluonGluon], - filled = filled <> FillEffectiveCouplingsInterfaceData["effective_couplings"]; + filled = filled <> GM2Calc`FillGM2CalcInterfaceData["gm2calc_data"]; ]; filled ]; @@ -574,6 +234,124 @@ Utils`StringJoinWithSeparator[CalculateObservable[#,structName]& /@ observables, "\n"] ]; -End[]; +Options@DefineObservable = { + InsertionFunction -> CConversion`ToValidCSymbolString, + GetObservableType -> Unset, + GetObservableName -> Unset, + GetObservablePrototype -> Unset, + GetObservableDescription -> Unset, + CalculateObservable -> Unset, + GetObservableFileName -> Unset, + GetObservableNamespace -> Unset +}; + +DefineObservable[obs_@pattern___, OptionsPattern[]] := +Module[{stringPattern, patternNames, uniqueNames, lhsRepl, rhsRepl, warn, + obsStr = SymbolName@obs, extraCalc, nameAux, specialWords}, + warn := Utils`FSFancyWarning[#," for ", ToString@obs, " might not be specified."]&; + extraCalc := StringReplace[#, "$(" ~~ Shortest[x__] ~~ ")" :> ToString@ToExpression[x]]&; + + stringPattern = ToString@FullForm@{pattern}; + patternNames = DeleteDuplicates@StringCases[stringPattern, "Pattern[" ~~ Shortest@x__ ~~ "," :> x]; + uniqueNames = Unique[#<>"$"]&/@patternNames; + + lhsRepl = MapThread[Rule, {patternNames, ToString/@uniqueNames}]; + rhsRepl = MapThread[ + RuleDelayed[#1, OptionValue[InsertionFunction]@#2]&, + {patternNames, uniqueNames} + ]; + + nameAux = StringReplace[obsStr, nums___?DigitQ ~~ x_?UpperCaseQ :> "_" <> nums <> ToLowerCase[x]]; + Switch[OptionValue[GetObservableFileName], + Unset, + GetObservableFileName[obs | obsStr] = StringDrop[nameAux, 1];, + _String, + GetObservableFileName[obs | obsStr] = OptionValue@GetObservableFileName; + ]; + Switch[OptionValue[GetObservableNamespace], + Unset, + GetObservableNamespace[obs | obsStr] = OptionValue[InsertionFunction][FlexibleSUSY`FSModelName <> nameAux];, + _String, + GetObservableNamespace[obs | obsStr] = OptionValue[InsertionFunction][FlexibleSUSY`FSModelName <> "_" <> OptionValue@GetObservableNamespace]; + ]; + + specialWords = { + "auto model" -> OptionValue[InsertionFunction]["const " <> FlexibleSUSY`FSModelName <> "_mass_eigenstates& model"], + "auto qedqcd" -> OptionValue[InsertionFunction]["const softsusy::QedQcd& qedqcd"], + "context" -> GetObservableNamespace[obs] + }; + rhsRepl = Join[rhsRepl, specialWords]; + + With[{args = Sequence@@ToExpression@StringReplace[stringPattern, lhsRepl], + repl = rhsRepl, + name = If[# === Unset, ToLowerCase@SymbolName@obs <> "_" <> StringRiffle[patternNames, "_"], #] &@ OptionValue@GetObservableName, + description = OptionValue@GetObservableDescription, + type = OptionValue@GetObservableType, + calculate = OptionValue@CalculateObservable, + prototype = OptionValue@GetObservablePrototype + }, + AppendTo[FlexibleSUSYObservable`FSObservables, obs]; + + GetObservableName@obs@args := extraCalc@StringReplace[name, repl]; + + Switch[type, + Unset, + warn@"GetObservableType", + {_Integer}, + GetObservableType@obs@args := + CConversion`ArrayType[CConversion`complexScalarCType, First@type], + _, + GetObservableType@obs@args := type + ]; + + Switch[description, + Unset, + GetObservableDescription@obs@args := StringReplace[extraCalc@StringReplace[name, repl], "_" -> " "];, + _String, + GetObservableDescription@obs@args := extraCalc@StringReplace[description, repl]; + ]; + + If[prototype === Unset, + warn@"GetObservablePrototype";, + Module[{nameStr, argStr}, + nameStr = StringReplace[prototype, Longest["(" ~~ s___ ~~ ")"] :> (argStr = s; "")]; + argStr = StringReplace[argStr, specialWords]; + GetObservablePrototype@obs@args := extraCalc@StringReplace[nameStr, repl] <> "(" <> argStr <> ")"; + ]; + ]; + + Switch[calculate, + Unset, + Module[{nameStr, argStr, removeSub, newCalculate, niceStr = {}}, + nameStr = StringReplace[prototype, Longest["(" ~~ s___ ~~ ")"] :> (argStr = s; "")]; + removeSub[pair_] := StringReplace[#, Longest[StringTake[pair, 1] ~~ ___ ~~ StringTake[pair, -1]] :> " "]&; + (argStr = FixedPoint[removeSub@#, argStr]) &/@ {"()" , "[]", "{}", "<>"}; + argStr = StringReverse@StringReplace[argStr <> ",", {"&" -> " ", Whitespace ~~ "," :> ","}]; + StringReplace[argStr, Shortest["," ~~ x__ ~~ Whitespace] :> (AppendTo[niceStr, StringReverse[x]]; "")]; + newCalculate = nameStr <> "(" <> StringRiffle[Reverse@niceStr, ", "] <> ")"; + + CalculateObservable[obs@args, structName:_String] := + structName <> "." <> StringReplace[name, repl] <> + extraCalc@StringReplace[" = context::"<>newCalculate<>";", repl]; + ];, + _String, + CalculateObservable[obs@args, structName:_String] := + structName <> "." <> StringReplace[name, repl] <> + extraCalc@StringReplace[" = context::"<>calculate<>";", repl]; + ]; + ]; +]; +Utils`MakeUnknownInputDefinition@DefineObservable; + +GetObservablesHeaders[] = +Module[{files, obs}, + files = Utils`DynamicInclude@$observablesWildcard@"Observables.m"; + obs = StringSplit[files, $PathnameSeparator][[All, -2]]; + StringRiffle[ + "#include \"observables/"<>FlexibleSUSY`FSModelName<>"_"<>Observables`GetObservableFileName@#<>".hpp\""&/@obs, + "\n" + ] +]; +End[]; EndPackage[]; diff --git a/meta/Observables/BrLTo3L/FSMathLink.m b/meta/Observables/BrLTo3L/FSMathLink.m new file mode 100644 index 0000000000..4ea743190f --- /dev/null +++ b/meta/Observables/BrLTo3L/FSMathLink.m @@ -0,0 +1,25 @@ +Begin@"FSMathLink`Private`"; +Module[{args = Sequence[lep_@nI_ -> {lep_@nO_, lep_@nA_, SARAH`bar@lep_@nA_}, proc_, loopN_], + obs = FlexibleSUSYObservable`BrLTo3L, + cxx = CConversion`ToValidCSymbolString}, + PutObservable[obs@args, type_, link_String, heads_:{}] := StringJoin[ + "MLPutFunction(link, \"Rule\", 2);", + "MLPutFunction(link, ", ObsToStr@obs, ", 3);", + "MLPutFunction(link, \"Rule\", 2);", + "MLPutFunction(link, \"", cxx@lep, "\", 1);", + "MLPutInteger(link, ", ObsToStr@nI, ");", + "MLPutFunction(link, \"List\", 3);", + "MLPutFunction(link, \"", cxx@lep, "\", 1);", + "MLPutInteger(link, ", ObsToStr@nO, ");", + "MLPutFunction(link, \"", cxx@lep, "\", 1);", + "MLPutInteger(link, ", ObsToStr@nA, ");", + "MLPutFunction(link, \"SARAH`bar\", 1);", + "MLPutFunction(link, \"", cxx@lep, "\", 1);", + "MLPutInteger(link, ", ObsToStr@nA, ");", + "MLPutSymbol(link, \"", CConversion`ToValidCSymbolString@proc, "\");", + "MLPutInteger(link, ", ObsToStr@loopN, ");", + "MLPutReal(link, Re(OBSERVABLE(", GetObservableName@obs[ + lep@nI -> {lep@nO, lep@nA, SARAH`bar@lep@nA}, + proc, + loopN], ")(0)));"];]; +End[]; diff --git a/meta/Observables/BrLTo3L/FlexibleSUSY.m b/meta/Observables/BrLTo3L/FlexibleSUSY.m new file mode 100644 index 0000000000..91857419b3 --- /dev/null +++ b/meta/Observables/BrLTo3L/FlexibleSUSY.m @@ -0,0 +1,154 @@ +Begin@"FlexibleSUSY`Private`"; + +FlexibleSUSY`WriteClass[obs:FlexibleSUSYObservable`BrLTo3L, slha_, files_] := +Module[ + { + observables = DeleteDuplicates@Cases[Observables`GetRequestedObservables@slha, _obs], + exportFields = {}, + npfDefinitions = "", obsPrototypes = "", obsDefinitions = "", + ffvV = {}, npfV = {}, fermions = {} + }, + + If[observables =!= {} && FlexibleSUSY`FSFeynArtsAvailable && FlexibleSUSY`FSFormCalcAvailable, + Utils`PrintHeadline["Creating " <> SymbolName@obs <> " class ..."]; + + exportFields = {#, #} &/@ observables[[All, 1]]; + fermions = {SARAH`bar@#, #} &/@ observables[[All, 1]]; + ffvV = Flatten/@Tuples@{fermions, {TreeMasses`GetPhoton[]}}; + + {npfV, npfDefinitions, obsPrototypes, obsDefinitions} = create@observables; + ]; + + WriteOut`ReplaceInFiles[files, + { + "@npf_headers@" -> NPointFunctions`CreateCXXHeaders[], + "@npf_definitions@" -> npfDefinitions, + "@calculate_prototypes@" -> obsPrototypes, + "@calculate_definitions@" -> obsDefinitions, + "@include_guard@" -> SymbolName@obs, + "@namespace@" -> Observables`GetObservableNamespace@obs, + "@filename@" -> Observables`GetObservableFileName@obs, + "@get_MSUSY@" -> TextFormatting`IndentText@TextFormatting`WrapLines@AMM`AMMGetMLCP[], + Sequence@@FlexibleSUSY`Private`GeneralReplacementRules[] + } + ]; + { + "FFV fields" -> DeleteDuplicates@exportFields, + "C++ vertices" -> DeleteDuplicates@Join[ffvV, npfV] + } +]; + +create[manyObservables:{__FlexibleSUSYObservable`BrLTo3L}] := { + DeleteDuplicates[Join@@#[[All,1]]], + StringRiffle[#[[All, 2]], "\n\n"], + StringRiffle[#[[All, 3]], "\n\n"], + StringRiffle[#[[All, 4]], "\n\n"] +}&[create/@DeleteDuplicates[manyObservables /. Rule[_, {_, _, _}] -> Rule[_, {_, _, _}]]]; + +create[obs:FlexibleSUSYObservable`BrLTo3L[lep_, __, loopN_]] := +Module[{npfVertices = {}, npfCode = "", prototype, definition, scalars, vectors, boxes}, + {{npfVertices, npfCode}, {scalars, vectors, boxes}} = generate@obs; + + prototype = CConversion`CreateCType@Observables`GetObservableType@obs <> + " " <> Observables`GetObservablePrototype@obs; + + definition = FixedPoint[ + StringReplace[#, + { + "@L@" -> CConversion`ToValidCSymbolString@lep, + "@Ph@" -> CConversion`ToValidCSymbolString@SARAH`Photon, + "@photon_penguin@" -> If[loopN === 1, "calculate_@L@_@L@_@Ph@_form_factors", "zero"], + "@class_scalars@" -> scalars, + "@class_vectors@" -> vectors, + "@class_boxes@" -> boxes + } + ]&, + prototype <> " { + return forge< + fields::@L@, fields::@Ph@, + @photon_penguin@, + @class_scalars@, + @class_vectors@, + @class_boxes@ + >(nI, nO, nA, model, qedqcd);\n}" + ]; + + {npfVertices, npfCode, prototype <> ";", definition} +]; + +Module[{unevaluatedContributions = Tuples@{{0, 1}, {Scalars, Vectors, Boxes}}}, +generate[obs:FlexibleSUSYObservable`BrLTo3L[lep_, _, con_, loopN_]] := +Module[{ + parsed, keep, npfVertices = {}, npfCode = "", + extraVertices, extraCode, forge, funName, npf, operatorRules + }, + parsed = SymbolName/@If[Head@# === List, #, {#}]&@con; + keep = Switch[{loopN, parsed}, + {0, {"All"}}, {Vectors, Scalars}, + {0, {"NoScalars"}}, {Vectors}, + {1, {"All"}}, {Vectors, Scalars, Boxes}, + {1, {"NoScalars"}}, {Vectors, Boxes}, + {1, {"Penguins"}}, {Vectors, Scalars}, + _, Symbol/@parsed + ]; + + If[Not@MemberQ[keep, #], + forge@# = "zero", + funName = ToLowerCase@SymbolName@# <>ToString@loopN<>"loop"; + forge@# = "npointfunctions::" <> funName; + If[MemberQ[unevaluatedContributions, {loopN, #}], + unevaluatedContributions = unevaluatedContributions /. {loopN, #} :> Sequence[]; + Print["Contribution: "<>SymbolName@#]; + Print["Loop level: ", loopN]; + npf = NPointFunctions`NPointFunction[{lep, lep}, {lep, lep}, + NPointFunctions`OnShellFlag -> True, + NPointFunctions`UseCache -> True, + NPointFunctions`ZeroExternalMomenta -> NPointFunctions`ExceptLoops, + NPointFunctions`KeepProcesses -> {#}, + NPointFunctions`LoopLevel -> loopN, + NPointFunctions`Observable -> obs, + NPointFunctions`Regularize -> FlexibleSUSY`FSRenormalizationScheme + ]; + npf = npf /. { + SARAH`sum[__] -> 0, + LoopTools`B0i[i_, _, mm__] :> LoopTools`B0i[i, 0, mm], + LoopTools`C0i[i_, Repeated[_, {3}], mm__] :> LoopTools`C0i[i, Sequence@@Array[0&, 3], mm], + LoopTools`D0i[i_, Repeated[_, {6}], mm__] :> LoopTools`D0i[i, Sequence@@Array[0&, 6], mm] + }; + + {npf, operatorRules} = match@npf; + extraVertices = NPointFunctions`VerticesForNPointFunction@npf; + extraCode = NPointFunctions`CreateCXXFunctions[npf, funName, Identity, operatorRules][[2]]; + + npfVertices = Join[npfVertices, extraVertices]; + npfCode = npfCode <> "\n" <> extraCode; + ]; + ] &/@ {Scalars, Vectors, Boxes}; + + {{npfVertices, npfCode}, Last/@DownValues@forge} +]; +]; + +match[npf_] := +Module[{fields, sp, dc, dim6}, + fields = Flatten@NPointFunctions`GetProcess@npf; + sp[i_] := SARAH`DiracSpinor[fields[[i]], 0, 0]; + dc[a_, b__, c_] := NPointFunctions`DiracChain[sp@a, b, sp@c]; + dim6 = With[{l = SARAH`Lorentz, R = 6, L = 7}, + { + "S_LL" -> dc[3,L,1] dc[4,L,2], + "S_LR" -> dc[3,L,1] dc[4,R,2], + "S_RL" -> dc[3,R,1] dc[4,L,2], + "S_RR" -> dc[3,R,1] dc[4,R,2], + "V_LL" -> dc[3,R,l@1,1] dc[4,R,l@1,2], + "V_LR" -> dc[3,R,l@1,1] dc[4,L,l@1,2], + "V_RL" -> dc[3,L,l@1,1] dc[4,R,l@1,2], + "V_RR" -> dc[3,L,l@1,1] dc[4,L,l@1,2], + "T_LL" -> dc[3,-L,l@1,l@2,1] dc[4,-L,l@1,l@2,2], + "T_RR" -> dc[3,-R,l@1,l@2,1] dc[4,-R,l@1,l@2,2] + } + ]; + {WilsonCoeffs`InterfaceToMatching[npf, dim6], dim6} +]; + +End[]; diff --git a/meta/Observables/BrLTo3L/NPointFunctions.m b/meta/Observables/BrLTo3L/NPointFunctions.m new file mode 100644 index 0000000000..b25ae4d907 --- /dev/null +++ b/meta/Observables/BrLTo3L/NPointFunctions.m @@ -0,0 +1,78 @@ +topologies[0] = { + {Vectors, Scalars} -> treeAll +}; + +topologies[1] = { + {Vectors, Scalars} -> penguinT, + Boxes -> boxAll +}; + +diagrams[0, Absent] = { + Vectors -> { + treeAll -> {"remove vector bosons", FreeQ[TreeFields@##, FeynArts`V]&} + }, + Scalars -> { + treeAll -> {"remove scalar bosons", FreeQ[TreeFields@##, FeynArts`S]&} + } +}; + +diagrams[1, Present] = { + Vectors -> { + penguinT -> {"remove external leptons", FreeQ[LoopFields@##, FieldPattern[#, 1|3]]&}, + penguinT -> {"remove loop vectors", FreeQ[LoopFields@##, FeynArts`V]&} + }, + Scalars -> { + penguinT -> {"remove external leptons", FreeQ[LoopFields@##, FieldPattern[#, 1|3]]&}, + penguinT -> {"remove loop vectors", FreeQ[LoopFields@##, FeynArts`V]&} + }, + Boxes -> { + boxAll -> {"remove external leptons", FreeQ[LoopFields@##, FieldPattern[#, 1|2|3|4]]&}, + boxAll -> {"remove loop vectors", FreeQ[LoopFields@##, FeynArts`V]&} + } +}; + +diagrams[1, Absent] = { + Vectors -> { + penguinT -> {"remove tree vectors", FreeQ[TreeFields@##, FeynArts`V]&} + }, + Scalars -> { + penguinT -> {"remove tree scalars", FreeQ[TreeFields@##, FeynArts`S]&} + } +}; + +amplitudes[0, Present] = { + Vectors -> { + treeAll -> {"remove photons", FreeQ[{##}, InternalMass[FeynArts`V, 5] -> 0]&} + } +}; + +amplitudes[1, Present] = { + Vectors -> { + penguinT -> {"remove tree photons", FreeQ[{##}, InternalMass[FeynArts`V, 5] -> 0]&} + } +}; + +order[] = {3, 1, 4, 2}; + +regularization[1] = { + boxAll -> D +}; + +momenta[1] = { + penguinT -> 2, + boxAll -> 2 +}; + +sum[1] = { + inSelfT -> {"skip initial lepton", {6, Field[#, 1]&}}, + outSelfT -> {"skip final lepton", {6, Field[#, 3]&}} +}; + +chains[1] = { + ExceptLoops -> {1[k[4|2], ___] -> 0, 2[k[3|1], ___] -> 0} +}; + +mass[1] = { + inSelfT -> {"explicit final lepton mass", InternalMass[FeynArts`F, 6] :> ExternalMass[3]}, + inSelfT -> {"keep initial lepton mass untouched", Hold :> ExternalMass[1]} +}; diff --git a/meta/Observables/BrLTo3L/Observables.m b/meta/Observables/BrLTo3L/Observables.m new file mode 100644 index 0000000000..017d87f14e --- /dev/null +++ b/meta/Observables/BrLTo3L/Observables.m @@ -0,0 +1,10 @@ +DefineObservable[ + FlexibleSUSYObservable`BrLTo3L[lep_, iI_ -> {iJ_, iK_, iK_}, contr_, loopN_], + GetObservableType -> {13}, + GetObservableName -> "lepiItoiJiKbariK_contr_loopNloop", + GetObservableDescription -> "BR(lep(iI)->lep(iJ)lep(iK)barlep(iK)) for contr at loopN loop", + CalculateObservable -> + "calculate_lep_to_leplepbarlep_for_contr_loopNloop($(iI-1), $(iJ-1), $(iK-1), model, qedqcd)", + GetObservablePrototype -> + "calculate_lep_to_leplepbarlep_for_contr_loopNloop(int nI, int nO, int nA, auto model, auto qedqcd)" +]; diff --git a/meta/Observables/BrLTo3L/WriteOut.m b/meta/Observables/BrLTo3L/WriteOut.m new file mode 100644 index 0000000000..071180bc05 --- /dev/null +++ b/meta/Observables/BrLTo3L/WriteOut.m @@ -0,0 +1,35 @@ +WriteOut`WriteObservable[ + blockName_, + obs:FlexibleSUSYObservable`BrLTo3L[_, iI_ -> {iO_, iA_, iA_}, contr_, loopN_] +] := +Switch[blockName, + "FlexibleSUSYLowEnergy", + "Re(observables." <> Observables`GetObservableName@obs <> "(0))", + "FWCOEF"|"IMFWCOEF", + Module[{c1, c2, type}, + c1 = StringJoin[{iO, iI} /. {0 -> "11", 1 -> "13", 2 -> "15"}]; + c2 = StringJoin[{iA, iA} /. {0 -> "11", 1 -> "13", 2 -> "15"}]; + type = blockName /. {"FWCOEF"->"Re", "IMFWCOEF"->"Im"}; + StringReplace[ + { + "c1, 4322, 0, 0, 2, obs, \"D_L 1 loop\"", + "c1, 4422, 0, 0, 2, obs, \"D_R 1 loop\"", + "c1c2, 3131, 0, 0, 2, obs, \"S_LL contr loopN loop\"", + "c1c2, 3132, 0, 0, 2, obs, \"S_LR contr loopN loop\"", + "c1c2, 3231, 0, 0, 2, obs, \"S_RL contr loopN loop\"", + "c1c2, 3232, 0, 0, 2, obs, \"S_RR contr loopN loop\"", + "c1c2, 4141, 0, 0, 2, obs, \"V_LL contr loopN loop\"", + "c1c2, 4142, 0, 0, 2, obs, \"V_LR contr loopN loop\"", + "c1c2, 4241, 0, 0, 2, obs, \"V_RL contr loopN loop\"", + "c1c2, 4242, 0, 0, 2, obs, \"V_RR contr loopN loop\"", + "c1c2, 4343, 0, 0, 2, obs, \"T_LL contr loopN loop\"", + "c1c2, 4444, 0, 0, 2, obs, \"T_RR contr loopN loop\"" + }, + { + "c1" -> c1, "c2" -> c2, + "contr" -> SymbolName@contr, "loopN" -> ToString@loopN, + "obs" -> type<>"(observables."<>Observables`GetObservableName@obs<>")" + } + ] + ] +]; diff --git a/meta/Observables/BrLToLGamma/FSMathLink.m b/meta/Observables/BrLToLGamma/FSMathLink.m new file mode 100644 index 0000000000..125f453109 --- /dev/null +++ b/meta/Observables/BrLToLGamma/FSMathLink.m @@ -0,0 +1,15 @@ +Begin@"FSMathLink`Private`"; + +PutObservable[FlexibleSUSYObservable`BrLToLGamma[p1_[idx1_Integer]->{p2_[idx2_Integer], V_}], type_, link_String, heads_:{}] /; V === TreeMasses`GetPhoton[] := " +MLPutFunction(link, \"Rule\", 2); +MLPutFunction(link, \"FlexibleSUSYObservable`BrLToLGamma\", 1); +MLPutFunction(link, \"Rule\", 2); +MLPutFunction(link, " <> ObsToStr[p1] <> ", 1); +MLPutInteger(link, " <> ObsToStr[idx1] <> "); +MLPutFunction(link, \"List\", 2); +MLPutFunction(link, " <> ObsToStr[p2] <> ", 1); +MLPutInteger(link, " <> ObsToStr[idx2] <> "); +MLPutSymbol(link, " <> ObsToStr[V] <> "); +MLPutReal(link, OBSERVABLE(" <> ToString[p1] <> ToString[idx1] <> "_to_" <> ToString[p2] <> ToString[idx2] <> "_" <> ToString[V] <> "));" + +End[]; diff --git a/meta/BrLToLGamma.m b/meta/Observables/BrLToLGamma/FlexibleSUSY.m similarity index 60% rename from meta/BrLToLGamma.m rename to meta/Observables/BrLToLGamma/FlexibleSUSY.m index c7f52a318d..8e625cbf18 100644 --- a/meta/BrLToLGamma.m +++ b/meta/Observables/BrLToLGamma/FlexibleSUSY.m @@ -1,36 +1,59 @@ -(* ::Package:: *) +Begin@"FlexibleSUSY`Private`"; -(* :Copyright: +WriteClass[obs:FlexibleSUSYObservable`BrLToLGamma, slha_, files_] := +Module[{ + observables = DeleteDuplicates@Cases[Observables`GetRequestedObservables@slha, _obs], + LToLGammaFields, properStates, wrongFields, + prototypes = "", definitions = "" + }, - ==================================================================== - This file is part of FlexibleSUSY. + LToLGammaFields = DeleteDuplicates[observables /. + { + Rule[i_[_], {o_[_], v_}] :> Rule[i, {o, v}], + obs -> Sequence + } + ]; - FlexibleSUSY 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. + properStates = Cases[ + LToLGammaFields, + Rule[a_?IsLepton, {b_?IsLepton, c_ /; c === GetPhoton[]}] -> (a -> {b, c}) + ]; + wrongFields = Complement[LToLGammaFields, properStates]; + If[wrongFields =!= {}, + Utils`FSFancyWarning[ + "BrLToLGamma works only for leptons and a photon.", + " Removing requested process(es): ", + Riffle[ToString/@wrongFields, ", "] + ]; + LToLGammaFields = properStates; + ]; - FlexibleSUSY 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. + If[LToLGammaFields =!= {}, + Utils`PrintHeadline["Creating " <> SymbolName@obs <> " class ..."]; - You should have received a copy of the GNU General Public License - along with FlexibleSUSY. If not, see - . - ==================================================================== + {prototypes, definitions} = + StringJoin@@@(Riffle[#, "\n\n"] &/@ Transpose[createBrLToLGamma/@ LToLGammaFields]); + ]; -*) + WriteOut`ReplaceInFiles[ + files, + { + "@calculate_prototypes@" -> prototypes, + "@calculate_definitions@" -> definitions, + "@include_guard@" -> SymbolName@obs, + "@namespace@" -> Observables`GetObservableNamespace@obs, + "@filename@" -> Observables`GetObservableFileName@obs, + "@get_MSUSY@" -> TextFormatting`IndentText@TextFormatting`WrapLines@AMM`AMMGetMLCP[], + Sequence@@GeneralReplacementRules[] + } + ]; -BeginPackage["BrLToLGamma`", - {"SARAH`", "TextFormatting`", "TreeMasses`", "CXXDiagrams`", "CConversion`"} + { + "FFV fields" -> DeleteDuplicates@LToLGammaFields + } ]; -CreateInterfaceFunctionForBrLToLGamma::usage = ""; - -Begin["`Private`"]; - -CreateInterfaceFunctionForBrLToLGamma[inFermion_ -> {outFermion_, spectator_}] := +createBrLToLGamma[inFermion_ -> {outFermion_, spectator_}] := Module[{prototype, definition, numberOfIndices1 = CXXDiagrams`NumberOfFieldIndices[inFermion], numberOfIndices2 = CXXDiagrams`NumberOfFieldIndices[outFermion], @@ -57,21 +80,35 @@ IndentText[ If[TreeMasses`GetDimension[inFermion] =!= 1, "int generationIndex1, ", ""] <> If[TreeMasses`GetDimension[outFermion] =!= 1, "int generationIndex2, ", ""] <> "\n" <> - "const " <> FlexibleSUSY`FSModelName <> "_mass_eigenstates& model, const softsusy::QedQcd& qedqcd, const Physical_input& physical_input) {\n\n" + "const " <> FlexibleSUSY`FSModelName <> "_mass_eigenstates& model_, const softsusy::QedQcd& qedqcd, const Physical_input& physical_input) {\n\n" ] <> (* write routine for mu to e gamma *) IndentText[ + FlexibleSUSY`FSModelName<>"_mass_eigenstates model(model_);\n"<> + "try {\n"<> + IndentText[ + "run_to_MSUSY(model);\n"<> + "model.get_physical().clear();\n"<> + "model.solve_ewsb();\n" + ]<> + "} catch (const Error& e) {\n"<> + IndentText[ + "ERROR(\""<>FlexibleSUSY`FSModelName<> + "_l_to_lgamma:\" << e.what_detailed());\n"<> + "return std::numeric_limits::quiet_NaN();\n" + ]<> + "}\n"<> "context_base context {model};\n" <> "std::array ToString @ numberOfIndices1 <> "> indices1 = {" <> - (* TODO: Specify indices correctly *) + (* TODO(wkotlarski): Specify indices correctly *) If[TreeMasses`GetDimension[inFermion] =!= 1, " generationIndex1" <> If[numberOfIndices1 =!= 1, StringJoin @ Table[", 0", {numberOfIndices1-1}], ""] <> " ", If[numberOfIndices1 =!= 0, - StringJoin @ Riffle[Table[" 0", {numberOfIndices1}], ","] <> " ", + StringRiffle[Table[" 0", {numberOfIndices1}], ","] <> " ", ""] ] <> "};\n" <> "std::array ToString @ numberOfIndices2 <> @@ -82,7 +119,7 @@ StringJoin @ Table[", 0", {numberOfIndices2-1}], ""] <> " ", If[numberOfIndices2 =!= 0, - StringJoin @ Riffle[Table[" 0", {numberOfIndices2}], ","] <> " ", + StringRiffle[Table[" 0", {numberOfIndices2}], ","] <> " ", ""] ] <> "};\n\n" <> "const auto form_factors = calculate_" <> CXXNameOfField[inFermion] <> "_" @@ -96,11 +133,11 @@ "model, " <> discardSMcontributions <> ");\n" <> (* Dominik suggest that the phase space prefactor should use pole masses so we get them from the input file *) "double leptonInMassOS;\n" <> - "switch (generationIndex1) {\n" <> + "switch (generationIndex1) {\n" <> IndentText[ - "case 0: leptonInMassOS = qedqcd.displayMass(softsusy::mElectron); break;\n" <> - "case 1: leptonInMassOS = qedqcd.displayMass(softsusy::mMuon); break;\n" <> - "case 2: leptonInMassOS = qedqcd.displayMass(softsusy::mTau); break;\n" <> + "case 0: leptonInMassOS = qedqcd.displayMass(softsusy::mElectron); break;\n" <> + "case 1: leptonInMassOS = qedqcd.displayMass(softsusy::mMuon); break;\n" <> + "case 2: leptonInMassOS = qedqcd.displayMass(softsusy::mTau); break;\n" <> "default: throw std::invalid_argument(\"Unrecognized lepton\");\n" ] <> "}\n" <> @@ -109,7 +146,7 @@ "const double partial_width = pow(leptonInMassOS,5)/(16.0*Pi) * (std::norm(form_factors[2]) + std::norm(form_factors[3]));\n" <> "const double total_width = lepton_total_decay_width<" <> - CXXNameOfField[inFermion] <> ", " <> CXXNameOfField[outFermion] <> + CXXNameOfField[inFermion] <> ", " <> CXXNameOfField[outFermion] <> ">(indices1, indices2, model, qedqcd);\n" <> "\nreturn partial_width/total_width;\n" ] <> "}"; @@ -118,4 +155,3 @@ ]; End[]; -EndPackage[]; diff --git a/meta/Observables/BrLToLGamma/Observables.m b/meta/Observables/BrLToLGamma/Observables.m new file mode 100644 index 0000000000..46e79677f5 --- /dev/null +++ b/meta/Observables/BrLToLGamma/Observables.m @@ -0,0 +1,27 @@ +FlexibleSUSYObservable`BrLToLGamma[pIn_, idxIn_ -> idxOut_] := FlexibleSUSYObservable`BrLToLGamma[pIn[idxIn] -> {pIn[idxOut], TreeMasses`GetPhoton[]}]; + +DefineObservable[ + FlexibleSUSYObservable`BrLToLGamma[pIn_[idxIn_] -> {pOut_[idxOut_], V_}], + GetObservableName -> + "pInidxIn_to_pOutidxOut_V", + GetObservableDescription -> + "BR(pIn$(idxIn+1) -> pOut$(idxOut+1) V)", + GetObservableType -> + CConversion`ScalarType[CConversion`realScalarCType], + CalculateObservable -> + "calculate_pIn_to_pOut_V(idxIn, idxOut, model, qedqcd, physical_input)", + GetObservablePrototype -> "dummy()" +]; + +DefineObservable[ + FlexibleSUSYObservable`BrLToLGamma[pIn_ -> {pOut_, V_}], + GetObservableName -> + "pIn_to_pOut_V", + GetObservableDescription -> + "BR(pIn -> pOut V)", + GetObservableType -> + CConversion`ScalarType[CConversion`realScalarCType], + CalculateObservable -> + "calculate_pIn_to_pOut_V(model, qedqcd, physical_input)", + GetObservablePrototype -> "dummy()" +]; diff --git a/meta/Observables/BrLToLGamma/WriteOut.m b/meta/Observables/BrLToLGamma/WriteOut.m new file mode 100644 index 0000000000..fc4d4f7be2 --- /dev/null +++ b/meta/Observables/BrLToLGamma/WriteOut.m @@ -0,0 +1,11 @@ +WriteOut`WriteObservable[ + "FlexibleSUSYLowEnergy", + obs:FlexibleSUSYObservable`BrLToLGamma[pIn_[idxIn_] -> {pOut_[idxOut_], V_}] +] := "observables." <> Observables`GetObservableName@obs; + +WriteOut`WriteObservable[ + "FlexibleSUSYLowEnergy", + obs:FlexibleSUSYObservable`BrLToLGamma[pIn_ -> {pOut_, V_}] +] := "observables." <> Observables`GetObservableName@obs; + + diff --git a/meta/Observables/LToLConversion/FSMathLink.m b/meta/Observables/LToLConversion/FSMathLink.m new file mode 100644 index 0000000000..889c2fe346 --- /dev/null +++ b/meta/Observables/LToLConversion/FSMathLink.m @@ -0,0 +1,18 @@ +Begin@"FSMathLink`Private`"; +Module[{args = Sequence[in_@inN_ -> _@outN_, nucl_, proc_, loopN_], + obs = FlexibleSUSYObservable`LToLConversion, + cxx = CConversion`ToValidCSymbolString}, + PutObservable[obs@args, type_, link_String, heads_:{}] := StringJoin[ + "MLPutFunction(link, \"Rule\", 2);", + "MLPutFunction(link, ", ObsToStr@obs, ", 4);", + "MLPutFunction(link, \"Rule\", 2);", + "MLPutFunction(link, \"", cxx@in, "\", 1);", + "MLPutInteger(link, ", ObsToStr@inN, ");", + "MLPutFunction(link, \"", cxx@in, "\", 1);", + "MLPutInteger(link, ", ObsToStr@outN, ");", + "MLPutSymbol(link, \"", SymbolName@nucl, "\");", + "MLPutSymbol(link, \"", CConversion`ToValidCSymbolString@proc, "\");", + "MLPutInteger(link, ", ObsToStr@loopN, ");", + "MLPutReal(link, Re(OBSERVABLE(", GetObservableName@obs[ + in@inN -> in@outN, nucl, proc, loopN], ")(0)));"];]; +End[]; diff --git a/meta/Observables/LToLConversion/FlexibleSUSY.m b/meta/Observables/LToLConversion/FlexibleSUSY.m new file mode 100644 index 0000000000..c298fd2f35 --- /dev/null +++ b/meta/Observables/LToLConversion/FlexibleSUSY.m @@ -0,0 +1,165 @@ +Begin@"FlexibleSUSY`Private`"; + +WriteClass[obs:FlexibleSUSYObservable`LToLConversion, slha_, files_] := +Module[{ + observables = DeleteDuplicates@Cases[Observables`GetRequestedObservables@slha, _obs], + fieldsFFV = {}, verticesFFV = {}, additionalVertices = {}, + prototypes = "", npfHeaders = "", definitions = "", npfDefinitions = "", + newRules + }, + + newRules = { + "@LToLConversion_fill@" -> "slha_io.fill(ltolconversion_settings);", + "@LToLConversion_init@" -> "LToLConversion_settings ltolconversion_settings;", + "@LToLConversion_class_name@" -> "ltolconversion_settings,", + "@LToLConversion_class_declaration@" -> "class LToLConversion_settings;", + "@LToLConversion_named_argument@" -> "const LToLConversion_settings& ltolconversion_settings,", + (* Live inside librarylink. *) + "@LToLConversion_private@" -> "LToLConversion_settings ltolconversion_settings{}; ///< LToLConversion settings", + "@LToLConversion_setter@" -> "void set_ltolconversion_settings(const LToLConversion_settings& s) { ltolconversion_settings = s; }", + "@LToLConversion_set_data@" -> "data.set_ltolconversion_settings(ltolconversion_settings);", + "@LToLConversion_set_slha@" -> "slha_io.set_LToLConversion_settings(ltolconversion_settings);", + "@LToLConversion_reset@" -> "ltolconversion_settings.reset();" + }; + If[observables === {} || !FlexibleSUSY`FSFeynArtsAvailable || !FlexibleSUSY`FSFormCalcAvailable, + newRules = newRules /. Rule[x_, _]:> Rule[x, ""]; + ]; + + If[observables =!= {} && FlexibleSUSY`FSFeynArtsAvailable && FlexibleSUSY`FSFormCalcAvailable, + Utils`PrintHeadline["Creating " <> SymbolName@obs <> " class ..."]; + + fieldsFFV = {#, #} &/@ observables[[All, 1]]; + verticesFFV = Flatten/@Tuples@{{SARAH`bar@#, #}&/@TreeMasses`GetSMQuarks[], {TreeMasses`GetPhoton[]}}; + + {additionalVertices, npfDefinitions, prototypes, definitions} = create@observables; + ]; + + WriteOut`ReplaceInFiles[ + files, + { + "@npf_headers@" -> NPointFunctions`CreateCXXHeaders[], + "@npf_definitions@" -> npfDefinitions, + "@calculate_prototypes@" -> prototypes, + "@calculate_definitions@" -> definitions, + "@include_guard@" -> SymbolName@obs, + "@namespace@" -> Observables`GetObservableNamespace@obs, + "@filename@" -> Observables`GetObservableFileName@obs, + "@get_MSUSY@" -> TextFormatting`IndentText@TextFormatting`WrapLines@AMM`AMMGetMLCP[], + Sequence@@GeneralReplacementRules[] + } + ]; + { + "FFV fields" -> DeleteDuplicates@fieldsFFV, + "C++ vertices" -> DeleteDuplicates@Join[verticesFFV, additionalVertices], + "C++ replacements" -> newRules + } +]; + +create[manyObservables:{__FlexibleSUSYObservable`LToLConversion}] := { + DeleteDuplicates[Join@@#[[All,1]]], + StringRiffle[#[[All, 2]], "\n\n"], + StringRiffle[#[[All, 3]], "\n\n"], + StringRiffle[#[[All, 4]], "\n\n"] +}&[create/@DeleteDuplicates[manyObservables /. Rule[_Integer, _Integer] -> Rule[_, _]]]; + +create[obs:FlexibleSUSYObservable`LToLConversion[in_, __, con_, loopN_]] := +Module[{npfVertices, npfDefinition, calculateDefinition, prototype}, + {npfVertices, npfDefinition} = generate@obs; + + prototype = CConversion`CreateCType@Observables`GetObservableType@obs <> + " " <> Observables`GetObservablePrototype@obs; + + {calculateDefinition, npfDefinition} = FixedPoint[ + StringReplace[#, + { + "@L@" -> CConversion`ToValidCSymbolString@in, + "@U@" -> CConversion`ToValidCSymbolString@SARAH`UpQuark, + "@D@" -> CConversion`ToValidCSymbolString@SARAH`DownQuark, + "@Ph@" -> CConversion`ToValidCSymbolString@SARAH`Photon, + "@N@" -> CConversion`ToValidCSymbolString@loopN, + "@con@" -> CConversion`ToValidCSymbolString@con, + "@photon_penguin@" -> If[loopN === 1, "calculate_@L@_@L@_@Ph@_form_factors", "zero"], + "@classU@" -> "conversion_@L@@U@_to_@L@@U@_@con@@N@loop", + "@classD@" -> "conversion_@L@@D@_to_@L@@D@_@con@@N@loop" + } + ]&, + { + prototype <> " { + return forge_conversion< + fields::@L@, fields::@U@, fields::@D@, fields::@Ph@, + @photon_penguin@, + npointfunctions::@classU@, + npointfunctions::@classD@ + >(in, out, n, model, parameters, qedqcd);\n}", + npfDefinition + } + ]; + + {npfVertices, npfDefinition, prototype <> ";", calculateDefinition} +]; + +generate[obs:FlexibleSUSYObservable`LToLConversion[in_, __, con_, loopN_]] := +Module[{npfU, npfD, fields, keep, dim6, codeU, codeD, parsed}, + parsed = SymbolName/@If[Head@# === List, #, {#}]&@con; + keep = Switch[{loopN, parsed}, + {0, {"All"}}, {Vectors, Scalars}, + {0, {"NoScalars"}}, {Vectors}, + {1, {"All"}}, {Vectors, Scalars, Boxes}, + {1, {"NoScalars"}}, {Vectors, Boxes}, + {1, {"Penguins"}}, {Vectors, Scalars}, + _, Symbol/@parsed + ]; + Print["Contributions: ", SymbolName/@keep]; + Print["Loop level: ", loopN]; + + {npfU, npfD} = NPointFunctions`NPointFunction[ + {in, #}, {in, #}, + NPointFunctions`OnShellFlag -> True, + NPointFunctions`UseCache -> True, + NPointFunctions`ZeroExternalMomenta -> NPointFunctions`ExceptLoops, + NPointFunctions`KeepProcesses -> keep, + NPointFunctions`LoopLevel -> loopN, + NPointFunctions`Observable -> obs, + NPointFunctions`Regularize -> FlexibleSUSY`FSRenormalizationScheme + ] &/@ {SARAH`UpQuark, SARAH`DownQuark}; + {npfU, npfD} = {npfU, npfD} /. { + SARAH`sum[__] -> 0, + LoopTools`B0i[i_, _, mm__] :> LoopTools`B0i[i, 0, mm], + LoopTools`C0i[i_, Repeated[_, {3}], mm__] :> LoopTools`C0i[i, Sequence@@Array[0&, 3], mm], + LoopTools`D0i[i_, Repeated[_, {6}], mm__] :> LoopTools`D0i[i, Sequence@@Array[0&, 6], mm] + }; + + fields[SARAH`UpQuark] = Flatten@NPointFunctions`GetProcess@npfU; + fields[SARAH`DownQuark] = Flatten@NPointFunctions`GetProcess@npfD; + dim6[q_] := Module[{sp, dc, l = SARAH`Lorentz, R = 6, L = 7}, + sp[f_, n_] := SARAH`DiracSpinor[fields[f][[n]], 0, 0]; + dc[a_, b__, c_] := NPointFunctions`DiracChain[sp[q, a], b, sp[q, c]]; + { + "S_LL" -> dc[3,L,1] dc[4,L,2], + "S_LR" -> dc[3,L,1] dc[4,R,2], + "S_RL" -> dc[3,R,1] dc[4,L,2], + "S_RR" -> dc[3,R,1] dc[4,R,2], + "V_LL" -> dc[3,R,l@1,1] dc[4,R,l@1,2], + "V_LR" -> dc[3,R,l@1,1] dc[4,L,l@1,2], + "V_RL" -> dc[3,L,l@1,1] dc[4,R,l@1,2], + "V_RR" -> dc[3,L,l@1,1] dc[4,L,l@1,2], + "T_LL" -> dc[3,-L,l@1,l@2,1] dc[4,-L,l@1,l@2,2], + "T_RR" -> dc[3,-R,l@1,l@2,1] dc[4,-R,l@1,l@2,2] + } + ]; + npfU = WilsonCoeffs`InterfaceToMatching[npfU, dim6@SARAH`UpQuark]; + npfD = WilsonCoeffs`InterfaceToMatching[npfD, dim6@SARAH`DownQuark]; + + codeU = NPointFunctions`CreateCXXFunctions[npfU, "@classU@", SARAH`Delta, dim6@SARAH`UpQuark][[2]]; + codeD = NPointFunctions`CreateCXXFunctions[npfD, "@classD@", SARAH`Delta, dim6@SARAH`DownQuark][[2]]; + + { + DeleteDuplicates@Join[ + NPointFunctions`VerticesForNPointFunction@npfU, + NPointFunctions`VerticesForNPointFunction@npfD + ], + codeU<>"\n\n"<>codeD + } +]; + +End[]; diff --git a/meta/Observables/LToLConversion/NPointFunctions.m b/meta/Observables/LToLConversion/NPointFunctions.m new file mode 100644 index 0000000000..ce7465f204 --- /dev/null +++ b/meta/Observables/LToLConversion/NPointFunctions.m @@ -0,0 +1,80 @@ +topologies[0] = { + {Vectors, Scalars} -> treeAll +}; + +topologies[1] = { + {Vectors, Scalars} -> penguinT, + Boxes -> boxAll +}; + +diagrams[0, Absent] = { + Vectors -> { + treeAll -> {"remove vector bosons", FreeQ[TreeFields@##, FeynArts`V]&} + }, + Scalars -> { + treeAll -> {"remove scalar bosons", FreeQ[TreeFields@##, FeynArts`S]&} + } +}; + +diagrams[1, Present] = { + Vectors -> { + penguinT -> {"remove external leptons", FreeQ[LoopFields@##, FieldPattern[#, 1|3]]&}, + penguinT -> {"remove loop vectors", FreeQ[LoopFields@##, FeynArts`V]&} + }, + Scalars -> { + penguinT -> {"remove external leptons", FreeQ[LoopFields@##, FieldPattern[#, 1|3]]&}, + penguinT -> {"remove loop vectors", FreeQ[LoopFields@##, FeynArts`V]&} + }, + Boxes -> { + boxAll -> {"remove external leptons", FreeQ[LoopFields@##, FieldPattern[#, 1|2|3|4]]&}, + boxAll -> {"remove vector bosons from loops", FreeQ[LoopFields@##, FeynArts`V]&} + } +}; + +diagrams[1, Absent] = { + Vectors -> { + penguinT -> {"remove tree vectors", FreeQ[TreeFields@##, FeynArts`V]&} + }, + Scalars -> { + penguinT -> {"remove tree scalars", FreeQ[TreeFields@##, FeynArts`S]&} + } +}; + +amplitudes[0, Present] = { + Vectors -> { + treeAll -> {"remove photons", FreeQ[{##}, InternalMass[FeynArts`V, 5] -> 0]&} + } +}; + +amplitudes[1, Present] = { + Vectors -> { + penguinT -> {"remove tree photons", FreeQ[{##}, InternalMass[FeynArts`V, 5] -> 0]&} + } +}; + +order[] = {3, 1, 4, 2}; + +regularization[1] = { + boxS -> D, + boxU -> D +}; + +momenta[1] = { + penguinT -> 2, + boxS -> 2, + boxU -> 2 +}; + +sum[1] = { + inSelfT -> {"skip initial lepton", {6, Field[#, 1]&}}, + outSelfT -> {"skip final lepton", {6, Field[#, 3]&}} +}; + +chains[1] = { + {ExceptLoops, OperatorsOnly} -> {1[k[4], ___] -> 0, 2[k[1], ___] -> 0} +}; + +mass[1] = { + inSelfT -> {"explicit final lepton mass", InternalMass[FeynArts`F, 6] :> ExternalMass[3]}, + inSelfT -> {"keep initial lepton mass untouched", Hold :> ExternalMass[1]} +}; diff --git a/meta/Observables/LToLConversion/Observables.m b/meta/Observables/LToLConversion/Observables.m new file mode 100644 index 0000000000..96c037362c --- /dev/null +++ b/meta/Observables/LToLConversion/Observables.m @@ -0,0 +1,10 @@ +DefineObservable[ + FlexibleSUSYObservable`LToLConversion[lep_, iI_ -> iO_, nucl_, contr_, loopN_], + GetObservableType -> {13}, + GetObservableName -> "lepiIlepiOinnucl_contr_loopNloop", + CalculateObservable -> + "calculate_leplep_forcontr_loopNloop($(iI-1), $(iO-1), context::Nucleus::nucl, model, ltolconversion_settings, qedqcd)", + GetObservablePrototype -> + "calculate_leplep_forcontr_loopNloop(int in, int out, const context::Nucleus n, auto model, const LToLConversion_settings& parameters, auto qedqcd)", + GetObservableDescription -> "CR(lep(iI)->lep(iO)) in nucl for contr at loopN loop" +]; diff --git a/meta/Observables/LToLConversion/WriteOut.m b/meta/Observables/LToLConversion/WriteOut.m new file mode 100644 index 0000000000..521877235d --- /dev/null +++ b/meta/Observables/LToLConversion/WriteOut.m @@ -0,0 +1,34 @@ +WriteOut`WriteObservable[ + blockName_, + obs:FlexibleSUSYObservable`LToLConversion[_, iI_ -> iO_, _, contr_, loopN_] +] := +Switch[blockName, + "FlexibleSUSYLowEnergy", + "Re(observables." <> Observables`GetObservableName@obs <> "(0))", + "FWCOEF"|"IMFWCOEF", + Module[{lep, type}, + lep = StringJoin[{iO, iI} /. {0 -> "11", 1 -> "13", 2 -> "15"}]; + type = blockName /. {"FWCOEF"->"Re", "IMFWCOEF"->"Im"}; + StringReplace[ + { + "lep, 4322, 0, 0, 2, obs, \"D_L 1 loop\"", + "lep, 4422, 0, 0, 2, obs, \"D_R 1 loop\"", + "lepqu, 3131, 0, 0, 2, obs, \"S_LL contr loopN loop\"", + "lepqu, 3132, 0, 0, 2, obs, \"S_LR contr loopN loop\"", + "lepqu, 3231, 0, 0, 2, obs, \"S_RL contr loopN loop\"", + "lepqu, 3232, 0, 0, 2, obs, \"S_RR contr loopN loop\"", + "lepqu, 4141, 0, 0, 2, obs, \"V_LL contr loopN loop\"", + "lepqu, 4142, 0, 0, 2, obs, \"V_LR contr loopN loop\"", + "lepqu, 4241, 0, 0, 2, obs, \"V_RL contr loopN loop\"", + "lepqu, 4242, 0, 0, 2, obs, \"V_RR contr loopN loop\"", + "lepqu, 4343, 0, 0, 2, obs, \"T_LL contr loopN loop\"", + "lepqu, 4444, 0, 0, 2, obs, \"T_RR contr loopN loop\"" + }, + { + "lep" -> lep, "qu" -> "0202", "qd" -> "0101", + "contr" -> SymbolName@contr, "loopN" -> ToString@loopN, + "obs" -> type<>"(observables."<>Observables`GetObservableName@obs<>")" + } + ] + ] +]; diff --git a/meta/Parameters.m b/meta/Parameters.m index 331322a623..a7ad23548f 100644 --- a/meta/Parameters.m +++ b/meta/Parameters.m @@ -417,10 +417,12 @@ ProcessParameterInfo[{parameter_ /; (IsModelParameter[parameter] || IsOutputParameter[parameter]), {__}}] := Block[{}, - Print["Warning: the properties of ", parameter, " are set"]; - Print[" in the SARAH model files and cannot be overridden."]; - Print[" Ignoring property settings for ", parameter]; - ]; + Utils`FSFancyWarning[ + "The properties of ", parameter, " are set", + " in the SARAH model files and cannot be overridden.", + " Ignoring property settings for ", parameter + ]; + ]; ProcessParameterInfo[{parameter_?IsInputParameter, properties_List}] := Module[{i, inputBlock, ignored = {}, validProperties = properties, property, setting}, @@ -434,10 +436,14 @@ AddMassDimensionInfo[parameter, setting], property === SARAH`LesHouches, SetInputParameterSLHABlock[parameter, setting], - True, Print["Warning: unrecognized property for parameter ", parameter, ": ", property] - ]; - ]; - ]; + True, + Utils`FSFancyWarning[ + "Unrecognized property for parameter", + " ", parameter, ": ", property + ]; + ]; + ]; + ]; ProcessParameterInfo[{parameter_?IsExtraParameter, properties_List}] := Module[{i, property, setting}, @@ -454,10 +460,14 @@ Print["Error: ", parameter, " is defined as an input parameter"]; Print[" but is being treated as an extra parameter."]; Quit[1];, - True, Print["Warning: unrecognized property for parameter ", parameter, ": ", property] - ]; - ]; - ]; + True, + Utils`FSFancyWarning[ + "Unrecognized property for parameter", + " ", parameter, ": ", property + ]; + ]; + ]; + ]; ProcessParameterInfo[{parameter_, properties_List}] := Block[{inputOptions, isInput = False}, @@ -538,10 +548,6 @@ SetRealParameters[parameters_List] := additionalRealParameters = parameters; -DebugPrint[msg___] := - If[FlexibleSUSY`FSDebugOutput, - Print["Debug: ", Sequence @@ InputFormOfNonStrings /@ {msg}]]; - FindSymbolDef[sym_, opt_:DependenceNum] := Module[{symDef}, symDef = Cases[SARAH`ParameterDefinitions, @@ -552,10 +558,10 @@ Return[0]; ]; If[Length[symDef] > 1, - Print["Warning: ", sym, " defined multiple times"]; - ]; + Utils`FSFancyWarning[sym, " defined multiple times"]; + ]; symDef[[1]] - ]; + ]; FindAllParametersFromList[expr_, parameters_List] := Module[{symbols, compactExpr}, @@ -1006,7 +1012,7 @@ CreateIndexReplacementRules[pars_List] := Flatten[CreateIndexReplacementRule /@ pars]; -GetGUTNormalization[coupling_Symbol] := +GetGUTNormalization[coupling_Symbol] /; ValueQ[SARAH`Gauge] := Module[{pos, norm}, pos = Position[SARAH`Gauge, coupling]; If[pos =!= {}, @@ -1597,38 +1603,26 @@ GetParameterFromDescription[description_String] := Module[{parameter}, - parameter =Cases[SARAH`ParameterDefinitions, - {parameter_, - {___, SARAH`Description -> description, ___}} :> - parameter]; - If[Length[parameter] == 0, - Print["Error: Parameter with description \"", description, - "\" not found."]; - Return[Null]; - ]; - If[Length[parameter] > 1, - Print["Warning: Parameter with description \"", description, - "\" not unique."]; - ]; - parameter[[1]] + parameter = Cases[SARAH`ParameterDefinitions, + {parameter_, {___, SARAH`Description -> description, ___}} :> parameter]; + Switch[parameter, + {}, FSDebugPrint["Parameters", "Note: Parameter with description \"", description, "\" not found."]; Null, + {_}, First[parameter], + {_, __}, Utils`FSFancyWarning["Parameter with description \"", description, "\" not unique: ", parameter]; First[parameter], + _, Print["Error: Cases did not return a list in GetParameterFromDescription[", parameter, "]."]; Quit[1] + ] ]; GetParticleFromDescription[description_String, eigenstates_:FlexibleSUSY`FSEigenstates] := Module[{particle}, - particle =Cases[SARAH`ParticleDefinitions[eigenstates], - {particle_, - {___, SARAH`Description -> description, ___}} :> - particle]; - If[Length[particle] == 0, - DebugPrint["Note: Particle with description \"", description, - "\" not found."]; - Return[Null]; - ]; - If[Length[particle] > 1, - Print["Warning: Particle with description \"", description, - "\" not unique."]; - ]; - particle[[1]] + particle = Cases[SARAH`ParticleDefinitions[eigenstates], + {particle_, {___, SARAH`Description -> description, ___}} :> particle]; + Switch[particle, + {}, FSDebugPrint["Parameters", "Note: Particle with description \"", description, "\" not found."]; Null, + {_}, First[particle], + {_, __}, Utils`FSFancyWarning["Particle with description \"", description, "\" not unique: ", particle]; First[particle], + _, Print["Error: Cases did not return a list in GetParticleFromDescription[", particle, "]."]; Quit[1] + ] ]; GetParticleFromDescription[multipletName_String, splitNames_List] := @@ -1834,7 +1828,11 @@ GetThirdGeneration[par_] := Which[IsScalar[par], par, IsMatrix[par], par[2,2], - True, Print["Warning: GetThirdGeneration[",par,"]: unknown type"]; par + True, + Utils`FSFancyWarning[ + "GetThirdGeneration[", par, "]: unknown type" + ]; + par ]; GetSARAHParameters[] := diff --git a/meta/References.m b/meta/References.m index 8184a0261a..f85f3d9873 100644 --- a/meta/References.m +++ b/meta/References.m @@ -38,7 +38,7 @@ CreateCitation[{}] := ""; CreateCitation[refs_List] := - "\\cite{" <> StringJoin[Riffle[refs, ","]] <> "}"; + "\\cite{" <> StringRiffle[refs, ","] <> "}"; CreateCitation[] := CreateCitation[fsreferences]; diff --git a/meta/SelfEnergies.m b/meta/SelfEnergies.m index 9da179958d..fccc01543c 100644 --- a/meta/SelfEnergies.m +++ b/meta/SelfEnergies.m @@ -24,9 +24,28 @@ BeginPackage["SelfEnergies`", {"SARAH`", "TextFormatting`", "CConversion`", "TreeMasses`", "Parameters`", "Vertices`", "Utils`"}]; -FSSelfEnergy::usage="self-energy head"; -FSHeavySelfEnergy::usage="head for self-energy w/o BSM particles"; -FSHeavyRotatedSelfEnergy::usage="head for self-energy w/o BSM particles in mass eigenstate basis"; +FSSelfEnergy::usage = " +Head representing a self energy in a format + +FSSelfEnergy[{particle1[gen1], particle2[gen2]}[lor], expr] + +where gen1 and gen2 are integers representing generations and lor = 1|PL|PR + +The first argument can be + +{particle1, particle2} for dim=1 scalar or vector multiplet +{particle1[gen1], particle2[gen2]} for dim>1 scalar or vector multiplet +{particle1, particle2}[lor] for dim=1 fermion multiplet +{particle1[gen1], particle2[gen2]}[lor] for dim>1 fermion multiplet +"; + +FSSelfEnergyDerivative::usage="Head for derivative of self-energy w.r.t. p^2, see FSSelfEnergy for argument list"; + +(* symbols for derivative of loop functions w.r.t. p^2 *) +{ DB0, DF0, DG0 } + +FSHeavySelfEnergy::usage="head for self-energy w/o BSM particles, see FSSelfEnergy for argument list"; +FSHeavyRotatedSelfEnergy::usage="head for self-energy w/o BSM particles in mass eigenstate basis, see FSSelfEnergy for argument list"; Tadpole::usage="tadpole head"; GetField::usage="Returns field in self-energy or tadpole"; @@ -82,6 +101,9 @@ CreateThreeLoopSelfEnergiesMSSM::usage="Creates function prototypes and definitions for three-loop Higgs contribution in the MSSM"; +CreateThreeLoopSelfEnergiesNMSSM::usage="Creates function prototypes +and definitions for three-loop Higgs contribution in the NMSSM"; + CreateThreeLoopSelfEnergiesSplit::usage="Creates function prototypes and definitions for three-loop Higgs self-energies in split-SUSY"; @@ -92,9 +114,30 @@ Begin["`Private`"]; +SetSystemOptions[ + "DifferentiationOptions" -> + "ExcludedFunctions"-> DeleteDuplicates[ + Append[ + OptionValue[SystemOptions[], "DifferentiationOptions"->"ExcludedFunctions"], + SARAH`sum + ] + ] +]; + +SARAH`sum /: D[SARAH`sum[idx_, i_, j_, expr_], p2_] := SARAH`sum[idx, i, j, D[expr, p2]]; + +D[SelfEnergies`FSSelfEnergy[particle_, expr_], mom2_] ^:= SelfEnergies`FSSelfEnergyDerivative[particle, D[expr, mom2]]; + +Derivative[1, 0, 0][B0][p2_, m12_, m22_] := DB0[p2, m12, m22]; +Derivative[1, 0, 0][F0][p2_, m12_, m22_] := DF0[p2, m12, m22]; +Derivative[1, 0, 0][G0][p2_, m12_, m22_] := DG0[p2, m12, m22]; + GetExpression[selfEnergy_SelfEnergies`FSSelfEnergy] := selfEnergy[[2]]; +GetExpression[selfEnergy_SelfEnergies`FSSelfEnergyDerivative] := + selfEnergy[[2]]; + GetExpression[selfEnergy_SelfEnergies`FSHeavySelfEnergy] := selfEnergy[[2]]; @@ -107,6 +150,9 @@ GetField[selfEnergy_SelfEnergies`FSSelfEnergy] := selfEnergy[[1]]; +GetField[selfEnergy_SelfEnergies`FSSelfEnergyDerivative] := + selfEnergy[[1]]; + GetField[selfEnergy_SelfEnergies`FSHeavySelfEnergy] := selfEnergy[[1]]; @@ -205,10 +251,19 @@ Module[{k, field, result = lst}, For[k = 1, k <= Length[result], k++, field = GetField[result[[k]]]; - If[GetDimension[field] > 1, - result[[k,1]] = field[idx]; - ]; - ]; + (* self energies or tadpoles *) + If[ListQ[field], + If[GetDimension[field[[1]]] > 1, + result[[k,1,1]] = field[[1]][(List@idx)[[1]]]; + ]; + If[GetDimension[field[[2]]] > 1, + result[[k,1,2]] = field[[2]][(List@idx)[[2]]]; + ], + If[GetDimension[field] > 1, + result[[k,1]] = field[idx]; + ] + ] + ]; result ]; @@ -221,12 +276,14 @@ therefore not be accessed in the form Glu(gO2). *) Remove1DimensionalFieldIndices[lst_List] := - Module[{k, field, result = lst}, + Module[{k, fields, result = lst}, For[k = 1, k <= Length[result], k++, - field = GetHead[GetField[result[[k]]]]; - If[GetDimension[field] == 1, - result[[k,2]] = result[[k,2]] /. field[{__}] :> field; - ]; + fields = GetField[result[[k]]] /. {f__}[_] :> {f}; + For[i = 1, i <= Length[fields], i++, + If[GetDimension[fields[[i]]] == 1, + result[[k,2]] = result[[k,2]] /. fields[[i]][{__}] :> fields[[i]]; + ]; + ] ]; result ]; @@ -271,17 +328,26 @@ therefore not be accessed in the form Glu(gO2). result = AppendFieldIndices[result, SARAH`gO1, SARAH`gO2]; result = SplitFermionSelfEnergies[result]; result = Remove1DimensionalFieldIndices[result]; - (* Create Bottom, Tau self-energy with only SUSY + (* Create Bottom and lepton self-energy with only SUSY particles and W and Z bosons in the loop *) heavySE = Cases[result, SelfEnergies`FSSelfEnergy[ - p:bQuark[__][_]|bQuark[_]|((particle_[__][_]|particle_[_]) /; TreeMasses`IsSMChargedLepton[particle]), expr__] :> - SelfEnergies`FSHeavyRotatedSelfEnergy[p, expr]]; + { + p1:bQuark|bQuark[_]|(particle_[_] /; TreeMasses`IsSMChargedLepton[particle])|(particle_ /; TreeMasses`IsSMChargedLepton[particle]), + p2:bQuark|bQuark[_]|(particle_[_] /; TreeMasses`IsSMChargedLepton[particle])|(particle_ /; TreeMasses`IsSMChargedLepton[particle]) + }[lor_], + expr__ + ] :> SelfEnergies`FSHeavyRotatedSelfEnergy[{p1, p2}[lor], expr]]; result = Join[result, ReplaceUnrotatedFields /@ (RemoveSMParticles[#,False,{SARAH`VectorZ,SARAH`VectorW,SARAH`HiggsBoson}]& /@ heavySE)]; (* Create rotated Top self-energy with only SUSY particles and W, Z and photon bosons in the loop *) - heavySE = Cases[result, SelfEnergies`FSSelfEnergy[p:tQuark[__][_]|tQuark[_], expr__] :> - SelfEnergies`FSHeavyRotatedSelfEnergy[p, expr]]; + heavySE = Cases[result, SelfEnergies`FSSelfEnergy[ + { + p1:tQuark|tQuark[_], + p2:tQuark|tQuark[_] + }[lor_], + expr__ + ] :> SelfEnergies`FSHeavyRotatedSelfEnergy[{p1, p2}[lor], expr]]; result = Join[result, ReplaceUnrotatedFields /@ (RemoveParticle[#, If[FlexibleSUSY`UseMSSMYukawa2Loop === True, @@ -291,8 +357,13 @@ therefore not be accessed in the form Glu(gO2). ]& /@ heavySE)]; (* Create unrotated Top self-energy with only SUSY particles and W, Z and photon bosons in the loop *) - heavySE = Cases[result, SelfEnergies`FSSelfEnergy[p:tQuark[__][_]|tQuark[_], expr__] :> - SelfEnergies`FSHeavySelfEnergy[p, expr]]; + heavySE = Cases[result, SelfEnergies`FSSelfEnergy[ + { + p1:tQuark|tQuark[_], + p2:tQuark|tQuark[_] + }[lor_], + expr__ + ] :> SelfEnergies`FSHeavySelfEnergy[{p1, p2}[lor], expr]]; result = Join[result, RemoveParticle[#, If[FlexibleSUSY`UseMSSMYukawa2Loop === True, {SARAH`VectorG,SARAH`Gluino}, @@ -434,34 +505,43 @@ therefore not be accessed in the form Glu(gO2). ]; DeclareFieldIndices[field_Symbol] := ""; +DeclareFieldIndices[{field1_, field2_}] := ""; DeclareFieldIndices[field_[ind1_, ind2_]] := ", int " <> ToValidCSymbolString[ind1] <> ", int " <> ToValidCSymbolString[ind2]; +DeclareFieldIndices[{field_, field_}[chirality_]] := DeclareFieldIndices[{field, field}]; +DeclareFieldIndices[{field1_[ind1_], field2_[ind2_]}] := + ", int " <> ToValidCSymbolString[ind1] <> + ", int " <> ToValidCSymbolString[ind2]; + DeclareFieldIndices[field_[PL]] := DeclareFieldIndices[field]; DeclareFieldIndices[field_[PR]] := DeclareFieldIndices[field]; DeclareFieldIndices[field_[1]] := DeclareFieldIndices[field]; DeclareFieldIndices[field_[ind_]] := "int " <> ToValidCSymbolString[ind]; -ExtractChiraility[field_[idx1_,idx2_]] := ExtractChiraility[field]; ExtractChiraility[field_[PL]] := "_PL"; ExtractChiraility[field_[PR]] := "_PR"; ExtractChiraility[field_[1]] := "_1"; ExtractChiraility[field_[idx_]] := ExtractChiraility[field]; ExtractChiraility[field_] := ""; -ExtractFieldName[field_[idx1_,idx2_]] := ExtractFieldName[field]; -ExtractFieldName[field_[PL]] := ExtractFieldName[field]; -ExtractFieldName[field_[PR]] := ExtractFieldName[field]; -ExtractFieldName[field_[1]] := ExtractFieldName[field]; -ExtractFieldName[field_[idx_]] := ExtractFieldName[field]; -ExtractFieldName[field_] := ToValidCSymbolString[field]; +ExtractFieldName[field_[_]] := ExtractFieldName[field]; +ExtractFieldName[field_Symbol] := ToValidCSymbolString[field]; +ExtractFieldName[{field1_[_], field2_[_]}] := ExtractFieldName[{field1, field2}]; +ExtractFieldName[{field_, field_}] := ToValidCSymbolString[field]; +(* Z-gamma self energy case *) +ExtractFieldName[{field1_, field2_}] := ToValidCSymbolString[field1] <> ToValidCSymbolString[field2]; +ExtractFieldName[field_] := (Print["Error: Cannot get the name of fields ", field]; Quit[1]); CreateSelfEnergyFunctionName[field_, loops_] := "self_energy_" <> ExtractFieldName[field] <> "_" <> ToString[loops] <> "loop" <> ExtractChiraility[field]; +CreateSelfEnergyDerivativeFunctionName[field_, loops_] := + "self_energy_" <> ExtractFieldName[field] <> "_" <> ToString[loops] <> "loop" <> ExtractChiraility[field] <> "_deriv_p2"; + CreateHeavySelfEnergyFunctionName[field_, loops_] := "self_energy_" <> ExtractFieldName[field] <> "_" <> ToString[loops] <> "loop" <> ExtractChiraility[field] <> "_heavy"; @@ -474,6 +554,9 @@ therefore not be accessed in the form Glu(gO2). CreateFunctionName[selfEnergy_SelfEnergies`FSSelfEnergy, loops_] := CreateSelfEnergyFunctionName[GetField[selfEnergy], loops]; +CreateFunctionName[selfEnergy_SelfEnergies`FSSelfEnergyDerivative, loops_] := + CreateSelfEnergyDerivativeFunctionName[GetField[selfEnergy], loops]; + CreateFunctionName[selfEnergy_SelfEnergies`FSHeavySelfEnergy, loops_] := CreateHeavySelfEnergyFunctionName[GetField[selfEnergy], loops]; @@ -489,7 +572,7 @@ therefore not be accessed in the form Glu(gO2). CreateFunctionPrototype[selfEnergy_, loops_] := CreateFunctionName[selfEnergy, loops] <> - "(" <> CreateCType[CConversion`ScalarType[CConversion`realScalarCType]] <> " p " <> DeclareFieldIndices[GetField[selfEnergy]] <> ") const"; + "(" <> CreateCType[CConversion`ScalarType[CConversion`realScalarCType]] <> " p" <> DeclareFieldIndices[GetField[selfEnergy]] <> ") const"; CreateFunctionPrototypeMatrix[s_, loops_] := CreateFunctionName[s, loops] <> "(double p) const"; @@ -536,32 +619,38 @@ therefore not be accessed in the form Glu(gO2). CreateNPointFunctionMatrix[_SelfEnergies`Tadpole] := { "", "" }; FillHermitianSelfEnergyMatrix[nPointFunction_, sym_String] := - Module[{field = GetField[nPointFunction], dim, name}, - dim = GetDimension[field]; + Module[{field = GetField[nPointFunction] /. {f1_, f2_}[_] :> {f1, f2}, dim, name}, + dim1 = GetDimension[field[[1]]]; + dim2 = GetDimension[field[[2]]]; name = CreateFunctionName[nPointFunction, 1]; "\ -for (int i = 0; i < " <> ToString[dim] <> "; i++) - for (int k = i; k < " <> ToString[dim] <> "; k++) +for (int i = 0; i < " <> ToString[dim1] <> "; i++) { + for (int k = i; k < " <> ToString[dim2] <> "; k++) { " <> sym <> "(i, k) = " <> name <> "(p, i, k); + } +} Hermitianize(" <> sym <> "); " ]; FillGeneralSelfEnergyFunction[nPointFunction_, sym_String] := - Module[{field = GetField[nPointFunction], dim, name}, - dim = GetDimension[field]; + Module[{field = GetField[nPointFunction] /. {f1_, f2_}[_] :> {f1, f2}, dim, name}, + dim1 = GetDimension[field[[1]]]; + dim2 = GetDimension[field[[2]]]; name = CreateFunctionName[nPointFunction, 1]; "\ -for (int i = 0; i < " <> ToString[dim] <> "; i++) - for (int k = 0; k < " <> ToString[dim] <> "; k++) +for (int i = 0; i < " <> ToString[dim1] <> "; i++) { + for (int k = 0; k < " <> ToString[dim2] <> "; k++) { " <> sym <> "(i, k) = " <> name <> "(p, i, k); + } +} " ]; FillSelfEnergyMatrix[nPointFunction_, sym_String] := - Module[{particle = GetField[nPointFunction]}, - Which[(IsScalar[particle] || IsVector[particle]) && SelfEnergyIsSymmetric[particle], + Module[{particle = GetField[nPointFunction] /. {f1_, f2_}[_] :> {f1, f2}}, + Which[(IsScalar[particle[[1]]] || IsVector[particle[[1]]]) && SelfEnergyIsSymmetric[particle[[1]]], FillHermitianSelfEnergyMatrix[nPointFunction, sym], True, FillGeneralSelfEnergyFunction[nPointFunction, sym] @@ -570,7 +659,7 @@ therefore not be accessed in the form Glu(gO2). CreateNPointFunctionMatrix[nPointFunction_] := Module[{dim, functionName, type, prototype, def}, - dim = GetDimension[GetField[nPointFunction]]; + dim = GetDimension[GetField[nPointFunction] /. {a_, b_}[_] :> {a, b} /. {a_, b_} :> a ]; If[dim == 1, Return[{ "", "" }]]; functionName = CreateFunctionPrototypeMatrix[nPointFunction, 1]; type = CConversion`CreateCType[CConversion`MatrixType[CConversion`complexScalarCType, dim, dim]]; @@ -588,8 +677,8 @@ therefore not be accessed in the form Glu(gO2). ]; CreateNPointFunctions[nPointFunctions_List, vertexRules_List] := - Module[{prototypes = "", defs = "", vertexFunctionNames = {}, p, d, - relevantVertexRules}, + Module[{prototypes = "", defs = "", vertexFunctionNames = {}, prototype, def, + relevantVertexRules, derivatives, pSq}, (* create coupling functions for all vertices in the list *) Print["Converting vertex functions ..."]; (* extract vertex rules needed for the given nPointFunctions *) @@ -600,13 +689,33 @@ therefore not be accessed in the form Glu(gO2). Utils`StartProgressBar[Dynamic[k], Length[nPointFunctions]]; For[k = 1, k <= Length[nPointFunctions], k++, Utils`UpdateProgressBar[k, Length[nPointFunctions]]; - {p,d} = CreateNPointFunction[nPointFunctions[[k]], vertexFunctionNames]; - prototypes = prototypes <> p; - defs = defs <> d; - {p,d} = CreateNPointFunctionMatrix[nPointFunctions[[k]]]; - prototypes = prototypes <> p; - defs = defs <> d; + {prototype,def} = CreateNPointFunction[nPointFunctions[[k]], vertexFunctionNames]; + prototypes = prototypes <> prototype; + defs = defs <> def; + {prototype,def} = CreateNPointFunctionMatrix[nPointFunctions[[k]]]; + prototypes = prototypes <> prototype; + defs = defs <> def; + ]; + (* create derivatives of Higgs boson self-energies w.r.t. p^2 *) + If[ValueQ[SARAH`HiggsBoson], + derivatives = Cases[nPointFunctions, FSSelfEnergy[{SARAH`HiggsBoson, SARAH`HiggsBoson} | {SARAH`HiggsBoson[__], SARAH`HiggsBoson[__]}, ___]]; + + (* SARAH`sum has Attribute Constant because why not!? *) + ClearAttributes[SARAH`sum, Constant]; + derivatives = (D[#, pSq]& /@ (derivatives /. p^2->pSq)) /. pSq -> p^2; + SetAttributes[SARAH`sum, Constant]; + + Switch[Length[derivatives], + 0, Print["Error: no Higgs boson self-energy found."], + 1, {prototype, def} = CreateNPointFunction[First[derivatives], vertexFunctionNames]; + prototypes = prototypes <> prototype; + defs = defs <> def; + {prototype, def} = CreateNPointFunctionMatrix[First[derivatives]]; + prototypes = prototypes <> prototype; + defs = defs <> def;, + _, Print["Error: multiple Higgs boson self-energies found."] ]; + ]; Utils`StopProgressBar[Length[nPointFunctions]]; {prototypes, defs} ]; @@ -670,7 +779,7 @@ therefore not be accessed in the form Glu(gO2). GetTwoLoopTadpoleCorrections[model_String /; model === "MSSM"] := Module[{g3Str, mtStr, mbStr, mtauStr, mTop, mBot, mTau, - vev2Str, tanbStr, muStr, m3Str, mA0Str}, + vev2Str, tanbStr, muStr, m3Str, mAStr}, AssertFieldDimension[SARAH`HiggsBoson, 2, model]; mTop = TreeMasses`GetMass[TreeMasses`GetUpQuark[3,True]]; mBot = TreeMasses`GetMass[TreeMasses`GetDownQuark[3,True]]; @@ -683,7 +792,7 @@ therefore not be accessed in the form Glu(gO2). tanbStr = CConversion`RValueToCFormString[SARAH`VEVSM2 / SARAH`VEVSM1]; muStr = CConversion`RValueToCFormString[-Parameters`GetEffectiveMu[]]; m3Str = CConversion`RValueToCFormString[FlexibleSUSY`M[SARAH`Gluino]]; - mA0Str = TreeMasses`CallPseudoscalarHiggsMassGetterFunction[] <> "(0)"; + mAStr = TreeMasses`CallPseudoscalarHiggsMassGetterFunction[] <> "(0)"; "\ using namespace flexiblesusy::mssm_twoloophiggs; @@ -716,7 +825,7 @@ therefore not be accessed in the form Glu(gO2). const double tanb = " <> tanbStr <> "; const double amu = Re(" <> muStr <> "); const double mg = " <> m3Str <> "; -const double mAsq = Sqr(" <> mA0Str <> "); +const double mAsq = Sqr(" <> mAStr <> "); const double cotbeta = 1.0 / tanb; const double rmbsq = Sqr(" <> mbStr <> "); const double rmtausq = Sqr(" <> mtauStr <> "); @@ -756,7 +865,7 @@ therefore not be accessed in the form Glu(gO2). GetTwoLoopTadpoleCorrections[model_String /; model === "NMSSM"] := Module[{mTop, mBot, mTau, g3Str, mtStr, mbStr, mtauStr, lambdaStr, - vev2Str, svevStr, tanbStr, muStr, m3Str, mA0Str}, + vev2Str, svevStr, tanbStr, muStr, m3Str, mA2Str}, AssertFieldDimension[SARAH`HiggsBoson, 3, model]; mTop = TreeMasses`GetMass[TreeMasses`GetUpQuark[3,True]]; mBot = TreeMasses`GetMass[TreeMasses`GetDownQuark[3,True]]; @@ -769,7 +878,7 @@ therefore not be accessed in the form Glu(gO2). tanbStr = CConversion`RValueToCFormString[SARAH`VEVSM2 / SARAH`VEVSM1]; muStr = CConversion`RValueToCFormString[-Parameters`GetEffectiveMu[]]; m3Str = CConversion`RValueToCFormString[FlexibleSUSY`M[SARAH`Gluino]]; - mA0Str = CConversion`RValueToCFormString[Parameters`GetEffectiveMASqr[]]; + mA2Str = CConversion`RValueToCFormString[Parameters`GetEffectiveMASqr[]]; svevStr = CConversion`RValueToCFormString[Parameters`GetParameterFromDescription["Singlet-VEV"]]; lambdaStr = CConversion`RValueToCFormString[Parameters`GetParameterFromDescription["Singlet-Higgs-Interaction"]]; "\ @@ -805,7 +914,7 @@ therefore not be accessed in the form Glu(gO2). const double tanb = " <> tanbStr <> "; const double amu = Re(" <> muStr <> "); const double mg = " <> m3Str <> "; -const double mAsq = " <> mA0Str <> "; +const double mAsq = " <> mA2Str <> "; const double cotbeta = 1.0 / tanb; const double rmbsq = Sqr(" <> mbStr <> "); const double rmtausq = Sqr(" <> mtauStr <> "); @@ -876,10 +985,10 @@ therefore not be accessed in the form Glu(gO2). CreateTwoLoopTadpolesNMSSM[higgsBoson_] := CreateTwoLoopTadpoles[higgsBoson, "NMSSM"]; -GetNLoopSelfEnergyCorrections[particle_ /; particle === SARAH`HiggsBoson, +GetNLoopSelfEnergyCorrections[particle_ /; particle === {SARAH`HiggsBoson, SARAH`HiggsBoson}, model_String /; model === "SM", 2] := Module[{mtStr, ytStr, mbStr, ybStr, mtauStr, ytauStr, g3Str}, - AssertFieldDimension[particle, 1, model]; + AssertFieldDimension[SARAH`HiggsBoson, 1, model]; mtStr = CConversion`RValueToCFormString[TreeMasses`GetMass[TreeMasses`GetUpQuark[3,True]]]; ytStr = CConversion`RValueToCFormString[Parameters`GetThirdGeneration[SARAH`UpYukawa]]; mbStr = CConversion`RValueToCFormString[TreeMasses`GetMass[TreeMasses`GetDownQuark[3,True]]]; @@ -920,16 +1029,16 @@ therefore not be accessed in the form Glu(gO2). return self_energy;" ]; -GetNLoopSelfEnergyCorrections[particle_ /; particle === SARAH`HiggsBoson, +GetNLoopSelfEnergyCorrections[particle_ /; particle === {SARAH`HiggsBoson, SARAH`HiggsBoson}, model_String /; model === "SM", 3] := Module[{mTop, mtStr, yt, ytStr, g3Str, mHiggs, mhStr}, - AssertFieldDimension[particle, 1, model]; + AssertFieldDimension[SARAH`HiggsBoson, 1, model]; mTop = TreeMasses`GetMass[TreeMasses`GetUpQuark[3,True]]; mtStr = CConversion`RValueToCFormString[mTop]; yt = Parameters`GetThirdGeneration[SARAH`UpYukawa]; ytStr = CConversion`RValueToCFormString[yt]; g3Str = CConversion`RValueToCFormString[SARAH`strongCoupling]; - mHiggs = TreeMasses`GetMass[particle]; + mHiggs = TreeMasses`GetMass[particle[[1]]]; mhStr = CConversion`RValueToCFormString[mHiggs]; "\ using namespace flexiblesusy::sm_threeloophiggs; @@ -956,16 +1065,16 @@ therefore not be accessed in the form Glu(gO2). return self_energy;" ]; -GetNLoopSelfEnergyCorrections[particle_ /; particle === SARAH`HiggsBoson, +GetNLoopSelfEnergyCorrections[particle_ /; particle === {SARAH`HiggsBoson, SARAH`HiggsBoson}, model_String /; model === "SM", 4] := Module[{mTop, mtStr, yt, ytStr, g3Str, mHiggs, mhStr}, - AssertFieldDimension[particle, 1, model]; + AssertFieldDimension[SARAH`HiggsBoson, 1, model]; mTop = TreeMasses`GetMass[TreeMasses`GetUpQuark[3,True]]; mtStr = CConversion`RValueToCFormString[mTop]; yt = Parameters`GetThirdGeneration[SARAH`UpYukawa]; ytStr = CConversion`RValueToCFormString[yt]; g3Str = CConversion`RValueToCFormString[SARAH`strongCoupling]; - mHiggs = TreeMasses`GetMass[particle]; + mHiggs = TreeMasses`GetMass[particle[[1]]]; mhStr = CConversion`RValueToCFormString[mHiggs]; "\ using namespace flexiblesusy::sm_fourloophiggs; @@ -983,10 +1092,10 @@ therefore not be accessed in the form Glu(gO2). return self_energy;" ]; -GetNLoopSelfEnergyCorrections[particle_ /; particle === SARAH`HiggsBoson, +GetNLoopSelfEnergyCorrections[particle_ /; particle === {SARAH`HiggsBoson, SARAH`HiggsBoson}, model_String /; model === "Split", 3] := Module[{mTop, mGluino, mtStr, mgStr, yt, ytStr, g3Str}, - AssertFieldDimension[particle, 1, model]; + AssertFieldDimension[SARAH`HiggsBoson, 1, model]; mTop = TreeMasses`GetMass[TreeMasses`GetUpQuark[3,True]]; mtStr = CConversion`RValueToCFormString[mTop]; mGluino = TreeMasses`GetMass[Parameters`GetParticleFromDescription["Gluino"]]; @@ -1011,12 +1120,12 @@ therefore not be accessed in the form Glu(gO2). return self_energy;" ]; -GetNLoopSelfEnergyCorrections[particle_ /; particle === SARAH`HiggsBoson, +GetNLoopSelfEnergyCorrections[particle_ /; particle === {SARAH`HiggsBoson, SARAH`HiggsBoson}, model_String /; model === "MSSM", 2] := Module[{g3Str, mtStr, mbStr, mtauStr, mTop, mBot, mTau, - vev2Str, vuStr, vdStr, tanbStr, muStr, m3Str, mA0Str}, - AssertFieldDimension[particle, 2, model]; + vev2Str, vuStr, vdStr, tanbStr, muStr, m3Str, mAStr}, + AssertFieldDimension[SARAH`HiggsBoson, 2, model]; mTop = TreeMasses`GetMass[TreeMasses`GetUpQuark[3,True]]; mBot = TreeMasses`GetMass[TreeMasses`GetDownQuark[3,True]]; mTau = TreeMasses`GetMass[TreeMasses`GetDownLepton[3,True]]; @@ -1030,7 +1139,7 @@ therefore not be accessed in the form Glu(gO2). tanbStr = CConversion`RValueToCFormString[SARAH`VEVSM2 / SARAH`VEVSM1]; muStr = CConversion`RValueToCFormString[-Parameters`GetEffectiveMu[]]; m3Str = CConversion`RValueToCFormString[FlexibleSUSY`M[SARAH`Gluino]]; - mA0Str = TreeMasses`CallPseudoscalarHiggsMassGetterFunction[] <> "(0)"; + mAStr = TreeMasses`CallPseudoscalarHiggsMassGetterFunction[] <> "(0)"; "\ using namespace flexiblesusy::mssm_twoloophiggs; @@ -1063,7 +1172,7 @@ therefore not be accessed in the form Glu(gO2). const double tanb = " <> tanbStr <> "; const double amu = Re(" <> muStr <> "); const double mg = " <> m3Str <> "; -const double mAsq = Sqr(" <> mA0Str <> "); +const double mAsq = Sqr(" <> mAStr <> "); const double cotbeta = 1.0 / tanb; const double rmbsq = Sqr(" <> mbStr <> "); const double rmtausq = Sqr(" <> mtauStr <> "); @@ -1097,12 +1206,12 @@ therefore not be accessed in the form Glu(gO2). return self_energy_2l;" ]; -GetNLoopSelfEnergyCorrections[particle_ /; particle === SARAH`PseudoScalar, +GetNLoopSelfEnergyCorrections[particle_ /; particle === {SARAH`PseudoScalar, SARAH`PseudoScalar}, model_String /; model === "MSSM", 2] := Module[{g3Str, mtStr, mbStr, mtauStr, mTop, mBot, mTau, - vev2Str, vuStr, vdStr, tanbStr, muStr, m3Str, mA0Str}, - AssertFieldDimension[particle, 2, model]; + vev2Str, vuStr, vdStr, tanbStr, muStr, m3Str, mAStr}, + AssertFieldDimension[SARAH`PseudoScalar, 2, model]; mTop = TreeMasses`GetMass[TreeMasses`GetUpQuark[3,True]]; mBot = TreeMasses`GetMass[TreeMasses`GetDownQuark[3,True]]; mTau = TreeMasses`GetMass[TreeMasses`GetDownLepton[3,True]]; @@ -1116,7 +1225,7 @@ therefore not be accessed in the form Glu(gO2). tanbStr = CConversion`RValueToCFormString[SARAH`VEVSM2 / SARAH`VEVSM1]; muStr = CConversion`RValueToCFormString[-Parameters`GetEffectiveMu[]]; m3Str = CConversion`RValueToCFormString[FlexibleSUSY`M[SARAH`Gluino]]; - mA0Str = TreeMasses`CallPseudoscalarHiggsMassGetterFunction[] <> "(0)"; + mAStr = TreeMasses`CallPseudoscalarHiggsMassGetterFunction[] <> "(0)"; "\ using namespace flexiblesusy::mssm_twoloophiggs; @@ -1149,7 +1258,7 @@ therefore not be accessed in the form Glu(gO2). const double tanb = " <> tanbStr <> "; const double amu = Re(" <> muStr <> "); const double mg = " <> m3Str <> "; -const double mAsq = Sqr(" <> mA0Str <> "); +const double mAsq = Sqr(" <> mAStr <> "); const double cotbeta = 1.0 / tanb; const double rmbsq = Sqr(" <> mbStr <> "); const double rmtausq = Sqr(" <> mtauStr <> "); @@ -1183,13 +1292,13 @@ therefore not be accessed in the form Glu(gO2). return self_energy_2l;" ]; -GetNLoopSelfEnergyCorrections[particle_ /; particle === SARAH`HiggsBoson, +GetNLoopSelfEnergyCorrections[particle_ /; particle === {SARAH`HiggsBoson, SARAH`HiggsBoson}, model_String /; model === "NMSSM", 2] := Module[{g3Str, mtStr, mbStr, mtauStr, mTop, mBot, mTau, - vev2Str, vuStr, vdStr, vsStr, tanbStr, muStr, m3Str, mA0Str, + vev2Str, vuStr, vdStr, vsStr, tanbStr, muStr, m3Str, mA2Str, lambdaStr}, - AssertFieldDimension[particle, 3, model]; + AssertFieldDimension[SARAH`HiggsBoson, 3, model]; mTop = TreeMasses`GetMass[TreeMasses`GetUpQuark[3,True]]; mBot = TreeMasses`GetMass[TreeMasses`GetDownQuark[3,True]]; mTau = TreeMasses`GetMass[TreeMasses`GetDownLepton[3,True]]; @@ -1203,7 +1312,7 @@ therefore not be accessed in the form Glu(gO2). tanbStr = CConversion`RValueToCFormString[SARAH`VEVSM2 / SARAH`VEVSM1]; muStr = CConversion`RValueToCFormString[-Parameters`GetEffectiveMu[]]; m3Str = CConversion`RValueToCFormString[FlexibleSUSY`M[SARAH`Gluino]]; - mA0Str = CConversion`RValueToCFormString[Parameters`GetEffectiveMASqr[]]; + mA2Str = CConversion`RValueToCFormString[Parameters`GetEffectiveMASqr[]]; vsStr = CConversion`RValueToCFormString[Parameters`GetParameterFromDescription["Singlet-VEV"]]; lambdaStr = CConversion`RValueToCFormString[Parameters`GetParameterFromDescription["Singlet-Higgs-Interaction"]]; "\ @@ -1241,7 +1350,7 @@ therefore not be accessed in the form Glu(gO2). const double tanb = " <> tanbStr <> "; const double amu = Re(" <> muStr <> "); const double mg = " <> m3Str <> "; -const double mAsq = " <> mA0Str <> "; +const double mAsq = " <> mA2Str <> "; const double cotb = 1.0 / tanb; const double rmb = " <> mbStr <> "; const double rmbsq = Sqr(rmb); @@ -1281,13 +1390,13 @@ therefore not be accessed in the form Glu(gO2). return self_energy_2l;" ]; -GetNLoopSelfEnergyCorrections[particle_ /; particle === SARAH`PseudoScalar, +GetNLoopSelfEnergyCorrections[particle_ /; particle === {SARAH`PseudoScalar, SARAH`PseudoScalar}, model_String /; model === "NMSSM", 2] := Module[{g3Str, mtStr, mbStr, mtauStr, mTop, mBot, mTau, - vev2Str, vuStr, vdStr, vsStr, tanbStr, muStr, m3Str, mA0Str, + vev2Str, vuStr, vdStr, vsStr, tanbStr, muStr, m3Str, mA2Str, lambdaStr}, - AssertFieldDimension[particle, 3, model]; + AssertFieldDimension[SARAH`PseudoScalar, 3, model]; mTop = TreeMasses`GetMass[TreeMasses`GetUpQuark[3,True]]; mBot = TreeMasses`GetMass[TreeMasses`GetDownQuark[3,True]]; mTau = TreeMasses`GetMass[TreeMasses`GetDownLepton[3,True]]; @@ -1301,7 +1410,7 @@ therefore not be accessed in the form Glu(gO2). tanbStr = CConversion`RValueToCFormString[SARAH`VEVSM2 / SARAH`VEVSM1]; muStr = CConversion`RValueToCFormString[-Parameters`GetEffectiveMu[]]; m3Str = CConversion`RValueToCFormString[FlexibleSUSY`M[SARAH`Gluino]]; - mA0Str = CConversion`RValueToCFormString[Parameters`GetEffectiveMASqr[]]; + mA2Str = CConversion`RValueToCFormString[Parameters`GetEffectiveMASqr[]]; vsStr = CConversion`RValueToCFormString[Parameters`GetParameterFromDescription["Singlet-VEV"]]; lambdaStr = CConversion`RValueToCFormString[Parameters`GetParameterFromDescription["Singlet-Higgs-Interaction"]]; "\ @@ -1339,7 +1448,7 @@ therefore not be accessed in the form Glu(gO2). const double tanb = " <> tanbStr <> "; const double amu = Re(" <> muStr <> "); const double mg = " <> m3Str <> "; -const double mAsq = " <> mA0Str <> "; +const double mAsq = " <> mA2Str <> "; const double cotb = 1.0 / tanb; const double rmb = " <> mbStr <> "; const double rmbsq = Sqr(rmb); @@ -1379,13 +1488,17 @@ therefore not be accessed in the form Glu(gO2). return self_energy_2l;" ]; -GetNLoopSelfEnergyCorrections[particle_ /; particle === SARAH`HiggsBoson, +(* return a/b if b != 0, otherwise return 0 *) +DivideOrReturnZeroStr[a_, b_] := + CConversion`RValueToCFormString[b] <> " == 0 ? 0 : " <> CConversion`RValueToCFormString[a] <> "/" <> CConversion`RValueToCFormString[b]; + +GetNLoopSelfEnergyCorrections[particle_ /; particle === {SARAH`HiggsBoson, SARAH`HiggsBoson}, model_String /; model === "MSSM", 3] := Module[{g3Str, mtStr, mbStr, meStr, mTop, mBot, mTau, - vuStr, vdStr, muStr, m3Str, mA0Str, + vuStr, vdStr, muStr, m3Str, mAStr, AtStr, AbStr, AeStr, mWStr, mZStr, mq2Str, md2Str, mu2Str, ml2Str, me2Str}, - AssertFieldDimension[particle, 2, model]; + AssertFieldDimension[SARAH`HiggsBoson, 2, model]; mTop = TreeMasses`GetMass[TreeMasses`GetUpQuark[3,True]]; mBot = TreeMasses`GetMass[TreeMasses`GetDownQuark[3,True]]; mTau = TreeMasses`GetMass[TreeMasses`GetDownLepton[3,True]]; @@ -1397,10 +1510,10 @@ therefore not be accessed in the form Glu(gO2). vuStr = CConversion`RValueToCFormString[SARAH`VEVSM2]; muStr = CConversion`RValueToCFormString[Parameters`GetEffectiveMu[]]; m3Str = CConversion`RValueToCFormString[FlexibleSUSY`M[SARAH`Gluino]]; - mA0Str = TreeMasses`CallPseudoscalarHiggsMassGetterFunction[] <> "(0)"; - AtStr = CConversion`RValueToCFormString[SARAH`TrilinearUp[2,2] / SARAH`UpYukawa[2,2]]; - AbStr = CConversion`RValueToCFormString[SARAH`TrilinearDown[2,2] / SARAH`DownYukawa[2,2]]; - AeStr = CConversion`RValueToCFormString[SARAH`TrilinearLepton[2,2] / SARAH`ElectronYukawa[2,2]]; + mAStr = TreeMasses`CallPseudoscalarHiggsMassGetterFunction[] <> "(0)"; + AtStr = DivideOrReturnZeroStr[SARAH`TrilinearUp[2,2], SARAH`UpYukawa[2,2]]; + AbStr = DivideOrReturnZeroStr[SARAH`TrilinearDown[2,2], SARAH`DownYukawa[2,2]]; + AeStr = DivideOrReturnZeroStr[SARAH`TrilinearLepton[2,2], SARAH`ElectronYukawa[2,2]]; mWStr = CConversion`RValueToCFormString[FlexibleSUSY`M[SARAH`VectorW]]; mZStr = CConversion`RValueToCFormString[FlexibleSUSY`M[SARAH`VectorZ]]; mq2Str = CConversion`RValueToCFormString[SARAH`SoftSquark]; @@ -1434,7 +1547,7 @@ therefore not be accessed in the form Glu(gO2). pars.MZ = " <> mZStr <> "; pars.Mt = " <> mtStr <> "; pars.Mb = " <> mbStr <> "; -pars.MA = " <> mA0Str <> "; +pars.MA = " <> mAStr <> "; pars.MSt << mst_1, mst_2; pars.MSb << msb_1, msb_2; pars.s2t = Sin(2*theta_t); @@ -1476,7 +1589,7 @@ therefore not be accessed in the form Glu(gO2). if (ren_scheme == 1) { // calculate shift DR' -> MDR' self_energy_3l += - hier.getDMhDRbarPrimeToMDRbarPrimeShift(); - } else if (ren_scheme == 1) { + } else if (ren_scheme == 2) { // calculate shift DR' -> H3m self_energy_3l += - hier.getDMhDRbarPrimeToH3mShift(); } @@ -1502,7 +1615,7 @@ therefore not be accessed in the form Glu(gO2). if (ren_scheme == 1) { // calculate shift DR' -> MDR' self_energy_3l += - hier.getDMhDRbarPrimeToMDRbarPrimeShift(); - } else if (ren_scheme == 1) { + } else if (ren_scheme == 2) { // calculate shift DR' -> H3m self_energy_3l += - hier.getDMhDRbarPrimeToH3mShift(); } @@ -1519,6 +1632,159 @@ throw HimalayaError(\"The 3-loop corrections to Mh require Himalaya 1.0 \" \"configured with Himalaya!\"); #endif // ENABLE_HIMALAYA +return self_energy_3l;" + ]; + +GetNLoopSelfEnergyCorrections[particle_ /; particle === {SARAH`HiggsBoson, SARAH`HiggsBoson}, + model_String /; model === "NMSSM", 3] := + Module[{g3Str, mtStr, mbStr, meStr, mTop, mBot, mTau, + vuStr, vdStr, muStr, m3Str, mA2Str, + AtStr, AbStr, AeStr, mWStr, mZStr, + mq2Str, md2Str, mu2Str, ml2Str, me2Str, + mssm2LSelfEnergyType = CConversion`CreateCType[CConversion`MatrixType[CConversion`realScalarCType, 2, 2]], + nmssm2LSelfEnergyType = CConversion`CreateCType[TreeMasses`GetMassMatrixType[SARAH`HiggsBoson]] + }, + AssertFieldDimension[SARAH`HiggsBoson, 3, model]; + mTop = TreeMasses`GetMass[TreeMasses`GetUpQuark[3,True]]; + mBot = TreeMasses`GetMass[TreeMasses`GetDownQuark[3,True]]; + mTau = TreeMasses`GetMass[TreeMasses`GetDownLepton[3,True]]; + mtStr = CConversion`RValueToCFormString[mTop]; + mbStr = CConversion`RValueToCFormString[mBot]; + meStr = CConversion`RValueToCFormString[mTau]; + g3Str = CConversion`RValueToCFormString[SARAH`strongCoupling]; + vdStr = CConversion`RValueToCFormString[SARAH`VEVSM1]; + vuStr = CConversion`RValueToCFormString[SARAH`VEVSM2]; + muStr = CConversion`RValueToCFormString[Parameters`GetEffectiveMu[]]; + m3Str = CConversion`RValueToCFormString[FlexibleSUSY`M[SARAH`Gluino]]; + mA2Str = CConversion`RValueToCFormString[Parameters`GetEffectiveMASqr[]]; + AtStr = DivideOrReturnZeroStr[SARAH`TrilinearUp[2,2], SARAH`UpYukawa[2,2]]; + AbStr = DivideOrReturnZeroStr[SARAH`TrilinearDown[2,2], SARAH`DownYukawa[2,2]]; + AeStr = DivideOrReturnZeroStr[SARAH`TrilinearLepton[2,2], SARAH`ElectronYukawa[2,2]]; + mWStr = CConversion`RValueToCFormString[FlexibleSUSY`M[SARAH`VectorW]]; + mZStr = CConversion`RValueToCFormString[FlexibleSUSY`M[SARAH`VectorZ]]; + mq2Str = CConversion`RValueToCFormString[SARAH`SoftSquark]; + mu2Str = CConversion`RValueToCFormString[SARAH`SoftUp]; + md2Str = CConversion`RValueToCFormString[SARAH`SoftDown]; + ml2Str = CConversion`RValueToCFormString[SARAH`SoftLeftLepton]; + me2Str = CConversion`RValueToCFormString[SARAH`SoftRightLepton]; +"// MSSM 2x2 3-loop self-energy +" <> +mssm2LSelfEnergyType <> " self_energy_3l_mssm(" <> mssm2LSelfEnergyType <> "::Zero()); + +#ifdef ENABLE_HIMALAYA +// calculate 3rd generation sfermion masses and mixing angles +double mst_1, mst_2, theta_t; +double msb_1, msb_2, theta_b; + +" <> TreeMasses`CallGenerationHelperFunctionName[3, SARAH`TopSquark, "mst_1", "mst_2", "theta_t"] <> +"; +" <> TreeMasses`CallGenerationHelperFunctionName[3, SARAH`BottomSquark, "msb_1", "msb_2", "theta_b"] <> +"; + +himalaya::Parameters pars; +pars.scale = get_scale(); +pars.mu = Re(" <> muStr <> "); +pars.g3 = " <> g3Str <> "; +pars.vd = " <> vdStr <> "; +pars.vu = " <> vuStr <> "; +pars.mq2 = Re(" <> mq2Str <> "); +pars.md2 = Re(" <> md2Str <> "); +pars.mu2 = Re(" <> mu2Str <> "); +pars.MG = " <> m3Str <> "; +pars.MW = " <> mWStr <> "; +pars.MZ = " <> mZStr <> "; +pars.Mt = " <> mtStr <> "; +pars.Mb = " <> mbStr <> "; +pars.MA = Re(Sqrt(" <> mA2Str <> ")); +pars.MSt << mst_1, mst_2; +pars.MSb << msb_1, msb_2; +pars.s2t = Sin(2*theta_t); +pars.s2b = Sin(2*theta_b); + +#if Himalaya_VERSION_MAJOR < 2 + pars.At = Re(" <> AtStr <> "); + pars.Ab = Re(" <> AbStr <> "); +#else + pars.Au(2,2) = Re(" <> AtStr <> "); + pars.Ad(2,2) = Re(" <> AbStr <> "); + pars.Ae(2,2) = Re(" <> AeStr <> "); + pars.ml2 = Re(" <> ml2Str <> "); + pars.me2 = Re(" <> me2Str <> "); + pars.Mtau = " <> meStr <> "; +#endif + +try { + const auto ren_scheme = HIGGS_3LOOP_SCHEME; + const bool verbose = false; + himalaya::HierarchyCalculator hc(pars, verbose); + + if (HIGGS_3LOOP_CORRECTION_AT_AS_AS) { +#if Himalaya_VERSION_MAJOR < 2 + const auto hier = hc.calculateDMh3L(false, ren_scheme); +#else + const auto hier = hc.calculateDMh3L(false); +#endif + + // calculate the 3-loop corrections + self_energy_3l_mssm += - hier.getDMh(3); + +#if Himalaya_VERSION_MAJOR < 2 + if (ren_scheme) { + // calculate shift DR -> MDR + self_energy_3l_mssm += - hier.getDRToMDRShift(); + } +#else + if (ren_scheme == 1) { + // calculate shift DR' -> MDR' + self_energy_3l_mssm += - hier.getDMhDRbarPrimeToMDRbarPrimeShift(); + } else if (ren_scheme == 2) { + // calculate shift DR' -> H3m + self_energy_3l_mssm += - hier.getDMhDRbarPrimeToH3mShift(); + } +#endif + } + + if (HIGGS_3LOOP_CORRECTION_AB_AS_AS) { +#if Himalaya_VERSION_MAJOR < 2 + const auto hier = hc.calculateDMh3L(true, ren_scheme); +#else + const auto hier = hc.calculateDMh3L(true); +#endif + + // calculate the 3-loop corrections + self_energy_3l_mssm += - hier.getDMh(3); + +#if Himalaya_VERSION_MAJOR < 2 + if (ren_scheme) { + // calculate the shift DR -> MDR + self_energy_3l_mssm += - hier.getDRToMDRShift(); + } +#else + if (ren_scheme == 1) { + // calculate shift DR' -> MDR' + self_energy_3l_mssm += - hier.getDMhDRbarPrimeToMDRbarPrimeShift(); + } else if (ren_scheme == 2) { + // calculate shift DR' -> H3m + self_energy_3l_mssm += - hier.getDMhDRbarPrimeToH3mShift(); + } +#endif + } +} catch (const std::exception& e) { + VERBOSE_MSG(e.what()); + VERBOSE_MSG(pars); + throw HimalayaError(e.what()); +} +#else // ENABLE_HIMALAYA +throw HimalayaError(\"The 3-loop corrections to Mh require Himalaya 1.0 \" + \"(or higher), but FlexibleSUSY has not been \" + \"configured with Himalaya!\"); +#endif // ENABLE_HIMALAYA + +// create NMSSM 3x3 self-energy matrix from MSSM 2x2 one +" <> +nmssm2LSelfEnergyType <> " self_energy_3l(" <> nmssm2LSelfEnergyType <> "::Zero()); +self_energy_3l.topLeftCorner<2,2>() += self_energy_3l_mssm; + return self_energy_3l;" ]; @@ -1531,10 +1797,10 @@ throw HimalayaError(\"The 3-loop corrections to Mh require Himalaya 1.0 \" CreateNLoopSelfEnergy[particle_, model_String, loop_, args_String] := Module[{prototype, function, functionName, dim, dimStr, cType}, - dim = Parameters`NumberOfIndependentEntriesOfSymmetricMatrix[GetDimension[particle]]; + dim = Parameters`NumberOfIndependentEntriesOfSymmetricMatrix[GetDimension[particle[[1]]]]; dimStr = ToString[dim]; functionName = CreateSelfEnergyFunctionName[particle,loop]; - cType = CConversion`CreateCType[TreeMasses`GetMassMatrixType[particle]]; + cType = CConversion`CreateCType[TreeMasses`GetMassMatrixType[particle[[1]]]]; prototype = cType <> " " <> functionName <> "(" <> args <> ") const;\n"; body = GetNLoopSelfEnergyCorrections[particle, model, loop]; function = cType <> " CLASSNAME::" <> functionName <> "(" <> args <> ") const\n{\n" <> @@ -1570,6 +1836,9 @@ throw HimalayaError(\"The 3-loop corrections to Mh require Himalaya 1.0 \" CreateThreeLoopSelfEnergiesMSSM[particles_List] := CreateNLoopSelfEnergies[particles, "MSSM", 3]; +CreateThreeLoopSelfEnergiesNMSSM[particles_List] := + CreateNLoopSelfEnergies[particles, "NMSSM", 3]; + CreateThreeLoopSelfEnergiesSplit[particles_List] := CreateNLoopSelfEnergies[particles, "Split", 3]; diff --git a/meta/TerminalFormatting.m b/meta/TerminalFormatting.m index 9b0df21e38..dc40b25d9e 100644 --- a/meta/TerminalFormatting.m +++ b/meta/TerminalFormatting.m @@ -21,7 +21,7 @@ *) BeginPackage["TerminalFormatting`", {"SARAH`", "Utils`"}]; -Begin["`internal`"]; +Begin["`Private`"]; If[!$Notebooks, showTerms[info:_Integer, add:_Integer:3, pre:_String:""] := diff --git a/meta/TestSuite.m b/meta/TestSuite.m index 7535ac4426..9b0a4518e0 100644 --- a/meta/TestSuite.m +++ b/meta/TestSuite.m @@ -22,15 +22,14 @@ BeginPackage["TestSuite`", {"Utils`"}]; +GetNumberOfFailedTests::usage="returns number of failed tests"; +PrintTestSummary::usage="prints test summary"; +TestCPPCode::usage="tests a C/C++ code snippet for an expected result"; TestEquality::usage="tests equality of two expressions"; -TestCloseRel::usage="tests relative numerical difference." -TestLowerThan::usage="tests whether a < b." -TestGreaterThan::usage="tests whether a > b." +TestCloseRel::usage="tests relative numerical equality" +TestGreaterThan::usage="tests whether a > b" +TestLowerThan::usage="tests whether a < b" TestNonEquality::usage="tests inequality of two expressions"; -TestCPPCode::usage="tests a C/C++ code snippet for an expected -result"; -PrintTestSummary::usage="prints test summary"; -GetNumberOfFailedTests::usage="returns number of failed tests"; Begin["`Private`"]; @@ -39,17 +38,18 @@ GetNumberOfFailedTests[] := numberOfFailedTests; +TestEquality::wrongArgs = "Wrong arguments. Received '`1`'."; + TestEquality[val_, expr_, msg_:""] := If[val =!= expr, numberOfFailedTests++; Print["Error: expressions are not equal: ", InputForm[val], " =!= ", InputForm[expr]]; - Return[False];, + False, numberOfPassedTests++; - Return[True]; + True ]; -TestEquality::wrongArgs = -"Wrong arguments. Received '`1`'."; + TestEquality[args___] := Utils`AssertOrQuit[False, TestEquality::wrongArgs, StringJoin@@Riffle[ToString/@{args},", "]]; @@ -58,9 +58,9 @@ numberOfFailedTests++; Print["Error: expressions are equal: ", InputForm[val], " === ", InputForm[expr]]; - Return[False];, + False, numberOfPassedTests++; - Return[True]; + True ]; TestCPPCode[{preface_String, expr_String}, value_String, type_String, expected_String] := @@ -75,16 +75,14 @@ ]; ]; -PrintTestSummary[] := - Block[{}, - Print["Test summary"]; - Print["============"]; - If[numberOfFailedTests == 0, - Print["All tests passed (", numberOfPassedTests, ")."]; - , - Print["*** ", numberOfFailedTests, " tests failed!"]; - ]; - ]; +PrintTestSummary[] := ( + Print["Test summary"]; + Print["============"]; + If[numberOfFailedTests == 0, + Print["All tests passed (", numberOfPassedTests, ")."], + Print["*** ", numberOfFailedTests, " tests failed!"] + ]; + ); RunCPPProgram[{preface_String, expr_String}, fileName_String:"tmp.cpp"] := Module[{code, output = "", errorCode}, @@ -111,10 +109,15 @@ ]; TestCloseRel[a_?NumericQ, b_?NumericQ, rel_?NumericQ] := - If[Abs[a] < rel, - TestEquality[Abs[a - b] < rel, True], - TestEquality[Abs[(a - b)/a] < rel, True] - ]; + Which[ + a == b, + numberOfPassedTests++; True, + Abs[a - b] < Abs[rel] Max[Abs[a], Abs[b]], + numberOfPassedTests++; True, + True, + Print["TestCloseRel: FAIL: ", InputForm[a], " < ", InputForm[b], " with relative precision ", InputForm[rel]]; + numberOfFailedTests++; False + ]; TestCloseRel[a_List, b_List, rel_?NumericQ] := MapThread[TestCloseRel[#1,#2,rel]&, {Flatten[a], Flatten[b]}]; @@ -124,14 +127,26 @@ TestEquality[0,1]); TestLowerThan[a_?NumericQ, b_?NumericQ] := - TestEquality[a < b, True]; + If[a < b, + numberOfPassedTests++; + True, + Print["TestLowerThan: FAIL: ", InputForm[a], " < ", InputForm[b]]; + numberOfFailedTests++; + False + ]; TestLowerThan[a___] := ( Print["TestLowerThan: FAIL: ", {a}]; TestEquality[0,1]); TestGreaterThan[a_?NumericQ, b_?NumericQ] := - TestEquality[a > b, True]; + If[a > b, + numberOfPassedTests++; + True, + Print["TestGreaterThan: FAIL: ", InputForm[a], " > ", InputForm[b]]; + numberOfFailedTests++; + False + ]; TestGreaterThan[a___] := ( Print["TestGreaterThan: FAIL: ", {a}]; diff --git a/meta/TextFormatting.m b/meta/TextFormatting.m index 4657526b65..3aa509dd91 100644 --- a/meta/TextFormatting.m +++ b/meta/TextFormatting.m @@ -28,8 +28,28 @@ WrapText::usage="WrapText[text, maxWidth, indentation] breaks text lines. It tries to wrap a line at a blank or a special character that maximizes the line length within maxWidth characters."; IndentText::usage="indents text by a given number of spaces"; +ReplaceCXXTokens::usage="Replaces C++ tokens in a string"; + Begin["`Private`"]; +IsCXXToken[str_] := MatchQ[str, _String?(StringMatchQ[#, RegularExpression@"@[^@\n]+@"]&)]; + +IsCXXRules[list_] := MatchQ[list, {Rule[_?IsCXXToken, _String]..}]; + +getIndent[obj:_String] := + First@StringCases[obj,StartOfString~~"\n"...~~indent:" "...:>indent]; +getIndent[obj:{__String}] := + First/@StringCases[obj,StartOfString~~"\n"...~~indent:" "...:>indent]; + +removeIndent[obj:_String] := + StringReplace[obj, StartOfLine~~getIndent[obj]->""]; + +ReplaceCXXTokens[code_String, rules_?IsCXXRules] := +StringJoin[ + StringReplace[#, "\n"->StringJoin["\n", getIndent@#]] &/@ + Riffle[StringReplace[StringSplit[removeIndent@code,"\n"],rules], "\n"] +]; + WrapLines[text_String, maxWidth_:79, offset_:" "] := WrapText[text, maxWidth, StringLength[offset]]; diff --git a/meta/ThresholdCorrections.m b/meta/ThresholdCorrections.m index dc4fef504d..3c7e480964 100644 --- a/meta/ThresholdCorrections.m +++ b/meta/ThresholdCorrections.m @@ -279,7 +279,7 @@ ToMatrixExpression[expr_ /; Head[expr] =!= List] := expr; ToMatrixExpression[list_List] := - Module[{dim, symbol, matrix, i, k, diag, expression = Null, + Module[{dim, symbol, matrix, diag, expression = Null, expandedList, permutations}, dim = Length[list]; symbol = ExtractSymbols[list[[1,1]]]; @@ -477,20 +477,43 @@ MultiplyBy[factor]; CalculateThetaWFromFermiConstant[] := - Module[{}, + Module[{ + mhStr = CConversion`ToValidCSymbolString[FlexibleSUSY`M[TreeMasses`GetHiggsBoson[]]], + mwStr = CConversion`ToValidCSymbolString[FlexibleSUSY`M[TreeMasses`GetWBoson[]]], + callStr = If[TreeMasses`GetDimension[TreeMasses`GetHiggsBoson[]] > 1, "(higgs_idx)", ""] + }, "\ -" <> FlexibleSUSY`FSModelName <> "_weinberg_angle::Sm_parameters sm_pars; -sm_pars.fermi_constant = qedqcd.displayFermiConstant(); -sm_pars.mw_pole = qedqcd.displayPoleMW(); -sm_pars.mz_pole = qedqcd.displayPoleMZ(); -sm_pars.mt_pole = qedqcd.displayPoleMt(); -sm_pars.alpha_s = calculate_alpha_s_SM5_at(qedqcd, qedqcd.displayPoleMt()); -sm_pars.higgs_index = higgs_idx; +const auto get_mh_pole = [&] () { + double mh_pole = MODEL->get_physical()." <> mhStr <> callStr <> "; + if (mh_pole == 0) { + mh_pole = Electroweak_constants::MH; + } + return mh_pole; +}; + +const auto get_mw_pole = [&] () { + double mw_pole = MODEL->get_physical()." <> mwStr <> "; + if (mw_pole == 0) { + mw_pole = qedqcd.displayPoleMW(); + } + return mw_pole; +}; + +" <> FlexibleSUSY`FSModelName <> "_weinberg_angle::Parameters parameters; +parameters.fermi_constant = qedqcd.displayFermiConstant(); +parameters.mw_pole = get_mw_pole(); +parameters.mz_pole = qedqcd.displayPoleMZ(); +parameters.mt_pole = qedqcd.displayPoleMt(); +parameters.mh_pole = get_mh_pole(); +parameters.alpha_s = calculate_alpha_s_SM5_at(qedqcd, qedqcd.displayPoleMt()); +parameters.alpha_s_mz = qedqcd.displayAlphaSInput(); +parameters.dalpha_s_5_had = Electroweak_constants::delta_alpha_s_5_had; +parameters.higgs_index = higgs_idx; const int number_of_iterations = std::max(20, static_cast(std::abs(-log10(MODEL->get_precision()) * 10))); -" <> FlexibleSUSY`FSModelName <> "_weinberg_angle weinberg(MODEL, sm_pars); +" <> FlexibleSUSY`FSModelName <> "_weinberg_angle weinberg(MODEL, parameters); weinberg.set_number_of_loops(MODEL->get_threshold_corrections().sin_theta_w); weinberg.set_number_of_iterations(number_of_iterations); @@ -498,8 +521,9 @@ const auto result = weinberg.calculate(); THETAW = ArcSin(result.first); - if (MODEL->get_thresholds() && MODEL->get_threshold_corrections().sin_theta_w > 0) - qedqcd.setPoleMW(result.second); + if (MODEL->get_thresholds() > 0 && MODEL->get_threshold_corrections().sin_theta_w > 0) { + Pole(M" <> ToString@TreeMasses`GetWBoson[] <> ") = result.second; + } MODEL->get_problems().unflag_no_sinThetaW_convergence(); } catch (const Error& e) { @@ -518,7 +542,7 @@ If[weinbergAngle === None || weinbergAngle === Null, weinbergAngle = expr /. subst; If[weinbergAngle === None || weinbergAngle === Null, - Print["Warning: No expression for the Weinberg angle defined, setting it to 0."]; + Utils`FSFancyWarning["No expression for the Weinberg angle defined, setting it to 0."]; weinbergAngle = 0; ]; ]; diff --git a/meta/TreeMasses.m b/meta/TreeMasses.m index 0803248bea..0968a9b621 100644 --- a/meta/TreeMasses.m +++ b/meta/TreeMasses.m @@ -157,7 +157,7 @@ CreateDependencePrototypes::usage=""; CreateDependenceFunctions::usage=""; -ColorChargedQ::usage=""; +ColorChargedQ::usage="Checks whether or not input field has color property"; FieldInfo::usage=""; includeLorentzIndices::usage=""; @@ -182,8 +182,9 @@ IsUnmixed::usage=""; IsQuark::usage=""; IsLepton::usage=""; -IsPhoton::usage=""; +IsPhoton::usage="Checks whether input field is a Photon"; IsZBoson::usage=""; +IsGluon::usage="Checks whether input field is a Gluon"; IsSMChargedLepton::usage=""; IsSMNeutralLepton::usage=""; IsSMLepton::usage=""; @@ -196,7 +197,7 @@ the element is a SM-like field or not. The function assumes that BSM fields are always heavier than the SM fields."; -IsElectricallyCharged::usage=""; +IsElectricallyCharged::usage="Returns whether or not a field has Electric Charge"; ContainsGoldstone::usage=""; FSAntiField::usage = "Returns the anti-field of a given field"; @@ -524,6 +525,11 @@ IsZBoson[sym_[___]] := IsZBoson[sym]; IsZBoson[field_Symbol] := field === GetZBoson[]; +IsGluon[Susyno`LieGroups`conj[sym_]] := IsGluon[sym]; +IsGluon[SARAH`bar[sym_]] := IsGluon[sym]; +IsGluon[sym_[___]] := IsGluon[sym]; +IsGluon[field_Symbol] := field === GetGluon[]; + IsSMChargedLepton[Susyno`LieGroups`conj[sym_]] := IsSMChargedLepton[sym]; IsSMChargedLepton[SARAH`bar[sym_]] := IsSMChargedLepton[sym]; IsSMChargedLepton[sym_[__]] := IsSMChargedLepton[sym]; @@ -1950,13 +1956,13 @@ the fundamental representation of SU(3) in SARAH. If[vexp === {}, If[Parameters`IsParameter[SARAH`VEVSM], SARAH`VEVSM, - DebugPrint["Warning: SM-like Higgs vev is not define in the SARAH model file!"]; + FSDebugPrint["TreeMasses", "Warning: SM-like Higgs vev is not define in the SARAH model file!"]; symbIfUndefined] , First[vexp] ] , - DebugPrint["Warning: SM-like Higgs vev is not define in the SARAH model file!"]; + FSDebugPrint["TreeMasses", "Warning: SM-like Higgs vev is not define in the SARAH model file!"]; symbIfUndefined ] ]; diff --git a/meta/Unitarity.m b/meta/Unitarity.m new file mode 100644 index 0000000000..66c6808f32 --- /dev/null +++ b/meta/Unitarity.m @@ -0,0 +1,140 @@ +(* :Copyright: + + ==================================================================== + This file is part of FlexibleSUSY. + + FlexibleSUSY 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. + + FlexibleSUSY 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 FlexibleSUSY. If not, see + . + ==================================================================== + +*) + +BeginPackage["Unitarity`", {"SARAH`", "Parameters`", "CConversion`", "TreeMasses`", "TextFormatting`", "Vertices`", "CXXDiagrams`"}]; + +GetScatteringMatrix::usage = ""; + +Begin["`Private`"]; + +FSScatteringPairsSizes[pairs_] := Map[TreeMasses`GetDimension, pairs, {2}]; + +InfiniteS[a0Input_, generationSizes_, FSScatteringPairs_] := Module[{params = Parameters`FindAllParametersClassified[a0Input], paramsCPP, mixingCPP, a0, decrementIndices, removeFactor=16*Pi, inputPars}, + (* CPP definitions of parameters present in the expression *) + paramsCPP = + StringJoin[ + ("const auto " <> ToString@CConversion`ToValidCSymbol[#] <> + " = model.get_" <> ToString@CConversion`ToValidCSymbol[#] <> "();\n")& /@ Join[Parameters`FSModelParameters /. params, Parameters`FSPhases /. params, Parameters`FSOutputParameters /. params] + ]; + inputPars = ("const auto " <> ToString@CConversion`ToValidCSymbol[#] <> " = model.get_input_parameters()." <> ToString@CConversion`ToValidCSymbol[#] <> ";\n")& /@ (Parameters`FSInputParameters /. params); + decrementIndices = (#[i_, j_] /; Or@@(IntegerQ/@{i,j}) :> #@@(If[IntegerQ@#, #-1, #]& /@ {i, j}))& /@ Select[Join[Parameters`FSModelParameters /. params, Parameters`FSOutputParameters /. params], Length[GetParameterDimensions[#]]===2&]; + + (* replace input parameters with their FS names *) + a0 = a0Input /. Thread[(Parameters`FSModelParameters /. params) -> CConversion`ToValidCSymbol /@ (Parameters`FSModelParameters /. params)]; + a0 = a0 /. Susyno`LieGroups`conj -> Conj; + a0 = a0 //. SARAH`sum[idx_, start_, stop_, exp_] :> FlexibleSUSY`SUM[idx, start-1, stop-1, exp]; + (* only for test + a0 = a0 /. Delta[c1_?SarahColorIndexQ, c2_?SarahColorIndexQ] :> 1;*) + resultInfinite = ""; + fsScatteringPairsSizes = FSScatteringPairsSizes[FSScatteringPairs]; + For[i=1, i<=Length[a0], i++, + For[j=i, j<=Length[a0[[i]]], j++, + If[a0[[i,j]] =!= 0, + resultInfinite = resultInfinite <> "\n// " <> ToString[FSScatteringPairs[[i]]] <> "->" <> ToString[FSScatteringPairs[[j]]] <> "\n" <> + If[Count[generationSizes[[i,j]], x_/;x>1] === 0, "{\n", ""] <> + If[generationSizes[[i,j,1]] > 1, + "for (int in1=0; in1<" <> CXXNameOfField[First@FSScatteringPairs[[i]] /. Susyno`LieGroups`conj -> Identity] <> "::numberOfGenerations; ++in1) {\n", + "" + ] <> + If[generationSizes[[i,j,2]] > 1, + Nest[TextFormatting`IndentText, "for (int in2=0; in2<" <> CXXNameOfField[Last@FSScatteringPairs[[i]] /. Susyno`LieGroups`conj -> Identity] <> "::numberOfGenerations; ++in2) {\n", If[generationSizes[[i,j,1]] > 1, 1, 0]], + "" + ] <> + If[generationSizes[[i,j,3]] > 1, + Nest[TextFormatting`IndentText, "for (int out1=0; out1<" <> CXXNameOfField[First@FSScatteringPairs[[j]] /. Susyno`LieGroups`conj -> Identity] <> "::numberOfGenerations; ++out1) {\n", If[generationSizes[[i,j,1]] > 1, 1, 0] +If[generationSizes[[i,j,2]] > 1, 1, 0] ], + "" + ] <> + If[generationSizes[[i,j,4]] > 1, + Nest[TextFormatting`IndentText, "for (int out2=0; out2<" <> CXXNameOfField[Last@FSScatteringPairs[[j]] /. Susyno`LieGroups`conj -> Identity] <> "::numberOfGenerations; ++out2) {\n", If[generationSizes[[i,j,1]] > 1, 1, 0] +If[generationSizes[[i,j,2]] > 1, 1, 0] + If[generationSizes[[i,j,3]] > 1, 1, 0]], + "" + ] <> + Nest[ + TextFormatting`IndentText, + WrapLines["const std::complex temp = " <> ToString@CForm[FullSimplify[removeFactor*a0[[i,j]]] /. decrementIndices] <> ";\n"] <> + With[ + { + rowIdxStr = ToString[Plus@@Times@@@FSScatteringPairsSizes[Take[FSScatteringPairs, i-1]]] <> If[generationSizes[[i,j,1]] > 1, "+in1", ""] <> + If[generationSizes[[i,j,2]] > 1, + "+in2" <> + If[generationSizes[[i,j,1]] > 1, + "*" <> CXXNameOfField[First@FSScatteringPairs[[i]] /. Susyno`LieGroups`conj -> Identity] <> "::numberOfGenerations", + "" + ], + "" + ], + columnIdxStr=ToString[Plus@@Times@@@FSScatteringPairsSizes[Take[FSScatteringPairs, j-1]]] <> If[generationSizes[[i,j,3]] > 1, "+out1", ""] <> + If[generationSizes[[i,j,4]] > 1, + "+out2" <> + If[generationSizes[[i,j,3]] > 1, + "*" <> CXXNameOfField[First@FSScatteringPairs[[j]] /. Susyno`LieGroups`conj -> Identity] <> "::numberOfGenerations", + "" + ], + "" + ] + }, + "matrix.coeffRef(" <> rowIdxStr <> ", " <> columnIdxStr <> ") = temp;\n" <> + If[ToExpression[rowIdxStr] =!= ToExpression[columnIdxStr], If[!IntegerQ@ToExpression[rowIdxStr] || !IntegerQ@ToExpression[columnIdxStr], "if (" <> rowIdxStr <> " != " <> columnIdxStr <> ") ", ""] <> "matrix.coeffRef(" <> columnIdxStr <> ", " <> rowIdxStr <> ") = temp;\n", ""] + ], + If[MemberQ[{0, 1}, Count[generationSizes[[i,j]], x_/;x>1]], 1, Count[generationSizes[[i,j]], x_/;x>1]] + ] <> + If[generationSizes[[i,j,4]] > 1, + Nest[TextFormatting`IndentText, "}\n", If[generationSizes[[i,j,1]] > 1, 1, 0] +If[generationSizes[[i,j,2]] > 1, 1, 0] + If[generationSizes[[i,j,3]] > 1, 1, 0]], + "" + ] <> + If[generationSizes[[i,j,3]] > 1, + Nest[TextFormatting`IndentText, "}\n", If[generationSizes[[i,j,1]] > 1, 1, 0] +If[generationSizes[[i,j,2]] > 1, 1, 0] ], + "" + ] <> + If[generationSizes[[i,j,2]] > 1, + Nest[TextFormatting`IndentText, "}\n", If[generationSizes[[i,j,1]] > 1, 1, 0]], + "" + ] <> + If[Count[generationSizes[[i,j]], x_/;x>1] ===0 || generationSizes[[i,j, 1]] > 1, + "}\n", + "" + ] + ] + ] + ]; + TextFormatting`IndentText[paramsCPP <> inputPars <> resultInfinite] +]; + +GetScatteringMatrix[] := Module[{generationSizes, a0, a0InfiniteS, FSScatteringPairs, FSScatteringPairsSizes}, + InitUnitarity[]; + + (* only color neutral final states *) + FSScatteringPairs = Select[scatteringPairs, (TreeMasses`GetColorRepresentation /@ #) == {S,S}&]; + + a0 = Outer[GetScatteringDiagrams[#1 -> #2]&, FSScatteringPairs, FSScatteringPairs, 1]; + (* obviously 's' lives in Susyno`LieGroups` *) + a0InfiniteS = Map[Limit[# /. qChan -> 1 /. sChan|tChan|uChan -> 0, Susyno`LieGroups`s->Infinity]&, a0, {2}]; + + generationSizes = Table[{i, j}, {i, Length[FSScatteringPairs]}, {j, Length[FSScatteringPairs]}]; + generationSizes = Apply[Join[TreeMasses`GetDimension /@ FSScatteringPairs[[#1]], TreeMasses`GetDimension /@ FSScatteringPairs[[#2]]]&, generationSizes, {2}]; + FSScatteringPairsSizes = Map[TreeMasses`GetDimension, FSScatteringPairs, {2}]; + + {Plus@@Times@@@FSScatteringPairsSizes, InfiniteS[a0InfiniteS, generationSizes, FSScatteringPairs]} +]; + +End[]; +EndPackage[]; + diff --git a/meta/Utils.m b/meta/Utils.m index eac4b47ac8..93f3c13f0a 100644 --- a/meta/Utils.m +++ b/meta/Utils.m @@ -135,6 +135,9 @@ occurrence of the given rule is replaced (if it exists) or added (if FSFancyLine::usage = "Print separator line in command line mode"; +FSFancyWarning::usage = "Print a warning with a style. Note, if <> used in +argument, might be printed twice."; + PrintHeadline::usage = "Print fancy head line"; PrintAndReturn::usage = "Print result and return it"; @@ -142,79 +145,50 @@ occurrence of the given rule is replaced (if it exists) or added (if AssertWithMessage::usage = "AssertWithMessage[assertion_, message_String]: If assertion does not evaluate to True, print message and Quit[1]."; -AssertOrQuit::usage = -"@brief AssertOrQuit[assertion, sym::tag, insertions...]: -If assertion evaluate to True, returns True. -If assertion evaluate to False, print message with sequence of insertions -and Quit[1]. -@param assertion Some expression which one want to check being True or something -else. -@param sym::tag Controlling MessageName String. It is assumed that symbol \"\" -appears only as controllling one, i.e. in the form \"1\", \"25\" etc. -@param insertions... None or more expressions which are inserted inside sym::tag -controlling String. Its length should be equal or more then the maximal -controlling number in sym::tag. -@note First check controlling sym::tag. -@note __~~\"Private\"~~str__:>str is done because Mathematica prints the names -of Private` variables in a quite weird way. -@note \"\\n->\"dummy_new_line\" because Mathematica's StringForm incorrectly -parses \\n symbol. -@note hard-coded width of output colourless text is 70."; - -EvaluateOrQuit::usage = -"@brief EvaluateOrQuit[expression, sym::tag, insertions...]: -Evaluates expression and returns the result if Wolfram messages aren't -generated. -If any Message is generated it - stops evaluation, - prints message with sequence of insertions, - prints content of Message and - Quit[1]. -@param expression Some expression which one want to evaluate without Wolfram -messages. -@param sym::tag Controlling MessageName String. It is assumed that symbol \"`\" -appears only as controllling one, i.e. in the form \"`1`\", \"`25`\" etc. -@param insertions... None or more expressions which are inserted inside sym::tag -controlling String. Its length should be equal or more then the maximal -controlling number in sym::tag. -@note First check controlling sym::tag. -@note hard-coded width of output colourless text is 70. -@note It seems that function is not working for messages generated in subkernels -if they are running inside expression. -@note __~~\"Private`\"~~str__:>str is done because Mathematica prints the names -of Private` variables in a quite weird way. -@note \"\\n->\"dummy_new_line\" because Mathematica's StringForm incorrectly -parses \\n symbol. -@note Internal`HandlerBlock is not documented, this is why System`Dump` prefix -is used for function arguments to avoid any unexpected behavior."; - -MakeUnknownInputDefinition::usage = -"@brief Creates definition for a given symbol for a case when input is not defined -explicitly, i.e. creates definition for the pattern symbol[args___]. -@example Step 1) Make all desired definitions for a function (here: foo), like -foo[a_Integer] := Module[{<...>},<...>]; -foo[c:{__Integer}] := Module[{<...>},<...>]; -Step 2) Secure the usage of foo for specified above cases simply by writing -foo // Utils`MakeUnknownInputDefinition; -or -Utils`MakeUnknownInputDefinition[foo]; -or -Utils`MakeUnknownInputDefinition@foo; -somewhere in the scope of the package, where foo is defined. -@param sym Symbol to make definition for. -@returns None. +AssertOrQuit::usage = " +@brief If assertion === True, True is returned. + If assertion =!= True, an error message is printed and kernel is killed. +@param assertion Any expression. +@param sym::tag A message string. +@param insertions Expressions inserted into the message via StringTemplate."; + +MakeUnknownInputDefinition::usage = " +@brief After the definition of any function use it like: + + Utils`MakeUnknownInputDefinition[function]; + + It creates a new definition function[args___], which prints an error and + kills the kernel if used in the code. +@param sym A name of a function. @note UpValues for symbol[args___] are not cleared."; +DynamicInclude::usage = " +@brief Once gets a file(s), specified by the input string. +@param file A name of a file to load."; + ReadLinesInFile::usage = "ReadLinesInFile[fileName_String]: Read the entire contents of the file given by fileName and return it as a list of Strings representing the lines in the file. Warning: This function may ignore empty lines."; -FSReIm::usage = "FS replacement for the mathematica's function ReIm"; -FSBooleanQ::usage = "FS replacement for the mathematica's function BooleanQ"; MathIndexToCPP::usage = "Converts integer-literal index from mathematica to c/c++ convention"; FSPermutationSign::usage = "Returns the sign of a permutation given in a Cycles form"; +DecomposeVersionString::usage = "Return a list for string containing a version number"; +VersionOrderGtEqThan::usage = "Checks if version is >= than a given one"; +FSRound::usage = "FSRound[x, n] rounds number x to n digits after dot."; + +UnzipRules::usage = "Expands a set of compact rules into the full one: +In[1]:= rules = {a -> b, {c, d} -> e}; + Utils`UnzipRules[rules] +Out[1]= {a -> b, c -> e, d -> e}"; + +FSDebugPrint::usage = " +@brief Print debug messages from the meta phase. Printout is controlled by the + FlexibleSUSY`FSDebugOutput global variable. +@param module name as string (e.g. Utils), message as sequence of strings +"; + Begin["`Private`"]; AppendOrReplaceInList[values_List, elem_, test_:SameQ] := @@ -239,7 +213,7 @@ occurrence of the given rule is replaced (if it exists) or added (if SetAttributes[ApplyAndConcatenate, HoldFirst]; StringJoinWithSeparator[list_List, separator_String, transformer_:ToString] := - StringJoin[Riffle[transformer /@ list, separator]]; + StringRiffle[transformer /@ list, separator]; Zip[list1_List, list2_List] := MapThread[List, {list1, list2}]; @@ -269,7 +243,7 @@ occurrence of the given rule is replaced (if it exists) or added (if 0, Print["Error: option ", opt, " not found"]; Null, 1, values[[1]], - _, Print["Warning: option ", opt, " not unique"]; + _, FSFancyWarning["Option ", opt, " is not unique"]; values[[1]] ] ]; @@ -352,166 +326,163 @@ occurrence of the given rule is replaced (if it exists) or added (if FSFancyLine[]; ]; +FSFancyWarning[string_String, len_Integer:70] := +Module[{warning, chopped}, + warning = If[$Notebooks, + Style["Warning: ", Cyan], + If[TrueQ@FlexibleSUSY`FSEnableColors, + "\033[1;36mWarning\033[1;0m: ", + "Warning: " + ] + ]; + chopped = InsertLinebreaks[StringReplace[string, "\n"-> " "], len-9]; + chopped = StringReplace[chopped, "\n"-> "\n "]; + WriteString[$Output, warning <> chopped <> "\n"] + If[$Notebooks, + Print[warning, chopped];, + WriteString[$Output, warning <> chopped <> "\n"]; + ]; +]; + PrintAndReturn[e___] := (Print[e]; e) AssertWithMessage[assertion_, message_String] := If[assertion =!= True, Print[message]; Quit[1]]; -AssertOrQuit::errNotDefined = -"Error message \"`1`\" is not defined in the code."; -AssertOrQuit::errStrokes = -"Even number of `.` symbols in sym::tag should be given in: -\"`1`\""; -AssertOrQuit::errControl = -"Only control symbols \"`.`int Number`.`\" and \"`.`.`.`\" are allowed in: -\"`1`\""; -AssertOrQuit::errInsertions = -"The length of insertions -`1` -should large or equal to the max control number `2` in: -\"`3`\""; -AssertOrQuit::errInput = -"Input should be of the following form: -AssertOrQuit[assertion, sym::tag, insertions...] and not -AssertOrQuit@@`1`. - -Read AssertOrQuit::usage for more information."; -AssertOrQuit[assertion_,HoldPattern@MessageName[sym_, tag_],insertions___] := - internalAssertOrQuit[assertion,MessageName[sym,tag],insertions] /; - internalOrQuitInputCheck[AssertOrQuit,MessageName[sym,tag],insertions]; -AssertOrQuit[x___] := - AssertOrQuit[False,AssertOrQuit::errInput,{x}]; -If[!$Notebooks, - internalAssertOrQuit[assertion_,HoldPattern@MessageName[sym_, tag_],insertions___] := - Module[{RedString,WriteOut,MultilineToDummy,replacedMessage}, - If[assertion === True,Return@True]; - - RedString[str_] := "\033[1;31m"<>str<>"\033[1;0m"; - WriteOut[str__] := WriteString["stdout"~OutputStream~1,StringJoin@str]; - MultilineToDummy[args___] := Sequence@@(StringReplace[ToString@#,"\n"->"dummy_n"]&/@{args}); - replacedMessage = StringReplace[sym~MessageName~tag,"\n"->"dummy_n"]; - - Utils`FSFancyLine[]; - WriteOut[Context@sym,StringReplace[ToString@sym,__~~"`"~~str__:>str],": ",RedString@tag,":\n"]; - WriteOut@StringReplace[ToString@StringForm[replacedMessage,MultilineToDummy@insertions],"dummy_n"->"\n"]; - WriteOut["\nWolfram Language kernel session ",RedString@"terminated",".\n"]; - Utils`FSFancyLine[]; - Quit[1]; - ];, - (* Else *) - internalAssertOrQuit[assertion_,HoldPattern@MessageName[sym_, tag_],insertions___] := - Module[{WriteColourless,MultilineToDummy,replacedMessage}, - If[assertion === True,Return@True]; - - MultilineToDummy[args___] := Sequence@@(StringReplace[ToString@#,"\n"->"dummy_n"]&/@{args}); - replacedMessage = StringReplace[sym~MessageName~tag,"\n"->"dummy_n"]; - - Print[Context@sym,StringReplace[ToString@sym,__~~"`"~~str__:>str],": ",Style[tag,Red],":\n", - StringReplace[ToString@StringForm[replacedMessage,MultilineToDummy@insertions],"dummy_n"->"\n"], - "\nWolfram Language kernel session ","terminated"~Style~Red,"."]; - Quit[1]; +AssertOrQuit[assertion_, + HoldPattern@MessageName[sym_, tag_], + insertions___] := +Module[{RedString, WriteOut}, + If[TrueQ@assertion, Return@True]; + RedString[str_] := If[$Notebooks, + Style[str, Red], + If[TrueQ@FlexibleSUSY`FSEnableColors, + "\033[1;31m"<>str<>"\033[1;0m", + str + ] ]; + WriteOut[str__] := If[$Notebooks, + Print[str], + WriteString[$Output, StringJoin[str]<>"\n"] + ]; + WriteOut[Context@sym, SymbolName@sym, ": ", RedString@tag, ":"]; + WriteOut@StringTemplate[MessageName[sym, tag]][insertions]; + WriteOut["Wolfram Language kernel session ", RedString@"terminated", "."]; + Quit[1]; ]; -SetAttributes[{AssertOrQuit,internalAssertOrQuit},{HoldAll,Locked,Protected}]; - -EvaluateOrQuit::errNotDefined = AssertOrQuit::errNotDefined; -EvaluateOrQuit::errStrokes = AssertOrQuit::errStrokes; -EvaluateOrQuit::errControl = AssertOrQuit::errControl; -EvaluateOrQuit::errInsertions = AssertOrQuit::errInsertions; -EvaluateOrQuit::errInput = -"Input should be of the following form: -EvaluateOrQuit[expression, sym::tag, insertions...] and not -EvaluateOrQuit@@`1`. -Read EvaluateOrQuit::usage for more information."; -EvaluateOrQuit[expression_,HoldPattern@MessageName[sym_, tag_],insertions___] := - internalEvaluateOrQuit[expression,MessageName[sym,tag],insertions] /; - internalOrQuitInputCheck[EvaluateOrQuit,MessageName[sym,tag],insertions]; -EvaluateOrQuit[x___] := - AssertOrQuit[False,EvaluateOrQuit::errInput,{x}]; -internalEvaluateOrQuit[ - expression_, - HoldPattern@MessageName[sym_, tag_], - insertions___ -] := -Module[ - { - ctrlRed=If[!$Notebooks,"\033[1;31m",""], - ctrlBack=If[!$Notebooks,"\033[1;0m",""], - CutString=If[(!$Notebooks)&&MemberQ[$Packages,"TextFormatting`"], - TextFormatting`WrapLines[#,70,""]&,#&], - WriteOut,WriteColourless,Filter - }, - WriteOut[string__] := WriteString[OutputStream["stdout",1],StringJoin@string]; - WriteColourless[string__] := WriteOut@CutString@StringJoin@string; - Filter[ - System`Dump`str_, - Hold[MessageName[System`Dump`s_, System`Dump`t_]], - Hold[Message[_, System`Dump`args___]] - ] := - ( - Utils`FSFancyLine[]; - WriteOut[Context@sym,StringReplace[ToString@sym,__~~"`"~~str__:>str], - ": ",ctrlRed,tag,ctrlBack,":\n"]; - WriteColourless[#,"\n"]&/@StringSplit[ToString@StringForm[ - StringReplace[MessageName[sym, tag],"\n"->"dummy_n"],insertions], - "dummy_n"]; - WriteColourless[ToString@System`Dump`s,"::",System`Dump`t," ", - ToString@StringForm[System`Dump`str,System`Dump`args]]; - WriteOut["\nWolfram Language kernel session ",ctrlRed,"terminated",ctrlBack,".\n"]; - Utils`FSFancyLine[]; - Quit[1] - ); - Internal`HandlerBlock[{"MessageTextFilter", Filter}, expression] -]; -SetAttributes[{EvaluateOrQuit,internalEvaluateOrQuit},{HoldAll,Locked,Protected}]; - -internalOrQuitInputCheck[func_,message_,insertions___] := -Module[{nStrokes,controlSubstrings}, - internalAssertOrQuit[StringQ@message, - func::errNotDefined,message]; - nStrokes = StringCount[message,"`"]; - internalAssertOrQuit[EvenQ@nStrokes, - func::errStrokes,message]; - - If[nStrokes===0,Return@True]; - - controlSubstrings=DeleteDuplicates@StringCases[message,{ - "`.`":>0,(* Ok *) - "`"~~num:DigitCharacter..~~"`":>FromDigits@num,(* Ok *) - "`"~~___~~"`":>-1(* Something bad *) - }]; - internalAssertOrQuit[FreeQ[controlSubstrings,-1], - func::errControl,message]; - internalAssertOrQuit[TrueQ[Max@controlSubstrings<=Length@{insertions}], - func::errInsertions,{insertions},Max@checkedControl,message] + +AssertOrQuit[x___] := AssertOrQuit[False, AssertOrQuit::errInput, {x}]; +AssertOrQuit ~ SetAttributes ~ {HoldAll, Protected}; +AssertOrQuit::errInput = "Input '`1`' is not supported."; + +Options[FSFancyWarning] = { + PageWidth-> 70 +}; + +FSFancyWarning[input__, OptionsPattern[]] := +Module[{warning, chopped, string}, + string = StringReplace[StringJoin[ToString/@ {input}], "\n"-> " "]; + warning = If[!$Notebooks, + If[TrueQ@FlexibleSUSY`FSEnableColors, + "\033[1;36mWarning:\033[1;0m ", + "Warning: " + ], + Style["Warning: ", Cyan] + ]; + chopped = InsertLinebreaks[string, OptionValue[PageWidth]-9]; + chopped = StringReplace[chopped, "\n"-> "\n "]; + If[!$Notebooks, + WriteString[$Output, warning <> chopped <> "\n"];, + Print[warning, chopped]; + ]; ]; -SetAttributes[internalOrQuitInputCheck,{HoldFirst,Locked,Protected}]; MakeUnknownInputDefinition[sym_Symbol] := -Module[{usageString,info,parsedInfo,infoString,symbolAsString}, - (* Clean existing definitions if they exist for required pattern.. *) +Module[{up, down, all, usageString, infoString, simplify}, Off[Unset::norep]; - sym[args___] =.; + sym[args___] =.; On[Unset::norep]; - (* Maybe some useful definitions already exist*) - If[MatchQ[sym::usage,_String],usageString="Usage:\n"<>sym::usage<>"\n\n",usageString=""]; - info = MakeBoxes@Definition@sym; - If[MatchQ[info,InterpretationBox["Null",__]],(* True - No, there is no definitions. *) - infoString="", - parsedInfo = Flatten@# &/@ (Cases[info[[1,1]],GridBox[{x:{_}..},__]:>Cases[{x},{_RowBox},1],2]~Flatten~2 //. {RowBox[x_]:>x,StyleBox[x_,_]:>x}); - parsedInfo = MapThread[parsedInfo[[##]]&,{Range@Length@#,First/@#}] &@ (Range@(First@#-1) &@ Position[#,"="|":="|"^="|"^:="] &/@ parsedInfo); - parsedInfo = DeleteCases[DeleteDuplicates@parsedInfo,{"Options",__}|{"Attributes",__}]; - parsedInfo = Array[Join[{ToString@#,") "},parsedInfo[[#]]]&,Length@parsedInfo]; - infoString = StringJoin@Riffle[StringJoin @@ # & /@ parsedInfo, "\n"]; - infoString = "The behavior for case"<>If[Length@parsedInfo===1,"\n","s\n"]<>infoString<>"\nis defined only.\n\n"; + + If[MatchQ[sym::usage, _String], + usageString = StringJoin["Usage:\n", sym::usage, "\n\n"];, + usageString = ""; + ]; + + simplify[expr_] := StringReplace[ToString@expr, + StartOfString ~~ "HoldPattern[" ~~ x___ ~~ "]" ~~ EndOfString :> x]; + + up = simplify/@ First/@ UpValues@ sym; + down = simplify/@ First/@ DownValues@ sym; + all = Join[up, down]; + + If[all === {}, + infoString = "", + infoString = Array[(ToString[#]<>") "<>all[[#]])&, Length@all]; + infoString = StringRiffle[infoString, "\n"]; + infoString = "The behavior for case(s):\n"<>infoString<> + "\nis defined only.\n\n"; + ]; + + With[{name = ToString@sym}, + sym::errUnknownInput = "`1``2`Call\n`3`[`4`]\nis not supported."; + sym[args___] := AssertOrQuit[False, + sym::errUnknownInput, + usageString, + infoString, + name, + StringJoinWithSeparator[{args},", "] + ]; ]; - symbolAsString=StringReplace[ToString@sym,"`"->"`.`"]; - sym::errUnknownInput = "`1``2`Call\n"<>symbolAsString<>"[`3`]\nis not supported."; - (* Define a new pattern. *) - sym[args___] := AssertOrQuit[False,sym::errUnknownInput,usageString,infoString,StringJoinWithSeparator[{args},", "]]; ]; MakeUnknownInputDefinition@MakeUnknownInputDefinition; -SetAttributes[MakeUnknownInputDefinition,{Locked,Protected}]; +MakeUnknownInputDefinition // Protect; + +DynamicInclude[path_String] := +Module[{separatedQ, wildQ, files}, + separatedQ = StringContainsQ[path, $PathnameSeparator]; + wildQ = StringContainsQ[path, "*"]; + + Switch[{wildQ, separatedQ}, + {False, False}, + Return@singleInclude@FileNameJoin@{DirectoryName@$Input, path};, + {False, True}, + Return@singleInclude@path;, + {True, False}, + files = FileNames@FileNameJoin@{DirectoryName@$Input, path}; + Return[singleInclude/@files];, + {True, True}, + Return[singleInclude/@FileNames@path]; + ]; +]; +DynamicInclude // MakeUnknownInputDefinition; +DynamicInclude // Protect; + +singleInclude[path_String] := +With[{inserted = path}, + AssertOrQuit[And[FileExistsQ@path, Not@DirectoryQ@path], + DynamicInclude::errNoFile, + path + ]; + Once@Get@inserted; + Return@inserted; +]; +singleInclude // MakeUnknownInputDefinition; +singleInclude // Protect; + +DynamicInclude::errNoFile = "\nFile\n`1`\ndoes not exist and can't be loaded!"; + +UnzipRules[rules:{Rule[_|{__}, _]...}] := + rules /. Rule[lhs:{__}, rhs_] :> Sequence@@ (Rule[#, rhs]&/@ lhs); +UnzipRules // MakeUnknownInputDefinition; +UnzipRules // Protect; + +abbreviateLongString[expr_] := +Module[{str, b}, + b[s_] := If[!$Notebooks,"\033[1;36m"<>s<>"\033[0m", s]; + str = ToString@expr; + If[StringLength@str > 1000, b["<"]<>StringTake[str, 1000]<>b[">"], str]]; +abbreviateLongString // MakeUnknownInputDefinition; +abbreviateLongString // Protect; StringJoinWithReplacement[ list_List, @@ -538,17 +509,6 @@ occurrence of the given rule is replaced (if it exists) or added (if lines ] -FSReIm[z_/;NumberQ[z]] := If[$VersionNumber >= 10.1, - ReIm[z], - {Re[z], Im[z]} -]; - -FSBooleanQ[b_] := - If[$VersionNumber >= 10.0, - BooleanQ[b], - If[b === True || b === False, True, False] - ]; - (* MathIndexToCPP *) MathIndexToCPP[i_Integer /; i>0] := i-1; @@ -569,6 +529,25 @@ occurrence of the given rule is replaced (if it exists) or added (if FSPermutationSign[perm___] := (Print[perm, " is not a permutation in disjoint cyclic form."];Quit[1]); +DecomposeVersionString[version_String] := + ToExpression /@ StringSplit[version, "."]; + +VersionOrderGtEqThan[version_List, minimRequired_List] /; + Length[version] ===3 && Length[minimRequired] ===3 && And@@(IntegerQ /@ Join[version, minimRequired]) := + !(version[[1]] < minimRequired[[1]] || + (version[[1]] == minimRequired[[1]] && + version[[2]] < minimRequired[[2]]) || + (version[[1]] == minimRequired[[1]] && + version[[2]] == minimRequired[[2]] && + version[[3]] < minimRequired[[3]])); + +FSRound[num_, prec_] := + PaddedForm[num, {IntegerPart[Log[10, Abs[num]]] + prec + 1, prec}]; + +FSDebugPrint[module_String, msg___] := + If[FlexibleSUSY`FSDebugOutput, + Print["Debug<" <> module <> ">: ", Sequence @@ Utils`InputFormOfNonStrings /@ {msg}]]; + End[]; EndPackage[]; diff --git a/meta/Vertices.m b/meta/Vertices.m index 65e30c2761..93b7d8a604 100644 --- a/meta/Vertices.m +++ b/meta/Vertices.m @@ -61,6 +61,24 @@ Begin["`Private`"] +FSVertex[sortedFields_, UseDependences_:False] := FSVertex[sortedFields, UseDependences] = +Module[{vertexList, vertex}, + + vertexList = + Switch[Length[sortedFields], + 3, SARAH`VertexList3, + 4, SARAH`VertexList4, + _, Print["Only three- and four-point vertices are supported"]; Quit[1] + ]; + + vertex = Select[vertexList, Vertices`StripFieldIndices[#[[1]]] === sortedFields &, 1]; + + If[vertex =!= {}, + First@vertex, + SARAH`Vertex[sortedFields, UseDependences -> useDependences] + ] +]; + (* cached 3-point vertices, with and without dependencies imposed *) cachedVertices[3, False] = {}; cacjedVertices[3, True] = {}; @@ -276,7 +294,7 @@ are scalars without (generation) indices. This alone does not yet EnforceCpColorStructures /@ nPointFunctions; EnforceCpColorStructures[ - SelfEnergies`FSSelfEnergy[p : f_Symbol[__] | f_Symbol, expr__]] := + SelfEnergies`FSSelfEnergy[p : {f_Symbol[_], f_Symbol[_]}[_] | {f_Symbol[_], f_Symbol[_]} | {f_Symbol, f_Symbol} | {f_Symbol, f_Symbol}[_] , expr__]] := SelfEnergies`FSSelfEnergy@@Prepend[EnforceCpColorStructures[f, {expr}], p]; EnforceCpColorStructures[nPointFunction_] := nPointFunction; @@ -786,14 +804,7 @@ are scalars without (generation) indices. This alone does not yet IsNonZeroVertex[fields_List, vertexList_:{}, useDependences_:False] := Module[{sortedFields, cached, vertex}, sortedFields = SortFieldsInCp[fields]; - If[vertexList =!= {}, - cached = DeleteDuplicates[Select[vertexList, StripFieldIndices[#[[1]]] === sortedFields &, 1]]; - If[cached =!= {}, - Return[Or @@ (MemberQ[#[[2 ;;]][[All, 1]], Except[0]]& /@ cached)]; - ]; - ]; - vertex = SARAH`Vertex[sortedFields, UseDependences -> useDependences]; - AddToCachedVertices[vertex, useDependences]; + vertex = FSVertex[sortedFields, UseDependences -> useDependences]; MemberQ[vertex[[2 ;;]][[All, 1]], Except[0]] ]; diff --git a/meta/WeinbergAngle.m b/meta/WeinbergAngle.m index d3bdfad613..5e3979f225 100644 --- a/meta/WeinbergAngle.m +++ b/meta/WeinbergAngle.m @@ -53,10 +53,6 @@ CheckMuonDecayRunning[] := MuonDecayWorks; -DebugPrint[msg___] := - If[FlexibleSUSY`FSDebugOutput, - Print["Debug: ", Sequence @@ Utils`InputFormOfNonStrings /@ {msg}]]; - CheckMuonDecayInputRequirements[] := Module[{requiredSymbols, availPars, areDefined}, requiredSymbols = {SARAH`VectorP, SARAH`VectorW, SARAH`VectorZ, @@ -67,7 +63,7 @@ Parameters`GetModelParameters[], Parameters`GetOutputParameters[]]; areDefined = MemberQ[availPars, #]& /@ requiredSymbols; - DebugPrint["Error: Unknown symbol: ", #]& /@ + FSDebugPrint["WeinbergAngle", "Error: Unknown symbol: ", #]& /@ Cases[Utils`Zip[areDefined, requiredSymbols], {False, p_} :> p]; And @@ areDefined ]; @@ -121,7 +117,7 @@ result = "const auto pizzt = "; If[!MuonDecayWorks, Return[result <> "0.;"]]; - result <> "Re(model->" <> SelfEnergies`CreateSelfEnergyFunctionName[SARAH`VectorZ, 1] <> "(p));" + result <> "Re(model->" <> SelfEnergies`CreateSelfEnergyFunctionName[{SARAH`VectorZ, SARAH`VectorZ}, 1] <> "(p));" ]; DefVWSelfEnergy[] := @@ -129,7 +125,7 @@ result = "const auto piwwt = "; If[!MuonDecayWorks, Return[result <> "0.;"]]; - result <> "Re(model->" <> SelfEnergies`CreateSelfEnergyFunctionName[SARAH`VectorW, 1] <> "(p));" + result <> "Re(model->" <> SelfEnergies`CreateSelfEnergyFunctionName[{SARAH`VectorW, SARAH`VectorW}, 1] <> "(p));" ]; YukawaMatching[] := @@ -140,11 +136,11 @@ yukawa = {SARAH`UpYukawa, SARAH`DownYukawa, SARAH`ElectronYukawa}; If[(Parameters`GetParameterDimensions /@ yukawa) != {{3, 3}, {3, 3}, {3, 3}}, MuonDecayWorks = False; - DebugPrint["Error: Not all SM Yukawas are 3x3 matrices"];]; + FSDebugPrint["WeinbergAngle", "Error: Not all SM Yukawas are 3x3 matrices"];]; prefactor = Table[ThresholdCorrections`YukawaToMassPrefactor[fermion[[i]], yukawa[[i]]], {i, 3}]; If[!(And @@ Not /@ NumericQ /@ prefactor), MuonDecayWorks = False; - DebugPrint["Error: Prefactors of SM Yukawas cannot be determined"];]; + FSDebugPrint["WeinbergAngle", "Error: Prefactors of SM Yukawas cannot be determined"];]; If[!MuonDecayWorks, Return[""]]; result = Parameters`CreateLocalConstRefs[prefactor] <> "\n"; @@ -162,11 +158,11 @@ DefVZVWSelfEnergies[] := Module[{result}, result = "const double sigma_Z_MZ_Model = Re(model->"; - result = result <> SelfEnergies`CreateSelfEnergyFunctionName[SARAH`VectorZ, 1] <> "(mz));\n"; + result = result <> SelfEnergies`CreateSelfEnergyFunctionName[{SARAH`VectorZ, SARAH`VectorZ}, 1] <> "(MZ));\n"; result = result <> "const double sigma_W_MW_Model = Re(model->"; - result = result <> SelfEnergies`CreateSelfEnergyFunctionName[SARAH`VectorW, 1] <> "(mw));\n"; + result = result <> SelfEnergies`CreateSelfEnergyFunctionName[{SARAH`VectorW, SARAH`VectorW}, 1] <> "(MW));\n"; result = result <> "const double sigma_W_0_Model = Re(model->"; - result <> SelfEnergies`CreateSelfEnergyFunctionName[SARAH`VectorW, 1] <> "(0.));" + result <> SelfEnergies`CreateSelfEnergyFunctionName[{SARAH`VectorW, SARAH`VectorW}, 1] <> "(0.));" ]; DeltaAlphaHatBSM[scheme_] := @@ -184,7 +180,7 @@ massExpr = Cases[masses, TreeMasses`FSMassMatrix[{mass_}, particle, ___] :> mass]; If[Head[massExpr] =!= List || massExpr === {}, MuonDecayWorks = False; - DebugPrint["Error: Could not find mass of ", particle, " in masses list"]; + FSDebugPrint["WeinbergAngle", "Error: Could not find mass of ", particle, " in masses list"]; Return[1]]; TreeMasses`ReplaceDependenciesReverse[massExpr[[1]]] ]; @@ -202,12 +198,12 @@ submatrix = Cases[submatrixList, x_ /; And @@ (FreeQ[x, #] & /@ extraGaugeCouplings)]; If[Length[submatrix] != 1, MuonDecayWorks = False; - DebugPrint["Error: Photon-Z mass matrix could not be identified"]; + FSDebugPrint["WeinbergAngle", "Error: Photon-Z mass matrix could not be identified"]; Return[1]]; mass2Eigenvalues = Eigenvalues[submatrix]; If[Length[mass2Eigenvalues] != 2 || !MemberQ[mass2Eigenvalues, 0], MuonDecayWorks = False; - DebugPrint["Error: Determination of UnmixedZMass2 failed"]; + FSDebugPrint["WeinbergAngle", "Error: Determination of UnmixedZMass2 failed"]; Return[1]]; Select[mass2Eigenvalues, # =!= 0 &][[1]] /. Parameters`ApplyGUTNormalization[] ]; @@ -225,12 +221,12 @@ submatrix = Cases[submatrixList, x_ /; And @@ (FreeQ[x, #] & /@ extraGaugeCouplings)]; If[Length[submatrix] != 1, MuonDecayWorks = False; - DebugPrint["Error: W mass matrix could not be identified"]; + FSDebugPrint["WeinbergAngle", "Error: W mass matrix could not be identified"]; Return[0]]; mass2Eigenvalues = Eigenvalues[submatrix]; If[Length[DeleteDuplicates[mass2Eigenvalues]] != 1, MuonDecayWorks = False; - DebugPrint["Error: Determination of UnmixedWMass2 failed"]; + FSDebugPrint["WeinbergAngle", "Error: Determination of UnmixedWMass2 failed"]; Return[0]]; mass2Eigenvalues[[1]] /. Parameters`ApplyGUTNormalization[] ]; @@ -240,12 +236,12 @@ Module[{photonMassMatrix, extraGaugeCouplings, submatrixIndices, BW3pos, photonEigenSystem, photonVector}, If[FreeQ[SARAH`Gauge, SARAH`hypercharge] || FreeQ[SARAH`Gauge, SARAH`left], - DebugPrint["Error: hypercharge or left gauge group does not exist"]; + FSDebugPrint["WeinbergAngle", "Error: hypercharge or left gauge group does not exist"]; Return[False]]; photonMassMatrix = SARAH`MassMatrix[SARAH`VectorP]; Assert[MatrixQ[photonMassMatrix]]; If[Length[photonMassMatrix] > 4, - DebugPrint["Error: neutral vector boson mass matrix is too large to be diagonalized"]; + FSDebugPrint["WeinbergAngle", "Error: neutral vector boson mass matrix is too large to be diagonalized"]; Return[False]]; extraGaugeCouplings = Cases[SARAH`Gauge, x_ /; FreeQ[x, SARAH`hypercharge] && FreeQ[x, SARAH`left] && FreeQ[x, SARAH`color] :> x[[4]]]; @@ -256,13 +252,13 @@ x_ /; And @@ (FreeQ[x, #] & /@ extraGaugeCouplings), {1}, Heads -> False]]]; If[Length[BW3pos] != 2, - DebugPrint["Error: Photon-Z mass matrix could not be identified"]; + FSDebugPrint["WeinbergAngle", "Error: Photon-Z mass matrix could not be identified"]; Return[False]]; photonEigenSystem = Eigensystem[photonMassMatrix]; photonVector = Extract[photonEigenSystem[[2]], Position[photonEigenSystem[[1]], 0]]; If[!MemberQ[Total[Abs[Part[#, Complement[Range[Length[photonMassMatrix]], BW3pos]] & /@ photonVector], {2}], 0], - DebugPrint["Error: SM-like photon could not be identified"]; + FSDebugPrint["WeinbergAngle", "Error: SM-like photon could not be identified"]; Return[False]]; True ]; @@ -272,7 +268,7 @@ Module[{hyperchargePos, leftPos, vevlist}, If[!GellMannNishijimaRelationHolds[], MuonDecayWorks = False; - DebugPrint["Error: the Gell-Mann-Nishijima relation does not hold"]; + FSDebugPrint["WeinbergAngle", "Error: the Gell-Mann-Nishijima relation does not hold"]; Return[1]]; hyperchargePos = Position[SARAH`Gauge, x_ /; !FreeQ[x, SARAH`hypercharge], {1}][[1, 1]]; leftPos = Position[SARAH`Gauge, x_ /; !FreeQ[x, SARAH`left], {1}][[1, 1]]; @@ -285,7 +281,7 @@ -SA`ChargeGG[fieldname, hyperchargePos]}]; If[!FreeQ[vevlist, None], MuonDecayWorks = False; - DebugPrint["Error: determination of electric charge did not work"]; + FSDebugPrint["WeinbergAngle", "Error: determination of electric charge did not work"]; Return[1]]; Simplify[Plus @@ ((#[[3]]^2 - #[[4]]^2 + #[[3]]) Abs[#[[1]] #[[2]] Sqrt[2]]^2 & /@ vevlist) / Plus @@ (2 #[[4]]^2 Abs[#[[1]] #[[2]] Sqrt[2]]^2 & /@ vevlist), @@ -330,7 +326,7 @@ Module[{higgsVEV = TreeMasses`GetSMVEVExpr[Undefined], higgsDep}, If[higgsVEV === Undefined, MuonDecayWorks = False; - DebugPrint["Error: SM like Higgs vev does not exist"]; + FSDebugPrint["WeinbergAngle", "Error: SM like Higgs vev does not exist"]; Return[0]]; higgsDep = (Abs[#[[2]]]^2 - Abs[#[[3]]]^2) RHO2[FlexibleSUSY`M[#[[1]]]/MT] &; Simplify[3 (GFERMI MT higgsVEV / (8 Pi^2 Sqrt[2]))^2 * @@ -416,11 +412,11 @@ intparticles = ({SARAH`Internal[1], SARAH`Internal[2]} /. diagr[[2]]) /. {SARAH`bar[p_] :> p, Susyno`LieGroups`conj[p_] :> p}; If[Select[intparticles, TreeMasses`IsFermion] === {}, - Print["Warning: no internal fermion in wave function diagram"]; + Utils`FSFancyWarning["No internal fermion in wave function diagram"]; Return[0]]; intfermion = Select[intparticles, TreeMasses`IsFermion][[1]]; If[Select[intparticles, TreeMasses`IsScalar] === {}, - Print["Warning: no internal scalar in wave function diagram"]; + Utils`FSFancyWarning["No internal scalar in wave function diagram"]; Return[0]]; intscalar = Select[intparticles, TreeMasses`IsScalar][[1]]; result = -coupl Susyno`LieGroups`conj[coupl] * @@ -441,8 +437,9 @@ CompleteWaveResult[particle_, includeGoldstones_] := Plus @@ (WaveResult[#, includeGoldstones] &) /@ ExcludeDiagrams[GenerateDiagramsWave[particle], - If[includeGoldstones, TreeMasses`IsVector, - TreeMasses`IsVector[#] || TreeMasses`IsGoldstone[#] &]]; + (TreeMasses`IsSMHiggs[#] || + If[includeGoldstones, TreeMasses`IsVector[#], + TreeMasses`IsVector[#] || TreeMasses`IsGoldstone[#]])&]; (*returns the complete wave-function renormalization part of deltaVB*) DeltaVBwave[includeGoldstones_:False] := @@ -453,20 +450,20 @@ If[Length[neutrinofields] == 1, If[TreeMasses`GetDimension[neutrinofields[[1]]] != 3, MuonDecayWorks = False; - DebugPrint["Error: DeltaVBwave does not work since there are not 3 neutrinos"]; + FSDebugPrint["WeinbergAngle", "Error: DeltaVBwave does not work since there are not 3 neutrinos (but ", TreeMasses`GetDimension[neutrinofields[[1]]], ")"]; Return[{}]]; neutrinoresult = {WeinbergAngle`DeltaVB[{WeinbergAngle`fswave, {SARAH`gO1}, neutrinofields[[1]]}, CompleteWaveResult[neutrinofields[[1]], includeGoldstones]]}, If[Length[neutrinofields] != 3, MuonDecayWorks = False; - DebugPrint["Error: DeltaVBwave does not work since there are ", + FSDebugPrint["WeinbergAngle", "Error: DeltaVBwave does not work since there are ", "neither 1 nor 3 neutrino fields"]; Return[{}]]; If[TreeMasses`GetDimension[neutrinofields[[1]]] != 1 || TreeMasses`GetDimension[neutrinofields[[2]]] != 1, MuonDecayWorks = False; - DebugPrint["Error: definition of neutrino fields not supported"]; + FSDebugPrint["WeinbergAngle", "Error: definition of neutrino fields not supported"]; Return[{}]]; neutrinoresult = {WeinbergAngle`DeltaVB[{WeinbergAngle`fswave, {}, neutrinofields[[1]]}, @@ -477,20 +474,20 @@ If[Length[chargedleptonfields] == 1, If[TreeMasses`GetDimension[chargedleptonfields[[1]]] != 3, MuonDecayWorks = False; - DebugPrint["Error: DeltaVBwave does not work since there are not 3 charged leptons"]; + FSDebugPrint["WeinbergAngle", "Error: DeltaVBwave does not work since there are not 3 charged leptons"]; Return[{}]]; chargedleptonresult = {WeinbergAngle`DeltaVB[{WeinbergAngle`fswave, {SARAH`gO1}, chargedleptonfields[[1]]}, CompleteWaveResult[chargedleptonfields[[1]], includeGoldstones]]}, If[Length[chargedleptonfields] != 3, MuonDecayWorks = False; - DebugPrint["Error: DeltaVBwave does not work since there are ", + FSDebugPrint["WeinbergAngle", "Error: DeltaVBwave does not work since there are ", "neither 1 nor 3 charged lepton fields"]; Return[{}]]; If[TreeMasses`GetDimension[chargedleptonfields[[1]]] != 1 || TreeMasses`GetDimension[chargedleptonfields[[2]]] != 1, MuonDecayWorks = False; - DebugPrint["Error: definition of charged lepton fields not supported"]; + FSDebugPrint["WeinbergAngle", "Error: definition of charged lepton fields not supported"]; Return[{}]]; chargedleptonresult = {WeinbergAngle`DeltaVB[{WeinbergAngle`fswave, {}, chargedleptonfields[[1]]}, @@ -548,7 +545,7 @@ factor = 1, If[scalarsoutin === {inscalar, outscalar}, factor = -1, - Print["Warning: scalar direction could not be determined"]; + Utils`FSFancyWarning["Scalar direction could not be determined"]; Return[0]]]; couplSSV = factor couplSSV; couplFFSout = (diagr[[1, extoutindex]] /. C[a__] -> SARAH`Cp[a])[SARAH`PR]; @@ -640,7 +637,8 @@ Switch[{nFermions, nScalars}, {1, 2}, VertexResultFSS[diagr, includeGoldstones], {2, 1}, VertexResultFFS[diagr, includeGoldstones], - _, Print["Warning: vertex diagram type not supported"]; 0] + _, Utils`FSFancyWarning["Vertex diagram type not supported"]; + 0] ]; (*calculates tree-level vertex result for normalization of one-loop results*) @@ -654,7 +652,7 @@ part2withindex = part2]; If[TreeMasses`GetDimension[SARAH`VectorW] != 1, MuonDecayWorks = False; - DebugPrint["Error: W boson is not defined uniquely or at all"]; + FSDebugPrint["WeinbergAngle", "Error: W boson is not defined uniquely or at all"]; Return[1]]; SARAH`Cp[part2withindex, part1withindex, GetWPlusBoson[]][SARAH`PL] ]; @@ -677,14 +675,14 @@ chargedleptonfields = TreeMasses`GetSMChargedLeptons[]; If[Length[neutrinofields] != Length[chargedleptonfields], MuonDecayWorks = False; - DebugPrint["Error: DeltaVBvertex does not work since the numbers of ", + FSDebugPrint["WeinbergAngle", "Error: DeltaVBvertex does not work since the numbers of ", "neutrino and charged lepton fields are different"]; Return[{}]]; If[Length[neutrinofields] == 1, If[TreeMasses`GetDimension[neutrinofields[[1]]] != 3 || TreeMasses`GetDimension[chargedleptonfields[[1]]] != 3, MuonDecayWorks = False; - DebugPrint["Error: DeltaVBvertex does not work since there are ", + FSDebugPrint["WeinbergAngle", "Error: DeltaVBvertex does not work since there are ", "not 3 neutrinos and 3 charged leptons"]; Return[{}]]; result = {WeinbergAngle`DeltaVB[{WeinbergAngle`fsvertex, {SARAH`gO1, SARAH`gO2}}, @@ -693,14 +691,14 @@ includeGoldstones]]}, If[Length[neutrinofields] != 3, MuonDecayWorks = False; - DebugPrint["Error: DeltaVBvertex does not work since there are ", + FSDebugPrint["WeinbergAngle", "Error: DeltaVBvertex does not work since there are ", "neither 1 nor 3 neutrino fields"]; Return[{}]]; If[Or @@ ((TreeMasses`GetDimension[#] != 1) & /@ {neutrinofields[[1]], neutrinofields[[2]], chargedleptonfields[[1]], chargedleptonfields[[2]]}), MuonDecayWorks = False; - DebugPrint["Error: definition of neutrino or charged lepton fields not supported"]; + FSDebugPrint["WeinbergAngle", "Error: definition of neutrino or charged lepton fields not supported"]; Return[{}]]; result = {WeinbergAngle`DeltaVB[{WeinbergAngle`fsvertex, {}, chargedleptonfields[[1]], neutrinofields[[1]]}, @@ -766,10 +764,10 @@ SARAH`Internal[3], SARAH`Internal[4]} /. diagr[[2]]) /. {SARAH`bar[p_] :> p, Susyno`LieGroups`conj[p_] :> p}; If[Length[Select[intparticles, TreeMasses`IsFermion]] != 2, - Print["Warning: not 2 internal fermions in box diagram"]; + Utils`FSFancyWarning["Not 2 internal fermions in box diagram"]; Return[0]]; If[Length[Select[intparticles, TreeMasses`IsScalar]] != 2, - Print["Warning: not 2 internal scalars in box diagram"]; + Utils`FSFancyWarning["Not 2 internal scalars in box diagram"]; Return[0]]; intfermions = Select[intparticles, TreeMasses`IsFermion]; toponr = WeinbergAngle`topoNr /. diagr[[2]]; @@ -814,14 +812,14 @@ chargedleptonfields = TreeMasses`GetSMChargedLeptons[]; If[Length[neutrinofields] != Length[chargedleptonfields], MuonDecayWorks = False; - DebugPrint["Error: DeltaVBbox does not work since the numbers of ", + FSDebugPrint["WeinbergAngle", "Error: DeltaVBbox does not work since the numbers of ", "neutrino and charged lepton fields are different"]; Return[{}]]; If[Length[neutrinofields] == 1, If[TreeMasses`GetDimension[neutrinofields[[1]]] != 3 || TreeMasses`GetDimension[chargedleptonfields[[1]]] != 3, MuonDecayWorks = False; - DebugPrint["Error: DeltaVBbox does not work since there are ", + FSDebugPrint["WeinbergAngle", "Error: DeltaVBbox does not work since there are ", "not 3 neutrinos and 3 charged leptons"]; Return[{}]]; result = {WeinbergAngle`DeltaVB[{WeinbergAngle`fsbox, {SARAH`gO1, SARAH`gO2, @@ -833,14 +831,14 @@ includeGoldstones]]}, If[Length[neutrinofields] != 3, MuonDecayWorks = False; - DebugPrint["Error: DeltaVBbox does not work since there are ", + FSDebugPrint["WeinbergAngle", "Error: DeltaVBbox does not work since there are ", "neither 1 nor 3 neutrino fields"]; Return[{}]]; If[Or @@ ((TreeMasses`GetDimension[#] != 1) & /@ {neutrinofields[[1]], neutrinofields[[2]], chargedleptonfields[[1]], chargedleptonfields[[2]]}), MuonDecayWorks = False; - DebugPrint["Error: definition of neutrino or charged lepton fields not supported"]; + FSDebugPrint["WeinbergAngle", "Error: definition of neutrino or charged lepton fields not supported"]; Return[{}]]; result = {WeinbergAngle`DeltaVB[{WeinbergAngle`fsbox, {}}, CompleteBoxResult[chargedleptonfields[[2]], @@ -929,7 +927,7 @@ SelfEnergies`CreateVertexExpressions[relevantVertexRules, False]; Print["Generating C++ code for deltaVB ..."]; For[k = 1, k <= Length[deltaVBcontris], k++, - DebugPrint[" ", PrintDeltaVBContributionName[deltaVBcontris[[k]]]]; + FSDebugPrint["WeinbergAngle", " ", PrintDeltaVBContributionName[deltaVBcontris[[k]]]]; {p, d} = CreateDeltaVBContribution[deltaVBcontris[[k]], vertexFunctionNames]; prototypes = prototypes <> p; defs = defs <> d]; @@ -949,7 +947,7 @@ GetWPlusBoson[]][SARAH`PL]; (*follow vertex conventions:*) coupl = Vertices`SortCp[coupl]; - (*omit a possible minus sign:*) + (*omit a possible minus sign:*) If[MatchQ[coupl, Times[-1, _]], coupl = -coupl]; coupl = SelfEnergies`CreateCouplingSymbol[coupl]; For[k = 0, k <= 2, k++, @@ -995,7 +993,7 @@ CreateDeltaVBCalculation[deltaVBcontris_List] := Module[{type, result = "", boxcontri, vertexcontris, wavecontris}, If[!(TreeMasses`FindMixingMatrixSymbolFor[TreeMasses`GetSMNeutralLeptons[][[1]]] === Null), - Print["Warning: neutrino mixing is not considered in muon decay"]]; + Utils`FSFancyWarning["Neutrino mixing is not considered in muon decay"]]; type = CConversion`CreateCType[CConversion`ScalarType[CConversion`complexScalarCType]]; boxcontri = Cases[deltaVBcontris, WeinbergAngle`DeltaVB[{WeinbergAngle`fsbox, __}, _]]; If[boxcontri === {}, diff --git a/meta/WilsonCoeffs.m b/meta/WilsonCoeffs.m index 1eda9a587d..a8ae594b11 100644 --- a/meta/WilsonCoeffs.m +++ b/meta/WilsonCoeffs.m @@ -24,87 +24,82 @@ {InterfaceToMatching,neglectBasisElements}; -Begin["`internal`"]; -`type`npf = NPointFunctions`internal`type`npf; -getGenericSums = NPointFunctions`internal`getGenericSums; -getSubexpressions = NPointFunctions`internal`getSubexpressions; -getName = NPointFunctions`internal`getName; - -neglectBasisElements::usage= -"@brief Deletes specified basis elements with not anymore used subexpressions. +Begin["`Private`"]; + +neglectBasisElements::usage = " +@brief Deletes specified basis elements with not anymore used subexpressions. @param npf object to modify. @param <{Rule[_String,_]..}> operatorBasis list with {string name,fermion chain multiplication} pairs. @returns object"; -neglectBasisElements[obj:`type`npf, operatorBasis:{Rule[_String,_]..}]:= +neglectBasisElements[obj_?NPointFunctions`IsNPointFunction, operatorBasis:{Rule[_String,_]..}]:= Module[ { - basis = Last /@ findFermionChains[getSubexpressions[obj],operatorBasis], + basis = Last /@ findFermionChains[NPointFunctions`GetSubexpressions[obj],operatorBasis], objNew,positionsToDelete, - subsOnly = DeleteDuplicates@Cases[#,Alternatives@@(getName@getSubexpressions@obj),Infinity]& + subsOnly = DeleteDuplicates@Cases[#,Alternatives@@(NPointFunctions`GetParticleName@NPointFunctions`GetSubexpressions@obj),Infinity]& }, If[basis === {},Return@obj]; objNew = ReplaceAll[obj,#->0 &/@ basis]; - positionsToDelete = If[Length@#===1,#[[1]]~Take~3,##&[]] &@ Position[objNew,#] &/@ Complement[getName@getSubexpressions@obj,subsOnly@objNew[[2,1,1]]]; + positionsToDelete = If[Length@#===1,#[[1]]~Take~3,##&[]] &@ Position[objNew,#] &/@ Complement[NPointFunctions`GetParticleName@NPointFunctions`GetSubexpressions@obj,subsOnly@objNew[[2,1,1]]]; Delete[objNew,positionsToDelete] ]; SetAttributes[neglectBasisElements,{Locked,Protected}]; -InterfaceToMatching::usage= -"@brief Transforms GenericSum accordig to a given basis. -@param NPF NPF object. -@param operatorBasis list with {string name,fermion chain multiplication} pairs. -@returns Corresponding GenericSum which matches to a given basis. -@note the name convention of the chiral basis follows the FormCalc convention."; -InterfaceToMatching::errUnknownInput = -"Correct input has the folliwing form: -InterfaceToMatching@@{ , { basis expression>..} } -and not -InterfaceToMatching@@`1`."; -InterfaceToMatching[obj:`type`npf, operatorBasis:{Rule[_String,_]}] := obj; -InterfaceToMatching[obj:`type`npf, operatorBasis:{Rule[_String,_]..}] := -Module[{basis, coefficientsWilson}, - basis = findFermionChains[getSubexpressions@obj, operatorBasis]; - coefficientsWilson = removeFermionChains[createNewNPF[obj, basis]]; - coefficientsWilson +InterfaceToMatching[obj_?NPointFunctions`IsNPointFunction, operatorBasis:{Rule[_String,_]}] := obj; +InterfaceToMatching[obj_?NPointFunctions`IsNPointFunction, operatorBasis:{Rule[_String,_]..}] := +Module[{basis}, + basis = findFermionChains[NPointFunctions`GetSubexpressions@obj, operatorBasis]; + removeFermionChains[createNewNPF[obj, basis]]]; + +InterfaceToMatching[npf_?NPointFunctions`IsNPointFunction, basis:{__}] := +npf /. NPointFunctions`GenericSum[{x_}, rest__] :> + NPointFunctions`GenericSum[FindCoefficients[x, basis], rest]; + +InterfaceToMatching // Utils`MakeUnknownInputDefinition; + +FindCoefficients[expr_, basis:{__}] := +Module[{res = {}, check}, + AppendTo[res, Coefficient[expr, #]] &/@ basis; + + check = Expand[expr - res.basis]; + If[check =!= 0, + Utils`FSFancyWarning[ToString@FullForm@check, " remains."]; + ]; + res ]; -InterfaceToMatching[x___] := -Utils`AssertOrQuit[False,InterfaceToMatching::errUnknownInput,{x}]; - -findFermionChains::usage = -"@brief Searches the FermionChains in the abbreviations rules. -@param subs substitution rules of the form {Rule[_,_]..}. -@param chiralBasis name basis element rules of the form {Rule[_String,_]..}. -@returns List of ->NPointFunctions`internal`mat[F#] pairs."; +FindCoefficients // Utils`MakeUnknownInputDefinition; + +findFermionChains::usage = " +@brief Searches the FermionChains in the abbreviations rules. +@param subs Substitution rules. +@param chiralBasis Name basis element rules of the form {Rule[_String,_]..}. +@returns List of ->NPointFunctions`Mat[F#] pairs."; findFermionChains[subs:{Rule[_,_]..}, chiralBasis:{Rule[_String,_]..}] := -Module[ - { - warning = If[!$Notebooks,"\033[1;33mWarning\033[1;0m",Style["Warning",Yellow]], - (*@note there is F# <-> chain correspondence*) - basisPos = Position[subs, #]& /@ chiralBasis[[All, 2]], - i - }, +Module[{basisPos}, + basisPos = Position[subs, #]& /@ chiralBasis[[All, 2]]; Table[ If[basisPos[[i]] === {}, - Print[warning,": " <> chiralBasis[[i,1]] <> " is absent in GenericSums."]; - chiralBasis[[i,1]]->NPointFunctions`internal`mat[], + Utils`FSFancyWarning[chiralBasis[[i,1]], " is zero. ", "It might be expected or accidential."]; + chiralBasis[[i,1]]->NPointFunctions`Mat[], (*else*) - chiralBasis[[i,1]]->NPointFunctions`internal`mat[Extract[subs,{basisPos[[i,1,1]],basisPos[[i,1,2]]-1}]] + chiralBasis[[i,1]]->NPointFunctions`Mat[Extract[subs,{basisPos[[i,1,1]],basisPos[[i,1,2]]-1}]] ], - {i,Length@basisPos}] + {i,Length@basisPos} + ] ]; createNewNPF::usage = "@brief Extracts the coefficients for a given basis and NPF object."; -createNewNPF[obj:`type`npf, - chiralBasis:{Rule[_String,_NPointFunctions`internal`mat]..} +createNewNPF[obj_?NPointFunctions`IsNPointFunction, + chiralBasis:{Rule[_String,_NPointFunctions`Mat]..} ] := Module[ { newSums, newNPF=obj }, - newSums = extractCoeffs[#,chiralBasis]& /@ getGenericSums[obj]; + newSums = extractCoeffs[#,chiralBasis]& /@ NPointFunctions`GetGenericSums[obj]; newNPF[[2, 1, 1]] = newSums; newNPF ]; @@ -115,7 +110,7 @@ was not taken into account appropriately."; extractCoeffs[ NPointFunctions`GenericSum[{expr_},sumFields:{__}], - operators:{Rule[_String,_NPointFunctions`internal`mat]..} + operators:{Rule[_String,_NPointFunctions`Mat]..} ] := Module[ { @@ -129,9 +124,9 @@ removeFermionChains::usage = "@brief Removes DiracChains from the abbreviations rules."; -removeFermionChains[npointExpression:`type`npf] := +removeFermionChains[npointExpression_?NPointFunctions`IsNPointFunction] := Module[{pos}, - pos = Take[#, 3]& /@ Position[npointExpression, NPointFunctions`internal`dc]; + pos = Take[#, 3]& /@ Position[npointExpression, NPointFunctions`DiracChain]; Delete[npointExpression, pos] ]; diff --git a/meta/Wrappers.m b/meta/Wrappers.m new file mode 100644 index 0000000000..53eea7b335 --- /dev/null +++ b/meta/Wrappers.m @@ -0,0 +1,51 @@ +(* :Copyright: + + ==================================================================== + This file is part of FlexibleSUSY. + + FlexibleSUSY 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. + + FlexibleSUSY 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 FlexibleSUSY. If not, see + . + ==================================================================== + +*) + +Needs["Utils`"]; +Needs["TreeMasses`"]; + +BeginPackage["Wrappers`"]; +Begin["`Private`"]; + +warnVVVV[fields:{_, _, _, _}, vertex:{__}] := + "Input fields "<> ToString@fields<> " lead to the following combination "<> + "of Lorentz indices in the vertex "<> ToString@First@vertex<> ". "<> + "They should be equal to {lt1, lt2, lt3, lt4} up to any permutation! "<> + "Most likely the vertex is wrong. Please, cross-check the input!"; + +Module[{status = True, res}, + SARAH`Vertex[fields:{Repeated[_?TreeMasses`IsVector, {4}]}, + opts___]/; status := + Module[{naked}, + status = False; + res = SARAH`Vertex[fields, opts]; + naked = Sort@Cases[First@res, {___, lt_}:> lt, Infinity]; + If[Not@MatchQ[naked, {SARAH`lt1, SARAH`lt2, SARAH`lt3, SARAH`lt4}], + Utils`FSFancyWarning@warnVVVV[fields, res]; + ]; + status = True; + res + ]; +]; + +End[]; +Block[{$ContextPath}, EndPackage[]]; diff --git a/meta/WriteOut.m b/meta/WriteOut.m index 5bef2aa9f2..09bdd0ba0a 100644 --- a/meta/WriteOut.m +++ b/meta/WriteOut.m @@ -24,6 +24,7 @@ "Parameters`", "TreeMasses`", "Utils`"}]; +WriteObservable::usage="Prepares SLHA or FLHA output for NPointFunctions observable"; ReplaceInFiles::usage="Replaces tokens in files."; PrintParameters::usage="Creates parameter printout statements"; PrintInputParameters::usage="Creates input parameter printout statements"; @@ -80,10 +81,6 @@ Begin["`Private`"]; -DebugPrint[msg___] := - If[FlexibleSUSY`FSDebugOutput, - Print["Debug: ", Sequence @@ InputFormOfNonStrings /@ {msg}]]; - (* * @brief Replaces tokens in files. * @@ -106,7 +103,7 @@ cppTemplateFileName = files[[f,2]]; cppFile = Import[cppFileName, "String"]; modifiedCppFile = StringReplace[cppFile, replacementList]; - DebugPrint["writing file ", cppTemplateFileName]; + FSDebugPrint["WriteOut", "writing file ", cppTemplateFileName]; Export[cppTemplateFileName, modifiedCppFile, "String"]; ]; ]; @@ -335,10 +332,12 @@ Module[{str, strSLHA, lhs, wrapper}, If[SARAH`getDimParameters[mixingMatrix] === {} || SARAH`getDimParameters[mixingMatrix] === {1}, - Print["Warning: You are trying to create a SLHA matrix block for"]; - Print[" ", mixingMatrix, ", which is not a matrix!"]; - Print[" Please specify a Les Houches index in the SARAH model file."]; - ]; + Utils`FSFancyWarning[ + "You are trying to create a SLHA matrix block for ", + mixingMatrix, ", which is not a matrix! Please specify ", + "a Les Houches index in the SARAH model file." + ]; + ]; str = CConversion`ToValidCSymbolString[mixingMatrix]; (* use SLHA compliant yukawas, trilinears, soft-squared masses *) strSLHA = If[mixingMatrix === SARAH`UpYukawa || @@ -448,95 +447,75 @@ ClearAttributes[WriteSLHABlockEntry, HoldFirst]; -WriteEffectiveCouplingsSLHABlockEntry[blockName_, particle_, vectorBoson_] := - Module[{i, dim, dimWithoutGoldstones, start, particlePDG, vectorPDG, - struct, comment, value, result = ""}, - vectorPDG = Parameters`GetPDGCodesForParticle[vectorBoson][[1]]; - particlePDG = Parameters`GetPDGCodesForParticle[particle]; - dim = TreeMasses`GetDimension[particle]; - dimWithoutGoldstones = TreeMasses`GetDimensionWithoutGoldstones[particle]; - If[Length[particlePDG] != dim, - Print["Warning: length of PDG number list != dimension of particle ", particle]; - Print[" PDG number list = ", particlePDG]; - Print[" dimension of particle ", particle, " = ", dim]; - ]; - If[Length[particlePDG] < dim, - Return[""]; - ]; - start = TreeMasses`GetDimensionStartSkippingGoldstones[particle]; - Which[particle === SARAH`HiggsBoson && vectorBoson === SARAH`VectorP, - struct = "OBSERVABLES.eff_cp_higgs_photon_photon"; - comment = "Abs(effective H-Photon-Photon coupling)";, - particle === SARAH`HiggsBoson && vectorBoson === SARAH`VectorG, - struct = "OBSERVABLES.eff_cp_higgs_gluon_gluon"; - comment = "Abs(effective H-Gluon-Gluon coupling)";, - particle === SARAH`PseudoScalar && vectorBoson === SARAH`VectorP, - struct = "OBSERVABLES.eff_cp_pseudoscalar_photon_photon"; - comment = "Abs(effective A-Photon-Photon coupling)";, - particle === SARAH`PseudoScalar && vectorBoson === SARAH`VectorG, - struct = "OBSERVABLES.eff_cp_pseudoscalar_gluon_gluon"; - comment = "Abs(effective A-Gluon-Gluon coupling)";, - True, - Print["Error: unsupported effective coupling ", - particle, "-", vectorBoson, "-", vectorBoson, - "requested!"]; - Quit[1] - ]; - If[dimWithoutGoldstones == 1 || start == dim, - value = "Abs(" <> struct <> ")"; - result = result - <> WriteSLHABlockEntry[blockName, - {value, particlePDG[[start]], vectorPDG, vectorPDG}, - comment];, - For[i = start, i <= Length[particlePDG], i++, - value = "Abs(" <> struct <> "(" <> ToString[i-start] <> "))"; - result = result - <> WriteSLHABlockEntry[blockName, - {value, particlePDG[[i]], vectorPDG, vectorPDG}, - comment]; - ]; - ]; - result - ]; +$writeSLHACurrentObservable; +Module[{npfFiles, npfObservables, npfPattern, executedAlready}, WriteSLHABlockEntry[blockName_, {par_?Observables`IsObservable, idx___}, comment_String:""] := - Module[{result = ""}, - Switch[par, - FlexibleSUSYObservable`aMuon, - result = WriteSLHABlockEntry[blockName, {"OBSERVABLES.a_muon", idx}, "Delta(g-2)_muon/2 FlexibleSUSY"], - FlexibleSUSYObservable`aMuonUncertainty, - result = WriteSLHABlockEntry[blockName, {"OBSERVABLES.a_muon_uncertainty", idx}, "Delta(g-2)_muon/2 FlexibleSUSY uncertainty"], - FlexibleSUSYObservable`aMuonGM2Calc, - result = WriteSLHABlockEntry[blockName, {"OBSERVABLES.a_muon_gm2calc", idx}, "Delta(g-2)_muon/2 GM2Calc"], - FlexibleSUSYObservable`aMuonGM2CalcUncertainty, - result = WriteSLHABlockEntry[blockName, {"OBSERVABLES.a_muon_gm2calc_uncertainty", idx}, "Delta(g-2)_muon/2 GM2Calc uncertainty"], - FlexibleSUSYObservable`CpHiggsPhotonPhoton, - result = WriteEffectiveCouplingsSLHABlockEntry[blockName, SARAH`HiggsBoson, SARAH`VectorP], - FlexibleSUSYObservable`CpHiggsGluonGluon, - result = WriteEffectiveCouplingsSLHABlockEntry[blockName, SARAH`HiggsBoson, SARAH`VectorG], - FlexibleSUSYObservable`CpPseudoScalarPhotonPhoton, - result = WriteEffectiveCouplingsSLHABlockEntry[blockName, SARAH`PseudoScalar, SARAH`VectorP], - FlexibleSUSYObservable`CpPseudoScalarGluonGluon, - result = WriteEffectiveCouplingsSLHABlockEntry[blockName, SARAH`PseudoScalar, SARAH`VectorG], - FlexibleSUSYObservable`EDM[_], - result = WriteSLHABlockEntry[blockName, - {"OBSERVABLES." <> Observables`GetObservableName[par], idx}, - Observables`GetObservableDescription[par]], - FlexibleSUSYObservable`BrLToLGamma[__], - result = WriteSLHABlockEntry[blockName, - {"OBSERVABLES." <> Observables`GetObservableName[par], idx}, - Observables`GetObservableDescription[par]], - FlexibleSUSYObservable`FToFConversionInNucleus[__], - result = WriteSLHABlockEntry[blockName, - {"OBSERVABLES." <> Observables`GetObservableName[par], idx}, - Observables`GetObservableDescription[par]], - FlexibleSUSYObservable`bsgamma, - result = WriteSLHABlockEntry[blockName, {"OBSERVABLES.b_to_s_gamma", idx}, "Re(C7) for b -> s gamma"], - _, - result = WriteSLHABlockEntry[blockName, {"", idx}, ""] - ]; - result - ]; +Module[{}, + If[executedAlready =!= True, + npfFiles = Utils`DynamicInclude@FlexibleSUSY`$observablesWildcard@"WriteOut.m"; + npfObservables = StringSplit[npfFiles, $PathnameSeparator][[All, -2]]; + npfPattern = Alternatives@@(ToExpression["_FlexibleSUSYObservable`"<>#]&/@npfObservables); + executedAlready = True; + ]; + $writeSLHACurrentObservable = par; + Switch[par, + FlexibleSUSYObservable`AMM[_], + WriteSLHABlockEntry[blockName, + {"OBSERVABLES." <> Observables`GetObservableName[par], idx}, + Observables`GetObservableDescription@par], + FlexibleSUSYObservable`AMMUncertainty[_], + WriteSLHABlockEntry[blockName, + {"OBSERVABLES." <> Observables`GetObservableName[par], idx}, + Observables`GetObservableDescription@par], + FlexibleSUSYObservable`aMuonGM2Calc, + WriteSLHABlockEntry[blockName, + {"OBSERVABLES.a_muon_gm2calc", idx}, + "Delta(g-2)_muon/2 GM2Calc"], + FlexibleSUSYObservable`aMuonGM2CalcUncertainty, + WriteSLHABlockEntry[blockName, + {"OBSERVABLES.a_muon_gm2calc_uncertainty", idx}, + "Delta(g-2)_muon/2 GM2Calc uncertainty"], + FlexibleSUSYObservable`EDM[_], + WriteSLHABlockEntry[blockName, + {"OBSERVABLES." <> Observables`GetObservableName[par], idx}, + Observables`GetObservableDescription@par], + FlexibleSUSYObservable`bsgamma, + WriteSLHABlockEntry[blockName, + {"OBSERVABLES.b_to_s_gamma", idx}, + "Re(C7) for b -> s gamma"], + npfPattern, + WriteSLHABlockEntry[blockName, + {WriteObservable[blockName, par], idx}, + Observables`GetObservableDescription@par], + _, + WriteSLHABlockEntry[blockName, {"", idx}, ""] + ] +];]; + +WriteSLHABlockEntry::errType = "Currently type `1` is not supported."; +WriteSLHABlockEntry["FWCOEF"|"IMFWCOEF", {flha_List, _}, _] := +Module[{obstype, maxlength, numbered}, + obstype = Observables`GetObservableType@$writeSLHACurrentObservable; + Switch[obstype, + _CConversion`ArrayType, + maxlength = obstype[[2]], + _, + Utils`AssertOrQuit[False, WriteSLHABlockEntry::errType, obstype] + ]; + numbered = MapIndexed[ + StringReplace[" << FORMAT_WILSON_COEFFICIENTS(" <> #1 <> ")\n", + ")," -> "(" <> ToString[maxlength - Length@flha + First@#2 - 1] <> ")),"]&, + flha + ]; + numbered = StringReplace[numbered, + "COEFFICIENTS(" ~~ Shortest[x__] ~~ "," :> "COEFFICIENTS(\"" <> StringTrim@x <> "\"," + ]; + numbered = StringReplace[numbered, + "\"," ~~ Shortest[x__] ~~ "," :> "\", \"" <> StringTrim@x <> "\"," + ]; + numbered +]; WriteSLHABlockEntry[blockName_, {par_, idx1_?NumberQ, idx2_?NumberQ, idx3_?NumberQ}, comment_String:""] := Module[{parStr, parVal, idx1Str, idx2Str, idx3Str, commentStr}, @@ -668,7 +647,9 @@ reformed = ReformeBlocks /@ outputBlocks; ( result = result - <> If[First[#[[1]]] === FlexibleSUSY`FlexibleSUSYLowEnergy, + <> If[Or[First[#[[1]]] === FlexibleSUSY`FlexibleSUSYLowEnergy, + First[#[[1]]] === FlexibleSUSY`FWCOEF, + First[#[[1]]] === FlexibleSUSY`IMFWCOEF], "if (spectrum_generator_settings.get(Spectrum_generator_settings::calculate_observables)) {\n" <> TextFormatting`IndentText[WriteSLHABlock[#[[1]], #[[2]]]] <> "}\n", @@ -733,8 +714,10 @@ ReadSLHAOutputBlock[{parameter_, {blockName_, pdg_?NumberQ}}] := Block[{}, - Print["Warning: SLHA block name is not a symbol: ", blockName]; - Print[" I'm using: ", CConversion`RValueToCFormString[blockName]]; + Utils`FSFancyWarning[ + "SLHA block name is not a symbol: ", blockName, + " I'm using: ", CConversion`RValueToCFormString[blockName] + ]; ReadSLHAOutputBlock[{parameter, {CConversion`RValueToCFormString[blockName], pdg}}] ]; @@ -987,9 +970,11 @@ CreateSLHAFermionMixingMatrixName[vR] <> ", " <> CreateSLHAFermionMixingMatrixName[vL] <> ");\n"; , - Print["Warning: Cannot convert Yukawa coupling ", #, - " to SLHA, because ", {vL,vR}, " are not defined", - " or have incompatible dimension."]; + Utils`FSFancyWarning[ + "Cannot convert Yukawa coupling ", #, + " to SLHA, because ", {vL,vR}, " are not", + " defined or have incompatible dimension." + ]; result = result <> CreateSLHAYukawaName[#] <> " = MODELPARAMETER(" <> CConversion`ToValidCSymbolString[#] <> ").diagonal().real();\n"; @@ -1039,9 +1024,11 @@ GetSLHATrilinearCouplingType[#] ] <> ";\n"; , - Print["Warning: Cannot convert Trilinear coupling ", #, - " to SLHA, because ", {vL,vR}, " are not defined", - " or have incompatible dimension."]; + Utils`FSFancyWarning[ + "Cannot convert Trilinear coupling ", #, + " to SLHA, because ", {vL,vR}, " are not", + " defined or have incompatible dimension." + ]; result = result <> CreateSLHATrilinearCouplingName[#] <> " = " <> CConversion`CastTo[ @@ -1111,9 +1098,11 @@ ] <> ";\n"; ]; , - Print["Warning: Cannot convert soft squared mass ", #, - " to SLHA, because ", {vL,vR}, " are not defined", - " or have incompatible dimension."]; + Utils`FSFancyWarning[ + "Cannot convert soft squared mass ", #, + " to SLHA, because ", {vL,vR}, " are not", + " defined or have incompatible dimension." + ]; result = result <> CreateSLHASoftSquaredMassName[#] <> " = " <> CConversion`CastTo[ diff --git a/meta/createVPVZ.m b/meta/createVPVZ.m new file mode 100644 index 0000000000..4779b0427e --- /dev/null +++ b/meta/createVPVZ.m @@ -0,0 +1,156 @@ +(* + +CorrectionListVectorVector[EWSB][[1, 2]] gives data like +{bar[Fu], Fu, C[Fu, VP, bar[Fu]], C[Fu, VZ, bar[Fu]], FFV, 3, 1/2} + +whereas we want data like ThreeParticleVertex2[VP] gives, along the lines of {{bar[Fd], Fd, Cp[VP, bar[Fd[{gI1}]], Fd[{gI2}]], FFV, 3, 1/2} + +These normally feed into AddLoopScalar etc +*) + +AddLoopVectorDiff[particles_, corrections_] := + Block[{particle1, particle2, temp, m1, m2, m0, mS, mV, v, fac, m11, + m12, m21, m22, ind1, ind2, coupL1, coupR1, coupL2, coupR2, coup1, + coup2, coup3, pi1Loop}, + + {particle1, particle2} = getBlank /@ particles; (* remove indices*) + + If[getType[corrections[[1]]] === F, + temp = OrderMasses[corrections[[1]], corrections[[2]], F]; + If[FreeQ[m11, corrections[[1]]] && FreeQ[m21, corrections[[2]]], + m11 = m11 /. gI1 -> gI2; + m12 = m12 /. gI1 -> gI2; + m22 = m22 /. gI2 -> gI1; + m21 = m21 /. gI2 -> gI1;]; + m11 = temp[[1]]; m12 = temp[[1]] /. Mass -> Mass2; m21 = temp[[2]]; + m22 = temp[[2]] /. Mass -> Mass2; + coupL1 = corrections[[3]][PL]; + coupR1 = corrections[[3]][PR]; + coupL2 = corrections[[4]][PL]; + coupR2 = corrections[[4]][PR]; + + (* original pi1Loop=(coupL1 conj[coupL1]+coupR1 conj[coupR1])*H0[p^2,m12,m22]+4 Re[conj[coupL1] coupR1]*B0[p^2,m12,m22] m11 m21; + NB conj[coup[PL]] = -coup[PR] = coup[PL] for identical fields *) + + pi1Loop = (coupL1 coupL2 + coupR1 coupR2)*H0[p^2, m12, m22] + 2 (coupL1 coupR2 + coupR1 coupL2)*B0[p^2, m12, m22] m11 m21; + If[AntiField[particle1] === particle1 && AntiField[particle2] === particle2, + pi1Loop = 2 pi1Loop*corrections[[7]]*corrections[[6]];, + pi1Loop = pi1Loop*corrections[[7]]*corrections[[6]];]; + Return[sum[gI1, 1, getGen[corrections[[1]]],sum[gI2, 1, getGen[corrections[[2]]], pi1Loop]]]; + , (* Not fermionic amplitude *) + temp = OrderMasses[corrections[[1]], corrections[[2]], V]; + m11 = temp[[1]]; + m12 = temp[[1]] /. Mass -> Mass2; m21 = temp[[2]]; + m22 = temp[[2]] /. Mass -> Mass2; + If[FreeQ[m11, corrections[[1]]] && FreeQ[m21, corrections[[2]]], + m11 = m11 /. gI1 -> gI2; + m12 = m12 /. gI1 -> gI2; + m22 = m22 /. gI2 -> gI1; + m21 = m21 /. gI2 -> gI1;]; + coup1 = corrections[[3]]; + coup2 = corrections[[4]]; + Switch[corrections[[5]], + SSV, + (*pi1Loop=-4 B22[p^2,m12,m22]-(A0[m12]+A0[m22]);*) + pi1Loop = -4 B00[p^2, m12, m22]; + pi1Loop = pi1Loop*corrections[[7]]*corrections[[6]] coup1 coup2; + If[conj[particle1] === particle1 && conj[particle2] === particle2, + Return[sum[gI1, 1, getGen[corrections[[1]]],sum[gI2, 1, getGen[corrections[[2]]], 2 pi1Loop]]];, + Return[sum[gI1, 1, getGen[corrections[[1]]],sum[gI2, 1, getGen[corrections[[2]]], pi1Loop]]];];, + SVV, + pi1Loop = coup1 coup2 B0[p^2, m12, m22]; + pi1Loop = pi1Loop*corrections[[7]]*corrections[[6]]; + If[conj[particle1] === particle1 && conj[particle2] === particle2, pi1Loop = 2 pi1Loop]; + Return[sum[gI1, 1, getGen[corrections[[1]]],sum[gI2, 1, getGen[corrections[[2]]], pi1Loop]]];, + VVV, + pi1Loop = 10 B00[p^2, m12, m22] + (m12 + m22 + 4*p^2)*B0[p^2, m12, m22] + A0[m12] + A0[m22] - 2 (m12 + m22 - 1/3 p^2)*rMS; + pi1Loop = -pi1Loop*corrections[[7]]*corrections[[6]] coup1 coup2; + If[conj[particle1] === particle1 && conj[particle2] === particle2, pi1Loop = 2 pi1Loop]; + Return[sum[gI1, 1, getGen[corrections[[1]]], + sum[gI2, 1, getGen[corrections[[2]]], pi1Loop]]];, GGV, + pi1Loop = coup1 coup2 B00[p^2, m12, m22]; + pi1Loop = pi1Loop*corrections[[7]]*corrections[[6]]; + If[conj[particle1] === particle1 && conj[particle2] === particle2, pi1Loop = 2 pi1Loop]; + Return[sum[gI1, 1, getGen[corrections[[1]]], sum[gI2, 1, getGen[corrections[[2]]], pi1Loop]]];, + VVVV, + coup1 = corrections[[3]][1]; + coup2 = corrections[[3]][2]; + coup3 = corrections[[3]][3]; + pi1Loop = 2*coup1*m12*rMS - (4*coup1 + coup2 + coup3)*A0[m12]; + pi1Loop = pi1Loop*corrections[[7]]*corrections[[6]]; + Return[sum[gI1, 1, getGen[corrections[[1]]], pi1Loop]];, + SSVV, + pi1Loop = coup1*A0[m12]; + pi1Loop = pi1Loop*corrections[[7]]*corrections[[6]]; + Return[sum[gI1, 1, getGen[corrections[[1]]], pi1Loop]];]; + ]; (* end switch *) + + ]; (* End block *) + +GetVPVZSelfEnergy:=Module[{temp, temp2, particles, i, j, k, part, temploop, + loopCorrection, correction}, + particles = {VectorP, VectorZ}; + (* First get the data for the 3-vertices *) + temp = InsFields[{{C[particles[[1]], AntiField[FieldToInsert[1]], + FieldToInsert[2]], + C[AntiField[particles[[2]]], AntiField[FieldToInsert[2]], + FieldToInsert[1]]}, {Internal[1] -> FieldToInsert[1], + Internal[2] -> FieldToInsert[2], External[1] -> particles[[1]], + External[2] -> particles[[2]], Index[1] -> gO1, Index[2] -> gO2, + Index[3] -> gI1, Index[4] -> gI2}}]; + + If[temp =!= {}, + temp2 = {}; + For[k = 1, k <= Length[temp], k++, + temp2 = + Join[temp2, {ReleaseHold[ + Hold[{AntiField[Internal[1]], Internal[2], + C[External[1][{Index[1]}], AntiField[Internal[1][{Index[3]}]], + Internal[2][{Index[4]}]], + C[AntiField[External[2][{Index[2]}]], + AntiField[Internal[2][{Index[4]}]], Internal[1][{Index[3]}]], + VType[getType[Internal[1]], getType[Internal[2]], + getType[External[1]]], + CalculateColorFactor[getBlank[External[1]], Internal[1], + Internal[2]], + CalculateSymmetryFactor[Internal[1], Internal[2]]}] /. + temp[[k, 2]]]}]; + ]; + + ];(* temp =!= {}*) + + (* Then get the data for the 4-vertices*) + temp = InsFields[{{C[particles[[1]], AntiField[particles[[2]]], + AntiField[FieldToInsert[1]], FieldToInsert[1]]}, {Internal[1] -> FieldToInsert[1], External[1] -> particles[[1]], External[2] -> particles[[2]], Index[1] -> gO1, Index[2] -> gO2, Index[3] -> gI1}}]; + If[temp =!= {}, + For[k = 1, k <= Length[temp], k++, + temp2 = Join[ + temp2, {ReleaseHold[ + Hold[{AntiField[Internal[1]], Internal[1], + Cp[External[1][{Index[1]}], AntiField[External[2][{Index[2]}]], + AntiField[Internal[1][{Index[3]}]], Internal[1][{Index[3]}]], + Cp[External[1][{Index[1]}], + AntiField[External[2][{Index[2]}]], + AntiField[Internal[1][{Index[3]}]], Internal[1][{Index[3]}]], + VType[getType[Internal[1]], getType[Internal[1]], + getType[External[1]], getType[External[2]]], + CalculateColorFactor[getBlank[External[1]], Internal[1], + AntiField[Internal[1]]], + 2 CalculateSymmetryFactor[Internal[1], + AntiField[Internal[1]]]}] /. temp[[k, 2]]]}]; + ]; + ]; + + loopCorrection = 0; + For[k = 1, k <= Length[temp2], k++, + part = temp2[[k, 1]]; + correction = temp2[[k]]; + + temploop = AddLoopVectorDiff[particles, correction]; + temploop = temploop /. {Mass[conj[x_]] -> Mass[x], Mass[bar[x_]] -> Mass[x], Mass2[conj[x_]] -> Mass2[x], Mass2[bar[x_]] -> Mass2[x]}; + loopCorrection += temploop; + ]; + + + Return[loopCorrection]; + ]; diff --git a/meta/generic_loop_decay_diagram_classes.m b/meta/generic_loop_decay_diagram_classes.m index 91fc19c1af..26aaed04dc 100644 --- a/meta/generic_loop_decay_diagram_classes.m +++ b/meta/generic_loop_decay_diagram_classes.m @@ -1,4 +1,4 @@ -(* Generated at Sat 4 Jan 2020 00:13:09 *) +(* Generated at Wed 2 Jun 2021 20:27:47 *) {{"diagram_SSS_t1g1n1_FFF", {{0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 1, 1}, {0, 1, 0, 1, 0, 1}, {0, 0, 1, 1, 1, 0}}, {{1, 4} -> Field[1], {2, 5} -> Field[2], diff --git a/meta/module.mk b/meta/module.mk index 0778c3bc57..7ce3fa44cb 100644 --- a/meta/module.mk +++ b/meta/module.mk @@ -61,7 +61,7 @@ META_THDM_SRC:= \ $(DIR)/THDM/Thresholds_1L_full.m META_SRC := \ - $(DIR)/AMuon.m \ + $(DIR)/AMM.m \ $(DIR)/AnomalousDimension.m \ $(DIR)/BetaFunction.m \ $(DIR)/CConversion.m \ @@ -69,16 +69,14 @@ META_SRC := \ $(DIR)/ConvergenceTester.m \ $(DIR)/CXXDiagrams.m \ $(DIR)/Decays.m \ + $(DIR)/GM2Calc.m \ $(DIR)/NPointFunctions.m \ - $(DIR)/NPointFunctions/internal.m \ - $(DIR)/NPointFunctions/createFAModelFile.m \ + $(wildcard $(DIR)/NPointFunctions/*.m) \ + $(wildcard $(DIR)/Observables/*/*.m) \ $(DIR)/WilsonCoeffs.m \ $(DIR)/EDM.m \ $(DIR)/FFVFormFactors.m \ - $(DIR)/FToFConversionInNucleus.m \ - $(DIR)/BrLToLGamma.m \ $(DIR)/BtoSGamma.m \ - $(DIR)/EffectiveCouplings.m \ $(DIR)/EWSB.m \ $(DIR)/FlexibleEFTHiggsMatching.m \ $(DIR)/FlexibleSUSY.m \ @@ -112,9 +110,11 @@ META_SRC := \ $(DIR)/TwoLoopMSSM.m \ $(DIR)/TwoLoopQCD.m \ $(DIR)/TwoLoopSM.m \ + $(DIR)/Unitarity.m \ $(DIR)/Utils.m \ $(DIR)/Vertices.m \ $(DIR)/WeinbergAngle.m \ + $(DIR)/Wrappers.m \ $(DIR)/WriteOut.m \ $(DIR)/writeRGE.m \ $(DIR)/writeNRGE.m \ diff --git a/model_files/BLSM/FlexibleSUSY.m.in b/model_files/BLSM/FlexibleSUSY.m.in index 66efd501f2..7f7129dd71 100644 --- a/model_files/BLSM/FlexibleSUSY.m.in +++ b/model_files/BLSM/FlexibleSUSY.m.in @@ -61,6 +61,8 @@ InitialGuessAtLowScale = { PotentialLSPParticles = {}; ExtraSLHAOutputBlocks = { + {FlexibleSUSYLowEnergy, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]} } }, {FlexibleSUSYOutput, {{1, Hold[SUSYScale]}, {2, Hold[LowScale]} } } diff --git a/model_files/BLSM/LesHouches.in.BLSM b/model_files/BLSM/LesHouches.in.BLSM index 1edc34d648..7bf8cfff5a 100644 --- a/model_files/BLSM/LesHouches.in.BLSM +++ b/model_files/BLSM/LesHouches.in.BLSM @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole @@ -53,7 +54,7 @@ Block SMINPUTS # Standard Model inputs 22 2.400000000e-03 # mu(2 GeV) MS-bar 23 1.040000000e-01 # ms(2 GeV) MS-bar 24 1.270000000e+00 # mc(mc) MS-bar -Block MINPAR # Input parameters +Block MINPAR # Input parameters 1 -1.2700000E-01 # Lambda1INPUT 2 -7.2000000E-05 # Lambda2INPUT 3 0.0000000E+00 # Lambda3INPUT diff --git a/model_files/BLSMlightZp/LesHouches.in.BLSMlightZp b/model_files/BLSMlightZp/LesHouches.in.BLSMlightZp index e761adb174..fddca12648 100644 --- a/model_files/BLSMlightZp/LesHouches.in.BLSMlightZp +++ b/model_files/BLSMlightZp/LesHouches.in.BLSMlightZp @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole @@ -53,7 +54,7 @@ Block SMINPUTS # Standard Model inputs 22 2.400000000e-03 # mu(2 GeV) MS-bar 23 1.040000000e-01 # ms(2 GeV) MS-bar 24 1.270000000e+00 # mc(mc) MS-bar -Block MINPAR # Input parameters +Block MINPAR # Input parameters 1 -1.2700000E-01 # Lambda1INPUT 2 -7.2000000E-05 # Lambda2INPUT 3 0.0000000E+00 # Lambda3INPUT diff --git a/model_files/CE6SSM/FlexibleSUSY.m.in b/model_files/CE6SSM/FlexibleSUSY.m.in index f85a2d0569..4c0615ba81 100644 --- a/model_files/CE6SSM/FlexibleSUSY.m.in +++ b/model_files/CE6SSM/FlexibleSUSY.m.in @@ -136,7 +136,7 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon} } }, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]} } }, {EWSBOutputs, NoScale, {{1, m0Sq}, {2, m12}, diff --git a/model_files/CE6SSM/LesHouches.in.CE6SSM b/model_files/CE6SSM/LesHouches.in.CE6SSM index a311207185..26231cb020 100644 --- a/model_files/CE6SSM/LesHouches.in.CE6SSM +++ b/model_files/CE6SSM/LesHouches.in.CE6SSM @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/model_files/CMSSM/FlexibleSUSY.m.in b/model_files/CMSSM/FlexibleSUSY.m.in index 8a76c594ef..e4b891b7e5 100644 --- a/model_files/CMSSM/FlexibleSUSY.m.in +++ b/model_files/CMSSM/FlexibleSUSY.m.in @@ -83,7 +83,9 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon} } }, + {{20, FlexibleSUSYObservable`AMM[Fe[1]]}, + {21, FlexibleSUSYObservable`AMM[Fe[2]]}, + {22, FlexibleSUSYObservable`AMM[Fe[3]]} } }, {ALPHA, NoScale, {{ArcSin[Pole[ZH[2,2]]]}}}, {HMIX , {{1, \[Mu]}, diff --git a/model_files/CMSSM/LesHouches.in.CMSSM b/model_files/CMSSM/LesHouches.in.CMSSM index 4a6ac413aa..c2c3403978 100644 --- a/model_files/CMSSM/LesHouches.in.CMSSM +++ b/model_files/CMSSM/LesHouches.in.CMSSM @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole @@ -59,3 +60,14 @@ Block MINPAR # Input parameters 3 10. # TanBeta 4 1 # SignMu 5 0 # Azero +Block FlexibleDecay + 0 1 # calculate decays (0 = no, 1 = yes) + 1 1e-5 # minimum BR to print + 2 41 # include higher order corrections in decays SM|BSM (0 = LO, 1 = NLO, 2 = NNLO, 3 = N^3LO, 4 = N^4LO) + 3 1 # use Thomson alpha(0) instead of alpha(m) in decays to γγ and γZ + 4 2 # off-shell decays into VV pair + 5 1 # print loop-induced Higgs couplings + 6 0 # calculate Higgs effc normalized to SM + 7 0 # call HiggsTools + 8 0 # call Lilith + 9 1 # use pole Higgs mixings in decays diff --git a/model_files/CMSSMCKM/FlexibleSUSY.m.in b/model_files/CMSSMCKM/FlexibleSUSY.m.in index cf88881384..f387dadc23 100644 --- a/model_files/CMSSMCKM/FlexibleSUSY.m.in +++ b/model_files/CMSSMCKM/FlexibleSUSY.m.in @@ -91,11 +91,11 @@ ExtraSLHAOutputBlocks = { {102, vd}, {103, vu} } }, {FlexibleSUSYLowEnergy, { - {21, FlexibleSUSYObservable`aMuon}, + {21, FlexibleSUSYObservable`AMM[Fe[2]]}, {23, FlexibleSUSYObservable`EDM[Fe[1]]}, {24, FlexibleSUSYObservable`EDM[Fe[2]]}, {25, FlexibleSUSYObservable`EDM[Fe[3]]}, - {26, FlexibleSUSYObservable`BrLToLGamma[Fe[2] -> {Fe[1], VP}]}, + {26, FlexibleSUSYObservable`BrLToLGamma[Fe, 2 -> 1]}, {27, FlexibleSUSYObservable`bsgamma} } } diff --git a/model_files/CMSSMCKM/LesHouches.in.CMSSMCKM b/model_files/CMSSMCKM/LesHouches.in.CMSSMCKM index da873398ac..69385a6d43 100644 --- a/model_files/CMSSMCKM/LesHouches.in.CMSSMCKM +++ b/model_files/CMSSMCKM/LesHouches.in.CMSSMCKM @@ -15,9 +15,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -34,6 +34,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/CMSSMCPV/FlexibleSUSY.m.in b/model_files/CMSSMCPV/FlexibleSUSY.m.in index 5e3fd3a35c..1eb2fba642 100644 --- a/model_files/CMSSMCPV/FlexibleSUSY.m.in +++ b/model_files/CMSSMCPV/FlexibleSUSY.m.in @@ -85,7 +85,7 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon}, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]}, {23, FlexibleSUSYObservable`EDM[Fe[1]]}, {24, FlexibleSUSYObservable`EDM[Fe[2]]}, {25, FlexibleSUSYObservable`EDM[Fe[3]]} } }, diff --git a/model_files/CMSSMCPV/LesHouches.in.CMSSMCPV b/model_files/CMSSMCPV/LesHouches.in.CMSSMCPV index c833bc92cb..129f3c1ac8 100644 --- a/model_files/CMSSMCPV/LesHouches.in.CMSSMCPV +++ b/model_files/CMSSMCPV/LesHouches.in.CMSSMCPV @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/CMSSMCPVSemiAnalytic/FlexibleSUSY.m.in b/model_files/CMSSMCPVSemiAnalytic/FlexibleSUSY.m.in index 124eb9c1ad..a864e7c684 100644 --- a/model_files/CMSSMCPVSemiAnalytic/FlexibleSUSY.m.in +++ b/model_files/CMSSMCPVSemiAnalytic/FlexibleSUSY.m.in @@ -110,7 +110,7 @@ ExtraSLHAOutputBlocks = { {2, ImBMu0}, {3, m0Sq} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon}, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]}, {23, FlexibleSUSYObservable`EDM[Fe[1]]}, {24, FlexibleSUSYObservable`EDM[Fe[2]]}, {25, FlexibleSUSYObservable`EDM[Fe[3]]} } }, diff --git a/model_files/CMSSMCPVSemiAnalytic/LesHouches.in.CMSSMCPVSemiAnalytic b/model_files/CMSSMCPVSemiAnalytic/LesHouches.in.CMSSMCPVSemiAnalytic index a2924725da..7466b86a8b 100644 --- a/model_files/CMSSMCPVSemiAnalytic/LesHouches.in.CMSSMCPVSemiAnalytic +++ b/model_files/CMSSMCPVSemiAnalytic/LesHouches.in.CMSSMCPVSemiAnalytic @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/model_files/CMSSMEFTHiggs/LesHouches.in.CMSSMEFTHiggs b/model_files/CMSSMEFTHiggs/LesHouches.in.CMSSMEFTHiggs index cb4fcee1f1..79de62d921 100644 --- a/model_files/CMSSMEFTHiggs/LesHouches.in.CMSSMEFTHiggs +++ b/model_files/CMSSMEFTHiggs/LesHouches.in.CMSSMEFTHiggs @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -26,6 +26,7 @@ Block FlexibleSUSY 22 0 # EFT index of SM-like Higgs in the BSM model 23 0 # calculate BSM pole masses 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole diff --git a/model_files/CMSSMNoFV/FlexibleSUSY.m.in b/model_files/CMSSMNoFV/FlexibleSUSY.m.in index 30625adf92..e4a1e4c4a4 100644 --- a/model_files/CMSSMNoFV/FlexibleSUSY.m.in +++ b/model_files/CMSSMNoFV/FlexibleSUSY.m.in @@ -89,8 +89,8 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{0, FlexibleSUSYObservable`aMuon}, - {1, FlexibleSUSYObservable`aMuonUncertainty}, + {{0, FlexibleSUSYObservable`AMM[Fm]}, + {1, FlexibleSUSYObservable`AMMUncertainty[Fm]}, {2, FlexibleSUSYObservable`aMuonGM2Calc}, {3, FlexibleSUSYObservable`aMuonGM2CalcUncertainty} } }, {ALPHA, {{ArcSin[Pole[ZH[2,2]]]}}}, diff --git a/model_files/CMSSMNoFV/LesHouches.in.CMSSMNoFV b/model_files/CMSSMNoFV/LesHouches.in.CMSSMNoFV index 21fa4fc127..01a7d9268a 100644 --- a/model_files/CMSSMNoFV/LesHouches.in.CMSSMNoFV +++ b/model_files/CMSSMNoFV/LesHouches.in.CMSSMNoFV @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 1 # calculate observables (a_muon, ...) + 15 1 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole diff --git a/model_files/CMSSMNoFVHimalaya/FlexibleSUSY.m.in b/model_files/CMSSMNoFVHimalaya/FlexibleSUSY.m.in index e38dbbb22f..8397957bdf 100644 --- a/model_files/CMSSMNoFVHimalaya/FlexibleSUSY.m.in +++ b/model_files/CMSSMNoFVHimalaya/FlexibleSUSY.m.in @@ -92,8 +92,8 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{0, FlexibleSUSYObservable`aMuon}, - {1, FlexibleSUSYObservable`aMuonUncertainty}, + {{0, FlexibleSUSYObservable`AMM[Fm]}, + {1, FlexibleSUSYObservable`AMMUncertainty[Fm]}, {2, FlexibleSUSYObservable`aMuonGM2Calc}, {3, FlexibleSUSYObservable`aMuonGM2CalcUncertainty} } }, {ALPHA, {{ArcSin[Pole[ZH[2,2]]]}}}, diff --git a/model_files/CMSSMSemiAnalytic/FlexibleSUSY.m.in b/model_files/CMSSMSemiAnalytic/FlexibleSUSY.m.in index fa2477ab2e..f38631e464 100644 --- a/model_files/CMSSMSemiAnalytic/FlexibleSUSY.m.in +++ b/model_files/CMSSMSemiAnalytic/FlexibleSUSY.m.in @@ -118,7 +118,7 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon} } }, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]} } }, {EWSBOutputs, NoScale, {{1, BMu0}, {2, m0Sq} } }, diff --git a/model_files/CMSSMSemiAnalytic/LesHouches.in.CMSSMSemiAnalytic b/model_files/CMSSMSemiAnalytic/LesHouches.in.CMSSMSemiAnalytic index 0c795c3c8b..c58493412c 100644 --- a/model_files/CMSSMSemiAnalytic/LesHouches.in.CMSSMSemiAnalytic +++ b/model_files/CMSSMSemiAnalytic/LesHouches.in.CMSSMSemiAnalytic @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/model_files/CMSSMSemiAnalyticHimalaya/FlexibleSUSY.m.in b/model_files/CMSSMSemiAnalyticHimalaya/FlexibleSUSY.m.in index b3341c44da..751a5e5f2d 100644 --- a/model_files/CMSSMSemiAnalyticHimalaya/FlexibleSUSY.m.in +++ b/model_files/CMSSMSemiAnalyticHimalaya/FlexibleSUSY.m.in @@ -121,7 +121,7 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon} } }, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]} } }, {EWSBOutputs, NoScale, {{1, BMu0}, {2, m0Sq} } }, diff --git a/model_files/CMSSMSemiAnalyticHimalaya/LesHouches.in.CMSSMSemiAnalyticHimalaya b/model_files/CMSSMSemiAnalyticHimalaya/LesHouches.in.CMSSMSemiAnalyticHimalaya index dc2b599992..cc364a9ff4 100644 --- a/model_files/CMSSMSemiAnalyticHimalaya/LesHouches.in.CMSSMSemiAnalyticHimalaya +++ b/model_files/CMSSMSemiAnalyticHimalaya/LesHouches.in.CMSSMSemiAnalyticHimalaya @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole diff --git a/model_files/CNMSSM/FlexibleSUSY.m.in b/model_files/CNMSSM/FlexibleSUSY.m.in index 60647aca8c..e54ea22c1d 100644 --- a/model_files/CNMSSM/FlexibleSUSY.m.in +++ b/model_files/CNMSSM/FlexibleSUSY.m.in @@ -104,7 +104,7 @@ ExtraSLHAOutputBlocks = { {2, vS}, {3, m0Sq} } }, {FlexibleSUSYLowEnergy, - {{0, FlexibleSUSYObservable`aMuon} } }, + {{0, FlexibleSUSYObservable`AMM[Fe[2]]} } }, {NMSSMRUN, {{1, \[Lambda]}, {2, \[Kappa]}, diff --git a/model_files/CNMSSM/LesHouches.in.CNMSSM b/model_files/CNMSSM/LesHouches.in.CNMSSM index 0e4b328a26..15e31b2fac 100644 --- a/model_files/CNMSSM/LesHouches.in.CNMSSM +++ b/model_files/CNMSSM/LesHouches.in.CNMSSM @@ -15,9 +15,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/model_files/CSE6SSM/FlexibleSUSY.m.in b/model_files/CSE6SSM/FlexibleSUSY.m.in index d439458d23..ca2b4a3ce9 100644 --- a/model_files/CSE6SSM/FlexibleSUSY.m.in +++ b/model_files/CSE6SSM/FlexibleSUSY.m.in @@ -5,6 +5,8 @@ FSDefaultSARAHModel = SE6SSM; FSBVPSolvers = { SemiAnalyticSolver }; +FSEWSBSolvers = { GSLBroyden }; + (* CSE6SSM model definition, see arXiv:1512.07040 [hep-ph] *) @@ -161,7 +163,7 @@ ExtraSLHAOutputBlocks = { {4, \[Xi]F}, {5, LXiF0} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon}, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]}, {23, FlexibleSUSYObservable`EDM[Fe[1]]}, {24, FlexibleSUSYObservable`EDM[Fe[2]]}, {25, FlexibleSUSYObservable`EDM[Fe[3]]} diff --git a/model_files/CSE6SSM/LesHouches.in.CSE6SSM b/model_files/CSE6SSM/LesHouches.in.CSE6SSM index b02e2d36f5..3e27bf25de 100644 --- a/model_files/CSE6SSM/LesHouches.in.CSE6SSM +++ b/model_files/CSE6SSM/LesHouches.in.CSE6SSM @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/model_files/DiracGauginos/FlexibleSUSY.m.in b/model_files/DiracGauginos/FlexibleSUSY.m.in index 395a3485c0..2746ed8fde 100644 --- a/model_files/DiracGauginos/FlexibleSUSY.m.in +++ b/model_files/DiracGauginos/FlexibleSUSY.m.in @@ -122,11 +122,11 @@ ExtraSLHAOutputBlocks = { {{1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, { - {21, FlexibleSUSYObservable`aMuon}, + {21, FlexibleSUSYObservable`AMM[Fe[2]]}, {23, FlexibleSUSYObservable`EDM[Fe[1]]}, {24, FlexibleSUSYObservable`EDM[Fe[2]]}, {25, FlexibleSUSYObservable`EDM[Fe[3]]}, - {26, FlexibleSUSYObservable`BrLToLGamma[Fe[2] -> {Fe[1], VP}]} + {26, FlexibleSUSYObservable`BrLToLGamma[Fe, 2 -> 1]} } } }; diff --git a/model_files/DiracGauginos/LesHouches.in.DiracGauginos b/model_files/DiracGauginos/LesHouches.in.DiracGauginos index 855534ac68..b9ec57b294 100644 --- a/model_files/DiracGauginos/LesHouches.in.DiracGauginos +++ b/model_files/DiracGauginos/LesHouches.in.DiracGauginos @@ -15,9 +15,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -34,6 +34,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi @@ -65,7 +66,7 @@ Block SMINPUTS # Standard Model inputs # 6 0.000000000e+00 # alpha_2 Block MINPAR # Input parameters 1 1.5000000E+03 # mSUSY -3 2.0000000E+00 # TanBeta +3 2.0000000E+00 # TanBeta Block EXTPAR 1 2.0000000E+02 # MDBinput 2 5.0000000E+02 # MDWinput diff --git a/model_files/E6SSM/FlexibleSUSY.m.in b/model_files/E6SSM/FlexibleSUSY.m.in index 113623fa12..32e3aeea79 100644 --- a/model_files/E6SSM/FlexibleSUSY.m.in +++ b/model_files/E6SSM/FlexibleSUSY.m.in @@ -115,7 +115,7 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon} } }, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]} } }, {Au, {{1, 1, T[Yu][1,1] / Yu[1,1]}, {2, 2, T[Yu][2,2] / Yu[2,2]}, {3, 3, T[Yu][3,3] / Yu[3,3]} } }, diff --git a/model_files/E6SSM/LesHouches.in.E6SSM b/model_files/E6SSM/LesHouches.in.E6SSM index eeaa4173aa..d82eb54068 100644 --- a/model_files/E6SSM/LesHouches.in.E6SSM +++ b/model_files/E6SSM/LesHouches.in.E6SSM @@ -15,9 +15,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -34,6 +34,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/E6SSMEFTHiggs/FlexibleSUSY.m.in b/model_files/E6SSMEFTHiggs/FlexibleSUSY.m.in index aac9fd1dba..b32aaaf339 100644 --- a/model_files/E6SSMEFTHiggs/FlexibleSUSY.m.in +++ b/model_files/E6SSMEFTHiggs/FlexibleSUSY.m.in @@ -200,7 +200,7 @@ LowPoleMassPrecision = {}; ExtraSLHAOutputBlocks = { {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon} } } + {{21, FlexibleSUSYObservable`AMM[Fe[2]]} } } }; FSCalculateDecays = True; diff --git a/model_files/E6SSMEFTHiggs/LesHouches.in.E6SSMEFTHiggs b/model_files/E6SSMEFTHiggs/LesHouches.in.E6SSMEFTHiggs index 189b635459..2131da17a9 100644 --- a/model_files/E6SSMEFTHiggs/LesHouches.in.E6SSMEFTHiggs +++ b/model_files/E6SSMEFTHiggs/LesHouches.in.E6SSMEFTHiggs @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279440000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/FlavorAligned2HDM/FlexibleSUSY.m.in b/model_files/FlavorAligned2HDM/FlexibleSUSY.m.in index 06a350ca5b..65902a50c2 100644 --- a/model_files/FlavorAligned2HDM/FlexibleSUSY.m.in +++ b/model_files/FlavorAligned2HDM/FlexibleSUSY.m.in @@ -184,7 +184,7 @@ InitialGuessAtLowScale = { }; DefaultPoleMassPrecision = MediumPrecision; -HighPoleMassPrecision = {hh, Ah, Hpm}; +HighPoleMassPrecision = {hh, Hm}; MediumPoleMassPrecision = {}; LowPoleMassPrecision = {}; diff --git a/model_files/FlavorAligned2HDM/LesHouches.in.FlavorAligned2HDM b/model_files/FlavorAligned2HDM/LesHouches.in.FlavorAligned2HDM index 31685c6015..740c4432a8 100644 --- a/model_files/FlavorAligned2HDM/LesHouches.in.FlavorAligned2HDM +++ b/model_files/FlavorAligned2HDM/LesHouches.in.FlavorAligned2HDM @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 0 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 0 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole diff --git a/model_files/HGTHDMIIMSSMBC/FlexibleSUSY.m.in b/model_files/HGTHDMIIMSSMBC/FlexibleSUSY.m.in index d482b33377..37902024bb 100644 --- a/model_files/HGTHDMIIMSSMBC/FlexibleSUSY.m.in +++ b/model_files/HGTHDMIIMSSMBC/FlexibleSUSY.m.in @@ -17,12 +17,44 @@ EXTPAR = { {4, M2Input}, {5, M3Input}, {6, MAInput}, - {7, AtInput}, - {8, AbInput}, - {9, AtauInput}, {100, LambdaLoopOrder} }; +FSAuxiliaryParameterInfo = { + {AeInput, { LesHouches -> AeIN, + ParameterDimensions -> {3,3}, + InputParameter -> True + } }, + {AdInput, { LesHouches -> AdIN, + ParameterDimensions -> {3,3}, + InputParameter -> True + } }, + {AuInput, { LesHouches -> AuIN, + ParameterDimensions -> {3,3}, + InputParameter -> True + } }, + {mslInput, { LesHouches -> MSLIN, + ParameterDimensions -> {3}, + InputParameter -> True + } }, + {mseInput, { LesHouches -> MSEIN, + ParameterDimensions -> {3}, + InputParameter -> True + } }, + {msqInput, { LesHouches -> MSQIN, + ParameterDimensions -> {3}, + InputParameter -> True + } }, + {msdInput, { LesHouches -> MSDIN, + ParameterDimensions -> {3}, + InputParameter -> True + } }, + {msuInput, { LesHouches -> MSUIN, + ParameterDimensions -> {3}, + InputParameter -> True + } } +}; + EWSBOutputParameters = { M112, M222 }; (* The high scale where we match to the MSSM *) @@ -30,31 +62,72 @@ HighScale = MSUSY; HighScaleFirstGuess = MSUSY; +Needs["THDMThresholds1L`", FileNameJoin[{Directory[], "meta", "THDM", "Thresholds_1L_full.m"}]]; + +translate = { + gY -> GUTNormalization[g1] g1, + Tu[idx__] :> AuInput[idx] Yu[idx], + Td[idx__] :> AdInput[idx] Yd[idx], + Te[idx__] :> AeInput[idx] Ye[idx], + msl[idx__] :> mslInput[idx], + mse[idx__] :> mseInput[idx], + msq[idx__] :> msqInput[idx], + msu[idx__] :> msuInput[idx], + msd[idx__] :> msdInput[idx], + M1 -> MassB, + M2 -> MassWB, + Mu -> \[Mu], + Q -> SCALE, + Conjugate[p_] :> p, + B0[m1_,m2_,mu_] :> TCB0[m1,m2,mu], + DB0[m1_,m2_] :> TCDB0[m1,m2], + C0[m1_,m2_,m3_] :> TCC0[m1,m2,m3], + D0[m1_,m2_,m3_,m4_] :> TCD0[m1,m2,m3,m4], + D2tilde[m1_,m2_,m3_,m4_] :> TCD2t[m1,m2,m3,m4], + D4tilde[m1_,m2_,m3_,m4_,mu_] :> TCD4t[m1,m2,m3,m4,mu], + W[m1_,m2_,mu_] :> TCW[m1,m2,mu] +}; + +transposeYuks = { + Yu[i_,j_] :> Yu[j,i], + Yd[i_,j_] :> Yd[j,i], + Ye[i_,j_] :> Ye[j,i], + AuInput[i_,j_] :> AuInput[j,i], + AdInput[i_,j_] :> AdInput[j,i], + AeInput[i_,j_] :> AeInput[j,i] +}; + +(* flags to disable Higgsino + gaugino contributions *) +hgthmdFlags = Join[{flagIno -> 0}, GetTHDMThresholds1LFlags[]]; + +deltaLambda0L = GetTHDMThresholds1L[loopOrder -> {1,0}, flags -> hgthmdFlags] //. translate /. transposeYuks; +deltaLambda1L = GetTHDMThresholds1L[loopOrder -> {0,1}, flags -> hgthmdFlags] //. translate /. transposeYuks; + HighScaleInput = { {g1d , g2 }, {g1dp , GUTNormalization[g1] g1 (* gY *)}, {g2u , g2 }, {g2up , GUTNormalization[g1] g1 (* gY *)}, - {Lambda1, 1/2 (1/4 ( (GUTNormalization[g1] g1)^2 + g2^2) - + UnitStep[LambdaLoopOrder-1] (deltaLambda1th1L + deltaLambda1Phi1L) + {Lambda1, 1/2 (deltaLambda0L[[1]] + + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[1]] + UnitStep[LambdaLoopOrder-2] deltaLambda1th2L)}, - {Lambda2, 1/2 (1/4 ( (GUTNormalization[g1] g1)^2 + g2^2) - + UnitStep[LambdaLoopOrder-1] (deltaLambda2th1L + deltaLambda2Phi1L) + {Lambda2, 1/2 (deltaLambda0L[[2]] + + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[2]] + UnitStep[LambdaLoopOrder-2] deltaLambda2th2L)}, - {Lambda3, 1/4 (-(GUTNormalization[g1] g1)^2 + g2^2) - + UnitStep[LambdaLoopOrder-1] (deltaLambda3th1L + deltaLambda3Phi1L) + {Lambda3, deltaLambda0L[[3]] + + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[3]] + UnitStep[LambdaLoopOrder-2] deltaLambda3th2L}, - {Lambda4, -1/2 g2^2 - + UnitStep[LambdaLoopOrder-1] (deltaLambda4th1L + deltaLambda4Phi1L) + {Lambda4, deltaLambda0L[[4]] + + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[4]] + UnitStep[LambdaLoopOrder-2] deltaLambda4th2L}, - {Lambda5, 0 - + UnitStep[LambdaLoopOrder-1] (deltaLambda5th1L + deltaLambda5Phi1L) + {Lambda5, deltaLambda0L[[5]] + + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[5]] + UnitStep[LambdaLoopOrder-2] deltaLambda5th2L}, - {Lambda6, 0 - + UnitStep[LambdaLoopOrder-1] (deltaLambda6th1L + deltaLambda6Phi1L) + {Lambda6, deltaLambda0L[[6]] + + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[6]] + UnitStep[LambdaLoopOrder-2] deltaLambda6th2L}, - {Lambda7, 0 - + UnitStep[LambdaLoopOrder-1] (deltaLambda7th1L + deltaLambda7Phi1L) + {Lambda7, deltaLambda0L[[7]] + + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[7]] + UnitStep[LambdaLoopOrder-2] deltaLambda7th2L} }; @@ -102,233 +175,6 @@ HighPoleMassPrecision = {hh}; MediumPoleMassPrecision = {}; LowPoleMassPrecision = {}; -(* abbreviations *) -At = AtInput; -Ab = AbInput; -Atau = AtauInput; -Lambda1WagnerLee = 2 Lambda1; -Lambda2WagnerLee = 2 Lambda2; - -(* arxiv:1508.00576, Eq. (45) *) -deltaLambda1th1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - gY = GUTNormalization[g1] g1, - muMS = \[Mu] / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY - }, - ( - - kappa/2 ht^4 muMS^4 - + 6 kappa hb^4 AbMS^2 (1 - AbMS^2/12) - + 2 kappa htau^4 AtauMS^2 (1 - AtauMS^2/12) - + kappa (g2^2 + gY^2)/4 (3 ht^2 muMS^2 - 3 hb^2 AbMS^2 - htau^2 AtauMS^2) - ) -]; - -(* arxiv:1508.00576, Eq. (46) *) -deltaLambda2th1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - gY = GUTNormalization[g1] g1, - muMS = \[Mu] / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY, - AtMS = At / MSUSY - }, - ( - 6 kappa ht^4 AtMS^2 (1 - AtMS^2/12) - - kappa/2 hb^4 muMS^4 - - kappa/6 htau^4 muMS^4 - - kappa (g2^2 + gY^2)/4 (3 ht^2 AtMS^2 - 3 hb^2 muMS^2 - htau^2 muMS^2) - ) -]; - -(* arxiv:1508.00576, Eq. (47)-(48) *) -deltaLambda3th1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - gY = GUTNormalization[g1] g1, - muMS = \[Mu] / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY, - AtMS = At / MSUSY - }, - ( - kappa/6 muMS^2 (3 ht^4 (3 - AtMS^2) - + 3 hb^4 (3 - AbMS^2) - + htau^4 (3 - AtauMS^2)) - + kappa/2 ht^2 hb^2 (3 (AtMS + AbMS)^2 - - (muMS^2 - AtMS AbMS)^2 - - 6 muMS^2) - - kappa/2 (g2^2 - gY^2)/4 (3 ht^2 (AtMS^2 - muMS^2) - + 3 hb^2 (AbMS^2 - muMS^2) - + htau^2 (AtauMS^2 - muMS^2)) - ) -]; - -(* arxiv:1508.00576, Eq. (49) *) -deltaLambda4th1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - gY = GUTNormalization[g1] g1, - muMS = \[Mu] / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY, - AtMS = At / MSUSY - }, - ( - kappa/6 muMS^2 (3 ht^4 (3 - AtMS^2) - + 3 hb^4 (3 - AbMS^2) - + htau^4 (3 - AtauMS^2)) - - kappa/2 ht^2 hb^2 (3 (AtMS + AbMS)^2 - - (muMS^2 - AtMS AbMS)^2 - - 6 muMS^2) - + kappa/2 g2^2/2 (3 ht^2 (AtMS^2 - muMS^2) - + 3 hb^2 (AbMS^2 - muMS^2) - + htau^2 (AtauMS^2 - muMS^2)) - ) -]; - -(* arxiv:1508.00576, Eq. (50) *) -deltaLambda5th1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - muMS = \[Mu] / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY, - AtMS = At / MSUSY - }, - ( - - kappa/6 muMS^2 (3 ht^4 AtMS^2 + 3 hb^4 AbMS^2 + htau^4 AtauMS^2) - ) -]; - -(* arxiv:1508.00576, Eq. (51) *) -deltaLambda6th1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - muMS = \[Mu] / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY, - AtMS = At / MSUSY, - gbar = ((GUTNormalization[g1] g1)^2 + g2^2) / 4 - }, - ( - kappa/6 muMS (+ 3 ht^4 muMS^2 AtMS - + 3 hb^4 AbMS (AbMS^2 - 6) - + htau^4 AtauMS (AtauMS^2 - 6)) - (* arxiv:hep-ph/9307201, Eq. (6.13)-(6.14) *) - + gbar/2 kappa muMS (+ 3 AbMS hb^2 - - 3 AtMS ht^2 - + AtauMS htau^2) - ) -]; - -(* arxiv:1508.00576, Eq. (52) *) -deltaLambda7th1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - muMS = \[Mu] / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY, - AtMS = At / MSUSY, - gbar = ((GUTNormalization[g1] g1)^2 + g2^2) / 4 - }, - ( - kappa/6 muMS (+ 3 ht^4 AtMS (AtMS^2 - 6) - + 3 hb^4 muMS^2 AbMS - + htau^4 muMS^2 AtauMS) - (* arxiv:hep-ph/9307201, Eq. (6.13)-(6.14) *) - - gbar/2 kappa muMS (+ 3 AbMS hb^2 - - 3 AtMS ht^2 - + AtauMS htau^2) - ) -]; - -(* arxiv:1508.00576, Eq. (53) *) -deltaLambda1Phi1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - gY = GUTNormalization[g1] g1, - muMS = \[Mu] / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY - }, - ( - -kappa/6 (g2^2 + gY^2)/2 (3 ht^2 muMS^2 + 3hb^2 AbMS^2 + htau^2 AtauMS^2) - ) -]; - -(* arxiv:1508.00576, Eq. (54) *) -deltaLambda2Phi1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - gY = GUTNormalization[g1] g1, - muMS = \[Mu] / MSUSY, - AtMS = At / MSUSY - }, - ( - -kappa/6 (g2^2 + gY^2)/2 (3 ht^2 AtMS^2 + 3 hb^2 muMS^2 + htau^2 muMS^2) - ) -]; - -(* arxiv:1508.00576, Eq. (55) *) -deltaLambda3Phi1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - gY = GUTNormalization[g1] g1, - muMS = \[Mu] / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY, - AtMS = At / MSUSY - }, - ( - -kappa/6 (g2^2 - gY^2)/4 (3 ht^2 (AtMS^2 + muMS^2) + 3 hb^2 (AbMS^2 + muMS^2) + htau^2 (AtauMS^2 + muMS^2)) - ) -]; - -(* arxiv:1508.00576, Eq. (56) *) -deltaLambda4Phi1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - muMS = \[Mu] / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY, - AtMS = At / MSUSY - }, - ( - kappa/6 g2^2/2 (3 ht^2 (AtMS^2 + muMS^2) + 3 hb^2 (AbMS^2 + muMS^2) + htau^2 (AtauMS^2 + muMS^2)) - ) -]; - -(* arxiv:1508.00576, Eq. (57) *) -deltaLambda5Phi1L = 0; -deltaLambda6Phi1L = 0; (* wrong in arxiv:hep-ph/9307201, Eq. (6.17) *) -deltaLambda7Phi1L = 0; (* wrong in arxiv:hep-ph/9307201, Eq. (6.17) *) - (* arxiv:1508.00576, Eq. (59) *) deltaLambda1th2L = With[{ kappa = 1/(4 Pi)^2, @@ -345,7 +191,7 @@ deltaLambda2th2L = With[{ kappa = 1/(4 Pi)^2, ht = Yu[3,3], muMS = \[Mu] / MSUSY, - AtMS = At / MSUSY + AtMS = AuInput[3,3] / MSUSY }, ( 16 kappa^2 ht^4 g3^2 (-2 AtMS + 1/3 AtMS^3 - 1/12 AtMS^4) @@ -357,7 +203,7 @@ deltaLambda3th2L = With[{ kappa = 1/(4 Pi)^2, ht = Yu[3,3], muMS = \[Mu] / MSUSY, - AtMS = At / MSUSY + AtMS = AuInput[3,3] / MSUSY }, ( 2 kappa^2 ht^4 g3^2 AtMS muMS^2 (1 - 1/2 AtMS) @@ -372,7 +218,7 @@ deltaLambda6th2L = With[{ kappa = 1/(4 Pi)^2, ht = Yu[3,3], muMS = \[Mu] / MSUSY, - AtMS = At / MSUSY + AtMS = AuInput[3,3] / MSUSY }, ( 4/3 kappa^2 ht^4 g3^2 muMS^3 (-1 + AtMS) @@ -384,7 +230,7 @@ deltaLambda7th2L = With[{ kappa = 1/(4 Pi)^2, ht = Yu[3,3], muMS = \[Mu] / MSUSY, - AtMS = At / MSUSY + AtMS = AuInput[3,3] / MSUSY }, ( 4 kappa^2 ht^4 g3^2 muMS (2 - AtMS^2 + 1/3 AtMS^3) diff --git a/model_files/HGTHDMIIMSSMBC/LesHouches.in.HGTHDMIIMSSMBC b/model_files/HGTHDMIIMSSMBC/LesHouches.in.HGTHDMIIMSSMBC index 8426180374..38276865ed 100644 --- a/model_files/HGTHDMIIMSSMBC/LesHouches.in.HGTHDMIIMSSMBC +++ b/model_files/HGTHDMIIMSSMBC/LesHouches.in.HGTHDMIIMSSMBC @@ -14,25 +14,7 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O(alpha_t^2 + alpha_t alpha_b + alpha_b^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) - 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) - 16 0 # force positive majorana masses - 17 0 # pole mass renormalization scale (0 = SUSY scale) - 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) - 19 0 # EFT matching scale (0 = SUSY scale) - 20 2 # EFT loop order for upwards matching - 21 1 # EFT loop order for downwards matching - 22 0 # EFT index of SM-like Higgs in the BSM model - 23 1 # calculate BSM pole masses - 24 123111321 # individual threshold correction loop orders - 25 0 # ren. scheme for Higgs 3L corrections (0 = DR, 1 = MDR) - 26 1 # Higgs 3-loop corrections O(alpha_t alpha_s^2) - 27 1 # Higgs 3-loop corrections O(alpha_b alpha_s^2) - 28 1 # Higgs 3-loop corrections O(alpha_t^2 alpha_s) - 29 1 # Higgs 3-loop corrections O(alpha_t^3) - 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) - 31 0 # loop library (0 = softsusy) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) Block SMINPUTS # Standard Model inputs 1 1.279440000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi @@ -61,7 +43,36 @@ Block EXTPAR # Input parameters 4 200 # M2(MEWSB) 5 200 # M3(MEWSB) 6 200 # MA(MEWSB) - 7 0 # At(MSUSY) - 8 0 # Ab(MSUSY) - 9 0 # Atau(MSUSY) 100 2 # lambda BCs loop order +Block AuIN # Au(MSUSY) + 1 1 0 + 2 2 0 + 3 3 0 +Block AdIN # Ad(MSUSY) + 1 1 0 + 2 2 0 + 3 3 0 +Block AeIN # Ae(MSUSY) + 1 1 0 + 2 2 0 + 3 3 0 +Block MSLIN # msl(MSUSY) + 1 1e6 + 2 1e6 + 3 1e6 +Block MSEIN # mel(MSUSY) + 1 1e6 + 2 1e6 + 3 1e6 +Block MSQIN # mql(MSUSY) + 1 1e6 + 2 1e6 + 3 1e6 +Block MSUIN # mul(MSUSY) + 1 1e6 + 2 1e6 + 3 1e6 +Block MSDIN # mdl(MSUSY) + 1 1e6 + 2 1e6 + 3 1e6 diff --git a/model_files/HGTHDMIIMSSMBCFull/FlexibleSUSY.m.in b/model_files/HGTHDMIIMSSMBCFull/FlexibleSUSY.m.in deleted file mode 100644 index 37902024bb..0000000000 --- a/model_files/HGTHDMIIMSSMBCFull/FlexibleSUSY.m.in +++ /dev/null @@ -1,238 +0,0 @@ -FSModelName = "@CLASSNAME@"; -FSEigenstates = SARAH`EWSB; -AutomaticInputAtMSUSY = False; -FSDefaultSARAHModel = "HGTHDM-II"; - -(* input parameters *) - -MINPAR = { - {3, TanBeta} -}; - -EXTPAR = { - {0, MSUSY}, - {1, MEWSB}, - {2, MuInput}, - {3, M1Input}, - {4, M2Input}, - {5, M3Input}, - {6, MAInput}, - {100, LambdaLoopOrder} -}; - -FSAuxiliaryParameterInfo = { - {AeInput, { LesHouches -> AeIN, - ParameterDimensions -> {3,3}, - InputParameter -> True - } }, - {AdInput, { LesHouches -> AdIN, - ParameterDimensions -> {3,3}, - InputParameter -> True - } }, - {AuInput, { LesHouches -> AuIN, - ParameterDimensions -> {3,3}, - InputParameter -> True - } }, - {mslInput, { LesHouches -> MSLIN, - ParameterDimensions -> {3}, - InputParameter -> True - } }, - {mseInput, { LesHouches -> MSEIN, - ParameterDimensions -> {3}, - InputParameter -> True - } }, - {msqInput, { LesHouches -> MSQIN, - ParameterDimensions -> {3}, - InputParameter -> True - } }, - {msdInput, { LesHouches -> MSDIN, - ParameterDimensions -> {3}, - InputParameter -> True - } }, - {msuInput, { LesHouches -> MSUIN, - ParameterDimensions -> {3}, - InputParameter -> True - } } -}; - -EWSBOutputParameters = { M112, M222 }; - -(* The high scale where we match to the MSSM *) -HighScale = MSUSY; - -HighScaleFirstGuess = MSUSY; - -Needs["THDMThresholds1L`", FileNameJoin[{Directory[], "meta", "THDM", "Thresholds_1L_full.m"}]]; - -translate = { - gY -> GUTNormalization[g1] g1, - Tu[idx__] :> AuInput[idx] Yu[idx], - Td[idx__] :> AdInput[idx] Yd[idx], - Te[idx__] :> AeInput[idx] Ye[idx], - msl[idx__] :> mslInput[idx], - mse[idx__] :> mseInput[idx], - msq[idx__] :> msqInput[idx], - msu[idx__] :> msuInput[idx], - msd[idx__] :> msdInput[idx], - M1 -> MassB, - M2 -> MassWB, - Mu -> \[Mu], - Q -> SCALE, - Conjugate[p_] :> p, - B0[m1_,m2_,mu_] :> TCB0[m1,m2,mu], - DB0[m1_,m2_] :> TCDB0[m1,m2], - C0[m1_,m2_,m3_] :> TCC0[m1,m2,m3], - D0[m1_,m2_,m3_,m4_] :> TCD0[m1,m2,m3,m4], - D2tilde[m1_,m2_,m3_,m4_] :> TCD2t[m1,m2,m3,m4], - D4tilde[m1_,m2_,m3_,m4_,mu_] :> TCD4t[m1,m2,m3,m4,mu], - W[m1_,m2_,mu_] :> TCW[m1,m2,mu] -}; - -transposeYuks = { - Yu[i_,j_] :> Yu[j,i], - Yd[i_,j_] :> Yd[j,i], - Ye[i_,j_] :> Ye[j,i], - AuInput[i_,j_] :> AuInput[j,i], - AdInput[i_,j_] :> AdInput[j,i], - AeInput[i_,j_] :> AeInput[j,i] -}; - -(* flags to disable Higgsino + gaugino contributions *) -hgthmdFlags = Join[{flagIno -> 0}, GetTHDMThresholds1LFlags[]]; - -deltaLambda0L = GetTHDMThresholds1L[loopOrder -> {1,0}, flags -> hgthmdFlags] //. translate /. transposeYuks; -deltaLambda1L = GetTHDMThresholds1L[loopOrder -> {0,1}, flags -> hgthmdFlags] //. translate /. transposeYuks; - -HighScaleInput = { - {g1d , g2 }, - {g1dp , GUTNormalization[g1] g1 (* gY *)}, - {g2u , g2 }, - {g2up , GUTNormalization[g1] g1 (* gY *)}, - {Lambda1, 1/2 (deltaLambda0L[[1]] - + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[1]] - + UnitStep[LambdaLoopOrder-2] deltaLambda1th2L)}, - {Lambda2, 1/2 (deltaLambda0L[[2]] - + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[2]] - + UnitStep[LambdaLoopOrder-2] deltaLambda2th2L)}, - {Lambda3, deltaLambda0L[[3]] - + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[3]] - + UnitStep[LambdaLoopOrder-2] deltaLambda3th2L}, - {Lambda4, deltaLambda0L[[4]] - + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[4]] - + UnitStep[LambdaLoopOrder-2] deltaLambda4th2L}, - {Lambda5, deltaLambda0L[[5]] - + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[5]] - + UnitStep[LambdaLoopOrder-2] deltaLambda5th2L}, - {Lambda6, deltaLambda0L[[6]] - + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[6]] - + UnitStep[LambdaLoopOrder-2] deltaLambda6th2L}, - {Lambda7, deltaLambda0L[[7]] - + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[7]] - + UnitStep[LambdaLoopOrder-2] deltaLambda7th2L} -}; - -(* The scale where we impose the EWSB conditions - and calculate the spectrum *) -SUSYScale = MEWSB; - -SUSYScaleFirstGuess = MEWSB; - -SUSYScaleInput = { - {\[Mu] , MuInput }, - {MassB , M1Input }, - {MassWB , M2Input }, - {MassG , M3Input }, - {M122 , MAInput^2 Sin[ArcTan[v2/v1]] Cos[ArcTan[v2/v1]]} -}; - -LowScale = LowEnergyConstant[MT]; - -LowScaleFirstGuess = LowEnergyConstant[MT]; - -LowScaleInput = { - {Yu, Automatic}, - {Yd, Automatic}, - {Ye, Automatic}, - {v1, 2 MZMSbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Cos[ArcTan[TanBeta]]}, - {v2, 2 MZMSbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Sin[ArcTan[TanBeta]]} -}; - -InitialGuessAtLowScale = { - {v1, LowEnergyConstant[vev] Cos[ArcTan[TanBeta]]}, - {v2, LowEnergyConstant[vev] Sin[ArcTan[TanBeta]]}, - {Yu, Automatic}, - {Yd, Automatic}, - {Ye, Automatic}, - {\[Mu] , MuInput }, - {MassB , M1Input }, - {MassWB , M2Input }, - {MassG , M3Input }, - {M122 , MAInput^2 Sin[ArcTan[TanBeta]] Cos[ArcTan[TanBeta]]} -}; - -DefaultPoleMassPrecision = MediumPrecision; -HighPoleMassPrecision = {hh}; -MediumPoleMassPrecision = {}; -LowPoleMassPrecision = {}; - -(* arxiv:1508.00576, Eq. (59) *) -deltaLambda1th2L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - muMS = \[Mu] / MSUSY - }, - ( - -4/3 kappa^2 ht^4 g3^2 muMS^4 - ) -]; - -(* arxiv:1508.00576, Eq. (60) *) -deltaLambda2th2L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - muMS = \[Mu] / MSUSY, - AtMS = AuInput[3,3] / MSUSY - }, - ( - 16 kappa^2 ht^4 g3^2 (-2 AtMS + 1/3 AtMS^3 - 1/12 AtMS^4) - ) -]; - -(* arxiv:1508.00576, Eq. (61) *) -deltaLambda3th2L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - muMS = \[Mu] / MSUSY, - AtMS = AuInput[3,3] / MSUSY - }, - ( - 2 kappa^2 ht^4 g3^2 AtMS muMS^2 (1 - 1/2 AtMS) - ) -]; - -deltaLambda4th2L = deltaLambda3th2L; -deltaLambda5th2L = 0; - -(* arxiv:1508.00576, Eq. (62) *) -deltaLambda6th2L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - muMS = \[Mu] / MSUSY, - AtMS = AuInput[3,3] / MSUSY - }, - ( - 4/3 kappa^2 ht^4 g3^2 muMS^3 (-1 + AtMS) - ) -]; - -(* arxiv:1508.00576, Eq. (63) *) -deltaLambda7th2L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - muMS = \[Mu] / MSUSY, - AtMS = AuInput[3,3] / MSUSY - }, - ( - 4 kappa^2 ht^4 g3^2 muMS (2 - AtMS^2 + 1/3 AtMS^3) - ) -]; diff --git a/model_files/HSSUSY/LesHouches.in.HSSUSY b/model_files/HSSUSY/LesHouches.in.HSSUSY index b8ce5ebe92..b55d50f76f 100644 --- a/model_files/HSSUSY/LesHouches.in.HSSUSY +++ b/model_files/HSSUSY/LesHouches.in.HSSUSY @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O(alpha_t^2 + alpha_t alpha_b + alpha_b^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 3 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 3 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole diff --git a/model_files/HTHDMIIMSSMBC/LesHouches.in.HTHDMIIMSSMBC b/model_files/HTHDMIIMSSMBC/LesHouches.in.HTHDMIIMSSMBC index d06b81e55d..8ebbe6dce8 100644 --- a/model_files/HTHDMIIMSSMBC/LesHouches.in.HTHDMIIMSSMBC +++ b/model_files/HTHDMIIMSSMBC/LesHouches.in.HTHDMIIMSSMBC @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O(alpha_t^2 + alpha_t alpha_b + alpha_b^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279440000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/LRLR/FlexibleSUSY.m.in b/model_files/LRLR/FlexibleSUSY.m.in index 9d7d7c6acd..b4ac10c7b9 100644 --- a/model_files/LRLR/FlexibleSUSY.m.in +++ b/model_files/LRLR/FlexibleSUSY.m.in @@ -199,3 +199,4 @@ ExtraSLHAOutputBlocks = { }; FSCalculateDecays = True; +FSUnitarityConstraints = False; diff --git a/model_files/LRLR/LesHouches.in.LRLR b/model_files/LRLR/LesHouches.in.LRLR index a4aedf3bff..eb39298566 100644 --- a/model_files/LRLR/LesHouches.in.LRLR +++ b/model_files/LRLR/LesHouches.in.LRLR @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top quark 2-loop corrections QCD + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/LeptoSplitMSSM/FlexibleSUSY.m.in b/model_files/LeptoSplitMSSM/FlexibleSUSY.m.in index e895e34da0..dea6d9ac11 100644 --- a/model_files/LeptoSplitMSSM/FlexibleSUSY.m.in +++ b/model_files/LeptoSplitMSSM/FlexibleSUSY.m.in @@ -202,8 +202,8 @@ UseHiggs4LoopSM = True; ExtraSLHAOutputBlocks = { {FlexibleSUSYLowEnergy, - {{1, FlexibleSUSYObservable`aMuon}, - {2, FlexibleSUSYObservable`aMuonUncertainty} } } + {{1, FlexibleSUSYObservable`AMM[Fe[2]]}, + {2, FlexibleSUSYObservable`AMMUncertainty[Fe[2]]} } } }; diff --git a/model_files/LeptoSplitMSSM/LesHouches.in.LeptoSplitMSSM b/model_files/LeptoSplitMSSM/LesHouches.in.LeptoSplitMSSM index 553af508c7..942745220c 100644 --- a/model_files/LeptoSplitMSSM/LesHouches.in.LeptoSplitMSSM +++ b/model_files/LeptoSplitMSSM/LesHouches.in.LeptoSplitMSSM @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O(alpha_t^2 + alpha_t alpha_b + alpha_b^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 1 # calculate observables (a_muon, ...) + 15 1 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279440000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/MDM/LesHouches.in.MDM b/model_files/MDM/LesHouches.in.MDM index b43cd002ac..ea8aa203ac 100644 --- a/model_files/MDM/LesHouches.in.MDM +++ b/model_files/MDM/LesHouches.in.MDM @@ -14,7 +14,7 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 0 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) diff --git a/model_files/MRSSM/LesHouches.in.MRSSM b/model_files/MRSSM/LesHouches.in.MRSSM index 8209dfa2be..0e59196370 100644 --- a/model_files/MRSSM/LesHouches.in.MRSSM +++ b/model_files/MRSSM/LesHouches.in.MRSSM @@ -26,9 +26,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 1 # calculate observables (a_muon, ...) + 15 1 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -45,6 +45,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SPhenoInput # SPheno specific input 1 -1 # error level 2 1 # SPA conventions diff --git a/model_files/MRSSM2/FlexibleSUSY.m.in b/model_files/MRSSM2/FlexibleSUSY.m.in index d956f7c262..f8de8feab5 100644 --- a/model_files/MRSSM2/FlexibleSUSY.m.in +++ b/model_files/MRSSM2/FlexibleSUSY.m.in @@ -89,19 +89,43 @@ InitialGuessAtLowScale = { ExtraSLHAOutputBlocks = { {FlexibleSUSYLowEnergy, { - {21, FlexibleSUSYObservable`aMuon}, + {20, FlexibleSUSYObservable`AMM[Fe[1]]}, + {21, FlexibleSUSYObservable`AMM[Fe[2]]}, + {22, FlexibleSUSYObservable`AMM[Fe[3]]}, {23, FlexibleSUSYObservable`EDM[Fe[1]]}, {24, FlexibleSUSYObservable`EDM[Fe[2]]}, {25, FlexibleSUSYObservable`EDM[Fe[3]]}, - {26, FlexibleSUSYObservable`BrLToLGamma[Fe[2] -> {Fe[1], VP}]} + {26, FlexibleSUSYObservable`BrLToLGamma[Fe, 2 -> 1]}, + {31, FlexibleSUSYObservable`BrLTo3L[Fe, 2 -> {1, 1, 1}, All, 1]}, + {41, FlexibleSUSYObservable`LToLConversion[Fe, 2 -> 1, Al, All, 1]}, + {27, FlexibleSUSYObservable`AMMUncertainty[Fe[2]]} + } + }, + {HMIX, { + {1, \[Mu]}, + {10, ArcTan[vu/vd]}, + {101, B[\[Mu]]}, + {102, vd}, + {103, vu}, + {310, vT}, + {201, MuD}, + {202, MuU}, + {203, B[MuD]}, + {204, B[MuU]}, + {301, LamSD}, + {302, LamSU}, + {303, LamTD}, + {304, LamTU} } } }; FSCalculateDecays = True; -FSDecayParticles = {hh, Ah, Hpm}; +FSDecayParticles = {hh, Ah, Hpm, sigmaO, phiO, Su}; + +PotentialLSPParticles = {Chi, Su, Sd, Se, Cha1, Cha2}; -DefaultPoleMassPrecision = HighPrecision; +DefaultPoleMassPrecision = MediumPrecision; HighPoleMassPrecision = {hh, Ah, Hpm}; MediumPoleMassPrecision = {}; LowPoleMassPrecision = {}; diff --git a/model_files/MRSSM2/LesHouches.in.MRSSM2 b/model_files/MRSSM2/LesHouches.in.MRSSM2 index 6bf195ec69..6857239573 100644 --- a/model_files/MRSSM2/LesHouches.in.MRSSM2 +++ b/model_files/MRSSM2/LesHouches.in.MRSSM2 @@ -15,9 +15,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 1 # calculate observables (a_muon, ...) + 15 1 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -34,6 +34,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole @@ -142,6 +143,11 @@ Block MSOFTIN Block FlexibleDecay 0 1 # calculate decays (0 = no, 1 = yes) 1 1e-5 # minimum BR to print - 2 4 # include higher order corrections in decays (0 = LO, 1 = NLO, 2 = NNLO, 3 = N^3LO, 4 = N^4LO ) + 2 41 # include higher order corrections in decays SM|BSM (0 = LO, 1 = NLO, 2 = NNLO, 3 = N^3LO, 4 = N^4LO) 3 1 # use Thomson alpha(0) instead of alpha(m) in decays to γγ and γZ 4 2 # off-shell decays into VV pair + 5 1 # print loop-induced Higgs couplings + 6 0 # calculate Higgs effc normalized to SM + 7 0 # call HiggsTools + 8 0 # call Lilith + 9 1 # use pole Higgs mixings in decays diff --git a/model_files/MRSSM2CKM/FlexibleSUSY.m.in b/model_files/MRSSM2CKM/FlexibleSUSY.m.in index eb960e9b57..3c01128dbb 100644 --- a/model_files/MRSSM2CKM/FlexibleSUSY.m.in +++ b/model_files/MRSSM2CKM/FlexibleSUSY.m.in @@ -89,11 +89,11 @@ InitialGuessAtLowScale = { ExtraSLHAOutputBlocks = { {FlexibleSUSYLowEnergy, { - {21, FlexibleSUSYObservable`aMuon}, + {21, FlexibleSUSYObservable`AMM[Fe[2]]}, {23, FlexibleSUSYObservable`EDM[Fe[1]]}, {24, FlexibleSUSYObservable`EDM[Fe[2]]}, {25, FlexibleSUSYObservable`EDM[Fe[3]]}, - {26, FlexibleSUSYObservable`BrLToLGamma[Fe[2] -> {Fe[1], VP}]}, + {26, FlexibleSUSYObservable`BrLToLGamma[Fe, 2 -> 1]}, {27, FlexibleSUSYObservable`bsgamma} } } diff --git a/model_files/MRSSM2CKM/LesHouches.in.MRSSM2CKM b/model_files/MRSSM2CKM/LesHouches.in.MRSSM2CKM index 8ffc6cb744..7ace37626b 100644 --- a/model_files/MRSSM2CKM/LesHouches.in.MRSSM2CKM +++ b/model_files/MRSSM2CKM/LesHouches.in.MRSSM2CKM @@ -15,9 +15,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 1 # calculate observables (a_muon, ...) + 15 1 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -34,6 +34,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole @@ -60,13 +61,6 @@ Block VCKMIN # CKM matrix input (Wolfenstein parameters) 2 8.180000000e-01 # A(MZ) SM DR-bar 3 2.210000000e-01 # rhobar(MZ) SM DR-bar 4 3.400000000e-01 # etabar(MZ) SM DR-bar -# Block UPMNSIN # PMNS matrix input -# 1 5.837630000e-01 # theta_12 -# 2 7.695840000e-01 # theta_23 -# 3 1.549480000e-01 # theta_13 -# 4 0.000000000e+00 # delta -# 5 0.000000000e+00 # alpha_1 -# 6 0.000000000e+00 # alpha_2 Block MINPAR 3 5 # TanBeta Block EXTPAR diff --git a/model_files/MRSSMEFTHiggs/FlexibleSUSY.m.in b/model_files/MRSSMEFTHiggs/FlexibleSUSY.m.in index ea581ac61c..ae05cb1a10 100644 --- a/model_files/MRSSMEFTHiggs/FlexibleSUSY.m.in +++ b/model_files/MRSSMEFTHiggs/FlexibleSUSY.m.in @@ -105,7 +105,7 @@ LowPoleMassPrecision = {}; ExtraSLHAOutputBlocks = { {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon} } } + {{21, FlexibleSUSYObservable`AMM[Fe[2]]} } } }; FSCalculateDecays = True; diff --git a/model_files/MRSSMEFTHiggs/LesHouches.in.MRSSMEFTHiggs b/model_files/MRSSMEFTHiggs/LesHouches.in.MRSSMEFTHiggs index 4bf4dcb03f..124cd6046c 100644 --- a/model_files/MRSSMEFTHiggs/LesHouches.in.MRSSMEFTHiggs +++ b/model_files/MRSSMEFTHiggs/LesHouches.in.MRSSMEFTHiggs @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole diff --git a/model_files/MSSM/FlexibleSUSY.m.in b/model_files/MSSM/FlexibleSUSY.m.in index 552b84d95f..17e708bde1 100644 --- a/model_files/MSSM/FlexibleSUSY.m.in +++ b/model_files/MSSM/FlexibleSUSY.m.in @@ -139,11 +139,15 @@ ExtraSLHAOutputBlocks = { {48, SignedAbsSqrt[md2[2,2]]}, {49, SignedAbsSqrt[md2[3,3]]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon}, + {{20, FlexibleSUSYObservable`AMM[Fe[1]]}, + {21, FlexibleSUSYObservable`AMM[Fe[2]]}, + {22, FlexibleSUSYObservable`AMM[Fe[3]]}, {23, FlexibleSUSYObservable`EDM[Fe[1]]}, {24, FlexibleSUSYObservable`EDM[Fe[2]]}, {25, FlexibleSUSYObservable`EDM[Fe[3]]}, - {26, FlexibleSUSYObservable`BrLToLGamma[Fe[2] -> {Fe[1], VP}]} + {26, FlexibleSUSYObservable`BrLToLGamma[Fe, 2 -> 1]}, + {31, FlexibleSUSYObservable`BrLTo3L[Fe, 2 -> {1, 1, 1}, All, 1]}, + {41, FlexibleSUSYObservable`LToLConversion[Fe, 2 -> 1, Al, All, 1]} } } }; diff --git a/model_files/MSSM/LesHouches.in.MSSM b/model_files/MSSM/LesHouches.in.MSSM index c39f8769de..0c77deabf5 100644 --- a/model_files/MSSM/LesHouches.in.MSSM +++ b/model_files/MSSM/LesHouches.in.MSSM @@ -15,9 +15,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -34,6 +34,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi @@ -139,6 +140,6 @@ Block MSOFTIN Block FlexibleDecay 0 1 # calculate decays (0 = no, 1 = yes) 1 1e-5 # minimum BR to print - 2 1 # include higher order corrections in decays (0 = LO, 1 = NLO, 2 = NNLO, 3 = NNNLO) + 2 41 # include higher order corrections in decays SM|BSM (0 = LO, 1 = NLO, 2 = NNLO, 3 = N^3LO, 4 = N^4LO) 3 1 # use Thomson alpha(0) instead of alpha(m) in decays to γγ and γZ 4 2 # off-shell decays into VV pair diff --git a/model_files/MSSMCPV/FlexibleSUSY.m.in b/model_files/MSSMCPV/FlexibleSUSY.m.in index d36d2ed85d..0d0b177b1c 100644 --- a/model_files/MSSMCPV/FlexibleSUSY.m.in +++ b/model_files/MSSMCPV/FlexibleSUSY.m.in @@ -120,17 +120,19 @@ InitialGuessAtLowScale = { {Ye, Automatic} }; +PotentialLSPParticles = {Chi, Sv, Su, Sd, Se, Cha, Glu}; + ExtraSLHAOutputBlocks = { {FlexibleSUSYOutput, NoScale, {{0, Hold[HighScale]}, {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon}, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]}, {23, FlexibleSUSYObservable`EDM[Fe[1]]}, {24, FlexibleSUSYObservable`EDM[Fe[2]]}, {25, FlexibleSUSYObservable`EDM[Fe[3]]}, - {26, FlexibleSUSYObservable`BrLToLGamma[Fe[2] -> {Fe[1], VP}]} + {26, FlexibleSUSYObservable`BrLToLGamma[Fe, 2 -> 1]} } }, {ALPHA, NoScale, diff --git a/model_files/MSSMCPV/LesHouches.in.MSSMCPV b/model_files/MSSMCPV/LesHouches.in.MSSMCPV index 9546ed332d..f7686a511e 100644 --- a/model_files/MSSMCPV/LesHouches.in.MSSMCPV +++ b/model_files/MSSMCPV/LesHouches.in.MSSMCPV @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi @@ -112,6 +113,6 @@ Block IMAEIN Block FlexibleDecay 0 1 # calculate decays (0 = no, 1 = yes) 1 1e-5 # min br. to print - 2 4 # include higher order corrections in decays (0 = LO, 1 = NLO, 2 = NNLO, 3 = N^3LO, 4 = N^4LO ) + 2 41 # include higher order corrections in decays SM|BSM (0 = LO, 1 = NLO, 2 = NNLO, 3 = N^3LO, 4 = N^4LO) 3 1 # use Thomson alpha instead of alpha(m) in decays to gamgam and gamZ 4 2 # off-shell decays into VV pair diff --git a/model_files/MSSMEFTHiggs/FlexibleSUSY.m.in b/model_files/MSSMEFTHiggs/FlexibleSUSY.m.in index 1dee564773..bf89202d33 100644 --- a/model_files/MSSMEFTHiggs/FlexibleSUSY.m.in +++ b/model_files/MSSMEFTHiggs/FlexibleSUSY.m.in @@ -152,7 +152,7 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon} } }, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]} } }, {ALPHA, {{ArcSin[Pole[ZH[2,2]]]}}}, {HMIX , {{1, \[Mu]}, {2, vu / vd}, diff --git a/model_files/MSSMEFTHiggs/LesHouches.in.MSSMEFTHiggs b/model_files/MSSMEFTHiggs/LesHouches.in.MSSMEFTHiggs index 01c3567439..e165298cf3 100644 --- a/model_files/MSSMEFTHiggs/LesHouches.in.MSSMEFTHiggs +++ b/model_files/MSSMEFTHiggs/LesHouches.in.MSSMEFTHiggs @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279440000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/MSSMMuBMu/FlexibleSUSY.m.in b/model_files/MSSMMuBMu/FlexibleSUSY.m.in index 7c00fabfac..ad23ec561d 100644 --- a/model_files/MSSMMuBMu/FlexibleSUSY.m.in +++ b/model_files/MSSMMuBMu/FlexibleSUSY.m.in @@ -3,10 +3,6 @@ FSEigenstates = SARAH`EWSB; FSDefaultSARAHModel = MSSM; OnlyLowEnergyFlexibleSUSY = True; -MINPAR = { - {4, Sign[\[Mu]]} -}; - EXTPAR = { {0, MSUSY}, {1, M1Input}, diff --git a/model_files/MSSMMuBMu/LesHouches.in.MSSMMuBMu b/model_files/MSSMMuBMu/LesHouches.in.MSSMMuBMu index 720eb49af0..bf77e3d055 100644 --- a/model_files/MSSMMuBMu/LesHouches.in.MSSMMuBMu +++ b/model_files/MSSMMuBMu/LesHouches.in.MSSMMuBMu @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top quark 2-loop corrections QCD + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279440000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi @@ -51,8 +52,6 @@ Block SMINPUTS # Standard Model inputs 22 2.400000000e-03 # mu(2 GeV) MS-bar 23 1.040000000e-01 # ms(2 GeV) MS-bar 24 1.270000000e+00 # mc(mc) MS-bar -Block MINPAR # Input parameters - 4 1 # SignMu Block EXTPAR 0 2000 # Ms 1 2000 # M1(MSUSY) diff --git a/model_files/MSSMNoFV/FlexibleSUSY.m.in b/model_files/MSSMNoFV/FlexibleSUSY.m.in index 857f612480..7fa97ac36b 100644 --- a/model_files/MSSMNoFV/FlexibleSUSY.m.in +++ b/model_files/MSSMNoFV/FlexibleSUSY.m.in @@ -120,7 +120,8 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, NoScale, - {{0, FlexibleSUSYObservable`aMuon}, + {{3, FlexibleSUSYObservable`AMM[Fe]}, + {0, FlexibleSUSYObservable`AMM[Fm]}, {1, FlexibleSUSYObservable`aMuonGM2Calc}, {2, FlexibleSUSYObservable`aMuonGM2CalcUncertainty} } }, {ALPHA, NoScale, diff --git a/model_files/MSSMNoFV/LesHouches.in.MSSMNoFV b/model_files/MSSMNoFV/LesHouches.in.MSSMNoFV index 3d6806c4e4..38c9b85100 100644 --- a/model_files/MSSMNoFV/LesHouches.in.MSSMNoFV +++ b/model_files/MSSMNoFV/LesHouches.in.MSSMNoFV @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279440000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166370000e-05 # G_Fermi diff --git a/model_files/MSSMNoFVEFTHiggs/FlexibleSUSY.m.in b/model_files/MSSMNoFVEFTHiggs/FlexibleSUSY.m.in index f5b241191e..aa53ab0755 100644 --- a/model_files/MSSMNoFVEFTHiggs/FlexibleSUSY.m.in +++ b/model_files/MSSMNoFVEFTHiggs/FlexibleSUSY.m.in @@ -132,7 +132,8 @@ ExtraSLHAOutputBlocks = { {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, NoScale, {{1, FlexibleSUSYObservable`aMuonGM2Calc}, - {2, FlexibleSUSYObservable`aMuonGM2CalcUncertainty} } }, + {2, FlexibleSUSYObservable`aMuonGM2CalcUncertainty}, + {21, FlexibleSUSYObservable`AMM[Fm]} } }, {ALPHA, NoScale, {{ArcSin[Pole[ZH[2,2]]]}}}, {HMIX , {{1, \[Mu]}, diff --git a/model_files/MSSMNoFVEFTHiggs/LesHouches.in.MSSMNoFVEFTHiggs b/model_files/MSSMNoFVEFTHiggs/LesHouches.in.MSSMNoFVEFTHiggs index 208e4024ba..76d9fe065a 100644 --- a/model_files/MSSMNoFVEFTHiggs/LesHouches.in.MSSMNoFVEFTHiggs +++ b/model_files/MSSMNoFVEFTHiggs/LesHouches.in.MSSMNoFVEFTHiggs @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/model_files/MSSMNoFVHimalaya/FlexibleSUSY.m.in b/model_files/MSSMNoFVHimalaya/FlexibleSUSY.m.in index 02e28b70ea..ec7813f765 100644 --- a/model_files/MSSMNoFVHimalaya/FlexibleSUSY.m.in +++ b/model_files/MSSMNoFVHimalaya/FlexibleSUSY.m.in @@ -121,7 +121,7 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, NoScale, - {{0, FlexibleSUSYObservable`aMuon}, + {{0, FlexibleSUSYObservable`AMM[Fm]}, {1, FlexibleSUSYObservable`aMuonGM2Calc}, {2, FlexibleSUSYObservable`aMuonGM2CalcUncertainty} } }, {ALPHA, {{ArcSin[Pole[ZH[2,2]]]}}}, diff --git a/model_files/MSSMNoFVHimalaya/LesHouches.in.MSSMNoFVHimalaya b/model_files/MSSMNoFVHimalaya/LesHouches.in.MSSMNoFVHimalaya index 42b8877a16..b6a357e88f 100644 --- a/model_files/MSSMNoFVHimalaya/LesHouches.in.MSSMNoFVHimalaya +++ b/model_files/MSSMNoFVHimalaya/LesHouches.in.MSSMNoFVHimalaya @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279440000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166370000e-05 # G_Fermi diff --git a/model_files/MSSMNoFVatMGUT/LesHouches.in.MSSMNoFVatMGUT b/model_files/MSSMNoFVatMGUT/LesHouches.in.MSSMNoFVatMGUT index fe4f2b0624..6d2acc288d 100644 --- a/model_files/MSSMNoFVatMGUT/LesHouches.in.MSSMNoFVatMGUT +++ b/model_files/MSSMNoFVatMGUT/LesHouches.in.MSSMNoFVatMGUT @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/MSSMNoFVatMGUTHimalaya/FlexibleSUSY.m.in b/model_files/MSSMNoFVatMGUTHimalaya/FlexibleSUSY.m.in index a6aa1f9087..57da22dd75 100644 --- a/model_files/MSSMNoFVatMGUTHimalaya/FlexibleSUSY.m.in +++ b/model_files/MSSMNoFVatMGUTHimalaya/FlexibleSUSY.m.in @@ -120,7 +120,7 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, NoScale, - {{0, FlexibleSUSYObservable`aMuon}, + {{0, FlexibleSUSYObservable`AMM[Fm]}, {1, FlexibleSUSYObservable`aMuonGM2Calc}, {2, FlexibleSUSYObservable`aMuonGM2CalcUncertainty} } }, {ALPHA, {{ArcSin[Pole[ZH[2,2]]]}}}, diff --git a/model_files/MSSMNoFVatMGUTHimalaya/LesHouches.in.MSSMNoFVatMGUTHimalaya b/model_files/MSSMNoFVatMGUTHimalaya/LesHouches.in.MSSMNoFVatMGUTHimalaya index 5aae41a8ef..cdc47f7c62 100644 --- a/model_files/MSSMNoFVatMGUTHimalaya/LesHouches.in.MSSMNoFVatMGUTHimalaya +++ b/model_files/MSSMNoFVatMGUTHimalaya/LesHouches.in.MSSMNoFVatMGUTHimalaya @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166370000e-05 # G_Fermi @@ -50,7 +51,7 @@ Block SMINPUTS # Standard Model inputs 22 2.400000000e-03 # mu(2 GeV) MS-bar 23 1.040000000e-01 # ms(2 GeV) MS-bar 24 1.270000000e+00 # mc(mc) MS-bar -Block MINPAR # Input parameters +Block MINPAR # Input parameters 3 10. # TanBeta 4 1 # SignMu Block EXTPAR @@ -73,13 +74,13 @@ Block EXTPAR 33 125.0 34 125.0 35 125.0 - 36 125.0 - 41 125.0 + 36 125.0 + 41 125.0 42 125.0 43 125.0 44 125.0 45 125.0 - 46 125.0 + 46 125.0 47 125.0 48 125.0 49 125.0 diff --git a/model_files/MSSMRHN/FlexibleSUSY.m.in b/model_files/MSSMRHN/FlexibleSUSY.m.in index f1deed43af..4ad2164b20 100644 --- a/model_files/MSSMRHN/FlexibleSUSY.m.in +++ b/model_files/MSSMRHN/FlexibleSUSY.m.in @@ -74,3 +74,4 @@ MediumPoleMassPrecision = {}; LowPoleMassPrecision = {}; FSCalculateDecays = True; + diff --git a/model_files/MSSMRHN/LesHouches.in.MSSMRHN b/model_files/MSSMRHN/LesHouches.in.MSSMRHN index 78fdda56fc..a7a287e438 100644 --- a/model_files/MSSMRHN/LesHouches.in.MSSMRHN +++ b/model_files/MSSMRHN/LesHouches.in.MSSMRHN @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 3 # Top quark 2-loop corrections QCD + 13 3 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -36,6 +36,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole diff --git a/model_files/MSSMatMGUT/LesHouches.in.MSSMatMGUT b/model_files/MSSMatMGUT/LesHouches.in.MSSMatMGUT index 3b0683fa4e..1f50b7303f 100644 --- a/model_files/MSSMatMGUT/LesHouches.in.MSSMatMGUT +++ b/model_files/MSSMatMGUT/LesHouches.in.MSSMatMGUT @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/NMSSM/FlexibleSUSY.m.in b/model_files/NMSSM/FlexibleSUSY.m.in index 0868f45636..25acc5f21d 100644 --- a/model_files/NMSSM/FlexibleSUSY.m.in +++ b/model_files/NMSSM/FlexibleSUSY.m.in @@ -88,11 +88,11 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon}, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]}, {23, FlexibleSUSYObservable`EDM[Fe[1]]}, {24, FlexibleSUSYObservable`EDM[Fe[2]]}, {25, FlexibleSUSYObservable`EDM[Fe[3]]}, - {26, FlexibleSUSYObservable`BrLToLGamma[Fe[2] -> {Fe[1], VP}]} + {26, FlexibleSUSYObservable`BrLToLGamma[Fe, 2 -> 1]} } }, {NMSSMRUN, diff --git a/model_files/NMSSM/LesHouches.in.NMSSM b/model_files/NMSSM/LesHouches.in.NMSSM index b53c576b8e..0fff350c87 100644 --- a/model_files/NMSSM/LesHouches.in.NMSSM +++ b/model_files/NMSSM/LesHouches.in.NMSSM @@ -15,9 +15,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -34,6 +34,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole diff --git a/model_files/NMSSMCPV/FlexibleSUSY.m.in b/model_files/NMSSMCPV/FlexibleSUSY.m.in index e6db757321..9f5a0d9ec3 100644 --- a/model_files/NMSSMCPV/FlexibleSUSY.m.in +++ b/model_files/NMSSMCPV/FlexibleSUSY.m.in @@ -104,7 +104,7 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon}, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]}, {23, FlexibleSUSYObservable`EDM[Fe[1]]}, {24, FlexibleSUSYObservable`EDM[Fe[2]]}, {25, FlexibleSUSYObservable`EDM[Fe[3]]} } }, diff --git a/model_files/NMSSMCPV/LesHouches.in.NMSSMCPV b/model_files/NMSSMCPV/LesHouches.in.NMSSMCPV index 42fecbe94a..896f880a63 100644 --- a/model_files/NMSSMCPV/LesHouches.in.NMSSMCPV +++ b/model_files/NMSSMCPV/LesHouches.in.NMSSMCPV @@ -15,9 +15,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -34,6 +34,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/NMSSMEFTHiggs/FlexibleSUSY.m.in b/model_files/NMSSMEFTHiggs/FlexibleSUSY.m.in index bb0102623b..554aad2fb8 100644 --- a/model_files/NMSSMEFTHiggs/FlexibleSUSY.m.in +++ b/model_files/NMSSMEFTHiggs/FlexibleSUSY.m.in @@ -3,6 +3,7 @@ FSEigenstates = SARAH`EWSB; FSDefaultSARAHModel = NMSSM; OnlyLowEnergyFlexibleSUSY = True; FlexibleEFTHiggs = True; +FSBVPSolvers = { ShootingSolver }; EXTPAR = { {0, MSUSY}, @@ -122,11 +123,33 @@ LowScaleInput = { {vu, 2 MZDRbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Sin[ArcTan[TanBeta]]} }; +InitialGuessAtLowScale = { + {vd, LowEnergyConstant[vev] Cos[ArcTan[TanBeta]]}, + {vu, LowEnergyConstant[vev] Sin[ArcTan[TanBeta]]}, + {Yu, Automatic}, + {Yd, Automatic}, + {Ye, Automatic} +}; + + +PotentialLSPParticles = { Chi, Sv, Su, Sd, Se, Cha, Glu }; + UseHiggs2LoopNMSSM = True; EffectiveMu = \[Lambda] vS / Sqrt[2]; EffectiveMASqr = (T[\[Lambda]] vS / Sqrt[2] + 0.5 \[Lambda] \[Kappa] vS^2) (vu^2 + vd^2) / (vu vd); +UseMSSM3LoopRGEs = True; +UseHiggs3LoopNMSSM = True; +UseMSSMYukawa2Loop = True; +UseMSSMAlphaS2Loop = True; -PotentialLSPParticles = { Chi, Sv, Su, Sd, Se, Cha, Glu }; +(* MSSM-limit for 2-loop contributions to Mhh *) +FSMSSMLimit = { + {\[Kappa], FSGaugeLess}, + {\[Lambda], FSGaugeLess}, + {vS, Sqrt[2] MuInput/FSGaugeLess}, + {T[\[Lambda]], ALambdaInput FSGaugeLess}, + {T[\[Kappa]], AKappaInput FSGaugeLess} +}; DefaultPoleMassPrecision = HighPrecision; HighPoleMassPrecision = {hh, Ah, Hpm}; @@ -139,7 +162,7 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon} } }, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]} } }, {ALPHA, {{ArcSin[Pole[ZH[2,2]]]}}}, {HMIX , {{2, vu / vd}, {3, Sqrt[vu^2 + vd^2]}, @@ -184,5 +207,60 @@ ExtraSLHAOutputBlocks = { {10, ms2} } } }; -FSCalculateDecays = True; +FSYukawaLessLimit = { + {Yu[1, 1], 0}, + {Yu[1, 2], 0}, + {Yu[1, 3], 0}, + {Yu[2, 1], 0}, + {Yu[2, 2], 0}, + {Yu[2, 3], 0}, + {Yu[3, 1], 0}, + {Yu[3, 2], 0}, + (* *) + {Yd[1, 1], 0}, + {Yd[1, 2], 0}, + {Yd[1, 3], 0}, + {Yd[2, 1], 0}, + {Yd[2, 2], 0}, + {Yd[2, 3], 0}, + {Yd[3, 1], 0}, + {Yd[3, 2], 0}, + (* *) + {Ye[1, 1], 0}, + {Ye[1, 2], 0}, + {Ye[1, 3], 0}, + {Ye[2, 1], 0}, + {Ye[2, 2], 0}, + {Ye[2, 3], 0}, + {Ye[3, 1], 0}, + {Ye[3, 2], 0}, + (* *) + {T[Yu][1, 1], 0}, + {T[Yu][1, 2], 0}, + {T[Yu][1, 3], 0}, + {T[Yu][2, 1], 0}, + {T[Yu][2, 2], 0}, + {T[Yu][2, 3], 0}, + {T[Yu][3, 1], 0}, + {T[Yu][3, 2], 0}, + (* *) + {T[Yd][1, 1], 0}, + {T[Yd][1, 2], 0}, + {T[Yd][1, 3], 0}, + {T[Yd][2, 1], 0}, + {T[Yd][2, 2], 0}, + {T[Yd][2, 3], 0}, + {T[Yd][3, 1], 0}, + {T[Yd][3, 2], 0}, + (* *) + {T[Ye][1, 1], 0}, + {T[Ye][1, 2], 0}, + {T[Ye][1, 3], 0}, + {T[Ye][2, 1], 0}, + {T[Ye][2, 2], 0}, + {T[Ye][2, 3], 0}, + {T[Ye][3, 1], 0}, + {T[Ye][3, 2], 0} +}; +FSCalculateDecays = True; diff --git a/model_files/NMSSMEFTHiggs/LesHouches.in.NMSSMEFTHiggs b/model_files/NMSSMEFTHiggs/LesHouches.in.NMSSMEFTHiggs index 9ad0fcd85e..5df474e248 100644 --- a/model_files/NMSSMEFTHiggs/LesHouches.in.NMSSMEFTHiggs +++ b/model_files/NMSSMEFTHiggs/LesHouches.in.NMSSMEFTHiggs @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279440000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/NMSSMEFTHiggs/LesHouches.in.NMSSMEFTHiggs_1507.05093_TP3 b/model_files/NMSSMEFTHiggs/LesHouches.in.NMSSMEFTHiggs_1507.05093_TP3 index 64cd0c35c7..fe61a042ba 100644 --- a/model_files/NMSSMEFTHiggs/LesHouches.in.NMSSMEFTHiggs_1507.05093_TP3 +++ b/model_files/NMSSMEFTHiggs/LesHouches.in.NMSSMEFTHiggs_1507.05093_TP3 @@ -11,9 +11,9 @@ Block FlexibleSUSY 9 1 # Higgs 2-loop corrections O(alpha_b alpha_s) 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/model_files/NUHMSSM/FlexibleSUSY.m.in b/model_files/NUHMSSM/FlexibleSUSY.m.in index ec8df97e09..ecfa521d43 100644 --- a/model_files/NUHMSSM/FlexibleSUSY.m.in +++ b/model_files/NUHMSSM/FlexibleSUSY.m.in @@ -1,23 +1,18 @@ - FSModelName = "@CLASSNAME@"; FSEigenstates = SARAH`EWSB; FSDefaultSARAHModel = MSSM; -(* input parameters *) - -MINPAR = { {1, m0}, - {2, m12}, - {3, TanBeta}, - {4, Sign[\[Mu]]}, - {5, Azero} - }; - -EXTPAR = { - {1, mHd2In}, - {2, mHu2In} - }; +MINPAR = { + {1, m0}, + {2, m12}, + {3, TanBeta}, + {4, Sign[\[Mu]]}, + {5, Azero}, + {6, MuInput}, + {7, BInput} +}; -EWSBOutputParameters = { B[\[Mu]], \[Mu] }; +EWSBOutputParameters = { mHd2, mHu2 }; SUSYScale = Sqrt[Product[M[Su[i]]^(Abs[ZU[i,3]]^2 + Abs[ZU[i,6]]^2), {i,6}]]; @@ -29,20 +24,36 @@ HighScale = g1 == g2; HighScaleFirstGuess = 2.0 10^16; -HighScaleInput={ - {T[Ye], Azero*Ye}, - {T[Yd], Azero*Yd}, - {T[Yu], Azero*Yu}, - {mHd2, mHd2In}, - {mHu2, mHu2In}, - {mq2, UNITMATRIX[3] m0^2}, - {ml2, UNITMATRIX[3] m0^2}, - {md2, UNITMATRIX[3] m0^2}, - {mu2, UNITMATRIX[3] m0^2}, - {me2, UNITMATRIX[3] m0^2}, - {MassB, m12}, - {MassWB,m12}, - {MassG,m12} +HighScaleInput = { + {T[Ye], Azero*Ye}, + {T[Yd], Azero*Yd}, + {T[Yu], Azero*Yu}, + {\[Mu], MuInput}, + {B[\[Mu]], BInput}, + {mq2, UNITMATRIX[3] m0^2}, + {ml2, UNITMATRIX[3] m0^2}, + {md2, UNITMATRIX[3] m0^2}, + {mu2, UNITMATRIX[3] m0^2}, + {me2, UNITMATRIX[3] m0^2}, + {MassB, m12}, + {MassWB, m12}, + {MassG, m12} +}; + +InitialGuessAtHighScale = { + {T[Ye], Azero*Ye}, + {T[Yd], Azero*Yd}, + {T[Yu], Azero*Yu}, + {\[Mu], MuInput}, + {B[\[Mu]], BInput}, + {mq2, UNITMATRIX[3] m0^2}, + {ml2, UNITMATRIX[3] m0^2}, + {md2, UNITMATRIX[3] m0^2}, + {mu2, UNITMATRIX[3] m0^2}, + {me2, UNITMATRIX[3] m0^2}, + {MassB, m12}, + {MassWB,m12}, + {MassG,m12} }; LowScale = LowEnergyConstant[MZ]; @@ -50,33 +61,72 @@ LowScale = LowEnergyConstant[MZ]; LowScaleFirstGuess = LowEnergyConstant[MZ]; LowScaleInput = { - {Yu, Automatic}, - {Yd, Automatic}, - {Ye, Automatic}, - {vd, 2 MZDRbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Cos[ArcTan[TanBeta]]}, - {vu, 2 MZDRbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Sin[ArcTan[TanBeta]]} + {Yu, Automatic}, + {Yd, Automatic}, + {Ye, Automatic}, + {vd, 2 MZDRbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Cos[ArcTan[TanBeta]]}, + {vu, 2 MZDRbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Sin[ArcTan[TanBeta]]} }; InitialGuessAtLowScale = { - {vd, LowEnergyConstant[vev] Cos[ArcTan[TanBeta]]}, - {vu, LowEnergyConstant[vev] Sin[ArcTan[TanBeta]]}, - {Yu, Automatic}, - {Yd, Automatic}, - {Ye, Automatic} -}; - -InitialGuessAtHighScale = { - {\[Mu] , 1.0}, - {B[\[Mu]], 0.0} + {vd, LowEnergyConstant[vev] Cos[ArcTan[TanBeta]]}, + {vu, LowEnergyConstant[vev] Sin[ArcTan[TanBeta]]}, + {Yu, Automatic}, + {Yd, Automatic}, + {Ye, Automatic} }; UseHiggs2LoopMSSM = True; EffectiveMu = \[Mu]; -UseMSSM3LoopRGEs = True; +UseMSSM3LoopRGEs = False; PotentialLSPParticles = { Chi, Sv, Su, Sd, Se, Cha, Glu }; -DefaultPoleMassPrecision = MediumPrecision; +DefaultPoleMassPrecision = HighPrecision; HighPoleMassPrecision = {hh, Ah, Hpm}; MediumPoleMassPrecision = {}; LowPoleMassPrecision = {}; + +ExtraSLHAOutputBlocks = { + {FlexibleSUSYOutput, + {{0, Hold[HighScale]}, + {1, Hold[SUSYScale]}, + {2, Hold[LowScale]} } }, + {ALPHA, {{ArcSin[Pole[ZH[2,2]]]}}}, + {HMIX , {{1, \[Mu]}, + {2, vu / vd}, + {3, Sqrt[vu^2 + vd^2]}, + {4, M[Ah[2]]^2}, + {101, B[\[Mu]]}, + {102, vd}, + {103, vu} } }, + {Au, {{1, 1, T[Yu][1,1] / Yu[1,1]}, + {2, 2, T[Yu][2,2] / Yu[2,2]}, + {3, 3, T[Yu][3,3] / Yu[3,3]} } }, + {Ad, {{1, 1, T[Yd][1,1] / Yd[1,1]}, + {2, 2, T[Yd][2,2] / Yd[2,2]}, + {3, 3, T[Yd][3,3] / Yd[3,3]} } }, + {Ae, {{1, 1, T[Ye][1,1] / Ye[1,1]}, + {2, 2, T[Ye][2,2] / Ye[2,2]}, + {3, 3, T[Ye][3,3] / Ye[3,3]} } }, + {MSOFT, {{1, MassB}, + {2, MassWB}, + {3, MassG}, + {21, mHd2}, + {22, mHu2}, + {31, SignedAbsSqrt[ml2[1,1]]}, + {32, SignedAbsSqrt[ml2[2,2]]}, + {33, SignedAbsSqrt[ml2[3,3]]}, + {34, SignedAbsSqrt[me2[1,1]]}, + {35, SignedAbsSqrt[me2[2,2]]}, + {36, SignedAbsSqrt[me2[3,3]]}, + {41, SignedAbsSqrt[mq2[1,1]]}, + {42, SignedAbsSqrt[mq2[2,2]]}, + {43, SignedAbsSqrt[mq2[3,3]]}, + {44, SignedAbsSqrt[mu2[1,1]]}, + {45, SignedAbsSqrt[mu2[2,2]]}, + {46, SignedAbsSqrt[mu2[3,3]]}, + {47, SignedAbsSqrt[md2[1,1]]}, + {48, SignedAbsSqrt[md2[2,2]]}, + {49, SignedAbsSqrt[md2[3,3]]} } } +}; diff --git a/model_files/NUHMSSMalt/LesHouches.in.NUHMSSMalt b/model_files/NUHMSSM/LesHouches.in.NUHMSSMalt similarity index 93% rename from model_files/NUHMSSMalt/LesHouches.in.NUHMSSMalt rename to model_files/NUHMSSM/LesHouches.in.NUHMSSMalt index eab5d53b10..d10cecf11e 100644 --- a/model_files/NUHMSSMalt/LesHouches.in.NUHMSSMalt +++ b/model_files/NUHMSSM/LesHouches.in.NUHMSSMalt @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top quark 2-loop corrections QCD + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/NUHMSSMaltEFTHiggs/FlexibleSUSY.m.in b/model_files/NUHMSSMEFTHiggs/FlexibleSUSY.m.in similarity index 100% rename from model_files/NUHMSSMaltEFTHiggs/FlexibleSUSY.m.in rename to model_files/NUHMSSMEFTHiggs/FlexibleSUSY.m.in diff --git a/model_files/NUHMSSMaltEFTHiggs/LesHouches.in.NUHMSSMaltEFTHiggs b/model_files/NUHMSSMEFTHiggs/LesHouches.in.NUHMSSMaltEFTHiggs similarity index 91% rename from model_files/NUHMSSMaltEFTHiggs/LesHouches.in.NUHMSSMaltEFTHiggs rename to model_files/NUHMSSMEFTHiggs/LesHouches.in.NUHMSSMaltEFTHiggs index 5992056ed7..f917246e42 100644 --- a/model_files/NUHMSSMaltEFTHiggs/LesHouches.in.NUHMSSMaltEFTHiggs +++ b/model_files/NUHMSSMEFTHiggs/LesHouches.in.NUHMSSMaltEFTHiggs @@ -14,10 +14,11 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top quark 2-loop corrections QCD + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/NUHMSSMNoFV/FlexibleSUSY.m.in b/model_files/NUHMSSMNoFV/FlexibleSUSY.m.in index deb53bb126..49101c838c 100644 --- a/model_files/NUHMSSMNoFV/FlexibleSUSY.m.in +++ b/model_files/NUHMSSMNoFV/FlexibleSUSY.m.in @@ -139,8 +139,8 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, NoScale, - {{0, FlexibleSUSYObservable`aMuon}, - {1, FlexibleSUSYObservable`aMuonUncertainty}, + {{0, FlexibleSUSYObservable`AMM[Fm]}, + {1, FlexibleSUSYObservable`AMMUncertainty[Fm]}, {2, FlexibleSUSYObservable`aMuonGM2Calc}, {3, FlexibleSUSYObservable`aMuonGM2CalcUncertainty} } }, {ALPHA, {{ArcSin[Pole[ZH[2,2]]]}}}, diff --git a/model_files/NUHMSSMNoFV/LesHouches.in.NUHMSSMNoFV b/model_files/NUHMSSMNoFV/LesHouches.in.NUHMSSMNoFV index 79b92255d0..e7a63745b6 100644 --- a/model_files/NUHMSSMNoFV/LesHouches.in.NUHMSSMNoFV +++ b/model_files/NUHMSSMNoFV/LesHouches.in.NUHMSSMNoFV @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279440000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166370000e-05 # G_Fermi diff --git a/model_files/NUHMSSMNoFVHimalaya/FlexibleSUSY.m.in b/model_files/NUHMSSMNoFVHimalaya/FlexibleSUSY.m.in index 5b7335155d..3c3595382f 100644 --- a/model_files/NUHMSSMNoFVHimalaya/FlexibleSUSY.m.in +++ b/model_files/NUHMSSMNoFVHimalaya/FlexibleSUSY.m.in @@ -130,9 +130,9 @@ InitialGuessAtHighScale = { }; UseHiggs2LoopMSSM = True; +UseHiggs3LoopMSSM = True; EffectiveMu = \[Mu]; UseMSSM3LoopRGEs = True; -UseHiggs3LoopMSSM = True; UseMSSMYukawa2Loop = True; UseMSSMAlphaS2Loop = True; @@ -142,8 +142,8 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, NoScale, - {{0, FlexibleSUSYObservable`aMuon}, - {1, FlexibleSUSYObservable`aMuonUncertainty}, + {{0, FlexibleSUSYObservable`AMM[Fm]}, + {1, FlexibleSUSYObservable`AMMUncertainty[Fm]}, {2, FlexibleSUSYObservable`aMuonGM2Calc}, {3, FlexibleSUSYObservable`aMuonGM2CalcUncertainty} } }, {ALPHA, {{ArcSin[Pole[ZH[2,2]]]}}}, diff --git a/model_files/NUHMSSMNoFVHimalaya/LesHouches.in.NUHMSSMNoFVHimalaya b/model_files/NUHMSSMNoFVHimalaya/LesHouches.in.NUHMSSMNoFVHimalaya index c7162332d9..938235f245 100644 --- a/model_files/NUHMSSMNoFVHimalaya/LesHouches.in.NUHMSSMNoFVHimalaya +++ b/model_files/NUHMSSMNoFVHimalaya/LesHouches.in.NUHMSSMNoFVHimalaya @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279440000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166370000e-05 # G_Fermi diff --git a/model_files/NUHMSSMNoFVHimalayaEFTHiggs/FlexibleSUSY.m.in b/model_files/NUHMSSMNoFVHimalayaEFTHiggs/FlexibleSUSY.m.in new file mode 100644 index 0000000000..c7b43b711c --- /dev/null +++ b/model_files/NUHMSSMNoFVHimalayaEFTHiggs/FlexibleSUSY.m.in @@ -0,0 +1,237 @@ +FSModelName = "@CLASSNAME@"; +FSDefaultSARAHModel = MSSMNoFV; +OnlyLowEnergyFlexibleSUSY = True; +FlexibleEFTHiggs = True; +FSBVPSolvers = { ShootingSolver }; + +EXTPAR = { + {0, MSUSY}, + {1, M1Input}, + {2, M2Input}, + {3, M3Input}, + {4, MuInput}, + {5, mAInput}, + {25, TanBeta} +}; + +FSAuxiliaryParameterInfo = { + {mq2Input, { LesHouches -> MSQ2IN, + ParameterDimensions -> {3,3}, + InputParameter -> True + } }, + {mu2Input, { LesHouches -> MSU2IN, + ParameterDimensions -> {3,3}, + InputParameter -> True + } }, + {md2Input, { LesHouches -> MSD2IN, + ParameterDimensions -> {3,3}, + InputParameter -> True + } }, + {ml2Input, { LesHouches -> MSL2IN, + ParameterDimensions -> {3,3}, + InputParameter -> True + } }, + {me2Input, { LesHouches -> MSE2IN, + ParameterDimensions -> {3,3}, + InputParameter -> True + } }, + {AuInput, { LesHouches -> AUIN, + ParameterDimensions -> {3,3}, + InputParameter -> True + } }, + {AdInput, { LesHouches -> ADIN, + ParameterDimensions -> {3,3}, + InputParameter -> True + } }, + {AeInput, { LesHouches -> AEIN, + ParameterDimensions -> {3,3}, + InputParameter -> True + } } +}; + +EWSBOutputParameters = { mHd2, mHu2 }; + +EvalIf[expr_] := Block[{If}, expr]; + +SUSYScale = EvalIf @ If[MSUSY != 0, MSUSY, Sqrt[M[St[1]] M[St[2]]]]; + +SUSYScaleFirstGuess = EvalIf @ If[MSUSY != 0, MSUSY, Sqrt[Sqrt[mq2Input[3,3] mu2Input[3,3]]]]; + +SUSYScaleInput = { + {vu, Sqrt[vu^2 + vd^2] Sin[ArcTan[TanBeta]]}, + {vd, Sqrt[vu^2 + vd^2] Cos[ArcTan[TanBeta]]}, + {MassB, M1Input}, + {MassWB, M2Input}, + {MassG, M3Input}, + {mq2, mq2Input}, + {mu2, mu2Input}, + {md2, md2Input}, + {ml2, ml2Input}, + {me2, me2Input}, + {\[Mu], MuInput}, + {B[\[Mu]], mAInput^2/(TanBeta + 1/TanBeta)}, + {T[Yu], AuInput Yu}, + {T[Yd], AdInput Yd}, + {T[Ye], AeInput Ye} +}; + +InitialGuessAtSUSYScale = { + {vu, VEV Sin[ArcTan[TanBeta]]}, + {vd, VEV Cos[ArcTan[TanBeta]]}, + {MassB, M1Input}, + {MassWB, M2Input}, + {MassG, M3Input}, + {mq2, mq2Input}, + {mu2, mu2Input}, + {md2, md2Input}, + {ml2, ml2Input}, + {me2, me2Input}, + {\[Mu], MuInput}, + {B[\[Mu]], mAInput^2/(TanBeta + 1/TanBeta)}, + {T[Yu], AuInput Yu}, + {T[Yd], AdInput Yd}, + {T[Ye], AeInput Ye} +}; + +(* VEV is the SM-like VEV in the MSSM *) +MatchingScaleInput = { + {vu, VEV Sin[ArcTan[vu/vd]]}, + {vd, VEV Cos[ArcTan[vu/vd]]} +}; + +LowScale = LowEnergyConstant[MZ]; + +LowScaleFirstGuess = LowEnergyConstant[MZ]; + +LowScaleInput = { + {Yu, Automatic}, + {Yd, Automatic}, + {Ye, Automatic}, + {vd, 2 MZDRbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Cos[ArcTan[TanBeta]]}, + {vu, 2 MZDRbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Sin[ArcTan[TanBeta]]} +}; + +InitialGuessAtLowScale = { + {vd, LowEnergyConstant[vev] Cos[ArcTan[TanBeta]]}, + {vu, LowEnergyConstant[vev] Sin[ArcTan[TanBeta]]}, + {Yu, Automatic}, + {Yd, Automatic}, + {Ye, Automatic} +}; + +InitialGuessAtHighScale = { + {\[Mu] , 1.0}, + {B[\[Mu]], 0.0} +}; + +UseHiggs2LoopMSSM = True; +EffectiveMu = \[Mu]; +UseMSSM3LoopRGEs = True; +UseHiggs3LoopMSSM = True; +UseMSSMYukawa2Loop = True; +UseMSSMAlphaS2Loop = True; + +ExtraSLHAOutputBlocks = { + {FlexibleSUSYOutput, + {{0, Hold[HighScale]}, + {1, Hold[SUSYScale]}, + {2, Hold[LowScale]} } }, + {FlexibleSUSYLowEnergy, NoScale, + {{0, FlexibleSUSYObservable`AMM[Fm]}, + {1, FlexibleSUSYObservable`AMMUncertainty[Fm]}, + {2, FlexibleSUSYObservable`aMuonGM2Calc}, + {3, FlexibleSUSYObservable`aMuonGM2CalcUncertainty} } }, + {ALPHA, {{ArcSin[Pole[ZH[2,2]]]}}}, + {HMIX , {{1, \[Mu]}, + {2, vu / vd}, + {3, Sqrt[vu^2 + vd^2]}, + {4, M[Ah[2]]^2}, + {101, B[\[Mu]]}, + {102, vd}, + {103, vu} } }, + {Au, {{1, 1, T[Yu][1,1] / Yu[1,1]}, + {2, 2, T[Yu][2,2] / Yu[2,2]}, + {3, 3, T[Yu][3,3] / Yu[3,3]} } }, + {Ad, {{1, 1, T[Yd][1,1] / Yd[1,1]}, + {2, 2, T[Yd][2,2] / Yd[2,2]}, + {3, 3, T[Yd][3,3] / Yd[3,3]} } }, + {Ae, {{1, 1, T[Ye][1,1] / Ye[1,1]}, + {2, 2, T[Ye][2,2] / Ye[2,2]}, + {3, 3, T[Ye][3,3] / Ye[3,3]} } }, + {MSOFT, {{1, MassB}, + {2, MassWB}, + {3, MassG}, + {21, mHd2}, + {22, mHu2}, + {31, SignedAbsSqrt[ml2[1,1]]}, + {32, SignedAbsSqrt[ml2[2,2]]}, + {33, SignedAbsSqrt[ml2[3,3]]}, + {34, SignedAbsSqrt[me2[1,1]]}, + {35, SignedAbsSqrt[me2[2,2]]}, + {36, SignedAbsSqrt[me2[3,3]]}, + {41, SignedAbsSqrt[mq2[1,1]]}, + {42, SignedAbsSqrt[mq2[2,2]]}, + {43, SignedAbsSqrt[mq2[3,3]]}, + {44, SignedAbsSqrt[mu2[1,1]]}, + {45, SignedAbsSqrt[mu2[2,2]]}, + {46, SignedAbsSqrt[mu2[3,3]]}, + {47, SignedAbsSqrt[md2[1,1]]}, + {48, SignedAbsSqrt[md2[2,2]]}, + {49, SignedAbsSqrt[md2[3,3]]} } } +}; + +FSYukawaLessLimit = { + {Yu[1, 1], 0}, + {Yu[1, 2], 0}, + {Yu[1, 3], 0}, + {Yu[2, 1], 0}, + {Yu[2, 2], 0}, + {Yu[2, 3], 0}, + {Yu[3, 1], 0}, + {Yu[3, 2], 0}, + (* *) + {Yd[1, 1], 0}, + {Yd[1, 2], 0}, + {Yd[1, 3], 0}, + {Yd[2, 1], 0}, + {Yd[2, 2], 0}, + {Yd[2, 3], 0}, + {Yd[3, 1], 0}, + {Yd[3, 2], 0}, + (* *) + {Ye[1, 1], 0}, + {Ye[1, 2], 0}, + {Ye[1, 3], 0}, + {Ye[2, 1], 0}, + {Ye[2, 2], 0}, + {Ye[2, 3], 0}, + {Ye[3, 1], 0}, + {Ye[3, 2], 0}, + (* *) + {T[Yu][1, 1], 0}, + {T[Yu][1, 2], 0}, + {T[Yu][1, 3], 0}, + {T[Yu][2, 1], 0}, + {T[Yu][2, 2], 0}, + {T[Yu][2, 3], 0}, + {T[Yu][3, 1], 0}, + {T[Yu][3, 2], 0}, + (* *) + {T[Yd][1, 1], 0}, + {T[Yd][1, 2], 0}, + {T[Yd][1, 3], 0}, + {T[Yd][2, 1], 0}, + {T[Yd][2, 2], 0}, + {T[Yd][2, 3], 0}, + {T[Yd][3, 1], 0}, + {T[Yd][3, 2], 0}, + (* *) + {T[Ye][1, 1], 0}, + {T[Ye][1, 2], 0}, + {T[Ye][1, 3], 0}, + {T[Ye][2, 1], 0}, + {T[Ye][2, 2], 0}, + {T[Ye][2, 3], 0}, + {T[Ye][3, 1], 0}, + {T[Ye][3, 2], 0} +}; diff --git a/model_files/NUHMSSMNoFVHimalayaEFTHiggs/LesHouches.in.NUHMSSMNoFVHimalayaEFTHiggs b/model_files/NUHMSSMNoFVHimalayaEFTHiggs/LesHouches.in.NUHMSSMNoFVHimalayaEFTHiggs new file mode 100644 index 0000000000..9333e1813c --- /dev/null +++ b/model_files/NUHMSSMNoFVHimalayaEFTHiggs/LesHouches.in.NUHMSSMNoFVHimalayaEFTHiggs @@ -0,0 +1,92 @@ +Block MODSEL # Select model +# 12 1000 # DRbar parameter output scale (GeV) +Block FlexibleSUSY + 0 1.000000000e-05 # precision goal + 1 0 # max. iterations (0 = automatic) + 2 0 # algorithm (0 = all, 1 = two_scale, 2 = semi_analytic) + 3 0 # calculate SM pole masses + 4 4 # pole mass loop order + 5 4 # EWSB loop order + 6 4 # beta-functions loop order + 7 3 # threshold corrections loop order + 8 1 # Higgs 2-loop corrections O(alpha_t alpha_s) + 9 1 # Higgs 2-loop corrections O(alpha_b alpha_s) + 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) + 11 0 # Higgs 2-loop corrections O(alpha_tau^2) + 12 0 # force output + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) + 14 1.000000000e-11 # beta-function zero threshold + 15 0 # calculate observables (a_muon, ...) + 16 0 # force positive majorana masses + 17 0 # pole mass renormalization scale (0 = SUSY scale) + 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) + 19 0 # EFT matching scale (0 = SUSY scale) + 20 2 # EFT loop order for upwards matching + 21 3 # EFT loop order for downwards matching + 22 0 # EFT index of SM-like Higgs in the BSM model + 23 0 # calculate BSM pole masses + 24 123111321 # individual threshold correction loop orders + 25 0 # ren. scheme for Higgs 3L corrections (0 = DR, 1 = MDR) + 26 1 # Higgs 3-loop corrections O(alpha_t alpha_s^2) + 27 0 # Higgs 3-loop corrections O(alpha_b alpha_s^2) + 28 0 # Higgs 3-loop corrections O(alpha_t^2 alpha_s) + 29 0 # Higgs 3-loop corrections O(alpha_t^3) + 30 0 # Higgs 4-loop corrections O(alpha_t alpha_s^3) +Block SMINPUTS # Standard Model inputs + 1 1.279440000e+02 # alpha^(-1) SM MSbar(MZ) + 2 1.166378700e-05 # G_Fermi + 3 1.184000000e-01 # alpha_s(MZ) SM MSbar + 4 9.118760000e+01 # MZ(pole) + 5 4.180000000e+00 # mb(mb) SM MSbar + 6 1.733400000e+02 # mtop(pole) + 7 1.777000000e+00 # mtau(pole) + 8 0.000000000e+00 # mnu3(pole) + 9 80.379 # MW pole + 11 5.109989020e-04 # melectron(pole) + 12 0.000000000e+00 # mnu1(pole) + 13 1.056583570e-01 # mmuon(pole) + 14 0.000000000e+00 # mnu2(pole) + 21 4.750000000e-03 # md(2 GeV) MS-bar + 22 2.400000000e-03 # mu(2 GeV) MS-bar + 23 1.040000000e-01 # ms(2 GeV) MS-bar + 24 1.270000000e+00 # mc(mc) MS-bar +Block EXTPAR + 0 2000 # Ms + 1 2000 # M1(MSUSY) + 2 2000 # M2(MSUSY) + 3 2000 # M3(MSUSY) + 4 2000 # Mu(MSUSY) + 5 2000 # mA(MSUSY) + 25 20 # TanBeta(MSUSY) +Block MSQ2IN + 1 1 4.00000000E+06 # mq2(1,1) + 2 2 4.00000000E+06 # mq2(2,2) + 3 3 4.00000000E+06 # mq2(3,3) +Block MSE2IN + 1 1 4.00000000E+06 # me2(1,1) + 2 2 4.00000000E+06 # me2(2,2) + 3 3 4.00000000E+06 # me2(3,3) +Block MSL2IN + 1 1 4.00000000E+06 # ml2(1,1) + 2 2 4.00000000E+06 # ml2(2,2) + 3 3 4.00000000E+06 # ml2(3,3) +Block MSU2IN + 1 1 4.00000000E+06 # mu2(1,1) + 2 2 4.00000000E+06 # mu2(2,2) + 3 3 4.00000000E+06 # mu2(3,3) +Block MSD2IN + 1 1 4.00000000E+06 # md2(1,1) + 2 2 4.00000000E+06 # md2(2,2) + 3 3 4.00000000E+06 # md2(3,3) +Block AUIN + 1 1 400 # Au(1,1) + 2 2 400 # Au(2,2) + 3 3 4998.98 # Au(3,3) # At = Xt + Mu/TanBeta, Xt = Sqrt[6] MS +Block ADIN + 1 1 1e4 # Ad(1,1) + 2 2 1e4 # Ad(2,2) + 3 3 1e4 # Ad(3,3) +Block AEIN + 1 1 1e4 # Ad(1,1) + 2 2 1e4 # Ad(2,2) + 3 3 1e4 # Ad(3,3) diff --git a/model_files/NUHMSSMalt/FlexibleSUSY.m.in b/model_files/NUHMSSMalt/FlexibleSUSY.m.in deleted file mode 100644 index ecfa521d43..0000000000 --- a/model_files/NUHMSSMalt/FlexibleSUSY.m.in +++ /dev/null @@ -1,132 +0,0 @@ -FSModelName = "@CLASSNAME@"; -FSEigenstates = SARAH`EWSB; -FSDefaultSARAHModel = MSSM; - -MINPAR = { - {1, m0}, - {2, m12}, - {3, TanBeta}, - {4, Sign[\[Mu]]}, - {5, Azero}, - {6, MuInput}, - {7, BInput} -}; - -EWSBOutputParameters = { mHd2, mHu2 }; - -SUSYScale = Sqrt[Product[M[Su[i]]^(Abs[ZU[i,3]]^2 + Abs[ZU[i,6]]^2), {i,6}]]; - -SUSYScaleFirstGuess = Sqrt[m0^2 + 4 m12^2]; - -SUSYScaleInput = {}; - -HighScale = g1 == g2; - -HighScaleFirstGuess = 2.0 10^16; - -HighScaleInput = { - {T[Ye], Azero*Ye}, - {T[Yd], Azero*Yd}, - {T[Yu], Azero*Yu}, - {\[Mu], MuInput}, - {B[\[Mu]], BInput}, - {mq2, UNITMATRIX[3] m0^2}, - {ml2, UNITMATRIX[3] m0^2}, - {md2, UNITMATRIX[3] m0^2}, - {mu2, UNITMATRIX[3] m0^2}, - {me2, UNITMATRIX[3] m0^2}, - {MassB, m12}, - {MassWB, m12}, - {MassG, m12} -}; - -InitialGuessAtHighScale = { - {T[Ye], Azero*Ye}, - {T[Yd], Azero*Yd}, - {T[Yu], Azero*Yu}, - {\[Mu], MuInput}, - {B[\[Mu]], BInput}, - {mq2, UNITMATRIX[3] m0^2}, - {ml2, UNITMATRIX[3] m0^2}, - {md2, UNITMATRIX[3] m0^2}, - {mu2, UNITMATRIX[3] m0^2}, - {me2, UNITMATRIX[3] m0^2}, - {MassB, m12}, - {MassWB,m12}, - {MassG,m12} -}; - -LowScale = LowEnergyConstant[MZ]; - -LowScaleFirstGuess = LowEnergyConstant[MZ]; - -LowScaleInput = { - {Yu, Automatic}, - {Yd, Automatic}, - {Ye, Automatic}, - {vd, 2 MZDRbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Cos[ArcTan[TanBeta]]}, - {vu, 2 MZDRbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Sin[ArcTan[TanBeta]]} -}; - -InitialGuessAtLowScale = { - {vd, LowEnergyConstant[vev] Cos[ArcTan[TanBeta]]}, - {vu, LowEnergyConstant[vev] Sin[ArcTan[TanBeta]]}, - {Yu, Automatic}, - {Yd, Automatic}, - {Ye, Automatic} -}; - -UseHiggs2LoopMSSM = True; -EffectiveMu = \[Mu]; -UseMSSM3LoopRGEs = False; - -PotentialLSPParticles = { Chi, Sv, Su, Sd, Se, Cha, Glu }; - -DefaultPoleMassPrecision = HighPrecision; -HighPoleMassPrecision = {hh, Ah, Hpm}; -MediumPoleMassPrecision = {}; -LowPoleMassPrecision = {}; - -ExtraSLHAOutputBlocks = { - {FlexibleSUSYOutput, - {{0, Hold[HighScale]}, - {1, Hold[SUSYScale]}, - {2, Hold[LowScale]} } }, - {ALPHA, {{ArcSin[Pole[ZH[2,2]]]}}}, - {HMIX , {{1, \[Mu]}, - {2, vu / vd}, - {3, Sqrt[vu^2 + vd^2]}, - {4, M[Ah[2]]^2}, - {101, B[\[Mu]]}, - {102, vd}, - {103, vu} } }, - {Au, {{1, 1, T[Yu][1,1] / Yu[1,1]}, - {2, 2, T[Yu][2,2] / Yu[2,2]}, - {3, 3, T[Yu][3,3] / Yu[3,3]} } }, - {Ad, {{1, 1, T[Yd][1,1] / Yd[1,1]}, - {2, 2, T[Yd][2,2] / Yd[2,2]}, - {3, 3, T[Yd][3,3] / Yd[3,3]} } }, - {Ae, {{1, 1, T[Ye][1,1] / Ye[1,1]}, - {2, 2, T[Ye][2,2] / Ye[2,2]}, - {3, 3, T[Ye][3,3] / Ye[3,3]} } }, - {MSOFT, {{1, MassB}, - {2, MassWB}, - {3, MassG}, - {21, mHd2}, - {22, mHu2}, - {31, SignedAbsSqrt[ml2[1,1]]}, - {32, SignedAbsSqrt[ml2[2,2]]}, - {33, SignedAbsSqrt[ml2[3,3]]}, - {34, SignedAbsSqrt[me2[1,1]]}, - {35, SignedAbsSqrt[me2[2,2]]}, - {36, SignedAbsSqrt[me2[3,3]]}, - {41, SignedAbsSqrt[mq2[1,1]]}, - {42, SignedAbsSqrt[mq2[2,2]]}, - {43, SignedAbsSqrt[mq2[3,3]]}, - {44, SignedAbsSqrt[mu2[1,1]]}, - {45, SignedAbsSqrt[mu2[2,2]]}, - {46, SignedAbsSqrt[mu2[3,3]]}, - {47, SignedAbsSqrt[md2[1,1]]}, - {48, SignedAbsSqrt[md2[2,2]]}, - {49, SignedAbsSqrt[md2[3,3]]} } } -}; diff --git a/model_files/NUHNMSSM/FlexibleSUSY.m.in b/model_files/NUHNMSSMHimalaya/FlexibleSUSY.m.in similarity index 90% rename from model_files/NUHNMSSM/FlexibleSUSY.m.in rename to model_files/NUHNMSSMHimalaya/FlexibleSUSY.m.in index 51b25a7991..777f35af2b 100644 --- a/model_files/NUHNMSSM/FlexibleSUSY.m.in +++ b/model_files/NUHNMSSMHimalaya/FlexibleSUSY.m.in @@ -1,7 +1,6 @@ FSModelName = "@CLASSNAME@"; FSEigenstates = SARAH`EWSB; FSDefaultSARAHModel = NMSSM; -OnlyLowEnergyFlexibleSUSY = True; EXTPAR = { {0, MSUSY}, @@ -53,13 +52,17 @@ FSAuxiliaryParameterInfo = { EWSBOutputParameters = { mHd2, mHu2, ms2 }; -SUSYScale = MSUSY; +SUSYScale = Sqrt[Product[M[Su[i]]^(Abs[ZU[i,3]]^2 + Abs[ZU[i,6]]^2), {i,6}]]; -SUSYScaleFirstGuess = MSUSY; +SUSYScaleFirstGuess = LowEnergyConstant[MZ]; -SUSYScaleInput = { - {vu, Sqrt[vu^2 + vd^2] Sin[ArcTan[TanBeta]]}, - {vd, Sqrt[vu^2 + vd^2] Cos[ArcTan[TanBeta]]}, +SUSYScaleInput = {}; + +HighScale = MSUSY; + +HighScaleFirstGuess = MSUSY; + +HighScaleInput = { {MassB, M1Input}, {MassWB, M2Input}, {MassG, M3Input}, @@ -107,16 +110,18 @@ LowScale = LowEnergyConstant[MZ]; LowScaleFirstGuess = LowEnergyConstant[MZ]; LowScaleInput = { - {vd, LowEnergyConstant[vev] Cos[ArcTan[TanBeta]]}, - {vu, LowEnergyConstant[vev] Sin[ArcTan[TanBeta]]}, {Yu, Automatic}, {Yd, Automatic}, - {Ye, Automatic} + {Ye, Automatic}, + {vd, 2 MZDRbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Cos[ArcTan[TanBeta]]}, + {vu, 2 MZDRbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Sin[ArcTan[TanBeta]]} }; UseHiggs2LoopNMSSM = True; +UseHiggs3LoopNMSSM = True; EffectiveMu = \[Lambda] vS / Sqrt[2]; EffectiveMASqr = (T[\[Lambda]] vS / Sqrt[2] + 0.5 \[Lambda] \[Kappa] vS^2) (vu^2 + vd^2) / (vu vd); +UseMSSM3LoopRGEs = True; UseMSSMYukawa2Loop = True; UseMSSMAlphaS2Loop = True; @@ -133,7 +138,7 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon} } }, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]} } }, {ALPHA, {{ArcSin[Pole[ZH[2,2]]]}}}, {HMIX , {{1, \[Lambda] vS / Sqrt[2]}, {2, vu / vd}, @@ -178,3 +183,5 @@ ExtraSLHAOutputBlocks = { {5, \[Lambda] vS / Sqrt[2]}, {10, ms2} } } }; + +FSCalculateDecays = True; diff --git a/model_files/NUHNMSSMHimalaya/LesHouches.in.NUHNMSSMHimalaya b/model_files/NUHNMSSMHimalaya/LesHouches.in.NUHNMSSMHimalaya new file mode 100644 index 0000000000..345310f58c --- /dev/null +++ b/model_files/NUHNMSSMHimalaya/LesHouches.in.NUHNMSSMHimalaya @@ -0,0 +1,158 @@ +Block MODSEL # Select model +# 12 1000 # DRbar parameter output scale (GeV) +Block FlexibleSUSY + 0 1.000000000e-04 # precision goal + 1 0 # max. iterations (0 = automatic) + 2 0 # solver (0 = all, 1 = two_scale, 2 = semi_analytic) + 3 0 # calculate SM pole masses + 4 4 # pole mass loop order + 5 4 # EWSB loop order + 6 4 # beta-functions loop order + 7 4 # threshold corrections loop order + 8 1 # Higgs 2-loop corrections O(alpha_t alpha_s) + 9 1 # Higgs 2-loop corrections O(alpha_b alpha_s) + 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) + 11 1 # Higgs 2-loop corrections O(alpha_tau^2) + 12 0 # force output + 13 3 # Top quark 2-loop corrections QCD (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) + 14 1.000000000e-11 # beta-function zero threshold + 15 0 # calculate all observables + 16 0 # force positive majorana masses + 17 0 # pole mass renormalization scale (0 = SUSY scale) + 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) + 19 0 # EFT matching scale (0 = SUSY scale) + 20 2 # EFT loop order for upwards matching + 21 1 # EFT loop order for downwards matching + 22 0 # EFT index of SM-like Higgs in the BSM model + 23 1 # calculate BSM pole masses + 24 124111421 # individual threshold correction loop orders + 25 0 # ren. scheme for Higgs 3L corrections (0 = DR', 1 = MDR', 2 = H3m) + 26 1 # Higgs 3-loop corrections O(alpha_t alpha_s^2) + 27 1 # Higgs 3-loop corrections O(alpha_b alpha_s^2) + 28 1 # Higgs 3-loop corrections O(alpha_t^2 alpha_s) + 29 1 # Higgs 3-loop corrections O(alpha_t^3) + 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) + 28 1 # Higgs 3-loop corrections O(alpha_t^2 alpha_s) + 29 1 # Higgs 3-loop corrections O(alpha_t^3) + 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) + 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM +Block FlexibleSUSYInput + 0 0.00729735 # alpha_em(0) + 1 125.09 # Mh pole +Block SMINPUTS # Standard Model inputs + 1 1.279160000e+02 # alpha^(-1) SM MSbar(MZ) + 2 1.166378700e-05 # G_Fermi + 3 1.184000000e-01 # alpha_s(MZ) SM MSbar + 4 9.118760000e+01 # MZ(pole) + 5 4.180000000e+00 # mb(mb) SM MSbar + 6 1.733400000e+02 # mtop(pole) + 7 1.776990000e+00 # mtau(pole) + 8 0.000000000e+00 # mnu3(pole) + 9 80.385 # MW pole + 11 5.109989020e-04 # melectron(pole) + 12 0.000000000e+00 # mnu1(pole) + 13 1.056583715e-01 # mmuon(pole) + 14 0.000000000e+00 # mnu2(pole) + 21 4.750000000e-03 # md(2 GeV) MS-bar + 22 2.400000000e-03 # mu(2 GeV) MS-bar + 23 1.040000000e-01 # ms(2 GeV) MS-bar + 24 1.270000000e+00 # mc(mc) MS-bar +Block FlexibleDecay + 0 1 # calculate decays (0 = no, 1 = yes) + 1 1e-5 # minimum BR to print + 2 41 # include higher order corrections in decays SM|BSM (0 = LO, 1 = NLO, 2 = NNLO, 3 = N^3LO, 4 = N^4LO) + 3 1 # use Thomson alpha(0) instead of alpha(m) in decays to γγ and γZ + 4 2 # off-shell decays into VV pair +Block EXTPAR + 0 2e3 # MSUSY + 1 2e3 # M1Input + 2 2e3 # M2Input + 3 2e3 # M3Input + 4 2e3 # MuInput + 25 10 # TanBeta + 61 0.1 # LambdaInput + 62 0.1 # KappaInput + 63 -5e2 # ALambdaInput + 64 -5e2 # AKappaInput +Block MSQ2IN + 1 1 4e6 # mq2Input(1,1) + 1 2 0 # mq2Input(1,2) + 1 3 0 # mq2Input(1,3) + 2 1 0 # mq2Input(2,1) + 2 2 4e6 # mq2Input(2,2) + 2 3 0 # mq2Input(2,3) + 3 1 0 # mq2Input(3,1) + 3 2 0 # mq2Input(3,2) + 3 3 4e6 # mq2Input(3,3) +Block MSU2IN + 1 1 4e6 # mu2Input(1,1) + 1 2 0 # mu2Input(1,2) + 1 3 0 # mu2Input(1,3) + 2 1 0 # mu2Input(2,1) + 2 2 4e6 # mu2Input(2,2) + 2 3 0 # mu2Input(2,3) + 3 1 0 # mu2Input(3,1) + 3 2 0 # mu2Input(3,2) + 3 3 4e6 # mu2Input(3,3) +Block MSD2IN + 1 1 4e6 # md2Input(1,1) + 1 2 0 # md2Input(1,2) + 1 3 0 # md2Input(1,3) + 2 1 0 # md2Input(2,1) + 2 2 4e6 # md2Input(2,2) + 2 3 0 # md2Input(2,3) + 3 1 0 # md2Input(3,1) + 3 2 0 # md2Input(3,2) + 3 3 4e6 # md2Input(3,3) +Block MSL2IN + 1 1 4e6 # ml2Input(1,1) + 1 2 0 # ml2Input(1,2) + 1 3 0 # ml2Input(1,3) + 2 1 0 # ml2Input(2,1) + 2 2 4e6 # ml2Input(2,2) + 2 3 0 # ml2Input(2,3) + 3 1 0 # ml2Input(3,1) + 3 2 0 # ml2Input(3,2) + 3 3 4e6 # ml2Input(3,3) +Block MSE2IN + 1 1 4e6 # me2Input(1,1) + 1 2 0 # me2Input(1,2) + 1 3 0 # me2Input(1,3) + 2 1 0 # me2Input(2,1) + 2 2 4e6 # me2Input(2,2) + 2 3 0 # me2Input(2,3) + 3 1 0 # me2Input(3,1) + 3 2 0 # me2Input(3,2) + 3 3 4e6 # me2Input(3,3) +Block AUIN + 1 1 0 # AuInput(1,1) + 1 2 0 # AuInput(1,2) + 1 3 0 # AuInput(1,3) + 2 1 0 # AuInput(2,1) + 2 2 0 # AuInput(2,2) + 2 3 0 # AuInput(2,3) + 3 1 0 # AuInput(3,1) + 3 2 0 # AuInput(3,2) + 3 3 -4698.98 # AuInput(3,3) +Block ADIN + 1 1 0 # AdInput(1,1) + 1 2 0 # AdInput(1,2) + 1 3 0 # AdInput(1,3) + 2 1 0 # AdInput(2,1) + 2 2 0 # AdInput(2,2) + 2 3 0 # AdInput(2,3) + 3 1 0 # AdInput(3,1) + 3 2 0 # AdInput(3,2) + 3 3 2e4 # AdInput(3,3) +Block AEIN + 1 1 0 # AeInput(1,1) + 1 2 0 # AeInput(1,2) + 1 3 0 # AeInput(1,3) + 2 1 0 # AeInput(2,1) + 2 2 0 # AeInput(2,2) + 2 3 0 # AeInput(2,3) + 3 1 0 # AeInput(3,1) + 3 2 0 # AeInput(3,2) + 3 3 2e4 # AeInput(3,3) + diff --git a/model_files/NUHNMSSM/NUHNMSSM_uncertainty_estimate.m b/model_files/NUHNMSSMHimalaya/NUHNMSSMHimalaya_uncertainty_estimate.m similarity index 75% rename from model_files/NUHNMSSM/NUHNMSSM_uncertainty_estimate.m rename to model_files/NUHNMSSMHimalaya/NUHNMSSMHimalaya_uncertainty_estimate.m index e8b841d0dc..9df3f57e09 100644 --- a/model_files/NUHNMSSM/NUHNMSSM_uncertainty_estimate.m +++ b/model_files/NUHNMSSMHimalaya/NUHNMSSMHimalaya_uncertainty_estimate.m @@ -21,20 +21,20 @@ *) (** - Functions to perform an uncertainty estimate of NUHNMSSM. + Functions to perform an uncertainty estimate of NUHNMSSMHimalaya. *) -CalcNUHNMSSMDMh::usage="\ +CalcNUHNMSSMHimalayaDMh::usage="\ The function takes the parameter point as input (same syntax as -FSNUHNMSSMOpenHandle[]) and returns the 2-component list { Mh, DMh } +FSNUHNMSSMHimalayaOpenHandle[]) and returns the 2-component list { Mh, DMh } where Mh is the Higgs mass and DMh is an uncertainty estimate of missing 3-loop and 4-loop corrections. Example: Peform a parameter scan over the SUSY scale in the interval [1000, 10^10] GeV for tan(beta) = 20 and Xt/MS = Sqrt[6]. -Get[\"models/NUHNMSSM/NUHNMSSM_librarylink.m\"]; -Get[\"model_files/NUHNMSSM/NUHNMSSM_uncertainty_estimate.m\"]; +Get[\"models/NUHNMSSMHimalaya/NUHNMSSMHimalaya_librarylink.m\"]; +Get[\"model_files/NUHNMSSMHimalaya/NUHNMSSMHimalaya_uncertainty_estimate.m\"]; CalcTlambda[mA2_, TB_, lam_, kap_, muEff_] := Module[{vS = muEff Sqrt[2] / lam}, @@ -47,7 +47,7 @@ The function takes the parameter point as input (same syntax as ]; CalcMh[MS_, TB_, Xtt_] := - CalcNUHNMSSMDMh[ + CalcNUHNMSSMHimalayaDMh[ fsSettings -> { precisionGoal -> 1.*^-5, poleMassLoopOrder -> 3, @@ -101,16 +101,16 @@ The function takes the parameter point as input (same syntax as Exp /@ Range[Log[start], Log[stop], (Log[stop] - Log[start])/steps]; (* calculate Higgs mass *) -CalcNUHNMSSMMh[a___, (fsSettings | fsSMParameters | fsModelParameters) -> s_List, r___] := - CalcNUHNMSSMMh[a, Sequence @@ s, r]; +CalcNUHNMSSMHimalayaMh[a___, (fsSettings | fsSMParameters | fsModelParameters) -> s_List, r___] := + CalcNUHNMSSMHimalayaMh[a, Sequence @@ s, r]; -CalcNUHNMSSMMh[asLoops_?NumericQ, ytLoops_?NumericQ, Qpole_?NumericQ, args__] := +CalcNUHNMSSMHimalayaMh[asLoops_?NumericQ, ytLoops_?NumericQ, Qpole_?NumericQ, args__] := Module[{handle, spec, tc}, tc = thresholdCorrections /. { args }; tc = If[IntegerQ[tc], tc, - thresholdCorrections /. Options[FSNUHNMSSMOpenHandle]]; - handle = FSNUHNMSSMOpenHandle[args]; - FSNUHNMSSMSet[handle, + thresholdCorrections /. Options[FSNUHNMSSMHimalayaOpenHandle]]; + handle = FSNUHNMSSMHimalayaOpenHandle[args]; + FSNUHNMSSMHimalayaSet[handle, fsSettings -> { calculateStandardModelMasses -> 0, calculateBSMMasses -> 1, @@ -119,26 +119,26 @@ The function takes the parameter point as input (same syntax as thresholdCorrections -> SetDigit[SetDigit[tc, 2, asLoops], 6, ytLoops] } ]; - spec = FSNUHNMSSMCalculateSpectrum[handle]; - FSNUHNMSSMCloseHandle[handle]; + spec = FSNUHNMSSMHimalayaCalculateSpectrum[handle]; + FSNUHNMSSMHimalayaCloseHandle[handle]; If[spec === $Failed, $Failed, - (Pole[M[hh]] /. (NUHNMSSM /. spec))[[1]]] + (Pole[M[hh]] /. (NUHNMSSMHimalaya /. spec))[[1]]] ]; (* calculate Higgs mass and uncertainty estimate *) -CalcNUHNMSSMDMh[a___, (fsSettings | fsSMParameters | fsModelParameters) -> s_List, r___] := - CalcNUHNMSSMDMh[a, Sequence @@ s, r]; +CalcNUHNMSSMHimalayaDMh[a___, (fsSettings | fsSMParameters | fsModelParameters) -> s_List, r___] := + CalcNUHNMSSMHimalayaDMh[a, Sequence @@ s, r]; -CalcNUHNMSSMDMh[args__] := +CalcNUHNMSSMHimalayaDMh[args__] := Module[{Mh, MhAs, MhYt, varyQpole, DMh, mhLoops = poleMassLoopOrder /. { args }, ytLoops, asLoops, MS = MSUSY /. { args }}, ytLoops = Max[mhLoops - 1, 1]; asLoops = Max[mhLoops - 2, 1]; - Mh = CalcNUHNMSSMMh[asLoops , ytLoops , 0, args]; - MhAs = CalcNUHNMSSMMh[asLoops + 1, ytLoops , 0, args]; - MhYt = CalcNUHNMSSMMh[asLoops , ytLoops + 1, 0, args]; - varyQpole = CalcNUHNMSSMMh[asLoops , ytLoops , #, args]& /@ + Mh = CalcNUHNMSSMHimalayaMh[asLoops , ytLoops , 0, args]; + MhAs = CalcNUHNMSSMHimalayaMh[asLoops + 1, ytLoops , 0, args]; + MhYt = CalcNUHNMSSMHimalayaMh[asLoops , ytLoops + 1, 0, args]; + varyQpole = CalcNUHNMSSMHimalayaMh[asLoops , ytLoops , #, args]& /@ LogRange[MS/2, 2 MS, 10]; If[Mh === $Failed, Return[{ $Failed, $Failed }]]; If[MhAs === $Failed || MhYt === $Failed || MemberQ[varyQpole, $Failed], diff --git a/model_files/NUTNMSSM/FlexibleSUSY.m.in b/model_files/NUTNMSSM/FlexibleSUSY.m.in index 20a1314a58..de42fba6ec 100644 --- a/model_files/NUTNMSSM/FlexibleSUSY.m.in +++ b/model_files/NUTNMSSM/FlexibleSUSY.m.in @@ -94,7 +94,7 @@ LowPoleMassPrecision = {}; ExtraSLHAOutputBlocks = { {FlexibleSUSYLowEnergy, - {{0, FlexibleSUSYObservable`aMuon} } }, + {{0, FlexibleSUSYObservable`AMM[Fe[2]]} } }, {FlexibleSUSYOutput, NoScale, {{0, Hold[HighScale]}, {1, Hold[SUSYScale]}, @@ -107,3 +107,6 @@ ExtraSLHAOutputBlocks = { {5, \[Lambda] vS / Sqrt[2]}, {10, ms2} } } }; + +FSCalculateDecays = True; + diff --git a/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM b/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM index 6ad925aecf..557d0c26d8 100644 --- a/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM +++ b/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 127.944 # ALPHA_EM^-1(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_1308.1333_BP1 b/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_1308.1333_BP1 index 1e82ac3bdf..88da6e92cf 100644 --- a/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_1308.1333_BP1 +++ b/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_1308.1333_BP1 @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 127.944 # ALPHA_EM^-1(MZ) 2 1.1663787E-5 # GF diff --git a/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_1308.1333_BP2 b/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_1308.1333_BP2 index a3f5095392..becda90940 100644 --- a/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_1308.1333_BP2 +++ b/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_1308.1333_BP2 @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 127.944 # ALPHA_EM^-1(MZ) 2 1.1663787E-5 # GF diff --git a/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_1308.1333_BP3 b/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_1308.1333_BP3 index c5aa7c06d9..4d5bcfb342 100644 --- a/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_1308.1333_BP3 +++ b/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_1308.1333_BP3 @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 127.944 # ALPHA_EM^-1(MZ) 2 1.1663787E-5 # GF diff --git a/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_GTP1 b/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_GTP1 index 4798ac7a8b..577bdd2992 100644 --- a/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_GTP1 +++ b/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_GTP1 @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM BLOCK SMINPUTS 1 1.28962000E+02 # alpha_em^(-1) 2 1.16637000E-05 # G_F diff --git a/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_GTP2 b/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_GTP2 index 767f275341..738aad7866 100644 --- a/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_GTP2 +++ b/model_files/NUTNMSSM/LesHouches.in.NUTNMSSM_GTP2 @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM BLOCK SMINPUTS 1 1.28962000E+02 # alpha_em^(-1) 2 1.16637000E-05 # G_F diff --git a/model_files/NUTSMSSM/FlexibleSUSY.m.in b/model_files/NUTSMSSM/FlexibleSUSY.m.in index 040aba8da1..90e04786e9 100644 --- a/model_files/NUTSMSSM/FlexibleSUSY.m.in +++ b/model_files/NUTSMSSM/FlexibleSUSY.m.in @@ -112,3 +112,5 @@ ExtraSLHAOutputBlocks = { {9, B[MS]}, {10, ms2} } } }; + +FSCalculateDecays = True; diff --git a/model_files/NUTSMSSM/LesHouches.in.NUTSMSSM b/model_files/NUTSMSSM/LesHouches.in.NUTSMSSM index 0484f5f355..e188c01124 100644 --- a/model_files/NUTSMSSM/LesHouches.in.NUTSMSSM +++ b/model_files/NUTSMSSM/LesHouches.in.NUTSMSSM @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/S3/FlexibleSUSY.m.in b/model_files/S3/FlexibleSUSY.m.in new file mode 100644 index 0000000000..e09656320b --- /dev/null +++ b/model_files/S3/FlexibleSUSY.m.in @@ -0,0 +1,62 @@ + +FSModelName = "@CLASSNAME@"; +FSEigenstates = SARAH`EWSB; +FSDefaultSARAHModel = S3; + +MINPAR = {{1, LambdaIN}}; + +EXTPAR = { + {0, Qin}, + {1, QEWSB}, + {2, mS3IN}, + {3, LambdaS3IN}, + {4, LambdaHS3IN} +}; + +EWSBOutputParameters = { mu2 }; + +HighScale = Qin; + +HighScaleFirstGuess = Qin; + +HighScaleInput = {{\[Lambda], LambdaIN}}; + +SUSYScale = QEWSB; + +SUSYScaleFirstGuess = QEWSB; + +SUSYScaleInput = {{YS3L, LHInput[YS3L]}, {mS3, mS3IN}, {lambdaS3, LambdaS3IN}, {lambdaHS3, LambdaHS3IN}}; + +LowScale = LowEnergyConstant[MZ]; + +LowScaleFirstGuess = LowEnergyConstant[MZ]; + +LowScaleInput = { + {v, 2 MZMSbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2]}, + {Yu, Sqrt[2] MatMul[upQuarksDRbar, CKM] / v}, + {Yd, Sqrt[2] downQuarksDRbar / v}, + {Ye, Sqrt[2] downLeptonsDRbar / v} +}; + +InitialGuessAtLowScale = { + {v, LowEnergyConstant[vev]}, + {Yu, Automatic}, + {Yd, Automatic}, + {Ye, Automatic} +}; + +ExtraSLHAOutputBlocks = { + {FlexibleSUSYOutput, + {{1, Hold[SUSYScale]}, + {2, Hold[LowScale]} } }, + {FlexibleSUSYLowEnergy, { + {20, FlexibleSUSYObservable`AMM[Fe[1]]}, + {21, FlexibleSUSYObservable`AMM[Fe[2]]}, + {26, FlexibleSUSYObservable`BrLToLGamma[Fe, 2 -> 1]}, + {27, FlexibleSUSYObservable`bsgamma} + } + } +}; + +FSCalculateDecays = True; +FSDecayParticles = {hh, phi13, phi23, phi43}; diff --git a/model_files/S3/LesHouches.in.S3 b/model_files/S3/LesHouches.in.S3 new file mode 100644 index 0000000000..52674efb79 --- /dev/null +++ b/model_files/S3/LesHouches.in.S3 @@ -0,0 +1,89 @@ +Block MODSEL # Select model + 6 1 # flavour violation +# 12 173 # DRbar parameter output scale (GeV) +Block FlexibleSUSY + 0 1.000000000e-04 # precision goal + 1 0 # max. iterations (0 = automatic) + 2 0 # solver (0 = all, 1 = two_scale, 2 = semi_analytic) + 3 1 # calculate SM pole masses + 4 4 # pole mass loop order + 5 4 # EWSB loop order + 6 4 # beta-functions loop order + 7 4 # threshold corrections loop order + 8 1 # Higgs 2-loop corrections O(alpha_t alpha_s) + 9 1 # Higgs 2-loop corrections O(alpha_b alpha_s) + 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) + 11 1 # Higgs 2-loop corrections O(alpha_tau^2) + 12 0 # force output + 13 3 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) + 14 1.000000000e-11 # beta-function zero threshold + 15 0 # calculate all observables + 16 0 # force positive majorana masses + 17 0 # pole mass renormalization scale (0 = SUSY scale) + 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) + 19 0 # EFT matching scale (0 = SUSY scale) + 20 2 # EFT loop order for upwards matching + 21 1 # EFT loop order for downwards matching + 22 0 # EFT index of SM-like Higgs in the BSM model + 23 1 # calculate BSM pole masses + 24 124111421 # individual threshold correction loop orders + 25 0 # ren. scheme for Higgs 3L corrections (0 = DR', 1 = MDR', 2 = H3m) + 26 1 # Higgs 3-loop corrections O(alpha_t alpha_s^2) + 27 1 # Higgs 3-loop corrections O(alpha_b alpha_s^2) + 28 1 # Higgs 3-loop corrections O(alpha_t^2 alpha_s) + 29 1 # Higgs 3-loop corrections O(alpha_t^3) + 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) + 28 1 # Higgs 3-loop corrections O(alpha_t^2 alpha_s) + 29 1 # Higgs 3-loop corrections O(alpha_t^3) + 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) + 31 0 # loop library (0 = softsusy) +Block FlexibleSUSYInput + 0 0.00729735 # alpha_em(0) + 1 125.09 # Mh pole +Block SMINPUTS # Standard Model inputs + 1 1.279160000e+02 # alpha^(-1) SM MSbar(MZ) + 2 1.166378700e-05 # G_Fermi + 3 1.184000000e-01 # alpha_s(MZ) SM MSbar + 4 9.118760000e+01 # MZ(pole) + 5 4.180000000e+00 # mb(mb) SM MSbar + 6 1.7300000e+02 # mtop(pole) + 7 1.776990000e+00 # mtau(pole) + 8 0.000000000e+00 # mnu3(pole) + 9 80.385 # MW pole + 11 5.109989020e-04 # melectron(pole) + 12 0.000000000e+00 # mnu1(pole) + 13 1.056583715e-01 # mmuon(pole) + 14 0.000000000e+00 # mnu2(pole) + 21 4.750000000e-03 # md(2 GeV) MS-bar + 22 2.400000000e-03 # mu(2 GeV) MS-bar + 23 1.040000000e-01 # ms(2 GeV) MS-bar + 24 1.270000000e+00 # mc(mc) MS-bar +Block VCKMIN # CKM matrix input (Wolfenstein parameters) + 1 2.272000000e-01 # lambda(MZ) SM DR-bar + 2 8.180000000e-01 # A(MZ) SM DR-bar + 3 2.210000000e-01 # rhobar(MZ) SM DR-bar + 4 3.400000000e-01 # etabar(MZ) SM DR-bar +Block MINPAR + 1 0.192 # LambdaIN +Block EXTPAR + 0 1000 # Qin + 1 173 # QEWSB + 2 1e+6 # mS3Input + 3 0.1 # lambdaS3Input + 4 0.1 # lambdaHS3Input +Block YS3LIN + 1 1 0 # YS3LInput(1,1) + 1 2 0 # YS3LInput(1,2) + 1 3 0 # YS3LInput(1,3) + 2 1 0 # YS3LInput(2,1) + 2 2 0 # YS3LInput(2,2) + 2 3 0.1 # YS3LInput(2,3) + 3 1 0.01 # YS3LInput(3,1) + 3 2 0.1 # YS3LInput(3,2) + 3 3 0.1 # YS3LInput(3,3) +Block FlexibleDecay + 0 1 # calculate decays (0 = no, 1 = yes) + 1 1e-5 # minimum BR to print + 2 41 # include higher order corrections in decays SM|BSM (0 = LO, 1 = NLO, 2 = NNLO, 3 = N^3LO, 4 = N^4LO) + 3 1 # use Thomson alpha(0) instead of alpha(m) in decays to γγ and γZ + 4 2 # off-shell decays into VV pair diff --git a/model_files/SM/FlexibleSUSY.m.in b/model_files/SM/FlexibleSUSY.m.in index 7e6fba734e..58972aaa00 100644 --- a/model_files/SM/FlexibleSUSY.m.in +++ b/model_files/SM/FlexibleSUSY.m.in @@ -64,7 +64,12 @@ LowPoleMassPrecision = {}; ExtraSLHAOutputBlocks = { {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon} } } + {{20, FlexibleSUSYObservable`AMM[Fe[1]]}, + {21, FlexibleSUSYObservable`AMM[Fe[2]]}, + {22, FlexibleSUSYObservable`AMM[Fe[3]]}, + {31, FlexibleSUSYObservable`BrLTo3L[Fe, 2 -> {1, 1, 1}, All, 1]}, + {41, FlexibleSUSYObservable`LToLConversion[Fe, 2 -> 1, Al, All, 1]} + } } }; FSCalculateDecays = True; diff --git a/model_files/SM/LesHouches.in.SM b/model_files/SM/LesHouches.in.SM index 7f29f1b416..eca9ad13b5 100644 --- a/model_files/SM/LesHouches.in.SM +++ b/model_files/SM/LesHouches.in.SM @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 3 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 3 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole @@ -61,6 +62,11 @@ Block EXTPAR # Input parameters Block FlexibleDecay 0 1 # calculate decays (0 = no, 1 = yes) 1 1e-5 # minimum BR to print - 2 4 # include higher order corrections in decays (0 = LO, 1 = NLO, 2 = NNLO, 3 = N^3LO, 4 = N^4LO ) + 2 41 # include higher order corrections in decays SM|BSM (0 = LO, 1 = NLO, 2 = NNLO, 3 = N^3LO, 4 = N^4LO) 3 1 # use Thomson alpha(0) instead of alpha(m) in decays to γγ and γZ 4 2 # off-shell decays into VV pair + 5 1 # print loop-induced Higgs couplings + 6 0 # calculate Higgs effc normalized to SM + 7 0 # call HiggsTools + 8 0 # call Lilith + 9 1 # use pole Higgs mixings in decays diff --git a/model_files/SMEFTHiggs/LesHouches.in.SMEFTHiggs b/model_files/SMEFTHiggs/LesHouches.in.SMEFTHiggs index fda412f04f..db7779d9b3 100644 --- a/model_files/SMEFTHiggs/LesHouches.in.SMEFTHiggs +++ b/model_files/SMEFTHiggs/LesHouches.in.SMEFTHiggs @@ -14,10 +14,11 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 0 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top quark 2-loop corrections QCD + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/SMHighScale/FlexibleSUSY.m.in b/model_files/SMHighScale/FlexibleSUSY.m.in index 613bbb3d03..de0344d13d 100644 --- a/model_files/SMHighScale/FlexibleSUSY.m.in +++ b/model_files/SMHighScale/FlexibleSUSY.m.in @@ -65,3 +65,5 @@ SARAH`ParameterDefinitions = Append[ Cases[SARAH`ParameterDefinitions, {p_ /; p =!= SARAH`\[Lambda], ___}], {SARAH`\[Lambda], { Description -> "SM Higgs Selfcouplings" } } ]; + +FSCalculateDecays = True; diff --git a/model_files/SMHighScale/LesHouches.in.SMHighScale b/model_files/SMHighScale/LesHouches.in.SMHighScale index bc06f7692b..f97d74e10e 100644 --- a/model_files/SMHighScale/LesHouches.in.SMHighScale +++ b/model_files/SMHighScale/LesHouches.in.SMHighScale @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 0 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/SMSSM/FlexibleSUSY.m.in b/model_files/SMSSM/FlexibleSUSY.m.in index b7409f74b2..2d0d8c17c0 100644 --- a/model_files/SMSSM/FlexibleSUSY.m.in +++ b/model_files/SMSSM/FlexibleSUSY.m.in @@ -151,6 +151,10 @@ ExtraSLHAOutputBlocks = { {{0, Hold[HighScale]}, {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, + {HMIX, + {{1, \[Mu]}, + {10, ArcTan[vu/vd]}, + {31, MS} } }, {NMSSMRUN, {{1, \[Lambda]}, {2, \[Kappa]}, diff --git a/model_files/SMSSM/LesHouches.in.SMSSM b/model_files/SMSSM/LesHouches.in.SMSSM index 135c316a3a..84b3d5604e 100644 --- a/model_files/SMSSM/LesHouches.in.SMSSM +++ b/model_files/SMSSM/LesHouches.in.SMSSM @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole diff --git a/model_files/SMSemiAnalytic/FlexibleSUSY.m.in b/model_files/SMSemiAnalytic/FlexibleSUSY.m.in index 7d09d30b68..e61500547a 100644 --- a/model_files/SMSemiAnalytic/FlexibleSUSY.m.in +++ b/model_files/SMSemiAnalytic/FlexibleSUSY.m.in @@ -70,7 +70,7 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon} } }, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]} } }, {EWSBOutputs, NoScale, {{1, mu20} } } }; diff --git a/model_files/SMSemiAnalytic/LesHouches.in.SMSemiAnalytic b/model_files/SMSemiAnalytic/LesHouches.in.SMSemiAnalytic index 48804a22d8..f54c17611b 100644 --- a/model_files/SMSemiAnalytic/LesHouches.in.SMSemiAnalytic +++ b/model_files/SMSemiAnalytic/LesHouches.in.SMSemiAnalytic @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 0 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/model_files/SSM/LesHouches.in.SSM b/model_files/SSM/LesHouches.in.SSM index 14c2cf4bf9..eae881674a 100644 --- a/model_files/SSM/LesHouches.in.SSM +++ b/model_files/SSM/LesHouches.in.SSM @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 0 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 0 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/SSMMhInput/LesHouches.in.SSMMhInput b/model_files/SSMMhInput/LesHouches.in.SSMMhInput index f79eece116..1d13553448 100644 --- a/model_files/SSMMhInput/LesHouches.in.SSMMhInput +++ b/model_files/SSMMhInput/LesHouches.in.SSMMhInput @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 0 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 0 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/SSMSemiAnalytic/LesHouches.in.SSMSemiAnalytic b/model_files/SSMSemiAnalytic/LesHouches.in.SSMSemiAnalytic index c0b4d85f17..8324f497ba 100644 --- a/model_files/SSMSemiAnalytic/LesHouches.in.SSMSemiAnalytic +++ b/model_files/SSMSemiAnalytic/LesHouches.in.SSMSemiAnalytic @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 0 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 0 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/model_files/ScalarLeptoquarks/FlexibleSUSY.m.in b/model_files/ScalarLeptoquarks/FlexibleSUSY.m.in index 96f7099390..56e5ffefc7 100644 --- a/model_files/ScalarLeptoquarks/FlexibleSUSY.m.in +++ b/model_files/ScalarLeptoquarks/FlexibleSUSY.m.in @@ -87,11 +87,11 @@ ExtraSLHAOutputBlocks = { {{1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon}, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]}, {23, FlexibleSUSYObservable`EDM[Fe[1]]}, {24, FlexibleSUSYObservable`EDM[Fe[2]]}, {25, FlexibleSUSYObservable`EDM[Fe[3]]}, - {26, FlexibleSUSYObservable`BrLToLGamma[Fe[2] -> {Fe[1], VP}]} + {26, FlexibleSUSYObservable`BrLToLGamma[Fe, 2 -> 1]} } } }; diff --git a/model_files/ScalarLeptoquarks/LesHouches.in.ScalarLeptoquarks b/model_files/ScalarLeptoquarks/LesHouches.in.ScalarLeptoquarks index ec1f2cb096..17c60f1b9f 100644 --- a/model_files/ScalarLeptoquarks/LesHouches.in.ScalarLeptoquarks +++ b/model_files/ScalarLeptoquarks/LesHouches.in.ScalarLeptoquarks @@ -12,17 +12,17 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top quark 2-loop corrections QCD + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) -Block SMINPUTS # Standard Model inputs + 15 0 # calculate all observables +Block SMINPUTS # Standard Model inputs 1 1.279340e+02 # alpha^(-1) SM MSbar(MZ) - 2 1.166370E-05 # G_F,Fermi constant - 3 1.187000E-01 # alpha_s(MZ) SM MSbar - 4 9.118870E+01 # Z-boson pole mass - 5 4.180000E+00 # m_b(mb) SM MSbar - 6 1.735000E+02 # m_top(pole) - 7 1.776690E+00 # m_tau(pole) + 2 1.166370E-05 # G_F,Fermi constant + 3 1.187000E-01 # alpha_s(MZ) SM MSbar + 4 9.118870E+01 # Z-boson pole mass + 5 4.180000E+00 # m_b(mb) SM MSbar + 6 1.735000E+02 # m_top(pole) + 7 1.776690E+00 # m_tau(pole) 8 0.000000000e+00 # mnu3(pole) 11 5.109989020e-04 # melectron(pole) 12 0.000000000e+00 # mnu1(pole) @@ -32,10 +32,10 @@ Block SMINPUTS # Standard Model inputs 22 2.400000000e-03 # mu(2 GeV) MS-bar 23 1.040000000e-01 # ms(2 GeV) MS-bar 24 1.270000000e+00 # mc(mc) MS-bar -Block MINPAR # Input parameters +Block MINPAR # Input parameters 1 1.000000E+03 # vSinput 2 1.000000E+03 # MPhiinput -Block EXTPAR # Input parameters +Block EXTPAR # Input parameters 1 1.000000E-01 # Linput 2 1.000000E+02 # LS3input 3 5.000000E-01 # LS4input @@ -45,12 +45,12 @@ Block EXTPAR # Input parameters 7 1.000000E-01 # gSPinput 8 1.000000E+03 # KSPinput 9 -1.000000E+02 # KSHinput -Block GSCIN # +Block GSCIN # 1 1 1.000000E-01 # gSC(1,1) 1 2 0.000000E+00 # gSC(1,2) 2 1 0.000000E+00 # gSC(2,1) 2 2 1.000000E-01 # gSC(2,2) -Block LAMLIN # +Block LAMLIN # 1 1 1.000000E-01 # lamL(1,1) 1 2 0.000000E+00 # lamL(1,2) 1 3 0.000000E+00 # lamL(1,3) @@ -60,7 +60,7 @@ Block LAMLIN # 3 1 0.000000E+00 # lamL(3,1) 3 2 0.000000E+00 # lamL(3,2) 3 3 1.000000E-01 # lamL(3,3) -Block LAMRIN # +Block LAMRIN # 1 1 1.000000E-01 # lamR(1,1) 1 2 0.000000E+00 # lamR(1,2) 1 3 0.000000E+00 # lamR(1,3) @@ -70,7 +70,7 @@ Block LAMRIN # 3 1 0.000000E+00 # lamR(3,1) 3 2 0.000000E+00 # lamR(3,2) 3 3 1.000000E-01 # lamR(3,3) -Block MCHIIN # +Block MCHIIN # 1 1 1.000000E+02 # MChi(1,1) 1 2 1.000000E+02 # MChi(1,2) 2 1 1.000000E+02 # MChi(2,1) diff --git a/model_files/SplitMSSM/LesHouches.in.SplitMSSM b/model_files/SplitMSSM/LesHouches.in.SplitMSSM index 22be3b72ef..753fd97eae 100644 --- a/model_files/SplitMSSM/LesHouches.in.SplitMSSM +++ b/model_files/SplitMSSM/LesHouches.in.SplitMSSM @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O(alpha_t^2 + alpha_t alpha_b + alpha_b^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279440000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/SplitMSSMEFTHiggs/LesHouches.in.SplitMSSMEFTHiggs b/model_files/SplitMSSMEFTHiggs/LesHouches.in.SplitMSSMEFTHiggs index 22be3b72ef..753fd97eae 100644 --- a/model_files/SplitMSSMEFTHiggs/LesHouches.in.SplitMSSMEFTHiggs +++ b/model_files/SplitMSSMEFTHiggs/LesHouches.in.SplitMSSMEFTHiggs @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O(alpha_t^2 + alpha_t alpha_b + alpha_b^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279440000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/THDMI/FlexibleSUSY.m.in b/model_files/THDMI/FlexibleSUSY.m.in new file mode 100644 index 0000000000..65041edc15 --- /dev/null +++ b/model_files/THDMI/FlexibleSUSY.m.in @@ -0,0 +1,100 @@ +FSModelName = "@CLASSNAME@"; +FSEigenstates = SARAH`EWSB; +FSDefaultSARAHModel = "THDM-I"; + +OnlyLowEnergyFlexibleSUSY = True; + +(* input parameters *) + +MINPAR = { + {1, Lambda1IN}, + {2, Lambda2IN}, + {3, Lambda3IN}, + {4, Lambda4IN}, + {5, Lambda5IN}, + {6, Lambda6IN}, + {7, Lambda7IN}, + {8, M122IN}, + {10, TanBeta} +}; + +EXTPAR = { + {0, Qin} +}; + +EWSBOutputParameters = { M112, M222 }; + +SUSYScale = Qin; + +SUSYScaleFirstGuess = Qin; + +SUSYScaleInput = { + {Lambda1, Lambda1IN}, + {Lambda2, Lambda2IN}, + {Lambda3, Lambda3IN}, + {Lambda4, Lambda4IN}, + {Lambda5, Lambda5IN}, + {Lambda6, Lambda6IN}, + {Lambda7, Lambda7IN}, + {M122 , M122IN} +}; + +LowScale = LowEnergyConstant[MZ]; + +LowScaleFirstGuess = LowEnergyConstant[MZ]; + +LowScaleInput = { + {v1, 2 MZMSbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Cos[ArcTan[TanBeta]]}, + {v2, 2 MZMSbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Sin[ArcTan[TanBeta]]}, + {Yu, Automatic}, + {Yd, Automatic}, + {Ye, Automatic} +}; + +InitialGuessAtLowScale = { + {v1, LowEnergyConstant[vev] Cos[ArcTan[TanBeta]]}, + {v2, LowEnergyConstant[vev] Sin[ArcTan[TanBeta]]}, + {Yu, Automatic}, + {Yd, Automatic}, + {Ye, Automatic} +}; + +DefaultPoleMassPrecision = MediumPrecision; +HighPoleMassPrecision = {hh, Ah, Hm}; +MediumPoleMassPrecision = {}; +LowPoleMassPrecision = {}; + +ExtraSLHAOutputBlocks = { + {FlexibleSUSYLowEnergy, { + {21, FlexibleSUSYObservable`AMM[Fe[2]]}, + {22, FlexibleSUSYObservable`AMMUncertainty[Fe[2]]}, + {26, FlexibleSUSYObservable`aMuonGM2Calc}, + {27, FlexibleSUSYObservable`aMuonGM2CalcUncertainty} + } + } +}; + +(* input parameters for GM2Calc, see [arxiv:2110.13238] *) +FSGM2CalcInput = { + yukawaType -> 1, + lambda1 -> 2 Lambda1, + lambda2 -> 2 Lambda2, + lambda3 -> Lambda3, + lambda4 -> Lambda4, + lambda5 -> Lambda5, + lambda6 -> Lambda6, + lambda7 -> Lambda7, + tanBeta -> v2 / v1, + m122 -> M122, + zetau -> 0, + zetad -> 0, + zetal -> 0, + deltau -> ZEROMATRIX[3,3], + deltad -> ZEROMATRIX[3,3], + deltal -> ZEROMATRIX[3,3], + piu -> ZEROMATRIX[3,3], + pid -> ZEROMATRIX[3,3], + pil -> ZEROMATRIX[3,3] +}; + +FSCalculateDecays = True; diff --git a/model_files/THDMI/LesHouches.in.THDMI b/model_files/THDMI/LesHouches.in.THDMI new file mode 100644 index 0000000000..2d25f09e51 --- /dev/null +++ b/model_files/THDMI/LesHouches.in.THDMI @@ -0,0 +1,73 @@ +Block MODSEL # Select model +# 12 1000 # parameter output scale (GeV) +Block FlexibleSUSY + 0 1.000000000e-04 # precision goal + 1 0 # max. iterations (0 = automatic) + 2 0 # algorithm (0 = all, 1 = two_scale, 2 = semi_analytic) + 3 1 # calculate SM pole masses + 4 1 # pole mass loop order + 5 1 # EWSB loop order + 6 2 # beta-functions loop order + 7 2 # threshold corrections loop order + 8 0 # Higgs 2-loop corrections O(alpha_t alpha_s) + 9 0 # Higgs 2-loop corrections O(alpha_b alpha_s) + 10 0 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) + 11 0 # Higgs 2-loop corrections O(alpha_tau^2) + 12 0 # force output + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) + 14 1.000000000e-11 # beta-function zero threshold + 15 0 # calculate all observables + 16 0 # force positive majorana masses + 17 0 # pole mass renormalization scale (0 = SUSY scale) + 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) + 19 0 # EFT matching scale (0 = SUSY scale) + 20 2 # EFT loop order for upwards matching + 21 1 # EFT loop order for downwards matching + 22 0 # EFT index of SM-like Higgs in the BSM model + 23 1 # calculate BSM pole masses + 24 123111321 # individual threshold correction loop orders + 25 0 # ren. scheme for Higgs 3L corrections (0 = DR, 1 = MDR) + 26 1 # Higgs 3-loop corrections O(alpha_t alpha_s^2) + 27 1 # Higgs 3-loop corrections O(alpha_b alpha_s^2) + 28 1 # Higgs 3-loop corrections O(alpha_t^2 alpha_s) + 29 1 # Higgs 3-loop corrections O(alpha_t^3) + 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) + 31 0 # loop library (0 = softsusy) +Block FlexibleSUSYInput + 0 0.00729735 # alpha_em(0) + 1 125.09 # Mh pole +Block SMINPUTS # Standard Model inputs + 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) + 2 1.166378700e-05 # G_Fermi + 3 1.176000000e-01 # alpha_s(MZ) SM MSbar + 4 9.118760000e+01 # MZ(pole) + 5 4.200000000e+00 # mb(mb) SM MSbar + 6 1.733000000e+02 # mtop(pole) + 7 1.777000000e+00 # mtau(pole) + 8 0.000000000e+00 # mnu3(pole) + 11 5.109989020e-04 # melectron(pole) + 12 0.000000000e+00 # mnu1(pole) + 13 1.056583570e-01 # mmuon(pole) + 14 0.000000000e+00 # mnu2(pole) + 21 4.750000000e-03 # md(2 GeV) MS-bar + 22 2.400000000e-03 # mu(2 GeV) MS-bar + 23 1.040000000e-01 # ms(2 GeV) MS-bar + 24 1.270000000e+00 # mc(mc) MS-bar +Block MINPAR # Input parameters + 1 2 # Lambda1IN + 2 0.1 # Lambda2IN + 3 0.5 # Lambda3IN + 4 0.8 # Lambda4IN + 5 -2 # Lambda5IN + 6 0 # Lambda6IN + 7 0 # Lambda7IN + 8 1000 # M122 + 10 10 # TanBeta +Block EXTPAR + 0 126 # Qin +Block FlexibleDecay + 0 1 # calculate decays (0 = no, 1 = yes) + 1 1e-5 # minimum BR to print + 2 41 # include higher order corrections in decays SM|BSM (0 = LO, 1 = NLO, 2 = NNLO, 3 = N^3LO, 4 = N^4LO) + 3 1 # use Thomson alpha(0) instead of alpha(m) in decays to γγ and γZ + 4 2 # off-shell decays into VV pair diff --git a/model_files/THDMII/FlexibleSUSY.m.in b/model_files/THDMII/FlexibleSUSY.m.in index 0c28d4f3a6..e0ef75a653 100644 --- a/model_files/THDMII/FlexibleSUSY.m.in +++ b/model_files/THDMII/FlexibleSUSY.m.in @@ -67,12 +67,36 @@ LowPoleMassPrecision = {}; ExtraSLHAOutputBlocks = { {FlexibleSUSYLowEnergy, { - {21, FlexibleSUSYObservable`aMuon}, - {23, FlexibleSUSYObservable`EDM[Fe[1]]}, - {24, FlexibleSUSYObservable`EDM[Fe[2]]}, - {25, FlexibleSUSYObservable`EDM[Fe[3]]} + {21, FlexibleSUSYObservable`AMM[Fe[2]]}, + {22, FlexibleSUSYObservable`AMMUncertainty[Fe[2]]}, + {26, FlexibleSUSYObservable`aMuonGM2Calc}, + {27, FlexibleSUSYObservable`aMuonGM2CalcUncertainty} } } }; +(* input parameters for GM2Calc, see [arxiv:2110.13238] *) +FSGM2CalcInput = { + yukawaType -> 2, + lambda1 -> 2 Lambda1, + lambda2 -> 2 Lambda2, + lambda3 -> Lambda3, + lambda4 -> Lambda4, + lambda5 -> Lambda5, + lambda6 -> Lambda6, + lambda7 -> Lambda7, + tanBeta -> v2 / v1, + m122 -> M122, + zetau -> 0, + zetad -> 0, + zetal -> 0, + deltau -> ZEROMATRIX[3,3], + deltad -> ZEROMATRIX[3,3], + deltal -> ZEROMATRIX[3,3], + piu -> ZEROMATRIX[3,3], + pid -> ZEROMATRIX[3,3], + pil -> ZEROMATRIX[3,3] +}; + FSCalculateDecays = True; + diff --git a/model_files/THDMII/LesHouches.in.THDMII b/model_files/THDMII/LesHouches.in.THDMII index 3c85c7a7c7..a4e658ace9 100644 --- a/model_files/THDMII/LesHouches.in.THDMII +++ b/model_files/THDMII/LesHouches.in.THDMII @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 0 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 0 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole @@ -68,6 +69,11 @@ Block EXTPAR Block FlexibleDecay 0 1 # calculate decays (0 = no, 1 = yes) 1 1e-5 # minimum BR to print - 2 4 # include higher order corrections in decays (0 = LO, 1 = NLO, 2 = NNLO, 3 = N^3LO, 4 = N^4LO ) + 2 41 # include higher order corrections in decays SM|BSM (0 = LO, 1 = NLO, 2 = NNLO, 3 = N^3LO, 4 = N^4LO) 3 1 # use Thomson alpha(0) instead of alpha(m) in decays to γγ and γZ 4 2 # off-shell decays into VV pair + 5 1 # print loop-induced Higgs couplings + 6 0 # calculate Higgs effc normalized to SM + 7 0 # call HiggsTools + 8 0 # call Lilith + 9 1 # use pole Higgs mixings in decays diff --git a/model_files/THDMIIMSSMBC/FlexibleSUSY.m.in b/model_files/THDMIIMSSMBC/FlexibleSUSY.m.in index c3f0fb8c68..90f919e7c2 100644 --- a/model_files/THDMIIMSSMBC/FlexibleSUSY.m.in +++ b/model_files/THDMIIMSSMBC/FlexibleSUSY.m.in @@ -13,13 +13,47 @@ EXTPAR = { {0, MSUSY}, {1, MEWSB}, {2, MuInput}, + {3, M1Input}, + {4, M2Input}, {6, MAInput}, - {7, AtInput}, - {8, AbInput}, - {9, AtauInput}, {100, LambdaLoopOrder} }; +FSAuxiliaryParameterInfo = { + {AeInput, { LesHouches -> AeIN, + ParameterDimensions -> {3,3}, + InputParameter -> True + } }, + {AdInput, { LesHouches -> AdIN, + ParameterDimensions -> {3,3}, + InputParameter -> True + } }, + {AuInput, { LesHouches -> AuIN, + ParameterDimensions -> {3,3}, + InputParameter -> True + } }, + {mslInput, { LesHouches -> MSLIN, + ParameterDimensions -> {3}, + InputParameter -> True + } }, + {mseInput, { LesHouches -> MSEIN, + ParameterDimensions -> {3}, + InputParameter -> True + } }, + {msqInput, { LesHouches -> MSQIN, + ParameterDimensions -> {3}, + InputParameter -> True + } }, + {msdInput, { LesHouches -> MSDIN, + ParameterDimensions -> {3}, + InputParameter -> True + } }, + {msuInput, { LesHouches -> MSUIN, + ParameterDimensions -> {3}, + InputParameter -> True + } } +}; + EWSBOutputParameters = { M112, M222 }; (* The high scale where we match to the MSSM *) @@ -27,27 +61,65 @@ HighScale = MSUSY; HighScaleFirstGuess = MSUSY; +Needs["THDMThresholds1L`", FileNameJoin[{Directory[], "meta", "THDM", "Thresholds_1L_full.m"}]]; + +translate = { + gY -> GUTNormalization[g1] g1, + Tu[idx__] :> AuInput[idx] Yu[idx], + Td[idx__] :> AdInput[idx] Yd[idx], + Te[idx__] :> AeInput[idx] Ye[idx], + msl[idx__] :> mslInput[idx], + mse[idx__] :> mseInput[idx], + msq[idx__] :> msqInput[idx], + msu[idx__] :> msuInput[idx], + msd[idx__] :> msdInput[idx], + M1 -> M1Input, + M2 -> M2Input, + Mu -> MuInput, + Q -> SCALE, + Conjugate[p_] :> p, + B0[m1_,m2_,mu_] :> TCB0[m1,m2,mu], + DB0[m1_,m2_] :> TCDB0[m1,m2], + C0[m1_,m2_,m3_] :> TCC0[m1,m2,m3], + D0[m1_,m2_,m3_,m4_] :> TCD0[m1,m2,m3,m4], + D2tilde[m1_,m2_,m3_,m4_] :> TCD2t[m1,m2,m3,m4], + D4tilde[m1_,m2_,m3_,m4_,mu_] :> TCD4t[m1,m2,m3,m4,mu], + W[m1_,m2_,mu_] :> TCW[m1,m2,mu] +}; + +transposeYuks = { + Yu[i_,j_] :> Yu[j,i], + Yd[i_,j_] :> Yd[j,i], + Ye[i_,j_] :> Ye[j,i], + AuInput[i_,j_] :> AuInput[j,i], + AdInput[i_,j_] :> AdInput[j,i], + AeInput[i_,j_] :> AeInput[j,i] +}; + +deltaLambda0L = GetTHDMThresholds1L[loopOrder -> {1,0}] //. translate /. transposeYuks; +deltaLambda1L = GetTHDMThresholds1L[loopOrder -> {0,1}] //. translate /. transposeYuks; + HighScaleInput = { - {Lambda1, 1/2 (1/4 ( (GUTNormalization[g1] g1)^2 + g2^2) - + UnitStep[LambdaLoopOrder-1] (deltaLambda1th1L + deltaLambda1Phi1L) + {Lambda1, 1/2 (deltaLambda0L[[1]] + + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[1]] + UnitStep[LambdaLoopOrder-2] deltaLambda1th2L)}, - {Lambda2, 1/2 (1/4 ( (GUTNormalization[g1] g1)^2 + g2^2) - + UnitStep[LambdaLoopOrder-1] (deltaLambda2th1L + deltaLambda2Phi1L) + {Lambda2, 1/2 (deltaLambda0L[[2]] + + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[2]] + UnitStep[LambdaLoopOrder-2] deltaLambda2th2L)}, - {Lambda3, 1/4 (-(GUTNormalization[g1] g1)^2 + g2^2) - + UnitStep[LambdaLoopOrder-1] (deltaLambda3th1L + deltaLambda3Phi1L) + {Lambda3, deltaLambda0L[[3]] + + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[3]] + UnitStep[LambdaLoopOrder-2] deltaLambda3th2L}, - {Lambda4, -1/2 g2^2 - + UnitStep[LambdaLoopOrder-1] (deltaLambda4th1L + deltaLambda4Phi1L) + {Lambda4, deltaLambda0L[[4]] + + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[4]] + UnitStep[LambdaLoopOrder-2] deltaLambda4th2L}, - {Lambda5, 0 - + UnitStep[LambdaLoopOrder-1] (deltaLambda5th1L + deltaLambda5Phi1L) + {Lambda5, deltaLambda0L[[5]] + + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[5]] + UnitStep[LambdaLoopOrder-2] deltaLambda5th2L}, - {Lambda6, 0 - + UnitStep[LambdaLoopOrder-1] (deltaLambda6th1L + deltaLambda6Phi1L) + {Lambda6, deltaLambda0L[[6]] + + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[6]] + UnitStep[LambdaLoopOrder-2] deltaLambda6th2L}, - {Lambda7, 0 - + UnitStep[LambdaLoopOrder-1] (deltaLambda7th1L + deltaLambda7Phi1L) + {Lambda7, deltaLambda0L[[7]] + + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[7]] + UnitStep[LambdaLoopOrder-2] deltaLambda7th2L} }; @@ -87,263 +159,6 @@ HighPoleMassPrecision = {hh}; MediumPoleMassPrecision = {}; LowPoleMassPrecision = {}; -(* abbreviations *) -At = AtInput; -Ab = AbInput; -Atau = AtauInput; -Lambda1WagnerLee = 2 Lambda1; -Lambda2WagnerLee = 2 Lambda2; - -(* arxiv:1508.00576, Eq. (45) *) -deltaLambda1th1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - gY = GUTNormalization[g1] g1, - muMS = MuInput / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY - }, - ( - - kappa/2 ht^4 muMS^4 - + 6 kappa hb^4 AbMS^2 (1 - AbMS^2/12) - + 2 kappa htau^4 AtauMS^2 (1 - AtauMS^2/12) - + kappa (g2^2 + gY^2)/4 (3 ht^2 muMS^2 - 3 hb^2 AbMS^2 - htau^2 AtauMS^2) - ) -]; - -(* arxiv:1508.00576, Eq. (46) *) -deltaLambda2th1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - gY = GUTNormalization[g1] g1, - muMS = MuInput / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY, - AtMS = At / MSUSY - }, - ( - 6 kappa ht^4 AtMS^2 (1 - AtMS^2/12) - - kappa/2 hb^4 muMS^4 - - kappa/6 htau^4 muMS^4 - - kappa (g2^2 + gY^2)/4 (3 ht^2 AtMS^2 - 3 hb^2 muMS^2 - htau^2 muMS^2) - ) -]; - -(* arxiv:1508.00576, Eq. (47)-(48) *) -deltaLambda3th1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - gY = GUTNormalization[g1] g1, - muMS = MuInput / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY, - AtMS = At / MSUSY - }, - ( - kappa/6 muMS^2 (3 ht^4 (3 - AtMS^2) - + 3 hb^4 (3 - AbMS^2) - + htau^4 (3 - AtauMS^2)) - + kappa/2 ht^2 hb^2 (3 (AtMS + AbMS)^2 - - (muMS^2 - AtMS AbMS)^2 - - 6 muMS^2) - - kappa/2 (g2^2 - gY^2)/4 (3 ht^2 (AtMS^2 - muMS^2) - + 3 hb^2 (AbMS^2 - muMS^2) - + htau^2 (AtauMS^2 - muMS^2)) - ) -]; - -(* arxiv:1508.00576, Eq. (49) *) -deltaLambda4th1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - gY = GUTNormalization[g1] g1, - muMS = MuInput / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY, - AtMS = At / MSUSY - }, - ( - kappa/6 muMS^2 (3 ht^4 (3 - AtMS^2) - + 3 hb^4 (3 - AbMS^2) - + htau^4 (3 - AtauMS^2)) - - kappa/2 ht^2 hb^2 (3 (AtMS + AbMS)^2 - - (muMS^2 - AtMS AbMS)^2 - - 6 muMS^2) - + kappa/2 g2^2/2 (3 ht^2 (AtMS^2 - muMS^2) - + 3 hb^2 (AbMS^2 - muMS^2) - + htau^2 (AtauMS^2 - muMS^2)) - ) -]; - -(* arxiv:1508.00576, Eq. (50) *) -deltaLambda5th1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - muMS = MuInput / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY, - AtMS = At / MSUSY - }, - ( - - kappa/6 muMS^2 (3 ht^4 AtMS^2 + 3 hb^4 AbMS^2 + htau^4 AtauMS^2) - ) -]; - -(* arxiv:1508.00576, Eq. (51) *) -deltaLambda6th1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - muMS = MuInput / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY, - AtMS = At / MSUSY, - gbar = ((GUTNormalization[g1] g1)^2 + g2^2) / 4 - }, - ( - kappa/6 muMS (+ 3 ht^4 muMS^2 AtMS - + 3 hb^4 AbMS (AbMS^2 - 6) - + htau^4 AtauMS (AtauMS^2 - 6)) - (* arxiv:hep-ph/9307201, Eq. (6.13)-(6.14) *) - + gbar/2 kappa muMS (+ 3 AbMS hb^2 - - 3 AtMS ht^2 - + AtauMS htau^2) - ) -]; - -(* arxiv:1508.00576, Eq. (52) *) -deltaLambda7th1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - muMS = MuInput / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY, - AtMS = At / MSUSY, - gbar = ((GUTNormalization[g1] g1)^2 + g2^2) / 4 - }, - ( - kappa/6 muMS (+ 3 ht^4 AtMS (AtMS^2 - 6) - + 3 hb^4 muMS^2 AbMS - + htau^4 muMS^2 AtauMS) - (* arxiv:hep-ph/9307201, Eq. (6.13)-(6.14) *) - - gbar/2 kappa muMS (+ 3 AbMS hb^2 - - 3 AtMS ht^2 - + AtauMS htau^2) - ) -]; - -(* arxiv:1508.00576, Eq. (53) *) -deltaLambda1Phi1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - gY = GUTNormalization[g1] g1, - muMS = MuInput / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY - }, - ( - -kappa/6 (g2^2 + gY^2)/2 (3 ht^2 muMS^2 + 3hb^2 AbMS^2 + htau^2 AtauMS^2) - ) -]; - -(* arxiv:1508.00576, Eq. (54) *) -deltaLambda2Phi1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - gY = GUTNormalization[g1] g1, - muMS = MuInput / MSUSY, - AtMS = At / MSUSY - }, - ( - -kappa/6 (g2^2 + gY^2)/2 (3 ht^2 AtMS^2 + 3 hb^2 muMS^2 + htau^2 muMS^2) - ) -]; - -(* arxiv:1508.00576, Eq. (55) *) -deltaLambda3Phi1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - gY = GUTNormalization[g1] g1, - muMS = MuInput / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY, - AtMS = At / MSUSY - }, - ( - -kappa/6 (g2^2 - gY^2)/4 (3 ht^2 (AtMS^2 + muMS^2) + 3 hb^2 (AbMS^2 + muMS^2) + htau^2 (AtauMS^2 + muMS^2)) - ) -]; - -(* arxiv:1508.00576, Eq. (56) *) -deltaLambda4Phi1L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - hb = Yd[3,3], - htau = Ye[3,3], - muMS = MuInput / MSUSY, - AbMS = Ab / MSUSY, - AtauMS = Atau / MSUSY, - AtMS = At / MSUSY - }, - ( - kappa/6 g2^2/2 (3 ht^2 (AtMS^2 + muMS^2) + 3 hb^2 (AbMS^2 + muMS^2) + htau^2 (AtauMS^2 + muMS^2)) - ) -]; - -(* arxiv:1508.00576, Eq. (57) *) -deltaLambda5Phi1L = 0; -deltaLambda6Phi1L = 0; (* wrong in arxiv:hep-ph/9307201, Eq. (6.17) *) -deltaLambda7Phi1L = 0; (* wrong in arxiv:hep-ph/9307201, Eq. (6.17) *) - -(* Partial O(alpha_t^2) correction (only sinb^6 part) from Eq.(25) of [1312.5743]. - Intended to be added to lambda[2]. *) -Deltaht6LambdaMSSM = With[{ - kappa = 1/(4 Pi)^2, - htMS = Yu[3,3], - sinb = Sin[ArcTan[TanBeta]], - cosb = Cos[ArcTan[TanBeta]], - muMS = MuInput / MSUSY, - AtMS = At / MSUSY, - k = -0.1953256 - }, - ( - 3 kappa^2 htMS^6 sinb^4 (1/2 + 6 muMS^2 - - 2 (4 + muMS^2) TCfth[1][muMS] + - 3 muMS^2 TCfth[2][muMS] + 4 TCfth[3][muMS] - + (-(17/2) - 6 muMS^2 - (4 + 3 muMS^2) TCfth[2][muMS] + - (4 - 6 muMS^2) TCfth[1][muMS]) XtMS^2 + - (23 + 4 sinb^2 + 4 muMS^2 + 2 TCfth[2][muMS] - - 2 (1 - 2 muMS^2) TCfth[1][muMS]) XtMS^4/4 - - 13/24 sinb^2 XtMS^6 + - cosb^2 (-9/2 + 60 k + (27/2 - 24 k) XtMS^2 - - 6 XtMS^4 - (3 + 16 k) (4 XtMS + YtMS) YtMS + - 4 (1 + 4 k) XtMS^3 YtMS + (14/3 + 24 k) XtMS^2 YtMS^2 - (19/ - 12 + 8 k) XtMS^4 YtMS^2)) - ) /. { - XtMS -> AtMS - muMS/TanBeta, - YtMS -> AtMS + muMS TanBeta - } -]; - (* arxiv:1508.00576, Eq. (59) *) deltaLambda1th2L = With[{ kappa = 1/(4 Pi)^2, @@ -360,7 +175,7 @@ deltaLambda2th2L = With[{ kappa = 1/(4 Pi)^2, ht = Yu[3,3], muMS = MuInput / MSUSY, - AtMS = At / MSUSY + AtMS = AuInput[3,3] / MSUSY }, ( 16 kappa^2 ht^4 g3^2 (-2 AtMS + 1/3 AtMS^3 - 1/12 AtMS^4) @@ -372,7 +187,7 @@ deltaLambda3th2L = With[{ kappa = 1/(4 Pi)^2, ht = Yu[3,3], muMS = MuInput / MSUSY, - AtMS = At / MSUSY + AtMS = AuInput[3,3] / MSUSY }, ( 2 kappa^2 ht^4 g3^2 AtMS muMS^2 (1 - 1/2 AtMS) @@ -387,7 +202,7 @@ deltaLambda6th2L = With[{ kappa = 1/(4 Pi)^2, ht = Yu[3,3], muMS = MuInput / MSUSY, - AtMS = At / MSUSY + AtMS = AuInput[3,3] / MSUSY }, ( 4/3 kappa^2 ht^4 g3^2 muMS^3 (-1 + AtMS) @@ -399,7 +214,7 @@ deltaLambda7th2L = With[{ kappa = 1/(4 Pi)^2, ht = Yu[3,3], muMS = MuInput / MSUSY, - AtMS = At / MSUSY + AtMS = AuInput[3,3] / MSUSY }, ( 4 kappa^2 ht^4 g3^2 muMS (2 - AtMS^2 + 1/3 AtMS^3) diff --git a/model_files/THDMIIMSSMBCFull/LesHouches.in.THDMIIMSSMBCFull b/model_files/THDMIIMSSMBC/LesHouches.in.THDMIIMSSMBCFull similarity index 98% rename from model_files/THDMIIMSSMBCFull/LesHouches.in.THDMIIMSSMBCFull rename to model_files/THDMIIMSSMBC/LesHouches.in.THDMIIMSSMBCFull index d8fc97a3cb..02d7b21193 100644 --- a/model_files/THDMIIMSSMBCFull/LesHouches.in.THDMIIMSSMBCFull +++ b/model_files/THDMIIMSSMBC/LesHouches.in.THDMIIMSSMBCFull @@ -14,7 +14,7 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O(alpha_t^2 + alpha_t alpha_b + alpha_b^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) Block SMINPUTS # Standard Model inputs 1 1.279440000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/THDMIIMSSMBCFull/FlexibleSUSY.m.in b/model_files/THDMIIMSSMBCFull/FlexibleSUSY.m.in deleted file mode 100644 index 90f919e7c2..0000000000 --- a/model_files/THDMIIMSSMBCFull/FlexibleSUSY.m.in +++ /dev/null @@ -1,222 +0,0 @@ -FSModelName = "@CLASSNAME@"; -FSEigenstates = SARAH`EWSB; -AutomaticInputAtMSUSY = False; -FSDefaultSARAHModel = "THDM-II"; - -(* input parameters *) - -MINPAR = { - {3, TanBeta} -}; - -EXTPAR = { - {0, MSUSY}, - {1, MEWSB}, - {2, MuInput}, - {3, M1Input}, - {4, M2Input}, - {6, MAInput}, - {100, LambdaLoopOrder} -}; - -FSAuxiliaryParameterInfo = { - {AeInput, { LesHouches -> AeIN, - ParameterDimensions -> {3,3}, - InputParameter -> True - } }, - {AdInput, { LesHouches -> AdIN, - ParameterDimensions -> {3,3}, - InputParameter -> True - } }, - {AuInput, { LesHouches -> AuIN, - ParameterDimensions -> {3,3}, - InputParameter -> True - } }, - {mslInput, { LesHouches -> MSLIN, - ParameterDimensions -> {3}, - InputParameter -> True - } }, - {mseInput, { LesHouches -> MSEIN, - ParameterDimensions -> {3}, - InputParameter -> True - } }, - {msqInput, { LesHouches -> MSQIN, - ParameterDimensions -> {3}, - InputParameter -> True - } }, - {msdInput, { LesHouches -> MSDIN, - ParameterDimensions -> {3}, - InputParameter -> True - } }, - {msuInput, { LesHouches -> MSUIN, - ParameterDimensions -> {3}, - InputParameter -> True - } } -}; - -EWSBOutputParameters = { M112, M222 }; - -(* The high scale where we match to the MSSM *) -HighScale = MSUSY; - -HighScaleFirstGuess = MSUSY; - -Needs["THDMThresholds1L`", FileNameJoin[{Directory[], "meta", "THDM", "Thresholds_1L_full.m"}]]; - -translate = { - gY -> GUTNormalization[g1] g1, - Tu[idx__] :> AuInput[idx] Yu[idx], - Td[idx__] :> AdInput[idx] Yd[idx], - Te[idx__] :> AeInput[idx] Ye[idx], - msl[idx__] :> mslInput[idx], - mse[idx__] :> mseInput[idx], - msq[idx__] :> msqInput[idx], - msu[idx__] :> msuInput[idx], - msd[idx__] :> msdInput[idx], - M1 -> M1Input, - M2 -> M2Input, - Mu -> MuInput, - Q -> SCALE, - Conjugate[p_] :> p, - B0[m1_,m2_,mu_] :> TCB0[m1,m2,mu], - DB0[m1_,m2_] :> TCDB0[m1,m2], - C0[m1_,m2_,m3_] :> TCC0[m1,m2,m3], - D0[m1_,m2_,m3_,m4_] :> TCD0[m1,m2,m3,m4], - D2tilde[m1_,m2_,m3_,m4_] :> TCD2t[m1,m2,m3,m4], - D4tilde[m1_,m2_,m3_,m4_,mu_] :> TCD4t[m1,m2,m3,m4,mu], - W[m1_,m2_,mu_] :> TCW[m1,m2,mu] -}; - -transposeYuks = { - Yu[i_,j_] :> Yu[j,i], - Yd[i_,j_] :> Yd[j,i], - Ye[i_,j_] :> Ye[j,i], - AuInput[i_,j_] :> AuInput[j,i], - AdInput[i_,j_] :> AdInput[j,i], - AeInput[i_,j_] :> AeInput[j,i] -}; - -deltaLambda0L = GetTHDMThresholds1L[loopOrder -> {1,0}] //. translate /. transposeYuks; -deltaLambda1L = GetTHDMThresholds1L[loopOrder -> {0,1}] //. translate /. transposeYuks; - -HighScaleInput = { - {Lambda1, 1/2 (deltaLambda0L[[1]] - + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[1]] - + UnitStep[LambdaLoopOrder-2] deltaLambda1th2L)}, - {Lambda2, 1/2 (deltaLambda0L[[2]] - + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[2]] - + UnitStep[LambdaLoopOrder-2] deltaLambda2th2L)}, - {Lambda3, deltaLambda0L[[3]] - + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[3]] - + UnitStep[LambdaLoopOrder-2] deltaLambda3th2L}, - {Lambda4, deltaLambda0L[[4]] - + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[4]] - + UnitStep[LambdaLoopOrder-2] deltaLambda4th2L}, - {Lambda5, deltaLambda0L[[5]] - + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[5]] - + UnitStep[LambdaLoopOrder-2] deltaLambda5th2L}, - {Lambda6, deltaLambda0L[[6]] - + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[6]] - + UnitStep[LambdaLoopOrder-2] deltaLambda6th2L}, - {Lambda7, deltaLambda0L[[7]] - + UnitStep[LambdaLoopOrder-1] deltaLambda1L[[7]] - + UnitStep[LambdaLoopOrder-2] deltaLambda7th2L} -}; - -(* The scale where we impose the EWSB conditions - and calculate the spectrum *) -SUSYScale = MEWSB; - -SUSYScaleFirstGuess = MEWSB; - -SUSYScaleInput = { - {M122 , MAInput^2 Sin[ArcTan[v2/v1]] Cos[ArcTan[v2/v1]]} -}; - -LowScale = LowEnergyConstant[MT]; - -LowScaleFirstGuess = LowEnergyConstant[MT]; - -LowScaleInput = { - {Yu, Automatic}, - {Yd, Automatic}, - {Ye, Automatic}, - {v1, 2 MZMSbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Cos[ArcTan[TanBeta]]}, - {v2, 2 MZMSbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Sin[ArcTan[TanBeta]]} -}; - -InitialGuessAtLowScale = { - {v1, LowEnergyConstant[vev] Cos[ArcTan[TanBeta]]}, - {v2, LowEnergyConstant[vev] Sin[ArcTan[TanBeta]]}, - {Yu, Automatic}, - {Yd, Automatic}, - {Ye, Automatic}, - {M122, MAInput^2 Sin[ArcTan[TanBeta]] Cos[ArcTan[TanBeta]]} -}; - -DefaultPoleMassPrecision = MediumPrecision; -HighPoleMassPrecision = {hh}; -MediumPoleMassPrecision = {}; -LowPoleMassPrecision = {}; - -(* arxiv:1508.00576, Eq. (59) *) -deltaLambda1th2L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - muMS = MuInput / MSUSY - }, - ( - -4/3 kappa^2 ht^4 g3^2 muMS^4 - ) -]; - -(* arxiv:1508.00576, Eq. (60) *) -deltaLambda2th2L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - muMS = MuInput / MSUSY, - AtMS = AuInput[3,3] / MSUSY - }, - ( - 16 kappa^2 ht^4 g3^2 (-2 AtMS + 1/3 AtMS^3 - 1/12 AtMS^4) - ) -]; - -(* arxiv:1508.00576, Eq. (61) *) -deltaLambda3th2L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - muMS = MuInput / MSUSY, - AtMS = AuInput[3,3] / MSUSY - }, - ( - 2 kappa^2 ht^4 g3^2 AtMS muMS^2 (1 - 1/2 AtMS) - ) -]; - -deltaLambda4th2L = deltaLambda3th2L; -deltaLambda5th2L = 0; - -(* arxiv:1508.00576, Eq. (62) *) -deltaLambda6th2L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - muMS = MuInput / MSUSY, - AtMS = AuInput[3,3] / MSUSY - }, - ( - 4/3 kappa^2 ht^4 g3^2 muMS^3 (-1 + AtMS) - ) -]; - -(* arxiv:1508.00576, Eq. (63) *) -deltaLambda7th2L = With[{ - kappa = 1/(4 Pi)^2, - ht = Yu[3,3], - muMS = MuInput / MSUSY, - AtMS = AuInput[3,3] / MSUSY - }, - ( - 4 kappa^2 ht^4 g3^2 muMS (2 - AtMS^2 + 1/3 AtMS^3) - ) -]; diff --git a/model_files/THDMX/FlexibleSUSY.m.in b/model_files/THDMX/FlexibleSUSY.m.in new file mode 100644 index 0000000000..ff8fd9d2e4 --- /dev/null +++ b/model_files/THDMX/FlexibleSUSY.m.in @@ -0,0 +1,100 @@ +FSModelName = "@CLASSNAME@"; +FSEigenstates = SARAH`EWSB; +FSDefaultSARAHModel = "THDM-X"; + +OnlyLowEnergyFlexibleSUSY = True; + +(* input parameters *) + +MINPAR = { + {1, Lambda1IN}, + {2, Lambda2IN}, + {3, Lambda3IN}, + {4, Lambda4IN}, + {5, Lambda5IN}, + {6, Lambda6IN}, + {7, Lambda7IN}, + {8, M122IN}, + {10, TanBeta} +}; + +EXTPAR = { + {0, Qin} +}; + +EWSBOutputParameters = { M112, M222 }; + +SUSYScale = Qin; + +SUSYScaleFirstGuess = Qin; + +SUSYScaleInput = { + {Lambda1, Lambda1IN}, + {Lambda2, Lambda2IN}, + {Lambda3, Lambda3IN}, + {Lambda4, Lambda4IN}, + {Lambda5, Lambda5IN}, + {Lambda6, Lambda6IN}, + {Lambda7, Lambda7IN}, + {M122 , M122IN} +}; + +LowScale = LowEnergyConstant[MZ]; + +LowScaleFirstGuess = LowEnergyConstant[MZ]; + +LowScaleInput = { + {v1, 2 MZMSbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Cos[ArcTan[TanBeta]]}, + {v2, 2 MZMSbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Sin[ArcTan[TanBeta]]}, + {Yu, Automatic}, + {Yd, Automatic}, + {Ye, Automatic} +}; + +InitialGuessAtLowScale = { + {v1, LowEnergyConstant[vev] Cos[ArcTan[TanBeta]]}, + {v2, LowEnergyConstant[vev] Sin[ArcTan[TanBeta]]}, + {Yu, Automatic}, + {Yd, Automatic}, + {Ye, Automatic} +}; + +DefaultPoleMassPrecision = MediumPrecision; +HighPoleMassPrecision = {hh, Ah, Hm}; +MediumPoleMassPrecision = {}; +LowPoleMassPrecision = {}; + +ExtraSLHAOutputBlocks = { + {FlexibleSUSYLowEnergy, { + {21, FlexibleSUSYObservable`AMM[Fe[2]]}, + {22, FlexibleSUSYObservable`AMMUncertainty[Fe[2]]}, + {26, FlexibleSUSYObservable`aMuonGM2Calc}, + {27, FlexibleSUSYObservable`aMuonGM2CalcUncertainty} + } + } +}; + +(* input parameters for GM2Calc, see [arxiv:2110.13238] *) +FSGM2CalcInput = { + yukawaType -> 3, + lambda1 -> 2 Lambda1, + lambda2 -> 2 Lambda2, + lambda3 -> Lambda3, + lambda4 -> Lambda4, + lambda5 -> Lambda5, + lambda6 -> Lambda6, + lambda7 -> Lambda7, + tanBeta -> v2 / v1, + m122 -> M122, + zetau -> 0, + zetad -> 0, + zetal -> 0, + deltau -> ZEROMATRIX[3,3], + deltad -> ZEROMATRIX[3,3], + deltal -> ZEROMATRIX[3,3], + piu -> ZEROMATRIX[3,3], + pid -> ZEROMATRIX[3,3], + pil -> ZEROMATRIX[3,3] +}; + +FSCalculateDecays = True; diff --git a/model_files/THDMX/LesHouches.in.THDMX b/model_files/THDMX/LesHouches.in.THDMX new file mode 100644 index 0000000000..2d25f09e51 --- /dev/null +++ b/model_files/THDMX/LesHouches.in.THDMX @@ -0,0 +1,73 @@ +Block MODSEL # Select model +# 12 1000 # parameter output scale (GeV) +Block FlexibleSUSY + 0 1.000000000e-04 # precision goal + 1 0 # max. iterations (0 = automatic) + 2 0 # algorithm (0 = all, 1 = two_scale, 2 = semi_analytic) + 3 1 # calculate SM pole masses + 4 1 # pole mass loop order + 5 1 # EWSB loop order + 6 2 # beta-functions loop order + 7 2 # threshold corrections loop order + 8 0 # Higgs 2-loop corrections O(alpha_t alpha_s) + 9 0 # Higgs 2-loop corrections O(alpha_b alpha_s) + 10 0 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) + 11 0 # Higgs 2-loop corrections O(alpha_tau^2) + 12 0 # force output + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) + 14 1.000000000e-11 # beta-function zero threshold + 15 0 # calculate all observables + 16 0 # force positive majorana masses + 17 0 # pole mass renormalization scale (0 = SUSY scale) + 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) + 19 0 # EFT matching scale (0 = SUSY scale) + 20 2 # EFT loop order for upwards matching + 21 1 # EFT loop order for downwards matching + 22 0 # EFT index of SM-like Higgs in the BSM model + 23 1 # calculate BSM pole masses + 24 123111321 # individual threshold correction loop orders + 25 0 # ren. scheme for Higgs 3L corrections (0 = DR, 1 = MDR) + 26 1 # Higgs 3-loop corrections O(alpha_t alpha_s^2) + 27 1 # Higgs 3-loop corrections O(alpha_b alpha_s^2) + 28 1 # Higgs 3-loop corrections O(alpha_t^2 alpha_s) + 29 1 # Higgs 3-loop corrections O(alpha_t^3) + 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) + 31 0 # loop library (0 = softsusy) +Block FlexibleSUSYInput + 0 0.00729735 # alpha_em(0) + 1 125.09 # Mh pole +Block SMINPUTS # Standard Model inputs + 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) + 2 1.166378700e-05 # G_Fermi + 3 1.176000000e-01 # alpha_s(MZ) SM MSbar + 4 9.118760000e+01 # MZ(pole) + 5 4.200000000e+00 # mb(mb) SM MSbar + 6 1.733000000e+02 # mtop(pole) + 7 1.777000000e+00 # mtau(pole) + 8 0.000000000e+00 # mnu3(pole) + 11 5.109989020e-04 # melectron(pole) + 12 0.000000000e+00 # mnu1(pole) + 13 1.056583570e-01 # mmuon(pole) + 14 0.000000000e+00 # mnu2(pole) + 21 4.750000000e-03 # md(2 GeV) MS-bar + 22 2.400000000e-03 # mu(2 GeV) MS-bar + 23 1.040000000e-01 # ms(2 GeV) MS-bar + 24 1.270000000e+00 # mc(mc) MS-bar +Block MINPAR # Input parameters + 1 2 # Lambda1IN + 2 0.1 # Lambda2IN + 3 0.5 # Lambda3IN + 4 0.8 # Lambda4IN + 5 -2 # Lambda5IN + 6 0 # Lambda6IN + 7 0 # Lambda7IN + 8 1000 # M122 + 10 10 # TanBeta +Block EXTPAR + 0 126 # Qin +Block FlexibleDecay + 0 1 # calculate decays (0 = no, 1 = yes) + 1 1e-5 # minimum BR to print + 2 41 # include higher order corrections in decays SM|BSM (0 = LO, 1 = NLO, 2 = NNLO, 3 = N^3LO, 4 = N^4LO) + 3 1 # use Thomson alpha(0) instead of alpha(m) in decays to γγ and γZ + 4 2 # off-shell decays into VV pair diff --git a/model_files/THDMY/FlexibleSUSY.m.in b/model_files/THDMY/FlexibleSUSY.m.in new file mode 100644 index 0000000000..0c3d3b050a --- /dev/null +++ b/model_files/THDMY/FlexibleSUSY.m.in @@ -0,0 +1,100 @@ +FSModelName = "@CLASSNAME@"; +FSEigenstates = SARAH`EWSB; +FSDefaultSARAHModel = "THDM-Y"; + +OnlyLowEnergyFlexibleSUSY = True; + +(* input parameters *) + +MINPAR = { + {1, Lambda1IN}, + {2, Lambda2IN}, + {3, Lambda3IN}, + {4, Lambda4IN}, + {5, Lambda5IN}, + {6, Lambda6IN}, + {7, Lambda7IN}, + {8, M122IN}, + {10, TanBeta} +}; + +EXTPAR = { + {0, Qin} +}; + +EWSBOutputParameters = { M112, M222 }; + +SUSYScale = Qin; + +SUSYScaleFirstGuess = Qin; + +SUSYScaleInput = { + {Lambda1, Lambda1IN}, + {Lambda2, Lambda2IN}, + {Lambda3, Lambda3IN}, + {Lambda4, Lambda4IN}, + {Lambda5, Lambda5IN}, + {Lambda6, Lambda6IN}, + {Lambda7, Lambda7IN}, + {M122 , M122IN} +}; + +LowScale = LowEnergyConstant[MZ]; + +LowScaleFirstGuess = LowEnergyConstant[MZ]; + +LowScaleInput = { + {v1, 2 MZMSbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Cos[ArcTan[TanBeta]]}, + {v2, 2 MZMSbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Sin[ArcTan[TanBeta]]}, + {Yu, Automatic}, + {Yd, Automatic}, + {Ye, Automatic} +}; + +InitialGuessAtLowScale = { + {v1, LowEnergyConstant[vev] Cos[ArcTan[TanBeta]]}, + {v2, LowEnergyConstant[vev] Sin[ArcTan[TanBeta]]}, + {Yu, Automatic}, + {Yd, Automatic}, + {Ye, Automatic} +}; + +DefaultPoleMassPrecision = MediumPrecision; +HighPoleMassPrecision = {hh, Ah, Hm}; +MediumPoleMassPrecision = {}; +LowPoleMassPrecision = {}; + +ExtraSLHAOutputBlocks = { + {FlexibleSUSYLowEnergy, { + {21, FlexibleSUSYObservable`AMM[Fe[2]]}, + {22, FlexibleSUSYObservable`AMMUncertainty[Fe[2]]}, + {26, FlexibleSUSYObservable`aMuonGM2Calc}, + {27, FlexibleSUSYObservable`aMuonGM2CalcUncertainty} + } + } +}; + +(* input parameters for GM2Calc, see [arxiv:2110.13238] *) +FSGM2CalcInput = { + yukawaType -> 4, + lambda1 -> 2 Lambda1, + lambda2 -> 2 Lambda2, + lambda3 -> Lambda3, + lambda4 -> Lambda4, + lambda5 -> Lambda5, + lambda6 -> Lambda6, + lambda7 -> Lambda7, + tanBeta -> v2 / v1, + m122 -> M122, + zetau -> 0, + zetad -> 0, + zetal -> 0, + deltau -> ZEROMATRIX[3,3], + deltad -> ZEROMATRIX[3,3], + deltal -> ZEROMATRIX[3,3], + piu -> ZEROMATRIX[3,3], + pid -> ZEROMATRIX[3,3], + pil -> ZEROMATRIX[3,3] +}; + +FSCalculateDecays = True; diff --git a/model_files/THDMY/LesHouches.in.THDMY b/model_files/THDMY/LesHouches.in.THDMY new file mode 100644 index 0000000000..2d25f09e51 --- /dev/null +++ b/model_files/THDMY/LesHouches.in.THDMY @@ -0,0 +1,73 @@ +Block MODSEL # Select model +# 12 1000 # parameter output scale (GeV) +Block FlexibleSUSY + 0 1.000000000e-04 # precision goal + 1 0 # max. iterations (0 = automatic) + 2 0 # algorithm (0 = all, 1 = two_scale, 2 = semi_analytic) + 3 1 # calculate SM pole masses + 4 1 # pole mass loop order + 5 1 # EWSB loop order + 6 2 # beta-functions loop order + 7 2 # threshold corrections loop order + 8 0 # Higgs 2-loop corrections O(alpha_t alpha_s) + 9 0 # Higgs 2-loop corrections O(alpha_b alpha_s) + 10 0 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) + 11 0 # Higgs 2-loop corrections O(alpha_tau^2) + 12 0 # force output + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) + 14 1.000000000e-11 # beta-function zero threshold + 15 0 # calculate all observables + 16 0 # force positive majorana masses + 17 0 # pole mass renormalization scale (0 = SUSY scale) + 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) + 19 0 # EFT matching scale (0 = SUSY scale) + 20 2 # EFT loop order for upwards matching + 21 1 # EFT loop order for downwards matching + 22 0 # EFT index of SM-like Higgs in the BSM model + 23 1 # calculate BSM pole masses + 24 123111321 # individual threshold correction loop orders + 25 0 # ren. scheme for Higgs 3L corrections (0 = DR, 1 = MDR) + 26 1 # Higgs 3-loop corrections O(alpha_t alpha_s^2) + 27 1 # Higgs 3-loop corrections O(alpha_b alpha_s^2) + 28 1 # Higgs 3-loop corrections O(alpha_t^2 alpha_s) + 29 1 # Higgs 3-loop corrections O(alpha_t^3) + 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) + 31 0 # loop library (0 = softsusy) +Block FlexibleSUSYInput + 0 0.00729735 # alpha_em(0) + 1 125.09 # Mh pole +Block SMINPUTS # Standard Model inputs + 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) + 2 1.166378700e-05 # G_Fermi + 3 1.176000000e-01 # alpha_s(MZ) SM MSbar + 4 9.118760000e+01 # MZ(pole) + 5 4.200000000e+00 # mb(mb) SM MSbar + 6 1.733000000e+02 # mtop(pole) + 7 1.777000000e+00 # mtau(pole) + 8 0.000000000e+00 # mnu3(pole) + 11 5.109989020e-04 # melectron(pole) + 12 0.000000000e+00 # mnu1(pole) + 13 1.056583570e-01 # mmuon(pole) + 14 0.000000000e+00 # mnu2(pole) + 21 4.750000000e-03 # md(2 GeV) MS-bar + 22 2.400000000e-03 # mu(2 GeV) MS-bar + 23 1.040000000e-01 # ms(2 GeV) MS-bar + 24 1.270000000e+00 # mc(mc) MS-bar +Block MINPAR # Input parameters + 1 2 # Lambda1IN + 2 0.1 # Lambda2IN + 3 0.5 # Lambda3IN + 4 0.8 # Lambda4IN + 5 -2 # Lambda5IN + 6 0 # Lambda6IN + 7 0 # Lambda7IN + 8 1000 # M122 + 10 10 # TanBeta +Block EXTPAR + 0 126 # Qin +Block FlexibleDecay + 0 1 # calculate decays (0 = no, 1 = yes) + 1 1e-5 # minimum BR to print + 2 41 # include higher order corrections in decays SM|BSM (0 = LO, 1 = NLO, 2 = NNLO, 3 = N^3LO, 4 = N^4LO) + 3 1 # use Thomson alpha(0) instead of alpha(m) in decays to γγ and γZ + 4 2 # off-shell decays into VV pair diff --git a/model_files/U1xMSSM3G/LesHouches.in.U1xMSSM3G b/model_files/U1xMSSM3G/LesHouches.in.U1xMSSM3G index 86207a2740..322eda05e5 100644 --- a/model_files/U1xMSSM3G/LesHouches.in.U1xMSSM3G +++ b/model_files/U1xMSSM3G/LesHouches.in.U1xMSSM3G @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 0 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 0 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 1 # calculate observables (a_muon, ...) + 15 1 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,17 +33,18 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole Block SMINPUTS # Standard Model inputs 1 1.27932567E+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi - 3 1.187000000e-01 # alpha_s(MZ) SM MSbar + 3 1.187000000e-01 # alpha_s(MZ) SM MSbar 4 9.118870000e+01 # MZ(pole) 5 4.180000000e+00 # mb(mb) SM MSbar 6 1.735000000e+02 # mtop(pole) - 7 1.776690000e+00 # mtau(pole) + 7 1.776690000e+00 # mtau(pole) 8 0.000000000e+00 # mnu3(pole) 11 5.109989020e-04 # melectron(pole) 12 0.000000000e+00 # mnu1(pole) @@ -78,7 +79,7 @@ Block EXTPAR # Input parameters 52 1.00000000E+00 # lEinput 53 1.00000000E+03 # MVUinput 54 4.00000000E+02 # MVEinput -Block YEPIN # +Block YEPIN # 1 1 0.000000E+00 # yep(1,1) 1 2 0.000000E+00 # yep(1,2) 1 3 0.000000E+00 # yep(1,3) @@ -88,7 +89,7 @@ Block YEPIN # 3 1 0.000000E+00 # yep(3,1) 3 2 0.000000E+00 # yep(3,2) 3 3 0.000000E+00 # yep(3,3) -Block YXIN # +Block YXIN # 1 1 0.000000E+00 # Yx(1,1) 1 2 0.000000E+00 # Yx(1,2) 1 3 0.000000E+00 # Yx(1,3) @@ -98,7 +99,7 @@ Block YXIN # 3 1 0.000000E+00 # Yx(3,1) 3 2 0.000000E+00 # Yx(3,2) 3 3 0.000000E+00 # Yx(3,3) -Block YUPIN # +Block YUPIN # 1 1 0.000000E+00 # yup(1,1) 1 2 0.000000E+00 # yup(1,2) 1 3 0.000000E+00 # yup(1,3) @@ -108,7 +109,7 @@ Block YUPIN # 3 1 0.000000E+00 # yup(3,1) 3 2 0.000000E+00 # yup(3,2) 3 3 0.000000E+00 # yup(3,3) -Block YVIN # +Block YVIN # 1 1 0.000000E+00 # Yv(1,1) 1 2 0.000000E+00 # Yv(1,2) 1 3 0.000000E+00 # Yv(1,3) @@ -118,66 +119,66 @@ Block YVIN # 3 1 0.000000E+00 # Yv(3,1) 3 2 0.000000E+00 # Yv(3,2) 3 3 0.000000E+00 # Yv(3,3) -Block SPhenoInput # SPheno specific input - 1 -1 # error level - 2 0 # SPA conventions - 7 0 # Skip 2-loop Higgs corrections - 8 3 # Method used for two-loop calculation - 9 1 # Gaugeless limit used at two-loop - 10 0 # safe-mode used at two-loop - 11 1 # calculate branching ratios - 13 0 # 3-Body decays: none (0), fermion (1), scalar (2), both (3) - 14 1 # Run couplings to scale of decaying particle - 12 1.000E-04 # write only branching ratios larger than this value - 15 1.000E-30 # write only decay if width larger than this value - 31 -1 # fixed GUT scale (-1: dynamical GUT scale) - 32 0 # Strict unification - 34 1.000E-04 # Precision of mass calculation +Block SPhenoInput # SPheno specific input + 1 -1 # error level + 2 0 # SPA conventions + 7 0 # Skip 2-loop Higgs corrections + 8 3 # Method used for two-loop calculation + 9 1 # Gaugeless limit used at two-loop + 10 0 # safe-mode used at two-loop + 11 1 # calculate branching ratios + 13 0 # 3-Body decays: none (0), fermion (1), scalar (2), both (3) + 14 1 # Run couplings to scale of decaying particle + 12 1.000E-04 # write only branching ratios larger than this value + 15 1.000E-30 # write only decay if width larger than this value + 31 -1 # fixed GUT scale (-1: dynamical GUT scale) + 32 0 # Strict unification + 34 1.000E-04 # Precision of mass calculation 35 40 # Maximal number of iterations 36 5 # Minimal number of iterations before discarding points - 37 1 # Set Yukawa scheme - 38 2 # 1- or 2-Loop RGEs - 50 1 # Majorana phases: use only positive masses (put 0 to use file with CalcHep/Micromegas!) - 51 0 # Write Output in CKM basis - 52 1 # Write spectrum in case of tachyonic states - 55 1 # Calculate loop corrected masses - 57 0 # Calculate low energy constraints - 60 1 # Include possible, kinetic mixing - 65 1 # Solution tadpole equation - 75 1 # Write WHIZARD files - 76 1 # Write HiggsBounds file - 86 0 # Maximal width to be counted as invisible in Higgs decays; -1: only LSP - 510 0 # Write tree level values for tadpole solutions - 515 0 # Write parameter values at GUT scale - 520 0 # Write effective Higgs couplings (HiggsBounds blocks): put 0 to use file with MadGraph! - 525 0 # Write loop contributions to diphoton decay of Higgs - 530 1 # Write Blocks for Vevacious - 1101 1 # Include Glu in 1-loop corrections - 1102 1 # Include Chi in 1-loop corrections - 1103 1 # Include Cha in 1-loop corrections - 1104 1 # Include Fv in 1-loop corrections - 1105 1 # Include Fe in 1-loop corrections - 1106 1 # Include Fd in 1-loop corrections - 1107 1 # Include Fu in 1-loop corrections - 1201 1 # Include Sd in 1-loop corrections - 1202 1 # Include Su in 1-loop corrections - 1203 1 # Include Se in 1-loop corrections - 1204 1 # Include SvIm in 1-loop corrections - 1205 1 # Include SvRe in 1-loop corrections - 1206 1 # Include hh in 1-loop corrections - 1207 1 # Include Ah in 1-loop corrections - 1208 1 # Include Hpm in 1-loop corrections - 1301 1 # Include VG in 1-loop corrections - 1302 1 # Include VP in 1-loop corrections - 1303 1 # Include VZ in 1-loop corrections - 1304 1 # Include VZp in 1-loop corrections - 1305 1 # Include VWm in 1-loop corrections - 1401 1 # Include gG in 1-loop corrections - 1402 1 # Include gA in 1-loop corrections - 1403 1 # Include gZ in 1-loop corrections - 1404 1 # Include gZp in 1-loop corrections - 1405 1 # Include gWm in 1-loop corrections - 1406 1 # Include gWpC in 1-loop corrections - 1500 1 # Include Wave diagrams 1-loop corrections - 1501 1 # Include Penguin diagrams 1-loop corrections - 1502 1 # Include Box diagrams 1-loop corrections + 37 1 # Set Yukawa scheme + 38 2 # 1- or 2-Loop RGEs + 50 1 # Majorana phases: use only positive masses (put 0 to use file with CalcHep/Micromegas!) + 51 0 # Write Output in CKM basis + 52 1 # Write spectrum in case of tachyonic states + 55 1 # Calculate loop corrected masses + 57 0 # Calculate low energy constraints + 60 1 # Include possible, kinetic mixing + 65 1 # Solution tadpole equation + 75 1 # Write WHIZARD files + 76 1 # Write HiggsBounds file + 86 0 # Maximal width to be counted as invisible in Higgs decays; -1: only LSP + 510 0 # Write tree level values for tadpole solutions + 515 0 # Write parameter values at GUT scale + 520 0 # Write effective Higgs couplings (HiggsBounds blocks): put 0 to use file with MadGraph! + 525 0 # Write loop contributions to diphoton decay of Higgs + 530 1 # Write Blocks for Vevacious + 1101 1 # Include Glu in 1-loop corrections + 1102 1 # Include Chi in 1-loop corrections + 1103 1 # Include Cha in 1-loop corrections + 1104 1 # Include Fv in 1-loop corrections + 1105 1 # Include Fe in 1-loop corrections + 1106 1 # Include Fd in 1-loop corrections + 1107 1 # Include Fu in 1-loop corrections + 1201 1 # Include Sd in 1-loop corrections + 1202 1 # Include Su in 1-loop corrections + 1203 1 # Include Se in 1-loop corrections + 1204 1 # Include SvIm in 1-loop corrections + 1205 1 # Include SvRe in 1-loop corrections + 1206 1 # Include hh in 1-loop corrections + 1207 1 # Include Ah in 1-loop corrections + 1208 1 # Include Hpm in 1-loop corrections + 1301 1 # Include VG in 1-loop corrections + 1302 1 # Include VP in 1-loop corrections + 1303 1 # Include VZ in 1-loop corrections + 1304 1 # Include VZp in 1-loop corrections + 1305 1 # Include VWm in 1-loop corrections + 1401 1 # Include gG in 1-loop corrections + 1402 1 # Include gA in 1-loop corrections + 1403 1 # Include gZ in 1-loop corrections + 1404 1 # Include gZp in 1-loop corrections + 1405 1 # Include gWm in 1-loop corrections + 1406 1 # Include gWpC in 1-loop corrections + 1500 1 # Include Wave diagrams 1-loop corrections + 1501 1 # Include Penguin diagrams 1-loop corrections + 1502 1 # Include Box diagrams 1-loop corrections diff --git a/model_files/UMSSM/FlexibleSUSY.m.in b/model_files/UMSSM/FlexibleSUSY.m.in index 26237eac8e..6921b489a6 100644 --- a/model_files/UMSSM/FlexibleSUSY.m.in +++ b/model_files/UMSSM/FlexibleSUSY.m.in @@ -50,6 +50,7 @@ HighScaleInput = { {md2, UNITMATRIX[3] m0^2}, {mu2, UNITMATRIX[3] m0^2}, {me2, UNITMATRIX[3] m0^2}, + {mvR2, UNITMATRIX[3] m0^2}, {\[Lambda], LambdaInput}, {T[\[Lambda]], ALambdaInput*\[Lambda]}, {MassB, m12}, @@ -66,7 +67,7 @@ LowScaleInput = { {Yu, Automatic}, {Yd, Automatic}, {Ye, Automatic}, - {Yv, ZEROMATRIX[3,3]}, + {Yv, Sqrt[2] neutrinoDRbar / vu}, {vd, 2 MZDRbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Cos[ArcTan[TanBeta]]}, {vu, 2 MZDRbar / Sqrt[GUTNormalization[g1]^2 g1^2 + g2^2] Sin[ArcTan[TanBeta]]} }; diff --git a/model_files/UMSSM/LesHouches.in.UMSSM b/model_files/UMSSM/LesHouches.in.UMSSM index 8573382591..52e87ae8b9 100644 --- a/model_files/UMSSM/LesHouches.in.UMSSM +++ b/model_files/UMSSM/LesHouches.in.UMSSM @@ -15,9 +15,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -34,6 +34,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/VCMSSM/FlexibleSUSY.m.in b/model_files/VCMSSM/FlexibleSUSY.m.in index 78ecff2875..561aad6f8e 100644 --- a/model_files/VCMSSM/FlexibleSUSY.m.in +++ b/model_files/VCMSSM/FlexibleSUSY.m.in @@ -613,7 +613,7 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon} } }, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]} } }, {ALPHA, NoScale, {{ArcSin[Pole[ZH[2,2]]]}}}, {HMIX , {{1, \[Mu]}, diff --git a/model_files/VCMSSM/LesHouches.in.VCMSSM b/model_files/VCMSSM/LesHouches.in.VCMSSM index 6338db890f..7feeb3d156 100644 --- a/model_files/VCMSSM/LesHouches.in.VCMSSM +++ b/model_files/VCMSSM/LesHouches.in.VCMSSM @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block FlexibleSUSYInput 0 0.00729735 # alpha_em(0) 1 125.09 # Mh pole diff --git a/model_files/cCMSSM/FlexibleSUSY.m.in b/model_files/cCMSSM/FlexibleSUSY.m.in index e90ab6a25c..3db6ed3071 100644 --- a/model_files/cCMSSM/FlexibleSUSY.m.in +++ b/model_files/cCMSSM/FlexibleSUSY.m.in @@ -161,7 +161,7 @@ ExtraSLHAOutputBlocks = { {48, SignedAbsSqrt[Im[md2[2,2]]]}, {49, SignedAbsSqrt[Im[md2[3,3]]]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon}} + {{21, FlexibleSUSYObservable`AMM[Fe[2]]}} } }; diff --git a/model_files/cCMSSM/LesHouches.in.cCMSSM b/model_files/cCMSSM/LesHouches.in.cCMSSM index bf31a587fd..2fa8e8981a 100644 --- a/model_files/cCMSSM/LesHouches.in.cCMSSM +++ b/model_files/cCMSSM/LesHouches.in.cCMSSM @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/complexMSSM/LesHouches.in.complexMSSM b/model_files/complexMSSM/LesHouches.in.complexMSSM index 584825928c..af830b55aa 100644 --- a/model_files/complexMSSM/LesHouches.in.complexMSSM +++ b/model_files/complexMSSM/LesHouches.in.complexMSSM @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/lowMSSM/FlexibleSUSY.m.in b/model_files/lowMSSM/FlexibleSUSY.m.in index e202b8d804..ec4513ddbb 100644 --- a/model_files/lowMSSM/FlexibleSUSY.m.in +++ b/model_files/lowMSSM/FlexibleSUSY.m.in @@ -44,7 +44,7 @@ ExtraSLHAOutputBlocks = { {1, Hold[SUSYScale]}, {2, Hold[LowScale]} } }, {FlexibleSUSYLowEnergy, - {{21, FlexibleSUSYObservable`aMuon} } }, + {{21, FlexibleSUSYObservable`AMM[Fe[2]]} } }, {ALPHA, NoScale, {{ArcSin[Pole[ZH[2,2]]]}}}, {HMIX , {{1, \[Mu]}, diff --git a/model_files/lowMSSM/LesHouches.in.lowMSSM b/model_files/lowMSSM/LesHouches.in.lowMSSM index 68edb6c958..bee66e71ec 100644 --- a/model_files/lowMSSM/LesHouches.in.lowMSSM +++ b/model_files/lowMSSM/LesHouches.in.lowMSSM @@ -12,9 +12,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -31,6 +31,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/lowNMSSM/FlexibleSUSY.m.in b/model_files/lowNMSSM/FlexibleSUSY.m.in index 68f54130d5..d62a98caff 100644 --- a/model_files/lowNMSSM/FlexibleSUSY.m.in +++ b/model_files/lowNMSSM/FlexibleSUSY.m.in @@ -68,8 +68,6 @@ SUSYScaleInput = { {mq2[1,1], mq1Input^2}, {mq2[2,2], mq2Input^2}, {mq2[3,3], mq3Input^2}, - {me2[1,1], me1Input^2}, - {me2[2,2], me2Input^2}, {T[Yu][3,3], AtInput Yu[3,3]}, {T[Yd][3,3], AbInput Yd[3,3]}, {T[Ye][3,3], ATauInput Ye[3,3]} @@ -124,6 +122,7 @@ ExtraSLHAOutputBlocks = { {2, vu / vd}, {3, Sqrt[vu^2 + vd^2]}, {4, M[Ah[2]]^2}, + {10, ArcTan[vu/vd]}, {102, vd}, {103, vu} } }, {Au, {{1, 1, T[Yu][1,1] / Yu[1,1]}, @@ -163,3 +162,5 @@ ExtraSLHAOutputBlocks = { {5, \[Lambda] vS / Sqrt[2]}, {10, ms2} } } }; + +FSCalculateDecays = True; diff --git a/model_files/lowNMSSM/LesHouches.in.TP1 b/model_files/lowNMSSM/LesHouches.in.TP1 index fd5a2838c0..c2acb2f165 100644 --- a/model_files/lowNMSSM/LesHouches.in.TP1 +++ b/model_files/lowNMSSM/LesHouches.in.TP1 @@ -11,9 +11,9 @@ Block FlexibleSUSY 9 1 # Higgs 2-loop corrections O(alpha_b alpha_s) 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -30,47 +30,48 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) -BLOCK SMINPUTS # -1 128.962 # -2 0.000011663900000000002 # -3 0.1172 # -4 91.1876 # -5 4.2 # -6 172.9 # -7 1.777 # -9 80.385 # -11 0.00051099891 # -13 1.10565836 # -21 0.00495 # -22 0.0025 # -23 0.1 # -24 1.42 # -BLOCK EXTPAR # -0 1500. # -1 500. # -2 1000. # -3 3000. # -11 3000. # -12 0. # -13 0. # -25 10.0 # -31 1500.1 # -32 1500.2 # -33 1500.3 # -34 1500.4 # -35 1500.5 # -36 1500.6 # -41 1500.7 # -42 1500.8 # -43 1500. # -44 1500.01 # -45 1500.02 # -46 1500.0 # -47 1500.04 # -48 1500.05 # -49 1500.06 # -61 0.1 # -62 0.1 # -63 -10. # -64 -10.0 # + 32 2 # loop level to calculate AMM +BLOCK SMINPUTS # +1 128.962 # +2 0.000011663900000000002 # +3 0.1172 # +4 91.1876 # +5 4.2 # +6 172.9 # +7 1.777 # +9 80.385 # +11 0.00051099891 # +13 1.10565836 # +21 0.00495 # +22 0.0025 # +23 0.1 # +24 1.42 # +BLOCK EXTPAR # +0 1500. # +1 500. # +2 1000. # +3 3000. # +11 3000. # +12 0. # +13 0. # +25 10.0 # +31 1500.1 # +32 1500.2 # +33 1500.3 # +34 1500.4 # +35 1500.5 # +36 1500.6 # +41 1500.7 # +42 1500.8 # +43 1500. # +44 1500.01 # +45 1500.02 # +46 1500.0 # +47 1500.04 # +48 1500.05 # +49 1500.06 # +61 0.1 # +62 0.1 # +63 -10. # +64 -10.0 # 65 900. # diff --git a/model_files/lowNMSSM/LesHouches.in.TP2 b/model_files/lowNMSSM/LesHouches.in.TP2 index a887bf5972..ef38c8502f 100644 --- a/model_files/lowNMSSM/LesHouches.in.TP2 +++ b/model_files/lowNMSSM/LesHouches.in.TP2 @@ -11,9 +11,9 @@ Block FlexibleSUSY 9 1 # Higgs 2-loop corrections O(alpha_b alpha_s) 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -30,47 +30,48 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) -BLOCK SMINPUTS # -1 128.962 # -2 0.000011663900000000002 # -3 0.1172 # -4 91.1876 # -5 4.2 # -6 172.9 # -7 1.777 # -9 80.385 # -11 0.00051099891 # -13 1.10565836 # -21 0.00495 # -22 0.0025 # -23 0.1 # -24 1.42 # -BLOCK EXTPAR # -0 1500. # -1 1000. # -2 2000. # -3 2500. # -11 -2900. # -12 0. # -13 0. # -25 10.0 # -31 1500.1 # -32 1500.2 # -33 1500.3 # -34 1500.4 # -35 1500.5 # -36 1500.6 # -41 1500.7 # -42 1500.8 # -43 2500.0 # -44 1500.01 # -45 1500.02 # -46 500.0 # -47 1500.04 # -48 1500.05 # -49 1500.06 # -61 0.05 # -62 0.1 # -63 -200. # -64 -200.0 # -65 1500. # + 32 2 # loop level to calculate AMM +BLOCK SMINPUTS # +1 128.962 # +2 0.000011663900000000002 # +3 0.1172 # +4 91.1876 # +5 4.2 # +6 172.9 # +7 1.777 # +9 80.385 # +11 0.00051099891 # +13 1.10565836 # +21 0.00495 # +22 0.0025 # +23 0.1 # +24 1.42 # +BLOCK EXTPAR # +0 1500. # +1 1000. # +2 2000. # +3 2500. # +11 -2900. # +12 0. # +13 0. # +25 10.0 # +31 1500.1 # +32 1500.2 # +33 1500.3 # +34 1500.4 # +35 1500.5 # +36 1500.6 # +41 1500.7 # +42 1500.8 # +43 2500.0 # +44 1500.01 # +45 1500.02 # +46 500.0 # +47 1500.04 # +48 1500.05 # +49 1500.06 # +61 0.05 # +62 0.1 # +63 -200. # +64 -200.0 # +65 1500. # diff --git a/model_files/lowNMSSM/LesHouches.in.TP3 b/model_files/lowNMSSM/LesHouches.in.TP3 index c3a02b9be8..9978dbee07 100644 --- a/model_files/lowNMSSM/LesHouches.in.TP3 +++ b/model_files/lowNMSSM/LesHouches.in.TP3 @@ -11,9 +11,9 @@ Block FlexibleSUSY 9 1 # Higgs 2-loop corrections O(alpha_b alpha_s) 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -30,50 +30,51 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) -BLOCK SMINPUTS # -1 128.962 # -2 0.000011663900000000002 # -3 0.1172 # -4 91.1876 # -5 4.2 # -6 172.9 # -7 1.777 # -9 80.385 # -11 0.00051099891 # -13 1.10565836 # -21 0.00495 # -22 0.0025 # -23 0.1 # -24 1.42 # -BLOCK EXTPAR # -0 1000. # -1 200. # -2 400. # -3 2000. # -11 1000. # -12 1000. # -13 1000. # -25 3. # -31 1500. # -32 1500. # -33 1500. # -34 1500. # -35 1500. # -36 1500. # -41 1500. # -42 1500. # -43 1000. # -44 1500. # -45 1500. # -46 1000. # -47 1500. # -48 1500. # -49 1500. # -61 0.67 # -62 0.1 # -63 650. # -64 -10. # -65 200. # + 32 2 # loop level to calculate AMM +BLOCK SMINPUTS # +1 128.962 # +2 0.000011663900000000002 # +3 0.1172 # +4 91.1876 # +5 4.2 # +6 172.9 # +7 1.777 # +9 80.385 # +11 0.00051099891 # +13 1.10565836 # +21 0.00495 # +22 0.0025 # +23 0.1 # +24 1.42 # +BLOCK EXTPAR # +0 1000. # +1 200. # +2 400. # +3 2000. # +11 1000. # +12 1000. # +13 1000. # +25 3. # +31 1500. # +32 1500. # +33 1500. # +34 1500. # +35 1500. # +36 1500. # +41 1500. # +42 1500. # +43 1000. # +44 1500. # +45 1500. # +46 1000. # +47 1500. # +48 1500. # +49 1500. # +61 0.67 # +62 0.1 # +63 650. # +64 -10. # +65 200. # diff --git a/model_files/lowNMSSM/LesHouches.in.TP4 b/model_files/lowNMSSM/LesHouches.in.TP4 index 0511d34b2d..764c87f159 100644 --- a/model_files/lowNMSSM/LesHouches.in.TP4 +++ b/model_files/lowNMSSM/LesHouches.in.TP4 @@ -11,9 +11,9 @@ Block FlexibleSUSY 9 1 # Higgs 2-loop corrections O(alpha_b alpha_s) 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -30,50 +30,51 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) -BLOCK SMINPUTS # -1 128.962 # -2 0.000011663900000000002 # -3 0.1172 # -4 91.1876 # -5 4.2 # -6 172.9 # -7 1.777 # -9 80.385 # -11 0.00051099891 # -13 1.10565836 # -21 0.00495 # -22 0.0025 # -23 0.1 # -24 1.42 # -BLOCK EXTPAR # -0 750. # -1 120. # -2 200. # -3 1500. # -11 1000. # -12 1000. # -13 1000. # -25 2.0 # -31 1500. # -32 1500. # -33 1500. # -34 1500. # -35 1500. # -36 1500. # -41 1500. # -42 1500. # -43 750. # -44 1500. # -45 1500. # -46 750. # -47 1500. # -48 1500. # -49 1500. # -61 0.67 # -62 0.2 # -63 405. # -64 -0. # -65 200. # + 32 2 # loop level to calculate AMM +BLOCK SMINPUTS # +1 128.962 # +2 0.000011663900000000002 # +3 0.1172 # +4 91.1876 # +5 4.2 # +6 172.9 # +7 1.777 # +9 80.385 # +11 0.00051099891 # +13 1.10565836 # +21 0.00495 # +22 0.0025 # +23 0.1 # +24 1.42 # +BLOCK EXTPAR # +0 750. # +1 120. # +2 200. # +3 1500. # +11 1000. # +12 1000. # +13 1000. # +25 2.0 # +31 1500. # +32 1500. # +33 1500. # +34 1500. # +35 1500. # +36 1500. # +41 1500. # +42 1500. # +43 750. # +44 1500. # +45 1500. # +46 750. # +47 1500. # +48 1500. # +49 1500. # +61 0.67 # +62 0.2 # +63 405. # +64 -0. # +65 200. # diff --git a/model_files/lowNMSSM/LesHouches.in.TP5 b/model_files/lowNMSSM/LesHouches.in.TP5 index cef9b740f0..ab05d81c93 100644 --- a/model_files/lowNMSSM/LesHouches.in.TP5 +++ b/model_files/lowNMSSM/LesHouches.in.TP5 @@ -11,9 +11,9 @@ Block FlexibleSUSY 9 1 # Higgs 2-loop corrections O(alpha_b alpha_s) 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -30,50 +30,51 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) -BLOCK SMINPUTS # -1 128.962 # -2 0.000011663900000000002 # -3 0.1172 # -4 91.1876 # -5 4.2 # -6 172.9 # -7 1.777 # -9 80.385 # -11 0.00051099891 # -13 1.10565836 # -21 0.00495 # -22 0.0025 # -23 0.1 # -24 1.42 # -BLOCK EXTPAR # -0 1500. # -1 135. # -2 200. # -3 1400. # -11 0. # -12 0. # -13 0. # -25 3.0 # -31 1500. # -32 1500. # -33 1500. # -34 1500. # -35 1500. # -36 1500. # -41 1500. # -42 1500. # -43 1500. # -44 1500. # -45 1500. # -46 1500. # -47 1500. # -48 1500. # -49 1500. # -61 0.67 # -62 0.2 # -63 570. # -64 -25. # -65 200. # + 32 2 # loop level to calculate AMM +BLOCK SMINPUTS # +1 128.962 # +2 0.000011663900000000002 # +3 0.1172 # +4 91.1876 # +5 4.2 # +6 172.9 # +7 1.777 # +9 80.385 # +11 0.00051099891 # +13 1.10565836 # +21 0.00495 # +22 0.0025 # +23 0.1 # +24 1.42 # +BLOCK EXTPAR # +0 1500. # +1 135. # +2 200. # +3 1400. # +11 0. # +12 0. # +13 0. # +25 3.0 # +31 1500. # +32 1500. # +33 1500. # +34 1500. # +35 1500. # +36 1500. # +41 1500. # +42 1500. # +43 1500. # +44 1500. # +45 1500. # +46 1500. # +47 1500. # +48 1500. # +49 1500. # +61 0.67 # +62 0.2 # +63 570. # +64 -25. # +65 200. # diff --git a/model_files/lowNMSSM/LesHouches.in.TP6 b/model_files/lowNMSSM/LesHouches.in.TP6 index 89514675a6..ec865a2995 100644 --- a/model_files/lowNMSSM/LesHouches.in.TP6 +++ b/model_files/lowNMSSM/LesHouches.in.TP6 @@ -11,9 +11,9 @@ Block FlexibleSUSY 9 1 # Higgs 2-loop corrections O(alpha_b alpha_s) 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -30,47 +30,48 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) -BLOCK SMINPUTS # -1 128.962 # -2 0.000011663900000000002 # -3 0.1172 # -4 91.1876 # -5 4.2 # -6 172.9 # -7 1.777 # -9 80.385 # -11 0.00051099891 # -13 1.10565836 # -21 0.00495 # -22 0.0025 # -23 0.1 # -24 1.42 # -BLOCK EXTPAR # -0 1500. # -1 200. # -2 400. # -3 2000. # -11 0. # -12 0. # -13 0. # -25 3.0 # -31 1500.1 # -32 1500.2 # -33 1500.3 # -34 1500.4 # -35 1500.5 # -36 1500.6 # -41 1500.7 # -42 1500.8 # -43 1500.9 # -44 1500.01 # -45 1500.02 # -46 1500.03 # -47 1500.04 # -48 1500.05 # -49 1500.06 # -61 1.60 # -62 1.61 # -63 375.0 # -64 -1605. # -65 614. # + 32 2 # loop level to calculate AMM +BLOCK SMINPUTS # +1 128.962 # +2 0.000011663900000000002 # +3 0.1172 # +4 91.1876 # +5 4.2 # +6 172.9 # +7 1.777 # +9 80.385 # +11 0.00051099891 # +13 1.10565836 # +21 0.00495 # +22 0.0025 # +23 0.1 # +24 1.42 # +BLOCK EXTPAR # +0 1500. # +1 200. # +2 400. # +3 2000. # +11 0. # +12 0. # +13 0. # +25 3.0 # +31 1500.1 # +32 1500.2 # +33 1500.3 # +34 1500.4 # +35 1500.5 # +36 1500.6 # +41 1500.7 # +42 1500.8 # +43 1500.9 # +44 1500.01 # +45 1500.02 # +46 1500.03 # +47 1500.04 # +48 1500.05 # +49 1500.06 # +61 1.60 # +62 1.61 # +63 375.0 # +64 -1605. # +65 614. # diff --git a/model_files/lowNMSSMTanBetaAtMZ/FlexibleSUSY.m.in b/model_files/lowNMSSMTanBetaAtMZ/FlexibleSUSY.m.in index 383cdc8308..b68e084ccd 100644 --- a/model_files/lowNMSSMTanBetaAtMZ/FlexibleSUSY.m.in +++ b/model_files/lowNMSSMTanBetaAtMZ/FlexibleSUSY.m.in @@ -67,8 +67,6 @@ SUSYScaleInput = { {mq2[1,1], mq1Input^2}, {mq2[2,2], mq2Input^2}, {mq2[3,3], mq3Input^2}, - {me2[1,1], me1Input^2}, - {me2[2,2], me2Input^2}, {T[Yu][3,3], AtInput Yu[3,3]}, {T[Yd][3,3], AbInput Yd[3,3]}, {T[Ye][3,3], ATauInput Ye[3,3]} @@ -161,3 +159,5 @@ ExtraSLHAOutputBlocks = { {5, \[Lambda] vS / Sqrt[2]}, {10, ms2} } } }; + +FSCalculateDecays = True; diff --git a/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP1 b/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP1 index a7fd383907..496481ca07 100644 --- a/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP1 +++ b/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP1 @@ -11,9 +11,9 @@ Block FlexibleSUSY 9 1 # Higgs 2-loop corrections O(alpha_b alpha_s) 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -30,48 +30,49 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) -BLOCK SMINPUTS # -1 128.962 # -2 0.000011663900000000002 # -3 0.1172 # -4 91.1876 # -5 4.2 # -6 172.9 # -7 1.777 # -9 80.385 # -11 0.00051099891 # -13 1.10565836 # -21 0.00495 # -22 0.0025 # -23 0.1 # + 32 2 # loop level to calculate AMM +BLOCK SMINPUTS # +1 128.962 # +2 0.000011663900000000002 # +3 0.1172 # +4 91.1876 # +5 4.2 # +6 172.9 # +7 1.777 # +9 80.385 # +11 0.00051099891 # +13 1.10565836 # +21 0.00495 # +22 0.0025 # +23 0.1 # 24 1.42 # BLOCK MINPAR 3 10.0 # TanBeta(MZ) -BLOCK EXTPAR # -0 1500. # -1 500. # -2 1000. # -3 3000. # -11 3000. # -12 0. # -13 0. # -31 1500.1 # -32 1500.2 # -33 1500.3 # -34 1500.4 # -35 1500.5 # -36 1500.6 # -41 1500.7 # -42 1500.8 # -43 1500. # -44 1500.01 # -45 1500.02 # -46 1500.0 # -47 1500.04 # -48 1500.05 # -49 1500.06 # -61 0.1 # -62 0.1 # -63 -10. # -64 -10.0 # +BLOCK EXTPAR # +0 1500. # +1 500. # +2 1000. # +3 3000. # +11 3000. # +12 0. # +13 0. # +31 1500.1 # +32 1500.2 # +33 1500.3 # +34 1500.4 # +35 1500.5 # +36 1500.6 # +41 1500.7 # +42 1500.8 # +43 1500. # +44 1500.01 # +45 1500.02 # +46 1500.0 # +47 1500.04 # +48 1500.05 # +49 1500.06 # +61 0.1 # +62 0.1 # +63 -10. # +64 -10.0 # 65 900. # diff --git a/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP2 b/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP2 index 482706ae16..bfbab4d056 100644 --- a/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP2 +++ b/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP2 @@ -11,9 +11,9 @@ Block FlexibleSUSY 9 1 # Higgs 2-loop corrections O(alpha_b alpha_s) 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -30,48 +30,49 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) -BLOCK SMINPUTS # -1 128.962 # -2 0.000011663900000000002 # -3 0.1172 # -4 91.1876 # -5 4.2 # -6 172.9 # -7 1.777 # -9 80.385 # -11 0.00051099891 # -13 1.10565836 # -21 0.00495 # -22 0.0025 # -23 0.1 # -24 1.42 # + 32 2 # loop level to calculate AMM +BLOCK SMINPUTS # +1 128.962 # +2 0.000011663900000000002 # +3 0.1172 # +4 91.1876 # +5 4.2 # +6 172.9 # +7 1.777 # +9 80.385 # +11 0.00051099891 # +13 1.10565836 # +21 0.00495 # +22 0.0025 # +23 0.1 # +24 1.42 # BLOCK MINPAR 3 10.0 # TanBeta(MZ) -BLOCK EXTPAR # -0 1500. # -1 1000. # -2 2000. # -3 2500. # -11 -2900. # -12 0. # -13 0. # -31 1500.1 # -32 1500.2 # -33 1500.3 # -34 1500.4 # -35 1500.5 # -36 1500.6 # -41 1500.7 # -42 1500.8 # -43 2500.0 # -44 1500.01 # -45 1500.02 # -46 500.0 # -47 1500.04 # -48 1500.05 # -49 1500.06 # -61 0.05 # -62 0.1 # -63 -200. # -64 -200.0 # -65 1500. # +BLOCK EXTPAR # +0 1500. # +1 1000. # +2 2000. # +3 2500. # +11 -2900. # +12 0. # +13 0. # +31 1500.1 # +32 1500.2 # +33 1500.3 # +34 1500.4 # +35 1500.5 # +36 1500.6 # +41 1500.7 # +42 1500.8 # +43 2500.0 # +44 1500.01 # +45 1500.02 # +46 500.0 # +47 1500.04 # +48 1500.05 # +49 1500.06 # +61 0.05 # +62 0.1 # +63 -200. # +64 -200.0 # +65 1500. # diff --git a/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP3 b/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP3 index 2ce3e5b851..330d892f44 100644 --- a/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP3 +++ b/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP3 @@ -11,9 +11,9 @@ Block FlexibleSUSY 9 1 # Higgs 2-loop corrections O(alpha_b alpha_s) 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -30,51 +30,52 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) -BLOCK SMINPUTS # -1 128.962 # -2 0.000011663900000000002 # -3 0.1172 # -4 91.1876 # -5 4.2 # -6 172.9 # -7 1.777 # -9 80.385 # -11 0.00051099891 # -13 1.10565836 # -21 0.00495 # -22 0.0025 # -23 0.1 # -24 1.42 # + 32 2 # loop level to calculate AMM +BLOCK SMINPUTS # +1 128.962 # +2 0.000011663900000000002 # +3 0.1172 # +4 91.1876 # +5 4.2 # +6 172.9 # +7 1.777 # +9 80.385 # +11 0.00051099891 # +13 1.10565836 # +21 0.00495 # +22 0.0025 # +23 0.1 # +24 1.42 # BLOCK MINPAR 3 3.0 # TanBeta(MZ) -BLOCK EXTPAR # -0 1000. # -1 200. # -2 400. # -3 2000. # -11 1000. # -12 1000. # -13 1000. # -31 1500. # -32 1500. # -33 1500. # -34 1500. # -35 1500. # -36 1500. # -41 1500. # -42 1500. # -43 1000. # -44 1500. # -45 1500. # -46 1000. # -47 1500. # -48 1500. # -49 1500. # -61 0.67 # -62 0.1 # -63 650. # -64 -10. # -65 200. # +BLOCK EXTPAR # +0 1000. # +1 200. # +2 400. # +3 2000. # +11 1000. # +12 1000. # +13 1000. # +31 1500. # +32 1500. # +33 1500. # +34 1500. # +35 1500. # +36 1500. # +41 1500. # +42 1500. # +43 1000. # +44 1500. # +45 1500. # +46 1000. # +47 1500. # +48 1500. # +49 1500. # +61 0.67 # +62 0.1 # +63 650. # +64 -10. # +65 200. # diff --git a/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP4 b/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP4 index 4d58a13fa9..0cb3de5ae5 100644 --- a/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP4 +++ b/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP4 @@ -11,9 +11,9 @@ Block FlexibleSUSY 9 1 # Higgs 2-loop corrections O(alpha_b alpha_s) 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -30,51 +30,52 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) -BLOCK SMINPUTS # -1 128.962 # -2 0.000011663900000000002 # -3 0.1172 # -4 91.1876 # -5 4.2 # -6 172.9 # -7 1.777 # -9 80.385 # -11 0.00051099891 # -13 1.10565836 # -21 0.00495 # -22 0.0025 # -23 0.1 # -24 1.42 # + 32 2 # loop level to calculate AMM +BLOCK SMINPUTS # +1 128.962 # +2 0.000011663900000000002 # +3 0.1172 # +4 91.1876 # +5 4.2 # +6 172.9 # +7 1.777 # +9 80.385 # +11 0.00051099891 # +13 1.10565836 # +21 0.00495 # +22 0.0025 # +23 0.1 # +24 1.42 # BLOCK MINPAR 3 2.0 # TanBeta(MZ) -BLOCK EXTPAR # -0 750. # -1 120. # -2 200. # -3 1500. # -11 1000. # -12 1000. # -13 1000. # -31 1500. # -32 1500. # -33 1500. # -34 1500. # -35 1500. # -36 1500. # -41 1500. # -42 1500. # -43 750. # -44 1500. # -45 1500. # -46 750. # -47 1500. # -48 1500. # -49 1500. # -61 0.67 # -62 0.2 # -63 405. # -64 -0. # -65 200. # +BLOCK EXTPAR # +0 750. # +1 120. # +2 200. # +3 1500. # +11 1000. # +12 1000. # +13 1000. # +31 1500. # +32 1500. # +33 1500. # +34 1500. # +35 1500. # +36 1500. # +41 1500. # +42 1500. # +43 750. # +44 1500. # +45 1500. # +46 750. # +47 1500. # +48 1500. # +49 1500. # +61 0.67 # +62 0.2 # +63 405. # +64 -0. # +65 200. # diff --git a/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP5 b/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP5 index d63fabe7ef..849a8ca4d8 100644 --- a/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP5 +++ b/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP5 @@ -11,9 +11,9 @@ Block FlexibleSUSY 9 1 # Higgs 2-loop corrections O(alpha_b alpha_s) 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -30,51 +30,52 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) -BLOCK SMINPUTS # -1 128.962 # -2 0.000011663900000000002 # -3 0.1172 # -4 91.1876 # -5 4.2 # -6 172.9 # -7 1.777 # -9 80.385 # -11 0.00051099891 # -13 1.10565836 # -21 0.00495 # -22 0.0025 # -23 0.1 # -24 1.42 # + 32 2 # loop level to calculate AMM +BLOCK SMINPUTS # +1 128.962 # +2 0.000011663900000000002 # +3 0.1172 # +4 91.1876 # +5 4.2 # +6 172.9 # +7 1.777 # +9 80.385 # +11 0.00051099891 # +13 1.10565836 # +21 0.00495 # +22 0.0025 # +23 0.1 # +24 1.42 # BLOCK MINPAR 3 3.0 # TanBeta(MZ) -BLOCK EXTPAR # -0 1500. # -1 135. # -2 200. # -3 1400. # -11 0. # -12 0. # -13 0. # -31 1500. # -32 1500. # -33 1500. # -34 1500. # -35 1500. # -36 1500. # -41 1500. # -42 1500. # -43 1500. # -44 1500. # -45 1500. # -46 1500. # -47 1500. # -48 1500. # -49 1500. # -61 0.67 # -62 0.2 # -63 570. # -64 -25. # -65 200. # +BLOCK EXTPAR # +0 1500. # +1 135. # +2 200. # +3 1400. # +11 0. # +12 0. # +13 0. # +31 1500. # +32 1500. # +33 1500. # +34 1500. # +35 1500. # +36 1500. # +41 1500. # +42 1500. # +43 1500. # +44 1500. # +45 1500. # +46 1500. # +47 1500. # +48 1500. # +49 1500. # +61 0.67 # +62 0.2 # +63 570. # +64 -25. # +65 200. # diff --git a/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP6 b/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP6 index f85ec9d6e7..6ec51f6cc5 100644 --- a/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP6 +++ b/model_files/lowNMSSMTanBetaAtMZ/LesHouches.in.TP6 @@ -11,9 +11,9 @@ Block FlexibleSUSY 9 1 # Higgs 2-loop corrections O(alpha_b alpha_s) 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -30,48 +30,49 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) -BLOCK SMINPUTS # -1 128.962 # -2 0.000011663900000000002 # -3 0.1172 # -4 91.1876 # -5 4.2 # -6 172.9 # -7 1.777 # -9 80.385 # -11 0.00051099891 # -13 1.10565836 # -21 0.00495 # -22 0.0025 # -23 0.1 # -24 1.42 # + 32 2 # loop level to calculate AMM +BLOCK SMINPUTS # +1 128.962 # +2 0.000011663900000000002 # +3 0.1172 # +4 91.1876 # +5 4.2 # +6 172.9 # +7 1.777 # +9 80.385 # +11 0.00051099891 # +13 1.10565836 # +21 0.00495 # +22 0.0025 # +23 0.1 # +24 1.42 # BLOCK MINPAR 3 3.0 # TanBeta(MZ) -BLOCK EXTPAR # -0 1500. # -1 200. # -2 400. # -3 2000. # -11 0. # -12 0. # -13 0. # -31 1500.1 # -32 1500.2 # -33 1500.3 # -34 1500.4 # -35 1500.5 # -36 1500.6 # -41 1500.7 # -42 1500.8 # -43 1500.9 # -44 1500.01 # -45 1500.02 # -46 1500.03 # -47 1500.04 # -48 1500.05 # -49 1500.06 # -61 1.60 # -62 1.61 # -63 375.0 # -64 -1605. # -65 614. # +BLOCK EXTPAR # +0 1500. # +1 200. # +2 400. # +3 2000. # +11 0. # +12 0. # +13 0. # +31 1500.1 # +32 1500.2 # +33 1500.3 # +34 1500.4 # +35 1500.5 # +36 1500.6 # +41 1500.7 # +42 1500.8 # +43 1500.9 # +44 1500.01 # +45 1500.02 # +46 1500.03 # +47 1500.04 # +48 1500.05 # +49 1500.06 # +61 1.60 # +62 1.61 # +63 375.0 # +64 -1605. # +65 614. # diff --git a/model_files/lowNUHMSSM/FlexibleSUSY.m.in b/model_files/lowNUHMSSM/FlexibleSUSY.m.in index 3e7903bd5f..9cc88584c3 100644 --- a/model_files/lowNUHMSSM/FlexibleSUSY.m.in +++ b/model_files/lowNUHMSSM/FlexibleSUSY.m.in @@ -73,3 +73,5 @@ DefaultPoleMassPrecision = MediumPrecision; HighPoleMassPrecision = {hh, Ah, Hpm}; MediumPoleMassPrecision = {}; LowPoleMassPrecision = {}; + +FSCalculateDecays = True; diff --git a/model_files/lowNUHMSSM/LesHouches.in.lowNUHMSSM b/model_files/lowNUHMSSM/LesHouches.in.lowNUHMSSM index 742d5cdf94..32b1fbdbc4 100644 --- a/model_files/lowNUHMSSM/LesHouches.in.lowNUHMSSM +++ b/model_files/lowNUHMSSM/LesHouches.in.lowNUHMSSM @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/model_files/lowNUHMSSMSemiAnalytic/LesHouches.in.lowNUHMSSMSemiAnalytic b/model_files/lowNUHMSSMSemiAnalytic/LesHouches.in.lowNUHMSSMSemiAnalytic index 2c9c1a8027..d168067902 100644 --- a/model_files/lowNUHMSSMSemiAnalytic/LesHouches.in.lowNUHMSSMSemiAnalytic +++ b/model_files/lowNUHMSSMSemiAnalytic/LesHouches.in.lowNUHMSSMSemiAnalytic @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-11 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/model_files/munuSSM/FlexibleSUSY.m.in b/model_files/munuSSM/FlexibleSUSY.m.in index be1e0a25d3..ebcb7340a5 100644 --- a/model_files/munuSSM/FlexibleSUSY.m.in +++ b/model_files/munuSSM/FlexibleSUSY.m.in @@ -95,4 +95,11 @@ HighPoleMassPrecision = {hh, Ah, Hpm}; MediumPoleMassPrecision = {}; LowPoleMassPrecision = {}; +ExtraSLHAOutputBlocks = { + {FlexibleSUSYLowEnergy, { + {21, FlexibleSUSYObservable`AMM[Cha[2]]} + } + } +}; + FSCalculateDecays = True; diff --git a/model_files/munuSSM/LesHouches.in.munuSSM b/model_files/munuSSM/LesHouches.in.munuSSM index a286e0ea2c..ab193b2d55 100644 --- a/model_files/munuSSM/LesHouches.in.munuSSM +++ b/model_files/munuSSM/LesHouches.in.munuSSM @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-16 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) @@ -33,6 +33,7 @@ Block FlexibleSUSY 29 1 # Higgs 3-loop corrections O(alpha_t^3) 30 1 # Higgs 4-loop corrections O(alpha_t alpha_s^3) 31 0 # loop library (0 = softsusy) + 32 2 # loop level to calculate AMM Block SMINPUTS # Standard Model inputs 1 1.279340000e+02 # alpha^(-1) SM MSbar(MZ) 2 1.166378700e-05 # G_Fermi diff --git a/model_files/munuSSMSemiAnalytic/LesHouches.in.munuSSMSemiAnalytic b/model_files/munuSSMSemiAnalytic/LesHouches.in.munuSSMSemiAnalytic index fa5b1490b9..d386a067bb 100644 --- a/model_files/munuSSMSemiAnalytic/LesHouches.in.munuSSMSemiAnalytic +++ b/model_files/munuSSMSemiAnalytic/LesHouches.in.munuSSMSemiAnalytic @@ -14,9 +14,9 @@ Block FlexibleSUSY 10 1 # Higgs 2-loop corrections O((alpha_t + alpha_b)^2) 11 1 # Higgs 2-loop corrections O(alpha_tau^2) 12 0 # force output - 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L) + 13 1 # Top pole mass QCD corrections (0 = 1L, 1 = 2L, 2 = 3L, 3 = 4L) 14 1.000000000e-16 # beta-function zero threshold - 15 0 # calculate observables (a_muon, ...) + 15 0 # calculate all observables 16 0 # force positive majorana masses 17 0 # pole mass renormalization scale (0 = SUSY scale) 18 0 # pole mass renormalization scale in the EFT (0 = min(SUSY scale, Mt)) diff --git a/model_specific/MSSM_higgs/mssm_twoloophiggs.cpp b/model_specific/MSSM_higgs/mssm_twoloophiggs.cpp index f6ea24551a..e6cac06521 100644 --- a/model_specific/MSSM_higgs/mssm_twoloophiggs.cpp +++ b/model_specific/MSSM_higgs/mssm_twoloophiggs.cpp @@ -19,7 +19,7 @@ #include "mssm_twoloophiggs.hpp" #include "mssm_twoloophiggs.h" #include "config.h" -#include "dilog.hpp" +#include "Li2.hpp" #include #include #include @@ -47,32 +47,25 @@ template T logabs(T x) { return std::log(std::abs(x)); } double phi(double x, double y, double z) { - using std::log; - const double u = x/z, v = y/z; const double lambda = sqrtabs(sqr(1 - u - v) - 4*u*v); const double xp = 0.5 * (1 + (u - v) - lambda); const double xm = 0.5 * (1 - (u - v) - lambda); return 1./lambda * (2*logabs(xp)*logabs(xm) - logabs(u)*logabs(v) - - 2*(dilog(xp) + dilog(xm)) + M_PI*M_PI/3.); + 2*(Li2(xp) + Li2(xm)) + M_PI*M_PI/3.); } /// First derivative of phi[t,T,g] w.r.t. T double dphi_010(double t, double T, double g) { - using std::fabs; - using std::sqrt; - using std::log; - using std::pow; - constexpr double Pi2 = M_PI * M_PI; const double g2 = sqr(g); const double abbr = (-4*t*T)/g2 + sqr(1 - t/g - T/g); const double rabbr = sqrtabs(abbr); - return ((g + t - T)*(Pi2 - 6*dilog((g - rabbr*g + t - T)/(2.*g)) - - 6*dilog((g - rabbr*g - t + T)/(2.*g)) - + return ((g + t - T)*(Pi2 - 6*Li2((g - rabbr*g + t - T)/(2.*g)) - + 6*Li2((g - rabbr*g - t + T)/(2.*g)) - 3*logabs(t/g)*logabs(T/g) + 6*logabs((g - rabbr*g + t - T)/(2.*g))*logabs((g - rabbr*g - t + T)/(2.*g))) + (3*rabbr*g* ( rabbr*g*((-1 + rabbr)*g + t - T)*logabs(t/g) + @@ -83,18 +76,16 @@ double dphi_010(double t, double T, double g) T*logabs((g - rabbr*g - t + T)/g) + g*logabs((g + rabbr*g - t + T)/g) - rabbr*g*logabs((g + rabbr*g - t + T)/g) - t*logabs((g + rabbr*g - t + T)/g) + T*logabs((g + rabbr*g - t + T)/g)) ) ) / - (T*(g - rabbr*g - t + T)))/(3.*pow(fabs(abbr),1.5)*g2); + (T*(g - rabbr*g - t + T)))/(3.*std::pow(std::fabs(abbr),1.5)*g2); } /// First derivative of phi[g,t,T] w.r.t. T double dphi_001(double g, double t, double T) { - using std::sqrt; - const double Pi2 = 9.869604401089359; const double T2 = sqr(T); const double T3 = T2*T; - const double x = sqrt(sqr(1 - g/T - t/T) - 4*g*t/T2); + const double x = sqrtabs(sqr(1 - g/T - t/T) - 4*g*t/T2); const double y = -(2*(g/T2 + t/T2)*(1 - g/T - t/T) + (8*g*t)/T3)/(2*x); const double ym = -g/T + t/T; const double yp = g/T - t/T; @@ -104,8 +95,8 @@ double dphi_001(double g, double t, double T) const double lxmyp = logabs(0.5*(1 - x + yp)); const double lxpym = logabs(0.5*(1 + x + ym)); const double lxpyp = logabs(0.5*(1 + x + yp)); - const double li2xym = dilog(0.5*(1 - x + ym)); - const double li2xyp = dilog(0.5*(1 - x + yp)); + const double li2xym = Li2(0.5*(1 - x + ym)); + const double li2xyp = Li2(0.5*(1 - x + yp)); return ((t*(t - T) - g*(2*t + T) + sqr(g))* (-6*li2xym - 6*li2xyp - 3*lgT*ltT + 6*lxmym*lxmyp + Pi2) @@ -134,10 +125,6 @@ Eigen::Matrix tadpole_higgs_2loop_at_as_mssm_st_0( double /* sxt */, double /* cxt */, double scale2, double mu, double tanb, double vev2, double gs) { - using std::atan; - using std::sin; - using std::cos; - const double gs2 = sqr(gs); const double g = sqr(mg); const double q = scale2; @@ -192,10 +179,6 @@ Eigen::Matrix tadpole_higgs_2loop_at_as_mssm_st_0_mst1_eq_mst2( double /* sxt */, double /* cxt */, double scale2, double mu, double tanb, double vev2, double gs) { - using std::atan; - using std::sin; - using std::cos; - const double gs2 = sqr(gs); const double q = scale2; const double q2 = sqr(q); @@ -213,12 +196,13 @@ Eigen::Matrix tadpole_higgs_2loop_at_as_mssm_st_0_mst1_eq_mst2( const double beta = std::atan(tanb); const double v2 = v * std::sin(beta); const double v1 = v * std::cos(beta); + const double dphi = dphi_001(g, t, T); const double t1 = (16*mg*mu*(-((g2 - 2*g*t + sqr(t) - Tsqr)*phi(g,t,T)) + T*(ltg*(-g + t) + (1 + lgtq2 - lgq*ltq - 4*lTq + lgtq2*lTq)*T + (g2 - 2*t*T - 2*g*(t + T) + sqr(t) + Tsqr)* - dphi_001(g,t,T))))/(tanb*Tsqr*sqr(v1)); + dphi)))/(tanb*Tsqr*sqr(v1)); const double t2 = (-16*(-((g2*(mg*mu + 2*T*tanb) + mg*mu*(sqr(t) - Tsqr) - @@ -229,7 +213,7 @@ Eigen::Matrix tadpole_higgs_2loop_at_as_mssm_st_0_mst1_eq_mst2( t*(-5 - 2*lTq + 2*ltq*(3 + lTq) - 3*sqr(ltq)) + T*(5 - 4*lTq + sqr(lTq)))) + mg*mu*(g2 - 2*t*T - 2*g*(t + T) + sqr(t) + Tsqr)* - dphi_001(g,t,T))))/(tanb*Tsqr*sqr(v2)); + dphi)))/(tanb*Tsqr*sqr(v2)); Eigen::Matrix result; result << t1, t2; @@ -253,8 +237,9 @@ Eigen::Matrix tadpole_higgs_2loop_at_as_mssm_general( // workaround for intel or Eigen bug causing unexpected behaviour // of result.allFinite() - if (!std::isfinite(result(0)) || !std::isfinite(result(1))) + if (!std::isfinite(result(0)) || !std::isfinite(result(1))) { result.setZero(); + } return -result; } @@ -265,9 +250,6 @@ Eigen::Matrix self_energy_higgs_2loop_at_as_mssm_with_tadpoles_st_ double /* sxt */, double /* cxt */, double scale2, double mu, double tanb, double vev2, double gs, int /* scheme */) { - using std::atan; - using std::sin; - const double gs2 = sqr(gs); const double g = sqr(mg); const double g2 = sqr(g); @@ -285,13 +267,14 @@ Eigen::Matrix self_energy_higgs_2loop_at_as_mssm_with_tadpoles_st_ const double lgq = logabs(g/q); const double lT2t2 = logabs(Tsqr/t2); const double del = g2 + t2 + Tsqr - 2*(g*t + g*T + t*T); - const double sb = sin(atan(tanb)); + const double sb = std::sin(std::atan(tanb)); const double ht2 = 2./vev2*mt2/sqr(sb); + const double dphi = dphi_010(t,T,g); Eigen::Matrix result; result(0,0) = 0.; - result(0,1) = (32*mg*mu*(-1 + ltq - T*dphi_010(t,T,g)))/T; + result(0,1) = (32*mg*mu*(-1 + ltq - T*dphi))/T; result(1,0) = result(0,1); result(1,1) = (8*(8*del*mg*mu - 8*del*ltq*mg*mu + 8*del*g*tanb - 8*del*g*lgq*tanb + @@ -302,7 +285,7 @@ Eigen::Matrix self_energy_higgs_2loop_at_as_mssm_with_tadpoles_st_ 12*ltg*T*t2*tanb - 8*ltg*t3*tanb - 4*ltg*tanb*Tcub + 8*g*(g + t - T)*T*tanb*phi(t,T,g) + del*T*tanb*sqr(lT2t2) + 8*del*T*tanb*sqr(ltq) - 8*del*T*tanb*sqr(lTq) + - 8*del*mg*mu*T*dphi_010(t,T,g)))/(del*T*tanb); + 8*del*mg*mu*T*dphi))/(del*T*tanb); const double k2 = 0.00004010149318236068; // 1/(4 Pi)^4 const double pref = k2*ht2*mt2*gs2; @@ -332,10 +315,6 @@ double self_energy_pseudoscalar_2loop_at_as_mssm_with_tadpoles_mst1_eq_mst2( double sxt, double cxt, double scale2, double mu, double tanb, double vev2, double gs) { - using std::atan; - using std::log; - using std::sin; - constexpr double Pi2 = M_PI * M_PI; const double g = sqr(mg); const double g2 = sqr(g); @@ -343,7 +322,7 @@ double self_energy_pseudoscalar_2loop_at_as_mssm_with_tadpoles_mst1_eq_mst2( const double q2 = sqr(scale2); const double t = mt2; const double T = mst12; - const double sb = sin(atan(tanb)); + const double sb = std::sin(std::atan(tanb)); const double ht2 = 2./vev2*mt2/sqr(sb); const double At = calc_At(mt2, mst12, mst22, sxt, cxt, mu, tanb); @@ -381,9 +360,10 @@ Eigen::Matrix tadpole_higgs_2loop_at_as_mssm( double mu, double tanb, double vev2, double gs) { if (std::abs(sxt) < 1e-8) { - if (std::abs((mst12 - mst22)/mst12) < 1e-6) + if (std::abs((mst12 - mst22)/mst12) < 1e-6) { return tadpole_higgs_2loop_at_as_mssm_st_0_mst1_eq_mst2( mt2, mg, mst12, mst22, sxt, cxt, scale2, mu, tanb, vev2, gs); + } return tadpole_higgs_2loop_at_as_mssm_st_0( mt2, mg, mst12, mst22, sxt, cxt, scale2, mu, tanb, vev2, gs); @@ -411,8 +391,9 @@ Eigen::Matrix tadpole_higgs_2loop_at_at_mssm( // workaround for intel or Eigen bug causing unexpected behaviour // of result.allFinite() - if (!std::isfinite(result(0)) || !std::isfinite(result(1))) + if (!std::isfinite(result(0)) || !std::isfinite(result(1))) { result.setZero(); + } return -result; } @@ -443,8 +424,9 @@ Eigen::Matrix tadpole_higgs_2loop_atau_atau_mssm( // workaround for intel or Eigen bug causing unexpected behaviour // of result.allFinite() - if (!std::isfinite(result(0)) || !std::isfinite(result(1))) + if (!std::isfinite(result(0)) || !std::isfinite(result(1))) { result.setZero(); + } return -result; } @@ -454,9 +436,10 @@ Eigen::Matrix self_energy_higgs_2loop_at_as_mssm_with_tadpoles( double sxt, double cxt, double scale2, double mu, double tanb, double vev2, double gs, int scheme) { - if (std::abs((mst12 - mst22)/mst12) < 1e-8) + if (std::abs((mst12 - mst22)/mst12) < 1e-8) { return self_energy_higgs_2loop_at_as_mssm_with_tadpoles_st_0_mst1_eq_mst2( mt2, mg, mst12, mst22, sxt, cxt, scale2, mu, tanb, vev2, gs, scheme); + } return self_energy_higgs_2loop_at_as_mssm_with_tadpoles_general( mt2, mg, mst12, mst22, sxt, cxt, scale2, mu, tanb, vev2, gs, scheme); @@ -522,8 +505,9 @@ double self_energy_pseudoscalar_2loop_at_as_mssm_with_tadpoles( const double At = calc_At(mt2, mst12, mst22, sxt, cxt, mu, tanb); // if At = 0 => mu = 0 => dMA(2L) = 0 - if (std::abs(At) < std::numeric_limits::epsilon()) + if (std::abs(At) < std::numeric_limits::epsilon()) { return 0.; + } return self_energy_pseudoscalar_2loop_at_as_mssm_with_tadpoles_mst1_eq_mst2( mt2, mg, mst12, mst22, sxt, cxt, scale2, mu, tanb, vev2, gs); diff --git a/model_specific/MSSM_thresholds/mssm_twoloop_as.cpp b/model_specific/MSSM_thresholds/mssm_twoloop_as.cpp index 27580cd928..fddc23f16c 100644 --- a/model_specific/MSSM_thresholds/mssm_twoloop_as.cpp +++ b/model_specific/MSSM_thresholds/mssm_twoloop_as.cpp @@ -20,11 +20,11 @@ // with the script "as2_to_cpp.m". #include "mssm_twoloop_as.hpp" -#include "dilog.hpp" +#include "Cl2.hpp" +#include "Li2.hpp" #include #include #include -#include #include #include @@ -80,14 +80,6 @@ namespace { return power2(1 - x - y) - 4*x*y; } - /// ClausenCl[2,x] - Real ClausenCl2(Real x) noexcept - { - const std::complex img(0.0l, 1.0l); - - return std::imag(dilog(std::exp(img*x))); - } - /// x < 1 && y < 1, LambdaSquared(x,y) > 0 Real PhiPos(Real x, Real y) noexcept { @@ -95,8 +87,8 @@ namespace { return (-(std::log(x)*std::log(y)) + 2*std::log((1 - lambda + x - y)/2)*std::log((1 - lambda - x + y)/2) - - 2*dilog((1 - lambda + x - y)/2) - - 2*dilog((1 - lambda - x + y)/2) + - 2*Li2((1 - lambda + x - y)/2) + - 2*Li2((1 - lambda - x + y)/2) + power2(Pi)/3)/lambda; } @@ -105,9 +97,9 @@ namespace { { const Real lambda = std::sqrt(-LambdaSquared(x,y)); - return 2*(+ ClausenCl2(2*std::acos((1 + x - y)/(2*std::sqrt(x)))) - + ClausenCl2(2*std::acos((1 - x + y)/(2*std::sqrt(y)))) - + ClausenCl2(2*std::acos((-1 + x + y)/(2*std::sqrt(x*y)))))/lambda; + return 2*(+ Cl2(2*std::acos((1 + x - y)/(2*std::sqrt(x)))) + + Cl2(2*std::acos((1 - x + y)/(2*std::sqrt(y)))) + + Cl2(2*std::acos((-1 + x + y)/(2*std::sqrt(x*y)))))/lambda; } Real Phi(Real x, Real y) noexcept diff --git a/model_specific/MSSM_thresholds/mssm_twoloop_mb.cpp b/model_specific/MSSM_thresholds/mssm_twoloop_mb.cpp index 65ab801df6..c326ad0bae 100644 --- a/model_specific/MSSM_thresholds/mssm_twoloop_mb.cpp +++ b/model_specific/MSSM_thresholds/mssm_twoloop_mb.cpp @@ -20,11 +20,11 @@ // with the script "bquark_to_cpp.m". #include "mssm_twoloop_mb.hpp" -#include "dilog.hpp" +#include "Cl2.hpp" +#include "Li2.hpp" #include #include #include -#include #include namespace flexiblesusy { @@ -71,7 +71,7 @@ namespace { return (6*(mm1*log1u + mm2*log2u) + (-mm1 - mm2)*(7 + pow2(Pi)/6) + - (mm1 - mm2)*(2*dilog(1 - mm1/mm2) + + (mm1 - mm2)*(2*Li2(1 - mm1/mm2) + pow2(log12)/2) + ((mm1 + mm2)*pow2(log12))/2 - 2*(mm1*pow2(log1u) + mm2*pow2(log2u)))/2; @@ -82,14 +82,6 @@ namespace { return pow2(1 - x - y) - 4*x*y; } - /// ClausenCl[2,x] - double ClausenCl2(double x) noexcept - { - const std::complex img(0.0, 1.0); - - return std::imag(dilog(std::exp(img*x))); - } - /// x < 1 && y < 1, LambdaSquared(x,y) > 0 double PhiPos(double x, double y) noexcept { @@ -97,8 +89,8 @@ namespace { return (-(std::log(x)*std::log(y)) + 2*std::log((1 - lambda + x - y)/2)*std::log((1 - lambda - x + y)/2) - - 2*dilog((1 - lambda + x - y)/2) - - 2*dilog((1 - lambda - x + y)/2) + - 2*Li2((1 - lambda + x - y)/2) + - 2*Li2((1 - lambda - x + y)/2) + pow2(Pi)/3)/lambda; } @@ -107,9 +99,9 @@ namespace { { const double lambda = std::sqrt(-LambdaSquared(x,y)); - return 2*(+ ClausenCl2(2*std::acos((1 + x - y)/(2*std::sqrt(x)))) - + ClausenCl2(2*std::acos((1 - x + y)/(2*std::sqrt(y)))) - + ClausenCl2(2*std::acos((-1 + x + y)/(2*std::sqrt(x*y)))))/lambda; + return 2*(+ Cl2(2*std::acos((1 + x - y)/(2*std::sqrt(x)))) + + Cl2(2*std::acos((1 - x + y)/(2*std::sqrt(y)))) + + Cl2(2*std::acos((-1 + x + y)/(2*std::sqrt(x*y)))))/lambda; } double Phi(double x, double y) noexcept diff --git a/model_specific/MSSM_thresholds/mssm_twoloop_mt.cpp b/model_specific/MSSM_thresholds/mssm_twoloop_mt.cpp index c591f870fd..22423bd4f8 100644 --- a/model_specific/MSSM_thresholds/mssm_twoloop_mt.cpp +++ b/model_specific/MSSM_thresholds/mssm_twoloop_mt.cpp @@ -16,11 +16,11 @@ // . // ==================================================================== -// This file has been generated at Wed 17 Jun 2020 11:16:10 +// This file has been generated at Sun 26 Feb 2023 12:30:46 // with the script "tquark_to_cpp.m". #include "mssm_twoloop_mt.hpp" -#include "dilog.hpp" +#include "Li2.hpp" #include #include @@ -85,7 +85,7 @@ namespace { return (6*(mm1*log1u + mm2*log2u) + (-mm1 - mm2)*(7 + pow2(Pi)/6.) + - (mm1 - mm2)*(2*dilog(1 - mm1/mm2) + pow2(log12)/2.) + + (mm1 - mm2)*(2*Li2(1 - mm1/mm2) + pow2(log12)/2.) + ((mm1 + mm2)*pow2(log12))/2. - 2*(mm1*pow2(log1u) + mm2*pow2(log2u)))/2.; } @@ -216,7 +216,6 @@ double dMt_over_mt_2loop_qcd(const Parameters& pars) double dMt_over_mt_2loop_susy(const Parameters& pars) { const double g34 = pow4(pars.g3); - const double Xt = pars.xt; const double mt = pars.mt; const double mgl = shift_mg(pars.mg, pars.mst1, pars.mst2); const double mmu = pow2(pars.Q); @@ -228,8 +227,8 @@ double dMt_over_mt_2loop_susy(const Parameters& pars) const double SX = 2*mt*pars.xt; const double s2t = SX / (mmst1 - mmst2); - if (is_equal(mmst1, mmst2, mmt) && is_equal(mmst1, mmgl, mmt) && - is_equal(mmst1, mmsusy, mmt) && is_equal(std::abs(Xt), 0., 1e-1)) { + if (is_equal(mmst1, mmst2, mmt) && is_equal(mmst1, pow2(pars.mg), mmt) && + is_equal(mmst1, mmsusy, mmt)) { const double logmmsusymmu = std::log(mmsusy/mmu); const double logmmtmmu = std::log(mmt/mmu); @@ -247,365 +246,633 @@ double dMt_over_mt_2loop_susy(const Parameters& pars) const double logmmglmmu = std::log(mmgl/mmu ); const double result = - -10.055555555555555 + 82*logmmtmmu - (20*logmmsusymmu*logmmtmmu)/3. + (56* - mmst1)/(mmgl - mmst1) + (2*mmst1)/(3*mmgl - 3*mmst2) - (896*mmst1)/(9.*( - mmst1 - mmst2)) + (6*mmst2)/(-mmgl + mmst1) + (188*mmst2)/(3*mmgl - 3* - mmst2) + (896*mmst2)/(9.*(mmst1 - mmst2)) + logmmtmmu*(-74 + (8*mmst1)/(3 - *mmgl - 3*mmst1) + (8*mmst2)/(3*mmgl - 3*mmst2)) + (60*mmsusy)/(-mmgl + - mmst1) + (60*mmsusy)/(-mmgl + mmst2) + (16*logmmglmmu*logmmtmmu*mgl*mmgl* - (mmst1 - mmst2)*s2t)/(3.*(mmgl - mmst1)*(mmgl - mmst2)*mt) - (160* - logmmsusymmu*mgl*(mmst1 - mmst2)*mmsusy*s2t)/(3.*(mmgl - mmst1)*(mmgl - - mmst2)*mt) - (16*logmmst1mmu*logmmtmmu*mgl*mmst1*s2t)/(3*mmgl*mt - 3* - mmst1*mt) + (16*logmmst2mmu*logmmtmmu*mgl*mmst2*s2t)/(3*mmgl*mt - 3*mmst2 - *mt) + (8*zt2)/9. + (91*mmst1*zt2)/(9*mmgl - 9*mmst1) - (128*mmst1*zt2)/( - 9.*(mmst1 - mmst2)) + (mmst2*zt2)/(-mmgl + mmst1) + (11*mmst2*zt2)/(mmgl - - mmst2) + (128*mmst2*zt2)/(9.*(mmst1 - mmst2)) + (mmst1*zt2)/(9.*(-mmgl - + mmst2)) + (10*mmsusy*zt2)/(-mmgl + mmst1) + (10*mmsusy*zt2)/(-mmgl + - mmst2) + (20*mgl*(mmst1 - mmst2)*mmsusy*s2t*pow2(logmmsusymmu))/(3.*(mmgl - - mmst1)*(mmgl - mmst2)*mt) - (2825*mmst1*mmst2)/(324.*pow2(mmgl - mmst1 - )) - (27275*mmst1*mmsusy)/(324.*pow2(mmgl - mmst1)) - (40*logmmst1mmu* - logmmsusymmu*mgl*mmst1*mmsusy*s2t)/(3.*mt*pow2(mmgl - mmst1)) - (4*mmst1* - mmst2*zt2)/(3.*pow2(mmgl - mmst1)) - (130*mmst1*mmsusy*zt2)/(9.*pow2(mmgl - - mmst1)) + (40*mgl*(mmst1 - mmsusy)*s2t*fin(mmst1,mmsusy,mmu))/(3.*mt* - pow2(mmgl - mmst1)) + (20*pow2(mmst1))/(3.*(mmgl - mmst1)*(mmgl - mmst2)) - + (896*pow2(mmst1))/(9.*(-mmgl + mmst1)*(mmst1 - mmst2)) + (8*zt2*pow2( - mmst1))/(9.*(mmgl - mmst1)*(mmgl - mmst2)) + (128*zt2*pow2(mmst1))/(9.*(- - mmgl + mmst1)*(mmst1 - mmst2)) + (886*pow2(mmst1))/(9.*pow2(mmgl - mmst1) - ) + (233*mmst2*pow2(mmst1))/(324.*(mmst1 - mmst2)*pow2(mmgl - mmst1)) + ( - 1355*mmsusy*pow2(mmst1))/(324.*(mmst1 - mmsusy)*pow2(mmgl - mmst1)) + (44 - *zt2*pow2(mmst1))/(3.*pow2(mmgl - mmst1)) + (10*mmsusy*zt2*pow2(mmst1))/( - 9.*(mmst1 - mmsusy)*pow2(mmgl - mmst1)) - (2*logmmst1mmu*logmmtmmu*(-10* - mmgl*mmst1 + pow2(mmgl) + 5*pow2(mmst1)))/(3.*pow2(mmgl - mmst1)) - (8* - mmst1*mmst2)/pow2(mmgl - mmst2) - (27275*mmst2*mmsusy)/(324.*pow2(mmgl - - mmst2)) + (40*logmmst2mmu*logmmsusymmu*mgl*mmst2*mmsusy*s2t)/(3.*mt*pow2( - mmgl - mmst2)) - (4*mmst1*mmst2*zt2)/(3.*pow2(mmgl - mmst2)) - (130*mmst2 - *mmsusy*zt2)/(9.*pow2(mmgl - mmst2)) - (40*mgl*(mmst2 - mmsusy)*s2t*fin( - mmst2,mmsusy,mmu))/(3.*mt*pow2(mmgl - mmst2)) + (40*logmmglmmu* - logmmsusymmu*mgl*mmgl*(2*mmgl - mmst1 - mmst2)*(mmst1 - mmst2)*mmsusy*s2t - )/(3.*mt*pow2(mmgl - mmst1)*pow2(mmgl - mmst2)) - (40*mgl*(mmst1 - mmst2) - *(mmgl*(mmst1 + mmst2 - 2*mmsusy) + mmst2*mmsusy + mmst1*(-2*mmst2 + - mmsusy))*s2t*fin(mmgl,mmsusy,mmu))/(3.*mt*pow2(mmgl - mmst1)*pow2(mmgl - - mmst2)) + (8*logmmglmmu*logmmtmmu*((2*mmst1)/(-mmgl + mmst1) - pow2(mmst1 - )/pow2(mmgl - mmst1) + (8*mmgl*mmst2 - 5*pow2(mmgl) - 4*pow2(mmst2))/pow2 - (mmgl - mmst2)))/3. - (896*pow2(mmst2))/(9.*(mmst1 - mmst2)*(-mmgl + - mmst2)) - (128*zt2*pow2(mmst2))/(9.*(mmst1 - mmst2)*(-mmgl + mmst2)) - ( - 233*mmst1*pow2(mmst2))/(216.*(mmst1 - mmst2)*pow2(mmgl - mmst1)) + (886* - pow2(mmst2))/(9.*pow2(mmgl - mmst2)) + (1355*mmsusy*pow2(mmst2))/(324.*( - mmst2 - mmsusy)*pow2(mmgl - mmst2)) + (44*zt2*pow2(mmst2))/(3.*pow2(mmgl - - mmst2)) + (10*mmsusy*zt2*pow2(mmst2))/(9.*(mmst2 - mmsusy)*pow2(mmgl - - mmst2)) + (233*pow2(mmst1)*pow2(mmst2))/(648.*pow2(mmgl - mmst1)*pow2( - mmst1 - mmst2)) + (4*mgl*(mmst1 - mmst2)*s2t*fin(mmst1,mmst2,mmu)*(-( - mmst1*mmst2) - 5*mmgl*(mmst1 + mmst2) + 5*pow2(mmgl) + 3*pow2(mmst1) + 3* - pow2(mmst2)))/(9.*mt*pow2(mmgl - mmst1)*pow2(mmgl - mmst2)) - (4*mgl*s2t* - fin(mmst2,mmgl,mmu)*(-7*mmst1*mmst2 + mmgl*(-37*mmst1 + mmst2) + 18*pow2( - mmgl) + 22*pow2(mmst1) + 3*pow2(mmst2)))/(9.*(mmgl - mmst2)*mt*pow2(mmgl - - mmst1)) - (2*logmmst2mmu*logmmtmmu*(-10*mmgl*mmst2 + pow2(mmgl) + 5* - pow2(mmst2)))/(3.*pow2(mmgl - mmst2)) + (4*mgl*s2t*fin(mmst1,mmgl,mmu)*( - mmgl*(mmst1 - 37*mmst2) - 7*mmst1*mmst2 + 18*pow2(mmgl) + 3*pow2(mmst1) + - 22*pow2(mmst2)))/(9.*(mmgl - mmst1)*mt*pow2(mmgl - mmst2)) - (515*mmst1* - pow2(mmsusy))/(108.*(mmst1 - mmsusy)*pow2(mmgl - mmst1)) - (20*mmst1*zt2* - pow2(mmsusy))/(9.*(mmst1 - mmsusy)*pow2(mmgl - mmst1)) - (515*mmst2*pow2( - mmsusy))/(108.*(mmst2 - mmsusy)*pow2(mmgl - mmst2)) - (20*mmst2*zt2*pow2( - mmsusy))/(9.*(mmst2 - mmsusy)*pow2(mmgl - mmst2)) + (95*pow2(mmst1)*pow2( - mmsusy))/(162.*pow2(mmgl - mmst1)*pow2(mmst1 - mmsusy)) + (10*zt2*pow2( - mmst1)*pow2(mmsusy))/(9.*pow2(mmgl - mmst1)*pow2(mmst1 - mmsusy)) + (95* - pow2(mmst2)*pow2(mmsusy))/(162.*pow2(mmgl - mmst2)*pow2(mmst2 - mmsusy)) - + (10*zt2*pow2(mmst2)*pow2(mmsusy))/(9.*pow2(mmgl - mmst2)*pow2(mmst2 - - mmsusy)) - (256*pow2(s2t))/9. + (63625*mmst1*pow2(s2t))/(1296.*(-mmgl + - mmst1)) + (56281*mmst1*pow2(s2t))/(1296.*(mmgl - mmst2)) + (896*mmst1* - pow2(s2t))/(9.*(mmst1 - mmst2)) + (10535*mmst2*pow2(s2t))/(3888.*(mmgl - - mmst1)) - (896*mmst2*pow2(s2t))/(9.*(mmst1 - mmst2)) + (mmst1*mmst2*pow2( - s2t))/(648.*(-mmgl + mmst1)*(mmst1 - mmst2)) + (10967*mmst2*pow2(s2t))/( - 1296.*(-mmgl + mmst2)) - (85*mmst1*mmst2*pow2(s2t))/(972.*(mmst1 - mmst2) - *(-mmgl + mmst2)) + (41*mmst1*zt2*pow2(s2t))/(9.*(-mmgl + mmst1)) + (52* - mmst1*zt2*pow2(s2t))/(9*mmgl - 9*mmst2) + (128*mmst1*zt2*pow2(s2t))/(9.*( - mmst1 - mmst2)) + (11*mmst2*zt2*pow2(s2t))/(9*mmgl - 9*mmst2) - (128* - mmst2*zt2*pow2(s2t))/(9.*(mmst1 - mmst2)) + (mmst1*mmst2*zt2*pow2(s2t))/( - 27.*(-mmgl + mmst1)*(mmst1 - mmst2)) - (mmst1*mmst2*zt2*pow2(s2t))/(27.*( - mmst1 - mmst2)*(-mmgl + mmst2)) + (16*mmst1*mmst2*pow2(s2t))/(9.*pow2( - mmgl - mmst1)) + (52825*pow2(mmst1)*pow2(s2t))/(1296.*(mmgl - mmst1)*( - mmgl - mmst2)) + (96683*pow2(mmst1)*pow2(s2t))/(972.*(mmgl - mmst1)*( - mmst1 - mmst2)) - (85*pow2(mmst1)*pow2(s2t))/(972.*(mmst1 - mmst2)*(-mmgl - + mmst2)) + (52*zt2*pow2(mmst1)*pow2(s2t))/(9.*(mmgl - mmst1)*(mmgl - - mmst2)) + (383*zt2*pow2(mmst1)*pow2(s2t))/(27.*(mmgl - mmst1)*(mmst1 - - mmst2)) - (zt2*pow2(mmst1)*pow2(s2t))/(27.*(mmst1 - mmst2)*(-mmgl + mmst2 - )) - (2*pow2(mmst1)*pow2(s2t))/pow2(mmgl - mmst1) + (16*mmst1*mmst2*pow2( - s2t))/(9.*pow2(mmgl - mmst2)) + (85*pow2(mmst2)*pow2(s2t))/(972.*(-mmgl + - mmst1)*(mmst1 - mmst2)) + (387233*pow2(mmst2)*pow2(s2t))/(3888.*(mmst1 - - mmst2)*(-mmgl + mmst2)) + (zt2*pow2(mmst2)*pow2(s2t))/(27.*(-mmgl + mmst1 - )*(mmst1 - mmst2)) + (383*zt2*pow2(mmst2)*pow2(s2t))/(27.*(mmst1 - mmst2) - *(-mmgl + mmst2)) - (2*pow2(mmst2)*pow2(s2t))/pow2(mmgl - mmst2) + (167* - mmst1*pow2(mmst2)*pow2(s2t))/(3888.*(mmgl - mmst1)*pow2(mmst1 - mmst2)) + - (4*mgl*(mmst1 - mmst2)*s2t*(18*mmst2 + 180*mmsusy + 3*mmst2*zt2 + 30* - mmsusy*zt2 + mmst1*(18 + 3*zt2 - 4*pow2(s2t)) - 4*mmst2*pow2(s2t) + mmgl* - (147 + 19*zt2 + 8*pow2(s2t))))/(9.*(mmgl - mmst1)*(mmgl - mmst2)*mt) - (8 - *logmmglmmu*mgl*mmgl*(mmst1 - mmst2)*s2t*(mmgl*(-107*mmst1 - 107*mmst2 + - 60*mmsusy) + 65*pow2(mmgl) + pow2(mmst1)*(-3 + 2*pow2(s2t)) + mmst1*(155* - mmst2 - 30*mmsusy - 4*mmst2*pow2(s2t)) + mmst2*(-3*mmst2 - 30*mmsusy + 2* - mmst2*pow2(s2t))))/(9.*mt*pow2(mmgl - mmst1)*pow2(mmgl - mmst2)) + (8* - logmmst2mmu*mgl*s2t*(mmst2*(30*mmst1*mmsusy + 3*pow2(mmst1) + 2*pow2( - mmst2)*(-3 + pow2(s2t)) + mmst1*mmst2*(-41 + 6*pow2(s2t))) + pow2(mmgl)*( - 2*mmst1*(4 + pow2(s2t)) + mmst2*(7 + 6*pow2(s2t))) - mmgl*(2*pow2(mmst1)* - pow2(s2t) + mmst1*mmst2*(15 + 4*pow2(s2t)) + 2*mmst2*(15*mmsusy + mmst2*( - -26 + 5*pow2(s2t)))) - 8*pow3(mmgl)))/(9.*(mmgl - mmst1)*mt*pow2(mmgl - - mmst2)) + (8*logmmst1mmu*mgl*s2t*(mmgl*(30*mmst1*mmsusy + 2*pow2(mmst2)* - pow2(s2t) + mmst1*mmst2*(15 + 4*pow2(s2t)) + 2*pow2(mmst1)*(-26 + 5*pow2( - s2t))) - mmst1*(3*mmst2*(mmst2 + 10*mmsusy) + 2*pow2(mmst1)*(-3 + pow2( - s2t)) + mmst1*mmst2*(-41 + 6*pow2(s2t))) - pow2(mmgl)*(2*mmst2*(4 + pow2( - s2t)) + mmst1*(7 + 6*pow2(s2t))) + 8*pow3(mmgl)))/(9.*(mmgl - mmst2)*mt* - pow2(mmgl - mmst1)) + (10*logmmst1mmu*logmmsusymmu*mmst1*(3*mmgl + mmst1) - *mmsusy)/(3.*pow3(mmgl - mmst1)) + (10*fin(mmst1,mmsusy,mmu)*(-3*mmgl*( - mmst1 - mmsusy) + mmst1*(mmst1 + mmsusy) - 2*pow2(mmgl)))/(3.*pow3(mmgl - - mmst1)) + (85*pow2(s2t)*pow3(mmst1))/(972.*(mmgl - mmst1)*(mmgl - mmst2)* - (mmst1 - mmst2)) + (zt2*pow2(s2t)*pow3(mmst1))/(27.*(mmgl - mmst1)*(mmgl - - mmst2)*(mmst1 - mmst2)) + (112*pow3(mmst1))/(3.*pow3(mmgl - mmst1)) + ( - 16*zt2*pow3(mmst1))/(3.*pow3(mmgl - mmst1)) - (2*mgl*mmst1*s2t*pow2( - logmmst1mmu)*(-2*pow2(mmgl)*(15*mmst1*mmsusy - 15*mmst2*mmsusy + 4*pow2( - mmst2)*(-1 + pow2(s2t)) + mmst1*mmst2*(11 + 8*pow2(s2t)) + pow2(mmst1)*(- - 31 + 12*pow2(s2t))) + 2*(mmst1*(-7 + 4*pow2(s2t)) + mmst2*(-1 + 4*pow2( - s2t)))*pow3(mmgl) + mmst1*(-3*mmst1*mmst2*(11*mmst2 + 10*mmsusy) + 3*( - mmst2 + 10*mmsusy)*pow2(mmst2) + mmst2*pow2(mmst1)*(43 - 16*pow2(s2t)) + - 3*pow3(mmst1)) + mmgl*(-3*(mmst2 + 10*mmsusy)*pow2(mmst2) + mmst1*pow2( - mmst2)*(21 + 8*pow2(s2t)) + pow2(mmst1)*(-11*mmst2 + 30*mmsusy + 24*mmst2 - *pow2(s2t)) + (-55 + 16*pow2(s2t))*pow3(mmst1))))/(9.*(mmgl - mmst2)*( - mmst1 - mmst2)*mt*pow3(-mmgl + mmst1)) + (10*fin(mmgl,mmsusy,mmu)*(1/(- - mmgl + mmst1) + 1/(-mmgl + mmst2) - (3*mmsusy)/pow2(mmgl - mmst1) - (3* - mmsusy)/pow2(mmgl - mmst2) + (4*pow2(mmst1))/pow3(mmgl - mmst1) + (mmst1* - (-3*mmgl + 3*mmst1 + 4*mmsusy))/pow3(-mmgl + mmst1) + (mmst2*(3*mmgl - 4* - mmsusy))/pow3(mmgl - mmst2) + pow2(mmst2)/pow3(mmgl - mmst2)))/3. + (fin( - mmst2,mmgl,mmu)*(7/(-mmgl + mmst1) + 45/(mmgl - mmst2) + 128/(mmst1 - - mmst2) + (11*pow2(s2t))/(-mmgl + mmst1) + (11*pow2(s2t))/(mmgl - mmst2) - - (128*pow2(s2t))/(mmst1 - mmst2) + mmst2*(-128/((mmst1 - mmst2)*(-mmgl + - mmst2)) - 9/pow2(mmgl - mmst1) + 108/pow2(mmgl - mmst2) + (128*pow2(s2t)) - /((mmst1 - mmst2)*(-mmgl + mmst2))) + (mmst1*(17*mmgl - 2*mmst1*(4 + 13* - pow2(s2t)) + mmst2*(-9 + 26*pow2(s2t))))/((mmgl - mmst2)*pow2(mmgl - - mmst1)) + (12*pow2(mmst1))/pow3(mmgl - mmst1) + (12*mmst1*mmst2)/pow3(- - mmgl + mmst1) + (48*pow2(mmst2))/pow3(mmgl - mmst2)))/9. + (10* - logmmst2mmu*logmmsusymmu*mmst2*(3*mmgl + mmst2)*mmsusy)/(3.*pow3(mmgl - - mmst2)) + (10*fin(mmst2,mmsusy,mmu)*(-3*mmgl*(mmst2 - mmsusy) + mmst2*( - mmst2 + mmsusy) - 2*pow2(mmgl)))/(3.*pow3(mmgl - mmst2)) + (271*pow3( - mmst2))/(648.*(mmst1 - mmst2)*pow2(mmgl - mmst1)) + (zt2*pow3(mmst2))/(9. - *(mmst1 - mmst2)*pow2(mmgl - mmst1)) - (7*mmst1*pow3(mmst2))/(9.*pow2( - mmgl - mmst1)*pow2(mmst1 - mmst2)) - (mmst1*zt2*pow3(mmst2))/(9.*pow2( - mmgl - mmst1)*pow2(mmst1 - mmst2)) + (169*pow2(s2t)*pow3(mmst2))/(1296.*( - -mmgl + mmst1)*pow2(mmst1 - mmst2)) - (85*pow2(s2t)*pow3(mmst2))/(972.*(- - mmgl + mmst2)*pow2(mmst1 - mmst2)) + (zt2*pow2(s2t)*pow3(mmst2))/(27.*(- - mmgl + mmst1)*pow2(mmst1 - mmst2)) - (zt2*pow2(s2t)*pow3(mmst2))/(27.*(- - mmgl + mmst2)*pow2(mmst1 - mmst2)) + (112*pow3(mmst2))/(3.*pow3(mmgl - - mmst2)) + (16*zt2*pow3(mmst2))/(3.*pow3(mmgl - mmst2)) + (2*mgl*mmst2*s2t - *pow2(logmmst2mmu)*(-2*pow2(mmgl)*(-15*mmst1*mmsusy + 15*mmst2*mmsusy + 4 - *pow2(mmst1)*(-1 + pow2(s2t)) + mmst1*mmst2*(11 + 8*pow2(s2t)) + pow2( - mmst2)*(-31 + 12*pow2(s2t))) + 2*(mmst2*(-7 + 4*pow2(s2t)) + mmst1*(-1 + - 4*pow2(s2t)))*pow3(mmgl) + mmgl*(mmst1*pow2(mmst2)*(-11 + 24*pow2(s2t)) + - pow2(mmst1)*(-30*mmsusy + mmst2*(21 + 8*pow2(s2t))) + pow2(mmst2)*(30* - mmsusy + mmst2*(-55 + 16*pow2(s2t))) - 3*pow3(mmst1)) + mmst2*((-33*mmst2 - + 30*mmsusy)*pow2(mmst1) + mmst1*mmst2*(-30*mmsusy + mmst2*(43 - 16*pow2 - (s2t))) + 3*pow3(mmst1) + 3*pow3(mmst2))))/(9.*(mmgl - mmst1)*(mmst1 - - mmst2)*mt*pow3(mmgl - mmst2)) + (fin(mmst1,mmgl,mmu)*(37/(mmgl - mmst1) + - 1/(mmgl - mmst2) - 128/(mmst1 - mmst2) + (mmst2*(9 - 26*pow2(s2t)))/pow2( - mmgl - mmst2) + (15*pow2(s2t))/(-mmgl + mmst1) + (15*pow2(s2t))/(mmgl - - mmst2) + (128*pow2(s2t))/(mmst1 - mmst2) + (48*pow2(mmst1))/pow3(mmgl - - mmst1) + (12*pow2(mmst2))/pow3(mmgl - mmst2) + mmst1*(8/((mmgl - mmst1)*( - mmgl - mmst2)) + 128/((-mmgl + mmst1)*(mmst1 - mmst2)) + 108/pow2(mmgl - - mmst1) - 9/pow2(mmgl - mmst2) + (2*(64*mmgl + 13*mmst1 - 77*mmst2)*pow2( - s2t))/((mmgl - mmst1)*(mmgl - mmst2)*(mmst1 - mmst2)) + (12*mmst2)/pow3(- - mmgl + mmst2))))/9. - (95*mmst1*pow3(mmsusy))/(162.*pow2(mmgl - mmst1)* - pow2(mmst1 - mmsusy)) - (10*mmst1*zt2*pow3(mmsusy))/(9.*pow2(mmgl - mmst1 - )*pow2(mmst1 - mmsusy)) - (95*mmst2*pow3(mmsusy))/(162.*pow2(mmgl - mmst2 - )*pow2(mmst2 - mmsusy)) - (10*mmst2*zt2*pow3(mmsusy))/(9.*pow2(mmgl - - mmst2)*pow2(mmst2 - mmsusy)) + (10*logmmglmmu*logmmsusymmu*mmgl*mmsusy*(3 - *mmgl*(mmst1 + mmst2)*pow2(mmst1 - mmst2) + pow2(mmgl)*(6*mmst1*mmst2 - 9 - *pow2(mmst1) - 9*pow2(mmst2)) + mmst1*mmst2*(pow2(mmst1) + pow2(mmst2)) + - 8*(mmst1 + mmst2)*pow3(mmgl) - 6*pow4(mmgl)))/(3.*pow3(mmgl - mmst1)*pow3 - (mmgl - mmst2)) + (5*pow2(logmmsusymmu)*(mmst1*mmst2*(2*mmst1*mmst2 - - mmst1*mmsusy - mmst2*mmsusy) + pow2(mmgl)*(8*mmst1*mmst2 + 5*mmst1*mmsusy - + 5*mmst2*mmsusy + 2*pow2(mmst1) + 2*pow2(mmst2)) - mmgl*(4*mmst1*mmst2* - (mmst2 - mmsusy) + (4*mmst2 + 3*mmsusy)*pow2(mmst1) + 3*mmsusy*pow2(mmst2 - )) - 2*(2*mmst1 + 2*mmst2 + 3*mmsusy)*pow3(mmgl) + 2*pow4(mmgl)))/(3.* - pow2(mmgl - mmst1)*pow2(mmgl - mmst2)) - (4*logmmglmmu*logmmst1mmu*mgl* - mmgl*s2t*(2*pow2(mmgl)*(69*mmst1*mmst2 + 26*pow2(mmst1) + 8*pow2(mmst2)) - + pow2(mmst1)*(mmst1*mmst2*(6 - 8*pow2(s2t)) + pow2(mmst1)*(-3 + 4*pow2( - s2t)) + pow2(mmst2)*(47 + 4*pow2(s2t))) + mmgl*mmst1*(pow2(mmst1)*(1 - 4* - pow2(s2t)) + 8*mmst1*mmst2*(-13 + pow2(s2t)) - pow2(mmst2)*(67 + 4*pow2( - s2t))) - 2*(35*mmst1 + 16*mmst2)*pow3(mmgl) + 16*pow4(mmgl)))/(9.*mt*pow2 - (mmgl - mmst2)*pow3(mmgl - mmst1)) + (4*logmmglmmu*logmmst2mmu*mgl*mmgl* - s2t*(2*pow2(mmgl)*(69*mmst1*mmst2 + 8*pow2(mmst1) + 26*pow2(mmst2)) + - pow2(mmst2)*(mmst1*mmst2*(6 - 8*pow2(s2t)) + pow2(mmst2)*(-3 + 4*pow2(s2t - )) + pow2(mmst1)*(47 + 4*pow2(s2t))) + mmgl*mmst2*(pow2(mmst2)*(1 - 4* - pow2(s2t)) + 8*mmst1*mmst2*(-13 + pow2(s2t)) - pow2(mmst1)*(67 + 4*pow2( - s2t))) - 2*(16*mmst1 + 35*mmst2)*pow3(mmgl) + 16*pow4(mmgl)))/(9.*mt*pow2 - (mmgl - mmst1)*pow3(mmgl - mmst2)) + (10*logmmsusymmu*(mmst1*mmst2*(19* - mmst1*mmst2 + 12*mmst1*mmsusy + 12*mmst2*mmsusy) + pow2(mmgl)*(76*mmst1* - mmst2 - 60*mmst1*mmsusy - 60*mmst2*mmsusy + 19*pow2(mmst1) + 19*pow2( - mmst2)) + mmgl*(-2*mmst1*mmst2*(19*mmst2 + 24*mmsusy) + (-38*mmst2 + 36* - mmsusy)*pow2(mmst1) + 36*mmsusy*pow2(mmst2)) + (-38*mmst1 - 38*mmst2 + 72 - *mmsusy)*pow3(mmgl) + 19*pow4(mmgl)))/(9.*pow2(mmgl - mmst1)*pow2(mmgl - - mmst2)) + (2*mgl*mmgl*(mmst1 - mmst2)*s2t*pow2(logmmglmmu)*(-(mmst1*mmst2 - *(3*mmst2*(mmst2 + 10*mmsusy) + mmst1*(-248*mmst2 + 30*mmsusy) + 3*pow2( - mmst1))) + pow2(mmgl)*(598*mmst1*mmst2 - 90*mmst1*mmsusy - 90*mmst2* - mmsusy + 141*pow2(mmst1) + 141*pow2(mmst2)) - 2*(97*mmst1 + 97*mmst2 - 30 - *mmsusy)*pow3(mmgl) + 3*mmgl*(mmst1*mmst2*(-131*mmst2 + 40*mmsusy) + (- - 131*mmst2 + 10*mmsusy)*pow2(mmst1) + (mmst2 + 10*mmsusy)*pow2(mmst2) + - pow3(mmst1)) + 46*pow4(mmgl)))/(9.*mt*pow3(mmgl - mmst1)*pow3(mmgl - - mmst2)) + (271*pow4(mmst2))/(648.*pow2(mmgl - mmst1)*pow2(mmst1 - mmst2)) - + (zt2*pow4(mmst2))/(9.*pow2(mmgl - mmst1)*pow2(mmst1 - mmst2)) - (4* - logmmst1mmu*logmmst2mmu*mgl*s2t*(-8*(mmst1 + mmst2)*pow2(mmgl)*(mmst1* - mmst2*(-3 + pow2(s2t)) + pow2(mmst1)*pow2(s2t) + pow2(mmst2)*pow2(s2t)) - - mmst1*mmst2*(mmst1 + mmst2)*(3*pow2(mmst1) + 3*pow2(mmst2) + 2*mmst1* - mmst2*(-7 + 4*pow2(s2t))) + 4*(2*mmst1*mmst2*(-2 + pow2(s2t)) + pow2( - mmst1)*pow2(s2t) + pow2(mmst2)*pow2(s2t))*pow3(mmgl) + 4*mmgl*(2*pow2( - mmst1)*pow2(mmst2)*(-5 + 4*pow2(s2t)) + mmst2*(-1 + pow2(s2t))*pow3(mmst1 - ) + mmst1*(-1 + pow2(s2t))*pow3(mmst2) + pow2(s2t)*pow4(mmst1) + pow2(s2t - )*pow4(mmst2))))/(9.*(mmst1 - mmst2)*mt*pow2(mmgl - mmst1)*pow2(mmgl - - mmst2)) - (logmmst1mmu*logmmst2mmu*(3*pow2(mmst1)*pow2(mmst2)*(pow2(mmst1 - ) + pow2(mmst2) - 3*mmst1*mmst2*pow2(s2t)) + mmgl*mmst1*mmst2*(mmst1 + - mmst2)*(9*pow2(mmst1) + 9*pow2(mmst2) + 2*mmst1*mmst2*(-7 + 11*pow2(s2t)) - ) + 2*(mmst1 + mmst2)*(mmst1*mmst2*(20 - 39*pow2(s2t)) + 24*pow2(mmst1)* - pow2(s2t) + 24*pow2(mmst2)*pow2(s2t))*pow3(mmgl) - (mmst1*mmst2*(30 - 43* - pow2(s2t)) + 48*pow2(mmst1)*pow2(s2t) + 48*pow2(mmst2)*pow2(s2t))*pow4( - mmgl) - pow2(mmgl)*(2*pow2(mmst1)*pow2(mmst2)*(1 + 28*pow2(s2t)) + mmst2* - (31 - 19*pow2(s2t))*pow3(mmst1) + mmst1*(31 - 19*pow2(s2t))*pow3(mmst2) + - 16*pow2(s2t)*pow4(mmst1) + 16*pow2(s2t)*pow4(mmst2)) + 16*(mmst1 + mmst2) - *pow2(s2t)*pow5(mmgl)))/(9.*pow3(mmgl - mmst1)*pow3(mmgl - mmst2)) + (fin - (mmst1,mmst2,mmu)*(-(mmst1*mmst2*(mmst1 + mmst2)*(3*pow2(mmst1) + 3*pow2( - mmst2) + mmst1*mmst2*(4 - 15*pow2(s2t)))) - (mmst1 + mmst2)*pow2(mmgl)*( - mmst1*mmst2*(94 - 68*pow2(s2t)) + pow2(mmst1)*(-29 + 11*pow2(s2t)) + pow2 - (mmst2)*(-29 + 11*pow2(s2t))) + 2*(2*mmst1*mmst2*(19 - 6*pow2(s2t)) + - pow2(mmst1)*(-17 + 9*pow2(s2t)) + pow2(mmst2)*(-17 + 9*pow2(s2t)))*pow3( - mmgl) - (mmst1 + mmst2)*(-14 + 29*pow2(s2t))*pow4(mmgl) - mmgl*(2*pow2( - mmst1)*pow2(mmst2)*(-17 + 45*pow2(s2t)) + 2*mmst2*(-13 + 2*pow2(s2t))* - pow3(mmst1) + 2*mmst1*(-13 + 2*pow2(s2t))*pow3(mmst2) + 9*pow4(mmst1) + 9 - *pow4(mmst2)) + 2*(-6 + 11*pow2(s2t))*pow5(mmgl)))/(9.*pow3(mmgl - mmst1) - *pow3(mmgl - mmst2)) - (logmmst2mmu*(mmst1*(mmst1 - mmst2)*pow2(mmst2)*( - 60*mmst1*mmsusy + 6*pow2(mmst1) + mmst1*mmst2*(165 - 98*pow2(s2t)) + 4* - pow2(mmst2)*(3 + 2*pow2(s2t))) + pow3(mmgl)*(mmst1*mmst2*(180*mmsusy + - mmst2*(239 - 704*pow2(s2t))) - 5*pow2(mmst1)*(mmst2 + 46*mmst2*pow2(s2t)) - + pow2(mmst2)*(-180*mmsusy + mmst2*(489 + 70*pow2(s2t))) + (45 + 96*pow2( - s2t))*pow3(mmst1)) - (mmst1*mmst2*(159 - 482*pow2(s2t)) + pow2(mmst2)*( - 263 - 174*pow2(s2t)) + 18*pow2(mmst1)*(5 + 8*pow2(s2t)))*pow4(mmgl) - - pow2(mmgl)*(mmst1*pow2(mmst2)*(-420*mmsusy + mmst2*(1195 - 284*pow2(s2t)) - ) + mmst2*pow2(mmst1)*(360*mmsusy - mmst2*(721 + 320*pow2(s2t))) + 3* - mmst2*(-5 + 4*pow2(s2t))*pow3(mmst1) + (60*mmsusy + mmst2*(53 + 64*pow2( - s2t)))*pow3(mmst2) + 16*pow2(s2t)*pow4(mmst1)) + mmgl*mmst2*(2*mmst1*pow2 - (mmst2)*(60*mmsusy + mmst2*(199 - 69*pow2(s2t))) + mmst2*pow2(mmst1)*(- - 300*mmsusy + mmst2*(259 - 64*pow2(s2t))) + (180*mmsusy + mmst2*(-511 + 50 - *pow2(s2t)))*pow3(mmst1) + 18*pow4(mmst1) + 12*(-3 + 2*pow2(s2t))*pow4( - mmst2)) + (mmst2*(83 - 192*pow2(s2t)) + mmst1*(45 + 64*pow2(s2t)))*pow5( - mmgl)))/(9.*(mmst1 - mmst2)*pow2(mmgl - mmst1)*pow3(mmgl - mmst2)) - ( - logmmst1mmu*((mmst1 - mmst2)*mmst2*pow2(mmst1)*(6*mmst2*(mmst2 + 10* - mmsusy) + mmst1*mmst2*(165 - 98*pow2(s2t)) + 4*pow2(mmst1)*(3 + 2*pow2( - s2t))) - pow3(mmgl)*(pow2(mmst1)*(239*mmst2 - 180*mmsusy - 704*mmst2*pow2 - (s2t)) - 5*mmst1*mmst2*(mmst2 - 36*mmsusy + 46*mmst2*pow2(s2t)) + (489 + - 70*pow2(s2t))*pow3(mmst1) + 3*(15 + 32*pow2(s2t))*pow3(mmst2)) + (mmst1* - mmst2*(159 - 482*pow2(s2t)) + pow2(mmst1)*(263 - 174*pow2(s2t)) + 18*pow2 - (mmst2)*(5 + 8*pow2(s2t)))*pow4(mmgl) - mmgl*mmst1*(mmst2*pow2(mmst1)*( - 259*mmst2 + 120*mmsusy - 64*mmst2*pow2(s2t)) + mmst1*pow2(mmst2)*(-511* - mmst2 - 300*mmsusy + 50*mmst2*pow2(s2t)) + 2*mmst2*(199 - 69*pow2(s2t))* - pow3(mmst1) + 18*(mmst2 + 10*mmsusy)*pow3(mmst2) + 12*(-3 + 2*pow2(s2t))* - pow4(mmst1)) + pow2(mmgl)*(3*mmst1*pow2(mmst2)*(-5*mmst2 + 120*mmsusy + 4 - *mmst2*pow2(s2t)) - mmst2*pow2(mmst1)*(721*mmst2 + 420*mmsusy + 320*mmst2 - *pow2(s2t)) + (1195*mmst2 + 60*mmsusy - 284*mmst2*pow2(s2t))*pow3(mmst1) - + (53 + 64*pow2(s2t))*pow4(mmst1) + 16*pow2(s2t)*pow4(mmst2)) + (-(mmst2* - (45 + 64*pow2(s2t))) + mmst1*(-83 + 192*pow2(s2t)))*pow5(mmgl)))/(9.*( - mmst1 - mmst2)*pow2(mmgl - mmst2)*pow3(mmgl - mmst1)) + (pow2(logmmst1mmu - )*(-((mmst1 - mmst2)*mmst2*(3*mmst2*(mmst2 + 10*mmsusy) + 3*pow2(mmst1) + - mmst1*mmst2*(32 - 51*pow2(s2t)))*pow3(mmst1)) + mmst1*pow3(mmgl)*(pow2( - mmst1)*(945*mmst2 - 60*mmsusy - 762*mmst2*pow2(s2t)) + mmst1*mmst2*(83* - mmst2 - 120*mmsusy - 342*mmst2*pow2(s2t)) + pow2(mmst2)*(7*mmst2 + 180* - mmsusy - 50*mmst2*pow2(s2t)) - 7*(-35 + 18*pow2(s2t))*pow3(mmst1)) + (2* - mmst1*mmst2*(-53*mmst2 - 45*mmsusy + 127*mmst2*pow2(s2t)) + pow2(mmst1)*( - -676*mmst2 + 90*mmsusy + 685*mmst2*pow2(s2t)) + (-492 + 341*pow2(s2t))* - pow3(mmst1) - 6*pow3(mmst2))*pow4(mmgl) + mmgl*pow2(mmst1)*(mmst2*pow2( - mmst1)*(229*mmst2 + 60*mmsusy - 128*mmst2*pow2(s2t)) + mmst1*pow2(mmst2)* - (-183*mmst2 - 120*mmsusy + 76*mmst2*pow2(s2t)) + mmst2*(85 - 76*pow2(s2t) - )*pow3(mmst1) + 6*(mmst2 + 10*mmsusy)*pow3(mmst2) - 9*pow4(mmst1)) + - mmst1*pow2(mmgl)*(mmst1*pow2(mmst2)*(141*mmst2 - 30*mmsusy - 35*mmst2* - pow2(s2t)) + 3*mmst2*pow2(mmst1)*(-51*mmst2 + 50*mmsusy + 115*mmst2*pow2( - s2t)) + (-623*mmst2 - 30*mmsusy + 305*mmst2*pow2(s2t))*pow3(mmst1) - 9*( - mmst2 + 10*mmsusy)*pow3(mmst2) + (4 + 25*pow2(s2t))*pow4(mmst1)) + (12* - pow2(mmst2) + mmst1*mmst2*(242 - 332*pow2(s2t)) + pow2(mmst1)*(386 - 308* - pow2(s2t)))*pow5(mmgl) - 2*(3*mmst2 + mmst1*(61 - 64*pow2(s2t)))*pow6( - mmgl)))/(18.*(mmst1 - mmst2)*pow2(mmgl - mmst2)*pow4(mmgl - mmst1)) + ( - pow2(logmmst2mmu)*(mmst2*pow3(mmgl)*(pow2(mmst2)*(60*mmsusy + 7*mmst2*(- - 35 + 18*pow2(s2t))) + 3*mmst1*mmst2*(40*mmsusy + mmst2*(-315 + 254*pow2( - s2t))) + pow2(mmst1)*(-180*mmsusy + mmst2*(-83 + 342*pow2(s2t))) + (-7 + - 50*pow2(s2t))*pow3(mmst1)) - mmst1*(mmst1 - mmst2)*(30*mmst1*mmsusy + 3* - pow2(mmst1) + 3*pow2(mmst2) + mmst1*mmst2*(32 - 51*pow2(s2t)))*pow3(mmst2 - ) + (mmst1*mmst2*(90*mmsusy + mmst2*(676 - 685*pow2(s2t))) + pow2(mmst2)* - (-90*mmsusy + mmst2*(492 - 341*pow2(s2t))) + 2*mmst2*pow2(mmst1)*(53 - - 127*pow2(s2t)) + 6*pow3(mmst1))*pow4(mmgl) + mmst2*pow2(mmgl)*(mmst1*pow2 - (mmst2)*(-150*mmsusy + mmst2*(623 - 305*pow2(s2t))) + 3*mmst2*pow2(mmst1) - *(10*mmsusy + mmst2*(51 - 115*pow2(s2t))) + (90*mmsusy + mmst2*(-141 + 35 - *pow2(s2t)))*pow3(mmst1) + (30*mmsusy - mmst2*(4 + 25*pow2(s2t)))*pow3( - mmst2) + 9*pow4(mmst1)) + mmgl*pow2(mmst2)*(mmst1*pow2(mmst2)*(-60*mmsusy - + mmst2*(-85 + 76*pow2(s2t))) + mmst2*pow2(mmst1)*(120*mmsusy + mmst2*(- - 229 + 128*pow2(s2t))) + (-60*mmsusy + mmst2*(183 - 76*pow2(s2t)))*pow3( - mmst1) - 6*pow4(mmst1) + 9*pow4(mmst2)) - 2*(6*pow2(mmst1) + mmst1*mmst2* - (121 - 166*pow2(s2t)) + pow2(mmst2)*(193 - 154*pow2(s2t)))*pow5(mmgl) + 2 - *(3*mmst1 + mmst2*(61 - 64*pow2(s2t)))*pow6(mmgl)))/(18.*(mmst1 - mmst2)* - pow2(mmgl - mmst1)*pow4(mmgl - mmst2)) + (logmmglmmu*logmmst1mmu*mmgl*(-( - mmst2*(3*pow2(mmst1) + pow2(mmst2)*(23 - 21*pow2(s2t)) + mmst1*mmst2*(4 + - 21*pow2(s2t)))*pow3(mmst1)) + pow3(mmgl)*(-2*mmst2*pow2(mmst1)*(139 + 92* - pow2(s2t)) - mmst1*pow2(mmst2)*(587 + 514*pow2(s2t)) + (-35 + 122*pow2( - s2t))*pow3(mmst1) - 64*(1 + pow2(s2t))*pow3(mmst2)) + mmgl*pow2(mmst1)*( - 81*mmst1*pow2(mmst2) + 2*mmst2*pow2(mmst1)*(8 + 3*pow2(s2t)) + (-9 + 16* - pow2(s2t))*pow3(mmst1) - 2*(49 + 43*pow2(s2t))*pow3(mmst2)) + mmst1*pow2( - mmgl)*(mmst2*pow2(mmst1)*(-95 + 49*pow2(s2t)) + mmst1*pow2(mmst2)*(282 + - 163*pow2(s2t)) - 9*(-4 + 9*pow2(s2t))*pow3(mmst1) + (197 + 189*pow2(s2t)) - *pow3(mmst2)) + (pow2(mmst1)*(142 - 53*pow2(s2t)) + 192*pow2(mmst2)*(1 + - pow2(s2t)) + 3*mmst1*mmst2*(196 + 167*pow2(s2t)))*pow4(mmgl) - 2*(96* - mmst2*(1 + pow2(s2t)) + mmst1*(105 + 64*pow2(s2t)))*pow5(mmgl) + 64*(1 + - pow2(s2t))*pow6(mmgl)))/(9.*pow3(mmgl - mmst2)*pow4(mmgl - mmst1)) + ( - logmmglmmu*logmmst2mmu*mmgl*(mmst1*(-3*pow2(mmst2) + pow2(mmst1)*(-23 + - 21*pow2(s2t)) - mmst1*mmst2*(4 + 21*pow2(s2t)))*pow3(mmst2) - pow3(mmgl)* - (2*mmst1*pow2(mmst2)*(139 + 92*pow2(s2t)) + mmst2*pow2(mmst1)*(587 + 514* - pow2(s2t)) + 64*(1 + pow2(s2t))*pow3(mmst1) + (35 - 122*pow2(s2t))*pow3( - mmst2)) + mmst2*pow2(mmgl)*(mmst1*pow2(mmst2)*(-95 + 49*pow2(s2t)) + - mmst2*pow2(mmst1)*(282 + 163*pow2(s2t)) + (197 + 189*pow2(s2t))*pow3( - mmst1) + 9*(4 - 9*pow2(s2t))*pow3(mmst2)) + mmgl*pow2(mmst2)*(81*mmst2* - pow2(mmst1) + 2*mmst1*pow2(mmst2)*(8 + 3*pow2(s2t)) - 2*(49 + 43*pow2(s2t - ))*pow3(mmst1) + (-9 + 16*pow2(s2t))*pow3(mmst2)) + (pow2(mmst2)*(142 - - 53*pow2(s2t)) + 192*pow2(mmst1)*(1 + pow2(s2t)) + 3*mmst1*mmst2*(196 + - 167*pow2(s2t)))*pow4(mmgl) - 2*(96*mmst1*(1 + pow2(s2t)) + mmst2*(105 + - 64*pow2(s2t)))*pow5(mmgl) + 64*(1 + pow2(s2t))*pow6(mmgl)))/(9.*pow3(mmgl - - mmst1)*pow4(mmgl - mmst2)) - (2*logmmglmmu*(3*mmgl*mmst1*mmst2*((123* - mmst2 + 10*mmsusy)*pow2(mmst1) + 123*mmst1*pow2(mmst2) + (mmst2 + 10* - mmsusy)*pow2(mmst2) + pow3(mmst1)) + pow3(mmgl)*(pow2(mmst1)*(-270*mmsusy - + mmst2*(3236 - 505*pow2(s2t))) + mmst1*mmst2*(180*mmsusy + mmst2*(3236 - - 505*pow2(s2t))) + pow2(mmst2)*(-270*mmsusy + mmst2*(172 + 121*pow2(s2t) - )) + (172 + 121*pow2(s2t))*pow3(mmst1)) - 78*pow3(mmst1)*pow3(mmst2) + ( - 240*mmst1*mmsusy + 240*mmst2*mmsusy + pow2(mmst1)*(-999 + 85*pow2(s2t)) + - pow2(mmst2)*(-999 + 85*pow2(s2t)) + mmst1*mmst2*(-4944 + 982*pow2(s2t)))* - pow4(mmgl) - pow2(mmgl)*(2*mmst2*pow2(mmst1)*(45*mmsusy + mmst2*(904 - - 207*pow2(s2t))) + mmst1*pow2(mmst2)*(90*mmsusy + mmst2*(753 + 103*pow2( - s2t))) + (-90*mmsusy + mmst2*(753 + 103*pow2(s2t)))*pow3(mmst1) + (-90* - mmsusy + mmst2*(-9 + 8*pow2(s2t)))*pow3(mmst2) + (-9 + 8*pow2(s2t))*pow4( - mmst1)) - 4*(45*mmsusy + mmst1*(-421 + 96*pow2(s2t)) + mmst2*(-421 + 96* - pow2(s2t)))*pow5(mmgl) + 12*(-51 + 16*pow2(s2t))*pow6(mmgl)))/(9.*pow3( - mmgl - mmst1)*pow3(mmgl - mmst2)) + (pow2(logmmglmmu)*(3*mmgl*pow2(mmst1) - *pow2(mmst2)*((-87*mmst2 + 10*mmsusy)*pow2(mmst1) - 87*mmst1*pow2(mmst2) - + (mmst2 + 10*mmsusy)*pow2(mmst2) + pow3(mmst1)) + mmst1*mmst2*pow2(mmgl) - *(-(mmst1*pow2(mmst2)*(220*mmst2 + 120*mmsusy + 159*mmst2*pow2(s2t))) + 2 - *mmst2*pow2(mmst1)*(288*mmst2 - 60*mmsusy + 223*mmst2*pow2(s2t)) + (-220* - mmst2 + 60*mmsusy - 159*mmst2*pow2(s2t))*pow3(mmst1) + 6*(mmst2 + 10* - mmsusy)*pow3(mmst2) + 6*pow4(mmst1)) - pow4(mmgl)*(2*mmst1*pow2(mmst2)*(- - 120*mmsusy + 7*mmst2*(218 + 9*pow2(s2t))) - 2*mmst2*pow2(mmst1)*(120* - mmsusy + mmst2*(-4172 + 1249*pow2(s2t))) + 2*(-180*mmsusy + 7*mmst2*(218 - + 9*pow2(s2t)))*pow3(mmst1) + (-360*mmsusy + mmst2*(30 + 163*pow2(s2t)))* - pow3(mmst2) + (30 + 163*pow2(s2t))*pow4(mmst1)) + 72*pow4(mmst1)*pow4( - mmst2) + (pow2(mmst1)*(8613*mmst2 - 510*mmsusy - 1486*mmst2*pow2(s2t)) + - mmst1*mmst2*(8613*mmst2 - 480*mmsusy - 1486*mmst2*pow2(s2t)) + pow2(mmst2 - )*(597*mmst2 - 510*mmsusy + 206*mmst2*pow2(s2t)) + (597 + 206*pow2(s2t))* - pow3(mmst1))*pow5(mmgl) + pow3(mmgl)*(2*pow2(mmst1)*pow2(mmst2)*(1046* - mmst2 + 180*mmsusy - 383*mmst2*pow2(s2t)) - 2*mmst2*(-1046*mmst2 + 120* - mmsusy + 383*mmst2*pow2(s2t))*pow3(mmst1) + mmst1*(451*mmst2 - 240*mmsusy - + 382*mmst2*pow2(s2t))*pow3(mmst2) + (451*mmst2 - 90*mmsusy + 382*mmst2* - pow2(s2t))*pow4(mmst1) - 9*(mmst2 + 10*mmsusy)*pow4(mmst2) - 9*pow5(mmst1 - )) + (7*pow2(mmst1)*(-296 + 39*pow2(s2t)) + 7*mmst2*(-296*mmst2 + 60* - mmsusy + 39*mmst2*pow2(s2t)) + 6*mmst1*(-1358*mmst2 + 70*mmsusy + 229* - mmst2*pow2(s2t)))*pow6(mmgl) - 6*(-347*mmst2 + 30*mmsusy + 64*mmst2*pow2( - s2t) + mmst1*(-347 + 64*pow2(s2t)))*pow7(mmgl) + 4*(-139 + 32*pow2(s2t))* - pow8(mmgl)))/(18.*pow4(mmgl - mmst1)*pow4(mmgl - mmst2)); + -10.055555555555555 + 82*logmmtmmu - (20*logmmsusymmu*logmmtmmu)/3. - (56* + mmst1)/(-mmgl + mmst1) - (896*mmst1)/(9.*(mmst1 - mmst2)) + (6*mmst2)/(- + mmgl + mmst1) + (896*mmst2)/(9.*(mmst1 - mmst2)) - (2*mmst1)/(3.*(-mmgl + + mmst2)) - (188*mmst2)/(3.*(-mmgl + mmst2)) + logmmtmmu*(-74 - (8*mmst1)/( + 3.*(-mmgl + mmst1)) - (8*mmst2)/(3.*(-mmgl + mmst2))) + (60*mmsusy)/(- + mmgl + mmst1) + (60*mmsusy)/(-mmgl + mmst2) + (16*logmmst1mmu*logmmtmmu* + mgl*mmst1*s2t)/(3.*(-mmgl + mmst1)*mt) - (16*logmmst2mmu*logmmtmmu*mgl* + mmst2*s2t)/(3.*(-mmgl + mmst2)*mt) + (logmmglmmu*logmmtmmu*((-16*mgl* + mmst1*s2t)/(3.*(-mmgl + mmst1)) + (16*mgl*mmst2*s2t)/(3.*(-mmgl + mmst2)) + ))/mt + (logmmsusymmu*((160*mgl*mmsusy*s2t)/(3.*(-mmgl + mmst1)) - (160* + mgl*mmsusy*s2t)/(3.*(-mmgl + mmst2))))/mt + (8*zt2)/9. - (91*mmst1*zt2)/( + 9.*(-mmgl + mmst1)) - (128*mmst1*zt2)/(9.*(mmst1 - mmst2)) + (mmst2*zt2)/ + (-mmgl + mmst1) + (128*mmst2*zt2)/(9.*(mmst1 - mmst2)) + (mmst1*zt2)/(9.* + (-mmgl + mmst2)) - (11*mmst2*zt2)/(-mmgl + mmst2) + (10*mmsusy*zt2)/(- + mmgl + mmst1) + (10*mmsusy*zt2)/(-mmgl + mmst2) + (((-20*mgl*mmsusy*s2t)/ + (3.*(-mmgl + mmst1)) + (20*mgl*mmsusy*s2t)/(3.*(-mmgl + mmst2)))*pow2( + logmmsusymmu))/mt + (896*pow2(mmst1))/(9.*(-mmgl + mmst1)*(mmst1 - mmst2) + ) + (20*pow2(mmst1))/(3.*(-mmgl + mmst1)*(-mmgl + mmst2)) + (128*zt2*pow2 + (mmst1))/(9.*(-mmgl + mmst1)*(mmst1 - mmst2)) + (8*zt2*pow2(mmst1))/(9.*( + -mmgl + mmst1)*(-mmgl + mmst2)) + (fin(mmst2,mmgl,mmu)*((-16*mgl*s2t)/(9. + *(-mmgl + mmst1)) + (88*mgl*s2t)/(9.*(-mmgl + mmst2)) - (4*mgl*mmst1*s2t) + /(3.*pow2(-mmgl + mmst1)) + (4*mgl*mmst2*s2t)/(3.*pow2(-mmgl + mmst1))))/ + mt + (fin(mmst1,mmsusy,mmu)*((40*mgl*mmst1*s2t)/(3.*pow2(-mmgl + mmst1)) + - (40*mgl*mmsusy*s2t)/(3.*pow2(-mmgl + mmst1))))/mt + logmmst1mmu* + logmmtmmu*(-0.6666666666666666 - (16*mmst1)/(3.*(-mmgl + mmst1)) + (8* + pow2(mmst1))/(3.*pow2(-mmgl + mmst1))) - (2825*mmst1*mmst2)/(324.*pow2(- + mmgl + mmst1)) - (27275*mmst1*mmsusy)/(324.*pow2(-mmgl + mmst1)) - (40* + logmmst1mmu*logmmsusymmu*mgl*mmst1*mmsusy*s2t)/(3.*mt*pow2(-mmgl + mmst1) + ) - (4*mmst1*mmst2*zt2)/(3.*pow2(-mmgl + mmst1)) - (130*mmst1*mmsusy*zt2) + /(9.*pow2(-mmgl + mmst1)) + (886*pow2(mmst1))/(9.*pow2(-mmgl + mmst1)) + + (233*mmst2*pow2(mmst1))/(324.*(mmst1 - mmst2)*pow2(-mmgl + mmst1)) + ( + 1355*mmsusy*pow2(mmst1))/(324.*(mmst1 - mmsusy)*pow2(-mmgl + mmst1)) + ( + 44*zt2*pow2(mmst1))/(3.*pow2(-mmgl + mmst1)) + (10*mmsusy*zt2*pow2(mmst1) + )/(9.*(mmst1 - mmsusy)*pow2(-mmgl + mmst1)) - (896*pow2(mmst2))/(9.*( + mmst1 - mmst2)*(-mmgl + mmst2)) - (128*zt2*pow2(mmst2))/(9.*(mmst1 - + mmst2)*(-mmgl + mmst2)) - (233*mmst1*pow2(mmst2))/(216.*(mmst1 - mmst2)* + pow2(-mmgl + mmst1)) + (233*pow2(mmst1)*pow2(mmst2))/(648.*pow2(-mmgl + + mmst1)*pow2(mmst1 - mmst2)) + (fin(mmst1,mmst2,mmu)*((4*mgl*s2t)/(9.*(- + mmgl + mmst1)) - (4*mgl*s2t)/(9.*(-mmgl + mmst2)) + (4*mgl*mmst1*s2t)/(3. + *pow2(-mmgl + mmst1)) - (4*mgl*mmst2*s2t)/(3.*pow2(-mmgl + mmst1)) + (4* + mgl*mmst1*s2t)/(3.*pow2(-mmgl + mmst2)) - (4*mgl*mmst2*s2t)/(3.*pow2(- + mmgl + mmst2))))/mt + (fin(mmst1,mmgl,mmu)*((-88*mgl*s2t)/(9.*(-mmgl + + mmst1)) + (16*mgl*s2t)/(9.*(-mmgl + mmst2)) - (4*mgl*mmst1*s2t)/(3.*pow2( + -mmgl + mmst2)) + (4*mgl*mmst2*s2t)/(3.*pow2(-mmgl + mmst2))))/mt + (fin( + mmgl,mmsusy,mmu)*((-40*mgl*s2t)/(3.*(-mmgl + mmst1)) + (40*mgl*s2t)/(3.*( + -mmgl + mmst2)) - (40*mgl*mmst1*s2t)/(3.*pow2(-mmgl + mmst1)) + (40*mgl* + mmsusy*s2t)/(3.*pow2(-mmgl + mmst1)) + (40*mgl*mmst2*s2t)/(3.*pow2(-mmgl + + mmst2)) - (40*mgl*mmsusy*s2t)/(3.*pow2(-mmgl + mmst2))))/mt + (fin( + mmst2,mmsusy,mmu)*((-40*mgl*mmst2*s2t)/(3.*pow2(-mmgl + mmst2)) + (40*mgl + *mmsusy*s2t)/(3.*pow2(-mmgl + mmst2))))/mt + (logmmglmmu*logmmsusymmu*((- + 40*mgl*mmsusy*s2t)/(3.*(-mmgl + mmst1)) + (40*mgl*mmsusy*s2t)/(3.*(-mmgl + + mmst2)) + (40*mgl*mmst1*mmsusy*s2t)/(3.*pow2(-mmgl + mmst1)) - (40*mgl* + mmst2*mmsusy*s2t)/(3.*pow2(-mmgl + mmst2))))/mt + logmmglmmu*logmmtmmu*(- + 13.333333333333334 + (16*mmst1)/(3.*(-mmgl + mmst1)) + (16*mmst2)/(3.*(- + mmgl + mmst2)) - (8*pow2(mmst1))/(3.*pow2(-mmgl + mmst1)) - (8*pow2(mmst2 + ))/(3.*pow2(-mmgl + mmst2))) + logmmst2mmu*logmmtmmu*(-0.6666666666666666 + - (16*mmst2)/(3.*(-mmgl + mmst2)) + (8*pow2(mmst2))/(3.*pow2(-mmgl + + mmst2))) - (8*mmst1*mmst2)/pow2(-mmgl + mmst2) - (27275*mmst2*mmsusy)/( + 324.*pow2(-mmgl + mmst2)) + (40*logmmst2mmu*logmmsusymmu*mgl*mmst2*mmsusy + *s2t)/(3.*mt*pow2(-mmgl + mmst2)) - (4*mmst1*mmst2*zt2)/(3.*pow2(-mmgl + + mmst2)) - (130*mmst2*mmsusy*zt2)/(9.*pow2(-mmgl + mmst2)) + (886*pow2( + mmst2))/(9.*pow2(-mmgl + mmst2)) + (1355*mmsusy*pow2(mmst2))/(324.*(mmst2 + - mmsusy)*pow2(-mmgl + mmst2)) + (44*zt2*pow2(mmst2))/(3.*pow2(-mmgl + + mmst2)) + (10*mmsusy*zt2*pow2(mmst2))/(9.*(mmst2 - mmsusy)*pow2(-mmgl + + mmst2)) - (515*mmst1*pow2(mmsusy))/(108.*(mmst1 - mmsusy)*pow2(-mmgl + + mmst1)) - (20*mmst1*zt2*pow2(mmsusy))/(9.*(mmst1 - mmsusy)*pow2(-mmgl + + mmst1)) - (515*mmst2*pow2(mmsusy))/(108.*(mmst2 - mmsusy)*pow2(-mmgl + + mmst2)) - (20*mmst2*zt2*pow2(mmsusy))/(9.*(mmst2 - mmsusy)*pow2(-mmgl + + mmst2)) + (95*pow2(mmst1)*pow2(mmsusy))/(162.*pow2(-mmgl + mmst1)*pow2( + mmst1 - mmsusy)) + (10*zt2*pow2(mmst1)*pow2(mmsusy))/(9.*pow2(-mmgl + + mmst1)*pow2(mmst1 - mmsusy)) + (95*pow2(mmst2)*pow2(mmsusy))/(162.*pow2(- + mmgl + mmst2)*pow2(mmst2 - mmsusy)) + (10*zt2*pow2(mmst2)*pow2(mmsusy))/( + 9.*pow2(-mmgl + mmst2)*pow2(mmst2 - mmsusy)) - (256*pow2(s2t))/9. + ( + 63625*mmst1*pow2(s2t))/(1296.*(-mmgl + mmst1)) + (896*mmst1*pow2(s2t))/( + 9.*(mmst1 - mmst2)) - (10535*mmst2*pow2(s2t))/(3888.*(-mmgl + mmst1)) - ( + 896*mmst2*pow2(s2t))/(9.*(mmst1 - mmst2)) + (mmst1*mmst2*pow2(s2t))/(648. + *(-mmgl + mmst1)*(mmst1 - mmst2)) - (56281*mmst1*pow2(s2t))/(1296.*(-mmgl + + mmst2)) + (10967*mmst2*pow2(s2t))/(1296.*(-mmgl + mmst2)) - (85*mmst1* + mmst2*pow2(s2t))/(972.*(mmst1 - mmst2)*(-mmgl + mmst2)) + (41*mmst1*zt2* + pow2(s2t))/(9.*(-mmgl + mmst1)) + (128*mmst1*zt2*pow2(s2t))/(9.*(mmst1 - + mmst2)) - (128*mmst2*zt2*pow2(s2t))/(9.*(mmst1 - mmst2)) + (mmst1*mmst2* + zt2*pow2(s2t))/(27.*(-mmgl + mmst1)*(mmst1 - mmst2)) - (52*mmst1*zt2*pow2 + (s2t))/(9.*(-mmgl + mmst2)) - (11*mmst2*zt2*pow2(s2t))/(9.*(-mmgl + mmst2 + )) - (mmst1*mmst2*zt2*pow2(s2t))/(27.*(mmst1 - mmst2)*(-mmgl + mmst2)) - + (96683*pow2(mmst1)*pow2(s2t))/(972.*(-mmgl + mmst1)*(mmst1 - mmst2)) + ( + 52825*pow2(mmst1)*pow2(s2t))/(1296.*(-mmgl + mmst1)*(-mmgl + mmst2)) - ( + 85*pow2(mmst1)*pow2(s2t))/(972.*(mmst1 - mmst2)*(-mmgl + mmst2)) - (383* + zt2*pow2(mmst1)*pow2(s2t))/(27.*(-mmgl + mmst1)*(mmst1 - mmst2)) + (52* + zt2*pow2(mmst1)*pow2(s2t))/(9.*(-mmgl + mmst1)*(-mmgl + mmst2)) - (zt2* + pow2(mmst1)*pow2(s2t))/(27.*(mmst1 - mmst2)*(-mmgl + mmst2)) + (16*mmst1* + mmst2*pow2(s2t))/(9.*pow2(-mmgl + mmst1)) - (2*pow2(mmst1)*pow2(s2t))/ + pow2(-mmgl + mmst1) + (85*pow2(mmst2)*pow2(s2t))/(972.*(-mmgl + mmst1)*( + mmst1 - mmst2)) + (387233*pow2(mmst2)*pow2(s2t))/(3888.*(mmst1 - mmst2)*( + -mmgl + mmst2)) + (zt2*pow2(mmst2)*pow2(s2t))/(27.*(-mmgl + mmst1)*(mmst1 + - mmst2)) + (383*zt2*pow2(mmst2)*pow2(s2t))/(27.*(mmst1 - mmst2)*(-mmgl + + mmst2)) - (167*mmst1*pow2(mmst2)*pow2(s2t))/(3888.*(-mmgl + mmst1)*pow2 + (mmst1 - mmst2)) + (16*mmst1*mmst2*pow2(s2t))/(9.*pow2(-mmgl + mmst2)) - + (2*pow2(mmst2)*pow2(s2t))/pow2(-mmgl + mmst2) + (85*pow2(s2t)*pow3(mmst1) + )/(972.*(-mmgl + mmst1)*(mmst1 - mmst2)*(-mmgl + mmst2)) + (zt2*pow2(s2t) + *pow3(mmst1))/(27.*(-mmgl + mmst1)*(mmst1 - mmst2)*(-mmgl + mmst2)) + fin + (mmst1,mmsusy,mmu)*(20/(3.*(-mmgl + mmst1)) - (220*mmst1)/(9.*pow2(-mmgl + + mmst1)) + (10*mmsusy)/pow2(-mmgl + mmst1) - (20*mmst1*mmsusy)/(9.*( + mmst1 - mmsusy)*pow2(-mmgl + mmst1)) + (10*pow2(mmst1))/(9.*(mmst1 - + mmsusy)*pow2(-mmgl + mmst1)) + (10*mmsusy*pow2(mmst1))/(9.*pow2(-mmgl + + mmst1)*pow2(mmst1 - mmsusy)) - (10*mmst1*pow2(mmsusy))/(9.*pow2(-mmgl + + mmst1)*pow2(mmst1 - mmsusy)) - (40*mmst1*mmsusy)/(3.*pow3(-mmgl + mmst1)) + + (40*pow2(mmst1))/(3.*pow3(-mmgl + mmst1))) - (112*pow3(mmst1))/(3.*pow3 + (-mmgl + mmst1)) - (16*zt2*pow3(mmst1))/(3.*pow3(-mmgl + mmst1)) + (271* + pow3(mmst2))/(648.*(mmst1 - mmst2)*pow2(-mmgl + mmst1)) + (zt2*pow3(mmst2 + ))/(9.*(mmst1 - mmst2)*pow2(-mmgl + mmst1)) - (7*mmst1*pow3(mmst2))/(9.* + pow2(-mmgl + mmst1)*pow2(mmst1 - mmst2)) - (mmst1*zt2*pow3(mmst2))/(9.* + pow2(-mmgl + mmst1)*pow2(mmst1 - mmst2)) + (169*pow2(s2t)*pow3(mmst2))/( + 1296.*(-mmgl + mmst1)*pow2(mmst1 - mmst2)) - (85*pow2(s2t)*pow3(mmst2))/( + 972.*(-mmgl + mmst2)*pow2(mmst1 - mmst2)) + (zt2*pow2(s2t)*pow3(mmst2))/( + 27.*(-mmgl + mmst1)*pow2(mmst1 - mmst2)) - (zt2*pow2(s2t)*pow3(mmst2))/( + 27.*(-mmgl + mmst2)*pow2(mmst1 - mmst2)) + fin(mmgl,mmsusy,mmu)*(10/(3.*( + -mmgl + mmst1)) + 10/(3.*(-mmgl + mmst2)) + (10*mmst1)/pow2(-mmgl + mmst1 + ) - (10*mmsusy)/pow2(-mmgl + mmst1) + (10*mmst2)/pow2(-mmgl + mmst2) - ( + 10*mmsusy)/pow2(-mmgl + mmst2) + (40*mmst1*mmsusy)/(3.*pow3(-mmgl + mmst1 + )) - (40*pow2(mmst1))/(3.*pow3(-mmgl + mmst1)) + (40*mmst2*mmsusy)/(3.* + pow3(-mmgl + mmst2)) - (40*pow2(mmst2))/(3.*pow3(-mmgl + mmst2))) + fin( + mmst2,mmgl,mmu)*(7/(9.*(-mmgl + mmst1)) + 128/(9.*(mmst1 - mmst2)) - 5/(- + mmgl + mmst2) + (8*mmst1)/(9.*(-mmgl + mmst1)*(-mmgl + mmst2)) - (128* + mmst2)/(9.*(mmst1 - mmst2)*(-mmgl + mmst2)) + mmst1/pow2(-mmgl + mmst1) - + mmst2/pow2(-mmgl + mmst1) + (12*mmst2)/pow2(-mmgl + mmst2) + (11*pow2(s2t + ))/(9.*(-mmgl + mmst1)) - (128*pow2(s2t))/(9.*(mmst1 - mmst2)) - (11*pow2 + (s2t))/(9.*(-mmgl + mmst2)) + (26*mmst1*pow2(s2t))/(9.*(-mmgl + mmst1)*(- + mmgl + mmst2)) + (128*mmst2*pow2(s2t))/(9.*(mmst1 - mmst2)*(-mmgl + mmst2 + )) - (26*mmst1*pow2(s2t))/(9.*pow2(-mmgl + mmst1)) + (4*mmst1*mmst2)/(3.* + pow3(-mmgl + mmst1)) - (4*pow2(mmst1))/(3.*pow3(-mmgl + mmst1)) - (16* + pow2(mmst2))/(3.*pow3(-mmgl + mmst2))) + fin(mmst1,mmgl,mmu)*(-37/(9.*(- + mmgl + mmst1)) - 128/(9.*(mmst1 - mmst2)) + (128*mmst1)/(9.*(-mmgl + + mmst1)*(mmst1 - mmst2)) - 1/(9.*(-mmgl + mmst2)) + (8*mmst1)/(9.*(-mmgl + + mmst1)*(-mmgl + mmst2)) + (12*mmst1)/pow2(-mmgl + mmst1) - mmst1/pow2(- + mmgl + mmst2) + mmst2/pow2(-mmgl + mmst2) + (5*pow2(s2t))/(3.*(-mmgl + + mmst1)) + (128*pow2(s2t))/(9.*(mmst1 - mmst2)) - (128*mmst1*pow2(s2t))/( + 9.*(-mmgl + mmst1)*(mmst1 - mmst2)) - (5*pow2(s2t))/(3.*(-mmgl + mmst2)) + + (26*mmst1*pow2(s2t))/(9.*(-mmgl + mmst1)*(-mmgl + mmst2)) - (26*mmst2* + pow2(s2t))/(9.*pow2(-mmgl + mmst2)) - (16*pow2(mmst1))/(3.*pow3(-mmgl + + mmst1)) + (4*mmst1*mmst2)/(3.*pow3(-mmgl + mmst2)) - (4*pow2(mmst2))/(3.* + pow3(-mmgl + mmst2))) + fin(mmst1,mmst2,mmu)*(2/(9.*(-mmgl + mmst1)) + 10 + /(9.*(-mmgl + mmst2)) - (8*mmst1)/(9.*(-mmgl + mmst1)*(-mmgl + mmst2)) - + (7*mmst1)/(3.*pow2(-mmgl + mmst1)) + mmst2/pow2(-mmgl + mmst1) + pow2( + mmst2)/(9.*(mmst1 - mmst2)*pow2(-mmgl + mmst1)) - (mmst1*pow2(mmst2))/(9. + *pow2(-mmgl + mmst1)*pow2(mmst1 - mmst2)) + mmst1/pow2(-mmgl + mmst2) - ( + 7*mmst2)/(3.*pow2(-mmgl + mmst2)) - (67*pow2(s2t))/(54.*(-mmgl + mmst1)) + - (mmst2*pow2(s2t))/(54.*(-mmgl + mmst1)*(mmst1 - mmst2)) - (65*pow2(s2t) + )/(54.*(-mmgl + mmst2)) - (mmst1*pow2(s2t))/(54.*(-mmgl + mmst1)*(-mmgl + + mmst2)) + (mmst2*pow2(s2t))/(54.*(mmst1 - mmst2)*(-mmgl + mmst2)) + (26* + mmst1*pow2(s2t))/(9.*pow2(-mmgl + mmst1)) + (26*mmst2*pow2(s2t))/(9.*pow2 + (-mmgl + mmst2)) - (4*mmst1*mmst2)/(3.*pow3(-mmgl + mmst1)) + (4*pow2( + mmst1))/(3.*pow3(-mmgl + mmst1)) + pow3(mmst2)/(9.*pow2(-mmgl + mmst1)* + pow2(mmst1 - mmst2)) - (4*mmst1*mmst2)/(3.*pow3(-mmgl + mmst2)) + (4*pow2 + (mmst2))/(3.*pow3(-mmgl + mmst2))) + fin(mmst2,mmsusy,mmu)*(20/(3.*(-mmgl + + mmst2)) - (220*mmst2)/(9.*pow2(-mmgl + mmst2)) + (10*mmsusy)/pow2(- + mmgl + mmst2) - (20*mmst2*mmsusy)/(9.*(mmst2 - mmsusy)*pow2(-mmgl + mmst2 + )) + (10*pow2(mmst2))/(9.*(mmst2 - mmsusy)*pow2(-mmgl + mmst2)) + (10* + mmsusy*pow2(mmst2))/(9.*pow2(-mmgl + mmst2)*pow2(mmst2 - mmsusy)) - (10* + mmst2*pow2(mmsusy))/(9.*pow2(-mmgl + mmst2)*pow2(mmst2 - mmsusy)) - (40* + mmst2*mmsusy)/(3.*pow3(-mmgl + mmst2)) + (40*pow2(mmst2))/(3.*pow3(-mmgl + + mmst2))) + logmmglmmu*logmmsusymmu*((10*mmsusy)/(-mmgl + mmst1) + (10* + mmsusy)/(-mmgl + mmst2) - (70*mmst1*mmsusy)/(3.*pow2(-mmgl + mmst1)) - ( + 70*mmst2*mmsusy)/(3.*pow2(-mmgl + mmst2)) + (40*mmsusy*pow2(mmst1))/(3.* + pow3(-mmgl + mmst1)) + (40*mmsusy*pow2(mmst2))/(3.*pow3(-mmgl + mmst2))) + + (pow2(logmmglmmu)*((-10*mgl*mmst1*s2t)/(-mmgl + mmst1) - (2*mgl*mmst2* + s2t)/(3.*(-mmgl + mmst1)) - (2*mgl*mmst1*s2t)/(9.*(-mmgl + mmst2)) + (98* + mgl*mmst2*s2t)/(9.*(-mmgl + mmst2)) - (20*mgl*mmsusy*s2t)/(3.*(-mmgl + + mmst1)) + (20*mgl*mmsusy*s2t)/(3.*(-mmgl + mmst2)) + (8*mgl*s2t*pow2( + mmst1))/(3.*(-mmgl + mmst1)*(-mmgl + mmst2)) + (2*mgl*mmst1*mmst2*s2t)/( + 3.*pow2(-mmgl + mmst1)) + (20*mgl*mmst1*mmsusy*s2t)/(3.*pow2(-mmgl + + mmst1)) - (218*mgl*s2t*pow2(mmst1))/(9.*pow2(-mmgl + mmst1)) - (14*mgl* + mmst1*mmst2*s2t)/(9.*pow2(-mmgl + mmst2)) - (20*mgl*mmst2*mmsusy*s2t)/(3. + *pow2(-mmgl + mmst2)) - (8*mgl*s2t*pow2(mmst1))/(9.*pow2(-mmgl + mmst2)) + + (70*mgl*s2t*pow2(mmst2))/(3.*pow2(-mmgl + mmst2)) - (8*mgl*s2t*pow3( + mmst1))/(9.*(-mmgl + mmst2)*pow2(-mmgl + mmst1)) + (8*mgl*s2t*pow3(mmst1) + )/(9.*(-mmgl + mmst1)*pow2(-mmgl + mmst2)) + (8*mgl*s2t*pow3(mmst1))/(9.* + pow3(-mmgl + mmst1)) - (8*mgl*s2t*pow3(mmst2))/(9.*pow3(-mmgl + mmst2)))) + /mt + logmmglmmu*(64.88888888888889 + (98*mmst1)/(3.*(-mmgl + mmst1)) + ( + 640*mmst1)/(9.*(mmst1 - mmst2)) - (2*mmst2)/(-mmgl + mmst1) - (640*mmst2) + /(9.*(mmst1 - mmst2)) + (14*mmst1)/(3.*(-mmgl + mmst2)) + (118*mmst2)/(3. + *(-mmgl + mmst2)) - (20*mmsusy)/(-mmgl + mmst1) - (20*mmsusy)/(-mmgl + + mmst2) - (640*pow2(mmst1))/(9.*(-mmgl + mmst1)*(mmst1 - mmst2)) - (20* + pow2(mmst1))/(3.*(-mmgl + mmst1)*(-mmgl + mmst2)) + (14*mmst1*mmst2)/(3.* + pow2(-mmgl + mmst1)) + (140*mmst1*mmsusy)/(3.*pow2(-mmgl + mmst1)) - (116 + *pow2(mmst1))/pow2(-mmgl + mmst1) + (640*pow2(mmst2))/(9.*(mmst1 - mmst2) + *(-mmgl + mmst2)) + (38*mmst1*mmst2)/(9.*pow2(-mmgl + mmst2)) + (140* + mmst2*mmsusy)/(3.*pow2(-mmgl + mmst2)) - (4*pow2(mmst1))/(9.*pow2(-mmgl + + mmst2)) - (1048*pow2(mmst2))/(9.*pow2(-mmgl + mmst2)) + (256*pow2(s2t))/ + 9. - (376*mmst1*pow2(s2t))/(9.*(-mmgl + mmst1)) - (640*mmst1*pow2(s2t))/( + 9.*(mmst1 - mmst2)) + (16*mmst2*pow2(s2t))/(9.*(-mmgl + mmst1)) + (640* + mmst2*pow2(s2t))/(9.*(mmst1 - mmst2)) + (40*mmst1*pow2(s2t))/(3.*(-mmgl + + mmst2)) - (272*mmst2*pow2(s2t))/(9.*(-mmgl + mmst2)) + (640*pow2(mmst1)* + pow2(s2t))/(9.*(-mmgl + mmst1)*(mmst1 - mmst2)) - (104*pow2(mmst1)*pow2( + s2t))/(9.*(-mmgl + mmst1)*(-mmgl + mmst2)) - (32*mmst1*mmst2*pow2(s2t))/( + 9.*pow2(-mmgl + mmst1)) + (170*pow2(mmst1)*pow2(s2t))/(9.*pow2(-mmgl + + mmst1)) - (640*pow2(mmst2)*pow2(s2t))/(9.*(mmst1 - mmst2)*(-mmgl + mmst2) + ) - (4*mmst1*mmst2*pow2(s2t))/(9.*pow2(-mmgl + mmst2)) + (28*pow2(mmst1)* + pow2(s2t))/(9.*pow2(-mmgl + mmst2)) + (22*pow2(mmst2)*pow2(s2t))/pow2(- + mmgl + mmst2) + (4*pow3(mmst1))/(9.*(-mmgl + mmst2)*pow2(-mmgl + mmst1)) + + (4*pow3(mmst1))/(9.*(-mmgl + mmst1)*pow2(-mmgl + mmst2)) - (28*pow2(s2t + )*pow3(mmst1))/(9.*(-mmgl + mmst2)*pow2(-mmgl + mmst1)) - (28*pow2(s2t)* + pow3(mmst1))/(9.*(-mmgl + mmst1)*pow2(-mmgl + mmst2)) - (8*mmst2*pow2( + mmst1))/(3.*pow3(-mmgl + mmst1)) - (80*mmsusy*pow2(mmst1))/(3.*pow3(-mmgl + + mmst1)) + (16*mmst2*pow2(mmst1)*pow2(s2t))/(9.*pow3(-mmgl + mmst1)) + + (508*pow3(mmst1))/(9.*pow3(-mmgl + mmst1)) + (4*pow2(s2t)*pow3(mmst1))/( + 3.*pow3(-mmgl + mmst1)) - (8*mmst1*pow2(mmst2))/(3.*pow3(-mmgl + mmst2)) + - (80*mmsusy*pow2(mmst2))/(3.*pow3(-mmgl + mmst2)) + (16*mmst1*pow2(mmst2 + )*pow2(s2t))/(9.*pow3(-mmgl + mmst2)) + (508*pow3(mmst2))/(9.*pow3(-mmgl + + mmst2)) + (4*pow2(s2t)*pow3(mmst2))/(3.*pow3(-mmgl + mmst2))) - (112* + pow3(mmst2))/(3.*pow3(-mmgl + mmst2)) - (16*zt2*pow3(mmst2))/(3.*pow3(- + mmgl + mmst2)) - (95*mmst1*pow3(mmsusy))/(162.*pow2(-mmgl + mmst1)*pow2( + mmst1 - mmsusy)) - (10*mmst1*zt2*pow3(mmsusy))/(9.*pow2(-mmgl + mmst1)* + pow2(mmst1 - mmsusy)) - (95*mmst2*pow3(mmsusy))/(162.*pow2(-mmgl + mmst2) + *pow2(mmst2 - mmsusy)) - (10*mmst2*zt2*pow3(mmsusy))/(9.*pow2(-mmgl + + mmst2)*pow2(mmst2 - mmsusy)) + logmmst1mmu*logmmsusymmu*((80*mmst1*mmsusy + )/(9.*pow2(-mmgl + mmst1)) + (10*mmsusy*pow2(mmst1))/(9.*(mmst1 - mmsusy) + *pow2(-mmgl + mmst1)) - (20*mmst1*pow2(mmsusy))/(9.*(mmst1 - mmsusy)*pow2 + (-mmgl + mmst1)) + (10*pow2(mmst1)*pow2(mmsusy))/(9.*pow2(-mmgl + mmst1)* + pow2(mmst1 - mmsusy)) - (40*mmsusy*pow2(mmst1))/(3.*pow3(-mmgl + mmst1)) + - (10*mmst1*pow3(mmsusy))/(9.*pow2(-mmgl + mmst1)*pow2(mmst1 - mmsusy))) + + logmmst2mmu*logmmsusymmu*((80*mmst2*mmsusy)/(9.*pow2(-mmgl + mmst2)) + + (10*mmsusy*pow2(mmst2))/(9.*(mmst2 - mmsusy)*pow2(-mmgl + mmst2)) - (20* + mmst2*pow2(mmsusy))/(9.*(mmst2 - mmsusy)*pow2(-mmgl + mmst2)) + (10*pow2( + mmst2)*pow2(mmsusy))/(9.*pow2(-mmgl + mmst2)*pow2(mmst2 - mmsusy)) - (40* + mmsusy*pow2(mmst2))/(3.*pow3(-mmgl + mmst2)) - (10*mmst2*pow3(mmsusy))/( + 9.*pow2(-mmgl + mmst2)*pow2(mmst2 - mmsusy))) + pow2(logmmsusymmu)*( + 3.3333333333333335 + (5*mmsusy)/(-mmgl + mmst1) + (5*mmsusy)/(-mmgl + + mmst2) - (65*mmst1*mmsusy)/(9.*pow2(-mmgl + mmst1)) + (5*mmsusy*pow2( + mmst1))/(9.*(mmst1 - mmsusy)*pow2(-mmgl + mmst1)) - (65*mmst2*mmsusy)/(9. + *pow2(-mmgl + mmst2)) + (5*mmsusy*pow2(mmst2))/(9.*(mmst2 - mmsusy)*pow2( + -mmgl + mmst2)) - (10*mmst1*pow2(mmsusy))/(9.*(mmst1 - mmsusy)*pow2(-mmgl + + mmst1)) - (10*mmst2*pow2(mmsusy))/(9.*(mmst2 - mmsusy)*pow2(-mmgl + + mmst2)) + (5*pow2(mmst1)*pow2(mmsusy))/(9.*pow2(-mmgl + mmst1)*pow2(mmst1 + - mmsusy)) + (5*pow2(mmst2)*pow2(mmsusy))/(9.*pow2(-mmgl + mmst2)*pow2( + mmst2 - mmsusy)) - (5*mmst1*pow3(mmsusy))/(9.*pow2(-mmgl + mmst1)*pow2( + mmst1 - mmsusy)) - (5*mmst2*pow3(mmsusy))/(9.*pow2(-mmgl + mmst2)*pow2( + mmst2 - mmsusy))) + logmmsusymmu*(21.11111111111111 - (40*mmsusy)/(-mmgl + + mmst1) - (40*mmsusy)/(-mmgl + mmst2) + (170*mmst1*mmsusy)/(3.*pow2(- + mmgl + mmst1)) - (10*mmsusy*pow2(mmst1))/(3.*(mmst1 - mmsusy)*pow2(-mmgl + + mmst1)) + (170*mmst2*mmsusy)/(3.*pow2(-mmgl + mmst2)) - (10*mmsusy*pow2 + (mmst2))/(3.*(mmst2 - mmsusy)*pow2(-mmgl + mmst2)) + (20*mmst1*pow2( + mmsusy))/(3.*(mmst1 - mmsusy)*pow2(-mmgl + mmst1)) + (20*mmst2*pow2( + mmsusy))/(3.*(mmst2 - mmsusy)*pow2(-mmgl + mmst2)) - (10*pow2(mmst1)*pow2 + (mmsusy))/(3.*pow2(-mmgl + mmst1)*pow2(mmst1 - mmsusy)) - (10*pow2(mmst2) + *pow2(mmsusy))/(3.*pow2(-mmgl + mmst2)*pow2(mmst2 - mmsusy)) + (10*mmst1* + pow3(mmsusy))/(3.*pow2(-mmgl + mmst1)*pow2(mmst1 - mmsusy)) + (10*mmst2* + pow3(mmsusy))/(3.*pow2(-mmgl + mmst2)*pow2(mmst2 - mmsusy))) + ( + logmmst1mmu*((64*mgl*s2t)/9. - (32*mgl*mmst1*s2t)/(9.*(-mmgl + mmst1)) + + (64*mgl*mmst2*s2t)/(9.*(-mmgl + mmst1)) - (64*mgl*mmst1*mmst2*s2t)/(9.*(- + mmgl + mmst1)*(mmst1 - mmst2)) - (40*mgl*mmst1*s2t)/(9.*(-mmgl + mmst2)) + - (8*mgl*s2t*pow2(mmst1))/(9.*(-mmgl + mmst1)*(-mmgl + mmst2)) + (8*mgl* + mmst1*mmst2*s2t)/(3.*pow2(-mmgl + mmst1)) + (80*mgl*mmst1*mmsusy*s2t)/(3. + *pow2(-mmgl + mmst1)) - (40*mgl*s2t*pow2(mmst1))/pow2(-mmgl + mmst1) + ( + 64*mgl*s2t*pow2(mmst2))/(9.*(-mmgl + mmst1)*(mmst1 - mmst2)) + (32*mgl* + mmst1*pow3(s2t))/(9.*(-mmgl + mmst1)) - (16*mgl*mmst2*pow3(s2t))/(3.*(- + mmgl + mmst1)) + (64*mgl*mmst1*mmst2*pow3(s2t))/(9.*(-mmgl + mmst1)*( + mmst1 - mmst2)) + (16*mgl*mmst1*pow3(s2t))/(9.*(-mmgl + mmst2)) - (16*mgl + *mmst1*mmst2*pow3(s2t))/(9.*pow2(-mmgl + mmst1)) + (16*mgl*pow2(mmst1)* + pow3(s2t))/(9.*pow2(-mmgl + mmst1)) - (64*mgl*pow2(mmst2)*pow3(s2t))/(9.* + (-mmgl + mmst1)*(mmst1 - mmst2))))/mt + (pow2(logmmst1mmu)*((22*mgl*mmst1 + *s2t)/(9.*(-mmgl + mmst1)) - (16*mgl*mmst2*s2t)/(9.*(-mmgl + mmst1)) + ( + 16*mgl*mmst1*mmst2*s2t)/(3.*(-mmgl + mmst1)*(mmst1 - mmst2)) + (2*mgl* + mmst1*s2t)/(3.*(-mmgl + mmst2)) - (2*mgl*mmst1*mmst2*s2t)/(3.*pow2(-mmgl + + mmst1)) - (20*mgl*mmst1*mmsusy*s2t)/(3.*pow2(-mmgl + mmst1)) + (62*mgl* + s2t*pow2(mmst1))/(9.*pow2(-mmgl + mmst1)) - (16*mgl*s2t*pow2(mmst2))/(9.* + (-mmgl + mmst1)*(mmst1 - mmst2)) + (8*mgl*s2t*pow3(mmst1))/(9.*pow3(-mmgl + + mmst1)) - (16*mgl*mmst1*pow3(s2t))/(9.*(-mmgl + mmst1)) + (16*mgl* + mmst2*pow3(s2t))/(9.*(-mmgl + mmst1)) - (16*mgl*mmst1*mmst2*pow3(s2t))/( + 3.*(-mmgl + mmst1)*(mmst1 - mmst2)) - (16*mgl*pow2(mmst1)*pow3(s2t))/(9.* + pow2(-mmgl + mmst1)) + (16*mgl*pow2(mmst2)*pow3(s2t))/(9.*(-mmgl + mmst1) + *(mmst1 - mmst2))))/mt + ((-220*mgl*mmst1*s2t)/(3.*(-mmgl + mmst1)) - (56 + *mgl*mmst2*s2t)/(3.*(-mmgl + mmst1)) + (32*mgl*mmst1*mmst2*s2t)/(3.*(- + mmgl + mmst1)*(mmst1 - mmst2)) + (8*mgl*mmst1*s2t)/(-mmgl + mmst2) + (220 + *mgl*mmst2*s2t)/(3.*(-mmgl + mmst2)) - (80*mgl*mmsusy*s2t)/(-mmgl + mmst1 + ) + (80*mgl*mmsusy*s2t)/(-mmgl + mmst2) - (88*mgl*mmst1*s2t*zt2)/(9.*(- + mmgl + mmst1)) - (44*mgl*mmst2*s2t*zt2)/(9.*(-mmgl + mmst1)) + (32*mgl* + mmst1*mmst2*s2t*zt2)/(9.*(-mmgl + mmst1)*(mmst1 - mmst2)) + (4*mgl*mmst1* + s2t*zt2)/(3.*(-mmgl + mmst2)) + (88*mgl*mmst2*s2t*zt2)/(9.*(-mmgl + mmst2 + )) - (40*mgl*mmsusy*s2t*zt2)/(3.*(-mmgl + mmst1)) + (40*mgl*mmsusy*s2t* + zt2)/(3.*(-mmgl + mmst2)) - (32*mgl*s2t*pow2(mmst2))/(3.*(-mmgl + mmst1)* + (mmst1 - mmst2)) - (32*mgl*s2t*zt2*pow2(mmst2))/(9.*(-mmgl + mmst1)*( + mmst1 - mmst2)) - (16*mgl*mmst1*pow3(s2t))/(9.*(-mmgl + mmst1)) + (112* + mgl*mmst2*pow3(s2t))/(9.*(-mmgl + mmst1)) - (32*mgl*mmst1*mmst2*pow3(s2t) + )/(3.*(-mmgl + mmst1)*(mmst1 - mmst2)) - (16*mgl*mmst1*pow3(s2t))/(9.*(- + mmgl + mmst2)) + (16*mgl*mmst2*pow3(s2t))/(9.*(-mmgl + mmst2)) + (32*mgl* + mmst2*zt2*pow3(s2t))/(9.*(-mmgl + mmst1)) - (32*mgl*mmst1*mmst2*zt2*pow3( + s2t))/(9.*(-mmgl + mmst1)*(mmst1 - mmst2)) + (32*mgl*pow2(mmst2)*pow3(s2t + ))/(3.*(-mmgl + mmst1)*(mmst1 - mmst2)) + (32*mgl*zt2*pow2(mmst2)*pow3( + s2t))/(9.*(-mmgl + mmst1)*(mmst1 - mmst2)))/mt + (logmmst1mmu*logmmst2mmu + *((8*mgl*mmst1*s2t)/(9.*(-mmgl + mmst1)) - (32*mgl*mmst2*s2t)/(9.*(-mmgl + + mmst1)) - (8*mgl*mmst1*s2t)/(9.*(-mmgl + mmst2)) - (32*mgl*mmst2*s2t)/( + 9.*(-mmgl + mmst2)) + (8*mgl*s2t*pow2(mmst1))/(3.*(-mmgl + mmst1)*(-mmgl + + mmst2)) - (4*mgl*mmst1*mmst2*s2t)/(3.*pow2(-mmgl + mmst1)) - (8*mgl*s2t + *pow2(mmst1))/(9.*pow2(-mmgl + mmst1)) - (32*mgl*s2t*pow2(mmst2))/(9.*(- + mmgl + mmst1)*(mmst1 - mmst2)) - (32*mgl*s2t*pow2(mmst2))/(9.*(mmst1 - + mmst2)*(-mmgl + mmst2)) + (4*mgl*mmst1*mmst2*s2t)/(9.*pow2(-mmgl + mmst2) + ) - (8*mgl*s2t*pow2(mmst1))/(9.*pow2(-mmgl + mmst2)) - (8*mgl*s2t*pow3( + mmst1))/(9.*(-mmgl + mmst2)*pow2(-mmgl + mmst1)) + (8*mgl*s2t*pow3(mmst1) + )/(9.*(-mmgl + mmst1)*pow2(-mmgl + mmst2)) + (16*mgl*mmst2*pow3(s2t))/(9. + *(-mmgl + mmst1)) + (16*mgl*mmst1*pow3(s2t))/(9.*(-mmgl + mmst2)) + (32* + mgl*mmst2*pow3(s2t))/(9.*(-mmgl + mmst2)) + (16*mgl*mmst1*mmst2*pow3(s2t) + )/(9.*pow2(-mmgl + mmst1)) + (32*mgl*pow2(mmst2)*pow3(s2t))/(9.*(-mmgl + + mmst1)*(mmst1 - mmst2)) + (32*mgl*pow2(mmst2)*pow3(s2t))/(9.*(mmst1 - + mmst2)*(-mmgl + mmst2)) - (16*mgl*mmst1*mmst2*pow3(s2t))/(9.*pow2(-mmgl + + mmst2))))/mt + (logmmglmmu*logmmst1mmu*((-64*mgl*s2t)/9. - (12*mgl*mmst1* + s2t)/(-mmgl + mmst1) - (32*mgl*mmst1*mmst2*s2t)/(9.*(-mmgl + mmst1)*( + mmst1 - mmst2)) + (20*mgl*mmst1*s2t)/(9.*(-mmgl + mmst2)) + (32*mgl*mmst2 + *s2t)/(9.*(-mmgl + mmst2)) - (8*mgl*s2t*pow2(mmst1))/(3.*(-mmgl + mmst1)* + (-mmgl + mmst2)) + (52*mgl*s2t*pow2(mmst1))/(3.*pow2(-mmgl + mmst1)) + ( + 32*mgl*s2t*pow2(mmst2))/(9.*(mmst1 - mmst2)*(-mmgl + mmst2)) - (4*mgl* + mmst1*mmst2*s2t)/(9.*pow2(-mmgl + mmst2)) + (8*mgl*s2t*pow2(mmst1))/(9.* + pow2(-mmgl + mmst2)) + (8*mgl*s2t*pow3(mmst1))/(9.*(-mmgl + mmst2)*pow2(- + mmgl + mmst1)) - (8*mgl*s2t*pow3(mmst1))/(9.*(-mmgl + mmst1)*pow2(-mmgl + + mmst2)) - (16*mgl*s2t*pow3(mmst1))/(9.*pow3(-mmgl + mmst1)) + (16*mgl* + mmst1*pow3(s2t))/(9.*(-mmgl + mmst1)) + (32*mgl*mmst1*mmst2*pow3(s2t))/( + 9.*(-mmgl + mmst1)*(mmst1 - mmst2)) - (16*mgl*mmst1*pow3(s2t))/(9.*(-mmgl + + mmst2)) - (32*mgl*mmst2*pow3(s2t))/(9.*(-mmgl + mmst2)) + (16*mgl*pow2 + (mmst1)*pow3(s2t))/(9.*pow2(-mmgl + mmst1)) - (32*mgl*pow2(mmst2)*pow3( + s2t))/(9.*(mmst1 - mmst2)*(-mmgl + mmst2)) + (16*mgl*mmst1*mmst2*pow3(s2t + ))/(9.*pow2(-mmgl + mmst2))))/mt + (logmmglmmu*logmmst2mmu*((64*mgl*s2t)/ + 9. - (8*mgl*mmst1*s2t)/(9.*(-mmgl + mmst1)) - (4*mgl*mmst2*s2t)/(3.*(- + mmgl + mmst1)) + (32*mgl*mmst1*mmst2*s2t)/(9.*(-mmgl + mmst1)*(mmst1 - + mmst2)) + (8*mgl*mmst1*s2t)/(9.*(-mmgl + mmst2)) + (68*mgl*mmst2*s2t)/(9. + *(-mmgl + mmst2)) - (8*mgl*s2t*pow2(mmst1))/(3.*(-mmgl + mmst1)*(-mmgl + + mmst2)) + (4*mgl*mmst1*mmst2*s2t)/(3.*pow2(-mmgl + mmst1)) + (8*mgl*s2t* + pow2(mmst1))/(9.*pow2(-mmgl + mmst1)) - (32*mgl*s2t*pow2(mmst2))/(9.*( + mmst1 - mmst2)*(-mmgl + mmst2)) + (8*mgl*mmst1*mmst2*s2t)/(9.*pow2(-mmgl + + mmst2)) + (8*mgl*s2t*pow2(mmst1))/(9.*pow2(-mmgl + mmst2)) - (148*mgl* + s2t*pow2(mmst2))/(9.*pow2(-mmgl + mmst2)) + (8*mgl*s2t*pow3(mmst1))/(9.*( + -mmgl + mmst2)*pow2(-mmgl + mmst1)) - (8*mgl*s2t*pow3(mmst1))/(9.*(-mmgl + + mmst1)*pow2(-mmgl + mmst2)) + (16*mgl*s2t*pow3(mmst2))/(9.*pow3(-mmgl + + mmst2)) + (16*mgl*mmst2*pow3(s2t))/(9.*(-mmgl + mmst1)) - (32*mgl*mmst1* + mmst2*pow3(s2t))/(9.*(-mmgl + mmst1)*(mmst1 - mmst2)) + (16*mgl*mmst2* + pow3(s2t))/(9.*(-mmgl + mmst2)) - (16*mgl*mmst1*mmst2*pow3(s2t))/(9.*pow2 + (-mmgl + mmst1)) + (32*mgl*pow2(mmst2)*pow3(s2t))/(9.*(mmst1 - mmst2)*(- + mmgl + mmst2)) - (16*mgl*pow2(mmst2)*pow3(s2t))/(9.*pow2(-mmgl + mmst2))) + )/mt + (logmmst2mmu*((-64*mgl*s2t)/9. + (8*mgl*mmst1*s2t)/(9.*(-mmgl + + mmst1)) + (112*mgl*mmst2*s2t)/(9.*(-mmgl + mmst1)) - (64*mgl*mmst1*mmst2* + s2t)/(9.*(-mmgl + mmst1)*(mmst1 - mmst2)) - (8*mgl*mmst1*s2t)/(9.*(-mmgl + + mmst2)) + (8*mgl*mmst2*s2t)/(3.*(-mmgl + mmst2)) + (8*mgl*s2t*pow2( + mmst1))/(9.*(-mmgl + mmst1)*(-mmgl + mmst2)) + (64*mgl*s2t*pow2(mmst2))/( + 9.*(-mmgl + mmst1)*(mmst1 - mmst2)) - (8*mgl*mmst1*mmst2*s2t)/(3.*pow2(- + mmgl + mmst2)) - (80*mgl*mmst2*mmsusy*s2t)/(3.*pow2(-mmgl + mmst2)) + (40 + *mgl*s2t*pow2(mmst2))/pow2(-mmgl + mmst2) - (80*mgl*mmst2*pow3(s2t))/(9.* + (-mmgl + mmst1)) + (64*mgl*mmst1*mmst2*pow3(s2t))/(9.*(-mmgl + mmst1)*( + mmst1 - mmst2)) - (16*mgl*mmst1*pow3(s2t))/(9.*(-mmgl + mmst2)) - (32*mgl + *mmst2*pow3(s2t))/(9.*(-mmgl + mmst2)) - (64*mgl*pow2(mmst2)*pow3(s2t))/( + 9.*(-mmgl + mmst1)*(mmst1 - mmst2)) + (16*mgl*mmst1*mmst2*pow3(s2t))/(9.* + pow2(-mmgl + mmst2)) - (16*mgl*pow2(mmst2)*pow3(s2t))/(9.*pow2(-mmgl + + mmst2))))/mt + (pow2(logmmst2mmu)*((-22*mgl*mmst2*s2t)/(9.*(-mmgl + mmst1 + )) + (16*mgl*mmst1*mmst2*s2t)/(9.*(-mmgl + mmst1)*(mmst1 - mmst2)) + (10* + mgl*mmst2*s2t)/(9.*(-mmgl + mmst2)) - (16*mgl*s2t*pow2(mmst2))/(9.*(-mmgl + + mmst1)*(mmst1 - mmst2)) + (32*mgl*s2t*pow2(mmst2))/(9.*(mmst1 - mmst2) + *(-mmgl + mmst2)) + (2*mgl*mmst1*mmst2*s2t)/(3.*pow2(-mmgl + mmst2)) + ( + 20*mgl*mmst2*mmsusy*s2t)/(3.*pow2(-mmgl + mmst2)) - (62*mgl*s2t*pow2( + mmst2))/(9.*pow2(-mmgl + mmst2)) - (8*mgl*s2t*pow3(mmst2))/(9.*pow3(-mmgl + + mmst2)) + (16*mgl*mmst2*pow3(s2t))/(9.*(-mmgl + mmst1)) - (16*mgl* + mmst1*mmst2*pow3(s2t))/(9.*(-mmgl + mmst1)*(mmst1 - mmst2)) - (16*mgl* + mmst2*pow3(s2t))/(9.*(-mmgl + mmst2)) + (16*mgl*pow2(mmst2)*pow3(s2t))/( + 9.*(-mmgl + mmst1)*(mmst1 - mmst2)) - (32*mgl*pow2(mmst2)*pow3(s2t))/(9.* + (mmst1 - mmst2)*(-mmgl + mmst2)) + (16*mgl*pow2(mmst2)*pow3(s2t))/(9.* + pow2(-mmgl + mmst2))))/mt + (logmmglmmu*((544*mgl*mmst1*s2t)/(9.*(-mmgl + + mmst1)) + (8*mgl*mmst2*s2t)/(3.*(-mmgl + mmst1)) - (8*mgl*mmst1*s2t)/(3.* + (-mmgl + mmst2)) - (544*mgl*mmst2*s2t)/(9.*(-mmgl + mmst2)) + (80*mgl* + mmsusy*s2t)/(3.*(-mmgl + mmst1)) - (80*mgl*mmsusy*s2t)/(3.*(-mmgl + mmst2 + )) - (8*mgl*mmst1*mmst2*s2t)/(3.*pow2(-mmgl + mmst1)) - (80*mgl*mmst1* + mmsusy*s2t)/(3.*pow2(-mmgl + mmst1)) + (40*mgl*s2t*pow2(mmst1))/pow2(- + mmgl + mmst1) + (8*mgl*mmst1*mmst2*s2t)/(3.*pow2(-mmgl + mmst2)) + (80* + mgl*mmst2*mmsusy*s2t)/(3.*pow2(-mmgl + mmst2)) - (40*mgl*s2t*pow2(mmst2)) + /pow2(-mmgl + mmst2) - (16*mgl*mmst1*pow3(s2t))/(9.*(-mmgl + mmst1)) - ( + 16*mgl*mmst2*pow3(s2t))/(9.*(-mmgl + mmst1)) + (16*mgl*mmst1*pow3(s2t))/( + 9.*(-mmgl + mmst2)) + (16*mgl*mmst2*pow3(s2t))/(9.*(-mmgl + mmst2)) + (16 + *mgl*mmst1*mmst2*pow3(s2t))/(9.*pow2(-mmgl + mmst1)) - (16*mgl*pow2(mmst1 + )*pow3(s2t))/(9.*pow2(-mmgl + mmst1)) - (16*mgl*mmst1*mmst2*pow3(s2t))/( + 9.*pow2(-mmgl + mmst2)) + (16*mgl*pow2(mmst2)*pow3(s2t))/(9.*pow2(-mmgl + + mmst2))))/mt + logmmglmmu*logmmst1mmu*(7.111111111111111 - (59*mmst1)/(9. + *(-mmgl + mmst1)) + (13*mmst1)/(9.*(-mmgl + mmst2)) + (4*pow2(mmst1))/(9. + *(-mmgl + mmst1)*(-mmgl + mmst2)) - (109*pow2(mmst1))/(9.*pow2(-mmgl + + mmst1)) - (29*mmst1*mmst2)/(9.*pow2(-mmgl + mmst2)) - (4*pow2(mmst1))/(3. + *pow2(-mmgl + mmst2)) + (64*pow2(s2t))/9. - (67*mmst1*pow2(s2t))/(9.*(- + mmgl + mmst1)) - (61*mmst1*pow2(s2t))/(9.*(-mmgl + mmst2)) + (13*pow2( + mmst1)*pow2(s2t))/((-mmgl + mmst1)*(-mmgl + mmst2)) - (97*pow2(mmst1)* + pow2(s2t))/(9.*pow2(-mmgl + mmst1)) + (56*mmst1*mmst2*pow2(s2t))/(9.*pow2 + (-mmgl + mmst2)) - (4*pow2(mmst1)*pow2(s2t))/(3.*pow2(-mmgl + mmst2)) + ( + 16*pow3(mmst1))/(9.*(-mmgl + mmst1)*pow2(-mmgl + mmst2)) - (32*pow2(s2t)* + pow3(mmst1))/(3.*(-mmgl + mmst2)*pow2(-mmgl + mmst1)) + (16*pow2(s2t)* + pow3(mmst1))/(3.*(-mmgl + mmst1)*pow2(-mmgl + mmst2)) + (116*pow3(mmst1)) + /(9.*pow3(-mmgl + mmst1)) + (160*pow2(s2t)*pow3(mmst1))/(9.*pow3(-mmgl + + mmst1)) + (4*mmst1*pow2(mmst2))/(3.*pow3(-mmgl + mmst2)) - (32*mmst2*pow2 + (mmst1)*pow2(s2t))/(9.*pow3(-mmgl + mmst2)) - (16*mmst1*pow2(mmst2)*pow2( + s2t))/(3.*pow3(-mmgl + mmst2)) - (32*pow2(s2t)*pow3(mmst1))/(9.*pow3(- + mmgl + mmst2)) - (4*pow4(mmst1))/(9.*pow2(-mmgl + mmst1)*pow2(-mmgl + + mmst2)) - (4*pow2(s2t)*pow4(mmst1))/(9.*pow2(-mmgl + mmst1)*pow2(-mmgl + + mmst2)) + (32*pow2(s2t)*pow4(mmst1))/(9.*(-mmgl + mmst2)*pow3(-mmgl + + mmst1)) + (32*pow2(s2t)*pow4(mmst1))/(9.*(-mmgl + mmst1)*pow3(-mmgl + + mmst2)) - (4*pow4(mmst1))/(3.*pow4(-mmgl + mmst1)) - (20*pow2(s2t)*pow4( + mmst1))/(3.*pow4(-mmgl + mmst1))) + (271*pow4(mmst2))/(648.*pow2(-mmgl + + mmst1)*pow2(mmst1 - mmst2)) + (zt2*pow4(mmst2))/(9.*pow2(-mmgl + mmst1)* + pow2(mmst1 - mmst2)) + logmmst2mmu*(-5 + (4*mmst1)/(9.*(-mmgl + mmst1)) - + (4*mmst2)/(-mmgl + mmst1) - (128*mmst2)/(9.*(mmst1 - mmst2)) - (4*mmst1)/ + (9.*(-mmgl + mmst2)) + (178*mmst2)/(9.*(-mmgl + mmst2)) + (16*mmst1*mmst2 + )/(3.*pow2(-mmgl + mmst1)) + (128*pow2(mmst2))/(9.*(mmst1 - mmst2)*(-mmgl + + mmst2)) - (14*mmst1*mmst2)/(9.*pow2(-mmgl + mmst2)) - (515*mmst2* + mmsusy)/(27.*pow2(-mmgl + mmst2)) + (4*pow2(mmst1))/(9.*pow2(-mmgl + + mmst2)) + (248*pow2(mmst2))/(9.*pow2(-mmgl + mmst2)) - (25*mmsusy*pow2( + mmst2))/(27.*(mmst2 - mmsusy)*pow2(-mmgl + mmst2)) - (5*mmst2*pow2(mmsusy + ))/(9.*(mmst2 - mmsusy)*pow2(-mmgl + mmst2)) + (40*pow2(mmst2)*pow2( + mmsusy))/(27.*pow2(-mmgl + mmst2)*pow2(mmst2 - mmsusy)) - (64*pow2(s2t))/ + 9. - (4385*mmst1*pow2(s2t))/(324.*(-mmgl + mmst1)) + (871*mmst2*pow2(s2t) + )/(324.*(-mmgl + mmst1)) + (128*mmst2*pow2(s2t))/(9.*(mmst1 - mmst2)) - ( + 11*mmst1*mmst2*pow2(s2t))/(162.*(-mmgl + mmst1)*(mmst1 - mmst2)) + (3809* + mmst1*pow2(s2t))/(324.*(-mmgl + mmst2)) + (8993*mmst2*pow2(s2t))/(324.*(- + mmgl + mmst2)) + (11*mmst1*mmst2*pow2(s2t))/(162.*(mmst1 - mmst2)*(-mmgl + + mmst2)) - (11*pow2(mmst1)*pow2(s2t))/(162.*(-mmgl + mmst1)*(mmst1 - + mmst2)) - (5681*pow2(mmst1)*pow2(s2t))/(324.*(-mmgl + mmst1)*(-mmgl + + mmst2)) + (11*pow2(mmst1)*pow2(s2t))/(162.*(mmst1 - mmst2)*(-mmgl + mmst2 + )) - (16*mmst1*mmst2*pow2(s2t))/(9.*pow2(-mmgl + mmst1)) + (32*pow2(mmst1 + )*pow2(s2t))/(9.*pow2(-mmgl + mmst1)) - (5*pow2(mmst2)*pow2(s2t))/(108.*( + -mmgl + mmst1)*(mmst1 - mmst2)) - (1531*pow2(mmst2)*pow2(s2t))/(108.*( + mmst1 - mmst2)*(-mmgl + mmst2)) + (4*mmst1*mmst2*pow2(s2t))/pow2(-mmgl + + mmst2) + (4*pow2(mmst1)*pow2(s2t))/(9.*pow2(-mmgl + mmst2)) - (182*pow2( + mmst2)*pow2(s2t))/(9.*pow2(-mmgl + mmst2)) - (4*pow3(mmst1))/(9.*(-mmgl + + mmst1)*pow2(-mmgl + mmst2)) - (11*pow2(s2t)*pow3(mmst1))/(162.*(-mmgl + + mmst1)*(mmst1 - mmst2)*(-mmgl + mmst2)) + (32*pow2(s2t)*pow3(mmst1))/(9.* + (-mmgl + mmst2)*pow2(-mmgl + mmst1)) - (4*pow2(s2t)*pow3(mmst1))/(9.*(- + mmgl + mmst1)*pow2(-mmgl + mmst2)) - pow3(mmst2)/(3.*(mmst1 - mmst2)*pow2 + (-mmgl + mmst1)) + (mmst1*pow3(mmst2))/(3.*pow2(-mmgl + mmst1)*pow2(mmst1 + - mmst2)) - (11*pow2(s2t)*pow3(mmst2))/(162.*(-mmgl + mmst1)*pow2(mmst1 + - mmst2)) + (11*pow2(s2t)*pow3(mmst2))/(162.*(-mmgl + mmst2)*pow2(mmst1 - + mmst2)) + (8*mmst1*pow2(mmst2))/(3.*pow3(-mmgl + mmst2)) + (80*mmsusy* + pow2(mmst2))/(3.*pow3(-mmgl + mmst2)) - (16*mmst1*pow2(mmst2)*pow2(s2t))/ + (9.*pow3(-mmgl + mmst2)) - (220*pow3(mmst2))/(9.*pow3(-mmgl + mmst2)) - ( + 4*pow2(s2t)*pow3(mmst2))/(3.*pow3(-mmgl + mmst2)) - (40*mmst2*pow3(mmsusy + ))/(27.*pow2(-mmgl + mmst2)*pow2(mmst2 - mmsusy)) - pow4(mmst2)/(3.*pow2( + -mmgl + mmst1)*pow2(mmst1 - mmst2))) + logmmst1mmu*(-5 + (62*mmst1)/(3.*( + -mmgl + mmst1)) + (128*mmst1)/(9.*(mmst1 - mmst2)) - (44*mmst1)/(9.*(- + mmgl + mmst2)) - (128*pow2(mmst1))/(9.*(-mmgl + mmst1)*(mmst1 - mmst2)) + + (4*pow2(mmst1))/(3.*(-mmgl + mmst1)*(-mmgl + mmst2)) - (41*mmst1*mmst2)/( + 27.*pow2(-mmgl + mmst1)) - (515*mmst1*mmsusy)/(27.*pow2(-mmgl + mmst1)) + + (244*pow2(mmst1))/(9.*pow2(-mmgl + mmst1)) - (13*mmst2*pow2(mmst1))/(27.* + (mmst1 - mmst2)*pow2(-mmgl + mmst1)) - (25*mmsusy*pow2(mmst1))/(27.*( + mmst1 - mmsusy)*pow2(-mmgl + mmst1)) + (13*mmst1*pow2(mmst2))/(18.*(mmst1 + - mmst2)*pow2(-mmgl + mmst1)) - (13*pow2(mmst1)*pow2(mmst2))/(54.*pow2(- + mmgl + mmst1)*pow2(mmst1 - mmst2)) + (16*mmst1*mmst2)/(3.*pow2(-mmgl + + mmst2)) - (5*mmst1*pow2(mmsusy))/(9.*(mmst1 - mmsusy)*pow2(-mmgl + mmst1) + ) + (40*pow2(mmst1)*pow2(mmsusy))/(27.*pow2(-mmgl + mmst1)*pow2(mmst1 - + mmsusy)) - (64*pow2(s2t))/9. + (2959*mmst1*pow2(s2t))/(162.*(-mmgl + + mmst1)) - (128*mmst1*pow2(s2t))/(9.*(mmst1 - mmst2)) - (16*mmst2*pow2(s2t + ))/(9.*(-mmgl + mmst1)) - (2*mmst1*mmst2*pow2(s2t))/(81.*(-mmgl + mmst1)* + (mmst1 - mmst2)) + (1973*mmst1*pow2(s2t))/(162.*(-mmgl + mmst2)) - (7* + mmst2*pow2(s2t))/(162.*(-mmgl + mmst2)) + (11*mmst1*mmst2*pow2(s2t))/( + 162.*(mmst1 - mmst2)*(-mmgl + mmst2)) + (2293*pow2(mmst1)*pow2(s2t))/( + 162.*(-mmgl + mmst1)*(mmst1 - mmst2)) - (893*pow2(mmst1)*pow2(s2t))/(162. + *(-mmgl + mmst1)*(-mmgl + mmst2)) + (11*pow2(mmst1)*pow2(s2t))/(162.*( + mmst1 - mmst2)*(-mmgl + mmst2)) + (32*mmst1*mmst2*pow2(s2t))/(9.*pow2(- + mmgl + mmst1)) - (62*pow2(mmst1)*pow2(s2t))/(3.*pow2(-mmgl + mmst1)) - ( + 29*pow2(mmst2)*pow2(s2t))/(324.*(-mmgl + mmst1)*(mmst1 - mmst2)) + (2* + pow2(mmst2)*pow2(s2t))/(81.*(mmst1 - mmst2)*(-mmgl + mmst2)) + (7*mmst1* + pow2(mmst2)*pow2(s2t))/(324.*(-mmgl + mmst1)*pow2(mmst1 - mmst2)) - (16* + mmst1*mmst2*pow2(s2t))/(3.*pow2(-mmgl + mmst2)) - (32*pow2(mmst1)*pow2( + s2t))/(9.*pow2(-mmgl + mmst2)) - (4*pow3(mmst1))/(9.*(-mmgl + mmst2)*pow2 + (-mmgl + mmst1)) - (11*pow2(s2t)*pow3(mmst1))/(162.*(-mmgl + mmst1)*( + mmst1 - mmst2)*(-mmgl + mmst2)) - (4*pow2(s2t)*pow3(mmst1))/(9.*(-mmgl + + mmst2)*pow2(-mmgl + mmst1)) + (32*pow2(s2t)*pow3(mmst1))/(9.*(-mmgl + + mmst1)*pow2(-mmgl + mmst2)) + (8*mmst2*pow2(mmst1))/(3.*pow3(-mmgl + + mmst1)) + (80*mmsusy*pow2(mmst1))/(3.*pow3(-mmgl + mmst1)) - (16*mmst2* + pow2(mmst1)*pow2(s2t))/(9.*pow3(-mmgl + mmst1)) - (220*pow3(mmst1))/(9.* + pow3(-mmgl + mmst1)) - (4*pow2(s2t)*pow3(mmst1))/(3.*pow3(-mmgl + mmst1)) + - (5*pow3(mmst2))/(54.*(mmst1 - mmst2)*pow2(-mmgl + mmst1)) + (mmst1*pow3 + (mmst2))/(3.*pow2(-mmgl + mmst1)*pow2(mmst1 - mmst2)) - (29*pow2(s2t)* + pow3(mmst2))/(324.*(-mmgl + mmst1)*pow2(mmst1 - mmst2)) + (11*pow2(s2t)* + pow3(mmst2))/(162.*(-mmgl + mmst2)*pow2(mmst1 - mmst2)) - (40*mmst1*pow3( + mmsusy))/(27.*pow2(-mmgl + mmst1)*pow2(mmst1 - mmsusy)) - (5*pow4(mmst2)) + /(54.*pow2(-mmgl + mmst1)*pow2(mmst1 - mmst2))) + pow2(logmmst1mmu)*( + 0.3333333333333333 - (35*mmst1)/(18.*(-mmgl + mmst1)) - (64*mmst1)/(9.*( + mmst1 - mmst2)) + mmst1/(2.*(-mmgl + mmst2)) + (64*pow2(mmst1))/(9.*(- + mmgl + mmst1)*(mmst1 - mmst2)) + (mmst1*mmst2)/(2.*pow2(-mmgl + mmst1)) + + (40*mmst1*mmsusy)/(9.*pow2(-mmgl + mmst1)) - (25*pow2(mmst1))/(6.*pow2(- + mmgl + mmst1)) + (5*mmsusy*pow2(mmst1))/(9.*(mmst1 - mmsusy)*pow2(-mmgl + + mmst1)) - (2*mmst1*mmst2)/(3.*pow2(-mmgl + mmst2)) - (10*mmst1*pow2( + mmsusy))/(9.*(mmst1 - mmsusy)*pow2(-mmgl + mmst1)) + (5*pow2(mmst1)*pow2( + mmsusy))/(9.*pow2(-mmgl + mmst1)*pow2(mmst1 - mmsusy)) - (25*mmst1*pow2( + s2t))/(9.*(-mmgl + mmst1)) + (64*mmst1*pow2(s2t))/(9.*(mmst1 - mmst2)) + + (mmst1*mmst2*pow2(s2t))/(54.*(-mmgl + mmst1)*(mmst1 - mmst2)) - (13*mmst1 + *pow2(s2t))/(9.*(-mmgl + mmst2)) - (mmst1*mmst2*pow2(s2t))/(54.*(mmst1 - + mmst2)*(-mmgl + mmst2)) - (383*pow2(mmst1)*pow2(s2t))/(54.*(-mmgl + mmst1 + )*(mmst1 - mmst2)) + (13*pow2(mmst1)*pow2(s2t))/(9.*(-mmgl + mmst1)*(- + mmgl + mmst2)) - (pow2(mmst1)*pow2(s2t))/(54.*(mmst1 - mmst2)*(-mmgl + + mmst2)) + (185*pow2(mmst1)*pow2(s2t))/(18.*pow2(-mmgl + mmst1)) + (pow2( + mmst2)*pow2(s2t))/(54.*(-mmgl + mmst1)*(mmst1 - mmst2)) - (pow2(mmst2)* + pow2(s2t))/(54.*(mmst1 - mmst2)*(-mmgl + mmst2)) + (pow2(s2t)*pow3(mmst1) + )/(54.*(-mmgl + mmst1)*(mmst1 - mmst2)*(-mmgl + mmst2)) - (2*mmst2*pow2( + mmst1))/(3.*pow3(-mmgl + mmst1)) - (20*mmsusy*pow2(mmst1))/(3.*pow3(-mmgl + + mmst1)) + (10*pow3(mmst1))/(3.*pow3(-mmgl + mmst1)) - (8*pow2(s2t)* + pow3(mmst1))/pow3(-mmgl + mmst1) + pow3(mmst2)/(18.*(mmst1 - mmst2)*pow2( + -mmgl + mmst1)) - (mmst1*pow3(mmst2))/(18.*pow2(-mmgl + mmst1)*pow2(mmst1 + - mmst2)) + (pow2(s2t)*pow3(mmst2))/(54.*(-mmgl + mmst1)*pow2(mmst1 - + mmst2)) - (pow2(s2t)*pow3(mmst2))/(54.*(-mmgl + mmst2)*pow2(mmst1 - mmst2 + )) - (5*mmst1*pow3(mmsusy))/(9.*pow2(-mmgl + mmst1)*pow2(mmst1 - mmsusy)) + + (2*pow4(mmst1))/(3.*pow4(-mmgl + mmst1)) + (10*pow2(s2t)*pow4(mmst1))/( + 3.*pow4(-mmgl + mmst1)) + pow4(mmst2)/(18.*pow2(-mmgl + mmst1)*pow2(mmst1 + - mmst2))) + logmmst1mmu*logmmst2mmu*((4*mmst1)/(9.*(-mmgl + mmst1)) - ( + 4*mmst1)/(9.*(-mmgl + mmst2)) - (4*pow2(mmst1))/(9.*(-mmgl + mmst1)*(- + mmgl + mmst2)) + (mmst1*mmst2)/pow2(-mmgl + mmst1) - (4*pow2(mmst1))/(9.* + pow2(-mmgl + mmst1)) + (17*mmst1*mmst2)/(9.*pow2(-mmgl + mmst2)) + (4* + pow2(mmst1))/(3.*pow2(-mmgl + mmst2)) - (19*mmst1*pow2(s2t))/(9.*(-mmgl + + mmst1)) + (16*mmst2*pow2(s2t))/(9.*(-mmgl + mmst1)) + (mmst1*mmst2*pow2( + s2t))/(27.*(-mmgl + mmst1)*(mmst1 - mmst2)) + (35*mmst1*pow2(s2t))/(9.*(- + mmgl + mmst2)) - (mmst1*mmst2*pow2(s2t))/(27.*(mmst1 - mmst2)*(-mmgl + + mmst2)) + (pow2(mmst1)*pow2(s2t))/(27.*(-mmgl + mmst1)*(mmst1 - mmst2)) - + (91*pow2(mmst1)*pow2(s2t))/(9.*(-mmgl + mmst1)*(-mmgl + mmst2)) - (pow2( + mmst1)*pow2(s2t))/(27.*(mmst1 - mmst2)*(-mmgl + mmst2)) - (32*mmst1*mmst2 + *pow2(s2t))/(9.*pow2(-mmgl + mmst1)) + (20*pow2(mmst1)*pow2(s2t))/(3.* + pow2(-mmgl + mmst1)) + (pow2(mmst2)*pow2(s2t))/(27.*(-mmgl + mmst1)*( + mmst1 - mmst2)) - (pow2(mmst2)*pow2(s2t))/(27.*(mmst1 - mmst2)*(-mmgl + + mmst2)) - (56*mmst1*mmst2*pow2(s2t))/(9.*pow2(-mmgl + mmst2)) + (4*pow2( + mmst1)*pow2(s2t))/(3.*pow2(-mmgl + mmst2)) - (16*pow3(mmst1))/(9.*(-mmgl + + mmst1)*pow2(-mmgl + mmst2)) + (pow2(s2t)*pow3(mmst1))/(27.*(-mmgl + + mmst1)*(mmst1 - mmst2)*(-mmgl + mmst2)) + (32*pow2(s2t)*pow3(mmst1))/(3.* + (-mmgl + mmst2)*pow2(-mmgl + mmst1)) - (16*pow2(s2t)*pow3(mmst1))/(3.*(- + mmgl + mmst1)*pow2(-mmgl + mmst2)) - (4*mmst2*pow2(mmst1))/(3.*pow3(-mmgl + + mmst1)) + (16*mmst2*pow2(mmst1)*pow2(s2t))/(9.*pow3(-mmgl + mmst1)) - + (32*pow2(s2t)*pow3(mmst1))/(9.*pow3(-mmgl + mmst1)) + pow3(mmst2)/(9.*( + mmst1 - mmst2)*pow2(-mmgl + mmst1)) - (mmst1*pow3(mmst2))/(9.*pow2(-mmgl + + mmst1)*pow2(mmst1 - mmst2)) + (pow2(s2t)*pow3(mmst2))/(27.*(-mmgl + + mmst1)*pow2(mmst1 - mmst2)) - (pow2(s2t)*pow3(mmst2))/(27.*(-mmgl + mmst2 + )*pow2(mmst1 - mmst2)) - (4*mmst1*pow2(mmst2))/(3.*pow3(-mmgl + mmst2)) + + (32*mmst2*pow2(mmst1)*pow2(s2t))/(9.*pow3(-mmgl + mmst2)) + (16*mmst1* + pow2(mmst2)*pow2(s2t))/(3.*pow3(-mmgl + mmst2)) + (32*pow2(s2t)*pow3( + mmst1))/(9.*pow3(-mmgl + mmst2)) + (4*pow4(mmst1))/(9.*pow2(-mmgl + mmst1 + )*pow2(-mmgl + mmst2)) + (4*pow2(s2t)*pow4(mmst1))/(9.*pow2(-mmgl + mmst1 + )*pow2(-mmgl + mmst2)) - (32*pow2(s2t)*pow4(mmst1))/(9.*(-mmgl + mmst2)* + pow3(-mmgl + mmst1)) - (32*pow2(s2t)*pow4(mmst1))/(9.*(-mmgl + mmst1)* + pow3(-mmgl + mmst2)) + pow4(mmst2)/(9.*pow2(-mmgl + mmst1)*pow2(mmst1 - + mmst2))) + logmmglmmu*logmmst2mmu*(7.111111111111111 - (4*mmst1)/(9.*(- + mmgl + mmst1)) + mmst2/(-mmgl + mmst1) + (4*mmst1)/(9.*(-mmgl + mmst2)) - + (55*mmst2)/(9.*(-mmgl + mmst2)) + (4*pow2(mmst1))/(9.*(-mmgl + mmst1)*(- + mmgl + mmst2)) - (7*mmst1*mmst2)/(3.*pow2(-mmgl + mmst1)) + (4*pow2(mmst1 + ))/(9.*pow2(-mmgl + mmst1)) - (8*mmst1*mmst2)/(9.*pow2(-mmgl + mmst2)) - + (4*pow2(mmst1))/(3.*pow2(-mmgl + mmst2)) - (113*pow2(mmst2))/(9.*pow2(- + mmgl + mmst2)) + (64*pow2(s2t))/9. + (5*mmst1*pow2(s2t))/(-mmgl + mmst1) + - (16*mmst2*pow2(s2t))/(9.*(-mmgl + mmst1)) - (5*mmst1*pow2(s2t))/(-mmgl + + mmst2) - (112*mmst2*pow2(s2t))/(9.*(-mmgl + mmst2)) + (13*pow2(mmst1)* + pow2(s2t))/((-mmgl + mmst1)*(-mmgl + mmst2)) + (32*mmst1*mmst2*pow2(s2t)) + /(9.*pow2(-mmgl + mmst1)) - (20*pow2(mmst1)*pow2(s2t))/(3.*pow2(-mmgl + + mmst1)) + (8*mmst1*mmst2*pow2(s2t))/(3.*pow2(-mmgl + mmst2)) - (4*pow2( + mmst1)*pow2(s2t))/(3.*pow2(-mmgl + mmst2)) - (37*pow2(mmst2)*pow2(s2t))/( + 9.*pow2(-mmgl + mmst2)) + (16*pow3(mmst1))/(9.*(-mmgl + mmst1)*pow2(-mmgl + + mmst2)) - (32*pow2(s2t)*pow3(mmst1))/(3.*(-mmgl + mmst2)*pow2(-mmgl + + mmst1)) + (16*pow2(s2t)*pow3(mmst1))/(3.*(-mmgl + mmst1)*pow2(-mmgl + + mmst2)) + (4*mmst2*pow2(mmst1))/(3.*pow3(-mmgl + mmst1)) - (16*mmst2*pow2 + (mmst1)*pow2(s2t))/(9.*pow3(-mmgl + mmst1)) + (32*pow2(s2t)*pow3(mmst1))/ + (9.*pow3(-mmgl + mmst1)) - (32*mmst2*pow2(mmst1)*pow2(s2t))/(9.*pow3(- + mmgl + mmst2)) - (32*mmst1*pow2(mmst2)*pow2(s2t))/(9.*pow3(-mmgl + mmst2) + ) - (32*pow2(s2t)*pow3(mmst1))/(9.*pow3(-mmgl + mmst2)) + (116*pow3(mmst2 + ))/(9.*pow3(-mmgl + mmst2)) + (128*pow2(s2t)*pow3(mmst2))/(9.*pow3(-mmgl + + mmst2)) - (4*pow4(mmst1))/(9.*pow2(-mmgl + mmst1)*pow2(-mmgl + mmst2)) + - (4*pow2(s2t)*pow4(mmst1))/(9.*pow2(-mmgl + mmst1)*pow2(-mmgl + mmst2)) + + (32*pow2(s2t)*pow4(mmst1))/(9.*(-mmgl + mmst2)*pow3(-mmgl + mmst1)) + ( + 32*pow2(s2t)*pow4(mmst1))/(9.*(-mmgl + mmst1)*pow3(-mmgl + mmst2)) - (4* + pow4(mmst2))/(3.*pow4(-mmgl + mmst2)) - (20*pow2(s2t)*pow4(mmst2))/(3.* + pow4(-mmgl + mmst2))) + pow2(logmmglmmu)*(-9.555555555555555 - (211*mmst1 + )/(18.*(-mmgl + mmst1)) - (64*mmst1)/(3.*(mmst1 - mmst2)) + mmst2/(2.*(- + mmgl + mmst1)) + (64*mmst2)/(3.*(mmst1 - mmst2)) - (31*mmst1)/(18.*(-mmgl + + mmst2)) - (251*mmst2)/(18.*(-mmgl + mmst2)) + (5*mmsusy)/(-mmgl + + mmst1) + (5*mmsusy)/(-mmgl + mmst2) + (64*pow2(mmst1))/(3.*(-mmgl + mmst1 + )*(mmst1 - mmst2)) + (4*pow2(mmst1))/(3.*(-mmgl + mmst1)*(-mmgl + mmst2)) + - (7*mmst1*mmst2)/(6.*pow2(-mmgl + mmst1)) - (35*mmst1*mmsusy)/(3.*pow2(- + mmgl + mmst1)) + (821*pow2(mmst1))/(18.*pow2(-mmgl + mmst1)) - (64*pow2( + mmst2))/(3.*(mmst1 - mmst2)*(-mmgl + mmst2)) - (5*mmst1*mmst2)/(18.*pow2( + -mmgl + mmst2)) - (35*mmst2*mmsusy)/(3.*pow2(-mmgl + mmst2)) + (4*pow2( + mmst1))/(3.*pow2(-mmgl + mmst2)) + (829*pow2(mmst2))/(18.*pow2(-mmgl + + mmst2)) - (128*pow2(s2t))/9. + (15*mmst1*pow2(s2t))/(-mmgl + mmst1) + (64 + *mmst1*pow2(s2t))/(3.*(mmst1 - mmst2)) - (64*mmst2*pow2(s2t))/(3.*(mmst1 + - mmst2)) - (7*mmst1*pow2(s2t))/(9.*(-mmgl + mmst2)) + (128*mmst2*pow2( + s2t))/(9.*(-mmgl + mmst2)) - (64*pow2(mmst1)*pow2(s2t))/(3.*(-mmgl + + mmst1)*(mmst1 - mmst2)) - (65*pow2(mmst1)*pow2(s2t))/(9.*(-mmgl + mmst1)* + (-mmgl + mmst2)) + (pow2(mmst1)*pow2(s2t))/(2.*pow2(-mmgl + mmst1)) + (64 + *pow2(mmst2)*pow2(s2t))/(3.*(mmst1 - mmst2)*(-mmgl + mmst2)) - (8*mmst1* + mmst2*pow2(s2t))/(3.*pow2(-mmgl + mmst2)) + (4*pow2(mmst1)*pow2(s2t))/(3. + *pow2(-mmgl + mmst2)) - (37*pow2(mmst2)*pow2(s2t))/(6.*pow2(-mmgl + mmst2 + )) - (16*pow3(mmst1))/(9.*(-mmgl + mmst1)*pow2(-mmgl + mmst2)) + (32*pow2 + (s2t)*pow3(mmst1))/(3.*(-mmgl + mmst2)*pow2(-mmgl + mmst1)) - (16*pow2( + s2t)*pow3(mmst1))/(3.*(-mmgl + mmst1)*pow2(-mmgl + mmst2)) + (2*mmst2* + pow2(mmst1))/(3.*pow3(-mmgl + mmst1)) + (20*mmsusy*pow2(mmst1))/(3.*pow3( + -mmgl + mmst1)) - (242*pow3(mmst1))/(9.*pow3(-mmgl + mmst1)) - (88*pow2( + s2t)*pow3(mmst1))/(9.*pow3(-mmgl + mmst1)) + (2*mmst1*pow2(mmst2))/(3.* + pow3(-mmgl + mmst2)) + (20*mmsusy*pow2(mmst2))/(3.*pow3(-mmgl + mmst2)) + + (32*mmst2*pow2(mmst1)*pow2(s2t))/(9.*pow3(-mmgl + mmst2)) + (32*mmst1* + pow2(mmst2)*pow2(s2t))/(9.*pow3(-mmgl + mmst2)) + (32*pow2(s2t)*pow3( + mmst1))/(9.*pow3(-mmgl + mmst2)) - (242*pow3(mmst2))/(9.*pow3(-mmgl + + mmst2)) - (56*pow2(s2t)*pow3(mmst2))/(9.*pow3(-mmgl + mmst2)) + (4*pow4( + mmst1))/(9.*pow2(-mmgl + mmst1)*pow2(-mmgl + mmst2)) + (4*pow2(s2t)*pow4( + mmst1))/(9.*pow2(-mmgl + mmst1)*pow2(-mmgl + mmst2)) - (32*pow2(s2t)*pow4 + (mmst1))/(9.*(-mmgl + mmst2)*pow3(-mmgl + mmst1)) - (32*pow2(s2t)*pow4( + mmst1))/(9.*(-mmgl + mmst1)*pow3(-mmgl + mmst2)) + (2*pow4(mmst1))/(3.* + pow4(-mmgl + mmst1)) + (10*pow2(s2t)*pow4(mmst1))/(3.*pow4(-mmgl + mmst1) + ) + (2*pow4(mmst2))/(3.*pow4(-mmgl + mmst2)) + (10*pow2(s2t)*pow4(mmst2)) + /(3.*pow4(-mmgl + mmst2))) + pow2(logmmst2mmu)*(0.3333333333333333 + + mmst2/(2.*(-mmgl + mmst1)) + (64*mmst2)/(9.*(mmst1 - mmst2)) - (35*mmst2) + /(18.*(-mmgl + mmst2)) - (2*mmst1*mmst2)/(3.*pow2(-mmgl + mmst1)) - (64* + pow2(mmst2))/(9.*(mmst1 - mmst2)*(-mmgl + mmst2)) + (mmst1*mmst2)/(2.* + pow2(-mmgl + mmst2)) + (40*mmst2*mmsusy)/(9.*pow2(-mmgl + mmst2)) - (25* + pow2(mmst2))/(6.*pow2(-mmgl + mmst2)) + (5*mmsusy*pow2(mmst2))/(9.*(mmst2 + - mmsusy)*pow2(-mmgl + mmst2)) - (10*mmst2*pow2(mmsusy))/(9.*(mmst2 - + mmsusy)*pow2(-mmgl + mmst2)) + (5*pow2(mmst2)*pow2(mmsusy))/(9.*pow2(- + mmgl + mmst2)*pow2(mmst2 - mmsusy)) + (13*mmst1*pow2(s2t))/(9.*(-mmgl + + mmst1)) - (64*mmst2*pow2(s2t))/(9.*(mmst1 - mmst2)) + (mmst1*mmst2*pow2( + s2t))/(54.*(-mmgl + mmst1)*(mmst1 - mmst2)) - (13*mmst1*pow2(s2t))/(9.*(- + mmgl + mmst2)) - (38*mmst2*pow2(s2t))/(9.*(-mmgl + mmst2)) - (mmst1*mmst2 + *pow2(s2t))/(54.*(mmst1 - mmst2)*(-mmgl + mmst2)) + (pow2(mmst1)*pow2(s2t + ))/(54.*(-mmgl + mmst1)*(mmst1 - mmst2)) + (13*pow2(mmst1)*pow2(s2t))/(9. + *(-mmgl + mmst1)*(-mmgl + mmst2)) - (pow2(mmst1)*pow2(s2t))/(54.*(mmst1 - + mmst2)*(-mmgl + mmst2)) + (pow2(mmst2)*pow2(s2t))/(54.*(-mmgl + mmst1)*( + mmst1 - mmst2)) + (383*pow2(mmst2)*pow2(s2t))/(54.*(mmst1 - mmst2)*(-mmgl + + mmst2)) + (185*pow2(mmst2)*pow2(s2t))/(18.*pow2(-mmgl + mmst2)) + ( + pow2(s2t)*pow3(mmst1))/(54.*(-mmgl + mmst1)*(mmst1 - mmst2)*(-mmgl + + mmst2)) + pow3(mmst2)/(18.*(mmst1 - mmst2)*pow2(-mmgl + mmst1)) - (mmst1* + pow3(mmst2))/(18.*pow2(-mmgl + mmst1)*pow2(mmst1 - mmst2)) + (pow2(s2t)* + pow3(mmst2))/(54.*(-mmgl + mmst1)*pow2(mmst1 - mmst2)) - (pow2(s2t)*pow3( + mmst2))/(54.*(-mmgl + mmst2)*pow2(mmst1 - mmst2)) - (2*mmst1*pow2(mmst2)) + /(3.*pow3(-mmgl + mmst2)) - (20*mmsusy*pow2(mmst2))/(3.*pow3(-mmgl + + mmst2)) + (10*pow3(mmst2))/(3.*pow3(-mmgl + mmst2)) - (8*pow2(s2t)*pow3( + mmst2))/pow3(-mmgl + mmst2) - (5*mmst2*pow3(mmsusy))/(9.*pow2(-mmgl + + mmst2)*pow2(mmst2 - mmsusy)) + pow4(mmst2)/(18.*pow2(-mmgl + mmst1)*pow2( + mmst1 - mmst2)) + (2*pow4(mmst2))/(3.*pow4(-mmgl + mmst2)) + (10*pow2(s2t + )*pow4(mmst2))/(3.*pow4(-mmgl + mmst2))); return result * g34 * twoLoop; } diff --git a/model_specific/MSSM_thresholds/mssm_twoloop_mt.hpp b/model_specific/MSSM_thresholds/mssm_twoloop_mt.hpp index 43c3373636..520ba58932 100644 --- a/model_specific/MSSM_thresholds/mssm_twoloop_mt.hpp +++ b/model_specific/MSSM_thresholds/mssm_twoloop_mt.hpp @@ -16,7 +16,7 @@ // . // ==================================================================== -// This file has been generated at Wed 17 Jun 2020 11:16:10 +// This file has been generated at Sun 26 Feb 2023 12:30:46 // with the script "tquark_to_cpp.m". #ifndef MSSM_TWO_LOOP_SQCD_MT_H @@ -26,13 +26,6 @@ namespace flexiblesusy { namespace mssm_twoloop_mt { struct Parameters { - Parameters() = default; - Parameters(double g3_, double mt_, double mg_, double mst1_, - double mst2_, double msusy_, double xt_, double Q_) - : g3(g3_), mt(mt_), mg(mg_), mst1(mst1_) - , mst2(mst2_), msusy(msusy_), xt(xt_), Q(Q_) - {} - double g3{}; ///< MSSM strong gauge coupling DR-bar double mt{}; ///< MSSM top mass DR-bar double mg{}; ///< MSSM gluino mass DR-bar diff --git a/model_specific/MSSM_thresholds/mssm_twoloop_mtau.cpp b/model_specific/MSSM_thresholds/mssm_twoloop_mtau.cpp index 98235c9f49..c1204c9f80 100644 --- a/model_specific/MSSM_thresholds/mssm_twoloop_mtau.cpp +++ b/model_specific/MSSM_thresholds/mssm_twoloop_mtau.cpp @@ -20,11 +20,11 @@ // with the script "tau_to_cpp.m". #include "mssm_twoloop_mtau.hpp" -#include "dilog.hpp" +#include "Cl2.hpp" +#include "Li2.hpp" #include #include #include -#include #include #include @@ -92,7 +92,7 @@ namespace { return (6*(mm1*log1u + mm2*log2u) + (-mm1 - mm2)*(7 + power2(Pi)/6) + - (mm1 - mm2)*(2*dilog(1 - mm1/mm2) + + (mm1 - mm2)*(2*Li2(1 - mm1/mm2) + power2(log12)/2) + ((mm1 + mm2)*power2(log12))/2 - 2*(mm1*power2(log1u) + mm2*power2(log2u)))/2; @@ -103,14 +103,6 @@ namespace { return power2(1 - x - y) - 4*x*y; } - /// ClausenCl[2,x] - Real ClausenCl2(Real x) noexcept - { - const std::complex img(0.0l, 1.0l); - - return std::imag(dilog(std::exp(img*x))); - } - /// x < 1 && y < 1, LambdaSquared(x,y) > 0 Real PhiPos(Real x, Real y) noexcept { @@ -118,8 +110,8 @@ namespace { return (-(std::log(x)*std::log(y)) + 2*std::log((1 - lambda + x - y)/2)*std::log((1 - lambda - x + y)/2) - - 2*dilog((1 - lambda + x - y)/2) - - 2*dilog((1 - lambda - x + y)/2) + - 2*Li2((1 - lambda + x - y)/2) + - 2*Li2((1 - lambda - x + y)/2) + power2(Pi)/3)/lambda; } @@ -128,9 +120,9 @@ namespace { { const Real lambda = std::sqrt(-LambdaSquared(x,y)); - return 2*(+ ClausenCl2(2*std::acos((1 + x - y)/(2*std::sqrt(x)))) - + ClausenCl2(2*std::acos((1 - x + y)/(2*std::sqrt(y)))) - + ClausenCl2(2*std::acos((-1 + x + y)/(2*std::sqrt(x*y)))))/lambda; + return 2*(+ Cl2(2*std::acos((1 + x - y)/(2*std::sqrt(x)))) + + Cl2(2*std::acos((1 - x + y)/(2*std::sqrt(y)))) + + Cl2(2*std::acos((-1 + x + y)/(2*std::sqrt(x*y)))))/lambda; } Real Phi(Real x, Real y) noexcept diff --git a/model_specific/NMSSM_higgs/nmssm2loop.f b/model_specific/NMSSM_higgs/nmssm2loop.f index f78c77268e..6ae7ec5ff5 100644 --- a/model_specific/NMSSM_higgs/nmssm2loop.f +++ b/model_specific/NMSSM_higgs/nmssm2loop.f @@ -20,7 +20,29 @@ subroutine effpot(lp,mt,mg,T1,T2,st,ct,q2,tanb,vv,l,xx,as, $ DMS(0:2,0:2),DMP(0:2,0:2) double precision c2t,s2t,At,mu,Xt,ht,sbe,pi,k double precision F1t,F2t,F3t,Ft,FA + double precision, parameter :: eps_st = 1d-5 + double precision, parameter :: eps_t1 = 1d-5 +c ADDED by ALEX: guards against NANs when sin theta is zero! + if (dabs(st).lt.eps_st) then + if (st.ge.0.0d0) then + st = eps_st + else + st = -eps_st + endif + ct = sqrt(1.d0-st*st) + endif +c end of addition by ALEX + +c ADDED by ALEX: guards against NANs when T1 == T2 + if (dabs((T1-T2)/T1).lt.eps_t1) then + if (T1.gt.T2) then + T1 = T2 / (1d0 - eps_t1) + else + T1 = T2 / (1d0 + eps_t1) + endif + endif +c end of addition by ALEX pi = 4d0*atan(1.d0) diff --git a/model_specific/SM/cxx_qft/standard_model_context_base.hpp b/model_specific/SM/cxx_qft/standard_model_context_base.hpp new file mode 100644 index 0000000000..f0f06c64ad --- /dev/null +++ b/model_specific/SM/cxx_qft/standard_model_context_base.hpp @@ -0,0 +1,205 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + + +/** + * @file cxx_qft/SM_context_base.hpp + * + * This file was generated with FlexibleSUSY 2.7.1 and SARAH 4.14.5 . + */ + +#ifndef STANDARDMODEL_CXXQFT_CONTEXT_BASE_H +#define STANDARDMODEL_CXXQFT_CONTEXT_BASE_H + +#include "standard_model_fields.hpp" +#include "standard_model.hpp" + +namespace flexiblesusy { +namespace standard_model_cxx_diagrams { + +using cxx_diagrams::field_indices; +using standard_model::Standard_model; + + struct context_base { + Standard_model const& model; ///< The model object. + + template + double mass(const typename cxx_diagrams::field_indices::type& indices) const + { + using CleanField = + typename cxx_diagrams::fields::remove_lorentz_conjugation::type; + return mass_impl(indices); + } + template + double physical_mass(const typename cxx_diagrams::field_indices::type& indices) const + { + using CleanField = + typename cxx_diagrams::fields::remove_lorentz_conjugation::type; + return physical_mass_impl(indices); + } + + context_base(Standard_model const& m) : model(m) {} + context_base(Standard_model const* const m) : model(*m) {} + + context_base(const context_base&) = default; + context_base(context_base&&) = default; + + virtual ~context_base(void) = default; + + private: + template + double + mass_impl(const typename cxx_diagrams::field_indices::type& indices) const; + template + double physical_mass_impl(const typename cxx_diagrams::field_indices::type& indices) const; + }; + +template<> inline +double context_base::mass_impl(const std::array& indices) const +{ return model.get_MVG(); } + +template<> inline +double context_base::mass_impl(const std::array& indices) const +{ return model.get_MVG(); } + +template<> inline +double context_base::mass_impl(const std::array& indices) const +{ return model.get_MHp(); } + +template<> inline +double context_base::mass_impl(const std::array& indices) const +{ return model.get_MFv(indices[0]); } + +template<> inline +double context_base::mass_impl(const std::array& indices) const +{ return model.get_MAh(); } + +template<> inline +double context_base::mass_impl(const std::array& indices) const +{ return model.get_Mhh(); } + +template<> inline +double context_base::mass_impl(const std::array& indices) const +{ return model.get_MVP(); } + +template<> inline +double context_base::mass_impl(const std::array& indices) const +{ return model.get_MVZ(); } + +template<> inline +double context_base::mass_impl(const std::array& indices) const +{ return model.get_MVP(); } + +template<> inline +double context_base::mass_impl(const std::array& indices) const +{ return model.get_MVZ(); } + +template<> inline +double context_base::mass_impl(const std::array& indices) const +{ return model.get_MVWp(); } + +template<> inline +double context_base::mass_impl(const std::array& indices) const +{ return model.get_MVWp(); } + +template<> inline +double context_base::mass_impl(const std::array& indices) const +{ return model.get_MFd(indices[0]); } + +template<> inline +double context_base::mass_impl(const std::array& indices) const +{ return model.get_MFu(indices[0]); } + +template<> inline +double context_base::mass_impl(const std::array& indices) const +{ return model.get_MFe(indices[0]); } + +template<> inline +double context_base::mass_impl(const std::array& indices) const +{ return model.get_MVWp(); } + +template<> inline +double context_base::physical_mass_impl(const std::array& indices) const +{ return model.get_physical().MVG; } + +template<> inline +double context_base::physical_mass_impl(const std::array& indices) const +{ return model.get_physical().MVG; } + +template<> inline +double context_base::physical_mass_impl(const std::array& indices) const +{ return model.get_physical().MHp; } + +template<> inline +double context_base::physical_mass_impl(const std::array& indices) const +{ return model.get_physical().MFv[indices[0]]; } + +template<> inline +double context_base::physical_mass_impl(const std::array& indices) const +{ return model.get_physical().MAh; } + +template<> inline +double context_base::physical_mass_impl(const std::array& indices) const +{ return model.get_physical().Mhh; } + +template<> inline +double context_base::physical_mass_impl(const std::array& indices) const +{ return model.get_physical().MVP; } + +template<> inline +double context_base::physical_mass_impl(const std::array& indices) const +{ return model.get_physical().MVZ; } + +template<> inline +double context_base::physical_mass_impl(const std::array& indices) const +{ return model.get_physical().MVP; } + +template<> inline +double context_base::physical_mass_impl(const std::array& indices) const +{ return model.get_physical().MVZ; } + +template<> inline +double context_base::physical_mass_impl(const std::array& indices) const +{ return model.get_physical().MVWp; } + +template<> inline +double context_base::physical_mass_impl(const std::array& indices) const +{ return model.get_physical().MVWp; } + +template<> inline +double context_base::physical_mass_impl(const std::array& indices) const +{ return model.get_physical().MFd[indices[0]]; } + +template<> inline +double context_base::physical_mass_impl(const std::array& indices) const +{ return model.get_physical().MFu[indices[0]]; } + +template<> inline +double context_base::physical_mass_impl(const std::array& indices) const +{ return model.get_physical().MFe[indices[0]]; } + +template<> inline +double context_base::physical_mass_impl(const std::array& indices) const +{ return model.get_physical().MVWp; } + +} // namespace standard_model_cxx_diagrams +} // namespace flexiblesusy + +#include "standard_model_vertices.hpp" + +#endif diff --git a/model_specific/SM/cxx_qft/standard_model_fields.hpp b/model_specific/SM/cxx_qft/standard_model_fields.hpp new file mode 100644 index 0000000000..2e0974eeed --- /dev/null +++ b/model_specific/SM/cxx_qft/standard_model_fields.hpp @@ -0,0 +1,354 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + + +/** + * @file cxx_qft/SM_fields.hpp + * + * This file was generated with FlexibleSUSY 2.7.1 and SARAH 4.14.5 . + */ + +#ifndef STANDARDMODEL_CXXQFT_FIELDS_H +#define STANDARDMODEL_CXXQFT_FIELDS_H + +#include + +#include "cxx_qft/fields.hpp" + +namespace flexiblesusy { +namespace standard_model_cxx_diagrams::fields { + +using cxx_diagrams::fields::ParticleType; +using cxx_diagrams::fields::ParticleColorRep; +using cxx_diagrams::fields::conj; +using cxx_diagrams::fields::bar; + +struct VG { + static constexpr auto particleType = ParticleType::vector; + static constexpr auto colorRep = ParticleColorRep::octet; + static constexpr auto massless = true; + using index_bounds = boost::mpl::pair< + boost::mpl::vector_c, + boost::mpl::vector_c + >; + static constexpr int numberOfGenerations = 1; + using sm_flags = boost::mpl::vector_c; + static constexpr int numberOfFieldIndices = 0; + static constexpr double electricCharge = 0; + static constexpr auto pdgids = boost::hana::make_tuple(21); + using lorentz_conjugate = VG; +}; + +struct gG { + static constexpr auto particleType = ParticleType::ghost; + static constexpr auto colorRep = ParticleColorRep::octet; + static constexpr auto massless = true; + using index_bounds = boost::mpl::pair< + boost::mpl::vector_c, + boost::mpl::vector_c + >; + static constexpr int numberOfGenerations = 1; + using sm_flags = boost::mpl::vector_c; + static constexpr int numberOfFieldIndices = 0; + static constexpr double electricCharge = 0; + static constexpr auto pdgids = boost::hana::make_tuple(0); + using lorentz_conjugate = typename bar::type; +}; + +struct Hp { + static constexpr auto particleType = ParticleType::scalar; + static constexpr auto colorRep = ParticleColorRep::singlet; + static constexpr auto massless = false; + using index_bounds = boost::mpl::pair< + boost::mpl::vector_c, + boost::mpl::vector_c + >; + static constexpr int numberOfGenerations = 1; + using sm_flags = boost::mpl::vector_c; + static constexpr int numberOfFieldIndices = 0; + static constexpr double electricCharge = 1; + static constexpr auto pdgids = boost::hana::make_tuple(0); + using lorentz_conjugate = typename conj::type; +}; + +struct Fv { + static constexpr auto particleType = ParticleType::fermion; + static constexpr auto colorRep = ParticleColorRep::singlet; + static constexpr auto massless = true; + using index_bounds = boost::mpl::pair< + boost::mpl::vector_c, + boost::mpl::vector_c + >; + static constexpr int numberOfGenerations = 3; + using sm_flags = boost::mpl::vector_c; + static constexpr int numberOfFieldIndices = 1; + static constexpr double electricCharge = 0; + static constexpr auto pdgids = boost::hana::make_tuple(12,14,16); + using lorentz_conjugate = typename bar::type; +}; + +struct Ah { + static constexpr auto particleType = ParticleType::scalar; + static constexpr auto colorRep = ParticleColorRep::singlet; + static constexpr auto massless = false; + using index_bounds = boost::mpl::pair< + boost::mpl::vector_c, + boost::mpl::vector_c + >; + static constexpr int numberOfGenerations = 1; + using sm_flags = boost::mpl::vector_c; + static constexpr int numberOfFieldIndices = 0; + static constexpr double electricCharge = 0; + static constexpr auto pdgids = boost::hana::make_tuple(0); + using lorentz_conjugate = Ah; +}; + +struct hh { + static constexpr auto particleType = ParticleType::scalar; + static constexpr auto colorRep = ParticleColorRep::singlet; + static constexpr auto massless = false; + using index_bounds = boost::mpl::pair< + boost::mpl::vector_c, + boost::mpl::vector_c + >; + static constexpr int numberOfGenerations = 1; + using sm_flags = boost::mpl::vector_c; + static constexpr int numberOfFieldIndices = 0; + static constexpr double electricCharge = 0; + static constexpr auto pdgids = boost::hana::make_tuple(25); + using lorentz_conjugate = hh; +}; + +struct VP { + static constexpr auto particleType = ParticleType::vector; + static constexpr auto colorRep = ParticleColorRep::singlet; + static constexpr auto massless = true; + using index_bounds = boost::mpl::pair< + boost::mpl::vector_c, + boost::mpl::vector_c + >; + static constexpr int numberOfGenerations = 1; + using sm_flags = boost::mpl::vector_c; + static constexpr int numberOfFieldIndices = 0; + static constexpr double electricCharge = 0; + static constexpr auto pdgids = boost::hana::make_tuple(22); + using lorentz_conjugate = VP; +}; + +struct VZ { + static constexpr auto particleType = ParticleType::vector; + static constexpr auto colorRep = ParticleColorRep::singlet; + static constexpr auto massless = false; + using index_bounds = boost::mpl::pair< + boost::mpl::vector_c, + boost::mpl::vector_c + >; + static constexpr int numberOfGenerations = 1; + using sm_flags = boost::mpl::vector_c; + static constexpr int numberOfFieldIndices = 0; + static constexpr double electricCharge = 0; + static constexpr auto pdgids = boost::hana::make_tuple(23); + using lorentz_conjugate = VZ; +}; + +struct gP { + static constexpr auto particleType = ParticleType::ghost; + static constexpr auto colorRep = ParticleColorRep::singlet; + static constexpr auto massless = true; + using index_bounds = boost::mpl::pair< + boost::mpl::vector_c, + boost::mpl::vector_c + >; + static constexpr int numberOfGenerations = 1; + using sm_flags = boost::mpl::vector_c; + static constexpr int numberOfFieldIndices = 0; + static constexpr double electricCharge = 0; + static constexpr auto pdgids = boost::hana::make_tuple(0); + using lorentz_conjugate = typename bar::type; +}; + +struct gZ { + static constexpr auto particleType = ParticleType::ghost; + static constexpr auto colorRep = ParticleColorRep::singlet; + static constexpr auto massless = false; + using index_bounds = boost::mpl::pair< + boost::mpl::vector_c, + boost::mpl::vector_c + >; + static constexpr int numberOfGenerations = 1; + using sm_flags = boost::mpl::vector_c; + static constexpr int numberOfFieldIndices = 0; + static constexpr double electricCharge = 0; + static constexpr auto pdgids = boost::hana::make_tuple(0); + using lorentz_conjugate = typename bar::type; +}; + +struct gWp { + static constexpr auto particleType = ParticleType::ghost; + static constexpr auto colorRep = ParticleColorRep::singlet; + static constexpr auto massless = false; + using index_bounds = boost::mpl::pair< + boost::mpl::vector_c, + boost::mpl::vector_c + >; + static constexpr int numberOfGenerations = 1; + using sm_flags = boost::mpl::vector_c; + static constexpr int numberOfFieldIndices = 0; + static constexpr double electricCharge = 1; + static constexpr auto pdgids = boost::hana::make_tuple(0); + using lorentz_conjugate = typename bar::type; +}; + +struct gWpC { + static constexpr auto particleType = ParticleType::ghost; + static constexpr auto colorRep = ParticleColorRep::singlet; + static constexpr auto massless = false; + using index_bounds = boost::mpl::pair< + boost::mpl::vector_c, + boost::mpl::vector_c + >; + static constexpr int numberOfGenerations = 1; + using sm_flags = boost::mpl::vector_c; + static constexpr int numberOfFieldIndices = 0; + static constexpr double electricCharge = -1; + static constexpr auto pdgids = boost::hana::make_tuple(0); + using lorentz_conjugate = typename bar::type; +}; + +struct Fd { + static constexpr auto particleType = ParticleType::fermion; + static constexpr auto colorRep = ParticleColorRep::triplet; + static constexpr auto massless = false; + using index_bounds = boost::mpl::pair< + boost::mpl::vector_c, + boost::mpl::vector_c + >; + static constexpr int numberOfGenerations = 3; + using sm_flags = boost::mpl::vector_c; + static constexpr int numberOfFieldIndices = 1; + static constexpr double electricCharge = -0.3333333333333333; + static constexpr auto pdgids = boost::hana::make_tuple(1,3,5); + using lorentz_conjugate = typename bar::type; +}; + +struct Fu { + static constexpr auto particleType = ParticleType::fermion; + static constexpr auto colorRep = ParticleColorRep::triplet; + static constexpr auto massless = false; + using index_bounds = boost::mpl::pair< + boost::mpl::vector_c, + boost::mpl::vector_c + >; + static constexpr int numberOfGenerations = 3; + using sm_flags = boost::mpl::vector_c; + static constexpr int numberOfFieldIndices = 1; + static constexpr double electricCharge = 0.6666666666666666; + static constexpr auto pdgids = boost::hana::make_tuple(2,4,6); + using lorentz_conjugate = typename bar::type; +}; + +struct Fe { + static constexpr auto particleType = ParticleType::fermion; + static constexpr auto colorRep = ParticleColorRep::singlet; + static constexpr auto massless = false; + using index_bounds = boost::mpl::pair< + boost::mpl::vector_c, + boost::mpl::vector_c + >; + static constexpr int numberOfGenerations = 3; + using sm_flags = boost::mpl::vector_c; + static constexpr int numberOfFieldIndices = 1; + static constexpr double electricCharge = -1; + static constexpr auto pdgids = boost::hana::make_tuple(11,13,15); + using lorentz_conjugate = typename bar::type; +}; + +struct VWp { + static constexpr auto particleType = ParticleType::vector; + static constexpr auto colorRep = ParticleColorRep::singlet; + static constexpr auto massless = false; + using index_bounds = boost::mpl::pair< + boost::mpl::vector_c, + boost::mpl::vector_c + >; + static constexpr int numberOfGenerations = 1; + using sm_flags = boost::mpl::vector_c; + static constexpr int numberOfFieldIndices = 0; + static constexpr double electricCharge = 1; + static constexpr auto pdgids = boost::hana::make_tuple(24); + using lorentz_conjugate = typename conj::type; +}; + +// Named fields +using Electron = Fe; + +using scalars = boost::mpl::vector; +using fermions = boost::mpl::vector; +using vectors = boost::mpl::vector; +using ghosts = boost::mpl::vector; + +} // namespace standard_model_cxx_diagrams::fields + +namespace cxx_diagrams::fields{ + +// Fields that are their own Lorentz conjugates. +template<> struct conj { using type = standard_model_cxx_diagrams::fields::VG; }; +template<> struct conj { using type = standard_model_cxx_diagrams::fields::Ah; }; +template<> struct conj { using type = standard_model_cxx_diagrams::fields::hh; }; +template<> struct conj { using type = standard_model_cxx_diagrams::fields::VP; }; +template<> struct conj { using type = standard_model_cxx_diagrams::fields::VZ; }; + +template<> +struct is_vector : public std::true_type {}; +template<> +struct is_ghost : public std::true_type {}; +template<> +struct is_scalar : public std::true_type {}; +template<> +struct is_fermion : public std::true_type {}; +template<> +struct is_scalar : public std::true_type {}; +template<> +struct is_scalar : public std::true_type {}; +template<> +struct is_vector : public std::true_type {}; +template<> +struct is_vector : public std::true_type {}; +template<> +struct is_ghost : public std::true_type {}; +template<> +struct is_ghost : public std::true_type {}; +template<> +struct is_ghost : public std::true_type {}; +template<> +struct is_ghost : public std::true_type {}; +template<> +struct is_fermion : public std::true_type {}; +template<> +struct is_fermion : public std::true_type {}; +template<> +struct is_fermion : public std::true_type {}; +template<> +struct is_vector : public std::true_type {}; + + +} // namespace cxx_diagrams::fields + +} // namespace flexiblesusy + +#endif diff --git a/model_specific/SM/cxx_qft/standard_model_particle_aliases.hpp b/model_specific/SM/cxx_qft/standard_model_particle_aliases.hpp new file mode 100644 index 0000000000..586262d2c7 --- /dev/null +++ b/model_specific/SM/cxx_qft/standard_model_particle_aliases.hpp @@ -0,0 +1,41 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + + +/** + * @file standard_model_particle_aliases.hpp + * + * This file was generated with FlexibleSUSY @FlexibleSUSYVersion@ and SARAH @SARAHVersion@ . + */ + +#include "cxx_qft/standard_model_fields.hpp" + +namespace flexiblesusy::standard_model_cxx_diagrams::fields { + +using Higgs = hh; +using WpBoson = VWp; +using WmBoson = typename conj::type; +using Photon = VP; +using ZBoson = VZ; +using Gluon = VG; +using ChargedLepton = Fe; +using Neutrino = Fv; +using UpTypeQuark = Fu; +using DownTypeQuark = Fd; + +} diff --git a/model_specific/SM/cxx_qft/standard_model_qft.hpp b/model_specific/SM/cxx_qft/standard_model_qft.hpp new file mode 100644 index 0000000000..ef679bbb77 --- /dev/null +++ b/model_specific/SM/cxx_qft/standard_model_qft.hpp @@ -0,0 +1,35 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + + +/** + * @file cxx_qft/SM_qft.hpp + * + * This file was generated with FlexibleSUSY 2.7.1 and SARAH 4.14.5 . + */ + +#ifndef STANDARDMODEL_CXXQFT_QFT_H +#define STANDARDMODEL_CXXQFT_QFT_H + +#include "multiindex.hpp" + +#include "standard_model_context_base.hpp" +#include "standard_model_fields.hpp" +#include "standard_model_vertices.hpp" + +#endif diff --git a/model_specific/SM/cxx_qft/standard_model_vertices.cpp b/model_specific/SM/cxx_qft/standard_model_vertices.cpp new file mode 100644 index 0000000000..b149d3ab3e --- /dev/null +++ b/model_specific/SM/cxx_qft/standard_model_vertices.cpp @@ -0,0 +1,1388 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + + +/** + * @file cxx_qft/SM_vertices.cpp + * + * This file was generated with FlexibleSUSY 2.7.1 and SARAH 4.14.5 . + */ + +#include "standard_model_context_base.hpp" +#include "standard_model_vertices.hpp" + +#include "concatenate.hpp" +#include "wrappers.hpp" + +#define MODELPARAMETER(p) context.model.get_##p() +#define DERIVEDPARAMETER(p) context.model.p() + +namespace flexiblesusy { +namespace standard_model_cxx_diagrams { +namespace detail { + +cxx_diagrams::ChiralVertex unit_charge(const context_base& context) +{ + std::array electron_indices = { 0 }; + std::array photon_indices = {}; + std::array indices = concatenate(photon_indices, electron_indices, electron_indices); + + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex left = 0.5*KroneckerDelta(gt1,gt2)*(0.7745966692414834*g1*Cos(ThetaW) + g2*Sin(ThetaW)); + + const std::complex right = 0.7745966692414834*g1*Cos(ThetaW)*KroneckerDelta(gt1,gt2); + + return {left, right}; +} + +cxx_diagrams::ScalarVertex VertexImpl::evaluate( + const std::array& indices, const context_base& context) +{ + const auto Lambdax = MODELPARAMETER(Lambdax); + + const std::complex result = -Lambdax; + + return {result}; +} + +cxx_diagrams::ScalarVertex VertexImpl::evaluate( + const std::array& indices, const context_base& context) +{ + const auto v = MODELPARAMETER(v); + const auto Lambdax = MODELPARAMETER(Lambdax); + + const std::complex result = -(v*Lambdax); + + return {result}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto g1 = MODELPARAMETER(g1); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.5*Sqr(g2*Cos(ThetaW) + 0.7745966692414834*g1*Sin(ThetaW)); + + return {result}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VWp>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + + const std::complex result = 0.5*Sqr(g2); + + return {result}; +} + +cxx_diagrams::MomentumDifferenceVertex VertexImpl::evaluate( + const std::array& indices, const context_base& context) +{ + int minuend_index = 0; + int subtrahend_index = 1; + + const auto g2 = MODELPARAMETER(g2); + const auto g1 = MODELPARAMETER(g1); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = std::complex(0,0.1)*(5*g2*Cos(ThetaW) + 3.872983346207417*g1*Sin(ThetaW)); + + return {result, minuend_index, subtrahend_index}; +} + +cxx_diagrams::MomentumDifferenceVertex VertexImpl::type>::evaluate( + const std::array& indices, const context_base& context) +{ + int minuend_index = 0; + int subtrahend_index = 1; + + const auto g2 = MODELPARAMETER(g2); + + const std::complex result = std::complex(0,-0.5)*g2; + + return {result, minuend_index, subtrahend_index}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fd>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto Yd = MODELPARAMETER(Yd); + const auto Vd = MODELPARAMETER(Vd); + const auto Ud = MODELPARAMETER(Ud); + + const std::complex left = std::complex(0.,0.7071067811865475)*SUM(j2,0,2,Conj(Vd(gt2,j2))*SUM(j1,0,2,Conj(Ud(gt1,j1))*Yd(j1,j2))); + + const std::complex right = std::complex(0.,-0.7071067811865475)*SUM(j2,0,2,SUM(j1,0,2,Conj(Yd(j1,j2))*Ud(gt2,j1))*Vd(gt1,j2)); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fe>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto Ye = MODELPARAMETER(Ye); + const auto Ve = MODELPARAMETER(Ve); + const auto Ue = MODELPARAMETER(Ue); + + const std::complex left = std::complex(0.,0.7071067811865475)*SUM(j2,0,2,Conj(Ve(gt2,j2))*SUM(j1,0,2,Conj(Ue(gt1,j1))*Ye(j1,j2))); + + const std::complex right = std::complex(0.,-0.7071067811865475)*SUM(j2,0,2,SUM(j1,0,2,Conj(Ye(j1,j2))*Ue(gt2,j1))*Ve(gt1,j2)); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fu>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto Yu = -MODELPARAMETER(Yu); + const auto Vu = MODELPARAMETER(Vu); + const auto Uu = MODELPARAMETER(Uu); + + const std::complex left = std::complex(0.,-0.7071067811865475)*SUM(j2,0,2,Conj(Vu(gt2,j2))*SUM(j1,0,2,Conj(Uu(gt1,j1))*Yu(j1,j2))); + + const std::complex right = std::complex(0.,0.7071067811865475)*SUM(j2,0,2,SUM(j1,0,2,Conj(Yu(j1,j2))*Uu(gt2,j1))*Vu(gt1,j2)); + + return {left, right}; +} + +cxx_diagrams::MomentumDifferenceVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VWp>::evaluate( + const std::array& indices, const context_base& context) +{ + int minuend_index = 0; + int subtrahend_index = 1; + + const auto g2 = MODELPARAMETER(g2); + + const std::complex result = std::complex(0,-0.5)*g2; + + return {result, minuend_index, subtrahend_index}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VP>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt2 = indices[0]; + const int gt1 = indices[1]; + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex left = -0.7745966692414834*g1*Cos(ThetaW)*KroneckerDelta(gt1,gt2); + + const std::complex right = -0.5*KroneckerDelta(gt1,gt2)*(0.7745966692414834*g1*Cos(ThetaW) + g2*Sin(ThetaW)); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VZ>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt2 = indices[0]; + const int gt1 = indices[1]; + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex left = 0.7745966692414834*g1*KroneckerDelta(gt1,gt2)*Sin(ThetaW); + + const std::complex right = 0.1*KroneckerDelta(gt1,gt2)*(-5*g2*Cos(ThetaW) + 3.872983346207417*g1*Sin(ThetaW)); + + return {left, right}; +} + +cxx_diagrams::ScalarVertex VertexImpl::evaluate( + const std::array& indices, const context_base& context) +{ + const auto Lambdax = MODELPARAMETER(Lambdax); + + const std::complex result = -3*Lambdax; + + return {result}; +} + +cxx_diagrams::ScalarVertex VertexImpl::evaluate( + const std::array& indices, const context_base& context) +{ + const auto v = MODELPARAMETER(v); + const auto Lambdax = MODELPARAMETER(Lambdax); + + const std::complex result = -3*v*Lambdax; + + return {result}; +} + +cxx_diagrams::ScalarVertex VertexImpl::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto Lambdax = MODELPARAMETER(Lambdax); + + const std::complex result = -Lambdax; + + return {result}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto g1 = MODELPARAMETER(g1); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.5*Sqr(g2*Cos(ThetaW) + 0.7745966692414834*g1*Sin(ThetaW)); + + return {result}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VWp>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + + const std::complex result = 0.5*Sqr(g2); + + return {result}; +} + +cxx_diagrams::ScalarVertex VertexImpl::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto v = MODELPARAMETER(v); + const auto Lambdax = MODELPARAMETER(Lambdax); + + const std::complex result = -(v*Lambdax); + + return {result}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VP>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.3872983346207417*g1*g2*Cos(ThetaW); + + return {result}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VZ>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = -0.3872983346207417*g1*g2*Sin(ThetaW); + + return {result}; +} + +cxx_diagrams::MomentumDifferenceVertex VertexImpl::type>::evaluate( + const std::array& indices, const context_base& context) +{ + int minuend_index = 0; + int subtrahend_index = 1; + + const auto g2 = MODELPARAMETER(g2); + + const std::complex result = 0.5*g2; + + return {result, minuend_index, subtrahend_index}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto v = MODELPARAMETER(v); + + const std::complex result = 0.5*v*Sqr(g2); + + return {result}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::evaluate( + const std::array& indices, const context_base& context) +{ + const auto v = MODELPARAMETER(v); + const auto g2 = MODELPARAMETER(g2); + const auto g1 = MODELPARAMETER(g1); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.5*v*Sqr(g2*Cos(ThetaW) + 0.7745966692414834*g1*Sin(ThetaW)); + + return {result}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fd>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto Yd = MODELPARAMETER(Yd); + const auto Vd = MODELPARAMETER(Vd); + const auto Ud = MODELPARAMETER(Ud); + + const std::complex left = -0.7071067811865475*SUM(j2,0,2,Conj(Vd(gt2,j2))*SUM(j1,0,2,Conj(Ud(gt1,j1))*Yd(j1,j2))); + + const std::complex right = -0.7071067811865475*SUM(j2,0,2,SUM(j1,0,2,Conj(Yd(j1,j2))*Ud(gt2,j1))*Vd(gt1,j2)); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fe>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto Ye = MODELPARAMETER(Ye); + const auto Ve = MODELPARAMETER(Ve); + const auto Ue = MODELPARAMETER(Ue); + + const std::complex left = -0.7071067811865475*SUM(j2,0,2,Conj(Ve(gt2,j2))*SUM(j1,0,2,Conj(Ue(gt1,j1))*Ye(j1,j2))); + + const std::complex right = -0.7071067811865475*SUM(j2,0,2,SUM(j1,0,2,Conj(Ye(j1,j2))*Ue(gt2,j1))*Ve(gt1,j2)); + + return {left, right}; +} + +cxx_diagrams::ScalarVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Hp>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto v = MODELPARAMETER(v); + const auto Lambdax = MODELPARAMETER(Lambdax); + + const std::complex result = -(v*Lambdax); + + return {result}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VP, standard_model_cxx_diagrams::fields::VWp>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.3872983346207417*g1*g2*Cos(ThetaW); + + return {result}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VWp, standard_model_cxx_diagrams::fields::VZ>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = -0.3872983346207417*g1*g2*Sin(ThetaW); + + return {result}; +} + +cxx_diagrams::MomentumDifferenceVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VWp>::evaluate( + const std::array& indices, const context_base& context) +{ + int minuend_index = 0; + int subtrahend_index = 1; + + const auto g2 = MODELPARAMETER(g2); + + const std::complex result = -0.5*g2; + + return {result, minuend_index, subtrahend_index}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VWp>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto v = MODELPARAMETER(v); + + const std::complex result = 0.5*v*Sqr(g2); + + return {result}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VP, standard_model_cxx_diagrams::fields::VP>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.5*Sqr(0.7745966692414834*g1*Cos(ThetaW) + g2*Sin(ThetaW)); + + return {result}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VP, standard_model_cxx_diagrams::fields::VZ>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.05*(7.745966692414834*g1*g2*Cos(2*ThetaW) + Sin(2*ThetaW)*(-3*Sqr(g1) + 5*Sqr(g2))); + + return {result}; +} + +cxx_diagrams::MomentumDifferenceVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VP>::evaluate( + const std::array& indices, const context_base& context) +{ + int minuend_index = 0; + int subtrahend_index = 1; + + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.1*(-3.872983346207417*g1*Cos(ThetaW) - 5*g2*Sin(ThetaW)); + + return {result, minuend_index, subtrahend_index}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VZ, standard_model_cxx_diagrams::fields::VZ>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto g1 = MODELPARAMETER(g1); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.5*Sqr(g2*Cos(ThetaW) - 0.7745966692414834*g1*Sin(ThetaW)); + + return {result}; +} + +cxx_diagrams::MomentumDifferenceVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VZ>::evaluate( + const std::array& indices, const context_base& context) +{ + int minuend_index = 0; + int subtrahend_index = 1; + + const auto g2 = MODELPARAMETER(g2); + const auto g1 = MODELPARAMETER(g1); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.1*(-5*g2*Cos(ThetaW) + 3.872983346207417*g1*Sin(ThetaW)); + + return {result, minuend_index, subtrahend_index}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::type, typename standard_model_cxx_diagrams::fields::conj::type, standard_model_cxx_diagrams::fields::VWp>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + + const std::complex result = 0.5*Sqr(g2); + + return {result}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VP>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto v = MODELPARAMETER(v); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.3872983346207417*g1*g2*v*Cos(ThetaW); + + return {result}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VZ>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto v = MODELPARAMETER(v); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = -0.3872983346207417*g1*g2*v*Sin(ThetaW); + + return {result}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt2 = indices[0]; + const int gt1 = indices[1]; + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex left = -0.2581988897471611*g1*Cos(ThetaW)*KroneckerDelta(gt1,gt2); + + const std::complex right = 0.16666666666666666*KroneckerDelta(gt1,gt2)*(0.7745966692414834*g1*Cos(ThetaW) - 3*g2*Sin(ThetaW)); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt2 = indices[0]; + const int gt1 = indices[1]; + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex left = -0.7745966692414834*g1*Cos(ThetaW)*KroneckerDelta(gt1,gt2); + + const std::complex right = -0.5*KroneckerDelta(gt1,gt2)*(0.7745966692414834*g1*Cos(ThetaW) + g2*Sin(ThetaW)); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt2 = indices[0]; + const int gt1 = indices[1]; + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex left = 0.5163977794943222*g1*Cos(ThetaW)*KroneckerDelta(gt1,gt2); + + const std::complex right = 0.16666666666666666*KroneckerDelta(gt1,gt2)*(0.7745966692414834*g1*Cos(ThetaW) + 3*g2*Sin(ThetaW)); + + return {left, right}; +} + +cxx_diagrams::MomentumDifferenceVertex VertexImpl::type>::evaluate( + const std::array& indices, const context_base& context) +{ + int minuend_index = 1; + int subtrahend_index = 2; + + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.1*(-3.872983346207417*g1*Cos(ThetaW) - 5*g2*Sin(ThetaW)); + + return {result, minuend_index, subtrahend_index}; +} + +cxx_diagrams::TripleVectorVertex VertexImpl::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = -(g2*Sin(ThetaW)); + + return {result, cxx_diagrams::TripleVectorVertex::odd_permutation{}}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt2 = indices[0]; + const int gt1 = indices[1]; + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex left = 0.2581988897471611*g1*KroneckerDelta(gt1,gt2)*Sin(ThetaW); + + const std::complex right = -0.16666666666666666*KroneckerDelta(gt1,gt2)*(3*g2*Cos(ThetaW) + 0.7745966692414834*g1*Sin(ThetaW)); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt2 = indices[0]; + const int gt1 = indices[1]; + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex left = 0.7745966692414834*g1*KroneckerDelta(gt1,gt2)*Sin(ThetaW); + + const std::complex right = 0.1*KroneckerDelta(gt1,gt2)*(-5*g2*Cos(ThetaW) + 3.872983346207417*g1*Sin(ThetaW)); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt2 = indices[0]; + const int gt1 = indices[1]; + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex left = -0.5163977794943222*g1*KroneckerDelta(gt1,gt2)*Sin(ThetaW); + + const std::complex right = 0.16666666666666666*KroneckerDelta(gt1,gt2)*(3*g2*Cos(ThetaW) - 0.7745966692414834*g1*Sin(ThetaW)); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fd, standard_model_cxx_diagrams::fields::hh>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto Yd = MODELPARAMETER(Yd); + const auto Vd = MODELPARAMETER(Vd); + const auto Ud = MODELPARAMETER(Ud); + + const std::complex left = -0.7071067811865475*SUM(j2,0,2,Conj(Vd(gt2,j2))*SUM(j1,0,2,Conj(Ud(gt1,j1))*Yd(j1,j2))); + + const std::complex right = -0.7071067811865475*SUM(j2,0,2,SUM(j1,0,2,Conj(Yd(j1,j2))*Ud(gt2,j1))*Vd(gt1,j2)); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fd, standard_model_cxx_diagrams::fields::VG>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto g3 = MODELPARAMETER(g3); + + const std::complex left = -0.5*g3*KroneckerDelta(gt1,gt2); + + const std::complex right = -0.5*g3*KroneckerDelta(gt1,gt2); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fd, standard_model_cxx_diagrams::fields::VP>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex left = -0.16666666666666666*KroneckerDelta(gt1,gt2)*(0.7745966692414834*g1*Cos(ThetaW) - 3*g2*Sin(ThetaW)); + + const std::complex right = 0.2581988897471611*g1*Cos(ThetaW)*KroneckerDelta(gt1,gt2); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fd, standard_model_cxx_diagrams::fields::VZ>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto g2 = MODELPARAMETER(g2); + const auto g1 = MODELPARAMETER(g1); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex left = 0.16666666666666666*KroneckerDelta(gt1,gt2)*(3*g2*Cos(ThetaW) + 0.7745966692414834*g1*Sin(ThetaW)); + + const std::complex right = -0.2581988897471611*g1*KroneckerDelta(gt1,gt2)*Sin(ThetaW); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fu, typename standard_model_cxx_diagrams::fields::conj::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto Yd = MODELPARAMETER(Yd); + const auto Yu = -MODELPARAMETER(Yu); + const auto Vu = MODELPARAMETER(Vu); + const auto Ud = MODELPARAMETER(Ud); + const auto Uu = MODELPARAMETER(Uu); + const auto Vd = MODELPARAMETER(Vd); + + const std::complex left = -SUM(j2,0,2,Conj(Vu(gt2,j2))*SUM(j1,0,2,Conj(Ud(gt1,j1))*Yd(j1,j2))); + + const std::complex right = SUM(j2,0,2,SUM(j1,0,2,Conj(Yu(j1,j2))*Uu(gt2,j1))*Vd(gt1,j2)); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fu, typename standard_model_cxx_diagrams::fields::conj::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto g2 = MODELPARAMETER(g2); + const auto Vu = MODELPARAMETER(Vu); + const auto Vd = MODELPARAMETER(Vd); + + const std::complex left = -0.7071067811865475*g2*SUM(j1,0,2,Conj(Vu(gt2,j1))*Vd(gt1,j1)); + + const std::complex right = 0; + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fe, standard_model_cxx_diagrams::fields::hh>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto Ye = MODELPARAMETER(Ye); + const auto Ve = MODELPARAMETER(Ve); + const auto Ue = MODELPARAMETER(Ue); + + const std::complex left = -0.7071067811865475*SUM(j2,0,2,Conj(Ve(gt2,j2))*SUM(j1,0,2,Conj(Ue(gt1,j1))*Ye(j1,j2))); + + const std::complex right = -0.7071067811865475*SUM(j2,0,2,SUM(j1,0,2,Conj(Ye(j1,j2))*Ue(gt2,j1))*Ve(gt1,j2)); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fe, standard_model_cxx_diagrams::fields::VP>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex left = 0.5*KroneckerDelta(gt1,gt2)*(0.7745966692414834*g1*Cos(ThetaW) + g2*Sin(ThetaW)); + + const std::complex right = 0.7745966692414834*g1*Cos(ThetaW)*KroneckerDelta(gt1,gt2); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fe, standard_model_cxx_diagrams::fields::VZ>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto g2 = MODELPARAMETER(g2); + const auto g1 = MODELPARAMETER(g1); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex left = 0.5*KroneckerDelta(gt1,gt2)*(g2*Cos(ThetaW) - 0.7745966692414834*g1*Sin(ThetaW)); + + const std::complex right = -0.7745966692414834*g1*KroneckerDelta(gt1,gt2)*Sin(ThetaW); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fv, typename standard_model_cxx_diagrams::fields::conj::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto Ye = MODELPARAMETER(Ye); + const auto Ue = MODELPARAMETER(Ue); + + const std::complex left = -SUM(j1,0,2,Conj(Ue(gt1,j1))*Ye(j1,gt2)); + + const std::complex right = 0; + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fv, typename standard_model_cxx_diagrams::fields::conj::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto g2 = MODELPARAMETER(g2); + const auto Ve = MODELPARAMETER(Ve); + + const std::complex left = IF(gt2 < 3,-0.7071067811865475*g2*Ve(gt1,gt2),0); + + const std::complex right = 0; + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, typename standard_model_cxx_diagrams::fields::conj::type, standard_model_cxx_diagrams::fields::Fv>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto Ye = MODELPARAMETER(Ye); + const auto Ue = MODELPARAMETER(Ue); + + const std::complex left = -SUM(j1,0,2,Conj(Ue(gt1,j1))*Ye(j1,gt2)); + + const std::complex right = 0; + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fd, standard_model_cxx_diagrams::fields::Hp>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto Yu = -MODELPARAMETER(Yu); + const auto Yd = MODELPARAMETER(Yd); + const auto Vd = MODELPARAMETER(Vd); + const auto Uu = MODELPARAMETER(Uu); + const auto Ud = MODELPARAMETER(Ud); + const auto Vu = MODELPARAMETER(Vu); + + const std::complex left = SUM(j2,0,2,Conj(Vd(gt2,j2))*SUM(j1,0,2,Conj(Uu(gt1,j1))*Yu(j1,j2))); + + const std::complex right = -SUM(j2,0,2,SUM(j1,0,2,Conj(Yd(j1,j2))*Ud(gt2,j1))*Vu(gt1,j2)); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fd, standard_model_cxx_diagrams::fields::VWp>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto g2 = MODELPARAMETER(g2); + const auto Vd = MODELPARAMETER(Vd); + const auto Vu = MODELPARAMETER(Vu); + + const std::complex left = -0.7071067811865475*g2*SUM(j1,0,2,Conj(Vd(gt2,j1))*Vu(gt1,j1)); + + const std::complex right = 0; + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fu, standard_model_cxx_diagrams::fields::hh>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto Yu = -MODELPARAMETER(Yu); + const auto Vu = MODELPARAMETER(Vu); + const auto Uu = MODELPARAMETER(Uu); + + const std::complex left = -0.7071067811865475*SUM(j2,0,2,Conj(Vu(gt2,j2))*SUM(j1,0,2,Conj(Uu(gt1,j1))*Yu(j1,j2))); + + const std::complex right = -0.7071067811865475*SUM(j2,0,2,SUM(j1,0,2,Conj(Yu(j1,j2))*Uu(gt2,j1))*Vu(gt1,j2)); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fu, standard_model_cxx_diagrams::fields::VG>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto g3 = MODELPARAMETER(g3); + + const std::complex left = -0.5*g3*KroneckerDelta(gt1,gt2); + + const std::complex right = -0.5*g3*KroneckerDelta(gt1,gt2); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fu, standard_model_cxx_diagrams::fields::VP>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex left = -0.16666666666666666*KroneckerDelta(gt1,gt2)*(0.7745966692414834*g1*Cos(ThetaW) + 3*g2*Sin(ThetaW)); + + const std::complex right = -0.5163977794943222*g1*Cos(ThetaW)*KroneckerDelta(gt1,gt2); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fu, standard_model_cxx_diagrams::fields::VZ>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto g2 = MODELPARAMETER(g2); + const auto g1 = MODELPARAMETER(g1); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex left = 0.03333333333333333*KroneckerDelta(gt1,gt2)*(-15*g2*Cos(ThetaW) + 3.872983346207417*g1*Sin(ThetaW)); + + const std::complex right = 0.5163977794943222*g1*KroneckerDelta(gt1,gt2)*Sin(ThetaW); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fe, standard_model_cxx_diagrams::fields::Hp>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto Ye = MODELPARAMETER(Ye); + const auto Ue = MODELPARAMETER(Ue); + + const std::complex left = 0; + + const std::complex right = -SUM(j1,0,2,Conj(Ye(j1,gt1))*Ue(gt2,j1)); + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fe, standard_model_cxx_diagrams::fields::VWp>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto g2 = MODELPARAMETER(g2); + const auto Ve = MODELPARAMETER(Ve); + + const std::complex left = IF(gt1 < 3,-0.7071067811865475*g2*Conj(Ve(gt2,gt1)),0); + + const std::complex right = 0; + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Fv, standard_model_cxx_diagrams::fields::VZ>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto g2 = MODELPARAMETER(g2); + const auto g1 = MODELPARAMETER(g1); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex left = -0.5*KroneckerDelta(gt1,gt2)*(g2*Cos(ThetaW) + 0.7745966692414834*g1*Sin(ThetaW)); + + const std::complex right = 0; + + return {left, right}; +} + +cxx_diagrams::ChiralVertex VertexImpl::type, standard_model_cxx_diagrams::fields::Hp, standard_model_cxx_diagrams::fields::Fe>::evaluate( + const std::array& indices, const context_base& context) +{ + const int gt1 = indices[0]; + const int gt2 = indices[1]; + const auto Ye = MODELPARAMETER(Ye); + const auto Ue = MODELPARAMETER(Ue); + + const std::complex left = 0; + + const std::complex right = -SUM(j1,0,2,Conj(Ye(j1,gt1))*Ue(gt2,j1)); + + return {left, right}; +} + +cxx_diagrams::MomentumVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gWpC, standard_model_cxx_diagrams::fields::VWp>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = g2*Sin(ThetaW); + + return {result, 1}; +} + +cxx_diagrams::MomentumVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gWp, typename standard_model_cxx_diagrams::fields::conj::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = -(g2*Sin(ThetaW)); + + return {result, 1}; +} + +cxx_diagrams::ScalarVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gP, typename standard_model_cxx_diagrams::fields::conj::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto v = MODELPARAMETER(v); + const auto g1 = MODELPARAMETER(g1); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = -0.25*g2*v*(0.7745966692414834*g1*Cos(ThetaW) + g2*Sin(ThetaW)); + + return {result}; +} + +cxx_diagrams::MomentumVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gP, typename standard_model_cxx_diagrams::fields::conj::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = g2*Sin(ThetaW); + + return {result, 1}; +} + +cxx_diagrams::ScalarVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gWpC, standard_model_cxx_diagrams::fields::hh>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto v = MODELPARAMETER(v); + + const std::complex result = -0.25*v*Sqr(g2); + + return {result}; +} + +cxx_diagrams::MomentumVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gWpC, standard_model_cxx_diagrams::fields::VP>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = -(g2*Sin(ThetaW)); + + return {result, 1}; +} + +cxx_diagrams::MomentumVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gWpC, standard_model_cxx_diagrams::fields::VZ>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = -(g2*Cos(ThetaW)); + + return {result, 1}; +} + +cxx_diagrams::ScalarVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gZ, typename standard_model_cxx_diagrams::fields::conj::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto v = MODELPARAMETER(v); + const auto g1 = MODELPARAMETER(g1); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.05*g2*v*(-5*g2*Cos(ThetaW) + 3.872983346207417*g1*Sin(ThetaW)); + + return {result}; +} + +cxx_diagrams::MomentumVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gZ, typename standard_model_cxx_diagrams::fields::conj::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = g2*Cos(ThetaW); + + return {result, 1}; +} + +cxx_diagrams::ScalarVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gP, standard_model_cxx_diagrams::fields::Hp>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto v = MODELPARAMETER(v); + const auto g1 = MODELPARAMETER(g1); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = -0.25*g2*v*(0.7745966692414834*g1*Cos(ThetaW) + g2*Sin(ThetaW)); + + return {result}; +} + +cxx_diagrams::MomentumVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gP, standard_model_cxx_diagrams::fields::VWp>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = -(g2*Sin(ThetaW)); + + return {result, 1}; +} + +cxx_diagrams::ScalarVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gWp, standard_model_cxx_diagrams::fields::Ah>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto v = MODELPARAMETER(v); + + const std::complex result = std::complex(0,-0.25)*v*Sqr(g2); + + return {result}; +} + +cxx_diagrams::ScalarVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gWp, standard_model_cxx_diagrams::fields::hh>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto v = MODELPARAMETER(v); + + const std::complex result = -0.25*v*Sqr(g2); + + return {result}; +} + +cxx_diagrams::MomentumVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gWp, standard_model_cxx_diagrams::fields::VP>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = g2*Sin(ThetaW); + + return {result, 1}; +} + +cxx_diagrams::MomentumVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gWp, standard_model_cxx_diagrams::fields::VZ>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = g2*Cos(ThetaW); + + return {result, 1}; +} + +cxx_diagrams::ScalarVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gZ, standard_model_cxx_diagrams::fields::Hp>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto v = MODELPARAMETER(v); + const auto g1 = MODELPARAMETER(g1); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.05*g2*v*(-5*g2*Cos(ThetaW) + 3.872983346207417*g1*Sin(ThetaW)); + + return {result}; +} + +cxx_diagrams::MomentumVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gZ, standard_model_cxx_diagrams::fields::VWp>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = -(g2*Cos(ThetaW)); + + return {result, 1}; +} + +cxx_diagrams::ScalarVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gP, standard_model_cxx_diagrams::fields::hh>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto v = MODELPARAMETER(v); + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.025*v*(7.745966692414834*g1*g2*Cos(2*ThetaW) + Sin(2*ThetaW)*(3*Sqr(g1) - 5*Sqr(g2))); + + return {result}; +} + +cxx_diagrams::ScalarVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gWpC, standard_model_cxx_diagrams::fields::Hp>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto v = MODELPARAMETER(v); + const auto g1 = MODELPARAMETER(g1); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.25*g2*v*(g2*Cos(ThetaW) + 0.7745966692414834*g1*Sin(ThetaW)); + + return {result}; +} + +cxx_diagrams::MomentumVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gWpC, standard_model_cxx_diagrams::fields::VWp>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = g2*Cos(ThetaW); + + return {result, 1}; +} + +cxx_diagrams::ScalarVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gWp, typename standard_model_cxx_diagrams::fields::conj::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto v = MODELPARAMETER(v); + const auto g1 = MODELPARAMETER(g1); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.25*g2*v*(g2*Cos(ThetaW) + 0.7745966692414834*g1*Sin(ThetaW)); + + return {result}; +} + +cxx_diagrams::MomentumVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gWp, typename standard_model_cxx_diagrams::fields::conj::type>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = -(g2*Cos(ThetaW)); + + return {result, 1}; +} + +cxx_diagrams::ScalarVertex VertexImpl::type, standard_model_cxx_diagrams::fields::gZ, standard_model_cxx_diagrams::fields::hh>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto v = MODELPARAMETER(v); + const auto g2 = MODELPARAMETER(g2); + const auto g1 = MODELPARAMETER(g1); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = -0.25*v*Sqr(g2*Cos(ThetaW) + 0.7745966692414834*g1*Sin(ThetaW)); + + return {result}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VP, standard_model_cxx_diagrams::fields::VWp>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto v = MODELPARAMETER(v); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = 0.3872983346207417*g1*g2*v*Cos(ThetaW); + + return {result}; +} + +cxx_diagrams::InverseMetricVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VWp, standard_model_cxx_diagrams::fields::VZ>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto v = MODELPARAMETER(v); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = -0.3872983346207417*g1*g2*v*Sin(ThetaW); + + return {result}; +} + +cxx_diagrams::QuadrupleVectorVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VP, standard_model_cxx_diagrams::fields::VP, standard_model_cxx_diagrams::fields::VWp>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex part1 = Sqr(g2)*Sqr(Sin(ThetaW)); + + const std::complex part2 = Sqr(g2)*Sqr(Sin(ThetaW)); + + const std::complex part3 = -2*Sqr(g2)*Sqr(Sin(ThetaW)); + + return {part1, part2, part3}; +} + +cxx_diagrams::QuadrupleVectorVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VP, standard_model_cxx_diagrams::fields::VWp, standard_model_cxx_diagrams::fields::VZ>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex part1 = Cos(ThetaW)*Sin(ThetaW)*Sqr(g2); + + const std::complex part2 = -(Sin(2*ThetaW)*Sqr(g2)); + + const std::complex part3 = Cos(ThetaW)*Sin(ThetaW)*Sqr(g2); + + return {part1, part2, part3}; +} + +cxx_diagrams::TripleVectorVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VP, standard_model_cxx_diagrams::fields::VWp>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = -(g2*Sin(ThetaW)); + + return {result, cxx_diagrams::TripleVectorVertex::odd_permutation{}}; +} + +cxx_diagrams::QuadrupleVectorVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VWp, standard_model_cxx_diagrams::fields::VZ, standard_model_cxx_diagrams::fields::VZ>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex part1 = -2*Sqr(g2)*Sqr(Cos(ThetaW)); + + const std::complex part2 = Sqr(g2)*Sqr(Cos(ThetaW)); + + const std::complex part3 = Sqr(g2)*Sqr(Cos(ThetaW)); + + return {part1, part2, part3}; +} + +cxx_diagrams::TripleVectorVertex VertexImpl::type, standard_model_cxx_diagrams::fields::VWp, standard_model_cxx_diagrams::fields::VZ>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + const auto ThetaW = DERIVEDPARAMETER(ThetaW); + + const std::complex result = g2*Cos(ThetaW); + + return {result, cxx_diagrams::TripleVectorVertex::odd_permutation{}}; +} + +cxx_diagrams::QuadrupleVectorVertex VertexImpl::type, typename standard_model_cxx_diagrams::fields::conj::type, standard_model_cxx_diagrams::fields::VWp, standard_model_cxx_diagrams::fields::VWp>::evaluate( + const std::array& indices, const context_base& context) +{ + const auto g2 = MODELPARAMETER(g2); + + const std::complex part1 = 2*Sqr(g2); + + const std::complex part2 = -Sqr(g2); + + const std::complex part3 = -Sqr(g2); + + return {part1, part2, part3}; +} + +} // namespace detail +} // namespace standard_model_cxx_diagrams +} // namespace flexiblesusy diff --git a/model_specific/SM/cxx_qft/standard_model_vertices.hpp b/model_specific/SM/cxx_qft/standard_model_vertices.hpp new file mode 100644 index 0000000000..8a01bb8a14 --- /dev/null +++ b/model_specific/SM/cxx_qft/standard_model_vertices.hpp @@ -0,0 +1,656 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + + +/** + * @file cxx_qft/SM_vertices.hpp + * + * This file was generated with FlexibleSUSY 2.7.1 and SARAH 4.14.5 . + */ + +#ifndef STANDARDMODEL_CXXQFT_VERTICES_H +#define STANDARDMODEL_CXXQFT_VERTICES_H + +#include "multiindex.hpp" +#include "numerics2.hpp" + +#include "standard_model_fields.hpp" +#include "cxx_qft/vertices.hpp" + +#include +#include + +#include +#include +#include +#include + +namespace flexiblesusy { +namespace standard_model_cxx_diagrams { + +namespace detail { +template struct VertexImpl; +} // namespace detail + +template +struct Vertex { + using index_bounds = typename boost::mpl::fold< + boost::mpl::vector, + boost::mpl::pair, boost::mpl::vector<>>, + boost::mpl::pair< + boost::mpl::joint_view< + boost::mpl::first, + boost::mpl::first> + >, + boost::mpl::joint_view< + boost::mpl::second, + boost::mpl::second> + > + > + >::type; + using indices_type = std::array + >::value + >; + using vertex_type = decltype( + detail::VertexImpl::evaluate( + std::declval(), + std::declval() + ) + ); + + template + static typename cxx_diagrams::field_indices, FieldIndex>::type + >::type indices_of_field(const indices_type& indices) + { + using namespace boost::mpl; + using fields = vector; + + using result_type = typename cxx_diagrams::field_indices< + typename boost::mpl::at_c::type + >::type; + + using preceeding_fields = typename erase::type, + int_ + >::type, + typename end::type + >::type; + + constexpr int offset = + cxx_diagrams::detail::total_number_of_field_indices::value; + constexpr int length = std::tuple_size::value; + + result_type result_indices; + std::copy(indices.begin() + offset, + indices.begin() + offset + length, + result_indices.begin() + ); + + return result_indices; + } + + static vertex_type + evaluate(const indices_type& indices, const context_base& context) + { + return detail::VertexImpl::evaluate(indices, context); + } +}; + +struct context_base; + +namespace detail { +template<> struct VertexImpl +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VWp> +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl +{ + static cxx_diagrams::MomentumDifferenceVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type> +{ + static cxx_diagrams::MomentumDifferenceVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fd> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fe> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fu> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VWp> +{ + static cxx_diagrams::MomentumDifferenceVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VP> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VZ> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type> +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VWp> +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type> +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VP> +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VZ> +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type> +{ + static cxx_diagrams::MomentumDifferenceVertex evaluate(const std::array& indices, const context_base& context); +}; + + +template<> struct VertexImpl::type> +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fd> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fe> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fu> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Hp> +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VP, standard_model_cxx_diagrams::fields::VWp> +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VWp, standard_model_cxx_diagrams::fields::VZ> +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VWp> +{ + static cxx_diagrams::MomentumDifferenceVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VWp> +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VP, standard_model_cxx_diagrams::fields::VP> +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VP, standard_model_cxx_diagrams::fields::VZ> +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VP> +{ + static cxx_diagrams::MomentumDifferenceVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VZ, standard_model_cxx_diagrams::fields::VZ> +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VZ> +{ + static cxx_diagrams::MomentumDifferenceVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, typename standard_model_cxx_diagrams::fields::conj::type, standard_model_cxx_diagrams::fields::VWp> +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VP> +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VZ> +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type> +{ + static cxx_diagrams::MomentumDifferenceVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type> +{ + static cxx_diagrams::TripleVectorVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fd, standard_model_cxx_diagrams::fields::Ah> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fd, standard_model_cxx_diagrams::fields::hh> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fd, standard_model_cxx_diagrams::fields::VG> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fd, standard_model_cxx_diagrams::fields::VP> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fd, standard_model_cxx_diagrams::fields::VZ> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fu, typename standard_model_cxx_diagrams::fields::conj::type> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fu, typename standard_model_cxx_diagrams::fields::conj::type> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fe, standard_model_cxx_diagrams::fields::Ah> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fe, standard_model_cxx_diagrams::fields::hh> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fe, standard_model_cxx_diagrams::fields::VP> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fe, standard_model_cxx_diagrams::fields::VZ> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fv, typename standard_model_cxx_diagrams::fields::conj::type> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fv, typename standard_model_cxx_diagrams::fields::conj::type> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, typename standard_model_cxx_diagrams::fields::conj::type, standard_model_cxx_diagrams::fields::Fv> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fd, standard_model_cxx_diagrams::fields::Hp> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fd, standard_model_cxx_diagrams::fields::VWp> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fu, standard_model_cxx_diagrams::fields::Ah> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fu, standard_model_cxx_diagrams::fields::hh> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fu, standard_model_cxx_diagrams::fields::VG> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fu, standard_model_cxx_diagrams::fields::VP> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fu, standard_model_cxx_diagrams::fields::VZ> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fe, standard_model_cxx_diagrams::fields::Hp> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fe, standard_model_cxx_diagrams::fields::VWp> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Fv, standard_model_cxx_diagrams::fields::VZ> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::Hp, standard_model_cxx_diagrams::fields::Fe> +{ + static cxx_diagrams::ChiralVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gWpC, standard_model_cxx_diagrams::fields::VWp> +{ + static cxx_diagrams::MomentumVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gWp, typename standard_model_cxx_diagrams::fields::conj::type> +{ + static cxx_diagrams::MomentumVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gP, typename standard_model_cxx_diagrams::fields::conj::type> +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gP, typename standard_model_cxx_diagrams::fields::conj::type> +{ + static cxx_diagrams::MomentumVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gWpC, standard_model_cxx_diagrams::fields::Ah> +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gWpC, standard_model_cxx_diagrams::fields::hh> +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gWpC, standard_model_cxx_diagrams::fields::VP> +{ + static cxx_diagrams::MomentumVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gWpC, standard_model_cxx_diagrams::fields::VZ> +{ + static cxx_diagrams::MomentumVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gZ, typename standard_model_cxx_diagrams::fields::conj::type> +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gZ, typename standard_model_cxx_diagrams::fields::conj::type> +{ + static cxx_diagrams::MomentumVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gP, standard_model_cxx_diagrams::fields::Hp> +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gP, standard_model_cxx_diagrams::fields::VWp> +{ + static cxx_diagrams::MomentumVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gWp, standard_model_cxx_diagrams::fields::Ah> +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gWp, standard_model_cxx_diagrams::fields::hh> +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gWp, standard_model_cxx_diagrams::fields::VP> +{ + static cxx_diagrams::MomentumVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gWp, standard_model_cxx_diagrams::fields::VZ> +{ + static cxx_diagrams::MomentumVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gZ, standard_model_cxx_diagrams::fields::Hp> +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gZ, standard_model_cxx_diagrams::fields::VWp> +{ + static cxx_diagrams::MomentumVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gP, standard_model_cxx_diagrams::fields::hh> +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gWpC, standard_model_cxx_diagrams::fields::Hp> +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gWpC, standard_model_cxx_diagrams::fields::VWp> +{ + static cxx_diagrams::MomentumVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gWp, typename standard_model_cxx_diagrams::fields::conj::type> +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gWp, typename standard_model_cxx_diagrams::fields::conj::type> +{ + static cxx_diagrams::MomentumVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::gZ, standard_model_cxx_diagrams::fields::hh> +{ + static cxx_diagrams::ScalarVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VP, standard_model_cxx_diagrams::fields::VWp> +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VWp, standard_model_cxx_diagrams::fields::VZ> +{ + static cxx_diagrams::InverseMetricVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VP, standard_model_cxx_diagrams::fields::VP, standard_model_cxx_diagrams::fields::VWp> +{ + static cxx_diagrams::QuadrupleVectorVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VP, standard_model_cxx_diagrams::fields::VWp, standard_model_cxx_diagrams::fields::VZ> +{ + static cxx_diagrams::QuadrupleVectorVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VP, standard_model_cxx_diagrams::fields::VWp> +{ + static cxx_diagrams::TripleVectorVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VWp, standard_model_cxx_diagrams::fields::VZ, standard_model_cxx_diagrams::fields::VZ> +{ + static cxx_diagrams::QuadrupleVectorVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, standard_model_cxx_diagrams::fields::VWp, standard_model_cxx_diagrams::fields::VZ> +{ + static cxx_diagrams::TripleVectorVertex evaluate(const std::array& indices, const context_base& context); +}; + +template<> struct VertexImpl::type, typename standard_model_cxx_diagrams::fields::conj::type, standard_model_cxx_diagrams::fields::VWp, standard_model_cxx_diagrams::fields::VWp> +{ + static cxx_diagrams::QuadrupleVectorVertex evaluate(const std::array& indices, const context_base& context); +}; + + + +cxx_diagrams::ChiralVertex unit_charge(const context_base& context); +} // namespace detail + +inline double unit_charge(const context_base& context) +{ + return -(detail::unit_charge(context).left().real() / + fields::Electron::electricCharge); +} + +} // namespace standard_model_cxx_diagrams +} // namespace flexiblesusy + +#endif diff --git a/model_specific/SM/cxx_qft/vertices.mk b/model_specific/SM/cxx_qft/vertices.mk new file mode 100644 index 0000000000..590d8fa124 --- /dev/null +++ b/model_specific/SM/cxx_qft/vertices.mk @@ -0,0 +1,21 @@ +# ==================================================================== +# This file is part of FlexibleSUSY. +# +# FlexibleSUSY 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. +# +# FlexibleSUSY 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 FlexibleSUSY. If not, see +# . +# ==================================================================== + + +LIB_model_specific_SM_CXXQFT_VERTICES_SRC := \ + model_specific/SM/cxx_qft/standard_model_vertices.cpp diff --git a/model_specific/SM/decays/standard_model_decay_table.cpp b/model_specific/SM/decays/standard_model_decay_table.cpp new file mode 100644 index 0000000000..866de10799 --- /dev/null +++ b/model_specific/SM/decays/standard_model_decay_table.cpp @@ -0,0 +1,79 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + + +#include "standard_model_decay_table.hpp" + +#include "error.hpp" + +#include +#include + +namespace flexiblesusy { + +standard_model_decay_table::standard_model_decay_table() + : decay_table({Decays_list(25)}) +{ +} + +void standard_model_decay_table::clear() +{ + for (auto& particle: decay_table) { + particle.clear(); + } +} + +void standard_model_decay_table::print(std::ostream& ostr) const +{ + for (const auto& particle: decay_table) { + const auto pdg = particle.get_particle_id(); + for (const auto& decay: particle) { + const auto& final_state = decay.second.get_final_state_particle_ids(); + const std::size_t final_state_size = final_state.size(); + ostr << "Partial width[" + << standard_model_info::get_particle_name_from_pdg(pdg) + << " -> "; + for (std::size_t i = 0; i < final_state_size; ++i) { + ostr << standard_model_info::get_particle_name_from_pdg(final_state[i]); + if (i < final_state_size - 1) { + ostr << ", "; + } + } + ostr << "] = " << decay.second.get_width() << '\n'; + } + } +} + +std::ostream& operator<<(std::ostream& ostr, + const standard_model_decay_table& table) +{ + table.print(ostr); + return ostr; +} + +Decays_list& standard_model_decay_table::get_hh_decays() +{ + return decay_table[0]; +} + +const Decays_list& standard_model_decay_table::get_hh_decays() const +{ + return decay_table[0]; +} + +} // namespace flexiblesusy diff --git a/model_specific/SM/decays/standard_model_decay_table.hpp b/model_specific/SM/decays/standard_model_decay_table.hpp new file mode 100644 index 0000000000..a28b5c112c --- /dev/null +++ b/model_specific/SM/decays/standard_model_decay_table.hpp @@ -0,0 +1,68 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + + +#ifndef STANDARDMODEL_DECAY_TABLE_H +#define STANDARDMODEL_DECAY_TABLE_H + +#include "standard_model.hpp" +#include "decays/decay.hpp" + +#include +#include + +namespace flexiblesusy { + +class standard_model_decay_table { +private: + static constexpr int number_of_decay_particles = 1; + using Table_type = std::array; +public: + using iterator = Table_type::iterator; + using const_iterator = Table_type::const_iterator; + + standard_model_decay_table(); + ~standard_model_decay_table() = default; + standard_model_decay_table(const standard_model_decay_table&) = default; + standard_model_decay_table(standard_model_decay_table&&) = default; + standard_model_decay_table& operator=(const standard_model_decay_table&) = default; + standard_model_decay_table& operator=(standard_model_decay_table&&) = default; + + iterator begin() noexcept { return decay_table.begin(); } + const_iterator begin() const noexcept { return decay_table.begin(); } + const_iterator cbegin() const noexcept { return decay_table.cbegin(); } + iterator end() noexcept { return decay_table.end(); } + const_iterator end() const noexcept { return decay_table.end(); } + const_iterator cend() const noexcept { return decay_table.end(); } + + std::size_t size() const noexcept { return decay_table.size(); } + + void clear(); + void print(std::ostream&) const; + + Decays_list& get_hh_decays(); + const Decays_list& get_hh_decays() const; +private: + Table_type decay_table; +}; + +std::ostream& operator<<(std::ostream&, const standard_model_decay_table&); + +} // namespace flexiblesusy + +#endif diff --git a/model_specific/SM/decays/standard_model_decays.cpp b/model_specific/SM/decays/standard_model_decays.cpp new file mode 100644 index 0000000000..ddc3f7992e --- /dev/null +++ b/model_specific/SM/decays/standard_model_decays.cpp @@ -0,0 +1,6002 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + + +/** + * @file standard_model_decays.cpp + * @brief implementation of particle decays in the SM + * + * Contains the definition of SM decays class methods, + * which calculate the decay rates for particles in the model. + * + * This file was generated with FlexibleSUSY 2.7.1 and SARAH 4.14.5 . + */ + +#include + +#include +#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#define BOOST_MPL_LIMIT_LIST_SIZE 50 +#include +#include +#include +#include +#include +#include + +#include "standard_model_decays.hpp" +#include "standard_model.hpp" +#include "decays/one_loop_decay_diagrams.hpp" +#include "concatenate.hpp" +#include "decays/decay_functions.hpp" +#include "config.h" +#include "thread_pool.hpp" +#include "wrappers.hpp" +#include "cxx_qft/standard_model_particle_aliases.hpp" +#include "cxx_qft/standard_model_vertices.hpp" +#include "error.hpp" + +namespace flexiblesusy { + +#define CLASSNAME Standard_model_decays +#define PHYSICAL(parameter) model.get_physical().parameter + +using namespace standard_model_cxx_diagrams; +using namespace standard_model_cxx_diagrams::fields; +namespace info = standard_model_info; +using namespace std::complex_literals; + +const standard_model_decay_table& CLASSNAME::get_decay_table() const +{ + return decay_table; +} + +const FlexibleDecay_problems& CLASSNAME::get_problems() const +{ + return problems; +} + +void CLASSNAME::clear_problems() +{ + problems.clear(); +} + +void CLASSNAME::clear() +{ + clear_problems(); + decay_table.clear(); +} + +void CLASSNAME::calculate_decays() +{ +try { +#ifdef ENABLE_THREADS + Thread_pool tp(std::min(std::thread::hardware_concurrency(), 1u)); + + tp.run_task([this] () { calculate_hh_decays(); }); + +#else + calculate_hh_decays(); + +#endif +} +catch (std::exception& e) { + problems.add_error(e.what()); +} +} + +double CLASSNAME::get_alphas(standard_model_cxx_diagrams::context_base const& context) const +{ + return Sqr(context.model.get_g3())/(4.*Pi); +} + +double CLASSNAME::get_alpha(standard_model_cxx_diagrams::context_base const& context) const +{ + return Sqr(unit_charge(context))/(4.*Pi); +} + +template +constexpr auto _to_array = [](auto&& ...x) { + return std::array{std::forward(x)...}; +}; + +template +int fieldPDG(const typename field_indices::type indx) { + return boost::hana::unpack(Field::pdgids, _to_array).at(indx.size() > 0 ? indx.at(0) : 0); +} + +/* 1-loop BSM amplitudes + * + * Notes: + * - Since FS removes a factor of i from every vertex we reintroduce it + * calls to one loop amplitudes + */ + +// hh -> {VG, VG} +template<> +Decay_amplitude_SVV CLASSNAME::calculate_amplitude( + const context_base& context, + typename cxx_diagrams::field_indices::type const& idx_1, + typename cxx_diagrams::field_indices::type const& idx_2, + typename cxx_diagrams::field_indices::type const& idx_3) const{ + + // amplitude type + Decay_amplitude_SVV result; + + // external particles' masses + result.m_decay = context.physical_mass(idx_1); + result.m_vector_1 = context.physical_mass(idx_2); + result.m_vector_2 = context.physical_mass(idx_3); + + // set the initial value of an amplitude to 0 + result.form_factor_g = std::complex(0., 0.); + result.form_factor_11 = std::complex(0., 0.); + result.form_factor_12 = std::complex(0., 0.); + result.form_factor_21 = std::complex(0., 0.); + result.form_factor_22 = std::complex(0., 0.); + result.form_factor_eps = std::complex(0., 0.); + + const double ren_scale {result.m_decay}; + + // ----------------- 1-loop contributions to the amplitude ----------------- + + // topology T1 + // internal particles in the diagram: Fd, bar[Fd], Fd + { + using vertexId1 = Vertex::type, Fd, hh>; + using vertexId2 = Vertex::type, Fd, VG>; + using vertexId3 = Vertex::type, Fd, VG>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {2.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g1n1_FFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), 1.0i*vertexId2Val.left(), + 1.0i*vertexId2Val.right(), 1.0i*vertexId3Val.left(), 1.0i*vertexId3Val.right + (), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: Fu, bar[Fu], Fu + { + using vertexId1 = Vertex::type, Fu, hh>; + using vertexId2 = Vertex::type, Fu, VG>; + using vertexId3 = Vertex::type, Fu, VG>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {2.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g1n1_FFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), 1.0i*vertexId2Val.left(), + 1.0i*vertexId2Val.right(), 1.0i*vertexId3Val.left(), 1.0i*vertexId3Val.right + (), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: bar[Fd], Fd, bar[Fd] + { + using vertexId1 = Vertex::type, Fd, hh>; + using vertexId2 = Vertex::type, Fd, VG>; + using vertexId3 = Vertex::type, Fd, VG>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {2.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g1n1_FFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), -1.0i*vertexId2Val.right() + , -1.0i*vertexId2Val.left(), -1.0i*vertexId3Val.right(), -1.0i*vertexId3Val. + left(), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: bar[Fu], Fu, bar[Fu] + { + using vertexId1 = Vertex::type, Fu, hh>; + using vertexId2 = Vertex::type, Fu, VG>; + using vertexId3 = Vertex::type, Fu, VG>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {2.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g1n1_FFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), -1.0i*vertexId2Val.right() + , -1.0i*vertexId2Val.left(), -1.0i*vertexId3Val.right(), -1.0i*vertexId3Val. + left(), + ren_scale); + } + } + } + } + } + + return result; +} + +// hh -> {VP, VP} +template<> +Decay_amplitude_SVV CLASSNAME::calculate_amplitude( + const context_base& context, + typename cxx_diagrams::field_indices::type const& idx_1, + typename cxx_diagrams::field_indices::type const& idx_2, + typename cxx_diagrams::field_indices::type const& idx_3) const{ + + // amplitude type + Decay_amplitude_SVV result; + + // external particles' masses + result.m_decay = context.physical_mass(idx_1); + result.m_vector_1 = context.physical_mass(idx_2); + result.m_vector_2 = context.physical_mass(idx_3); + + // set the initial value of an amplitude to 0 + result.form_factor_g = std::complex(0., 0.); + result.form_factor_11 = std::complex(0., 0.); + result.form_factor_12 = std::complex(0., 0.); + result.form_factor_21 = std::complex(0., 0.); + result.form_factor_22 = std::complex(0., 0.); + result.form_factor_eps = std::complex(0., 0.); + + // FormCalc's Finite variable + constexpr double Finite {1.}; + + const double ren_scale {result.m_decay}; + + // ----------------- 1-loop contributions to the amplitude ----------------- + + // topology T1 + // internal particles in the diagram: Fd, bar[Fd], Fd + { + using vertexId1 = Vertex::type, Fd, hh>; + using vertexId2 = Vertex::type, Fd, VP>; + using vertexId3 = Vertex::type, Fd, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {3.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + + auto temp_result = symmetryFac * colorFac * calculate_diagram_SVV_t1g1n1_FFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), 1.0i*vertexId2Val.left(), + 1.0i*vertexId2Val.right(), 1.0i*vertexId3Val.left(), 1.0i*vertexId3Val.right + (), + ren_scale); + if (static_cast(flexibledecay_settings.get(FlexibleDecay_settings::include_higher_order_corrections)) > 0 && + vertexId1::template indices_of_field<1>(indexId1) == vertexId1::template indices_of_field<0>(indexId1) && + vertexId2::template indices_of_field<1>(indexId2) == vertexId2::template indices_of_field<0>(indexId2) && + vertexId3::template indices_of_field<1>(indexId3) == vertexId3::template indices_of_field<0>(indexId3)) { + const auto correction_S = 1. + get_alphas(context)/Pi * delta_hAA_2loopQCD_for_quark_loop(result.m_decay, mInternal1, ren_scale); + const auto correction_P = 1. + get_alphas(context)/Pi * delta_AhAA_2loopQCD_for_quark_loop(result.m_decay, mInternal1, ren_scale); + temp_result.form_factor_g = correction_S * temp_result.form_factor_g; + temp_result.form_factor_11 = correction_S * temp_result.form_factor_11; + temp_result.form_factor_12 = correction_S * temp_result.form_factor_12; + temp_result.form_factor_21 = correction_S * temp_result.form_factor_21; + temp_result.form_factor_22 = correction_S * temp_result.form_factor_22; + temp_result.form_factor_eps = correction_P * temp_result.form_factor_eps; + } + result += temp_result; + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: Fe, bar[Fe], Fe + { + using vertexId1 = Vertex::type, Fe, hh>; + using vertexId2 = Vertex::type, Fe, VP>; + using vertexId3 = Vertex::type, Fe, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g1n1_FFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), 1.0i*vertexId2Val.left(), + 1.0i*vertexId2Val.right(), 1.0i*vertexId3Val.left(), 1.0i*vertexId3Val.right + (), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: Fu, bar[Fu], Fu + { + using vertexId1 = Vertex::type, Fu, hh>; + using vertexId2 = Vertex::type, Fu, VP>; + using vertexId3 = Vertex::type, Fu, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {3.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + + auto temp_result = symmetryFac * colorFac * calculate_diagram_SVV_t1g1n1_FFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), 1.0i*vertexId2Val.left(), + 1.0i*vertexId2Val.right(), 1.0i*vertexId3Val.left(), 1.0i*vertexId3Val.right + (), + ren_scale); + if (static_cast(flexibledecay_settings.get(FlexibleDecay_settings::include_higher_order_corrections)) > 0 && + vertexId1::template indices_of_field<1>(indexId1) == vertexId1::template indices_of_field<0>(indexId1) && + vertexId2::template indices_of_field<1>(indexId2) == vertexId2::template indices_of_field<0>(indexId2) && + vertexId3::template indices_of_field<1>(indexId3) == vertexId3::template indices_of_field<0>(indexId3)) { + const auto correction_S = 1. + get_alphas(context)/Pi * delta_hAA_2loopQCD_for_quark_loop(result.m_decay, mInternal1, ren_scale); + const auto correction_P = 1. + get_alphas(context)/Pi * delta_AhAA_2loopQCD_for_quark_loop(result.m_decay, mInternal1, ren_scale); + temp_result.form_factor_g = correction_S * temp_result.form_factor_g; + temp_result.form_factor_11 = correction_S * temp_result.form_factor_11; + temp_result.form_factor_12 = correction_S * temp_result.form_factor_12; + temp_result.form_factor_21 = correction_S * temp_result.form_factor_21; + temp_result.form_factor_22 = correction_S * temp_result.form_factor_22; + temp_result.form_factor_eps = correction_P * temp_result.form_factor_eps; + } + result += temp_result; + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: bar[gWp], gWp, bar[gWp] + { + using vertexId1 = Vertex::type, gWp, hh>; + using vertexId2 = Vertex::type, gWp, VP>; + using vertexId3 = Vertex::type, gWp, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g3n3_UUU( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), -1.0i*vertexId2Val.value(1), -1.0i*vertexId3Val. + value(1), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: bar[gWpC], gWpC, bar[gWpC] + { + using vertexId1 = Vertex::type, gWpC, hh>; + using vertexId2 = Vertex::type, gWpC, VP>; + using vertexId3 = Vertex::type, gWpC, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g3n3_UUU( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), -1.0i*vertexId2Val.value(1), -1.0i*vertexId3Val. + value(1), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: Hp, conj[Hp], Hp + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<2>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g2n2_SSS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(0, 1), 1.0i*vertexId3Val. + value(1, 0), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: Hp, conj[Hp], VWp + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VP, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<1>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g4n4_SSV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val.value() + , + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[Hp], VWp, conj[Hp] + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VP, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<1>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g5n5_SVS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(0, 1), 1.0i*vertexId2Val.value(1, 0), 1.0i*vertexId3Val + .value(), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[Hp], VWp, conj[VWp] + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VP, VWp>; + using vertexId3 = Vertex::type, VP, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<1>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<1>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<2>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g7n7_SVV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(0, 1), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val. + value(cxx_diagrams::TripleVectorVertex::odd_permutation {}), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[VWp], Hp, conj[Hp] + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g6n6_VSS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(0, 1), 1.0i*vertexId2Val.value(0, 1), 1.0i*vertexId3Val + .value(), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[VWp], Hp, conj[VWp] + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VP, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<1>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g8n8_VSV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(0, 1), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val. + value(cxx_diagrams::TripleVectorVertex::even_permutation {}), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: VWp, conj[VWp], Hp + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VP, VWp>; + using vertexId3 = Vertex::type, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<1>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<2>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<2>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g9n9_VVS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val.value() + , + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: VWp, conj[VWp], VWp + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VP, VWp>; + using vertexId3 = Vertex::type, VP, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<1>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<1>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<2>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g10n10_VVV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(cxx_diagrams:: + TripleVectorVertex::odd_permutation {}), 1.0i*vertexId3Val.value( + cxx_diagrams::TripleVectorVertex::even_permutation {}), + ren_scale, + Finite); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: bar[Fd], Fd, bar[Fd] + { + using vertexId1 = Vertex::type, Fd, hh>; + using vertexId2 = Vertex::type, Fd, VP>; + using vertexId3 = Vertex::type, Fd, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {3.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + auto temp_result = symmetryFac * colorFac * calculate_diagram_SVV_t1g1n1_FFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), -1.0i*vertexId2Val.right() + , -1.0i*vertexId2Val.left(), -1.0i*vertexId3Val.right(), -1.0i*vertexId3Val. + left(), + ren_scale); + if (static_cast(flexibledecay_settings.get(FlexibleDecay_settings::include_higher_order_corrections)) > 0 && + vertexId1::template indices_of_field<0>(indexId1) == vertexId1::template indices_of_field<1>(indexId1) && + vertexId2::template indices_of_field<0>(indexId2) == vertexId2::template indices_of_field<1>(indexId2) && + vertexId3::template indices_of_field<0>(indexId3) == vertexId3::template indices_of_field<1>(indexId3)) { + const auto correction_S = 1. + get_alphas(context)/Pi * delta_hAA_2loopQCD_for_quark_loop(result.m_decay, mInternal1, ren_scale); + const auto correction_P = 1. + get_alphas(context)/Pi * delta_AhAA_2loopQCD_for_quark_loop(result.m_decay, mInternal1, ren_scale); + temp_result.form_factor_g = correction_S * temp_result.form_factor_g; + temp_result.form_factor_11 = correction_S * temp_result.form_factor_11; + temp_result.form_factor_12 = correction_S * temp_result.form_factor_12; + temp_result.form_factor_21 = correction_S * temp_result.form_factor_21; + temp_result.form_factor_22 = correction_S * temp_result.form_factor_22; + temp_result.form_factor_eps = correction_P * temp_result.form_factor_eps; + } + result += temp_result; + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: bar[Fe], Fe, bar[Fe] + { + using vertexId1 = Vertex::type, Fe, hh>; + using vertexId2 = Vertex::type, Fe, VP>; + using vertexId3 = Vertex::type, Fe, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g1n1_FFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), -1.0i*vertexId2Val.right() + , -1.0i*vertexId2Val.left(), -1.0i*vertexId3Val.right(), -1.0i*vertexId3Val. + left(), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: bar[Fu], Fu, bar[Fu] + { + using vertexId1 = Vertex::type, Fu, hh>; + using vertexId2 = Vertex::type, Fu, VP>; + using vertexId3 = Vertex::type, Fu, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {3.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + auto temp_result = symmetryFac * colorFac * calculate_diagram_SVV_t1g1n1_FFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), -1.0i*vertexId2Val.right() + , -1.0i*vertexId2Val.left(), -1.0i*vertexId3Val.right(), -1.0i*vertexId3Val. + left(), + ren_scale); + if (static_cast(flexibledecay_settings.get(FlexibleDecay_settings::include_higher_order_corrections)) > 0 && + vertexId1::template indices_of_field<0>(indexId1) == vertexId1::template indices_of_field<1>(indexId1) && + vertexId2::template indices_of_field<0>(indexId2) == vertexId2::template indices_of_field<1>(indexId2) && + vertexId3::template indices_of_field<0>(indexId3) == vertexId3::template indices_of_field<1>(indexId3)) { + const auto correction_S = 1. + get_alphas(context)/Pi * delta_hAA_2loopQCD_for_quark_loop(result.m_decay, mInternal1, ren_scale); + const auto correction_P = 1. + get_alphas(context)/Pi * delta_AhAA_2loopQCD_for_quark_loop(result.m_decay, mInternal1, ren_scale); + temp_result.form_factor_g = correction_S * temp_result.form_factor_g; + temp_result.form_factor_11 = correction_S * temp_result.form_factor_11; + temp_result.form_factor_12 = correction_S * temp_result.form_factor_12; + temp_result.form_factor_21 = correction_S * temp_result.form_factor_21; + temp_result.form_factor_22 = correction_S * temp_result.form_factor_22; + temp_result.form_factor_eps = correction_P * temp_result.form_factor_eps; + } + result += temp_result; + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: gWp, bar[gWp], gWp + { + using vertexId1 = Vertex::type, gWp, hh>; + using vertexId2 = Vertex::type, gWp, VP>; + using vertexId3 = Vertex::type, gWp, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g3n3_UUU( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), -1.0i*vertexId2Val.value(1), -1.0i*vertexId3Val. + value(1), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: gWpC, bar[gWpC], gWpC + { + using vertexId1 = Vertex::type, gWpC, hh>; + using vertexId2 = Vertex::type, gWpC, VP>; + using vertexId3 = Vertex::type, gWpC, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g3n3_UUU( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), -1.0i*vertexId2Val.value(1), -1.0i*vertexId3Val. + value(1), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[Hp], Hp, conj[Hp] + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<2>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g2n2_SSS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(1, 0), 1.0i*vertexId3Val. + value(0, 1), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[Hp], Hp, conj[VWp] + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VP, VWp>; + using vertexId3 = Vertex::type, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<1>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<2>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<2>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g4n4_SSV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val.value() + , + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: Hp, conj[VWp], Hp + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<2>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g5n5_SVS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(0, 1), 1.0i*vertexId2Val.value(0, 1), 1.0i*vertexId3Val + .value(), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: Hp, conj[VWp], VWp + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VP, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<1>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g7n7_SVV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(0, 1), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val. + value(cxx_diagrams::TripleVectorVertex::even_permutation {}), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: VWp, conj[Hp], Hp + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VP, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<1>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g6n6_VSS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(0, 1), 1.0i*vertexId2Val.value(1, 0), 1.0i*vertexId3Val + .value(), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: VWp, conj[Hp], VWp + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VP, VWp>; + using vertexId3 = Vertex::type, VP, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<1>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<1>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<2>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g8n8_VSV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(0, 1), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val. + value(cxx_diagrams::TripleVectorVertex::odd_permutation {}), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[VWp], VWp, conj[Hp] + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VP, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<1>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g9n9_VVS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val.value() + , + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[VWp], VWp, conj[VWp] + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VP, VWp>; + using vertexId3 = Vertex::type, VP, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<1>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<1>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<2>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g10n10_VVV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(cxx_diagrams:: + TripleVectorVertex::even_permutation {}), 1.0i*vertexId3Val.value( + cxx_diagrams::TripleVectorVertex::odd_permutation {}), + ren_scale, + Finite); + } + } + } + } + } + + // topology T4 + // internal particles in the diagram: Hp, conj[Hp] + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VP, VP>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<3>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t4g1n15_SS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), + ren_scale); + } + } + } + } + + // topology T4 + // internal particles in the diagram: VWp, conj[VWp] + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VP, VP, VWp>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<1>(indexId2); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<3>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t4g2n16_VV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value3(), 1.0i*vertexId2Val.value1 + (), 1.0i*vertexId2Val.value2(), + ren_scale, + Finite); + } + } + } + } + + // topology T6 + // internal particles in the diagram: Hp, conj[VWp] + { + using vertexId1 = Vertex::type, VP, VWp>; + using vertexId2 = Vertex::type, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId2::template indices_of_field<0>(indexId2); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<3>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<2>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t6g1n19_SV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), + ren_scale); + } + } + } + } + + // topology T6 + // internal particles in the diagram: conj[Hp], VWp + { + using vertexId1 = Vertex::type, VP>; + using vertexId2 = Vertex::type, VP, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId2::template indices_of_field<0>(indexId2); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<3>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t6g1n19_SV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), + ren_scale); + } + } + } + } + + // topology T7 + // internal particles in the diagram: Hp, conj[VWp] + { + using vertexId1 = Vertex::type, VP, VWp>; + using vertexId2 = Vertex::type, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId2::template indices_of_field<0>(indexId2); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<3>(indexId2); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<1>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<2>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t7g1n20_SV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), + ren_scale); + } + } + } + } + + // topology T7 + // internal particles in the diagram: conj[Hp], VWp + { + using vertexId1 = Vertex::type, VP>; + using vertexId2 = Vertex::type, VP, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId2::template indices_of_field<0>(indexId2); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<2>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<3>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t7g1n20_SV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), + ren_scale); + } + } + } + } + + return result; +} + +// hh -> {VP, VZ} +template<> +Decay_amplitude_SVV CLASSNAME::calculate_amplitude( + const context_base& context, + typename cxx_diagrams::field_indices::type const& idx_1, + typename cxx_diagrams::field_indices::type const& idx_2, + typename cxx_diagrams::field_indices::type const& idx_3) const{ + + // amplitude type + Decay_amplitude_SVV result; + + // external particles' masses + result.m_decay = context.physical_mass(idx_1); + result.m_vector_1 = 0.; + result.m_vector_2 = qedqcd.displayPoleMZ(); + + // set the initial value of an amplitude to 0 + result.form_factor_g = std::complex(0., 0.); + result.form_factor_11 = std::complex(0., 0.); + result.form_factor_12 = std::complex(0., 0.); + result.form_factor_21 = std::complex(0., 0.); + result.form_factor_22 = std::complex(0., 0.); + result.form_factor_eps = std::complex(0., 0.); + + // FormCalc's Finite variable + constexpr double Finite {1.}; + + const double ren_scale {result.m_decay}; + + // ----------------- 1-loop contributions to the amplitude ----------------- + + // topology T1 + // internal particles in the diagram: Fd, bar[Fd], Fd + { + using vertexId1 = Vertex::type, Fd, hh>; + using vertexId2 = Vertex::type, Fd, VZ>; + using vertexId3 = Vertex::type, Fd, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {3.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + + auto temp_result = symmetryFac * colorFac * calculate_diagram_SVV_t1g1n1_FFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), 1.0i*vertexId2Val.left(), + 1.0i*vertexId2Val.right(), 1.0i*vertexId3Val.left(), 1.0i*vertexId3Val.right + (), + ren_scale); + if (static_cast(flexibledecay_settings.get(FlexibleDecay_settings::include_higher_order_corrections)) > 0 && + vertexId1::template indices_of_field<1>(indexId1) == vertexId1::template indices_of_field<0>(indexId1) && + vertexId2::template indices_of_field<1>(indexId2) == vertexId2::template indices_of_field<0>(indexId2) && + vertexId3::template indices_of_field<1>(indexId3) == vertexId3::template indices_of_field<0>(indexId3) + && result.m_decay/mInternal1 < 0.8 && result.m_vector_2/result.m_decay < 0.75 + ) { + const double correction_S = 1 - get_alphas(context)/Pi; + temp_result.form_factor_g = correction_S * temp_result.form_factor_g; + temp_result.form_factor_11 = correction_S * temp_result.form_factor_11; + temp_result.form_factor_12 = correction_S * temp_result.form_factor_12; + temp_result.form_factor_21 = correction_S * temp_result.form_factor_21; + temp_result.form_factor_22 = correction_S * temp_result.form_factor_22; + } + result += temp_result; + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: Fe, bar[Fe], Fe + { + using vertexId1 = Vertex::type, Fe, hh>; + using vertexId2 = Vertex::type, Fe, VZ>; + using vertexId3 = Vertex::type, Fe, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g1n1_FFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), 1.0i*vertexId2Val.left(), + 1.0i*vertexId2Val.right(), 1.0i*vertexId3Val.left(), 1.0i*vertexId3Val.right + (), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: Fu, bar[Fu], Fu + { + using vertexId1 = Vertex::type, Fu, hh>; + using vertexId2 = Vertex::type, Fu, VZ>; + using vertexId3 = Vertex::type, Fu, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {3.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + + auto temp_result = symmetryFac * colorFac * calculate_diagram_SVV_t1g1n1_FFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), 1.0i*vertexId2Val.left(), + 1.0i*vertexId2Val.right(), 1.0i*vertexId3Val.left(), 1.0i*vertexId3Val.right + (), + ren_scale); + if (static_cast(flexibledecay_settings.get(FlexibleDecay_settings::include_higher_order_corrections)) > 0 && + vertexId1::template indices_of_field<1>(indexId1) == vertexId1::template indices_of_field<0>(indexId1) && + vertexId2::template indices_of_field<1>(indexId2) == vertexId2::template indices_of_field<0>(indexId2) && + vertexId3::template indices_of_field<1>(indexId3) == vertexId3::template indices_of_field<0>(indexId3) + && result.m_decay/mInternal1 < 0.8 && result.m_vector_2/result.m_decay < 0.75 + ) { + const double correction_S = 1 - get_alphas(context)/Pi; + temp_result.form_factor_g = correction_S * temp_result.form_factor_g; + temp_result.form_factor_11 = correction_S * temp_result.form_factor_11; + temp_result.form_factor_12 = correction_S * temp_result.form_factor_12; + temp_result.form_factor_21 = correction_S * temp_result.form_factor_21; + temp_result.form_factor_22 = correction_S * temp_result.form_factor_22; + } + result += temp_result; + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: bar[gWp], gWp, bar[gWp] + { + using vertexId1 = Vertex::type, gWp, hh>; + using vertexId2 = Vertex::type, gWp, VZ>; + using vertexId3 = Vertex::type, gWp, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g3n3_UUU( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), -1.0i*vertexId2Val.value(1), -1.0i*vertexId3Val. + value(1), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: bar[gWpC], gWpC, bar[gWpC] + { + using vertexId1 = Vertex::type, gWpC, hh>; + using vertexId2 = Vertex::type, gWpC, VZ>; + using vertexId3 = Vertex::type, gWpC, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g3n3_UUU( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), -1.0i*vertexId2Val.value(1), -1.0i*vertexId3Val. + value(1), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: Hp, conj[Hp], Hp + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VZ>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<2>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g2n2_SSS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(0, 1), 1.0i*vertexId3Val. + value(1, 0), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[Hp], Hp, conj[VWp] + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VP, VWp>; + using vertexId3 = Vertex::type, VZ>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<1>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<2>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<2>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g4n4_SSV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val.value() + , + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[Hp], VWp, conj[Hp] + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VWp, VZ>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<2>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g5n5_SVS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(0, 1), 1.0i*vertexId2Val.value(1, 0), 1.0i*vertexId3Val + .value(), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[Hp], VWp, conj[VWp] + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VP, VWp>; + using vertexId3 = Vertex::type, VWp, VZ>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<1>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<2>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<2>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g7n7_SVV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(0, 1), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val. + value(cxx_diagrams::TripleVectorVertex::even_permutation {}), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[VWp], Hp, conj[Hp] + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VZ>; + using vertexId3 = Vertex::type, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g6n6_VSS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(0, 1), 1.0i*vertexId2Val.value(0, 1), 1.0i*vertexId3Val + .value(), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[VWp], Hp, conj[VWp] + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VZ>; + using vertexId3 = Vertex::type, VP, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<1>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g8n8_VSV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(0, 1), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val. + value(cxx_diagrams::TripleVectorVertex::even_permutation {}), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[VWp], VWp, conj[Hp] + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VWp, VZ>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<2>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g9n9_VVS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val.value() + , + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: VWp, conj[VWp], VWp + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VP, VWp>; + using vertexId3 = Vertex::type, VWp, VZ>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<1>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<2>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<2>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g10n10_VVV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(cxx_diagrams:: + TripleVectorVertex::odd_permutation {}), 1.0i*vertexId3Val.value( + cxx_diagrams::TripleVectorVertex::odd_permutation {}), + ren_scale, + Finite); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: bar[Fd], Fd, bar[Fd] + { + using vertexId1 = Vertex::type, Fd, hh>; + using vertexId2 = Vertex::type, Fd, VZ>; + using vertexId3 = Vertex::type, Fd, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {3.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + auto temp_result = symmetryFac * colorFac * calculate_diagram_SVV_t1g1n1_FFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), -1.0i*vertexId2Val.right() + , -1.0i*vertexId2Val.left(), -1.0i*vertexId3Val.right(), -1.0i*vertexId3Val. + left(), + ren_scale); + if (static_cast(flexibledecay_settings.get(FlexibleDecay_settings::include_higher_order_corrections)) > 0 && + vertexId1::template indices_of_field<0>(indexId1) == vertexId1::template indices_of_field<1>(indexId1) && + vertexId2::template indices_of_field<0>(indexId2) == vertexId2::template indices_of_field<1>(indexId2) && + vertexId3::template indices_of_field<0>(indexId3) == vertexId3::template indices_of_field<1>(indexId3) + && result.m_decay/mInternal1 < 0.8 && result.m_vector_2/result.m_decay < 0.75 + ) { + const double correction_S = 1 - get_alphas(context)/Pi; + temp_result.form_factor_g = correction_S * temp_result.form_factor_g; + temp_result.form_factor_11 = correction_S * temp_result.form_factor_11; + temp_result.form_factor_12 = correction_S * temp_result.form_factor_12; + temp_result.form_factor_21 = correction_S * temp_result.form_factor_21; + temp_result.form_factor_22 = correction_S * temp_result.form_factor_22; + } + result += temp_result; + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: bar[Fe], Fe, bar[Fe] + { + using vertexId1 = Vertex::type, Fe, hh>; + using vertexId2 = Vertex::type, Fe, VZ>; + using vertexId3 = Vertex::type, Fe, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g1n1_FFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), -1.0i*vertexId2Val.right() + , -1.0i*vertexId2Val.left(), -1.0i*vertexId3Val.right(), -1.0i*vertexId3Val. + left(), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: bar[Fu], Fu, bar[Fu] + { + using vertexId1 = Vertex::type, Fu, hh>; + using vertexId2 = Vertex::type, Fu, VZ>; + using vertexId3 = Vertex::type, Fu, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {3.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + auto temp_result = symmetryFac * colorFac * calculate_diagram_SVV_t1g1n1_FFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), -1.0i*vertexId2Val.right() + , -1.0i*vertexId2Val.left(), -1.0i*vertexId3Val.right(), -1.0i*vertexId3Val. + left(), + ren_scale); + if (static_cast(flexibledecay_settings.get(FlexibleDecay_settings::include_higher_order_corrections)) > 0 && + vertexId1::template indices_of_field<0>(indexId1) == vertexId1::template indices_of_field<1>(indexId1) && + vertexId2::template indices_of_field<0>(indexId2) == vertexId2::template indices_of_field<1>(indexId2) && + vertexId3::template indices_of_field<0>(indexId3) == vertexId3::template indices_of_field<1>(indexId3) + && result.m_decay/mInternal1 < 0.8 && result.m_vector_2/result.m_decay < 0.75 + ) { + const double correction_S = 1 - get_alphas(context)/Pi; + temp_result.form_factor_g = correction_S * temp_result.form_factor_g; + temp_result.form_factor_11 = correction_S * temp_result.form_factor_11; + temp_result.form_factor_12 = correction_S * temp_result.form_factor_12; + temp_result.form_factor_21 = correction_S * temp_result.form_factor_21; + temp_result.form_factor_22 = correction_S * temp_result.form_factor_22; + } + result += temp_result; + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: gWp, bar[gWp], gWp + { + using vertexId1 = Vertex::type, gWp, hh>; + using vertexId2 = Vertex::type, gWp, VZ>; + using vertexId3 = Vertex::type, gWp, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g3n3_UUU( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), -1.0i*vertexId2Val.value(1), -1.0i*vertexId3Val. + value(1), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: gWpC, bar[gWpC], gWpC + { + using vertexId1 = Vertex::type, gWpC, hh>; + using vertexId2 = Vertex::type, gWpC, VZ>; + using vertexId3 = Vertex::type, gWpC, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g3n3_UUU( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), -1.0i*vertexId2Val.value(1), -1.0i*vertexId3Val. + value(1), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[Hp], Hp, conj[Hp] + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VZ>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<2>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g2n2_SSS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(1, 0), 1.0i*vertexId3Val. + value(0, 1), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: Hp, conj[Hp], VWp + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VWp, VZ>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<2>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g4n4_SSV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val.value() + , + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: Hp, conj[VWp], Hp + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VZ>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<2>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g5n5_SVS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(0, 1), 1.0i*vertexId2Val.value(0, 1), 1.0i*vertexId3Val + .value(), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: Hp, conj[VWp], VWp + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VWp, VZ>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<2>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g7n7_SVV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(0, 1), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val. + value(cxx_diagrams::TripleVectorVertex::odd_permutation {}), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: VWp, conj[Hp], Hp + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VZ>; + using vertexId3 = Vertex::type, VP, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<1>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g6n6_VSS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(0, 1), 1.0i*vertexId2Val.value(1, 0), 1.0i*vertexId3Val + .value(), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: VWp, conj[Hp], VWp + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VWp, VZ>; + using vertexId3 = Vertex::type, VP, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<1>(indexId3); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<2>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g8n8_VSV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(0, 1), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val. + value(cxx_diagrams::TripleVectorVertex::odd_permutation {}), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: VWp, conj[VWp], Hp + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VP, VWp>; + using vertexId3 = Vertex::type, VZ>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<1>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<2>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<2>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g9n9_VVS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val.value() + , + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[VWp], VWp, conj[VWp] + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VP, VWp>; + using vertexId3 = Vertex::type, VWp, VZ>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<1>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<2>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<2>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t1g10n10_VVV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(cxx_diagrams:: + TripleVectorVertex::even_permutation {}), 1.0i*vertexId3Val.value( + cxx_diagrams::TripleVectorVertex::even_permutation {}), + ren_scale, + Finite); + } + } + } + } + } + + // topology T3 + // internal particles in the diagram: VZ, Hp + { + using vertexId1 = Vertex; + using vertexId2 = Vertex::type, VP, VZ>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<1>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<3>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t3g1n13_VS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), + ren_scale); + } + } + } + } + + // topology T3 + // internal particles in the diagram: VZ, VWp + { + using vertexId1 = Vertex; + using vertexId2 = Vertex::type, VP, VWp, VZ>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<1>(indexId2); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<1>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<3>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId2::template indices_of_field<2>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t3g2n14_VV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value2(), 1.0i*vertexId2Val.value3 + (), 1.0i*vertexId2Val.value1(), + ren_scale, + Finite); + } + } + } + } + + // topology T4 + // internal particles in the diagram: Hp, conj[Hp] + { + using vertexId1 = Vertex::type>; + using vertexId2 = Vertex::type, VP, VZ>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<3>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t4g1n15_SS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), + ren_scale); + } + } + } + } + + // topology T4 + // internal particles in the diagram: VWp, conj[VWp] + { + using vertexId1 = Vertex::type, VWp>; + using vertexId2 = Vertex::type, VP, VWp, VZ>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<1>(indexId2); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<3>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<2>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t4g2n16_VV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value2(), 1.0i*vertexId2Val.value1 + (), 1.0i*vertexId2Val.value3(), + ren_scale, + Finite); + } + } + } + } + + // topology T6 + // internal particles in the diagram: Hp, conj[VWp] + { + using vertexId1 = Vertex::type, VP, VWp>; + using vertexId2 = Vertex::type, VZ>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId2::template indices_of_field<0>(indexId2); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<3>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<2>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t6g1n19_SV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), + ren_scale); + } + } + } + } + + // topology T6 + // internal particles in the diagram: conj[Hp], VWp + { + using vertexId1 = Vertex::type, VP>; + using vertexId2 = Vertex::type, VWp, VZ>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId2::template indices_of_field<0>(indexId2); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<2>(indexId1); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<3>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<2>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t6g1n19_SV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), + ren_scale); + } + } + } + } + + // topology T7 + // internal particles in the diagram: Hp, conj[VWp] + { + using vertexId1 = Vertex::type, VWp, VZ>; + using vertexId2 = Vertex::type, VP>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId2::template indices_of_field<0>(indexId2); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<3>(indexId2); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<2>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<2>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t7g1n20_SV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), + ren_scale); + } + } + } + } + + // topology T7 + // internal particles in the diagram: conj[Hp], VWp + { + using vertexId1 = Vertex::type, VZ>; + using vertexId2 = Vertex::type, VP, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId2::template indices_of_field<0>(indexId2); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<2>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<3>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId1::template indices_of_field<1>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t7g1n20_SV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), + ren_scale); + } + } + } + } + + // topology T9 + // internal particles in the diagram: VZ, Fd, bar[Fd] + { + using vertexId1 = Vertex::type, Fd, VZ>; + using vertexId2 = Vertex::type, Fd, VP>; + using vertexId3 = Vertex; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {3.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId3::template indices_of_field<0>(indexId3); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<1>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t9g6n36_VFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + -1.0i*vertexId1Val.right(), -1.0i*vertexId1Val.left(), -1.0i*vertexId2Val.right + (), -1.0i*vertexId2Val.left(), 1.0i*vertexId3Val.value(), + ren_scale); + } + } + } + } + } + + // topology T9 + // internal particles in the diagram: VZ, Fe, bar[Fe] + { + using vertexId1 = Vertex::type, Fe, VZ>; + using vertexId2 = Vertex::type, Fe, VP>; + using vertexId3 = Vertex; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId3::template indices_of_field<0>(indexId3); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<1>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t9g6n36_VFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + -1.0i*vertexId1Val.right(), -1.0i*vertexId1Val.left(), -1.0i*vertexId2Val.right + (), -1.0i*vertexId2Val.left(), 1.0i*vertexId3Val.value(), + ren_scale); + } + } + } + } + } + + // topology T9 + // internal particles in the diagram: VZ, Fu, bar[Fu] + { + using vertexId1 = Vertex::type, Fu, VZ>; + using vertexId2 = Vertex::type, Fu, VP>; + using vertexId3 = Vertex; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {3.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId3::template indices_of_field<0>(indexId3); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<1>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<1>(indexId1) != vertexId2::template indices_of_field<0>(indexId2)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId1::template indices_of_field<1>(indexId1))}; + const double mInternal3 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t9g6n36_VFF( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + -1.0i*vertexId1Val.right(), -1.0i*vertexId1Val.left(), -1.0i*vertexId2Val.right + (), -1.0i*vertexId2Val.left(), 1.0i*vertexId3Val.value(), + ren_scale); + } + } + } + } + } + + // topology T9 + // internal particles in the diagram: VZ, bar[gWp], gWp + { + using vertexId1 = Vertex; + using vertexId2 = Vertex::type, gWp, VZ>; + using vertexId3 = Vertex::type, gWp, VP>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<1>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<2>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t9g8n38_VUU( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), -1.0i*vertexId2Val.value(1), -1.0i*vertexId3Val. + value(1), + ren_scale); + } + } + } + } + } + + // topology T9 + // internal particles in the diagram: VZ, bar[gWpC], gWpC + { + using vertexId1 = Vertex; + using vertexId2 = Vertex::type, gWpC, VZ>; + using vertexId3 = Vertex::type, gWpC, VP>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<1>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<2>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t9g8n38_VUU( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), -1.0i*vertexId2Val.value(1), -1.0i*vertexId3Val. + value(1), + ren_scale); + } + } + } + } + } + + // topology T9 + // internal particles in the diagram: VZ, Hp, conj[Hp] + { + using vertexId1 = Vertex; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VZ>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<1>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId2::template indices_of_field<1>(indexId2))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t9g7n37_VSS( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(1, 0), 1.0i*vertexId3Val. + value(0, 1), + ren_scale); + } + } + } + } + } + + // topology T9 + // internal particles in the diagram: VZ, conj[Hp], VWp + { + using vertexId1 = Vertex; + using vertexId2 = Vertex::type, VP>; + using vertexId3 = Vertex::type, VWp, VZ>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<1>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId2::template indices_of_field<0>(indexId2))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t9g9n39_VSV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val.value() + , + ren_scale); + } + } + } + } + } + + // topology T9 + // internal particles in the diagram: VZ, Hp, conj[VWp] + { + using vertexId1 = Vertex; + using vertexId2 = Vertex::type, VP, VWp>; + using vertexId3 = Vertex::type, VZ>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<1>(indexId2); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<1>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<2>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t9g9n39_VSV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(), 1.0i*vertexId3Val.value() + , + ren_scale); + } + } + } + } + } + + // topology T9 + // internal particles in the diagram: VZ, VWp, conj[VWp] + { + using vertexId1 = Vertex; + using vertexId2 = Vertex::type, VP, VWp>; + using vertexId3 = Vertex::type, VWp, VZ>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + const auto externalFieldIndicesIn2 = vertexId2::template indices_of_field<1>(indexId2); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<1>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<2>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SVV_t9g10n40_VVV( + result.m_decay, result.m_vector_1, result.m_vector_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.value(), 1.0i*vertexId2Val.value(cxx_diagrams:: + TripleVectorVertex::even_permutation {}), 1.0i*vertexId3Val.value( + cxx_diagrams::TripleVectorVertex::even_permutation {}), + ren_scale, + Finite); + } + } + } + } + } + + return result; +} + +// hh -> {VZ, VZ} +template<> +Decay_amplitude_SVV CLASSNAME::calculate_amplitude( + const context_base& context, + typename cxx_diagrams::field_indices::type const& idx_1, + typename cxx_diagrams::field_indices::type const& idx_2, + typename cxx_diagrams::field_indices::type const& idx_3) const{ + + // amplitude type + Decay_amplitude_SVV result; + + // external particles' masses + result.m_decay = context.physical_mass(idx_1); + result.m_vector_1 = qedqcd.displayPoleMZ(); + result.m_vector_2 = qedqcd.displayPoleMZ(); + + // set the initial value of an amplitude to 0 + result.form_factor_g = std::complex(0., 0.); + result.form_factor_11 = std::complex(0., 0.); + result.form_factor_12 = std::complex(0., 0.); + result.form_factor_21 = std::complex(0., 0.); + result.form_factor_22 = std::complex(0., 0.); + result.form_factor_eps = std::complex(0., 0.); + // @todo correct prefactors + // tree-level amplitude + const auto indices = concatenate(idx_1, idx_2, idx_3); + const auto vertex = Vertex::evaluate(indices, context); + + result.form_factor_g += vertex.value(); + + return result; +} + +// hh -> {VWp, conj[VWp]} +template<> +Decay_amplitude_SVV CLASSNAME::calculate_amplitude::type>( + const context_base& context, + typename cxx_diagrams::field_indices::type const& idx_1, + typename cxx_diagrams::field_indices::type const& idx_2, + typename cxx_diagrams::field_indices::type >::type const& idx_3 +) const{ + + // amplitude type + Decay_amplitude_SVV result; + + // external particles' masses + result.m_decay = context.physical_mass(idx_1); + result.m_vector_2 = context.physical_mass(idx_2); + result.m_vector_1 = context.physical_mass::type>(idx_3); + + // set the initial value of an amplitude to 0 + result.form_factor_g = std::complex(0., 0.); + result.form_factor_11 = std::complex(0., 0.); + result.form_factor_12 = std::complex(0., 0.); + result.form_factor_21 = std::complex(0., 0.); + result.form_factor_22 = std::complex(0., 0.); + result.form_factor_eps = std::complex(0., 0.); + // @todo correct prefactors + // tree-level amplitude + const auto indices = concatenate(idx_1, idx_2, idx_3); + const auto vertex = Vertex::type>::evaluate(indices, context); + + result.form_factor_g += vertex.value(); + + return result; +} + +// hh -> {bar[Fv], Fv} +template<> +Decay_amplitude_SFF CLASSNAME::calculate_amplitude::type, Fv>( + const context_base& context, + typename cxx_diagrams::field_indices::type const& idx_1, + typename cxx_diagrams::field_indices::type >::type const& idx_2, + typename cxx_diagrams::field_indices::type const& idx_3) const { + + // amplitude type + Decay_amplitude_SFF result; + + // external particles' masses + result.m_decay = context.physical_mass(idx_1); + result.m_fermion_1 = context.physical_mass::type>(idx_2); + result.m_fermion_2 = context.physical_mass(idx_3); + + // set the initial value of an amplitude to 0 + result.form_factor_left = std::complex(0., 0.); + result.form_factor_right = std::complex(0., 0.); + + // FormCalc's Finite variable + constexpr double Finite {1.}; + + const double ren_scale {result.m_decay}; + + // ----------------- 1-loop contributions to the amplitude ----------------- + + // topology T1 + // internal particles in the diagram: bar[Fe], Fe, Hp + { + using vertexId1 = Vertex::type, Fv, typename conj::type>; + using vertexId2 = Vertex::type, Fe, hh>; + using vertexId3 = Vertex::type, Fe, Hp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<0>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + const double mInternal3 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SFF_t1g1n1_FFS( + result.m_decay, result.m_fermion_1, result.m_fermion_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), 1.0i*vertexId2Val.left(), + 1.0i*vertexId2Val.right(), 1.0i*vertexId3Val.left(), 1.0i*vertexId3Val.right + (), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: bar[Fe], Fe, VWp + { + using vertexId1 = Vertex::type, Fv, typename conj::type>; + using vertexId2 = Vertex::type, Fe, hh>; + using vertexId3 = Vertex::type, Fe, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId3::template indices_of_field<0>(indexId3); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + const double mInternal3 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SFF_t1g3n3_FFV( + result.m_decay, result.m_fermion_1, result.m_fermion_2, + mInternal1, mInternal2, mInternal3, + -1.0i*vertexId1Val.left(), -1.0i*vertexId1Val.right(), 1.0i*vertexId2Val.left() + , 1.0i*vertexId2Val.right(), -1.0i*vertexId3Val.right(), -1.0i*vertexId3Val. + left(), + ren_scale, + Finite); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[Hp], Hp, Fe + { + using vertexId1 = Vertex::type, Fv, typename conj::type>; + using vertexId2 = Vertex::type, Fe, Hp>; + using vertexId3 = Vertex::type>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId3::template indices_of_field<0>(indexId3); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<0>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId2::template indices_of_field<2>(indexId2))}; + const double mInternal3 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SFF_t1g2n2_SSF( + result.m_decay, result.m_fermion_1, result.m_fermion_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), 1.0i*vertexId2Val.left(), + 1.0i*vertexId2Val.right(), 1.0i*vertexId3Val.value(), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[Hp], VWp, Fe + { + using vertexId1 = Vertex::type, Fv, typename conj::type>; + using vertexId2 = Vertex::type, Fe, VWp>; + using vertexId3 = Vertex::type>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId3::template indices_of_field<0>(indexId3); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<0>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId2::template indices_of_field<2>(indexId2))}; + const double mInternal3 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SFF_t1g4n4_SVF( + result.m_decay, result.m_fermion_1, result.m_fermion_2, + mInternal1, mInternal2, mInternal3, + 1.0i*vertexId1Val.left(), 1.0i*vertexId1Val.right(), -1.0i*vertexId2Val.right() + , -1.0i*vertexId2Val.left(), 1.0i*vertexId3Val.value(0, 1), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[VWp], Hp, Fe + { + using vertexId1 = Vertex::type, Fv, typename conj::type>; + using vertexId2 = Vertex::type, Fe, Hp>; + using vertexId3 = Vertex::type, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId3::template indices_of_field<0>(indexId3); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<0>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId2::template indices_of_field<2>(indexId2))}; + const double mInternal3 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SFF_t1g5n5_VSF( + result.m_decay, result.m_fermion_1, result.m_fermion_2, + mInternal1, mInternal2, mInternal3, + -1.0i*vertexId1Val.left(), -1.0i*vertexId1Val.right(), 1.0i*vertexId2Val.left() + , 1.0i*vertexId2Val.right(), 1.0i*vertexId3Val.value(0, 1), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: conj[VWp], VWp, Fe + { + using vertexId1 = Vertex::type, Fv, typename conj::type>; + using vertexId2 = Vertex::type, Fe, VWp>; + using vertexId3 = Vertex::type, VWp>; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId3::template indices_of_field<0>(indexId3); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<0>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass::type>(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId2::template indices_of_field<2>(indexId2))}; + const double mInternal3 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SFF_t1g6n6_VVF( + result.m_decay, result.m_fermion_1, result.m_fermion_2, + mInternal1, mInternal2, mInternal3, + -1.0i*vertexId1Val.right(), -1.0i*vertexId1Val.left(), -1.0i*vertexId2Val.right + (), -1.0i*vertexId2Val.left(), 1.0i*vertexId3Val.value(), + ren_scale); + } + } + } + } + } + + // topology T1 + // internal particles in the diagram: VZ, VZ, Fv + { + using vertexId1 = Vertex::type, Fv, VZ>; + using vertexId2 = Vertex::type, Fv, VZ>; + using vertexId3 = Vertex; + + constexpr double symmetryFac {1.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId3::template indices_of_field<0>(indexId3); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId2::template indices_of_field<0>(indexId2); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId1::template indices_of_field<0>(indexId1) != vertexId2::template indices_of_field<1>(indexId2)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId2::template indices_of_field<2>(indexId2))}; + const double mInternal3 {context.mass::type>(vertexId1::template indices_of_field<0>(indexId1))}; + + result += symmetryFac * colorFac * calculate_diagram_SFF_t1g6n6_VVF( + result.m_decay, result.m_fermion_1, result.m_fermion_2, + mInternal1, mInternal2, mInternal3, + -1.0i*vertexId1Val.right(), -1.0i*vertexId1Val.left(), -1.0i*vertexId2Val.right + (), -1.0i*vertexId2Val.left(), 1.0i*vertexId3Val.value(), + ren_scale); + } + } + } + } + } + + // topology T10 + // internal particles in the diagram: Fd, bar[Fd], VZ + { + using vertexId1 = Vertex::type, Fv, VZ>; + using vertexId2 = Vertex::type, Fd, VZ>; + using vertexId3 = Vertex::type, Fd, hh>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {3.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<0>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<2>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SFF_t5g6n18_VFF( + result.m_decay, result.m_fermion_1, result.m_fermion_2, + mInternal1, mInternal2, mInternal3, + -1.0i*vertexId1Val.right(), -1.0i*vertexId1Val.left(), -1.0i*vertexId2Val.left( + ), -1.0i*vertexId2Val.right(), 1.0i*vertexId3Val.left(), 1.0i*vertexId3Val. + right(), + ren_scale); + } + } + } + } + } + + // topology T10 + // internal particles in the diagram: Fe, bar[Fe], VZ + { + using vertexId1 = Vertex::type, Fv, VZ>; + using vertexId2 = Vertex::type, Fe, VZ>; + using vertexId3 = Vertex::type, Fe, hh>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<0>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<2>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SFF_t5g6n18_VFF( + result.m_decay, result.m_fermion_1, result.m_fermion_2, + mInternal1, mInternal2, mInternal3, + -1.0i*vertexId1Val.right(), -1.0i*vertexId1Val.left(), -1.0i*vertexId2Val.left( + ), -1.0i*vertexId2Val.right(), 1.0i*vertexId3Val.left(), 1.0i*vertexId3Val. + right(), + ren_scale); + } + } + } + } + } + + // topology T10 + // internal particles in the diagram: Fu, bar[Fu], VZ + { + using vertexId1 = Vertex::type, Fv, VZ>; + using vertexId2 = Vertex::type, Fu, VZ>; + using vertexId3 = Vertex::type, Fu, hh>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {3.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId3::template indices_of_field<2>(indexId3); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<0>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId2::template indices_of_field<2>(indexId2)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SFF_t5g6n18_VFF( + result.m_decay, result.m_fermion_1, result.m_fermion_2, + mInternal1, mInternal2, mInternal3, + -1.0i*vertexId1Val.right(), -1.0i*vertexId1Val.left(), -1.0i*vertexId2Val.left( + ), -1.0i*vertexId2Val.right(), 1.0i*vertexId3Val.left(), 1.0i*vertexId3Val. + right(), + ren_scale); + } + } + } + } + } + + // topology T10 + // internal particles in the diagram: bar[gWp], gWp, VZ + { + using vertexId1 = Vertex::type, Fv, VZ>; + using vertexId2 = Vertex::type, gWp, hh>; + using vertexId3 = Vertex::type, gWp, VZ>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<0>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SFF_t5g8n20_VUU( + result.m_decay, result.m_fermion_1, result.m_fermion_2, + mInternal1, mInternal2, mInternal3, + -1.0i*vertexId1Val.right(), -1.0i*vertexId1Val.left(), 1.0i*vertexId2Val.value( + ), -1.0i*vertexId3Val.value(1), + ren_scale); + } + } + } + } + } + + // topology T10 + // internal particles in the diagram: bar[gWpC], gWpC, VZ + { + using vertexId1 = Vertex::type, Fv, VZ>; + using vertexId2 = Vertex::type, gWpC, hh>; + using vertexId3 = Vertex::type, gWpC, VZ>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId2::template indices_of_field<2>(indexId2); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<0>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<0>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<0>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SFF_t5g8n20_VUU( + result.m_decay, result.m_fermion_1, result.m_fermion_2, + mInternal1, mInternal2, mInternal3, + -1.0i*vertexId1Val.right(), -1.0i*vertexId1Val.left(), 1.0i*vertexId2Val.value( + ), -1.0i*vertexId3Val.value(1), + ren_scale); + } + } + } + } + } + + // topology T10 + // internal particles in the diagram: Hp, conj[Hp], VZ + { + using vertexId1 = Vertex::type, Fv, VZ>; + using vertexId2 = Vertex::type>; + using vertexId3 = Vertex::type, VZ>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId2::template indices_of_field<0>(indexId2); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<0>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId2::template indices_of_field<2>(indexId2))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SFF_t5g7n19_VSS( + result.m_decay, result.m_fermion_1, result.m_fermion_2, + mInternal1, mInternal2, mInternal3, + -1.0i*vertexId1Val.right(), -1.0i*vertexId1Val.left(), 1.0i*vertexId2Val.value( + ), 1.0i*vertexId3Val.value(0, 1), + ren_scale); + } + } + } + } + } + + // topology T10 + // internal particles in the diagram: conj[Hp], VWp, VZ + { + using vertexId1 = Vertex::type, Fv, VZ>; + using vertexId2 = Vertex::type>; + using vertexId3 = Vertex::type, VWp, VZ>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId2::template indices_of_field<0>(indexId2); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<0>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass(vertexId2::template indices_of_field<1>(indexId2))}; + const double mInternal3 {context.mass::type>(vertexId2::template indices_of_field<2>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SFF_t5g9n21_VSV( + result.m_decay, result.m_fermion_1, result.m_fermion_2, + mInternal1, mInternal2, mInternal3, + -1.0i*vertexId1Val.right(), -1.0i*vertexId1Val.left(), 1.0i*vertexId2Val.value( + 0, 1), 1.0i*vertexId3Val.value(), + ren_scale); + } + } + } + } + } + + // topology T10 + // internal particles in the diagram: Hp, conj[VWp], VZ + { + using vertexId1 = Vertex::type, Fv, VZ>; + using vertexId2 = Vertex::type, VWp>; + using vertexId3 = Vertex::type, VZ>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId2::template indices_of_field<0>(indexId2); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<0>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId2::template indices_of_field<1>(indexId2))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<2>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SFF_t5g9n21_VSV( + result.m_decay, result.m_fermion_1, result.m_fermion_2, + mInternal1, mInternal2, mInternal3, + -1.0i*vertexId1Val.right(), -1.0i*vertexId1Val.left(), 1.0i*vertexId2Val.value( + 0, 1), 1.0i*vertexId3Val.value(), + ren_scale); + } + } + } + } + } + + // topology T10 + // internal particles in the diagram: VWp, conj[VWp], VZ + { + using vertexId1 = Vertex::type, Fv, VZ>; + using vertexId2 = Vertex::type, VWp>; + using vertexId3 = Vertex::type, VWp, VZ>; + + constexpr double symmetryFac {2.000000000000000}; + + constexpr double colorFac {1.000000000000000}; + + // loops over vertices' indices + for (const auto& indexId1: index_range()) { + for (const auto& indexId2: index_range()) { + for (const auto& indexId3: index_range()) { + + // skip indices that don't match external indices + const auto externalFieldIndicesIn1 = vertexId2::template indices_of_field<0>(indexId2); + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<0>(indexId1); + + if (externalFieldIndicesIn1 != idx_1 || externalFieldIndicesIn2 != idx_2 || externalFieldIndicesIn3 != idx_3) + continue; + + // connect internal particles in vertices + if (vertexId1::template indices_of_field<2>(indexId1) != vertexId3::template indices_of_field<2>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<1>(indexId2) != vertexId3::template indices_of_field<1>(indexId3)) + continue; + + if (vertexId2::template indices_of_field<2>(indexId2) != vertexId3::template indices_of_field<0>(indexId3)) + continue; + + auto const vertexId1Val = vertexId1::evaluate(indexId1, context); + auto const vertexId2Val = vertexId2::evaluate(indexId2, context); + auto const vertexId3Val = vertexId3::evaluate(indexId3, context); + + if (!vertexId1Val.isZero() && !vertexId2Val.isZero() && !vertexId3Val.isZero()) { + // internal masses + const double mInternal1 {context.mass(vertexId1::template indices_of_field<2>(indexId1))}; + const double mInternal2 {context.mass::type>(vertexId2::template indices_of_field<1>(indexId2))}; + const double mInternal3 {context.mass(vertexId2::template indices_of_field<2>(indexId2))}; + + result += symmetryFac * colorFac * calculate_diagram_SFF_t5g10n22_VVV( + result.m_decay, result.m_fermion_1, result.m_fermion_2, + mInternal1, mInternal2, mInternal3, + -1.0i*vertexId1Val.right(), -1.0i*vertexId1Val.left(), 1.0i*vertexId2Val.value( + ), 1.0i*vertexId3Val.value(cxx_diagrams::TripleVectorVertex:: + even_permutation {}), + ren_scale); + } + } + } + } + } + + return result; +} + +// hh -> {bar[Fd], Fd} +template<> +Decay_amplitude_SFF CLASSNAME::calculate_amplitude::type, Fd>( + const context_base& context, + typename cxx_diagrams::field_indices::type const& idx_1, + typename cxx_diagrams::field_indices::type >::type const& idx_2, + typename cxx_diagrams::field_indices::type const& idx_3) const{ + + // amplitude type + Decay_amplitude_SFF result; + + // external particles' masses + result.m_decay = context.physical_mass(idx_1); + result.m_fermion_1 = context.physical_mass::type>(idx_2); + result.m_fermion_2 = context.physical_mass(idx_3); + + // set the initial value of an amplitude to 0 + result.form_factor_left = std::complex(0., 0.); + result.form_factor_right = std::complex(0., 0.); + // @todo correct prefactors + // tree-level amplitude + const auto indices = concatenate(idx_3, idx_2, idx_1); + const auto vertex = Vertex::type, Fd, hh>::evaluate(indices, context); + + result.form_factor_left += vertex.left(); + result.form_factor_right += vertex.right(); + + return result; +} + +// hh -> {bar[Fu], Fu} +template<> +Decay_amplitude_SFF CLASSNAME::calculate_amplitude::type, Fu>( + const context_base& context, + typename cxx_diagrams::field_indices::type const& idx_1, + typename cxx_diagrams::field_indices::type >::type const& idx_2, + typename cxx_diagrams::field_indices::type const& idx_3) const{ + + // amplitude type + Decay_amplitude_SFF result; + + // external particles' masses + result.m_decay = context.physical_mass(idx_1); + result.m_fermion_1 = context.physical_mass::type>(idx_2); + result.m_fermion_2 = context.physical_mass(idx_3); + + // set the initial value of an amplitude to 0 + result.form_factor_left = std::complex(0., 0.); + result.form_factor_right = std::complex(0., 0.); + // @todo correct prefactors + // tree-level amplitude + const auto indices = concatenate(idx_3, idx_2, idx_1); + const auto vertex = Vertex::type, Fu, hh>::evaluate(indices, context); + + result.form_factor_left += vertex.left(); + result.form_factor_right += vertex.right(); + + return result; +} + +// -------- specializations for decays needing higher order SM corrections -------- + +// List of potential Z boson decay products excluding pure SM decays +typedef boost::mpl::list< +> BSMForZdecay; + +// List of potential W boson decay products excluding pure SM decays +typedef boost::mpl::list< +> BSMForWdecay; + +template +bool check_3body_Vff_decay(const context_base& context, double mHOS, const typename field_indices::type& idx) { + bool found_problem = false; + const double mVOS {context.physical_mass(idx)}; + boost::mpl::for_each( + [mHOS, mVOS, &idx, &context, &found_problem](auto arg) { + using T = decltype(arg); + using Field1 = typename boost::mpl::at>::type; + using Field2 = typename boost::mpl::at>::type; + using vertexId1 = Vertex; + for (const auto& indexId1: index_range()) { + const auto externalFieldIndicesIn1 = vertexId1::template indices_of_field<0>(indexId1); + if (externalFieldIndicesIn1 != idx) { + continue; + } + const auto externalFieldIndicesIn2 = vertexId1::template indices_of_field<1>(indexId1); + const auto externalFieldIndicesIn3 = vertexId1::template indices_of_field<2>(indexId1); + + const double mInternal2 {context.physical_mass(externalFieldIndicesIn2)}; + const double mInternal3 {context.physical_mass(externalFieldIndicesIn3)}; + + if (mHOS-mVOS > mInternal2 + mInternal3 + && !Vertex::evaluate(indexId1, context).isZero()) { + found_problem = true; + } + } + } + ); + return found_problem; +} + +#include "decays/specializations/H/decay_H_to_ZZ.inc" +#include "decays/specializations/H/decay_H_to_WpWm.inc" +#include "decays/specializations/H/decay_H_to_gg.inc" +#include "decays/specializations/H/decay_H_to_AA.inc" +#include "decays/specializations/H/decay_H_to_AZ.inc" +#include "decays/specializations/H/decay_H_to_ubaru.inc" +#include "decays/specializations/H/decay_H_to_dbard.inc" +#include "decays/specializations/H/decay_H_to_lbarl.inc" + +void CLASSNAME::calculate_hh_decays() +{ + + if (run_to_decay_particle_scale) { + auto decay_mass = PHYSICAL(Mhh); + if (decay_mass > qedqcd.displayPoleMZ()) { + try { + model.run_to(decay_mass); + } + catch (const NonPerturbativeRunningError& e) { + WARNING(std::string(e.what()) + " λ(μ=" + std::to_string(decay_mass) + " GeV) = " + std::to_string(model.get_Lambdax())); + } + model.solve_ewsb_tree_level(); + model.calculate_DRbar_masses(); + } + } + + context_base context {model}; + + auto& decays = decay_table.get_hh_decays(); + + if (context.physical_mass(std::array{}) > context.physical_mass< + VG>(std::array {}) + context.physical_mass(std::array + {})) { + decays.set_decay(partial_width_hh_to_VGVG(model), {standard_model_info:: + get_pdg_code_for_particle(standard_model_info::VG), standard_model_info:: + get_pdg_code_for_particle(standard_model_info::VG)}, create_process_string({},{},{})); + } + + if (context.physical_mass(std::array{}) > context.physical_mass< + VP>(std::array {}) + context.physical_mass(std::array + {})) { + decays.set_decay(partial_width_hh_to_VPVP(model), {standard_model_info:: + get_pdg_code_for_particle(standard_model_info::VP), standard_model_info:: + get_pdg_code_for_particle(standard_model_info::VP)}, create_process_string({},{},{})); + } + + if (context.physical_mass(std::array{}) > context.physical_mass< + VP>(std::array {}) + context.physical_mass(std::array + {})) { + decays.set_decay(partial_width_hh_to_VPVZ(model), {standard_model_info:: + get_pdg_code_for_particle(standard_model_info::VP), standard_model_info:: + get_pdg_code_for_particle(standard_model_info::VZ)}, create_process_string({},{},{})); + } + decays.set_decay(partial_width_hh_to_VZVZ(model), {standard_model_info:: + get_pdg_code_for_particle(standard_model_info::VZ), standard_model_info:: + get_pdg_code_for_particle(standard_model_info::VZ)}, create_process_string({},{},{})); + decays.set_decay(partial_width_hh_to_conjVWpVWp(model), {- + standard_model_info::get_pdg_code_for_particle(standard_model_info::VWp), standard_model_info:: + get_pdg_code_for_particle(standard_model_info::VWp)}, create_process_string::type, VWp>({},{},{})); + + for (int gO1 = 0; gO1 < 3; ++gO1) { + for (int gO2 = 0; gO2 < 3; ++gO2) { + if (context.physical_mass(std::array{}) < context. + physical_mass::type>(std::array {gO1}) + + context.physical_mass(std::array {gO2})) { + continue; + } + decays.set_decay(partial_width_hh_to_barFvFv(model, gO1, gO2 + ), {-standard_model_info::get_pdg_code_for_particle(standard_model_info::Fv, gO1), standard_model_info + ::get_pdg_code_for_particle(standard_model_info::Fv, gO2)}, + create_process_string::type, Fv>({},{gO1},{gO2 + })); + + } + } + + for (int gO1 = 0; gO1 < 3; ++gO1) { + for (int gO2 = 0; gO2 < 3; ++gO2) { + if (context.physical_mass(std::array{}) < context. + physical_mass::type>(std::array {gO1}) + + context.physical_mass(std::array {gO2})) { + continue; + } + decays.set_decay(partial_width_hh_to_barFdFd(model, gO1, gO2 + ), {-standard_model_info::get_pdg_code_for_particle(standard_model_info::Fd, gO1), standard_model_info + ::get_pdg_code_for_particle(standard_model_info::Fd, gO2)}, + create_process_string::type, Fd>({},{gO1},{gO2 + })); + + } + } + + for (int gO1 = 0; gO1 < 3; ++gO1) { + for (int gO2 = 0; gO2 < 3; ++gO2) { + decays.set_decay(partial_width_hh_to_barFuFu(model, gO1, gO2 + ), {-standard_model_info::get_pdg_code_for_particle(standard_model_info::Fu, gO1), standard_model_info + ::get_pdg_code_for_particle(standard_model_info::Fu, gO2)}, + create_process_string::type, Fu>({},{gO1},{gO2 + })); + + } + } + + for (int gO1 = 0; gO1 < 3; ++gO1) { + for (int gO2 = 0; gO2 < 3; ++gO2) { + if (context.physical_mass(std::array{}) < context. + physical_mass::type>(std::array {gO1}) + + context.physical_mass(std::array {gO2})) { + continue; + } + decays.set_decay(partial_width_hh_to_barFeFe(model, gO1, gO2 + ), {-standard_model_info::get_pdg_code_for_particle(standard_model_info::Fe, gO1), standard_model_info + ::get_pdg_code_for_particle(standard_model_info::Fe, gO2)}, + create_process_string::type, Fe>({},{gO1},{gO2 + })); + + } + } + + if (flexibledecay_settings.get(FlexibleDecay_settings::call_higgstools) || + flexibledecay_settings.get(FlexibleDecay_settings::call_lilith) || + flexibledecay_settings.get(FlexibleDecay_settings::print_effc_block)) + { + auto found = std::find_if(std::begin(neutral_higgs_effc), std::end( + neutral_higgs_effc), [](NeutralHiggsEffectiveCouplings const& effC) { + return effC.particle == field_as_string({});}); + found->width = decays.get_total_width(); + found->mass = context.physical_mass({}); + const auto _indices = concatenate(typename cxx_diagrams::field_indices::type {}, typename cxx_diagrams::field_indices::type {}, typename cxx_diagrams::field_indices::type {}, typename cxx_diagrams::field_indices::type {}); + const auto h4vertex = Vertex::evaluate(_indices, context); + found->lam = std::real(h4vertex.value()); + } +} + +double CLASSNAME::partial_width_hh_to_VGVG(Standard_model const& model) +{ + context_base context {model}; + const typename field_indices::type in_indices {}; + const typename field_indices::type out_1_indices {}; + const typename field_indices::type out_2_indices {}; + + return get_partial_width(context, in_indices, out_1_indices, out_2_indices); +} + +double CLASSNAME::partial_width_hh_to_VPVP(Standard_model const& model) +{ + context_base context {model}; + const typename field_indices::type in_indices {}; + const typename field_indices::type out_1_indices {}; + const typename field_indices::type out_2_indices {}; + + return get_partial_width(context, in_indices, out_1_indices, out_2_indices); +} + +double CLASSNAME::partial_width_hh_to_VPVZ(Standard_model const& model) +{ + context_base context {model}; + const typename field_indices::type in_indices {}; + const typename field_indices::type out_1_indices {}; + const typename field_indices::type out_2_indices {}; + + return get_partial_width(context, in_indices, out_1_indices, out_2_indices); +} + +double CLASSNAME::partial_width_hh_to_VZVZ(Standard_model const& model) +{ + context_base context {model}; + const typename field_indices::type in_indices {}; + const typename field_indices::type out_1_indices {}; + const typename field_indices::type out_2_indices {}; + + return get_partial_width(context, in_indices, out_1_indices, out_2_indices); +} + +double CLASSNAME::partial_width_hh_to_conjVWpVWp(Standard_model const& model) +{ + context_base context {model}; + const typename field_indices::type in_indices {}; + const typename field_indices::type out_1_indices {}; + const typename field_indices::type>::type out_2_indices {}; + + return get_partial_width::type>(context, in_indices, out_1_indices, out_2_indices); +} + +double CLASSNAME::partial_width_hh_to_barFvFv(Standard_model const& model, int gO1, int gO2) +{ + context_base context {model}; + const typename field_indices::type in_indices {}; + const typename field_indices::type>::type out_1_indices {{gO1}}; + const typename field_indices::type out_2_indices {{gO2}}; + + return get_partial_width::type, Fv>(context, in_indices, out_1_indices, out_2_indices); +} + +double CLASSNAME::partial_width_hh_to_barFdFd(Standard_model const& model, int gO1, int gO2) +{ + context_base context {model}; + const typename field_indices::type in_indices {}; + const typename field_indices::type>::type out_1_indices {{gO1}}; + const typename field_indices::type out_2_indices {{gO2}}; + + return get_partial_width::type, Fd>(context, in_indices, out_1_indices, out_2_indices); +} + +double CLASSNAME::partial_width_hh_to_barFuFu(Standard_model const& model, int gO1, int gO2) +{ + context_base context {model}; + const typename field_indices::type in_indices {}; + const typename field_indices::type>::type out_1_indices {{gO1}}; + const typename field_indices::type out_2_indices {{gO2}}; + + return get_partial_width::type, Fu>(context, in_indices, out_1_indices, out_2_indices); +} + +double CLASSNAME::partial_width_hh_to_barFeFe(Standard_model const& model, int gO1, int gO2) +{ + context_base context {model}; + const typename field_indices::type in_indices {}; + const typename field_indices::type>::type out_1_indices {{gO1}}; + const typename field_indices::type out_2_indices {{gO2}}; + + return get_partial_width::type, Fe>(context, in_indices, out_1_indices, out_2_indices); +} + + +} // namespace flexiblesusy diff --git a/model_specific/SM/decays/standard_model_decays.hpp b/model_specific/SM/decays/standard_model_decays.hpp new file mode 100644 index 0000000000..ecaa67c19b --- /dev/null +++ b/model_specific/SM/decays/standard_model_decays.hpp @@ -0,0 +1,226 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + + +/** + * @file standard_model_decays.hpp + * + * @brief contains class for calculating particle decays + * + * This file was generated with FlexibleSUSY 2.7.1 and SARAH 4.14.5 . + */ + +#ifndef STANDARDMODEL_DECAYS_H +#define STANDARDMODEL_DECAYS_H + +#include "lowe.h" +#include "wrappers.hpp" +#include "error.hpp" +#include "physical_input.hpp" +#include "decays/flexibledecay_settings.hpp" +#include "decays/flexibledecay_problems.hpp" + +#include "standard_model.hpp" +#include "cxx_qft/standard_model_qft.hpp" +#include "decays/decay_amplitudes.hpp" +#include "standard_model_decay_table.hpp" +#include "config.h" + +#include +#include +#include +#include + +namespace flexiblesusy { + +class Standard_model_decays { +public: + Standard_model_decays() = default; + Standard_model_decays(standard_model::Standard_model model_, softsusy::QedQcd const& qedqcd_, + Physical_input const& physical_input_, + FlexibleDecay_settings const& flexibledecay_settings_) + : model(model_) + , qedqcd(qedqcd_) + , physical_input(physical_input_) + , flexibledecay_settings(flexibledecay_settings_) + {} + Standard_model_decays(const Standard_model_decays&) = default; + Standard_model_decays(Standard_model_decays&&) = default; + ~Standard_model_decays() = default; + Standard_model_decays& operator=(const Standard_model_decays&) = default; + Standard_model_decays& operator=(Standard_model_decays&&) = default; + + const standard_model_decay_table& get_decay_table() const; + const FlexibleDecay_problems& get_problems() const; + + void clear(); + void clear_problems(); + void calculate_decays(); + EffectiveCoupling_list const& get_neutral_higgs_effc() const {return neutral_higgs_effc;}; + std::vector> get_effhiggscouplings_block_input() const { + return effhiggscouplings_block_input; + } + + const Decays_list& get_hh_decays() const { return decay_table.get_hh_decays(); + } + void calculate_hh_decays(); + +double partial_width_hh_to_VGVG(standard_model::Standard_model const&); +double partial_width_hh_to_VPVP(standard_model::Standard_model const&); +double partial_width_hh_to_VPVZ(standard_model::Standard_model const&); +double partial_width_hh_to_VZVZ(standard_model::Standard_model const&); +double partial_width_hh_to_conjVWpVWp(standard_model::Standard_model const&); +double partial_width_hh_to_barFvFv(standard_model::Standard_model const&, int, int); +double partial_width_hh_to_barFdFd(standard_model::Standard_model const&, int, int); +double partial_width_hh_to_barFuFu(standard_model::Standard_model const&, int, int); +double partial_width_hh_to_barFeFe(standard_model::Standard_model const&, int, int); + +private: + standard_model::Standard_model model{}; + softsusy::QedQcd qedqcd{}; + Physical_input physical_input; + FlexibleDecay_settings flexibledecay_settings {}; + bool run_to_decay_particle_scale {true}; + standard_model_decay_table decay_table{}; + FlexibleDecay_problems problems{}; + EffectiveCoupling_list neutral_higgs_effc {}; + + template + typename Decay_amplitude_type::type + calculate_amplitude( + const standard_model_cxx_diagrams::context_base&, + const typename cxx_diagrams::field_indices::type&, + const typename cxx_diagrams::field_indices::type&, + const typename cxx_diagrams::field_indices::type&) const; + + template + double amplitude_squared(standard_model_cxx_diagrams::context_base const& context, + typename cxx_diagrams::field_indices::type const& indexIn, + typename cxx_diagrams::field_indices::type const& indexOut1, + typename cxx_diagrams::field_indices::type const& indexOut2) const; + + template + double get_partial_width( + const standard_model_cxx_diagrams::context_base&, + typename cxx_diagrams::field_indices::type const&, + typename cxx_diagrams::field_indices::type const&, + typename cxx_diagrams::field_indices::type const&); + double get_alphas(standard_model_cxx_diagrams::context_base const&) const; + double get_alpha(standard_model_cxx_diagrams::context_base const&) const; + std::vector> effhiggscouplings_block_input {}; +}; + +template<> +Decay_amplitude_SVV Standard_model_decays::calculate_amplitude(const standard_model_cxx_diagrams::context_base&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type&) const; + +template<> +Decay_amplitude_SVV Standard_model_decays::calculate_amplitude(const standard_model_cxx_diagrams::context_base&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type&) const; + +template<> +Decay_amplitude_SVV Standard_model_decays::calculate_amplitude(const standard_model_cxx_diagrams::context_base&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type&) const; + +template<> +Decay_amplitude_SVV Standard_model_decays::calculate_amplitude(const standard_model_cxx_diagrams::context_base&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type&) const; + +template<> +Decay_amplitude_SVV Standard_model_decays::calculate_amplitude::type, standard_model_cxx_diagrams::fields::VWp>(const standard_model_cxx_diagrams::context_base&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type >::type&, const typename cxx_diagrams::field_indices::type&) const; + +template<> +Decay_amplitude_SFF Standard_model_decays::calculate_amplitude::type, standard_model_cxx_diagrams::fields::Fv>(const standard_model_cxx_diagrams::context_base&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type >::type&, const typename cxx_diagrams::field_indices::type&) const; + +template<> +Decay_amplitude_SFF Standard_model_decays::calculate_amplitude::type, standard_model_cxx_diagrams::fields::Fd>(const standard_model_cxx_diagrams::context_base&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type >::type&, const typename cxx_diagrams::field_indices::type&) const; + +template<> +Decay_amplitude_SFF Standard_model_decays::calculate_amplitude::type, standard_model_cxx_diagrams::fields::Fu>(const standard_model_cxx_diagrams::context_base&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type >::type&, const typename cxx_diagrams::field_indices::type&) const; + + +template +double +Standard_model_decays::amplitude_squared(standard_model_cxx_diagrams::context_base const& context, + typename cxx_diagrams::field_indices::type const& indexIn, + typename cxx_diagrams::field_indices::type const& indexOut1, + typename cxx_diagrams::field_indices::type const& indexOut2) const +{ + + const auto mat_elem = calculate_amplitude( + context, indexIn, indexOut1, indexOut2); + return mat_elem.square(); +} + +// generic decay of FieldIn -> FieldOut1 FieldOut2 +template +double Standard_model_decays::get_partial_width( + const standard_model_cxx_diagrams::context_base& context, + typename cxx_diagrams::field_indices::type const& indexIn, + typename cxx_diagrams::field_indices::type const& indexOut1, + typename cxx_diagrams::field_indices::type const& indexOut2 + ) +{ + + // on-shell masses + const double mIn = context.physical_mass(indexIn); + const double mOut1 = context.physical_mass(indexOut1); + const double mOut2 = context.physical_mass(indexOut2); + + // is decay kinematically allowed? + if(mIn < mOut1 + mOut2) { + WARNING("Called kinematically forbidden decay"); + return 0.; + } + + // phase space without symmetry factor + const double ps = 1./(8.*Pi) * std::sqrt(KallenLambda(1., Sqr(mOut1/mIn), Sqr(mOut2/mIn))); + + // phase space symmetry factor + const double ps_symmetry = + final_state_symmetry_factor(indexOut1, indexOut2); + + // color factor + constexpr double color_factor = squared_color_generator(); + + // matrix element squared + const auto mat_elem_sq = amplitude_squared( + context, indexIn, indexOut1, indexOut2); + + // flux * phase space factor * symmetry factor * color factor * |matrix element|^2 + const auto result = 0.5/mIn * ps * ps_symmetry * color_factor * mat_elem_sq; + + return result; +} + +template <> +double Standard_model_decays::get_partial_width(const standard_model_cxx_diagrams::context_base&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type&); +template <> +double Standard_model_decays::get_partial_width::type,standard_model_cxx_diagrams::fields::VWp >(const standard_model_cxx_diagrams::context_base&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type >::type&, const typename cxx_diagrams::field_indices::type&); +template <> +double Standard_model_decays::get_partial_width(const standard_model_cxx_diagrams::context_base&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type&); +template <> +double Standard_model_decays::get_partial_width(const standard_model_cxx_diagrams::context_base&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type&); +template <> +double Standard_model_decays::get_partial_width(const standard_model_cxx_diagrams::context_base&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type&); +template <> +double Standard_model_decays::get_partial_width::type,standard_model_cxx_diagrams::fields::Fu >(const standard_model_cxx_diagrams::context_base&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type >::type&, const typename cxx_diagrams::field_indices::type&); +template <> +double Standard_model_decays::get_partial_width::type,standard_model_cxx_diagrams::fields::Fd >(const standard_model_cxx_diagrams::context_base&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type >::type&, const typename cxx_diagrams::field_indices::type&); +template <> +double Standard_model_decays::get_partial_width::type,standard_model_cxx_diagrams::fields::Fe >(const standard_model_cxx_diagrams::context_base&, const typename cxx_diagrams::field_indices::type&, const typename cxx_diagrams::field_indices::type >::type&, const typename cxx_diagrams::field_indices::type&); + +} // namespace flexiblesusy + +#endif diff --git a/model_specific/SM/module.mk b/model_specific/SM/module.mk index 6279567196..a10947a088 100644 --- a/model_specific/SM/module.mk +++ b/model_specific/SM/module.mk @@ -5,34 +5,55 @@ WITH_$(MODNAME) := yes LIB_model_specific_SM_MK := \ $(DIR)/module.mk +model_specific_SM_CXXQFT_VERTICES_MK := \ + $(DIR)/cxx_qft/vertices.mk + +-include $(model_specific_SM_CXXQFT_VERTICES_MK) +LIB_model_specific_SM_CXXQFT_VERTICES_SRC ?= '' + LIB_model_specific_SM_SRC := \ + $(DIR)/decays/standard_model_decays.cpp \ + $(DIR)/decays/standard_model_decay_table.cpp \ $(DIR)/sm_fourloophiggs.cpp \ $(DIR)/sm_fourloop_as.cpp \ + $(DIR)/sm_mw.cpp \ $(DIR)/sm_threeloophiggs.cpp \ $(DIR)/sm_twoloophiggs.cpp \ $(DIR)/standard_model.cpp \ - $(DIR)/standard_model_effective_couplings.cpp \ $(DIR)/standard_model_physical.cpp \ + $(DIR)/standard_model_shooting_low_scale_constraint.cpp \ $(DIR)/standard_model_two_scale_convergence_tester.cpp \ $(DIR)/standard_model_two_scale_low_scale_constraint.cpp \ $(DIR)/standard_model_two_scale_model.cpp \ $(DIR)/weinberg_angle.cpp +LIB_model_specific_SM_SRC += $(LIB_model_specific_SM_CXXQFT_VERTICES_SRC) + LIB_model_specific_SM_HDR := \ + $(DIR)/decays/standard_model_decays.hpp \ + $(DIR)/decays/standard_model_decay_table.hpp \ $(DIR)/sm_fourloophiggs.hpp \ $(DIR)/sm_fourloop_as.hpp \ + $(DIR)/sm_mw.hpp \ $(DIR)/sm_threeloophiggs.hpp \ $(DIR)/sm_twoloophiggs.hpp \ $(DIR)/standard_model.hpp \ $(DIR)/standard_model_convergence_tester.hpp \ - $(DIR)/standard_model_effective_couplings.hpp \ $(DIR)/standard_model_low_scale_constraint.hpp \ $(DIR)/standard_model_physical.hpp \ + $(DIR)/standard_model_shooting_model.hpp \ + $(DIR)/standard_model_shooting_low_scale_constraint.hpp \ $(DIR)/standard_model_two_scale_convergence_tester.hpp \ $(DIR)/standard_model_two_scale_low_scale_constraint.hpp \ $(DIR)/standard_model_two_scale_model.hpp \ $(DIR)/weinberg_angle.hpp +LIB_model_specific_SM_CXXQFT_HDR := \ + $(DIR)/cxx_qft/standard_model_qft.hpp \ + $(DIR)/cxx_qft/standard_model_fields.hpp \ + $(DIR)/cxx_qft/standard_model_vertices.hpp \ + $(DIR)/cxx_qft/standard_model_context_base.hpp + LIB_model_specific_SM_OBJ := \ $(patsubst %.cpp, %.o, $(filter %.cpp, $(LIB_model_specific_SM_SRC))) @@ -52,8 +73,9 @@ ifneq ($(INSTALL_DIR),) install-src:: $(Q)install -d $(LIB_model_specific_SM_INSTALL_DIR) $(Q)install -m u=rw,g=r,o=r $(LIB_model_specific_SM_SRC) $(LIB_model_specific_SM_INSTALL_DIR) - $(Q)install -m u=rw,g=r,o=r $(LIB_model_specific_SM_HDR) $(LIB_model_specific_SM_INSTALL_DIR) + $(Q)install -m u=rw,g=r,o=r $(LIB_model_specific_SM_HDR) $(LIB_model_specific_SM_CXXQFT_HDR) $(LIB_model_specific_SM_INSTALL_DIR) $(Q)install -m u=rw,g=r,o=r $(LIB_model_specific_SM_MK) $(LIB_model_specific_SM_INSTALL_DIR) + $(Q)install -m u=rw,g=r,o=r $(model_specific_SM_CXXQFT_VERTICES_MK) $(SM_INSTALL_CXXQFT_DIR) endif clean-$(MODNAME)-dep: @@ -76,7 +98,7 @@ clean:: clean-$(MODNAME) distclean:: distclean-$(MODNAME) -$(LIB_model_specific_SM_DEP) $(LIB_model_specific_SM_OBJ): CPPFLAGS += $(EIGENFLAGS) $(BOOSTFLAGS) +$(LIB_model_specific_SM_DEP) $(LIB_model_specific_SM_OBJ): CPPFLAGS += $(EIGENFLAGS) $(BOOSTFLAGS) -Imodel_specific/SM ifneq (,$(findstring yes,$(ENABLE_LOOPTOOLS)$(ENABLE_FFLITE))) $(LIB_model_specific_SM_DEP) $(LIB_model_specific_SM_OBJ): CPPFLAGS += $(LOOPFUNCFLAGS) diff --git a/model_specific/SM/sm_mw.cpp b/model_specific/SM/sm_mw.cpp new file mode 100644 index 0000000000..5c77d237ab --- /dev/null +++ b/model_specific/SM/sm_mw.cpp @@ -0,0 +1,188 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + +#include "sm_mw.hpp" +#include "logger.hpp" +#include + +namespace flexiblesusy { +namespace sm_mw { + +namespace { + +constexpr double sqr(double x) noexcept { return x*x; } + +} // anonymous namespace + +/** + * Calculates the prediction for the W boson mass in the Standard + * Model, using the fit formula Eq (45) from arXiv:1411.7040 (MS-bar + * calculation). + * + * @param mh SM Higgs boson pole mass + * @param mt SM top quark pole mass + * @param as MS-bar alpha_s(MZ) in the SM with 5 quark flavours + * @param da5had hadronic contributison Delta alpha_{had}^{(5)}(MZ^2) + * + * The authors of arXiv:1411.7040 used the following input values (Table 1): + * + * mz = 91.1876 GeV (Z boson pole mass) + * mh = 125.15 GeV (SM Higgs boson pole mass) + * mt = 173.34 GeV + * as = 0.1184 + * da5had = 0.02750 + * + * @return W boson pole mass as predicted in the Standard Model (first + * entry) and corresponding theory uncertainty (second entry) + */ +std::pair calculate_mw_pole_SM_fit_MSbar( + double mh, double mt, double as, double da5had) noexcept +{ + // Table 3, 2nd column, 124.42 <= mh <= 125.87 + const double p[8] = { + 80.35712, -0.06017, 0.0, 0.0, 0.52749, -0.00613, -0.08178, -0.50530 + }; + // Table 3, 3rd column, 50 <= mh <= 450 + const double q[8] = { + 80.35714, -0.06094, -0.00971, 0.00028, 0.52655, -0.00646, -0.08199, -0.50259 + }; + + const double das = as/0.1184 - 1; // Eq.(20) + const double da5 = da5had/0.02750 - 1; // defined below Eq.(44) + const double dh = sqr(mh/125.15) - 1; // defined below Eq.(45) + const double dH = std::log(std::abs(mh)/125.15); // Eq.(20) + const double dt = sqr(mt/173.34) - 1; // defined below Eq.(41) + + const double* w = (124.42 <= mh && mh <= 125.87) ? p : q; + const double dmw_fit = (124.42 <= mh && mh <= 125.87) ? 0.11e-3 : 0.5e-3; // below Eq.(45) + const double dmw_theo = (124.42 <= mh && mh <= 125.87) ? 1e-3 : 3e-3; // below Eq.(45); + const double dmw = dmw_theo + dmw_fit; + + // Eq.(45) + const double mw = w[0] + w[1]*dH + w[2]*dH*dH + w[3]*dh + w[4]*dt + + w[5]*dH*dt + w[6]*das + w[7]*da5; + + if (mh <= 0) { + VERBOSE_MSG("calculate_mw_pole_SM_fit_MSbar: mh = " << mh << " <= 0"); + } + if (mh < 50) { + VERBOSE_MSG("calculate_mw_pole_SM_fit_MSbar: mh = " << mh << " < 50 GeV is outside the fit range"); + } + if (mh > 450) { + VERBOSE_MSG("calculate_mw_pole_SM_fit_MSbar: mh = " << mh << " > 450 GeV is outside the fit range"); + } + if (mt <= 0) { + VERBOSE_MSG("calculate_mw_pole_SM_fit_MSbar: mt = " << mt << " <= 0"); + } + if (as <= 0) { + VERBOSE_MSG("calculate_mw_pole_SM_fit_MSbar: alpha_s = " << as << " <= 0"); + } + if (da5had <= 0) { + VERBOSE_MSG("calculate_mw_pole_SM_fit_MSbar: Delta alpha_{had}^{(5)} = " << da5had << " <= 0"); + } + if (mw < 0) { + VERBOSE_MSG("calculate_mw_pole_SM_fit_MSbar: Standard Model MW = " << mw << " < 0"); + } + + return std::make_pair(std::abs(mw), dmw); +} + +/** + * Calculates the prediction for the W boson mass in the Standard + * Model, using the fit formulae Eqs (6)-(9) from hep-ph/0311148 + * (on-shell calculation). + * + * @param mz Z boson pole mass + * @param mh SM Higgs boson pole mass + * @param mt SM top quark pole mass + * @param as MS-bar alpha_s(MZ) in the SM with 5 quark flavours + * @param Da = sum of leptonic and hadronic contributison to \f$\Delta\alpha\f$ + * + * The authors of hep-ph/0311148 used the following input values (Eq.(5)): + * + * mz = 91.1875 GeV (Z boson pole mass) + * mh = 114.4 GeV (SM Higgs boson pole mass) + * mt = 173.3 GeV + * as = 0.119 + * Da = 0.05907 = 0.0314977 + 0.027572 + * + * @return W boson pole mass as predicted in the Standard Model (first + * entry) and corresponding theory uncertainty (second entry) + */ +std::pair calculate_mw_pole_SM_fit_OS( + double mz, double mh, double mt, double as, double Da) noexcept +{ + // Eq.(8), 10 GeV <= mh <= 1000 GeV + const double p[12] = { + 80.3779, 0.05427, 0.008931, 0.0000882, 0.000161, 1.070, + 0.5237, 0.0679, 0.00179, 0.0000664, 0.0795, 114.9 + }; + // Eq.(9), 100 GeV <= mh <= 1000 GeV + const double q[12] = { + 80.3779, 0.05263, 0.010239, 0.000954, -0.000054, 1.077, + 0.5252, 0.0700, 0.004102, 0.000111, 0.0774, 115.0 + }; + + // Eq.(7) + const double dH = std::log(std::abs(mh)/100); + const double dh = sqr(mh/100); + const double dt = sqr(mt/174.3) - 1; + const double dZ = mz/91.1875 - 1; + const double da = Da/0.05907 - 1; + const double das = as/0.119 - 1; + + const double* c = (mh < 100) ? p : q; + const double dmh_fit = (mh < 100) ? 0.5e-3 : 0.25e-3; // fit uncertainty, below Eqs.(8) and (9) + const double dmh_theo = 4e-3; // theory uncertainty Eq.(10) + const double dmw = dmh_fit + dmh_theo; + + // Eq.(6) + const double mw = c[0] - c[1]*dH - c[2]*dH*dH + c[3]*dH*dH*dH*dH + + c[4]*(dh - 1) - c[5]*da + c[6]*dt - c[7]*dt*dt - c[8]*dH*dt + + c[9]*dh*dt - c[10]*das + c[11]*dZ; + + if (mz <= 0) { + VERBOSE_MSG("calculate_mw_pole_SM_fit_OS: mz " << mz << " <= 0"); + } + if (mh <= 0) { + VERBOSE_MSG("calculate_mw_pole_SM_fit_OS: mh " << mh << " <= 0"); + } + if (mh < 10) { + VERBOSE_MSG("calculate_mw_pole_SM_fit_OS: mh = " << mh << " < 10 GeV is outside the fit range"); + } + if (mh > 1000) { + VERBOSE_MSG("calculate_mw_pole_SM_fit_OS: mh = " << mh << " > 1000 GeV is outside the fit range"); + } + if (mt <= 0) { + VERBOSE_MSG("calculate_mw_pole_SM_fit_OS: mt " << mt << " <= 0"); + } + if (as <= 0) { + VERBOSE_MSG("calculate_mw_pole_SM_fit_OS: alpha_s " << as << " <= 0"); + } + if (Da <= 0) { + VERBOSE_MSG("calculate_mw_pole_SM_fit_OS: Delta alpha " << Da << " <= 0"); + } + if (mw < 0) { + VERBOSE_MSG("calculate_mw_pole_SM_fit_OS: Standard Model MW " << mw << " < 0"); + } + + return std::make_pair(std::abs(mw), dmw); +} + +} // namespace sm_mw +} // namespace flexiblesusy diff --git a/model_specific/SM/sm_mw.hpp b/model_specific/SM/sm_mw.hpp new file mode 100644 index 0000000000..60e7fa448f --- /dev/null +++ b/model_specific/SM/sm_mw.hpp @@ -0,0 +1,36 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + +#ifndef SM_MW_H +#define SM_MW_H + +#include + +namespace flexiblesusy { +namespace sm_mw { + +/// returns W pole mass in the SM and corresponding uncertainty, using fit formula (MS-bar scheme) +std::pair calculate_mw_pole_SM_fit_MSbar(double mh, double mt, double as, double da5had) noexcept; + +/// returns W pole mass in the SM and corresponding uncertainty, using fit formula (OS scheme) +std::pair calculate_mw_pole_SM_fit_OS(double mz, double mh, double mt, double as, double Da) noexcept; + +} // namespace sm_mw +} // namespace flexiblesusy + +#endif diff --git a/model_specific/SM/sm_twoloophiggs.cpp b/model_specific/SM/sm_twoloophiggs.cpp index 2df038abdc..b8e8d4f31d 100644 --- a/model_specific/SM/sm_twoloophiggs.cpp +++ b/model_specific/SM/sm_twoloophiggs.cpp @@ -121,6 +121,197 @@ double delta_mh_1loop_at_sm( return result * oneLoop; } + +double delta_mh_1loop_ab_sm( + double p, double scale, double mb, double yb) +{ + const double yb2 = sqr(yb); + const double mb2 = sqr(mb); + const double p2 = sqr(p); + const double Q2 = sqr(scale); + + const double result = + 3*yb2*(4.*mb2 - p2)*Loop_library::get().B0(p2,mb2,mb2,Q2).real(); + + return result * oneLoop; +} + +double delta_mh_1loop_atau_sm( + double p, double scale, double mtau, double ytau) +{ + const double yt2 = sqr(ytau); + const double mt2 = sqr(mtau); + const double p2 = sqr(p); + const double Q2 = sqr(scale); + + const double result = + yt2*(4.*mt2 - p2)*Loop_library::get().B0(p2,mt2,mt2,Q2).real(); + + return result * oneLoop; +} + +/* + * Derivatives w.r.t. to y_{t,b,tau}, v, p + * + * Note: Because 2L-Se are evaluated from the effective potential + * all formal two-loop contr must be derived for p=0. + * + */ + +double delta_mh_1loop_at_sm_deriv_yt( + double p, double scale, double mt, double yt) +{ + const double yt2 = sqr(yt); + const double mt2 = sqr(mt); + const double p2 = sqr(p); + const double Q2 = sqr(scale); + const double LogT = std::log(mt2 / Q2); + + + const double result = + -24. * yt * mt2 * (2. * LogT + 1.); + + return result * oneLoop; +} + +double delta_mh_1loop_ab_sm_deriv_yb( + double p, double scale, double mb, double yb) +{ + + const double yb2 = sqr(yb); + const double mb2 = sqr(mb); + const double p2 = sqr(p); + const double Q2 = sqr(scale); + const double LogB = std::log(mb2 / Q2); + + + const double result = + -24. * yb * mb2 *(2 * LogB + 1.); + + return result * oneLoop; +} + +double delta_mh_1loop_atau_sm_deriv_ytau( + double p, double scale, double mtau, double ytau) +{ + + const double ytau2 = sqr(ytau); + const double mtau2 = sqr(mtau); + const double p2 = sqr(p); + const double Q2 = sqr(scale); + const double LogT = std::log(mtau2 / Q2); + + + const double result = + -8. * ytau * mtau2 * (2. * LogT + 1.); + + return result * oneLoop; +} + +double delta_mh_1loop_at_sm_deriv_v( + double p, double scale, double mt, double yt) +{ + + const double yt2 = sqr(yt); + const double mt2 = sqr(mt); + const double p2 = sqr(p); + const double Q2 = sqr(scale); + const double LogT = std::log(mt2 / Q2); + + + const double result = + - 12. * 1.41421356237 * yt * yt2 * mt * ( LogT + 1.); + + return result * oneLoop; +} + +double delta_mh_1loop_ab_sm_deriv_v( + double p, double scale, double mb, double yb) +{ + + const double yb2 = sqr(yb); + const double mb2 = sqr(mb); + const double p2 = sqr(p); + const double Q2 = sqr(scale); + const double LogB = std::log(mb2 / Q2); + + + const double result = + - 12. * 1.41421356237 * yb * yb2 * mb * ( LogB + 1.); + + return result * oneLoop; +} + +double delta_mh_1loop_atau_sm_deriv_v( + double p, double scale, double mtau, double ytau) +{ + + const double ytau2 = sqr(ytau); + const double mtau2 = sqr(mtau); + const double p2 = sqr(p); + const double Q2 = sqr(scale); + const double LogTau = std::log(mtau2 / Q2); + + + const double result = + - 4. * 1.41421356237 * ytau * ytau2 * mtau * ( LogTau + 1.); + + return result * oneLoop; +} + + +double delta_mh_1loop_at_sm_deriv_p2( + double p, double scale, double mt, double yt) +{ + + const double yt2 = sqr(yt); + const double mt2 = sqr(mt); + const double p2 = sqr(p); + const double Q2 = sqr(scale); + const double LogT = std::log(mt2 / Q2); + + + const double result = + yt2 * (3.* LogT + 2.); + + return result * oneLoop; +} + +double delta_mh_1loop_ab_sm_deriv_p2( + double p, double scale, double mb, double yb) +{ + + const double yb2 = sqr(yb); + const double mb2 = sqr(mb); + const double p2 = sqr(p); + const double Q2 = sqr(scale); + const double LogB = std::log(mb2 / Q2); + + + const double result = + yb2 * (3.* LogB + 2.); + + return result * oneLoop; +} + + +double delta_mh_1loop_atau_sm_deriv_p2( + double p, double scale, double mtau, double ytau) +{ + + const double ytau2 = sqr(ytau); + const double mtau2 = sqr(mtau); + const double p2 = sqr(p); + const double Q2 = sqr(scale); + const double LogTau = std::log(mtau2 / Q2); + + + const double result = + ytau2 * ( LogTau + 2./3.); + + return result * oneLoop; +} + /** * Standard Model Higgs self-energy 2-loop, \f$O(\alpha_t * \alpha_s)\f$, including momentum dependence. diff --git a/model_specific/SM/sm_twoloophiggs.hpp b/model_specific/SM/sm_twoloophiggs.hpp index ffa6e25109..28560a47ab 100644 --- a/model_specific/SM/sm_twoloophiggs.hpp +++ b/model_specific/SM/sm_twoloophiggs.hpp @@ -31,6 +31,55 @@ double delta_mh_1loop_sm( double delta_mh_1loop_at_sm( double p, double scale, double mt, double yt); +/// SM Higgs 1-loop contribution, only O(alpha_b) +double delta_mh_1loop_ab_sm( + double p, double scale, double mb, double yb); + +/// SM Higgs 1-loop contribution, only O(alpha_tau) +double delta_mh_1loop_atau_sm( + double p, double scale, double mtau, double ytau); + +/// SM Higgs tadpole 1-loop, only O(alpha_t) +double tadpole_higgs_1loop_at_sm( + double scale, double mt, double yt); + +/// SM Higgs derivative 1l-mass shift O(alpha_t) wrt yt +double delta_mh_1loop_at_sm_deriv_yt( + double p, double scale, double mt, double yt); + +/// SM Higgs derivative 1l-mass shift O(alpha_b) wrt yb +double delta_mh_1loop_ab_sm_deriv_yb( + double p, double scale, double mb, double yb); + +/// SM Higgs derivative 1l-mass shift O(alpha_tau) wrt ytau +double delta_mh_1loop_atau_sm_deriv_ytau( + double p, double scale, double mtau, double ytau); + +/// SM Higgs derivative 1l-mass shift O(alpha_t) wrt vev +double delta_mh_1loop_at_sm_deriv_v( + double p, double scale, double mt, double yt); + +/// SM Higgs derivative 1l-mass shift O(alpha_b) wrt vev +double delta_mh_1loop_ab_sm_deriv_v( + double p, double scale, double mb, double yb); + +/// SM Higgs derivative 1l-mass shift O(alpha_tau) wrt vev +double delta_mh_1loop_atau_sm_deriv_v( + double p, double scale, double mtau, double ytau); + +/// SM Higgs derivative 1l-mass shift O(alpha_t) wrt p2 +double delta_mh_1loop_at_sm_deriv_p2( + double p, double scale, double mt, double yt); + +/// SM Higgs derivative 1l-mass shift O(alpha_b) wrt p2 +double delta_mh_1loop_ab_sm_deriv_p2( + double p, double scale, double mb, double yb); + +/// SM Higgs derivative 1l-mass shift O(alpha_tau) wrt p2 +double delta_mh_1loop_atau_sm_deriv_p2( + double p, double scale, double mtau, double ytau); + + /// SM Higgs self-energy 2-loop, only O(alpha_t alpha_s) double self_energy_higgs_2loop_at_as_sm( double p2, double scale, double mt, double yt, double g3); @@ -47,10 +96,6 @@ double self_energy_higgs_2loop_at_at_sm( double self_energy_higgs_2loop_atau_atau_sm( double p2, double scale, double mtau, double ytau); -/// SM Higgs tadpole 1-loop, only O(alpha_t) -double tadpole_higgs_1loop_at_sm( - double scale, double mt, double yt); - /// SM Higgs tadpole 2-loop, only O(alpha_t alpha_s) double tadpole_higgs_2loop_at_as_sm( double scale, double mt, double yt, double g3); diff --git a/model_specific/SM/standard_model.cpp b/model_specific/SM/standard_model.cpp index c37a65440d..d87b920e45 100644 --- a/model_specific/SM/standard_model.cpp +++ b/model_specific/SM/standard_model.cpp @@ -44,12 +44,14 @@ #include "sm_threeloophiggs.hpp" #include "sm_fourloophiggs.hpp" #include "sm_fourloop_as.hpp" +#include "sm_mw.hpp" #include #include #include #include #include +#include namespace flexiblesusy { @@ -103,6 +105,102 @@ namespace standard_model_info { const std::string model_name = "SM"; +int get_pdg_code_for_particle(Particles p) +{ + if (particle_multiplicities[p] > 1) { + throw OutOfBoundsError(particle_names[p] + " must have a generation index"); + } + + int pdg = 0; + switch (p) { + + case VG: pdg = 21; break; + case Hp: pdg = 0; break; + case Ah: pdg = 0; break; + case hh: pdg = 25; break; + case VWp: pdg = 24; break; + case VP: pdg = 22; break; + case VZ: pdg = 23; break; + + default: throw OutOfBoundsError("invalid particle " + std::to_string(p)); + } + + return pdg; +} + +int get_pdg_code_for_particle(Particles p, int index) +{ + if (particle_multiplicities[p] == 1) { + throw OutOfBoundsError(particle_names[p] + " does not carry an index"); + } + + std::vector pdg_codes; + switch (p) { + + case Fv: pdg_codes = {12, 14, 16}; break; + case Fd: pdg_codes = {1, 3, 5}; break; + case Fu: pdg_codes = {2, 4, 6}; break; + case Fe: pdg_codes = {11, 13, 15}; break; + + default: throw OutOfBoundsError("invalid particle " + std::to_string(p)); + } + + if (index < 0 || index >= pdg_codes.size()) { + throw OutOfBoundsError("index " + std::to_string(index) + " out of bounds"); + } + + return pdg_codes[index]; +} + +std::pair> get_multiplet_and_index_from_pdg(int pdg) +{ + std::pair> name; + + switch (pdg) { + + case 21: name = {"VG", {}}; break; + case 12: name = {"Fv", 1}; break; + case 14: name = {"Fv", 2}; break; + case 16: name = {"Fv", 3}; break; + case 25: name = {"hh", {}}; break; + case 1: name = {"Fd", 1}; break; + case 3: name = {"Fd", 2}; break; + case 5: name = {"Fd", 3}; break; + case 2: name = {"Fu", 1}; break; + case 4: name = {"Fu", 2}; break; + case 6: name = {"Fu", 3}; break; + case 11: name = {"Fe", 1}; break; + case 13: name = {"Fe", 2}; break; + case 15: name = {"Fe", 3}; break; + case 24: name = {"VWp", {}}; break; + case 22: name = {"VP", {}}; break; + case 23: name = {"VZ", {}}; break; + case -12: name = {"barFv", 1}; break; + case -14: name = {"barFv", 2}; break; + case -16: name = {"barFv", 3}; break; + case -1: name = {"barFd", 1}; break; + case -3: name = {"barFd", 2}; break; + case -5: name = {"barFd", 3}; break; + case -2: name = {"barFu", 1}; break; + case -4: name = {"barFu", 2}; break; + case -6: name = {"barFu", 3}; break; + case -11: name = {"barFe", 1}; break; + case -13: name = {"barFe", 2}; break; + case -15: name = {"barFe", 3}; break; + case -24: name = {"conjVWp", {}}; break; + + default: name = {"", {}}; + } + + return name; +} + +std::string get_particle_name_from_pdg(int pdg) +{ + std::pair> const pair = get_multiplet_and_index_from_pdg(pdg); + return pair.first + (pair.second.has_value() ? "(" + std::to_string(pair.second.value()) + ")" : ""); +} + void print(std::ostream& ostr) { ostr @@ -158,7 +256,7 @@ const int Standard_model::numberOfParameters; Standard_model::Standard_model() { set_number_of_parameters(numberOfParameters); - set_thresholds(3); + set_thresholds(4); } Standard_model::Standard_model(double scale_, double loops_, double thresholds_ @@ -419,8 +517,9 @@ int Standard_model::solve_ewsb() { VERBOSE_MSG("\t\tSolving Standard model EWSB at " << ewsb_loop_order << "-loop order"); - if (ewsb_loop_order == 0) + if (ewsb_loop_order == 0) { return solve_ewsb_tree_level(); + } return solve_ewsb_iteratively(ewsb_loop_order); } @@ -603,20 +702,19 @@ void Standard_model::calculate_DRbar_masses() void Standard_model::calculate_pole_masses() { #ifdef ENABLE_THREADS - Thread_pool tp(std::min(std::thread::hardware_concurrency(), 9u)); - - tp.run_task([this] () { calculate_MVG_pole(); }); - tp.run_task([this] () { calculate_MFv_pole(); }); - tp.run_task([this] () { calculate_Mhh_pole(); }); - tp.run_task([this] () { calculate_MVP_pole(); }); - tp.run_task([this] () { calculate_MVZ_pole(); }); - tp.run_task([this] () { calculate_MFd_pole(); }); - tp.run_task([this] () { calculate_MFu_pole(); }); - tp.run_task([this] () { calculate_MFe_pole(); }); - tp.run_task([this] () { calculate_MVWp_pole(); }); - + { + Thread_pool tp(std::min(std::thread::hardware_concurrency(), 9u)); + + tp.run_task([this] () { calculate_MVG_pole(); }); + tp.run_task([this] () { calculate_MFv_pole(); }); + tp.run_task([this] () { calculate_Mhh_pole(); }); + tp.run_task([this] () { calculate_MVP_pole(); }); + tp.run_task([this] () { calculate_MVZ_pole(); }); + tp.run_task([this] () { calculate_MFd_pole(); }); + tp.run_task([this] () { calculate_MFu_pole(); }); + tp.run_task([this] () { calculate_MFe_pole(); }); + } #else - calculate_MVG_pole(); calculate_MFv_pole(); calculate_Mhh_pole(); @@ -625,9 +723,18 @@ void Standard_model::calculate_pole_masses() calculate_MFd_pole(); calculate_MFu_pole(); calculate_MFe_pole(); - calculate_MVWp_pole(); - #endif + + // If mW == 0 it means that the SM was not initialized via matching to the SM. + // -> Compute mW using an ordinary 1-loop calculation. + if (PHYSICAL(MVWp) == 0. || this->get_physical().Mhh == 0.) { + calculate_MVWp_pole(); + } + // If mW != 0 it means it was computed as part of the matching to the SM. + // -> Recompute it with the predicted value of mh_pole. + else { + calculate_MVWp_pole_fit(this->get_physical().Mhh); + } } void Standard_model::copy_DRbar_masses_to_pole_masses() @@ -651,7 +758,6 @@ void Standard_model::copy_DRbar_masses_to_pole_masses() PHYSICAL(MVWp) = MVWp; PHYSICAL(MVPVZ) = MVPVZ; PHYSICAL(ZZ) = ZZ; - } /** @@ -660,7 +766,6 @@ void Standard_model::copy_DRbar_masses_to_pole_masses() void Standard_model::check_pole_masses_for_tachyons() { if (PHYSICAL(Mhh) < 0.) problems.flag_pole_tachyon(standard_model_info::hh); - } /** @@ -670,8 +775,10 @@ void Standard_model::check_pole_masses_for_tachyons() void Standard_model::calculate_spectrum() { calculate_DRbar_masses(); - if (pole_mass_loop_order > 0) + + if (pole_mass_loop_order > 0) { calculate_pole_masses(); + } if (pole_mass_loop_order == 0) { copy_DRbar_masses_to_pole_masses(); @@ -743,7 +850,7 @@ std::string Standard_model::name() const void Standard_model::initialise_from_input(const softsusy::QedQcd& qedqcd_) { const double scale = get_scale(); - auto qedqcd = qedqcd_; + qedqcd = qedqcd_; // initial guess qedqcd.to(qedqcd.displayPoleMZ()); @@ -770,16 +877,18 @@ void Standard_model::initialise_from_input(const softsusy::QedQcd& qedqcd_) double delta_alpha_em = 0.; double delta_alpha_s = 0.; - if (get_thresholds() && threshold_corrections.alpha_em > 0) + if (get_thresholds() > 0 && threshold_corrections.alpha_em > 0) { delta_alpha_em = calculate_delta_alpha_em(alpha_em); + } - if (get_thresholds() && threshold_corrections.alpha_s > 0) + if (get_thresholds() > 0 && threshold_corrections.alpha_s > 0) { delta_alpha_s = calculate_delta_alpha_s(alpha_s); + } const double alpha_em_drbar = alpha_em / (1.0 - delta_alpha_em); const double alpha_s_drbar = alpha_s / (1.0 - delta_alpha_s); const double e_drbar = Sqrt(4.0 * Pi * alpha_em_drbar); - const double theta_w_drbar = calculate_theta_w(qedqcd, alpha_em_drbar); + const auto theta_w_drbar = calculate_theta_w(); v = Re((2 * mz_run) / Sqrt(0.6 * Sqr(g1) + Sqr(g2))); @@ -810,9 +919,6 @@ void Standard_model::initialise_from_input(const softsusy::QedQcd& qedqcd_) g2 = Electroweak_constants::g2; } - if (get_thresholds() && threshold_corrections.sin_theta_w > 0) - qedqcd.setPoleMW(recalculate_mw_pole(qedqcd.displayPoleMW())); - converged = check_convergence(old); old = *this; } @@ -858,19 +964,19 @@ void Standard_model::initial_guess_for_parameters(const softsusy::QedQcd& qedqcd upQuarksDRbar(0,0) = mu_guess; upQuarksDRbar(1,1) = mc_guess; upQuarksDRbar(2,2) = mt_guess; - Yu = -((1.4142135623730951*upQuarksDRbar) / v).transpose(); + Yu = -(sqrt2*upQuarksDRbar/v).transpose(); Eigen::Matrix downQuarksDRbar(Eigen::Matrix::Zero()); downQuarksDRbar(0,0) = md_guess; downQuarksDRbar(1,1) = ms_guess; downQuarksDRbar(2,2) = mb_guess; - Yd = ((1.4142135623730951*downQuarksDRbar)/v).transpose(); + Yd = (sqrt2*downQuarksDRbar/v).transpose(); Eigen::Matrix downLeptonsDRbar(Eigen::Matrix::Zero()); downLeptonsDRbar(0,0) = me_guess; downLeptonsDRbar(1,1) = mm_guess; downLeptonsDRbar(2,2) = mtau_guess; - Ye = ((1.4142135623730951*downLeptonsDRbar)/v).transpose(); + Ye = (sqrt2*downLeptonsDRbar/v).transpose(); Lambdax = Sqr(MH) / Sqr(v); @@ -879,21 +985,32 @@ void Standard_model::initial_guess_for_parameters(const softsusy::QedQcd& qedqcd double Standard_model::calculate_delta_alpha_em(double alphaEm) const { - const double delta_alpha_em_SM = -0.28294212105225836*alphaEm* - FiniteLog(Abs(MFu(2) / get_scale())); + double delta_alpha_em_1loop = 0.; + + if (get_thresholds() > 0 && threshold_corrections.alpha_em > 0) { + delta_alpha_em_1loop = -0.28294212105225836*alphaEm* + FiniteLog(Abs(MFu(2) / get_scale())); + } - return delta_alpha_em_SM; + return delta_alpha_em_1loop; } double Standard_model::calculate_delta_alpha_s(double alphaS) const { - const double delta_alpha_s_1loop = -0.1061032953945969*alphaS* - FiniteLog(Abs(MFu(2) / get_scale())); - + double delta_alpha_s_1loop = 0.; double delta_alpha_s_2loop = 0.; double delta_alpha_s_3loop = 0.; double delta_alpha_s_4loop = 0.; + if (get_thresholds() > 0 && threshold_corrections.alpha_s > 0) { + sm_fourloop_as::Parameters pars; + pars.as = alphaS; // alpha_s(SM(5)) MS-bar + pars.mt = MFu(2); + pars.Q = get_scale(); + + delta_alpha_s_1loop = sm_fourloop_as::delta_alpha_s_1loop_as(pars); + } + if (get_thresholds() > 1 && threshold_corrections.alpha_s > 1) { sm_fourloop_as::Parameters pars; pars.as = alphaS; // alpha_s(SM(5)) MS-bar @@ -939,76 +1056,84 @@ double Standard_model::calculate_delta_alpha_s(double alphaS) const } -double Standard_model::calculate_theta_w(const softsusy::QedQcd& qedqcd, double alpha_em_drbar) +double Standard_model::calculate_G_fermi(const softsusy::QedQcd& qedqcd) { - double theta_w = 0.; + const double mh_pole = [&] () { + double mh_pole = this->get_physical().Mhh; + if (mh_pole == 0) { + mh_pole = Electroweak_constants::MH; + } + return mh_pole; + }(); + + calculate_MVWp_pole_fit(mh_pole); + + weinberg_angle::Weinberg_angle::Parameters parameters; + parameters.fermi_constant = qedqcd.displayFermiConstant(); + parameters.mz_pole = qedqcd.displayPoleMZ(); + parameters.mt_pole = qedqcd.displayPoleMt(); + parameters.mh_pole = mh_pole; + parameters.alpha_s = calculate_alpha_s_SM5_at(qedqcd, qedqcd.displayPoleMt()); + parameters.alpha_s_mz = qedqcd.displayAlphaSInput(); + parameters.dalpha_s_5_had = Electroweak_constants::delta_alpha_s_5_had; + parameters.mw_pole = this->get_physical().MVWp; + + const int number_of_iterations = std::max(20, static_cast(std::abs(-log10(this->get_precision()) * 10))); + + weinberg_angle::Weinberg_angle weinberg(this, parameters); + weinberg.set_number_of_loops(this->get_threshold_corrections().sin_theta_w); + weinberg.set_number_of_iterations(number_of_iterations); + + double g_fermi = qedqcd.displayFermiConstant(); + + try { + g_fermi = weinberg.calculate_G_fermi(); + } catch (const Error& e) { + VERBOSE_MSG(e.what_detailed()); + this->get_problems().flag_no_GFermi_convergence(); + } - using namespace weinberg_angle; + return g_fermi; +} - const double scale = get_scale(); - const double mw_pole = qedqcd.displayPoleMW(); - const double mz_pole = qedqcd.displayPoleMZ(); - const double mt_pole = qedqcd.displayPoleMt(); - const double mt_drbar = MFu(2); - const double mb_drbar = MFd(2); - const double mh_drbar = Mhh; - const double gY = g1 * 0.7745966692414834; - const double pizztMZ = Re(self_energy_VZ_1loop(mz_pole)); - const double piwwt0 = Re(self_energy_VWp_1loop(0.)); - const double self_energy_w_at_mw = Re(self_energy_VWp_1loop(mw_pole)); - - Weinberg_angle::Self_energy_data se_data; - se_data.scale = scale; - se_data.mt_pole = mt_pole; - se_data.mt_drbar = mt_drbar; - se_data.mb_drbar = mb_drbar; - se_data.gY = gY; - se_data.g2 = g2; - - double pizztMZ_corrected = pizztMZ; - double piwwtMW_corrected = self_energy_w_at_mw; - double piwwt0_corrected = piwwt0; - - if (get_thresholds() > 1 && threshold_corrections.sin_theta_w > 1) { - pizztMZ_corrected = - Weinberg_angle::replace_mtop_in_self_energy_z(pizztMZ, mz_pole, - se_data); - piwwtMW_corrected = - Weinberg_angle::replace_mtop_in_self_energy_w( - self_energy_w_at_mw, mw_pole, se_data); - piwwt0_corrected = - Weinberg_angle::replace_mtop_in_self_energy_w(piwwt0, 0., - se_data); - } +double Standard_model::calculate_theta_w() +{ + const double mh_pole = [&] () { + double mh_pole = this->get_physical().Mhh; + if (mh_pole == 0) { + mh_pole = Electroweak_constants::MH; + } + return mh_pole; + }(); - Weinberg_angle::Data data; - data.scale = scale; - data.alpha_em_drbar = alpha_em_drbar; - data.fermi_contant = qedqcd.displayFermiConstant(); - data.self_energy_z_at_mz = pizztMZ_corrected; - data.self_energy_w_at_mw = piwwtMW_corrected; - data.self_energy_w_at_0 = piwwt0_corrected; - data.mw_pole = mw_pole; - data.mz_pole = mz_pole; - data.mt_pole = mt_pole; - data.mh_drbar = mh_drbar; - data.gY = gY; - data.g2 = g2; - data.g3 = g3; - - Weinberg_angle weinberg; - weinberg.disable_susy_contributions(); - weinberg.set_number_of_loops(threshold_corrections.sin_theta_w); - weinberg.set_data(data); - - const int error = weinberg.calculate(); - - theta_w = ArcSin(weinberg.get_sin_theta()); - - if (error) - problems.flag_no_sinThetaW_convergence(); - else - problems.unflag_no_sinThetaW_convergence(); + calculate_MVWp_pole_fit(mh_pole); + + weinberg_angle::Weinberg_angle::Parameters parameters; + parameters.fermi_constant = qedqcd.displayFermiConstant(); + parameters.mz_pole = qedqcd.displayPoleMZ(); + parameters.mt_pole = qedqcd.displayPoleMt(); + parameters.mh_pole = mh_pole; + parameters.alpha_s = calculate_alpha_s_SM5_at(qedqcd, qedqcd.displayPoleMt()); + parameters.alpha_s_mz = qedqcd.displayAlphaSInput(); + parameters.dalpha_s_5_had = Electroweak_constants::delta_alpha_s_5_had; + parameters.mw_pole = this->get_physical().MVWp; + + const int number_of_iterations = + std::max(20, static_cast(std::abs(-log10(this->get_precision()) * 10) + )); + + using namespace weinberg_angle; + Weinberg_angle weinberg(this, parameters); + weinberg.set_number_of_loops(this->get_threshold_corrections().sin_theta_w); + weinberg.set_number_of_iterations(number_of_iterations); + + double theta_w = std::asin(Electroweak_constants::sinThetaW); + try { + theta_w = ArcSin(weinberg.calculate_sin_theta_w()); + } catch (const Error& e) { + VERBOSE_MSG(e.what_detailed()); + this->get_problems().flag_no_sinThetaW_convergence(); + } return theta_w; } @@ -1023,7 +1148,7 @@ void Standard_model::calculate_Yu_DRbar(const softsusy::QedQcd& qedqcd) if (get_thresholds() && threshold_corrections.mt > 0) upQuarksDRbar(2,2) = calculate_MFu_DRbar(qedqcd.displayPoleMt(), 2); - Yu = -((1.4142135623730951*upQuarksDRbar)/v).transpose(); + Yu = -(sqrt2*upQuarksDRbar/v).transpose(); } void Standard_model::calculate_Yd_DRbar(const softsusy::QedQcd& qedqcd) @@ -1036,7 +1161,7 @@ void Standard_model::calculate_Yd_DRbar(const softsusy::QedQcd& qedqcd) if (get_thresholds() && threshold_corrections.mb > 0) downQuarksDRbar(2,2) = calculate_MFd_DRbar(qedqcd.displayMass(softsusy::mBottom), 2); - Yd = ((1.4142135623730951*downQuarksDRbar)/v).transpose(); + Yd = (sqrt2*downQuarksDRbar/v).transpose(); } void Standard_model::calculate_Ye_DRbar(const softsusy::QedQcd& qedqcd) @@ -1054,7 +1179,7 @@ void Standard_model::calculate_Ye_DRbar(const softsusy::QedQcd& qedqcd) if (get_thresholds() && threshold_corrections.mtau > 0) downLeptonsDRbar(2,2) = calculate_MFe_DRbar(qedqcd.displayMass(softsusy::mTau), 2); - Ye = ((1.4142135623730951*downLeptonsDRbar)/v).transpose(); + Ye = (sqrt2*downLeptonsDRbar/v).transpose(); } void Standard_model::calculate_Lambdax_DRbar() @@ -2263,6 +2388,9 @@ void Standard_model::calculate_MVPVZ() MVPVZ = AbsSqrt(MVPVZ); + + MVP = 0.; + MVZ = MVPVZ(1); } @@ -4532,7 +4660,7 @@ void Standard_model::calculate_MVZ_pole() return; // diagonalization with medium precision - const double M_tree(get_mass_matrix_VZ()); + const double M_tree(Sqr(MVZ)); const double p = MVZ; const double self_energy = Re(self_energy_VZ_1loop(p)); const double mass_sqr = M_tree - self_energy; @@ -4747,6 +4875,10 @@ double Standard_model::calculate_MFv_DRbar(double, int) const double Standard_model::calculate_MFe_DRbar(double m_sm_msbar, int idx) const { + if (get_thresholds() == 0 || threshold_corrections.mtau == 0) { + return m_sm_msbar; + } + const double p = m_sm_msbar; const double self_energy_1 = Re(self_energy_Fe_1loop_1_heavy_rotated(p, idx , idx)); @@ -4765,6 +4897,10 @@ double Standard_model::calculate_MFe_DRbar(double m_sm_msbar, int idx) const double Standard_model::calculate_MFu_DRbar(double m_pole, int idx) const { + if (get_thresholds() == 0 || threshold_corrections.mt == 0) { + return m_pole; + } + const double p = m_pole; const double self_energy_1 = Re(self_energy_Fu_1loop_1_heavy_rotated(p, idx , idx)); @@ -4809,6 +4945,10 @@ double Standard_model::calculate_MFu_DRbar(double m_pole, int idx) const double Standard_model::calculate_MFd_DRbar(double m_sm_msbar, int idx) const { + if (get_thresholds() == 0 || threshold_corrections.mb == 0) { + return m_sm_msbar; + } + const double p = m_sm_msbar; const double self_energy_1 = Re(self_energy_Fd_1loop_1_heavy_rotated(p, idx , idx)); @@ -4885,6 +5025,24 @@ std::ostream& operator<<(std::ostream& ostr, const Standard_model& model) return ostr; } +double Standard_model::calculate_alpha_s_SM5_at( + softsusy::QedQcd qedqcd_tmp, double scale) const +{ + qedqcd_tmp.run_to(scale); // running in SM(5) + return qedqcd_tmp.displayAlpha(softsusy::ALPHAS); +} + +void Standard_model::calculate_MVWp_pole_fit(const double mh_pole) { + const double mt_pole = qedqcd.displayPoleMt(); + const double alpha_s_mz = qedqcd.displayAlphaSInput(); + const double dalpha_s_5_had = Electroweak_constants::delta_alpha_s_5_had; + + const auto sm_mw = flexiblesusy::sm_mw::calculate_mw_pole_SM_fit_MSbar( + mh_pole, mt_pole, alpha_s_mz, dalpha_s_5_had); + + this->get_physical().MVWp = sm_mw.first; +} + } // namespace standard_model } // namespace flexiblesusy diff --git a/model_specific/SM/standard_model.hpp b/model_specific/SM/standard_model.hpp index fe21f0979a..e58c1e1d55 100644 --- a/model_specific/SM/standard_model.hpp +++ b/model_specific/SM/standard_model.hpp @@ -34,17 +34,15 @@ #include "names.hpp" #include "problems.hpp" #include "physical_input.hpp" +#include "lowe.h" #include #include #include +#include #include -namespace softsusy { - class QedQcd; -} // namespace softsusy - namespace flexiblesusy { class EWSB_solver; @@ -85,6 +83,11 @@ namespace standard_model_info { extern const std::string model_name; constexpr bool is_low_energy_model = false; constexpr bool is_supersymmetric_model = false; + constexpr bool is_CP_violating_Higgs_sector {false}; + + int get_pdg_code_for_particle(Particles); + int get_pdg_code_for_particle(Particles, int); + std::string get_particle_name_from_pdg(int); class Standard_model_particle_names : public Names { public: @@ -133,7 +136,6 @@ class Standard_model : public Beta_function { Standard_model(const Standard_model&) = default; Standard_model(Standard_model&&) = default; virtual ~Standard_model() = default; - EIGEN_MAKE_ALIGNED_OPERATOR_NEW Standard_model& operator=(const Standard_model&) = default; Standard_model& operator=(Standard_model&&) = default; @@ -528,7 +530,8 @@ class Standard_model : public Beta_function { double calculate_delta_alpha_em(double alphaEm) const; double calculate_delta_alpha_s(double alphaS) const; void calculate_Lambdax_DRbar(); - double calculate_theta_w(const softsusy::QedQcd&, double alpha_em_drbar); + double calculate_G_fermi(const softsusy::QedQcd&); + double calculate_theta_w(); void calculate_Yu_DRbar(const softsusy::QedQcd&); void calculate_Yd_DRbar(const softsusy::QedQcd&); void calculate_Ye_DRbar(const softsusy::QedQcd&); @@ -656,7 +659,9 @@ class Standard_model : public Beta_function { Eigen::Array MFd{Eigen::Array::Zero()}; Eigen::Array MFu{Eigen::Array::Zero()}; Eigen::Array MFe{Eigen::Array::Zero()}; - double MVWp{}; + double MVWp{}; ///< running W boson mass + double MVWp_pole{}; ///< W boson pole mass (determined from fit formula) + Eigen::Array MVPVZ{Eigen::Array::Zero()}; // DR-bar mixing matrices @@ -668,7 +673,9 @@ class Standard_model : public Beta_function { Eigen::Matrix,3,3> Ue{Eigen::Matrix,3,3>::Zero()}; Eigen::Matrix ZZ{Eigen::Matrix::Zero()}; - + double calculate_alpha_s_SM5_at(softsusy::QedQcd, double) const; + void calculate_MVWp_pole_fit(double); + softsusy::QedQcd qedqcd; }; std::ostream& operator<<(std::ostream&, const Standard_model&); diff --git a/model_specific/SM/standard_model_effective_couplings.cpp b/model_specific/SM/standard_model_effective_couplings.cpp deleted file mode 100644 index 17c47a7311..0000000000 --- a/model_specific/SM/standard_model_effective_couplings.cpp +++ /dev/null @@ -1,513 +0,0 @@ -// ==================================================================== -// This file is part of FlexibleSUSY. -// -// FlexibleSUSY 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. -// -// FlexibleSUSY 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 FlexibleSUSY. If not, see -// . -// ==================================================================== - -#include "standard_model_effective_couplings.hpp" - -#include "effective_couplings.hpp" -#include "standard_model.hpp" -#include "wrappers.hpp" - -namespace flexiblesusy { -namespace standard_model { - -using namespace effective_couplings; - -#define INPUTPARAMETER(parameter) model.get_input().parameter -#define MODELPARAMETER(parameter) model.get_##parameter() -#define DERIVEDPARAMETER(parameter) model.##parameter() -#define PHASE(parameter) model.get_##parameter() -#define PHYSICAL(parameter) model.get_physical().parameter - -Standard_model_effective_couplings::Standard_model_effective_couplings( - const Standard_model& model_, - const softsusy::QedQcd& qedqcd_, - const Physical_input& input_) - : model(model_), qedqcd(qedqcd_), physical_input(input_) - , rg_improve(true), include_qcd_corrections(true) - , Vd(PHYSICAL(Vd)), Ud(PHYSICAL(Ud)), Vu(PHYSICAL(Vu)), Uu(PHYSICAL(Uu)), Ve - (PHYSICAL(Ve)), Ue(PHYSICAL(Ue)), ZZ(PHYSICAL(ZZ)) - - , eff_CphhVPVP(0), eff_CphhVGVG(0), eff_CpAhVPVP(0), eff_CpAhVGVG(0) - -{ -} - -void Standard_model_effective_couplings::calculate_effective_couplings() -{ - const standard_model::Standard_model sm(initialise_SM()); - const double scale = model.get_scale(); - const Eigen::ArrayXd saved_parameters(model.get()); - - const double saved_mt = PHYSICAL(MFu(2)); - PHYSICAL(MFu(2)) = qedqcd.displayPoleMt(); - - const auto Mhh = PHYSICAL(Mhh); - run_SM_strong_coupling_to(sm, 0.5 * Mhh); - calculate_eff_CphhVPVP(); - run_SM_strong_coupling_to(sm, Mhh); - calculate_eff_CphhVGVG(); - - PHYSICAL(MFu(2)) = saved_mt; - model.set_scale(scale); - model.set(saved_parameters); - -} - -void Standard_model_effective_couplings::set_model(const Standard_model& model_) -{ - model = model_; - copy_mixing_matrices_from_model(); -} - -void Standard_model_effective_couplings::copy_mixing_matrices_from_model() -{ - Vd = PHYSICAL(Vd); - Ud = PHYSICAL(Ud); - Vu = PHYSICAL(Vu); - Uu = PHYSICAL(Uu); - Ve = PHYSICAL(Ve); - Ue = PHYSICAL(Ue); - ZZ = PHYSICAL(ZZ); - -} - -standard_model::Standard_model Standard_model_effective_couplings::initialise_SM() const -{ - standard_model::Standard_model sm; - - sm.set_loops(2); - sm.set_thresholds(2); - sm.set_physical_input(physical_input); - - sm.initialise_from_input(qedqcd); - - return sm; -} - -void Standard_model_effective_couplings::run_SM_strong_coupling_to(standard_model::Standard_model sm, double m) -{ - sm.run_to(m); - model.set_g3(sm.get_g3()); -} - -std::complex Standard_model_effective_couplings::scalar_scalar_qcd_factor(double m_decay, double m_loop) const -{ - std::complex result(1.0, 0.0); - - if (include_qcd_corrections) { - const auto g3 = MODELPARAMETER(g3); - if (m_loop > m_decay) { - result = 1 + 0.06754745576155852*Sqr(g3); - } - - } - - return result; -} - -std::complex Standard_model_effective_couplings::scalar_fermion_qcd_factor(double m_decay, double m_loop) const -{ - std::complex result(1.0, 0.0); - - if (include_qcd_corrections) { - const auto g3 = MODELPARAMETER(g3); - result = 1.0 + 0.025330295910584444*Sqr(g3) * - scalar_diphoton_fermion_loop(m_decay, m_loop); - - } - - return result; -} - -std::complex Standard_model_effective_couplings::pseudoscalar_fermion_qcd_factor(double m_decay, double m_loop) const -{ - std::complex result(1.0, 0.0); - - if (include_qcd_corrections) { - const auto g3 = MODELPARAMETER(g3); - result = 1.0 + 0.025330295910584444*Sqr(g3) * - pseudoscalar_diphoton_fermion_loop(m_decay, m_loop); - - } - - return result; -} - -double Standard_model_effective_couplings::number_of_active_flavours(double m) const -{ - if (m < qedqcd.displayMbMb()) { - return 4.0; - } else if (m < qedqcd.displayPoleMt()) { - return 5.0; - } else { - return 6.0; - } -} - -double Standard_model_effective_couplings::scalar_scaling_factor(double m) const -{ - const double Nf = number_of_active_flavours(m); - const double mtpole = qedqcd.displayPoleMt(); - const double l = Log(Sqr(m) / Sqr(mtpole)); - - const auto g3 = MODELPARAMETER(g3); - - const double nlo_qcd = 0.025330295910584444*(23.75 - 1.1666666666666667*Nf)* - Sqr(g3); - const double nnlo_qcd = 0.000641623890917771*Power(g3,4)*(370.1956513893174 - + 2.375*l + (-47.18640261449638 + 0.6666666666666666*l)*Nf + - 0.9017702481178881*Sqr(Nf)); - const double nnnlo_qcd = 0.000016252523020247696*Power(g3,6)*(467.683620788 - + 122.440972222*l + 10.9409722222*Sqr(l)); - - return Sqrt(1.0 + nlo_qcd + nnlo_qcd + nnnlo_qcd); -} - -double Standard_model_effective_couplings::pseudoscalar_scaling_factor(double m) const -{ - const double Nf = number_of_active_flavours(m); - const double mtpole = qedqcd.displayPoleMt(); - const double l = Log(Sqr(m) / Sqr(mtpole)); - - const auto g3 = MODELPARAMETER(g3); - - const double nlo_qcd = 0.025330295910584444*(24.25 - 1.1666666666666667*Nf)* - Sqr(g3); - const double nnlo_qcd = 0.000641623890917771*Power(g3,4)*(171.54400563089382 - + 5*l); - const double nnnlo_qcd = 0; - - return Sqrt(1.0 + nlo_qcd + nnlo_qcd + nnnlo_qcd); -} - -double Standard_model_effective_couplings::get_hhVPVP_partial_width() const -{ - const double mass = PHYSICAL(Mhh); - return 0.0049735919716217296 * Power(mass, 3.0) * AbsSqr(eff_CphhVPVP); -} - -double Standard_model_effective_couplings::get_hhVGVG_partial_width() const -{ - const double mass = PHYSICAL(Mhh); - return 0.039788735772973836 * Power(mass, 3.0) * AbsSqr(eff_CphhVGVG); -} - -double Standard_model_effective_couplings::get_AhVPVP_partial_width() const -{ - const double mass = PHYSICAL(MAh); - return 0.0049735919716217296 * Power(mass, 3.0) * AbsSqr(eff_CpAhVPVP); -} - -double Standard_model_effective_couplings::get_AhVGVG_partial_width() const -{ - const double mass = PHYSICAL(MAh); - return 0.039788735772973836 * Power(mass, 3.0) * AbsSqr(eff_CpAhVGVG); -} - -std::complex Standard_model_effective_couplings::CpFdhhbarFdPL(int gt1, int gt3) const -{ - const auto Yd = MODELPARAMETER(Yd); - - std::complex result; - - std::complex tmp_467; - std::complex tmp_468; - for (int j2 = 0; j2 < 3; ++j2) { - std::complex tmp_469; - std::complex tmp_470; - for (int j1 = 0; j1 < 3; ++j1) { - tmp_470 += Conj(Ud(gt3,j1))*Yd(j1,j2); - } - tmp_469 += tmp_470; - tmp_468 += (Conj(Vd(gt1,j2))) * tmp_469; - } - tmp_467 += tmp_468; - result += (-0.7071067811865475) * tmp_467; - - return result; -} - -std::complex Standard_model_effective_couplings::CpFuhhbarFuPL(int gt1, int gt3) const -{ - const auto Yu = MODELPARAMETER(Yu); - - std::complex result; - - std::complex tmp_471; - std::complex tmp_472; - for (int j2 = 0; j2 < 3; ++j2) { - std::complex tmp_473; - std::complex tmp_474; - for (int j1 = 0; j1 < 3; ++j1) { - tmp_474 += Conj(Uu(gt3,j1))*Yu(j1,j2); - } - tmp_473 += tmp_474; - tmp_472 += (Conj(Vu(gt1,j2))) * tmp_473; - } - tmp_471 += tmp_472; - result += (0.7071067811865475) * tmp_471; - - return result; -} - -std::complex Standard_model_effective_couplings::CpFehhbarFePL(int gt1, int gt3) const -{ - const auto Ye = MODELPARAMETER(Ye); - - std::complex result; - - std::complex tmp_475; - std::complex tmp_476; - for (int j2 = 0; j2 < 3; ++j2) { - std::complex tmp_477; - std::complex tmp_478; - for (int j1 = 0; j1 < 3; ++j1) { - tmp_478 += Conj(Ue(gt3,j1))*Ye(j1,j2); - } - tmp_477 += tmp_478; - tmp_476 += (Conj(Ve(gt1,j2))) * tmp_477; - } - tmp_475 += tmp_476; - result += (-0.7071067811865475) * tmp_475; - - return result; -} - -double Standard_model_effective_couplings::CphhVWpconjVWp() const -{ - const auto g2 = MODELPARAMETER(g2); - const auto v = MODELPARAMETER(v); - - double result = 0.0; - - result = 0.5*v*Sqr(g2); - - return result; -} - -std::complex Standard_model_effective_couplings::CpAhFdbarFdPL(int gt2, int gt3) const -{ - const auto Yd = MODELPARAMETER(Yd); - - std::complex result; - - std::complex tmp_479; - std::complex tmp_480; - for (int j2 = 0; j2 < 3; ++j2) { - std::complex tmp_481; - std::complex tmp_482; - for (int j1 = 0; j1 < 3; ++j1) { - tmp_482 += Conj(Ud(gt3,j1))*Yd(j1,j2); - } - tmp_481 += tmp_482; - tmp_480 += (Conj(Vd(gt2,j2))) * tmp_481; - } - tmp_479 += tmp_480; - result += (std::complex(0.,0.7071067811865475)) * tmp_479; - - return result; -} - -std::complex Standard_model_effective_couplings::CpAhFubarFuPL(int gt2, int gt3) const -{ - const auto Yu = MODELPARAMETER(Yu); - - std::complex result; - - std::complex tmp_483; - std::complex tmp_484; - for (int j2 = 0; j2 < 3; ++j2) { - std::complex tmp_485; - std::complex tmp_486; - for (int j1 = 0; j1 < 3; ++j1) { - tmp_486 += Conj(Uu(gt3,j1))*Yu(j1,j2); - } - tmp_485 += tmp_486; - tmp_484 += (Conj(Vu(gt2,j2))) * tmp_485; - } - tmp_483 += tmp_484; - result += (std::complex(0.,0.7071067811865475)) * tmp_483; - - return result; -} - -std::complex Standard_model_effective_couplings::CpAhFebarFePL(int gt2, int gt3) const -{ - const auto Ye = MODELPARAMETER(Ye); - - std::complex result; - - std::complex tmp_487; - std::complex tmp_488; - for (int j2 = 0; j2 < 3; ++j2) { - std::complex tmp_489; - std::complex tmp_490; - for (int j1 = 0; j1 < 3; ++j1) { - tmp_490 += Conj(Ue(gt3,j1))*Ye(j1,j2); - } - tmp_489 += tmp_490; - tmp_488 += (Conj(Ve(gt2,j2))) * tmp_489; - } - tmp_487 += tmp_488; - result += (std::complex(0.,0.7071067811865475)) * tmp_487; - - return result; -} - -void Standard_model_effective_couplings::calculate_eff_CphhVPVP() -{ - const auto MFd = PHYSICAL(MFd); - const auto MFu = PHYSICAL(MFu); - const auto MFe = PHYSICAL(MFe); - const auto MVWp = PHYSICAL(MVWp); - const auto decay_mass = PHYSICAL(Mhh); - const auto decay_scale = 0.25 * Sqr(decay_mass); - - const auto vev = 1.0 / Sqrt(qedqcd.displayFermiConstant() * Sqrt(2.0)); - - std::complex result = 0; - for (int gI1 = 0; gI1 < 3; ++gI1) { - result += 0.3333333333333333 * scalar_fermion_qcd_factor(decay_mass, - MFd(gI1)) * CpFdhhbarFdPL(gI1, gI1) * vev * AS12(decay_scale / Sqr(MFd( - gI1))) / MFd(gI1); - } - for (int gI1 = 0; gI1 < 3; ++gI1) { - result += 1.3333333333333333 * scalar_fermion_qcd_factor(decay_mass, - MFu(gI1)) * CpFuhhbarFuPL(gI1, gI1) * vev * AS12(decay_scale / Sqr(MFu( - gI1))) / MFu(gI1); - } - for (int gI1 = 0; gI1 < 3; ++gI1) { - result += CpFehhbarFePL(gI1, gI1) * vev * AS12(decay_scale / Sqr(MFe( - gI1))) / MFe(gI1); - } - result += -0.5 * CphhVWpconjVWp() * vev * AS1(decay_scale / Sqr(MVWp)) / Sqr - (MVWp); - - - result *= 0.18926819071273507 * physical_input.get( - Physical_input::alpha_em_0) * Sqrt(qedqcd.displayFermiConstant()); - - eff_CphhVPVP = result; - -} - -void Standard_model_effective_couplings::calculate_eff_CphhVGVG() -{ - const auto g3 = MODELPARAMETER(g3); - const auto MFd = PHYSICAL(MFd); - const auto MFu = PHYSICAL(MFu); - const double alpha_s = 0.07957747154594767*Sqr(g3); - const auto decay_mass = PHYSICAL(Mhh); - const auto decay_scale = 0.25 * Sqr(decay_mass); - - const auto vev = 1.0 / Sqrt(qedqcd.displayFermiConstant() * Sqrt(2.0)); - - std::complex result = 0; - for (int gI1 = 0; gI1 < 3; ++gI1) { - result += CpFdhhbarFdPL(gI1, gI1) * vev * AS12(decay_scale / Sqr(MFd( - gI1))) / MFd(gI1); - } - for (int gI1 = 0; gI1 < 3; ++gI1) { - result += CpFuhhbarFuPL(gI1, gI1) * vev * AS12(decay_scale / Sqr(MFu( - gI1))) / MFu(gI1); - } - result *= std::complex(0.75,0.); - - if (include_qcd_corrections) { - result *= scalar_scaling_factor(decay_mass); - } - - - result *= 0.12617879380849006 * alpha_s * Sqrt(qedqcd.displayFermiConstant() - ); - - eff_CphhVGVG = result; - -} - -void Standard_model_effective_couplings::calculate_eff_CpAhVPVP() -{ - const auto MFd = PHYSICAL(MFd); - const auto MFu = PHYSICAL(MFu); - const auto MFe = PHYSICAL(MFe); - const auto decay_mass = PHYSICAL(MAh); - const auto decay_scale = 0.25 * Sqr(decay_mass); - - const auto vev = 1.0 / Sqrt(qedqcd.displayFermiConstant() * Sqrt(2.0)); - - std::complex result = 0; - for (int gI1 = 0; gI1 < 3; ++gI1) { - result += 0.3333333333333333 * pseudoscalar_fermion_qcd_factor( - decay_mass, MFd(gI1)) * CpAhFdbarFdPL(gI1, gI1) * vev * AP12(decay_scale - / Sqr(MFd(gI1))) / MFd(gI1); - } - for (int gI1 = 0; gI1 < 3; ++gI1) { - result += 1.3333333333333333 * pseudoscalar_fermion_qcd_factor( - decay_mass, MFu(gI1)) * CpAhFubarFuPL(gI1, gI1) * vev * AP12(decay_scale - / Sqr(MFu(gI1))) / MFu(gI1); - } - for (int gI1 = 0; gI1 < 3; ++gI1) { - result += CpAhFebarFePL(gI1, gI1) * vev * AP12(decay_scale / Sqr(MFe( - gI1))) / MFe(gI1); - } - result *= std::complex(2.0,0.); - - - result *= 0.18926819071273507 * physical_input.get( - Physical_input::alpha_em_0) * Sqrt(qedqcd.displayFermiConstant()); - - eff_CpAhVPVP = result; - -} - -void Standard_model_effective_couplings::calculate_eff_CpAhVGVG() -{ - const auto g3 = MODELPARAMETER(g3); - const auto MFd = PHYSICAL(MFd); - const auto MFu = PHYSICAL(MFu); - const double alpha_s = 0.07957747154594767*Sqr(g3); - const auto decay_mass = PHYSICAL(MAh); - const auto decay_scale = 0.25 * Sqr(decay_mass); - - const auto vev = 1.0 / Sqrt(qedqcd.displayFermiConstant() * Sqrt(2.0)); - - std::complex result = 0; - for (int gI1 = 0; gI1 < 3; ++gI1) { - result += CpAhFdbarFdPL(gI1, gI1) * vev * AP12(decay_scale / Sqr(MFd( - gI1))) / MFd(gI1); - } - for (int gI1 = 0; gI1 < 3; ++gI1) { - result += CpAhFubarFuPL(gI1, gI1) * vev * AP12(decay_scale / Sqr(MFu( - gI1))) / MFu(gI1); - } - result *= std::complex(1.5,0.); - - if (include_qcd_corrections) { - result *= pseudoscalar_scaling_factor(decay_mass); - } - - - result *= 0.12617879380849006 * alpha_s * Sqrt(qedqcd.displayFermiConstant() - ); - - eff_CpAhVGVG = result; - -} - -} // namespace standard_model -} // namespace flexiblesusy diff --git a/model_specific/SM/standard_model_effective_couplings.hpp b/model_specific/SM/standard_model_effective_couplings.hpp deleted file mode 100644 index f8f75bf8cd..0000000000 --- a/model_specific/SM/standard_model_effective_couplings.hpp +++ /dev/null @@ -1,113 +0,0 @@ -// ==================================================================== -// This file is part of FlexibleSUSY. -// -// FlexibleSUSY 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. -// -// FlexibleSUSY 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 FlexibleSUSY. If not, see -// . -// ==================================================================== - - -#ifndef STANDARD_MODEL_EFFECTIVE_COUPLINGS_H -#define STANDARD_MODEL_EFFECTIVE_COUPLINGS_H - -#include "standard_model.hpp" -#include "lowe.h" -#include "physical_input.hpp" - -#include -#include - -namespace flexiblesusy { - -namespace standard_model { - -class Standard_model_effective_couplings { -public: - Standard_model_effective_couplings(const Standard_model&, - const softsusy::QedQcd&, - const Physical_input&); - - void do_run_couplings(bool flag) { rg_improve = flag; } - bool do_run_couplings() const { return rg_improve; } - void do_include_qcd_corrections(bool flag) { include_qcd_corrections = flag; } - bool do_include_qcd_corrections() const { return include_qcd_corrections; } - void set_physical_inputs(const Physical_input& inputs_) { physical_input = inputs_; } - void set_low_energy_data(const softsusy::QedQcd& qedqcd_) { qedqcd = qedqcd_; } - void set_model(const Standard_model& model_); - - double get_hhVPVP_partial_width() const; - double get_hhVGVG_partial_width() const; - double get_AhVPVP_partial_width() const; - double get_AhVGVG_partial_width() const; - std::complex get_eff_CphhVPVP() const { return eff_CphhVPVP; } - std::complex get_eff_CphhVGVG() const { return eff_CphhVGVG; } - std::complex get_eff_CpAhVPVP() const { return eff_CpAhVPVP; } - std::complex get_eff_CpAhVGVG() const { return eff_CpAhVGVG; } - - void calculate_effective_couplings(); - - std::complex CpFdhhbarFdPL(int gt1, int gt3) const; - std::complex CpFuhhbarFuPL(int gt1, int gt3) const; - std::complex CpFehhbarFePL(int gt1, int gt3) const; - double CphhVWpconjVWp() const; - std::complex CpAhFdbarFdPL(int gt2, int gt3) const; - std::complex CpAhFubarFuPL(int gt2, int gt3) const; - std::complex CpAhFebarFePL(int gt2, int gt3) const; - void calculate_eff_CphhVPVP(); - void calculate_eff_CphhVGVG(); - void calculate_eff_CpAhVPVP(); - void calculate_eff_CpAhVGVG(); - -private: - Standard_model model; - softsusy::QedQcd qedqcd; - Physical_input physical_input; - bool rg_improve; - bool include_qcd_corrections; - - void copy_mixing_matrices_from_model(); - - standard_model::Standard_model initialise_SM() const; - void run_SM_strong_coupling_to(standard_model::Standard_model, double m); - - // higher order corrections to the amplitudes for - // effective coupling to photons - std::complex scalar_scalar_qcd_factor(double, double) const; - std::complex scalar_fermion_qcd_factor(double, double) const; - std::complex pseudoscalar_fermion_qcd_factor(double, double) const; - - // higher order corrections to the leading order - // effective couplings to gluons - double number_of_active_flavours(double) const; - double scalar_scaling_factor(double) const; - double pseudoscalar_scaling_factor(double) const; - - Eigen::Matrix,3,3> Vd; - Eigen::Matrix,3,3> Ud; - Eigen::Matrix,3,3> Vu; - Eigen::Matrix,3,3> Uu; - Eigen::Matrix,3,3> Ve; - Eigen::Matrix,3,3> Ue; - Eigen::Matrix ZZ; - - std::complex eff_CphhVPVP; - std::complex eff_CphhVGVG; - std::complex eff_CpAhVPVP; - std::complex eff_CpAhVGVG; - -}; - -} // namespace standard_model -} // namespace flexiblesusy - -#endif diff --git a/model_specific/SM/standard_model_shooting_low_scale_constraint.cpp b/model_specific/SM/standard_model_shooting_low_scale_constraint.cpp new file mode 100644 index 0000000000..c8dacd18db --- /dev/null +++ b/model_specific/SM/standard_model_shooting_low_scale_constraint.cpp @@ -0,0 +1,139 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + + +#include "standard_model_shooting_low_scale_constraint.hpp" +#include "standard_model_shooting_model.hpp" +#include "wrappers.hpp" +#include "logger.hpp" +#include "ew_input.hpp" +#include "gsl_utils.hpp" +#include "minimizer.hpp" +#include "root_finder.hpp" +#include "threshold_loop_functions.hpp" +#include "weinberg_angle.hpp" + +#include +#include + +namespace flexiblesusy { +namespace standard_model { + +Standard_model_low_scale_constraint::Standard_model_low_scale_constraint( + StandardModel* model_, const softsusy::QedQcd& qedqcd_) + : Single_scale_constraint() + , model(model_) + , qedqcd(qedqcd_) +{ + initialize(); +} + +void Standard_model_low_scale_constraint::apply() +{ + if (!model) + throw SetupError("Error: Standard_model_low_scale_constraint::apply():" + " model pointer must not be zero"); + + qedqcd.run_to(scale, 1.0e-5); + model->calculate_DRbar_masses(); + + const double alpha_em = qedqcd.displayAlpha(softsusy::ALPHA); + const double alpha_s = qedqcd.displayAlpha(softsusy::ALPHAS); + const double mz_pole = qedqcd.displayPoleMZ(); + + double delta_alpha_em = 0.; + double delta_alpha_s = 0.; + + if (model->get_thresholds() && model->get_threshold_corrections().alpha_em > 0) + delta_alpha_em = model->calculate_delta_alpha_em(alpha_em); + + if (model->get_thresholds() && model->get_threshold_corrections().alpha_s > 0) + delta_alpha_s = model->calculate_delta_alpha_s(alpha_s); + + const double alpha_em_drbar = alpha_em / (1.0 - delta_alpha_em); + const double alpha_s_drbar = alpha_s / (1.0 - delta_alpha_s); + const double e_drbar = Sqrt(4.0 * Pi * alpha_em_drbar); + const double g1 = model->get_g1(); + const double g2 = model->get_g2(); + const double mZ = model->get_thresholds() && model->get_threshold_corrections().mz > 0 ? + model->calculate_MVZ_DRbar(mz_pole) : mz_pole; + const double theta_w = model->calculate_theta_w(); + + double new_g1 = 1.2909944487358056*e_drbar*Sec(theta_w); + double new_g2 = e_drbar*Csc(theta_w); + + if (IsFinite(new_g1)) { + model->get_problems().unflag_non_perturbative_parameter(standard_model_info::g1); + } else { + model->get_problems().flag_non_perturbative_parameter( + standard_model_info::g1, new_g1, get_scale()); + new_g1 = Electroweak_constants::g1; + } + + if (IsFinite(new_g2)) { + model->get_problems().unflag_non_perturbative_parameter(standard_model_info::g2); + } else { + model->get_problems().flag_non_perturbative_parameter( + standard_model_info::g2, new_g2, get_scale()); + new_g2 = Electroweak_constants::g2; + } + + model->set_v(Re((2*mZ)/Sqrt(0.6*Sqr(g1) + Sqr(g2)))); + model->calculate_Yu_DRbar(qedqcd); + model->calculate_Yd_DRbar(qedqcd); + model->calculate_Ye_DRbar(qedqcd); + model->set_g1(new_g1); + model->set_g2(new_g2); + model->set_g3(3.5449077018110318*Sqrt(alpha_s_drbar)); +} + +double Standard_model_low_scale_constraint::get_scale() const +{ + return scale; +} + +void Standard_model_low_scale_constraint::set_model(Model* model_) +{ + model = cast_model*>(model_); +} + +void Standard_model_low_scale_constraint::set_sm_parameters( + const softsusy::QedQcd& qedqcd_) +{ + qedqcd = qedqcd_; +} + +const softsusy::QedQcd& Standard_model_low_scale_constraint::get_sm_parameters() const +{ + return qedqcd; +} + +void Standard_model_low_scale_constraint::clear() +{ + scale = 0.; + model = nullptr; + qedqcd = softsusy::QedQcd(); +} + +void Standard_model_low_scale_constraint::initialize() +{ + scale = qedqcd.displayPoleMZ(); +} + +} // namespace standard_model +} // namespace flexiblesusy diff --git a/model_specific/SM/standard_model_shooting_low_scale_constraint.hpp b/model_specific/SM/standard_model_shooting_low_scale_constraint.hpp new file mode 100644 index 0000000000..56e9ec4541 --- /dev/null +++ b/model_specific/SM/standard_model_shooting_low_scale_constraint.hpp @@ -0,0 +1,62 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + + +#ifndef STANDARD_MODEL_SHOOTING_LOW_SCALE_CONSTRAINT_H +#define STANDARD_MODEL_SHOOTING_LOW_SCALE_CONSTRAINT_H + +#include "standard_model_low_scale_constraint.hpp" +#include "single_scale_constraint.hpp" +#include "lowe.h" +#include + +namespace flexiblesusy { + +class Shooting; + +namespace standard_model { + +template +class StandardModel; + +template<> +class Standard_model_low_scale_constraint : public Single_scale_constraint { +public: + Standard_model_low_scale_constraint() = default; + Standard_model_low_scale_constraint(StandardModel*, const softsusy::QedQcd&); + virtual ~Standard_model_low_scale_constraint() = default; + virtual void apply() override; + virtual double get_scale() const override; + virtual std::string name() const override { return "Standard model low-scale constraint"; } + virtual void set_model(Model*) override; + + void clear(); + void initialize(); + const softsusy::QedQcd& get_sm_parameters() const; + void set_sm_parameters(const softsusy::QedQcd&); + +private: + double scale{0.}; + StandardModel* model{nullptr}; + softsusy::QedQcd qedqcd{}; +}; + +} // namespace standard_model +} // namespace flexiblesusy + +#endif diff --git a/model_specific/SM/standard_model_shooting_model.hpp b/model_specific/SM/standard_model_shooting_model.hpp new file mode 100644 index 0000000000..6b3a4a2405 --- /dev/null +++ b/model_specific/SM/standard_model_shooting_model.hpp @@ -0,0 +1,55 @@ +// ==================================================================== +// This file is part of FlexibleSUSY. +// +// FlexibleSUSY 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. +// +// FlexibleSUSY 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 FlexibleSUSY. If not, see +// . +// ==================================================================== + + + +/** + * @file standard_model_two_scale_model.hpp + * @brief contains class for model with routines needed to solve boundary + * value problem using the two_scale solver by solvingt EWSB + * and determine the pole masses and mixings + * + */ + +#ifndef STANDARD_MODEL_SHOOTING_MODEL_H +#define STANDARD_MODEL_SHOOTING_MODEL_H + +#include "model.hpp" +#include "standard_model.hpp" +#include "standard_model_two_scale_model.hpp" + +namespace flexiblesusy { + +class Shooting; +class Two_scale; + +/** + * @class StandardModel + * @brief model class with routines for determing masses and mixinga and EWSB + */ + +namespace standard_model { + +template<> +class StandardModel : public StandardModel {}; + +} // namespace standard_model + +} // namespace flexiblesusy + +#endif diff --git a/model_specific/SM/standard_model_two_scale_low_scale_constraint.cpp b/model_specific/SM/standard_model_two_scale_low_scale_constraint.cpp index 8642f489af..b615a5fcfc 100644 --- a/model_specific/SM/standard_model_two_scale_low_scale_constraint.cpp +++ b/model_specific/SM/standard_model_two_scale_low_scale_constraint.cpp @@ -46,6 +46,8 @@ void Standard_model_low_scale_constraint::apply() qedqcd.run_to(scale, 1.0e-5); model->calculate_DRbar_masses(); + model->solve_ewsb(); + model->calculate_Mhh_pole(); const double alpha_em = qedqcd.displayAlpha(softsusy::ALPHA); const double alpha_s = qedqcd.displayAlpha(softsusy::ALPHAS); @@ -67,7 +69,7 @@ void Standard_model_low_scale_constraint::apply() const double g2 = model->get_g2(); const double mZ = model->get_thresholds() && model->get_threshold_corrections().mz > 0 ? model->calculate_MVZ_DRbar(mz_pole) : mz_pole; - const double theta_w = model->calculate_theta_w(qedqcd, alpha_em_drbar); + const auto theta_w = model->calculate_theta_w(); double new_g1 = 1.2909944487358056*e_drbar*Sec(theta_w); double new_g2 = e_drbar*Csc(theta_w); @@ -95,9 +97,6 @@ void Standard_model_low_scale_constraint::apply() model->set_g1(new_g1); model->set_g2(new_g2); model->set_g3(3.5449077018110318*Sqrt(alpha_s_drbar)); - - if (model->get_thresholds() && model->get_threshold_corrections().sin_theta_w > 0) - qedqcd.setPoleMW(model->recalculate_mw_pole(qedqcd.displayPoleMW())); } double Standard_model_low_scale_constraint::get_scale() const diff --git a/model_specific/SM/weinberg_angle.cpp b/model_specific/SM/weinberg_angle.cpp index 61d4c50d3f..99979e68d4 100644 --- a/model_specific/SM/weinberg_angle.cpp +++ b/model_specific/SM/weinberg_angle.cpp @@ -22,6 +22,10 @@ #include "logger.hpp" #include "numerics.h" #include "numerics2.hpp" +#include "sm_mw.hpp" +#include "wrappers.hpp" +#include "sum.hpp" +#include "loop_libraries/loop_library.hpp" #include #include @@ -37,84 +41,31 @@ #define ROOT2 Electroweak_constants::root2 +#define MODELPARAMETER(p) model->get_##p() + namespace flexiblesusy { namespace { -constexpr double Pi = 3.141592653589793; - -constexpr double oneOver16PiSqr = 1.0/(16.0*Pi*Pi); - double sqr(double x) noexcept { return x*x; } -} // anonymous namespace - -namespace weinberg_angle { - -using namespace softsusy; - -Weinberg_angle::Data::Data() - : scale(0.) - , alpha_em_drbar(0.) - , fermi_contant(0.) - , self_energy_z_at_mz(0.) - , self_energy_w_at_0(0.) - , self_energy_w_at_mw(0.) - , mw_pole(0.) - , mz_pole(0.) - , mt_pole(0.) - , mh_drbar(0.) - , hmix_12(0.) - , msel_drbar(0.) - , msmul_drbar(0.) - , msve_drbar(0.) - , msvm_drbar(0.) - , mn_drbar() - , mc_drbar() - , zn() - , um() - , up() - , gY(0.) - , g2(0.) - , g3(0.) - , tan_beta(0.) +double calculate_G_fermi(double alpha_em, double mz_pole, double sin_2_cos_2, double delta_rhat) noexcept { + return Pi*alpha_em/(ROOT2*Sqr(mz_pole)*sin_2_cos_2*(1.0 - delta_rhat)); } -Weinberg_angle::Self_energy_data::Self_energy_data() - : scale(0.) - , mt_pole(0.) - , mt_drbar(0.) - , mb_drbar(0.) - , gY(0.) - , g2(0.) -{ -} +} // anonymous namespace -/** - * Sets the maximum number of iterations to 20 and - * sets the precision goal to 1.0e-8 and - * sets enables the SUSY contributions by default. - */ -Weinberg_angle::Weinberg_angle() - : number_of_iterations(20) - , number_of_loops(2) - , precision_goal(1.0e-8) - , rho_hat(0.) - , sin_theta(0.) - , data() - , susy_contributions(true) -{ -} +namespace weinberg_angle { -void Weinberg_angle::enable_susy_contributions() -{ - susy_contributions = true; -} +using namespace softsusy; -void Weinberg_angle::disable_susy_contributions() +Weinberg_angle::Weinberg_angle( + const standard_model::Standard_model* model_, + const Parameters& parameters_) + : model(model_) + , parameters(parameters_) { - susy_contributions = false; } void Weinberg_angle::set_number_of_iterations(int n) @@ -127,11 +78,6 @@ void Weinberg_angle::set_number_of_loops(int n) number_of_loops = n; } -void Weinberg_angle::set_data(const Data& data_) -{ - data = data_; -} - void Weinberg_angle::set_precision_goal(double p) { precision_goal = p; @@ -142,554 +88,202 @@ double Weinberg_angle::get_rho_hat() const return rho_hat; } -double Weinberg_angle::get_sin_theta() const -{ - return sin_theta; -} - /** * Calculates the DR-bar weak mixing angle \f$\sin\hat{\theta}_W\f$ as * defined in Eq. (C.3) from hep-ph/9606211 given the Fermi constant, - * the Z-boson pole mass and the DR-bar electromagnetic coupling as - * input. + * the Z-boson pole mass and the DR-bar electromagnetic coupling as input + * and taking the tree-level value of the \f$\hat{\rho}\f$ parameter into account. + * Furthermore the W boson pole mass is determined from the final result. * - * The function returns 1 if the iterative procedure to determine the - * weak mixing angle does not converge. + * The function throws an exception of type NoSinThetaWConvergenceError if the + * iterative procedure to determine the weak mixing angle does not converge. * - * @param rho_start initial guess for the rho-hat-parameter - * @param sin_start initial guess for the sinus of the weak mixing angle + * @param sinThetaW_start initial guess for the sine of the weak mixing angle * - * @return value != 0 if an error has occured + * @return sine of the DR-bar weak mixing angle (#1) and W pole mass (#2) */ -int Weinberg_angle::calculate(double rho_start, double sin_start) +double Weinberg_angle::calculate_sin_theta_w(double sinThetaW_start) { - const double alphaDRbar = data.alpha_em_drbar; - const double mz_pole = data.mz_pole; - const double gfermi = data.fermi_contant; + const auto gY = model->get_g1() * standard_model_info::normalization_g1; + const auto g2 = model->get_g2() * standard_model_info::normalization_g2; + const double eDRbar = gY * g2 / Sqrt(Sqr(gY) + Sqr(g2)); + const double alphaDRbar = Sqr(eDRbar) / (4.0 * Pi); + const double mw_pole = parameters.mw_pole; + const double mz_pole = parameters.mz_pole; + const double gfermi = parameters.fermi_constant; + + pizzt_MZ = calculate_self_energy_VZ(mz_pole); + piwwt_MW = calculate_self_energy_VWp(mw_pole); + piwwt_0 = calculate_self_energy_VWp(0.); int iteration = 0; bool not_converged = true; - double rho_old = rho_start, sin_old = sin_start; - double rho_new = rho_start, sin_new = sin_start; + bool fudged = false; + double sinThetaW_old = sinThetaW_start; + double sinThetaW_new = sinThetaW_start; while (not_converged && iteration < number_of_iterations) { - double deltaR - = calculate_delta_r(rho_old, sin_old, data, susy_contributions, - number_of_loops); + fudged = false; - if (deltaR > 1.) { -#if defined(ENABLE_VERBOSE) || defined(ENABLE_DEBUG) - WARNING("delta_r > 1"); -#endif - deltaR = 0.; + double deltaRhoHat = calculate_delta_rho_hat(sinThetaW_old); + + if (!std::isfinite(deltaRhoHat) || Abs(deltaRhoHat) >= 1.0) { + fudged = true; + deltaRhoHat = 0.; } - if (!std::isfinite(deltaR)) { -#if defined(ENABLE_VERBOSE) || defined(ENABLE_DEBUG) - WARNING("delta_r non-finite"); -#endif - deltaR = 0.; + const double rhohat_ratio = 1.0 / (1.0 - deltaRhoHat); + + double deltaRHat = calculate_delta_r_hat(rhohat_ratio, sinThetaW_old); + + if (!std::isfinite(deltaRHat) || Abs(deltaRHat) >= 1.0) { + fudged = true; + deltaRHat = 0.; } double sin2thetasqO4 = Pi * alphaDRbar / - (ROOT2 * sqr(mz_pole) * gfermi * (1.0 - deltaR)); + (ROOT2 * Sqr(mz_pole) * gfermi * (1.0 - deltaRHat)); - if (sin2thetasqO4 >= 0.25) + if (sin2thetasqO4 >= 0.25) { + fudged = true; sin2thetasqO4 = 0.25; + } - if (sin2thetasqO4 < 0.0) + if (sin2thetasqO4 < 0.0) { + fudged = true; sin2thetasqO4 = 0.0; - - const double sin2theta = std::sqrt(4.0 * sin2thetasqO4); - const double theta = 0.5 * std::asin(sin2theta); - - sin_new = std::sin(theta); - - double deltaRho - = calculate_delta_rho(rho_old, sin_new, data, susy_contributions, - number_of_loops); - - if (!std::isfinite(deltaRho)) { -#if defined(ENABLE_VERBOSE) || defined(ENABLE_DEBUG) - WARNING("delta_rho non-finite"); -#endif - deltaRho = 0.; } - if (std::abs(deltaRho) < 1.0) - rho_new = 1.0 / (1.0 - deltaRho); - else - rho_new = 1.0; + const double sin2theta = Sqrt(4.0 * sin2thetasqO4); + const double theta = 0.5 * ArcSin(sin2theta); - const double precision - = std::abs(rho_old / rho_new - 1.0) + std::abs(sin_old / sin_new - 1.0); + sinThetaW_new = Sin(theta); + + const double precision = Abs(sinThetaW_old / sinThetaW_new - 1.0); VERBOSE_MSG("\t\tIteration step " << iteration << ": prec=" << precision - << " dr=" << deltaR - << " drho=" << deltaRho - << " rho_new=" << rho_new - << " sin_new=" << sin_new); + << " dRhoHat=" << deltaRhoHat + << " rhohat_ratio=" << rhohat_ratio + << " dRHat=" << deltaRHat + << " sinThetaW_new=" << sinThetaW_new + << " fudged = " << fudged); not_converged = precision >= precision_goal; - rho_old = rho_new; - sin_old = sin_new; + sinThetaW_old = sinThetaW_new; iteration++; } - rho_hat = rho_new; - sin_theta = sin_new; + if (fudged) + throw NonPerturbativeSinThetaW(); - const int no_convergence_error = iteration == number_of_iterations; + if (not_converged) + throw NoSinThetaWConvergenceError(number_of_iterations, sinThetaW_new); - return no_convergence_error; + return sinThetaW_new; } /** - * Calculates the \f$\Delta\hat{\rho}\f$ corrections as defined in - * Eqs. (C.4), (C.6) from hep-ph/9606211 . - * - * @param rho rho-hat-parameter - * @param sinThetaW sin(theta_W) - * @param data data structure with model parameters - * @param add_susy_contributions add SUSY particle contributions - * @param number_of_loops loop order (0, 1, 2) - * - * @return \f$\Delta\hat{\rho}\f$ as defined in (C.5) and (C.5) from hep-ph/9606211 + * Calculates Fermi constant \f$G_F\f$. */ -double Weinberg_angle::calculate_delta_rho( - double rho, - double sinThetaW, - const Data& data, - bool add_susy_contributions, - int number_of_loops -) +double Weinberg_angle::calculate_G_fermi() { - const double mz = data.mz_pole; - const double mw = data.mw_pole; - const double mt = data.mt_pole; - const double mh = data.mh_drbar; - const double sinb = std::sin(std::atan(data.tan_beta)); - const double xt = 3.0 * data.fermi_contant * sqr(mt) * ROOT2 * oneOver16PiSqr; - const double alphaDRbar = data.alpha_em_drbar; - const double g3 = data.g3; - const double pizztMZ = data.self_energy_z_at_mz; - const double piwwtMW = data.self_energy_w_at_mw; - const double hmix12 = data.hmix_12; - -#if defined(ENABLE_VERBOSE) || defined(ENABLE_DEBUG) - WARN_IF_ZERO(rho, calculate_delta_rho) - WARN_IF_ZERO(sinThetaW, calculate_delta_rho) - WARN_IF_ZERO(mz, calculate_delta_rho) - WARN_IF_ZERO(mw, calculate_delta_rho) - WARN_IF_ZERO(mt, calculate_delta_rho) - WARN_IF_ZERO(mh, calculate_delta_rho) - WARN_IF_ZERO(xt, calculate_delta_rho) - WARN_IF_ZERO(alphaDRbar, calculate_delta_rho) - WARN_IF_ZERO(pizztMZ, calculate_delta_rho) - WARN_IF_ZERO(piwwtMW, calculate_delta_rho) - if (add_susy_contributions) { - WARN_IF_ZERO(sinb, calculate_delta_rho) - WARN_IF_ZERO(hmix12, calculate_delta_rho) + const double gY = model->get_g1() * standard_model_info::normalization_g1; + const double g2 = model->get_g2() * standard_model_info::normalization_g2; + const double e = gY*g2/Sqrt(Sqr(gY) + Sqr(g2)); + const double alpha_em_drbar = Sqr(e)/(4*Pi); // @todo(alex): may use input parameters.alpha_em_drbar from qedqcd here + const double mw_drbar = model->get_MVWp(); + const double mz_drbar = model->get_MVZ(); + const double mw_pole = parameters.mw_pole; + const double mz_pole = parameters.mz_pole; + const double cos_theta = mw_drbar/mz_drbar; + const double theta = ArcCos(cos_theta); + const double sin_theta = Sin(theta); + const double sin_2_cos_2 = Sqr(sin_theta*Cos(theta)); + + const double gfermi_0l = flexiblesusy::calculate_G_fermi(alpha_em_drbar, mz_pole, sin_2_cos_2, 0.0); + + VERBOSE_MSG("\tcalculate_G_fermi (" << number_of_loops << "-loop):" + << " alpha_em_drbar=" << alpha_em_drbar + << ", mz_pole=" << mz_pole + << ", sin_theta=" << sin_theta + << ", gfermi_0l=" << gfermi_0l); + + if (number_of_loops <= 0) { + return gfermi_0l; } -#endif - double hmix_r = 1.0; - if (add_susy_contributions) - hmix_r = sqr(hmix12 / sinb); + pizzt_MZ = calculate_self_energy_VZ(mz_pole); + piwwt_MW = calculate_self_energy_VWp(mw_pole); + piwwt_0 = calculate_self_energy_VWp(0.); - double deltaRhoOneLoop = 0.; + const double delta_rho_hat_1l = calculate_delta_rho_hat(sin_theta); // Eq.(C.4) [arXiv:hep-ph/9606211] + const double rho_hat_1l = 1.0/(1.0 - delta_rho_hat_1l); // Eq.(C.4) + const double delta_r_hat_1l = calculate_delta_r_hat(rho_hat_1l, sin_theta); // Eq.(C.3) + const double gfermi_1l = flexiblesusy::calculate_G_fermi(alpha_em_drbar, mz_pole, sin_2_cos_2, delta_r_hat_1l); - if (number_of_loops > 0) - deltaRhoOneLoop = pizztMZ / (rho * sqr(mz)) - piwwtMW / sqr(mw); + VERBOSE_MSG("\t\tG_Fermi(1-loop):" + << " delta_rho_hat_1l=" << delta_rho_hat_1l + << ", rho_hat_1l=" << rho_hat_1l + << ", delta_r_hat_1l=" << delta_r_hat_1l + << ", gfermi_1l=" << gfermi_1l); - double deltaRho2LoopSm = 0.; - - if (number_of_loops > 1) { - deltaRho2LoopSm = alphaDRbar * sqr(g3) / - (16.0 * Pi * sqr(Pi) * sqr(sinThetaW)) * - (-2.145 * sqr(mt) / sqr(mw) + 1.262 * log(mt / mz) - 2.24 - - 0.85 * sqr(mz) - / sqr(mt)) + sqr(xt) * hmix_r * - rho_2(mh / mt) / 3.0; + if (number_of_loops <= 1) { + return gfermi_1l; } - const double deltaRho = deltaRhoOneLoop + deltaRho2LoopSm; - - return deltaRho; -} + int iteration = 0; + bool not_converged = true; -/** - * Calculates the \f$\Delta\hat{r}\f$ corrections as defined in Eqs. (C.3), - * (C.5) from hep-ph/9606211 . - * - * @param rho rho-hat-parameter - * @param sinThetaW sin(theta_W) - * @param data data structure with model parameters - * @param add_susy_contributions add SUSY particle contributions - * @param number_of_loops loop order (0, 1, 2) - * - * @return \f$\Delta\hat{r}\f$ as defined in (C.5) and (C.5) from hep-ph/9606211 - */ -double Weinberg_angle::calculate_delta_r( - double rho, - double sinThetaW, - const Data& data, - bool add_susy_contributions, - int number_of_loops -) -{ - const double outcos = std::cos(std::asin(sinThetaW)); - const double sinb = std::sin(std::atan(data.tan_beta)); - const double mz = data.mz_pole; - const double mw = data.mw_pole; - const double mt = data.mt_pole; - const double mh = data.mh_drbar; - const double xt = 3.0 * data.fermi_contant * sqr(mt) * ROOT2 * oneOver16PiSqr; - const double alphaDRbar = data.alpha_em_drbar; - const double g3 = data.g3; - const double pizztMZ = data.self_energy_z_at_mz; - const double piwwt0 = data.self_energy_w_at_0; - const double hmix12 = data.hmix_12; + parameters.fermi_constant = gfermi_1l; + double gfermi_2l_old = gfermi_1l; + double gfermi_2l = gfermi_1l; -#if defined(ENABLE_VERBOSE) || defined(ENABLE_DEBUG) - WARN_IF_ZERO(rho, calculate_delta_r) - WARN_IF_ZERO(sinThetaW, calculate_delta_r) - WARN_IF_ZERO(mz, calculate_delta_r) - WARN_IF_ZERO(mw, calculate_delta_r) - WARN_IF_ZERO(mt, calculate_delta_r) - WARN_IF_ZERO(mh, calculate_delta_r) - WARN_IF_ZERO(xt, calculate_delta_r) - WARN_IF_ZERO(alphaDRbar, calculate_delta_r) - WARN_IF_ZERO(g3, calculate_delta_r) - WARN_IF_ZERO(pizztMZ, calculate_delta_r) - WARN_IF_ZERO(piwwt0, calculate_delta_r) - if (add_susy_contributions) { - WARN_IF_ZERO(sinb, calculate_delta_rho) - WARN_IF_ZERO(hmix12, calculate_delta_rho) + while (not_converged && iteration++ < number_of_iterations) { + const double delta_rho_hat = calculate_delta_rho_hat(sin_theta); + const double rho_hat = 1.0/(1.0 - delta_rho_hat); // Eq.(C.4) + const double delta_r_hat = calculate_delta_r_hat(rho_hat, sin_theta); + gfermi_2l = flexiblesusy::calculate_G_fermi(alpha_em_drbar, mz_pole, sin_2_cos_2, delta_r_hat); + const double precision = Abs(gfermi_2l_old/gfermi_2l - 1.0); + not_converged = precision >= precision_goal; + parameters.fermi_constant = gfermi_2l; + gfermi_2l_old = gfermi_2l; + + VERBOSE_MSG("\t\tG_Fermi(1-loop, iteration " << iteration << "," + << " precision=" << precision << "):" + << " delta_rho_hat=" << delta_rho_hat + << ", rho_hat=" << rho_hat + << ", delta_r_hat=" << delta_r_hat + << ", gfermi_2l=" << gfermi_2l); } -#endif - - double dvb = 0.; - - if (number_of_loops > 0) - dvb = calculate_delta_vb(rho, sinThetaW, data, add_susy_contributions); - double hmix_r = 1.0; - if (add_susy_contributions) - hmix_r = sqr(hmix12 / sinb); - - double deltaR = 0.; - - if (number_of_loops > 0) - deltaR = rho * piwwt0 / sqr(mw) - pizztMZ / sqr(mz) + dvb; - - double deltaR2LoopSm = 0.; - - if (number_of_loops > 1) { - deltaR2LoopSm = alphaDRbar * sqr(g3) / - (16.0 * sqr(Pi) * Pi * sqr(sinThetaW) * sqr(outcos)) * - (2.145 * sqr(mt) / sqr(mz) + 0.575 * log(mt / mz) - 0.224 - - 0.144 * sqr(mz) / sqr(mt)) - - sqr(xt) * hmix_r * - rho_2(mh / mt) * (1.0 - deltaR) * rho / 3.0; + if (iteration >= number_of_iterations) { + throw NoGFermiConvergenceError(number_of_iterations, gfermi_2l); } - const double deltaR_full = deltaR + deltaR2LoopSm; - - return deltaR_full; + return gfermi_2l; } /** - * Calculates the vertex, box and external wave-function - * renormalizations \f$\delta_{\text{VB}}\f$ as given in - * Eqs. (C.11)-(C.16), (C.20) from hep-ph/9606211 . + * Calculates the vertex, box and external wave-function renormalization + * corrections \f$\delta_{\text{VB}}\f$ for the specific model as e.g. + * given in Eqs. (C.11)-(C.16), (C.20) from hep-ph/9606211 for the MSSM. * - * @param rho rho-hat-parameter + * @param rhohat_ratio = rhohat / rhohat_tree * @param sinThetaW sin(theta_W) - * @param data data structure with model parameters - * @param add_susy_contributions add SUSY particle contributions * - * @return \f$\delta_{\text{VB}}\f$ as defined in (C.11) from hep-ph/9606211 + * @return \f$\delta_{\text{VB}}\f$ */ -double Weinberg_angle::calculate_delta_vb( - double rho, - double sinThetaW, - const Data& data, - bool add_susy_contributions) +double Weinberg_angle::calculate_delta_vb(double rhohat_ratio, double sinThetaW) const { - double deltaVbSusy = 0.; - const double deltaVbSm = calculate_delta_vb_sm(rho, sinThetaW, data); - - if (add_susy_contributions) - deltaVbSusy = calculate_delta_vb_susy(sinThetaW, data); + const double deltaVbSM = calculate_delta_vb_sm(sinThetaW); - const double deltaVb = deltaVbSm + deltaVbSusy; + const double deltaVb = rhohat_ratio * deltaVbSM; return deltaVb; } -/** - * Calculates the Standard Model vertex, box corrections - * \f$\delta_{\text{VB}}^{\text{SM}}\f$ as given in Eqs. (C.12) from - * hep-ph/9606211 . - * - * @param rho rho-hat-parameter - * @param sinThetaW sin(theta_W) - * @param data data structure with model parameters - * - * @return \f$\delta_{\text{VB}}^{\text{SM}}\f$ as defined in (C.11) - * from hep-ph/9606211 - */ -double Weinberg_angle::calculate_delta_vb_sm( - double rho, - double sinThetaW, - const Data& data -) -{ - const double mz = data.mz_pole; - const double mw = data.mw_pole; - const double costh = mw / mz; - const double cw2 = sqr(costh); - const double sw2 = 1.0 - cw2; - const double sinThetaW2 = sqr(sinThetaW); - const double outcos = sqrt(1.0 - sinThetaW2); - const double alphaDRbar = data.alpha_em_drbar; - const double scale = data.scale; - -#if defined(ENABLE_VERBOSE) || defined(ENABLE_DEBUG) - WARN_IF_ZERO(rho, calculate_delta_vb_sm) - WARN_IF_ZERO(sinThetaW, calculate_delta_vb_sm) - WARN_IF_ZERO(mz, calculate_delta_vb_sm) - WARN_IF_ZERO(mw, calculate_delta_vb_sm) - WARN_IF_ZERO(alphaDRbar, calculate_delta_vb_sm) -#endif - - const double deltaVbSm = - rho * alphaDRbar / (4.0 * Pi * sinThetaW2) * - (6.0 + log(cw2) / sw2 * - (3.5 - 2.5 * sw2 - sinThetaW2 * (5.0 - 1.5 * cw2 / sqr(outcos))) - - 4. * std::log(sqr(mz/scale))); - - return deltaVbSm; -} - -/** - * Calculates the SUSY vertex, box and external wave-function - * renormalizations \f$\delta_{\text{VB}}^{\text{SUSY}}\f$ as given in - * Eqs. (C.11)-(C.16), (C.20) from hep-ph/9606211 . - * - * @param sinThetaW sin(theta_W) - * @param data data structure with model parameters - * - * @return \f$\delta_{\text{VB}}^{\text{SUSY}}\f$ as defined in (C.11) - * from hep-ph/9606211 - */ -double Weinberg_angle::calculate_delta_vb_susy( - double sinThetaW, - const Data& data -) -{ - const double g = data.g2; - const double gp = data.gY; - const double mz = data.mz_pole; - const double sinThetaW2 = sqr(sinThetaW); - const double outcos = sqrt(1.0 - sinThetaW2); - const double q = data.scale; - const double alphaDRbar = data.alpha_em_drbar; - const double mselL = data.msel_drbar; - const double msmuL = data.msmul_drbar; - const double msnue = data.msve_drbar; - const double msnumu = data.msvm_drbar; - const Eigen::ArrayXd& mneut(data.mn_drbar); - const Eigen::ArrayXd& mch(data.mc_drbar); - const Eigen::MatrixXcd& n(data.zn); - const Eigen::MatrixXcd& u(data.um); - const Eigen::MatrixXcd& v(data.up); - -#if defined(ENABLE_VERBOSE) || defined(ENABLE_DEBUG) - WARN_IF_ZERO(sinThetaW, calculate_delta_vb_susy) - WARN_IF_ZERO(g, calculate_delta_vb_susy) - WARN_IF_ZERO(gp, calculate_delta_vb_susy) - WARN_IF_ZERO(mz, calculate_delta_vb_susy) - WARN_IF_ZERO(q, calculate_delta_vb_susy) - WARN_IF_ZERO(alphaDRbar, calculate_delta_vb_susy) - WARN_IF_ZERO(mselL, calculate_delta_vb_susy) - WARN_IF_ZERO(msmuL, calculate_delta_vb_susy) - WARN_IF_ZERO(msnue, calculate_delta_vb_susy) - WARN_IF_ZERO(msnumu, calculate_delta_vb_susy) - QUIT_IF(mneut.rows() < 4, calculate_delta_vb_susy) - QUIT_IF(mneut.cols() != 1, calculate_delta_vb_susy) - QUIT_IF(mch.rows() < 2, calculate_delta_vb_susy) - QUIT_IF(mch.cols() != 1, calculate_delta_vb_susy) - QUIT_IF(mneut.rows() != n.rows(), calculate_delta_vb_susy) - QUIT_IF(mneut.rows() != n.cols(), calculate_delta_vb_susy) - QUIT_IF(mch.rows() != u.rows(), calculate_delta_vb_susy) - QUIT_IF(mch.rows() != u.cols(), calculate_delta_vb_susy) - QUIT_IF(mch.rows() != v.rows(), calculate_delta_vb_susy) - QUIT_IF(mch.rows() != v.cols(), calculate_delta_vb_susy) -#endif - - const int dimN = mneut.rows(); - const int dimC = mch.rows(); - - Eigen::VectorXd bPsi0NuNul(Eigen::VectorXd::Zero(dimN)), - bPsicNuSell(Eigen::VectorXd::Zero(dimC)); - Eigen::VectorXd bPsi0ESell(Eigen::VectorXd::Zero(dimN)), - aPsicESnul(Eigen::VectorXd::Zero(dimC)); - Eigen::VectorXcd bChi0NuNul, bChicNuSell; - Eigen::VectorXcd bChi0ESell, aChicESnul; - - bPsicNuSell(0) = g; - bPsi0NuNul(1) = ROOT2 * g * 0.5; - bPsi0NuNul(0) = -gp / ROOT2; - aPsicESnul(0) = g; - bPsi0ESell(0) = -gp / ROOT2; - bPsi0ESell(1) = -g * ROOT2 * 0.5; - - bChicNuSell = u * bPsicNuSell; - bChi0ESell = n * bPsi0ESell; - bChi0NuNul = n * bPsi0NuNul; - - aChicESnul = v.conjugate() * aPsicESnul; - - double deltaZnue = 0.0, deltaZe = 0.0; - for (int i = 0; i < dimN; i++) { - deltaZnue += - sqr(std::abs(bChi0NuNul(i))) * b1(0.0, mneut(i), msnue, q); - deltaZe += - sqr(std::abs(bChi0ESell(i))) * b1(0.0, mneut(i), mselL, q); - } - for (int i = 0; i < dimC; i++) { - deltaZnue += - sqr(std::abs(bChicNuSell(i))) * b1(0.0, mch(i), mselL, q); - deltaZe += - sqr(std::abs(aChicESnul(i))) * b1(0.0, mch(i), msnue, q); - } - - Eigen::VectorXd bPsicNuSmul(Eigen::VectorXd::Zero(dimC)); - Eigen::VectorXd bPsi0MuSmul(Eigen::VectorXd::Zero(dimN)), - aPsicMuSnul(Eigen::VectorXd::Zero(dimC)); - Eigen::VectorXcd bChicNuSmul; - Eigen::VectorXcd bChi0MuSmul, aChicMuSnul; - - bPsicNuSmul(0) = g; - aPsicMuSnul(0) = g; - bPsi0MuSmul(0) = -gp / ROOT2; - bPsi0MuSmul(1) = -g * ROOT2 * 0.5; - - bChicNuSmul = u * bPsicNuSmul; - bChi0MuSmul = n * bPsi0MuSmul; - aChicMuSnul = v.conjugate() * aPsicMuSnul; - - double deltaZnumu = 0.0, deltaZmu = 0.0; - for (int i = 0; i < dimN; i++) { - deltaZnumu += - sqr(std::abs(bChi0NuNul(i))) * b1(0.0, mneut(i), msnumu, q); - deltaZmu += - sqr(std::abs(bChi0MuSmul(i))) * b1(0.0, mneut(i), msmuL, q); - } - for (int i = 0; i < dimC; i++) { - deltaZnumu += - sqr(std::abs(bChicNuSmul(i))) * b1(0.0, mch(i), msmuL, q); - deltaZmu += - sqr(std::abs(aChicMuSnul(i))) * b1(0.0, mch(i), msnumu, q); - } - - Eigen::MatrixXd aPsi0PsicW(Eigen::MatrixXd::Zero(dimN,dimC)), - bPsi0PsicW(Eigen::MatrixXd::Zero(dimN,dimC)), - fW(Eigen::MatrixXd::Zero(dimN,dimC)), - gW(Eigen::MatrixXd::Zero(dimN,dimC)); - Eigen::MatrixXcd aChi0ChicW, bChi0ChicW; - - aPsi0PsicW(1, 0) = - g; - bPsi0PsicW(1, 0) = - g; - aPsi0PsicW(3, 1) = g / ROOT2; - bPsi0PsicW(2, 1) = -g / ROOT2; - - aChi0ChicW = n.conjugate() * aPsi0PsicW * v.transpose(); - bChi0ChicW = n * bPsi0PsicW * u.adjoint(); - - const double b0_0_mselL_msnue = b0(0.0, mselL, msnue, q); - const double b0_0_mnmuL_msnumu = b0(0.0, msmuL, msnumu, q); - - std::complex deltaVE; - for (int i = 0; i < dimC; i++) { - for (int j = 0; j < dimN; j++) { - const double c0_mselL_mch_mneut = c0(mselL, mch(i), mneut(j)); - const double c0_msnue_mch_mneut = c0(msnue, mch(i), mneut(j)); - const double b0_0_mch_mneut = b0(0.0, mch(i), mneut(j), q); - - deltaVE += bChicNuSell(i) * std::conj(bChi0ESell(j)) * - (- ROOT2 / g * aChi0ChicW(j, i) * mch(i) * mneut(j) * - c0_mselL_mch_mneut + 1.0 / (ROOT2 * g) * - bChi0ChicW(j, i) * - (b0_0_mch_mneut + sqr(mselL) * - c0_mselL_mch_mneut - 0.5)); - deltaVE += - aChicESnul(i) * bChi0NuNul(j) * - (- ROOT2 / g * bChi0ChicW(j, i) * mch(i) * mneut(j) * - c0_msnue_mch_mneut + 1.0 / (ROOT2 * g) * - aChi0ChicW(j, i) * - (b0_0_mch_mneut + sqr(msnue) * - c0_msnue_mch_mneut - 0.5)); - } - } - - for (int j = 0; j < dimN; j++) { - deltaVE += - 0.5 * std::conj(bChi0ESell(j)) * bChi0NuNul(j) * - (b0_0_mselL_msnue + sqr(mneut(j)) * - c0(mneut(j), mselL, msnue) + 0.5); - } - - std::complex deltaVMu; - for (int i = 0; i < dimC; i++) { - for (int j = 0; j < dimN; j++) { - const double c0_msmuL_mch_mneut = c0(msmuL, mch(i), mneut(j)); - const double c0_msnumu_mch_mneut = c0(msnumu, mch(i), mneut(j)); - const double b0_0_mch_mneut = b0(0.0, mch(i), mneut(j), q); - - deltaVMu += bChicNuSmul(i) * std::conj(bChi0MuSmul(j)) * - (- ROOT2 / g * aChi0ChicW(j, i) * mch(i) * mneut(j) * - c0_msmuL_mch_mneut + 1.0 / (ROOT2 * g) * - bChi0ChicW(j, i) * - (b0_0_mch_mneut + sqr(msmuL) * - c0_msmuL_mch_mneut - 0.5)); - deltaVMu += - aChicMuSnul(i) * bChi0NuNul(j) * - (- ROOT2 / g * bChi0ChicW(j, i) * mch(i) * mneut(j) * - c0_msnumu_mch_mneut + 1.0 / (ROOT2 * g) * - aChi0ChicW(j, i) * - (b0_0_mch_mneut + sqr(msnumu) * - c0_msnumu_mch_mneut - 0.5)); - } - } - - for (int j = 0; j < dimN; j++) { - deltaVMu += - 0.5 * std::conj(bChi0MuSmul(j)) * bChi0NuNul(j) * - (b0_0_mnmuL_msnumu + sqr(mneut(j)) * - c0(mneut(j), msmuL, msnumu) + 0.5); - } - - std::complex a1; - for(int i = 0; i < dimC; i++) { - for(int j = 0; j < dimN; j++) { - a1 += 0.5 * aChicMuSnul(i) * std::conj(bChicNuSell(i)) * - bChi0NuNul(j) * bChi0ESell(j) * mch(i) * mneut(j) * - d0(mselL, msnumu, mch(i), mneut(j)); - a1 += 0.5 * std::conj(aChicESnul(i)) * bChicNuSmul(i) * - std::conj(bChi0NuNul(j)) * std::conj(bChi0MuSmul(j)) * mch(i) * mneut(j) * - d0(msmuL, msnue, mch(i), mneut(j)); - a1 += bChicNuSmul(i) * std::conj(bChicNuSell(i)) * - std::conj(bChi0MuSmul(j)) * bChi0ESell(j) * - d27(msmuL, mselL, mch(i), mneut(j)); - a1 += std::conj(aChicMuSnul(i)) * aChicESnul(i) * - bChi0NuNul(j) * std::conj(bChi0NuNul(j)) * - d27(msnumu, msnue, mch(i), mneut(j)); - } - } - - const double deltaVbSusy = - (-sinThetaW2 * sqr(outcos) / (2.0 * Pi * alphaDRbar) * sqr(mz) - * a1.real() + deltaVE.real() + deltaVMu.real() + - 0.5 * (deltaZe + deltaZnue + deltaZmu + deltaZnumu) ) * oneOver16PiSqr; - - return deltaVbSusy; -} - /** * Calculates \f$\rho^{(2)}(r)\f$ as given in Eqs. (C.7)-(C.8) from * hep-ph/9606211 . @@ -731,26 +325,28 @@ double Weinberg_angle::rho_2(double r) } /** - * Calculates 1-loop top-quark contribution to W boson self-energy. + * Calculates 1-loop transverse Z boson self-energy + * including the correction from usage of pole instead of DRbar top-quark mass. * * @param p momentum - * @param mt top-quark mass - * @param data model parameters * - * @return 1-loop top-quark contribution to W boson self-energy + * @return 1-loop transverse Z boson self-energy */ -double Weinberg_angle::calculate_self_energy_w_top( - double p, double mt, const Self_energy_data& data) +double Weinberg_angle::calculate_self_energy_VZ(double p) const { - const double q = data.scale; - const double mb = data.mb_drbar; - const double Nc = 3.0; - const double g2 = data.g2; + const double mt_pole = parameters.mt_pole; + const double mt_drbar = model->get_MFu(2); + const double pizzt = Re(model->self_energy_VZ_1loop(p)); - const double self_energy_w = - 0.5 * Nc * hfn(p, mt, mb, q) * sqr(g2) * oneOver16PiSqr; + double pizzt_corrected = pizzt; + + if (model->get_thresholds() > 1) { + pizzt_corrected = + pizzt - calculate_self_energy_VZ_top(p, mt_drbar) + + calculate_self_energy_VZ_top(p, mt_pole); + } - return self_energy_w; + return pizzt_corrected; } /** @@ -758,84 +354,218 @@ double Weinberg_angle::calculate_self_energy_w_top( * * @param p momentum * @param mt top-quark mass - * @param data model parameters * * @return 1-loop top-quark contribution to Z boson self-energy */ -double Weinberg_angle::calculate_self_energy_z_top( - double p, double mt, const Self_energy_data& data) +double Weinberg_angle::calculate_self_energy_VZ_top(double p, double mt) const { - const double q = data.scale; - const double Nc = 3.0; - const double gY = data.gY; - const double g2 = data.g2; - const double gY2 = sqr(gY); - const double g22 = sqr(g2); + const double q = model->get_scale(); + static constexpr double Nc = 3.0; + const auto gY = model->get_g1() * standard_model_info::normalization_g1; + const auto g2 = model->get_g2() * standard_model_info::normalization_g2; + const double gY2 = Sqr(gY); + const double g22 = Sqr(g2); const double sw2 = gY2 / (gY2 + g22); const double cw2 = 1.0 - sw2; const double guL = 0.5 - 2.0 * sw2 / 3.0; const double guR = 2.0 * sw2 / 3.0; - const double self_energy_z = - Nc * (hfn(p, mt, mt, q) * (sqr(guL) + sqr(guR)) - - 4.0 * guL * guR * sqr(mt) * b0(p, mt, mt, q)) - * sqr(g2) / cw2 * oneOver16PiSqr; + const double self_energy_z_top = + Nc * Sqr(g2) / cw2 * oneOver16PiSqr * + (softsusy::hfn(p, mt, mt, q) * (Sqr(guL) + Sqr(guR)) - + 4.0 * guL * guR * Sqr(mt) * softsusy::b0(p, mt, mt, q)); - return self_energy_z; + return self_energy_z_top; } /** - * Replaces the 1-loop top-quark DR-bar mass contribution in the given - * W boson self-energy by the 1-loop top-quark pole mass contribution. + * Calculates 1-loop transverse W boson self-energy + * including the correction from usage of pole instead of DRbar top-quark mass. * - * @param self_energy_w full W boson self-energy * @param p momentum - * @param data model parameters * - * @return W self-energy with top DR-bar mass replaced by top pole mass + * @return 1-loop transverse W boson self-energy */ -double Weinberg_angle::replace_mtop_in_self_energy_w( - double self_energy_w, double p, const Self_energy_data& data) +double Weinberg_angle::calculate_self_energy_VWp(double p) const { - const double mt_pole = data.mt_pole; - const double mt_drbar = data.mt_drbar; + const double mt_pole = parameters.mt_pole; + const double mt_drbar = model->get_MFu(2); + const double piwwt = Re(model->self_energy_VWp_1loop(p)); - const double self_energy_w_mt_drbar - = calculate_self_energy_w_top(p, mt_drbar, data); - const double self_energy_w_mt_pole - = calculate_self_energy_w_top(p, mt_pole, data); + double piwwt_corrected = piwwt; - const double self_energy_w_with_mt_pole - = self_energy_w - self_energy_w_mt_drbar + self_energy_w_mt_pole; + if (model->get_thresholds() > 1) { + piwwt_corrected = + piwwt - calculate_self_energy_VWp_top(p, mt_drbar) + + calculate_self_energy_VWp_top(p, mt_pole); + } - return self_energy_w_with_mt_pole; + return piwwt_corrected; } /** - * Replaces the 1-loop top-quark DR-bar mass contribution in the given - * Z boson self-energy by the 1-loop top-quark pole mass contribution. + * Calculates 1-loop top-quark contribution to W boson self-energy. * - * @param self_energy_z full Z boson self-energy * @param p momentum - * @param data model parameters + * @param mt top-quark mass + * + * @return 1-loop top-quark contribution to W boson self-energy + */ +double Weinberg_angle::calculate_self_energy_VWp_top(double p, double mt) const +{ + const double q = model->get_scale(); + const double mb = model->get_MFd(2); + static constexpr double Nc = 3.0; + const auto g2 = model->get_g2() * standard_model_info::normalization_g2; + + const double self_energy_w_top = + 0.5 * Nc * softsusy::hfn(p, mt, mb, q) * Sqr(g2) * oneOver16PiSqr; + + return self_energy_w_top; +} + +/** + * Calculates the \f$\Delta\hat{\rho}\f$ corrections as defined in + * Eqs. (C.4), (C.6) from hep-ph/9606211 but with the dependency on + * rhohat eliminated. + * + * @param sinThetaW sin(theta_W) * - * @return Z self-energy with top DR-bar mass replaced by top pole mass + * @return \f$\Delta\hat{\rho}\f$ as defined in (C.4) and (C.6) from hep-ph/9606211 */ -double Weinberg_angle::replace_mtop_in_self_energy_z( - double self_energy_z, double p, const Self_energy_data& data) +double Weinberg_angle::calculate_delta_rho_hat(double sinThetaW) const { - const double mt_pole = data.mt_pole; - const double mt_drbar = data.mt_drbar; + const double gfermi = parameters.fermi_constant; + const double mw = parameters.mw_pole; + const double mz = parameters.mz_pole; + const double mt = parameters.mt_pole; + const double alphaS = parameters.alpha_s; - const double self_energy_z_mt_drbar - = calculate_self_energy_z_top(p, mt_drbar, data); - const double self_energy_z_mt_pole - = calculate_self_energy_z_top(p, mt_pole, data); + const double deltaRhoHat1Loop = number_of_loops > 0 ? + 1 - (1 + piwwt_MW / Sqr(mw)) / (1 + pizzt_MZ / Sqr(mz)) : 0.; - const double self_energy_z_with_mt_pole - = self_energy_z - self_energy_z_mt_drbar + self_energy_z_mt_pole; + std::complex deltaRhoHat2LoopSM(0., 0.); - return self_energy_z_with_mt_pole; + if (number_of_loops > 1) { + if (Abs(1. - model->get_scale() / mz) > 0.1) { +#if defined(ENABLE_VERBOSE) || defined(ENABLE_DEBUG) + WARNING("scale deviates from value mz_pole assumed in deltaRhoHat2LoopSM"); +#endif + } + + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto v = MODELPARAMETER(v); + const auto Yu = MODELPARAMETER(Yu); + const auto Vu = MODELPARAMETER(Vu); + const auto Uu = MODELPARAMETER(Uu); + const auto Mhh = MODELPARAMETER(Mhh); + + deltaRhoHat2LoopSM = (6.015223977354103e-6*((64*alphaS*Pi*Sqr(g1)*Sqr(g2)*(- + 2.24 + 1.262*Log(mt/mz) - (2.145*Sqr(mt))/Sqr(mw) - (0.85*Sqr(mz))/Sqr(mt))) + /((0.6*Sqr(g1) + Sqr(g2))*Sqr(sinThetaW)) - 5*rho_2(Mhh/mt)*Sqr(gfermi)*Sqr( + mt)*Sqr(v)*(Sqr(Abs(SUM(j2,0,2,Conj(Vu(2,j2))*SUM(j1,0,2,Conj(Uu(2,j1))*Yu( + j1,j2))) - SUM(j2,0,2,SUM(j1,0,2,Conj(Yu(j1,j2))*Uu(2,j1))*Vu(2,j2)))) - Sqr + (Abs(SUM(j2,0,2,Conj(Vu(2,j2))*SUM(j1,0,2,Conj(Uu(2,j1))*Yu(j1,j2))) + SUM( + j2,0,2,SUM(j1,0,2,Conj(Yu(j1,j2))*Uu(2,j1))*Vu(2,j2)))))))/(1 + pizzt_MZ/Sqr( + mz)); } + + const double deltaRhoHat2LoopSMreal = std::real(deltaRhoHat2LoopSM); + + const double deltaRhoHat = deltaRhoHat1Loop + deltaRhoHat2LoopSMreal; + + return deltaRhoHat; +} + +/** + * Calculates the \f$\Delta\hat{r}\f$ corrections as defined in + * Eqs. (C.3), (C.5) from hep-ph/9606211 taking the tree-level + * value of the rhohat parameter into account. + * + * @param rhohat_ratio = rhohat / rhohat_tree + * @param sinThetaW sin(theta_W) + * + * @return \f$\Delta\hat{r}\f$ as defined in (C.3) and (C.5) from hep-ph/9606211 + */ +double Weinberg_angle::calculate_delta_r_hat(double rhohat_ratio, double sinThetaW) const +{ + const double gfermi = parameters.fermi_constant; + const double mw = parameters.mw_pole; + const double mz = parameters.mz_pole; + const double mt = parameters.mt_pole; + const double alphaS = parameters.alpha_s; + + const double dvb = number_of_loops > 0 ? + calculate_delta_vb(rhohat_ratio, sinThetaW) : 0.; + + const double deltaRHat1Loop = number_of_loops > 0 ? + rhohat_ratio * piwwt_0 / Sqr(mw) - pizzt_MZ / Sqr(mz) + dvb : 0.; + + std::complex deltaRHat2LoopSM(0., 0.); + + if (number_of_loops > 1) { + if (Abs(1. - model->get_scale() / mz) > 0.1) { +#if defined(ENABLE_VERBOSE) || defined(ENABLE_DEBUG) + WARNING("scale deviates from value mz_pole assumed in deltaRHat2LoopSM"); +#endif + } + + const auto g1 = MODELPARAMETER(g1); + const auto g2 = MODELPARAMETER(g2); + const auto v = MODELPARAMETER(v); + const auto Yu = MODELPARAMETER(Yu); + const auto Vu = MODELPARAMETER(Vu); + const auto Uu = MODELPARAMETER(Uu); + const auto Mhh = MODELPARAMETER(Mhh); + + deltaRHat2LoopSM = 6.015223977354103e-6*((64*alphaS*Pi*Sqr(g1)*Sqr(g2)*(-0.224 + + 0.575*Log(mt/mz) + (2.145*Sqr(mt))/Sqr(mz) - (0.144*Sqr(mz))/Sqr(mt)))/(( + 0.6*Sqr(g1) + Sqr(g2))*(1 - Sqr(sinThetaW))*Sqr(sinThetaW)) - 5*(-1 + + deltaRHat1Loop)*rhohat_ratio*rho_2(Mhh/mt)*Sqr(gfermi)*Sqr(mt)*Sqr(v)*(Sqr(Abs + (SUM(j2,0,2,Conj(Vu(2,j2))*SUM(j1,0,2,Conj(Uu(2,j1))*Yu(j1,j2))) - SUM(j2,0, + 2,SUM(j1,0,2,Conj(Yu(j1,j2))*Uu(2,j1))*Vu(2,j2)))) - Sqr(Abs(SUM(j2,0,2,Conj + (Vu(2,j2))*SUM(j1,0,2,Conj(Uu(2,j1))*Yu(j1,j2))) + SUM(j2,0,2,SUM(j1,0,2, + Conj(Yu(j1,j2))*Uu(2,j1))*Vu(2,j2)))))); } + + const double deltaRHat2LoopSMreal = std::real(deltaRHat2LoopSM); + + const double deltaRHat = deltaRHat1Loop + deltaRHat2LoopSMreal; + + return deltaRHat; +} + +/** + * Calculates the Standard Model vertex and box corrections + * \f$\delta_{\text{VB}}^{\text{SM}}\f$ as given in Eq. (C.12) from + * hep-ph/9606211 taking the tree-level value of the rhohat parameter + * into account. + * + * @param sinThetaW sin(theta_W) + * + * @return \f$\delta_{\text{VB}}^{\text{SM}}\f$ as defined in (C.12) + * from hep-ph/9606211 + */ +double Weinberg_angle::calculate_delta_vb_sm(double sinThetaW) const +{ + const double mz = parameters.mz_pole; + const double mw = parameters.mw_pole; + const double cw2 = Sqr(mw / mz); + const double sw2 = 1.0 - cw2; + const double sinThetaW2 = Sqr(sinThetaW); + const double outcos2 = 1.0 - sinThetaW2; + const double q = model->get_scale(); + + const auto gY = model->get_g1() * standard_model_info::normalization_g1; + const auto g2 = model->get_g2() * standard_model_info::normalization_g2; + const double eDRbar = gY * g2 / Sqrt(Sqr(gY) + Sqr(g2)); + const double alphaDRbar = Sqr(eDRbar) / (4.0 * Pi); + + const double deltaVbSM = alphaDRbar / (4.0 * Pi * sinThetaW2) * + (6.0 + log(cw2) / sw2 * + (3.5 - 2.5 * sw2 - sinThetaW2 * (5.0 - 1.5 * cw2 / outcos2)) + - 4. * Log(Sqr(mz/q))); + + return deltaVbSM; } } // namespace weinberg_angle diff --git a/model_specific/SM/weinberg_angle.hpp b/model_specific/SM/weinberg_angle.hpp index a25455fbed..d6dd5cc525 100644 --- a/model_specific/SM/weinberg_angle.hpp +++ b/model_specific/SM/weinberg_angle.hpp @@ -19,6 +19,9 @@ #ifndef WEINBERG_ANGLE_H #define WEINBERG_ANGLE_H +#include "standard_model.hpp" +#include "ew_input.hpp" + #include namespace flexiblesusy { @@ -32,88 +35,55 @@ namespace weinberg_angle { class Weinberg_angle { public: /** - * @class Data - * @brief Model parameters necessary for calculating weak mixing angle - * - * @attention The W and Z self-energies are assumed to be - * calculated using the top quark pole mass, instead of the top - * quark DR-bar mass. + * @class Parameters + * @brief Parameters necessary for calculating the weak mixing angle */ - struct Data { - Data(); - - double scale; ///< renormalization scale - double alpha_em_drbar; ///< alpha_em(MZ, DR-bar, SUSY) - double fermi_contant; ///< Fermi constant - double self_energy_z_at_mz; ///< self-energy Z at p = MZ, mt = mt_pole - double self_energy_w_at_0; ///< self-energy W at p = 0, mt = mt_pole - double self_energy_w_at_mw; ///< self-energy W at p = MW, mt = mt_pole - double mw_pole; ///< W pole mass - double mz_pole; ///< Z pole mass - double mt_pole; ///< top quark pole mass - double mh_drbar; ///< lightest CP-even Higgs DR-bar mass - double hmix_12; ///< CP-even Higgs mixing Cos(alpha) - double msel_drbar; ///< left-handed selectron DR-bar mass - double msmul_drbar; ///< left-handed smuon DR-bar mass - double msve_drbar; ///< electron-sneutrino DR-bar mass - double msvm_drbar; ///< muon-sneutrino DR-bar mass - Eigen::ArrayXd mn_drbar; ///< Neutralino DR-bar mass - Eigen::ArrayXd mc_drbar; ///< Chargino DR-bar mass - Eigen::MatrixXcd zn; ///< Neutralino mixing matrix - Eigen::MatrixXcd um; ///< Chargino mixing matrix - Eigen::MatrixXcd up; ///< Chargino mixing matrix - double gY; ///< U(1)_Y gauge coupling - double g2; ///< SU(2)_L gauge coupling - double g3; ///< SU(3)_c gauge coupling - double tan_beta; ///< tan(beta) = vu / vd - }; - - struct Self_energy_data { - Self_energy_data(); - double scale; ///< renormalization scale - double mt_pole; ///< top quark pole mass - double mt_drbar; ///< top quark DR-bar mass - double mb_drbar; ///< bottom quark DR-bar mass - double gY; ///< U(1)_Y gauge coupling - double g2; ///< SU(2)_L gauge coupling + struct Parameters { + double fermi_constant{0.}; ///< Fermi constant + double mw_pole{0.}; ///< W pole mass + double mz_pole{0.}; ///< Z pole mass + double mt_pole{0.}; ///< top quark pole mass + double mh_pole{Electroweak_constants::MH}; ///< Higgs pole mass + double alpha_s{0.}; ///< strong coupling at Q = mt_pole + double alpha_s_mz{0.}; ///< strong coupling at Q = mz_pole + double dalpha_s_5_had{Electroweak_constants::delta_alpha_s_5_had}; ///< 5-flavour hadronic contributions }; Weinberg_angle(); + Weinberg_angle(const standard_model::Standard_model*, const Parameters&); - void enable_susy_contributions(); ///< enable susy contributions - void disable_susy_contributions(); ///< disable susy contributions - - void set_data(const Data&); ///< set data necessary for the calculation void set_number_of_iterations(int); ///< maximum number of iterations void set_number_of_loops(int); ///< set number of loops void set_precision_goal(double); ///< set precision goal double get_rho_hat() const; ///< returns the rho parameter - double get_sin_theta() const; ///< returns sin(theta_w) - /// calculates the sinus of the Weinberg angle - int calculate(double rho_start = 1.0, double sin_start = 0.48); + /// calculates and returns the sine of the Weinberg angle + double calculate_sin_theta_w(double sinThetaW_start = 0.48); - static double replace_mtop_in_self_energy_z(double, double, const Self_energy_data&); - static double replace_mtop_in_self_energy_w(double, double, const Self_energy_data&); + /// calculates and returns the Fermi constant G_F + double calculate_G_fermi(); private: - int number_of_iterations; ///< maximum number of iterations - int number_of_loops; ///< number of loops - double precision_goal; ///< precision goal - double rho_hat; ///< output rho-hat parameter - double sin_theta; ///< output sin(theta) - Data data; - bool susy_contributions; ///< model type - - static double calculate_delta_r(double, double, const Data&, bool add_susy_contributions = true, int number_of_loops = 2); - static double calculate_delta_rho(double, double, const Data&, bool add_susy_contributions = true, int number_of_loops = 2); - static double calculate_delta_vb(double, double, const Data&, bool add_susy_contributions = true); - static double calculate_delta_vb_sm(double, double, const Data&); - static double calculate_delta_vb_susy(double, const Data&); - static double rho_2(double); + int number_of_iterations = 20; ///< maximum number of iterations + int number_of_loops = 2; ///< number of loops + double precision_goal = 1e-8; ///< precision goal + double rho_hat = 0.; ///< output rho-hat parameter + + const standard_model::Standard_model* model{nullptr}; ///< pointer to investigated model + Parameters parameters{}; ///< SM parameters + double calculate_self_energy_VZ(double p) const; + double calculate_self_energy_VZ_top(double p, double mt) const; + double calculate_self_energy_VWp(double p) const; + double calculate_self_energy_VWp_top(double p, double mt) const; + double calculate_delta_rho_hat(double sinThetaW) const; + double pizzt_MZ{0.}; ///< transverse Z self-energy at p^2 = MZ^2 + double piwwt_MW{0.}; ///< transverse W self-energy at p^2 = MW^2 + double piwwt_0{0.}; ///< transverse W self-energy at p^2 = 0 + double calculate_delta_r_hat(double rhohat_ratio, double sinThetaW) const; + double calculate_delta_vb(double rhohat_ratio, double sinThetaW) const; + double calculate_delta_vb_sm(double sinThetaW) const; - static double calculate_self_energy_z_top(double, double, const Self_energy_data&); - static double calculate_self_energy_w_top(double, double, const Self_energy_data&); + static double rho_2(double); }; } // namespace weinberg_angle diff --git a/nlohmann/json.hpp b/nlohmann/json.hpp new file mode 100644 index 0000000000..82d69f7c5d --- /dev/null +++ b/nlohmann/json.hpp @@ -0,0 +1,25526 @@ +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + +/****************************************************************************\ + * Note on documentation: The source files contain links to the online * + * documentation of the public API at https://json.nlohmann.me. This URL * + * contains the most recent documentation and should also be applicable to * + * previous versions; documentation for deprecated functions is not * + * removed, but marked deprecated. See "Generate documentation" section in * + * file docs/README.md. * +\****************************************************************************/ + +#ifndef INCLUDE_NLOHMANN_JSON_HPP_ +#define INCLUDE_NLOHMANN_JSON_HPP_ + +#include // all_of, find, for_each +#include // nullptr_t, ptrdiff_t, size_t +#include // hash, less +#include // initializer_list +#ifndef JSON_NO_IO + #include // istream, ostream +#endif // JSON_NO_IO +#include // random_access_iterator_tag +#include // unique_ptr +#include // string, stoi, to_string +#include // declval, forward, move, pair, swap +#include // vector + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// This file contains all macro definitions affecting or depending on the ABI + +#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK + #if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH) + #if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 12 || NLOHMANN_JSON_VERSION_PATCH != 0 + #warning "Already included a different version of the library!" + #endif + #endif +#endif + +#define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum) +#define NLOHMANN_JSON_VERSION_MINOR 12 // NOLINT(modernize-macro-to-enum) +#define NLOHMANN_JSON_VERSION_PATCH 0 // NOLINT(modernize-macro-to-enum) + +#ifndef JSON_DIAGNOSTICS + #define JSON_DIAGNOSTICS 0 +#endif + +#ifndef JSON_DIAGNOSTIC_POSITIONS + #define JSON_DIAGNOSTIC_POSITIONS 0 +#endif + +#ifndef JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON + #define JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 0 +#endif + +#if JSON_DIAGNOSTICS + #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS _diag +#else + #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS +#endif + +#if JSON_DIAGNOSTIC_POSITIONS + #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS _dp +#else + #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS +#endif + +#if JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON + #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON _ldvcmp +#else + #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON +#endif + +#ifndef NLOHMANN_JSON_NAMESPACE_NO_VERSION + #define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0 +#endif + +// Construct the namespace ABI tags component +#define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c) json_abi ## a ## b ## c +#define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b, c) \ + NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c) + +#define NLOHMANN_JSON_ABI_TAGS \ + NLOHMANN_JSON_ABI_TAGS_CONCAT( \ + NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \ + NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON, \ + NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS) + +// Construct the namespace version component +#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) \ + _v ## major ## _ ## minor ## _ ## patch +#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(major, minor, patch) \ + NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) + +#if NLOHMANN_JSON_NAMESPACE_NO_VERSION +#define NLOHMANN_JSON_NAMESPACE_VERSION +#else +#define NLOHMANN_JSON_NAMESPACE_VERSION \ + NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(NLOHMANN_JSON_VERSION_MAJOR, \ + NLOHMANN_JSON_VERSION_MINOR, \ + NLOHMANN_JSON_VERSION_PATCH) +#endif + +// Combine namespace components +#define NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) a ## b +#define NLOHMANN_JSON_NAMESPACE_CONCAT(a, b) \ + NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) + +#ifndef NLOHMANN_JSON_NAMESPACE +#define NLOHMANN_JSON_NAMESPACE \ + nlohmann::NLOHMANN_JSON_NAMESPACE_CONCAT( \ + NLOHMANN_JSON_ABI_TAGS, \ + NLOHMANN_JSON_NAMESPACE_VERSION) +#endif + +#ifndef NLOHMANN_JSON_NAMESPACE_BEGIN +#define NLOHMANN_JSON_NAMESPACE_BEGIN \ + namespace nlohmann \ + { \ + inline namespace NLOHMANN_JSON_NAMESPACE_CONCAT( \ + NLOHMANN_JSON_ABI_TAGS, \ + NLOHMANN_JSON_NAMESPACE_VERSION) \ + { +#endif + +#ifndef NLOHMANN_JSON_NAMESPACE_END +#define NLOHMANN_JSON_NAMESPACE_END \ + } /* namespace (inline namespace) NOLINT(readability/namespace) */ \ + } // namespace nlohmann +#endif + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // transform +#include // array +#include // forward_list +#include // inserter, front_inserter, end +#include // map +#ifdef JSON_HAS_CPP_17 + #include // optional +#endif +#include // string +#include // tuple, make_tuple +#include // is_arithmetic, is_same, is_enum, underlying_type, is_convertible +#include // unordered_map +#include // pair, declval +#include // valarray + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // nullptr_t +#include // exception +#if JSON_DIAGNOSTICS + #include // accumulate +#endif +#include // runtime_error +#include // to_string +#include // vector + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // array +#include // size_t +#include // uint8_t +#include // string + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // declval, pair +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +template struct make_void +{ + using type = void; +}; +template using void_t = typename make_void::type; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +// https://en.cppreference.com/w/cpp/experimental/is_detected +struct nonesuch +{ + nonesuch() = delete; + ~nonesuch() = delete; + nonesuch(nonesuch const&) = delete; + nonesuch(nonesuch const&&) = delete; + void operator=(nonesuch const&) = delete; + void operator=(nonesuch&&) = delete; +}; + +template class Op, + class... Args> +struct detector +{ + using value_t = std::false_type; + using type = Default; +}; + +template class Op, class... Args> +struct detector>, Op, Args...> +{ + using value_t = std::true_type; + using type = Op; +}; + +template class Op, class... Args> +using is_detected = typename detector::value_t; + +template class Op, class... Args> +struct is_detected_lazy : is_detected { }; + +template class Op, class... Args> +using detected_t = typename detector::type; + +template class Op, class... Args> +using detected_or = detector; + +template class Op, class... Args> +using detected_or_t = typename detected_or::type; + +template class Op, class... Args> +using is_detected_exact = std::is_same>; + +template class Op, class... Args> +using is_detected_convertible = + std::is_convertible, To>; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include + + +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-FileCopyrightText: 2016 - 2021 Evan Nemerson +// SPDX-License-Identifier: MIT + +/* Hedley - https://nemequ.github.io/hedley + * Created by Evan Nemerson + */ + +#if !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < 15) +#if defined(JSON_HEDLEY_VERSION) + #undef JSON_HEDLEY_VERSION +#endif +#define JSON_HEDLEY_VERSION 15 + +#if defined(JSON_HEDLEY_STRINGIFY_EX) + #undef JSON_HEDLEY_STRINGIFY_EX +#endif +#define JSON_HEDLEY_STRINGIFY_EX(x) #x + +#if defined(JSON_HEDLEY_STRINGIFY) + #undef JSON_HEDLEY_STRINGIFY +#endif +#define JSON_HEDLEY_STRINGIFY(x) JSON_HEDLEY_STRINGIFY_EX(x) + +#if defined(JSON_HEDLEY_CONCAT_EX) + #undef JSON_HEDLEY_CONCAT_EX +#endif +#define JSON_HEDLEY_CONCAT_EX(a,b) a##b + +#if defined(JSON_HEDLEY_CONCAT) + #undef JSON_HEDLEY_CONCAT +#endif +#define JSON_HEDLEY_CONCAT(a,b) JSON_HEDLEY_CONCAT_EX(a,b) + +#if defined(JSON_HEDLEY_CONCAT3_EX) + #undef JSON_HEDLEY_CONCAT3_EX +#endif +#define JSON_HEDLEY_CONCAT3_EX(a,b,c) a##b##c + +#if defined(JSON_HEDLEY_CONCAT3) + #undef JSON_HEDLEY_CONCAT3 +#endif +#define JSON_HEDLEY_CONCAT3(a,b,c) JSON_HEDLEY_CONCAT3_EX(a,b,c) + +#if defined(JSON_HEDLEY_VERSION_ENCODE) + #undef JSON_HEDLEY_VERSION_ENCODE +#endif +#define JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MAJOR) + #undef JSON_HEDLEY_VERSION_DECODE_MAJOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MINOR) + #undef JSON_HEDLEY_VERSION_DECODE_MINOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_REVISION) + #undef JSON_HEDLEY_VERSION_DECODE_REVISION +#endif +#define JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) + +#if defined(JSON_HEDLEY_GNUC_VERSION) + #undef JSON_HEDLEY_GNUC_VERSION +#endif +#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) +#elif defined(__GNUC__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) +#endif + +#if defined(JSON_HEDLEY_GNUC_VERSION_CHECK) + #undef JSON_HEDLEY_GNUC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GNUC_VERSION) + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GNUC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION) + #undef JSON_HEDLEY_MSVC_VERSION +#endif +#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) +#elif defined(_MSC_FULL_VER) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) +#elif defined(_MSC_VER) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION_CHECK) + #undef JSON_HEDLEY_MSVC_VERSION_CHECK +#endif +#if !defined(JSON_HEDLEY_MSVC_VERSION) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) +#elif defined(_MSC_VER) && (_MSC_VER >= 1400) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) +#elif defined(_MSC_VER) && (_MSC_VER >= 1200) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) +#else + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION) + #undef JSON_HEDLEY_INTEL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && !defined(__ICL) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) +#elif defined(__INTEL_COMPILER) && !defined(__ICL) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_INTEL_VERSION) + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_INTEL_CL_VERSION) + #undef JSON_HEDLEY_INTEL_CL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && defined(__ICL) + #define JSON_HEDLEY_INTEL_CL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER, __INTEL_COMPILER_UPDATE, 0) +#endif + +#if defined(JSON_HEDLEY_INTEL_CL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_CL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_INTEL_CL_VERSION) + #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_CL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION) + #undef JSON_HEDLEY_PGI_VERSION +#endif +#if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) + #define JSON_HEDLEY_PGI_VERSION JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION_CHECK) + #undef JSON_HEDLEY_PGI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PGI_VERSION) + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PGI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #undef JSON_HEDLEY_SUNPRO_VERSION +#endif +#if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) +#elif defined(__SUNPRO_C) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) +#elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) +#elif defined(__SUNPRO_CC) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION_CHECK) + #undef JSON_HEDLEY_SUNPRO_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_SUNPRO_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION +#endif +#if defined(__EMSCRIPTEN__) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_EMSCRIPTEN_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION) + #undef JSON_HEDLEY_ARM_VERSION +#endif +#if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) +#elif defined(__CC_ARM) && defined(__ARMCC_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION_CHECK) + #undef JSON_HEDLEY_ARM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_ARM_VERSION) + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_ARM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION) + #undef JSON_HEDLEY_IBM_VERSION +#endif +#if defined(__ibmxl__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) +#elif defined(__xlC__) && defined(__xlC_ver__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) +#elif defined(__xlC__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION_CHECK) + #undef JSON_HEDLEY_IBM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IBM_VERSION) + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IBM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_VERSION) + #undef JSON_HEDLEY_TI_VERSION +#endif +#if \ + defined(__TI_COMPILER_VERSION__) && \ + ( \ + defined(__TMS470__) || defined(__TI_ARM__) || \ + defined(__MSP430__) || \ + defined(__TMS320C2000__) \ + ) +#if (__TI_COMPILER_VERSION__ >= 16000000) + #define JSON_HEDLEY_TI_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif +#endif + +#if defined(JSON_HEDLEY_TI_VERSION_CHECK) + #undef JSON_HEDLEY_TI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_VERSION) + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #undef JSON_HEDLEY_TI_CL2000_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C2000__) + #define JSON_HEDLEY_TI_CL2000_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL2000_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #undef JSON_HEDLEY_TI_CL430_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__MSP430__) + #define JSON_HEDLEY_TI_CL430_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL430_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL430_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #undef JSON_HEDLEY_TI_ARMCL_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && (defined(__TMS470__) || defined(__TI_ARM__)) + #define JSON_HEDLEY_TI_ARMCL_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION_CHECK) + #undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_ARMCL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #undef JSON_HEDLEY_TI_CL6X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C6X__) + #define JSON_HEDLEY_TI_CL6X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL6X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #undef JSON_HEDLEY_TI_CL7X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__C7000__) + #define JSON_HEDLEY_TI_CL7X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL7X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #undef JSON_HEDLEY_TI_CLPRU_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__PRU__) + #define JSON_HEDLEY_TI_CLPRU_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CLPRU_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION) + #undef JSON_HEDLEY_CRAY_VERSION +#endif +#if defined(_CRAYC) + #if defined(_RELEASE_PATCHLEVEL) + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) + #else + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION_CHECK) + #undef JSON_HEDLEY_CRAY_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_CRAY_VERSION) + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_CRAY_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION) + #undef JSON_HEDLEY_IAR_VERSION +#endif +#if defined(__IAR_SYSTEMS_ICC__) + #if __VER__ > 1000 + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) + #else + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE(__VER__ / 100, __VER__ % 100, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION_CHECK) + #undef JSON_HEDLEY_IAR_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IAR_VERSION) + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IAR_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION) + #undef JSON_HEDLEY_TINYC_VERSION +#endif +#if defined(__TINYC__) + #define JSON_HEDLEY_TINYC_VERSION JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION_CHECK) + #undef JSON_HEDLEY_TINYC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TINYC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION) + #undef JSON_HEDLEY_DMC_VERSION +#endif +#if defined(__DMC__) + #define JSON_HEDLEY_DMC_VERSION JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION_CHECK) + #undef JSON_HEDLEY_DMC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_DMC_VERSION) + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_DMC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #undef JSON_HEDLEY_COMPCERT_VERSION +#endif +#if defined(__COMPCERT_VERSION__) + #define JSON_HEDLEY_COMPCERT_VERSION JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION_CHECK) + #undef JSON_HEDLEY_COMPCERT_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_COMPCERT_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION) + #undef JSON_HEDLEY_PELLES_VERSION +#endif +#if defined(__POCC__) + #define JSON_HEDLEY_PELLES_VERSION JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION_CHECK) + #undef JSON_HEDLEY_PELLES_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PELLES_VERSION) + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PELLES_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_MCST_LCC_VERSION) + #undef JSON_HEDLEY_MCST_LCC_VERSION +#endif +#if defined(__LCC__) && defined(__LCC_MINOR__) + #define JSON_HEDLEY_MCST_LCC_VERSION JSON_HEDLEY_VERSION_ENCODE(__LCC__ / 100, __LCC__ % 100, __LCC_MINOR__) +#endif + +#if defined(JSON_HEDLEY_MCST_LCC_VERSION_CHECK) + #undef JSON_HEDLEY_MCST_LCC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_MCST_LCC_VERSION) + #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_MCST_LCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION) + #undef JSON_HEDLEY_GCC_VERSION +#endif +#if \ + defined(JSON_HEDLEY_GNUC_VERSION) && \ + !defined(__clang__) && \ + !defined(JSON_HEDLEY_INTEL_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_ARM_VERSION) && \ + !defined(JSON_HEDLEY_CRAY_VERSION) && \ + !defined(JSON_HEDLEY_TI_VERSION) && \ + !defined(JSON_HEDLEY_TI_ARMCL_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL430_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL2000_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL6X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL7X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CLPRU_VERSION) && \ + !defined(__COMPCERT__) && \ + !defined(JSON_HEDLEY_MCST_LCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION JSON_HEDLEY_GNUC_VERSION +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_ATTRIBUTE +#endif +#if \ + defined(__has_attribute) && \ + ( \ + (!defined(JSON_HEDLEY_IAR_VERSION) || JSON_HEDLEY_IAR_VERSION_CHECK(8,5,9)) \ + ) +# define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) +#else +# define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#endif +#if \ + defined(__has_cpp_attribute) && \ + defined(__cplusplus) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS +#endif +#if !defined(__cplusplus) || !defined(__has_cpp_attribute) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#elif \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ + (!defined(JSON_HEDLEY_MSVC_VERSION) || JSON_HEDLEY_MSVC_VERSION_CHECK(19,20,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(ns::attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_BUILTIN) + #undef JSON_HEDLEY_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) +#else + #define JSON_HEDLEY_HAS_BUILTIN(builtin) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_BUILTIN) + #undef JSON_HEDLEY_GNUC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_BUILTIN) + #undef JSON_HEDLEY_GCC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_FEATURE) + #undef JSON_HEDLEY_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature) +#else + #define JSON_HEDLEY_HAS_FEATURE(feature) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_FEATURE) + #undef JSON_HEDLEY_GNUC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_FEATURE) + #undef JSON_HEDLEY_GCC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_EXTENSION) + #undef JSON_HEDLEY_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) +#else + #define JSON_HEDLEY_HAS_EXTENSION(extension) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_EXTENSION) + #undef JSON_HEDLEY_GNUC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_EXTENSION) + #undef JSON_HEDLEY_GCC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_WARNING) + #undef JSON_HEDLEY_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning) +#else + #define JSON_HEDLEY_HAS_WARNING(warning) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_WARNING) + #undef JSON_HEDLEY_GNUC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_WARNING) + #undef JSON_HEDLEY_GCC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + defined(__clang__) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) + #define JSON_HEDLEY_PRAGMA(value) _Pragma(#value) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_PRAGMA(value) __pragma(value) +#else + #define JSON_HEDLEY_PRAGMA(value) +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_PUSH) + #undef JSON_HEDLEY_DIAGNOSTIC_PUSH +#endif +#if defined(JSON_HEDLEY_DIAGNOSTIC_POP) + #undef JSON_HEDLEY_DIAGNOSTIC_POP +#endif +#if defined(__clang__) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) + #define JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) +#elif JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_PUSH + #define JSON_HEDLEY_DIAGNOSTIC_POP +#endif + +/* JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat") +# if JSON_HEDLEY_HAS_WARNING("-Wc++17-extensions") +# if JSON_HEDLEY_HAS_WARNING("-Wc++1z-extensions") +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ + _Pragma("clang diagnostic ignored \"-Wc++1z-extensions\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# endif +# else +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# endif +# endif +#endif +#if !defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(x) x +#endif + +#if defined(JSON_HEDLEY_CONST_CAST) + #undef JSON_HEDLEY_CONST_CAST +#endif +#if defined(__cplusplus) +# define JSON_HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) +#elif \ + JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_REINTERPRET_CAST) + #undef JSON_HEDLEY_REINTERPRET_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) +#else + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_STATIC_CAST) + #undef JSON_HEDLEY_STATIC_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) +#else + #define JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_CPP_CAST) + #undef JSON_HEDLEY_CPP_CAST +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wold-style-cast") +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wold-style-cast\"") \ + ((T) (expr)) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# elif JSON_HEDLEY_IAR_VERSION_CHECK(8,3,0) +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("diag_suppress=Pe137") \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_CPP_CAST(T, expr) ((T) (expr)) +# endif +#else +# define JSON_HEDLEY_CPP_CAST(T, expr) (expr) +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:1478 1786)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1216,1444,1445") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:161)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(16,9,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 161") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-attributes") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("clang diagnostic ignored \"-Wunknown-attributes\"") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("warning(disable:1292)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:1292)) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:5030)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097,1098") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("error_messages(off,attrskipunsup)") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1173") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress=Pe1097") +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wcast-qual") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunused-function") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("clang diagnostic ignored \"-Wunused-function\"") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("GCC diagnostic ignored \"-Wunused-function\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(1,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION __pragma(warning(disable:4505)) +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("diag_suppress 3142") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION +#endif + +#if defined(JSON_HEDLEY_DEPRECATED) + #undef JSON_HEDLEY_DEPRECATED +#endif +#if defined(JSON_HEDLEY_DEPRECATED_FOR) + #undef JSON_HEDLEY_DEPRECATED_FOR +#endif +#if \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) +#elif \ + (JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) && !defined(JSON_HEDLEY_IAR_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) +#elif defined(__cplusplus) && (__cplusplus >= 201402L) + #define JSON_HEDLEY_DEPRECATED(since) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since)]]) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since "; use " #replacement)]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated") + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") +#else + #define JSON_HEDLEY_DEPRECATED(since) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) +#endif + +#if defined(JSON_HEDLEY_UNAVAILABLE) + #undef JSON_HEDLEY_UNAVAILABLE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) +#else + #define JSON_HEDLEY_UNAVAILABLE(available_since) +#endif + +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT +#endif +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT_MSG) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) __attribute__((__warn_unused_result__)) +#elif (JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) >= 201907L) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard(msg)]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) +#elif defined(_Check_return_) /* SAL */ + #define JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_ + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) _Check_return_ +#else + #define JSON_HEDLEY_WARN_UNUSED_RESULT + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) +#endif + +#if defined(JSON_HEDLEY_SENTINEL) + #undef JSON_HEDLEY_SENTINEL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) +#else + #define JSON_HEDLEY_SENTINEL(position) +#endif + +#if defined(JSON_HEDLEY_NO_RETURN) + #undef JSON_HEDLEY_NO_RETURN +#endif +#if JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NO_RETURN __noreturn +#elif \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L + #define JSON_HEDLEY_NO_RETURN _Noreturn +#elif defined(__cplusplus) && (__cplusplus >= 201103L) + #define JSON_HEDLEY_NO_RETURN JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[noreturn]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_NO_RETURN _Pragma("does_not_return") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NO_RETURN __attribute((noreturn)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#else + #define JSON_HEDLEY_NO_RETURN +#endif + +#if defined(JSON_HEDLEY_NO_ESCAPE) + #undef JSON_HEDLEY_NO_ESCAPE +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(noescape) + #define JSON_HEDLEY_NO_ESCAPE __attribute__((__noescape__)) +#else + #define JSON_HEDLEY_NO_ESCAPE +#endif + +#if defined(JSON_HEDLEY_UNREACHABLE) + #undef JSON_HEDLEY_UNREACHABLE +#endif +#if defined(JSON_HEDLEY_UNREACHABLE_RETURN) + #undef JSON_HEDLEY_UNREACHABLE_RETURN +#endif +#if defined(JSON_HEDLEY_ASSUME) + #undef JSON_HEDLEY_ASSUME +#endif +#if \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_ASSUME(expr) __assume(expr) +#elif JSON_HEDLEY_HAS_BUILTIN(__builtin_assume) + #define JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr) +#elif \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #if defined(__cplusplus) + #define JSON_HEDLEY_ASSUME(expr) std::_nassert(expr) + #else + #define JSON_HEDLEY_ASSUME(expr) _nassert(expr) + #endif +#endif +#if \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(JSON_HEDLEY_ARM_VERSION))) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(10,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_UNREACHABLE() __builtin_unreachable() +#elif defined(JSON_HEDLEY_ASSUME) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif +#if !defined(JSON_HEDLEY_ASSUME) + #if defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, ((expr) ? 1 : (JSON_HEDLEY_UNREACHABLE(), 1))) + #else + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, expr) + #endif +#endif +#if defined(JSON_HEDLEY_UNREACHABLE) + #if \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (JSON_HEDLEY_STATIC_CAST(void, JSON_HEDLEY_ASSUME(0)), (value)) + #else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) JSON_HEDLEY_UNREACHABLE() + #endif +#else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (value) +#endif +#if !defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif + +JSON_HEDLEY_DIAGNOSTIC_PUSH +#if JSON_HEDLEY_HAS_WARNING("-Wpedantic") + #pragma clang diagnostic ignored "-Wpedantic" +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") && defined(__cplusplus) + #pragma clang diagnostic ignored "-Wc++98-compat-pedantic" +#endif +#if JSON_HEDLEY_GCC_HAS_WARNING("-Wvariadic-macros",4,0,0) + #if defined(__clang__) + #pragma clang diagnostic ignored "-Wvariadic-macros" + #elif defined(JSON_HEDLEY_GCC_VERSION) + #pragma GCC diagnostic ignored "-Wvariadic-macros" + #endif +#endif +#if defined(JSON_HEDLEY_NON_NULL) + #undef JSON_HEDLEY_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) +#else + #define JSON_HEDLEY_NON_NULL(...) +#endif +JSON_HEDLEY_DIAGNOSTIC_POP + +#if defined(JSON_HEDLEY_PRINTF_FORMAT) + #undef JSON_HEDLEY_PRINTF_FORMAT +#endif +#if defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) +#elif defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(format) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) +#else + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) +#endif + +#if defined(JSON_HEDLEY_CONSTEXPR) + #undef JSON_HEDLEY_CONSTEXPR +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_CONSTEXPR JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(constexpr) + #endif +#endif +#if !defined(JSON_HEDLEY_CONSTEXPR) + #define JSON_HEDLEY_CONSTEXPR +#endif + +#if defined(JSON_HEDLEY_PREDICT) + #undef JSON_HEDLEY_PREDICT +#endif +#if defined(JSON_HEDLEY_LIKELY) + #undef JSON_HEDLEY_LIKELY +#endif +#if defined(JSON_HEDLEY_UNLIKELY) + #undef JSON_HEDLEY_UNLIKELY +#endif +#if defined(JSON_HEDLEY_UNPREDICTABLE) + #undef JSON_HEDLEY_UNPREDICTABLE +#endif +#if JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable) + #define JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable((expr)) +#endif +#if \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) && !defined(JSON_HEDLEY_PGI_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability( (expr), (value), (probability)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1 , (probability)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0 , (probability)) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect (!!(expr), 1 ) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect (!!(expr), 0 ) +#elif \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PREDICT(expr, expected, probability) \ + (((probability) >= 0.9) ? __builtin_expect((expr), (expected)) : (JSON_HEDLEY_STATIC_CAST(void, expected), (expr))) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ + })) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ + })) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#else +# define JSON_HEDLEY_PREDICT(expr, expected, probability) (JSON_HEDLEY_STATIC_CAST(void, expected), (expr)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_LIKELY(expr) (!!(expr)) +# define JSON_HEDLEY_UNLIKELY(expr) (!!(expr)) +#endif +#if !defined(JSON_HEDLEY_UNPREDICTABLE) + #define JSON_HEDLEY_UNPREDICTABLE(expr) JSON_HEDLEY_PREDICT(expr, 1, 0.5) +#endif + +#if defined(JSON_HEDLEY_MALLOC) + #undef JSON_HEDLEY_MALLOC +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_MALLOC __attribute__((__malloc__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_MALLOC _Pragma("returns_new_memory") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_MALLOC __declspec(restrict) +#else + #define JSON_HEDLEY_MALLOC +#endif + +#if defined(JSON_HEDLEY_PURE) + #undef JSON_HEDLEY_PURE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PURE __attribute__((__pure__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) +# define JSON_HEDLEY_PURE _Pragma("does_not_write_global_data") +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) \ + ) +# define JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;") +#else +# define JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_CONST) + #undef JSON_HEDLEY_CONST +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(const) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_CONST __attribute__((__const__)) +#elif \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_CONST _Pragma("no_side_effect") +#else + #define JSON_HEDLEY_CONST JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_RESTRICT) + #undef JSON_HEDLEY_RESTRICT +#endif +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT restrict +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,4) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + defined(__clang__) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_RESTRICT __restrict +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT _Restrict +#else + #define JSON_HEDLEY_RESTRICT +#endif + +#if defined(JSON_HEDLEY_INLINE) + #undef JSON_HEDLEY_INLINE +#endif +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + (defined(__cplusplus) && (__cplusplus >= 199711L)) + #define JSON_HEDLEY_INLINE inline +#elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0) + #define JSON_HEDLEY_INLINE __inline__ +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,1,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_INLINE __inline +#else + #define JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_ALWAYS_INLINE) + #undef JSON_HEDLEY_ALWAYS_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) +# define JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) JSON_HEDLEY_INLINE +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_ALWAYS_INLINE __forceinline +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) \ + ) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") +#else +# define JSON_HEDLEY_ALWAYS_INLINE JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_NEVER_INLINE) + #undef JSON_HEDLEY_NEVER_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("noinline") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute((noinline)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#else + #define JSON_HEDLEY_NEVER_INLINE +#endif + +#if defined(JSON_HEDLEY_PRIVATE) + #undef JSON_HEDLEY_PRIVATE +#endif +#if defined(JSON_HEDLEY_PUBLIC) + #undef JSON_HEDLEY_PUBLIC +#endif +#if defined(JSON_HEDLEY_IMPORT) + #undef JSON_HEDLEY_IMPORT +#endif +#if defined(_WIN32) || defined(__CYGWIN__) +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC __declspec(dllexport) +# define JSON_HEDLEY_IMPORT __declspec(dllimport) +#else +# if \ + JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + ( \ + defined(__TI_EABI__) && \ + ( \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) \ + ) \ + ) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) +# define JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default"))) +# else +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC +# endif +# define JSON_HEDLEY_IMPORT extern +#endif + +#if defined(JSON_HEDLEY_NO_THROW) + #undef JSON_HEDLEY_NO_THROW +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_NO_THROW __attribute__((__nothrow__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NO_THROW __declspec(nothrow) +#else + #define JSON_HEDLEY_NO_THROW +#endif + +#if defined(JSON_HEDLEY_FALL_THROUGH) + #undef JSON_HEDLEY_FALL_THROUGH +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(fallthrough) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(clang,fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[clang::fallthrough]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[fallthrough]]) +#elif defined(__fallthrough) /* SAL */ + #define JSON_HEDLEY_FALL_THROUGH __fallthrough +#else + #define JSON_HEDLEY_FALL_THROUGH +#endif + +#if defined(JSON_HEDLEY_RETURNS_NON_NULL) + #undef JSON_HEDLEY_RETURNS_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) +#elif defined(_Ret_notnull_) /* SAL */ + #define JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_ +#else + #define JSON_HEDLEY_RETURNS_NON_NULL +#endif + +#if defined(JSON_HEDLEY_ARRAY_PARAM) + #undef JSON_HEDLEY_ARRAY_PARAM +#endif +#if \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ + !defined(__STDC_NO_VLA__) && \ + !defined(__cplusplus) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_ARRAY_PARAM(name) (name) +#else + #define JSON_HEDLEY_ARRAY_PARAM(name) +#endif + +#if defined(JSON_HEDLEY_IS_CONSTANT) + #undef JSON_HEDLEY_IS_CONSTANT +#endif +#if defined(JSON_HEDLEY_REQUIRE_CONSTEXPR) + #undef JSON_HEDLEY_REQUIRE_CONSTEXPR +#endif +/* JSON_HEDLEY_IS_CONSTEXPR_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #undef JSON_HEDLEY_IS_CONSTEXPR_ +#endif +#if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) && !defined(__cplusplus)) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) +#endif +#if !defined(__cplusplus) +# if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) +#else + #include + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) +#endif +# elif \ + ( \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && \ + !defined(JSON_HEDLEY_SUNPRO_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION)) || \ + (JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) && !defined(JSON_HEDLEY_IAR_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) +#else + #include + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) +#endif +# elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + defined(JSON_HEDLEY_INTEL_VERSION) || \ + defined(JSON_HEDLEY_TINYC_VERSION) || \ + defined(JSON_HEDLEY_TI_ARMCL_VERSION) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(18,12,0) || \ + defined(JSON_HEDLEY_TI_CL2000_VERSION) || \ + defined(JSON_HEDLEY_TI_CL6X_VERSION) || \ + defined(JSON_HEDLEY_TI_CL7X_VERSION) || \ + defined(JSON_HEDLEY_TI_CLPRU_VERSION) || \ + defined(__clang__) +# define JSON_HEDLEY_IS_CONSTEXPR_(expr) ( \ + sizeof(void) != \ + sizeof(*( \ + 1 ? \ + ((void*) ((expr) * 0L) ) : \ +((struct { char v[sizeof(void) * 2]; } *) 1) \ + ) \ + ) \ + ) +# endif +#endif +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) JSON_HEDLEY_IS_CONSTEXPR_(expr) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (JSON_HEDLEY_IS_CONSTEXPR_(expr) ? (expr) : (-1)) +#else + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) (0) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) +#endif + +#if defined(JSON_HEDLEY_BEGIN_C_DECLS) + #undef JSON_HEDLEY_BEGIN_C_DECLS +#endif +#if defined(JSON_HEDLEY_END_C_DECLS) + #undef JSON_HEDLEY_END_C_DECLS +#endif +#if defined(JSON_HEDLEY_C_DECL) + #undef JSON_HEDLEY_C_DECL +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_BEGIN_C_DECLS extern "C" { + #define JSON_HEDLEY_END_C_DECLS } + #define JSON_HEDLEY_C_DECL extern "C" +#else + #define JSON_HEDLEY_BEGIN_C_DECLS + #define JSON_HEDLEY_END_C_DECLS + #define JSON_HEDLEY_C_DECL +#endif + +#if defined(JSON_HEDLEY_STATIC_ASSERT) + #undef JSON_HEDLEY_STATIC_ASSERT +#endif +#if \ + !defined(__cplusplus) && ( \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \ + (JSON_HEDLEY_HAS_FEATURE(c_static_assert) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + defined(_Static_assert) \ + ) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) +#elif \ + (defined(__cplusplus) && (__cplusplus >= 201103L)) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(static_assert(expr, message)) +#else +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) +#endif + +#if defined(JSON_HEDLEY_NULL) + #undef JSON_HEDLEY_NULL +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_NULL JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr) + #elif defined(NULL) + #define JSON_HEDLEY_NULL NULL + #else + #define JSON_HEDLEY_NULL JSON_HEDLEY_STATIC_CAST(void*, 0) + #endif +#elif defined(NULL) + #define JSON_HEDLEY_NULL NULL +#else + #define JSON_HEDLEY_NULL ((void*) 0) +#endif + +#if defined(JSON_HEDLEY_MESSAGE) + #undef JSON_HEDLEY_MESSAGE +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_MESSAGE(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(message msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message msg) +#elif JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(_CRI message msg) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_WARNING) + #undef JSON_HEDLEY_WARNING +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_WARNING(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(clang warning msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(GCC warning msg) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_REQUIRE) + #undef JSON_HEDLEY_REQUIRE +#endif +#if defined(JSON_HEDLEY_REQUIRE_MSG) + #undef JSON_HEDLEY_REQUIRE_MSG +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if) +# if JSON_HEDLEY_HAS_WARNING("-Wgcc-compat") +# define JSON_HEDLEY_REQUIRE(expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), #expr, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), msg, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_REQUIRE(expr) __attribute__((diagnose_if(!(expr), #expr, "error"))) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) __attribute__((diagnose_if(!(expr), msg, "error"))) +# endif +#else +# define JSON_HEDLEY_REQUIRE(expr) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) +#endif + +#if defined(JSON_HEDLEY_FLAGS) + #undef JSON_HEDLEY_FLAGS +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) && (!defined(__cplusplus) || JSON_HEDLEY_HAS_WARNING("-Wbitfield-enum-conversion")) + #define JSON_HEDLEY_FLAGS __attribute__((__flag_enum__)) +#else + #define JSON_HEDLEY_FLAGS +#endif + +#if defined(JSON_HEDLEY_FLAGS_CAST) + #undef JSON_HEDLEY_FLAGS_CAST +#endif +#if JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0) +# define JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("warning(disable:188)") \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_FLAGS_CAST(T, expr) JSON_HEDLEY_STATIC_CAST(T, expr) +#endif + +#if defined(JSON_HEDLEY_EMPTY_BASES) + #undef JSON_HEDLEY_EMPTY_BASES +#endif +#if \ + (JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,23918) && !JSON_HEDLEY_MSVC_VERSION_CHECK(20,0,0)) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_EMPTY_BASES __declspec(empty_bases) +#else + #define JSON_HEDLEY_EMPTY_BASES +#endif + +/* Remaining macros are deprecated. */ + +#if defined(JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#endif +#if defined(__clang__) + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) +#else + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_CLANG_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_BUILTIN) + #undef JSON_HEDLEY_CLANG_HAS_BUILTIN +#endif +#define JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) JSON_HEDLEY_HAS_BUILTIN(builtin) + +#if defined(JSON_HEDLEY_CLANG_HAS_FEATURE) + #undef JSON_HEDLEY_CLANG_HAS_FEATURE +#endif +#define JSON_HEDLEY_CLANG_HAS_FEATURE(feature) JSON_HEDLEY_HAS_FEATURE(feature) + +#if defined(JSON_HEDLEY_CLANG_HAS_EXTENSION) + #undef JSON_HEDLEY_CLANG_HAS_EXTENSION +#endif +#define JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) JSON_HEDLEY_HAS_EXTENSION(extension) + +#if defined(JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_WARNING) + #undef JSON_HEDLEY_CLANG_HAS_WARNING +#endif +#define JSON_HEDLEY_CLANG_HAS_WARNING(warning) JSON_HEDLEY_HAS_WARNING(warning) + +#endif /* !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < X) */ + + +// This file contains all internal macro definitions (except those affecting ABI) +// You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them + +// #include + + +// exclude unsupported compilers +#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK) + #if defined(__clang__) + #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400 + #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) + #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 + #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #endif +#endif + +// C++ language standard detection +// if the user manually specified the used c++ version this is skipped +#if !defined(JSON_HAS_CPP_23) && !defined(JSON_HAS_CPP_20) && !defined(JSON_HAS_CPP_17) && !defined(JSON_HAS_CPP_14) && !defined(JSON_HAS_CPP_11) + #if (defined(__cplusplus) && __cplusplus > 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG > 202002L) + #define JSON_HAS_CPP_23 + #define JSON_HAS_CPP_20 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 + #elif (defined(__cplusplus) && __cplusplus > 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG > 201703L) + #define JSON_HAS_CPP_20 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 + #elif (defined(__cplusplus) && __cplusplus > 201402L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 + #elif (defined(__cplusplus) && __cplusplus > 201103L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1) + #define JSON_HAS_CPP_14 + #endif + // the cpp 11 flag is always specified because it is the minimal required version + #define JSON_HAS_CPP_11 +#endif + +#ifdef __has_include + #if __has_include() + #include + #endif +#endif + +#if !defined(JSON_HAS_FILESYSTEM) && !defined(JSON_HAS_EXPERIMENTAL_FILESYSTEM) + #ifdef JSON_HAS_CPP_17 + #if defined(__cpp_lib_filesystem) + #define JSON_HAS_FILESYSTEM 1 + #elif defined(__cpp_lib_experimental_filesystem) + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #elif !defined(__has_include) + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #elif __has_include() + #define JSON_HAS_FILESYSTEM 1 + #elif __has_include() + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #endif + + // std::filesystem does not work on MinGW GCC 8: https://sourceforge.net/p/mingw-w64/bugs/737/ + #if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ == 8 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before GCC 8: https://en.cppreference.com/w/cpp/compiler_support + #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 8 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before Clang 7: https://en.cppreference.com/w/cpp/compiler_support + #if defined(__clang_major__) && __clang_major__ < 7 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before MSVC 19.14: https://en.cppreference.com/w/cpp/compiler_support + #if defined(_MSC_VER) && _MSC_VER < 1914 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before iOS 13 + #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 130000 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before macOS Catalina + #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + #endif +#endif + +#ifndef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 0 +#endif + +#ifndef JSON_HAS_FILESYSTEM + #define JSON_HAS_FILESYSTEM 0 +#endif + +#ifndef JSON_HAS_THREE_WAY_COMPARISON + #if defined(__cpp_impl_three_way_comparison) && __cpp_impl_three_way_comparison >= 201907L \ + && defined(__cpp_lib_three_way_comparison) && __cpp_lib_three_way_comparison >= 201907L + #define JSON_HAS_THREE_WAY_COMPARISON 1 + #else + #define JSON_HAS_THREE_WAY_COMPARISON 0 + #endif +#endif + +#ifndef JSON_HAS_RANGES + // ranges header shipping in GCC 11.1.0 (released 2021-04-27) has syntax error + #if defined(__GLIBCXX__) && __GLIBCXX__ == 20210427 + #define JSON_HAS_RANGES 0 + #elif defined(__cpp_lib_ranges) + #define JSON_HAS_RANGES 1 + #else + #define JSON_HAS_RANGES 0 + #endif +#endif + +#ifndef JSON_HAS_STATIC_RTTI + #if !defined(_HAS_STATIC_RTTI) || _HAS_STATIC_RTTI != 0 + #define JSON_HAS_STATIC_RTTI 1 + #else + #define JSON_HAS_STATIC_RTTI 0 + #endif +#endif + +#ifdef JSON_HAS_CPP_17 + #define JSON_INLINE_VARIABLE inline +#else + #define JSON_INLINE_VARIABLE +#endif + +#if JSON_HEDLEY_HAS_ATTRIBUTE(no_unique_address) + #define JSON_NO_UNIQUE_ADDRESS [[no_unique_address]] +#else + #define JSON_NO_UNIQUE_ADDRESS +#endif + +// disable documentation warnings on clang +#if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdocumentation" + #pragma clang diagnostic ignored "-Wdocumentation-unknown-command" +#endif + +// allow disabling exceptions +#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION) + #define JSON_THROW(exception) throw exception + #define JSON_TRY try + #define JSON_CATCH(exception) catch(exception) + #define JSON_INTERNAL_CATCH(exception) catch(exception) +#else + #include + #define JSON_THROW(exception) std::abort() + #define JSON_TRY if(true) + #define JSON_CATCH(exception) if(false) + #define JSON_INTERNAL_CATCH(exception) if(false) +#endif + +// override exception macros +#if defined(JSON_THROW_USER) + #undef JSON_THROW + #define JSON_THROW JSON_THROW_USER +#endif +#if defined(JSON_TRY_USER) + #undef JSON_TRY + #define JSON_TRY JSON_TRY_USER +#endif +#if defined(JSON_CATCH_USER) + #undef JSON_CATCH + #define JSON_CATCH JSON_CATCH_USER + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_CATCH_USER +#endif +#if defined(JSON_INTERNAL_CATCH_USER) + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER +#endif + +// allow overriding assert +#if !defined(JSON_ASSERT) + #include // assert + #define JSON_ASSERT(x) assert(x) +#endif + +// allow to access some private functions (needed by the test suite) +#if defined(JSON_TESTS_PRIVATE) + #define JSON_PRIVATE_UNLESS_TESTED public +#else + #define JSON_PRIVATE_UNLESS_TESTED private +#endif + +/*! +@brief macro to briefly define a mapping between an enum and JSON +@def NLOHMANN_JSON_SERIALIZE_ENUM +@since version 3.4.0 +*/ +#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \ + template \ + inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \ + { \ + /* NOLINTNEXTLINE(modernize-type-traits) we use C++11 */ \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + /* NOLINTNEXTLINE(modernize-avoid-c-arrays) we don't want to depend on */ \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [e](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.first == e; \ + }); \ + j = ((it != std::end(m)) ? it : std::begin(m))->second; \ + } \ + template \ + inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \ + { \ + /* NOLINTNEXTLINE(modernize-type-traits) we use C++11 */ \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + /* NOLINTNEXTLINE(modernize-avoid-c-arrays) we don't want to depend on */ \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [&j](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.second == j; \ + }); \ + e = ((it != std::end(m)) ? it : std::begin(m))->first; \ + } + +// Ugly macros to avoid uglier copy-paste when specializing basic_json. They +// may be removed in the future once the class is split. + +#define NLOHMANN_BASIC_JSON_TPL_DECLARATION \ + template class ObjectType, \ + template class ArrayType, \ + class StringType, class BooleanType, class NumberIntegerType, \ + class NumberUnsignedType, class NumberFloatType, \ + template class AllocatorType, \ + template class JSONSerializer, \ + class BinaryType, \ + class CustomBaseClass> + +#define NLOHMANN_BASIC_JSON_TPL \ + basic_json + +// Macros to simplify conversion from/to types + +#define NLOHMANN_JSON_EXPAND( x ) x +#define NLOHMANN_JSON_GET_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, NAME,...) NAME +#define NLOHMANN_JSON_PASTE(...) NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_GET_MACRO(__VA_ARGS__, \ + NLOHMANN_JSON_PASTE64, \ + NLOHMANN_JSON_PASTE63, \ + NLOHMANN_JSON_PASTE62, \ + NLOHMANN_JSON_PASTE61, \ + NLOHMANN_JSON_PASTE60, \ + NLOHMANN_JSON_PASTE59, \ + NLOHMANN_JSON_PASTE58, \ + NLOHMANN_JSON_PASTE57, \ + NLOHMANN_JSON_PASTE56, \ + NLOHMANN_JSON_PASTE55, \ + NLOHMANN_JSON_PASTE54, \ + NLOHMANN_JSON_PASTE53, \ + NLOHMANN_JSON_PASTE52, \ + NLOHMANN_JSON_PASTE51, \ + NLOHMANN_JSON_PASTE50, \ + NLOHMANN_JSON_PASTE49, \ + NLOHMANN_JSON_PASTE48, \ + NLOHMANN_JSON_PASTE47, \ + NLOHMANN_JSON_PASTE46, \ + NLOHMANN_JSON_PASTE45, \ + NLOHMANN_JSON_PASTE44, \ + NLOHMANN_JSON_PASTE43, \ + NLOHMANN_JSON_PASTE42, \ + NLOHMANN_JSON_PASTE41, \ + NLOHMANN_JSON_PASTE40, \ + NLOHMANN_JSON_PASTE39, \ + NLOHMANN_JSON_PASTE38, \ + NLOHMANN_JSON_PASTE37, \ + NLOHMANN_JSON_PASTE36, \ + NLOHMANN_JSON_PASTE35, \ + NLOHMANN_JSON_PASTE34, \ + NLOHMANN_JSON_PASTE33, \ + NLOHMANN_JSON_PASTE32, \ + NLOHMANN_JSON_PASTE31, \ + NLOHMANN_JSON_PASTE30, \ + NLOHMANN_JSON_PASTE29, \ + NLOHMANN_JSON_PASTE28, \ + NLOHMANN_JSON_PASTE27, \ + NLOHMANN_JSON_PASTE26, \ + NLOHMANN_JSON_PASTE25, \ + NLOHMANN_JSON_PASTE24, \ + NLOHMANN_JSON_PASTE23, \ + NLOHMANN_JSON_PASTE22, \ + NLOHMANN_JSON_PASTE21, \ + NLOHMANN_JSON_PASTE20, \ + NLOHMANN_JSON_PASTE19, \ + NLOHMANN_JSON_PASTE18, \ + NLOHMANN_JSON_PASTE17, \ + NLOHMANN_JSON_PASTE16, \ + NLOHMANN_JSON_PASTE15, \ + NLOHMANN_JSON_PASTE14, \ + NLOHMANN_JSON_PASTE13, \ + NLOHMANN_JSON_PASTE12, \ + NLOHMANN_JSON_PASTE11, \ + NLOHMANN_JSON_PASTE10, \ + NLOHMANN_JSON_PASTE9, \ + NLOHMANN_JSON_PASTE8, \ + NLOHMANN_JSON_PASTE7, \ + NLOHMANN_JSON_PASTE6, \ + NLOHMANN_JSON_PASTE5, \ + NLOHMANN_JSON_PASTE4, \ + NLOHMANN_JSON_PASTE3, \ + NLOHMANN_JSON_PASTE2, \ + NLOHMANN_JSON_PASTE1)(__VA_ARGS__)) +#define NLOHMANN_JSON_PASTE2(func, v1) func(v1) +#define NLOHMANN_JSON_PASTE3(func, v1, v2) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE2(func, v2) +#define NLOHMANN_JSON_PASTE4(func, v1, v2, v3) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE3(func, v2, v3) +#define NLOHMANN_JSON_PASTE5(func, v1, v2, v3, v4) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE4(func, v2, v3, v4) +#define NLOHMANN_JSON_PASTE6(func, v1, v2, v3, v4, v5) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE5(func, v2, v3, v4, v5) +#define NLOHMANN_JSON_PASTE7(func, v1, v2, v3, v4, v5, v6) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE6(func, v2, v3, v4, v5, v6) +#define NLOHMANN_JSON_PASTE8(func, v1, v2, v3, v4, v5, v6, v7) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE7(func, v2, v3, v4, v5, v6, v7) +#define NLOHMANN_JSON_PASTE9(func, v1, v2, v3, v4, v5, v6, v7, v8) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE8(func, v2, v3, v4, v5, v6, v7, v8) +#define NLOHMANN_JSON_PASTE10(func, v1, v2, v3, v4, v5, v6, v7, v8, v9) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE9(func, v2, v3, v4, v5, v6, v7, v8, v9) +#define NLOHMANN_JSON_PASTE11(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE10(func, v2, v3, v4, v5, v6, v7, v8, v9, v10) +#define NLOHMANN_JSON_PASTE12(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE11(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) +#define NLOHMANN_JSON_PASTE13(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE12(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) +#define NLOHMANN_JSON_PASTE14(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE13(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) +#define NLOHMANN_JSON_PASTE15(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE14(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) +#define NLOHMANN_JSON_PASTE16(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE15(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) +#define NLOHMANN_JSON_PASTE17(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE16(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) +#define NLOHMANN_JSON_PASTE18(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE17(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) +#define NLOHMANN_JSON_PASTE19(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE18(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) +#define NLOHMANN_JSON_PASTE20(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE19(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) +#define NLOHMANN_JSON_PASTE21(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE20(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) +#define NLOHMANN_JSON_PASTE22(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE21(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) +#define NLOHMANN_JSON_PASTE23(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE22(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) +#define NLOHMANN_JSON_PASTE24(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE23(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) +#define NLOHMANN_JSON_PASTE25(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE24(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) +#define NLOHMANN_JSON_PASTE26(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE25(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) +#define NLOHMANN_JSON_PASTE27(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE26(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) +#define NLOHMANN_JSON_PASTE28(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE27(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) +#define NLOHMANN_JSON_PASTE29(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE28(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) +#define NLOHMANN_JSON_PASTE30(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE29(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) +#define NLOHMANN_JSON_PASTE31(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE30(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) +#define NLOHMANN_JSON_PASTE32(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE31(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) +#define NLOHMANN_JSON_PASTE33(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE32(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) +#define NLOHMANN_JSON_PASTE34(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE33(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33) +#define NLOHMANN_JSON_PASTE35(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE34(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34) +#define NLOHMANN_JSON_PASTE36(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE35(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35) +#define NLOHMANN_JSON_PASTE37(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE36(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36) +#define NLOHMANN_JSON_PASTE38(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE37(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37) +#define NLOHMANN_JSON_PASTE39(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE38(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38) +#define NLOHMANN_JSON_PASTE40(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE39(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39) +#define NLOHMANN_JSON_PASTE41(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE40(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40) +#define NLOHMANN_JSON_PASTE42(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE41(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41) +#define NLOHMANN_JSON_PASTE43(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE42(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42) +#define NLOHMANN_JSON_PASTE44(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE43(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43) +#define NLOHMANN_JSON_PASTE45(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE44(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44) +#define NLOHMANN_JSON_PASTE46(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE45(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45) +#define NLOHMANN_JSON_PASTE47(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE46(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46) +#define NLOHMANN_JSON_PASTE48(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE47(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47) +#define NLOHMANN_JSON_PASTE49(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE48(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48) +#define NLOHMANN_JSON_PASTE50(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE49(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49) +#define NLOHMANN_JSON_PASTE51(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE50(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50) +#define NLOHMANN_JSON_PASTE52(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE51(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51) +#define NLOHMANN_JSON_PASTE53(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE52(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52) +#define NLOHMANN_JSON_PASTE54(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE53(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53) +#define NLOHMANN_JSON_PASTE55(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE54(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54) +#define NLOHMANN_JSON_PASTE56(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE55(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55) +#define NLOHMANN_JSON_PASTE57(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE56(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56) +#define NLOHMANN_JSON_PASTE58(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE57(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57) +#define NLOHMANN_JSON_PASTE59(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE58(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58) +#define NLOHMANN_JSON_PASTE60(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE59(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59) +#define NLOHMANN_JSON_PASTE61(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE60(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60) +#define NLOHMANN_JSON_PASTE62(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE61(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61) +#define NLOHMANN_JSON_PASTE63(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE62(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62) +#define NLOHMANN_JSON_PASTE64(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE63(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63) + +#define NLOHMANN_JSON_TO(v1) nlohmann_json_j[#v1] = nlohmann_json_t.v1; +#define NLOHMANN_JSON_FROM(v1) nlohmann_json_j.at(#v1).get_to(nlohmann_json_t.v1); +#define NLOHMANN_JSON_FROM_WITH_DEFAULT(v1) nlohmann_json_t.v1 = !nlohmann_json_j.is_null() ? nlohmann_json_j.value(#v1, nlohmann_json_default_obj.v1) : nlohmann_json_default_obj.v1; + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_INTRUSIVE +@since version 3.9.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE(Type, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + friend void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT +@since version 3.11.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(Type, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + friend void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { const Type nlohmann_json_default_obj{}; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_INTRUSIVE_ONLY_SERIALIZE +@since version 3.11.3 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE_ONLY_SERIALIZE(Type, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE +@since version 3.9.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_non_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Type, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT +@since version 3.11.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_non_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(Type, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { const Type nlohmann_json_default_obj{}; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE +@since version 3.11.3 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_non_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE(Type, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE(Type, BaseType, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + friend void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { nlohmann::from_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE_WITH_DEFAULT +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE_WITH_DEFAULT(Type, BaseType, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + friend void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { nlohmann::from_json(nlohmann_json_j, static_cast(nlohmann_json_t)); const Type nlohmann_json_default_obj{}; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE_ONLY_SERIALIZE +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE_ONLY_SERIALIZE(Type, BaseType, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE(Type, BaseType, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { nlohmann::from_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE_WITH_DEFAULT +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE_WITH_DEFAULT(Type, BaseType, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { nlohmann::from_json(nlohmann_json_j, static_cast(nlohmann_json_t)); const Type nlohmann_json_default_obj{}; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE(Type, BaseType, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } + +// inspired from https://stackoverflow.com/a/26745591 +// allows calling any std function as if (e.g., with begin): +// using std::begin; begin(x); +// +// it allows using the detected idiom to retrieve the return type +// of such an expression +#define NLOHMANN_CAN_CALL_STD_FUNC_IMPL(std_name) \ + namespace detail { \ + using std::std_name; \ + \ + template \ + using result_of_##std_name = decltype(std_name(std::declval()...)); \ + } \ + \ + namespace detail2 { \ + struct std_name##_tag \ + { \ + }; \ + \ + template \ + std_name##_tag std_name(T&&...); \ + \ + template \ + using result_of_##std_name = decltype(std_name(std::declval()...)); \ + \ + template \ + struct would_call_std_##std_name \ + { \ + static constexpr auto const value = ::nlohmann::detail:: \ + is_detected_exact::value; \ + }; \ + } /* namespace detail2 */ \ + \ + template \ + struct would_call_std_##std_name : detail2::would_call_std_##std_name \ + { \ + } + +#ifndef JSON_USE_IMPLICIT_CONVERSIONS + #define JSON_USE_IMPLICIT_CONVERSIONS 1 +#endif + +#if JSON_USE_IMPLICIT_CONVERSIONS + #define JSON_EXPLICIT +#else + #define JSON_EXPLICIT explicit +#endif + +#ifndef JSON_DISABLE_ENUM_SERIALIZATION + #define JSON_DISABLE_ENUM_SERIALIZATION 0 +#endif + +#ifndef JSON_USE_GLOBAL_UDLS + #define JSON_USE_GLOBAL_UDLS 1 +#endif + +#if JSON_HAS_THREE_WAY_COMPARISON + #include // partial_ordering +#endif + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +/////////////////////////// +// JSON type enumeration // +/////////////////////////// + +/*! +@brief the JSON type enumeration + +This enumeration collects the different JSON types. It is internally used to +distinguish the stored values, and the functions @ref basic_json::is_null(), +@ref basic_json::is_object(), @ref basic_json::is_array(), +@ref basic_json::is_string(), @ref basic_json::is_boolean(), +@ref basic_json::is_number() (with @ref basic_json::is_number_integer(), +@ref basic_json::is_number_unsigned(), and @ref basic_json::is_number_float()), +@ref basic_json::is_discarded(), @ref basic_json::is_primitive(), and +@ref basic_json::is_structured() rely on it. + +@note There are three enumeration entries (number_integer, number_unsigned, and +number_float), because the library distinguishes these three types for numbers: +@ref basic_json::number_unsigned_t is used for unsigned integers, +@ref basic_json::number_integer_t is used for signed integers, and +@ref basic_json::number_float_t is used for floating-point numbers or to +approximate integers which do not fit in the limits of their respective type. + +@sa see @ref basic_json::basic_json(const value_t value_type) -- create a JSON +value with the default value for a given type + +@since version 1.0.0 +*/ +enum class value_t : std::uint8_t +{ + null, ///< null value + object, ///< object (unordered set of name/value pairs) + array, ///< array (ordered collection of values) + string, ///< string value + boolean, ///< boolean value + number_integer, ///< number value (signed integer) + number_unsigned, ///< number value (unsigned integer) + number_float, ///< number value (floating-point) + binary, ///< binary array (ordered collection of bytes) + discarded ///< discarded by the parser callback function +}; + +/*! +@brief comparison operator for JSON types + +Returns an ordering that is similar to Python: +- order: null < boolean < number < object < array < string < binary +- furthermore, each type is not smaller than itself +- discarded values are not comparable +- binary is represented as a b"" string in python and directly comparable to a + string; however, making a binary array directly comparable with a string would + be surprising behavior in a JSON file. + +@since version 1.0.0 +*/ +#if JSON_HAS_THREE_WAY_COMPARISON + inline std::partial_ordering operator<=>(const value_t lhs, const value_t rhs) noexcept // *NOPAD* +#else + inline bool operator<(const value_t lhs, const value_t rhs) noexcept +#endif +{ + static constexpr std::array order = {{ + 0 /* null */, 3 /* object */, 4 /* array */, 5 /* string */, + 1 /* boolean */, 2 /* integer */, 2 /* unsigned */, 2 /* float */, + 6 /* binary */ + } + }; + + const auto l_index = static_cast(lhs); + const auto r_index = static_cast(rhs); +#if JSON_HAS_THREE_WAY_COMPARISON + if (l_index < order.size() && r_index < order.size()) + { + return order[l_index] <=> order[r_index]; // *NOPAD* + } + return std::partial_ordering::unordered; +#else + return l_index < order.size() && r_index < order.size() && order[l_index] < order[r_index]; +#endif +} + +// GCC selects the built-in operator< over an operator rewritten from +// a user-defined spaceship operator +// Clang, MSVC, and ICC select the rewritten candidate +// (see GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105200) +#if JSON_HAS_THREE_WAY_COMPARISON && defined(__GNUC__) +inline bool operator<(const value_t lhs, const value_t rhs) noexcept +{ + return std::is_lt(lhs <=> rhs); // *NOPAD* +} +#endif + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +/*! +@brief replace all occurrences of a substring by another string + +@param[in,out] s the string to manipulate; changed so that all + occurrences of @a f are replaced with @a t +@param[in] f the substring to replace with @a t +@param[in] t the string to replace @a f + +@pre The search string @a f must not be empty. **This precondition is +enforced with an assertion.** + +@since version 2.0.0 +*/ +template +inline void replace_substring(StringType& s, const StringType& f, + const StringType& t) +{ + JSON_ASSERT(!f.empty()); + for (auto pos = s.find(f); // find first occurrence of f + pos != StringType::npos; // make sure f was found + s.replace(pos, f.size(), t), // replace with t, and + pos = s.find(f, pos + t.size())) // find next occurrence of f + {} +} + +/*! + * @brief string escaping as described in RFC 6901 (Sect. 4) + * @param[in] s string to escape + * @return escaped string + * + * Note the order of escaping "~" to "~0" and "/" to "~1" is important. + */ +template +inline StringType escape(StringType s) +{ + replace_substring(s, StringType{"~"}, StringType{"~0"}); + replace_substring(s, StringType{"/"}, StringType{"~1"}); + return s; +} + +/*! + * @brief string unescaping as described in RFC 6901 (Sect. 4) + * @param[in] s string to unescape + * @return unescaped string + * + * Note the order of escaping "~1" to "/" and "~0" to "~" is important. + */ +template +static void unescape(StringType& s) +{ + replace_substring(s, StringType{"~1"}, StringType{"/"}); + replace_substring(s, StringType{"~0"}, StringType{"~"}); +} + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // size_t + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +/// struct to capture the start position of the current token +struct position_t +{ + /// the total number of characters read + std::size_t chars_read_total = 0; + /// the number of characters read in the current line + std::size_t chars_read_current_line = 0; + /// the number of lines read + std::size_t lines_read = 0; + + /// conversion to size_t to preserve SAX interface + constexpr operator size_t() const + { + return chars_read_total; + } +}; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-FileCopyrightText: 2018 The Abseil Authors +// SPDX-License-Identifier: MIT + + + +#include // array +#include // size_t +#include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type +#include // index_sequence, make_index_sequence, index_sequence_for + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +template +using uncvref_t = typename std::remove_cv::type>::type; + +#ifdef JSON_HAS_CPP_14 + +// the following utilities are natively available in C++14 +using std::enable_if_t; +using std::index_sequence; +using std::make_index_sequence; +using std::index_sequence_for; + +#else + +// alias templates to reduce boilerplate +template +using enable_if_t = typename std::enable_if::type; + +// The following code is taken from https://github.com/abseil/abseil-cpp/blob/10cb35e459f5ecca5b2ff107635da0bfa41011b4/absl/utility/utility.h +// which is part of Google Abseil (https://github.com/abseil/abseil-cpp), licensed under the Apache License 2.0. + +//// START OF CODE FROM GOOGLE ABSEIL + +// integer_sequence +// +// Class template representing a compile-time integer sequence. An instantiation +// of `integer_sequence` has a sequence of integers encoded in its +// type through its template arguments (which is a common need when +// working with C++11 variadic templates). `absl::integer_sequence` is designed +// to be a drop-in replacement for C++14's `std::integer_sequence`. +// +// Example: +// +// template< class T, T... Ints > +// void user_function(integer_sequence); +// +// int main() +// { +// // user_function's `T` will be deduced to `int` and `Ints...` +// // will be deduced to `0, 1, 2, 3, 4`. +// user_function(make_integer_sequence()); +// } +template +struct integer_sequence +{ + using value_type = T; + static constexpr std::size_t size() noexcept + { + return sizeof...(Ints); + } +}; + +// index_sequence +// +// A helper template for an `integer_sequence` of `size_t`, +// `absl::index_sequence` is designed to be a drop-in replacement for C++14's +// `std::index_sequence`. +template +using index_sequence = integer_sequence; + +namespace utility_internal +{ + +template +struct Extend; + +// Note that SeqSize == sizeof...(Ints). It's passed explicitly for efficiency. +template +struct Extend, SeqSize, 0> +{ + using type = integer_sequence < T, Ints..., (Ints + SeqSize)... >; +}; + +template +struct Extend, SeqSize, 1> +{ + using type = integer_sequence < T, Ints..., (Ints + SeqSize)..., 2 * SeqSize >; +}; + +// Recursion helper for 'make_integer_sequence'. +// 'Gen::type' is an alias for 'integer_sequence'. +template +struct Gen +{ + using type = + typename Extend < typename Gen < T, N / 2 >::type, N / 2, N % 2 >::type; +}; + +template +struct Gen +{ + using type = integer_sequence; +}; + +} // namespace utility_internal + +// Compile-time sequences of integers + +// make_integer_sequence +// +// This template alias is equivalent to +// `integer_sequence`, and is designed to be a drop-in +// replacement for C++14's `std::make_integer_sequence`. +template +using make_integer_sequence = typename utility_internal::Gen::type; + +// make_index_sequence +// +// This template alias is equivalent to `index_sequence<0, 1, ..., N-1>`, +// and is designed to be a drop-in replacement for C++14's +// `std::make_index_sequence`. +template +using make_index_sequence = make_integer_sequence; + +// index_sequence_for +// +// Converts a typename pack into an index sequence of the same length, and +// is designed to be a drop-in replacement for C++14's +// `std::index_sequence_for()` +template +using index_sequence_for = make_index_sequence; + +//// END OF CODE FROM GOOGLE ABSEIL + +#endif + +// dispatch utility (taken from ranges-v3) +template struct priority_tag : priority_tag < N - 1 > {}; +template<> struct priority_tag<0> {}; + +// taken from ranges-v3 +template +struct static_const +{ + static JSON_INLINE_VARIABLE constexpr T value{}; +}; + +#ifndef JSON_HAS_CPP_17 + template + constexpr T static_const::value; +#endif + +template +constexpr std::array make_array(Args&& ... args) +{ + return std::array {{static_cast(std::forward(args))...}}; +} + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // numeric_limits +#include // char_traits +#include // tuple +#include // false_type, is_constructible, is_integral, is_same, true_type +#include // declval + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // random_access_iterator_tag + +// #include + +// #include + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +template +struct iterator_types {}; + +template +struct iterator_types < + It, + void_t> +{ + using difference_type = typename It::difference_type; + using value_type = typename It::value_type; + using pointer = typename It::pointer; + using reference = typename It::reference; + using iterator_category = typename It::iterator_category; +}; + +// This is required as some compilers implement std::iterator_traits in a way that +// doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341. +template +struct iterator_traits +{ +}; + +template +struct iterator_traits < T, enable_if_t < !std::is_pointer::value >> + : iterator_types +{ +}; + +template +struct iterator_traits::value>> +{ + using iterator_category = std::random_access_iterator_tag; + using value_type = T; + using difference_type = ptrdiff_t; + using pointer = T*; + using reference = T&; +}; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN + +NLOHMANN_CAN_CALL_STD_FUNC_IMPL(begin); + +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN + +NLOHMANN_CAN_CALL_STD_FUNC_IMPL(end); + +NLOHMANN_JSON_NAMESPACE_END + +// #include + +// #include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + +#ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_ + #define INCLUDE_NLOHMANN_JSON_FWD_HPP_ + + #include // int64_t, uint64_t + #include // map + #include // allocator + #include // string + #include // vector + + // #include + + + /*! + @brief namespace for Niels Lohmann + @see https://github.com/nlohmann + @since version 1.0.0 + */ + NLOHMANN_JSON_NAMESPACE_BEGIN + + /*! + @brief default JSONSerializer template argument + + This serializer ignores the template arguments and uses ADL + ([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl)) + for serialization. + */ + template + struct adl_serializer; + + /// a class to store JSON values + /// @sa https://json.nlohmann.me/api/basic_json/ + template class ObjectType = + std::map, + template class ArrayType = std::vector, + class StringType = std::string, class BooleanType = bool, + class NumberIntegerType = std::int64_t, + class NumberUnsignedType = std::uint64_t, + class NumberFloatType = double, + template class AllocatorType = std::allocator, + template class JSONSerializer = + adl_serializer, + class BinaryType = std::vector, // cppcheck-suppress syntaxError + class CustomBaseClass = void> + class basic_json; + + /// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document + /// @sa https://json.nlohmann.me/api/json_pointer/ + template + class json_pointer; + + /*! + @brief default specialization + @sa https://json.nlohmann.me/api/json/ + */ + using json = basic_json<>; + + /// @brief a minimal map-like container that preserves insertion order + /// @sa https://json.nlohmann.me/api/ordered_map/ + template + struct ordered_map; + + /// @brief specialization that maintains the insertion order of object keys + /// @sa https://json.nlohmann.me/api/ordered_json/ + using ordered_json = basic_json; + + NLOHMANN_JSON_NAMESPACE_END + +#endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_ + + +NLOHMANN_JSON_NAMESPACE_BEGIN +/*! +@brief detail namespace with internal helper functions + +This namespace collects functions that should not be exposed, +implementations of some @ref basic_json methods, and meta-programming helpers. + +@since version 2.1.0 +*/ +namespace detail +{ + +///////////// +// helpers // +///////////// + +// Note to maintainers: +// +// Every trait in this file expects a non CV-qualified type. +// The only exceptions are in the 'aliases for detected' section +// (i.e. those of the form: decltype(T::member_function(std::declval()))) +// +// In this case, T has to be properly CV-qualified to constraint the function arguments +// (e.g. to_json(BasicJsonType&, const T&)) + +template struct is_basic_json : std::false_type {}; + +NLOHMANN_BASIC_JSON_TPL_DECLARATION +struct is_basic_json : std::true_type {}; + +// used by exceptions create() member functions +// true_type for pointer to possibly cv-qualified basic_json or std::nullptr_t +// false_type otherwise +template +struct is_basic_json_context : + std::integral_constant < bool, + is_basic_json::type>::type>::value + || std::is_same::value > +{}; + +////////////////////// +// json_ref helpers // +////////////////////// + +template +class json_ref; + +template +struct is_json_ref : std::false_type {}; + +template +struct is_json_ref> : std::true_type {}; + +////////////////////////// +// aliases for detected // +////////////////////////// + +template +using mapped_type_t = typename T::mapped_type; + +template +using key_type_t = typename T::key_type; + +template +using value_type_t = typename T::value_type; + +template +using difference_type_t = typename T::difference_type; + +template +using pointer_t = typename T::pointer; + +template +using reference_t = typename T::reference; + +template +using iterator_category_t = typename T::iterator_category; + +template +using to_json_function = decltype(T::to_json(std::declval()...)); + +template +using from_json_function = decltype(T::from_json(std::declval()...)); + +template +using get_template_function = decltype(std::declval().template get()); + +// trait checking if JSONSerializer::from_json(json const&, udt&) exists +template +struct has_from_json : std::false_type {}; + +// trait checking if j.get is valid +// use this trait instead of std::is_constructible or std::is_convertible, +// both rely on, or make use of implicit conversions, and thus fail when T +// has several constructors/operator= (see https://github.com/nlohmann/json/issues/958) +template +struct is_getable +{ + static constexpr bool value = is_detected::value; +}; + +template +struct has_from_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +// This trait checks if JSONSerializer::from_json(json const&) exists +// this overload is used for non-default-constructible user-defined-types +template +struct has_non_default_from_json : std::false_type {}; + +template +struct has_non_default_from_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +// This trait checks if BasicJsonType::json_serializer::to_json exists +// Do not evaluate the trait when T is a basic_json type, to avoid template instantiation infinite recursion. +template +struct has_to_json : std::false_type {}; + +template +struct has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +template +using detect_key_compare = typename T::key_compare; + +template +struct has_key_compare : std::integral_constant::value> {}; + +// obtains the actual object key comparator +template +struct actual_object_comparator +{ + using object_t = typename BasicJsonType::object_t; + using object_comparator_t = typename BasicJsonType::default_object_comparator_t; + using type = typename std::conditional < has_key_compare::value, + typename object_t::key_compare, object_comparator_t>::type; +}; + +template +using actual_object_comparator_t = typename actual_object_comparator::type; + +///////////////// +// char_traits // +///////////////// + +// Primary template of char_traits calls std char_traits +template +struct char_traits : std::char_traits +{}; + +// Explicitly define char traits for unsigned char since it is not standard +template<> +struct char_traits : std::char_traits +{ + using char_type = unsigned char; + using int_type = uint64_t; + + // Redefine to_int_type function + static int_type to_int_type(char_type c) noexcept + { + return static_cast(c); + } + + static char_type to_char_type(int_type i) noexcept + { + return static_cast(i); + } + + static constexpr int_type eof() noexcept + { + return static_cast(std::char_traits::eof()); + } +}; + +// Explicitly define char traits for signed char since it is not standard +template<> +struct char_traits : std::char_traits +{ + using char_type = signed char; + using int_type = uint64_t; + + // Redefine to_int_type function + static int_type to_int_type(char_type c) noexcept + { + return static_cast(c); + } + + static char_type to_char_type(int_type i) noexcept + { + return static_cast(i); + } + + static constexpr int_type eof() noexcept + { + return static_cast(std::char_traits::eof()); + } +}; + +/////////////////// +// is_ functions // +/////////////////// + +// https://en.cppreference.com/w/cpp/types/conjunction +template struct conjunction : std::true_type { }; +template struct conjunction : B { }; +template +struct conjunction +: std::conditional(B::value), conjunction, B>::type {}; + +// https://en.cppreference.com/w/cpp/types/negation +template struct negation : std::integral_constant < bool, !B::value > { }; + +// Reimplementation of is_constructible and is_default_constructible, due to them being broken for +// std::pair and std::tuple until LWG 2367 fix (see https://cplusplus.github.io/LWG/lwg-defects.html#2367). +// This causes compile errors in e.g. clang 3.5 or gcc 4.9. +template +struct is_default_constructible : std::is_default_constructible {}; + +template +struct is_default_constructible> + : conjunction, is_default_constructible> {}; + +template +struct is_default_constructible> + : conjunction, is_default_constructible> {}; + +template +struct is_default_constructible> + : conjunction...> {}; + +template +struct is_default_constructible> + : conjunction...> {}; + +template +struct is_constructible : std::is_constructible {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_iterator_traits : std::false_type {}; + +template +struct is_iterator_traits> +{ + private: + using traits = iterator_traits; + + public: + static constexpr auto value = + is_detected::value && + is_detected::value && + is_detected::value && + is_detected::value && + is_detected::value; +}; + +template +struct is_range +{ + private: + using t_ref = typename std::add_lvalue_reference::type; + + using iterator = detected_t; + using sentinel = detected_t; + + // to be 100% correct, it should use https://en.cppreference.com/w/cpp/iterator/input_or_output_iterator + // and https://en.cppreference.com/w/cpp/iterator/sentinel_for + // but reimplementing these would be too much work, as a lot of other concepts are used underneath + static constexpr auto is_iterator_begin = + is_iterator_traits>::value; + + public: + static constexpr bool value = !std::is_same::value && !std::is_same::value && is_iterator_begin; +}; + +template +using iterator_t = enable_if_t::value, result_of_begin())>>; + +template +using range_value_t = value_type_t>>; + +// The following implementation of is_complete_type is taken from +// https://blogs.msdn.microsoft.com/vcblog/2015/12/02/partial-support-for-expression-sfinae-in-vs-2015-update-1/ +// and is written by Xiang Fan who agreed to using it in this library. + +template +struct is_complete_type : std::false_type {}; + +template +struct is_complete_type : std::true_type {}; + +template +struct is_compatible_object_type_impl : std::false_type {}; + +template +struct is_compatible_object_type_impl < + BasicJsonType, CompatibleObjectType, + enable_if_t < is_detected::value&& + is_detected::value >> +{ + using object_t = typename BasicJsonType::object_t; + + // macOS's is_constructible does not play well with nonesuch... + static constexpr bool value = + is_constructible::value && + is_constructible::value; +}; + +template +struct is_compatible_object_type + : is_compatible_object_type_impl {}; + +template +struct is_constructible_object_type_impl : std::false_type {}; + +template +struct is_constructible_object_type_impl < + BasicJsonType, ConstructibleObjectType, + enable_if_t < is_detected::value&& + is_detected::value >> +{ + using object_t = typename BasicJsonType::object_t; + + static constexpr bool value = + (is_default_constructible::value && + (std::is_move_assignable::value || + std::is_copy_assignable::value) && + (is_constructible::value && + std::is_same < + typename object_t::mapped_type, + typename ConstructibleObjectType::mapped_type >::value)) || + (has_from_json::value || + has_non_default_from_json < + BasicJsonType, + typename ConstructibleObjectType::mapped_type >::value); +}; + +template +struct is_constructible_object_type + : is_constructible_object_type_impl {}; + +template +struct is_compatible_string_type +{ + static constexpr auto value = + is_constructible::value; +}; + +template +struct is_constructible_string_type +{ + // launder type through decltype() to fix compilation failure on ICPC +#ifdef __INTEL_COMPILER + using laundered_type = decltype(std::declval()); +#else + using laundered_type = ConstructibleStringType; +#endif + + static constexpr auto value = + conjunction < + is_constructible, + is_detected_exact>::value; +}; + +template +struct is_compatible_array_type_impl : std::false_type {}; + +template +struct is_compatible_array_type_impl < + BasicJsonType, CompatibleArrayType, + enable_if_t < + is_detected::value&& + is_iterator_traits>>::value&& +// special case for types like std::filesystem::path whose iterator's value_type are themselves +// c.f. https://github.com/nlohmann/json/pull/3073 + !std::is_same>::value >> +{ + static constexpr bool value = + is_constructible>::value; +}; + +template +struct is_compatible_array_type + : is_compatible_array_type_impl {}; + +template +struct is_constructible_array_type_impl : std::false_type {}; + +template +struct is_constructible_array_type_impl < + BasicJsonType, ConstructibleArrayType, + enable_if_t::value >> + : std::true_type {}; + +template +struct is_constructible_array_type_impl < + BasicJsonType, ConstructibleArrayType, + enable_if_t < !std::is_same::value&& + !is_compatible_string_type::value&& + is_default_constructible::value&& +(std::is_move_assignable::value || + std::is_copy_assignable::value)&& +is_detected::value&& +is_iterator_traits>>::value&& +is_detected::value&& +// special case for types like std::filesystem::path whose iterator's value_type are themselves +// c.f. https://github.com/nlohmann/json/pull/3073 +!std::is_same>::value&& +is_complete_type < +detected_t>::value >> +{ + using value_type = range_value_t; + + static constexpr bool value = + std::is_same::value || + has_from_json::value || + has_non_default_from_json < + BasicJsonType, + value_type >::value; +}; + +template +struct is_constructible_array_type + : is_constructible_array_type_impl {}; + +template +struct is_compatible_integer_type_impl : std::false_type {}; + +template +struct is_compatible_integer_type_impl < + RealIntegerType, CompatibleNumberIntegerType, + enable_if_t < std::is_integral::value&& + std::is_integral::value&& + !std::is_same::value >> +{ + // is there an assert somewhere on overflows? + using RealLimits = std::numeric_limits; + using CompatibleLimits = std::numeric_limits; + + static constexpr auto value = + is_constructible::value && + CompatibleLimits::is_integer && + RealLimits::is_signed == CompatibleLimits::is_signed; +}; + +template +struct is_compatible_integer_type + : is_compatible_integer_type_impl {}; + +template +struct is_compatible_type_impl: std::false_type {}; + +template +struct is_compatible_type_impl < + BasicJsonType, CompatibleType, + enable_if_t::value >> +{ + static constexpr bool value = + has_to_json::value; +}; + +template +struct is_compatible_type + : is_compatible_type_impl {}; + +template +struct is_constructible_tuple : std::false_type {}; + +template +struct is_constructible_tuple> : conjunction...> {}; + +template +struct is_json_iterator_of : std::false_type {}; + +template +struct is_json_iterator_of : std::true_type {}; + +template +struct is_json_iterator_of : std::true_type +{}; + +// checks if a given type T is a template specialization of Primary +template