Advancing Solar Magnetic Field Extrapolations through Multiheight Magnetic Field Measurements

Nonlinear force-free extrapolations are a common approach to estimate the 3D topology of coronal magnetic fields based on photospheric vector magnetograms. The force-free assumption is a valid approximation at coronal heights, but for the dense plasma conditions in the lower atmosphere, this assumption is not satisfied. In this study, we utilize multiheight magnetic field measurements in combination with physics-informed neural networks to advance solar magnetic field extrapolations. We include a flexible height-mapping, which allows us to account for the different formation heights of the observed magnetic field measurements. The comparison to analytical and simulated magnetic fields demonstrates that including chromospheric magnetic field measurements leads to a significant improvement of our magnetic field extrapolations. We also apply our method to chromospheric line-of-sight magnetograms from the Vector Spectromagnetograph (VSM) on the Synoptic Optical Long-term Investigations of the Sun (SOLIS) observatory, in combination with photospheric vector magnetograms from the Helioseismic Magnetic Imager (HMI) on board the Solar Dynamics Observatory (SDO). The comparison to observations in extreme-ultraviolet wavelengths shows that the additional chromospheric information leads to a better agreement with the observed coronal structures. In addition, our method intrinsically provides an estimate of the corrugation of the observed magnetograms. With this new approach, we make efficient use of multiheight magnetic field measurements and advance the realism of coronal magnetic field simulations.


INTRODUCTION
The magnetic field of the Sun is primarily observed from spectral lines that originate low in the solar atmosphere.To obtain a better understanding of the build-up and release of magnetic energy in the solar atmosphere, a full 3D understanding of the magnetic field topology is required (Green et al. 2018;Wiegelmann et al. 2017).A frequently applied approach are non-linear force-free (NLFF) magnetic field extrapolations, where the photospheric vector magnetogram is used as boundary condition and plasma density is assumed to be negligible (Wiegelmann & Sakurai 2021).This requires solving a system of coupled partial differential equations in the form of the divergence-free equation and the force-free equation where ⃗ B refers to the magnetic field vector and ⃗ J to the electric current density.The force-free model builds on the assumption that the plasma density is low, and therefore the ratio of plasma pressure and magnetic pressure is small (plasma beta β plasma ≪ 1), which is not satisfied in the solar photosphere but which can be validly assumed for heights of ∼400 km and above (Metcalf et al. 1995).Commonly relying on regularly performed photospheric vector magnetic field measurements as an input, extrapolations therefore deal with an inherently ill-posed problem, where a certain adjustment of the photospheric vector field prior to the supply as an input to the extrapolation or during relaxation were shown to obtain solutions of improved quality (see Wiegelmann et al. 2006;Wiegelmann & Inhester 2010).
In Jarolim et al. (2023) a physics-informed neural network (PINN) was used to intrinsically find a trade-off between the aforementioned physical model constraints and the observed magnetogram, where the obtained NLFF models adhere to a similar degree of quality and realism.This property is enabled by the ability of PINNs to smoothly integrate noisy data and incomplete physical models (Raissi et al. 2019;Karniadakis et al. 2021).
In this study, we propose a novel approach based on PINNs that in addition incorporates also magnetic field measurements at multiple optical depths τ (e.g., chromospheric measurements), in order to achieve more realistic coronal magnetic field extrapolations.Here, we assume that the force-free assumption is applicable in the solar chromosphere and that the additional observational constraint, in the form of an internal condition, can achieve a more realistic field estimate of the solar corona.For observations from upper atmospheric layers (lower optical depth τ ), we expect a stronger variation in the height of formation of the line.Consequently, the magnetic field observations do not correspond to a geometrically flat surface of the solar atmosphere, but are corrugated surfaces, that can span multiple Mm (Carson 1976;Quintero Noda et al. 2023).To account for this, we include in our study a height mapping module that allows our neural network to dynamically adjust the estimated local (i.e., pixel-wise) geometrical height of the observed magnetic field to be consistent with the extrapolated field.In the same way, our method adjusts the extrapolated field to be compatible with the observations.In addition to the improved magnetic field extrapolation, this approach allows us to extract also the geometrical height variation of the observed magnetic field from the model.
Magnetic field extrapolations are typically performed using photospheric magnetograms (e.g., Wiegelmann & Inhester 2010;Wheatland & Leka 2011).In Yelles Chaouche et al. (2012), chromospheric slices were used for magnetic field extrapolations.In Vissers et al. (2022), the similarity between the chromospheric magnetic field, inferred from observations, and the field obtained from a magnetohydrostatic extrapolation are compared.In this study, we consistently incorporate both photospheric and chromospheric magnetic field observations in our non-linear force-free model.
We demonstrate the advantage of our approach by applying our method to a semi-analytical magnetic field (Sect.3.1), and to a realistic solar magnetic field simulation (MURaM; Sect.3.2).Both test cases provide a ground-truth reference to evaluate the performance of our method.In Sect.3.3, we apply our method to chromospheric observations from SOLIS/VSM in combination with photospheric magnetograms from SDO/HMI.

