# Signatures of strong magnetization and a metal-poor atmosphere for a Neptune-sized exoplanet

Lotfi Ben-Jaffel, Gilda E. Ballester, Antonio García Muñoz, Panayotis Lavvas, David K. Sing, Jorge Sanz-Forcada, Ofer Cohen, Tiffany Kataria, Gregory W. Henry, Lars Buchhave, et al.

► To cite this version:

Lotfi Ben-Jaffel, Gilda E. Ballester, Antonio García Muñoz, Panayotis Lavvas, David K. Sing, et al.. Signatures of strong magnetization and a metal-poor atmosphere for a Neptune-sized exoplanet. Nature Astronomy, 2022, 6, pp.141-153. 10.1038/s41550-021-01505-x. insu-03745337

HAL Id: insu-03745337

https://insu.hal.science/insu-03745337v1

Submitted on 7 Oct 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_2.png" /></figure>

# Signatures of strong magnetization and a metal-poor atmosphere for a Neptune-sized exoplanet

Lotfi Ben-Jaffel ID 1,2,✉, Gilda E. Ballesteros², Antonio García Muñoz³,⁴, Panayotis Lavvas ID 5,
David K. Sing ID 6,7, Jorge Sanz-Forcada ID 8, Ofer Cohen⁹, Tiffany Kataria¹⁰, Gregory W. Henry¹¹,
Lars Buchhave ID 12, Thomas Mikal-Evans ID 13, Hannah R. Wakeford ID 14 and
Mercedes López-Morales ID 15

The magnetosphere of an exoplanet has yet to be unambiguously detected. Investigations of star-planet interaction and neutral atomic hydrogen absorption during transit to detect magnetic fields in hot Jupiters have been inconclusive, and interpretations of the transit absorption non-unique. In contrast, ionized species escaping a magnetized exoplanet, particularly from the polar caps, should populate the magnetosphere, allowing detection of different regions from the plasmasphere to the extended magnetotail and characterization of the magnetic field producing them. Here we report ultraviolet observations of HAT-P-11 b, a low-mass (0.08 M<sub>J</sub>) exoplanet showing strong, phase-extended transit absorption of neutral hydrogen (maximum and tail transit depths of 32 ± 4% and 27 ± 4%) and singly ionized carbon (15 ± 4% and 12.5 ± 4%). We show that the atmosphere should have less than six times the solar metallicity (at 200 bar), and the exoplanet must also have an extended magnetotail (1.8–3.1 AU). The HAT-P-11 b equatorial magnetic field strength should be about 1–5 G. Our panchromatic approach using ionized species to simultaneously derive metallicity and magnetic field strength can now constrain interior and dynamo models of exoplanets, with implications for formation and evolution scenarios.

Lines of hydrogen, helium, carbon, oxygen and heavy metals have been successfully detected in the UV, optical and near-infrared on a few exoplanets with significant absorption extending beyond their Roche lobe<fnref n="1" />⁻⁶. Those detections are consistent with the immense X-ray/extreme-UV irradiation from the host star that drives hydrodynamic escape from microbar pressure levels. For magnetized exoplanets, the interaction between the stellar wind and the planetary magnetic field produces large-scale magnetospheric structure (Figs. 1 and 4). The planetary wind can fill in the planet's plasmasphere⁷ (inner magnetospheric region) and magnetotail (far region on the nightside), and thus extend the gas distribution blocking the starlight during transit. Unfortunately, we have not yet been able to relate the transit absorption by the outer layers to the underlying magnetospheric structure nor to the bulk composition in the deep atmosphere.

For instance, the composition, the magnetization level and their time evolution over the lifetime of exoplanets are open questions. Despite the few thousand exoplanets known so far, direct detection of intrinsic exoplanetary magnetic activity has yet to be confirmed. Based on solar system magnetism, weak radio signals are expected from a subset of exoplanets, a signal that existing technology has either failed to detect or to unambiguously

