High-Fidelity Control of Spin Ensemble Dynamics via Artificial Intelligence: From Quantum Computing to Imaging


 High-fidelity control of spin ensemble dynamics is essential to many fields, spanning from quantum computing to optical, coherent, and nuclear magnetic resonance (NMR) spectroscopy and imaging (MRI). However, attaining robust and high-fidelity quantum spin operations remains an unmet challenge. Using a combination of an evolutionary algorithm and artificial intelligence, we designed time-optimal, radio frequency (RF) pulses with tunable spatial or temporal field inhomogeneity compensation and fidelity for unitary operations up to 0.9999. As a benchmark, we constructed a spin entanglement operator and a programmable quantum state creator for a weakly-coupled two-spin-1/2 system. We achieved high-fidelity transformations under multiple inhomogeneity sources. The newly designed RF pulses are more robust and less prone to imperfection than the commonly used shapes for basic liquid-state NMR experiments and reduce RF artifacts in MRI. This new strategy will enable the design of efficient quantum computing opera-tors as well as new spectroscopic and imaging techniques.


INTRODUCTION 1
High-fidelity control of quantum spin systems is at the foundation of many applications such as 2 quantum computing, coherent and optical spectroscopies, as well as nuclear magnetic resonance 3 (NMR) spectroscopy and imaging (MRI) [1][2][3][4] . Spin operations such as excitation, inversion, refo-4 cusing, etc. are central to these techniques and are achieved by applying radiofrequency (RF) 5 pulses of finite length and amplitude. However, the RF and external field inhomogeneities and 6 finite pulse width effects make the coherent manipulation of spin ensemble dynamics rather chal-7 lenging 5 . The latter affects quantum operations' fidelity, such as gates, on-demand entangled 8 state generation, and coherent control 1,6,7 . MRI and NMR at high-and ultra-high fields are also 9 affected by these experimental errors as they require high operational fidelity levels for coherent 10 and high-efficiency control of heterogeneous spin ensembles 8,9 . Moreover, these imperfections 11 accumulate in multi-pulse experiments, leading to low fidelity operations and sizable signal 12 losses 10 . Although advanced computational techniques have been instrumental for designing 13 compensated RF pulses such as composite, adiabatic, and numerically-optimized pulses 5,11-17,18 14 , the fidelity and compensation levels for instrumental inhomogeneities achieved are still inade-15 quate to perform spin operations for reliable quantum computing. 16 Here, we introduce a novel strategy to achieve high fidelity control of spin ensemble dy-17 namics with a high-level compensation for inhomogeneity and offset effects, reaching an unprec-18 edented level of fidelity for several spin operations. We combined an evolutionary algorithm with 19 artificial intelligence to accomplish this task, generating a family of time-optimal phase shapes 20 with constant amplitude to reach an operational fidelity higher than 0.9999. These RF shapes 21 display a smooth profile and are symmetric for all universal flipping operations with high tolerance 22 against random noise. We demonstrated our approach's versatility by designing several spin op-23 erations for selected applications, including the generation of quantum spin entanglement, liquid-24 state NMR spectroscopy, and magnetic resonance imaging. 25 26 IFSA and ISCA optimization network that generates the OPS in which each shape is connected 23 to a family of shapes by iterative forward or reverse search schemes. The smoothness of phase 24 shape can be estimated by calculating the average phase difference (APD): 25 where n is the number of points in the phase shape, and ϕ j is the phase's j th point. To demonstrate 2 the smoothness of GENETICS-AI pulses, we calculated the APD values for a series of 500-point 3 universal π pulses, which are tolerant to changes in RF amplitude up to ±10% (Supplementary 4 Figs. 4a-b). As expected, the APD value increases with the bandwidth, indicating higher geomet-5 rical complexity of the phase shape at larger bandwidth. For a 500-point phase shape with random 6 numbers, the APD value is 120°, whereas the GENETICS-AI pulses designed for NMR spectros-7 copy the APD value is less than 10°. In addition to their smooth shapes, GENETICS-AI pulses 8 are highly tolerant of random noise on phase or amplitude shape, which dramatically affects the 9 operational fidelity. To test the robustness to these imperfections, we added random numerical 10 noise to the amplitude and phase of a GENETICS-AI pulse and evaluated changes in its opera-11 tional fidelity. Supplementary Figs. 4c-e shows a universal π pulse with a bandwidth of 100 kHz 12 and RF amplitude (ω 1 ) of 25 kHz that performs spin operations with a fidelity of 0.999 in the 13 absence of noise. Upon addition of noise, with an amplitude of 5 kHz (20%), the fidelity drops by 14 only 0.014 (i.e., 0.985), demonstrating a high tolerance to random sources of noise. A similar 15 scenario is anticipated for simultaneous errors in amplitude and phase shape. To assess the 16 refocusing pulses' performance obtained with GENETICS-AI, we compared several of these 17 shapes to best-performing pulses reported in the literature 15,16,[19][20][21][22][23] . We tested the length, opera-18 tional bandwidth, and average fidelity of these pulses (Supplementary Fig. 5 and supplementary 19 Table 2). For all the shapes tested, the GENETICS-AI pulses show higher fidelity and shorter 20 duration. The new pulses are time-optimal and tunable for any operational fidelity and, which 21 enables one to perform refocusing operations up to 220 kHz bandwidth, with a pulse length of 4 22 ms and a maximum RF amplitude of 10 kHz. Note that when using higher resolution RF shapes, 23 the maximum bandwidth can be further improved. 24 25 CHCl 3 (Figs. 1d). As a metric for robustness, we simulated a 0.99 fidelity iso-surface of GEN-1 Entangler for the simultaneous triple compensation of Δω 1 , Ω, and ΔJ, and compared it with a 2 standard C-NOT entangler with rectangular pulses (Fig. 1f). We then experimentally generated 3 six entangled states by detuning the pulses' calibrated optimal values and performed the quantum 4 state tomography. The yellow outer iso-surface in Fig. 1f represents the fidelity volume obtained 5 with the GEN-Entangler for n = 2. In contrast, the inner red surface represents the fidelity volume 6 corresponding to the standard C-NOT entangler using rectangular RF pulses. Considering the 7 maximum levels of inhomogeneity for all three parameters, the fidelity volume obtained by GEN-8 Entangler is approximately 100 times larger than the corresponding rectangular shape pulse. For 9 an iso-surface fidelity of 0.98, the volume ratio, V GEN /V RECT , increases up to 200 times (Fig. 1g), 10 demonstrating that the new entangler has a significantly higher tolerance for experimental errors. 11 Note that the GEN-Entangler sequence is ~62% shorter than the ΔJ compensated Controlled-12 NOT gate sequence by Jones et al. 31 ; therefore, it has an additional advantage in terms of time 13 duration. 14 1 Creation of High fidelity broadband pulses with a generalized flip angle. Generalizing broad-2 band (BB) operations for an arbitrary flip angle is quite challenging, as it requires individual opti-3 mization for the desired flip angle or final state 32 . Nonetheless, GENETICS-AI was able to create 4 High fidelity BB pulses for any arbitrary flip angle or final state. Our algorithm generated an optimal 5 phase surface (OPS) with smooth phase shapes vs. flip angle transitions (Figs. 2a-b). The neural 6 network trained on this OPS library created BB RF shapes for any flip angle with a fidelity greater 7 than 0.9999. We implemented this RF pulse generator in two different ways: as a programmable 8 single qubit quantum state creator and a quantum gate generator. The former assumes an initial 9 state | α>, whereas the latter consists of a BB universal flipping operation (Figs. 2a-b). Notably, 10 the pulse length is independent of the flip angle or spin state. This feature is critical for quantum 11 computing as these pulses' fixed-length removes any inhomogeneity associated with changes in 12  Table 1. b, J response curve of entanglement fidelity for n = 1, 2 and 4. c, RF shapes and fidelity profiles used in GEN-Entangler for n = 2. d, CHCl3 molecule used for validating the GEN-Entangler pulse sequence. e, Quantum state tomography for the real and imaginary part of the |αα⟩ pseudo pure state created on 1 H and 13 C nuclear spins. f, Simulated iso-surface at 0.99 fidelity for entanglement creation at n = 2 (outer surface -yellow) and standard C-NOT entangler with rectangular shaped pulse (inner volume -red). The quantum state tomography results for simulated inhomogeneities on the surface of the 0.99 fidelity iso-surface for both extreme values of all three variables are shown in blue. All the experiments were performed on a Bruker 900 MHz spectrometer at 300K. g, Fidelity volume fraction for entanglement creation with GEN-Entangler (VGEN) and standard rectangular pulse sequence (VRECT) for a fidelity of 0.995, 0.99, and 0.98. High fidelity Broadband RF pulses for liquid-state NMR at high magnetic fields. We also 6 explored the phase space for typical RF pulse operations used in high-resolution liquid-state NMR 7 spectroscopy. For quantum computing achieving the highest fidelity of pulse operations is critical, 8 on the other hand, for liquid-state NMR spectroscopy, it is crucial to tune the fidelity to match the 9

