Closed mphoward closed 3 years ago
I don't think there is really a need for this anymore because DesignVariables
can now be shared between potentials and used as cutoffs. Closing for now, can be reopened if someone thinks of a use-case we're missing.
This is a proposal to allow the user to compose pair potentials from existing ones with coupling between parameters. This would be very useful for making interactions defined piecewise. An example would be a WCA core with fixed epsilon/sigma and a Lennard-Jones tail of varying attraction relative to epsilon, called lambda. Here, the beginning of the attractive tail is coupled to the WCA cutoff. All the functions could be reimplemented, but they could productively crib from the existing Lennard-Jones potential.
To support this, we should change the
_energy
,_force
, and_derivative
methods to be classmethods. This will allow the user to call them directly without needing to instantiate the class. The composite potential will define the parameters that it is expecting, and it can then forward them to the appropriate class method. This level of intentional control is good because the user can pick which parameters get coupled to each other, etc.Here's what an energy function might look like (this is a scalar r, but can be generalized to an array)