# Solving Differential Equations with Neural Networks:

Applied to the Calculation of Cosmological Phase Transitions

###### Abstract

Starting from the observation that artificial neural networks are uniquely suited to solving optimisation problems, and most physics problems can be cast as an optimisation task, we introduce a novel way of finding a numerical solution to wide classes of differential equations. We find our approach to be very flexible and stable without relying on trial solutions, and applicable to ordinary, partial and coupled differential equations. We apply our method to the calculation of tunnelling profiles for cosmological phase transitions, which is a problem of relevance for baryogenesis and stochastic gravitational wave spectra. Comparing our solutions with publicly available codes which use numerical methods optimised for the calculation of tunnelling profiles, we find our approach to provide at least as accurate results as these dedicated differential equation solvers, and for some parameter choices even more accurate and reliable solutions. We point out that this approach of using artificial neural networks to solve equations is viable for any problem that can be cast into the form , and is thus applicable to various other problems in perturbative and non-perturbative quantum field theory.

IPPP/19/11

## I Introduction

A neural network is an algorithm designed to perform an optimisation procedure, where the loss function provides a measure of the performance of the optimisation. Thus, if a physics problem can be cast into the form , then its solution can be calculated by minimising the loss function of a neural network. While this approach is applicable to any function , we attempt to apply this observation to the solution of differential equations and to the non-perturbative calculation of tunnelling rates of electroweak phase transitions.

Solving differential equations is a profound problem, relevant for all areas of theoretical physics. For large classes of differential equations, analytic solutions cannot be found. Thus, numerical or approximative methods are needed to solve them. Standard methods to solve differential equations numerically include the Runge-Kutta method, linear multistep methods, finite-element or finite-volume methods, and spectral methods Springer Verlag GmbH, European Mathematical Society (). We instead propose a novel approach to solving differential equations using artificial neural networks.

In recent years, machine-learning algorithms have become increasingly popular in extracting correlations in high-dimensional parameter spaces. Even for a small number of dimensions, e.g. , it becomes very difficult to visualise data such that a human can extract correlations to a high degree of accuracy. Machine-learning algorithms, and in particular neural networks, prove to be faster, more precise and allow a parametric improvement of the precision in how well the region of interest is interpolated. As a result, various neural network architectures have been designed, e.g. convolutional neural networks, recurrent neural networks, deep neural networks, etc., to perform various increasingly complex tasks.

In particle physics such tasks include the classification of signal to background events based on event selection cuts McGlone (2009); Chatrchyan et al. (2013); Aaboud et al. (2018); Sirunyan et al. (2019), or the classification of complex objects such as jets, according to the image their radiation imprints in the detector de Oliveira et al. (2016); Barnard et al. (2017); Komiske et al. (2017); Lenz et al. (2018); Metodiev et al. (2017); Kasieczka et al. (2017); Butter et al. (2018); Chang et al. (2018). In other applications neural networks are used to regress between data points Ball et al. (2009); Louppe et al. (2016); D’Agnolo and Wulzer (2019); Englert et al. (2019); Brehmer et al. (2018) or are trained on a well known sample to identify outliers or anomalies Farina et al. (2018); Hajer et al. (2018). However, in all aforementioned applications that can be characterised as classification and regression, the neural network is applied to an output sample, trying to extract information on the parameters that determine the input. In particle physics that would mean to analyse the radiation profile as recorded by a particle detector to learn the parameters of the underlying model, e.g. the Standard Model. Input and output are connected through quantum field theory, i.e. a non-trivial set of differential and integral equations.

We propose to use these powerful artificial neural network algorithms in a different way, namely to directly find solutions to differential equations. We then apply these methods to calculate the solution of the non-perturbative quantum-field-theoretical description of tunnelling processes for electroweak phase transitions. The fast and reliable calculation of tunnelling rates of the electroweak phase transitions within and in extensions of the Standard Model is of importance to assessing if the model allows for a strong first-order phase transition during the evolution of the early Universe. This could explain baryogenesis Sakharov (1967); Kuzmin et al. (1985) in such a model as the source of matter-antimatter asymmetry in the Universe, and further lead to a stochastic gravitational wave signal which could potentially be measured at future gravitational wave experiments Kosowsky et al. (1992); Grojean and Servant (2007), e.g. eLISA Caprini et al. (2016).

The Universal Approximation Theorem Hornik et al. (1989); Hornik (1991) allows us to expect a neural network to perform well in solving complicated mathematical expressions. It states that an artificial neural network containing a single hidden layer can approximate any arbitrarily complex function with enough neurons. We make use of this property by proposing a neural network model where the output of the network alone solves the differential equation, subject to its boundary conditions. In contrast to previous approaches Lee and Kang (1990); Meade and Fernandez (1994); Meade and A. Fern (1994); Lagaris et al. (1997); Mall and Chakraverty (2013); Iftikhar and Bilal (2014) where the neural network is part of a full trial solution which is fixed to satisfy the boundary conditions, our approach includes the boundary conditions as additional terms in the loss function. The derivatives of the network output with respect to its inputs are calculated and passed to the loss function, and the network is optimised via backpropagation to regress to the solution of the differential equation. The network then gives a fully differentiable function which can be evaluated at any point within the training domain, and in some cases, extrapolated to further points (although we don’t explore the extrapolation performance here).

