Modeling and performance analysis of Implicit Electric Field Conjugation with two deformable mirrors applied to the Roman Coronagraph

High-order wavefront sensing and control (HOWFSC) is key to create a dark hole region within the coronagraphic image plane where high contrasts are achieved. The Roman Coronagraph is expected to perform its HOWFSC with a ground-in-the-loop scheme due to the computational complexity of the Electric Field Conjugation (EFC) algorithm. This scheme provides the flexibility to alter the HOWFSC algorithm for given science objectives. The baseline HOWFSC scheme involves running EFC while observing a bright star such as {\zeta} Puppis to create the initial dark hole followed by a slew to the science target. The new implicit EFC (iEFC) algorithm removes the optical diffraction model from the controller, making the final contrast independent of model accuracy. While previously demonstrated with a single DM, iEFC is extended to two deformable mirror systems in order to create annular dark holes. The algorithm is then applied to the Wide-Field-of-View Shaped Pupil Coronagraph (SPC-WFOV) mode designed for the Roman Space Telescope using end-to-end physical optics models. Initial monochromatic simulations demonstrate the efficacy of iEFC as well as the optimal choice of modes for the SPC-WFOV instrument. Further simulations with a 3.6% wavefront control bandpass and a broader 10% bandpass then demonstrate that iEFC can be used in broadband scenarios to achieve contrasts below 1E-8 with Roman. Finally, an EMCCD model is implemented to estimate calibration times and predict the controller's performance. Here, 1E-8 contrasts are achieved with a calibration time of about 6.8 hours assuming the reference star is {\zeta} Puppis. The results here indicate that iEFC can be a valid HOWFSC method that can mitigate the risk of model errors associated with space-borne coronagraphs, but to maximize iEFC performance, lengthy calibration times will be required to mitigate the noise accumulated during calibration.


Introduction
With thousands of exoplanets having been discovered primarily via indirect detection methods including transit photometry and radial velocity measurements, further studies are desired to understand the dynamics of planet formation, interactions with debris disks, and aid the discovery of potentially habitable worlds.These studies can be enabled if the challenges of direct-imaging are overcome, of which the two primary challenges are the relatively small angular separation between the host star and the exoplanet as well as the small planet to star flux ratio.For perspective, a Sun-Earth analog at 10 parsecs will have an angular separation of about 0.1 arcsec and a flux ratio of about 10 −10 . 1 While coronagraphs and high-order wavefront control algorithms have been demonstrated under laboratory conditions with ground-based instruments 2,3 , atmospheric turbulence, telescope stability, and absorption in certain bandpasses limit ground-based performance.
A key milestone for direct-imaging will be the launch of the Nancy Grace Roman Space Telescope, which will carry an onboard coronagraph with multiple modes for imaging and spectral characterization. 4hile acting as a technology demonstration, the Roman Coronagraph is expected to bridge the performance gap between current high-contrast imaging capabilities and what is expected for a future 6 meter class Habitable Worlds Observatory (HWO) recommended by the decadal survey to image Earth-like exoplanets. 5Predicted to achieve contrasts on the order of 10 −9 , 6 the Coronagraph Instrument is particularly focused on demonstrating two distinct coronagraph designs, lownoise electron multiplying detectors, and high-order wavefront sensing and control (HOWFSC) algorithms required to suppress speckles from quasi-static aberrations within the optical train.The primary method intended for the HOWFSC scheme has been the use of model-based Electric Field Conjugation (EFC). 7Described in Section 2.1, EFC is combined with Pairwise Probing (PWP) in order to sense and minimize the focal plane electric field using an instrument model.
Currently, EFC is expected to achieve the desired contrasts for Roman.However, the contrast attained by EFC has been demonstrated to degrade, in some cases by an order of magnitude, due to model errors, particularly those associated with the DM translation and rotation. 8This is the motivation to study the alternative implicit EFC method 9 where the Jacobian is constructed entirely from empirical data and inherently includes all perturbations in the optical system.For a spaceborne telescope, iEFC can be a particularly valuable method as it can mitigate the risk associated with instrument performance in the presence of instrument uncertainties.In addition, iEFC does not require the focal plane electric field to be sensed prior to computing the actuator commands.This simplifies the controller because only a single regularization parameter needs to be optimized whereas an implementation of EFC with PWP requires two regularization parameters, one for the initial electric field estimation during PWP and one for the conjugation using EFC. 9 Here, iEFC is extended to use 2 DMs and proven capable of creating an annular dark hole such that it can be applied to the Roman Coronagraph as well as designs for future missions such the HWO.The Wide-Field-of-View Shaped Pupil Coronagraph (SPC-WFOV) mode is chosen because preliminary simulations demonstrated that iEFC is likely not suited to the Hybrid Lyot Coronagraph (HLC) due to the frequent relinearization of the Jacobian required for the HLC if the DM design patterns are not used 10 or are inaccurate. 11Specifically, the empirical calibration of the iEFC Jacobian would likely make repeated relinearizations unfeasible for the HLC because of the required duration of each Jacobian calibration.
Section 2 provides an overview of the EFC and iEFC algorithms, including how an arbitrary basis of modes can be used for each method.Additionally, iEFC is extended to use two DMs and initially demonstrated with a scalar vortex coronagraph (SVC) model.Section 4 then includes a demonstration of EFC for the SPC-WFOV mode that illustrates how instrument perturbations unaccounted for in a model result in contrast degradation and a more complex control scheme.In Section 5, the efficacy of iEFC is tested with monochromatic simulations using multiple modal bases to demonstrate which is optimal for the SPC-WFOV instrument.Section 6 then expands the iEFC simulations for a single narrowband wavefront control bandpass and a broader 10% bandpass.Lastly, Section 7 integrates flux estimates for a reference star and an EMCCD model into the simulations to test the feasibility of iEFC for both bandpasses considered.The results demonstrate that iEFC can be a suitable method for the SPC-WFOV mode and can mitigate the risk of pupil misalignments after the launch of Roman.However, the disadvantage of iEFC will be noise accumulated during calibration and the integration time required to acquire all calibration frames.Given EFC has been rigorously tested and simulated for the Roman Coronagraph and is expected to achieve the desired contrast goals, iEFC should likely be tested during the latter stages of the Roman mission in order to further study the efficacy of the method.This would inform future missions, ideally with less obstructed and larger apertures capable of capturing more photons to reduce calibration times and mitigate the effects of calibration noise.