METHOD
In this study, we follow the approach from Jarolim et al. (2023) for coronal magnetic field extrapolations.We use a neural network as a mesh-free representation of the simulation volume, mapping coordinate points (x, y, z) to the respective magnetic field vector (B x , B y , B z ).Since neural networks are fully-differentiable, we can compute smooth derivatives of the output magnetic field vectors with respect to the input coordinates (e.g., ∂B x /∂x, ∂B x /∂y).These are then used to construct the divergence-free and force-free equations.This provides the physical loss terms for our model optimization, starting with the force-free loss and the divergence-free loss Here, ⃗ B ≡ ⃗ B(x, y, z) refers to the neural network representation of the magnetic field vector at a given point (x, y, z) and ϵ = 10 −6 is added for numerical stability.
In addition, we optimize our neural network to reconstruct a magnetic field ⃗ B that matches the boundary and internal conditions ⃗ B τ (x, y), where ⃗ B τ refers to an observed magnetogram at the optical depth τ .We optimize for this condition by sampling coordinates from the vector magnetogram and minimizing the component-wise distance between the observed ⃗ B τ and modeled ⃗ B magnetogram at the same position.The loss term is then given by In this study, we add multiple height surfaces to our extrapolation.We account for this by adding a height-mapping module that maps coordinate points (x, y, z) to a new height surface (x, y, z ′ ) (only the vertical coordinate is updated).Here, z is a constant average geometrical height, estimated for each τ surface and remapped in dependence of the spatial location z ′ (x, y, z).The resulting mapped coordinate points and randomly sampled points are then used as input to the same PINN as for the regular extrapolation (see Fig. 1).This enables us to intrinsically model the corrugation of the observed magnetograms at constant optical depths τ as part of the optimization procedure.For our initial coordinates, we estimate the average line-formation height z.
For the optimization, the model is iteratively updated by randomly sampling points from the simulation volume and from the boundary and internal conditions.We emphasize that this approach solves a single simulation and does not rely on an underlying ground-truth data set.The application to a new active region requires a re-training of the model.
For our neural networks, we use the SInusoidal REpresentation Networks (SIREN) architecture from Sitzmann et al. (2020), analogously to Jarolim et al. (2023).For the height mapping and PINN model, we use 4 and 8 hidden layers respectively.Each layer consists for 256 neurons.For a comparison of different model architectures see Jarolim et al. (2023).For the height-mapping model, we use a positional encoding of the input coordinates (Mildenhall et al. 2020).As output, we use a sigmoid function and scale the predicted coordinate to the specified height range (such that

Regularization
We include two additional regularization terms into our model optimization.We compute the height regularization where ∆z corresponds to the height range (z ′ max − z ′ min ) and ϵ = 10 −6 is added for numerical stability.With this, we prefer mappings that are close to the estimated height.
We introduce a regularization for missing components (e.g., the missing horizontal vector components), by optimizing for minimum energy solutions.We use where B NaN refers to the unspecified components (NaN values).With this, we prevent unrealistic strong magnetic fields of undefined field components.The combined loss is then computed by the weighted sum of the individual terms For all our experiments we set λ ff = λ div = 0.1, and use a scheduled weight for λ B , where we exponentially decay from 1000 to 1 over 10 5 iterations (for a detailed parameter discussion see Jarolim et al. 2023).For our regularization we set λ h = 10 −3 and λ NaN = 10 −2 .For all our experiments we start from a randomly initialize neural network and train our model iteratively, where we sample 10 4 coordinate points from the boundary condition and 2 × 10 4 coordinate points randomly and continuously from the simulation volume.The loss per update step is averaged over the full batch.L B , L h , and L NaN are computed over the sampled boundary and internal conditions, while L div and L ff are computed over all sampled points.For our extrapolations we use 2 × 10 5 iterations.The analytical magnetic field solutions in Sect.3.1 are trained for 10 5 iterations.We use the Adam optimizer (Kingma & Ba 2014) with beta β Adam of (0.9, 0.999), and exponentially schedule the learning rate from 5 × 10 −4 to 5 × 10 −5 over the full length of the training.
After model training, we obtain the extrapolated magnetic field by sampling the magnetic field vectors at each grid cell in our simulation volume, using the spatial resolution of the boundary condition.The resulting data cube is then used for further evaluation, where we use finite-differences to compute derivatives of the magnetic field (e.g., divergence, current density).

Data
For the verification of our method, we consider two data sets that provide a ground-truth reference.We use a semi-analytical magnetic field solution to estimate the models ability to extrapolate smooth force-free fields in an ideal setting (Sect.2.2.1).We further use a snapshot from a MHD simulation, which does not satisfy the force-free assumption.Therefore, this data set provides a more realistic estimation of the model performance for the application to observational data (Sect.2.2.2).For the application to observational data, we use photospheric and chromospheric magnetograms (Sect.2.2.3).For the comparison with potential magnetic fields, we compute the solution using the Green's function approach as proposed by Sakurai (1982).This simpler model assumes a current-free field and serves as additional baseline.

Semi-analytical field
We apply our method to extracted slices from the "Low and Lou" model (Low & Lou 1990).This magnetic field model is analytical except for the numerical solution of an ordinary differential equation in spherical coordinates with eigenvalues m and n.The obtained fields are axisymmetric, but by rotating the symmetry axis by a rotation angle Φ and placing the singularity at a depth l below the photosphere, we can mimic coronal fields that are useful for assessing the performance of NLFF models for the case of large-scale smooth currents distributed in the entire test volume (Wiegelmann & Sakurai 2021;Schrijver et al. 2006;Wheatland et al. 2000).Here we use the Case I configuration from Schrijver et al. (2006), where six different state-of-the-art NLFF methods for 3D coronal field extrapolation have been systematically compared.The configuration uses n = 1, m = 1, l = 0.3 and Φ = π/4, in a volume spanning 64 3 grid points.

MURaM snapshot
We use a realistic simulation of the solar magnetic field from the MPS/University of Chicago Radiative MHD code (MURaM: Vögler et al. 2005;Rempel 2017).The setup simulates the emergence of a kink-unstable twisted bipole in a domain of 98.304 Mm horizontal and 82.944 Mm vertical extent.The photosphere is located about 7.8 Mm above the bottom boundary.The simulation has a resolution of 0.192 Mm per pixel in the horizontal dimensions and 0.064 Mm per pixel for the vertical dimension.For our application we reduce the resolution of all dimensions to 0.384 Mm per pixel (binning by a factor of 2 and 6 for the horizontal and vertical axis, respectively), similar to the HMI resolution of 0.36 Mm per pixel.The snapshot we use as reference in this investigation is the same as used in Judge et al. (2021) to highlight the chromospheric corrugation and diagnostic potential of several chromspheric lines in the near UV (see, Figure 2 in Judge et al. 2021).
We extract magnetic field layers at Rosseland optical depths τ = {10 −6 , 10 −5 , 10 −4 , 10 −3 , 10 −2 , 10 −1 }, by using the optical depth scale of a vertical ray computed with Rosseland mean opacities.We compute the optical depth τ at each point in the simulation volume (x, y, z) according to where z refers to the geometrical height, z top to the top of the simulation volume (∼75 Mm above the photosphere), κ to the opacity, and ρ to the plasma density, which are taken from the MURaM simulation.We select surfaces of constant τ , where we compute the geometrical height z and select the magnetic field vector at the corresponding points.The extracted height surfaces serve as reference for the evaluation of the height mapping module, while the magnetic field is used as input to our model.The optical depth range corresponds to the height from the photosphere to upper chromosphere.Note that the extracted magnetic fields correspond to a thin layer, resembling optically-thick spectral lines.Since this simulation describes active flux emergence, the deformation of the higher chromospheric τ surfaces is considerable and exceeds 10 Mm for τ = 10 −6 .This example was specifically chosen to estimate the model performance for a broad range of corrugations.The extracted τ surfaces and magnetic fields are shown in Fig. 3.

Observations
To test the method on real solar observations, we use cotemporal synoptic chromospheric line-ofsight magnetic fields from the Vector Spectromagnetograph (VSM) on the Synoptic Optical Longterm Investigations of the Sun (SOLIS: Keller et al. 2003) and photospheric magnetic vector data from the Helioseismic Magnetic Imager (HMI: Schou et al. 2012) onboard the Solar Dynamic Observatory (SDO; Pesnell et al. 2012) spacecraft.SOLIS/VSM provides full-disk chromospheric magnetic field estimates inferred from the polarization signatures of the chromospheric Ca II 854.2 nm line.In particular, SOLIS/VSM provides line-of-sight magnetic field strength calculated with the weak field approximation applied to the chromospheric core of the Ca II 854.2 nm line.We note that VSM also provides photospheric data, but the corresponding photospheric magnetogram is recorded with a delay of one hour.Therefore, we use a combination of chromospheric VSM and photospheric HMI data, to ensure the best temporal alignment.
We chose observations of NOAA AR 11166 on from 2011 March 9 as the example case for this study, due to its proximity to disc center and the favorable observing conditions at the SOLIS observing site.We use the SOLIS/VSM Ca II 854.2 nm dataset taken at 16:33 UT and the corresponding 16:36 UT dataset from the SHARPs (Bobra et al. 2014) AR HMI catalogue.We reproject the helioprojective SOLIS/VSM data to the CEA projection of the SHARPs dataset using the SunPy library (Barnes et al. 2020).

Metrics
For the quantitative evaluation we use the metrics from Schrijver et al. (2006).We denote the magnetic field vectors at point i as ⃗ B ref,i and ⃗ B ext,i for the reference solution and the extrapolated magnetic field respectively.The vector correlation coefficient (C vec ) compares the local characteristics of the magnetic field vectors The metric gives 0 for no correlation (perpendicular vectors) and 1 for identical vectors.The second metric measures the angle between the magnetic field solutions based on the Cauchy-Schwarz inequality (cosine similarity index) where M refers to the total number of grid points in the volume.C CS ranges from -1 (anti-parallel vectors) to 1 (parallel vectors), with a value of 0 indicating perpendicular vectors.To measure the difference between vectors, we compute the mean error normalized by the average vector norm and the mean error normalized per vector Here, the best performance is achieved when , such that the best attainable performance corresponds to 1, to allow for an easier comparison with the previous metrics.
We further compare the global magnetic field, where we compute the modeled magnetic energy relative to the reference magnetic energy where the best performance equals to 1. Values ε > 1 and ε < 1 correspond to an over-or underestimation, respectively.
To quantify the divergence-freeness of the magnetic field ⃗ B, we compute the normalized divergence To quantify the force-freeness of the magnetic field, we use the current weighted average sine of the the angle between the magnetic field and its current density vector (c.f., Schrijver et al. 2006):

Magnetic mapping and twist
In order to characterize the differences in magnetic connectivity in the NLFF modeling based solely on photospheric magnetic field information and including in addition magnetic information at a chromospheric level, we employ two measures that are based on magnetic field lines traced within the NLFF models, via the application of the fourth-order Runge-Kutta method described in (Liu et al. 2016).
First, in order to pin down regions of strong connectivity gradients, we compute the squashing factor Q. Therefore, we characterize the mapping of elementary flux tubes (approximated by point-wise traced magnetic field lines in the NLFF models), using the Jacobian matrix associated to the mapping of the two footpoints of a field line (elementary flux tube) 12 : ⃗ r 1 (x 1 , y 1 ) → ⃗ r 2 (x 2 , y 2 ).Then, following Titov et al. (2002), the squashing factor is defined as where B n,1 (y 1 , y 1 ) and B n,2 (x 2 , y 2 ) are the magnetic field components normal to the plane of the footpoints (the lower boundary in our case), and their ratio is equivalent to the determinant of D 12 .Second, in order to indicate how many turns two (presuming infinitesimally closed) field lines wind about each other, we compute the twist number (Berger & Prior 2006) where the integrand can be regarded as a local twist density along of a field line.If ⃗ ∇ × ⃗ B = α ⃗ B, with α being the force-free parameter (constant along of each individual field line in the case of a perfectly force-free field), then T w = 1 4π L α dl.The twist number distribution in a vertical plane in the model volume is achieved by assigning the twist number of each field line to the position where this field line threads the plane.

RESULTS
To assess the validity of our approach, we consider three evaluation schemes.(1) We use a semianalytical magnetic field solution ⃗ B ref from which we extract geometrical slices z ref and generate artificially corrugated slices τ ref (to mimic constant τ surfaces).Here we consider the ideal case of a force-free magnetic field (Sect.3.1).(2) We extract reference magnetic fields ⃗ B ref at constant τ ref from a MURaM simulation snapshot.In this case, we are dealing with a realistic magnetic field that is not force-free and where the corrugation is computed based on the simulated optical depth τ (Sect.3.2).(3) We utilize observational data of AR 11166 (SHARP 401) from SOLIS in conjunction with SDO/HMI vector magnetograms to estimate both the topology and height of formation of the magnetic field.We compare our magnetic field extrapolation ⃗ B ext to EUV observations in order to assess the realism of the extrapolated magnetic field topology (Sect.3.3).

Evaluation with analytical fields
We use the semi-analytical field ⃗ B ref described in Sect.2.2.1 and consider four principal configurations for our extrapolations (Table 1).For all configurations we normalize the magnetic field strength to 300 Gauss and the spatial scaling to 64 pixels.First, we perform a standard extrapolation that uses only the bottom boundary as an input.The upper boundaries are either taken from a potential-field solution or from the semi-analytical field.Note that the boundary and internal conditions are not strictly enforced and are dynamically adjusted throughout the model training.
For the remaining configurations we impose no side-boundaries.Therefore, L B is computed based on the bottom and internal boundary conditions (Eq.5), while the remaining volume, including the lateral and top boundaries, is determined by minimizing the force-free condition at randomly sampled points within the simulations volume (Eqs.3 and 4).In other words, the lateral boundaries are not fixed during training but are solely determined by the physical equations.For the second configuration, we extract geometrical slices at the boundary and within the simulation volume which spans a height of 64 pixels.We extract geometrical slices at heights z ref = {0, 8, 16, 32} pixels and compare extrapolations ⃗ B ext that use a combination of two to four slices.For the second configuration, we extract geometrical slices from the simulation volume, which spans 64 pixels in height, starting at the lower boundary z ref = 0 pixels and at increasing heights within the volume z ref = {8, 16, 32} pixels.We compare extrapolations ⃗ B ext that use a combination of the boundary condition and one to three internal conditions.
For the third configuration, we use artificial τ surfaces instead of constant geometrical height surfaces.More specifically, we generate corrugated magnetograms by extracting magnetic field values at locations (x, y, z ref ) where z ref is taken from a 2D normal distribution where x and y ranges between [−32, 32] pixels (i.e., the horizontal limits of the volume), h is the constant geometrical height that ranges between [0, 64] pixels, and the width σ varies according to We extract corrugated magnetograms at heights h = {0, 8, 16, 32} pixels.For the slice at h = 0, we use no corrugation (i.e., we use a geometrical slice as the lower boundary).For the input of our height mapping module, we set the initial heights z to half of the maximum and the range between 0 and the maximum value.We found that for this ideal setting, height regularization is not necessary and we set λ h = 0.
For the fourth configuration, we utilize the τ surfaces from the third configuration, but only extract the vertical component of the magnetic field (B ref,z ) for the internal conditions.In other words, we use the full vector information at the lower boundary and only the vertical component for the corrugated surfaces.
Table 1 summarizes our results.For the first configuration, it can be seen that we achieve a nearly identical magnetic field solution for the extrapolation that uses the full boundary conditions.In contrast, the usage of a potential field approximation leads to a lower performance than the open configuration.This suggest that a wrong upper-boundary condition can strongly affect the result.We note that we consider here a magnetic field that is largely dominated by the lower-boundary condition, while a potential field approximation becomes more important when dealing with larger domains that deviate from the force-free assumption (see e.g.Sect.3.2).
The second configuration reveals that additional information from geometrical slices leads to a constant improvement over the open configuration, achieving the best results with a maximum number of four slices, that even exceed the configuration where all side-boundaries are specified (full).From the comparison of {0, 16} and {0, 8, 16}, as well as {0, 32} and {0, 8, 16, 32}, we can see that introducing intermediate layers provides only a marginal or no improvement.On the other hand, introducing slices at greater heights (e.g., 32), largely improves the extrapolations.From the analysis of the corrugated surfaces in the third configuration, it can be seen that our height mapping model can properly frame the magnetic field measurements into the extrapolation, where we only note a marginal quality drop.A notable performance decrease occurs when we only consider the vertical component of the corrugated surfaces (fourth configuration).Here, the resulting extrapolation performs throughout worse than the equivalent height surfaces that use the full vector magnetograms.However, the additional height information still provides an improvement over the single-height extrapolation.
The comparison of the height differences (∆h = |z ′ (x, y, z) − z ref (x, y, h)|), shows that our mapping model deviates from the ground-truth corrugation by about 1% and between 1 − 2% for the case of missing horizontal components., 8, 16, 32} pixels. (12-14): Same as for 9-11, but using only the vertical magnetic field component for the upper τ surfaces.We compare the vector correlation (C vec ), angular difference (C CS ), the complement of the normalized vector error (E ′ n = 1−E n ), the complement of the mean vector error (E ′ m = 1−E m ), relative total magnetic energy (ε), the current-weighted average of the sine of the angle between the magnetic field and electric current density (σ J ), the normalized divergence L n,div in pixels −1 , and the distance ∆h (in pixels and in percentage) between the reference heights z ref and the inferred heights z ′ .

