Active compensation of extrinsic polarization errors using adaptive optics

We present a scheme for active compensation of complex extrinsic polarization perturbations introduced into an optical system. Imaging polarimeter is used to measure the polarization state across a beam profile and a liquid crystal spatial light modulator controls the polarization of the input beam. A sequence of measurements permits determination of the birefringence properties of a perturbing specimen. The necessary correction is calculated and fed back to the polarization modulator to compensate for the polarization perturbation. The system capabilities are demonstrated on a range of birefringent specimens.


Introduction
Adaptive optics has predominantly focused on the correction of phase aberrations [1-3], but there are many optical systems where polarization errors can also have detrimental effects on performance [4,5]. While polarization control of a whole beam is a commonplace component of many optical systems, spatially variant control of polarization across a beam profile is also used, such as for manipulation of vector beams [6][7][8][9]. However, there are many reasons why spatially varying polarization errors can be introduced in a system, such as the effects of internal stresses in optical components, dielectric coatings, or birefringent materials [10,11]. In microscopes, for example, beam profile dependent polarization errors can arise from specimen birefringence or Fresnel effects when focusing at high numerical aperture through interfaces between the coverglass and immersion or mounting media [12][13][14][15][16]. It is known that in certain microscope applications, polarization plays an important role. For example, in STED microscopy, polarization errors can cause a non-zero intensity at the center of the depletion beam [17]; in structured illumination microscopy, the contrast of the sinusoidal illumination patterns is dependent upon the use of appropriate polarization [18,19]. It is clear therefore that the adaptive control of polarization could be beneficial in such cases.
Conventional adaptive optics involves the measurement and control of phase aberrations in the pupil of the system, which can be detected using a wavefront sensor and corrected using an adaptive element, such as a deformable mirror or a spatial light modulator (SLM). The equivalent concept for polarization would involve an imaging polarimeter and a device for adaptive polarization control. A wide range of imaging polarimeters could be employed for this purpose by using prisms [20,21], liquid crystal variable retarders [22] or interferometric methods [23][24][25]. Polarization control has been implemented using liquid crystal SLMs in various configuration for different applications such as investigating the principal modes in a multimode fiber [26], arbitrary polarization generation [27,28] and quantum logic [29]. Some polarization rectifiers have been implemented to correct the polarization state due to static errors introduced by microscope lenses or in other complex optical systems [30][31][32][33]. Mostly beam control has been implemented in open loop manipulation of the polarization state. Closed loop control has also been used for compensation of intrinsic errors in beam generation systems [33]. However, the potential exists for feedback correction using a combination of polarimeter and modulation to compensate for externally induced polarization disturbances.
In this paper, we introduce an adaptive polarization control (APC) system, encompassing both hardware and algorithms, which allow us to control the output polarization profile of a beam, even when perturbed by a specimen. The APC system consists of two hardware modules: a polarization state generator (PSG), in the form of a dual pass liquid crystal SLM, and a polarization state analyzer (PSA), comprising a rotating waveplate based imaging Stokes polarimeter. The APC system can extract the birefringence profile of a specimen and then adaptively manipulate the output polarization state through control of the input beam using the PSG.
The operation is described in terms of Jones calculus. As the Jones matrix of an unknown birefringence cannot be determined unambiguously through a single polarimeter measurement in the APC system, we investigate different strategies that can be employed depending upon the amount of prior information one has about the specimen. Through the assumption that the specimen is purely birefringent and introduces no diattenuation, we find that between one and three PSA measurements are required, dependent upon the knowledge of the specimen. We demonstrate four kinds of samples for system validation: a vortex half wave retarder, a stressed plastic plate, a customized liquid crystal device and excised mouse brain tissue. In each case we show how the polarized component of the output light can be restored through feedback correction to the desired state, despite the perturbation.