associate with an exoplanet⁸. Star-planet interactions, detected as a planetary modulation of the stellar chromospheric emission in Ca II by some hot Jupiters, have also been invoked to constrain the magnetic field strength. The method is indirect and relates to specific exoplanet/star combinations (magnetic field configuration producing magnetic reconnection, size of the exoplanet, orbital distance relative to the star's Alfvén radius and so on)⁹,¹⁰. Strong transit absorption in neutral atomic hydrogen has also been associated, via charge exchange with stellar protons, with the exoplanet magnetospheric cavity, yet the link with the magnetic field is controversial and the interpretation of the transit signature is not unique¹¹. Here we use a novel approach to implement panchromatic observations of the HAT-P-11 system plus interrelated simulations and corresponding uncertainties carefully linking the physical conditions in the deep exoplanet atmosphere (200 bar) to all the atmospheric layers above it, up to the magnetosphere (Fig. 1 and Methods). From detailed comparison with the observations, we uncover the presence of a plasmasphere and a magnetotail, constrain the atmospheric metallicity compared with existing gas planets in our solar system and estimate the intrinsic magnetic field of the exoplanet (Methods and Extended Data Figs. 1–7).

<footnote n="1">¹Institut d'Astrophysique de Paris, Sorbonne Universités, UPMC & CNRS, Paris, France. ²Lunar and Planetary Laboratory, University of Arizona, Tucson, AZ, USA. ³Zentrum für Astronomie und Astrophysik, Technische Universität Berlin, Berlin, Germany. ⁴AIM, CEA, CNRS, Université Paris-Saclay, Université de Paris, Gif-sur-Yvette, France. ⁵Groupe de Spectroscopie Moléculaire et Atmosphérique, Université de Reims, Champagne-Ardenne, France. ⁶Department of Earth & Planetary Sciences, John Hopkins University, Baltimore, MD, USA. ⁷Department of Physics & Astronomy, John Hopkins University, Baltimore, MD, USA. ⁸Centro de Astrobiología (CSIC-INTA), ESAC, Madrid, Spain. ⁹Lowell Center for Space Science and Technology, University of Massachusetts, Lowell, MA, USA. ¹⁰NASA Jet Propulsion Laboratory, Pasadena, CA, USA. ¹¹Center of Excellence in Information Systems, Tennessee State University, Nashville, TN, USA. ¹²DTU Space, National Space Institute, Technical University of Denmark, Kongens Lyngby, Denmark. ¹³Kavli Institute for Astrophysics and Space Research, Massachusetts Institute of Technology, Cambridge, MA, USA. ¹⁴School of Physics, University of Bristol, HH Wills Physics Laboratory, Bristol, UK. ¹⁵Center for Astrophysics, Harvard & Smithsonian, Cambridge, MA, USA. ¹⁶e-mail: bjaffel@iap.fr</footnote>
<figure><img src="image_3.png" /></figure>

**Fig. 1** | Flowchart of the HAT-P-11 star-planet system (not to scale) and the corresponding modelling framework proposed in this study. Our panchromatic comprehensive approach consists of modelling the different interconnected atmospheric layers and the magnetosphere that are powered by the stellar flux (large blue arrow) and the stellar wind (red). For each layer, the main processes are described on the left and the associated model tools are shown on the right. Few magnetic field lines are shown (pink). EUV (extreme ultraviolet) and RT (radiation transfer). The framework is described in detail in the 'Modelling and data analysis framework' section in the Methods.

HAT-P-11 b is a warm, low-mass (equilibrium temperature $T_{eq} \approx 870$ K) exoplanet orbiting an active K4 main-sequence star at ~0.0465 AU (refs. $^{12,13}$). HAT-P-11 b is among the few low-mass exoplanets showing water in its lower atmosphere$^{14,15}$. He I absorption has also been detected in its upper atmosphere$^{16}$. An extensive Kepler dataset showed HAT-P-11 b to have an approximately polar and eccentric orbit, evidencing a dynamically disturbed history for the system$^{17,18}$. Recently, a second, non-transiting, Jupiter-mass exoplanet was found in the system, with an eccentric and tilted orbit$^{19}$.

## Hubble Space Telescope observations

We performed several transit observations in the far-UV under the Hubble Space Telescope (HST) Panchromatic Comparative Exoplanetary Treasury programme (PanCET). We observed four transits of HAT-P-11 b on 28 October 2016, 16 and 21 December 2016 and 21 May 2017 using the Cosmic Origins Spectrograph (COS) with the G130M grating, sampling the far-UV ~113–146 nm spectral region at medium resolution (~15 km s⁻¹). We also observed two transits on 23 October and 12 November 2016 using the Space Telescope Imaging Spectrograph (STIS) with the G140M grating, covering ~119.4–124.9 nm at medium resolution with ~12.3 km s⁻¹ per pixel dispersion. The neutral oxygen O I 130.4 nm triplet and the ionized carbon C II 133.5 nm doublet were observed with COS, while STIS observed the H I Lyman-α (Lyα) line at 121.567 nm.

Comparing stellar spectra before transit with those during transit we find increasing H I Lyα absorption with HAT-P-11 b's orbital phase (Fig. 2a). Most of the absorption occurs at velocities between −150 km s⁻¹ and −30 km s⁻¹ in the reference frame of the star. When averaged over available transits, the integrated blue wing of the

stellar Lyα line shows pre-ingress absorption of 14 ± 5% (1σ) at the time of the optical-disk ingress, goes as deep as 32.5 ± 4.5% around mid-transit, and expands far (2.25 h) and deep (28 ± 5%) during egress (Fig. 2b). The corresponding detection levels are ~3σ, ~7σ and ~5.5σ respectively for ingress, transit and egress.

To check for stellar variability during each HST observation, we monitor the target's signal every 30 s using the time-tag information stored in the data. This is achieved for every single stellar emission line, providing a time series of the corresponding integrated flux over the exposure time. The analysis of those time series showed the absence of statistically significant stellar signal variability above noise levels during orbits 1 and 2 in both visits, respectively ~4 h and ~2.5 h before the optical mid-transit, which supports that the spectra obtained during orbit 1 provide a true out-of-transit stellar reference.

The repeatability of the Lyα transit light curve in the two STIS visits and the absence of apparent transit absorption in other stellar transition-region emission lines, observed with the same grating, further indicate that the Lyα detection is not due to stellar activity or known instrumental effects (the 'HST data description, analysis and calibration' section in the Methods).

For the C II 133.45 nm line, the comparison of the line profile during transit and egress with the off-transit reference in orbit 1 clearly shows blue Doppler-shifted absorption, particularly over the −70 km s⁻¹ to −10 km s⁻¹ spectral range. In contrast, no significant absorption is detected at line centre or in the red wing (Fig. 2e). Independently of any modelling, we find that these two spectral signatures strongly constrain the physics of the escaping atoms. The light curve of the integrated blue-wing absorption shows a transit depth of 10 ± 4% at ~2 h before the optical ingress, goes as
<figure><img src="image_4.png" /></figure>

<figure><img src="image_5.png" /></figure>

<figure><img src="image_6.png" /></figure>

<figure><img src="image_7.png" /></figure>

<figure><img src="image_8.png" /></figure>

**Fig. 2** | HAT-P-11 b FUV transit absorption. Error bars represent the $1\sigma$ statistical uncertainties that have been propagated from the STIS and COS data-reduction pipeline. **a, b.** Stellar H i 121.57 nm (a) and C ii 133.45 nm (b) line absorption by the exoplanet during transit. **c-e.** Transit absorption versus exoplanet orbital phase. For each visit, fluxes are normalized by the flux of the first orbit occurring before the transit event. Horizontal dotted lines at normalized flux=1 represent the absorption reference level. The optical transit duration is indicated by vertical dashed lines. One of our best fits ($B \approx 2.4$ G) to both C ii and H i lines are shown (solid line) for the same model. **a.** H i 121.57 Lyα-line profile binned by 2 in wavelength for the five orbital phases indicated in **c** with respect to the optical transit: out-of-transit, phase 1 (black); pre-transit, phase 2 (olive green); ingress, phase 3 (turquoise); in-transit, phase 4 (red) and post-transit, phase 5 (purple). The plotted line shapes are from the second STIS visit. The hatched area indicates the spectral window of the sky background contamination. **b.** C ii 133.45 nm line profile binned by 4 in wavelength for the 3 orbital phases indicated in **d**: out-of-transit, phase 1 (black); average of in-transit phases 3 and 4 (magenta) and post-transit, phase 5 (turquoise). The deviant pixel on the red wing of the magenta line profile is a single statistical effect (**e**). The plotted line shapes are from the average of all four COS visits. **c.** H i Lyα line flux integrated over projected velocities from −150 km s⁻¹ to −30 km s⁻¹ of the absorbing H i atoms (indicated by two dashed vertical lines in **a**) for two transit events: HST visit 1 on 23 October 2016 (turquoise) and HST visit 2 on 11 November 2016 (red). **d.** C ii 133.45 nm line flux integrated over the blue wing for projected velocities from −70 km s⁻¹ to −10 km s⁻¹ for the four HST transit events: transit 1 (red), transit 2 (olive), transit 3 (blue) and transit 4 (turquoise). **e.** Same as **d**, but for the red wing of the C ii line integrated from −10 km s⁻¹ to +50 km s⁻¹. Horizontal dotted lines are shown at ±3σ from the normalized flux=1. We also show the average of the four COS visits (grey).

deep as 15 ± 4% at mid-transit and expands far (2.25 h) and deep (12.5 ± 4%) during egress (Fig. 2d). In contrast, the red wing of the same stellar line shows a flat trend (Fig. 2e). Together, the absence of variability in the stellar flux during the first orbit in all visits, the repeatability of the C II 133.45 nm blue-wing absorption with planet orbital phase for all four COS visits and the absence of similar transit

<figure><img src="image_9.png" /></figure>

**Fig. 3** | Sensitivity of C II model transit light curves versus the metallicity assumed in the deep atmosphere and the strength of the intrinsic magnetic field of the exoplanet. In all panels, grey light curves from top to bottom correspond to 1-, 2-, 6-, 10-, 30- and 50-times solar metallicity; $B=1.2$ G (dashed light curves) and $B=2.4$ G (solid curves). Data points of individual HST visits/orbits and related $1\sigma$ statistical error bars are also shown with same colours used in Fig. 2. Here the model considers only the effect of the plasmasphere excluding the extended magnetotail. The final fit to observations, including the whole system, is discussed in the 'Step 2' section and Extended Data Fig. 1, with related $\chi^2$ values provided in Table 1 and an example best fit found in Fig. 2. **a.** Blue wing of the C II 133.45 nm line. The asymmetry of the light curves for $B=2.4$ G is remarkable compared with the more symmetric ones obtained for $B=1.2$ G. **b.** Red wing of same C II 133.45 nm line. No significant absorption can be measured on the red wing. The average of the four COS visits is shown in black. Horizontal (dotted) lines show ±3σ limits of the combined COS visits. Any model light curve that exceeds those limits is rejected for the assumed B strength.

absorption in other stellar lines (particularly in the red wing of the same C II 133.45 nm line) all indicate that the C II detection is not due to stellar variations or any known instrumental effect (the 'HST data description, analysis and calibration' section in the Methods).

Remarkably, the C II 133.45 nm and Lyα transit light curves look similar, yet the absorption is stronger in Lyα. In addition, the C II 133.45 nm transit absorption is maximum around −50 km s⁻¹ from line centre, while the blue side of Lyα the absorption is maximum around −100 km s⁻¹, indicating a factor of two higher average Doppler velocities for H i than C II. The lack of detectable absorption at the centre and red wing of the C II 133.4 nm line supports a projected Doppler-shifted absorption process during transit and thus, a dominant global particle motion away from the star. This diagnostic is possible because we can study the entire C II stellar line, in contrast to the wider H i Lyα line that is strongly affected by the interstellar medium (ISM).

## Transit absorption

Abundances and Doppler velocities inferred from transmission spectroscopy in the far ultraviolet (FUV) are sensitive to the stellar
<figure><img src="image_10.png" /></figure>

**Fig. 4** | PIC high-resolution simulations ($\Delta \approx 0.33 R_p$) for one of the best fits of the magnetic field strength, $B = 2.4 G$. The planetary disk ($3R_p$) is placed at (0,0) (shown in black). The stellar wind arrives from the left of the figure. Day-night cross sections of the magnetosphere are shown. The reference frame axes are shown on the left upper corner in **c. a**, Planetary protons flow streamlines with arrows (magenta) are shown over the plasma density. The outflow is tailward (to the right). On the dayside, low density and cross-field flow (dark blue) is stellar-ward for lower latitudes but bends tailward at higher latitudes. **b**, Same as in **a** but in the equatorial plane (XY). Ingress corresponds to the top of figure and egress to the bottom (after the tail tilt, provided in Table 1, is applied). We remark on the impact of the (anti-clockwise) corotation on the streamlines of the flow directed downtail, confirming early predictions made for the dynamic of the plasma flow due to corotation and an inner source (Io and ionosphere) in the Jovian magnetosphere³⁶. **c**, Plasma density of the stellar wind component and the compressed dipole magnetic field lines in the XZ plane. We clearly see an upstream bow shock of the energetic stellar wind (for example, at around $X = -20R_{pr}$, $Z = 0R_p$) on the dayside. Field-aligned particles flow from the near tail to the planetary poles (responsible for planetary aurorae). **d**, Magnetic field lines. We use the separation between open and closed field lines to define the solid angles of the north and south polar caps. A magnetic-field reconnection appears at a distance of $-50R_p$ on the far magnetotail, which should reinforce downtail plasma ejection from the system over time (and auroral particle precipitation onto the planet).

line width, the cross section of the escaping atom, its abundance and velocity, and its ionization lifetime. Because the system is complex, there is no straightforward one-to-one relationship between a property of the system and a specific aspect of the observed signal. Only forward comprehensive modelling is able to disentangle the problem (Methods).

To model and interpret the HST transit observations of HAT-P-11 b, we connect the deep composition of the exoplanetary atmosphere directly with the planet's atmospheric escape, consistent with the energy input from the stellar radiation and wind (for example, Fig. 1 and the 'Comprehensive global modelling of exoplanetary atmospheres' section in the Methods).

**Free parameters.** In this comprehensive study, we consider three main free parameters: the metallicity of the deep atmosphere in the range of 1-, 2-, 6-, 10-, 30-, 50-, 100- and 150-times solar, the strength of the exoplanet magnetic field in the range ~0.12, 1.2, 2.4, 4.8 and 9.6 G, and the full length of the magnetotail. The carbon abundance is tightly dependent on the deep atmosphere (200 bar) metallicity, while the spatial extent of the ionized C II species, which dominate the upper atmosphere, is controlled by the strength of the planetary magnetic field and the induced currents in the inner and outer regions of the magnetosphere. We also consider the tilt

of the planet's magnetic-field axis with respect to its spin axis as a free parameter but within a limited range as required by the fitting process. The reasoning behind the selected ranges is explained in Supplementary Discussion 1.

The implementation of the magnetospheric modelling follows four simple steps that aim to disentangle the contribution of metallicity versus field strength, while fitting both the C II and H I transit absorptions.

**Step 1.** With O I, C II is the most sensitive species to the atmospheric metallicity. For all magnetic field cases, we generated light curves versus atmospheric metallicity for both the blue and red wings of the 133.45 nm line for comparison with observations (Fig. 3).

A first result is that models with metallicity above 6 times solar (3 times stellar) are more than 3σ away from the average red-wing observations and are thus rejected (Table 1). Our metallicity upper limit is insensitive to the field strength or asymmetry considered. For reference, the 3σ constraint on the red-wing transit (~6% absorption, with less than 1% chance to happen) can be understood as a noise upper-limit absorption that, if it exists, would spectrally occur in the rest frame of the planet (to satisfy the red-wing spectral window), and would be principally produced by thermal atoms magnetically trapped in the dense plasmasphere
<figure><img src="image_11.png" /><figcaption>**Fig. 5** | Flow streamlines over the density of C II ions that originally started their trip from the north and south polar cap regions. Flow streamlines are in gold. At high north and south distances, the polar wind outflow is bent tailward. The presence of ions at lower latitudes is explained by the isotropy of the initial velocity distribution (Maxwellian) that injects a sub-population with velocity components perpendicular to the initial radial flow. That sub-population of ions are first trapped by closed field lines (blue) that are adjacent to the edge of the polar caps before they are quickly transported outward. Most ions shown, except the minor group flowing towards the star (Supplementary Discussion 3), contribute to the mass loading of the magnetotail by the polar wind.</figcaption></figure>

(Fig. 4a). This result is the first strong implication from the asymmetry observed in the C II 133.45 nm line absorption level and transit light curve behaviour.

Our derived solar-like upper-limit metallicity of HAT-P-11 b confirm the recent finding of low metallicity obtained from optical/infrared HST observations¹⁵. Based on a quite different wavelength window, our independent analysis obtained a more stringent metallicity upper limit of 6 times solar at the 3σ detection level. At the 1σ detection level regarding the red-wing signal of the C II 133.45 line, our upper limit should not exceed the stellar metallicity (2 times solar) for HAT-P-11 b (for example, Table 1). With its solar-like metallicity, HAT-P-11 b appears as a new kind of low-mass Jupiter-like exoplanet, and not a Neptune-like one.

**Step 2.** For the few times that solar metallicity derived above, and for all local magnetic field (B) cases considered, we find that the C II blue-wing models show less absorption than expected, particularly during egress in orbit 5. To increase the system opacity, the only option is to extend the magnetotail size. Fig. 4 shows how the magnetosphere is composed principally of a dense plasmasphere and a tenuous extended magnetotail. For perspective, magnetotails as long as a few thousand planetary radii (or few AU) have been predicted and observed for planets of the solar system²⁰,²¹ (Supplementary Discussion 2).

In the present case, no simulation with the regular spatial grid used in our particles-in-cell (PIC) model code can handle such an elongated system. However, all PIC models generated in our study show a steady state plasma flow leaving the system in the downtail sector (for example, Fig. 4c,d). Another important feature of the magnetotail model outflow is that the planetary polar wind is its dominant source (Supplementary Discussion 3). This PIC result is consistent with the low-energy plasma particles recently explored by the four Cluster II spacecraft as the dominant population in the Earth magnetosphere⁷,²².

In this frame, for each case of magnetic field strength, we ran the PIC simulation and used the results to derive the angular extension of the polar cap by finding the separation between open and closed field magnetic field lines. In a second run, the particles originating

from the polar cap were then tracked separately from the particles originating at lower latitudes (Fig. 5).

To derive the average plasma properties in the magnetotail, we first need to define the spatial size of the magnetopause inside which the plasma is confined, particularly to account for the tail flattening expected in the spin axis (OZ) direction (Supplementary Discussion 4). For instance, our PIC simulations show a complex topology of the plasma distribution in the magnetotail that can hardly be described only by tail flattening or averaged kinetic properties (for example, Figs. 4 and 5). For that reason, we provide a volume filling factor that should measure the filling/emptiness of the tail region along with a dispersion on most derived average plasma properties for each B case (for example, Figs. 4 and 5). This allowed us to derive the average statistical properties of the plasma inside the magnetotail volume (average bulk velocity of the flow), the dispersion on the velocity and the mean plasma density of each species, and also the related dispersion and the volume filling factor versus the B strength or tilt (for example, Table 1).

With the far tail properties derived above, the best fits, in terms of the extended tail size and orientation, are shown in Table 1. First, we find that for largest field strength (8 times the reference value), the ~6–19 AU length of the tail, required to fit the data, is rejected because it would be difficult to physically maintain a cohesive tail structure over such long distances. This case is thus rejected. All other field-strength/metallicity solutions with tail sizes above a few AU are also rejected (Table 1).

**Step 3.** In the steps above, we focused on the transit-integrated absorption over the blue versus red wings of the C II 133.45 nm line. We now use the spectral profile of the transit absorption. For C II, the signal to noise of all merged data is not as high as for the H I Lyα transit, so the comparison at the spectral pixel resolution is not conclusive. In addition, because the transit absorption is affecting the waning slope of a sharp line profile, it is difficult to compare models with observations with relatively large statistical errors. To clarify the diagnostic, we decided to focus our comparison on matching the Doppler velocity of the maximum absorption observed during transit or at egress for the different solutions derived in the previous step.

Despite the large error bars, we found that the models with field strength two and four times the reference value give the best fits for the spectral position of the maximum absorption. That spectral position is defined by the average velocity of the projected bulk flow in the tail as derived in the previous step. For the $B \approx 2.4$ G case the velocity is ~54 km s⁻¹ and for the $B \approx 4.8$ G case the velocity is ~49 km s⁻¹, which are the closest values to the maximum absorption spectral position observed for C II (~50 km s⁻¹). For the other strength values, the derived projected Doppler velocity (~22 km s⁻¹ for the weak field case) is different from the value observed (Table 1), yet these cases cannot be fully rejected at this stage. We remark that we could obtain reasonably good fits to the C II line profiles for the case of $B \approx 2.4$ G with a 30% tilted dipole, a degeneracy that cannot be removed because of the noise level of the data (for example, Table 1).

**Step 4.** In this step we verify if the solution obtained above from the fitting of the C II transit absorption is consistent with the transit absorption observed for H I, particularly the Doppler position of the maximum absorption.

Our model is based on two H I populations: primary (no charge exchange) and secondary (single charge exchange) populations (for example, the 'Lya transit interpretation and modelling' section in the Methods). First, we find that the ~4% transit absorption due to the primary hydrodynamically injected H I population is insufficient to fit the observations for all atmospheric metallicities considered. However, after adding the secondary H I population
<table><caption>**Table 1 |** Results of the sensitivity of the C II blue wing and H I Lyα model transit absorptions versus the exoplanet magnetic field assumed, including the magnetotail size and tilt angle free parameters</caption><thead><tr><th></th><th>0.1</th><th>1</th><th>2</th><th>2<sup>1</sup></th><th>4</th><th>8</th></tr></thead><tbody><tr><td>B/B<sub>ref</sub></td><td>0.12</td><td>1.2</td><td>2.4</td><td>2.4</td><td>4.8</td><td>9.6</td></tr><tr><td>|B<sub>eq</sub>| (gauss)</td><td>40</td><td>26</td><td>21</td><td>21</td><td>18</td><td>13</td></tr><tr><td>θ° (degree)</td><td>22</td><td>27</td><td>54</td><td>57</td><td>49</td><td>27</td></tr><tr><td>⟨v⟩<sub>tail</sub> (C II) (km s<sup>-1</sup>)</td><td>49</td><td>93</td><td>112</td><td>86</td><td>111</td><td>72</td></tr><tr><td>δ⟨v⟩<sub>tail</sub> (C II) (km s<sup>-1</sup>)</td><td>9.5</td><td>13</td><td>26</td><td>43</td><td>35</td><td>20</td></tr><tr><td>δ⟨v⟩<sub>tail</sub> (H II) (km s<sup>-1</sup>)</td><td>15.5</td><td>48</td><td>62</td><td>55</td><td>78</td><td>87</td></tr><tr><td>⟨n⟩<sub>tail</sub> (C II) (cm<sup>-3</sup>)</td><td>4.7</td><td>0.3</td><td>0.33</td><td>0.39</td><td>0.15</td><td>0.06</td></tr><tr><td>δ⟨n⟩<sub>tail</sub> (C II) (cm<sup>-3</sup>)</td><td>8.4 10<sup>4</sup></td><td>1.3 10<sup>4</sup></td><td>9.3 10<sup>3</sup></td><td>6.3 10<sup>3</sup></td><td>7.2 10<sup>3</sup></td><td>0.3 10<sup>3</sup></td></tr><tr><td>δ⟨n⟩<sub>tail</sub> (H II) (cm<sup>-3</sup>)</td><td>8.0</td><td>0.74</td><td>1.09</td><td>1.62</td><td>0.8</td><td>0.4</td></tr><tr><td>Magnetotail filling factor (C II)<sup>c</sup> (%)</td><td>97</td><td>48</td><td>56</td><td>34</td><td>27</td><td>7</td></tr><tr><td>Metallicity (minimum, maximum) (times solar<sup>d</sup>)</td><td>(1, 1.6)</td><td>(1, 1.6)</td><td>(2.0, 3.2)</td><td>(2.0, 2.8)</td><td>(2.5, 6)</td><td>(1, 3)</td></tr><tr><td>Mass loss rate<sup>e</sup> (hydro code; g s<sup>-1</sup>)</td><td>1.2 10<sup>11</sup></td><td>1.2 10<sup>11</sup></td><td>1.2 10<sup>11</sup></td><td>1.2 10<sup>11</sup></td><td>1.2 10<sup>11</sup></td><td>1.2 10<sup>11</sup></td></tr><tr><td>Relative escape rate magnetosphere<sup>f</sup> (H and C) (PIC escape rate/hydro escape rate; %)</td><td>97</td><td>44</td><td>34</td><td>23</td><td>30</td><td>3</td></tr><tr><td>Relative escape rate magnetosphere<sup>g</sup> (C) (PIC escape rate/hydro escape rate; %)</td><td>72</td><td>42</td><td>28</td><td>34</td><td>18</td><td>8</td></tr><tr><td>C II tail tilt (degrees)</td><td>0.1-2</td><td>0.1-0.4</td><td>0.1-0.3</td><td>0.1-0.3</td><td>0.1-0.4</td><td>≤0.1</td></tr><tr><td>C II tail size (AU)</td><td>0.4-0.8</td><td>1.8-3</td><td>2.5-9.3</td><td>2.5-7.5</td><td>1.9-3.1</td><td>6-19</td></tr><tr><td>H I tail tilt (degrees)</td><td>5-20</td><td>3-6</td><td>1-3</td><td>1-2.5</td><td>1-2.5</td><td>≤0.1</td></tr><tr><td>H I tail size (AU)</td><td>0.04</td><td>0.16</td><td>0.23</td><td>0.28</td><td>0.31</td><td>8.0</td></tr><tr><td>χ<sup>2</sup> orbit 5 (Lyα line)</td><td>14.8</td><td>1.3</td><td>1.</td><td>1.0</td><td>0.75</td><td>0.7</td></tr><tr><td>χ<sup>2</sup> orbit 4<sup>h</sup> (Lyα line)</td><td>20.4</td><td>1.2</td><td>2.1</td><td>1.4</td><td>2.2</td><td>2.2</td></tr><tr><td>χ<sup>2</sup> orbit 3 (Lyα line)</td><td>7.2</td><td>0.6</td><td>1.6</td><td>0.7</td><td>0.5</td><td>0.9</td></tr></tbody></table>

We highlight the case that is rejected because of the excessive size obtained for the magnetotail. Here $B_{ref}=1.2$ G, $B_{eq}$ is the equatorial magnetic field strength, $n_{tail}$ is the mean species density inside the magnetotail volume, $v_{tail}$ is the corresponding average bulk velocity. $^{a}$Magnetic field axis with a 30° tilt from the spin axis of the exoplanet. $^{b}$Polar cap cone semi-angle derived from PIC simulations (measured from magnetic field axis). $^{c}$The volume filling factor is derived from the PIC simulation using the gas density distribution and taking into account the flattening of the magnetotail. $^{d}$The metallicities are those implemented in the deep/low atmosphere 3D GCM and RT modelling and are constrained mainly by the C II observations. Note that for formation and evolution scenarios, the star has two-times solar metallicity. $^{e}$Mass loss rates correspond to the hydrodynamic escape from the upper atmosphere (hydro code). $^{f}$We provide the ratio (%) of escape rate derived from the PIC simulations relative to the hydro code for the H and C species (H I, H II, C I, C II). It is remarkable to observe the decline of the mass loss rate versus the magnetic field strength. Most of the mass lost at the ionosphere boundary is recycled in the magnetosphere. $^{g}$We provide the ratio (%) of escape rate derived from the PIC simulations relative to the hydro code for C II to check any differential escape for this heavy species. $^{h}$Orbit 4 of the COS transit 2 shows slight distortion in various stellar line profiles, particularly in the Si III 120.65 nm line. This explains the large reduced $\chi^2$ values obtained for all B-strength cases because the model line profile fit is based on the different stellar line profile of orbit 1 (for example, Extended Data Fig. 1).

(exactly same kinetic properties as the H II parents), we obtain a satisfactory fit to the Lyα transit light curve (Fig. 2c; with the tail parameters indicated in Table 1) for all the relevant planetary magnetic field strengths retained from the C II analysis. To solve this degeneracy, we compared the model line profiles corresponding to the fits of the C II and H I light curves listed in Table 1 with the line profiles observed at specific orbital phases for which there is good signal-to-noise ratio S/N. Using a simple least-square fit over the spectral range affected by the transit absorption, we obtained a best fit for the planetary magnetic field strength in the range of 1.2–4.8 G for each of the 3 orbital phases corresponding to HST orbits 3 to 5. For the case of $B \approx 0.1$ G (0.1 times the reference value), we could not obtain a satisfactory fit to any of the three HST orbits (reduced $\chi^2$ in the range of 7 to 20; Table 1), which rules out the weak-magnetization scenario for the planet. Since the ~9.6 G value is rejected by both the C II and H I analyses because their best fits require unacceptable sizes for the tail (for example, Table 1), we are left with the range of 1.2–4.8 G as the best solution for the magnetic field strength. Field strengths of the ~1–5 G solution are consistent with the C II line profile analysis, although the diagnostic was not conclusive.

The strength of our approach resides in using physically motivated forward models that can reproduce the HST observations (the ‘Sensitivity to model assumptions and overall error, and the

robustness of the results’ section in the Methods), in including most known uncertainties related to both data and models that we carefully forecast in the overall errors attached to the solution for the B strength and the atmospheric metallicity (Supplementary Discussion 5), and in proposing accurate predictions that future observations can test (the ‘Sensitivity to model assumptions and overall error, and the robustness of the results’ section in the Methods and Supplementary Discussion 6).

## Conclusions

With its low metallicity, at most three times the metallicity of its star, and a magnetic field in the few gauss regime, the properties of HAT-P-11 b are akin to Jovian rather than Neptunian planetary properties, despite its small mass. Curiously, the metallicity and magnetic field strength derived here are both in contradiction with previous planetary evolutionary modelling of HAT-P-11 b that predicted a 56-times solar (or 28-times stellar) metallicity$^{23}$, and with scaling laws for B strength that do not account for the specificity of the planet$^{24}$ (for example, Supplementary Discussion 5).

An approach to solve the metallicity contradiction is to revise planetary evolutionary models by changing various ingredients (for example, core mass, planet formation timing relative to the gas clearance of the disk, distance from the star, presence of a nearby Jupiter-mass planet c and so on) (for example,
Supplementary Discussion 7). For the magnetic field, the situation is more complex than a specific scaling law for this population of 'mini-Jupiter' exoplanets (for example, Supplementary Discussion 6), because the magnetic field strength is not easy to derive for any planet<sup>24</sup>. Such approaches could be interesting, yet they would miss the fundamental feature of the thousands of exoplanets detected to date: their diversity. If we keep the same paradigm for interpreting exoplanet metallicity and their magnetic field strength separately, we will end with as many scenarios and scaling laws as there are diverse exoplanets.

As far as a dynamo process is convection-driven (either thermal or compositional) in the deep interior of the planet (core or shell), an energy source is required, which could be related to a primordial heat (secular cooling from an initial hot state), an ongoing differentiation due to settling of heavy materials toward the centre<sup>24,25</sup> or even due to the magnetized parent star when orbiting close by. The altitude of the dynamo, the different layers that compose the interior of the planet and the energy balance of the system are thus strongly tied to each other at every era of the evolution of the planet. We propose to expand the modelling shown here to the deep interior of a planet (down to the core), to include models of convection-driven dynamo processes, so that the conditions in the deep interior are consistent with every layer above, up to the magnetosphere. Our study shows the strength of the proposed comprehensive modelling. This new PanCET study has provided simultaneous constraints of two fundamental current properties of HAT-P-11 b. Observations and modelling of other neutral and ionized species will be included in the future, probably with additional accurate constraints that formation and evolution models must fulfil (for example, the 'Sensitivity to model assumptions and overall error, and the robustness of the results' section in the Methods and Supplementary Discussions 6 and 9).

## Methods

Our novel approach (Fig. 1) connects panchromatic observations of the HAT-P-11 system and a variety of interrelated models, linking the physical conditions in the planet's deep atmosphere (200 bar) to all layers above, including the magnetosphere and the stellar corona, to uncover the planet's metallicity and magnetic field strength. In the 'Modelling and data analysis framework' section, we focus on the global picture of our approach and particularly on its adequacy for the interpretation of the HST transit observations. In the 'HST data description, analysis and calibration' section, we describe the HST observations and their calibration. In the 'Comprehensive global modelling of exoplanetary atmospheres' section, we discuss each model in detail. In the 'Sensitivity to model assumptions and overall error, and the robustness of the results' section, we assess the sensitivity of our results to model assumptions, emphasizing the impact of uncertainties on the final conclusions.

**Modelling and data analysis framework.** Our framework starts with three-dimensional (3D) general circulation modelling of the deep and lower atmosphere (pressure range 200–10⁻⁵ bar), coupled with a radiative transfer scheme for different atmospheric metallicities<sup>49</sup>. Longitudinally averaged simulated composition, pressure–temperature (P–T) and eddy diffusion altitude profiles are then used as inputs for a more detailed one-dimensional (1D) photochemical and thermochemical model of the deep, lower and middle atmosphere (P ≈ 1000–10⁻⁷ bar), including both light and heavy species<sup>57</sup>, and ion chemistry. In the following step, the simulated species mixing ratios, P–T and eddy mixing profiles are injected into a 1D hydrodynamics and photo- and ion-chemistry model (hydro code) that describes the escape and transport of species in the upper atmosphere<sup>28,29</sup> up to a few planetary radii.

To account for feedbacks between the middle and upper atmosphere, we iterate between models (Fig. 1) to achieve consistency between the different boundary conditions, particularly in the temperature profile (for example, the 'Lower-middle atmosphere' and 'Upper-atmosphere aeronomy' sections and Supplementary Discussion 5). Assuming spherical symmetry, the ionized species of H II (protons) and C II derived from the hydro code are then injected at selected altitudes above ~10⁻⁸ bar, where the atmosphere is no longer collisionally dominated, into the inner boundary of a 3D electromagnetic, relativistic and collisionless PIC model of the magnetosphere<sup>3,10,31</sup> (the 'Plasmasphere and magnetosphere' section). We consider the day-night asymmetry of irradiation by reducing a factor of two the flux of particles at the injection boundary radius on the night hemisphere (shadow region defined by the 1 planetary radius ($R_p$) 'surface' of the planet).

In the outer boundary of the PIC model, the plasma and the interplanetary magnetic field properties at the orbital position of the planet are derived with our 3D magneto-hydro-dynamics (MHD) simulations of the stellar wind of HAT-P-11 (the 'Stellar wind plasma and interplanetary magnetic field conditions at the orbital position of the exoplanet' section). In addition, we reconstructed the stellar radiation spectrum from X-ray to infrared wavelengths using both dedicated observations and modelling. This stellar spectrum is a key input for the atmospheric chemistry and dynamical models (the 'Stellar radiation inputs' section).

Finally, we assume a Jupiter-like dynamo process to produce a dipole magnetic field for the exoplanet described by its strength and tilt with respect to the spin axis. This is a realistic assumption for distances greater than 3–4$R_p$, where the absorption signal is produced. We demonstrate that this assumption has no impact on our conclusions, since any quadrupole or high-order fields drop much faster from the body-centre than the dipole field that effectively drives the magnetospheric structure (for example, Supplementary Discussion 8). With a radius $R_p \approx 2.78 \times 10^9$ cm, a spin rate of ~1.488 × 10⁻⁵ radians per second and a density of 1.33 g cm⁻³, energetic considerations show that HAT-P-11 b should sustain dynamo activity and possess a magnetic field even with an internal heat lower than the internal heat of Neptune, yet the exact strength of the field is difficult to estimate (fig. 16 in Stevenson<sup>41</sup>). Our simple dynamo model is described in Supplementary Discussion 6.

**HST data description, analysis and calibration.** *Data description and analysis.* We use datasets from two different HST programmes: GO 14767 and GO 14625. Each transit observation consists of five consecutive HST orbits covering exoplanet orbital phases before, during and after the nominal transit time. Supplementary Table 1 lists the data log from these two HST programmes. Four transit events were observed with the COS/G130M medium-resolution grating (~113.0–146.0 nm, which includes the C II 133.5 nm doublet) and two transits were observed with the STIS/G140M grating (~119.4–124.9 nm, including the H I Lyα line). Although the COS observations recorded the stellar Lyα and O I 130.4 nm lines, these lines are fully contaminated by emissions from the Earth geocorona and airglow, respectively. All data were obtained in time-tag mode, which allows us to monitor any time variability related either to the instrument or stellar activity.

For the STIS/G140M data, we sub-sample each exposure in ~435 s sub-exposures using the recorded time-tag events. Each sub-exposure is then processed using the STIS calibration pipeline (CalSTIS) to obtain a two-dimensional spectral image of the STIS long-slit (52′′ × 0.05′′), which is used to extract the stellar signal after subtracting the Earth's geocoronal emission from adjacent areas of the detector along the spatial direction of the slit<sup>12</sup>. Most of the red wing of the stellar Lyα line is absorbed by the ISM due to the large ~63.24 km s⁻¹ radial velocity of the star (Extended Data Fig. 2a), so only the blue wing of the Lyα line is available for transit diagnostics.

Fortunately, the four HST visits made with COS sampled key FUV stellar lines devoid of ISM absorption because the ~63.24 km s⁻¹ redshift of the star offsets any ISM absorption off narrow lines such as the C II 133.5 nm doublet. There is also no Earth airglow contamination for C II 133.5 nm, which unfortunately contaminated the stellar O I 130.4 nm signal. To summarize, in contrast to Lyα and the O I 130.4 nm triplet, the HAT-P-11 C II 133.5 nm doublet lines are not contaminated and are relatively strong, thus providing a complete and self-consistent diagnostic of the exoplanet's Doppler-shifted transit absorption of these ions over the full extent of the stellar line, in addition to directly monitoring the stellar chromospheric activity.

The C II doublet is an unresolved triplet composed of the 133.45 nm transition from the ground state ($J=1/2$) and two unresolved lines at ~133.57 nm that start from an exited state ($J=3/2$) and may be populated by collisional processes.

For the COS/G130M observations we used the default COS calibration pipeline, except for the statistical error estimation that we fully revise here (for example, the 'COS calibration pipeline' section). Besides statistical noise, we also carefully checked that the transit absorptions are not related to stellar activity. We know that HAT-P-11 is an active, K2-K4V (effective temperature $T_{eff} \approx 4780$ K), high-metallicity ([Fe/H] = 0.31) star<sup>12</sup>. Its chromospheric activity level defined by $R'_{HK}$ (the total flux in the Ca II H & K narrow bands normalized by the bolometric brightness of the star), with $log R'_{HK} = -4.584$, is comparable with the level, $log R'_{HK} = -4.501$, of the active HD189733 K0V star. Indeed, the chromospheric activity for HAT-P-11 recorded over a 450-day period with Keck shows constant high activity, with an ~10% modulation<sup>10</sup>. HAT-P-11 was in the Kepler field, and monitoring observations revealed that the exoplanet sits on a fairly polar orbit, evidencing a dynamically disturbed system<sup>17,18,33</sup>. The Kepler transit data revealed an active stellar disc with a latitudinal distribution of spots similar to sunspots (mean spots latitude of ~16°), yet with a coverage area that is two orders of magnitude larger than that for the Sun<sup>34</sup>.

To track the stellar activity during the four HST/COS transit observations, we first use a diagnostic based on the C II emission lines. We compared the integrated flux of the C II 133.57 nm line with the C II 133.45 nm line versus the time (measured from the mid-transit transit central time; Extended Data Fig. 3a) and versus the HST orbital phase. We find a nearly linear trend for both the C II 133.45 and 133.57 nm lines versus time that repeats for each of the five exoplanet orbital phases observed. For the out-of-transit observation (four data points around time from mid-transit ≈ -3.5 h, obtained between 12 October 2016 and 21 May 2017),
the C II 133.57 and C II 133.45 nm emissions are strongly correlated with a Pearson coefficient of ~0.91 and the integrated fluxes ratio ($I_{133.5}/I_{133.4}/I_{HAT-P-11}$) ≈ 1.41 ± 0.05). For reference, for an optically thin atmosphere ($I_{133.5}/I_{133.4}$) = 1.8, which supports that for HAT-P-11 the two lines form in the moderately opaque region of the upper chromosphere and probably lower transition region³⁵. This diagnostic is further confirmed by the shape of the two emission lines, both showing a single peak line profile with extended wings³⁵.

