Genetic algorithm-based control of birefringent filtering for self-tuning, self-pulsing fiber lasers

Polarization-based filtering in fiber lasers is well-known to enable spectral tunability and a wide range of dynamical operating states. This effect is rarely exploited in practical systems, however, because optimization of cavity parameters is non-trivial and evolves due to environmental sensitivity. Here, we report a genetic algorithm-based approach, utilizing electronic control of the cavity transfer function, to autonomously achieve broad wavelength tuning and the generation of Q-switched pulses with variable repetition rate and duration. The practicalities and limitations of simultaneous spectral and temporal self-tuning from a simple fiber laser are discussed, paving the way to on-demand laser properties through algorithmic control and machine learning schemes.

Fiber lasers are an important technology that continues to enable new applications as device performance, flexibility and reliability improve. Alongside research pushing the frontiers of laser specifications in the laboratory, there is a need to develop tunable, turn-key systems for non-expert users, allowing precise control of temporal and spectral properties of the source.
Spectral tunability can be achieved by introducing a bulk interference or birefringent filter, or diffraction grating into the cavity. Free-space components, however, eliminate the alignment-free benefits of an all-fiber system. A solution is to use an artificial birefringent filter, formed from the combined effect of dispersive linear polarization rotation due to fiber birefringence and polarization-dependent loss [1]. This is analogous to a Lyot filter, exhibiting a comb-like transmission function.
Duration-tunable pulses can be generated by Q-switching (QS) and/or mode-locking using an electrically-driven modulator. A conceptually simpler approach, however, is passive pulse generation exploiting nonlinearity in fiber. Nonlinear polarization rotation (NPR), for example, manifests itself through an intensity-dependent change in the polarization state of propagating light, yielding a power-dependent transmission when combined with a polarizer-i.e. forming an effective saturable absorber (SA) through nonlinear birefringent filtering. The transfer function can be modified through polarization control, varying the modulation depth and saturation intensity, and enabling a range of pulsed behaviors. Despite progress in the development of new real SA materials [2], artificial SAs remain a robust approach to pulse generation, with a quasi-instantaneous response and without requiring advanced material fabrication.
Exploitation of linear and nonlinear polarization-based filtering in all-fiber cavities has enabled wide tunability over a range of output properties, including: >75 nm mode-locked tuning range [3], multiwavelength operation with up to 25 distinct wavelengths simultaneously [4]; and temporal states from CW to Q-switching and modelocking. More recent applications of birefringent filtering in all-normal dispersion lasers have stabilized pulse for-mation [5], and enabled tuning of both wavelength [6,7] and pulse duration [7] by exploiting the chirped pulse dynamics.
The use of polarization-based filtering techniques in practical systems has been limited, however, by two major problems. Firstly, fiber birefringence can be modified by its environment (i.e. thermally/mechanically induced random fluctuations), thus optimum polarization settings can drift, requiring regular readjustment. Additionally, the coupled and nonlinear dependence of the output properties on cavity parameters that adjust temporal and spectral modulation result in a complex, timeconsuming optimization procedure to achieve a desired output [3,7].
To address this, automated parameter control approaches have been proposed, focused principally on achieving stable fixed-wavelength mode-locking [8][9][10][11][12]. Algorithms that simply search for optimum states, however, struggle with the diversity of laser operating regimes that include multiple points of local maxima (in addition to the desired global maxima). A promising and versatile solution to this problem is to employ machine learning [13][14][15][16][17], broadly defined as system development to perform given functions without explicit instruction. Learning [14] and genetic algorithms (GAs) [15][16][17] have recently been applied to fiber lasers to intelligently explore parameter space and locate global optima, e.g. stable single-pulse mode-locking [17].
Here, we extend this approach by using a GA to automate self-tuning of a fiber laser to achieve user-specified temporal and spectral properties, by harnessing birefringent filtering. Using automated polarization and pump power control, and designing appropriate fitness functions, our system is able to self-tune its wavelength over 55 nm and achieve self-Q-switching with target pulse properties in a 25 kHz repetition rate and 30 µs duration range. We explore the feasibility of simultaneous wavelength and repetition rate tunability and discuss the practicalities and limitations of self-tuning laser technology.
A ring fiber laser design is used [ Fig. 1(a)], including a 2.3 m length of erbium-ytterbium co-doped double-  range. We explore the feasibility of simultaneous wavelength and repetition rate tunability and discuss the practicalities and limitations of self-tuning laser technology.
A ring fiber laser design is used [ Fig. 1(a)], including a 2.3 m length of erbium-ytterbium co-doped double-clad fiber, pumped at 965 nm, an electronic polarization controller (PC) consisting of four stepper-motor-driven quarter waveplates (QWPs) formed of fiber loops with stress-induced birefringence, and an in-line fiber polarizer. The polarizer's fiber pigtails and subsequent 10% output coupler are constructed from high-birefringence (i.e. polarization-maintaining, PM) fiber, ensuring a fixed output polarization from the laser. All other fiber is low-birefringence (non-PM) Corning SMF28. Finally, a polarization-independent in-line isolator is used, resulting in a total cavity length of 21 m.
To explain the operation of the artificial birefringent filter, we use a simplified analysis [ Fig. 1(b)] considering the power transmission T of the polarizer, which blocks light (with >26 dB extinction) polarized in the direction aligned with the fast-axis of its PM fiber pigtails. Light in PM fiber after the polarizer remains linearly polarized in the fiber's slow axis. Non-PM cavity fiber has an intrinsic birefringence orders of magnitude lower than PM fiber, although stresses from twisting and spooling non-PM fiber can significantly increase this. The orthogonal polarization mode axes of the PM fibers form arbitrary angles θ 1 and θ 2 to the principal polarization axes of the non-PM fibers. Light launched into non-PM fiber can excite both supported polarization modes, which couple and transfer power on propagation. This causes a rotation of the polarization state through both a linear (∆φ L = 2πL∆n/λ) and nonlinear (∆φ NL = (2/3)γLP cos 2θ 1 ) phase shift between the two polarization components [18]; where the fiber has length L, birefringence ∆n, nonlinearity parameter γ, and the instantaneous optical power is P. An additional phase shift term ∆φ PC , variable by the user, arises from the PC, which permits complete traversal of the Poincaré sphere through the adjustable angles of four QWPs. Light launched into the ∼0.2 m PM input fiber pigtail of the polarizer is not necessarily aligned to one of the principal axes, hence birefringence here also results in a phase delay, which for simplicity is assumed to be included in ∆φ L and ∆φ NL terms. After a cavity round-trip, any light that is rotated to align with the polarizer's fast axis is attenuated, giving the power transmission function [18]: T = cos 2 θ 1 cos 2 θ 2 + sin 2 θ 1 sin 2 θ 2 + 1 2 sin 2θ 1 sin 2θ 2 cos(∆φ L + ∆φ NL + ∆φ PC ). (1) The final cosine term indicates that the birefringent filter transmission is periodic with wavelength due to ∆φ L . We also note that spectral filtering is introduced by weak wavelengthdependence of both γ and ∆n. Importantly, the transmitted wavelengths can be tuned by adjusting the PC (i.e. ∆φ PC ). In combination with the dynamic gain profile of the erbium fiber amplifier [3], the birefringent filter defines the laser wavelength. To achieve pulsation, the phase bias ∆φ PC is set such that the linear transmission (i.e. for CW light) is low, while the filter permits a higher transmission for light of greater intensity, controlled by ∆φ NL . The modulation depth, non-saturable loss and saturation intensity of this artificial SA can thus be adjusted by the phase bias.
Typically, the identification of system parameters (here, the 4 PC waveplate angles and pump power) to achieve on-demand output properties is a non-trivial optimization. Fortunately, GAs are ideally suited to this task. Briefly, GAs efficiently perform global multivariate optimization using principles from evolutionary biology to find parameters that maximize a quality score, as explained in greater detail for this context in Ref. [17]. The process starts with a population of random parameter sets, which are each trialled and scored according to a fitness function. A new generation of parameter sets is then generated by 'breeding' from the previous generation, where 'parent selection' is probabilistic, related to the parent's score. 'Mutation' is applied by randomly varying parameters with a small probability, to prevent the algorithm converging to local optima. The new generation is then tested and the procedure repeats, selectively identifying and maintaining the best parameters, while rejecting low-scoring sets.
We first demonstrate wavelength tuning, initially neglecting the temporal properties, to elucidate the GA evolution. The fitness function, F λ = 1 − |λ−λ0| 0.5∆λ , is used to score the spectrum (F λ = 1 is optimal) measured on an optical spectrum analyzer (OSA), where λ is the central wavelength (found using a peak detection routine on the recorded data; if no peak found, i.e. no lasing, F λ = 0), λ 0 is the target wavelength, and ∆λ = 70 nm is the estimated gain bandwidth.
The GA optimization procedure for a target wavelength of 1550.0 nm is visualized in Fig. 2: (a) shows the 1st, 3rd and 15th generation results-the initial population of randomized parameters yields a random selection of laser wavelengths; subsequent generations are formed from crossover of the 'best' parameters from the earlier generation, including a random mutation probability, resulting in the breeding out of 'bad' parameters that yield laser wavelengths far from the target, and introducing new parameters with laser wavelengths closer to the target. After several generations, the algorithm converges to locate the optimum PC and pump power settings that yield the desired laser wavelength [with the evolution of the best and average generation score shown in Fig. 2(b)]. We executed the algorithm with a range of target wavelengths: the tuning limits were found to be 1542.2 to 1600.4 nm. Within this range, autonomous selftuning of the birefringent filter was always successful, achieving on-demand wavelength selection within 0.1 nm of the target clad fiber, pumped at 965 nm, an electronic polarization controller (PC) consisting of four stepper-motor-driven quarter waveplates (QWPs) formed of fiber loops with stress-induced birefringence, and an in-line fiber polarizer. The polarizer's fiber pigtails and subsequent 10% output coupler are constructed from high-birefringence (i.e. polarization-maintaining, PM) fiber, ensuring a fixed output polarization from the laser. All other fiber is low-birefringence (non-PM) Corning SMF28. Finally, a polarization-independent in-line isolator is used, resulting in a total cavity length of 21 m.
To explain the operation of the artificial birefringent filter, we use a simplified analysis [ Fig. 1(b)] considering the power transmission T of the polarizer, which blocks light (with >26 dB extinction) polarized in the direction aligned with the fast-axis of its PM fiber pigtails. Light in PM fiber after the polarizer remains linearly polarized in the fiber's slow axis. Non-PM cavity fiber has an intrinsic birefringence orders of magnitude lower than PM fiber, although stresses from twisting and spooling non-PM fiber can significantly increase this. The orthogonal polarization mode axes of the PM fibers form arbitrary angles θ 1 and θ 2 to the principal polarization axes of the non-PM fibers. Light launched into non-PM fiber can excite both supported polarization modes, which couple and transfer power on propagation. This causes a rotation of the polarization state through both a linear (∆φ L = 2πL∆n/λ) and nonlinear (∆φ N L = (2/3)γLP cos 2θ 1 ) phase shift between the two polarization components [18]; where the fiber has length L, birefringence ∆n, nonlinearity parameter γ, and the instantaneous optical power is P . An additional phase shift term ∆φ P C , variable by the user, arises from the PC, which permits complete traversal of the Poincar sphere through the adjustable angles of four QWPs. Light launched into the ∼0.2 m PM input fiber pigtail of the polarizer is not necessarily aligned to one of the principal axes, hence birefringence here also results in a phase delay, which for simplicity is assumed to be included in ∆φ L and ∆φ N L terms. After a cav-ity round-trip, any light that is rotated to align with the polarizer's fast axis is attenuated, giving the power transmission function [18]: The final cosine term indicates that the birefringent filter transmission is periodic with wavelength due to ∆φ L . Spectral filtering is also introduced by weak wavelengthdependence of both γ and ∆n. Importantly, the transmitted wavelengths can be tuned by adjusting the PC (i.e. ∆φ P C ). In combination with the dynamic gain profile of the erbium fiber amplifier [3], the birefringent filter defines the laser wavelength. To achieve pulsation, the phase bias ∆φ P C is set such that the linear transmission (i.e. for CW light) is low, while the filter permits a higher transmission for light of greater intensity, controlled by ∆φ N L . The modulation depth, non-saturable loss and saturation intensity of this artificial SA can thus be adjusted by the phase bias. The identification of system parameters (here, the 4 PC waveplate angles and pump power) to achieve ondemand output properties is a non-trivial optimization. Fortunately, GAs are ideally suited to this task. Briefly, GAs efficiently perform global multivariate optimization using principles from evolutionary biology to find parameters that maximize a quality score, as explained in detail for this context in Ref. [17]. The process starts with a population of random parameter sets, which are each trialled and scored according to a fitness function. A new generation of parameter sets is then generated by 'breeding' from the previous generation, where 'parent selection' is probabilistic, related to the parent's score. 'Mutation' is applied by randomly varying parameters with a small probability, to prevent the algorithm converging to local optima. The new generation is then tested and the procedure repeats, identifying and maintaining the best parameters, while rejecting low-scoring sets.
We first demonstrate wavelength tuning, initially neglecting the temporal properties, to elucidate the GA evolution. The fitness function, F λ = 1 − |λ−λ0| 0.5∆λ , is used to score the spectrum (F λ = 1 is optimal) measured on an optical spectrum analyzer (OSA), where λ is the central wavelength (found using a peak detection routine on the recorded data; if no peak found, i.e. no lasing, F λ = 0), λ 0 is the target wavelength, and ∆λ = 70 nm is the estimated gain bandwidth.
The GA optimization procedure for a target wavelength of 1550.0 nm is visualized in Fig. 2: (a) shows the 1st, 3rd and 15th generation results-the initial population of randomized parameters yields a random selection of laser wavelengths; subsequent generations are formed from crossover of the 'best' parameters from the earlier generation, including a random mutation probability, resulting in the breeding out of 'bad' parameters that yield laser wavelengths far from the target, and introducing insertion losses in fixed fiber components (e.g. isolator/WDMs), which are specified for operation around 1560 nm. The choice of GA parameters (generation size, crossover rate etc. [19]) defines the accuracy and convergence rate of the system-i.e. the time taken to locate the desired state. Empirically, we achieved good performance using a generation size of 20, crossover rate of 90%, and mutation rate of 20% (which is linearly damped as the average score approaches 1). For parent selection during breeding, we use a 'rank selection' algorithm, in contrast to our previous GA work to find mode-locking [17] where 'roulette wheel selection' was chosen. Roulette wheel selection assigns the selection probability based on a parameter set's score, favourable for identifying small mode-locked states within a wide parameter space of non-lasing, CW and QS regimes exhibiting high performance contrast. Rank selection, however, chooses parameters based on their position in the fitness-sorted list of all parameter sets. This enhances the contrast between similarly scoring parameter sets, and is thus better suited for implementing on-demand tunability over a continuous range.
We now consider temporal properties. To highlight the diversity of possible output states and the dependence on input parameters, we measure a two-dimensional slice of the fivedimensional parameter space: three QWPs are fixed, while the pump power is swept from 0 to 0.9 W and one QWP (hereafter, called QWP1) is swept through 180 • [ Fig. 3(a)-(c)]. At each point, the wavelength is measured, and when pulsing, the pulse duration and repetition rate are measured using a photodetector and oscilloscope. The laser threshold is ∼0.2 W. For many QWP1 settings above threshold stable QS is observed, with the pulse properties determined by the pump power and polarization phase bias. Increasing the pump power during QS operation with fixed waveplates results in a linear increase in repetition rate [ Fig. 3(b)] and decrease in pulse duration [ Fig. 3(c)]. This is expected as a QS pulse is emitted once sufficient stored energy in the cavity is accumulated; thus, higher pump power enables increased repetition rates and shorter pulses. Pulse properties are also affected by the QWP angle as this adjusts ∆φ PC in the birefringent filter, which varies the intensity-dependent-loss function. To target autonomous control of a QS output with on-demand repetition rate (excluding wavelength tuning), we redefine the GA fitness function as self-pulsation over a 25 kHz repetition rate range. Fig. 3 highlights that various combinations of laser properties can be accessed-e.g. a contour of constant repetition rate ∼15 kHz in Fig. 3(b) corresponds to a region in Fig. 3(a) where the wavelength varies over ∼10 nm. This shows that by adjusting just the power and QWP1, a 15 kHz pulse train could be achieved at any target wavelength in this range. An important question, therefore, is can we arbitrarily select wavelength, pulse duration and repetition rate within the full tuning range?
We explore the potential for this self-tunability using a GA with a compound fitness function that assigns a score according to both the wavelength and pulse repetition rate: F total = 0.5F λ + 0.5F f . The effect of this function in identifying a target operating regime (arbitrarily chosen to be λ 0 = 1550 nm wavelength, f 0 = 15 kHz repetition rate) is illustrated by applying it to the reduced 2D parameter space (of pump power and QWP1), resulting in the fitness map Fig. 3(d), highlighting the optimum operation region for these properties.
Self-tuning from randomized initial parameters towards the target λ 0 = 1550 nm and f 0 = 15 kHz is demonstrated by running the compound fitness-function-based GA. Within the first generation, a range of non-lasing, CW and QS states (with widely varying pulse repetition rates) are observed, as expected from the broad parameter space (Fig. 3), giving a low average score. The algorithm maintains the 'good' parameters and breeds/mutates them to identify improved performanceshown by the increase in the 'Best in Generation', which leads to convergence to optimal performance over numerous generations [ Figs. 4(a)-(b)]. The routine is re-executed, each time following a different evolution due to the probabilistic process and randomized initial conditions, but demonstrating reliability by always converging on the generation of a 1550 nm wavelength, 15 kHz pulse train-as characterized in Figs. 4(c)-(e). The pulses are measured to have 5.9 µs duration and the electrical spectrum shows a high peak-to-background contrast of 40 dB at the fundamental repetition frequency of the pulse train, indicating good stability. The 4.7 mW output is linearly polarized with a 19 dB extinction ratio, corresponding to 0.31 µJ pulse energy. We also note that when the laser is intentionally disturbed mechani- new parameters with laser wavelengths closer to the target. After several generations, the algorithm converges to locate the optimum PC and pump power settings that yield the desired laser wavelength [with the evolution of the best and average generation score shown in Fig. 2(b)]. We executed the algorithm with a range of target wavelengths: the tuning limits were found to be 1542.2 to 1600.4 nm. Within this range, autonomous self-tuning of the birefringent filter was always successful, achieving on-demand wavelength selection within 0.1 nm of the target [ Fig. 2(b) inset]. The factor limiting this range is believed to be insertion losses in fixed fiber components (e.g. isolator/WDMs), which are specified for operation around 1560 nm.
The choice of GA parameters (generation size, crossover rate etc. [19]) defines the accuracy and convergence rate of the system-i.e. time taken to locate the desired state. Empirically, we achieved good performance using a generation size of 20, crossover rate of 90%, and mutation rate of 20% (which is linearly damped as the average score approaches 1). For parent selection during breeding, we use a 'rank selection' algorithm, in contrast to our previous GA work to find mode-locking [17] using 'roulette wheel selection'. Roulette wheel selection assigns the selection probability based on a parameter set's score, favourable for identifying small mode-locked states within a wide parameter space of non-lasing, CW and QS regimes exhibiting high performance contrast. Rank selection, however, chooses parameters based on their position in the fitness-sorted list of all parameter sets. This enhances the contrast between similarly scoring parameter sets, and is thus better suited for implementing on-demand tunability over a continuous range.
We now consider temporal properties. To highlight the diversity of possible output states and the dependence on input parameters, we measure a two-dimensional slice of the five-dimensional parameter space: three QWPs are fixed, while the pump power is swept from 0 to 0.9 W and one QWP (hereafter, called QWP1) is swept through 180 • [ Fig. 3(a)-(c)]. At each point, the wavelength is insertion losses in fixed fiber components (e.g. isolator/WDMs), which are specified for operation around 1560 nm. The choice of GA parameters (generation size, crossover rate etc. [19]) defines the accuracy and convergence rate of the system-i.e. the time taken to locate the desired state. Empirically, we achieved good performance using a generation size of 20, crossover rate of 90%, and mutation rate of 20% (which is linearly damped as the average score approaches 1). For parent selection during breeding, we use a 'rank selection' algorithm, in contrast to our previous GA work to find mode-locking [17] where 'roulette wheel selection' was chosen. Roulette wheel selection assigns the selection probability based on a parameter set's score, favourable for identifying small mode-locked states within a wide parameter space of non-lasing, CW and QS regimes exhibiting high performance contrast. Rank selection, however, chooses parameters based on their position in the fitness-sorted list of all parameter sets. This enhances the contrast between similarly scoring parameter sets, and is thus better suited for implementing on-demand tunability over a continuous range.
We now consider temporal properties. To highlight the diversity of possible output states and the dependence on input parameters, we measure a two-dimensional slice of the fivedimensional parameter space: three QWPs are fixed, while the pump power is swept from 0 to 0.9 W and one QWP (hereafter, called QWP1) is swept through 180 • [ Fig. 3(a)-(c)]. At each point, the wavelength is measured, and when pulsing, the pulse duration and repetition rate are measured using a photodetector and oscilloscope. The laser threshold is ∼0.2 W. For many QWP1 settings above threshold stable QS is observed, with the pulse properties determined by the pump power and polarization phase bias. Increasing the pump power during QS operation with fixed waveplates results in a linear increase in repetition rate [ Fig. 3(b)] and decrease in pulse duration [ Fig. 3(c)]. This is expected as a QS pulse is emitted once sufficient stored energy in the cavity is accumulated; thus, higher pump power enables increased repetition rates and shorter pulses. Pulse properties are also affected by the QWP angle as this adjusts ∆φ PC in the birefringent filter, which varies the intensity-dependent-loss function. To target autonomous control of a QS output with on-demand repetition rate (excluding wavelength tuning), we redefine the GA fitness function as self-pulsation over a 25 kHz repetition rate range. Fig. 3 highlights that various combinations of laser properties can be accessed-e.g. a contour of constant repetition rate ∼15 kHz in Fig. 3(b) corresponds to a region in Fig. 3(a) where the wavelength varies over ∼10 nm. This shows that by adjusting just the power and QWP1, a 15 kHz pulse train could be achieved at any target wavelength in this range. An important question, therefore, is can we arbitrarily select wavelength, pulse duration and repetition rate within the full tuning range?
We explore the potential for this self-tunability using a GA with a compound fitness function that assigns a score according to both the wavelength and pulse repetition rate: F total = 0.5F λ + 0.5F f . The effect of this function in identifying a target operating regime (arbitrarily chosen to be λ 0 = 1550 nm wavelength, f 0 = 15 kHz repetition rate) is illustrated by applying it to the reduced 2D parameter space (of pump power and QWP1), resulting in the fitness map Fig. 3(d), highlighting the optimum operation region for these properties.
Self-tuning from randomized initial parameters towards the target λ 0 = 1550 nm and f 0 = 15 kHz is demonstrated by running the compound fitness-function-based GA. Within the first generation, a range of non-lasing, CW and QS states (with widely varying pulse repetition rates) are observed, as expected from the broad parameter space (Fig. 3), giving a low average score. The algorithm maintains the 'good' parameters and breeds/mutates them to identify improved performanceshown by the increase in the 'Best in Generation', which leads to convergence to optimal performance over numerous generations [ Figs. 4(a)-(b)]. The routine is re-executed, each time following a different evolution due to the probabilistic process and randomized initial conditions, but demonstrating reliability by always converging on the generation of a 1550 nm wavelength, 15 kHz pulse train-as characterized in Figs. 4(c)-(e). The pulses are measured to have 5.9 µs duration and the electrical spectrum shows a high peak-to-background contrast of 40 dB at the fundamental repetition frequency of the pulse train, indicating good stability. The 4.7 mW output is linearly polarized with a 19 dB extinction ratio, corresponding to 0.31 µJ pulse energy. We also note that when the laser is intentionally disturbed mechani- measured, and when pulsing, the pulse duration and repetition rate are measured using a photodetector and oscilloscope. The laser threshold is ∼0.2 W. For many QWP1 settings above threshold stable QS is observed, with the pulse properties determined by the pump power and polarization phase bias. Increasing the pump power during QS operation with fixed waveplates results in a linear increase in repetition rate [ Fig. 3(b)] and decrease in pulse duration [ Fig. 3(c)]. This is expected as a QS pulse is emitted once sufficient stored energy in the cavity is accumulated; thus, higher pump power enables increased repetition rates and shorter pulses. Pulse properties are also affected by the QWP angle as this adjusts ∆φ P C in the birefringent filter, which varies the intensity-dependentloss function. To target autonomous control of a QS output with on-demand repetition rate (excluding wavelength tuning), we redefine the GA fitness function as F f = 1 − |f −f0| f0 , with measured repetition frequency f and target f 0 , achieving self-tuning, self-pulsation over a 25 kHz repetition rate range. Fig. 3 highlights that various combinations of laser properties can be accessed-e.g. a contour of constant repetition rate ∼15 kHz in Fig. 3(b) corresponds to a region in Fig. 3(a) where the wavelength varies over ∼10 nm. This shows that by adjusting just the power and QWP1, a 15 kHz pulse train could be achieved at any target wavelength in this range. The tuning range here, however, by varying only two parameters is limited compared to the full performance range that can be achieved through varying all five parameters [e.g. 30 nm wavelength range in Fig. 3(a) compared to 58 nm range in Fig. 2]. An important question, therefore, is can we arbitrarily select wavelength, pulse duration and repetition rate within the full tuning range?
We explore the potential for this self-tunability using a GA with a compound fitness function that assigns a score according to both the wavelength and pulse repetition rate: F total = 0.5F λ + 0.5F f . The effect of this function in identifying a target operating regime (arbitrarily chosen to be λ 0 = 1550 nm wavelength, f 0 = 15 kHz repetition rate) is illustrated by applying it to the reduced 2D parameter space (of pump power and QWP1), resulting in the fitness map Fig. 3(d), highlighting the optimum operation region for these properties. Self-tuning (from randomized initial conditions, including all five parameters) towards the target λ 0 = 1550 nm and f 0 = 15 kHz is demonstrated by running the compound fitness-function-based GA. Within the first generation, a range of non-lasing, CW and QS states (with widely varying repetition rates) are observed, as expected from the broad parameter space (Fig. 3), giving a low average score. The algorithm maintains the 'good' parameters and breeds/mutates them to identify improved performance-shown by the increase in the 'Best in Generation', which leads to convergence to optimal performance over numerous generations [Figs. 4(a)-(b)]. The routine is re-executed, each time following a different evolution due to the probabilistic process and randomized initial conditions, but demonstrating reliability by always converging on the generation of a 1550 nm wavelength, 15 kHz pulse train-as characterized in Figs. 4(c)-(e). The pulses exhibit a 5.9 µs duration and the electrical spectrum shows a high peak-to-background contrast of 40 dB at the fundamental repetition frequency of the pulse train, indicating good stability. The 4.7 mW output is linearly polarized with a 19 dB extinction ratio, corresponding to 0.31 µJ pulse energy. We also note that when the laser is intentionally disturbed, causing the performance to change randomly, the GA quickly relocates new optimum parameters to restore the desired output properties (similar to Ref. [17]).
To explore the limits of this approach, we repeated the optimization process targeting 15 kHz pulse train generation over a range of wavelengths. The optimal converged fitness values as a function of target wavelength are shown in Fig. 4(f). Unity fitness is not achieved across the full range, highlighting that the target properties were not found in all cases. Consistently, high performing regimes are observed between 1550 and 1570 nm, with achieved optimal scores exceeding 0.96. Outside of this region, however, the maximum score, despite numerous iterations of the self-tuning process, is lowerindicating the target laser wavelength and repetition rate could not be mutually satisfied; instead, the algorithm found a compromise: e.g. for the 15 kHz at 1590 nm target, the optimum output that could be found was an 11 kHz pulse train at 1585 nm. This limitation is related to the finite laser gain profile and intrinsic coupling of the spectral and temporal tuning through the birefringent filtering.
Greater degrees of freedom may enable broader simultaneous tuning of pulse properties and wavelength, beyond these current limits. Inclusion of a second po-  cally, causing the performance to change randomly, the GA can quickly relocate the new optimum system parameters to restore the desired output properties (similar to Ref. [17]).
To explore the limits of this approach, we repeated the optimization process targeting 15 kHz pulse train generation over a range of wavelengths. The optimal converged fitness values as a function of target wavelength are shown in Fig. 4(f). Unity fitness is not achieved across the full range, highlighting that the target properties were not found in all cases. Consistently, high performing regimes are observed between 1550 and 1570 nm, with achieved optimal scores exceeding 0.96. Outside of this region, however, the maximum score, despite numerous iterations of the self-tuning process, is lower-indicating the target laser wavelength and repetition rate could not be mutually satisfied; instead, the algorithm found a compromise: e.g. for the 15 kHz at 1590 nm target, the optimum output that could be found was an 11 kHz pulse train at 1585 nm. This limitation is related to the finite laser gain profile and intrinsic coupling of the spectral and temporal tuning through the birefringent filtering.
Greater degrees of freedom may enable broader simultaneous tuning of pulse duration and wavelength, beyond these current limits. Inclusion of a second electronic polarization controller, for example, after the output coupler would allow control over the polarization state of light launched into the non-PM fiber [15]. It can also be seen from Fig. 3(a) that pump power has minimal influence on the laser wavelength, yet >75 nm of tunability was recently demonstrated by introducing a variable attenuator into a laser cavity allowing adjustment of the threshold and thus the population inversion, modifying the spectral gain shape [3]. Inclusion of a tunable attenuator as a control variable could thus extend the tuning range. The automated tunability in wavelength and repetition rate suggest that applications such as laser spectroscopy and photoacoustic imaging could be explored to exploit such a Q-switched fiber laser [20].  larization controller, for example, after the output coupler would allow control over the polarization state of light launched into the non-PM fiber [15]. Additionally, >75 nm of spectral tunability was demonstrated by introducing a variable attenuator into a laser cavity allowing adjustment of the threshold and thus the population inversion, modifying the spectral gain shape [3]-this could also be included as a GA control variable to extend the tuning range. The automated tunability in wavelength and repetition rate suggest that applications such as laser spectroscopy and photoacoustic imaging could be explored to exploit such a Q-switched fiber laser [20].
Finally, we critically discuss the potential of intelligently automated birefringent filtering for the development of self-tuning fiber lasers. For optimization of a single characteristic, the proposed solution performs well: >55 nm tunability was demonstrated, without user intervention or active monitoring of the environment (e.g. temperature compensation). This could enable reliable automated wavelength tuning of lasers, including pulsed sources (mode-locked or Q-switched) using real SAs. For multi-characteristic tuning, however, the intrinsic coupling of temporal and spectral properties and finite spectral gain present limitations to the achievable tuning ranges: when demanding a 15 kHz repetition rate, our tuning range was limited to ∼20 nm. Introducing additional degrees of freedom and electronically controlled components is thus an interesting topic for future work. Compared to alternative approaches, such as in-line active modulators, automated passive filtering to achieve tuning of laser output characteristics represents a novel and potentially simpler/economical route forwards. We note that miniaturized low-cost optical diagnostics are an area of active research and development; thus, the inclusion of real-time monitoring systems in laser devices will enable further progress in this area.
In conclusion, we have demonstrated the first selftuning self-Q-switching fiber laser using a genetic algorithm to control intracavity birefringent filtering. Selftuning is possible in the presence of an unregulated environment which has to date prohibited the practical application of artificial saturable absorbers without complex active thermal and mechanical stabilization. Extending the autonomous tuning range of on-demand laser properties is a future challenge; yet, we believe there is great potential for artificial intelligence in the control of laser systems, not least by harnessing linear and nonlinear polarization effects.