1 Introduction

Fig. 1
figure 1

Concept for all-optical temporal and spatial shaping inside a few-mode graded-index fiber. Two long-period gratings (LPG, N grating periods of length g) are used to create a two-mode inline Mach–Zehnder interferometer for the probe pulses with a fiber length L in between the gratings. The relative phase difference between the two transverse modes of the probe pulses is tuned all-optically by control pulses at a separate wavelength and with a certain delay \(\varDelta t\). The output is then spatially or spatio-temporally shaped and an optional subsequent mode stripper (MS) additionally allows for pure temporal shaping. The simulated modal content of the control and probe pulses along the fiber is shown in Fig. 2

Since their development, single-mode optical fibers have mostly been preferred over multimode fibers when designing fiber applications as a clean beam profile is maintained and dispersion effects are reduced, e.g, modal group dispersion is avoided. However, the advantage of gaining a spatial degree of freedom inside an optical fiber by utilizing transverse fiber modes has sparked a wide variety of research in the recent years, including spatial division multiplexing for telecommunication systems [1], dispersion compensation [2], single-fiber spectrometers [3], pulse delivery through highly multimode fibers [4] and fundamental nonlinear effects like space–time mode locking [5] or controlled nonlinear multimode interactions [6].

We demonstrate with a numerical study that few-mode fibers can offer spatial as well as temporal pulse shaping capabilities by exploiting the nonlinear interaction between fiber modes via intermodal cross-phase modulation (intermodal XPM) [7,8,9]. In single mode fibers, XPM and its temporal impact have been investigated in detail [10] and different approaches to temporal shaping have been demonstrated, including nonlinear optical loop mirrors [11] and ultrashort pulse formation from a modulated continuous-wave signal [12]. Nevertheless, versatile fiber-based pulse shaping is still a topic of current research and has not yet accessed the spatial domain. Achieving temporal as well as spatial pulse shaping in a completely fiber-based setup can be of vital interest for any application scenario requiring robust, alignment-free all-fiber systems and could enable a spatial degree of freedom in fiber sensing applications, like lab-on-a-tip scenarios [13].

Most commonly, temporal pulse shaping of ultrashort pulses is performed in free-space setups by either manipulating amplitudes and phases of the electric field within the Fourier-plane of a 4f-setup [14, 15], or by employing programmable acousto-optic dispersive filters [15, 16]. Combined with spatial shaping techniques using, e.g., 2D-SLMs [17], nearly arbitrary spatial and temporal shaping is possible. However, as with any free-space method, such setups are very critical in alignment, exhibit high losses and are, thus, not suitable for integration into out-of-lab or completely fiber-based applications. While electro-optic modulators allow to generate pulses with durations down to several picoseconds in fiber-based setups [18, 19], temporal shaping within such pulses is not possible. Therefore, research has been dedicated to temporal shaping of light in fibers reaching ultrashort timescales, while circumventing the disadvantages of free-space setups and even offering novel functionality: apodized fiber Bragg gratings and long-period gratings have been demonstrated for arbitrary waveform generation [20] (see also chapter 9 in [21]) and nonlinear shaping of pulses even offers capabilities not possible with Fourier-optics based shaping, e.g., shortening of bandwidth-limited pulses through spectral broadening (see chapter 5 in [21] for a good review). However, only few methods exist for enabling reconfigurable shaping devices and, more importantly, spatial shaping has, so far, been bound exclusively to free-space setups. We present a way to achieve such shaping capabilities based on an all-optically tuned, all-fiber Mach–Zehnder interferometer.

Fiber-based Mach–Zehnder interferometers (MZI) are versatile optical components offering stability, low loss and ease of use in out-of-lab applications. They are found in a wide variety of applications, including optical signal processing and optical sensing [22, 23]. Typical inline MZI for sensing purposes use the core and cladding modes of a fiber as the interferometer pathways with coupling achieved either by discrete coupling points [24] or long-period gratings [25, 26]. As the cladding mode is not confined in the core of the fiber, this scheme is ideal for interaction with the surrounding of the fiber, e.g., for refractive index sensing [27]. However, for purposes like optical signal processing or pulse shaping, isolation from the environment is desirable and thus, the use of cladding modes unsuitable. In recent work on inline MZIs all-in-fiber core [28] and cladding-inscribed [29] versions have been demonstrated.

Here, we propose to use the two lowest order transverse modes of a few-mode fiber as interferometer pathways for an inline MZI and investigate such a structure numerically. The two-mode MZI can be tuned all-optically, as the phase difference between both modes can be changed by a second, co-propagating control pulse via intermodal XPM [9, 30, 31]. This approach provides significantly faster reconfiguration times than, e.g., reprogramming an SLM and additionally allows to tune the MZI on an intra-pulse time scale, enabling temporal pulse shaping. The temporal pulse shaping is achieved by appropriate combination of fiber length and pulse delays with the chromatic pulse walk-off, for basically ’carving-out’ a temporal section of the original probe pulse. Furthermore, spatial shaping can be achieved, when the induced change of phase difference between both modes is used to change the interference pattern of the two well-defined spatial modes at the output of the MZI. Combining the spatial and temporal shaping ultimately leads to a spatio-temporally shaped profile of the output pulses.

