  Context: Solar magnetic fields are regularly extrapolated into the corona
starting from photospheric magnetic measurements that can suffer from
significant uncertainties. Aims: Here we study how inaccuracies introduced into
the maps of the photospheric magnetic vector from the inversion of ideal and
noisy Stokes parameters influence the extrapolation of nonlinear force-free
magnetic fields. Methods: We compute nonlinear force-free magnetic fields based
on simulated vector magnetograms, which have been produced by the inversion of
Stokes profiles, computed froma 3-D radiation MHD simulation snapshot. These
extrapolations are compared with extrapolations starting directly from the
field in the MHD simulations, which is our reference. We investigate how line
formation and instrumental effects such as noise, limited spatial resolution
and the effect of employing a filter instrument influence the resulting
magnetic field structure. The comparison is done qualitatively by visual
inspection of the magnetic field distribution and quantitatively by different
metrics. Results: The reconstructed field is most accurate if ideal Stokes data
are inverted and becomes less accurate if instrumental effects and noise are
included. The results demonstrate that the non-linear force-free field
extrapolation method tested here is relatively insensitive to the effects of
noise in measured polarization spectra at levels consistent with present-day
instruments. Conclusions heading: Our results show that we can reconstruct the
coronal magnetic field as a nonlinear force-free field from realistic
photospheric measurements with an accuracy of a few percent, at least in the
absence of sunspots.
