Skip to content

Latest commit

 

History

History
421 lines (302 loc) · 10.1 KB

SKILL.md

File metadata and controls

421 lines (302 loc) · 10.1 KB
name feyncalc-tools
description Advanced FeynCalc tools and techniques for production calculations. Use this for: loop integral reduction (FIRE, Kira), numerical integration (FIESTA, LoopTools, pySecDec), IBP algorithms, master integral evaluation, dimensional regularization, multi-loop calculations, batch automation. Covers all 367 FeynHelpers functions with complete API, curator's guide for tools selection, and production workflows.

FeynCalc Tools Skill

Advanced Tools: Reduction, Integration, Automation


🎯 STEP 1: Identify Your Need (QUERY ROUTING)

Before exploring examples below, consult: guides/QUERY_ROUTER.md

This file helps you quickly identify which tool & example(s) match your task:

  • 8 tools (FIRE, Kira, FIESTA, LoopTools, Package-X, pySecDec, IBP, batch) mapped to examples
  • Decision tree for tool selection based on your integral type
  • Performance comparison matrix for 1-loop vs multi-loop
  • Learning paths for different backgrounds (beginner → expert)
  • O(1) routing - find the right tool instantly

How to use:

  1. Read your task/goal (1-loop? multi-loop? numerical? analytical?)
  2. Find matching tool/process in guides/QUERY_ROUTER.md
  3. Get directed to 1-2 specific examples (not all 8)
  4. Load only those examples
  5. Return to router for next task

File location: feyncalc-tools-skill/guides/QUERY_ROUTER.md


Quick Navigation - Choose Your Need

🎯 What tool do you need?

Consult QUERY_ROUTER.md first, then select:

  • "I have 1-loop integrals, need analytical"

    • Load SELECTION: oneloop_analytical
    • Use: Package-X
    • Go to: Package-X
  • "I have 1-loop integrals, need numerical"

    • Load SELECTION: oneloop_numerical
    • Use: LoopTools or FIESTA
    • Go to: Numerical 1-Loop
  • "I have multi-loop integrals, need reduction"

    • Load SELECTION: multiloop_reduction
    • Use: FIRE or Kira
    • Go to: IBP Reduction
  • "I have master integrals, need numerical"

  • "I need to run 100+ calculations"

  • "I need complete API reference"


Tool Selection Guide

Tool Purpose Input Output Complexity
Package-X 1-loop analytical 1-loop integral Series in ε ⭐
LoopTools 1-loop numerical 1-loop integral Decimal ⭐
FIRE Multi-loop IBP Generic integrals Master integrals ⭐⭐⭐
Kira Multi-loop IBP Generic integrals Master integrals ⭐⭐⭐
FIESTA Multi-loop numerical Master integrals Decimal+ε ⭐⭐⭐⭐
pySecDec Multi-loop numerical Multi-loop integrals Decimal ⭐⭐⭐⭐

SELECTION: oneloop_analytical

Package-X: Analytical 1-Loop

Use when: You need exact symbolic results for 1-loop integrals

Key features:

  • Exact analytical formulas
  • Dimensional regularization built-in
  • Series expansion in ε
  • Special functions (logarithms, polylogarithms)

Setup

