Capacitance-Power-Hysteresis Trilemma in Nanoporous Supercapacitors

Nanoporous supercapacitors are an important player in the field of energy storage that fill the gap between dielectric capacitors and batteries. The key challenge in the development of supercapacitors is the perceived trade-off between capacitance and power delivery. Current efforts to boost the capacitance of nanoporous supercapacitors focus on reducing the pore size so that they can only accommodate a single layer of ions. However, this tight packing compromises the charging dynamics and hence power density. We show via an analytical theory and Monte Carlo simulations that charging is sensitively dependent on the affinity of ions to the pores, and that high capacitances can be obtained for ionophobic pores of widths significantly larger than the ion diameter. Our theory also predicts that charging can be hysteretic with a significant energy loss per cycle for intermediate ionophilicities. We use these observations to explore the parameter regimes in which a capacitance-power-hysteresis trilemma may be avoided.


Imperial College London, SW7 2AZ, UK
Nanoporous supercapacitors are an important player in the field of energy storage that fill the gap between dielectric capacitors and batteries. The key challenge in the development of supercapacitors is the perceived tradeoff between capacitance and power delivery. Current efforts to boost the capacitance of nanoporous supercapacitors focus on reducing the pore size so that they can only accommodate a single layer of ions. However, this tight packing compromises the charging dynamics and hence power density. We show via an analytical theory and Monte Carlo simulations that charging is sensitively dependent on the affinity of ions to the pores, and that high capacitances can be obtained for ionophobic pores of widths significantly larger than the ion diameter. Our theory also predicts that charging can be hysteretic with a significant energy loss per cycle for intermediate ionophilicities. We use these observations to explore the parameter regimes in which a capacitance-power-hysteresis trilemma may be avoided.

