# Efficient Refocussing of One Spin and Two Spin Interactions for NMR Quantum Computation

## I Introduction

Much of the power and utility of NMR stems from the ease with which the experimenter can control the effective Hamiltonian experienced by the spin system. In conventional NMR  this permits different interactions to be studied individually, while in NMR quantum computation  this process is used to generate Hamiltonians corresponding to quantum logic gates between specific spins . This manipulation can be achieved using a variety of techniques , but the simplest and most important approach is the use of spin echoes. Applying a $`180^{}`$ pulse to a single spin in the middle of some evolution period acts to refocus any evolution occuring as a result of one spin interactions (that is, chemical shifts) or two spin interactions (spin–spin coupling, assumed to be *weak*) involving that spin. Thus the corresponding terms in the spin Hamiltonian are effectively deleted.

This approach is simple to apply in systems containing only a small number of coupled spins, but must be treated with caution when applied to larger systems, especially when all the spins are coupled to one another. The Hamiltonian describing evolution of a fully coupled spin system of $`N`$ spins contains $`N`$ one spin terms and $`N(N1)/2`$ two spin terms, and it would be possible to produce a large number of effective Hamiltonians, corresponding to any desired combination of these terms. For simplicity we will concentrate on one particularly simple Hamiltonian in which only one chemical shift term is retained; two other simple Hamiltonians (in which only one coupling is retained, or all interactions are refocussed) can be easily generated by small modifications to the corresponding pulse sequences.

A pulse sequence for achieving this simplification in a two spin system is shown in figure 1. In this case the refocussing process is simple, and can be achieved with only two time periods, separated by a single $`180^{}`$ pulse. For completeness it is necessary to apply a final $`180^{}`$ pulse to spin $`1`$ to ensure that each spin experiences an even number of $`180^{}`$ pulses (not gates), but in many cases such pulses can be omitted. When applied to larger spin systems, however, it is necessary to refocus many more interactions, requiring a larger number of time periods. The conventional approach  is to recursively nest copies of sequences like that shown in figure 1 within one another, as shown for a fully coupled four spin system in figure 2. While this nesting process is effective, it is exponentially inefficient, in that the number of time periods and $`180^{}`$ pulses required grows exponentially with the number of spins in the spin system: while a four spin system requires that the evolution period be divided into eight sections, a five spin system will require sixteen sections, and so on.

Although this nesting process is very widely used within NMR, a far more efficient scheme is available. Here we describe this efficient refocussing scheme, and show how it may be used to create the two effective Hamiltonians described above. We also discuss the application of this scheme to partially coupled spin systems.

## II Theory

While spin echo sequences are usually drawn out as sequences of pulses, as shown above, it is more convenient to describe a sequence mathematically by considering the evolution of each spin during the various equal time periods of free precession (the $`180^{}`$ pulses are assumed to be of negligible duration). Suppose that before the start of the spin echo sequence a spin is in a state of $`p=+1`$ quantum coherence; the effect of the $`180^{}`$ pulse is to convert this to $`1`$ quantum coherence, and vice versa. The evolution of the spin will depend on its coherence order, and thus the evolution during any period can be described by a set of numbers taking the values $`+1`$ and $`1`$, where the value changes sign each time a $`180^{}`$ pulse is applied to the spin.

These sets of values can then be gathered together into a matrix, whose rows correspond to the individual spins and whose columns correspond to the different time periods. Thus the sequence depicted in figure 1 can be described by the matrix

$$M_2=\left(\begin{array}{cc}\hfill 1& \hfill 1\\ \hfill 1& \hfill 1\end{array}\right),$$
(1)   
while that shown in figure 2 corresponds to the matrix

$$M_4=\left(\begin{array}{cccccccc}\hfill 1& \hfill 1& \hfill 1& \hfill 1& \hfill 1& \hfill 1& \hfill 1& \hfill 1\\ \hfill 1& \hfill 1& \hfill 1& \hfill 1& \hfill 1& \hfill 1& \hfill 1& \hfill 1\\ \hfill 1& \hfill 1& \hfill 1& \hfill 1& \hfill 1& \hfill 1& \hfill 1& \hfill 1\\ \hfill 1& \hfill 1& \hfill 1& \hfill 1& \hfill 1& \hfill 1& \hfill 1& \hfill 1\end{array}\right).$$
(2)   
The refocussing effected by these pulse sequences can then be easily explained by examining the properties of the corresponding matrices. The chemical shift of a spin will be refocussed as long as the corresponding row of the matrix $`M`$ contains the same number of plus and minus ones. Similarly the coupling between two spins will be refocussed if the vector obtained by multiplying pairs of numbers from the rows corresponding to the two spins contains the same number of plus and minus ones. More concisely, a spin–spin coupling will be refocussed if the corresponding rows are orthogonal, while a chemical shift will be refocussed if the corresponding row is orthogonal to a row of ones.

These two properties are sufficient to allow us to construct refocussing matrices, and thus pulse sequences, with the desired properties. Consider a system of $`N`$ spins, where we wish to refocus all the interactions *except* the chemical shift of spin $`0`$. This can be achieved by constructing a refocussing matrix comprising one row of ones, and $`N1`$ rows of plus and minus ones, all of which are orthogonal to one another and to the first row; the most efficient refocussing sequence will correspond to the matrix with the smallest number of columns. Such matrices are closely related to the well known Hadamard matrices.

The Hadamard matrix corresponding to a two spin system, $`H_2`$ takes the simple form

$$H_2=M_2=\left(\begin{array}{cc}\hfill 1& \hfill 1\\ \hfill 1& \hfill 1\end{array}\right),$$
(3)   
and so the conventional two spin sequence (figure 1) is, not surprisingly, the most efficient. The four spin Hadamard matrix, $`H_4`$, can be calculated using

