Inverting the Kohn-Sham equations with physics-informed machine learning

Electronic structure theory calculations offer an understanding of matter at the quantum level, complementing experimental studies in materials science and chemistry. One of the most widely used methods, density functional theory (DFT), maps a set of real interacting electrons to a set of fictitious non-interacting electrons that share the same probability density. Ensuring that the density remains the same depends on the exchange-correlation (XC) energy and, by a derivative, the XC potential. Inversions provide a method to obtain exact XC potentials from target electronic densities, in hopes of gaining insights into accuracy-boosting approximations. Neural networks provide a new avenue to perform inversions by learning the mapping from density to potential. In this work, we learn this mapping using physics-informed machine learning (PIML) methods, namely physics informed neural networks (PINNs) and Fourier neural operators (FNOs). We demonstrate the capabilities of these two methods on a dataset of one-dimensional atomic and molecular models. The capabilities of each approach are discussed in conjunction with this proof-of-concept presentation. The primary finding of our investigation is that the combination of both approaches has the greatest potential for inverting the Kohn-Sham equations at scale.


Introduction
Modern, high-performance computational resources have enabled large-scale electronic structure simulations of molecules, materials, and other systems of interest across biology, chemistry, physics, and beyond.Kohn-Sham (KS) Density Functional Theory (DFT) [1,2] is the most widely used method due to its accuracy and computational efficiency.KS-DFT has helped solve major scientific and technological problems such as simulating chemical reactions, computing material properties, finding new catalysts, discovering drugs, and modeling microscopic environmental processes.
The electronic structure problem is typically tackled by solving the non-relativistic Schrödinger equation for the molecular Hamiltonian within the Born-Oppenheimer approximation.KS-DFT simplifies this process by transforming the many-body problem into an effective single-particle problem, utilizing the one-to-one correspondence of the external potential and the electronic density [1].The crux of KS-DFT is producing an electronic density that matches the one obtained from solving the interacting manybody problem [2].This is accomplished through an effective single-particle potential known as the KS potential, which is comprised of the external potential, the Hartree potential that accounts for electrostatic repulsion, and an exchange-correlation (XC) potential compensating for all interactions beyond the Hartree potential.
Another promising approach to constructing approximations to the XC functional is by reverseengineering the XC potential from systems that can be solved exactly.This procedure takes the electronic density as input and finds the corresponding XC potential by inverting the KS equations.Though straightfoward to describe, this process is an example of an inverse problem.
Inverse problems are encountered in various scientific fields, such as image reconstruction, a fundamental method in MRI and CT scans; inverse scattering, commonly used in seismology and radar imaging; and tomography, frequently employed in CT scans.In each case, as in our case, observed data is used to reconstruct the structure of an object that gives rise to the initial data [52].Inverse problems are often ill-posed, meaning they are highly sensitive to small changes in the observed data and noise.This sensitivity makes them challenging to solve [53].
Various algorithmic and numerical schemes for inverting the KS equations exist in the literature [54,55,56,57,58,59,60].These have provided valuable insights [61,62,63,64,65,66] into the properties of the XC potential, such as the appearance of the derivative discontinuity or the dynamical step structures in timedependent DFT, and have guided the construction of XC approximations [67].However, traditional inversion methods are often plagued by the numerical errors and instabilities [55] common in the solution of inverse problems, as well as from those specific to the density-to-potential problem.
Recent research has demonstrated numerous examples of utilizing ML, particularly neural networks, to address inverse problems, with a focus on medical image processing applications.The primary objective is to learn stable mappings that can be effectively applied to noisy data in a general context [68,69].The fusion of physics with ML offers innovative solutions to complex problems, leading to the evolution of physics-informed machine learning (PIML) techniques [70].Instead of solely relying on data, PIML incorporates governing physical laws, typically differential equations, into the learning process.This results in data-efficient learning and equips the model with the capability to generalize within physically consistent bounds.This is especially relevant in cases with sparse or noisy data where conventional ML methods might not perform well due to overfitting or by producing non-physical outcomes.
In this work, we employ two recent advances in PIML, namely physics-informed neural networks (PINNs) [71] and Fourier neural operators (FNOs) [72], to tackle the inverse problem in KS-DFT.PINNs have the unique ability to learn from the underlying physics described by partial differential equations, leading to improved generalizability with less data and training time compared to conventional methods.This characteristic proves highly advantageous in computational sciences where data availability is limited and generating extensive training sets is costly.PINNs have demonstrated their effectiveness and versatility in various scientific domains for inversions, including materials and fluid dynamics models [73,74,75].
Neural operators (NOs) are a class of models that map function-to-function spaces, as opposed to the finite-dimensional vector space mappings of neural networks.This is especially useful for inverse PDE problems where experimental or simulation data is available.FNOs are a type of NO represent operator weights in Fourier space.The main advantages of FNOs are that they generalize well across function spaces, and being resolution-invariant, they can be used for inference on higher resolution grids than the training set grids.FNOs have also been used for forward and inverse PDE problems in various domains [72,76].
In the following, we construct both a PINN and an FNO to predict the XC potential based on input electronic densities.We demonstrate the implementation of these computational workflows and compare both approaches in terms of efficiency and accuracy for their applicability as KS inverters.We observe higher levels of accuracy and ease of use for FNOs and more predictable errors and greater extrapolation power for PINNs.

