A collection of simple textbook-based examples.
The trace formalism is widely used when teaching courses in particle physics.
At the same time, like many formalisms, it can become tedious, especially
when dealing with longer expressions or multiple diagrams.
This project provides a simple workflow that integrates Jupyter notebooks and Python for further processing.
The algebraic manipulations are handled using FORM.
FORM is open source and can be seen as the modern successor to Schoonschip, one
of the earliest programs designed for high-energy physics calculations.
- Quarks & Leptons: An Introductory Course to Modern Particle Physics — Halzen & Martin
- Diagrammatica: The Path to Feynman Diagrams — Martinus Veltman
- FORM: J.A.M. Vermaseren, "New features of FORM" (math-ph/0010025)
- Repository: https://github.com/form-dev/form
- Releases: https://github.com/form-dev/form/releases
- Manual: https://form-dev.github.io/form-docs/stable/manual/
/Notebooks— Interactive Jupyter Notebook environments that run FORM/Notebooks/scripts—.hfiles containing FORM code, along with.frmand.txtfiles generated from the notebooks
- FORM installed (command
formmust be available) - Python
- jupyterlab
- numpy
- matplotlib
- sympy
-
We aim to run
formdirectly from within Jupyter notebooks -
Assume a notebook
name.ipynb:- Import utilities in the first cell
- Start the second cell with:
%%pyForm name
- Write the FORM code in that cell
- On execution:
- A file
scripts/name.frmis generated - The FORM script is executed
- Output is written using Format C in
.txtfiles.
- A file
- Python then parses the output file for further manipulation
| Term | Internal Notation | Mathematical Equivalent |
|---|---|---|
| Unit Matrix | gamma(i1, i2) |
|
| Gamma Matrix | gamma(i1, i2, mu) |
|
| Slash Momentum | gamma(i1, i2, p_i) |
$(\slashed{p}i)^{i_1}{}{i_2}$ |
| Gamma 5 ( |
gamma(i1, i2, k5) |
|
| Left-Handed Projector | 1/2 * gamma(i1, i2, k7) |
|
| Right-Handed Projector | 1/2 * gamma(i1, i2, k6) |
|
| V−A Coupling | 1/2 * ((cv+ca)*g(i1,i2,k7) + (cv-ca)*g(i1,i2,k6)) |
-
Outgoing fermion (
$\bar{u}$ ):UB(i1, p1, m)→$\bar{u}_a(p_1, m)$ -
Incoming fermion (
$u$ ):U(i1, p1, m)→$u_a(p_1, m)$ -
Outgoing anti-fermion (
$v$ ):V(i1, p1, m)→$v_a(p_1, m)$ -
Incoming anti-fermion (
$\bar{v}$ ):VB(i1, p1, m)→$\bar{v}_a(p_1, m)$ -
Massless Vector polarization (
$\epsilon$ ):esum(mu1, p1)→$\epsilon_\mu(p_1)$ -
Massive Vector polarization (
$\epsilon$ ):esumM(mu1, p1 , m)→$\epsilon_\mu(p_1, m)$
U(i1?,p?,m?) * UB(i2?,p?,m?) = gamma(i1,i2,p) + gamma(i1,i2)*m;
V(i1?,p?,m?) * VB(i2?,p?,m?) = gamma(i1,i2,p) - gamma(i1,i2)*m;
esum(mu1?,p?) * esum(mu2?,p?) = -d_(mu1,mu2);
esumM(mu1?, p?, m?) * esumM(mu2?, p?, m?) = -d_(mu1,mu2) + p(mu1)*p(mu2)/(m^2);
fprop(i1?,i2?,p?,m?) = (g(i1,i2,p) + g(i1,i2)*m) * prop(p.p - m^2)
phprop(mu1?,mu2?,q?) = -d_(mu1,mu2) * prop(q.q);
Zprop(mu1?,mu2?,q?,m?) = (-d_(mu1,mu2) + q(mu1) * q(mu2)/(m^2)) * prop(q.q - m^2);
Wprop(mu1?,mu2?,q?,m?) = (-d_(mu1,mu2) + q(mu1) * q(mu2)/(m^2)) * prop(q.q - m^2);
The prop function is kept symbolic in intermediate expressions
It must be resolved using kinematics and momentum conservation.
For example:
* Momentum conservation
id q = p1 + p2;
.sort
* Propagator handling
id prop(x?) = (x)^-1;
.sort
id (q.q)^-1 = (s)^-1;
id (-mZ^2 + q.q)^-1 = (s - mZ^2)^-1;
.sort
To translate a handwritten Feynman rule:
- Index direction: Follow fermion flow (matrix multiplication order)
- Spinor indices:
i1, i2, i3, ...(up toi40) - Lorentz indices:
mu1, mu2, mu3, ...(up tomu20)
After defining the amplitude:
squareamplitude(Amp, Mat)
All calculations are performed using the Minkowski metric
On-shell condition:
Mandelstam variables: