1 Introduction

The generation of continuous wave (CW) laser light in the UV region is often realized by nonlinear effects such as second harmonic generation (SHG) [1, 2] or four-wave mixing [3]. At wavelengths around 257 nm used for example in ion beam cooling [4], UV laser light can be generated through frequency doubling in \(\beta \)-Barium Borate (BBO). To achieve stable, high output powers of several hundreds of milliwatts, a sufficient amount of fundamental light has to be provided. Employing resonant enhancement of the fundamental by placing the nonlinear crystal directly in the laser cavity [5] or by external enhancement cavities [1, 2, 4, 6, 7] provides a possible solution. A significant disadvantage of BBO is the appearance of degradation at varying output powers depending on crystal quality. This effect has been widely observed [4, 8,9,10,11]. In our group, we measured the output power of frequency doubling in BBO with the spherical cavity as used in Ref. [4], albeit with another crystal. As shown in Fig. 1, after only a few minutes a significant drop in power occurs limiting the stable operation of UV generation. To achieve a more stable operation the input power could be reduced [4, 9], though this method clearly reduces the usable SHG output power.

Fig. 1
figure 1

UV output power over time generated with the spherical enhancement cavity of [4] exhibiting irreversible degradation. Note that in contrast to [4], another sample of BBO was used in this measurement

To the best of our knowledge, the degradation effect is not understood in detail [9]. For example, in Ref. [10], UV-induced coating damage was identified as the cause of the power degradation in this particular experiment. But even in non-coated Brewster-cut BBO-crystals degradation effects limit the performance [12]. Additionally, various possible solutions are suggested, e.g., heating the crystal to an elevated temperature [13] and/or purging it with oxygen [13, 14].

Due to its irreversible character, degradation effects most likely are caused by permanent irradiance-induced crystal damage. Thus, our goal was to significantly lower the peak intensity through elliptical focusing, as suggested by Taira et al. [5] and Steinbach et al. [15]. To avoid sacrificing output power, as a first step, we numerically investigated the correlation between second harmonic (SH) output power and fundamental peak intensity in resonant enhancement cavities with different elliptical Gaussian beams.

We were guided by the following principles in our cavity design. To achieve high SH output power, an external enhancement cavity in a ring configuration is to be used to produce the full SH output in one direction. Also, cylindrical lenses inside the cavity should be avoided to prevent additional sources of linear losses. These requirements combined with the desired elliptical focus inside the crystal cannot be fulfilled by the standard bow-tie cavity frequently discussed throughout the literature [14, 16, 17]. Instead, we minimize the amount of optics and their associated losses by utilizing cylindrical mirrors, thus improving resonant enhancement. However, the design process of such a cavity is significantly more complex due to the large number of degrees of freedom and possible combinations of different mirror types. To attain the best agreement with our requirements as well as a stable cavity, we utilize evolutionary algorithms to find suitable resonator geometries. It should be noted that we did not consider machine learning techniques since they require large sets of training data. In the context of our work, it is more straight forward to have evolutionary algorithms do the optimisation.

The main purpose of this paper is the demonstration of the applicability of evolutionary algorithms to designing resonators even in more complex configurations, i.e., with specific requirements on the ellipticity of the beam. For an extensive discussion of the degradation process described in Fig. 1, we refer to Ref. [18]. There, we experimentally show that the irreversible damage in our crystal is induced in the bulk by the green and UV radiation. Specifically, the UV light leads to the generation of color centers by two-photon absorption [19] which in turn lead to increased absorption of the fundamental. To alleviate the degradation problem, our findings reveal that it is sufficient to concentrate primarily on lowering the fundamental peak irradiance in the green spectral range and set the crystal to elevated temperatures [18].

2 Selection of a Gaussian mode

The first step in the design process is to identify a suitable elliptical Gaussian profile. To reduce the fundamental peak intensity of a Gaussian mode without sacrificing SH output power, the dependence between both quantities was investigated. In the case of elliptical focusing, the SH output power in single pass has been analyzed [15, 20] and can be written as:

$$\begin{aligned} P_2=K P_1^2 l k_1 \cdot {\tilde{h}}(B,\xi _x,\xi _y) \end{aligned}$$
(1)