Fig. 2 | Broadband high-fidelity arbitrary flip angle pulses generated with GENETICS-AI. a,
Optimal phase surfaces (OPS) of a broadband arbitrary state preparation with fidelity > 0.99999. The y axis represent the zenith angle (ζ) of the final state. The OPS was generated with an initial state fixed at | ⟩ and varying the ζ from 0 to π iteratively. The total nutation angle of the pulse was fixed at 8.68π for all states. b, OPS for universal flipping operation with fidelity > 0.9999. The y axis represents the flip angle (θ) of the pulse. The OPS was created with the flip angle as a target variable. The total nutation angle for the operation was fixed at 11.42 π. c, Bloch sphere trajectories of 4 different state preparation labelled as A, B, C and D using RF shapes from the OPS shown in a. d, Bloch sphere trajectories of 2 different flipping operations from A and A' to B and B' using RF shape from the OPS shown in b. All trajectories are trimmed to show only 10% of the initial and final part. e, RF shape of 113.5° universal flipping for a bandwidth of 50 kHz. The RF amplitude is constant at 25kHz. f, 2D fidelity profile of the RF shape shown in c.
spin systems' relaxation features and maximize the signal-to-noise ratio (S/N). The intrinsic flexi-1 bility of the IFSA and ISCA modules of GENETICS-AI enables one to tune RF shapes for any 2 given operational fidelity. To demonstrate this feature, we generated several OPS libraries with 3 fidelities varying from 0.9 to 0.99999. The OPS for BB inversion pulses for different cutoff fidelities 4 is shown in supplementary Fig. 6a. Using numerical fitting, we obtained an empirical relationship 5 between the operational fidelity (F) of the RF pulse with total nutation angle (Θ): 6 where and are the slope and intercept functions that depend on the bandwidth (BW), RF 8 amplitude, and compensation level. As shown in equation 2, the total nutation angle, Θ, increases 9 linearly with − (1 − F ). This empirical relationship still holds for universal π pulses; however, 10 it may significantly deviate from the linear response at higher bandwidth due to the RF pulses' 11 digital resolutions ( Supplementary Fig. 6b). It is possible to avoid this issue by increasing the IFSA and ISCA optimization modules explore the phase space of any operation up to the limit 19 imposed by the digital resolution of a specific shape, i.e., the number of points (n) used to faithfully 20 represent a given shape. For example, we performed multiple optimizations of BB inversion 21 pulses with digital resolutions n = 16, 26, 50, 76, and 100. The IFSA/ISCA optimization progress 22 for these operations are shown using the 'Θ-Bandwidth' plot, where Θ is the total nutation angle 23 ( Supplementary Fig. 8). In this case, we observed a linear relation between Θ and bandwidth, 24 indicating that the bandwidth increase is constant for a unit change in pulse length or amplitude. 25 At higher bandwidth, the relationship is no longer linear. The slope of the curve decreases, as 1 shown in supplementary Fig. 8a, which significantly increases the RF power requirement to excite 2 the specific bandwidth. The linearity holds up to BW max (maximum bandwidth) and increases with 3 the shape's digital resolution ( Supplementary Fig. 8b). As the bandwidth increases, the shape's 4 geometrical complexity increases and requires more shape points for its faithful representation. 5 The 'Θ-bandwidth' plot for ultra-broadband universal π and inversion pulses are shown in supple-6 mentary Fig. 8c. Supplementary Fig. 9 shows the increased geometrical complexity of RF shape 7 with bandwidth for the universal π and inversion pulses. To achieve a bandwidth of 20 x ω 1 for a 8 universal π operation, it is necessary to increase the shape resolution to 2000 points. In supple-9 mentary Fig. 10, we report an ultra BB excitation pulse of 500 points, which can excite a bandwidth 10 of 22 x ω 1 . This pulse is equivalent to an in-phase excitation bandwidth of 550 kHz using a 440 11 μs pulse duration (ω 1 = 25 kHz). We experimentally tested this BB pulse by recording a proton 1D 12 spectrum of uniformly 15  . As expected, we observed a loss of signal intensity for the ultra BB pulse due to the 17 relaxation during the pulse execution. Nonetheless, the power required for these BB pulses is 18 only 6.57 mW, while a corresponding rectangular shape pulse would need 7.3 W to excite the 19 same bandwidth. 20 We also tested the compatibility of our new pulses with multi-pulse NMR experiments. 21 Specifically, we implemented RF inhomogeneity-compensated BB π/2 and π pulses into the 2D 22 for biomolecular liquid-state NMR spectroscopy 34-36 . Fig. 3a shows the new RF phase shapes 24 designed to compensate inhomogeneity in RF amplitude up to ±20% and an excitation bandwidth 25 covering the full chemical shift range of 1 H and 15 N for a Larmor frequency up to 1.2 GHz, which 1 is the highest magnetic field commercially available. The relatively short length of these pulses (~ 2 500 μs for ω 1 = 12.5 kHz for 1 H and 5.8 kHz for 15 N) makes them a robust alternative for the most 3 widely used sensitivity enhanced version of HSQC at magnetic fields at a Larmor frequency 4 greater than 1.2 GHz. 5 6 For comparison, we used the classical HSQC experiment with pulse field gradient (PFG) coher-7 ence selection and the corresponding version with the BB GENETICS-AI pulses (GEN-HSQC). 8 We acquired the amide fingerprint spectra of U-15 N UBI K48C 37 . Fig. 3c shows the 2D GEN-HSQC 9

