GSoC 2022 Project Report
Introduction
The Geant4 toolkit is the basis of the particle transport applications used in High Energy Physics (HEP) experiments, at CERN, other laboratories worldwide and in a large number of diverse applications.A key ability of Geant4 is the propagation of charged particles in electromagnetic fields. A challenging application involves the tracking of particles in accelerators for a large number of turns.Specifically, the muon g-2 experiment at Fermilab seeks to uncover whether a yet undiscovered force influences how the spin of the muon behaves.This requires the use of integration schemes which preserve phase space volume and energy over the course of the simulation.Currently, none of the numerical integration schemes present in the toolkit are energy preserving. Hence, the aim of this project is to implement multiple methods which do not accumulate errors in energy and phase space volume over a large number of integration steps.
Project Details
My project was about implementing symmplectic integrators into the Geant4 codebase.Symplectic integrators are methods that conserve phase space volume. They are excellent for long term accurate tracking of particles.
Progress:
Testbed Application:
Before starting my work on the methods themselves, it was imperative to come with Geant4 testbed application that would be used to test these method out. As such I developed a Geant4 application that provides the flexible choice of using a variety of integrator methods for their easy testing. The work done for this application can be found in the following Merge Request-1 to Geant4 developer repository. The testbed application code was submitted in the following commit of the Merge Request.Alternatively, the code should be visible in the following PR-1
Method-1: The Boris Algorithm:
The first method that we decided to implement was the boris algorithm.The 2nd order method is easy to implement and conservers phase space volume, even though it is not symplectic.The method was implemented along the lines of the following paper. The algorithm was implemented by designing a stepper class (G4BorisScheme
) and a driver class (G4BorisDriver
).The implementation can be found in the following Merge Request-1.Alternatively, the code should be visible in the following PR-2
Method-2: The Boris-SDC (Work in Progress)
After successfully implementing the 2nd order Boris Algorithm, I worked on implementing a higher order method, namely, Boris-SDC.Boris-SDC was designed to provide a high order alternative to Boris, with strong conservation properties, improved accuracy and lower computational effort required to attain this accuracy.Boris-SDC is fundamentally a collocation method solved via spectral deferred corrections, using the same trick as the Boris algorithm to avoid an implicit velocity dependence.The method was described in detail in the following thesis of K. Smedt. The method was implemented in the following Merge Request-2 for the case of a constant magnetic field. It still requires some minor corrections in the UpdateVelocity functions.Alternatively, the code should be visible in the following PR-3
Conclusion
Overall I had a highly educative experience this summer and hope to continue contributing to Geant4 in the future.