Definitions and Algorithm
For clarity between the EFC and iEFC, Table 2 in Appendix A has a list of variables used for the formalism of both methods.Variables in bold font represent column vectors, scalars are all lowercase variables, and matrices and scalar fields are all uppercase variables.The precise shape of all matrices is also included Table 2.
The images throughout these simulations are presented in units of normalized intensity (NI), defined as where I image (x, y) is the intensity of a raw coronagraphic image and I uo (x, y) is the intensity of the unocculted on-axis source (no focal plane mask in the optical train).While not a direct measurement of contrast, this metric is closely related and is the same used in FALCO. 12When contrast is referenced in latter sections, it will refer to this definition of normalized intensity.

EFC
Following the formalism of EFC from Give'on et al., 7 the fundamental concept is that the irradiance in the image plane can be minimized by computing DM commands that destructively interfere with the measured electric field. 7This is done by using a model of the instrument to estimate the electric field response of DM modes in the image plane.For a coronagraph, this electric field may be written as some linear operation C[ ] acting on the pupil plane wavefront A(x, y)e iΦ(x,y) where A(x, y) and Φ(x, y) are the scalar fields corresponding to the pupil plane amplitude and phase aberrations respectively.
With coronagraphs comprising multiple relays between pupil planes and focal planes, C[ ] is often a series of Fourier Transforms propagating the wavefront between the transverse planes.For a system with a single DM, the electric field can be written as x,y) ]. (3) Here, Φ DM (x, y) is the phase induced by the surface of the DM expressed as a sum of weighted influence functions F n (x, y) with the expression Assuming that the DM surface imparts a small phase, the DM phasor can be approximated as e iΦ DM (x,y) ≈ 1 + iΦ DM (x, y), allowing for the following simplification to the image plane electric field.
Once sampled by the science camera detector, E im (x, y) is written as the concatenated vector E im containing the real and imaginary components of the electric field at each pixel in the dark hole.The individual terms for the electric field contributed by the system aberrations and the DM influence functions are now written as respectively.Here, G 1 is the Jacobian that transforms the actuator heights of DM1 (A 1 ) into the electric field contributed by the DM at the focal plane.With this, the image plane electric field is written as the following system of linear equations.
As presented in Give'on et al 7 , when a second DM is used outside a pupil plane, this system of linear equations is expanded to include the term G 2 A 2 .While similar to the Jacobian for the pupil plane DM, the Jacobian G 2 includes the angular spectrum propagation affects from the plane of the second DM back to the pupil plane.As a system of linear equations, the two Jacobians can be concatenated to capture the influence of all DM actuators such that the final equation for the image plane electric field is simplified to In the case where an arbitrary basis of DM modes are used instead of individual actuators, this can be written more generally in terms of the modal coefficients m c .The basis of DM modes chosen are referred to as the calibration modes that are contained in the matrix M modes .Note that the shape of the Jacobian will depend on the amount of calibration modes used and the equation for the image plane electric field is then Figure 1 illustrates the typical practices for how EFC is calibrated and performed.Prior to the EFC control loop, the Jacobian is computed using the central difference approximation in Equation 11to estimate the response of the electric field in the image plane for each calibration mode.To do so, the positive and negative calibration modes are applied in a Fourier based optical model with a mode being the chosen calibration amplitude to calculate the fields referenced as E P and E N respectively.While it is possible to estimate the response using the nominal electric field and only applying a single positive or negative calibration mode, the central difference approximation decreases the error from nonlinear terms. 13Each response stored in the Jacobian as a single vector R i,EF where i denotes the index of the calibration mode.
During each iteration of EFC, the solution for modal coefficients to minimize the electric field are commonly found by minimizing a cost function such as where λ is a regularization parameter penalizing the use of large actuator strokes.Throughout the simulations presented, the "β regularization" technique described in Sidick et al 14 is used for both EFC and iEFC simulations.With this technique, the regularization parameter chosen by the user is β.Once specified, the control matrix (M control ) is computed numerically using the equation Here, α is the maximum singular value of the square matrix G ⊺ EF C G EF C .The modal coefficients that minimize the cost function are calculated with the matrix-vector product −M control E ab .These modal coefficients can be transformed into actuator heights using M modes as demonstrated in the following equation.The Jacobian G EF C is constructed by applying positive and negative calibration modes within the model and calculating the electric field at the focal plane.The response/derivative is computed from the difference normalized by the amplitude of the mode applied (a mode ).The EFC controller uses the pseudoinverted Jacobian to compute the update to the DM actuators using the estimated electric field E ab .All boxes in yellow indicate a step that is performed computationally.
A critical component to EFC is how the electric field in the focal plane is estimated prior to the actuator command being calculated.While the Self Coherent Camera (SCC) is a method of estimating the focal plane electric field using interference from a reference channel, 15 the common technique proposed for Roman is Pairwise Probing (PWP). 16This method uses at least two linearly independent DM probe commands to generate phase diversity within the focal plane.For each probe command, two images are recorded, one with the positive probe and one with the negative probe.The difference images of each probe command are then used to estimate the electric field in each pixel of the desired dark hole by solving Equation 16for E ab where δ is the concatenated vector of difference images and M probes is a matrix with the real and imaginary components of the electric field contributed by the DM probes estimated using the instrument model.Solving this system of linear equations requires another pseudo-inverse in which the regularization parameter λ P W P is used to make the algorithm robust against noise.
Various other implementations of PWP have been developed, including extensions to broadband estimation 17 and implementations of a Kalman filter for improved estimation, 18 but all rely on the difference images from pairwise probes.