We will begin by describing the method in detail and showcasing how it can be used to solve differential equations of varying complexity, before applying it to the calculation of cosmological phase transitions.

## Ii The Method

### ii.1 Design of the Network and Optimisation

We consider an artificial feedforward neural network (NN) with inputs, outputs and a single hidden layer with units. The outputs of the network, , can be written as,

(1) |

where the activation function is applied element-wise to each unit, and and denote the hidden and final layers, respectively. We use a single neural network with outputs to predict the solutions to coupled differential equations, and for the case of one differential equation, we use .

A set of coupled th order differential equations can be expressed in the general form,

(2) |

with boundary or initial conditions imposed on the solutions . Writing the differential equations in such a way allows us to easily convert the problem of finding a solution into an optimisation one. An approximate solution is one which approximately minimises the square of the left-hand side of Eq. (2), and thus the analogy can be made to the loss function of a neural network. In previous approaches Lee and Kang (1990); Meade and Fernandez (1994); Meade and A. Fern (1994); Lagaris et al. (1997), is a trial solution composed of two parts: one which satisfies the boundary conditions, and one which is a function of the output of a neural network and vanishes at the boundaries. However, this requires one to choose a special form of the trial solution which is dependent on the boundary conditions. Furthermore, for some configurations of boundary conditions, finding such a trial solution is a very complex task, e.g. in the case of phase transitions. Instead, we identify the trial solution with the network output, , and include the boundary conditions as extra terms in the loss function. If the domain is discretised into a finite number of training points , then approximations to the solutions, , can be obtained by finding the set of weights and biases, , such that the the neural network loss function is minimised on the training points. For training examples, the full loss function that we use is,

(3) |

where the second term represents the sum of the squares of the boundary conditions, defined at the boundaries .^{1}^{1}1Here, represents the order of derivative for which the boundary condition is defined, and is a function on the boundary. For example, for the condition the second term would be . These can be Dirichlet or Neumann, or they can be initial conditions if defined at the initial part of the domain.

The problem is then to minimise by optimising the weights and biases in the network, for a given choice of network setup. To calculate the loss, it is necessary to compute the derivatives of the network output with respect to its input. Since each part of the network, including the activation functions, are differentiable, then the derivatives can be obtained analytically. Ref. Lagaris et al. (1997) outlines how to calculate these derivatives. The optimisation can then proceed via backpropagation by further calculating the derivatives of the loss itself with respect to the network parameters. We use the Keras framework Chollet et al. (2015) with a TensorFlow Abadi et al. (2016) backend to implement the network and perform the optimisation of the loss function.

As with any neural network, the choice of hyperparameters will have an effect on the performance. For our setup, the important parameters are the number of hidden layers, the number of units in each hidden layer, the number of training points (corresponding to the number of anchors in the discretisation of the domain of the differential equation), the activation function in each hidden layer, the optimisation algorithm, the learning rate, and the number of epochs the network is trained for. Furthermore, a choice must be made for the size of the domain that contains the points that the network is trained on, but this will usually be determined by the problem being solved.

In all the examples, we use the Adam optimiser Kingma and Ba (2014) with learning rate reduction on plateau, i.e. when the loss plateaus the learning rate is reduced, and an initial learning rate of . We find that the network is not susceptible to overfitting—the training points are chosen exactly from the domain that one is trying to find the solution to, and are not subject to statistical fluctuations, so finding a solution for which the loss at every training point is zero would not limit the generalisation of the solution to other points within the domain. Therefore, we use a large number of epochs such that the training loss becomes very small. For all examples we use a conservative number of epochs. Furthermore, we use the entire set of training points in each batch so that the boundary conditions in the loss are included for each update of the network parameters. We also find that in general, a single hidden layer with a small number of units () is sufficient to obtain very accurate solutions.

In order to assess and improve the stability and performance in certain cases, there are some additional technical methods which we employ beyond the basic setup. Firstly, the differentiability of the network solution allows us to calculate the differential contribution, , to the loss across the entire training domain. This shows the degree of accuracy to which each part of the network solution satisfies the differential equation, and can be used for assessing the performance in cases where the analytic solution is not known. Secondly, for coupled differential equations with initial conditions, we find the stability of the solution can be improved by iteratively training on increasing domain sizes. Finally, for the calculation of phase transitions, we employ a two-step training where initially the boundaries are chosen to be the true and false vacua, before the correct boundary conditions are used in the second training. This prevents the network from finding the trivial solution where the field is always in the false vacuum.

### ii.2 Ordinary Differential Equation Examples

To show how well the method can solve ordinary differential equations (ODEs), we apply it to both a first and a second order ODE, which have known analytic solutions. The equations we study are,

(4) |

with the boundary condition in the domain and,