Fig. 3 | RF inhomogeneity compensated high-resolution multi-pulse NMR experiment. a, GENET-
ICS-AI shapes for universal π and π/2 pulses for 1 H (blue) and 15 N (red) channels. RF amplitudes were constant at 12.5 and 5.8 kHz for 1 H and 15 N channel, respectively. The pulse lengths for π/2 and π pulses were 488.6μs and 509.8μs for 1 H and 483.8μs and 524μs for 15 N. b, Simulated fidelity profiles for 1 H (blue) and 15 N (red) for the pulse shapes in a. The inner contour level indicates a fidelity of 0.99. c, GENETICS-AI version of the HSQC (GEN-HSQC) spectrum of 15 N labeled K48C mutant of Ubiquitin recorded using calibrated amplitude values for 1 H (12.5 kHz) and 15 N (5.8 kHz) channels on a Bruker 850 MHz spectrometer at 300K. The insets show the intensity comparison of the standard 'hsqcet-fpf3gpsi2' version ( ) and GEN-HSQC ( ) at different RF amplitudes for selected residues. Left y axis shows the normalized peak intensities of standard (blue) and GEN-HSQC (red) relative to the calibrated reference spectra ( 0 and 0 ), whereas the right y axis represents the normalized intensity of standard HSQCs (blue) with respect to 0 . spectra recorded on U-15 N UBI K48C with calibrated RF amplitudes of 12.5 and 5.8kHz for 1 H and 1 15 N, respectively. To assess the BB pulses' tolerance for RF amplitude inhomogeneity on both 1 H 2 and 15 N channels, we scaled the RF pulse amplitudes in steps of 5% up to ±20% while keeping 3 their length constant. The insets of Fig. 3c show the comparison of representative resonance 4 intensities of the GEN-HSQC spectrum ( ) vs. the standard HSQC experiment ( ). Overall, 5 the spectrum acquired with the GEN-HSQC sequence displays a higher S/N ratio, with a signifi-6 cantly higher tolerance for RF inhomogeneity. Remarkably, the relative intensity of the GEN-7 HSQC is higher than the classical HSQC, even at fully calibrated RF amplitudes. The gain in 8 sensitivity observed with the GEN-HSQC sequence can be attributed to the combination of high-9 fidelity pulse operation and RF inhomogeneity compensation. For HSQC with standard rectangu-10 lar-shaped pulses, the intensity for residues near the 1 H carrier frequency is ~0.8 and drops to 11 ~0.5 for off-resonance irradiation relative to GEN-HSQC. For an attenuation of ±20% of the hard 12 pulses, the amide peaks are barely observable, whereas the signal intensities for the GEN-HSQC 13 show a constant response. We also tested the performance of GEN-HSQC on the catalytic sub-14 unit of cAMP-dependent protein kinase A (PKA-C, Supplementary Fig. 11). For this larger protein 15 (42 kDa), the GEN-HSQC spectrum shows a higher S/N ratio and detects additional amide peaks 16 that are not observable with the standard HSQC experiment. The dramatic drop in peak intensities 17 observed in the standard HSQC experiment is due to the accumulation of pulse imperfections 18 over multiple pulses on both channels, i.e., ten pulses for 1 H and seven for 15 N. 19 Finally, we demonstrated the ultra-high RF inhomogeneity compensation of GENETICS-AI pulses 20 by Spin Echo imaging, where we simulated the effect of RF inhomogeneity by scaling the RF 21 pulse amplitudes up to ±100%, keeping the pulse length constant. Fig. 4a shows a RF inhomo-22 geneity-compensated SE sequence (GEN-SE) used to image a phantom constituted by two 4mm 23 glass beads immersed in a 5mm Shigemi NMR tube filled with 10% D 2 O and 90% H 2 O (Fig. 4b). 24 The 1D image of the phantom along the z-direction using the SE sequence with standard rectan-1 gular-shaped pulses is shown in Fig. 4c. The pulse shapes and their fidelity profiles are shown 2 illustrated in Supplementary Fig. 13. The intensity of the image acquired with the standard rec-3 tangular pulse version of SE becomes significantly lower with RF amplitude scaling (Fig. 4d). In 4 contrast, the GEN-SE generates high-quality images with less artifacts, even at ω 1 inhomogeneity 5 of ±80% (Fig. 4e).

