Introduction

Machine learning methods are widely used for various applications of modern optics, especially for inverse design problems1,2,3,4,5,6,7. Methods of forward design, where based on a given optical device geometry and boundary conditions researchers can find the optical field and its properties, are highly developed and various numerical, semi-analytical, and analytical methods are well known. On the other hand, not often is it possible to devise geometries to generate a given target optical field using forward design methods. In this case deep machine learning methods and in particular neural networks can play the role of universal predictors and ultra-precise interpolators for various types of engineering. For example, optical power beam splitters and multiport devices for arbitrary transmission matrices have been designed with these methods8,9. Such problems are particularly well suited for supervised learning methods, such as neural networks, but alternative methods based on reinforcement learning have also been used in some cases to design experiments10,11.

Similar approaches can be applied to the design of optical resonators for cavity quantum electrodynamics and quantum technology. For example, for various applications in these areas strong coupling of a quantum emitter to photons in a resonator is required and simultaneously a long photon lifetime in this resonator is critically important to reach the so-called good cavity limit12 where the coherent cavity coupling exceeds the decay rates. At the same time there often are geometrical restrictions, e.g., to allow for access from the side for loading, state initialisation, optical cooling13, or trapping fields14. Other applications require strong photon coupling to two quantum emitters for 2-qubit quantum gates15,16, such as for a controlled-not (CNOT) operation between two qubits stored in trapped ions17. In this case the performance could be significantly improved with an optimized cavity mode that exhibits two peaks at the positions of the two ions.

There is thus a need for a universal method to design and engineer cavities used in quantum information applications18 which should combine strong photon-particle coupling and low cavity losses by achieving a target field topology (e.g., one or several field maxima in the center and low mode divergence) while also taking into account constraints on geometry, materials, and fabrication. Traditionally, only cavities with spherical mirrors supporting Laguerre–Gaussian modes have been considered for these applications, but they provide only a limited design space that may not fulfill the requirements of specific applications. Allowing for non-spherical cavity mirrors provides a much wider range of design options and can generate cavity eigenmodes that have superior properties compared to standard Laguerre-Gaussian modes19,20. However, the large design space then makes inverse design problems very difficult to solve. In our previous work20 we exploited a gradient descent method for this task. Because of the frequent occurrence of local minima in the design optimization, we had to combine the gradient descent method with an evolutionary algorithm, which required a large number of forward-design calculations. Moreover, this optimization was performed for maximum cavity cooperativity in a single point in space and has to be repeated for any change in target parameters. Instead, in this paper we overcome the inverse design problem by using a convolutional neural network (CNN) approach.

For most optical device inverse designs, e.g., for beam splitters, the relevant quantity to be optimized is the electromagnetic field8,9. Optimizing an optical resonator is more complicated since a resonator supports many modes, each one of which could be a potential solution. Furthermore, it is generally not only the electric field of the mode that is of interest but also the mode decay rate must be taken into account; for example, a mode with high field intensity can have very high losses and thus be useless for real applications. In this paper we demonstrate an approach based on a coordinate-dependent cooperativity C, a measure that includes the ratio of the coherent coupling strength of the quantum emitter to the cavity photon (i.e., the single-photon field strength) over the incoherent cavity loss rate. Our CNN finds cavity geometries that optimize the cooperativity C and that can be achieved realistically by various modern fabrication methods such as a fiber-optic microcavities17,21,22,23, ion beam etched dielectric resonators24, and micro-assembled structures25.

This paper is organized as follows. First, in “Optical resonator coupling to a quantum emitter”, we describe our optical resonator model and introduce the parameters for optimization. In “Algorithm” we present a general overview of the optimization algorithm which consists of data generation, CNN training and verification. In “Convolutional neural network”, more details of the neural network topology and computational resources are discussed. The CNN predictions of optimized cavity mirror geometries and their verification is presented in “Results and discussion”. Finally we summarize our results and conclude in “Conclusions”.

Optical resonator coupling to a quantum emitter

We consider a Fabry-Perot optical cavity consisting of two mirrors whose geometry we wish to optimize for applications in quantum science and technology. A schematic of this is shown in Fig. 1.

Figure 1
Figure 1
Full size image

Schematic cavity representation. The shape of the mirrors should be optimized to generate a target cavity field mode \(\Psi\) while keeping the losses \(\kappa\) small.