2 Two-mode Mach–Zehnder interferometer

A sketch of the numerically investigated two-mode MZI is shown in Fig. 1. Probe pulses with a duration of 2 ps and centered at a wavelength of \(\lambda _p = 1030\,\hbox{nm}\) were launched into a few-mode fiber in the fundamental LP\(_{01}\)-mode and were converted into an equal superposition of the LP\(_{01}\)- and the LP\(_{11}\)-mode using a long period grating (LPG) with a grating period \(g=529.7\,\upmu\hbox{m}\) and a number of grating periods \(N=79\). The two transverse modes exhibited different propagation constants \(\beta _{{\text {LP}}_{01}}(\lambda _p)\) and \(\beta _{{\text {LP}}_{11}}(\lambda _p)\), which led to a periodically varying relative phase difference (RPD) along the propagation with a beating length \(l = 2\cdot \pi / (\beta _{{\text {LP}}_{01}}(\lambda _p) - \beta _{{\text {LP}}_{11}}(\lambda _p))\). The grating period had to match this beating length to achieve efficient mode conversion. After a certain propagation length L through the two-mode fiber, both modes were coupled to each other again using a second, identical LPG. The mode coupling at the second LPG was sensitive to the RPD between both modes and, therefore, the output of the device was a periodic function of the fiber length L with a period l: for a fiber length \(L=n \cdot l, n \in {\mathbb {N}}\), the probe pulses were converted completely into the higher-order mode and for a fiber length \(L=(n+1/2)\cdot l\), the probe pulses were converted back into a pure fundamental mode.

To tune such a two-mode MZI, the RPD between both transverse modes needs to be changed. We propose to use two complementary techniques: by stretching the fiber over a distance of one beating length, the phase difference can be tuned over a full \(2\pi\)-period. As the beating length between the fiber modes is typically in the range of a few hundreds of micrometers, this could be experimentally realized by employing a piezo-electric fiber stretcher [32]. On the other hand, in order to shape the RPD on an intra-pulse time-scale, all-optical tuning can be realized by exploiting intermodal XPM. We realized this by coupling a second (control) beam centered at a wavelength of \(\lambda _c = 1550\,\hbox{nm}\) into the fundamental mode of the fiber. The number of coupling points as well as the coupling strength within the LPG were optimized to result in the behavior shown in Fig. 2, showing two separate simulations based on the multimode generalized nonlinear Schrödinger equation [33] for a control and a probe pulse through the whole two-mode MZI. The mode conversion was strongly phase-mismatched for the control pulses and they were converted back into a pure fundamental mode up to the end of the LPG as the device had a length of two times their conversion length. The probe pulses (at \(\lambda _p = 1030\,\hbox{nm}\)) were efficiently converted and reached an equal superposition of both modes at the end of the LPG as it had a length of half their conversion length. At the second LPG the probe pulses were not converted completely into the higher-order mode, as with the chosen fiber length of \(L = 232.64\,\hbox{cm}\), L/l was not exactly an integer.

The phase that the weak probe pulses accumulated during propagation along the fiber was now altered via XPM by the intense control pulses. This altered phase depended on the effective overlap areas between the involved control and probe modes and, therefore, a change of the phase difference between two probe modes could be achieved by control pulses guided only in a single mode [7,8,9]. An analytical description of XPM can be derived from standard textbooks [34] and has been stated in several scenarios, e.g., for intermodal XPM of cw-light [7] and XPM between polarization states of pulsed light [35]. Here, we state the equation for intermodal XPM between two parallel-polarized pulses with no nonlinear impact from the weak probe pulse. The phase \(\delta \phi _{kj}(t)\) imprinted onto a mode of a probe pulse with index k by a control pulse guided in a mode with index j can then be expressed as

$$\begin{aligned} \delta \phi _{kj}(t) = \frac{8 \pi \, n_2}{\lambda _c \, \varDelta \beta _{1,kj} A_{kj}} {\int _0^{\varDelta \beta _{1,kj} L}} P_\text {control}(t- \varDelta t - \tau ) \text { d} \tau , \end{aligned}$$
(1)

with \(n_2\) denoting the nonlinear refractive index coefficient, \(\lambda _c\) the control wavelength, \(\varDelta \beta _{1,kj}\) the difference between the inverse group velocities of the k-th mode at the probe wavelength and the j-th mode at the control wavelength, \(A_{kj}\) the effective overlap area between the k-th probe mode and the j-th control mode (analogous to Park et al. [7]), L the fiber length, \(P_\text {control}(t)\) the control power at time t and \(\varDelta t\) the initial delay between control and probe pulses.

