Vectorial adaptive optics

Adaptive optics normally concerns the feedback correction of phase aberrations. Such correction has been of benefit in various optical systems, with applications ranging in scale from astronomical telescopes to super-resolution microscopes. Here we extend this powerful tool into the vectorial domain, encompassing higher-dimensional feedback correction of both polarisation and phase. This technique is termed vectorial adaptive optics (V-AO). We show that V-AO can be implemented using sensor feedback, indirectly using sensorless AO, or in hybrid form combining aspects of both. We validate improvements in both vector field state and the focal quality of an optical system, through correction for commonplace vectorial aberration sources, ranging from objective lenses to biological samples. This technique pushes the boundaries of traditional scalar beam shaping by providing feedback control of extra vectorial degrees of freedom. This paves the way for next generation AO functionality by manipulating the complex vectorial field.


Introduction
Phase aberrations affect the performance of many optical systems.Adaptive optics (AO) is widely used to perform feedback correction of these aberrations in a range of applications, from the inter-galactic scale of astronomical telescopes [1] to the molecular level in super-resolution microscopy [2,3].However, in many systems, polarisation aberrations play an even more crucial role.These aberrations lead to polarisation errors and extra (dynamic and geometric) phase distortion (see Supplementary Note 1) that can be introduced, for example, when focusing through stressed optical elements, due to Fresnel's effects or induced via polarising effects in materials or biological tissues [4][5][6][7].These effects directly alter the state of polarisation (SOP) of the light field and the focal quality, hence affecting vectorial information analysis and degrading the system resolution in ways that compound the effects of phase aberrations.Considered jointly as "vectorial aberrations" (see Fig. 1a), these polarisation and phase errors limit the performance of many vector sensitive or highresolution optical systems.
Incorrect vector states in the illumination or detection beams are greatly detrimental for polarisation sensitive microscopes, including Stokes/Mueller confocal microscopes [7], second/third harmonic generation microscopes [8] and superresolution fluorescence polarisation microscopy [9].Such effects are vital, for example, to provide correct vectorial information in label-free cancer detection using Stokes/Mueller microscopy.Incorrect polarisation states also disrupt the interference at the focus, hence affecting imaging resolution.This is particularly important in sensitive super-resolution methods, for example, in the creation of the zero intensity centre of the ring-shaped STED microscopy or MINFLUX beams [10,11,12]; in the interference light fields of the SIM or 4Pi microscopes [13,14]; and can also affect performance of other common microscopes [15].Such effects would be exacerbated in deep sample imaging where there are compounded polarisation and phase errors.
As these vectorial aberrations vary with the imaging scenario, field positions, and specimen type, adaptive feedback correction is essential to obtain optimal system performance.We therefore need to extend the concepts of conventional AO to the joint compensation of polarisation and phase aberrations through introduction of the concept of vectorial adaptive optics (V-AO).Conventional phase AO requires a method of phase measurement -either through a wavefront sensor or indirect optimisation methods ("sensorless AO" for short) [2,3] -to determine the input aberration and a method of phase compensation; whereas V-AO requires the sensing and correction of the vectorial aberration.There are significant challenges in extending existing AO methods to this higher-dimensional analogue to conventional phase correction.
In order to meet these challenges, we have implemented and validated V-AO correction through three methods: A) sensorbased, B) quasi-sensorless, C) modal-sensorless; conceptual sketches of the feedback process are shown in Fig. 1b.We describe in detail the three methods and their properties, with demonstrations of the improvement of both vector field and focus after correction of commonplace vectorial aberrations.Our results indicate that V-AO can suppress vectorial aberrations, thus enhancing the toolbox for applications beyond those of traditional AO.(a) Schematic of a system affected by vectorial aberration and a V-AO compensated system.The V-AO module encompasses a polarisation module and a phase module.Here the V-AO module pre-corrects the vectorial aberration.The state of polarisation (SOP) and phase profiles, as well as focus profile are given as sketches illustrating states 'before' and 'after' V-AO correction.(b) Sketches of three different V-AO correction methods.Method A (sensor-based V-AO): A MM sensor is used to measure the aberration then give feedback to V-AO module for pre-correction, hence leading to the desired light field output.PSG: polarisation state generator; PSA: polarisation state analyser.Method B (quasi-sensorless V-AO): A polariser is used to filter the intensity before the pupil, and the pupil intensity profile after the polariser serves as feedback to manipulate the V-AO module to correct the aberration.P: Polariser.Method C (modal-sensorless V-AO): Focal intensity is used as proxy for optimising the output phase and SOPs of the beam hence completing the V-AO loop.

Results
In contrast to conventional AO, V-AO requires a method to determine the full vectorial properties, encompassing polarisation and phase, and a mechanism for its control.Conventional Mueller matrix (MM) polarimetry plays a role here, as the "sensor" for determination of the MM (which is equivalent to the polarisation aberration) as well as the output state of polarisation (SOP).Sensorless V-AO methods can also be employed, allowing for example model-based optimisation of focal quality through adjustment of polarisation and phase states.Based on these principles, we introduce a suite of V-AO techniques that can be applied in different situations.Central to this is a versatile vectorial field compensation system consisting of two liquid crystal spatial light modulators (SLMs) to fully control the output SOP [16,17] and a deformable mirror (DM) to compensate for phase (Fig. 1a) [2,3].Similar multi adaptive element systems have been used for the purpose of complex beam generation [18,19,20], whereas here we emphasise the use of such manipulators as the aberration corrector in a feedback AO system.