For the Sun, high spectral- and spatial-resolution observations³⁵ show C II lines that are also relatively optically thick emissions, forming between the upper chromosphere and lower transition region³⁵. Using full-disk spectral-images (mosaics) gathered from the Interface Region Imaging Spectrograph (IRIS) scans obtained at distinct wavelengths between 2013 and 2017, we find that the disk-averaged C II 133.57 and C II 133.45 nm emissions are strongly correlated (Pearson coefficient of 0.999) over time, with a ratio ($I_{133.5}/I_{133.4}/I_{sun}$) ≈ 1.14 ± 0.02 that is comparable with the ratio derived here for HAT-P-11. Based on the strong correlation between the C II 133.45 and C II 133.57 nm emissions for both the Sun and HAT-P-11, we conclude that the C II 133.57 nm emission line can be safely used to monitor the variability of the stellar flux in that spectral range and correct for it at all orbital phases.

To further track the stellar activity during the transit observations of HAT-P-11 b, we also generated light curves for strong FUV lines (namely, Si III 120.6 nm and the average of Si IV 139.3 nm and S IV 140.2 nm), which are known to be good indicators of short-term variability due to the patchiness of the stellar disk for the Sun and for active stars such as HD189733 (refs. ²⁴,³⁶). For both the Sun and HD189733, the C II lines show, by far, much less variability than the Si III and Si IV emissions (for example, fig. 6 and table 3 in Ben-Jaffel and Ballester³⁴), a result consistent with the former lines being emitted by hotter layers of the upper chromosphere and lower transition region compared with the C II and O I lines³⁵.