Evaluation with MURaM τ surfaces
mapping model throughout outperforms the potential field approximation and the photospheric magnetic field extrapolations.For the single-height extrapolation the potential field boundary leads to a clear improvement, indicating that for a more complex magnetic field and a larger simulation volume, the potential field boundary is more favorable.For the individual configurations the performance is increasing with the inputs that are provided, where we achieve the best performance when using all available τ surfaces.We note that the realistic configuration with two layers largely outperforms single-height extrapolations when the full set of vector components is provided.When considering only the line-of-sight component of the chromospheric magnetic field B ref,z (τ = 10 −5 ) the improvement is minor.The additional horizontal field (Realistic split) leads to a clear improvement over the baseline extrapolations, but provides a slightly lower performance than the configuration with the spatially aligned vector magnetic field (Realistic vector).The metrics for divergence-freeness (L n,div ) and force-freeness (σ J ) show that our extrapolations are consistent with the force-free model.Specifically, the divergence deviation is in the same range as for the potential field.We note that the MURaM reference is computed analogously, while the simulation is performed with a different stencil, which results in the larger divergence L n,div .
To better understand the advantage that we obtain from the multi-height measurements we plot the metrics in dependence of height (Fig. 2).The extrapolations from photospheric vector magnetograms quickly deviate from the reference field with increasing height.The use the multi-height measurements (fixed and mapped heights), show throughout an improvement in height and show even at greater heights (> 10 Mm) a good agreement with the reference field.In particular, above 20 Mm the ratio of modeled and reference magnetic energy ε is close to 1, indicating a more consistent approximation of the energy that is stored in the coronal magnetic field.Surprisingly, by only adding the τ = 10 −5 magnetic field, we achieve an almost equal performance.In contrast, the reduced line-of-sight information only leads to a small performance increase, particularly at lower heights (≈ 2 Mm).The benefit from the full set of τ surfaces can be best seen from the relative total magnetic energy ε low in the solar atmosphere (≈ 1 Mm), where the additional magnetic field information prevents the initial underestimation of the photospheric magnetic field, which occurs due to the adjustment to the force-free condition in this layer (see σ J in Fig. 2c).The overestimation of the magnetic energy at greater heights can be related to the increased uncertainties in the regime of weak magnetic fields.The comparison to the baseline potential field shows that this simple model is largely outperformed by the NLFF approach.
In Table 3 we summarize the results of the height differences.The use of the height mapping model leads to an overall improvement over the use of fixed heights.The comparison of the height differences of the corrugated surfaces shows that the height mapping in the lower atmospheric layers does not improve over the simple assumption of the average height.We associate this with the stronger deviation from the force-free assumption in the lower atmospheric layers.In Fig. 2c, the force-freeness and divergence-freeness is plotted as a function of height.This shows that the largest deviation from the force-free assumption occurs in the first few Mm of the reference magnetic field from MURaM and is similarly reflected by our extrapolations.This suggests that for photospheric heights the magnetic field data does not profit from a remapping.The realistic configurations with a single τ layer show a large difference in height, which is related to the approximated initial height, which is computed from the ground-truth for the idealized configurations (Fixed Heights, Mapped Heights).Fig. 3 compares the inferred geometrical height maps associated with constant τ surfaces to the MURaM ground truth z ref (x, y, τ ).The model provides a realistic estimation of the height of formation of the magnetograms ⃗ B ref (τ ), and their overall structure is well approximated.The best results are achieved at greater heights, where we expect low plasma density conditions (i.e., solar corona).For τ ≥ 10 −3 , sunspots are correctly mapped close to the bottom boundary of the simulation volume, but small-scale height fluctuations are not properly captured.This can be also seen from the 2D histograms, where quiet Sun regions are mostly mapped to constant heights and with increasing extent in height the distributions follow the ideal correlation (red line).(1) MURaM: Assessment of the force-freeness and divergence-freeness of the reference magnetic field.(2 -4): Baseline (single-height) methods for comparison.
(5 -6): comparison of mapped and fixed heights, where we consider all six magnetograms as input to our model.(7 -9): realistic setting with a photospheric and chromospheric magnetogram (τ = {10 −1 , 10 −5 }).For B ref (τ = 10 −5 ) we consider a configuration with the full vector components and a configuration with the vertical component (B ref,z ) only.For 8 we also consider the horizontal vector magnetic field of B ref (τ = 10 −4 ) in addition to the vertical component B ref,z (τ = 10 −5 ).We compare the vector correlation (C vec ), angular difference (C CS ), the complement of the normalized vector error (E ′ n = 1 − E n ), the complement of the mean vector error (E ′ m = 1 − E m ), relative total magnetic energy (ε), the current-weighted average of the sine of the angle between the magnetic field and electric current density (σ J ), and the normalized divergence L n,div . Method