Methodology
The schematic basis of the system is shown in Fig. 1. The purpose of the system is to generate a desired polarization state at the output, even when an unknown birefringent perturbation is introduced by an object. Compensation for the perturbation is implemented by producing the necessary polarization state using the PSG at the input. A sequence of measurements is taken, the number of which depends on the degree of prior information that is known about the perturbation. Using these measurements, the polarizing characteristics of the object are determined and the necessary input state is generated.

Theoretical model
We based the theoretical model on the scheme in Fig. 1. According to Jones calculus, the polarization of the output light is represented as Eq. (1), assuming there is no loss and attenuation during beam propagation: where Jout is the normalized Jones vector of the output light. Jsample is the Jones matrix of the birefringent perturbation and Jmod is the Jones vector of the modulated input light, which is created by the PSG and which we will discuss in next section. In all cases presented here, the matrices are functions of the spatial coordinates across the beam profile. For brevity, we omit the explicit dependence on these coordinates from the notation. For the normalized Jones vector, the absolute phase is removed and retardance information is kept, which is sufficient for our analysis of polarization; hence, the vector represents the polarization state in terms of the amplitude ratio and retardance between the Cartesian electric field components Ex and Ey. The aim of the system is to obtain a specified Jout in the presence of an unknown Jsample. As we have control of Jmod, we can obtain output measurements using different input polarizations in order to determine the unknown Jsample. The Jones matrix of an arbitrary birefringent material could be simplified as [34]: 22 22 (2) where θ is the fast axis orientation with respect to the x-axis, ɸ is the retardance between Ex and Ey, and η is the circularity. Therefore, a minimum of three measurements needs to be taken to obtain the matrix. If η = 0, e.g. for linear retarders, the unknown variables are reduced to two. Further, if we have prior knowledge of the magnitude of the retardance of the perturbation, a single measurement is sufficient. Hence, in situations where we have different prior knowledge of the perturbation, we could apply different settings of Jmod and measure the corresponding Jout. The Jones matrix of the sample could be calculated according to Eq. (1). After the Jsample is obtained, we could calculate the Jmod required for each desired output polarization state Jout. The PSG would then be used to generate the corresponding Jmod.

Experimental set-up
A schematic of the APC system is shown in Fig. 2. This set-up is an enhanced version of that used in Ref [35]. The PSG used a dual-pass configuration using the SLM, which was able to generate any spatially variant polarization state. The PSA was able to calculate the polarization state of the output light by rotating the QWP to four different angles and recording the intensity profile of the beam. The SLM was pre-calibrated for retardance modulation [36] and the whole system was then calibrated by mapping the voltage applied on the SLM to the output polarization state measured by PSA. The perturbing sample was placed between the PSG and PSA. The sample was conjugated using 4f systems to the SLM in the PSG and to the CMOS camera in the PSA. In the PSG, each pixel on the SLM could be regarded as a phase retarder with fixed horizontal fast axis. Its Jones matrix can be written as: where δ is the retardance. Both of the HWP and QWP were rotated so that their extraordinary axes were at 22.5° to the x-axis. The Jones vector of the output light could be represented as: represents y polarized input light. The fast axis angle in the calculation of the output Jones vector is set along the beam propagation direction, therefore, in the PSG, after light is reflected by M3, the fast axis orientation of the QWP is used as -22.5°. We can then substitute this into all the Jones matrices to obtain the simplified output vector: We see that the amplitude ratio between Ex and Ey is determined by δ1, the first SLM pass retardance, and the phase shift between Ex and Ey is determined by the second pass retardance δ2. Therefore, assuming δ1 and δ2 can take any value between 0 and 2π radians, the polarization of the output light can be manipulated to any state by using the dual-pass SLM system. Using the PSA, the polarization could be determined by a sequence of four measurements. The camera recorded the intensity of the output light for four different orientations of the QWP. The Stokes parameters were calculated as: where A is a 4×4 matrix. Each row in A is the first row of the Müller multiplication of the polarizer and the QWP MpMQWP(θ), where Mp is the Müller matrix of the linear polarizer, whose fast axis was fixed to be horizontal; MQWP(θ) is the Müller matrix of the QWP, with the fast axis orientation of θ. Matrix A could then be determined when substituting θ = 15.1°, 51.7°, 128.3°, and 164.9° respectively [37,38]. The intensities obtained at each fast axis orientation θ were recorded in sequence and form a 4×1 matrix I. Hence, the output Stokes parameters can be calculated using Eq. (6). We refer to this as one PSA measurement.
As we are concerned here with restoring the desired polarization state through birefringence transformations, we make the implicit assumption that we are using fully polarized light. We can thus convert the Stokes vectors to the corresponding normalized Jones vectors [39], as in Eq. (1), which describe only the polarized component of the beam. Due to the nature of Müller polarimeter, it is not possible to retrieve the overall phase of the beam, although this could be obtained using alternative phase measurements.

