Skip to content

Gamma matrices and bilinears

Can a computer distinguish a correct spinor identity from a calculation with the wrong statistics? In this laboratory you will check the matrix coefficients and the exchange signs separately, then combine them in a four-spinor rearrangement. The final variation deliberately changes one gamma matrix: the Clifford algebra still passes, while the orientation test detects the mismatch.

Prepare with spinors in three dimensions and Fierz identities from explicit matrices. They own the analytic derivations. This page explains how to represent those calculations in editable code and interpret its output.

We use flat three-dimensional Euclidean signature, metric δμν\delta_{\mu\nu} and ϵ123=+1\epsilon_{123}=+1, with the conventions of P v3, Appendix A.1. The calculation is pointwise algebra. It assumes no gauge group, curved background or particular supersymmetric action. All inputs below are dimensionless algebraic test values; there is no momentum scale, integration contour or spatial discretization.

The matrices acting on lower-index columns are

γ1=(100−1),γ2=(0−1−10),γ3=(0i−i0),C=(0−110).(LAB01.1)\gamma^1=\begin{pmatrix}1&0\\0&-1\end{pmatrix},\quad \gamma^2=\begin{pmatrix}0&-1\\-1&0\end{pmatrix},\quad \gamma^3=\begin{pmatrix}0&i\\-i&0\end{pmatrix},\qquad C=\begin{pmatrix}0&-1\\1&0\end{pmatrix}. \tag{LAB01.1}

Here uv=uTCvuv=u^TCv and uγμv=uTCγμvu\gamma^\mu v=u^TC\gamma^\mu v; transpose does not conjugate. Epsilon raising uses −C-C. The first checks are

{γμ,γν}=2δμν1,γ1γ2γ3=i1.(LAB01.2)\{\gamma^\mu,\gamma^\nu\}=2\delta^{\mu\nu}1, \qquad \gamma^1\gamma^2\gamma^3=i1. \tag{LAB01.2}

These test different facts. The first determines the Euclidean Clifford algebra. The second fixes its relation to the stated orientation.

For four homogeneous spinors u,v,w,xu,v,w,x, let pu,…,pxp_u,\ldots,p_x be zero for commuting entries and one for odd entries. Define

S=(uv)(wx),V=(uγμv)(wγμx),S′=(ux)(wv),V′=(uγμx)(wγμv).\begin{aligned} S&=(uv)(wx),& V&=(u\gamma^\mu v)(w\gamma_\mu x),\\ S'&=(ux)(wv),& V'&=(u\gamma^\mu x)(w\gamma_\mu v). \end{aligned}

The canonical channel calculation gives

(SV)=(−1)pvpw+px(pv+pw)(121232−12)(S′V′).(LAB01.3)\begin{pmatrix}S\\V\end{pmatrix} =(-1)^{p_vp_w+p_x(p_v+p_w)} \begin{pmatrix}\frac12&\frac12\\\frac32&-\frac12\end{pmatrix} \begin{pmatrix}S'\\V'\end{pmatrix}. \tag{LAB01.3}

We test all sixteen parity assignments. The prefactor comes from a specified entry permutation, not from the number of gamma matrices. The code also checks the source’s all-lower-index completeness relation on all sixteen index choices. That uses γμCT\gamma^\mu C^T, which is different from the bilinear matrix CγμC\gamma^\mu.

Ordinary symbolic variables commute. Naming one theta does not make it Grassmann odd. Instead, represent an increasing monomial by a bit mask. Bit zero denotes θ1\theta_1, bit one denotes θ2\theta_2, and so on through θ8\theta_8. Thus mask 5=1+45=1+4 denotes θ1θ3\theta_1\theta_3, while mask zero denotes the scalar monomial 11.

A polynomial is a dictionary from masks to commuting coefficients. For example,

theta1 = {1: 1}
theta2 = {2: 1}
theta1_plus_twice_theta2 = {1: 1, 2: 2}

To multiply two monomials, first check for a repeated bit: its generator squares to zero. Otherwise count how many pairs must cross to restore increasing order. Each crossing contributes a minus sign. The released wedge function implements exactly these operations:

if left_mask & right_mask:
coefficient = 0
else:
crossings = sum(
(right_mask & ((1 << i) - 1)).bit_count()
for i in range(8) if left_mask & (1 << i)
)
coefficient = (-1)**crossings * left_coefficient * right_coefficient
result_mask = left_mask | right_mask

The full function sums coefficients when different products produce the same mask. It expands and removes zero coefficients. This excerpt describes one monomial product; use the complete downloadable function for polynomials.

For commuting spinors the entries are ordinary independent SymPy symbols stored at mask zero. For odd spinors the entries occupy distinct generator bits. The coefficients always commute. This makes a mixed-parity calculation an actual graded multiplication, rather than a sign attached after a commuting calculation.

Mathematical objectCode name or representation
γ1,γ2,γ3\gamma^1,\gamma^2,\gamma^3gamma[0], gamma[1], gamma[2]
Lower epsilon matrixC
An ordered Grassmann polynomialDictionary mask: coefficient
Polynomial productwedge(left, right)
uTMvu^TMvbilinear(u, M, v)
Entry statisticsFour-element tuple parities
Commuting Hermitian projectorrho, using conjugate transpose

The algebra engine has eight generators, sufficient for four independent two-component odd spinors. It is not a field-theory regulator. Generator anticommutation and associativity on all generator triples are checked before using it for Fierz rearrangements.

Download the complete lab (ZIP) with the program, pinned dependencies, reference output and run instructions.