For a given cavity geometry, the cavity modes can be calculated using standard methods, such as Gaussian beam resonator theory26, ray transfer matrix approaches27,28, or finite element methods. The electric field of a chosen mode is then normalized to a single photon field \(E({\textbf {r}})\), i.e., the total energy contained in the electromagnetic field inside the cavity is normalized to a single photon energy \(\hbar \omega\), where \(\omega\) is the angular frequency. The interaction energy between a dipole emitter at position \({\textbf {r}}\) and a cavity photon is given by \(\hbar g({\textbf {r}})=\mu E({\textbf {r}})\) where g is called the coupling constant and \(\mu\) is the electric dipole of the emitter. Exploiting the relationship between the dipole moment and the spontaneous decay rate of the emitter, \(\Gamma = \frac{\omega ^3 \mu ^2}{3\pi \varepsilon _{0}\hbar c^3}\), we can write the coupling constant as29

$$\begin{aligned} g({\textbf {r}})=\sqrt{\frac{3\lambda ^2c\Gamma }{4\pi V_{\Psi } }}\Psi ({\textbf {r}}),\ \Psi ({\textbf {r}}) = \frac{E({\textbf {r}})}{|E({\textbf {r}}_m)|} \end{aligned}$$
(1)

where \(\lambda\) is the wavelength corresponding to angular frequency \(\omega\), c is the vacuum speed of light, \(\Psi\) is the dimensionless cavity field normalized to its maximum at position \({\textbf {r}}_m\) and the mode volume is defined by

$$\begin{aligned} V_{\Psi } = \int _{V_{cavity}} |\Psi ({\textbf {r}})|^2 dV \end{aligned}$$
(2)

where the integral is over the geometric volume of the cavity.

The other important quantity of optical cavities for quantum applications is the cavity decay rate \(\kappa\), i.e., the rate at which a photon is lost from the cavity mode. We distinguish two contributions to the cavity loss rate: the loss per photon round trip by transmission through the mirrors or by absorption within the mirror \(D_{mir}\) (these are typically of the order of \(10^{-5}\)\(10^{-3}\)), and the loss per round trip through so-called clipping losses \(D_{clip}\) where the mode on the mirror is larger than the mirror diameter, i.e., a fraction of the photon field misses the mirror completely on reflection. The cavity decay rate is then

$$\begin{aligned} \kappa = (D_{clip}+D_{mir})\frac{c}{2L} \end{aligned}$$
(3)

where L is the length of the cavity. An alternative way to express the loss rate is via the cavity finesse F defined as

$$\begin{aligned} F = \frac{2\pi }{D_{clip} + D_{mir}} = \frac{c\pi }{L} \frac{1}{\kappa } \end{aligned}$$
(4)

To achieve strong particle-cavity coupling, the coherent coupling rate \(g({\textbf {r}})\) between the particle at position \({\textbf {r}}\) and the cavity must be larger than the strengths of any incoherent processes, i.e., energy exchange between the particle and the cavity must occur on time scales before the photon leaks out of the cavity or is incoherently scattered by the atom. Therefore, the cooperativity parameter defined as

$$\begin{aligned} C({\textbf {r}}) = \frac{g({\textbf {r}})^2}{\kappa \Gamma } = \frac{3\lambda ^2c}{4\pi \kappa V_{\psi }} |\Psi ({\textbf {r}})|^2 \end{aligned}$$
(5)

must be larger than one. The cooperativity therefore not only depends on the single-photon electric field strength at the position of the atom, but it also includes the round trip losses \(D_{clip}\) and \(D_{mir}\).

Our approach is to modify the shape of the cavity mirrors based on a spherical “reference” shape. It is therefore useful to compare the cooperitivity achieved with our designs to the maximum cooperativity obtained at the center of this reference cavity. For two identical spherical mirrors with radius of curvature R30 the fundamental cavity mode is given by a Gaussian beam and the maximum cooperativity becomes

$$\begin{aligned} C_0 = \frac{6\lambda F}{\sqrt{2RL-L^2}} = \frac{6\lambda }{\sqrt{2RL-L^2}} \frac{2\pi }{D_{mir}} \end{aligned}$$
(6)

where we assumed no clipping losses for this reference cavity mode.