Equation 1 exhibits that the temporal shape of the induced phase critically depends on the chromatic walk-off between the control and the probe pulses, given by the difference of inverse group velocities. Thus, the combination of a large chromatic walk-off \(\varDelta \beta _{1,kj}\) with a carefully chosen fiber length L and temporal delay \(\varDelta t\) allows to shape the induced change of RPD along the temporal evolution of the probe pulses and, consecutively, enables to control the mode conversion at the second LPG on an intra-pulse time-scale. However, any typical fiber additionally exhibits different group velocities for the two probe modes. The resulting modal walk-off of the probe pulses needs to be small, otherwise the interference contrast at the second LPG will be reduced. We identified a few-mode graded-index fiber (type: “two-mode graded-index” at \(1550\,\hbox{nm}\), manufacturer: OFS) as a suitable fiber as it provides a large chromatic walk-off of \(2.044\,\hbox{ps/m}\) and a small modal walk-off of \(0.258\,\hbox{ps/m}\). It is the same fiber which was successfully used in previous experiments [9] and we observed excellent agreement between experimental measurements of intermodal XPM and a theoretical modeling based on Eq. 1 using this fiber [31].

The output of such a two-mode MZI can then be used twofold: first, the interference of both modes at the fiber end facet can be exploited for spatial or spatio-temporal shaping. Second, by adding a mode stripper (MS) and removing the higher-order mode content, pure temporal shaping of the output pulses can be realized. Results for both cases are presented in Sect. 3.

Fig. 2
figure 2

Normalized modal content of control and probe pulses along propagation through the two-mode MZI, obtained from a simulation based on the MM-GNLSE. The long-period grating was designed to achieve an equal superposition of the LP\(_{01}\)- and LP\(_{11}\)-mode at the probe wavelength, but a pure fundamental mode at the control wavelength

To investigate a realistic scenario in our numerical study and obtain detailed insights for future experiments, we modeled the pulse propagation using the multimode generalized nonlinear Schrödinger equation (MM-GNLSE) [33]. Previous investigations on the nonlinear interaction between transverse fiber modes led to a good agreement between experiments and numerical simulations using the MM-GNLSE [9, 36, 37]. The used fiber parameters of the few-mode graded-index fiber are listed in table 1 and were calculated from measured propagation constants and spatial mode profiles, both provided by the manufacturer. The calculated dispersion was additionally in good agreement with values derived from a measured refractive index profile of the fiber [38].

Table 1 Parameters of the two-mode graded-index fiber; \(f_R, \tau _1, \tau _2\) are only used with the MM-GNLSE, see Ref. [33] for details

The MM-GNLSE represents an established model for pulse propagation in fibers and enables the modeling of complex phenomena (e.g. supercontinuum generation [39]) but requires long calculation times of about one to two hours for a pulse propagation through one to two meters of optical fiber, as the equation has to be integrated step-by-step with respect to the propagation. Such times are too long to perform large parameter scans for specifying a desired functionality of the MZI setup. Thus, we derived a drastically simplified MZI model specifically for the optically tuned two-mode MZI, which exploits the fact that intermodal XPM can be expressed analytically (Eq. 1). A calculation equivalent to an MM-GNLSE simulation can be performed in less than a minute with this simplified MZI model and the computation time is additionally independent of the used fiber length. The MZI model is limited to the two involved modes and includes only mode coupling at the LPG, the linear phase accumulation during propagation, the nonlinear phase shift induced by the intermodal XPM and the modal group walk-off of the probe modes (see supplement for mathematical details). Despite this drastic simplification, we observed good agreement between calculations with the MM-GNLSE and the MZI model for predicting the behavior of a two-mode MZI. The MZI model provides further advantage in the above mentioned special case of a fiber guiding only the fundamental mode at the control wavelength: the MM-GNLSE uses a linear approximation for the change of the mode fields with respect to the wavelength [33]. Therefore, simulating a wavelength range across a modal cutoff can lead to unphysical results when energy is coupled into the non-existent mode. The MZI model avoids such issues inherently as the induced phase shift is evaluated for every combination of control and probe modes individually, and the contribution of the higher-order control mode (\(j=2\)) can simply be set to zero, i.e., \(\delta \phi _{12} = \delta \phi _{22} = 0\) with the indices 1 and 2 corresponding to the LP\(_{01}\)- and LP\(_{11}\)-mode, respectively.

3 Results

We compare simulations based on the MM-GNLSE with calculations using the MZI model and outline the range of functionalities in the two-mode MZI with five examples: all-optical switching, temporal pulse shaping, temporal pulse compression, spatial shaping, and spatio-temporal shaping. Removing the higher-order mode at the MZI output creates an all-optical switch (Sect. 3.1) when the control and probe pulses pass each other completely and a temporally constant change of RPD is induced. By adjusting the fiber length and initial pulse delay such that control and probe pulses only partially pass each other, a specified temporal section of the probe pulse can be carved out of the original pulse, resulting in temporal pulse shaping or pulse compression (Sect. 3.2). Using the interference between both modes at the output of the MZI either spatially or spatio-temporally shaped pulses are obtained, depending on whether a constant or temporally shaped change of RPD is induced (Sect. 3.3).

