def spinChainProductSum(spins):
    """
    Calculate the Ising nearest neighbor interactions of a spin chain, periodic boundary condition(PBC).

    Parameters
    ----------
    spins : list of ints or floats
        The given spin under PBC.

    Returns
    float
        The nearest neighbor interactions(products).
    """
    res = 0.0
    n = len(spins)
    for i in range(n):
        res += spins[i] * spins[i + 1 - n]
    return res