(5) |

with boundary conditions and in the domain .

As a simple neural network structure, we choose a single hidden layer of 10 units with sigmoid activation functions, and we discretise the domain into 100 training examples. It is then just a case of passing the differential equations and boundary conditions to the loss function, as described in Eq. (II.1), and proceeding with the optimisation. Fig. 1 shows the results of the neural network output, compared to the analytic solutions of Eq. (4) and Eq. (5). The middle panel of Fig. 1 shows the absolute numerical difference between the numerical and analytic solutions. This difference can be reduced further by increasing the number of epochs, the number of anchors in the discretisation of the domain, or the number of units in the hidden layer. Thus, the neural network provides handles to consistently improve the numerical accuracy one aims to achieve.

The lower panel of Fig. 1 shows the differential contribution to the loss function, i.e. how much each training example contributes to the loss. As we will describe in the next section, if the solution is not analytically known, this provides a measure to assess whether the found solution is the correct one or if a numerical instability led the network to settle in a local minimum for the loss.

### ii.3 Coupled Differential Equation Example

When discussing the calculation of cosmological phase transitions, we will study the solution of coupled non-linear differential equations, for which no closed analytic form is known. Here, we will first show that such solutions can be obtained with our approach, for a case where an analytic solution is known. We consider,

(6) |

with boundary conditions,

(7) |

If the boundary conditions are set on one end of the domain, e.g. here at , it requires an increasingly elaborate network to maintain numerical stability for the solution over a large domain, e.g. where . This is due to small numerical instabilities during backpropagation because of the complexity of the loss hypersurface. If such numerical instability leads the network to choose a path that is in close proximity to the true solution, the NN can settle on a local minimum with a small value for the loss function. To solve this problem, we propose to incrementally extend the domain on which a solution should be found, by partitioning the training examples and increasing the number of partitions the NN is trained on in each step. If the weights the NN has learned in the previous step are then retained before training for the next step, i.e. the network only has to learn the function on the part of the domain that was incrementally increased, we find that one can achieve numerical stability for an arbitrarily large domain.

We show this mechanism in Fig. 2, where we have partitioned the full domain containing 100 training examples into three regions each of size 1. The network structure again consists of a single hidden layer of 10 units with sigmoid activation functions, and with two units in the final layer, since there are two coupled equations. The upper panel shows the solutions for and for each iterative step. While the first iteration only allows a solution to be found on a smaller domain, i.e. here from 0 to 1, subsequent steps, and in particular the third step, allows an accurate solution to be found over the entire domain. Again, the differential proves to be a good indicator of whether the calculated solution is satisfying the differential equation over the entire domain, see the lower panel of Fig. 2.

### ii.4 Partial Differential Equation Example

While we will not study partial differential equations (PDEs) in the later physics examples of calculating phase transitions, we showcase here the flexibility of our NN method. With the same network architecture as used for the solution of the ordinary differential equations (except for an extra input unit for each additional variable), we can apply our approach to the solution of partial differential equations. The precise solution of such equations is a widespread problem in physics, e.g. in mechanics, thermodynamics and quantum field theory. As an example, we choose the second order partial differential equation,

(8) |

with boundary conditions,

(9) |

for which an exact analytic solution is known. In Fig. 3 we show the difference between the numerical solution as predicted by the NN and the analytic solution over the domain . The 100 training examples were chosen from an evenly-spaced grid. As the value of is of for most of the domain, the relative and absolute accuracies are similar, so we only show here the absolute accuracy. Across the entire domain, we find a numerical solution with very good absolute and relative accuracy for this second order partial differential equation. However, with a deeper NN, e.g. a second layer with 10 tanh units, we find that the accuracy improves by an order of magnitude further. Deeper and wider networks result in even better accuracies.

## Iii Calculation of Phase Transitions During the Early Universe

Electroweak baryogenesis is a candidate for solving the baryon asymmetry puzzle, the observed abundance of matter over antimatter in the Universe Shaposhnikov (1986); Kuzmin et al. (1985). The need for a dynamical generation of baryon asymmetry is dictated by inflation—the entropy production occurring in the reheating phase of inflation would have washed out any asymmetry already present at the beginning of the Universe’s evolution Linde (1990). A model of baryogenesis was proposed by A. Sakharov in 1967 Sakharov (1967), and must now be accommodated by any fundamental theory capable of addressing the baryon asymmetry problem. This is commonly translated into three necessary conditions: (i) Baryon number violation; (ii) C- and CP-violation; (iii) Loss of thermal equilibrium. While the first condition can be satisfied in the SM, the second and third conditions require it to be extended Anderson and Hall (1992); Dine et al. (1992); Huet and Sather (1995). Departure from thermal equilibrium can be obtained during a strong first-order phase transition, which is usually accompanied by a sudden change of symmetry Pathria (1996). Within the SM, this could have occurred during electroweak symmetry breaking when the Universe had the temperature GeV Rubakov and Shaposhnikov (1996); Morrissey and Ramsey-Musolf (2012). In order to assess whether this might have been the case, it is crucial to discuss the conditions for scalar field phase transitions at finite temperature.

