| name | feyncalc-core |
|---|---|
| description | Core FeynCalc symbolic QFT calculation engine. Use this for: data structures, index contractions, algebraic simplifications, Lorentz tensor operations, spinor algebra, Dirac matrices, dimensional regularization setup, kinematics definition, basic amplitude construction. Foundation skill - foundation skill for all FeynCalc calculations. Provides core data types, basic operations, and setup guidance. |
Foundation for all quantum field theory calculations
Before exploring examples below, consult: guides/QUERY_ROUTER.md
This file helps you quickly identify which example(s) match your task:
- 8 core concepts mapped to specific examples
- Keywords table for fast lookup
- Learning paths for different backgrounds
- O(1) routing - find your answer instantly
How to use:
- Read your task/goal
- Find matching keyword in
guides/QUERY_ROUTER.md - Get directed to 1-2 specific examples (not all 8)
- Load only those examples
- Return to router for next task
File location: feyncalc-core-skill/guides/QUERY_ROUTER.md
Routed queries (see QUERY_ROUTER.md for detailed routing):
- 🎯 "I need to set up kinematics" → QUERY_ROUTER.md → specific example
- 🎯 "I'm doing Lorentz algebra" → QUERY_ROUTER.md → specific example
- 🎯 "I'm working with spinors/Dirac" → Load feyncalc-qed-skill
- 🎯 "I'm doing color algebra" → Load feyncalc-qcd-skill
- 🎯 "I need loop integrals" → Load feyncalc-tools-skill
(* 4-dimensional *)
FV[p, μ] (* p^μ *)
SP[p, q] (* p·q = p^μ q_μ *)
MT[μ, ν] (* g^{μν} metric *)
(* D-dimensional (for regularization) *)
FVD[p, μ] (* p^μ in D dimensions *)
SPD[p, q] (* p·q in D dimensions *)
MTD[μ, ν] (* g^{μν} in D dimensions *)
(* ε-component (D = 4 - 2ε splitting) *)
FVE[p, μ] (* ε-component *)
SPE[p, q]
MTE[μ, ν]Key options:
- Use
SPDfor regularized calculations - Use
SPfor 4-dimensional kinematics only - Mix freely - automatic conversion
(* Clear and define *)
FCClearScalarProducts[];
ScalarProduct[p, p] = m^2; (* on-shell *)
ScalarProduct[p, q] = s/2; (* Mandelstam *)
ScalarProduct[q, q] = NotRelated; (* undetermined *)
(* Verify *)
SP[p, q] (* returns defined value *)(* Dirac spinors *)
Spinor[p, m, 1] (* u(p,m) - positive energy *)
Spinor[p, m, -1] (* v(p,m) - negative energy *)
(* Adjoint *)
SpinorUBar[p, m] (* ū(p,m) *)
SpinorVBar[p, m] (* v̄(p,m) *)
(* Explicit momentum *)
Spinor[Momentum[p], m, 1]Conventions:
- Energy-positive: E > 0 for positive energy states
- Momentum: Use Dirac convention
- Adjoint: γ⁰ hermitian conjugate
(* Automatically contract dummy indices *)
expr = FV[p, μ] * FV[q, μ];
Contract[expr] (* → SP[p, q] *)
(* With scalar product definitions *)
ScalarProduct[p, p] = m^2;
Contract[FV[p, μ] * FV[p, μ]] (* → m^2 *)(* Expand scalar products *)
ExpandScalarProduct[expr]
(* Example: (p+q)² → p² + 2p·q + q² *)
ExpandScalarProduct[(FV[p, μ] + FV[q, μ])^2]
(* Collect by variable *)
Collect2[expr, x]
Collect2[expr, {x, y, z}](* Raise/lower indices *)
g^{μν} g_{μρ} = δ^ν_ρ
(* In FeynCalc *)
Contract[MT[μ, ν] * MT[μ, ρ]] (* → MT[ν, ρ] *)
(* Trace of metric *)
Contract[MT[μ, μ]] (* → 4 *)
Contract[MTD[μ, μ]] (* → D *)GA[μ] (* γ^μ *)
GA[5] (* γ^5 *)
GA[6], GA[7] (* Projectors *)
(* Slash notation *)
GS[p] (* γ·p *)
GSD[p] (* D-dimensional *)(* {γ^μ, γ^ν} = 2g^{μν} *)
(* γ^μ γ_μ = D *)
(* γ^μ γ^ν γ_μ = (2-D) γ^ν *)
(* FeynCalc handles automatically *)
DiracSimplify[GA[μ, ν, μ]] (* → (2-D) GA[ν] *)FCClearScalarProducts[];
(* Incoming: p1, p2; Outgoing: k1, k2 *)
ScalarProduct[p1, p1] = m1^2;
ScalarProduct[p2, p2] = m2^2;
ScalarProduct[k1, k1] = m3^2;
ScalarProduct[k2, k2] = m4^2;
(* Mandelstam *)
ScalarProduct[p1, p2] = (s - m1^2 - m2^2)/2;
ScalarProduct[p1, k1] = (u - m1^2 - m3^2)/2;
ScalarProduct[p1, k2] = (t - m1^2 - m4^2)/2;
ScalarProduct[p2, k1] = (t - m2^2 - m3^2)/2;
ScalarProduct[p2, k2] = (u - m2^2 - m4^2)/2;
ScalarProduct[k1, k2] = (s - m3^2 - m4^2)/2;
(* Verify momentum conservation *)
(* p1 + p2 = k1 + k2 *)FCClearScalarProducts[];
ScalarProduct[p, p] = m^2;
(* That's all - p is on-shell *)FCClearScalarProducts[];
ScalarProduct[p, p] = NotRelated; (* p² undetermined *)
ScalarProduct[q, q] = NotRelated;
ScalarProduct[p, q] = s/2; (* p·q related *)Recommended order:
(* 1. Contract all indices first *)
expr1 = Contract[expr0];
(* 2. Expand scalar products if needed *)
expr2 = ExpandScalarProduct[expr1];
(* 3. Collect by relevant variables *)
expr3 = Collect2[expr2, {variables}];
(* 4. Factor *)
expr4 = Factor2[expr3];ExpandAll2[expr] (* Expand everything *)
Expand2[expr, x] (* Keep x factored *)
PowerExpand[expr] (* Expand powers *)Collect2[expr, x] (* Collect terms with x *)
Collect2[expr, {x, y}] (* Multiple variables *)
Factor2[expr] (* Factor intelligently *)
Factor[expr] (* Mathematica's factor *)| Convention | FeynCalc Default | Note |
|---|---|---|
| Spinor | Dirac | Canonical choice |
| Metric | (-,+,+,+) | (-) is time direction |
| γ⁵ | γ^5 = iγ⁰γ¹γ²γ³ | Standard |
| Adjoint | u† γ⁰ | Hermitian conjugate |
| Momentum | p^μ = (E, p⃗) | Energy positive |
| Error | Cause | Solution |
|---|---|---|
Dangling index μ |
Index not contracted | Use Contract[] |
Uncontracted indices |
Mixed 4D and D | Use Contract[expr] after setup |
Undefined SP |
Kinematic not set | Use ScalarProduct[...] = ... |
Dimension mismatch |
4D vs D mixing | Use ChangeDimension[expr, D] |
This skill is for: Basic setup, kinematics, index manipulation
Switch to feyncalc-qed-skill when: You need spinor traces, QED amplitudes, form factors
Switch to feyncalc-qcd-skill when: You need color algebra, QCD amplitudes
Switch to feyncalc-tools-skill when: You need loop integrals, IBP reduction, numerical evaluation
See feyncalc-tools-skill for comprehensive function references.
All FeynCalc core functions documented in companion references.
Status: Core foundation skill Use with: feyncalc-qed-skill, feyncalc-qcd-skill, feyncalc-tools-skill Version: 1.0