    Counting atoms faster: policy-based nuclear magnetic resonance pulse sequencing for atomic abundance measurement

Importantly, this accelerated relaxation occurs within a                we demonstrate that the benefit of the spoiling model within
timescale that is just a fraction of the system’s T2 relax-             this procedure arises solely from its ability to rapidly reduce
ation time, whereas in the standard protocol, the system is             the transverse magnetization.
allowed to relax for multiple T2 periods. While the system is
                                                                        To better understand the behavior of the chirp and spoil-
not reset to equilibrium within this shortened relaxation pe-
                                                                        ing models within the toggle framework, we visualize the
riod, the suppression of magnetization is significant enough
                                                                        models’ actions as a function of the observed magnetiza-
that we can simply terminate the pulse after a short spoil-
                                                                        tions as well as the corresponding state densities in Figure 3.
ing time tS and achieve equilibrium more rapidly than the
                                                                        Across different environments and samples, we observe that
incumbent approach.
                                                                        the chirping model consistently reaches the maximum mag-
                                                                        netization in the same direction, validating the structured
3.3. Model 3: Toggled Chirping and Spoiling                             control it asserts in the system. Additionally, we find that
In standard NMR spectroscopy, the spoiling period must                  the spoiling model applies a large RF pulse in a consistent
reset the transverse magnetization to below a threshold, so             manner until the magnetization is significantly reduced, at
that the sample is returned to its initial state before repeating       which point it will occasionally stop pulsing. The effect
the pulse. In this experiment, we consider the possibility of           of this RF pulse is evident in the state density shift in the
instead permitting a partial reset, by training a third policy          bottom two plots, where the distribution of magnetization
to choose which of the chirping or spoiling models has                  states rapidly transitions in the direction of the RF pulse ap-
control of the environment. After chirping with the model               plied by the spoiling model (the x direction). These findings
trained in Section 3.1.2, the spoiling model from Section               highlight the complementary roles of the chirping and spoil-
3.2 can take over and push the spins toward equilibrium,                ing models within our toggling framework. Crucially, we
before the next chirp re-establishes high magnetization. The            demonstrate that toggle between these models provides a su-
MDP appropriate to this process has the same state space,               perior strategy relative to simple relaxation for maintaining
but with an additional binary flag indicating which of the              high magnetization and improving scan speed.
chirp or spoiling policies can control B1 , as well as the time
tC since the chirping policy last had control and the time              4. Limitations and Future Work
tS since the spoiling model last had control. The action
space is a change to that binary flag, although this action             In this work, we introduced a novel technique to measure
is only available 200 timesteps after the most recent toggle.           atomic abundances using NMR pulse sequences which are
The reward function at any given timestep T is taken as the             learned by reinforcement. While we demonstrate the suc-
change in maximum magnetization, with a penalty for long                cess of our approach on simulated samples of caffeine dis-
chirp-spoil sequences:                                                  solved in water, it has fundamental limitations which con-
                                                                        strain its applicability and require discussion. Most crucially,
            h              i t<T                                        the use of this method makes the implicit assumption that
                   ⃗ t ||2
 rT = tS × ∆ max ||M                                 ⃗ t ||2 (3)
                                            − tC × ||M
                                  t<T −tC
                                                                        the samples being measured with a given pre-trained chirp-
                                                                        ing policy have same relative distributions of nuclei as the
In Figure 4, we demonstrate that our toggle model outper-               samples used for training the pulse. As a result, any such
forms the chirp-only model due to the repeated partial reset            application of this measurement approach in the field will
facilitated by the spoiling stage. This result highlights the           require periodic cross-checks against traditional NMR to
importance of the interplay between the chirp and spoil-                ensure that distribution shift from the training data has not
ing models, which together enable us to maximize mag-                   occurred. Moreover, in this work we treated NMR pulses as
netization, quickly diminish transverse magnetization, and              targeting individual atomic spins, but inter-nuclear interac-
subsequently restore high magnetization in a cyclic manner.             tions within a sample such as proton coupling (Nishimura,
                                                                        1996) can cause other elements to be activated by the applied
To further validate the necessity of the spoiling model within          magnetic field, leading to radio-frequency responses which
this approach, we compare our toggle models performance                 interfere with our proposed procedure. Characterizing the
against a modified chirp procedure where the maximum                    performance of this proposed method as applied on real sam-
magnetization is artificially reset at the same points as the           ples of analytes of practical interest, in low-cost hardware,
toggling transitions. This experiment reveals that simply               is the clearest and most intriguing avenue of future research.
setting the maximum magnetization to zero while the chirp               We note in addition that the results in Figure 3 (top left,
is running is insufficient for maximizing magnetization over            black dots) suggest the existence of a preferred direction for
many runs. This limitation indicates that our MDP structure             abundance measurement in the transverse plane. It would
effectively learns to associate states with their maximum               be of interest to compare our method against a variant of
magnetization history, meaning that the learned policy par-             GRAPE which uses this vector as a target state.
tially depends on knowledge of prior magnetizations. Thus,

                                                                    6