I. INTRODUCTION
The physics of charge storage at the nanoscale has received significant attention in recent years due to its relevance for efficient energy storage and the development of novel green technologies [1][2][3]. In particular, extensive effort has been channeled into studying electrical double layer capacitors (also called supercapacitors) in which energy is stored at the electrode-electrolyte interface. Their importance for energy storage has stimulated the development of novel techniques for fabrication of conducting nanoporous materials [3,4].
For instance, high-temperature chlorination of carbides produces carbon electrodes with a network of slit and/or cylindrical nanopores with narrow pore-size distribution about a wellcontrolled average pore size [5]. There is also an emerging class of graphene-based electrodes consisting of aligned slit nanopores with pore sizes comparable to the ion diameter [6,7].
Additionally it is possible to manipulate the ion-pore interactions by functionalising carbons.
For instance, preparing carbon nanofibers in the presence of potassium hydroxide changes the surface functionality and increases the ion-pore attraction [8].
Nanoporous supercapacitors benefit from high surface-to-volume ratio of these materials with an increase in the volumetric capacitance observed as the surface area of the electrode increases [9]. However, pioneering experiments [10][11][12][13] have shown that a drastic increase in surface-specific capacitance is achieved when the average pore size approaches the ion diameter. Using a model of a single metallic slit-shaped nanopore (c.f. Figure 1), this 'anomalous' increase of capacitance has been explained by the emergence of a 'superionic state' in which the inter-ionic interactions become exponentially screened. Decreasing the pore size promotes screening which decreases the energy penalty for packing like charges and unbinding ion pairs, purportedly leading to an increase in the capacitance [14]. This reasoning applies also to non-perfect metals [15][16][17][18]. In particular, recent quantum densityfunctional calculations have shown that the ion-ion interactions are exponentially screened in carbon nanotubes [16,17] and it is reasonable to expect a similar behaviour for other types of confinement, including slit pores.
This effect of metallic screening has been observed in molecular dynamics simulations that use more elaborate models to account for complex pore geometries [19,20] and realistic ions [21][22][23]. If metallic screening is the sole driver of increased capacitance, the capacitance can only be optimized when the pore size equals the ion size. However, such a close-fitting pore is detrimental to the charging dynamics [24] because of the reduced effective diffusivity [25][26][27] and because the kinetic barrier to pore entry is large. Increased capacitance therefore appears to come at the cost of prolonged charging. This leads to a dilemma in the design of supercapacitors -should the design be chosen to optimize capacitance or power? Alternatively, one might naturally ask: Can the capacitance be maximized away from strerically close-fitting pores?
It is known that charging of flat electrodes may show a hysteresis [28][29][30][31], i.e. the differential capacitance depends on the initial voltage and the direction of scan [28,32]. This is connected with the existence of two or more metastable states of an ionic liquid at the electrode surface [31]. In nanoconfinement, there is evidence from a mean-field study [14], Monte Carlo [33] and molecular dynamics [34,35] simulations that charging of slit nanopores can proceed via a voltage-induced discontinuous transition that is manifested by an abrupt change in the ion density. Such discontinuous transitions can be detrimental to the operation of supercapacitors because of hysteretic energy losses when the charging and discharging routes follow different metastable branches. It is thus important to know whether (and when) charging is hysteretic, and how hysteresis might be avoided altogether. This adds another dimension to the dilemma already mentioned.
To answer these questions, we combine a mean field theory with Monte Carlo simulations for a model slit nanopore (Figure 1). We consider monovalent ions and a single slit-shaped metallic nanopore. The pore entrance and closing are ignored, and charging is modelled by applying a non-zero potential to the pore walls. This or similar models have previously been used to study charge storage [14,23,33,[36][37][38][39][40] and the dynamics of charging [25,27] of nanoporous supercapacitors. Here, we focus specifically on pores whose sizes are comparable with the ion diameter. In this limit, the system is quasi two-dimensional, and we can assume that ions are located on the central symmetry plane of the pore. This allows us to develop a mean-field theory in two dimensions, whereby, improving on a model developed previously [14], the entropy of out-of-plane packing of ions (for L > d) is taken into account by introducing an effective pore-width dependent ion diameter d * ≤ d (see Appendix A; we neglect the out-of-plane effects for the electrostatic interactions as they are subdominant). We supplement and compare our mean-field results with grand canonical Monte Carlo simulations of the same system in three dimensions (for simulation details see The model employed here ignores the chemical details of ions and the complex structures of nanoporous electrodes. With these deliberate simplifications we aspire to reveal and understand the essential physics at work, without the complexity of real supercapacitors. In particular, our study reveals that contrary to the long-standing paradigm, a maximal capacitance can actually be achieved when pores are appreciably wider than the ion diameter. In addition, we show that there is, in general, charging hysteresis with significant energy loss per cycle. However, this hysteresis can be evaded by carefully tuning the ion-pore interaction energy. This study therefore reveals generic features of such systems that we believe should apply more generally and hence may provide a framework within which to design optimal nanoporous supercapacitors and avoid the capacitance-power-hysteresis trilemma discussed above.

II. IONOPHOBICITY OF PORES
Our primary interest is to determine how the affinity of ions towards pores affects charging. In our model, this affinity is controlled by the electrochemical potential, where V is the applied voltage, e the elementary charge, δE self the ions' self-energy (see Eq. (A9) in Appendix A 3), and δE ± the resolvation energy [14]. The resolvation energy is the energy of transferring an ion from the bulk to the pore, and includes here the chemical potential of ions in the bulk. We shall assume δE + = δE − = δE for simplicity.
At zero applied voltage, h ± = h 0 = δE self + δE and the sign of h 0 determines whether the ion-pore interactions are favourable. For pores with h 0 > 0 (unfavourable ion-pore interaction), the occupancy of the pore at zero applied voltage is expected to be low: we therefore refer to such pores as ionophobic. For large positive h 0 the pore will be (almost) completely free of ions at zero applied voltage: we therefore refer to such pores as strongly ionophobic. Conversely pores with h 0 < 0 will be termed ionophilic, and a large negative h 0 will correspond to strongly ionophilic pores, which are nearly fully occupied by ions at no applied voltage. h 0 = 0 marks the crossover between ionophilic and ionophobic behaviours, which therefore occurs at a resolvation energy δE = δE crossover = −δE self = l B ln(2)/L (in units of k B T ) where l B is the Bjerrum length (see Appendix A 3 for an estimate of δE self ). For instance, for a typical Bjerrum length of 25nm and a 0.7nm wide pore we obtain δE crossover ≈ 25 k B T , while for a 0.6nm wide pore we have δE crossover ≈ 29 k B T (vertical lines in Figure 2).
To obtain an estimate for the resolvation energy, we decompose δE into δE ≈ δE desolv + δE non−ele , where δE desolv is the desolvation energy of the bulk ionic liquid (transferring one solvated ion from the bulk liquid to the vapour state), and δE non−ele is the ion-pore nonelectrostatic interactions (ion-pore electrostatic interactions are accounted for in δE self ).
A combination of quantum mechanical density functional calculations and molecular dynamics simulations [41] suggests δE desolv ≈ 65 − 110k B T per ion [42]. The main source of non-electrostatic interactions is the van der Waals attraction, of magnitude δE vdW ≈ −70k B T [43]. We thus find that, roughly, −5 < ∼ δE/(k B T ) < ∼ 45 (note that the crossover between ionophobic and ionophilic pores, δE crossover , lies in this range). We stress that this range is not exhaustive as other physical effects (such as specific surface chemistry of the pore or the presence of solvent) have not been taken into account in this analysis. In particular, recent experimental [44,45] and theoretical [46] studies suggest that ionophobicity can be effectively controlled by changing the solvent concentration. In any case, we emphasize that the definitive metric of ionophilicity/-phobicity is the occupancy of the pore at zero applied voltage, as shown in Figure 2.

III. SEARCHING FOR MAXIMAL CAPACITANCE
The key quantity characterizing the low voltage capacitance response of a supercapacitor is the differential capacitance at zero voltage, where Q is the charged stored in a pore, and V is the applied potential. In the following discussion, we compute Q(V ) by minimising a mean-field free energy function or directly from Monte Carlo simulations (as discussed in Appendix B). Clearly, Q(0) = 0 by electroneutrality, while C D (0) describes the response of the system to an applied voltage and is in general nonzero.
The mean-field approximation for the Helmholtz free energy is given by where β = (k B T ) −1 (with k B being the Boltzmann constant and T temperature) and ρ ± is the two-dimensional density of ± ions. k B T U el is the contribution to the free energy due to electrostatic interactions, k B T S is the excluded volume entropic contribution, and we assume that the density of ions in the slit pore is homogeneous (see Appendix A for expressions of U el and S). To obtain Q(V ) and hence C D (0), we minimize F over ρ ± subject to fixed V , noting that the charge per unit area is Q = e(ρ + − ρ − ), where e is the elementary charge.
It is possible that the free energy has two minima, one of which can be metastable, and charging and discharging may follow different metastable branches. This possibility will be discussed in Section IV. We will first focus on the parameter regime where the free energy minimum is unique. For strongly ionophilic pores, we find that the capacitance is maximal for the smallest pores possible, in agreement with the conventional view that the capacitance increases monotonically as the pore size decreases [10][11][12][13] (dashed line in Figure 3(a)). Surprisingly, however, we find that for weakly ionophobic pores the differential capacitance has a global maximum when the pore width is significantly larger than the ion diameter (though still smaller than 2d). This behaviour is due to two competing effects: On the one hand, the loss of ion-image interactions and an increase in electrostatic interactions hinders ions from entering the pore. On the other hand, the same factors also render the pore less populated at zero voltage (the inset in Figure 3a). As the width varies, a peak is achieved when the decrease in the total density frees up enough space in the pore that counter-ion insertion becomes entropically favourable. In fact, for narrow and weakly ionophilic pores the charging at low voltages is dominated by swapping coions for counterions and expelling coions; for wider pores, it is the counterion insertion that drives charging.
This charging behaviour is in contrast to strongly ionophilic pores, where total ion density increases with increasing pore width because the out-of-plane degrees of freedom allow ions to pack more efficiently. Therefore, both entropy and ion-ion as well as ion-image interactions work against charging as the pore size (L) increases, and so the capacitance decreases The insets show the 3D packing fraction η 3D = (π/6)ρd 3 as a function of pore width.
monotonically for increasing L. The case of strongly ionophobic pores is not considered here -charging commences only when ions can overcome the ionophobicity barrier (eV ≈ δE) and hence the capacitance at zero voltage is low or vanishing. Figure 3b shows the energy per surface area stored for each of the two slit widths. For low applied voltages the stored energy is slightly higher for the weakly ionophobic pore (inset in Figure 3b) because it has a higher low-voltage capacitance. For intermediate voltages, however, capacitance is higher for ionophilic pores (c.f. Figure 6a), and weak ionophobicity reduces the energy storage in this voltage range. For sufficiently high voltages, ionophilic pores eventually saturate, while ionophobic pores continue to charge, and this leads ultimately to higher energies stored by ionophobic pores [47,48].
Monte Carlo simulations confirm the predicted trends of the mean field model. Strongly ionophilic pores show a monotonic decrease of capacitance with increasing pore size (Figure 4a), while weak ionophobicity produces a local maximum with capacitances comparable to, or even higher than, the capacitance at L ≈ d (Figure 4b). The total ion packing fraction is almost constant with increasing slit width for strongly ionophilic pores (inset of Figure 4a) whereas for ionophobic pores it decreases with increasing slit width (inset of Figure 4b), agreeing qualitatively with the mean field model (inset of Figure 3a). We note that a slightly smaller δE in mean field theory is sufficient to achieve the same ion occupancy at zero volt- The presence of a local maximum is distinct from the oscillatory behaviour of capacitance as a function of pore width [39,49,50] and solvent polarity [40] observed in systems with wider pores. For weakly ionophobic pores, a maximum occurs because of entropic effects, while in the cited works it is the overlapping double layers and highly polar solvent, respectively, that cause the non-monotonicity in the capacitance (notice a second maximum in Figure 4a, with a similar origin but with a much smaller amplitude).
Another important aspect of capacitance optimization is how to choose the ion size (d) and slit width (L). Intuitively, one might expect that it is the ratio between the two that affects the capacitance. However, Figure 5a shows that for weakly ionophobic pores, a peak in the capacitance emerges as the ion diameter increases while the ratio between the slit energy and the metallic screening decrease (i.e. electrostatic interactions become stronger) when increasing the ion diameter at constant L/d (see Eqs. (A3) and (A9) in Appendix A).
This effect makes the pore less populated for weak ionophobicities, and thus adsorption of new counterions becomes entropically more favorable, giving rise to a local maximum at intermediate ion sizes. For strongly ionophilic pores, the ion density is close to maximal and charging proceeds mainly via swapping co-ions for counterions. Therefore, the capacitance increases monotonically with decreasing ion diameter (dashed curve in Figure 5a).
From these results we see that the highest possible capacitance may be obtained by optimizing both the pore width and the ion diameter (see Figures 5b and c). Crucially, the position of this optimum in parameter space, and its properties, depend on the pore's ionophilicity. For strongly ionophilic pores, the pores are completely filled with ions and a maximal capacitance is achieved for small ions and tight pores, i.e. L opt ≈ d for any d and the capacitance increases as d decreases (Figure 5a and b). Remarkably, a strong increase of capacitance is obtained for pores below 0.5 nm, reaching the values as high as 200 µF/cm 2 (see the inset in Figure 5a). This result suggests that such ultranarrow pores combined with inorganic electrolytes with small ions may be beneficial for the charge and energy storage.
For weak ionophobicities, there is an optimal slit width L opt ≈ 0.74nm that depends only weakly on the ion diameter d, for d > ∼ 0.5nm ( Figure 5c). As discussed, this is connected with emptying (half-filled) pores, which maximizes the capacitance, i.e. L opt ≈ L empty (see Figures 3a and 4b). Since the image-force interactions are ion-size independent (see Eq. (A9)), we roughly estimate that the pore is emptied when L > ∼ L empty ≈ l B ln(2)/δE [51].
For the parameters of Figure 5c, l B = 25nm and δE = 25 (in units of k B T ), we obtain L empty ≈ 0.7nm. This value is slightly modified by the ion-size dependent entropic and screened electrostatic interactions, which additionally bring a weak L opt (d) dependence.
To conclude this section, the fact that the capacitance reaches a maximum for pores that are significantly wider than the ion diameter may have an important impact on optimizing supercapacitors. It has previously been assumed that there is necessarily a trade-off between having large capacitance (narrow pores) and fast charging (wide pores) [25]. Charging is slower for narrower pores because the collective (or effective) diffusion coefficient, D ef f , which determines the rate of charging, decreases with decreasing the pore width, L [25][26][27]; for instance, D ef f is almost doubled when L increases from 0.7nm to 0.9nm [25]. Our analysis therefore provides the key insight that charging kinetics and capacitance can be simultaneously optimized by tuning the ionophilicity of the pore.

IV. HYSTERETIC CHARGING
Next, we study the charging hysteresis for non-zero applied voltages. Figure 6 shows that charging can proceed via a first-order discontinuous phase transition at intermediate ionophilicities, or via a continuous process beyond the critical endpoints.
For strongly ionophobic pores (with resolvation energies δE above the critical endpoints, Figure 6e), the pore is empty at no applied voltage, and counter-ions only enter the pore when the applied potential matches the unfavourable resolvation energy; hence there is a peak in capacitance when charging starts at eV ≈ δE (Figure 6a). Subsequently a separate regime of packing like charges starts and persists until the applied potential surpasses the interaction energy between co-ions. Beyond that point the capacitance falls off rapidly.
The situation is different for strongly ionophilic pores with δE below the critical endpoints, where the pore is nearly fully occupied with ions at zero voltage. At low voltages, charging proceeds via swapping of co-ions for counter-ions and co-ion desorption, while at higher voltages (above ≈ 1.2 V) it is the counter-ion adsorption that drives the charging.
It has been shown elsewhere [48] that adsorption leads to low capacitances, as compared to swapping and desorption, and hence the drop in the differential capacitance, C D (V ), at V ≈ 1.2 V (see the dash line in Figure 6a).
For ionophilicities between the two critical endpoints, charging proceeds via a large discontinuous drop in capacitance and ion densities (Figures 6b and c respectively). At low voltages, charging is driven by swapping of co-ions for counter-ions and co-ion expulsion, but at the point of the phase transition the system expels all co-ions. This is similar to strongly ionophilic pores (Figure 6a), except that this process is discontinuous and we can observe two coexisting phases [14]: Coion-deficient phase, with a vanishing number of coions in the pore, and coion-rich phase with the essentially non-zero coion density (Figures 6c-d).

has recently been observed in atomistic molecular dynamics simulations of [C2mim][FSI]
and [C4mim][TFSI] ionic liquids in (0.75nm wide) slit nanopores [35]. There, however, the drop in coion density is smoother than we observe, which is most likely due to finite size effects. Indeed, in our theory the pore is formally infinite in the lateral directions, while in the simulations of Ref. [35] the pore was only about a few tens nm long.
Our results are also in line with recent NMR experiments [44,52] which show that charging proceeds continuously (i.e. without phase transitions or accompanying abrupt co-ion expulsion) for [PEt 4 ][BF 4 ] ionic liquids and KOH activated carbon pores, known to be strongly ionophilic [8]. While it is difficult to calculate the resolvation energy (ionophobicity) for this system, Figure 6e suggests that it must at least be lower than 12k B T . This is consistent with our estimate of the crossover between the ionophilic and ionophobic pores which occurs at δE crossover ≈ 17k B T for the 1nm wide pore of Ref. [44] (see Section II). Figure 6e shows that the transition voltage increases with decreasing ionophobicity, as both counter ions and co-ions are favourably adsorbed into the pore, making it more difficult to expel the co-ions. The window of ionophilicities for which a phase transition occurs is wider for larger pores where electrostatic interactions are stronger and more long-ranged.
A signature of a discontinuous phase transition is hysteresis as the system follows the locally metastable branch. The dotted lines in Figures 6b-c show that the branch followed by the system when the voltage is increased is different to that followed by the system for decreasing voltage. Figure 6f shows that a significant amount of energy is lost per cycle as a consequence of hysteresis, with wider pores producing larger energy losses. In practical applications, the regime where charging proceeds via a first order phase transition should therefore be avoided, but this hysteresis loop can be used to probe the properties of the supercapacitor system experimentally. It is likely however that these transitions will be smoothed out by the distribution of pore sizes [53] in typically used porous electrodes (for instance in popular carbide-derived carbons [3]), making it difficult to capture them directly by in situ NMR spectroscopy [54,55] or in electrochemical quartz crystal microbalance experiments [56][57][58]. However, novel graphene-based nanoporous electrodes [6,7], which consist of nearly unimodal well-aligned slit pores with controllable pore widths, seem a promising candidate for validating our predictions experimentally. Although the quantum capacitance of these materials, which we have neglected in this work, may change the values of the total capacitance [59][60][61], we do not expect that it will affect the existence of phase transitions or their order, as they result solely from the competition between entropic effects (due to confinement) and screened inter-ionic interactions induced by the conducting pore walls.
Nevertheless it would be very interesting to analyze the role that the quantum capacitance may play in energy storage and hysteretic charging.

V. CONCLUSION
Using a mean-field model for charge storage in 2D nano-confinement and Monte Carlo simulations of the corresponding system in 3D, we have demonstrated the possibility of simultaneously boosting capacitance, accelerating charging, and avoiding hysteresis in nanoporous supercapacitors. Our calculations show that high capacitances can be achieved for electrolytes with small ions and close-fitting pores (inset in Figure 5a). On the other hand, we find that the long-espoused paradigm that equates narrow pores with necessarily larger capacitance does not always hold: Entropic effects may produce a second, more pronounced peak in capacitance for relatively wide ionophobic pores and room-temperature ionic liquids ( Fig. 3a and 4b). Similarly, there exists an optimal ion diameter when the ratio between the ion diameter (d) and the pore width (L) is kept constant, suggesting an optimization of supercapacitors with respect to the (d, L) pair rather than the pore size alone (Fig. 5).
For non-zero applied voltages, a voltage-induced discontinuous phase transition is predicted by the model, and the phase diagram has two critical endpoints corresponding to the limit of very ionophobic and ionophilic pores (Fig. 6). The phase transition gives rise to hysteresis and a sizeable energy loss, but crucially can be avoided by either reducing the operating voltage of the capacitor, or by pushing the pore ionophilicity away from the critical endpoints (for instance by making pores more ionophobic). Thus, the capacitancepower-hysteresis trilemma can be resolved by judiciously tuning material parameters and operating ranges.
Ion diameter and pore width are relatively straightforward to tune experimentally; our framework shows how to optimize both parameters together. We also single out a key outstanding challenge for further experimentation -the controlled tuning of the ionophobicity/ionophilicity of the pore. The ionophilicity can be controlled by changing the ion-pore non-electrostatic interaction. In addition to van der Waals interactions, suppose we have an ion that has multiple conformational states with different effective diameters (for example expanded versus folded alkyl chains on an ionic liquid ion). If the pore separation is less than the effective diameter of the lowest energy conformation, then entering the pore will require the ion to adopt a higher conformation energy, and thus incur a conformational energy penalty. Similarly, if the pore walls are flexible and ions can only enter by deforming the walls (as observed in Refs. [62,63]), the elastic energy will result in an unfavourable ion-pore non-electrostatic interaction. This interaction could also be controlled by addition of surfactants [64,65] or solvents [44][45][46], or by using ionic liquid mixtures [66], or via functionalisation of porous carbons [8]. Experimental studies of ionophilicity are currently scarce, however, and we hope that our theory will provide a framework to assess and direct future efforts to address this.

This work is supported by an EPSRC Doctoral Training Award and Fulbright Scholarship
to AAL. SK acknowledges COST Action MP1004 for supporting his short-time scientific visit to Imperial College London where part of this work has been done, and appreciates fruitful discussions with Alexei Kornyshev (Imperial College).
Appendix A: Improved mean-field approximation The Helmholtz free energy F (ρ + , ρ − ) per unit area of a homogeneous ionic liquid in a narrow slit nanopore is given by where β = (k B T ) −1 (k B is the Boltzmann constant and T temperature), ρ ± are the twodimensional ion densities, and it is convenient to introduce ρ = ρ + + ρ − and c = ρ + − ρ − . k B T U el is the contribution to free energy due to electrostatic interactions, k B T S is the excluded volume entropic contribution, and k B T h α is the electrochemical potential of the ion species (see below).

Electrostatic interactions
The electrostatic interaction can be expressed in terms of direct correlation functions C αβ (x, x ′ ) using a functional Taylor expansion with C αβ (x, x ′ ) computed using the Ornstein-Zernicke relation with an appropriate closure [67]. However, we take here a simplifying assumption in the spirit of the random phase approximation (RPA). In RPA, the direct correlation function is approximated by the interaction potential, which is valid for asymptotically weak interactions but overestimates the correlations at close particle separations [67]. To improve on this, we assume that the direct correlation function is essentially negligible for distances less than the average particle separation; beyond this distance the interaction is weak and can be approximated by the classical RPA. As such, is the electrostatic interaction kernel and R c = 1/ √ πρ is the average separation between particles (this result is also known as the cut-out disc approximation, see Ref. [68]).
The interaction potential between two point charges confined in a slit metallic nanopore and separated by distance r is given by [69] v αβ (r, z 1 , z 2 ) = 4q α q β ε p L ∞ n=1 K 0 (πnr/L) sin(πnz 1 /L) sin(πnz 2 /L), where q α and q β are charges, z 1 and z 2 are ion positions across the pore (within the mean-field model we assume z 1,2 = L/2, but we use the full potential in our Monte Carlo simulations, see below), and ε p is the dielectric constant in the pore; we have taken ε p = 2 in all calculations, but we note that ε p shall in principle depend on the pore width (and voltage), and this dependence may have a profound effect on system's behaviour [70].
For monovalent ions we obtain [14] U el (c, ρ) = 4c 2 R c (ρ)l B ∞ n=1 sin 2 (πn/2) n K 1 (πnR c (ρ)/L) , where l B = e 2 /(ε p k B T ) is the thermal Bjerrum length. Constrained ionic motion within the pore means that effectively only electronic degrees of freedom contribute to dielectric screening and we take ǫ p = 2, the high frequency dielectric constant of typical ionic liquids.
It is easy to see that at constant L/d, the functional dependence of the potential v αβ on d is the same as on L at constant d.

Electrochemical potential
The electrochemical potential (in infinite dilution) is given by Here the first term results from the applied voltage, and the second term originates from the ion self energy where z is the position across the pore and r distance to the charge (see Ref. [14]). At the pore mid plane z = L/2 which gives δE self (L/2) = −l B ln(2)/L. Again, δE self depends on L in the same way as on d at constant L/d. The last term in Equation (A8), δE ± , is the "resolvation energy" which is the energy of transferring an ion from the bulk of a supercapacitor into the pore in the absence of other ions.

Stored energy and hysteretic energy loss
The energy (per surface area) stored in a nanopore by charging it from u = u 1 to u = u 2 is E(u 1 , u 2 ) = where C D (u) = dQ/dV is differential surface-specific capacitance. To obtain an energy lost due to hysteresis (Figure 6f), we first calculated the energy stored when charging a nanopore from u 1 = 0 to u 2 = V = 1.3 V along the charging path (orange lines/arrows in Figure 6b), E charg = E(0, V ); and the energy released by fully discharging it along the discharging path (blue lines/arrows in Figure 6b), E discharg = −E(V, 0). The hysteretic energy loss is then shown as percentage of the stored energy lost in hysteresis, i.e. (E charg − E discharg )/E charg .

Appendix B: Grand canonical Monte Carlo simulations
We used the same method as in Ref. [36], so we will only summarize the simulation method here, and refer the reader to [36] for further detail.
Ionic liquid molecules are modelled as charged hard spheres, but instead of the Coulomb potential, we use the analytical solution (A3) for the ion-ion interactions. Ion-pore wall interactions are captured by potential (A9), which accounts for image forces. The resolvation energy (δE) and the applied voltage (V ) are subsumed into the chemical potential in the grand canonical simulations, µ (sim) ± = δE ± eV , where e is the elementary charge, and δE is the resolvation energy, as before. In all our simulations we took temperature T = 328K and the relative dielectric constant inside pores ε p = 2.
To calculate differential capacitance, we differentiated the accumulated charge obtained from Monte Carlo simulations with respect to voltage numerically using the Holoborodko method with seven points [73]. [2] P. Simon and Y. Gogotsi, "Capacitive energy storage in nanostructured carbon-electrolyte systems," Acc. Chem. Res. 46, 1094 (2013).