Gamma matrices and bilinears
Before this lesson: Spinors in three dimensions; Fierz identities from explicit matrices.
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 and , 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.
Fix the mathematical inputs
Section titled “Fix the mathematical inputs”The matrices acting on lower-index columns are
Here and ; transpose does not conjugate. Epsilon raising uses . The first checks are
These test different facts. The first determines the Euclidean Clifford algebra. The second fixes its relation to the stated orientation.
For four homogeneous spinors , let be zero for commuting entries and one for odd entries. Define
The canonical channel calculation gives
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 , which is different from the bilinear matrix .
Represent odd entries explicitly
Section titled “Represent odd entries explicitly”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 , bit one denotes , and so on through . Thus mask denotes , while mask zero denotes the scalar monomial .
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 = 0else: 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_maskThe 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 object | Code name or representation |
|---|---|
gamma[0], gamma[1], gamma[2] | |
| Lower epsilon matrix | C |
| An ordered Grassmann polynomial | Dictionary mask: coefficient |
| Polynomial product | wedge(left, right) |
bilinear(u, M, v) | |
| Entry statistics | Four-element tuple parities |
| Commuting Hermitian projector | rho, 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 and reproduce
Section titled “Download and reproduce”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:
python -m venv .venv.venv/Scripts/python.exe -m pip install -r requirements.txt.venv/Scripts/python.exe spinor_algebra.pyOn 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.
Check a result without the program
Section titled “Check a result without the program”Take independent odd columns and . Put , and . Direct substitution gives
For example, the first cross product is , because moving past two generators gives plus. The other cross product also gives ; the repeated-generator terms vanish. Independently, has square . The other two components each give the same coefficient, including the factor in the third. Hence
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 , with positive norm six. Its ordinary Hermitian projector determines , whose squared norm is one. The program also checks that the distinct complex bilinear obeys . 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.
Change one input
Section titled “Change one input”Run the same script with --flip-orientation. It replaces only by , holding . 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 removes its minus sign, and its anticommutators with the other matrices still vanish.
Hint 2
The triple product contains exactly once. The orientation-sensitive formula must change with it.
Solution
All nine Clifford checks pass, but the triple product becomes . 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 and . Predict and . Should the factor remain?
Hint 1
Use the same matrices and transpose contraction. Only the entry statistics changed.
Hint 2
The scalar contraction is , and the vector has only its first component nonzero.
Solution
Here and , so . The all-commuting sign in (LAB01.3) is plus. With repeated columns its first row gives , exactly . The all-odd factor 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.