A C++ TPSA/DA Library With Python Wrapper
Y. Zhang, Zhang, Yuhong · OSTI OAI (U.S. Department of Energy Office of Scientific and Technical Information) · 2019
Truncated power series algebra (TPSA) or differential algebra (DA) is often used by accelerator physicists to generate a transfer map of a dynamic system. The map then can be used in dynamic analysis of the system or in particle tracking study. TPSA/DA can also be used in some fast algorithms, eg. the fast multipole method, for collective effect simulation. This paper reports a new TPSA/DA library written in C++. This library is developed based on Dr. Lingyun Yang’s TPSA code, which has been used in MAD-X and PTC. Compared with the original code, the updated version has the following changes: (1) The memory management has been revised to improve the efficiency; (2) A new data type of DA vector is defined and supported by most frequently used operators; (3) Support of inverse trigonometric functions and hyperbolic functions for the DA vector has been added; (4) function composition is revised for better efficiency; (5) a python wrapper is provided. The code is hosted at github and available to the public.