Quantum fluctuations allow the transition between two vacua of the potential .^{2}^{2}2Without loss of generality we consider an -dimensional real scalar field . When these are not degenerate, the configuration which corresponds to a local minimum, the false vacuum , becomes unstable under barrier penetration, and can decay into the true vacuum of the potential. The tunnelling process converts a homogeneous region of false vacuum into one of approximate true vacuum—a bubble. Far from this region the false vacuum persists undisturbed Coleman (1977). The Euclidean action for this process reads,

(10) |

The description of the tunnelling action at finite temperatures follows from the equivalence between the quantum statistics of bosons (fermions) at and Euclidean quantum field theory, periodic (anti-periodic) in the Euclidean time with period . In the calculation of , the integration over is replaced by multiplication by Linde (1983), leaving the three-dimensional Euclidean action,

(11) |

with . Suggested by the symmetry of the physical problem, we assume to be invariant under three-dimensional Euclidean rotations (see Ref. Coleman et al. (1978) for a rigorous demonstration in the case of one single scalar field), and define . The bubble configuration is the solution to the Euler-Lagrange equation of motion,

(12) |

where the gradient of the potential is with respect to the field . The boundary conditions are,

(13) |

The solution thus minimises the action. The probability per unit time and unit volume for the metastable vacuum to decay is given by,

(14) |

This is maximised by the bounce,

(15) |

where is the action evaluated at the stationary configuration . A complete expression for the factor in Eq. (14) would require complex computations of differential operator determinants, for which we refer the reader to Ref. Linde (1990). An estimate can be obtained from dimensional analysis, which gives Apreda et al. (2002).

Dedicated methods for calculating the nucleation rate, by finding a solution for the bubble profile to the non-linear coupled differential equations of Eq. (12) exist, and have been implemented in publicly available codes, e.g. CosmoTransitions Wainwright (2012) and BubbleProfiler Athron et al. (2019). For the single-field case, both CosmoTransitions and BubbleProfiler use variants of the overshooting and undershooting method. In the multiple field case, BubbleProfiler applies the Newton-Kantorovich method Kantorovich (1948), as described in Akula et al. (2016). CosmoTransitions instead uses a method that splits the equation of motion into a parallel and perpendicular component along a test path through field space. Then the path is varied until a configuration is found that solves simultaneously both directions of the equations of motion. A further code to calculate the tunnelling rates is given in Ref. Masoumi et al. (2017). An approach using neural networks to directly learn bounce actions from potentials was described in Ref. Jinno (2018). Recently, a novel approximative approach for single Espinosa (2018) and multiple fields Espinosa and Konstandin (2019) was proposed. Older numerical approaches to calculating bubble profiles and tunnelling rates include John (1999); Konstandin and Huber (2006); Park (2011).

### iii.1 Phase Transition with a Single Scalar Field

As a first application of our method to the computation of cosmological phase transitions, we consider the case of a single scalar field. Eq. (12) then has a straightforward classical analogy—it describes the motion of a particle with coordinate subject to the inverted potential and to a peculiar looking damping force which decreases with time. The problem reduces to finding the initial position , in the vicinity of , such that the particle stops at as .

Existence of a solution was proven in Ref. Coleman (1977). Starting too close or too far from would both lead to missing the final configuration , due to overshooting and undershooting respectively. Continuity of thus implies that there must exist an intermediate initial position which solves the boundary conditions in Eq. (13). The solution presents two limiting profiles, determined by the ratio of to the height of the potential barrier . If this ratio is , which corresponds to the thick-wall case, the particle will overshoot unless its initial energy is similar to . Conversely, if this ratio is small, corresponding to the thin-wall case, in order to avoid undershooting, the particle must wait close to until the time , when the damping force has become negligible. The value of can be determined exactly in the thin-wall limit Coleman (1977) using,

(16) |

where the surface tension is given by,

(17) |

We test our method on the potential Athron et al. (2019),

(18) |

and set . Two distinct and non-degenerate minima exist for , with the upper bound representing the thick-wall limit, and smaller values of representing progressively thinner cases. A plot of the potential is shown in Fig. 4, for the values and which we consider as our thin-wall and thick-wall cases respectively.

For the boundary conditions in Eq. (13), it is clearly not possible to implement an infinite domain for the training of a neural network, and the divergence in the second term of Eq. (12) prevents the equation from being evaluated at . Therefore, a training domain must be chosen. Since the solution approaches the boundaries exponentially, it can be safely assumed that the numerical uncertainties induced by these choices can be neglected, provided that is sufficiently small and is sufficiently large. To help in choosing this domain, the identification of in Eq. (18) with in Eq. (16) can be made, and the bubble radius calculated. We then use for the thick-wall case, and for the thin-wall case (since Eq.(16) underestimates the true radius for thick-wall cases). Furthermore, we use for both cases. Although these choices may seem arbitrary, we find that the solution converges provided that the transition point is contained well inside the domain, and the result remains stable even if larger domains are used. The boundary conditions then read,