Download the editable Python calculation, its pinned environment, and the expected output into one folder. The script needs Python with SymPy; mpmath is SymPy’s pinned supporting dependency. The tested versions are Python 3.13.7, SymPy 1.13.3 and mpmath 1.3.0.

In Windows PowerShell, from that folder, create a local environment and run:

Terminal window
python -m venv .venv
.venv/Scripts/python.exe -m pip install -r requirements.txt
.venv/Scripts/python.exe spinor_algebra.py

On macOS or Linux, use python3 -m venv .venv, then substitute .venv/bin/python for .venv/Scripts/python.exe in the last two commands. The calculation itself is the same. Package installation requires access to the package registry; subsequent calculation requires no network or data file. No notebook service or plotting package is needed.

The default run prints JSON with these principal results:

{
"total": 650,
"parity_assignments": 16,
"coefficient_of_theta1_theta2_theta3_theta4": {
"scalar_squared": -2,
"vector_squared": 6
},
"unit_direction": ["-2/3", "-1/3", "-2/3"]
}

This is an excerpt; the output file includes the groups of checks and interpretation. Most assertions check the algebra engine, including 512 generator-associativity tests. They are not 650 independent physical results. The scientifically useful outputs are the completeness identities, the two Fierz rows for every parity choice, the quartic coefficients and the projector.

Take independent odd columns ψ=(θ1,θ2)T\psi=(\theta_1,\theta_2)^T and χ=(θ3,θ4)T\chi=(\theta_3,\theta_4)^T. Put s=ψχs=\psi\chi, jμ=ψγμχj^\mu=\psi\gamma^\mu\chi and Ω=θ1θ2θ3θ4\Omega=\theta_1\theta_2\theta_3\theta_4. Direct substitution gives

s=θ2θ3−θ1θ4,s2=−2Ω.s=\theta_2\theta_3-\theta_1\theta_4, \qquad s^2=-2\Omega.

For example, the first cross product is −θ2θ3θ1θ4=−Ω-\theta_2\theta_3\theta_1\theta_4=-\Omega, because moving θ1\theta_1 past two generators gives plus. The other cross product also gives −Ω-\Omega; the repeated-generator terms vanish. Independently, j1=θ1θ4+θ2θ3j^1=\theta_1\theta_4+\theta_2\theta_3 has square 2Ω2\Omega. The other two components each give the same coefficient, including the factor i2i^2 in the third. Hence

jμjμ=6Ω=−3s2.(LAB01.4)j_\mu j^\mu=6\Omega=-3s^2. \tag{LAB01.4}

This hand ordering checks the printed coefficients without relying on wedge. The complete proof and its flavor-index limitation remain in the Fierz lesson. These are ordered classical field polynomials; they do not calculate renormalized coincident operator products.

The commuting test instead uses ζ=(1,1+2i)T\zeta=(1,1+2i)^T, with positive norm six. Its ordinary Hermitian projector determines η=(−2,−1,−2)/3\eta=(-2,-1,-2)/3, whose squared norm is one. The program also checks that the distinct complex bilinear Pμ=ζTCγμζP^\mu=\zeta^TC\gamma^\mu\zeta obeys P⋅P=0P\cdot P=0. There is no contradiction: the latter contraction has no complex conjugation and is not a positive norm.

All these checks use exact integers, rational numbers and symbolic polynomials. There is no sampling uncertainty, numerical tolerance or cutoff extrapolation. An exact computation can still implement the wrong identity; the explicit source dictionary, hand calculation and changed-input test address that different risk.

Run the same script with --flip-orientation. It replaces only γ3\gamma^3 by −γ3-\gamma^3, holding ϵ123=+1\epsilon_{123}=+1. Predict which test fails before reading the diagnostic. Does this define an inconsistent Clifford representation, or an inconsistent use of the original orientation formula?

Hint 1

Squaring −γ3-\gamma^3 removes its minus sign, and its anticommutators with the other matrices still vanish.

Hint 2

The triple product contains γ3\gamma^3 exactly once. The orientation-sensitive formula must change with it.

Solution

All nine Clifford checks pass, but the triple product becomes −i1-i1. The diagnostic prints orientation_matches_epsilon123_plus_one: false. This run reports the intentionally introduced mismatch successfully; it does not declare the modified matrices compatible with the original convention.

The new matrices are a valid Euclidean Clifford representation. With the fixed orientation, however, their product formula has the opposite epsilon sign. A consistent translation would change all affected orientation formulas together. Passing the Clifford anticommutator alone would not authorize copying the original spin connection or bilinear formulas that depend on orientation.

As a second test, replace both odd columns in the hand example by the commuting columns ψ=(1,0)T\psi=(1,0)^T and χ=(0,1)T\chi=(0,1)^T. Predict s2s^2 and j⋅jj\cdot j. Should the factor −3-3 remain?

Hint 1

Use the same matrices and transpose contraction. Only the entry statistics changed.

Hint 2

The scalar contraction is −1-1, and the vector has only its first component nonzero.

Solution

Here s=−1s=-1 and j=(1,0,0)j=(1,0,0), so s2=j⋅j=1s^2=j\cdot j=1. The all-commuting sign in (LAB01.3) is plus. With repeated columns its first row gives s2=(s2+j2)/2s^2=(s^2+j^2)/2, exactly j2=s2j^2=s^2. The all-odd factor −3-3 applies to the earlier Grassmann-valued expression, not to these ordinary columns. No change of gamma basis is needed.

You can now distinguish three checks that often get conflated: the Clifford algebra, the chosen orientation, and the statistics of the entries. The output establishes these pointwise identities in the stated three-dimensional representation. Whether a spinor solves a differential equation, patches globally or labels a preserved symmetry requires the additional inputs taught in geometry from one spinor.