nwt-substrate: a substrate-algebraic computation library for Null Worldtube Theory

Read full text
Authors: Jim Galasyn
Cited by: 4

Abstract

Algebra-to-picture color mapping for Feynman diagrams The Diagram class can now express the structural correspondence between each chunk of a Feynman amplitude iℳ and its associated diagram element (incoming/outgoing fermion lines, internal propagators, vertex factors), and render both with matched coloring. What's new Term dataclass (nwt_substrate.qed.diagram.Term): a single chunk of the algebraic amplitude paired with the diagram element it represents (element_id) and a color. Diagram.expression_terms / element_colors: optional decomposition of the amplitude into colored chunks + a registry mapping element ids to colors. Diagram.render_color_mapped(...) / Diagram.save_color_mapped(...): render the diagram with each part colored to match its algebraic chunk; underneath, render the amplitude as a horizontal chain of colored chunks. render_compton(..., color_map=...): the matplotlib renderer accepts a per-element color override. Other diagram renderers (eemumu, moller, ...) continue to work as before; populating their expression_terms is queued as future work. Why The pedagogical payoff of a Feynman diagram comes from the ability to read off "this piece of the algebra ↔ that piece of the picture." Previously the library shipped the algebra and the picture in the same figure, but the correspondence was implicit. Now it's explicit: teal ū(p') chunk IS the teal outgoing electron line; red S_F(p+k) chunk IS the red virtual electron propagator. Compatibility Fully backwards compatible. All existing call paths continue to work; the new fields default to empty and the old save() method is unchanged. Tests 341 → 344 passing. New tests verify: Compton diagrams have populated expression_terms + consistent element_colors render_color_mapped() returns a Figure with two axes Calling on a Diagram without terms raises ValueError with a clear message Compton example import nwt_substrate.qed as qed qed.compton.diagrams.s_channel.save_color_mapped("compton_s.pdf") renders the Compton s-channel diagram with ū(p') and u(p) in teal (matching the external electron lines), γᵘε_μ and γⁿε'_ν* in dark blue (matching the photon polarization vectors at each vertex), and S_F(p+k) in red (matching the internal virtual propagator). This figure is now Figure 4 of Paper 19.

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
5 May 2026