Deep learning–based vortex decomposition and switching based on fiber vector eigenmodes

: Structured optical ﬁelds, such as cylindrical vector (CV) and orbital angular momentum (OAM) modes, have attracted considerable attention due to their polarization singularities and helical phase wavefront structure. However, one of the most critical challenges is still the intelligent generation or precise control of these modes. Here, we demonstrate the ﬁrst simulation and experimental realization of decomposing the CV and OAM modes by reconstructing the multi-view images of projected intensity distribution. Assisted by the deep learning–based stochastic parallel gradient descent (SPGD) algorithm, the modal coef-ﬁcients and optical ﬁeld distributions can be retrieved in 1.32 s within an average error of 0.416 % showing high efficiency and accuracy. Especially, the interference pattern and quarter-wave plate are exploited to conﬁrm the phase and distinguish elliptical or circular polarization direction, respectively. The generated donut modes are experimen-*


Introduction
Cylindrical vector (CV) and optical vortex beams with orbital angular momentum (OAM) have received widespread attention from many researchers due to their unique polarization and phase singularity [1][2][3].Driven by the potential applications of CV beams in laser machining [4], super-resolution microscopy [5,6], data storage [7] and sensing [8,9], etc., active methods of generating a single CV or OAM field with high purity have become preferred in the experiment.One popular method among these techniques is based on the free-space optical components, including Q-plates [10,11], spatial light modulators (SLMs) [12], and spiral phase plates [13], which always require high-precise optic alignment to generate a single CV or OAM beam.As an example, the input light polarization relative to its fast axis using the Q-plates is strictly chosen for azimuthally or radially polarized beams.By comparison, another is to deliver CV or OAM modes based on the vector eigenmodes in the fibers by using all-fiber mode converters, such as long period gratings (including helical gratings) [14][15][16][17][18][19][20][21][22][23] and mode selective couplers (MSCs) [24][25][26][27][28][29], a single high-order linearly polarized (LP) mode can be converted from the fundamental mode (LP 01 ), but easily influenced by the amplitudes and phase difference due to slightly different propagation constants of degenerated CV modes in the step-index fibers.Actually, the electrical fields of high-order modes (HOMs) consist of linear superposition of CV modes, such as the LP m1 mode (m ≥ 1), which have been understood well and exploited to decompose four-fold degenerated vector eigenmodes with different polarization distributions.
The LP or circularly polarized (CP) OAM modes in the fibers can also be formulated by means of coherent superposition of these vector eigenmode bases.As far as we know, there is still a challenge to obtain a single CV or OAM mode with a high purity both in the free space or fiber waveguide.Early, Shapira et al. [30] presented a noninterfering approach to achieve complete mode decomposition (MD) for light fields in the optical waveguide.In 2020, Mao et al. [31] reported an interference method to calculate the proportions of degenerated modes, which considered all possible modes in multimode fibers.Recently, Borhani et al. [32] recovered the phase of the input image by training the deep neural networks.Wang et al. [33] achieved the intelligent recognition of different OAM mode bases in the ring-core fiber by the deep learning technique, and the recognition rate is close to 93.3 %.It is noted that deep learning techniques, particularly convolutional neural network (CNN) algorithm, have performed MD of LP modes in optical fibers and stand out for global search ability and excellent real-time performance [34][35][36][37].The MD of the LP modes are achieved by reconstructing the mode intensity, and the average correlation is 0.9912 [38].The CNN-based optimized algorithm is also used to design ultra-compact silicon photonic devices with less training data [39].In addition, some techniques for single-shot measuring vector modes have been proposed based on metasurfaces, such as single spin-decoupled metasurface and polarizationsensitive dielectric metalens.The vortex can be recognized by using a single azimuthal-quadratic phase metasurfacebased photonic momentum transformation [40].Imaging polarimetry is widely used for precise measurement of any polarized light using a crosstalk-free broadband achromatic full Stokes method [41].An angular superoscillatory metalens is utilized for determining the OAM spectrum based on precalibrated mapping relationship [42].On the other side, the stochastic parallel gradient descent (SPGD) algorithm with fast convergence ability and low measurement requirements has been extensively utilized for the MD of diverse spatially scalar LP modes in practical experiments [43], where the correlation function reaches 0.995 with time of 0.7 s [44].Previously, the MD of the LP modes was researched widely by reconstructing single intensity distribution.However, precisely decomposing degenerated CV and OAM modes in the fiber has rarely been investigated in view of their polarization and phase distributions, simultaneously.Therefore, two crucial issues are raised, that is, the accurate measuring proportions and intelligent controlling of spatially varying CV or OAM modes, which play a pivotal role in improving the efficiency of mode control and optimizing the polarization properties of generated donut beams.Since CV and OAM beams are characterized by spatially varying polarization and phase distribution, it is of great importance to propose a vector-eigenmode decomposition method for recovering the optical field and retrieving the proportions of each group of CV and OAM modes.
Generally, CV and OAM modes as two degenerated mode bases in the fibers hold a transformation relation.Previous researches have revealed that a single CP-OAM mode is composed of two CV modes and a single LP-OAM mode consists of four CV modes.Moreover, the complete transformation relation of arbitrary high-order modes has also been derived, which can even provide a new perspective for the expression of the most generally elliptical polarized OAM modes [45,46].In this case, an unidentified mode can also be expressed in OAM mode bases when the corresponding modal coefficients of CV modes are obtained by the MD of the degenerated CV modes, which has not been reported.Intuitively, a new hybrid first-order Poincaré sphere (PS) [47] may be constructed and introduce an extra dimension to describe spatial modes with arbitrary proportions in that two groups of the CV or OAM modes are located on two first-order PSs, respectively.So far, traditional fibersqueezing devices are used to change the proportions and polarizations of the spatial modes in fibers, which is difficult to generate desired and switchable polarization states due to manual error.Here, the electrically driven polarization controller (EPC) is utilized to achieve a qualitative control of the CV or OAM beams, which would be immensely useful for intelligent polarization search of donut beams.
In this paper, we successfully and precisely recovered the complex amplitudes of degenerated modes (CV, LP-OAM, and CP-OAM) by reconstructing a multi-view image due to the polarization degeneracy of the degenerated spatial modes.Based on the deep learning-based SPGD algorithm, the decomposed results can be obtained within 1.32 s and the average error of modal coefficients is nearly 0.416 %.It is worth noting that evitable phase ambiguity caused by the SPGD algorithm may result in different modal proportions in OAM mode bases.However, the interference patterns are exploited to verify the phase distribution, which can also be determined by checking the direction of elliptical polarization.Furthermore, it is of paramount importance to distinguish the circular polarization direction when a single CP-OAM mode is considered.The experimentally generated donut beams are decomposed in the CV, LP-OAM, and CP-OAM mode bases, indicating that CV modes with purity of 99.5 % are realized.Employing the input voltages of the EPC, the CV modes are selected at a speed of 4 s.Therefore, fast vortex mode switching can be achieved from different inputs of CV modes passing through wave plates with fixed angles.It is believed that the proposed approach of decomposing and switching CV and OAM modes may facilitate applications of singular CV or OAM beam in fields, such as laser beam characterization, dipole orientation of single-photon sources for quantum optical communication, and fiber-optic communication exploiting multiple spatial modes.

