def METHOD_NAME(Nphi, Ntheta, Nr, dtype, dealias, build_basis):
    c, d, b, phi, theta, r, x, y, z = build_basis(Nphi, Ntheta, Nr, dtype, dealias)
    f = field.Field(dist=d, bases=(b,), dtype=dtype)
    f['g'] = x*y*z
    u = operators.Gradient(f).evaluate()
    def initialize_vector(*args):
        r, th, ph = args
        ur = 3*r**2*np.cos(th)*np.sin(th)**2*np.cos(ph)*np.sin(ph)
        uth = 1/4*r**2*(1+3*np.cos(2*th))*np.sin(th)*np.sin(2*ph)
        uph = r**2*np.cos(th)*np.sin(th)*np.cos(2*ph)
        return np.array([uph, uth, ur])
    def F(*args):
        return operators.GeneralFunction(d, u.domain, layout='g', tensorsig=u.tensorsig, dtype=dtype, func=initialize_vector, args=args)
    v = F(r, theta, phi).evaluate()
    assert np.allclose(u['g'], v['g'])