with the constant [20]

$$\begin{aligned} K=\frac{2 \omega _1^2 d_{\text {eff}}^2}{\pi \epsilon _0 c^3 n_1^2 n_2}\text { .} \end{aligned}$$
(2)

Here, \(l\) is the length of a crystal, \(c\) the vacuum speed of light, \(\epsilon _0\) the permittivity of free space, \(d_{\text {eff}}\) the effective nonlinear coefficient of the crystal, \(\omega _1\) the fundamental circular frequency, \(n_1\) and \(n_2\) the indices of refraction for the fundamental and the SH, and \(k_1\) the fundamental wave number. The function \({\tilde{h}}\) depends on the walk-off parameter \(B=\rho \sqrt{l k_1}/2\) with the walk-off angle \(\rho \) and the focal parameters \(\xi _x\) and \(\xi _y\) as defined in Ref. [21]. Those can be written as:

$$\begin{aligned} \xi _i=\frac{l \lambda _1}{2 \pi n w_{0,i}^2}, \end{aligned}$$
(3)

where \(w_{0,i}\) is the focal beam waist in the directions x and y, respectively. \({\tilde{h}}\) is given in terms of a double integral neglecting absorption in the crystal: [15]

$$\begin{aligned} \begin{aligned}&{\tilde{h}}(B,\xi _x,\xi _y)=\frac{\sqrt{\xi _x\xi _y}}{l^2} \times \\&\int _0^l \int _0^l \frac{\exp \left( i \varDelta k (z^{\prime }-z)\right) \exp \left( \nicefrac {-4B^2(z^{\prime }-z)^2\xi _x}{l^2}\right) }{\sqrt{1+i\tau _{x}^{\prime }}\sqrt{1+i\tau _{y}^{\prime }}\sqrt{1-i\tau _{x}^{{\prime }}}\sqrt{1-i\tau _y^{{\prime }}}} {\text {d}}z {\text {d}}z^\prime \end{aligned} \end{aligned}$$
(4)

with \(\tau _i^{(\prime )}=\nicefrac {\xi _i(2z^{(\prime )}-l)}{l}\). Following the notation of Boyd and Kleinman (c.f. Fig. 1 of Ref. [21]), the propagation axis is labeled with z and the optical axis of the crystal lies in the xz-plane. This is also the plane in which the generated SH will suffer from spatial walk-off in the case of critical phase matching.

Fig. 2
figure 2

Normalized SH power \(P_2\) over the beam waists \(w_x\) (walk-off direction) and \(w_y\) perpendicular to it. The configuration for optimal spherical focusing in terms of SH power is marked by a red open square, the corresponding elliptical profiles with the same power are shown with a contour line. Please note the different scales of the x- and y-axes. The point of optimal elliptical focusing with respect to the generation of SH power is marked by a blue solid square; our configuration being a compromise between generated SH power and low peak intensity is marked by a blue diamond. The dashed horizontal line for \(w_y\) = 12 \(\upmu {\text {m}}\) corresponds to the cross-sections shown in Fig. 4 for the single pass and resonant case

In most applications, the fundamental parameters \(P_1\) and \(\lambda _1\) are already fixed. For a given crystal with parameters \(l\), \(B\) and \(d_{\text {eff}}\), the harmonic power \(P_2\) clearly only depends on the focusing parameters \(\xi _x\) and \(\xi _y\), i.e., the focal beam waists in the middle of the crystal \(w_x\) and \(w_y\), respectively. Therefore, shaping of the Gaussian beam allows control of the achievable SH power. This output power can be calculated using Eq. 1 and computing Eq. 4 for pairs of focal beam waists \(w_x\) and \(w_y\). For each pair a numerical optimisation of Eq. 4 as a function of \(\varDelta k\) has to be performed. In Fig. 2, the normalized single-pass SH output power, which, due to normalization, is equivalent to the normalized single-pass conversion efficiency, is plotted over a wide range of focal beam waists employing the parameters of our particular application. This involves frequency doubling of 514 nm in an anti-reflective coated \(\beta \)-BBO crystal of length \(l={10}\hbox { mm}\) and with walk-off angle \(\rho ={50.2}^{\circ }\). We opted against a Brewster-cut crystal due to the significant addition of Fresnel losses of the UV at the output surfaces [2, 14, 15].