For HAT-P-11, we first notice in the silicon lines a flare event that occurred during the fifth HST orbit of transit 2 (blue around time from mid-transit ≈ 2.75 h) on 16 December 2016 (Extended Data Fig. 3b). In contrast, the C II 133.57 nm line shows much less flare-related variability while the C II 133.45 nm line shows a different response to the flare, which supports that the variation observed for the C II 133.45 nm line, relative to the first out-of-transit spectrum, is not related to the stellar variability but to the exoplanet transit absorption as detected during the three other transits (red, black and green).

For instance, for transits 1 to 3, and except for the flare event discussed above, the Si III and Si IV light curves do not show any transit trend, which confirms that the light curve observed for the C II 133.45 nm line is not correlated with any stellar variability. The 2017 transit 4 (green) has a different behaviour for Si III and Si IV emissions. Because it originates from a hotter layer (logT ≈ 4.75) of the chromosphere, the Si IV lines are expected to show the largest variations, followed by the Si III line that originates from a cooler layer (logT ≈ 4.25). In this frame, if the variation during transit 4 is of stellar origin, the scatter expected for the C II lines that originate from an even cooler layer (logT ≈ 4.1) should be smaller than observed for the Si III lines and follow the same temporal behaviour, which is not the trend observed during transit.

Our conclusion is that the stellar C II lines genuinely probe the transit absorption because we obtain the same repeated temporal trend over four distinct transit periods, despite the variations observed in other stellar lines. We considered the possibility of dismissing transit 4 and only using the first three transits in 2016 but found that this does not change our conclusions apart from slightly increasing the statistical error bars. All these pieces of evidence strongly support the detection of the transit absorption for the blue wing of the C II 133.45 nm line.