Principle of MD for degenerated fiber vector eigenmodes
Most optical fibers for practical applications are guiding light in the weakly guiding limit of Δ = (n 1 − n 2 )/n 2 << 1, Δ is the relative index difference between the core (n 1 ) and the cladding (n 2 ).The number of guided modes in the fiber is dependent on the physical dimensions of the core/cladding regions, refractive index, and light wavelength.The guiding electric fields in fibers can be described as the eigen-solutions of the , EH even∕odd m−1,1 for higher-order LP mn (m > 1, n = 1).All LP modes can be constructed from linear combinations of different basic fiber modes.
Generally, the spatial mode field from the few-mode fiber (FMF) can be decomposed as the four degenerated CV modes with arbitrary complex amplitudes assuming a single LP mn mode dominated in the fiber.To retrieve the modal coefficients of the four degenerated CV eigenmodes, the original and reconstructed near-field light fields should be compared from both spatially variant polarization and intensity distributions.Thus, the modal field distributions of a single LP mn mode in the fiber can be expressed as (m ≥ 1, n = 1): where  k and  k are the corresponding modal amplitude and phase of four CV eigenmodes (HE ).
E k is their normalized electric fields.Here,  1 is set to 0 as a phase reference.Thus, the corresponding modal weight  2 k can be obtained with the given normalized condition of ∑ 4 1  2 k = 1 and relative phase  k (k = 2,3,4) can be calculated.
Furthermore, the theoretical model of the first-order PSs intuitively reveals all polarization states and mode profiles to generate arbitrary CV beams.Each point on the PSs can be described by the Stokes parameters through a QWP and a polarizer, which is expressed by the following equations [47]: where I 0 According to the theoretical derivation of Eq. ( 2), it can be found that the modal fields of any CV mode can be obtained by calculating the intensity distributions at  = 0 • , 45 • , 90 • , and −45 • .The MD schematic of CV modes is shown in Figure 1.The output modal patterns from the fiber are imaged to a charge-coupled device (CCD) camera through a 4f system and projected at the polarization angles of four by rotating the polarizer.Specifically, four grayscale images, as multiple perspectives, are reshaped into a multiview image for training the CNN model.It is noted that the expressed in CV mode bases can be predicted with a small margin of error.The SPGD algorithm can be divided into five parts: initializing the variables, generating perturbations, reconstructing the patterns, evaluating the merit function, and updating the variables.Here, the initial variables ( i and  i ) for the SPGD algorithm are replaced by the output vector from the CNN to shorten the time of exploring exact modal weights ( o ) and relative phases ( o ).