The maximum achievable single-pass SH power of a spherical beam profile \(P_{\text {max,sph}}\) used for normalization is marked with a red open square in Fig. 2 and is generated using focal beam waists of \(w_x=w_y={18.6}{\,\upmu \hbox {m}}\). Other configurations with an elliptical focus reaching the same output power are shown by a contour line in Fig. 2. As already mentioned in Refs. [15] and [20], elliptical focusing with beam waist combinations inside the area encircled by the contour line allow for higher SH output powers. Additionally, elliptical focusing can reduce the fundamental peak intensity through a larger spatial beam profile. For example, a maximization of the product \(w_x w_y\) can be run along the contour line shown in Fig. 2 to find a pair of waists enabling minimal peak intensity at the maximum output power \(P_{\text {max,sph}}\) achievable by spherical focusing. This optimisation can be carried out over a wide range of output powers to find the minimum intensity for a particular SH harmonic power. The results of such an optimisation are depicted in Fig. 3.

Fig. 3
figure 3

Minimal peak intensity plotted against normalized SH output power in single pass. Both axes are normalized with respect to maximum spherical focusing power marked with the red open square. Maximum elliptical focusing power and our experimentally chosen parameters are marked by a blue filled square and diamond, respectively. We have chosen our configuration close to the expected SH output of that for spherical focusing, but significantly reduced peak intensity to avoid degradation effects in BBO

By employing elliptical focusing, the peak intensity can be dropped to \(0.06 \times I_{\text {max,sph}}\) at the same output SH power as for maximum spherical focusing. In addition, the dependency between intensity and SH power rises more steeply for higher SH powers. This means a small gain in the desired output power occurs with a non-negligible increase in fundamental peak intensity. A compromise between both quantities has to be found. For our setup, we chose focal beam waists of \(w_x={255}\,\upmu \hbox {m}\) in walk-off-direction and \(w_y={16.3}\,\upmu \hbox {m}\) resulting in a SH power of \(P=1.08 \times P_{\text {max,sph}}\) and a fundamental peak intensity of \(I=0.09 \times I_{\text {max,sph}}\). This configuration is marked by blue diamonds in Figs. 2 and 3, respectively.

In most cw applications, SHG is performed utilizing resonant enhancement cavities. In this case, further considerations are necessary. Kozlovsky theoretically described the SH output of frequency doubling in an external enhancement cavity for resonant fundamental radiation taking into account the depletion of the fundamental caused by the SHG [22, 23]. Utilizing the results of single-pass efficiencies \(\eta \) depicted in Fig. 2 together with estimated linear losses \(L\) and the available fundamental power \(P_{\text {in}}\), the optimum, i.e., impedance-matched, input coupler transmission can be derived [24]. Clearly, the optimum input coupler transmission changes with variation of the single-pass efficiency and, therefore, with variations of the beam waists.

Employing the methods described above, the resonant conversion efficiency \(\epsilon =\nicefrac {P_2}{P_{\text {in}}}\) for an individually impedance-matched cavity can be calculated for each pair of beam waists \(w_x\) and \(w_y\). Compared to the single pass (cf. Fig. 2), the qualitative dependencies remain identical, especially the much lower sensitivity to changes of the beam waist \(w_x\) in walk-off direction in comparison to the non-walk-off direction. However, there are quantitative changes illustrated in Fig. 4. In black, we show a cut through the single-pass efficiency at \(w_y={12}\,\upmu \hbox {m}\) (cf. Fig. 2). In addition, the resonant conversion efficiency for different input power is shown as a function of the beam waist \(w_x\) in walk-off direction. Taking into account residual surface reflectivities of 0.25% of our AR-coated crystal as well as mirror losses lower than 0.1% per mirror, the combined linear losses L are estimated to be \(L=0.01\). Each curve of Fig. 4 is normalized individually to the corresponding conversion efficiency of optimum spherical focusing (\(w_x=w_y={18.6}\,\upmu \hbox {m}\)). Therefore, all curves intersect twice at a normalized SH power of 1. For higher input powers the relative benefit in conversion efficiency by carefully selecting a beam waist \(w_x\) becomes less significant. In this case, larger spot sizes can be chosen to lower peak intensity without sacrificing too much conversion efficiency. Nevertheless, the reduction in intensity by elliptical focusing in comparison to spherical focusing remains valid. Note that in addition to higher input powers the same effect is the case for lower linear losses \(L\), i.e., higher reflectivities on the resonator mirrors, since both contribute to a larger fundamental enhancement.

