The integral form of Ampere's law: $$ I=\oint \vec{H}\cdot d\vec{\ell} $$ States that the current enclosed by an imaginary closed path is equal to the field's line integral over the length. By choosing a closed path such that the magnetic field is constant everywhere on the loop, the $H$ can be taken out of the integral: $$ I = ||H||\oint d\vec{\ell} = H\ell $$ Where $\ell$ is the length of the closed path. Computing the length and solving for $H$ gives us the magnitude of the field.
How do you find the direction of the field? There is the differential form of Ampere's law that states: $$ \nabla \times \vec{H} = \vec{J} $$ Where $J$ is the current density (and magnetisation is zero).
As an example, I tried computing the magnetic field around an infinite wire with a constant and uniform current. I found that $||\vec{H}||=\frac{I}{2\pi r}$ where $r$ is the distance from the wire, but I am struggling to find the direction. I know of the right hand rule, but I would like to try arriving at the result analytically.
Unfortunately, the curl of a vector field is not one-to-one, so there exists no inverse of the curl. Another identity that popped into mind was: $$ \nabla \times (\nabla \times \vec{H}) = \nabla(\nabla\cdot \vec{H})-\nabla^2\vec{H} $$ The curl of a constant is the zero vector, so if $\vec{H}$ is source free, we could obtain two equations: $$ -\nabla^2 \vec{H} = 0 $$ I am not, however, sure whether this is the case. Is it a rule that magnetic fields have to be source free? If so, then is there an explanation of this?
Is there any way to analytically determine the direction of a magnetic field, or is it only determined empirically?
Apparently, the argument that $\vec{H}$ is constant along the chosen path already implies symmetry, which implies that the field is a spin field. Why is a spin field symmetric though? What is meant by symmetric? It doesn't occur to me why outward fields are not considered symmetric in this context.