Deep learning-based SPGD algorithm
In order to decompose four CV modes accurately, the pretrained VGG-16 model is firstly adapted by using the multiview images.The CNN model is mainly divided into three layers, such as convolution layers, the max pooling layers, and the fully connected layers.More details of the CNN model were described in ref. [38] for CV modes).In a word, the output vector size is equal to the label size.Modal weights and relative phases of CV modes are used for the label vector.Besides, the softmax and classification layers are replaced by the sigmoid and regression layers for achieving the regression, respectively.
The validation loss function is utilized to estimate the degree of consistency between the predicted and real modal coefficients, which is expressed by the mean-square error (MSE) as: where y i,o and y i,p represent the original and predicted label vector, which consists of the modal weights and phases.M is the batch-size and is set as 10 for training all the training data.Here, Adam optimizer with the initial learning rate of 5 × 10 −5 is exploited.In addition, the learning rate is renewed by using the cosine annealing learning rate every 20 epochs where the minimum learning rate is set to 10 −5 .The validation loss curve in Figure 2(a) indicates that training process of can converge after 88 epochs, which suggests that the feature of the multi-view images can be learned well with low loss and fast converge speed.The essence of the deep learning-based SPGD algorithm is to minimize the polarization projected difference between the reconstructed electric field (I re ) and the presupposed one (I pre ), which has higher computational precision and can be utilized for solving the optimization constraints.The iteration process of the deep learning-based SPGD algorithm is briefly described as follows: (1)   It is worth noting that compared to the residual intensity, J has lower noise sensitivity, which can be adopted as an important evaluation criterion for MD.When I pre = I re is satisfied, the predicted ( o and  o ) and the original modal coefficients are equal in the ideal case.To exhibit the excellent performance of the deep learning-based SPGD algorithm, firstly, the average merit function for decomposing the CV modes by using these two algorithms based on 100 times are described in Figure 2(b).It can be found that the average merit function J of the MD by using these two algorithms are 0.997 and 0.999, respectively.It can be found that the efficiency for obtaining the accurate results is higher by the deep learning-based SPGD algorithm.Secondly, the average errors of the modal weight (∆ = | 2 pre −  2  re |) and relative phase (∆ = || pre | − | re ||/2) by using these two algorithms can be obtained.The average errors reach 0.608 % and 0.416 % based on 100 times iteration using the CNN-based SPGD algorithm within 1.32 s, respectively.It is worth noting that the error of modal coefficients can reach 0.004 % in one time iteration.However, two mean errors by the SPGD algorithm are 6.585 % and 10.69 %.In a word, the CNN can indeed enhance the ability to explore the optimization solutions.It can be concluded that our proposed scheme not only can shorten the calculation time but also can obtain more precise decomposed results, which paves the way toward the real-time and batch processing.