Fig. 4
figure 4

Normalized SH power over the beam waist \(w_x\) (walk-off direction) at \(w_y={12}\,\upmu \hbox {m}\) for single pass (black) and resonant cases for different cavity input powers. The lines are cross-sections of Fig. 2 (dashed line) for different cavity input powers. The individual curves are normalized to the corresponding values for spherical focusing. Therefore, all curves intersect at two points

3 Objective function of an algorithm for designing resonators with a specific elliptical Gaussian mode

Based on the selected configuration of focal beam waists, the second task is to find a resonator with an eigenmode with the desired focal geometry within the crystal. For this purpose, we employ evolutionary algorithms through the java-framework EvA2 [25] by implementing a new java-class. Independent of the specific algorithm, a proper objective function has to be derived to evaluate and classify possible solutions. The construction of this objective function will be discussed in the following.

First, a basic resonator type is chosen, i.e., bow-tie, rectangular or triangular. Since it proves to be rather difficult to design an algorithm that can inherently handle different types, we opted for a fixed selection. Nevertheless, the approach can easily be adopted such that another type can be evaluated and compared. For simplification, we will limit our discussion here to a symmetrical bow-tie resonator as this gave us the best agreement to our specific requirements compared to implementations with other resonator types.

Fig. 5
figure 5

Schematic representation of the geometry of a symmetrical bow-tie resonator

Figure 5 shows the basic scheme of such a resonator type. The geometry is fully described by the lengths \(l_1\) and \(l_4\) next to the crystal, the length of the opposite side \(l_3\) and the height \(h\). \(l_2\) and the folding angle \(\theta \) can easily be calculated from these values. Regarding the beam profile in the center of the crystal, bow-tie resonators employing only rotational symmetric optical elements are in principle able to generate an elliptical focus to some extent [9]. However, since our intended beam profile has a rather large ellipticity of \(\epsilon =15.7\), in addition to spherical mirrors we explicitly permit cylindrical mirrors to be evaluated with the algorithm. Therefore, each mirror will be described by two parameters, one of them being the radius of curvature \(R_i\). The other is an integer parameter \(I_i\) limited to only three values \(0\), \(1\), and \(2\), representing a cylindrical mirror with curvature in the plane of incidence, perpendicular to it or a spherical mirror, respectively. Thus, \(\{l_1,l_3,l_4,h, R_1, R_2, R_3, R_4, I_1, I_2, I_3, I_4\}\) is the set of parameters, which can be varied by the algorithm to solve our optimisation problem. From this set, the algorithm calculates two matrices \(M_\text {Res,}x\) and \(M_\text {Res,}y\) of the form:

$$\begin{aligned} M_{\text {Res,}\{x,y\}}=\begin{pmatrix} A \quad &{} B\\ C \quad &{} D \end{pmatrix} \end{aligned}$$
(5)

representing both planes of the resonator using Gaussian matrix formalism as described in Ref. [26]. The two matrices have the basic form:

$$\begin{aligned} \begin{aligned} M_{{\text {Res,}}\{{x,y}\}} = \; &M_{{\text {C}}/2} \cdot M_P(l_4)\cdot M_{M,\{x,y\}}(R_4,I_4)\cdot M_P(l_2)\\ \cdot&\, M_{M,\{x,y\}}(R_3,I_3)\cdot M_P(l_3)\cdot M_{M,\{x,y\}}(R_2,I_2) \\ \cdot&\, M_P(l_2)\cdot M_{M,\{x,y\}}(R_1,I_1) \cdot M_P(l_1)\cdot M_{C/2}, \end{aligned} \end{aligned}$$
(6)