iEFC
As described in Haffert et al, 9 iEFC includes no explicit calculation of the electric field within each iteration because the electric field is not the the desired control variable, rather, difference images of probes are the control variable.The formalism of PWP demonstrates that difference images of two or more linearly independent probes are related to the focal plane electric field by a linear transformation making them a linear proxy for the electric field.Therefore, minimizing the difference images also minimizes the electric field.
Because the control variable for iEFC is measurable, a Fourier optics model of the instrument is not required to compute the Jacobian.Instead, iEFC is calibrated by measuring the response R i,δ for each calibration mode.Here, the response measured for a single mode is another central difference of the measurements for both the positive and negative calibration mode.Explained by Equation 19, the individual measurements themselves are the difference images δ +j and δ −j .The value of j references which probe the images are acquired for, + and − reference the sign of the calibration mode, while P and N reference the sign of the probe command.Each measured response is now a double difference that is stored into the iEFC Jacobian G IEF C .
Figure 2 illustrates the procedures for calibrating iEFC and closing the loop.Similar to EFC, the cost-function can be defined such that the difference images will be minimized.This cost function can be used to then compute a control matrix for M control .Each iteration of iEFC then  This diagram illustrates the critical steps for generating a Jacobian for iEFC by calibrating a chosen set of DM modes using difference images of probes concatenated into the vectors δ + and δ − .By inverting the Jacobian and measuring δ at each iteration, the difference images are minimized to reduce the electric field amplitude.Note that each measurement of δ is also normalized by the amplitude of the probe (a probe ).consists of measuring the difference images δ and solving for the modal coefficients by multiplying by M control .
The two DM iEFC controller is initially tested using an HCIPy 19 scalar vortex coronagraph (SVC) model to verify the capability of creating an annular dark hole.The model uses a charge 6 vortex with a 90% diameter Lyot stop.The wavelength for the simulation is 650nm with two 34 × 34 actuator DMs.The DM pupil is 10mm in diameter with 300mm separation between the DMs (roughly a Fresnel number of 512).Here, the control region spans from 2λ/D to 10λ/D.The calibration modes chosen are a basis of Fourier modes that span frequencies from 1.5λ/D to 12λ/D.The probes used are two single actuator pokes of adjacent actuators that are indicated by the white circles in Figure 3 on DM1 (bottom left).The choice of Fourier modes, sampling, and probes will be expanded upon in Section 5.While this result is for an ideal monochromatic vortex coronagraph, the application of iEFC with 2 DMs is found to be suitable for annular dark holes.