Decomposing CV and OAM modes enabled by deep learning
Here, we have demonstrated that the modal weights and phases in the CV modes with any proportions can be confirmed by the deep learning-based SPGD algorithm.In order not to lose the generality, one typical MD case of a mixed CV mode is presented in Figure 3.The simulated total intensity distribution and four polarization projection patterns of the presupposed and reconstructed beams are illustrated in Figure 3 to the given ones, which are consistent with the field distributions and the theoretical analysis.
It should be noted that the CV modes with the same modal weights but opposite phases have equal polarized intensity distributions because there exists the inevitable phase ambiguity.The noteworthy thing is that the predicted modal phases here are the absolute values relative to the phase of the first mode (TM 01 ).That is to say, there exist two possible mixed CV modes located on the southern and northern hemispheres of the hybrid first-order PS with same S 1 , S 2 but opposite S 3 .
The helical phase of OAM modes is an important feature, which also plays an essential role in the modal weight and phase of CV modes.The interference pattern is typically needed to further confirm the phase information.Therefore, the modal coefficients expressed in OAM mode bases can also be predicted well with the additional interference patterns.Many studies have found the transformation relation among CV modes, LP-OAM (xOAM ±1 , yOAM ±1 ) and CP-OAM ( ± OAM ±1 ) modes, which has been described in ref. [45,46]. − and  + represent the left-handed and righthanded circular polarization, and x and y are horizontal and vertical linear polarization, respectively.It can be found that two coefficient matrices are nonsingular.Here, column vectors are arbitrary complex vectors expressed in OAM and CV mode bases.In a word, there is only one group of LP-OAM or CP-OAM modes corresponding with any weighted CV modes, and vice versa.For the elliptical polarization, there could exist two set of modal phases in the CV mode bases, which is opposite of each other with the same modal weights.In this case, two groups of modal coefficients expressed in OAM mode bases could also be obtained.Thus, by observing the interference fringe, the exact phases can be determined further, which is beneficial to ensure the modal weights of OAM modes and the exact phase in the CV and OAM mode bases.
Firstly, the decomposition results of a single LP-OAM mode are introduced as shown in Figure 4(a1)-(a4).Note that the reconstructed beam patterns match well with the presupposed ones almost at every polarization, which indicates the high accuracy of the MD method and also implies the feature of a single xOAM.Moreover, the OAM beams are also interfered with a referenced spherical Gaussian beam in order to confirm the feature of helical phase structure.Comparing the interference patterns, xOAM −1 mode with a clockwise vortex shape is selected as shown in Figure 4(a1), which is the same as the presupposed ones.Hence, a single xOAM −1 mode can be determined from its weight prediction as shown in Figure 4(a3), which agrees well with the presupposed beam patterns.Figure 4(a2) shows that the modal weights for predicting four CV modes are the same.
Furthermore, there exists a ±∕2 time delay of HE odd 21 and TE 01 , respectively.At the meantime, we can obtain  − OAM −1 and  + OAM −1 with the same proportion in Figure 4(a4).It represents that the xOAM −1 can be obtained through equal superposition of left-handed ( − ) and right-handed ( + ) CP-OAM modes with the same to topological charge (TC) of −1.In the same way, yOAM −1 can also be obtained by superposing two  ± OAM −1 modes.
Secondly, the phase ambiguity of two mixed OAM modes can also be identified through the interference as shown in Figure 4(b1)-(b4) and (c1)-(c4).The total mode intensity and its four polarized distributions are the same but five interference patterns are slightly different.Taking 90 • polarized intensities as an example, Figure 4(b1) and (c1) clearly show the counter-clockwise and clockwise vortex-liked patterns, respectively.From Figure 4(b2) and (c2), the modal weights expressed in CV mode bases are the same while the phases are opposite.Nevertheless, in the LP-OAM mode bases, there exist two different proportions in weights and phases as shown in Figure 4(b3) and (c3).To be specific, the modal weights are just exchanged, and the phases of the last two modes remain different, which can be derived from the transformation matrices.When the CV modes with opposite phases are predicted, ±i in the transformation matrix is understood to swap the weights of xOAM −1 , xOAM +1 and yOAM −1 , yOAM +1 , which further leads to different phases in the OAM mode bases.The combination of LP-OAM modes in Figure 3(b3) indicates that the OAM mode with TC of +1 occupies a larger proportion, which is consistent with the interference patterns.However, the superposition result in Figure 4(c3) shows the proportion in OAM modes with TC of −1 is larger, which can be reflected in Figure 4(c1).By the same token, we can get the same conclusions in CP-OAM modes as shown in Figure 4(b4) and (c4).These results demonstrate that opposite phases of CV modes can affect the proportions of OAM modes, although the polarized intensity patterns are the same.Therefore, the interference patterns should be beneficial and are of great importance to confirm the modal weights and phase of the OAM modes.Except the interference, the direction of elliptical polarization can also be utilized to determine the phase expressed in OAM mode bases by using the QWP.
Especially, for a single CP-OAM mode, it can be found that there is no intensity discrepancy among the four polarized donut beams.Another ambiguity of lefthanded and right-handed polarization needs to be separated before using four polarized intensity patterns of the MD method.As discussed above, a single LP-OAM mode can be decomposed well by referencing the interference patterns.Since the QWP can provide a phase shift, the CP-OAM modes can be transformed into LP-OAM modes.Passing through a QWP whose optical axis coincides with the y-axis,  − OAM −1 mode is transformed into a −45 • LP-OAM −1 mode while  + OAM +1 is converted to a 45 • LP-OAM +1 mode.As for the −45 • LP-OAM −1 mode, the brightest beam pattern appears at −45 • (I Lcp ), the darkest one at 45 • (I Rcp ), and medium ones at the other two angles of the polarizer.That is to say, S 3 is equal to −1, and S 1 , S 2 = 0. Therefore, the  − OAM −1 mode on the south pole of the −1st-order PS can be selected.Afterward, we can acquire the modal coefficients expressed in CV and LP-OAM modes.It can be found that xOAM −1 + iyOAM −1 =  − OAM −1 .On the contrary, ixOAM +1 + yOAM +1 =  + OAM +1 can be obtained.
Therefore, a single CP-OAM mode can also be decomposed by transforming it into an LP-OAM mode with a QWP.
To conclude, we can acquire the exact modal weights of CV modes on the equator of the PS based on four polarized intensities, and the corresponding modal coefficients expressed in LP-OAM or CP-OAM mode bases can also be obtained through the matrices.As for the mixed CV modes on the hemispheres of the PS, the proportions in the three mode bases can be confirmed with additional detecting of the interference or direction of elliptical polarization.The two detections are both needed when one CP-OAM mode exists.In reality, the MD of OAM modes can be directly achieved by replacing the E k in Eq. ( 1) with the Jones vectors of the OAM modes.More importantly, employing the matrices, the polarization relation among CV, LP-OAM and CP-OAM modes can be deduced and understood more easily from the perspective of the mode proportion.

