def METHOD_NAME(R,spins,iat,kup,kdn,ngrid=500):
    psi0=eval_det(R,spins,kup,kdn)
    ratios=np.zeros(ngrid)
    sxgrid=np.zeros(ngrid)
    sygrid=np.zeros(ngrid)
    szgrid=np.zeros(ngrid)
    twopi=2.0*math.pi
    delt=twopi/(ngrid-1.0)
    spins_=copy.deepcopy(spins)
    for i in range(0,ngrid):
        s=delt*i
        spins_[iat]=s
        psi_new=eval_det(R,spins_,kup,kdn)
        ratio=psi_new/psi0
        sxgrid[i]=evaluate_sx(spins[iat],s)*ratio
        sygrid[i]=evaluate_sy(spins[iat],s)*ratio
        szgrid[i]=evaluate_sz(spins[iat],s)*ratio
    sx=np.trapz(sxgrid,dx=delt)/twopi
    sy=np.trapz(sygrid,dx=delt)/twopi
    sz=np.trapz(szgrid,dx=delt)/twopi
    return np.array([sx,sy,sz])