Kohn-Sham density functional theory
In the framework of KS-DFT, we solve a set of effective single-particle equations known as the KS equations (which we present here using atomic units [77] for clarity and simplicity of notation), where ϕ i (r) represents the KS eigenfunctions and ϵ i denotes the KS eigenvalues.These KS equations constitute an auxiliary system designed to replicate the electron density of an interacting many-body system, expressed as where the summation index corresponds to the total number of electrons, denoted as N .The correspondence of the density defined in Eq. (2) with the density of an interacting many-body system is established through the KS potential which mimics the inter-electronic interaction and is defined as Here, v ext (r) is the external potential, v H (r) is the Hartree potential (i.e., the electrostatic potential due to an electronic density interacting with itself) and v XC (r) is the XC potential.Both the external and Hartree potentials are known exactly in terms of the density.The only unknown is the XC potential.While solving the set of KS equations with the exact XC potential yields the exact density of the many-body system, in practice, approximations to the XC energy need to be used.A plethora of approximations is available in the literature [2, 4,5,6,7,8,9,10,11,12,13] and more accurate approximations are continuously being developed.Usually, the KS equations are solved iteratively.This means that a system is defined and an XC approximation is selected.An initial guess of the ground-state density is made, which in turn provides guesses for the Hartree and XC potentials.Eq. ( 1) and Eq.(2) are solved, generating a new density, which can be used to calculate new Hartree and XC potentials.This cycle will continue until the density converges to within a chosen criterion.In the end, the resulting density is an accurate approximation of the interacting many-body system, which can be used to calculate electronic properties.
Conversely, Eq. ( 1) and Eq.(2) can be solved to find the exact KS potential that results in a given target density.In this case, no approximation is made to the XC potential, only an initial guess.Then, by solving Eq. ( 1) and Eq.(2), the guess for the XC potential can be updated.This process is much less stable than the "direct" one described above because the potential is sensitive to small changes in the density.
We use the iDEA code [78,79] for generating data and as benchmark for inversion.In iDEA, the densityto-potential inversion is done iteratively: where n 0 (r) represents the target density, while µ and p serve as convergence parameters.

Model system
Model systems in one dimension are a useful tool for the development of DFT approximations [59] for two reasons.First, it is simpler to obtain highly accurate or exact data from a one-dimensional system.Second, these model systems can be finely tuned to mimic a wide range of well-understood physical phenomena.Therefore, we leverage one-dimensional models to demonstrate the utility of our inversion method.We define two model systems: a one-dimensional atom and a one-dimensional diatomic molecule, as illustrated in Figure 1.A one-dimensional atom is defined by the external potential where Z is the charge of the atomic well and a is softening parameter to ensure that the potential is defined at all points in space.This simple model can readily be extended to a one-dimensional model of a diatomic molecule by incorporating two potential wells through an additional parameter, d, which represents the bond length in terms of the separation distance between the two wells: This idea can be extended by defining additional wells to move from an atomistic view to a material or crystalline structure in one dimension.
All data used to train the presented models were generated using external potentials defined in this manner.
The electronic densities and KS eigenfunctions were generated using the iDEA code [78,79].For the one-dimensional atom of varying charge, Z was varied between the values of two and six in steps of 0.1, resulting in a dataset with 41 individual data points which was split into a train, test, and validation set.These sets had 32, 5, and 4 individual data points each, respectively.For the one-dimensional diatomic molecule, Z 1 , Z 2 , and d were all varied within the range of one to five, in steps of 0.5.All combinations of the three variables were generated, resulting in a data set with 729 data points.The dataset was split such that the training set had 590 points, the test set had 73, and the validation set had the remaining 66.

