# Use of Composite Rotations to Correct Systematic Errors in NMR Quantum Computation

## I Introduction

Quantum computers are information processing devices which operate by—and exploit—the laws of quantum mechanics, giving them the potential to tackle problems which are intractable using classical computers . Although there has been a great deal of interest in the theory of quantum computation, actually building a general purpose quantum computer has proved extremely difficult. The multiparticle coherent states on which quantum computers rely are extremely vulnerable to the effects of errors, and so considerable effort has been expended on tackling random errors introduced by decoherence, including methods of error correction  and fault tolerant computation . Comparatively little effort, however, has been directed at the issue of systematic errors, arising from reproducible imperfections in the apparatus used to implement quantum computations.

It makes sense to address systematic errors, however, because many of them can be eliminated relatively easily. It is convenient to visualise one spin quantum states as three-dimensional vectors, where the $`x`$, $`y`$, and $`z`$ components are given by decomposition of the state into a linear combination of Pauli spin matrices. In this picture, unitary operations are interpreted as rotations of the Bloch vector on a sphere. The sensitivity of the final state to rotational imperfections can be much reduced by replacing single rotations with composed rotations. Ordinarily replacing one erroneous operation by several erroneous operations will increase the overall error, but this isn’t necessarily the case as rotations are non-linear, and the non-linearity opens the possibility of errors cancelling one another.

It is worth stressing the distinction between improved experimental technique, quantum error correcting codes , and the use of composite pulses. Improved experimental technique minimises conditions which lead to data errors. Error correcting codes diagnose errors (however obliquely) and use this knowledge of the errors to explicitly reverse them. Composite pulses prevent errors in the first place by reducing the impact on the system of conditions which cause systematic data errors, without actually eliminating these conditions. Composite pulses cannot, however, correct random errors, as they rely on the reproducible nature of systematic errors to correct them.

## II Systematic errors in NMR quantum computers

In the last few years nuclear magnetic resonance (NMR) techniques  have been used to implement small quantum computers . Several simple quantum algorithms have been implemented using NMR, such as Deutsch’s algorithm  and Grover’s algorithm . The comparative ease with which such experiments have been performed reflects, in part, the fact that more conventional NMR experiments, used throughout the molecular sciences, themselves rely on the generation and manipulation of multi-spin coherent states, and so techniques for handling them are highly developed.

Despite this pre-existing experimental sophistication, NMR quantum computers are nonetheless subject to systematic errors. Implementing complex quantum algorithms require a large network of logic gates, which within an NMR implementation entails even longer cascades of pulses. In this case small systematic errors in the pulses (which can be largely ignored in conventional NMR experiments) accumulate and become significant.

Interactions between individual spins and between spins and the environment are mediated by RF pulses, which are applications of an RF field with phase $`\varphi `$ (in the rotating frame)  for some duration $`\tau `$. In the ideal case, the pulse will drive the Bloch vector through an angle $`\theta `$ about an axis orthogonal to the $`z`$-axis and at an angle $`\varphi `$ to the $`x`$-axis. The rotation angle, $`\theta `$, depends on the rotation rate induced by the RF field, usually written $`\omega _1`$, and the duration of the pulse, $`\tau `$. In practice the RF field is not ideal, and this leads to two important classes of systematic errors, usually referred to as pulse length errors and off-resonance effects.

Pulse length errors arise either when the length of the pulse is set incorrectly, or (more commonly) when the RF field strength deviates from its assumed value, so that the rotation angle achieved deviates from its theoretical value. This effect is most commonly observed within NMR as a result of inhomogeneity in the applied RF field; in this case it is impossible for all the spins within the sample to experience the same rotation angle.