For quantum optics and quantum technology applications, the cooperativity C is the quantity that we wish to optimize by a convolutional neural network approach in the following sections. Our CNN will thus be trained on a set of functions \(C({\textbf {r}})\) or equivalently, once a reference spherical mirror shape is chosen, on the relative enhancement \(C({\textbf {r}})/C_0\). As already discussed above, the cooperativity is a measure that depends on the ratio of the coherent coupling strength of the electric field to a particle and the resonator mode decay rate. The CNN is therefore trained to find resonator modes that have a given topology and also exhibit low round trip losses. This is in contrast to previous CNN-based optimization of optical devices which only take into account the electric field itself, e.g., in the case of integrated optical beamsplitters8,9.

Algorithm

We consider cavities with cylindrical rotational symmetry consisting of two identical mirrors with a spherical profile perturbed by a harmonic modulation given by

$$\begin{aligned} Z(r)=\frac{r^2}{2R} + A\cos (r/P). \end{aligned}$$
(7)

By limiting the ranges of the period P and the amplitude of the perturbation A, we can choose parameters which are achievable by modern fabrication tools, see “Fabrication considerations”. While choosing such a 2-parameter family of mirror shapes may look restrictive, we have shown in previous work19,20,31 that already very simple mirror deviation shapes from spherical can significantly enhance the cooperativity by generating eigenmodes that are superpositions of several Laguerre-Gaussian modes. We will show below that we can also achieve fairly complex mode shapes within the parameter family of Eq. (7), such as highly localised and double-peaked structures. We also note that our approach would work for any parameterization of the mirror surface. Equation (7) is valid within the paraxial approximation, i.e., we approximated the spherical profile by a parabolic one.

To generate our data training set we need a method to find the cavity eigenmodes for a given mirror profile Z(r). This mode solver will be treated as a black box function below. Any numerical or semi-analytical method can be used as mode solver; for the numerical calculations in this paper we employ a mode mixing method (MMM)31,32. The advantages of the MMM, compared to, e.g., finite elements or finite differences methods, are high computation speed, low RAM and CPU consumption and the absence of sharp corner singularities33,34. Depending on the complexity of the geometry one simulation on a single CPU core takes no more than 20 seconds, which allowed us to generate our CNN training data of 85000 samples on 240 CPU cores on an HPC cluster (2.0 GHz Intel Skylake processors) in about 2 hours of computation time. Choosing a computationally effective method for the mode solver is critical for our approach.

Once the mode solver has calculated the modes \(\Psi _i\) and their finesse \(F_i\) for a given Z(r) we proceed by selecting one mode based on the target topology, e.g., a mode with a single peak, two peaks, etc. The spatially dependent cooperativity \(C({\textbf {r}})\), Eq. (5), of this selected mode is then added to the training database. We emphasize that this selection process is very important to generate a well balanced training set; different training sets are required for different target mode topologies.

An overview of our algorithm is presented in Fig. 2. The first step is the selection of a perturbation pattern imposed on the spherical mirror within some range of parameters, Fig. 2a. In our case we choose harmonic perturbations with a flat distribution of periods P in the range 5–30 \(\upmu\)m and amplitudes A in the range 0.1–0.6 \(\upmu\)m. The second step is to use these geometries as arguments for the mode solver, calculate the modes, and select the most appropriate mode for the training data set as outlined above, Fig. 2b. The third step, Fig. 2c, is to train the CNN on the generated data set. This is described in more detail below in “Convolutional neural network”. The fourth step is testing the trained CNN on data which were not used in the training (more details below) and usage of the trained CNN as a predictor for inverse mirror design: a target cooperativity distribution is given to the CNN and it predicts the required mirror modulation parameters P and A, Fig. 2d. At the final, fifth step we put this predicted mirror geometry into the mode solver and verify the result of the mode field, Fig. 2e, as discussed in more detail in “Results and discussion”.

Figure 2
Figure 2
Full size image

Overview of the optimization algorithm including data generation (a,b), machine learning (c), inverse design prediction (d) and verification (e). (b) shows modes with various topologies which exist within the design space. (d) represents a sample target cooperativity distribution (i.e., a peak of high intensity and low loss) as input argument for the trained CNN. (e) compares the target mode from (d) with the mode calculated explicitly from the CNN-generated mirror geometry.

Convolutional neural network

Introduction to neural network approach