Application to SOLIS data
Based on our previous evaluation using the MURaM simulation, we assume that incorporating multi-height information (e.g., slices from the chromosphere) increases the level of realism of our magnetic field extrapolations, even for fields that do not satisfy the force-free assumption.Here we use the LOS magnetic field observations from SOLIS/VSM introduced in Sect.2.2.3.As can be seen from our evaluation in Sect.3.2, the height mapping at photospheric heights has limited application.Therefore we assume no vertical extend of the bottom boundary condition (i.e., photospheric vector magnetogram).For the internal condition from SOLIS (i.e., chromospheric line-of-sight magnetogram), we assume an initial formation height of z = 2 Mm (5.56 pixels), according to the estimated formation height of Ca II 854.2 nm (de la Cruz Rodríguez & van Noort 2017).We set the height range of z ′ to [0, 10] Mm ([0, 27.78] pixels), similar to the height ranges computed from the , but for the realistic configurations (Realistic vector, Realistic split, and Realistic LOS).The best value of all performance metrics is 1. c) Evaluation of the forcefreeness (σ J ) and divergence-freeness (L n,div ) of the extrapolated and reference magnetic fields as function of geometrical height.The best value of both metrics is 0. We compare the reference magnetic field (MURaM), and our single-height (Extrapolation, and Extrapolation -PF) and multi-height extrapolations (Fixed Height, Mapped Heights, Realistic vector, Realistic split, and Realistic LOS).Note that the value range in all plots is adjusted to enhance the visibility of differences among the extrapolation methods.Table 3.Comparison of height maps from MURaM τ surfaces to estimated height maps.We compare the deviation from the reference height maps (∆h) in pixels and in percent for fixed heights, mapped heights, and in the realistic setting with two τ surfaces, where we consider configurations with the full vector components, split vertical and horizontal components, and only the line-of-sight component.
In Fig. 4 we show the result of our multi-height extrapolation in comparison to a photospheric magnetic field extrapolation.Panel a shows the corresponding EUV observation of the SDO/AIA 171 Å filter (Lemen et al. 2012) and Hα filtergram from the Kanzelhöhe Solar Observatory (KSO; Pötzi et al. 2021), where we note the central elongated flux rope.From the extrapolations we extract field-line plots for comparison of the magnetic topology.Here, we extract field-lines at the same origin, indicated by the pink arrows (close to the supposed footpoint of the central filament).The comparison of the magnetic field topologies shows that the multi-height magnetic field measurement leads to a large difference in magnetic field configuration.For the multi-height extrapolation the magnetic flux shows a much higher twist (increased current density) and is strongly elongated.The single-height extrapolation recovers only a slightly twisted magnetic field and connects polarities already low in the solar atmosphere.We extract additional field lines, indicated by the blue arrow, to identify the flux rope, which does not connect to the strong polarities at the center of the active region.In panel c, we show a vertical slice of the squashing factor Q and the twist number T w for both extrapolations.This additionally confirms that the multi-height extrapolation recovers a larger twist and a higher flux rope.
The estimated height map in panel a shows that the magnetic field close to the filament is at large heights (>10 Mm), which seems also indicated by the AIA observations.The strong magnetic field of the sunspots is mapped low in the solar atmosphere, in agreement with our results from Sect.3.2.The height map shows artifacts north of strong magnetic polarities.These features are not present in our application to the MURaM simulation and are likely associated to the insufficient treatment of the line-of-sight component.