Physics-informed neural networks
As a subset of neural networks, PINNs use equations and conditions of the underlying physics to enable a neural network to predict physically relevant information.Consider a general partial differential equation of the form where u is the solution, x ∈ Ω a D-dimensional spatial coordinate with Ω a subset of R D , t ∈ [0, T ] the time variable, N a nonlinear operator, and λ the set of parameters that describe a physical system.If a neural network is used to represent the solution u, as ũ, this gives rise to The function f must only equal zero when the network accurately represents the solution to the differential equation for the given parameters λ.If trained on a wide set of physical data, it should be able to predict solutions to the differential equation within that set more generally.Based on Eq. ( 1), we derive the following model and loss functions within the framework of PINNs: where the loss function L PDE is computed in terms of a mean squared error (MSE) M SE(f, 0), with x i f denoting one of the N f collocation points where the solution is provided.
Here, our focus is to invert the KS equation, wherein we have the set of solutions, {ϕ i }, and our goal is to get the network to predict the parameters, v S , that lead to an appropriate set of solutions.If the network can correctly predict v S , then the function f should return a value of zero.What distinguishes this approach from conventional data-driven ML is that the network does not receive the solution set as input for prediction.Instead, it receives only the weighted sum of the solutions in the form of the electronic density calculated using Eq.(2).
In Figure 2, we illustrate our implementation of a PINN that predicts the KS potential for an input density.The network takes the density as an input and processes it through a series of convolutions.The output of each convolution as well as the initial density is used as an input into a dense network.The network is then asked to predict the KS potential on each point in space given this set of features, as well as the first and second derivative of the density.

. They observe both local and non-local features in input data
to predict what is present in an image.The convolution of two functions f and g is defined as and can be described as sum of the overlap of two functions at each point in t.
In our convolutional PINN, this is accomplished by using a set of convolutions in series and in parallel.Back propagation is used to learn functions g that emphasize input features crucial for predicting a class.Increasing the number of convolutions in series results in the passing of additional non-local information to the features.
It is widely known [1,4] that the XC potential is a nonlocal functional of the electronic density.Consequently, training a network to correctly predict an XC potential based only on the electronic density at a single point in space is ill-advised.Our PINN model uses convolutions to account for some of the nonlocality of the XC potential.Each step through the convolutions indicates a larger regime of non-locality that has been included in its output features.

