Return the squared distance between each point in on set,
    and every point in a second set, in periodic space.

    Parameters
    ----------
    ra, rb: float array-like, shape (n, d) and (m, d) in d dimensions.
        Two sets of points.
    L: float array, shape (d,)
        System lengths.

    Returns
    -------
    cdist_sq: float array-like, shape (n, m, d)
        cdist_sq[i, j] is the squared distance between point j and point i.

def cdist_sq_periodic(ra, rb, L):
    """Return the squared distance between each point in on set,
    and every point in a second set, in periodic space.

    Parameters
    ----------
    ra, rb: float array-like, shape (n, d) and (m, d) in d dimensions.
        Two sets of points.
    L: float array, shape (d,)
        System lengths.

    Returns
    -------
    cdist_sq: float array-like, shape (n, m, d)
        cdist_sq[i, j] is the squared distance between point j and point i.
    """
    return np.sum(np.square(csep_periodic(ra, rb, L)), axis=-1)