Pattern recognition of CV and OAM modes
The schematic of the experimental setup is illustrated in single-mode fiber (SMF) and an FMF is shown as the inset in Figure 6(a).To match their propagating constants, the diameters of two fibers in the fused region need to be appropriately chosen.The core diameter of the step-index FMF is 19.2 μm for propagating the HOMs.The detailed coupling principle and fiber parameters of the MSCs have been introduced in ref. [28].Briefly, different order LP modes with any coupled ratio by the MSCs have been obtained by a two-step process, i.e., pretapering the SMF to adjust its diameters and fusing together with the FMF to optimize the output high-order LP modes.
The measured transmission spectra of the MSCs delivering LP 11 mode working at the central wavelength of 532 nm and 660 nm are shown in Figure 6(a) and (b), respectively.The dips of the spectra indicate that the mode conversion efficiency is over 15 dB (∼97 %) and the measured 3 dB bandwidth is over 10 nm.By carefully adjusting the pressure and torsion angle of the PC clamped to the FMF, the degeneracy of LP 11 mode is eliminated so that the desired vector modes can be excited.The polarization characteristics of CV beams at the wavelength of 532 nm and 660 nm are shown in Figure 6(c) and (d).The first column is the near-field of CV beams without the polarizer, and the later four columns are the intensity distributions along with the rotating direction (0 • , −45 • , 90 • , and 45 • , marked by the bidirectional arrow) of the linear polarizer.
As depicted in Figure 5, a laser source at the wavelength of 660 nm is launched into an MSC with the output power ratio of 90:10, where two arms are used to be a high-order mode and reference beam for vortex interference.Here, higher-order modes than LP 11 mode in the FMF can be ignored due to the high purity of the MSC, which indicates that the first-order CV or OAM mode is mainly considered for the MD experimentally.The 90 % port of the FMF is connected to an in-line all-fiber EPC (EPC-400, OZ Optics), which is utilized to redistribute four degenerated vector eigenmodes of LP 11 mode propagating in the fiber by changing their relative amplitudes and phases by means of stress-induced birefringence [48].The EPC employing the mechanically squeezing technique is controlled through four-channel input DC voltages by varying over a ±5 V range, which enables over 25 N force applied to the fiber to introduce sufficient birefringence and phase changing the polarization over 360 • in scale.Therefore, any desired output polarization on the first-order PSs can be achieved through the EPC.A focal lens (denoting a 4-f imaging system mentioned above) is placed closely after the EPC output and utilized to collimate the output beams.After passing through a nonpolarization beam splitter (BS), the beam is divided into two branches for the purpose of the MD and vortex switching process.A rotatable linear polarizer is set to 0 • , 45 • , 90 • , and −45 • , respectively, and the intensity patterns at four corresponding polarization angles are recorded by a CCD (400-1100 nm, Ophir-Spiricon).Four projected polarization patterns are arrayed to be a multi-view image before sending to the deep learning-based SPGD algorithm for the MD procedure.The searching time for the accurate global optimization values can be 1.32 s as previously mentioned, exhibiting much better real-time performance than the SPGD algorithm.
The measured intensity patterns and decomposed results of TE 01 , HE odd 21 , TM 01 -TE 01 , and a hybrid vector mode by the proposed algorithm are illustrated in Figure 7(a)-(d), respectively.It is found that four measured polarized beam profiles have great consistency with the reconstructed ones.Additionally, the predicted modal weights of TE 01 and HE odd 21 modes are over 99 % as described in Figure 7(a1, a2) and (b1, b2), indicating the generation of a single CV beam with high purity.Moreover, according to the transformation relations between CV and OAM modes, a single CV mode separated as four LP-OAMs or two CP-OAMs is presented and decomposed with high accuracy, as predicted in Figure 7(a3, a4) and (b3, b4).It can be seen that TE 01 and HE odd  21 modes are composed of four LP-OAM modes with almost the same amplitudes but exactly opposite phases in Figure 7(a3) and (b3).It should be highlighted that those CV states located on the ±1st-order PSs can be seen as the superposition of two orthogonal  + OAM −1 ,  − OAM +1 and  − OAM −1 ,  + OAM +1 , respectively.Besides, TE 01 mode is located on +1st-order PS, while HE odd 21 mode on −1st-order PS.Consequently, these two CV modes can be expressed in the CP-OAM modes as shown in Figure 7(a4) and (b4).The predicted weights and phases are consistent with those from the theory.As for the hybrid TM 01 and TE 01 modes as shown in Figure 7(c) and (d), the predicted modal weights of TM 01 and TE 01 modes are 0.675 and 0.292 with a phase difference of .The corresponding expressions under LP-OAM and CP-OAM mode bases are described in Figure 7(c3) and (c4).Another hybrid CV mode can be expressed in CV and OAM mode bases as shown in Figure 7(d2)-(d4), where TE 01 mode accounts for a large proportion (∼84.6 %).From the beam patterns in Figure 7(d1), it can also be found that the polarization of the hybrid mode is close to TE 01 mode, but their weights and phase are clearly distinguished.It is worth noting that some measured CV modes are on the equator of the PS, which suggests that phase ambiguity in corresponding CV modes is not considered.
It is noted from the results of Figure 7 that projected polarization intensities are accurately predicted with measured ones by using the multi-view images in the algorithm, but the reconstructed mode patterns may present slightly inconsistent due to the following reasons: (1) the projected mode intensity using CCD acquisition is limited by its intensity pixels and measured resolution; (2) the presence of other LP modes in the fibers may also add the intensity perturbation; and (3) the CNN model for predicting CV mode is trained by the simulated data rather than experimental data.The prediction accuracy can be greatly improved considering these reasons in the future work.In general, the predicted coefficients expressed in CV and OAM mode bases are self-consistent with the measured beam patterns.Consequently, the modal decomposition of CV and OAM modes based on our scheme remains a high prediction performance in the actual experiments.