To obtain these functionalities, we considered fiber lengths of 0.5–2.3 m together with control pulses with durations of \( 1\,\hbox{ps}\) or \( 2\,\hbox{ps} \) and pulse energies ranging from 0 to \( 8\,\hbox{nJ}\). The probe pulses were chosen to carry an energy of \( 0.1\,\hbox{nJ}\) and we verified by examining the spectrum of the probe pulses in a separate simulation that any contribution to nonlinear effects solely originated from the control pulses.

3.1 All-optical switching

Fig. 3
figure 3

All-optical switching in a two-mode MZI. The normalized transmission of the probe pulses is shown as a function of the control pulse energy, calculated by the MZI model (solid, red line; dashed, blue line) and simulated using the MM-GNLSE (black crosses and plus signs). Between an on- and off-switch behavior could be chosen by a suitable fiber elongation

The two-mode MZI can be used as an all-optical switch, following the same principle of all-optical switching based on intermodal XPM that has been demonstrated experimentally before [7, 9]. Compared to previous demonstrations the advantages of an all-fiber system were gained and the modulation depth could be significantly improved. A \( 2.3\,\hbox{m} \) long fiber was used in combination with an initial delay between control and probe pulses of \(2\,\hbox{ps} \) in order to let the control pulses completely pass the probe pulses inside the fiber. Then, a temporally constant change of RPD between the probe modes was induced [31] and the second LPG in combination with a subsequent mode stripper led to an overall transmission being a function of the control pulse energy, while maintaining the original probe pulse shape. The initial state of the device (\(0\,\hbox{nJ} \) control pulse energy) could be set by adjusting the fiber length, as this set the relative phase difference between the probe modes in front of the second LPG and, thus, determined the transmission through the device. Two distinguished states (and most relevant here) are the states for initially minimal and maximal transmission resulting in an on- and off-switch, respectively. One could switch between these two states by altering the fiber length by one half of a beating length of the probe modes \(l/2 \approx 265\,\upmu \hbox {m}\). Figure 3 shows the transmission through the all-optical switch in such an on- and off-switch configuration normalized to the total probe power. With the MZI model a fiber length of \(2.3\,\hbox{m}+250\,\upmu\hbox{m}\) resulted in an on-switch configuration (dashed, blue line) and a fiber length of \(2.3\,\hbox{m}-5\,\upmu\hbox{m}\) resulted in an off-switch configuration (solid, red line). The transmission through the switch was verified to be a cos\(^2\)-shaped function of the control pulse energy as expected from a Mach–Zehnder interferometer. The estimation using our MZI model was in good agreement with the MM-GNLSE simulation, depicted in Fig. 3 by the black crosses and plus signs. In the MM-GNLSE simulations the total fiber length of \(2.3\,\hbox{m}\) had to be adjusted by \(+\,296\,\upmu\hbox{m}\) and \(+\,30\,\upmu\hbox{m}\) to obtain an on- and off-switch, respectively. Slightly different length adjustments were necessary as the MZI model included only linear phase accumulation and neglects any dispersion effects, which further altered the phase of the probe pulses during propagation. This could additionally be observed for the difference of length adjustments, necessary to alternate between the on- and off-switch configuration. In the MM-GNLSE simulations this difference matched l/2 (\(266\,\upmu \hbox {m}\)) while a deviation of about 4% was observed in the MZI model (\(255\,\upmu \hbox {m}\)). However, such detailed differences of length adjustments will not be relevant for an experimental realization, as one should tune the fiber length adjustment until the desired transmission is observed in any case to account for additional deviations, e.g., manufacturing tolerances of the fiber.

Changing the switch between its maximum and minimum transmission value was achieved with a control pulse energy of \( 3.75\,\hbox{nJ}\) and a modulation depth of 93% (11.6 dB) and 92% (11.0 dB) was observed for the off- and on-switch configuration, respectively. This is a factor of 2.4 less control pulse energy and a nearly twofold increase of modulation depth compared to previous experimental demonstrations of all-optical switching using intermodal XPM [9]. The improvements were obtained as in the presented scenario approximately ten times longer pulses were employed in combination with an approximately ten times longer fiber. This led to a comparable strength of XPM, but reduced the influence of nonlinear effects proportional to the steepness of the used control pulses, thus, avoiding the temporal pulse degradation which was observed in reference [9].

The modulation depth was limited in this scenario by the temporal delay of \( 0.593\,\hbox{ps}\) between both probe modes accumulated until the end of the fiber due to the modal walk-off. Such a delay limits the possible conversion efficiency at the second LPG, just like two delayed pulses would exhibit a reduced modulation depth when interfering at a conventional 50/50 beam splitter. The modulation depth could, therefore, be further increased by designing a fiber with a reduced modal walk-off. This could be achieved by exploiting that fibers typically exhibit a point of zero modal walk-off between two transverse modes at a wavelength near the cut-off wavelength of the higher-order mode, i.e., \(\varDelta \beta\) exhibits an extremum and \(\varDelta \beta _1\) changes its sign [2, 40].