Deep learning methods have recently been demonstrated as a powerful tool for solving physical and in particular optical problems, for example, for deeply subwavelength optical imaging35,36,37, analysis of scatterometry data38,39, enhanced resolution of SEM images40, MRI image analysis41,42, inverse design of optical components8,9 and many other image processing applications, revolutionising their future development. Deep learning methods are machine learning methods employing multilayer (3 and more layers) neural networks where subsequent layers extract finer level features from the raw input data. Deep neural networks automatically find the correct mathematical transformations to convert the input data to outputs results without requiring prior knowledge of the linear or nonlinear correlations. Convolutional neural networks (CNN)43, long short-term memory (LSTM)44, variational autoencoders (VAE)45, and generative adversarial networks (GAN) are examples of deep learning algorithms used for physical tasks46. GAN architectures have recently been used for complex inverse design problems in micro- and nano-photonics47,48,49. Such architectures are generally selected in situations where the Ground Truth cannot be parametrized, so the Ground Truth is a 2D object (image-to-image tasks). In our case the mirror profile (Ground Truth) is fully determined by two numbers and a (comparatively straightforward) CNN implementation is sufficient and computationally more efficient.

Specific network topology

In our paper we present the application of a deep convolutional neural network for predicting the required parameters of the cavity (period and amplitude of the sinusoidal mirror profile modulation) from a target cooperativity profile \(C({\textbf {r}})\). The forward design mode solver outputs a set of modes for each mirror profile, of which a single mode is chosen (see “Technical details” below) to be included in the training set. The training set therefore comprises only one mode per input mirror shape. Each mode is represented as a field map in a longitudinal and radial cross-section of the cavity of 500 \(\upmu\)m length in z-direction and 400 \(\upmu\)m in diameter. Each field map consists of \(300\times 200\) points. Exploiting the fact that all modes are radially and center-symmetric, we feed the neural network with only a quarter of the field maps (\(150\times 100\)) in order to save computer memory.

The neural network we use in our studies consists of four convolutional layers with 3x3 kernels with max-pool layers inserted between the first three convolutional layers50. The topology of the neural network is shown in Fig. 2c. All convolutional layers are activated by rectified linear unit (ReLU) functions. The final convolutional layer is connected to three fully connected layers with 512, 32 and two neurons, respectively. The hidden fully connected layers have ReLU activation functions, and the output layer is activated by sigmoid functions51. These fully-connected layers are needed for linking the feature representations from the convolutional layers with the output labels. This is a typical structure of a convolutional neural network which allows for automatic feature extraction for solving the inverse problem of finding the design of a device from the generated field map. The network was trained with the Adam stochastic optimization method with a learning rate of 0.001. The mean square error (MSE) was used as the loss function.

The neural network takes the field map as an input, outputting the period and amplitude both normalized to their maximum values in the whole dataset (i.e., between 0 and 1). 80% of the whole dataset was used for training, 10% for validation and the last 10% for testing.

Technical details

We use a self-made mode solver based on the MMM31,32 to generate the training data. The data contains 85,000 numerical simulations, where each simulation produces a set of cavity eigenmodes, their spatial field distribution, their corresponding round trip loss, finesse, and cooperativity for a different spatial mirror profile. The exact number of eigenmodes in each set depends on the desired precision and in our numerical simulations was set to 30 modes. For a given target mode topology (e.g. one strong peak of cooperativity at the cavity center), the most appropriate of these 30 modes in each set is then selected and added to the training data. We thus arrive at a training set of 85,000 unique modes. To train the network for a different mode topology (e.g. two peaks), different modes have to be selected out of the 30 modes calculated for each mirror profile, thus resulting in a different training set, and the CNN needs to be re-trained. We use the python programming language with libraries numpy for computation and mpi4py for distribution of simulations over an HPC cluster.

The CNN training software was also written in the python language. The open source machine learning framework Tensorflow was used for the deep neural networks and training took place on an Nvidia GPU supplied with CUDA.

Results and discussion

Mode prediction and verification

For the examples discussed here we choose a reference spherical cavity of length \(L=500~\upmu\)m, mirror radius of curvature \(R=400~\upmu\)m, and mirror diameter \(200~\upmu\)m. Harmonic modulations of the mirror profiles are chosen with random period P and amplitude A as discussed in “Algorithm”.

The results of the neural network training are shown in Fig. 3. This plot compares true parameters (red line) with CNN predictions (blue dots). This curve is based on a 10% subset of the forward design data set of 85000 samples which were separated from the training set and have not been used in training or validation (made after every epoch by CNN). From the figure we see that the correlation coefficient between the true and retrieved values of both amplitude and period are over 99%, which demonstrates a high quality of the retrieval process.

