<p> </p>
<p>High-speed adaptive correction of optics, based on real-time metrology feedback, has benefitted numerous scientific communities for several decades. However, it remains a major technological challenge to extend this concept into the hard X-ray regime due to the necessity for active mirrors with single-digit nanometer height errors relative to a range of aspheric forms. We have developed the first high-resolution, real-time, closed-loop “adaptive” optical system for synchrotron and X-ray free electron laser (XFEL) applications. After calibration of the wavefront using X-ray speckle scanning, the wavefront diagnostic was removed from the X-ray beam path. Non-invasive control of the size and shape of the reflected X-ray beam was then demonstrated by driving a piezoelectric deformable bimorph mirror at ~ 1 Hz. Continuous feedback was provided by a 20 kHz direct measurement of the optical surface with picometer sensitivity using an array of interferometric sensors. This enabled a non-specialist operator to reproduce a series of pre-defined X-ray wavefronts, including focused or non-Gaussian profiles, such as flat-top intensity or multiple split-peaks with controllable separation and relative amplitude. Such changes can be applied in any order and in rapid succession without the need for invasive wavefront diagnostic sensors which block the X-ray beam for scientific usage. These innovations have the potential to profoundly change how X-ray focusing elements are utilized at synchrotron radiation and XFEL sources and provide unprecedented dynamic control of photon beams to aid scientific discoveries in a wide range of disciplines.</p>