Off resonance effects arise from the use of a single RF source to excite transitions in two or more spins which have different resonance frequencies. This is done for a variety of practical reasons. For example, in conventional NMR experiments, which seek to analyse molecular systems, there will be a large number of different transition frequencies, whose exact values are unknown at the start of the experiment. Thus the only practical approach is to use a single RF source, with sufficient power that it can excite transitions across a wide range of frequencies. In quantum computation experiments the transition frequencies are known beforehand, but for a variety of reasons the use of a single RF source for each type of atomic nucleus remains the most practical approach (different sources *are* used for different nuclei, such as <sup>1</sup>H and <sup>13</sup>C).

Composite pulses are widely used in NMR to minimize the sensitivity of the system to pulse-length and off-resonance errors, by replacing direct rotations with composite rotations which are less sensitive to such effects. However, conventional composite pulse sequences are rarely appropriate for quantum computation because they usually incorporate assumptions about the initial state of the spins or introduce phase errors. These conventional sequences were initially derived by considering the trajectories of Bloch vectors during a pulse, and this approach is only useful if the starting point of the Bloch vector is known.

QC requires fully-compensating (type A) composite pulse sequences . Fortuitously, a number of such sequences were developed fifteen years ago by Tycko . While these pulse sequences do not offer quite the same degree of compensation as is found with some more conventional sequences, the compensation which does occur is effective whatever the initial position of the Bloch vector. As such sequences are rarely (if ever) required within conventional NMR experiments, these sequences have previously found no experimental use. They are, however, ideally suited to quantum computations.

## III Example: NMR quantum counting

Systematic errors are an issue with many types of quantum algorithms, but we will focus on a counting algorithm which can involve particularly long pulse trains. Counting the number of items matching a search criterion is a well-known computer science problem, and an efficient quantum counting algorithm based on a variation of Grover’s quantum search has been implemented using NMR techniques.

Consider a match function $`f(x)`$ which maps $`n`$-bit binary strings to a single output bit. In general there will be $`N=2^n`$ possible input values, of which $`k`$ will yield a match, $`f(x)`$=1. The object of the quantum counting algorithm is to estimate $`k`$ by estimating an eigenvalue of the Grover iterate $`G=HU_0H^1U_{\overline{f}}`$, where $`H`$ represents an $`n`$-bit Hadamard transform, $`U_0`$ maps $`|0`$ to $`|0`$, and $`U_{\overline{f}}`$ maps $`|x`$ to $`(1)^{f(x)+1}|x`$. The algorithm involves applying $`G`$ repeatedly and observing the variation in signal intensity. The signal intensity is modulated in $`r`$, the number of applications of G, with frequency proportional to $`k`$, the number of matches. A more detailed explanation of this algorithm is found in reference .

Figure 1 shows experimental results for a search over a one qubit search space, using a two-qubit quantum computer based on the two <sup>1</sup>H nuclei of cytosine in solution in $`\mathrm{D}_2\mathrm{O}`$ . The NMR spectrometer used a <sup>1</sup>H operating frequency of 500 MHz. On a one qubit search space, there are three possible results corresponding to four possible functions $`f`$: no inputs match (in which case $`f=f_{00}`$), the first input matches ($`f=f_{01}`$), the second input matches ($`f=f_{10}`$), or both inputs match ($`f=f_{11}`$). For simplicity, only the cases $`f_{00}`$ and $`f_{11}`$ are shown.

The observed signal loss with $`r`$ could arise from a number of sources. Clearly one possibility is the effects of decoherence, but the observed decay rate is too rapid to be so simply explained, and patterns in the signal loss (this is especially clear for $`f_{00}`$, where data points lie alternately above and below a smooth curve) suggest a more complex explanation. Repeating the experiments on spectrometers with higher operating frequencies markedly degrades the results, as shown in figure 2, which shows data from computations implemented on 600 and 750 MHz spectrometers. Once more, only the $`f_{00}`$ and $`f_{11}`$ cases are shown. These results clearly demonstrate that the use of expensive high field magnets does not always give better results. An unwanted beat frequency and high frequency chatter have been introduced, and the signal decays more rapidly. These effects are more severe at 750 MHz than at 600 MHz.