(19) |

Our NN method can then be applied to find the bubble profile by solving the Euler-Lagrange equation in Eq. (12). We discretise the domain into 500 training points, and choose a network with a single hidden layer. For the thick-wall case, we use 10 hidden units with a sigmoid activation function, as was used in earlier examples, but for the thin-wall case, we find a single tanh unit is sufficient to achieve very good performance, since the solution itself closely resembles a tanh function. To prevent the network from finding the trivial solution where the field remains in the false vacuum forever, we first train the network with the boundary condition at modified to so that the network finds a solution in the vicinity of the correct solution, since the starting point is close to the true vacuum, before training again with the correct boundary conditions. We use this two-step training for all phase transition calculations.

Our results for the thick-wall and thin-wall cases are shown in Figs. 5 and 6 respectively, together with the CosmoTransitions and BubbleProfiler solutions. While all three methods agree very well for the thick-wall case, CosmoTransitions is off compared to BubbleProfiler and the NN approach in the thin-wall case. The dashed vertical line indicates where the bubble radius should be according to Eq. 16. Both, BubbleProfiler and NN find a solution that matches the analytic calculation for the bubble radius. CosmoTransitions instead finds a solution with a smaller bubble radius, and therefore a smaller action and a larger tunnelling rate.

For thin-wall cases, numerical stability is difficult to achieve. It is possible for an approximate solution to be found, which transitions at a much earlier than it should, since a translated solution also approximately solves the differential equation Masoumi et al. (2017). For our method, can be monitored during the course of the training. During the early stages of the training where the solution does not yet have the correct transition point, then will be sharply distributed in the region of the incorrect transition. As the training proceeds and the solution converges, the function will flatten out until an accurate solution is found across the entire domain.

We noted that we achieved very good stability for our thin-wall case using a single tanh function. We also explored the idea of using an adaptive distribution of training examples, such that more examples are distributed close to the region where the transition of the NN solution happens, and this distribution is then modified over the course of the training. A larger contribution to the loss in this region will be amplified by having more training examples, which can speed up learning. We found the results can be improved by using this procedure, and this is an idea which could be investigated further in future work.

### iii.2 Phase Transition with Two Scalar Fields

To investigate how well the NN approach can solve the differential equation of Eq. (12) for multiple fields, we consider a potential for two scalar fields Wainwright (2012),

(20) |

which has a local minimum at and a global minimum near . We focus again on the thick- and thin-wall cases, setting for the former and for the latter. For the thick-wall potential, we solve the coupled equations in Eq. (12) with the boundary conditions,

(21) |

in the training domain with 500 training points. Again, the NN is built with units in a single hidden layer with a sigmoid activation function. Since there are two fields, the NN has two units in the final layer. The two components and of the bubble solution, and the associated path through field space, are shown in Figs. 7 and 8 respectively. Once more, BubbleProfiler and the NN predictions agree very well, both for the one-dimensional profiles for and , as well as for the path in the plane. CosmoTransitions shows a slightly different shape for the solutions of and even more so for , resulting in a slightly modified escape path in Fig. 8. We note that our NN solution has found initial positions for the fields which agree with those from BubbleProfiler. In thick-wall cases, these can differ significantly from the true vacuum , so these values have not been used as an input to the training and the network has converged to them itself.

For the thin-wall potential we find that the performance can be significantly improved if a deeper network is used. BubbleProfiler instead does not find a solution at all, while the NN agrees very well with the path found by CosmoTransitions. Since there is not a solution from all three codes, we do not show the plot here.

### iii.3 Singlet-Scalar Extended Standard Model with Finite Temperature Contributions

As a final example, we study a scenario of phenomenological interest, namely the extension of the SM Higgs sector by a single scalar field.^{3}^{3}3For projected and existing limits on this model see Refs. Profumo et al. (2007); No and Spannowsky (2018) and references therein. Despite its simplicity, the singlet-scalar extended Standard Model (SSM) could potentially provide solutions to puzzles such as the existence of dark matter Kusenko (2006); Burgess et al. (2001); McDonald (2002) and electroweak baryogenesis Cline and Kainulainen (2013); Huber et al. (2006); Huber and Schmidt (2001), where a crucial requirement is a strong electroweak phase transition, as discussed previously. The tree-level potential reads,

(22) |

where denotes the Higgs field and the additional -symmetric scalar field.^{4}^{4}4This condition could also be relaxed, since in models with no -symmetry the most general renormalisable potential would have three more parameters Profumo et al. (2007); Espinosa et al. (2012). It is possible to consider a scenario in which the potential barrier separating the electroweak symmetric and the broken phase is generated already at tree level Espinosa et al. (2012). In this scenario, to study the evolution of parameters with , it is enough to include only the high-temperature expansion of the one-loop thermal potential, which results in thermal corrections to the mass parameters Cline et al. (1999),

(23) |

where,

(24) |

(25) |

with and being the and gauge couplings respectively, and is the top Yukawa coupling. We then consider Eq. (12) with the potential,