$$H_4=H_2H_2=\left(\begin{array}{cccc}\hfill 1& \hfill 1& \hfill 1& \hfill 1\\ \hfill 1& \hfill 1& \hfill 1& \hfill 1\\ \hfill 1& \hfill 1& \hfill 1& \hfill 1\\ \hfill 1& \hfill 1& \hfill 1& \hfill 1\end{array}\right),$$
(4)   
and is only half the size of its conventional equivalent, $`M_4`$ (equation 2). The corresponding pulse sequence, shown in figure 3, is similarly shorter than the conventional equivalent (figure 2). Note that, with the exception of spin $`0`$, there is no particular significance to the spin labels, and individual nuclei can be assigned to the different spin numbers at will.

Unlike conventional spin echo sequences, these efficient sequences involve the application of simultaneous $`180^{}`$ pulses to two or more spins. In principle this need not be a problem, but in practice it may be necessary to choose $`B_1`$ field strengths with care, so as to minimise the effects of Hartmann-Hahn transfers (whether homonuclear or heteronuclear).

With slight modifications, these pulse sequences can also be used to generate effective Hamiltonians corresponding to a single spin–spin coupling. The procedure is straightforward: to generate a pure coupling between spins $`0`$ and $`1`$ (for example), simply copy the pulses applied to spin $`1`$ and apply them to spin $`0`$. Similarly, a pulse sequence in which *all* one and two-spin interactions are refocussed in an $`N`$ spin system can be obtained by using the bottom $`N`$ lines of a sequence which refocusses everything except the first chemical shift in an $`N+1`$ spin system.

The usefulness of this procedure depends on the existence of Hadamard matrices with appropriate dimensions. Ideally the matrix should have the same size as the number of spins in the spin system. Unfortunately it is usually only possible to form Hadamard matrices whose dimension is a multiple of four (the two by two Hadamard matrix, $`H_2`$, is a special case); Hadamard matrices can be formed for many (though not all) multiples of four, including all such multiples below fifty. When the number of spins is *not* a multiple of four, it is instead necessary to use the next largest appropriate multiple of four, and select an appropriate subset of the corresponding pulse sequence. In general this subset would probably be chosen to minimise the number of simultaneous pulses in the pulse sequence. For example, in a three spin system one possible pulse sequence is to use the lines labelled $`I^0`$, $`I^2`$ and $`I^3`$ in figure 3; this choice corresponds to the conventional pulse sequence! This procedure is always more efficient than the conventional approach except for the case of two or three spins: in these cases the conventional and Hadamard approaches give identical sequences.

A discussed below, in real systems where only some of the possible couplings are present it is not necessary to refocus all the couplings, and it is instead possible to use simpler pulse sequences. Spin coupling networks in molecules are usually quite local, with resolved couplings only being seen to a small number of close neighbours; it seems likely that the four spin (figure 3) and eight spin (figure 4) sequences would suffice for almost any system.

## III Partially coupled spin systems

In real life fully coupled spin systems are rather rare; in most cases only a small subset of the possible couplings can be resolved. It is not necessary to refocus all these unresolved couplings, which are effectively absent, and thus the refocussing process can be greatly simplified. In small spin systems it is practical to derive such simplified sequences by hand, but in larger systems it is useful to have an algorithmic procedure by which this can be achieved.

This is simply realised by treating the spin system as a non-complete graph. A graph comprises a set of vertices, connected by edges; this corresponds to a set of nuclei connected by J-couplings. A partially coupled spin system, in which some of the couplings are absent, corresponds to an non-complete graph. A graph can be coloured, by assigning each vertex one of a number of different colours, and the colouring scheme is called a proper colouring if no two connected vertices are the same colour. The graph may then be characterised by a chromatic number, $`\chi `$: this is the smallest number of colours required to properly colour the graph. In a complete graph (a fully coupled spin system) $`\chi =N`$, but in a partially coupled system $`\chi `$ can be much smaller.

The significance of this observation is that if a spin system is represented by a properly coloured graph, then it is not necessary to refocus interactions between nuclei corresponding to vertices with the same colour. To refocus all the interactions in an $`N`$ spin system it suffices to create a pulse sequence corresponding to a $`\chi `$ spin system, and apply identical pulses to all nuclei with the same colour. In this case there is no need for further concern about Hartman-Hahn transfers, as these additional simultaneous pulses will only be applied to spins which are not coupled to one another.

Clearly this approach is only practical if it is easy to determine both the value of $`\chi `$ and a corresponding proper colouring. In general this is extremely difficult: indeed, determining $`\chi `$ is an NP hard problem. This difficulty is, however, more apparent than real, as it is relatively simple to estimate $`\chi `$, and to find corresponding proper colourings, for certain simple types of graph such as those likely to occur in coupled spin systems. If the maximum number of edges at any vertex (that is, the maximum number of spins coupled to any other spin) is $`k`$, then the graph is said to be of degree $`k`$, and $`\chi k+1`$; in all but a few special cases $`\chi k`$. Furthermore, it is easy to construct a proper colouring using at most $`k`$ (or $`k+1`$) colours. Creating a sequence which refocuses all interactions except one chemical shift or one J-coupling is slightly more complicated, but the simplest approach is to assign the nuclei in question a unique colour; at worst this will increase the number of colours required by 1.

## IV Conclusions

The use of Hadamard matrices and non-complete graphs provides a powerful language for describing pulse sequences which refocus one spin and two spin interactions in NMR. This approach permits the construction of refocussing pulse sequences which are much shorter than their conventional equivalents.

## Acknowledgements

We thank M. Mosca for useful discussions. JAJ is a Royal Society University Research Fellow. EK thanks the National Security Agency for financial support.