DISCUSSION
In Fig. 2 we show the different quality metrics from Table 2 as function of height.Our height mapping module achieves for all heights the best agreement with the reference magnetic field data.The relative total magnetic energy ε emphasizes that the multi-height magnetic field strongly improves the estimated energy distribution in height.In contrast, the single-height extrapolation and the potential field show strong deviations at higher atmospheric layers (> 5 Mm).The additional magnetic field layers lead to only minor improvements (i.e., Multi Height vs Realistic), while the additional information of the horizontal components has a larger impact on the resulting magnetic field (comparison of Realistic vector, Realistic split, and Realistic LOS).
The evaluation of our method shows the importance of additional multi-height information for the coronal magnetic field extrapolations.Our experiments demonstrate that additional information provides for a more consistent magnetic energy distribution and a more realistic approximation of coronal magnetic fields, and that even one additional observational layer can drastically improve the outcome.
The comparison to the semi-analytical magnetic field solution shows that especially higher layers can improve the extrapolation (e.g., improvement of E ′ m from 0.71 to 0.98) and achieve results equivalent to the full boundary information.The height mapping model shows a consistent treatment of corrugation, where our method achieves an equivalent performance to geometrical slices.Furthermore, this allows us to estimate the corrugation of the surfaces, where errors are in the range of 1%.The reduced information of only vertical magnetic field components leads to a quality decrease, but exceeds in every case the extrapolation from a single layer.
With the application to the MURaM snapshot we evaluate our method in a realistic setting of a non force-free field, and a realistic corrugation that is computed from the simulated radiation field.The extracted τ surfaces exhibiting a wide spectrum of corrugations, spanning from less than 1 Mm to exceeding 10 Mm, thus serving as a comprehensive and rigorous test scenario.The evaluation shows that chromospheric magnetic field measurements can more accurately capture the estimated magnetic field in the solar corona and match closer the energy distribution of the MURaM simulation (Fig. 2).The comparison in Table 2 and Fig. 2, shows a clear improvement over the baseline potential field and single-height extrapolation.The estimated heights show only a few percent in difference from the reference.Comparing the height estimates to the baseline (geometrical slices at the average heights) shows that the height mapping gives a better estimate for stronger corrugations that occur at greater heights.As can be seen from Fig. 3, our estimated τ surfaces also show a good spatial agreement with the reference corrugation map, particularly for large corrugations the topology is well captured (e.g., τ = 10 −6 , τ = 10 −5 ).The MURaM snapshot presents a dynamic example of active flux emergence, introducing additional complexity for static magnetic field extrapolations that do not account for the temporal evolution of magnetic fields.In this context, the utilization of multi-height data can mitigate this shortcoming by integrating magnetic field information from the upper solar atmosphere.
The height mapping of the magnetic field is primarily driven by finding a better agreement of the magnetic field measurement to fit the force-free assumption.This is a consistent approach in settings where the force-free assumption is satisfied, but for non force-free conditions (i.e., photospheric and chromospheric heights) the correct mapping does not necessarily satisfy the force-free model.In other words, the height mapping tries to bring the observed magnetic field into a force-free state.This can be seen from Fig. 3 where a proper estimate of the height surface is only achieved at chromospheric heights, while photospheric height estimates can not capture the small scale variations.For this reason, we consider photospheric observations as geometric slices, which prevents artificial height mappings that are driven by non force-free conditions.We use a height regularization that favors solutions close to the estimated line formation height (typically in the photosphere or chromosphere).With this we better constrain quiet Sun regions, where we assume that observations are obtained from lower layers in the solar atmosphere.
With the use of SOLIS data we demonstrate a first application of multi-height magnetic field extrapolations.The additional chromospheric observation provides a clear advancement.The comparison between the photospheric and the multi-height extrapolation in Fig. 4 shows strong differences in magnetic field topology.
The distributions of Q and T w in a vertical plane crossing the model magnetic flux rope recovered by the photospheric and multi-height NLFF modeling are shown in Fig. 4c.In agreement we find in both models a left-handed modeled magnetic flux rope, clearly separated from the untwisted field in its surrounding (as characterized by high values of Q).This separation is much more pronounced in the multi-height model, however.While the T w map pictures a low-lying, narrow, and elongated magnetic flux rope structure in the single-height extrapolation, it indicates the presence of a much more symmetric (in terms of cross-section shape) and elevated magnetic flux rope in the multi-height model.In addition, the multi-height extrapolation results in a more strongly twisted magnetic flux rope (|T w | ≳ 5.6) than the single-height model (peak value |T w | ≳ 2.0).
While the single-height extrapolation shows only a small flux rope, that quickly connects with the photospheric field, the multi-height extrapolation yields an elongated flux rope that is visually in good agreement with the EUV observation by SDO/AIA.While this first application suggests a better agreement with observational data, a further comparison of height estimates with stereoscopic measurement could further support the validity of our approach.A shortcoming of our current approach is the insufficient correction for the line-of-sight observation.In other words, we approximate that the vertical coordinate aligns with the line-of-sight, which does not hold when we consider active regions that are more distant from the disk center.As a next step, the inclusion of the geometry (i.e., spherical coordinates), viewing perspective, and optically-thin plasma could improve the extrapolation.
Recent observing capabilities provide vector magnetograms from chromospheric heights (e.g., Vissers et al. (2022) using the Swedish Solar Telescope (Scharmer et al. 2003)).Our study suggests that the full vector information at layers above the photosphere is key to provide more realistic estimates of the coronal magnetic field and lead to better height estimations (c.f., Sect.3.2).We further note that our method optimizes for divergence-free solutions, while this constrain can be also enforced by computing the vector potential.Within the PINN framework this a straight-forward extension.These extensions will be addressed in a future study.
A primary use case of magnetic field extrapolations is the study of energy build-up and flare related energy release processes.To this point, there is no readily available data set that provides multi-height observations at a sufficient cadence (of the order of 10 min) for the evolution during flares and/or coronal mass ejections, which currently limits the application of our method to single extrapolations in time.We emphasize that with this new method, we provide a consistent approach to incorporate magnetic field measurements from multiple heights into a single magnetic field extrapolation, which paves the way for future high-cadence observing series for a better understanding of the energy buildup in active regions, the magnetic reconfiguration and energy release in flares and associated coronal mass ejections.
5. DATA AVAILABILITY All our extrapolation results are publicly available.Our codes are publicly available.We provide Python notebooks that perform extrapolations for arbitrary regions without any pre-requirements.See project page: https://github.com/RobertJaro/NF2.