(26) |

At high temperatures the thermal contribution in Eq. (23) dominates and the global minimum is the and electroweak symmetric configuration . The behaviour as decreases is determined by the choice of parameters. These are constrained to the parameter region in which the potential develops a strong tree-level barrier at the critical temperature Espinosa et al. (2012). In particular at after -symmetry breaking, acquires a non-zero vacuum expectation value, , along the direction. This configuration constitutes a global minimum for the potential. At a second degenerate minimum appears at the electroweak symmetry breaking phase and at the restored -symmetric vacuum, . Finally at the electroweak minimum represents the only energetically favourable configuration. The nucleation temperature at which the phase transition from to occurs is found from the requirement Anderson and Hall (1992); Moreno et al. (1998).

As an example parameter configuration, we consider GeV, and , as used in Ref. Athron et al. (2019), and a temperature of GeV, which is the nucleation temperature that BubbleProfiler finds. We thus solve the equations in Eq. (12) with the boundary conditions,

(27) |

We use a neural network with 10 units in a single hidden layer with a sigmoid activation function, on a training domain of with 500 training points. To avoid large numerical values in the loss function, we scale all mass parameters in the potential by the electroweak symmetry breaking vacuum expectation value at zero temperature, . Our result, along with the comparison to CosmoTransitions and BubbleProfiler, is shown in Fig. 9. We find very good agreement between all three methods to calculate the bubble profiles and , and the small values of across the domain show that good convergence has been achieved.

## Iv Conclusions

By building on the capabilities of an artificial neural network in solving optimisation problems, we have proposed a novel way to finding solutions to differential equations.

Our method extends on existing approaches on several accounts: (i) We avoid trial functions by including the boundary conditions directly into the loss function; (ii) The differential shape of is an excellent indicator of whether a good solution to has been found over the entire domain; (iii) In regions of numerical stability we propose to increase the domain iteratively to find stable solutions over arbitrarily large domains; (iv) For solutions that vary quickly over a small part of the domain, we find can be numerically beneficial to self-adaptively distribute more anchors in such regions.

We applied this approach to finding fully differentiable solutions to ordinary, coupled and partial differential equations, for which analytical solutions are known. Various network architectures have been studied, and even relatively small networks showed a very good performance.

To show how this method can be applied to a task of direct phenomenological interest, we used it to calculate the tunnelling profiles of electroweak phase transitions and compared them to those obtained by CosmoTransitions and BubbleProfiler. We find an optimised neural network to be very flexible, and finds solutions for all the examples tested with an accuracy that is competitive with the dedicated programs for calculating the bubble profiles. However, further work, e.g. in developing an approach to choosing the domain sizes for phase transitions in a more robust way, would be required to develop a fully automated tool using this approach.

As this method could be straightforwardly extended beyond the calculation of differential equations we envision it to be applicable to a wide range of problems in perturbative and non-perturbative quantum field theory.

###### Acknowledgements.

Acknowledgements: We would like to thank Mikael Chala for help with the CosmoTransitions code. MS acknowledges the generous hospitality of Barbara Jaeger and her group at the University of Tuebingen and support of the Humboldt Society during the completion of this work.## References