Results and discussion
This APC system can be controlled in different ways depending on what prior assumptions can be made about the specimen's birefringent properties. In order to illustrate this, we demonstrated four different kinds of samples, each of which required different numbers of measurements for correction.

Vortex half wave retarder
The first sample was a vortex half wave retarder (Thorlabs, WPV10L-780). This consists of a spatially variant half wave plate, whose retardance value is fixed, but whose fast axis is distributed as shown in Fig. 3(a). If we use horizontal polarized light for illumination, the output polarization state will still be linearly polarized but with a spatially varying orientation. Fig.  3(b) plots the polarization ellipse orientation of the output light as measured by the PSA. Note that for the PSG and the PSA, for calculations and control purposes we divided the image into 15×15 sub-regions, over which each of the individual PSA intensity measurements used was averaged before calculating the polarization state in that region. Correspondingly, the same voltage was applied within each sub-region on the SLM.
According to Eq. (2), if the retardance of the phase retarder is known to be π radians, the Jones matrix of the vortex half wave retarder could be simplified as 22 22 cos sin 2 cos sin 2 cos sin sin cos Hence, only one measurement is needed to get the value of θ modulo  radians We set the PSG to generate horizontal polarized input light, e.g.  (9) As we wanted to restore the light to horizontal polarization after the sample disturbance, we calculated the Jmod and applied the corresponding voltage on the SLM to create the necessary input polarization. Fig. 3(c) shows the polarization orientation after the APC correction. It is seen that the polarization orientation after correction is near uniform and is close to zero at all points across the field. The root mean square (RMS) variations of S1, S2 and S3 before and after correction are compared in Table 1.  As further illustrations of the correction process, Fig. 4 shows the output light intensity distribution on the camera viewed through two different orientation of the rotating QWP. Fig.  4(a) and (b) are the images taken at the rotating QWP fast-axis orientations of 15.1° and 164.9° before correction. The intensity pattern seen here is characteristic of what one should expect to see through the PSA following the vortex half wave retarder. Compared to that, the intensity distribution after correction are more uniform at the same QWP fast axis orientation as shown in Fig. 4(c) and (d), as the polarization state was restored to be horizontally polarized across the whole beam profile. The square grid patterns are due to pixel edge effects where the SLM has been divided into sub-regions. We also tested the APC system for reconstructing the output light to an arbitrarily chosen uniform polarization state. The target reconstructions for the output light were chosen to be horizontal, 45° linear and right circular polarized, respectively. Fig. 5 shows the Stokes parameters S1, S2 and S3 of the output under different reconstructing situations, as retrieved by the PSA. It is seen that the APC system is able to manipulate the polarization state as expected. The discontinuity of the polarization state at the center region is because of the spatial sampling chosen for the sub-regions. This effect could be minimized by decreasing the sub-region size, but with reduced signal-to-noise ratio.

