fieldsmith: Automated symbolic derivation in classical field theory and gauge theory from LaTeX input
We present fieldsmith, an open-source Python library for the automated derivation of analytical results in classical field theory, and non-abelian gauge theories. A Lagrangian is entered the way it is written on a blackboard, in LaTeX index notation, and the library produces and verifies Euler-Lagrange equations (of arbitrary derivative order, on flat or curved backgrounds), Noether currents and identities, canonical and Hilbert energy-momentum tensors, canonical momenta and Hamiltonians, local Poisson brackets and a Dirac-Bergmann constraint analysis with degree-of-freedom counting, linearised wave equations and dispersion relations, gauge-covariant derivatives and field strengths for products of unitary groups, and mass spectra after spontaneous symmetry breaking. A fitting routine translates component-level output back into covariant index notation, and a grading module checks students' submitted field equations, identities and conserved currents. The implementation is a compact (about 2,700 lines) layer on top of SymPy: tensors are stored by components with labelled, variance-aware slots, and every statement is established by exact symbolic computation rather than pattern matching. This document is the companion guide to the library. It explains the intent and design, describes the algorithms, and then works through eighteen self-checking examples, ranging from the Klein-Gordon field to the BPST instanton and the 't Hooft-Polyakov monopole, each preceded by the background physics needed to follow it. The examples double as a compact introduction to classical field theory and gauge theory as seen through a computational lens. We are explicit about the limitations of the approach.