Roman SPC Physical Optics Model
The HOWFSC simulations performed here make use of an end-to-end physical optics model for the Roman Coronagraph.The model was created using POPPY 20 as the backend physical optics propagation software, but the prescription and data are the same as those in the roman phasec proper (v1.4) package 1 .The motivation for choosing POPPY was to leverage end-to-end simulations entirely on a GPU as CuPy 21 was recently added as a computation feature in POPPY.The GPU computations greatly reducesimulation times and enable a more extensive investigation given the large number of computations required to simulate an iEFC Jacobian.When compared with results of the PROPER model, the mean normalized intensity of the POPPY model was found to be within a percent for an unocculted PSF and within a few percent for a coronagraphic image.More comparisons of the speckles and image morphology has been done in previous works. 22ithin the physical optics model, each optic includes a surface error map that is applied to the wavefront during propagation.In all EFC and iEFC simulations, the the initial state of the Fresnel model includes a DM1 flatmap correcting the pupil aberrations that improves the initial contrast for HOWFSC by more than an order of magnitude.Figure 4 demonstrates the initial images from the model prior to any HOWFSC.The image of the unocculted on-axis source (left) is the reference image to which coronagraph frames are normalized.In the middle is the initial coronagraphic image without correction by a DM1 flatmap followed by the image on the right using the DM1 flatmap.This flatmap is used at the start of all simulations such that HOWFSC requires less stroke and attains better contrasts.

Motivation for iEFC
A risk for the Roman Coronagraph will be how well can the model be calibrated to the instrument once the instrument is in orbit.As such, many efforts have been made to investigate the impact of model errors.Previous simulations and experiments by Sidick et al 14 and Marx et al 23 have demonstrated that using a β scheduling approach can mitigate the impact of model errors because periodically relaxing the regularization parameter β can improve the correction of poorly controlled modes even though overall contrast can degrade.By making the β value more strict again, a better overall contrast can be attained.Effectively, this means model errors can be mitigated given a larger number of iterations to perform HOWFSC.
Figure 5 presents the results of a single case study is investigating the performance of the SPC-WFOV mode in the presence of an unknown lateral shear of the Shaped Pupil Mask (SPM).First, EFC is performed on the SPC-WFOV mode with no model errors.In this scenario, the end-to-end model is used to compute the Jacobian and the same model is then used within the EFC controller.Note that PWP is ignored by using the model to directly compute the electric field from which the actuator commands are calculated, so perfect electric field estimation is simulated.With no model errors, EFC rapidly converges to 1.43 × 10 −10 after just 15 iterations.
For the scenario with an unknown lateral shear of the SPM, the model with no errors is again used to compute the initial Jacobian.However, a second model where the SPM has been shifted by 0.5% of the pupil diameter in the y-direction is used within the EFC controller to compute the electric field and apply the DM commands.In physical units, this shift is about 85microns, which is about 0.25 actuators when projected onto the DM pupil.Because of this unaccounted for error, β scheduling and recomputation of the Jacobian become significant within the EFC controller to obtain adequate convergence.How often to switch regularization along with the values to switch between will depend on the coronagraph and the amount of model error.Here, using a strict β value of -2.5 and a relaxed β value of -5 while alternating every 3 iterations was found to be an effective schedule after trial and error.Additionally, a new Jacobian is recomputed with the nonlinear coronagraph model every 15 iterations because as DM commands accumulate, the previous Jacobian becomes stale and EFC would diverge regardless of the β schedule.After every relinearization, the β schedule is restarted at the strict value of -2.5.Relinearizing more frequently at every 12 iterations was also simulated, but did not yield significant improvements in contrast or convergence.
While this use of β scheduling and recomputation of the Jacobian can mitigate the effect of model errors for EFC, the controller requires more iterations to converge and becomes more complicated with β values needing to be tuned according to the coronagraph and model.The multiple relinearizations also increases the computational requirements of the controller, which can become an issue for a HWO since computations will be done on-board instead of using a ground-in-theloop scheme 24 .Additional methods such as the expectation-maximization technique detailed in Sun et al. 25 have been proposed to recover the state of a system and improve the model Jacobian, but this adds additional complexity to the controller that is not implemented for comparison here.