Sensor-based vectorial adaptive optics (Method A)
At the heart of the sensor-based V-AO implementation is an imaging MM polarimeter, which is able to extract the full polarisation properties across the profile of a beam or an object [7] (Fig. 1b).A complete MM polarimeter consists of a polarisation state generator (PSG) and a polarisation state analyser (PSA) [7].Following the MM measurement of the object using the PSG and PSA, the SLMs are set such that the output SOP after propagation through the object is spatially uniform.This is achieved by setting the patterns displayed by precisely calibrated SLMs (see Supplementary Note 2), so that the SLMs introduce a pre-compensation aberration, leading to uniform output SOP.Phase aberration can also be introduced by the object, while additionally further phase variations are introduced by the SLMs themselves [21] (see Supplementary Note 1).Full correction is achieved by first correcting the SOP aberration using the SLMs and then applying phase only correction via conventional sensorless AO.
To illustrate some peculiarities of full vectorial aberrations (comprising both SOP and phase) we first introduce a vectorial aberration using the V-AO module.Three notable cases are depicted in Fig. 2a: 1) a beam with a uniform SOP was perturbed by such an aberration (V-AO off), resulting in both a disordered SOP in the pupil as well as a distorted focus.
2) (Phase AO on) we applied phase-only sensorless AO with the DM which results again in an aberrated focus.This verifies that traditional phase-only AO cannot fully compensate a full vectorial aberration, because a disordered polarisation state affects the constructive interference required for perfect focussing [22].3) Finally, the initial vectorial aberration introduced by the V-AO module is removed as following the correction procedure, resulting in a spatially nearuniform SOP in the pupil and a diffraction limited focus (V-AO on).We illustrate in Fig. 2b on the Poincaré sphere the distribution of the SOP in along a line in the cross-section of the pupil as well as cross-sections of the foci in Fig. 2a.
Corresponding theoretical validation and simulations can be found in Supplementary Note 1.The well-matched results (for simulation and experiments) also validated the capabilities of V-AO approach.
We then chose a graded index (GRIN) lens for demonstration of a real vectorial aberration.GRIN lenses are widely used for compact imaging systems and microscopy; applications span across connectors for quantum chips to biopsy probes for clinical diagnosis.By nature of their manufacture, GRIN lenses suffer from a rotationally symmetric birefringence variation that is concomitant with their symmetrical graded index profile [4].This property is considered as a nuisance as it introduces a vectorial perturbation that disrupts GRIN lens based imaging systems [4]; these perturbations cannot be compensated via traditional phase AO.Therefore, widespread adoption of GRIN optics is hindered in sensitive systems, such as for compact super-resolution or polarisation contrast imaging systems [4].Similar experiments are conducted following the same process in Fig. 2a.Fig. 2c shows results comparing before (V-AO off) and after correction (V-AO on).The vector fields, the correction patterns on the DM, as well as focal spot comparisons are given.More detailed analysis can be found in Supplementary Note 3.
These demonstrations show that the feedback sensor-based V-AO method (method A) can improve the performance of an optical system both in terms of uniformity of the SOP in the pupil and distortions at the focus.The MM polarimeter provided complete information about the spatially variant polarising properties of the aberrating object and this information was used to apply the SOP correction in method A. However, it is also possible -and indeed sometimes more practical for various applications [2,3] -to infer the necessary vectorial correction using less direct methods that do not require full knowledge of the polarisation aberration.We investigate here these polarimeter-free methods through the concept of "sensorless V-AO", which is named in analogy to wavefront-sensorless AO, which performs phase correction without the use of a wavefront sensor [2,3].In one case, a sequence of intensity measurements is taken in a conjugated pupil plane using a simple system consisting of polariser and a camera ("quasi-sensorless V-AO"; Method B); in the other case, a sequence of intensity measurements is taken at the focal plane instead of the pupil ("modalsensorless V-AO"; Method C); see Supplementary Note 4. In both cases, a process is employed in order to optimize the intensity as a proxy for the uniformity of the polarisation state.

