Since the question was somewhat clarified I will formalize both the question and the answer for future readers.
Having a differentiable scalar field $f : \mathbb{R}^4 \rightarrow \mathbb{R}$ we want to find the gradient of the field with respect to $\theta, \phi$ on the 2-manifold defined parametrically by:
$$(x(\theta,\phi), y(\theta,\phi) z(\theta,\phi), w(\theta,\phi)) = (r_0\cos\theta, r_0\sin\theta, r_1\cos\phi,r_1\sin\phi)$$
Where $r_0,r_1$ are constants. We can compute the partial derivatives as follows:
$$\frac{\partial f}{\partial \theta} = \frac{\partial f}{\partial x}\frac{\partial x}{\partial \theta} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial \theta} + \frac{\partial f}{\partial z}\frac{\partial z}{\partial \theta} + \frac{\partial f}{\partial w}\frac{\partial w}{\partial \theta} \\
= -r_0\frac{\partial f}{\partial x}\sin\theta + r_0\frac{\partial f}{\partial y}\cos\theta$$
$$\frac{\partial f}{\partial \phi} =
\frac{\partial f}{\partial x}\frac{\partial x}{\partial \phi} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial \phi} + \frac{\partial f}{\partial z}\frac{\partial z}{\partial \phi} + \frac{\partial f}{\partial w}\frac{\partial w}{\partial \phi} \\ = -r_1\frac{\partial f}{\partial x}\sin\phi + r_1\frac{\partial f}{\partial y}\cos\phi$$
Assuming that the gradient $\nabla f = (\frac{\partial f}{\partial x},\frac{\partial f}{\partial y},\frac{\partial f}{\partial z},\frac{\partial f}{\partial w})$ is known, it is straightforward to compute the 2d gradient.
Note that another possibility is to compute the gradient numerically (in case you don't have the partial derivatives of $f$):
$$ \frac{\partial f}{\partial \theta} \approx \frac{f(r_0\cos(\theta+h_{\theta}), r_0\sin(\theta+h_{\theta}), r_1\cos\phi,r_1\sin\phi) - f(r_0\cos\theta, r_0\sin\theta, r_1\cos\phi,r_1\sin\phi)}{h_{\theta}}$$
$$ \frac{\partial f}{\partial \phi} \approx \frac{f(r_0\cos\theta, r_0\sin\theta, r_1\cos(\phi+h_{\phi}),r_1\sin(\phi+h_{\phi})) - f(r_0\cos\theta, r_0\sin\theta, r_1\cos\phi,r_1\sin\phi)}{h_{\phi}}$$
For $h_{\theta}, h_{\phi}$ chosen adequately (note that the choice of these parameters is a nontrivial problem).