ACKNOWLEDGMENTS
This research has received financial support from the European Union's Horizon 2020 research and innovation program under grant agreement No. 824135 (SOLARNET).JT and AV acknowledge the Austrian Science Fund (FWF): P31413-N27.The authors acknowledge the use of the Skoltech Zhores cluster for obtaining the results presented in this paper (Zacharov et al. 2019).This work utilizes SOLIS data obtained by the NSO Integrated Synoptic Program (NISP), managed by the National Solar Observatory, which is operated by the Association of Universities for Research in Astronomy (AURA), Inc. under a cooperative agreement with the National Science Foundation.This research has made use of SunPy v3.0.0 (Mumford et al. 2020;Barnes et al. 2020), AstroPy (Astropy Collaboration et al. 2013), PyTorch (Paszke et al. 2019) and Paraview (Ahrens et al. 2005).

Figure 1 .
Figure 1.Overview of our proposed method.We extend the method presented in Jarolim et al. (2023) by including a height-mapping model.The height-mapping model takes coordinate points (x, y, z) and adjusts the the vertical component to z ′ .From the corrugated surface we sample both boundary values and random coordinates for our model training.The PINN and the height-mapping model, are updated simultaneously by optimizing for the force-free condition and matching the boundary condition of the observed magnetograms.

