Numerical code generation from symbolic expressions in Python

An approach to numerical software development is presented, with the objective to leverage
automatic symbolic expressions translation to universal functions of different numerical
backends. SymPy is used to define the symbolic expressions while NumPy and CuPy are the currently
supported numerical backends. This allows the non-expert in GPU programming to easily exploit
GPU computational power for highly demanding numerical tasks, while having the chance to
have the same formulas evaluated also on the CPU.
Our approach is demonstrated in the context of Optics related computations such
as Optical Propagation methods and Zernike modes covariance computation.

Theme – Other