Python class for harmonic potential

Hello sir,
In the documentation of LAMMPS, an example of a python class for harmonic potential. Can it be changed according to this form of potential U = -k**[(Ri+Rj)−rij]^2 Θ[**(Ri+Rj)−rij), where Ri and Rj are the radii of two interacting particles, rij=ri-rj , Θ is the unitary step function.

Only if the radius can be given as a potential parameter and is not read from the atom style.