| Spin Echo
Imaging at ultra-high RF inhomogeneity. a, Spin-echo (SE) pulse sequence used for imaging. The π/2 and π pulses are replaced with GENETICS-AI pulses for GENETICS version of SE sequence. The amplitude of the pulses are constant (16.67 kHz) and pulse lengths for π/2 and π pulses are 437 μs and 567 μs, respectively. The maximum RF amplitude tolerance level (Δω 1 ) of these pulses were ±80%. The gradient strengths (G1 and G2) for all the experiments were set at 50% (3.3 G/cm). b, Diagram of phantom and coil geometry. The phantom consists of two glass beads of 4 mm diameter in a 5 mm Shigemi tube filled with 10% D2O and 90% H2O. c, 1D image of the phantom using the pulse sequence in a. d, RF inhomogeneity response of 1D imaging using standard rectangular shaped pulses of amplitude 16.67 kHz. e, Same as d using GENETICS-AI pulses. The RF shapes and their fidelity profiles are shown in supplementary Fig. 13. The experiments were performed in a Bruker 900 MHz NMR spectrometer.
The combination of a novel evolutionary algorithm and artificial intelligence presented here 1 enables the optimization of spin operations with high fidelity in the presence of different sources 2 of inhomogeneity. The operational fidelity, bandwidth, RF inhomogeneity compensation, and flip 3 angle are customizable to meet various applications' requirements. The latter is achieved via the 4 forward and reverse optimization coupled with a neural network that generates time-optimal 5 phase shapes in a few milliseconds. The fast generation of the RF pulse is of paramount im-6 portance for building a programmable quantum compiler. As an example, we created a high- for high and ultra-high fields, which are notoriously arduous to achieve for spectroscopy 5,42 . A 20 similar level of control can be achieved for liquid-state NMR experiments, which involve large 21 ensembles of nuclear spin quantum processors in a highly mixed state. The new GENETICS-AI 22 pulses show an increased sensitivity for multi-pulse NMR experiments that will improve their per-23 formance at ultra-high magnetic field strength (see supplementary Fig. 14). 24 Deep reinforcement learning or simple neural network have been used in specific pulse 1 optimization cases 43 or for predicting multidimensional RF pulses for imaging 44,45 ; however, GE-2 NETICS-AI is the first implementation of artificial intelligence for the design of general spin oper-3 ations. The neural network built into GENETICS-AI is trained by an extensive library of realistic 4 RF pulse shapes and performance profiles to generate pulses with smooth phase shapes and 5 constant amplitude. These features improve the experimental fidelity by reducing pulse transient 6 effects 46 . 7 In conclusion, the combination of genetic algorithm and artificial intelligence showed that 8 it is possible to control the spin dynamics of heterogeneous spin ensemble with a fidelity up to 9 0.99999 by evolving the phase shape of RF pulse. The robust spin entangler and programmable 10 quantum compiler originated by GENETICS-AI will have an immediate application for quantum 11 information processing. Moreover, the customizable bandwidths, inhomogeneity compensation 12 levels, and fidelity of the operation will perform highly sensitive biomolecular NMR experiments at 13 ultra-high fields (> 1.