Fourier neural operators
Neural operators (NOs) [84,85] are an extension of neural networks that take functions as inputs and return functions as outputs.While traditional neural networks map finite-dimensional vectors to finitedimensional vectors, neural operators work on infinitedimensional function spaces.A neural network can be defined as a mapping f : R n → R m , whereas a neural operator maps functions to functions, i.e., G : A → U, where A and U are function spaces.Given that there exists a non-linear map G † : A → U, our goal is to construct a neural operator that approximates this map, i.e., G θ ≈ G † , where G θ : A → U with parameters θ in finite dimensional space R p .
The neural operator is trained on point-wise (in function space) observations of the form The goal is to find the parameters θ * that minimize the loss Analogous to the neural networks being defined as multi-layer compositions of linear and non-linear operations, we can define a neural operator G θ (a) as multi-layer compositions of linear and non-linear operators acting directly in function space: where the layer v l+1 is defined as Here, the non-local kernel integral operator K l is defined as κ l (x, y, a(x), a(y))v l (y)dy (15) over the domain Ω l .The kernel function κ l (x, y, a(x), a(y)) is a function of x, y, and the input functions a(x) and a(y).The kernel function, parametrized by λ, and the local linear operator W l , a matrix of weights, are learned during training.σ (l+1) is a local non-linear activation function.The local operator P (a) is a pre-processing operator that transforms the input function a into a higher dimensional representation v 0 , which is the input to the first layer.The local operator Q(v L ) is a post-processing operator that projects the output of the last layer v L back into U.
Several methods can be used to approximate the global integral calculation in each layer, such as graph neural networks with Monte-Carlo sampling [85] and multipole graph neural operators.
[86] These approximations reduce the computational complexity and allow for scalable solutions [76].
Fourier neural operators (FNOs) [72] leverage the Fourier transform to work in the frequency domain.Notice that by using a kernel κ(x − y), Eq. ( 15) is a convolution operator, and by using the convolution theorem, Eq. ( 15) becomes where F is the Fourier transform and F −1 is its inverse.The kernel κ l is parametrized in Fourier space.Here the parameterization is finite-dimensional determined by the number of Fourier modes k max .By working in frequency domain, the kernels can be computed efficiently using the Fast-Fourier Tranform (FFT) and the model can capture global patterns more effectively.
A distinction has to be made between the solving approach (PINNs) and the learning approach (NOs) for PDE problems.PINNs are useful for obtaining numerical solutions for specific initial and boundary conditions and PDE parametrizations.In contrast, learning a PDE via neural operators aims to learn the underlying operator itself, enabling the prediction of solutions for various conditions without re-solving the PDE.PINNs can be used to solve PDEs if the PDEs are defined, even in the absence of training data, while NOs can be used to approximate undefined PDEs with training data.NOs are resolution-invariant and can also be used for zero-shot super-resolution [72].A rigorous mathematical definition and analysis for NOs is provided in [76].The strengths of FNOs in this context lie in their inherent capability to capture nonlocal dependencies and their resolution invariance.
Given the non-local dependence of the XC potential on the electronic density, the non-locality of FNO layers make them well-suited for the inverse problem in KS-DFT.The input in this case is a grid of electronic density values and the output is the XC potential at the corresponding spatial grid points.The loss function is simply the MSE between true and predicted XC potential: where ṽXC denotes the predicted XC potential for system i.The architecture we implemented is shown in Figure 3.

Similarity Measures
We evaluate the complexity of the datasets using two different similarity measures, namely the cosine similarity and Euclidean distance.
The cosine similarity between two vectors X and Y in R D is defined as cos which returns values in the range [−1, 1], namely −1 if the vectors point in opposite directions, 1 if they point in the same direction, and 0 if they are orthogonal to each other.The Euclidean distance between the same vectors is defined as This measure has a lower bound of zero but no upper limit.The value returned is 0 only if the vectors X and Y are the same vector.Then, as two vectors continue to move further apart, the value moves further away from zero.The Euclidean distance includes some details related to the cosine similarity, but it also describes the difference in magnitude of the values found in the two vectors.This is a significant piece of information that the cosine similarity measure misses.Both of these measures provide insight into the complexity of each dataset and the network architecture's capacity to work on each of them.We illustrate the similarity for both the atomic and the molecular model systems in Figure 4.As expected, the diatomic system is more complex than the atomic system, which is evident from the broader range of values in the diatomic case, versus the atomic case, for both cosine similarity and Euclidean distance measures.In the cosine similarity plots for the diatomic system, a block pattern emerges.The largest blocks shift with a change in the bond length.Descending to the bottom or moving to the right of the plot corresponds to an increase in the separation between two atomic centers.The greatest dissimilarity is noted at the two extremes of separation.Interestingly, at larger separations, the vectors show slightly less self-similarity compared to those at lower separations, as indicated by the darker shading of the bottom right block compared to the top left.The Euclidean distance plot yields similar trends, although it does not show this distinction within varying separation distances.

Results
We next present our findings for the two PIML approaches, comparing results using the PINN model as well as the FNO model.We trained both models on the same datasets and evaluate the model performance via the accuracy of the returned eigenvalues when solving the KS equations with the predicted XC potentials.
We assess the ability of both PIML approaches as inverters for the KS equations in terms of the two aforemorentioned model systems: the In all model systems, we consider the first six eigenstates, where each model is occupied with two same-spin fermions.Additionally, we consider four virtual KS orbitals.The set of occupied and virtual eigenstates defines the shape of the KS potential.The lowest-energy eigenvalue indicates how well networks predict the cusp of the atoms, while the highest value signifies how well they predict the tail of the potential.
We evaluate each model for ten neural networks with different random seeds.The error is quantified using the mean absolute error (MAE) and the mean absolute percentage error (MAPE) of the eigenvalues defined as where εi,j,n denotes the predicted eigenvalues and each predicted eigenvalue is indexed by i, j, n, with i denoting the level index, j the system index, and n the network index, with each neural network having a different random seed.