where \(M_{\text {P}}(l_i)\) describes a free propagation of the length \(l_i\) through air. \(M_{{\text {C}}/2}\) describes propagation through half of the crystal, since we chose our reference plane to be in the middle of it to simplify beam waist calculations at this point. Note that we do not have to account for refraction at the crystal surfaces when working with reduced q-Parameters and corresponding matrices [26]. The mirrors are represented by matrices \(M_{\text {M}}(R_i,I_i)\).

It should be noted that the mirror matrices have different representations depending on which plane is to be considered. For a mirror with the curvature \(R\) in the sagittal plane of the resonator, perpendicular to the plane of incidence, the matrix is written as:

$$\begin{aligned} M_{{\text {M}},x}(R_i)=\begin{pmatrix} 1 &{} 0\\ -2\cos {\beta }/R_i &{} 1 \end{pmatrix} \text { .} \end{aligned}$$
(7)

The angle of incidence \(\beta \) is half the folding angle \(\theta \) of the bow-tie resonator. It is important to note that the orientation of the crystal, where the xz-plane aligns with the sagittal plane of our resonator, gave us the best overall results for our specific application after various runs of the algorithm. Therefore, to be consistent, we likewise labeled the sagittal plane of the resonator with xz, as can be seen in Fig. 5. For a mirror with curvature in the plane of incidence, i.e., the tangential yz-plane, the mirror matrix yields:

$$\begin{aligned} M_{{\text {M}},y}(R_i)=\begin{pmatrix} 1 &{} 0\\ -2/(R_i\cos {\beta }) &{} 1 \end{pmatrix} \text { .} \end{aligned}$$
(8)

If a mirror has no curvature in a specific plane, it is described by an identity matrix for this plane. For each plane, either the corresponding matrix or a unit matrix is used by the algorithm, depending on the value of \(I_i\), which triggers a simple if-case.

Optimisation algorithms need a figure of merit to decide upon the quality of a specific solution. This figure of merit is usually referred to as the value of the objective function. From \(M_{{\text {Res,}}x}\) and \(M_{{\text {Res,}}y}\), the algorithm’s objective function we chose reads as:

$$\begin{aligned} \begin{aligned} O_{\text {Res}}=\biggl [&\left( \frac{w_x-{255}\;{\upmu \hbox {m}}}{{255}\;{\upmu \hbox {m}}}\right) ^2+2\left( \frac{w_y-{16.3}\;{\upmu \hbox {m}}}{{16.3}\;{\upmu \hbox {m}}}\right) ^2 \\&+\frac{1}{20}(f_y/{}{\hbox {mm}})^2+\frac{1}{100}m_x^2+\frac{1}{100}m_y^2\biggr ]^{\frac{1}{2}}, \end{aligned} \end{aligned}$$
(9)

where \(w_x\) and \(w_y\) are the beam waists in the middle of the crystal, calculated by

$$\begin{aligned} w_i^2=\frac{|B_i|\lambda }{\pi } \sqrt{ \left| \frac{1}{1-m_i^2} \right| } \end{aligned}$$
(10)

with \(B_i\) the corresponding matrix element as defined in Eq. 5. The first two terms in Eq. 9 are a measure for the deviation from the desired focal dimensions, \(f_y\) is a measure for the deviation of the focus from the middle of the crystal and the \(m_i\) are the ABCD-matrix parameters for stability of the resonators in the two corresponding directions. The factors in front of these quantities denote the weighting factor of the different contributions and were chosen empirically as to find the best solutions. They might vary with the particular design configuration. Since we describe each mirror with two parameters, in principle each of the mirrors can be chosen spherical or elliptical by the algorithm. Also, the distances between the mirrors were freely determined except for bounds between 3 and 50 cm due to experimental restrictions. The only other restrictions are given by the intended focal sizes, the position of the focal points inside the crystal as well as the stability condition. Thus, the algorithm will find all-spherical solutions provided they are better than their counterpart with cylindrical optics. Furthermore, additional criteria for the merit function have been tested. However, it was found that other terms are not necessary, since these parameters are either not critical for our application or they only require more computational time and do not improve the quality of the solution.