Stressed plastic plate
Stressed polycarbonate is a biaxial birefringent material, whose in-plane and lateral refractive indices are different [40,41]. The difference in the refractive index would introduce a retardance depending on the orientation of the optical axis of the plastic substrate. We tested a stressed plastic plate whose both retardance and fast axis orientation were unknown to demonstrate our system. The birefringent effect of the plastic plate sample viewed through crossed polarizers is shown in Fig. 6(a). If the retardance and fast axis orientation are unknown, the Jones matrix of the sample can be represented as: 22 22  It is seen that the off-diagonal elements are equal. We can use this observation to extract the Jones matrix of the sample using two PSA measurements, which we chose to be taken with horizontally and vertically polarized illumination. The Jones vectors after using horizontal and vertical illumination are: (12) where A, B and C are all complex numbers in the sample Jones matrix. A1, B1 are the elements of the (normalized) Jones vector calculated from the conversion of Stokes parameters from the PSA of the first measurement, and α1 is the scaling factor to the original matrix element. Similarly, α2 is the equivalent factor for the second measurement. Since we know the two offdiagonal elements are the same, the relationship between the scaling factor α1 and α2 can be easily calculated and the normalized Jones matrix of the sample was then determined. Eq. (9) could then be used to determine the necessary input light field to produce the desired output. Fig. 6(b) shows plots of the polarization ellipse of each sub-region before correction when using vertical polarized light to illuminate the plastic plate. The output polarization state is nonuniformly distributed across the field because of the uneven birefringence. Fig. 6(c) − (e) show the polarization ellipses under different reconstruction situations by using the APC system. It is seen that the system is able to reconstruct across most of the field the output polarization state, even with an unknown retardance and fast axis orientation of the perturbation. The mismatch of a few regions in Fig. 6(d) and (e) is because those sub-regions are areas of rapidly changing birefringence, which can be seen from the inset aperture of the illumination region from Fig. 6(a). Since the Jones matrix calculated for each sub-region is based on the polarization state measured by PSA, and the intensity was averaged for each sub-region when calculating the polarization state by using Eq. (6), there could still be mismatches in correction within each region.

Liquid crystal device
A liquid crystal (LC) device was used to show how the APC could adapt to changes in a dynamic system. This LC device was a 20 µm thick anti-parallel rubbed cell (Instec Inc). It had a 5×5 mm electrode region and was filled with E7 liquid crystal. We connected the liquid crystal device to a signal generator and placed it at the sample plane. The device was designed to have two different regions, which we refer to as the static region and the dynamic region. The birefringence in the static region, which was away from the electrode structure, did not vary with the external voltage, denoted U, while the dynamic region, in the vicinity of the electrodes, changed with a varying drive voltage. The schematic of the device is shown in Fig. 7(a). We tested the system's dynamic functionality by changing the voltage to the device and to see if APC could react to the different birefringence disturbance and reconstruct to the same polarization state. Fig. 7(b) − (e) shows the measurements represented on a Poincaré Sphere when the sample was illuminated with a horizontally polarized light. Fig. 7(b) shows the output polarization state at different sub-regions (one point corresponds to one sub region) before correction when the drive voltage U = 1.8 volts. The output polarization state of the static and dynamic regions were distributed away from the desired horizontal polarization state because of the spatially varying birefringent perturbation introduced by the LC cell. After applying correction using the APC system, the polarization state after correction then became much more uniform and concentrated to the horizontal polarization state as shown in Fig. 7(c). Fig. 7(d) plots the output polarization state without APC compensation when the drive voltage was set to U = 2.5 volts. It can be seen that the polarization state of the reference region is similar to the equivalent measurements shown in part (b); due to the birefringence change in the dynamic region, the polarization state of that region had a different distribution. Despite the disturbance change, after APC correction the polarization of the output light still could be reconstructed to the uniform horizontal polarization as shown in Fig. 7(e). With this customized sample, we demonstrated that the APC is able to track dynamically changing perturbations.

