def lambda_potential(conf, params, box, lamb, multiplier, offset, u_fn):
    """
    Implements:

    (multiplier*lamb + offset)*u_fn(lamb)

    For example, to implement (1-lambda)*U_0(lambda) + lambda*U_1(lambda),
    The left hand side is (multiplier = 1, offset = 0),
    The right hand side is (multiplier = -1, offset = 1)

    """

    # lamb appears twice as the potential itself may be a function
    # of lambda (eg. if we use softcores)
    return (multiplier*lamb + offset)*u_fn(conf, params, box, lamb)