Fig. 4
figure 4

All-optical temporal shaping of initially Gaussian-shaped probe pulses with a duration of \( 2\,\hbox{ps}\) (dashed, black line). Gaussian-shaped (solid, blue line), flat-top (dotted, red line) or double pulses (dash-dotted, green line) were obtained at different control pulse energies and could be transformed into one another by varying the control pulse energy. The temporal shaping occurred due to a specifically exploited incomplete passing of control and probe pulses. a Calculation results using the MZI model, b simulation results using the MM-GNLSE

For comparison with other all-optical switching schemes a suitable figure of merit (FoM) is the necessary switching power P multiplied by the fiber length L [41]. Here, we obtained a value of \(P\cdot L = 3.75\,\hbox{nJ}/2\,\hbox{ps}\, \cdot \, 2.3\,\hbox{m} = 4313\,\hbox{Wm}\), which is nearly identical to the above mentioned previous experiments [9]. Further optimization of the FoM as well as further reduction of necessary pulse energy can be achieved by realizing all-optical switching in a SiN waveguide. There, reported values of \(P\cdot L = 2.3\,\hbox{Wm}\) [30] were significantly lower than the values of 300–60 Wm, achieved in other comparable switching schemes [41].

3.2 All-optical temporal shaping

The two-mode MZI allows for all-optical shaping of the temporal profile of the probe pulses by an incomplete passing of the control pulses over the probe pulses. As can be seen from Eq. 1, the change of RPD between the probe modes inside the MZI is a function of time in such a scenario. This temporally varying RPD is then transformed into temporally varying modal amplitudes by the second LPG and a subsequent mode stripper leads to temporally shaped probe pulses, which are guided purely in the fundamental mode. Here, we demonstrate a scenario in which three typical pulse shapes (Gaussian-shaped, flat-top and double pulse) could be created and transformed between each other simply by tuning the control pulse energy. We chose a fiber length of \( 0.5\,\hbox{m}\) in combination with an initial delay of \(0.5\,\hbox{ps} \) (\(-\,0.64\,\hbox{ps}\) delay at the output as the control pulses were faster than the probe pulses) and used control pulses with a duration of \( 1\,\hbox{ps}\) and pulse energies ranging from 0 to \( 8\,\hbox{nJ}\). The fiber length was fine-tuned to a dark output without the control pulses being present. By increasing the control pulse energy certain parts of the probe pulses were transmitted, depending on the induced change of RPD, and the temporal pulse shape was continuously varied with the control pulse energy. Figure 4a (MZI model), b (MM-GNLSE) shows the temporal shape of the probe pulses at three different control pulse energies, at which distinct temporal shapes could be observed: a shortened Gaussian-shaped pulse with a duration of \(1\,\hbox{ps} \) (solid, blue line; low control pulse energy), a flat top pulse with a duration of \(1.3\,\hbox{ps} \) (dotted, red line; medium control pulse energy) and a double pulse each with a duration of \( 0.5\,\hbox{ps}\) and a delay of \( 1.5\,\hbox{ps}\) between both peaks (dash-dotted, green line; high control pulse energy). For the sake of comparison, the initial temporal shape of the probe pulses is also shown (dashed, black line). Comparing the results obtained by the MZI model (Fig. 4a) and the MM-GNLSE (Fig. 4b), two distinct differences are visible: In Fig. 4b the flat-top pulse has a slightly longer duration and lower peak intensity and the peaks of the double pulse actually reach higher powers than the initial probe pulse at the respective time points. The more realistic MM-GNLSE simulation revealed that additional higher-order dispersion was imprinted onto the probe pulses, leading to slight stretching of the flat-top pulse and a compression of the double pulse, allowing the pulses to supersede the initial power level at this point of time. Such effects could not be observed within the MZI model as the responsible dispersion- and nonlinear-effects were not included and the output was precisely ’carved-out’ of the original pulse by the second LPG and mode stripper. Despite such differences in the details of the temporal characteristics, the qualitative temporal pulse shape and the necessary control pulse energies were predicted extremely well with the MZI model, making the model well suited to quickly identify the shaping possibilities in different setups.

Fig. 5
figure 5

All-optical temporal compression of probe pulses (\( 2\,\hbox{ps}\)) up to half of their initial duration. The temporal probe pulse shapes calculated using a the MZI model and b an MM-GNLSE simulation, are shown for control pulse energies of \(0\,\hbox{nJ} \) (dashed, blue line) and \( 3.125\,\hbox{nJ}\) (solid, red line). c Probe pulse duration as a function of the control pulse energy, calculated using the MZI model (solid, blue line) and MM-GNLSE (black crosses). A double control pulse setting was used to achieve this compression, with each control pulse carrying the specified pulse energy