Figure 2 .
Figure 2. Evaluation of ⃗ B ext as a function of geometrical height.The dotted horizontal lines indicate the average height of the τ surfaces.a) Comparison to ⃗ B ref for the baseline single-height extrapolations (Potential, Extrapolation, and Extrapolation -PF) and the multi-height extrapolations (Fixed Height, Mapped Heights).b) Same comparison as in a), but for the realistic configurations (Realistic vector, Realistic split, and Realistic LOS).The best value of all performance metrics is 1. c) Evaluation of the forcefreeness (σ J ) and divergence-freeness (L n,div ) of the extrapolated and reference magnetic fields as function of geometrical height.The best value of both metrics is 0. We compare the reference magnetic field (MURaM), and our single-height (Extrapolation, and Extrapolation -PF) and multi-height extrapolations (Fixed Height, Mapped Heights, Realistic vector, Realistic split, and Realistic LOS).Note that the value range in all plots is adjusted to enhance the visibility of differences among the extrapolation methods.

Figure 3 .
Figure 3.Comparison between the height surfaces at which magnetograms are formed at constant optical depths τ in the MURaM simulation z ref (x, y, τ ) and the height surfaces at which they are inferred by our model z ′ (x, y, z).The columns show B ref,z (τ ), the ground-truth z ref (x, y, τ ), the results of the height model z ′ (x, y, z), and a 2D histogram of ground-truth and mapped heights.The red lines in the 2D histograms indicates the ideal one-to-one correlation.From top to bottom, the rows show decreasing optical depths τ (i.e., increasing geometrical heights).

Figure 4 .
Figure 4. Application of our multi-height magnetic field extrapolation to observations from 2011-03-09 16:34.a) Reference EUV (left) and Hα (middle) observation together with the estimated height from our height mapping model z ′ (right) in the coordinate frame of the SHARP region (NOAA AR 11166; SHARP 401).The vertical magnetic field strength is overlaid as contours at -1000 and 1000 Gauss in blue and red, respectively.b) Comparison of magnetic field lines modeled with a single-height (photospheric HMI) extrapolation (left) and an extrapolation that includes also SOLIS/VSM chromospheric magnetic field information (right).The region corresponds to the white rectangle in panel a.The pink arrows indicate the position where we extract magnetic field lines.The blue arrow indicates the position where additional field lines were extracted for the single-height extrapolation.c) Squashing factor and twist number of the single-height (left) and multi-height (right) extrapolated magnetic field.The orange dashed line in panel a indicates the position where the slices are extracted.

Table 2 .
Quantitative comparison between ⃗ B ref and ⃗ B ext .