In the following, we briefly discuss the significance of the parameters in Eq. 9 for the optimisation in more detail. All parameter sets are evaluated by the algorithm, in particular the sets of parameters leading to unstable resonators, i.e., \(m_i^2 \ge 1\). Therefore, in contrast to the expression given in Ref. [26], Eq. 10 utilizes the modulus in the radiant. This avoids negative terms under the radical sign and resulting imaginary parts in the objective function for unstable configurations as these cannot be handled by the evolutionary algorithm. For \(m_i^2<1\), Eq. 10 yields the correct beam waists. The deviation of \(w_y\) from the desired beam waist is weighted by a factor of two in comparison to the beam waist \(w_x\) in walk-off direction. This is due to a higher sensitivity of SH output power to the beam waist in the y-direction, as seen in Fig. 2.

By definition, the \(w_i\) are not the focal beam waists, but rather the waist sizes in the middle of the crystal. Therefore, the locations of the focal points \(f_i\) need to be taken into account. Ideally, they should be located in the middle of the crystal for the corresponding plane. They can be calculated by

$$\begin{aligned} f_i=\frac{R_i\left( \pi w_i^2\right) ^2}{\left( \pi w_i^2\right) ^2-\left( \lambda /n\right) ^2 R_i^2}, \end{aligned}$$
(11)

where \(w_i\) is the waist in the middle of the crystal as calculated in Eq. 10 and

$$\begin{aligned} R_i=n\cdot \frac{2B_i}{D_i-A_i}, \end{aligned}$$
(12)

is the radius of curvature in the plane i. Eq. 11 yields only exact values if the focal point is inside the crystal, as refraction is neglected for simplification. However, for the purpose of the objective function the exact values are not explicitly needed.

Moreover, the large beam waist of \(w_x={255}\,\upmu \hbox {m}\) in the sagittal plane of the cavity also leads to a large Rayleigh-range \(z_R={66.6}{\hbox { cm}}\), calculated with the index of refraction of BBO. Therefore, the results of the SH generation are very insensitive to the focal position within this plane. In fact, we found that it can be neglected in the evaluation of the objective function, at least for our application. Finally, we evaluate the value of the determinants \(m_i=(A_i+D_i)/2\) of the two resonator matrices, as they not only reveal if a resonator is stable, but also are a good indicator towards the robustness of the resonator. For \(m_i^2\approx 1\), small changes in the resonator parameters can lead to instability, as opposed to \(m_i^2 \ll 1\), where a significantly greater robustness is achieved against small parameter variations, most importantly manufacturing tolerances and misalignment. The weights of the focal position and of the determinants in the merit function Eq. 9 have to be carefully chosen such that they scale the discrepancies to the same magnitude as the deviation in beam waists. They are found empirically by various test runs and should be optimized for a specific application. Finally, a perfect solution is represented by \(O_{\text {Res}}=0\). Thus, the smaller \(O_{\text {Res}}\) the better the quality of a set of parameters.

4 Choice of evolutionary algorithms and results

Due to the twelve degrees of freedom and the required computational power for conventional optimisation algorithms, we chose to employ evolutionary algorithms. In brief, evolutionary algorithms start out with sets of randomly generated parameters. This so called first generation is then evaluated in terms of the objective function. In an iteration, the best sets are kept and new sets of parameters are generated by techniques copied from evolution, i.e. reproducing the parameters from any two parent sets from the best, replacing parameters in a random way etc. This is repeated for several generations until a stable solution is reached, i.e. the best sets do not significantly change anymore.

More specifically, we worked with the Evolutionary Algorithm Framework EvA2 uniting several different algorithms in one framework. After implementing the objective function Eq. 9, we tested various of these algorithms. In comparison, some of them stood out in terms of a minimized runtime, one of them being Particle Swarm Optimisation which we ended up using. Its name refers to the specific way the algorithm arrives at the next generation of parameters in the evolutionary fitting process.