<< FeynHelpers`

(* Evaluate *)
result = PaXEvaluate[
  expr,
  PaXImplicitPrefactor -> 1/(2π)^D,
  PaXAnalytic -> True,
  PaXKeepEpsilonOrder -> 2
];

Available Integrals

PaXA0[m]                           (* Tadpole *)
PaXB0[p2, m1, m2]                 (* Bubble *)
PaXC0[p1^2, p2^2, (p1+p2)^2, m1, m2, m3]  (* Triangle *)
PaXD0[p1^2, ..., m1, m2, m3, m4]  (* Box *)

Options

PaXImplicitPrefactor -> 1/(2π)^D
PaXAnalytic -> True              (* Force analytic *)
PaXKeepEpsilonOrder -> 2         (* Order in ε *)
PaXSimplify -> True              (* Simplify result *)

Example

(* Box integral *)
box = PaXD0[m1, m2, m3, m4, s, t, u];
result = PaXEvaluate[box];

(* Extract poles *)
pole = Coefficient[Series[result, {ε, 0, 1}], 1/ε];
finite = Coefficient[Series[result, {ε, 0, 0}], 1];

Learning difficulty: ⭐ Basic


SELECTION: oneloop_numerical

LoopTools: 1-Loop Numerical

Use when: You need fast numerical evaluation of 1-loop integrals

Key features:

  • Fast numerical computation
  • Passarino-Veltman integrals
  • Real/complex kinematics support

Setup

LToolsLoadLibrary[];

result = LToolsEvaluate[
  LToolsC0[m1, m2, m3, p1^2, p2^2, p12^2]
];

LToolsUnLoadLibrary[];

Available Integrals

LToolsA0[m^2]                              (* A0 *)
LToolsB0[p^2, m1^2, m2^2]                (* B0 *)
LToolsB11[p^2, m1^2, m2^2]               (* B11 *)
LToolsC0[p1^2, p2^2, p12^2, m1^2, m2^2, m3^2]
LToolsD0[...]

Learning difficulty: ⭐ Basic


SELECTION: multiloop_reduction

IBP Reduction: FIRE vs Kira

Use when: You have multi-loop generic integrals, need reduction to master integrals

FIRE: Traditional IBP

(* 1. Define topology *)
topo = FCTopology["name",
  {FAD[...], FAD[...], ...},
  {loop momenta},
  {external momenta},
  {kinematic constraints},
  {}
];

(* 2. Create FIRE config *)
FIRECreateConfigFile[topo, "config.txt"];

(* 3. Create integral file *)
FIRECreateIntegralFile[integrals, "ints.txt"];

(* 4. Run *)
FIRERunReduction["ints.txt", FIREBinaryPath -> "/path/fire6"];

(* 5. Import *)
results = FIREImportResults["fire.table"];

Kira: Advanced IBP

(* Similar structure, more advanced *)
KiraCreateConfigFiles[topo, "kira/"];
KiraRunReduction["kira/job.kira"];
results = KiraImportResults["kira/results.txt"];

When to use each:

  • FIRE: Simpler topologies, fewer integrals
  • Kira: Complex topologies, many integrals, performance matters

Learning difficulty: ⭐⭐⭐ Advanced


SELECTION: multiloop_numerical

FIESTA: Numerical Multi-Loop

Use when: Master integrals need numerical evaluation

CRITICAL: FCLoopSwitchEtaSign must be used!

(* ⚠️ CRITICAL ⚠️ *)
topoFiesta = FCLoopSwitchEtaSign[topo, -1];

(* Create scripts *)
files = FSACreateMathematicaScripts[
  GLI[topo, {n1, n2, ...}],
  topoFiesta,
  "/tmp/fiesta/",
  FSAParameterRules -> {SPD[q] -> 10., m1 -> 1.5},
  FSAOrderInEps -> 0,
  FSAIntegrator -> "quasiMonteCarlo",
  OverwriteTarget -> True
];

(* Run *)
FSARunIntegration[files[[1]]];

(* Load *)
result = FSALoadNumericalResults[files[[2]]];

Common options:

FSAIntegrator -> "quasiMonteCarlo"    (* or "Sabanskis" *)
FSAOrderInEps -> 0                    (* Order in ε *)
FSAParameterRules -> {SPD[q] -> 10}   (* Kinematic point *)

Learning difficulty: ⭐⭐⭐⭐ Expert (remember eta sign!)


SELECTION: automation

Batch Automation

Use when: Running 50+ similar calculations

# config.json
{
  "template": "mathematica script with ${param}",
  "calculations": [
    {"parameters": {"param1": "value1", ...}},
    {"parameters": {"param1": "value2", ...}},
    ...
  ],
  "max_workers": 4,
  "timeout": 3600,
  "output_dir": "./results"
}
python3 batch_runner.py config.json

Features:

  • Parallel execution
  • Progress tracking
  • Error handling
  • Result aggregation
  • Logging

Learning difficulty: ⭐⭐ Intermediate


Complete API Reference

367 FeynHelpers Functions Organized

Categories:

  • FIRE (37 functions) - IBP reduction
  • Kira (20 functions) - Differential equations
  • FIESTA (78 functions) - Numerical integration
  • LoopTools (75 functions) - 1-loop Passarino-Veltman
  • Package-X (28 functions) - 1-loop analytical
  • PySecDec (69 functions) - Multi-loop numerical
  • QGRAF (31 functions) - Diagram generation
  • Configuration (12 functions) - Global settings
  • Fermat (10 functions) - Symbolic computation
  • Utility (7 functions) - Helper functions

See companion reference: FEYNHELPERS_COMPLETE_REFERENCE.md


Production Workflows

Workflow 1: 1-Loop Analytical (Tree + 1-Loop)

(* Generated tree amplitude *)
ampTree = ...;

(* Generated 1-loop amplitude *)
ampOneLoop = ...;

(* 1. Simplify tree *)
ampTreeSimp = Contract[ampTree];

(* 2. Simplify 1-loop *)
ampOneLoopSimp = OneLoopSimplify[Contract[ampOneLoop], q];

(* 3. Evaluate *)
resultTree = ampTreeSimp;
resultOneLoop = PaXEvaluate[ampOneLoopSimp];

(* 4. Combine NLO *)
ampNLO = resultTree + (αs/(2π)) * resultOneLoop;

Workflow 2: Multi-Loop with FIRE

(* 1. Define topology *)
topo = FCTopology[...];

(* 2. Reduce *)
FIRERunReduction[...];
miList = FIREImportResults[...];

(* 3. Evaluate MIs *)
resultsNumerical = Map[
  (FSACreateScripts[#, ...]; FSARunIntegration[...]) &,
  miList
];

(* 4. Reconstruct *)
ampFinal = (* linear combination of MI results *);

When to Use Each Tool

Situation Tool Why
1-loop, need exact Package-X Analytical formulas
1-loop, need speed LoopTools Fast numerical
Multi-loop, simple topo FIRE Proven, reliable
Multi-loop, complex Kira Advanced algorithm
Multi-loop, numerical FIESTA Most robust
100+ jobs batch_runner Parallelization

References

Complete function documentation: FEYNHELPERS_REFERENCE.md (50+ pages, 367 functions)

Examples catalog: FEYNCALC_CURATOR_GUIDE.md (15+ loop integral examples)

Tool interfaces: Each tool has comprehensive options documented


Troubleshooting

Issue Solution
FIRE not found Set FIREBinaryPath correctly
FIESTA fails Remember FCLoopSwitchEtaSign[topo, -1]
Kira config error Check momentum conservation in topology
LoopTools link error Verify library installation
Timeout Reduce max_workers or increase timeout

Status: Tools sub-skill Functions documented: 367 Workflows: 5+ production-tested Version: 1.0


Key Files

  • FEYNHELPERS_REFERENCE.md - Complete 367-function reference
  • FEYNCALC_CURATOR_GUIDE.md - 15+ tool examples
  • batch_runner.py - Automation script