The observed field dependence strongly suggests that these errors arise from off-resonance effects. These arise because only a single RF transmitter is used to excite both <sup>1</sup>H nuclei, and it cannot be on-resonance with both sets of transitions. Instead the transmitter is placed halfway between the two resonance frequencies, resulting in equal and opposite off resonance terms. Two factors are responsible for the poor results at higher frequencies. Firstly, the frequency offsets, $`\pm \delta \nu `$, are proportional to the resonance frequency, and thus are larger at high frequencies. Secondly, the RF field strength is typically weaker at higher frequencies. These combine to make the off-resonance effects much more serious. This diagnosis can be confirmed by including off-resonance effects in simulations of the NMR experiment. After this correction is made, the theoretical results, shown in figure 3, agree strikingly well with the experimental results. Even the high frequency ’noise’ on the peaks is reproduced.

Since our simulations confirm that the major errors in NMR quantum counting arise from off-resonance effects in the $`90_y^{}`$ pulses, we chose to use Tycko’s $`385_y^{}\mathrm{\hspace{0.17em}320}_y^{}\mathrm{\hspace{0.17em}25}_y^{}`$ composite $`90_y^{}`$ sequence, which offers good compensation for off-resonance errors while remaining fairly insensitive to pulse-length errors. Substituting this sequence for the $`90_y^{}`$ pulses produced a significant improvement in the experimental results at 750 MHz, as shown in figure 4. The low frequency beating almost disappears, and the high frequency noise is much reduced.

When using composite pulses, there is a trade-off between the cancellation of errors and the extra manipulation of the system necessary to induce this cancellation. While there exist sequences which in theory compensate for an extraordinary range of errors, these sequences involve prohibitively long cascades of pulses. In practice, three-pulse sequences seem to provide a good balance between insensitivity and simplicity. The hazards of over-manipulation can be seen when the counting experiment is repeated using composite $`180^{}`$ pulses as well as $`90^{}`$ ones, shown in figure 5. The composite $`180_x^{}`$ pulse used was $`90_x^{}\mathrm{\hspace{0.17em}225}_x^{}\mathrm{\hspace{0.17em}315}_x^{}`$ . Although simulations predict that the results should be slightly better when both $`180^{}`$ and $`90^{}`$ compensated pulses are used, the results for $`f_{11}`$ are in fact slightly worse. The errors introduced by the extra manipulation outweigh the small gain achieved by the use of more sophisticated pulse sequences.

## IV Composite pulses for arbitrary rotation angles

Discussion of composite pulses in the NMR literature has focussed almost exclusively on $`90^{}`$ and $`180^{}`$ pulses, for the simple reason that these are the rotation angles most commonly used in conventional pulse sequences. While these composite pulses can be very useful for quantum computation, as shown above, it would be preferable to have composite pulses for other rotation angles as well. For example, a $`45^{}`$ pulse could be used in the implementation of a true Hadamard gate , which might be applied many times in a single network.

We use the method of coherent averaging to generate an analytic expression for composite pulses similar to Tycko’s $`90^{}`$ pulse but with arbitrary rotation angle. The basic idea of the method is to split the Hamiltonian of the system into intended and error components,

$$H(t)=H_0(t)+V,$$
(1)   
where the “ideal” Hamiltonian (written in the rotating frame and using product operator notation) is

$$H_0\left(t\right)=\omega _1\left(I_x\mathrm{cos}\varphi +I_y\mathrm{sin}\varphi \right)$$
(2)   
and the error term is

$$V=\delta \omega I_z$$
(3)   
($`\delta \omega `$ is the resonance offset angular frequency). We then seek to minimise the propagator of the error component by expanding it as a power series . Knowing $`V`$, we can rewrite the propagator as a product,