Inversions with physics-informed neural networks
4.1.1.Atom with varying charge Figure 5 illustrates the performance of the PINN model for a onedimensional atom with a variable parameter Z corresponding to its charge, plotting the MAE for a set of fixed charges.Each data point represents the mean of ten neural network predictions that were generated using varying network initializations and random seeds.The data points are color-coded to indicate ground and excited states in the order of blue, orange, red, green, purple, and brown.This order is maintained in the following discussion of the results.
The performance of the PINN model is best when the well charge Z is small.The error systematically increases with the charge, particularly for the lowestlying eigenvalue.The overall MAE averaged over the test systems is 1.77e-3 Ha (denoted by a gray horizontal line in Figure 5).The PINN model is competitive with the chemical accuracy criterion of being within 1 kcal/mol or 0.0016 Ha, as marked by the red horizontal line in our figures.
We have also displayed the the MAPE of the individual eigenvalues in 6.The greatest error is in the first two eigenvalues of the systems, with both lying above the total average MAPE of around .13%, while the next four lie below this threshold.
We have also explored the relationship between the performance of the PINN model and the resolution of the spatial grid.We suspect that the source of the errors observed in Figure 5 is related to the resolution of the grid used to train the PINN model, which depends on the accuracy of the KS orbitals and their second derivatives.We anticipate that as the grid resolution improves, the accuracy of the second derivatives will also improve, particularly at the sharp cusp-like feature in the KS potential.Our findings indicate that errors diminish with the enhancement of grid resolution.This correlation presents a methodical approach for reducing the error in the PINN model.The improvements are reported in Table 1, which showcases the systematic enhancement in performance with increasing grid resolution (see Atom 501).

Diatomic molecule with varying charges and bond length
When switching to the diatomic molecule, the learning task becomes much more complex, as both the charges (Z 1 and Z 2 ) and the bond length (d) are variable parameters.This is exemplified in the roughly 10-fold increase in errors within the predicted eigenvalues.The MAE is shown  in Figure 7. Compared to the atomic test system, which had an overall MAE averaging around 1.77e-3 Ha, the overall MAE has increased to 1.25e-2 Ha (refer to the gray horizontal line in Figure 7).In the atomic test system, the largest errors were observed in the ground, first, and second states of the KS spectrum.All eigenvalues exhibit some errors above the limit of chemical accuracy.This suggests that the PINN model has difficulty predicting the tails of the XC potential, but not to the same extent as placing and accurately estimating the well depth.The relative ordering of errors on the states remains consistent.We have further broken down the error analysis into individual eigenvalues in Figure 8.We display the MAPE for the first six eigenvalues, which exhibits the larger errors for the ground and first excited states observed in the MAEs plot.The overall MAPE averages around .575% (denoted by a gray horizontal line in Figure 8).

Extrapolation for diatomic molecule
Purely data-driven neural network approaches rapidly degrade in predictive performance when provided with data outside the training set.However, using physicsbased approaches such as PINNs and also FNOs, higher extrapolation performance can be expected.Compared to data-driven learning, the neural network in the PINN model represents the solution to a given PDE, allowing accurate predictions within the specific scope of that PDE.We evaluate the PINN model's  The colors labels the eigenstates in increasing order of energy as described in Figure 5.
The outcome of this analysis is illustrated in Figure 9, which shows the MAE.The errors have increased as anticipated, resulting in an overall MAE of 2.48e-2 Ha indicated by the gray horizontal line.
The error has doubled in comparison to the interpolation task featured in Figure 5.While this is not a catastrophic failure, the higher error suggests the intricacy of extrapolation.The challenge of extrapolation is evident in Figure 10, where we illustrate the MAPE resolved over the first six eigenvalues with an overall MAPE of .73%,denoted by a gray line.Although no significant or sudden rise in error is observed with increasing eigenvalues, the overall MAPE is noticeably higher, as is the standard deviation shown by the red error bars.

