Classically, if the magnetic moment of a particle is aligned with a time-varying magnetic field, can its spin flip? Consider the time-varying magnetic field:
$$
\mathbf{B}=B \tanh{\Big(\frac{t}{\tau}\Big)}\hat{\mathbf{z}}.
$$
If the magnetic moment (which is proportional to the angular momentum) of a particle at $t=-\infty$ is in the $\hat{\mathbf{z}}$-direction, will it change as soon as the direction of $\mathbf{B}$ flips from $-\hat{\mathbf{z}}$ to $\hat{\mathbf{z}}$ at $t=0$?
With the potential energy of the particle being $U=-\vec{\mu}\cdot\mathbf{B}$, it seems to me as if the moment, so as to minimize $U$, would change its direction with time to align with $\mathbf{B}$, but this seems to violate the principle of angular momentum conservation.
How can these two ways of thinking about angular momentum in this context be made consistent with one another?
 A: Note that the potential energy $U=-\vec{\mu}\cdot\mathbf{B}=-\mu B\cos\theta$ has two equilibria, for $\theta=0$ (dipole and field aligned) and for $\theta=\pi$ (dipole and field antialigned). The equilibrium at $\theta=0$ is stable, while the equilibrium at $\theta=\pi$ is unstable. If the situation happens exactly as you describe (the external field is always precisely in the $\hat{z}$-direction, and the dipole is precisely aligned with the $\hat{z}$-direction), then there will never be any torque on the dipole, since the system jumped from one equilibrium to the other (from a stable equilibrium to an unstable equilibrium), so the dipole will not flip. But for $t>0$ (i.e. when the dipole and field are anti-aligned), if there is any perturbation of either the external field or the dipole, then the system will deviate from this unstable equilibrium and settle into the stable one. In other words, the dipole will flip if anything is perturbed even slightly, meaning that in any realistic situation, the dipole will flip for $t>0$.
Angular momentum of the dipole is not conserved when it flips because there is a torque being exerted on the dipole, namely from the external magnetic field. But of course, for the system consisting of the dipole and the external field, angular momentum is conserved. This means that when the dipole flips, there is a transfer of angular momentum between the dipole and the external field. This transfer is accomplished by the electromagnetic radiation that results from the dipole's rotation.