Monochromatic iEFC Results
Using the SPC-WFOV mode at 825nm, the iEFC Jacobian is generated for three types of modes: Fourier modes, individual actuators, and Hadamard modes.focal plane with a chosen spatial frequency sampling and generating cosine and sine commands corresponding to each of the desired spatial frequencies.The Hadamard modes on the other hand are generated based on the total number of actuators on a DM.
For each modal basis, the same probes are used to generate the difference images of each calibration mode.These are analogous to the same probes that could be used for PWP.Initially, single actuator pokes are used for the probes as these were also used in Haffert et al. 9 However, switching to the Fourier probes depicted in Figure 7 improved the simulations with noise in Section 7 because the flux in the control region is increased, allowing for higher SNR and reduced calibration times.For consistency, these monochromatic simulations also implement the same Fourier probes where each DM command is a weighted sum of cosine and sine modes that span the desired control region.This helps to generate a relatively uniform response in the dark hole.The total sum for each probe is then shifted to a region of the DM where the actuators are not obstructed by the SPM.
Overall, four sets of calibration modes were tested; two sets of Fourier modes, one set of single  actuator pokes, and one set of Hadamard modes.For each set, the calibration amplitude (a mode ) was set to 5nm and the probe amplitude (a probe ) was set to 20nm.These values are chosen based upon the typical range of values used for testbed experiments with iEFC.After each calibration, iEFC is performed for 30 iterations because that is the desired value for the Roman Coronagraph HOWFSC plan. 11When it came to the Fourier modes, two sets were used because the initial set only considered spatial frequencies within the desired control region.This meant that the only controllable frequencies spanned from 5.4λ/D to 20.6λ/D with a sampling of 1λ/D.The result after iEFC yielded a contrast of 4.47 × 10 −10 .However, by using an expanded set of Fourier modes that spanned from 1λ/D to 23λ/D, the final contrast reached is 2.08 × 10 −10 .Figure 8 depicts the two results using both the constrained and extended Fourier modes.In total, the constrained set contained 2552 modes and the extended set contained 3480 modes. .This demonstrates that control of higher and lower spatial frequencies is essential for the HOWFSC method to perform optimally.
For the single actuator modes, the total number of actuators is culled to only the ones within the extent of the geometric pupil, which is about 46.3 actuators across the diameter and totals 1804 actuators on each DM, or 3608 total modes.Using this basis results in a slight improvement over the extended Fourier modes as the final contrast reached is 1.85 × 10 −10 .Lastly, the Hadamard modes are selected by generating a set for each DM.As Hadamard modes are generated in powers of 2 and a single DM is assumed to use 1804 actuators, a single DM uses 2048 Hadamard modes.Calibrating both DMs meant using a total of 4096 modes and the final mean contrast was 1.1 × 10 −10 .Depicted in Figure 9 are the final images for both the single actuator modes and the Hadamard modes.For all simulations of iEFC, the control loop used the same β schedule for one-to-one com-parisons after tuning the values of the scheduler based upon what yielded adequate convergence within 30 iterations. Figure 10 directly compares the performance of iEFC using all calibration modes considered along with the β schedule used.Similar to EFC, a strict value of -2.5 was found to be sufficient to converge without degrading contrast while the relaxed value oscillates from -6 to -5.The final β used is -4 because that was the most relaxed value that could be used on the final iterations while converging and not requiring any more iterations with a value of -2.5.Although all results with iEFC attained similar convergence and final contrast values, the best result was with Hadamard modes.Further tuning of the β values for each modal basis could improve the results individually, but for the one-to-one comparison done here, Hadamard modes proved the most effective.As such, this basis is chosen for the next simulation which includes the same lateral SPM shift that was introduced in the perturbed EFC simulation.The significant difference with iEFC is that the error is present during the calibration given all empirical data would inherently capture the perturbation.For this simulation, the same β regularization schedule was used and the final solutions depicted in Figure 11 achieved a slightly worse final contrast with a value of 1.33 × 10 −10 .While the ideal scenario for EFC achieved the same contrast as the best case of iEFC within 15 iterations, this simulation demonstrates that iEFC is a preferable alternative in the scenario where the instrument is not well calibrated because EFC required 60 iterations with the increased computational complexity of relinearizing the Jacobian regularly.