Besides creating temporal pulse shapes, it is of central importance in many situations to gain control over the pulse duration. With a two-mode MZI a scenario can be realized in which the leading and trailing flanks of the probe pulses are removed, leading to temporally compressed pulses, whose duration can be tuned by simply tuning the control pulse power while maintaining a nearly constant peak power. We realized such a scenario using two control pulses of \(1\,\hbox{ps} \) duration and initial delays of \(-\,1\,\hbox{ps}\) and \(+\,3\,\hbox{ps}\) to the probe pulses in a fiber with \(1.2\,\hbox{m} \) length. With such delays, the first control pulse overlapped with the leading flank of the probe pulse at the input of the fiber and walked off during propagation as the control pulse was faster than the probe pulse. Therefore, the second control pulse, having no temporal overlap with the probe pulse initially, caught up with the probe pulse and overlapped with the trailing flank of the probe pulse at the output of the fiber. Just like in the previous scenario, the higher-order mode was stripped after the second LPG, but the fiber length was adjusted to maximal transmission with no control pulses present. Thus, with increasing control pulse power the flanks of the probe pulses were converted to the higher-order mode and removed at the mode stripper, effectively shortening the pulses. The resulting temporal shapes of the probe pulses for control pulse energies of \( 0\,\hbox{nJ}\) (dashed, black line) and \( 3.125\,\hbox{nJ}\) (solid, red line) are shown in Fig. 5a calculated by the MZI model and in Fig. 5b simulated using the MM-GNLSE. A slight reduction in peak power could be observed as well as a small, leading satellite pulse at about \( -\,1.5\,\hbox{ps}\). The MM-GNLSE simulation revealed, that this satellite pulse could actually be more efficiently suppressed than predicted by the MZI model. This can be accounted to a slightly larger change of RPD in the front of the probe pulse, as the control pulse walking of to the front was dispersively stretched and, thus, experienced a slightly longer lasting overlap with the front of the probe pulse. Comparable to the first example for temporal shaping, such a difference due to dispersion remained small and the MZI model provided a valid lower limit for the obtained pulse quality, i.e., a clean single pulse without satellite pulses.

The duration of the probe pulses could be tuned continuously and Fig. 5c shows the temporal probe pulse duration as a function of the control pulse energy. The discussed difference between the MZI model and MM-GNLSE was visible as well but, nevertheless, the shortening of the pulses was well approximated by the MZI model.

The probe pulses were shortened to less than half of their original duration (\(0.9\,\hbox{ps} \)) up to a control pulse energy of \( 3.125\,\hbox{nJ} \) and maintained their peak power, in contrast to conventional compression techniques based on dispersion. Nevertheless, in scenarios where only the pulse duration is of interest, the output pulses could be further compressed to a bandwidth-limited duration of \(0.43\,\hbox{ps} \), e.g., using a fiber-Bragg-grating. Further compression in the presented scenario is not possible as a further increase of the control pulse energy would lead to a change of RPD in the pulse flanks exceeding \(2\pi\) and, thus, resulting in a triple-pulse shape. However, different compression ratios could be obtained by changing the control pulse durations and using different delays.

Fig. 6
figure 6

All-optical tuning of the lateral offset of the beam profile at the fiber output, in total up to \(3.6\,\upmu \hbox {m}\). ac Intensity profiles at the fiber end facet for control pulse energies of \( 0\,\hbox{nJ}, 1.75\,\hbox{nJ}, \text {and}\, 2.75\,\hbox{nJ}\). The white circles indicate the FWHM of the graded-index fiber core. d Continuous tuning of the lateral offset as calculated by the MZI model (blue circles) and MM-GNLSE (black crosses), and exhibiting an arctangent-shaped dependence on the control pulse energy (dashed, green line). All distances are given relative to the center of the fiber cross-section

3.3 All-optical spatial and spatio-temporal shaping

The output of the two-mode MZI can be shaped spatially when the higher-order mode is not removed at the output, but the interference pattern between both modes is specifically used. We demonstrate the spatial shaping by an all-optically tuned lateral offset of the fiber output. Such spatial shaping was accomplished with the all-optical switching scenario, but without stripping the higher-order mode (with the MS) at the output and setting the fiber elongation to \(+\,444\,\upmu \hbox {m}\). With increasing control pulse energy a combination of changing modal amplitudes and modal phase difference was obtained at the output which is necessary to obtain a spot with a varying lateral offset: A lateral offset from the center can only be achieved by a superposition of both modes while a centered output can only be achieved with a pure fundamental mode. Figure 6a–c show the resulting spatial intensity patterns at the fiber output for control pulse energies of \(0\,\hbox{nJ}, 1.75\,\hbox{nJ}, \text{and} \,2.75\,\hbox{nJ} \), respectively, calculated from the modal weights and phases obtained from MM-GNLSE simulations. The white dashed circles indicate the full-width half-maximum (FWHM) of the graded-index fiber core. The negative lateral offset of the output with no control pulses present (Fig. 6a) was achieved by carefully selecting the above-described fiber elongation. Figure 6d then shows the lateral offset between the center of the beam (red crosses in Fig. 6a–c) and the center of the fiber as a function of the control pulse energy, demonstrating the continuous tuning of the lateral offset. The results obtained by the MZI model and the MM-GNLSE are depicted by blue circles and black crosses, respectively. At some control energy levels (e.g., \( 0.25\,\hbox{nJ}\) to \(0.5\,\hbox{nJ} \)) the lateral offset appears to make a ’step’, which can be attributed to the spatial discretization of the mode profiles of \(0.2\,\upmu \hbox {m}\). Nevertheless, the lateral offset of the output spot could be well fitted as an arctangent function of the control pulse energy (dashed, green line) and a lateral shift by a distance of \(3.6\,\upmu \hbox {m}\) from \(-\,2.3\,\upmu \hbox {m}\) to \(+\,1.3\,\upmu \hbox {m}\) could be observed. The asymmetry with regard to the fiber center and the additionally varying ellipticity (y-diameter over x-diameter) of the spot itself from 0.82 at \(-\,2.3\,\upmu \hbox {m}\) over 1.00 at \(0\,\upmu \hbox {m}\) to 0.90 at \(1.3\,\upmu \hbox {m}\) can be accounted to the combined change of modal amplitudes and modal phase difference. Using only two transverse modes for spatial shaping led unavoidably to deviations from an ideal Gaussian-shaped beam, but this scenario demonstrated that such deviations could be kept very small. Furthermore, the results obtained by the MM-GNLSE and the MZI model were in good agreement, proving the validity of the MZI model for predicting the lateral offset of the output.

