Curl of a simple magnetic field and resulting current distribution I've been doing some thinking lately and here is my question:
If one imagines that there is an auxiliary magnetic field $H$ whose spatial dependence is given by equation:
$$H(x,y,z)=y\hat{i}$$
Where by $\hat i$ it is meant the unit vector in the $x$ direction. 
Taking the curl of this field, I obtain $\text{curl}(H)=-\hat k$ where $\hat k$ is a unit vector in the $z$ direction. 
So, by Ampere's law, the curl of $H$ should be equal to the sum of current density $J$ and displacement current $dD/dt$. I believe that the displacement current can be neglected. So, we're left with a result that says that the current distribution is uniform and in the direction of the negative $z$ axis. Is that reasoning correct?
If it is correct, how can that current produce the field we started with? Shouldn't the field inside be zero everywhere? Can you help me find an error in my thinking?
 A: About the following:

Shouldn't the field inside be zero everywhere?,

correct me if I am wrong, but you are imagining a current flowing at every point in the '-z' direction, and by symmetry, the magnetic field should vanish everywhere.
I agree with that argument, which is valid only if you consider your region to be the whole space, $R^3$.
But the problem is that if you assume so, the field that you have imposed in the beginning, namely $\vec{H}=\hat{i}y$, becomes $\infty$ for $y\to \infty$.
I guess that that is what makes the problem be ill defined.
That situation is impossible in reality.
Does this make any sense to you? 
A: I wanted to point how how hopeless your goal is in general.
Imagine starting with a field, even a constant field such as $\vec H= H\hat k,$ then if you take the curl you lose information about the field, for instance $\vec \nabla \times \vec H=\vec \nabla \times \left(H \hat k\right)=\vec 0$ and if you then take a current like that, how can it produce the original field.
Or take two fields $\vec H_1$ and $\vec H_2$ that have the same curl: $\vec \nabla \times \vec H_1=\vec \nabla \times \vec H_2.$ How could that curl produce two different magnetic fields. There is no reason to expect one current to be able to produce two separate magnetic fields. So the whole expectation is misguided from the get go.
There are legitimate ways to think about electromagnetics. One is to accept that there are electromagnetic fields. And that given some fields and currents now we can find out how things change in time. Specifically $\frac{\partial \vec B}{\partial t}=-\vec \nabla \times \vec E.$ So the electric field actually tells the $\vec B$ field how to change. The $\vec B$ field isn't allowed to have its own freely adjustable time derivative.
And the displacement field similarly isn't allowed to have a freely adjustable time derivative, instead $\frac{\partial \vec D}{\partial t}=-\vec J+\vec \nabla \times \vec H.$ So the imbalance between the electric current and the curl of the magnetic field tells the displacement field how to change.
For such a view you could start with the electric current and the magnetic field, and both are what they are and any mismatch simply dictates how the displacement field changes in time. In this case, the magnetic field is what it is because the electric field made it into that and/or left if it that way when it was already like that.
Which is a key. If you want the magnetic field to stay like that you do need any electric fields to cooperate to avoid changing the $\vec B$ field.