Data-driven inversions with Fourier neural operators
In contrast to the PINN model, the density-topotential mapping data is explicitly used in the loss function to train the data-driven FNOs, as outlined in Section 3.4.The network takes the density grid as input and produces the corresponding potential grid as output.FNOs have several benefits, including learning the mapping in the functional space, which enables them to generalize effectively over varying input densities.Additionally, the network is resolutioninvariant, allowing it to assess higher resolution grids than those present in the training dataset.

Atom with varying charge
In the case of the one-dimensional atom with varying charge Z, the FNO model demonstrates exceptional performance over the range of charge values.The error plots for the eigenvalues, as shown in Figure 11, indicate that the predicted eigenvalues closely align with the true values.We resolve the error analysis over the spectrum of eigenvalues by showing the MAPE for the first six eigenvalues in Figure 12.The red error bars denote three standard deviations away from the mean, demonstrating that the MAPE is within 0.15% in this range of eigenvalues.The range of MAPEs is lowest for the ground state and shows a slight increasing trend with higher energy levels.This increase can be attributed to the magnitude of the eigenvalues decreasing as the energy level increase.Higher energy states, with their inherently lower magnitudes, offer a smaller margin for absolute error, thus demanding greater accuracy.
The model achieves this to a lesser degree, although the level of error is still well within the range of chemical accuracy.The overall MAE averaged over all model systems is 2.22e-04 Ha and the corresponding averaged MAPE over all eigenvalues is 3.18e-02 % denoted by gray horizontal lines in Figures 11 and 12.This underscores the FNO model's ability to accurately capture the potentialdensity mapping.

Diatomic molecule with varying charges and bond length
After demonstrating improved performance over the PINNs model for the onedimensional atom, we investigate the FNO model's abilities for the one-dimensional diatomic molecule.Variations in both charges (Z 1 and Z 2 ) and bond length d pose a different set of challenges for the FNO model.As depicted in Figure 13, the plots for eigenvalue errors indicate a slightly higher margin of error in comparison to the atomic model system.The eigenvalue errors consistently remain within chemical accuracy, except for a particular outlier.Figure 14 shows the MAPE range for each eigenvalue.There is a clear trend of increasing MAPE range from the ground state to excited states.Nevertheless, the overall MAE of 2.27e-04 Ha and MAPE of 1.90e-02% (denoted by gray horizontal lines) align with the results of the atomic model system, confirming the FNO model's adaptability and accuracy across this more challenging set of system parameters.

Extrapolation for diatomic molecule
The true test of a predictive model lies in its ability to generalize beyond the parameters of the systems in the training dataset.Figure 15 showcases the eigenvalue error plots for this dataset, which include systems with charges (Z 1 and Z 2 ) and bond lengths (d) that are outside the previous datasets.The errors recorded were marginally higher than those for the training dataset, and about half the eigenvalues are predicted within chemical accuracy.The percentage errors are within 2%, as depicted in Figure 16.The FNO model yields overall an MAE of 2.27e-04 Ha and MAPE of 1.90e-02% (denoted by gray horizontal lines).This demonstrates the FNO model's robustness and potential for broader applicability in solving the KS inversion problem.The colors labels the eigenstates in increasing order of energy as described in Figure 5.

Discussion
We summarize and contrast our results for the PINN and FNO models in Table 1 for both atomic and molecular model systems.Our performance metrics are the MAE expressed in Hartree (Ha) and the MAPE.Overall, the FNO outperforms the PINN model, providing chemical accuracy (MAE ≤ 0.0016 Ha) for almost all model systems.
For atoms, the PINN model shows an MAE of 0.0018 Ha, corresponding to a relative error of 0.13%, while the FNO model shows an MAE of 0.0002 Ha, corresponding to a relative error of 0.03%.The PINN model significantly improves its accuracy when the grid resolution is increased to 501, while the FNO model shows consistent accuracy over different grid resolutions.
When applied to molecules, the error of the PINN model increases significantly, especially for the extrapolation task, with an MAE reaching 0.0248 Ha and a relative error up to 0.73%.The FNO model maintains a lower error rate and remains within the chemical accuracy except for the extrapolation task, where its MAE increases to 0.005 Ha and a relative error of 0.25%.Despite the increase in error, the FNO model is still highly accurate.The values in parentheses represent additional metrics, namely the maximum absolute error and the maximum percentage error, which indicate the maximum spread of errors to evaluate the robustness of the models.
Having established the accuracy of the PIML methods, we turn to analyze the computational efficiency.
To this end, Table 2 shows the computational timings of the PINN and FNO models against a conventional inversion method (iDEA code) across the different model systems.Timing results are given in seconds, with standard deviations to indicate variability in computational performance.For atoms, the conventional inversion method shows a mean computation time of 135±29 seconds, which is significantly higher than both PINN and FNO models, which show mean computation times of 0.0016±0.0011seconds and 0.0022±0.0009seconds, respectively.The difference is even more pronounced for the molecular systems, where the conventional method requires 305±262 seconds, while PINN and FNO remain in the millisecond range.In particular, for the molecular system with larger grid resolution (501 grid points), the computational time of the conventional method continues to increase, while FNO maintains an efficient computational evaluation in the millisecond range.These results highlight the substantial improvements in computational speed offered by the PINN and FNO models over conventional methods, with FNO showing slightly faster times and lower variability than PINN in the scenarios tested, suggesting a robustness that could be particularly beneficial for larger and more complex systems.

