Skip to main content
. Author manuscript; available in PMC: 2018 Aug 1.
Published in final edited form as: J Magn Reson. 2017 May 25;281:94–103. doi: 10.1016/j.jmr.2017.05.011

Table 1.

Computational time for simulating H(t) (given by (13)) using the toggling frame method versus the matrix exponential method. The time axis is discretized into n equally sized increments, and ρ(t) for t ∈ [0, T] is extracted. The Matlab function timeit was used to estimate the running time. For the toggling frame method, the reported time includes constructing the toggling frame and average Hamiltonian, calculating the trajectory of the state in the toggling frame, and converting this back to the original frame. For the matrix exponential method, the time includes calculating the incremental propagator at each time using a matrix exponential. We also report the final state y component, showing that a discretization of at least ~ 1000 points is needed to adequately capture the highly oscillatory dynamics. 12 iterations of the toggling frame algorithm are needed to find the average Hamiltonian, regardless of the discretization. The last column is the multiple by which the toggling frame method is faster, which is up to two orders of magnitude for a very fine discretization. We used a regular personal computer.

n Toggling frame
Matrix exponential
Speedup
Time (ms) 2tr(Iyρ(T)) Num. togg. Time (ms) 2tr(Iyρ(T))
25 1.06 −0.984 12 3.56 −0.980 3.35
26 1.13 −0.995 12 7.11 −0.994 6.31
27 1.20 −0.998 12 13.98 −0.998 11.63
28 1.48 −0.999 12 28.26 −0.999 19.10
29 1.95 −0.999 12 56.27 −0.999 28.87
210 2.35 −1.0 12 110.6 −1.0 47.17
211 3.66 −1.0 12 224.2 −1.0 61.24
212 5.28 −1.0 12 443.9 −1.0 84.09
213 10.68 −1.0 12 888.1 −1.0 103.27
214 15.40 −1.0 12 1783 −1.0 115.82
215 32.73 −1.0 12 3587 −1.0 109.61
216 70.12 −1.0 12 7113 −1.0 101.45