Broadband iEFC Examples
Given the Roman Coronagraph will have both narrowband filters chosen for wavefront control purposes and broader bandpasses for science observations, additional simulations have been performed for both a wavefront control filter and a science bandpass.Here, filter 4b is chosen as the wavefront control filter with a central wavelength of 825nm and a FWHM of 3.6%. 16For the science filter, a bandpass of 10% is assumed.To simulate a single broadband image, multiple wavefronts are propagated in the physical optics model with wavelengths spanning the chosen bandpass.The final image is an incoherent sum of the wavefronts at the image plane.For the narrowband simulations, 3 equally spaced wavelengths are selected to span the bandpass while 5 wavelengths are selected for the 10% bandpass.Each wavefront is weighted equally in the final incoherent sum, so no variations in the filter transmittance are being considered.The final image using the single narrowband filter (left) illustrates that iEFC reached 1.51 × 10 −9 contrast while the image using the 10% bandpass (middle) has a contrast of 6.25 × 10 −9 .As depicted in the plot of contrast per iteration (right), both converged in 15 iterations.More iterations were attempted while varying the regularization, but better results likely require additional calibrations of iEFC.
After calibrating iEFC for each bandpass, the control-loop is repeated with results depicted in Figure 12.Given that Hadamard modes had the best performance in the monochromatic simulations, that was the chosen modal basis here.After iEFC is performed, the 3.6% bandpass reaches a contrast of 1.51 × 10 −9 while the 10% bandpass reaches a contrast of 6.25 × 10 −9 .Importantly, these are the results after just 15 iterations because convergence was significantly slower after reaching these contrast values.
This demonstrates that even in the full 10% bandpass, iEFC can be capable of reaching below 10 −8 contrast with the SPC-WFOV mode.Additional calibrations of iEFC after converging for a given bandpass could improve broadband iEFC results, but as explained in Section 7, iEFC will likely require lengthy calibration times making recalibration impractical.

iEFC Simulations with Noise
Due to the empirical calibration of iEFC, noise will inherently be included in the Jacobian.To consider the impact of noise, these final simulations consider the same narrowband and broadband cases from Section 6, but flux estimates for a given reference star along with a model of Roman's EMCCD are used to generate more realistic images with photon and detector noise.
Here, ζ Puppis is chosen as the reference star being utilized for wavefront control as it was in the Roman observing scenario simulations. 26As described in Appendix B, the flux for ζ Puppis is computed at each wavelength that will be propagated for the chosen bandpass.The amplitude of each wavefront is then weighted by the square root of the flux estimate for the respective wavelength and propagated to compute an image in units of photons/second/pixel.An additional factor of 0.5 is applied to the flux at the image plane to approximate the throughput losses from reflective surfaces throughout the optical train (note that this is based on a reflectivity of approximately 97.5% for 25 reflective optics).Next, the image plane flux is input into the emccd detect2 software to simulate an image with EM gain and detector noise.The additional parameters chosen to model the EMCCD are provided in Table 1.Again, only Hadamard modes are considered to provide a direct comparison with the noiseless simulations.However, additional methods were implemented during the calibration to prevent both low SNR responses and responses with saturated pixels.The first of these methods is to implement a varying calibration amplitude for modes with a response that is distributed across more pixels in the image.Specifically, the response of each Hadamard mode is first estimated with the magnitude of the mode's Fourier transform.The maximum value of each estimated response is recorded such that the calibration amplitude can be scaled according to the ratio of the maximum for a given mode and the largest maximum recorded.Therefore, the mode with the largest maximum value in it's response uses a calibration amplitude of 5nm, but all others are multiplied by a scaling factor greater than 1.
The second method used to calibrate both bandpasses is to average and stack frames with varying exposure times.This effectively increases the dynamic range of the images because pixels with large flux values do not get saturated at the lowest exposure time, but pixels with low flux values acquire a higher SNR when using the longer exposure times.For both the 3.6% and 10% bandpasses simulated, exposure times of 0.01s, 0.05s, and 0.1s are stacked to generate the final image.The number of frames for each respective exposure time are 10, 4, and 2. The total integration time for each calibration frame is then 0.5s, so to calibrate all 4096 Hadamard modes is estimated to require about 6.8hrs of data acquisition.Note that to perform full broadband control using all three narrowband wavefront control filters will require 3× the integration time, so a total of 20.4hrs, but this is not simulated here.Here, the EM gain used for all frames in the 3.6% bandpass is 250 and the EM gain for frames in the 10% bandpass is 100.
Figure 13 depicts a useful visualization for the quality of the calibration.Each image in Figure 13 illustrates the normalized RMS response of each actuator on DM1.In the case without any noise, the obstructed actuators have a considerably attenuated response while the two scenarios with noise have a relatively constant bias that is a direct result from noise during calibration.When using the 10% bandpass, the bias of the obstructed actuators is slightly less due to the higher SNR achieved by capturing more photons.Because of the noise accumulated during calibration, we see additional degradation in the performance of iEFC as presented in Figure 14.With the narrowband filter, the contrast converged to 9.68 × 10 −9 while the 10% bandpass reached 1.76 × 10 −8 .Each simulation only used 30 iterations because the convergence of iEFC became stagnant even when the regularization value was varied.
These simulations demonstrate the disadvantage of iEFC which is the noise accumulated during calibration.Possible mitigation strategies could be a smarter choice of EMCCD parameters including the use of higher gain values and photon counting to reduce detector noise, using a brighter reference star (but this will depend on the desired target star and stability of the optical assembly), using longer integration times for calibration, or choosing a more optimal set of modes for the controller.In any case, additional techniques should be investigated to mitigate the impact of noise in the calibration of iEFC if it is to be implemented by Roman.