Conclusion
In summary, this work has demonstrated the potential of physics-informed machine learning (PIML) techniques, specifically physics-informed neural networks (PINNs) and Fourier neural operators (FNOs), to address the inverse problem in Kohn-Sham density functional theory (KS-DFT).The PINN model uses the underlying KS differential equation to predict the KS potential from given electron densities.FNOs, on the other hand, use data from known density-to-potential mappings.They exhibit superior performance in both accuracy and computational efficiency as PINNs across a range of grid resolutions and complexity of model systems.In particular, FNOs maintain chemical accuracy in most cases, underscoring their ability to handle the density-to-potential mapping effectively.The computational times for both PIML approaches significantly outperform conventional methods, offering a promising alternative for large-scale electronic structure inversions.
A promising avenue for future work is to combine the strengths of both PINNs and FNOs.This could be realized by a hybrid model with a twocomponent loss term: one part based on the densityto-potential mapping characteristic of the FNO model, and another part derived from the underlying KS differential equation represented by the PINN model.During training, both the FNO and PINN components would be optimized simultaneously.This approach is expected to yield an efficient PIML model that not only exploits the data-driven robustness of the FNO component, but also requires less data and exhibits broader generalizability due to the PINN-derived loss.
Our results indicate that the integration of machine learning, in particular PIML techniques, can significantly improve the efficiency and accuracy of electronic structure inversions.These advances offer promising prospects for elucidating the XC potential of materials from experimental electron density data and for advancing the development of XC functionals within density functional theory, providing a reliable computational tool for accurate density-to-potential inversions.

Figure 1 :
Figure 1: Illustration of the model systems: onedimensional atom (blue) and a one-dimensional diatomic molecule (orange) with variable parameters charge Z, Z 1 , and Z 2 and bond length d.

Figure 2 :
Figure 2: PINN architecture for predicting the KS potential based on an input electronic density.

Figure 3 :
Figure 3: FNO architecture for predicting the KS potential based on an input electronic density.

Figure 4 :
Figure 4: Similarity measures − cosine similarity (left) and Euclidean distance (right) − of the two model systems.The top panel shows the similarity measures for the one-dimensional atom with varying charge, while the bottom panel shows the similarity measures for the one-dimensional diatomic molecule with varying charge and bond length.The similarity measures illustrate the greater degree of complexity in the molecular model system.The axes are labeled by the system index.

Figure 5 :
Figure 5: MAE of eigenvalues predicted by the PINN model on a logarithmic scale for the onedimensional atom.The MAE is averaged over 10 network initializations.The red horizontal line denotes chemical accuracy, while the gray horizontal line depicts the MAE averaged over all test systems.The colors label the eigenstates in increasing order as follows: blue, orange, red, green, purple, and brown.

Figure 6 :
Figure 6: The MAPE resolved for the first six eigenvalues of the one-dimensional atom with varying charges predicted by the PINN model.The red error bars denote three standard deviations away from the mean, while the gray horizontal line depicts the MAPE averaged over all eigenvalues.

Figure 7 :
Figure 7: MAE of eigenvalues predicted by the PINN model on a logarithmic scale for the one-dimensional diatomic molecule.The MAE is averaged over 10 network initializations.The red horizontal line denotes chemical accuracy, while the gray horizontal line depicts the MAE averaged over all test systems.The colors label the eigenstates in increasing order of energy as described in Figure 5.