Figure 3
Figure 3
Full size image

Correlation coefficient between the true parameters of the harmonic mirror modulations (red dots) and the values predicted by the trained network (blue dots) for (a) period P and (b) amplitude A. The correlation coefficients are 0.998826 and 0.996890 for period and amplitude, respectively, after training with 90% (10% of that was used for validation) and for a test set of 10% out of \(N = 85{,}000\) data sets.

Figure 4
Figure 4
Full size image

Learning curves for CNN training: mean square error of the training set (red dots) and of the validation set (blue dots) during the learning procedure within 200 epochs.

Figure 4 presents the training convergence curves (learning curves) where training MSE and validation MSE versus training epoch show smooth convergence50,52. We can see that at the earlier epochs (first 30) both training MSE and validation MSE are rapidly decreasing, while for the later epochs the speed of training is reduced. A peculiar behaviour of the network is observed at epochs around 110 where both training and validation errors increase. However, at later epochs they decrease faster again, showing better training. At the end of the training process we observe MSE at a level of \(10^{-4}\), and validation MSE of \(\sim 3\times 10^{-4}\). Training of the neural network was terminated by an ‘EarlyStopping’ callback with patience of 40, meaning that if the validation loss does not decrease within 40 epochs, the training is stopped, and the model giving the best validation loss is used for final predictions. This mechanism saves the model from overfitting. The strong convergence also shows that the extraction of mirror modulation parameters from mode images is a well posed problem and does not suffer from non-uniqueness issues53.

Next we use the trained CNN to predict the mirror modulation parameters for target mode profiles and compare the mode fields generated by the predicted mirror profiles with the targets. Two examples, taken from our test data set, are shown in Fig. 5. Target 1 is a typical example where the predicted cooperativity enhancement at the center of the cavity deviates by \(\sim 1\%\) from the target value. Out of our test data set this deviation is at the median deviation, i.e., 50% of the predicted cases in our test data set are a better fit of the central cooperativity enhancement to the target and 50% are worse. For this example, the deviations of the predicted mirror modulation periodicity P and amplitude A from the true target values are 0.3% and 1.3%, respectively. It can be seen that the cooperativity enhancement in the cavity radial direction at \(z=0\), Fig. 5a and on axis, Fig. 5b, are very accurately reproduced. Target 2 in the figure is chosen from the 10% least accurately fitted cases by the CNN: the deviation of the cooperativity at the cavity center is 17.6% in this case, with deviations in P and A of 1.3% and 0.7%, respectively. We see that in this case the profile along r and z still has the correct shape overall, but the predicted mode exhibits a slightly larger cooperativity enhancement throughout.

Figure 5
Figure 5
Full size image

Two examples from the test data set of the predicted cooperativity enhancement in (a) radial and (b) longitudinal direction. The CCN prediction of the mirror modulation produces cooperativity enhancement within 1% of the central value for target mode 1. Target 2 and the corresponding prediction are from the 10% least accurate fits in the data set (17% deviation of \(C/C_0\)).

Inverse design method

The results of the previous section confirm the validity of the CNN predictions for estimating mirror parameters based on a given actual mode field solution. However, to use the CNN as a design tool one would like to get at least approximate mirror parameters for idealized target fields that are drawn without actually solving the full electromagnetic cavity eigenmode problem, as it was required for the target fields above.

Such an example is shown in Fig. 6. Here the target mode is chosen to provide a desired cooperativity enhancement at the cavity center, but the mode shape is simply set as a Gaussian shape that decays to zero both in the radial and the longitudinal direction. Such a mode is clearly unphysical as the light must always be bouncing between the cavity mirrors and thus cannot decay to zero in the longitudinal direction, and therefore no mirror shape will be able to produce this mode exactly. Nevertheless, as evidenced in Fig. 6, the CNN finds mirror parameters that produce a mode approximating the general shape of the target mode. Note that the CNN predicts values of period P and amplitude A of the harmonic perturbation of the spherical mirror profile. These are then used in the MMM to calculate the cavity eigenmodes, of which the best fitting mode is then selected. The mode number n and its finesse F are indicated in the figure legends. Figure 6a compares the Gaussian target mode (red dashed curve) and the predicted mode (black solid) in the radial cross section at \(z=0\). The blue curve corresponds to the fundamental Gaussian mode of the spherical cavity of the same size, confirming that we achieved an enhancement of cooperativity by a factor of three. The predicted mode profile is a close approximation to the target Gaussian at the center, but it exhibits additional intensity lobes at around \(r=5\,\upmu\)m. Figure 6b shows the predicted mode profile in cylindrical coordinates, demonstrating the predicted mode’s similarity to a Gaussian at the cavity center. For a quantum technology application where strong coupling of light to a single trapped particle at the cavity center is required, this predicted mode would be a perfectly acceptable solution and it was found by the CNN without the need for the designer to calculate cavity eigenmodes using a numerical method such as the MMM.

