Solution (source code)

= Solution

Start from a gauge-invariant <Ginzburg-Landau theory of superconductivity> gradient energy $|(-i\hbar\nabla-q\mathbf A)\psi|^2/(2m)$, with $\psi$ the coherent pair <order parameter> and $q$ its charge. Varying the <free energy> with respect to $\mathbf A$ gives the <current density> displayed in the source. Write $\psi=\sqrt{n_s}e^{i\theta}$ to obtain
$$
\boxed{\mathbf J=\frac{q\hbar}{m}n_s\left(\nabla\theta-\frac q\hbar\mathbf A\right).}
$$
Single-valuedness around a loop in superconducting material requires $\oint\nabla\theta\cdot d\mathbf l=2\pi n$. Integrating the current relation therefore gives the exact <fluxoid> condition
$$
\boxed{\Phi+\frac m{q^2}\oint\frac{\mathbf J}{n_s}\cdot d\mathbf l
=n\frac hq.}
$$
For a thick ring choose the contour sufficiently deep in the material that the current term is negligible. Then flux itself is approximately quantized, with positive quantum
$$
\boxed{\Phi=n\Phi_0,\qquad\Phi_0=\frac h{|q|}=\frac h{2e}\simeq2.068\times10^{-15}\ \mathrm{Wb}.}
$$
The sign of the pair charge is absorbed into the orientation of $n$. In a thin ring with appreciable <kinetic inductance>, it is the <fluxoid>, not exactly the geometrical flux alone, that remains quantized. A state with nonzero phase-gradient current is a concrete counterexample to dropping the current integral without justification. The flux-only identity thus uses the ordinary thick-ring or negligible-kinetic-inductance limit in addition to phase single-valuedness.