Fig. 7
figure 7

All-optical spatio-temporal shaping of \( 2\,\hbox{ps}\) probe pulses. The probe pulse intensity is shown color-coded as a function of the vertical spatial dimension and the time. The beam profile of the probe pulses switched from an upward shifted spot to a downward shifted spot over the temporal evolution of the pulse. The switching point could be tuned continuously by changing the initial delay \(\varDelta t\) between the control and probe pulses. The probe pulse intensity is shown for three different delays, obtained by calculations using the MZI model (ac) and simulations based on the MM-GNLSE (df)

In the above discussed scenario, the lateral offset of the probe beam was constant over the duration of each pulse. However, using an incomplete passing between the control and probe pulses, similar to Sect. 3.2, the lateral offset could also be varied over the duration of a probe pulse, resulting in spatio-temporally shaped probe pulses. Using a configuration with a fiber length of \( 1.6\,\hbox{m}\), single control pulses with a duration of \( 1\,\hbox{ps}\), a pulse energy of \( 2.7\,\hbox{nJ}\), and an initial delay of \(3.1\,\hbox{ps}\) to the probe pulses we obtained a laterally shifted output spot as discussed above, but the control pulses passed only half of the probe pulses: As the control pulse started off behind the probe pulse but propagated faster, it caught up and overlapped with the trailing half of the probe pulse, but only reached its center until the end of the fiber. Hence, the leading half of the probe pulse remained unchanged with a beam profile as shown in Fig. 6a, while the trailing half looked like Fig. 6c. This scenario can be best visualized by showing the pulse intensity color-coded as a function of the vertical spatial and the temporal dimension. Figure 7a–c show the results obtained from the MZI model for initial delays \(\varDelta t = 4\,\hbox{ps}\), \( 3.1\,\hbox{ps}, \text{and}\, 2.5\,\hbox{ps}\), respectively. The temporal point of switching from the negatively offset spot to the positively offset spot could then be varied continuously by tuning the delay between the control and probe pulses, resulting in a simultaneous tuning of pulse length and pulse energy of the negatively as well as positively offset part of the probe pulses, as the overall temporal pulse shape was maintained. Figure 7d–f show the same scenario but simulated using the MM-GNLSE. A clear difference can be observed: While the MZI model predicts a gradual transition between negative and positive offset, the MM-GNLSE simulations showed that a sharp pulse-internal cut occurred instead.

This sharp temporal feature originated from the control pulses being self-compressed down to \( 73.6\,\hbox{fs}\) (7% of the original pulse duration) up to the end of the fiber. Self-compression of initially bandwidth-limited, short pulses due to a combination of self-phase modulation (SPM) and anomalous group velocity dispersion is a well known effect and plays, e.g., an important role in supercontinuum generation with short pulses [42]. In principle, such self-compression occurred in all scenarios presented in this paper. However, the comparison between MM-GNLSE and MZI model demonstrated, that self-compression had no impact on the two-mode MZI functionality, except for this last scenario of spatio-temporal shaping, which combines short pulses with a long fiber section. The self-amplifying nature of self-compression was the reason for this difference: The control pulse duration decreased exponentially with longer fiber lengths and only after a certain propagation length (and depending on the pulse energy and duration) the self-compression became notable at all, but once it did, the impact was significant with even slightly further propagation.