Figure 8 :
Figure 8: The MAPE resolved for the first six eigenvalues of the one-dimensional diatomic molecule with varying charges and bond length predicted by the PINN model.The red error bars denote three standard deviations away from the mean, while the gray horizontal line depicts the MAPE averaged over all eigenvalues.

Figure 9 :
Figure 9: Extrapolation with the PINN model for the one-dimensional diatomic molecule with varying charges and bond length.The test set includes molecules with charges and bond length that are outside the parameter ranges of the training dataset.The MAE of the predicted eigenvalues is shown on a logarithmic scale.The MAE is averaged over 10 network initializations.The red horizontal line denotes chemical accuracy, while the gray horizontal line depicts the MAE averaged over all test systems.The colors labels the eigenstates in increasing order of energy as described in Figure5.

Figure 10 :
Figure 10: Extrapolation with the PINN model for the one-dimensional diatomic molecule.The MAPE is resolved for the first six eigenvalues.The red error bars denote three standard deviations away from the mean, while the gray horizontal line depicts the MAPE averaged over all eigenvalues.

Figure 11 :
Figure 11: MAE of eigenvalues predicted by the FNO model on a logarithmic scale for the onedimensional atom.The MAE is averaged over 10 network initializations.The red horizontal line denotes chemical accuracy, while the gray horizontal line depicts the MAE averaged over all test systems.The colors label the eigenstates in increasing order of energy as described in Figure 5.

Figure 12 :
Figure 12: The MAPE resolved for the first six eigenvalues of the one-dimensional atom with varying charge predicted by the FNO model.The red error bars denote three standard deviations away from the mean, while the gray horizontal line depicts the MAPE averaged over all eigenvalues.

Figure 13 :
Figure 13: MAE of eigenvalues predicted by the FNO model on a logarithmic scale for the one-dimensional diatomic molecule.The MAE is averaged over 10 network initializations.The red horizontal line denotes chemical accuracy, while the gray horizontal line depicts the MAE averaged over all test systems.The colors label the eigenstates in increasing order of energy, as described in Figure 5.

Figure 14 :
Figure 14: The MAPE resolved for the first six eigenvalues of the one-dimensional diatomic molecule with varying charges and bond length predicted by the FNO model.The red error bars denote three standard deviations away from the mean, while the gray horizontal line depicts the MAPE averaged over all eigenvalues.

Figure 15 :
Figure 15: Extrapolation with the FNO model for the one-dimensional diatomic molecule.The test set includes molecules with charges and bond length that are outside the parameter ranges of the training dataset.The MAE of the predicted eigenvalues is shown on a logarithmic scale.The MAE is averaged over 10 network initializations.The red horizontal line denotes chemical accuracy, while the gray horizontal line depicts the MAE averaged over all test systems.The colors labels the eigenstates in increasing order of energy as described in Figure5.

Figure 16 :
Figure 16: Extrapolation with the FNO model for the one-dimensional diatomic molecule.The MAPE is resolved for the first six eigenvalues.The red error bars denote three standard deviations away from the mean, while the gray horizontal line depicts the MAPE averaged over all eigenvalues.

Table 1 :
work was partially supported by the Center for Advanced Systems Understanding (CASUS) which is financed by Germany's Federal Ministry of Education and Research (BMBF) and by the Saxon state government out of the State budget approved by the Saxon Model Atom (301) Atom (501) Molecule (301) Molecule (301 E) Performance comparison of PINN and FNO models on both model systems, showing the MAE (in Ha) and MAPE (%) and denoting the maximum absolute errors and the maximum percentage errors in braces.The labels 301 and 501 indicate the grid resolutions and E denotes extrapolation.

Table 2 :
Computational timings for inversions (in seconds), comparing a conventional method (iDEA) with the PINN and FNO models.State Parliament.Computations were performed on a Bull Cluster at the Center for Information Services and High-Performance Computing (ZIH) at Technische Universität Dresden and on the cluster Hemera of the Helmholtz-Zentrum Dresden-Rossendorf (HZDR).AC and KS acknowledge funding from the Helmholtz Association's Initiative and Networking Fund through Helmholtz AI.