Fast vortex mode switching
The field control module shown in Figure 5 is used to generate specific CV beams and achieve different vortex switching.Currently, driving an EPC by programming the applying voltages is to change the mode output from the MSC.Since the EPC has four channels to change the voltages, we set the time interval between different voltage groups as 4 s.Actually, the interval can be shorter because the EPC can The intensity profiles and polarization states under the invariant voltages are almost identical, indicating the high robustness and memorability of the EPC.In addition, the switching interval can be shorter, which demonstrates that fast and accurate CV mode switching certainly provides great potential in programmable optical sources.
Meanwhile, it is known that CV modes with arbitrary order l can be considered as a linear combination of two CP-OAMs with opposite TC (l ≥ 1).Moreover, four CV modes consist of two CP-OAMs with opposite TCs.The QWP can provide a phase shift and turn the circular polarization into linear polarization as pointed out above.Thus, a single CV mode can be transformed into LP-OAM ±1 in two projection positions through the QWP with a specific angle.Then the polarizer can select two LP-OAM modes at two orthogonal angles, respectively.The fast axis angle relative to the x-axis of the QWP is  1 and the transmission angle to the x-axis of the polarizer is  2 .The Jones matrices of the QWP and the polarizer can be represented by H QWP (  1 ) and ) , respectively.The detailed equations have been described in ref. [49,50].The Jones matrix of the combined QWP and the polarizer can be written as H S ( 1 ,  2 ).Here, we take l = 1 as an example.When four special CV modes are used as the inputs, we can theoretically calculate four output OAM modes, which are expressed as where F 11 (r) represents the radial field distribution, and k is a constant.It is worth noting that the CV modes here are generalized, that is, some mixed CV beams including TM 01 ± TE 01 and HE even 21 ± HE odd 21 modes can get the similar results.Based on the analysis above, the vortex mode switching at the wavelength of 532 nm using a QWP and a polarizer is achieved.The experimental results agree well with the simulations as illustrated in Figure 8 Considering the previous simulation MD results of LP-OAM modes, it is known that the purity of the produced LP-OAMs can also be calculated by further recording four polarized beam patterns and the interference patterns.Therefore, fast and accurate mode control of CV and LP-OAM modes by using the programmable EPC provide a reliable and switchable donut light source, which can be applied in stimulated emission depletion microscopy (STED) [51] and superresolution lithography [52].