We verified this conclusion by repeating the above presented simulation using the MM-GNLSE, but with control pulses which experienced normal group velocity dispersion inside the fiber. We achieved this, by simply exchanging the control and probe wavelengths. The previously observed self-compression did not occur and a good agreement with the spatio-temporal shape of the probe pulses predicted by the MZI model was observed. Alternatively, in case the wavelength cannot be chosen freely to match the fiber dispersion in an application scenario, the self-compression could be avoided by introducing a positive chirp to the input control pulses. This should be done using control pulses with a bandwidth-limited duration shorter than \( 1\,\hbox{ps}\), which are stretched to the necessary duration of \(1\,\hbox{ps} \). Then, the strong self-compression could be prohibited with a suitably chosen magnitude of the chirp, and the resulting broadened spectrum and chirp of the control pulses would have no further impact on the behavior of the two-mode MZI as its functionality only depends on the temporal intensity evolution of the control pulses. However, this example demonstrates very well the main limitation of the MZI model and, additionally, such sharp temporal features might be of interest on occasion.

4 Summary and discussion

We presented an optically tunable two-mode Mach–Zehnder interferometer as a versatile structure for spatial and temporal shaping of pulses as well as all-optical switching in an all-fiber setup. Numerical investigations revealed that compared to previous demonstrations an all-optical switch realized with this scheme offers a nearly twofold increase of modulation depth to over 90%. All-optical temporal shaping was demonstrated to obtain Gaussian-shaped, flat-top and double pulses between which could be transformed simply by tuning the control pulse power. Furthermore, direct pulse compression to half of the initial pulse duration could be demonstrated. Even spatial shaping of the probe pulses, which had so far been exclusive to free-space setups could be demonstrated by a translation of the output focus by \(3.6\,\upmu \hbox {m}\). Combining spatial and temporal shaping offers the capability of shaping complex spatio-temporal field patterns, demonstrated by switching the lateral offset of the output beam profile at a continuously tunable time point within the probe pulses.

Further functionality, beyond the discussed examples, can be conveniently explored using the presented MZI model: We demonstrated good agreement with MM-GNLSE simulations and were at the same time able with this model to reduce the computing time necessary to investigate the behavior of a two-mode MZI with a certain parameter set from hours to less than a minute. In fibers exhibiting anomalous dispersion care has to be taken, that the control pulse energy and fiber length stays below a regime where the self-compression of the control pulses results in an observable impact. On the other hand, fibers containing a modal cutoff in the investigated wavelength range can be handled by the MZI model without the risk of unphysical results.

The MZI model reveals that only three fiber parameters are key to the behavior of the two-mode MZI: the modal and chromatic walk-off as well as the effective modal overlap area. Thus, many different types of fiber could be used in a two-mode MZI. The few-mode graded-index fiber used in this study is commercially available and has already been successfully used in experiments investigating intermodal XPM [9, 31]. Furthermore, it enables splicing to standard SMF28 fiber with low loss and low modal crosstalk. On the other hand, the degeneracy of mode polarization as well as mode orientation in this fiber could degrade the functionality of the two-mode MZI in an experiment. As such a degeneracy is not linked to the three relevant parameters, e.g., a step-index or graded-index fiber with an elliptical core geometry could be employed for avoiding such a degeneracy. Elliptical-core step-index fibers have also been used in former experiments on intermodal nonlinear effects [7], but are not readily available with suitable parameters.

For application scenarios, which do not require the high degree of freedom provided by free-space shaping setups, the two-mode MZI can be a valuable alternative as it reduces losses in the system and enables effortless delivery of the shaped pulses to a target location. Such advantages are accompanied by significantly reduced switching times between different output states: SLMs are typically limited to about \(150\,\hbox{ms} \) refresh time while the two-mode MZI can be tuned in the range of tens of nanoseconds as the control pulse energy could be tuned using an acousto-optic modulator.

Furthermore, the ability to spatio-temporally shape the light inside a fiber could be beneficial for a wide variety of fiber applications. For instance, sensing applications could benefit from the two-mode MZI as light inside the fiber can be conveniently shaped and, therefore, also the evanescent field of a subsequent side-polished or tapered fiber. Moreover, the spatial shaping capability could enable a spatial degree of freedom in lab-on-a-tip applications [13] and allow to remotely shape the light at locations which might not be externally accessible, e.g., in-situ measurements in medical or biological settings.

If the boundary conditions of an experimental setup should not allow the use of control and probe pulses at two clearly separated wavelengths, the two-mode MZI and its functionality discussed in this publication could alternatively be realized with control and probe pulses centered at the same wavelength, but with orthogonal polarizations. We numerically verified that such a simplification of the light source requirements is possible, but only at the cost of a significantly more complex fiber design: a birefringent few-mode graded-index fiber would have to be designed and realized, in order to obtain the necessary small modal group walk-off in combination with a sufficiently large control-to-probe group walk-off. Additionally, as XPM between orthogonally polarized pulses is three times weaker compared to parallel polarized pulses [34], three times larger control pulse energies would be necessary.

For future fundamental investigations of this scheme, it will be of vital interest whether a way can be found to transfer the obtained insights to highly multimode systems, where the so-called principle modes [43] are more suitable to describe the spatial field distributions than the usual eigenmodes of the fiber. Obtaining in-fiber spatial shaping in such systems and rendering spatial shaping via SLMs unnecessary would be a major step towards their out-of-lab applicability.