- (1) Springer Verlag GmbH, European Mathematical Society, “Encyclopedia of Mathematics,” Website, uRL: https://www.encyclopediaofmath.org/.
- McGlone (2009) H. M. McGlone, “Neural Network Analysis in Higgs Search using and TAG Database Development for ATLAS,” (2009).
- Chatrchyan et al. (2013) S. Chatrchyan et al. (CMS), Phys. Rev. D87, 072001 (2013), arXiv:1301.0916 [hep-ex] .
- Aaboud et al. (2018) M. Aaboud et al. (ATLAS), Phys. Rev. D97, 072016 (2018), arXiv:1712.08895 [hep-ex] .
- Sirunyan et al. (2019) A. M. Sirunyan et al. (CMS), Phys. Rev. Lett. 122, 021801 (2019), arXiv:1807.06325 [hep-ex] .
- de Oliveira et al. (2016) L. de Oliveira, M. Kagan, L. Mackey, B. Nachman, and A. Schwartzman, JHEP 07, 069 (2016), arXiv:1511.05190 [hep-ph] .
- Barnard et al. (2017) J. Barnard, E. N. Dawe, M. J. Dolan, and N. Rajcic, Phys. Rev. D95, 014018 (2017), arXiv:1609.00607 [hep-ph] .
- Komiske et al. (2017) P. T. Komiske, E. M. Metodiev, and M. D. Schwartz, JHEP 01, 110 (2017), arXiv:1612.01551 [hep-ph] .
- Lenz et al. (2018) A. Lenz, M. Spannowsky, and G. Tetlalmatzi-Xolocotzi, Phys. Rev. D97, 016001 (2018), arXiv:1708.03517 [hep-ph] .
- Metodiev et al. (2017) E. M. Metodiev, B. Nachman, and J. Thaler, JHEP 10, 174 (2017), arXiv:1708.02949 [hep-ph] .
- Kasieczka et al. (2017) G. Kasieczka, T. Plehn, M. Russell, and T. Schell, JHEP 05, 006 (2017), arXiv:1701.08784 [hep-ph] .
- Butter et al. (2018) A. Butter, G. Kasieczka, T. Plehn, and M. Russell, SciPost Phys. 5, 028 (2018), arXiv:1707.08966 [hep-ph] .
- Chang et al. (2018) S. Chang, T. Cohen, and B. Ostdiek, Phys. Rev. D97, 056009 (2018), arXiv:1709.10106 [hep-ph] .
- Ball et al. (2009) R. D. Ball, L. Del Debbio, S. Forte, A. Guffanti, J. I. Latorre, A. Piccione, J. Rojo, and M. Ubiali (NNPDF), Nucl. Phys. B809, 1 (2009), [Erratum: Nucl. Phys. B816, 293(2009)], arXiv:0808.1231 [hep-ph] .
- Louppe et al. (2016) G. Louppe, M. Kagan, and K. Cranmer, (2016), arXiv:1611.01046 [stat.ME] .
- D’Agnolo and Wulzer (2019) R. T. D’Agnolo and A. Wulzer, Phys. Rev. D99, 015014 (2019), arXiv:1806.02350 [hep-ph] .
- Englert et al. (2019) C. Englert, P. Galler, P. Harris, and M. Spannowsky, Eur. Phys. J. C79, 4 (2019), arXiv:1807.08763 [hep-ph] .
- Brehmer et al. (2018) J. Brehmer, K. Cranmer, G. Louppe, and J. Pavez, Phys. Rev. Lett. 121, 111801 (2018), arXiv:1805.00013 [hep-ph] .
- Farina et al. (2018) M. Farina, Y. Nakai, and D. Shih, (2018), arXiv:1808.08992 [hep-ph] .
- Hajer et al. (2018) J. Hajer, Y.-Y. Li, T. Liu, and H. Wang, (2018), arXiv:1807.10261 [hep-ph] .
- Sakharov (1967) A. D. Sakharov, Pisma Zh. Eksp. Teor. Fiz. 5, 32 (1967).
- Kuzmin et al. (1985) V. A. Kuzmin, V. A. Rubakov, and M. E. Shaposhnikov, Phys. Lett. 155B, 36 (1985).
- Kosowsky et al. (1992) A. Kosowsky, M. S. Turner, and R. Watkins, Phys. Rev. Lett. 69, 2026 (1992).
- Grojean and Servant (2007) C. Grojean and G. Servant, Phys. Rev. D75, 043507 (2007), arXiv:hep-ph/0607107 [hep-ph] .
- Caprini et al. (2016) C. Caprini et al., JCAP 1604, 001 (2016), arXiv:1512.06239 [astro-ph.CO] .
- Hornik et al. (1989) K. Hornik, M. Stinchcombe, and H. White, NeuralNetworks 2, 359 (1989).
- Hornik (1991) K. Hornik, NeuralNetworks 4, 251 (1991).
- Lee and Kang (1990) H. Lee and I. S. Kang, Journal of Computational Physics 91, 110 (1990).
- Meade and Fernandez (1994) A. Meade and A. Fernandez, Mathematical and Computer Modelling 20, 1 (1994).
- Meade and A. Fern (1994) A. Meade and A. A. Fern, Mathematical and Computer Modelling 20 (1994), 10.1016/0895-7177(94)00160-X.
- Lagaris et al. (1997) I. E. Lagaris, A. Likas, and D. I. Fotiadis, (1997), arXiv:physics/9705023 [physics] .
- Mall and Chakraverty (2013) S. Mall and S. Chakraverty, Advances in Artificial Neural Systems 2013, 1 (2013).
- Iftikhar and Bilal (2014) A. Iftikhar and M. Bilal, American Journal of Computational Mathematics 04, 223 (2014).
- Chollet et al. (2015) F. Chollet et al., “Keras,” https://github.com/fchollet/keras (2015).
- Abadi et al. (2016) M. Abadi et al., (2016), arXiv:1603.04467 [cs.DC] .
- Kingma and Ba (2014) D. P. Kingma and J. Ba, (2014), arXiv:1412.6980 [cs.LG] .
- Shaposhnikov (1986) M. E. Shaposhnikov, JETP Lett. 44, 465 (1986).
- Linde (1990) A. D. Linde, Contemp. Concepts Phys. 5, 1 (1990), arXiv:hep-th/0503203 [hep-th] .
- Anderson and Hall (1992) G. W. Anderson and L. J. Hall, Phys. Rev. D45, 2685 (1992).
- Dine et al. (1992) M. Dine, R. G. Leigh, P. Huet, A. D. Linde, and D. A. Linde, Phys. Lett. B283, 319 (1992), arXiv:hep-ph/9203201 [hep-ph] .
- Huet and Sather (1995) P. Huet and E. Sather, Phys. Rev. D51, 379 (1995), arXiv:hep-ph/9404302 [hep-ph] .
- Pathria (1996) R. K. Pathria, Statistical Mechanics (Second Edition) (Elsevier Ltd, 1996).
- Rubakov and Shaposhnikov (1996) V. A. Rubakov and M. E. Shaposhnikov, Usp. Fiz. Nauk 166, 493 (1996), [Phys. Usp.39,461(1996)], arXiv:hep-ph/9603208 [hep-ph] .
- Morrissey and Ramsey-Musolf (2012) D. E. Morrissey and M. J. Ramsey-Musolf, New J. Phys. 14, 125003 (2012), arXiv:1206.2942 [hep-ph] .
- Coleman (1977) S. R. Coleman, Phys. Rev. D15, 2929 (1977), [Erratum: Phys. Rev. D16, 1248(1977)].
- Linde (1983) A. D. Linde, Nucl. Phys. B216, 421 (1983), [Erratum: Nucl. Phys. B223, 544(1983)].
- Coleman et al. (1978) S. R. Coleman, V. Glaser, and A. Martin, Commun. Math. Phys. 58, 211 (1978).
- Apreda et al. (2002) R. Apreda, M. Maggiore, A. Nicolis, and A. Riotto, Nucl. Phys. B631, 342 (2002), arXiv:gr-qc/0107033 [gr-qc] .
- Wainwright (2012) C. L. Wainwright, Comput. Phys. Commun. 183, 2006 (2012), arXiv:1109.4189 [hep-ph] .
- Athron et al. (2019) P. Athron, C. BalÃ¡zs, M. Bardsley, A. Fowlie, D. Harries, and G. White, (2019), arXiv:1901.03714 [hep-ph] .
- Kantorovich (1948) L. V. Kantorovich, Uspekhi Math. Nauk 3, 89 (1948).
- Akula et al. (2016) S. Akula, C. BalÃ¡zs, and G. A. White, Eur. Phys. J. C76, 681 (2016), arXiv:1608.00008 [hep-ph] .
- Masoumi et al. (2017) A. Masoumi, K. D. Olum, and B. Shlaer, JCAP 1701, 051 (2017), arXiv:1610.06594 [gr-qc] .
- Jinno (2018) R. Jinno, (2018), arXiv:1805.12153 [hep-th] .
- Espinosa (2018) J. R. Espinosa, JCAP 1807, 036 (2018), arXiv:1805.03680 [hep-th] .
- Espinosa and Konstandin (2019) J. R. Espinosa and T. Konstandin, JCAP 1901, 051 (2019), arXiv:1811.09185 [hep-th] .
- John (1999) P. John, Phys. Lett. B452, 221 (1999), arXiv:hep-ph/9810499 [hep-ph] .
- Konstandin and Huber (2006) T. Konstandin and S. J. Huber, JCAP 0606, 021 (2006), arXiv:hep-ph/0603081 [hep-ph] .
- Park (2011) J.-h. Park, JCAP 1102, 023 (2011), arXiv:1011.4936 [hep-ph] .
- Profumo et al. (2007) S. Profumo, M. J. Ramsey-Musolf, and G. Shaughnessy, JHEP 08, 010 (2007), arXiv:0705.2425 [hep-ph] .
- No and Spannowsky (2018) J. M. No and M. Spannowsky, (2018), arXiv:1807.04284 [hep-ph] .
- Kusenko (2006) A. Kusenko, Phys. Rev. Lett. 97, 241301 (2006), arXiv:hep-ph/0609081 [hep-ph] .
- Burgess et al. (2001) C. P. Burgess, M. Pospelov, and T. ter Veldhuis, Nucl. Phys. B619, 709 (2001), arXiv:hep-ph/0011335 [hep-ph] .
- McDonald (2002) J. McDonald, Phys. Rev. Lett. 88, 091304 (2002), arXiv:hep-ph/0106249 [hep-ph] .
- Cline and Kainulainen (2013) J. M. Cline and K. Kainulainen, JCAP 1301, 012 (2013), arXiv:1210.4196 [hep-ph] .
- Huber et al. (2006) S. J. Huber, T. Konstandin, T. Prokopec, and M. G. Schmidt, Nucl. Phys. B757, 172 (2006), arXiv:hep-ph/0606298 [hep-ph] .
- Huber and Schmidt (2001) S. J. Huber and M. G. Schmidt, Nucl. Phys. B606, 183 (2001), arXiv:hep-ph/0003122 [hep-ph] .
- Espinosa et al. (2012) J. R. Espinosa, T. Konstandin, and F. Riva, Nucl. Phys. B854, 592 (2012), arXiv:1107.5441 [hep-ph] .
- Cline et al. (1999) J. M. Cline, G. D. Moore, and G. Servant, Phys. Rev. D60, 105035 (1999), arXiv:hep-ph/9902220 [hep-ph] .
- Moreno et al. (1998) J. M. Moreno, M. Quiros, and M. Seco, Nucl. Phys. B526, 489 (1998), arXiv:hep-ph/9801272 [hep-ph] .