Quasi-sensorless vectorial adaptive optics (Method B)
Figure 3a gives a schematic of method B. At the heart of this method is the maximisation of intensity measured after a polariser across every point in the beam profile (highest intensity (HI); Fig. 3a).The camera is located at the pupil plane and measures the intensity of the output field after projection through a polariser, which was chosen to have the same principal polarisation eigenvector as the desired state (in principle, this could be spatially variant, but here linear polarisation is chosen for simplicity).When the output SOP is parallel to the eigenvector of the polariser, the intensity is maximum.One can thus correct the SOP aberration by maximizing the intensity at each point in the pupil.
For each point in the pupil, there is hence an input Stokes vector SV' that maximises the detected intensity and any other state will result in a reduced intensity.This intensity can be mapped onto the surface of the Poincaré sphere (see Fig 3a).
The point with maximum intensity corresponds to the eigenvector of the analyser and hence indicates the optimal SV' pre-correction that must be applied with the V-AO module.In practice, this optimal correction can be obtained by sampling a number of trial configurations of the retardance settings of the two SLMs and by interpolating between these measurements to reach the maximum intensity (see exemplar in Fig 3a).This process can also be carried out in parallel for each single point in the pupil.Detailed algorithms are elaborated in Supplementary Note 5.This procedure to optimise the final SV correction introduces additional phase errors due to the SLMs.This necessitates the second correction step consisting of a conventional phase sensorless AO procedure.
We validated the experimental feasibility of method B using a titled waveplate array as the aberrating object.Such a waveplate array is widely used to generate vector vortex beams, such as for the depletion focus in a STED microscope [23].We show the state before (V-AO off) and after correction (V-AO on) including the SOP fields, the phase on the DM, the focal spots (Fig. 3b).The improvement in performance is also exemplified through comparison of focal spot intensity profiles.A further demonstration showed compensation of the deleterious vectorial effects of a series of protected silver mirrors.These standard components of various modern optical systems show problematic vectorial aberrations, due to off-axis reflections, Fresnel's effects, and coating properties [6].We applied V-AO correction through method B, providing the results of Fig. 3c.More detailed analysis of these and other vectorial aberrations due to other optical components, such as beam splitters, wavelength filters, etc., are given in Supplementary Note 6.We emphasise that the aberrations corrected here are spatially variant and thus require the complex correction provided by V-AO.

Modal-sensorless vectorial adaptive optics (Method C)
Method B was able to correct vectorial aberrations after a short sequence of measurements at the conjugated pupil (correction of SOP) and focus (correction of phase).In this section, we demonstrate fully "sensorless" V-AO through method C.This method achieves V-AO correction with no additional hardware through focal plane measurement alone, taking advantage of prior knowledge of the nature of the vectorial aberration.There are various scenarios where assumptions can reasonably be made about the eigenmode axes of a polarising object, For example, this may occur in stressed optics, such as an endoscopic lens, which exhibits azimuthally or radially distributed birefringence axes, as determined by the intrinsic stress direction [4]; alternatively, in biological samples such as muscle tissue, where the axes follows the stress direction or the alignment direction of the intrinsic fibres [24].While such prior knowledge about symmetry is useful, the value of retardance is often still unknown, such as due to variation from different manufacturing processes for the lens, or the state of the biological tissue [4,7,24], so adaptive vectorial correction is needed.Method C operates in analogy to conventional, phase-only sensorless methods, whereby different trial aberration corrections are applied in sequence and the optimal value of the correction is deduced by assessing the image quality using an optimisation metric [2,3].The salient difference for method C is that polarisation and phase aberration compensation are simultaneously performed with both SLMs and DM operating in concert at each step.This is a vectorial extension of phase correction through sensorless adaptive optics.
Sensorless feedback correction of both polarisation and phase is a challenging task, because of the complex interplay between them [6] when compensation is implemented using a combination of SLMs (see Supplementary Note 1).Furthermore, as feedback was provided solely through intensity measurements, a sequence of measurements was required to infer the necessary information for correction.We hence considered two different scenarios for method C. In scenario 1, we dealt only with an unknown polarisation aberration, assuming that the traditional phase aberration was negligible (Fig. 4a and 4b).At each point of the pupil, we had prior knowledge of the polarisation eigenmode axis, which we denoted by the line Q/-Q through the Poincaré sphere.The input SV (and equivalently the correction targeted SOP) was represented by point A. As the retardance value was unknown, the corrected SV T, which should be generated via the V-AO module, must lie on the circle K, which passed through A and was centred on Q/-Q.
In practice, this sensorless optimisation was implemented using vectorial modes defined over the whole pupil, which were based upon Zernike polynomials [2,3].The correction mechanism relied upon maximisation of the focal intensity (the process is elaborated in Supplementary Note 7), in a process that was a higher-dimensional analogue to sensorless phase AO.Optimising the intensity through adjustment of the modes on the SLMs provided an indirect route to optimisation of the SOP.In scenario 2 (Fig. 4c), we considered the combination of unknown polarisation and phase aberrations.Here, we first executed a phase-only sensorless correction routine to remove most of the phase aberration due to optical path differences on propagation through the aberrating sample.Then we applied a polarisation-only aberration correction, following the procedure used in scenario 1.Finally, we applied a further round of phase-only aberration correction to remove any residual phase bias.In effect, through maximisation of focal intensity, this V-AO procedure seeks uniformity of the SOP, rather than a specific SOP (see details in Supplementary Note 7).
Experimentally, we validated the feasibility of our method C (sensorless scenario 1) via a calibration target consisting of a region of birefringent material made from a piece of thin film waveplate).This creates a pure polarisation aberration with negligible phase offset (Fig. 4b).Specifically, we present the final overall system axis orientation from the combined effect of the V-AO module and the object.This in effect determines the overall system performance, as an alternative evaluation of our V-AO performance.It can be seen that the effective fast/slow axis distribution show significantly improved uniformity after correction.More data, analysis and discussion are provided in Supplementary Note 7. V-AO correction for scenario 2 was undertaken using a thin tendon tissue sample, which exhibited both polarisation and phase effects, in this case with comparatively smaller polarisation aberrations (Fig. 4c).Focal spot performance and axis corrections are provided.Detailed analysis of the performance, including in terms of the vectorial modes, is provided in Supplementary Note 7. The above results validate that the sensorless V-AO method C has potential to be used in future applications that require precise vectorial control and correction of vectorial aberrations, where indirect optimisation is required, such as for beam shaping, focal control and imaging.fixed point P(r,q) on the pupil as example, when the axis of the aberration corresponding to this point is known, the circle K is determined.Hence, the vectorial correction must be found to set the input SV'(r,q), corresponding to point T, back to the desired SV(r,q) at point A. In practice, aberration modes are applied that change all of the points on the pupil P(x,y) simultaneously to optimise the focal intensity.Details are elaborated in Supplementary Note 7. (b) V-AO off vs. V-AO on status for a calibration target consisting of piece of thin film waveplate.SOP distributions, patterns on DM, focus profiles, overall slow/fast axis performances (before and after the correction), as well as the axis distributions and their comparison on Poincaré sphere are given.The corrected SOP is more uniform, and the focal spot is sharper.The complex phase pattern here reveals the extra phase errors that introduced via AO correctors.It can be also observed that both corrected axes are more uniform.(c) Comparison of V-AO off and V-AO on status of a biological sample.
Focal spots distributions at three steps, axis orientation corrections, are given for comparison.It can be found that the axis distribution and focal spot profiles are enhanced after the correction process.

