Listing 1: A code demo for DMFF force field frontend interface. Within the DMFF frontend, for each potential term (i.e., each node in the xml file), a "generator" class is defined. The generator class is in charge of dispatching force field parameters based on the molecular topology, then invokes the backend kernels to return a differentiable potential function to users. The atom typification process is done in the frontend, so we can keep the maximal flexibility of the backend computational kernels, which can be further wrapped to obtain more advanced potentials if necessary.