$`U(t)`$ $`=`$ $`U_0(t)U_V(t)`$ (4)   
$`=`$ $`T\mathrm{exp}\left(i{\displaystyle _0^\tau }𝑑tH_0(t)\right)T\mathrm{exp}\left(i{\displaystyle _0^\tau }𝑑t\stackrel{~}{V}(t)\right)`$ (5)   
where $`T`$ is the Dyson time-ordering operator and

$$\stackrel{~}{V}(t)=U_0(t)^1VU_0(t).$$
(6)   
Since $`U_V`$ varies rather slowly with time, it can be expanded as a power series in $`\stackrel{~}{V}`$:

$$U_V(\tau )=\mathrm{exp}\left(i\tau \left(V^{(0)}+V^{(1)}+\mathrm{}\right)\right)$$
(7)   
using the Magnus expansion

$`V^{(0)}`$ $`=`$ $`{\displaystyle \frac{1}{\tau }}{\displaystyle _0^\tau }𝑑t\stackrel{~}{V}(t)`$ (8)   
$`V^{(1)}`$ $`=`$ $`{\displaystyle \frac{i}{2\tau }}{\displaystyle _0^\tau }𝑑t_1{\displaystyle _0^{t_1}}𝑑t_2[\stackrel{~}{V}(t_1),\stackrel{~}{V}(t_2)]`$ (9)   
etc. Complete expressions for the higher order terms are given in . Our objective is to find a pulse sequence which satisfies the requirement that it perform an ideal rotation under ideal conditions,

$$T\underset{i=1}{\overset{m}{}}U_i(\tau _i)=U_0(\tau )$$
(10)   
while minimising $`V^{(0)}`$. We do not consider higher order terms as using more equations would require more variables in the solution and we wish to restrict the length of our composite sequence to three pulses. Here $`U_0(\tau )`$ is the propagator of an ideal uncomposed pulse and the $`U_i(\tau _i)`$ are the constituent propagators of the ideal composite pulse. Ordinarily, a numerical search for a solution must be conducted for each set of target values, $`\theta `$ and $`\varphi `$, but an analytic solution exists if the axes of rotation are taken to be $`\varphi _1=\varphi `$, $`\varphi _2=\pi +\varphi `$, and $`\varphi _3=\varphi `$. While this is nominally a loss of generality, the solutions we find are perfectly compensated to first order, and so no more general solution would be better to first order. The solutions also have reasonable properties with respect to RF field inhomogeneity.

With these phases, it follows trivially from equation (10) that

$$\theta _2=\theta _1+\theta _3\theta $$
(11)   
Working out $`V^{(0)}`$ with these values of $`\varphi `$ and $`\theta _2`$ and setting $`V_y^{(0)}`$ and $`V_z^{(0)}`$ to zero (it happens that $`V_x^{(0)}`$ is already zero) gives a restriction on $`\theta _3`$,

$$\theta _3=\pm \theta _1+2n\pi n=0,\pm 1,\pm 2,\mathrm{}$$
(12)   
Taking the positive result, $`\theta _3=\theta _1+2n\pi `$, and back-substituting gives two solution families,

$`\theta _1`$ $`=`$ $`\pm \mathrm{arccos}\left({\displaystyle \frac{\left(1\mathrm{cos}\theta \right)^2\pm \mathrm{sin}\theta \sqrt{\left(1\mathrm{cos}\theta \right)\left(7+\mathrm{cos}\theta \right)}}{4\left(1\mathrm{cos}\theta \right)}}\right)+2n\pi `$ (13)   
$`\theta _1`$ $`=`$ $`\pm \mathrm{arcsin}\left({\displaystyle \frac{\mathrm{sin}\theta \left(1+\mathrm{cos}\theta \sqrt{\left(1+\mathrm{cos}\theta \right)\left(7+\mathrm{cos}\theta \right)}\right)}{4\left(1+\mathrm{cos}\theta \right)}}\right)+2n\pi `$ (14)   
These solutions are equal in the region $`0\theta _{\text{target}}\pi `$ for the positive root and a consistent choice of signs. (This is easily checked by working out the Taylor expansions about 0, and less easily checked by working out the difference between equations (13) and (14) using an identity for $`\mathrm{arcsin}\alpha \mathrm{arccos}\beta `$.)

