  The minimum-energy configuration for the magnetic field above the solar
photosphere is curl-free (hence, by Ampere's law, also current-free), so can be
represented as the gradient of a scalar potential. Since magnetic fields are
divergence free, this scalar potential obeys Laplace's equation, given an
appropriate boundary condition (BC). With measurements of the full magnetic
vector at the photosphere, it is possible to employ either Neumann or Dirichlet
BCs there. Historically, the Neumann BC was used with available line-of-sight
magnetic field measurements, which approximate the radial field needed for the
Neumann BC. Since each BC fully determines the 3D vector magnetic field, either
choice will, in general, be inconsistent with some aspect of the observed field
on the boundary, due to the presence of both currents and noise in the observed
field. We present a method to combine solutions from both Dirichlet and Neumann
BCs to determine a hybrid, "least-squares" potential field, which minimizes the
integrated square of the residual between the potential and actual fields. This
has advantages in both not overfitting the radial field used for the Neumann
BC, and maximizing consistency with the observations. We demonstrate our
methods with SDO/HMI vector magnetic field observations of AR 11158, and find
that residual discrepancies between the observed and potential fields are
significant, and are consistent with nonzero horizontal photospheric currents.
We also analyze potential fields for two other active regions observed with two
different vector magnetographs, and find that hybrid potential fields have
significantly less energy than the Neumann fields in every case --- by more
than 10^(32) erg in some cases. This has major implications for estimates of
free magnetic energy in coronal field models, e.g., non-linear force-free field
extrapolations.