Conclusion
The iEFC algorithm is an exciting method for the high-contrast imaging community.Like EFC, iEFC is naturally extended to coronagraphs with two DMs and capable of digging annular dark holes.This makes iEFC a potential method for the Roman Coronagraph and future coronagraphs for the HWO.Here, the efficacy and potential benefits of iEFC have been investigated specifically for the SPC-WFOV mode due to the large linear regime of the DMs.The simulations demonstrate that contrasts comparable to those of EFC can be achieved in the ideal monochromatic scenario and that Hadamard modes are the most effective for the control-loop.More significantly, iEFC would reduce the risk of unknown system perturbations that would otherwise require a more complicated β scheduling method, more iterations, and greater computational complexity due to relinearizations of the Jacobian.By inherently including the state of the instrument during calibration, iEFC does not need to be relinearized for coronagraphs with large linear regimes such as the SPC-WFOV mode or a vortex coronagraph as simulations here demonstrate that adequate convergence can be obtained within 30 iterations.
Additional simulations demonstrate that iEFC can be calibrated and performed with both a narrowband filter and a broadband filter, but the performance of iEFC degrades due to the incoherent superposition of wavelengths.Further simulations including the EMCCD model predict that contrasts of 10 −8 can be achieved within 30 iterations after calibrating for an estimated time of 6.8hrs when using ζ Puppis as the reference star.Further investigations including more optimal EMCCD parameters, smarter choice of calibration modes, and improved calibration techniques could reduce the calibration time and improve the final contrast, but other factors such as system drift during calibration should also be considered in the future.Given the simulation results for the time being, the SPC-WFOV mode is a suitable instrument to perform iEFC tests during the latter stages of the Roman mission in order to inform the WFSC strategies for future coronagraphs such as those considered for the HWO.
This study utilized High Performance Computing (HPC) resources supported by the University of Arizona TRIF, UITS, and Research, Innovation, and Impact (RII) and maintained by the UArizona Research Technologies department.This research made use of community-developed core Python packages, including: POPPY, 20 Astropy, 27 Matplotlib, 28 SciPy, 29 Ray, 30 and the IPython Interactive Computing architecture. 31Lastly, A.J. Riggs, Jaren Ashcraft, Kevin Derby, Leonid Pogorelyuk, Aaron Goldtooth, and Ranger Maxwell have contributed through helpful discussions regarding simulations and wavefront control throughout the span of this research.9 Code, Data, and Materials Availability All the code for simulations is made available through public repositories.The repository containing the end-to-end diffraction model constructed with POPPY can be found on Zenodo at https://zenodo.org/record/8302380. 32 Similarly, the repository containing the simulation material can be found at https://zenodo.org/records/8302359. 33 The associated data that is required for the diffraction model along with the data obtained using iEFC can be found at https://github.com/kian1377/cgiphasec poppy data.

Appendix A: Definitions
The variables used for the formalism of EFC and iEFC are summarized here.The shapes of the matrices and vectors are also included to clarify how the algorithms are implemented (Table 2).star calculated with the equation Here, R is the radius of the star and d is the distance to the star, both of which are included in Table 3.The spectral photon flux is calculated by converting the spectral irradiance using E = hc/λ.Lastly, the spectral flux is integrated over several sub-bandpasses to estimate the flux for each wavelength that is propagated.Figure 15 presents an example of the spectral photon flux computed for ζ Puppis and 7 sub-bandpasses that would be integrated to estimate the photon flux for those 7 wavelengths.

Fig 1 :
Fig 1: This diagram illustrates the functional steps for model-based EFC.The Jacobian G EF C is constructed by applying positive and negative calibration modes within the model and calculating the electric field at the focal plane.The response/derivative is computed from the difference normalized by the amplitude of the mode applied (a mode ).The EFC controller uses the pseudoinverted Jacobian to compute the update to the DM actuators using the estimated electric field E ab .All boxes in yellow indicate a step that is performed computationally.