Conclusions
In summary, we have presented and demonstrated the accurate MD of the CV and OAM modes based on a multi-view image for the polarization and mode degeneracy.By using the deep learning-based SPGD algorithm, the modal coefficients in simulation can be predicted with the average modal coefficient error of 0.416 %, and the time can be as short as 1.32 s, representing high calculation accuracy and efficiency.Due to the phase ambiguity of the SPGD algorithm, a set of intensity distributions may correspond to two sets of modal coefficients expressed in CV mode bases, where modal weights are the same but the phase is opposite to each other.Afterward, it can lead to different modal weights and phases in the OAM mode bases.Thus, the interference patterns are measured to determine the phase expressed in CV mode bases.In reality, distinguishing the direction of elliptical polarization is also beneficial to confirm the modal phase by using the QWP.Especially, for a single CP-OAM mode, the ambiguity of phase and circular polarization should be identified simultaneously.In the actual experiment, the generated beams have been accurately decomposed in the CV, LP-OAM, and CP-OAM mode bases with the highest purity of 99.5 % in CV modes, indicating high feasibility of the MD.By varying the optimized voltages of the EPC with high speed response and precise control, the CV modes with high purity have been experimentally generated and modulated every 4 s.
Through invariant wave plates, switching the vortex modes has also been achieved, which offers a new method for manipulating vortex modes.As a result, a hybrid first-order PS may be constructed to describe the relationship among these three mode bases from the perspective of modal proportions.More importantly, it is expected to realize the intelligent generation of CV or OAM beams by measuring the exact proportions of the CV or OAM modes with programming and relevant intelligent techniques.It is believed that our works will provide a novel perspective on structure field analysis, easily modal control, and remote sensing.
. In the training process, 40,000 beam patterns expressed in CV mode bases with the resolution of 128 × 128 are generated with random label coefficients.Through calculating polarization projected images by use of a rotating polarizer, corresponding 40,000 multi-view images data with the resolution of 256 × 256 are reshaped, as shown in Figure 1.Around 80 % of the beam patterns is exploited as the training data for training the model, 10 % of which is used for validating the performance of the model during the training period.The remaining 10 % is employed as the testing data to generate the initial modal coefficients for the subsequent SPGD algorithm.Since the input training image is a one-channel image data, the filter size of the first convolution layer is changed from 3 × 3 × 3 to 3 × 3 × 1.The dimension of the output vector of the last fully connected layer is modified to 2N − 1, where N is the number of modes (here, N = 4

Figure 2 :( 4 )
Figure 2: Performance for decomposing CV modes based on VGG-16.(a) The validation loss for the CV mode using VGG-16.(b) The merit function curve (fine) and the average curve (thick) based on 100 times by using two algorithms.

Figure 3 :
Figure 3: One typical decomposition result of CV modes by the deep learning-based SPGD algorithm.(a) The presupposed and reconstructed beam intensities of a hybrid CV mode, and residual intensities are shown for comparison by the deep learning-based algorithm.The angle of the polarizer is marked by the bidirectional arrow.(b) The corresponding given and predicted modal coefficients.Pre.: presupposed patterns.Rec.: reconstructed patterns.Res.: residual patterns.

Figure 4 :
Figure 4: Three typical reconstructed intensity distributions and predicted modal coefficients by the deep learning-based SPGD algorithm, and the presupposed intensities and given modal coefficients are represented for comparison.(a1)-(a4): a single xOAM −1 mode; (b1)-(b4) and (c1)-(c4) are two hybrid OAM modes with same intensity distributions but different interference patterns.Pre.: presupposed patterns.Rec.: reconstructed patterns.Inter.: interference patterns.The angle of the polarizer is marked by the bidirectional arrow.

Figure 5 ,Figure 6 :
Figure 6: The schematic and characterization of MSCs.(a) The measured transmission spectra of the MSC at 532 nm; the inset represents the schematic of the MSC composed of an SMF and FMF.(b) The measured transmission spectra of the MSC at 660 nm.Polarization characteristic of CV beams (TM 01 , TE 01 , HE even 21 , and HE odd 21 ) excited by MSCs at (c) 532 nm and (d) 660 nm.

Figure 5 :
Figure 5: Experimental setup to decompose four degenerated modes and achieve dynamic mode switching between vortex and CV modes.MSC, mode selective coupler; EPC, electrically driven polarization controller; Lens, focal lens system; BS, nonpolarization beam splitter; Pol, linear polarizer; CCD, charge-coupled device; QWP, quarter-wave plate; PC, personal computer.

Figure 8 :
Figure 8: Vortex mode switching based on CV modes.(a) The dynamic transverse mode switching (above) and polarization distributions (below) of HE even

21 +
(b)-(e).The previous generated CV beams by adjusting the EPC, TE 01 , and HE even HE odd 21 are used as the inputs to achieve the vortex switching.When the QWP is parallel to the optical axis of the polarizer, the transmitted patterns are consistent with CV beams through one polarizer.When the angular difference is changed to ±45 • , the donut beams appear and their interference profiles exhibit right-handed and left-handed helixes, which suggests that two OAMs with opposite TCs have been selected.It is noted that the TE 01 mode is composed of  + OAM −1 and  − OAM +1 mode while HE even 21 + HE odd 21 mode consists of  + OAM +1 and  − OAM −1 .However, the polarization states of generated LP-OAMs with opposite TCs are oriented as the direction of ±45 • LP.In addition, TE 01 mode can be converted into OAM ∓1 and HE even 21 + HE odd 21 mode can be transformed into OAM ±1 when  2 is ±45 • .
• , I 45 • , I 90 • , and I −45 • stand for the light intensities through a polarizer at the corresponding angles.I Rcp and I Lcp denote the intensities of light by using a QWP at 45 • [31]−45•, respectively, and S 0 is the intensity distribution out of the FMF.TM 01 , TE 01 , HE even 21 , and HE odd 21 modes are located on the equator of the ±1st-order PSs, which suggests that the polarization state of any superimposed CV modes can be characterized by S 1 and S 2 with S 3 = 0. Therefore, the mode field with the group base of CV eigenmodes in arbitrary proportion can be derived for the four projected polarization intensities through a linear polarizer, which at the specific polarization  can be expressed as[31] the rough globally optimized values ( i