However, we found that neither Particle Swarm Optimisation nor any of the other algorithms could be tailored to find a reproducible solution representing a global minimum. Rather, we found a plenitude of local minima. These minima seem to be very stable in the solution space as in almost every case a single optimisation run converged to one of the local minima. Since this happened relatively fast in terms of generations needed, it could be countered by lowering the number of overall generations and instead increasing the number of independent optimisation runs. This technique is referred to as Multirun in EvA2. Since every run starts with a different set of a random initial population in the first generation, they usually converge to different minima.

In the work discussed here, Particle Swarm Optimisation with a population size of 50 individuals was used. Each run was terminated after 1,500,000 evaluations. This corresponds to 30,000 generations and appeared to be more than sufficient to reach a local minimum. After various runs roughly 22% of the obtained solutions with a value of the objective function lower than \(10^{-15}\) were found emphasizing the importance of the Multirun-feature. The solution with the most suitable footprint was chosen for experimental implementation. This resonator design features beam waists of \(w_x={255}\,\upmu \hbox {m}\) and \(w_y={16.2}\,\upmu \hbox {m}\) in the middle of the crystal, a focus position deviating only by \(f_y={4.9}\,\upmu \hbox {m}\) from the crystal center and stability parameters of \(m_x=6 \times 10^{-5}\) and \(m_y=1.8 \times 10^{-3}\) showing a near perfect agreement with our requirements.

This result demonstrates the capability of determining resonator geometries using evolutionary algorithms combined with a appropriate objective function. Nevertheless, to experimentally realize this resonator, three cylindrical mirrors have to be found with radii of curvature \(R_1={65.4}\hbox { mm}\), \(R_3={107.0}\hbox { mm}\) and \(R_4={59.0}\hbox { mm}\) as well as a spherical mirror with \(R_2={674.5}\hbox { mm}\). For experimental applications, this is a disadvantage, as these are not standard curvatures and are significantly more expensive and complicated to acquire. Therefore, the algorithm was slightly modified by setting the mirror curvatures \(R_i\) to fixed values available as off-the-shelf substrates by common manufactures as close as possible to the values obtained. Also, the knowledge gained by the previous run with all degrees of freedom was used to determine whether a mirror will be cylindrical or spherical, resulting in fixed values of \(I_i\). Therefore, mirror M2 is chosen spherical with \(R_2={750}\hbox { mm}\), while mirrors M1, M3 and M4 are chosen cylindrical with the same radius of curvature \(R_{\{1,3,4\}}={100}\hbox { mm}\). Interestingly, the cylindrical mirrors are all curved in the tangential plane of the cavity. Correspondingly, the cylindrical mirrors act as flat mirrors in the perpendicular plane. This leaves only one curved mirror to form a stable eigenmode in the sagittal plane which is unintuitive but demonstrates the superiority of algorithmic design over a trial-and-error approach.

Fig. 6
figure 6

Schematic representation of the resonator found with the described algorithm

By setting the boundary conditions mentioned above, the set of parameters of the optimisation algorithm is reduced to \(\{l_1,l_3,l_4,h\}\). With this, \({90}{\%}\) of individual optimisation runs converge to the solution with the lowest found value of the objective function indicating a global optimum of the optimisation problem based on this reduced set of parameters. The corresponding resonator design is depicted in Fig. 6. The beam waist perpendicular to the walk-off direction (the tangential plane of the resonator) is \(w_y={16.3}\,\upmu \hbox {m}\) and has its focus at \(f_y={9.8}\,\upmu \hbox {m}\) with regard to the crystal center. The beam waist in walk-off direction (sagittal) is \(w_x={271}\,\upmu \hbox {m}\) and the resonator stability parameters are \(m_x=5.9 \times 10^{-2}\) and \(m_y=7.4 \times 10^{-3}\), respectively. Overall, these results are in excellent agreement with our requirements, only \(w_x\) deviates by \({6.4}{\%}\) from the target beam waist. This is not a real drawback, since as previously noted, SH power is very insensitive to variations of this beam waist. In fact, the overall SH power is calculated to be \(P=1.06 \times P_{\text {max,sph}}\), while the fundamental peak intensity is reduced by more than one magnitude to \(I=0.08 \times I_{\text {max,sph}}\). This solution was also checked for robustness against manufacturing and positioning tolerances using standard resonator design software based on the ABCD matrix formalism.

5 Experimental results