Discussion
In summary, we have extended the concepts of conventional phase-only AO into the vectorial domain by merging polarisation and phase aberration correction.V-AO can be implemented using feedback in a sensor-based approach using a polarimeter, or through two different implementations of "sensorless V-AO", which uses neither a MM polarimeter nor a wavefront sensor.
These three approaches provide a versatile toolkit for compensation of vectorial aberrations, which can be chosen to match conditions in real applications.The sensor-based method provides the most comprehensive approach compatible with full MM characterisation, should it be necessary.However, the quasi-sensorless (and modal-sensorless) method can provide the ability to perform V-AO with simpler hardware requirements compatible with more practical scenarios [2,3].
The quasi-sensorless method features unique advantages: First, the complex hardware necessary for a full MM polarimeter measurement is replaced by a simple analyser without moving parts.Second, calculation of the MM is no longer needed, nor is its decomposition for application of the SLM settings, which avoids the complex error amplification due to the MM matrix calculation [7].Third, detailed calibration of the SLMs is not necessary, as the optimization procedure can be expressed directly in terms of the pixel values applied to the two SLMs.The modal-sensorless approach requires no additional hardware and no extra pupil measurement, uses prior knowledge of the target, and is based purely on focal optimisation.These methods can separately assist different optical system scenarios, with intriguing directions that are largely unexplored.
Future developments can expand these methods to deal with light depolarised by the object, which can occur in scenarios such as bulk tissue monitoring or diagnosis [7].Furthermore, with an increased number of AO devices, the V-AO format can be extended.The current system, using two SLM passes, can provide vectorial aberration compensation with precorrection of the illumination state.For even wider reach, the system could be expanded to three SLM passes [17], thus permitting conjugation of the vectorial state, for example in the emission path of a microscope.More discussion and perspectives can be found in Supplementary Notes 8.
Overall, we have put forward novel V-AO techniques for joint correction of polarisation and phase aberrations.With these vectorial field feedback control methods, this next-generation AO technique is expected to benefit various research areas -for example [25][26][27][28][29][30], ranging from astronomical telescopes to microscopy -with further applications spanning across galaxy detection, to laser-based and lithographic nano-fabrication, in addition to biomedical and clinical characterization.