Although we have not explicitly considered the effects of RF field inhomogeneity when determining the $`\varphi _i`$ and $`\theta _1`$, it happens they are trivial for the rotation axes we have chosen. Using $`V_{\text{rf}}=\delta \omega _1\left(I_x\mathrm{cos}\varphi \left(t\right)+I_y\mathrm{sin}\varphi \left(t\right)\right)`$, where $`\delta \omega _1`$ is a measure of the field inhomogeneity, for $`V`$ and working out $`V^{(0)}`$ with the $`\varphi _i`$ specified above, we get

$`V_x^{(0)}`$ $`=`$ $`\delta \omega _1`$ (15)   
$`V_y^{(0)}`$ $`=`$ $`0`$ (16)   
$`V_z^{(0)}`$ $`=`$ $`0`$ (17)   
Therefore, equations (13) and (14) can be used exclusively to determine $`\theta _1`$. We follow Tycko and choose $`n=1`$ so that $`2\pi \theta _14\pi `$. The final rotation angles are

$`\theta _1`$ $`=`$ $`\mathrm{arccos}\left({\displaystyle \frac{\left(1\mathrm{cos}\theta \right)^2+\sqrt{\left(1\mathrm{cos}\theta \right)\left(7+\mathrm{cos}\theta \right)}\mathrm{sin}\theta }{4\left(1\mathrm{cos}\theta \right)}}\right)+2\pi `$ (18)   
$`\theta _2`$ $`=`$ $`\theta _1+\theta _3\theta `$ (19)   
$`\theta _3`$ $`=`$ $`\theta _12\pi `$ (20)   
Within this family, the quality of the pulses is remarkably insensitive to to actual details of the pulse sequence. As long as equation (11) is strictly satisfied, any sequence with angles vaguely like those given by equation (20) will produce broad-band rotations.

Figure 6 shows fidelity plots for Tycko’s original $`90^{}`$ composite pulse, and a new pulse derived using our analytic method. For comparison purposes, fidelity plots for the equivalent uncompensated pulses are included as well. The fidelity was evaluated using quaternions as described in reference .

The operation of the sequence whose fidelity is plotted in Figure 6(d) is illustrated in Figure 7. The resonance offset was chosen to be fairly large so that the mechanism of the composite pulse is clear.

The composite pulses we have derived have good properties in both quantum computation and spectroscopic contexts, but it may be possible to produce pulses with properties that are even more favourable for quantum computation if we stop using spectroscopy as our implicit model. Consider equation (10) again. Although it seems like an obvious condition that the behaviour of the pulse should be ideal in the absence of errors, this is misleading. We would never want to use a composite pulse in a situation where all pulses were on-resonance, and so there is no *a priori* reason to design pulses which perform well in the event of this non-existent ideality. The resonance offsets for quantum computation will always be known exactly, so we would like to be able to design pulse sequences which perform best as these known offsets rather than at the zero offset. This is a problem we are currently considering.

## V Conclusions

Composite pulses show great promise for reducing data errors in NMR quantum computers. More generally, any implementation of a quantum computer must be concerned on some level with rotations on the Bloch sphere, and so composite pulse techniques may find very broad application in quantum computing. Composite pulses are not, however, a panacea, and some caution must be exercised in their use.

## ACKNOWLEDGMENTS

JAJ is a Royal Society University Research Fellow. HKC thanks NSERC (Canada) and the TMR programme (EU) for their financial assistance. We thank Starlab (Riverland NV) for their support. The OCMS is supported by the UK EPSRC, BBSRC, and MRC.