Fig 2 :
Fig 2: This diagram illustrates the critical steps for generating a Jacobian for iEFC by calibrating a chosen set of DM modes using difference images of probes concatenated into the vectors δ + and δ − .By inverting the Jacobian and measuring δ at each iteration, the difference images are minimized to reduce the electric field amplitude.Note that each measurement of δ is also normalized by the amplitude of the probe (a probe ).
Fig 3: Annular dark hole created using iEFC with a scalar vortex coronagraph model where the final mean contrast is 4.94 × 10 −10 after 30 iterations.The two white circles on the first DM indicate the actuators that are used as probes.

Fig 4 :
Fig 4: These images depict the initial state of the physical optics model prior to any HOWFSC.The image of the unocculted on-axis source (left) is the reference image to which coronagraph frames are normalized.In the middle is the initial coronagraphic image without correction by a DM1 flatmap followed by the image on the right using the DM1 flatmap.This flatmap is used at the start of all simulations such that HOWFSC requires less stroke and attains better contrasts.

Fig 5 :
Fig 5: When no model errors are simulated, EFC converged to the result in the top-left after just 15 iterations.When introducing the SPM shear of about 85um, the result in the bottom-left was attained after 60 iterations.The top-right plot illustrates the mean contrast per iteration for both simulated scenarios.The bottom right plot presents the β regularization value used during each iteration and the green lines represent each iteration at which the Jacobian was recomputed using the nonlinear coronagraph model.

Fig 6 :
Fig 6: The images above depict examples of a Fourier mode and a Hadamard mode.The Fourier mode is a particular cosine corresponding to a specific spatial frequency that will be used within the control loop.The Hadamard modes are binary commands that span the entire vector space of DM commands.

Fig 7 :
Fig 7: These probe commands are each a weighted sum of cosine and sine Fourier modes that have been shifted to a region of actuators not attenuated by the SPM.The first probe is solely a superposition of cosine Fourier modes (left), the second is an equal superposition of cosine and sine modes (middle), while the final probe is only a superposition of sine modes (right).The difference images of each probe are measured to generate a response or compute modal coefficients.

Fig 8 :
Fig 8:The iEFC solutions with Fourier modes using only the spatial frequencies of the control region only converge to a final contrast of 4.47 × 10 −10 while the solutions with extended Fourier modes reach 2.08 × 10 −10 .This demonstrates that control of higher and lower spatial frequencies is essential for the HOWFSC method to perform optimally.

Fig 10 :
Fig 10: Presented here are the mean contrasts and the respective β values per iteration for each modal basis tested.While the margins between the various modal bases are narrow, it remains notable that the best contrast achieved was 1.11 × 10 −10 with Hadamard modes.
Fig 11: After simulating iEFC with the same SPM shear introduced in the EFC simulations, a much smaller contrast degradation is noticed with the final contrast now being 1.33 × 10 −10 .
Fig 12:The final image using the single narrowband filter (left) illustrates that iEFC reached 1.51 × 10 −9 contrast while the image using the 10% bandpass (middle) has a contrast of 6.25 × 10 −9 .As depicted in the plot of contrast per iteration (right), both converged in 15 iterations.More iterations were attempted while varying the regularization, but better results likely require additional calibrations of iEFC.

Fig 13 :
Fig 13:After calibrating iEFC while including noise, the RMS response of DM1 actuators provides a useful visualization of the quality of calibration.On the left is the RMS response with a noiseless calibration while the middle and right show the RMS responses after calibrating the 3.6% and 10% bandpasses with noise.The constant bias of the obstructed actuators is a direct result of the noise from calibration.Here, the simulation of the 10% bandpass has a slightly lower bias than the 3.6% bandpass because the additional photons improved the SNR.
Fig 14: With noise implemented, iEFC reached 9.68 × 10 −9 using the 3.6% bandpass (left) while 1.76 × 10 −8 was reached with the 10% bandpass (middle).Here, 30 iterations were used for each simulation because the noise from the calibration degraded the convergence for each bandpass.

Fig 15 :
Fig 15: This is an example of the spectral flux computed for ζ Puppis using blackbody equation.The highlighted regions illustrate the sub-bandpasses integrated to estimate flux-values for individual wavelengths centered at each sub-bandpass.Note that the peak of the blackbody is located at about 200nm due to the temperature of the star.

Table 1 :
Below are the parameters used to model the EMCCD.The bias is chosen based on the current best estimate of read noise for the CGI EMCCD.

Table 3 :
The parameters used to calculate the spectral radiance of ζ Puppis are presented below along with the final solid angle used to calculate flux.