Mathematical background
We can model the evolution of the state of polarisation (SOP) and the scalar phase throughout the optical system using conventional Jones calculus [1][2][3].For a single point in the pupil, the change in SOP and phase can be modelled as where    1 and    2 are the Jones vectors respectively before and after the change in SOP and scalar phase applied by a polarisation modulation element such as a wave plate.This latter is modelled using a a 2 × 2 Jones matrix .It is useful to parametrise  so that the effects of SOP and phase change are more easily identifiable.In this paper we only consider retardance and phase modulation for a fully-polarised beam of light.As a result,  can be expressed as where  is the scalar phase applied by the element and  is a special unitary matrix (SU) describing the change in SOP.This latter matrix can also be parametrised [4] as where  is the retardance applied by the element,  is the 2 × 2 identity matrix, and  1 ,  2 ,  3 are the Pauli matrices defined as Note that  3 is defined differently than in some other sources [1][2][3]5,6].The coefficients  1 ,  2 ,  3 belong to a vector    = [ 1 ;  2 ;  3 ] with unit norm, i.e., |  | = 1.The change in SOP modelled by  can also be visualised as a rotation in the Poincaré sphere, where    is the axis of rotation and  the angle of rotation.Given a Jones vector   , the normalised Stokes vector representing its SOP can be computed as [6]    = where • † denotes the conjugate transpose.Note that by choosing  3 as in Eq. ( 4), we have that left circular (LC) polarisation    LC = [1;] corresponds to the South pole    LC = [0; 0; −1] in the Poincaré sphere.Right circular (RC)    RC = [1; −] corresponds to the North pole    RC = [0; 0; 1], instead.This is in accordance with the convention most commonly employed in optics [7] where RC polarised light is represented by the Jones vector [1; −] and corresponds to the North pole.
Positive uniaxial elements such as liquid crystals (LC) in a spatial light modulator (SLM) are characterised by an ordinary   and extraordinary   indices of refraction.The magnitude of the effective   of a LC cell can be controlled by applying a voltage.Excluding a common phase delay applied to both the   and   axes, the effect of a LC cell can be modelled by where  represents the additional phase delay experienced along the extraordinary axis.Note that in Eq. ( 6) we have dropped a common phase factor that would account for the propagation along a nonbirefringent cell with uniform refractive index   .This factor is inconsequential for our analysis as we are only concerned with the additional optical path length (OPL) experienced along the   axis, which is accounted for by , with respect to the OPL experienced along the   axis.It can be seen that where    = [1; 0; 0] denotes the horizontal axis in the Poincaré sphere.Therefore, Eq. ( 7) can be interpreted as applying a scalar phase factor of /2 to both the first and second components of the Jones vector.In addition to that, a change in the SOP is also applied via SU2(  , ).This latter can be visualised as a rotation of an angle  about the    axis in the Poincaré sphere.We remark that, contrary to the case of Eq. ( 6), in Eq. ( 7) we choose to keep the phase factor   /2 .This is because Eq. ( 7) only applies to a single point of the cell, but  can have different values for each pixel of a LC cell.As a result, a phase profile develops across the cell if one assigns different values to  for different pixels of the LC cell.