Mouse brain tissue
The system was also demonstrated in a more general scenario, where no assumptions were made about the nature of the birefringent effects. When the disturbance is an arbitrary birefringent material showing zero attenuation, three measurements are needed to reconstruct the polarization state. We tested the operation of the APC system in this regime using a sample of mouse brain tissue [42,43]. We used a thin tissue sample here to ensure minimal light loss and diattenuation introduced from the sample. The sample was a 60-µm thick fixed coronal brain slice from a Thy1-GFP line M mouse. A transmission microscope image of the tissue is provided in Fig. 8(a). According to Eq. (2), to measure the sample Jones matrix, we need to take three independent measurements; we implemented this by controlling the PSG to generate horizontal, vertical and 45° linearly polarized illumination light, respectively. The output Jones vectors then can be represented as: where A, B, C and D are complex elements of the sample's Jones matrix; A1, B1, C1 and D1 are normalized output Jones vector elements; α1, α2 and α3 are scaling factors between the matrix elements and normalized output Jones vectors. A and B can be first determined using the horizontal polarized illumination. The sample normalized Jones matrix can be determined if we find the relationship between α1 and α2 in Eq. (13) and (14). This can be worked out by having the additional measurement, Eq. (15). A control measurement was performed using an empty region of the microscope slide adjacent to the brain tissue; this showed negligible birefringence effects, where the RMS of the variation the Stokes parameters were all less than 0.01. Fig. 8(b) and (c) show, as examples, the intensity images of the recorded by the camera when using horizontally polarized light illumination, with the QWP oriented to 128.3° before and after restoration to horizontal polarization, respectively. It can be seen from the uneven intensity distribution before compensation and the more uniform intensity after compensation that the brain tissue introduced a perturbation through birefringence. Fig. 8(d) − (f) give the Stokes parameters of S1, S2 and S3 calculated from the PSA before compensation. The variance across the sample in S1, S2 and S3 was then corrected by the APC after the restoration as shown in Fig. 8(g) − (i). These results demonstrate the functionality of this system using three measurements to compensate for an arbitrary birefringent sample. Considering that the brain tissue could also introduce some depolarization, we then measured the degree of polarization (DOP) before and after correction. It is seen that although some depolarization is present, the APC system could correct the polarized component without significant changes to the DOP, from a mean value of 0.82 to 0.79. The statistical distribution of Stokes parameters and DOP comparison before and after correction are shown in Fig. 9. The variation of the Stokes parameters across the field of view was clearly reduced by the APC system. the camera of the brain tissue sample before correction at the rotating QWP of 128.3°. (c) Intensity image of the sample after correction. (d) − (f) S1, S2 and S3 of the polarization state after the brain tissue when using horizontal polarized illumination before correction. (g) − (i) S1, S2 and S3 of the polarization state following correction. Fig. 9. Stokes Parameters, S1, S2, S3 and DOP comparison before and after correction. Each data point represents the parameter of a sub-region. The bars show mean and standard deviation.

Discussion
The demonstrations present here illustrate possibilities for implementation of APC in different practical scenarios. In principle, for non-diattenuating specimens, there are three unknowns in the Jones matrix, and hence three independent measurements of the output Jones vector are required. If unknown diattenuation were also present, then more measurements would be required to determine the optical properties of the specimen. The number of measurements required in practice depends upon the assumptions one can make about the specimen, where knowledge about, for example, the retardance or orientation of the birefringence can be used. Using such prior knowledge would help increase the speed of operation of the APC system. The current implementation uses sequential measurements with four positions of the rotating waveplate in the PSA for each Stokes vector (or equivalently Jones vector) measurement. If speed was of the essence, then it would be possible to employ other forms of imaging polarimeter for single shot measurement [24,25].
The demonstrations here have concerned purely restoration of the polarization profile of the beam to its desired state. However, as discussed in the introduction, phase aberrations also play an important role in system performance. The methods described in this paper could be combined with conventional phase adaptive optics methods to provide further benefits in system correction.

Conclusion
Through implementation of the APC, we have shown how external complex perturbations of the polarization profile across a beam can be corrected using appropriate feedback from the PSA to the PSG. The system presented here could form the basis of an online polarization compensation system in optical systems that are affected by spatially variant polarization errors. Such an approach would have benefit in applications ranging from quantum optics to microscope imaging.

Funding
European Research Council (ERC) under the Horizon 2020 research and innovation program (AdOMiS, grant agreement No. 695140). China Scholarships Council.