Based on this solution, we set up and experimentally tested such a cavity with a cylindrical eigenmode for frequency doubling of 514 nm to 257 nm into the UV. The overall results along with an analysis of the cause for the degradation were published elsewhere [18] in detail. Therefore, we only briefly reiterate the most important experimental findings: As a source of green light at 514 nm we utilized the narrow-linewidth (\(\approx \) 40 kHz) radiation at 1028 nm from an ECDL [27, 28] fiber-amplified to 18 W and then frequency-doubled with the help of a periodically poled stoichiometric lithium tantalate crystal. The nonlinear BBO crystal was kept at a constant temperature of 130 \(^\circ \)C and placed at the center of the cavity waist. In Fig. 7, the achieved SH power at 257 nm along with the conversion efficiency is shown as a function of the fundamental input power of the resonator. Up to about 3 W input power, we find a good agreement with the theory derived in Ref. [24], which we added to Fig. 7 as solid lines. At higher powers, thermal effects, which were also observed in Ref. [24], limit the maximum conversion efficiency to about 14%. Despite the rather elliptical output profile of the resonator, we could shape the SH beam by a simple lens arrangement to an ellipticity of \(0.89\), which is depicted in Fig. 7 as an inset. Further optimisation would allow for an even better circularity. Additionally, in Ref. [18] we utilize the presented cavity with a standard BBO crystal to achieve stable 600 mW SH power over a duration of more than 8 h. Note that the same crystal suffers from degradation effects at a UV output power of roughly 30 mW in a conventional spherical focusing cavity (cf. Fig. 1).

Fig. 7
figure 7

SH output power at 257 nm in blue and conversion efficiency in red over the fundamental power at 514 nm. The SH beam profile after shaping through lenses is shown as an inset

6 Conclusion and outlook

In conclusion, we have described a method for determining a resonator configuration allowing for SH generation at much lower fundamental peak intensities. To this end, we have shown that elliptical focusing allows not only for higher SH powers than achievable through spherical focusing, but more importantly for a simultaneous reduction of fundamental peak intensity by one order of magnitude. Furthermore, we have investigated the relation between achievable SH power and minimal fundamental peak intensity, both in single pass and for resonant enhancement. By deriving a suitable objective function and employing evolutionary algorithms, we were able to find a resonator which ensures specific beam waists at a specific reference point, usually the middle of a nonlinear crystal. By setting up an elliptical focusing resonator derived with the algorithm, we could experimentally validate the functionality of our method.

To develop a resonator scheme for a specific application, the requirements for both SH output and fundamental peak intensity need careful consideration and a trade-off with corresponding focal beam waists has to be found. From this starting point, the derived objective function can be easily modified to find a resonator configuration employing evolutionary algorithms. In general, a few test runs have to be performed to tailor the objective function for optimal results. Those modifications include the overall implemented resonator geometry (bow-tie, rectangular, etc.) as well as the orientation of the nonlinear crystal in the resonator and the weights in the objective function. In particular, the focal position in the xz-plane corresponding to the sagittal plane in our cavity setup will not be negligible in every case. Once a suitable resonator has been found, a final adjustment can be made by setting the mirror curvatures to fixed values that are available by manufacturers to minimize costs.

Additionally to the specific case of frequency doubling with elliptical focusing, the presented method could easily be adopted to the design of generic optical cavities. As rather unintuitive designs are not excluded, different aspects for various applications such as the overall footprint or a better stability against misalignment could be improved compared to the limited possibilities of conventional cavity design.

Further improvements of the method can be achieved by making the selection of the elliptical Gaussian mode part of the algorithm rather than simply choosing a beam waist configuration. Instead of choosing a specific combination of SH power and peak intensity {\(P\),\(I\)} in Fig. 3 this could be achieved by selecting a specific lower limit for the SH power \(P\) and an upper limit for the peak intensity \(I\), resulting in not only a single pair of focal beam waists \(w_x\) and \(w_y\) but rather in various combinations. On the one hand, this would allow for solutions with even better accordance to the requirements. On the other hand, the requirements themselves could be expanded. For example, the overall resonator length can be made part of the objective function to find more compact designs.