Modelling the SOP and phase in the optical system
The layout of the optical system is shown in Supplementary Figure 1, where different positions along the setup are enumerated by numbers in purple.We first consider a single point in the pupil of the optical system.Given an initial Jones vector    1 at position (1), the Jones vector after reflection off the first SLM at position (2) is found to be    2 =    1 /2   SU2(  ,  1 )    1 .
Here,   =  1 accounts for the reflection at the back plane of the SLM, see Chapter 17 in [1].Note that   = − SU2(  , ), and therefore can also be thought of as a rotation by 180 • about the    axis in the Poincaré sphere.The retardance applied with the first SLM is  1 .We remark that in reality the retardance  1 is applied in two steps.First, a retardance of  1 /2 is applied when the beam passes through the LC cell in the forward direction.This is followed by the reflection off the back plane and by another pass through the LC cell in the backward direction, which applies another retardance of  1 /2.Since in our modelling the axes of the LCs are parallel to the  axes in both the forward and backward frames of reference, this description is equivalent to Eq. ( 8).
After reflection off the first SLM the beam is incident onto a half-wave plate oriented as shown in Supplementary Figure 1(a).As a result, the Jones vector after transmission through the half-wave plate at position (3) is given by where    = [1; −1; 0]/ √ 2 is the axis of rotation in the Poincaré sphere.The reflection off the second SLM at position (4) can be modelled as where  2 is the retardance applied with the second SLM.At position (5), scalar phase modulation is applied with a deformable mirror (DM), which is modelled by the Jones matrix    , i.e., At position ( 6), the beam is perturbed by an aberrating object, which comprises a scalar phase  and an aberration of the SOP, which is parametrised by an axis    and a retardance , i.e.,    6 =    SU2(  , )    5 . ( Depending on the considered scenario, ,   , and  may be unknown and to be determined by one of the correction methods outlined in the sections below.The scalar phase  accounts for OPL differences accrued by propagation of the beam through the aberrating object.These are commonly compensated with conventional adaptive optics (AO) [8].Finally, overall, the input and output Jones vectors    1 and    6 are thus related by Note that in the equation above we have dropped some constant phase factors that do not vary across the pupil and are thus inconsequential for our analysis.We emphasise that Eq. ( 13) is only relevant for a single point in the pupil disk.In fact, when spatial variations are considered, all the Jones vectors, , ,  1 , and  2 should be replaced by functions of the coordinates in the pupil plane.Finally, Eq. ( 13) also highlights the total accumulated scalar phase i.e,  +  + ( 1 +  2 )/2, as well as a number of rotations on the Poincaré sphere.We can use Eq. ( 13) above to establish under which conditions both the SOP and the phase can be corrected in the pupil of the overall optical system.For this reason, we first assume that   , , and  are known for each point in the pupil.The SOP aberration of the object is determined by    and , whereas the scalar phase aberration is determined by .Note that, in general, it is not possible to select  1 and  2 such that the matrix products in Eq. ( 13) evaluate to the identity matrix .That would imply that two SLMs can make an arbitrary retarder and correct for all possible values of    1 .Instead, the two SLMs can only make a correction for a single, fixed value of    1 , which we have chosen to be 2. This is because two SLMs are insufficient to simulate an equivalent arbitrary wave plate, which can be realised by employing three SLMs in series -see [9].Nevertheless, correction of the SOP can still be achieved by choosing  1 and  2 such that    6 =    1 , where    1 and    6 are the Stokes vectors on the Poincaré sphere corresponding to    1 and    6 , respectively.This condition is satisfied when i.e., when the product of the matrices in Eq. ( 13) evaluates to a unitary matrix SU2(   1 , ) for which    1 is an eigenvector.In this case,  represents the geometric phase accumulated by the closed path travelled along the Poincaré sphere [10,11].Once Eq. ( 14) is satisfied, correction of the total scalar phase is achieved by letting The modelling discussed so far was validated with experimental measurements in Supplementary Figure 2, where the first row reports the results of numerical simulation, whereas the second row reports experimental measurements obtained with the setup depicted in Supplementary Figure 1.In this case, no aberrating object was inserted at position (6) in Supplementary Figure 1.Instead, a randomly chosen aberration was induced with the two SLMs only.In Supplementary Figure 2 a comparison is made between the Mueller matrices (MM) computed using the model above shown in (a) and the effective MM measured experimentally shown in (d).Supplementary Figure 2(b) shows the computed SOP expected at position (6).The same data is obtained using the experimentally measured MM and is shown in Supplementary Figure 2(e).Finally, we computed the expected focal intensity distribution (FID), which is reported in Supplementary Figure 2(c).The corresponding experimental measurement obtained with camera C2 is reported in Supplementary Figure 2(f).The experimental MMs were obtained by applying the polarimetry method described in [12] and by temporarily enabling the SOP generator G and Stokes polarimeter A1 depicted in Supplementary Figure 1.

Arbitrary modulation of the SOP
As seen above, the Jones vector    4 after reflection off the second SLM is given by From now onwards, we always assume that    1 is fixed to    1 = [1; −1]/ √ 2, so that the corresponding SOP at position (1) is fixed to    1 = [0; −1; 0] -as can be found by applying Eq. ( 5).Next, we consider the problem of selecting  1 and  2 such that the SOP    4 at position (4) can be set to a desired value, i.e.,    4 = [ 4 ;  4 ;  4 ].By reasoning out the rotations along the Poincaré sphere outlined in Eq. ( 16), it can be shown that this is achieved when As a result, the two SLMs are able to transform the uniform SOP given by    1 = [0; −1; 0] into an arbitrary, spatially variant SOP at position (4).This means that the SOP can be pre-corrected before propagating through the aberrating object at position (6), see Supplementary Figure 1.
An illustration outlining the rotations in the Poincaré sphere is provided in Supplementary Figure 3.Here we have chosen    4 = [0.6943;−0.5826; 0.4226], from which we obtain  1 = 134.0• and  2 = 54.0 • after applying Eq. ( 17).First, retardance  1 is applied with SLM1, which causes a rotation of 140.0 • about the    axis.This is followed by a reflection off the back plane of the SLM, which is modelled by a rotation of 180.0 • about the same axis   .As a result, the SOP    2 is reached, see Supplementary Figure 3(b).At this point, the beam passes through the half-wave plate, which is modelled by a rotation of 180.0 • about the    axis.This results in a SOP of    3 , see Supplementary Figure 3(c).Finally, retardance  2 is applied, which causes a rotation of 54.0 • about the    axis.Another rotation about the    axis models the reflection off the back plane of the SLM.This results in the desired state    4 being reached as expected, see Supplementary Figure 3(d).Retardance  1 is applied with the first SLM, which is modelled as a rotation by  1 along the    axis.This is followed by a rotation of 180 • modelling the reflection off the back plane of the SLM; (c) The effect of the half-wave plate is that of applying a rotation of 180 • about the    axis; (d) The desired state    4 is reached using two rotations about the    axis modelling both the retardance  2 applied with SLM2 and the reflection off the back plane.

Conversion between Mueller and Jones matrices
Given a 2 × 2 complex-valued Jones matrix , the corresponding 4 × 4 real-valued Mueller matrix  can be found as a function of the Pauli matrices as shown below.Let  = vec() vec( 1 ) vec( 2 ) vec( 3 ) , and where vec(•) denotes the vectorisation operation.Note that by choosing  3 as in Eq. ( 4), the convention for RC and LC employed in optics literature is used [7].Other conventions, such as the one employed in [3], can be employed if  3 is replaced by its conjugate transpose.We now consider the inverse problem of determining  from a given .This latter problem has multiple solutions, since different Jones matrices expressing different global phases can correspond to the same Mueller matrix.Numerous authors have provided formulas for the individual elements of , see for example Appendix D in [3] and Chapter 6 in [1].These formulas are nonetheless inconvenient to use as special care must be taken for the cases when some denominators vanish.In the following, instead, we propose to formulate the computation of  as a Frobenius norm minimisation problem [13], i.e., min where •  is the Frobenius norm,  = 1/2 •    † , ⊗ denotes the Kronecker product, and The optimisation in Eq. ( 20) can be solved [13] by taking the SVD of  = ŪΣ V † and letting   = vec −1 ( √︁ Σ 1,1 ū   1 ), where Σ 1,1 is the first singular value in Σ and ū   1 is the first column of Ū.In this way, all the elements of  can be computed simultaneously using only matrix-based operations, in contrast to conventional formulas, e.g., see [1,3].Gaussian filtering with a standard deviation of 8 pixels to smoothen the patterns.Once the patterns are applied with the two SLMs this concludes the procedure for the correction of the SOP aberration.The subsequent correction of the scalar phase is performed as outlined previously in Supplementary Note 3 for Method A. A flow chart summarising the main steps for Method B is found in Supplementary Figure 9.A coarse grid of pixel values tuples is initially created, see Eq. (30).For each tuple ( 1 ,  2 ),  1 is applied to all pixels of SLM1,  2 is applied to all pixels of SLM2, and an image is recorded with camera C1, as outlined in Supplementary Note 5.For each pixel in the aperture, the intensity sampled from the recorded images and its interpolation are evaluated, see (a) and (b) respectively, and the maximum intensity is identified in (b).From the pixel values  1 and  2 corresponding to the maximum interpolated intensity, the correction patterns for SLM1 and SLM2 are computed, as shown in (c) and (d), respectively.and its corresponding Stokes vector retrieved with Eq. ( 5).Finally, we apply Eq. ( 17) to Ŝ    , thus obtaining the corresponding values of the retardances  1 and  2 that must be applied with the two SLMs.These latter operations can be performed in parallel for each point in the pupil.Note that, if the condition δ =  holds true then this procedure ensures that the SOP is corrected as desired.
It is important to realise that correction of the SOP alone as outlined above is not a sufficient condition to obtain a diffraction-limited FID.In fact, even assuming that δ = , correcting the SOP can induce a non-zero scalar phase across the pupil.This phase is due to the contributions of  1 and  2 in Eq. ( 31), in addition to the contribution due to  in Eq. ( 14).The induced scalar phase is a serious impediment to the sensorless algorithm, which can undermine the correction of the SOP.For example, consider the situation whereby the non-zero phase renders the FID more distorted with respect to its state before the SOP correction was applied.In such an instance, the sensorless algorithm fails to select the second state as the more optimal one, since the FID was degraded further.Instead, the first state comprising the SOP aberration but exhibiting a sharper FID is identified as the more optimal one and the SOP aberration is not corrected.
To try to overcome this critical issue one can compensate the scalar phase with the DM just after applying the SOP modulation but before recording the FID used by the sensorless algorithm.A possible strategy is to use the values of  1 ,  2 , and δ computed above and Eq. ( 31) to try to predict the Jones vector at position (6), i.e., ĵ   6 .Subsequently, the phase difference between    1 and ĵ   6 can be computed using the Pancharatnam connection [6,10], which we define as This phase can be finally cancelled using the DM by letting  = −Π(    1 , ĵ   6 ).Now, if one has that δ = , then a diffraction-limited FID is obtained as desired, since the phase induced by the SOP modulation has been suppressed.During the iterations of the sensorless algorithm one obviously has that δ ≠ , as otherwise the ideal correction would already have been attained.In such a case, the SOP of    1 and ĵ   6 do not match, i.e.,    1 ≠ Ŝ   6 , and phase comparison between    1 and ĵ   6 should be performed using the Pancharatnam connection given in Eq. (35).We emphasise that the algorithm presented so far is a heuristic approach that leads successfully to correction of the SOP uniformity.Our experimental results show that the algorithm yields consistent improvement of the FID.
Below we report some illustrative data obtained during the correction of the SOP induced by a calibration target, which is described in the main article.The distribution of    along the aperture was obtained using MM polarimetry, as described previously in Supplementary Note 3, and is reported in Supplementary Figure 12.The first 10 Zernike modes were considered for Eq.(32).The procedure begins by optimising the first Zernike mode, i.e., piston.Different amounts of piston, i.e., {−1.2, −0.8, −0.4,0.0, 0.4, 0.8, 1.2}, are applied to  1 in Eq. ( 32), and δ is computed -see the abscissa in Supplementary Figure 13(a) and the first column in Supplementary Figure 14.For each point of δ in Eq. ( 32), ĵ    and its corresponding Stokes vector Ŝ    are computed, from which the values of  1 ,  2 , and  are determined as explained above.The computation of  1 ,  2 , and  is carried out in parallel for each pixel in the pupil.The values so computed are shown in the second to fourth columns in Supplementary Figure 14 for three different amounts of piston marked with letters [A], [B], and [C] in Supplementary Figure 13(a).After the SLMs and DM are updated accordingly to the values of  1 ,  2 , and , the corresponding measurement of the FID is recorded with camera C2 -see the last column of Supplementary Figure 14.For each measured FID, the value of

Figure 1 :
Figure 1: Vectorial aberrations, vectorial adaptive optics (V-AO), and correction methods ranging from sensor-based to sensorless.(a) Schematic of a system affected by vectorial aberration and a V-AO compensated system.The V-AO module

Figure 2 :
Figure 2: Method A -sensor-based vectorial adaptive optics.(a) Random aberration case, showing V-AO off, phase AO only, and V-AO on.The vector field SOP profile, phase on the SM, profile of the foci are given.(b) SOP comparison on the Poincaré sphere of a sampled line of the vector fields of V-AO on and off status.Intensity comparison of a sampled line of different focus is presented as well.(c) V-AO off vs. V-AO on status of aberration correction for the GRIN objective lens.SOP distributions, phase patterns, and focus spot profiles are given.

Figure 3 :
Figure 3: Method B -quasi-sensorless vectorial adaptive optics.(a) Optimisation of SV'(x,y), which represents a Stokes vector that varies across the pupil, which is located before the aberration described by the Mueller matrix MM(x, y) and is thus related to the transformed Stokes vector SV(x, y).For a fixed point in the pupil P(n, m), the intensity is mapped onto the Poincaré sphere as function of SV'(n, m).The intensity at the same point is equivalently mapped onto a graph of the SLM pixel values.The correction mechanism involves interpolation to the maximum intensity point through a sequence of measurements using different SV'(m,n).The detailed mechanism is elaborated in Supplementary Note 5. (b) V-AO off vs. V-AO on status with a tilted waveplate array.SOP distributions, DM phase patterns, foci profiles, and an exemplar for comparison are given.(c) Comparison of V-AO off and V-AO on status for an assembly of protected silver mirrors.SOP distributions and Poincaré sphere comparisons are given, showing compensation of the significant errors introduced by the mirrors.

Figure 4 :
Figure 4: Method C -sensorless vectorial adaptive optics.(a) Simplified schematic of the sensorless V-AO mechanism.Taking a

Supplementary Figure 1 :
Simplified layout of the optical system used in the experimental validation.(a) A HeNe laser beam (Melles Griot, 05-LHP-171, 632.8 nm) is expanded and directed towards the first SLM (SLM1; Hamamatsu, X10468-01).After reflection the beam passes through a half-wave plate (HWP2; Thorlabs, WPH10M-633) and is reflected off the second SLM (SLM2; Hamamatsu, X10468-01) first, and then off a DM (Boston Micromachines Corporation, Multi-3.5).The planes conjugate to the pupil plane are denoted with (the telescopes that reimage these planes are not depicted for simplicity).Some positions in the setup are enumerated with numbers between parentheses in purple.The frame of reference at position (3) is used to indicate the orientation of HWP2.Measuring positive angles from the  towards the  axis, the slow and fast axes of HWP2 are at 22.5 • and 112.5 • , respectively.Legend: HWP half-wave plate, M flat mirror, P polariser (Thorlabs, GL10-A), BE beam expander, BS beam splitter (Thorlabs, BS010), FBS flip-in beam splitter (Thorlabs, BS010), C camera (Thorlabs, DCC3240N), QWP quarter-wave plate (Thorlabs, WPQ10M-633); (b) Flip-in elements denoted by letters in (a); (c) Table showing in which cases the flip-in elements depicted (b) are enabled.

Supplementary Figure 2 :
Experimental validation of the modelling reported in Supplementary Note 1.1.A randomly chosen aberration is induced with both SLMs and no aberrating object is present at position (6) in Supplementary Figure 1.(a) MM data computed using the modelling relating position (1) and position (6); (b) SOP predicted at position (6) using the modelling when    1 = [1; −1]/ √ 2; (c) FID computed using the modelling and expected at camera C2; (d) Experimental MM data measured with MM polarimetry [12]; (e) SOP predicted at position (6) using the experimentally measured MM data; (f) FID measured with camera C2.

3 :
Generation of an arbitrary SOP at position (4) in the optical setup.The Stokes vectors    indicate the SOP at various positions in the setup, which are denoted by the number in the subscript.(a) The initial state    1 is fixed to [0; −1; 0], whereas an arbitrary state    4 is desired; (b)

4 :
Correction of a GRIN lens SOP aberration.(a) Mueller matrix data obtained by measuring a cross-section of a GRIN lens using an external MM polarimetry setup described in[12]; (b)-(c) Distribution of the extra-ordinary axes and the retardance  of the GRIN lens.Both parameters were extracted from the data reported in (a) using the procedure outlined in Supplementary Note 3. The parameters of the polarisation ellipses are retrieved[7]  from the distribution of axis    across the aperture.The ellipses are then plotted in (b) to visualise the orientation of the extra-ordinary axes.Note that the plot in (b) is different from the plots in Supplementary Figure2(b)-(c), where the SOP is visualised instead of the axes; (d) Mueller matrix data obtained after correction of the GRIN lens SOP aberration.This measurement is taken between position (1) and position(6)  in Supplementary Figure1, and thus comprises both the pre-correction applied with the two SLMs and the aberration due to the GRIN lens.As can be seen by comparing with (a), element (3, 3) has become approximately uniform, which validates the correction for the fixed input SOP    1 = [0; −1; 0]; (e)-(f) Distribution of the axes and retardance after correction of the GRIN lens SOP aberration.Both parameters were extracted from the data reported in (d) As can be seen by comparing (e) with (b), the axes have become approximately linearly polarised along −45 • , for which the fixed input Jones vector    1 = [1; −1]/ √ 2 is an eigenvector.The retardance shown in (f) essentially becomes a scalar aberration, which can be corrected with the DM.

Supplementary Figure 8 :
Intermediate steps performed during the correction of the SOP for Method B.