It is interesting to note that the H I and C II absorption features overlap on spectral ranges where enough signal is available for both H I Lyα and C II 133.45 nm lines. For example, the spectral window from −150 km s⁻¹ to −30 km s⁻¹ used for the Lyα detection overlaps with the C II 133.45 nm line over the −70 to −30 km s⁻¹ range, where enough signal is available (up to ~2.5 × 10⁻¹⁴ erg cm⁻² s⁻¹ A⁻¹) in the C II line. Similarly, the spectral window from −70 to −10 km s⁻¹ used for the C II detection also overlaps with the window available for H I. As shown in Fig. 2a, around Doppler position −50 km s⁻¹, the Lyα flux of ~3 × 10⁻¹⁴ erg cm⁻² s⁻¹ A⁻¹ (close to the line's peak signal) is large enough for any potential absorption feature. We conclude that the observed velocity difference is not caused by the fact that we cannot observe the same velocity range in both lines.

**COS calibration pipeline.** HST COS was designed to work in the very low count rate regime, using Poisson statistics to evaluate error bars $\sqrt{N}$ that are attached to the measured counts N. This convention was applied to all archived COS data up to the end of 2012. The COS calibration pipeline (CalCOS 2.19.1 and later) implemented since 2013 used a new prescription to estimate statistical errors based on Gehrels³⁷, intended to correct for the limiting case when the signal counts and corresponding error are close to zero. With the approximate upper bound of the confidence interval ($L_u$) defined by³⁷

$$L_u = N + 1 + \sqrt{N + 3/4} \quad (1)$$

its error is estimated as $Err^{(u)} = 1 + \sqrt{N + 3/4}$. This formula produces an asymmetric confidence interval with respect to the mean value, yet nothing

was stated in the HST/COS handbook on the lower boundary of the confidence interval ($L_b$) that was initially estimated:

$$L_b = N - \sqrt{N} \quad (2)$$

with an error $Err^{(b)} = \sqrt{N}$ that is no longer used in CalCOS.

For reference, in the current CalCOS version, there is no straightforward way to implement any other expression of the error bars except for the default one. To illustrate the strong effect of the currently implemented error expression (equation (1)), we show in Extended Data Fig. 4 errors obtained before and after 2013 for the HD 209458 spectrum obtained with the COS/G130M grating³⁸. If we keep the inflated statistical noise estimated in the current CalCOS pipeline, we miss many detections for faint targets.

To remedy the problem of low or zero counts detection, Gehrels assumed single-sided upper and lower confidence limits and used the relation between the Poisson and $\chi^2$ probability functions to derive simplified approximations for each bound of the confidence interval (for example, equations (1) and (2)). One may also consider double-sided confidence intervals but with a lower confidence level than when considering each side of the interval³⁷. The problem is that for low counts signals, the size of the proposed error is comparable with the signal itself, which leads to very low S/N ratio across the entire spectrum that becomes difficult to detect.

Estimating confidence intervals for a Poisson mean is an old problem in statistics. Standard exact confidence intervals tend to be very conservative and too wide, particularly for moderate count levels³⁹. Our approach here is to favour methods that make the confidence interval the narrowest³⁹. Because we are interested in using the confidence interval as a measure of the statistical error, we propose to use the two-sided confidence limits instead of the one-sided confidence limit developed in Gehrels³⁷. In this framework, a few interesting solutions appear when using the classical 68% confidence level, such as the so-called two-sides Rao score confidence limits³⁹:

$$L_{u/b} = N + 1/2 \pm \sqrt{N + 1/4}, \quad (3)$$

with an upper bound error $Err = 1/2 + \sqrt{N + 1/4}$, or the expression proposed in Barker (2002)⁴⁰

$$L_{u/b} = N + 1/4 \pm \sqrt{N + 3/8}, \quad (4)$$

with an upper bound error $Err = 1/4 + \sqrt{N + 3/8}$, or the so-called continuity-corrected Wald interval⁴⁰:

$$L_{u/b} = N \pm \sqrt{N + 1/2}, \quad (5)$$

with an upper bound error $Err = \sqrt{N + 1/2}$, where $\pm$ are for the upper/lower edges of the confidence interval.

Interestingly, the new errors (equations (3–5)) fulfil the same constraints—namely, they trend toward the standard deviation for large N counts and give a finite value at N = 0. However, the confidence interval is now much narrower than the one used in CalCOS.

In the future, we recommend implementing equation (5) in the CalCOS pipeline, or simply going back to the classical standard deviation.

**Comprehensive global modelling of exoplanetary atmospheres.** Next, we provide a detailed description of our framework for the study of the HAT-P-11 system. It includes all levels of the atmosphere and external environment of the exoplanet, starting from the deep interior and reaching up to the magnetosphere and stellar corona (Fig. 1). Below, we describe the models developed separately for each layer and how they connect through boundary conditions.

**Deep-lower atmosphere.** To model the thermal structure and vertical mixing in the deep-lower atmosphere of HAT-P-11 b ($P = 200$ bar, −0.01 mbar), we utilize the Stellar and Planetary Atmospheric Radiation and Circulation (SPARC) model, which couples a two-stream, non-grey radiative transfer code by Marley and McKay⁴¹ with the 3D General Circulation Model (GCM) MITgcm⁴². MITgcm employs the primitive equations, a simplification of the fully compressible fluid equations assuming hydrostatic balance. The radiative transfer code is used to solve for the upward and downward fluxes at each grid point, which in turn are used to derive heating rates to update the wind and temperature fields in the dynamics. SPARC has been extensively used to model the atmospheric circulation of hot Jupiters²⁶,⁴³, sub-Neptunes⁴⁴ and super-Earths⁴⁵.

For each simulation of HAT-P-11 b, we utilize a cubed-sphere grid with a horizontal resolution of C32 (approximately equivalent to 64 × 128 elements in latitude and longitude) and 53 vertical levels. We model six atmospheric compositions: 1-, 3-, 5-, 10-, 30- and 50-times solar abundances. For each metallicity case, all species aside from H₂/He are enhanced by their respective factors. Opacities are calculated at each temperature/pressure point assuming local chemical equilibrium and accounting for condensates rainout, using Lodders¹⁶ elemental abundances.
We estimate eddy diffusion coefficient ($K_{zz}$) profiles in the middle atmosphere using the root-mean-square (rms) vertical velocities derived from the GCM simulations of HAT-P-11 b, by calculating $K_{zz} = w(z)L(z)$. Here $w(z)$ is the limb-averaged rms vertical velocity and $L(z)$ is the atmospheric pressure scale height, both as a function of altitude, $z$.

To save time, we also used the 1D atmosphere ATMO model¹⁷ to generate a forward atmospheric model for the lower atmosphere (100 to $10^{-5}$ bar). ATMO computes the 1D temperature-pressure (T-P) structure of an atmosphere in plane-parallel geometry in radiative, convective and chemical equilibrium. ATMO includes isotropic multi-gas Rayleigh scattering and $H_2-H_3$ and $H_3-He$ collision-induced absorption, as well as opacities for all major chemical species taken from the most up-to-date high-temperature sources, including $H_2O$, $CO_2$, $CO$, $CH_4$, $NH_3$, Na, K, Li, Rb and Cs, TiO, VO and FeH. We generated T-P profiles using 32 correlated k-bands across the 0.2 µm to 1 cm wavelength range, evenly spaced in wavenumber. Spectra were generated using 5,000 correlated k-bands across the same range to resolve spectral features. We used a stellar model for input flux from the host star (for example, the 'Stellar radiation inputs' section). Rainout chemistry was treated following refs. ⁴⁶,⁴⁸, with precipitation depleting condensable species at pressures where the T-P profile crossed the corresponding condensation curve and at higher altitudes. We set the heat redistribution factor to $f=0.5$, which assumes complete redistribution, calculating models for 1- and 50-times solar abundances.

We use both thermal and eddy diffusion altitude profiles as inputs for the following modelling steps of the middle and upper atmospheres.

**Lower-middle atmosphere.** We calculate the chemical composition of HAT-P-11 using a 1D photochemical-thermochemical model²⁷. The model solves kinetically for thermochemical equilibrium in the whole atmosphere, taking into account atmospheric mixing, molecular diffusion and stellar radiation. The thermochemical equilibrium that dominates in the deep atmosphere is described through the microscopic balance of multiple chemical reactions that include species of H/C/N/O/S composition. At lower pressures (different for the various species, but roughly $P<10^{-1}$ bar), the equilibrium is perturbed through atmospheric mixing (described through an eddy mixing profile) and photochemistry. Our modelling includes ion chemistry and spans the $P=200-1$ nbar regime.

The model requires as an input a thermal vertical structure profile for which we combine results from GCM models for the lower atmosphere averaged over the whole planet, with results from the 1D atmospheric escape simulations for the upper atmosphere (Extended Data Fig. 5a). We smoothly join profiles from the lower and upper atmospheres, taking into consideration atmospheric stability—that is, we verify that the atmospheric lapse rate for the assumed temperature structure is sub-adiabatic everywhere. For the assumed atmospheric mixing, we use inputs for the simulated $K_{zz}$ profiles derived from the GCM. For the upper atmosphere, we consider a constant $K_{zz}$ profile at the value defined from the GCM results. From the perspective of the upper atmosphere, the altitude profile of $K_{zz}$ is not critical as long as the resulting eddy mixing is large enough to suppress the heterosphere at the higher altitudes where it might otherwise be formed. It is likely that there is no homopause in the atmosphere of HAT-P-11 b and that separation by mass does not occur. Eddy mixing is superseded by vertical advection at higher altitudes, leaving no role for molecular diffusion. In other words, profiles of $K_{zz} \ge 10^7$ cm$^{-2}$s$^{-1}$ will produce the same fluxes of heavy elements in the upper atmosphere. At pressures higher than 100 bar, we assume that the eddy efficiency will increase due to convection. However, simulations with monotonic eddy profiles in the lower atmosphere demonstrate that the $K_{zz}$ values below 100 bar do not modify our compositional results. Both thermal structure and eddy mixing will change depending on the assumed elemental composition. For the different metallicity cases we study, we use profiles that are interpolated from limiting cases of 1- and 50-times solar metallicity.

Extended Data Fig. 5b,c shows the vertical distributions of typical species in the lower/middle atmosphere of HAT-P-11 b for the 1-times solar metallicity reference case.

**Upper-atmosphere aeronomy.** The aeronomy model is described in Garcia Muñoz²⁸,²⁹. It solves for mass, momentum and energy conservation in the planet's thermosphere-exosphere. The formulation assumes that the hydrodynamic outflow (resulting from stellar X-ray and extreme-UV (XUV) irradiation) is spherically symmetric. The atmosphere is irradiated at zero zenith angle. To account for partial shadowing of the nightside, we reduced the outflow density by a factor of two (for example, Supplementary Discussion 5) We also tested other irradiation zenith angles corresponding to limb-average conditions relevant to transit observations. The model incorporates both neutral and ion photochemistry.

The bottom and top boundaries are placed at a pressure of 10 µbar and at ~18 planetary radii. The simulations were carried out with the H-He-C-O-N-D-CH chemical network²⁸, which includes 46 species of hydrogen, helium, carbon, oxygen, nitrogen and deuterium in 223 chemical reactions. The chemicals are split into 19 neutral species and 27 charged species, including molecules, atoms and thermal electrons. The Lagrangian $L_i$ point that separates the domains where the gravitational field is dominated by the planet or the star is at about 7 planetary

radii above HAT-P-11 b's optical radius. The chemical species in the model are transported by bulk-gas advection, eddy, molecular and ambipolar diffusion²⁷.

The model²⁸ was upgraded to account for cooling by H I atoms excited in electron collisions²⁹, and a newer formulation of $H_3^+$ infrared cooling³⁰. Both H I and $H_3^+$ potentially behave as thermostats at high temperatures. However, their impact on the HAT-P-11 b simulations is relatively minor.

The implemented eddy diffusion coefficient ($K_{zz}=2 \times 10^{10}$ cm$^2$ s$^{-1}$, independent of altitude) is based on the mixing efficiencies inferred from the GCM at overlapping pressure levels. Strong eddy mixing prevents the occurrence of a heterosphere on HAT-P-11 b. Eddy diffusion and advection are the dominant transport mechanisms for bulk gas densities larger and smaller than about $4 \times 10^9$ cm$^{-3}$, respectively. At the bottom boundary, the aeronomy model adopts the gas concentrations calculated by the lower-atmosphere photochemical model at 10 µbar (for example, Extended Data Fig. 5).

Supplementary Table 2 lists the adopted volume-mixing ratios at the bottom boundary, together with the calculated mass loss rates for all the solar metallicity conditions considered (1, 2, 6, 10, 30 and 50 times solar). Extended Data Fig. 5c shows the vertical distributions for typical species in the upper atmosphere of HAT-P-11 b for the 1-times solar metallicity reference case. The derived temperature profile in the upper atmosphere is not too sensitive to the assumed metallicity (Extended Data Fig. 5d). For all metallicities, the bulk flow quickly becomes supersonic at distances above ~2 $R_p$ (Extended Data Fig. 5d).

**Plasmosphere and magnetosphere.** Here we use a PIC electromagnetic/relativistic 3D code, built and validated for the Earth and Mercury magnetospheres³⁰,⁵¹, Earth polar wind³² and recently extended to hot Jupiters HD189733b, WASP-12b and potential exomoon tori³,³¹.

Electrons and ions are represented as macro-particles, each containing a large number of real particles. The code solves the Maxwell equations on a 3D grid:

$$ \frac{\partial \mathbf{B}}{\partial t} = - \nabla \times \mathbf{E} $$

$$ \epsilon_0 \frac{\partial \mathbf{E}}{\partial t} = \mu_0^{-1} \nabla \times \mathbf{B} - \mathbf{J} $$

where $\mathbf{J}$ is the current vector and follows each macro-particle in the simulation box using the Newton-Lorentz motion equation:

$$ \frac{d(\gamma\mathbf{v})}{dt} = q(\mathbf{E} + \mathbf{v} \times \mathbf{B}) + \mathbf{F}_G $$

where $\mathbf{F}_G$ is the gravity force, $\gamma = \sqrt{1 - (v/c)^2}$ is the relativistic motion factor, $t$ is time, $\mathbf{E}$ is the electric field vector, $\epsilon_0$ is the permittivity of free space, $\mu_0$ is the permeability of free space, $q$ is the charge of the macro-particle, $m$ its mass, $v$ its velocity vector, and $c$ is the speed of light.

The technical difficulties inherent to the huge contrast between plasma kinetic scales and the macroscopic scales of the magnetosphere have been extensively discussed in the literature³,⁵,¹,⁵,²,⁵,⁵,⁵,⁴.

The way to address the problem was to scale the plasma parameters to shrink the computing time while keeping most of the physics needed for the macro-system. The adequacy of using a PIC code to study a magnetosphere is discussed in detail in Supplementary Discussion 10.

To answer the question of whether the kinetic spatial scales of the ions are resolved in the PIC model, we derived the gyroradius (defined as $mi^*v_i/(qi^*B)$, where $mi$ is the ion mass, $v_i$ is the local ion's speed perpendicular to the field, $qi$ its charge and $B$ is the local magnetic field), of the two main ions (C II and H II) considered in our study in the $XZ$ plane (Extended Data Fig. 6). The plot shows that the gyroradius of each species is well resolved and the macro-ions have enough space in the simulation box to interact with the magnetic field and complete their gyration motion. In the magnetotail, the gyroradius of macro-ions becomes larger (weaker magnetic field), consistent with the general picture that species are escaping along the tail on straight trajectories. For the stellar wind plasma, the macro-protons enter the simulation box with a gyroradius as large as ~30Δ, which shrinks to small values as soon as the particles start feeling the dipole field. For all plasma sources, the gyroradius for macro-electrons is even smaller by the ion-to-electron mass ratio $mi/me=100$. Therefore, all those scales are well resolved in our simulation, properly describing charge separation and kinetic acceleration of species.

Radiation pressure forces are probably important for the distribution of H I atoms with a moderate opacity but may be safely neglected for C II ions because the C II stellar line is much fainter than the stellar H I Lyα line, and the C II ions are also heavier. For reference, the maximum value of the ratio of radiation pressure force to gravity force for HAT-P-11 is $\beta_{max} \approx 0.02$ for C II (ref. ³⁵), which is too small to affect the dynamics of C II ions that are governed instead by strong electromagnetic forces and the complex magnetospheric current system.

In the PIC code, we adopt the exoplanet magnetic field strength with the range of values assumed in our sensitivity study. Stellar wind properties at the orbital position of the planet are derived from MHD 3D models of the stellar
wind (the 'Stellar wind plasma and interplanetary magnetic field conditions at the orbital position of the exoplanet' section). The exoplanet's (optionally tilted) magnetic field is assumed to be dipolar. The ion-to-electron mass ratio $m_i/m_e = 100$ for macro-protons is large enough to obtain a good separation between opposite charges⁶⁶. The code parameters are selected to yield an ion skin depth that ensures the magnetospheric cavity is properly resolved with the selected grid ($\Delta r = 0.33 R_\odot$), where $r$ is distance from the planet centre⁵⁷,³⁸. The grid fulfils the Courant condition $c\Delta t < \Delta/\sqrt{3}$ ($c=0.5$ is the speed of light and $\Delta t$ is the step time in the code), which helps avoid numerical instabilities⁵⁹. We also adopt a strong condition on the plasma frequency $\omega_p \Delta t < 0.25$, which efficiently reduces plasma instabilities⁵⁹. In addition, we avoid the problem of grid heating⁵⁹ by enforcing that the Debey length remains larger than a critical level $\lambda_D \gtrsim \Delta r/\pi$.

To obtain shielding of charges over the Debey volume, we load five pairs of particles per simulation cell⁵⁹. Macro-ion and macro-electron pairs are randomly and continuously injected to reproduce a spherical outflow around the exoplanet (planetary wind) with the radial kinetic temperature, density and bulk speed provided by the hydro code (for example, the 'Upper-atmosphere aeronomy' section). From the moments of the macro-particle velocity distributions, we derive the plasma number density, temperature and bulk velocity. To calculate the transit absorption, the box distribution is re-oriented in three dimensions to take into account the aberration angle of the nose-magnetotail orientation or any small tilt in the planet's magnetic field ($B_p$) with respect to the spin axis of the rotating planet.

For the HAT-P-11 parameters (for example, the 'Stellar wind plasma and interplanetary magnetic field conditions at the orbital position of the exoplanet' section), the stellar wind is super-magnetosonic at the orbital position of the exoplanet. We use a 3D cartesian simulation box centred at the planet's position in the OX-OY-OZ directions, where OX is the star-planet line, OY is the dawn-dusk direction and OZ is the spin axis.

The stellar wind particles impinge on the OYZ plane, resulting in a total of ~$1.8 \times 10^8$ macro-ion and macro-electron pairs in the box. To produce the planetary wind, we inject planetary macro-protons ($m_i/m_e = 100$) and ionized macro-carbon ($m_{C/\text{H}}/m_\text{p} = 12$, where $m_\text{p}$ is the proton mass) paired with their corresponding macro-electrons, using the species altitude profiles derived from the hydro code. Initial conditions require a Maxwell distribution for all species at the temperature provided by the hydro code. In total, a maximum of ~$8 \times 10^7$ macro-proton and macro-electron pairs, along with a maximum of $8 \times 10^7$ macro-C II and macro-electron pairs, are injected in the system. When required, the code separately tracks a sub-population of any family of particles (such as following C II and their electrons that escape from the exoplanet's polar caps). In the general case, the pressure level (generally above ~$10^{-8}$bar) of the bottom boundary layer of the PIC simulation depends on each atmospheric model used and is derived using the altitude level where electromagnetic forces take over collisional forces, leading to the decoupling between ions and neutrals⁶⁰. A simple diagnostic to check the location of that boundary is to estimate the altitude position (~1.1 to $1.4 R_\odot$) where the ionization fraction is sufficiently high (electron volume-mixing ratio $x_e > \sim 10^{-3}$)⁶⁰. Finally, fields are able to propagate into space without reflection on the facets of the simulation box⁶¹,⁶².

We use our PIC code results to investigate planetary magnetic field lines and typical plasma distributions of different origins for one of our best-fitting $B_p \sim 2.4$ G (Figs. 4 and 5). For the stellar wind plasma (impinging from the left of the figure), we derive the classical structure with a standoff distance at the magnetopause nose located at ~$12R_\odot$ (dayside; Fig. 4c), but with an extended magnetotail (nightside) where a reconnection appears in the field lines around ~$50 R_\odot$ tailward (Fig. 4d). The final configuration is an open magnetosphere with extended parallel field lines on the nightside. We also note the precipitation along field lines of stellar wind particles from the magnetotail equatorial sheet back to the planetary poles (Fig. 4c). For the planetary source, our code recovers the corotation dynamics expected in the plasmasphere and the resulting strong tailward outflow (Fig. 4a,b)⁶³. Finally, our PIC code reproduces many features such as the polar outflows (the exoplanet polar wind; Fig. 5) and the cross-field planetary wind⁶³ (Figs. 4a,b and 5).

**Stellar wind plasma and interplanetary magnetic field conditions at the orbital position of the exoplanet.** The stellar wind conditions at the planetary orbit are calculated using the Alfvén Wave Solar Model⁶⁴. The model calculates the non-ideal MHD solution for the stellar corona and stellar wind, taking into account coronal heating and wind acceleration by Alfvén waves, as well as coronal thermodynamics, radiative cooling and electron heat conduction. The model is driven by observations of the surface radial magnetic field of the magnetograms for the solar case and Zeeman-Doppler imaging⁶⁵ for the stellar case. This approach has been used in stellar corona and wind simulations of various systems—for example, Sun⁶⁶, HD189733 (ref. ⁶⁷) and so on. No magnetic field data are currently available for HAT-P-11. We searched for the most similar system with available Zeeman-Doppler-imaging data and found HD189733, with the following parameters for HD189733 (former) and HAT-P-11 (latter): spectral type: K1.5, K4; age: ~1, 6+6/-4 Gyr; radius of star: 0.8, 0.7 $R_\odot$; mass of star: 0.8, 0.7 $M_\odot$; period = 12, 29 days. Recent work on HD189733 confirms an average equatorial stellar magnetic field strength of ~30 G (ref. ⁶⁸). However, HAT-P-11 might be older and it is a slower rotator; although, the stellar Ca II chromospheric activity is lower

than HD189733's, but not as low as the average sun. Using standard correlations between surface magnetic field strength and age, and strength and rotation⁶⁹, we derive a field strength of ~1–2 G for HAT-P-11, similar to the Sun. We considered both a scaled Zeeman-Doppler-imaging magnetic field map of HD189733 and the magnetic field map for solar maximum activity conditions (Carrington Rotation map (CR1962) around year 2000). We ran our MHD model for both magnetic field conditions but with the intrinsic parameters of HAT-P-11. At the exoplanet orbit around the transit's phase, the two MHD simulations converge on stellar wind parameters in the range (1.3–1.5) × 10⁶ K for the temperature, 500–600 km s⁻¹ for the speed and ~3.3 × 10³ cm⁻³ for the density (for example, Extended Data Fig. 7 for the temperature distribution).

The MHD 3D-predicted coronal temperature is ~3 × 10⁶ K, which compares with the temperature range derived from X-ray Multi-mirror observations of HAT-P-11 (see below). We also tested the Parker model with coronal temperatures derived from the X-ray observations and found stellar wind speeds at the exoplanet orbital position similar to those from MHD simulations. The MHD 3D code is, however, superior because it provides the stellar wind (SW) plasma and field variable conditions at the exoplanet's position along its eccentric and nearly polar orbit.

We note that without direct stellar wind data, and with the uncertainties associated with the transit observations (for example, the 'HST data description, analysis and calibration' section) and the large number of parameters describing the star-planet system, a detailed study of the stellar corona and wind of HAT-P-11 becomes impractical. We thus focus on a range of stellar parameters that are consistent both with X-ray observations and MHD 3D models, leading to the stellar wind ram pressure and plasma properties in the range displayed in Supplementary Table 3.

**Stellar radiation inputs.** Stellar XUV spectrum reconstruction. The absorption of photons with $\lambda < 912$ Å in the ISM prevents the detection of extreme-UV radiation ($\lambda \approx 100-912$ Å) from almost every star. The XUV (~1–912 Å, X-ray + extreme-UV) spectrum of a late-type star is dominated by continuum and emission lines originating from the material at $\log T$ [K] ≈ 4–8 present in the transition region and corona⁷⁰. To model the spectral energy distribution in the XUV, we built a model of the emitting material in these layers, using X-ray spectra originated at the hottest temperatures and far-UV spectral lines formed at lower temperatures⁷⁰.

We use XMM-Newton data, complemented with the HST far-UV spectrum from this work. XMM-Newton observed HAT-P-11 on 19 May 2015 (Observation ID 764100701) using the three EPIC cameras (EPIC-pn, 16.9ks; EPIC-MOS1, 28.9ks; and EPIC-MOS2, 29.1ks), with a combined S/N ratio of 13.2. We fit spectra following standard procedures within ISIS, the Interactive Spectral Interpretation System⁷¹ software and complemented the coronal (and transition region) model with the far-UV line fluxes measured.

We generated a synthetic spectral energy distribution in the range $\lambda = 1-1200$ Å using this model (for example, more details in Supplemental Discussion 11). The derived extreme-UV (10–92 nm) luminosity is $L_{\text{extreme-UV}} \approx 4.01 \times 10^{24}$ erg s⁻¹ and the X-ray portion (0.5–10 nm) is $L_X \approx 2.36 \times 10^{27}$ erg s⁻¹, which are consistent with early calculations⁷². The final XUV spectrum is shown in Extended Data Fig. 2b.

**Stellar FUV-infrared spectrum reconstruction.** HAT-P-11 is a K2-K4V main-sequence star. To construct its full spectral radiation flux, we start from the stellar spectrum of Eps Eri (K2V) that was reconstructed from observations and provided in the MUSCLES database⁷³. As a first step, we subtract a PHOENIX continuum model (BT-NEXTGEN, 2009; $T_{\text{eff}} = 5000$; Log(g) = 4.5; solar metallicity) that fits the Eps Eri spectrum in the long wavelength range, and add another PHOENIX model with the HAT-P-11 parameters ($T_{\text{eff}} = 4700$, Log(g) = 4.5, two times solar metallicity). Because we have no near-UV observations for HAT-P-11, nor observations of the longest wavelengths in the far-UV, we keep the same observed Eps Eri flux for that spectral range (143.0–300 nm) after correcting for the distance and size of stellar discs (see Supplementary Discussion 11 for more details).

For the far-UV range (115.0–143.0 nm), we use our COS G130M observations for most lines and STIS 140M observations to reconstruct the Lyα line (Extended Data Fig. 2a). Because of the large radial velocity of the star, most thin lines, like in the C II 133.5 nm doublet, are not affected by the ISM absorption. However, the Lyα line is still strongly affected because it is particularly broad. Starting with a symmetric intrinsic stellar Lyα line⁷⁴, we obtain a reasonable fit to the observed line profile with an ISM H I column density of ~5 × 10¹⁸ cm⁻² along the line of sight toward the star (Extended Data Fig. 2a). For the XUV range, we replaced the Eps Eri spectrum with the one reconstructed in the 'Stellar XUV spectrum reconstruction' section. We used the final full stellar spectrum, shown in Extended Data Fig. 2b, as the input for all the theoretical modelling used in the present study.

**Lyα transit interpretation and modelling.** The H I Lyα transit has been used extensively as a direct diagnostic of the evaporation and related mass loss from exoplanets¹,²,⁴. Several scenarios for explaining the observations have been proposed, mainly related to thermal atoms absorption, ENAs production or radiation-accelerated atoms¹¹,³²,⁷⁵⁻⁷⁷.
Here we compare the absorption by a spherical cloud derived based on the H I radial distribution obtained by our hydro code with the ~14–32% Lyα transit depth observed by HST/STIS for HAT-P-11 b (for example, Fig. 2). Our results show that for 1–150 times solar metallicity, the model Lyα transit absorption, ~4.2–3.9%, falls short of the observed level for the spectral range shown in Fig. 2.

To take into account the key properties of the plasma distribution around the exoplanet, we consider a simplified model with only two populations of neutral atomic hydrogen. The first is the primary H I population from the hydro code described above. The secondary H I population is created by the first resonance charge-exchange reaction between one proton of the plasma in the magnetosphere (of planetary or SW origin) and one neutral of the primary H I population.⁷⁸ In this process, the newly created neutral H I has the same velocity distribution as the parent proton ("p" + H I → "H I + p"). Ripken and Fahr⁷⁹ approximate the production rate of neutrals from charge exchange as:

$$P(\mathbf{r}, \mathbf{v}) \approx \sigma(v_{\text{rel}}^{+}) \times v_{\text{rel}}^{+}(\mathbf{r}, \mathbf{v}) \times n_{\text{H I}}(\mathbf{r}) \times f_{\text{p+}}(\mathbf{r}, \mathbf{v}) \quad (6)$$

where $v_{\text{rel}}^{+}(\mathbf{r}, \mathbf{v})$ is the average relative velocity of all neutrals with respect to protons of velocity $\mathbf{v}$, $n_{\text{H I}}(\mathbf{r})$ is the density of primary H I (from hydro code), $f_{\text{p+}}(\mathbf{r}, \mathbf{v})$ is the velocity distribution of protons (PIC code), $\mathbf{r}$ is the position vector, and $\sigma(v_{\text{rel}}^{+})$ is the charge-exchange cross section, which is velocity dependent.⁸⁰ For the destruction rate we use a similar approximation but for all protons with respect to neutral atoms of velocity $\mathbf{v}$:

$$L(\mathbf{r}, \mathbf{v}) \approx \sigma(v_{\text{rel}}^{-}) \times v_{\text{rel}}^{-}(\mathbf{r}, \mathbf{v}) \times n_{\text{p+}}(\mathbf{r}) \times f_{\text{H I}}(\mathbf{r}, \mathbf{v}) = \Gamma_{\text{ext}}(\mathbf{r}, \mathbf{v}) \times f_{\text{H I}}(\mathbf{r}, \mathbf{v}) \quad (7)$$

where $v_{\text{rel}}^{-}(\mathbf{r}, \mathbf{v})$ is the average relative velocity of all protons with respect to neutral H-atoms of velocity $\mathbf{v}$, and $\Gamma_{\text{ext}}(\mathbf{r}, \mathbf{v})$ is the destruction frequency.⁷⁸ The production term that contributes to the transport equation for the secondary population (equation (6)) is proportional to the H II ion velocity distribution, whereas the destruction term (equation (7)) is proportional to the number density of the same ions.

Another limitation of the model used here is the neglect of radiation pressure and stellar gravity,⁷⁵ an acceptable approximation when the hydrogen cloud is optically thick as it is the case here.⁷⁵ Our simplified model for the Lyα transit absorption demonstrates the importance of taking into account magnetospheric processes, yet more work is needed to obtain a self-consistent model of the H I distribution around a magnetized outflowing exoplanet. A full kinetic treatment of the problem in three dimensions, coupled with the 3D PIC plasma code is underway and will be presented in a forthcoming study.

**Sensitivity to model assumptions and overall error, and the robustness of the results.** In Supplementary Discussion 5, we address the importance of feedback between modules (described in the 'Comprehensive global modelling of exoplanetary atmospheres' section) and how taking them into account impacts our conclusions. In addition, we assess the sensitivity of our results to model assumptions and evaluate the corresponding impact on the overall error. The arguments provided in Supplementary Discussion 5 reinforce the robustness of our results regarding the B strength of HAT-P-11 b and its atmospheric metallicity.

Here we summarize the main strengths of our approach:

* Our finding about the low metallicity of HAT-P-11 b is consistent with results from an independent and simultaneous study using spectrally extended optical/infrared HST transit observations and a quite different approach that probes the planet's lower atmosphere.¹³

* Our global model predicts the right Doppler-shift speed for two distinct species (C II and H I), particularly the speed ratio (~2), which cannot be explained by simple considerations. In addition, this ratio seems consistent with similar finding reported for O II and H II speeds with a ratio of ~2.6 that is observed in the polar wind at ~9 $R_{\text{Earth}}$ from Earth.⁸¹

* We provide enough details and predictions that it can be further tested with future observations/modelling. For example, the phase-extended light curve and the spectral shape of the transit absorption for distinct species can be immediately improved with dedicated HST observations. Also, the expected internal energy that we predict to sustain the dynamo process of the planet can be tested with future James Webb Space Telescope infrared observations of the exoplanet thermal emission during secondary eclipse (see Supplementary Discussion 6). Finally, we provide enough details about the plasma properties in the HAT-P-11 b atmosphere–magnetosphere that they can be cross-checked with distinct simulation tools such as using multi-fluid MHD or hybrid codes.

All arguments discussed above reinforce the robustness of our results and give us enough confidence in the reported conclusions.

## Data Availability

The data that support the plots within this paper and other findings of this study are available from the corresponding author upon reasonable request. HST reduced data are available to the public through https://archive.stsci.edu/ using the dataset names shown in Supplementary Table 1. An ASCII version of the HAT-P-11 stellar

spectrum shown in Extended Data Fig. 2b can be downloaded here: https://doi.org/10.48392/lbj-001.

## Code Availability

All the codes used in this study have been employed in the past for published work and references are provided in the manuscript. Those references include enough detail to make the model predictions reproducible. The PIC code is an old version of the Tristan code that is available to the public through Github: https://github.com/ntoles/tristan-mp-pitp.

Received: 23 October 2019; Accepted: 31 August 2021;

Published online: 16 December 2021

## References

1. Vidal-Madjar, A. et al. An extended upper atmosphere around the extrasolar planet HD209458b. Nature 422, 143–146 (2003).

2. Ben-Jaffel, L. Exoplanet HD209458b: inflated hydrogen atmosphere but no sign of evaporation. Astrophys. J. Lett. 671, L61–L64 (2007).

3. Ben-Jaffel, L. & Ballester, G. Hubble Space Telescope detection of oxygen in the atmosphere of exoplanet HD189733b. Astron. Astrophys. 553, A52 (2013).

4. Ehrenreich, D. et al. A giant comet-like cloud of hydrogen escaping the warm Neptune-mass exoplanet GJ 436b. Nature 522, 459–461 (2015).

5. Sing, D. K. et al. The Hubble Space Telescope PanCET program: exospheric Mg II and Fe II in the near-UV transmission spectrum of WASP-12b using jitter decorrelation. Astron. J. 158, 91 (2019).

6. García Muñoz, A. et al. A heavy molecular weight atmosphere for the super Earth π Men c. Astrophys. J. Lett. 907, L36 (2021).

7. André, M. Previously hidden low-energy ions: a better map of near-Earth space and the terrestrial mass balance. Phys. Scr. 90, 128005 (2015).

8. Turner, J. D. et al. The search for radio emission from the exoplanetary systems 55 Cancri, υ Andromedae, and τ Boötis using LOFAR beam-formed observations. Astron. Astrophys. 645, A59 (2021).

9. Shkolnik, E., Walker, G. A. H. & Bohlender, D. A. Evidence for planet-induced chromospheric activity on HD 179949. Astrophys. J. 592, 1092–1096 (2003).

10. Cauley, P. W., Shkolnik, E. L., Llama, J. & Lanza, A. F. Magnetic field strengths of hot Jupiters from signals of star-planet interactions. Nat. Astron. 3, 1128–1134 (2019).

11. Kislyakova, G., Holmström, M., Lammer, H., Odert, P. & Khodachenko, M. L. Magnetic moment and plasma environment of HD 209458b as determined from Lyα observations. Science 346, 981–984 (2014).

12. Bakos, G. A. et al. HAT-P-11b: a super-Neptune planet transiting a bright K star in the Kepler field. Astrophys. J. 710, 1724 (2010).

13. Huber, K. F., Czesla, S. & Schmitt, J. H. M. M. Discovery of the secondary eclipse of HAT-P-11b. Astron. Astrophys. 597, A113 (2017).

14. Fraine, J. et al. Water vapour absorption in the clear atmosphere of a Neptune-sized exoplanet. Nature 513, 526–529 (2014).

15. Chachan, Y. et al. A Hubble PanCET Study of HAT-P-11b: a cloudy Neptune with a low atmospheric metallicity. Astron. J. 158, 244 (2019).

16. Mansfield, M. et al. Detection of helium in the atmosphere of the exo-Neptune HAT-P-11b. Astrophys. J. Lett. 868, L34 (2018).

17. Deming, D. et al. Kepler and ground-based transits of the exo-Neptune HAT-P-11b. Astrophys. J. 740, 33 (2011).

18. Sanchez-Ojeda, R. & Winn, J. N. Starspots, spin-orbit misalignment, and active latitudes in the HAT-P-11 exoplanetary system. Astrophys. J. 743, 61 (2011).

19. Yee, S. W. et al. HAT-P-11: discovery of a second planet and a clue to understanding exoplanet obliquities. Astron. J. 155, 255 (2018).

20. Grzedzielski, S., Macek, W. & Oberc, P. Expected immersion of Saturn's magnetosphere in the Jovian magnetic tail. Nature 292, 615–616 (1981).

21. McComas, D. J. et al. Diverse plasma populations and structures in Jupiter's magnetotail. Science 318, 217–220 (2007).

22. Haaland, S. et al. in Magnetosphere–Ionosphere Coupling in the Solar System Geophysical Monograph 222, Ch. 3 (eds Chappell, C. R. et al.) (Wiley, 2017).

23. Thorngren, D. P., Fortney, J. J., Murray-Clay, R. A. & Lopez, E. D. The mass–metallicity relation for giant planets. Astrophys. J. 831, 64 (2016).

24. Stevenson, D. J. Planetary magnetic fields. Rep. Prog. Phys. 46, 555–620 (1983).

25. Basu, S. & Antia, H. M. Helioseismology and solar abundances. Phys. Rep. 457, 217–283 (2008).

26. Kataria, T. et al. The atmospheric circulation of a nine-hot-Jupiter sample: probing circulation and chemistry over a wide phase space. Astrophys. J. 821, 9 (2016).

27. Lavvas, P., Koskinen, T. & Yelle, R. V. Electron densities and alkali atoms in exoplanet atmospheres. Astrophys. J. 796, 15 (2014).

28. García Muñoz, A. Formulation of molecular diffusion in planetary atmospheres. Planet. Space Sci. 55, 1414–1425 (2007).
29. García Muñoz, A. Physical and chemical aeronomy of HD 209458b. *Planet. Space Sci.* **55**, 1426–1455 (2007).

30. Baraka, S. & Ben-Jaffel, L. Impact of solar wind depression on the dayside magnetosphere under northward interplanetary magnetic field. *Ann. Geophys.* **29**, 31–46 (2011).

31. Ben-Jaffel, L. & Ballester, G. Transit of exomoon plasma tori: new diagnosis. *Astrophys. J. Lett.* **785**, L30 (2014).

32. Ben-Jaffel, L. Spectral, spatial, and time properties of the hydrogen nebula around exoplanet HD 209458b. *Astrophys. J.* **688**, 1352 (2008).

33. Beky, B., Holman, M. J., Kipping, D. M. & West, R. Stellar rotation-planetary orbit period commensurability in the HAT-P-11 system. *Astrophys. J.* **788**, 1 (2014).

34. Morris, B. M. et al. Chromospheric activity of HAT-P-11: an unusual active planet-hosting K star. *Astrophys. J.* **848**, 58 (2017).

35. Rathore, B., Pereira, T. M., Carlsson, M. & De Pontieu, B. The formation of IRIS diagnostics VIII. IRIS observations of the C II 133.5 nm multiplet. *Astrophys. J.* **814**, 70 (2015).

36. Hill, T. W. Inertial limit on corotation. *J. Geophys. Res. Space Phys.* **S84**, 6554–6559 (1979).

37. Gehrels, N. Confidence limits for small numbers of events in astrophysics. *Astrophys. J.* **303**, 336 (1986).

38. Ballester, G. B. & Ben-Jaffel, L. Re-visit of HST FUV observations of the hot-Jupiter system HD 209458: no Si II detection and the need for COS transit observations. *Astrophys. J.* **804**, 116 (2015).

39. Swift, M. B. Comparison of confidence intervals for a Poisson mean—further considerations. *Commun. Stat. Theory Methods* **38**, 748–759 (2009).

40. Barker, L. A comparison of nine confidence intervals for a Poisson parameter when the expected number of events is $\le 5$. *Am. Stat.* **56**, 85–89 (2002).

41. Marley, M. S. & McKay, C. P. Thermal structure of Uranus' atmosphere. *Icarus* **138**, 268–286 (1999).

42. Adcroft, A., Campin, J. M., Hill, C. & Marshall, J. Implementation of an atmosphere ocean general circulation model on the expanded spherical cube. *Mon. Weather Rev.* **132**, 2845–2863 (2004).

43. Showman, A. P. et al. Atmospheric circulation of hot Jupiters: coupled radiative–dynamical general circulation model simulations of HD189733b and HD 209458b. *Astrophys. J.* **699**, 564 (2009).

44. Lewis, N. K. et al. Atmospheric circulation of eccentric hot Neptune GJ 436b. *Astrophys. J.* **720**, 344 (2010).

45. Kataria, T. et al. The atmospheric circulation of the super Earth GJ 1214b: dependence on composition and metallicity. *Astrophys. J.* **785**, 92 (2014).

46. Lodders, K. Solar system abundances and condensation temperatures of the elements. *Astrophys. J.* **591**, 1220–1247 (2003).

47. Tremblin, P. et al. Fingering convection and cloudless models for cool brown dwarf atmospheres. *Astrophys. J. Lett.* **804**, L17 (2015).

48. Burrows, A. & Sharp, C. M. Chemical equilibrium abundances in brown dwarf and extrasolar giant planet atmospheres. *Astrophys. J.* **512**, 843 (1999).

49. Black, J. H. The physical state of primordial intergalactic clouds. *Mon. Not. R. Astron. Soc.* **197**, 553–563 (1981).

50. Miller, S., Stallard, T., Tenneyson, J. & Melin, H. Cooling by H3(+) emission. *J. Phys. Chem. A* **117**, 9770–9777 (2013).

51. Wodnicka, E. B. On a magnetosphere disturbed by solar wind; observations of macroelectrons. *Ann. Geophys.* **27**, 2331–2339 (2009).

52. Barakat, A. & Schunk, R. W. A three-dimensional model of the generalized polar wind. *J. Geophys. Res. Space Phys.* **111**, A12314 (2006).

53. Cai, D., Ismaieli, A., Lenbège, B. & Nishikawa, K.-I. Cusp dynamics under northward IMF using three-dimensional global particle-in-cell simulations. *J. Geophys. Res. Space Phys.* **120**, 8368–8386 (2015).

54. Toth, G. et al. Scaling the ion inertial length and its implications for modeling reconnection in global simulations. *J. Geophys. Res. Space Phys.* **122**, 10336–10355 (2017).

55. Lagrange, A. M. et al. The β Pictoris circumstellar disk. XXIV. Clues to the origin of the stable gas. *Astron. Astrophys.* **330**, 1091–1108 (1998).

56. Gargaté, L. & Spitkovsky, A. Ion acceleration in non-relativistic astrophysical shocks. *Astrophys. J.* **744**, 67 (2012).

57. Omidi, N., Blanco-Cano, X., Russell, C. T. & Karimabadi, H. Dipolar magnetospheres and their characterization as a function of magnetic moment. *Adv. Space Res.* **33**, 1996–2003 (2004).

58. Moritaka, T., Kajimura, Y., Usui, H., Matsumoto, M. & Matsui, T. Momentum transfer of solar wind plasma in a kinetic scale magnetosphere. *Phys. Plasmas* **19**, 032111 (2012).

59. Tskhakaya, D., Matyash, K., Schneider, R. & Taccogna, F. The particle-in-cell method. *Contrib. Plasma Phys.* **47**, 563–594 (2007).

60. Koskinen, T. et al. Electrodynamics on extrasolar giant planets. *Astrophys. J.* **796**, 16 (2014).

61. Buneman, O. in *Computer Space Plasma Physics: Simulation Techniques and Software*, Ch. 3 (eds Mastumoto, H. & Omura, Y.) (TERRA, 1993).

62. Lindman, E. L. "Free-space" boundary conditions for the time dependent wave equation. *J. Comp. Phys.* **18**, 66–78 (1975).

63. Lemaire, J. & Shunck, R. W. Plasmaspheric wind. *J. Atmos. Terr. Phys.* **54**, 467–477 (1992).

64. van der Holst, B. et al. Alfvén Wave Solar Model (AWSoM): coronal heating. *Astrophys. J.* **782**, 82 (2014).

65. Donati, J.-F. & Semel, M. Zeeman-Doppler imaging—a new option for magnetic field study of AP and solar-type stars. *Sol. Phys.* **128**, 227–242 (1999).

66. Cohen, O. et al. A semiempirical magnetohydrodynamical model of the solar wind. *Astrophys. J. Lett.* **654**, L163–L166 (2007).

67. Cohen, O. et al. The dynamics of stellar coronae harboring hot Jupiters. I. A time-dependent magnetohydrodynamic simulation of the interplanetary environment in the HD189733 planetary system. *Astrophys. J.* **733**, 67 (2011).

68. Fares, R. et al. MOVES I. The evolving magnetic field of the planet-hosting star HD189733. *Mon. Not. R. Astron. Soc.* **471**, 1246–1257 (2017).

69. Vidotto, A. et al. Stellar magnetism: empirical trends with age and rotation. *Mon. Not. R. Astron. Soc.* **441**, 2361–2374 (2014).

70. Sanz-Forcada, J. et al. Estimation of the XUV radiation onto close planets and their evaporation. *Astron. Astrophys.* **523**, A6 (2011).

71. Houck, J. C. & Denicola, L. A. ISIS: An interactive spectral interpretation system for high resolution X-ray spectroscopy. In *Astronomical Data Analysis Software and Systems IX*, ASP Conference Series 216 (eds Manset, N. et al.) 591–594 (Astronomical Society of the Pacific, 2000).

72. Nortmann, L. et al. Ground-based detection of an extended helium atmosphere in the Saturn-mass exoplanet WASP-69b. *Science* **362**, 1388–1391 (2018).

73. France, K. et al. The MUSCLES Treasury survey. I. Motivation and overview. *Astrophys. J.* **820**, 89 (2016).

74. Wood, B. & Linsky, J. L. The local ISM and its interaction with the winds of nearby late-type stars. *Astrophys. J.* **492**, 788 (1998).

75. Bourrier, V. et al. Hubble PanCET: an extended upper atmosphere of neutral hydrogen around the warm Neptune GJ 3470b. *Astron. Astrophys.* **620**, A147 (2018).

76. Shaikislamov, I. F. et al. Two regimes of interaction of a hot Jupiter's escaping atmosphere with the stellar wind and generation of energized atomic hydrogen corona. *Astrophys. J.* **832**, 173 (2016).

77. Khodachenko, M. L. et al. Lyα absorption at transits of HD 209458b: a comparative study of various mechanisms under different conditions. *Astrophys. J.* **847**, 126 (2017).

78. Osterbart, R. & Fahr, H. J. A Boltzmann-kinetic approach to describe the entrance of neutral interstellar hydrogen into the heliosphere. *Astron. Astrophys.* **264**, 260–269 (1992).

79. Ripken, H. W. & Fahr, H. J. Modification of the local interstellar gas properties in the heliosphere interface. *Astron. Astrophys.* **122**, 181–192 (1983).

80. Maher, L. J. & Tinsley, B. A. Atomic hydrogen escape rate due to charge exchange with hot plasmaspheric ions. *J. Geophys. Res. Space Phys.* **82**, 689–695 (1977).

81. Yau, A. W., Abe, T. & Peterson, W. K. The polar wind: recent observations. *J. Atmos. Terr. Phys.* **69**, 1936–1983 (2007).

## Acknowledgements

We are very grateful to the staff at the Space Telescope Science Institute, in particular to P. Royle, S. Penton, W. Januszewski and J. Debes, for their careful work in the scheduling of our observations and for various instrument insights. We also thank C. Carvalho at the Institut d'Astrophysique de Paris and T. Forrester at the Lunar & Planetary Laboratory for the setup and managing of various computing resources for this project. We thank V. Bourrier, D. Ehenreich and A. Lecavelier for helpful discussions about the analysis of the Lyα transit data. L.B.-J. and P.L. acknowledge support from the Centre National des Etudes Spatiales CNES (France) and the Centre National de la Recherche Scientifique (CNRS) under project PACES. All US co-authors acknowledge support from the Space Telescope Science Institute under the PanCET GO 14767 programme, and G.E.B., G.W.H. and T.K. were also funded under GO 14625. This work is based on observations with the National Aeronautics and Space Administration/European Space Agency HST, obtained at the Space Telescope Science Institute operated by AURA, Inc. This work is also based on observations with XMM-Newton.

## Author contributions

L.B.-J. led the data analysis with contributions from G.E.B and identified the problem and solution for the current COS pipeline derivation of errors. He defined and planned over time the 3D PIC magnetospheric simulations and the post-processing of the large set of plasma data that enabled the reported analysis. He also defined the H I interactions with protons. He defined the final strategy and reasoning to disentangle the different parameters of the problem and get the different results summarized in Table 1. He used a Parker model for the stellar wind definition. He also derived a simplified model regarding the magnetic field strength and internal heat of the planet. He prepared the final draft with contributions from G.E.B. in particular and other co-authors as described below. G.E.B. initiated the multifaceted far-UV approach to the study of HAT-P-11 b in heavy metals versus H I, and, with L.B.-J. and A.G.M.,
led the definition and implementation of the cascading modelling scheme and its
implementation by other co-investigators under both HST programmes and other
related work. She led and conducted the HST far-UV observations and closely interacted
with L.B.-J. on most aspects of the work, in particular with in-depth discussions of the
general magnetospheric science including the need to resolve the effects of metallicity
versus field strength from signatures in the data. She worked on several aspects of the
publication including writing some sections. A.G.M. also provided the photochemistry
hydro code modelling and contributed to the data interpretation and paper writing.
He wrote the 'Upper-atmosphere aeronomy' section in the Methods. P.L. provided the
lower-atmosphere chemistry code modelling and contributed to the data interpretation
and paper writing. He wrote the 'Lower-middle atmosphere' section in the Methods.
D.K.S. contributed to the implementation of the HST observing programme, 1D lower
atmospheric modelling, interpretation and contributed to writing the 'Deep-lower
atmosphere' section in the Methods and the paper in general. J.S.-F. was responsible for
the X-ray observations obtained for this project. He analysed the X-ray data, modelled
the XUV emission and conducted its interpretation with discussion with G.E.B and
L.B.-J. He wrote the 'Stellar XUV spectrum reconstruction' section in the Methods
with contributions from L.B.-J. and G.E.B. O.C. applied his MHD code and solar and
stellar wind expertise to model HAT-P-11 b. He wrote the 'Stellar wind plasma and
interplanetary magnetic field conditions at the orbital position of the exoplanet' section
in the Methods with contributions from L.B.-J. T.K. provided the 3D GCM models and
contributed to writing the 'Deep-lower atmosphere' section in the Methods. G.W.H.
obtained the optical monitoring of the star activity that was used in two PanCET

publications and contributed to the paper writing. L.B., T.M.-E. and H.R.W. contributed to the paper writing. M.L.-M. contributed to the obtention of the HST time and the preparation of the HST observations to collect the data presented in the manuscript. She contributed to the paper writing. All authors contributed at different levels to the definition of the PanCET concept that is applied here.

**Competing interests**

The authors declare no competing interests.

**Additional information**

**Extended data** is available for this paper at https://doi.org/10.1038/s41550-021-01505-x.

**Supplementary information** The online version contains supplementary material available at https://doi.org/10.1038/s41550-021-01505-x.

**Correspondence and requests for materials** should be addressed to Lotfi Ben-Jaffel.

**Peer review information** *Nature Astronomy* thanks the anonymous reviewers for their contribution to the peer review of this work.

**Reprints and permissions information** is available at www.nature.com/reprints.

**Publisher's note** Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

© The Author(s), under exclusive licence to Springer Nature Limited 2021
<figure><img src="image_12.png" /></figure>

**Extended Data Fig. 1** | Lyman alpha model fit. One of our best models fit (B = 2.4 G, 2.35 x solar metallicity) compared to HAT-P-11b Lya line profiles observed at selected phases of the transit event (HST visit 1 & 2 averaged). We show the out-of-transit Lya line profile (average of orbit 1 of the two visits, black), in-transit observed line profile (red), and model best fit for the selected phase (cyan). Error bars represent the 1σ statistical uncertainties. **a**, HST orbit 5. **b**, HST orbit 4. **c**, HST orbit 3 (see Fig. 2 main draft for details).
<figure><img src="image_13.png" /></figure>

<figure><img src="image_14.png" /></figure>

**Extended Data Fig. 2** | Stellar spectrum. **a**, Reconstruction of the intrinsic profile (solid line) of the Lyα line of HAT-P-11 using observations (histogram) and best fit model with an ISM [H I] ~ 4 ×10¹⁸ cm⁻² (dashed). **b**, HAT-P-11 full spectrum reconstructed at 1 AU from the star. The spectrum, in the range 1-54997 Å, is used as an input for all theoretical models developed in this comprehensive study. An ascii file of the spectrum is provided online.
<figure><img src="image_15.png" /></figure>

<figure><img src="image_16.png" /></figure>

Extended Data Fig. 3 | See next page for caption.
**Extended Data Fig. 3** | **Light curves variability.** Transit light curves of HAT-P-11 versus time variability. **a**, Integrated flux of C II 133.45 nm (red) and C II 133.57 nm lines (black, scaled by the two lines' mean flux ratio ~1.41) versus time measured from the transit central time $T_c$. For clarity, dates of observations are only shown for the first HST orbit (time from mid-transit = -0.375), the other exposures being separated by a multiple of the HST orbit (1.5 h). **b**, Normalized flux of FUV chromosphere lines. We notice a flare event during the fifth HST orbit of the transit observed on December 21 2016 (blue) in the Si III and Si IV lines, an activity that is not visible in the C II lines. An extended but weaker activity also appears at most orbital phases during the May 21 2017 transit (olive) for the Si III and Si IV lines but not for the C II lines.
<figure><img src="image_17.png" /></figure>

**Extended Data Fig. 4** | HST COS Error. HD 209458 exposure lb4m05knq obtained with COS G130M on Oct. 2, 2009 (Ballester & Ben-Jaffel, 2015)³⁸. The stellar C II 1335 Å doublet spectrum (black) is compared to the statistical errors derived with the old (olive, e.g., CALCOS 2.14.4 or 2.18.5) and new (red, CALCOS 3.1.8) calibration pipelines. With the new pipeline errors (red), any detection of a transit absorption would be impossible. The new and highly inflated pipeline errors would also render the basic shape of the FUV spectrum of HD 209458 unmeasurable while other FUV dataset for this sunlike star are available (e.g., with HST STIS/G140L, STIS/Echelle data).
<figure><img src="image_18.png" /><figcaption>**Extended Data Fig. 5** | Middle and upper atmosphere models. **a**, Atmospheric thermal structure (black lines) and eddy mixing (blue lines) for the atmosphere of HAT-P-11 b, under different assumptions of metallicity. The thermal profile is consistent with the conditions at lower atmosphere (section I) and upper atmosphere (section III). **b**, Model of species mole fraction distribution in the lower-middle atmosphere of HAT-P-11 b under the assumption of solar metallicity and thermal structure shown in **a**. **c**, Model of species distribution in the upper atmosphere of HAT-P-11 b based on mixing ratios displayed on **a** & **b**. **d**, Temperature and velocity distributions corresponding to upper atmosphere shown in **c**.</figcaption></figure>
<figure><img src="image_19.png" /><figcaption>HAT P 11b : $B_p = 4.8$ G</figcaption></figure>

**Extended Data Fig. 6** | Plasma gyroradii. 2D distribution of gyroradius of individual species in the noon-midnight plane. **a**, Planetary protons.

**b**, Planetary C II. **c**, Stellar wind protons. For electrons (not shown), the gyroradius should be mi/me=100 smaller. For the three plasma sources and for electrons, those scales are well resolved in our simulation, which allows us to properly describe charge separation and kinetic acceleration of species that are needed in the present study (see Supplementary Discussion X & 'Plasmasphere and magnetosphere' in the Methods for more details).
<figure><img src="image_20.png" /><figcaption>**Extended Data Fig. 7** | MHD coronal model. Temperature distribution in the exoplanet's orbital plane extracted from MHD 3D model simulation of HAT-P-11 wind (see 'Stellar wind plasma and interplanetary magnetic field conditions at the orbital position of the exoplanet' in the Methods for more details).</figcaption></figure>