Figure 6
Figure 6
Full size image

Demonstration of CNN inverse design. (a) The radial cross section of the target mode (red dashed curve), the numerically verified predicted mode (black solid), and the fundamental Gaussian mode of the spherical cavity of the same size (blue curve). n is the mode number. (b) The predicted mode in cylindrical coordinates.

Figure 7
Figure 7
Full size image

Demonstration of CNN inverse design for a cavity mode with two maxima on the z axis. (a) The axial cross section of the target mode (red dashed curve) and the numerically verified predicted mode (black solid). (b) The predicted mode in cylindrical coordinates confirming the two-peak structure.

In a second example, Fig. 7, we target a mode comprising two maxima. We define the target as the sum of two Gaussian profiles shifted apart along the z-axis. Thus, as in the previous example of Fig. 6, the target is not a realistic cavity mode but a simple “mock up” exhibiting the desired property of a two-peak structure and it is left to the CNN to find a mirror shape that produces an eigenmode which (approximately) matches this target. The cross section of the target and the predicted modes along the z-axis are shown in Fig. 7a. The shape of the predicted mode differs from the target mode, which respects the fact that not every mode topology can be supported by our family of mirror shapes, i.e., a double-peak Gaussian mode is not necessarily an eigenmode of a spherical mirror with any single harmonic modulation. However, in this case the CNN finds the closest mode to the target mode and Fig. 7b shows that the main feature of the target mode of two peaks on the z-axis is well reproduced. As in the previous example, the cavity designed by the CNN would work perfectly fine for a quantum technology application where two particles trapped at the peaks of the target mode are strongly coupled to each other via the cavity mode to exchange quantum information.

The capability of the CNN to predict modes with a desired topology depends on the training set composition, especially on the balance between desired modes and other modes contained in the set. As already outlined in “Technical details”, this requires that the training sets for the one-peak mode (Fig. 6) and the two-peak mode (Fig. 7) are very different. The definition and computational implementation of the rule to select the single mode per mirror profile that is included in the training set is therefore an essential part of our method.

Fabrication considerations

The mirror geometries investigated here require the fabrication of a harmonic modulation with scales of tens of micrometers in the radial direction and hundreds of nanometers in the axial direction on a spherical mirror profile. These scales are defined by the ranges of parameters which were used for the generation of the training data. Since a CNN is an interpolator but not an extrapolator, any predictions of mirror geometries beyond the training range of parameters will be inaccurate. Mirror profiles with our specifications can be created by a number of fabrication techniques, such as mirror shaping by laser machining in silica glass54,55,56 or by focused ion beam milling24. Pulsed CO\(_2\) lasers can be used for thermal evaporation of surface material30 generating surfaces with extremely low roughness. Also modern micro-machining tools can provide sufficient precision25,57,58,59.

Conclusions

We have demonstrated an approach based on convolutional neural networks for the design of high-finesse optical resonators which support a desired electrical mode field and, crucially, simultaneously limit the mode decay rate. This allows us to design target fields with, for example, one or two field maxima on the cavity longitudinal axis where significant enhancement of the cooperativity between quantum emitters coupled to cavity photons is achieved. Such cavity designs are crucial for various quantum optics and quantum technology applications. The proposed “mode on-demand technique” can be extended to many types of mode topologies by implementing appropriate mode selection rules for the training set generation.

Numerically the most demanding part of our approach is the generation of the training data set. We used an efficient mode mixing method that works in the paraxial limit of cavity optics. However, other methods can be chosen for improved accuracy or implementation of the algorithm for other inverse optical design problems. This flexibility of our CNN formalism will make it useful for many practical applications in the future.