METHODS 1
Architecture of GENETICS-AI. The architecture of GENETICS-AI is reported in Extended Data 2 Fig. 1.  3 4 Input module: The first module consists of a customizable input interface in which the user de-5 fines the specific problem to be solved. The input parameters are: 6 1) Operator type: desired pulse operation, i.e., excitation, inversion, universal π, π/2, π/3 and 7 π/4 pulses. 8 2) Maximum RF amplitude: maximum allowed peak amplitude of the shape. 9 3) Operational bandwidth: desired bandwidth for the pulse operation (kHz).  Algorithm) that perform optimal conversion of a resource into a target variable, generating a family 4 of solutions, i.e., optimal phase surface or OPS. The resource variable provides the range of 5 maximum RF amplitude or pulse length for the IFSA-ISCA to explore. In contrast, the target vari-6 able is set according to the problem type, such as operational bandwidth, fidelity, and compensa-7 tion levels for various inhomogeneities. The individual solutions in OPS are interconnected 8 through the iterative forward and backward optimization network of IFSA-ISCA. These algorithms' 9 primary objective is to maintain a minimum fitness value for the optimization network by altering 10 the variable's value outside the optimal space and performing further optimization.  Fig. 2a). ISCA optimization is initialized with bandwidth (BW) and Θ of a standard 3 rectangular π pulse. The algorithm performs the first iteration by perturbing the BW by ε. The 4 small increase in bandwidth reduces the fitness value of the RF shape. At this point, IFSA tries to 5 maintain the fitness of the shape by increasing Θ, a step which is followed by Broyden-Fletcher- attains a cutoff fitness value, bandwidth will be perturbed again and undergoes the same optimi-1 zation process. The evolution of broadband pulse is monitored by 'Θ -BW' plot (Extended Data 2 Fig. 2b). The forward search of IFSA is coupled with a self-correction protocol that initiates an 3 ISCA to keep the time-optimal trajectory. Once initiated, ISCA performs reverse iterations by re-4 ducing Θ in small steps. As in the IFSA case, the system compensates for the loss in fitness by 5 reducing bandwidth by ε. Once the system reaches the fidelity cutoff, the iterative reverse search 6 continues until the reverse trajectory meets the forward (Extended Data Fig. 2b). This adiabatic 7 transition of optimal RF shape from low to high bandwidth continues until the IFSA-ISCA reaches 8 the maximum bandwidth imposed by the digital resolution of the pulse shape ( Supplementary Fig.  9 8a). The self-correcting protocol is based on a simple philosophy that if the nth step's fidelity is 10 more than expected, the previous steps may not be time-optimal. Therefore, the self-correcting 11 protocol is triggered when IFSA detects an increase in fitness, typically 20% close to the maximum 12 from cutoff in one optimization step. The latter indicates a possible correction in the trailing trajec-13 tory, and ISCA updates this with a higher slope trajectory (Extended Data Fig. 2b). OPS's geometric features increase with operational complexity, bandwidth, average fidelity, and 20 RF amplitude (ω1) compensation level (Supplementary Fig. 6). OPS for 1000-point inversion and 21 2000-point universal π pulse for higher bandwidths are shown in Supplementary Fig. 9. The fitness function (ℱ � ) used in IFSA-ISCA is defined as the average operational fidelity of a given 2 RF shape, and is calculated over a range of offset and Δω 1 : 3 where is the target unitary operator, is the unitary operator of the RF shape, is the 5 number of offset values from -BW/2 to +BW/2 used in the averaging, and Δω 1 is the number of 6 RF amplitudes from (ω 1 -Δω 1 /2) to (ω 1 +Δω 1 /2) used in the averaging. Even though higher values 7 of and ∆ 1 improve the fitness, smaller values are generally preferred as they are less com-8 putationally expensive. An example target unitary operator for universal π pulse is = − . 9 The fitness function given in eqn. 1 is used for operator optimization, where the operator type is 10 a unitary operator. The fitness function for a state preparation (such as excitation and inversion) 11 pulse design is given by, 12 where and are the initial and target states, respectively. For inversion pulse, the initial 14 state corresponds to = , and the target state is = − .

