def psi_ising(x_1,x_2,alpha):
    """ Ising potential function
    
    :param float x_1: first argument of the potential, eventually ndarray.
    :param float x_2: second argument, eventually ndarray of the same size that x_1.
    :param float alpha: granularity parameter
    
    :returns: **res** *(ndarray)* - output of the potential, eventually ndarray.      
    """
    
    res = alpha * (1.-2.*(x_2==x_1))
        
    return res