Data availability 16
The data that support the findings of this study are available from online version of the manuscript 17 and the corresponding author upon reasonable request. 18

19
Acknowledgments 20 The authors thank Dr. Olivieri for preparing the NMR samples of ubiquitin and PKA-C. The  ±10%). b, Example of RF shapes with various average phase differences. c, Amplitude and phase shape of broadband universal π pulse with a bandwidth of 100 kHz (for ω 1 = 25 kHz, pulse length = 244 μs). d, Average inversion or refocusing response of Mx ('square'), My ('circle'), and Mz ('triangle') magnetizations with different noise levels on amplitude (blue), phase (green), and on both simultaneously (red). The average response for each magnetization was evaluated by keeping the same magnetization as the initial state and calculated the average frequency response of the GENETICS-AI pulse over 100 kHz bandwidth and 1000 different noise profiles at the same noise amplitude. Starting with an initial state of Mx, the universal π pulse (with phase x) keeps the magnetization along the same direction, whereas the My and Mz initial states are inverted. e, Amplitude and phase shapes with noise modulation of 20% in RF amplitude and 20° in phase shape. Supplementary Figure 10 | Ultra-broad excitation pulse for high-resolution NMR spectroscopy. a, RF amplitude and phase shape of ultra-broadband in-phase excitation pulse. b, Excitation profile, and c, 1D spectrum of U-15 N ubiquitin K48C using GENETICS-AI ultra-broad band excitation pulse (red, ω 1 =0.5 kHz). The high-power rectangular pulse version is shown in blue. The lower sensitivity is due to the relaxation during the low power excitation pulse, which does not occur for an RF amplitude of 16.67 kHz. An excitation sculpting pulse scheme was used for water suppression with 2 ms selective pulses. Figure 13 | RF shapes used in the SE imaging sequence of glass bead phantom (Fig. 4). Amplitude and phase shape of a, π/2 pulse and b, π pulse. c, 2D fidelity profile of π/2 pulse shown in a and d, 2D fidelity profile π pulse shown in b. The pulse lengths of π/2 and π pulse are 437μs and 567μs respectively with constant RF amplitude shape of ω 1 = 16.67 kHz. Figure 14 | RF pulses for biomolecular NMR experiments in a hypothetical 5 GHz spectrometer. a, Universal π/2 pulse and b, universal π pulse for 1 H channel with RF amplitude constant at 16.67 kHz. The operational bandwidth of these RF pulses was ~100 kHz. c, Universal π /2 pulse. d, Universal π pulse for 13 C channel with RF amplitude constant at 16.67 kHz. The operational bandwidth of these RF pulses was ~250 kHz. e, Universal π/2 pulse. f, Universal π pulse for the 15 N channel with RF amplitude constant at 5 kHz. The operational bandwidth of these RF pulses was ~20 kHz. The offset responses are shown for initial states Mx(red), My(blue) and Mz(black). The average fidelity of these operations are 0.999. n = 1, 2, and 4. The pulse and delay parameters were obtained by an iterative optimization process starting from a single spin-echo element (n =1) and three global pulses. The time-optimal pulse and delay parameters were evaluated for a state conversion problem, where the initial state was |αα⟩ and the final state (1 √2 ⁄ (|αα⟩ + |ββ⟩) for a range of J coupling values (ΔJ). In the second iteration, the algorithm increases ΔJ, until the average fidelity stays within the cutoff (0.999). Once the iteration process reaches the maximum ΔJ for a single spin echo, the process is repeated for 2 spin-echo elements. The entire optimization process is scripted in MATLAB and took around 2 hours of computation on a PC laptop with Core -i7 processor.