Phase estimation is used in many quantum algorithms, particularly in order to estimate energy eigenvalues for quantum systems. When using a single qubit as the probe (used to control the unitary we wish to estimate the eigenvalue of), it is not possible to measure the phase with a minimum mean-square error. In standard methods, there would be a logarithmic (in error) number of control qubits needed in order to achieve this minimum error. Here, we show how to perform this measurement using only two control qubits, thereby reducing the qubit requirements of the quantum algorithm. To achieve this task, we prepare the optimal control state one qubit at a time, at the same time as applying the controlled unitaries and inverse quantum Fourier transform. As each control qubit is measured, it is reset to $ | 0 \u27e9$ then entangled with the other control qubit, so only two control qubits are needed.

## I. INTRODUCTION

Quantum phase estimation was originally applied in quantum algorithms for the task of period finding, as in Shor's algorithm.^{1} Later, quantum phase estimation was applied to the task of estimating eigenvalues for Hamiltonians in quantum chemistry.^{2} The appropriate way to perform quantum phase estimation is different between these two applications, due to the different costs of the operations that phase estimation is being performed on. In particular, for Shor's algorithm, one can perform arbitrary powers at low cost (logarithmic in the power). In contrast, for estimating eigenvalues of Hamiltonians, the cost of simulating the time evolution is (at least) proportional to the time, so the phase estimation procedure should attempt to minimize the total evolution time. At the same time, the mean-square error (MSE) in the estimate should be minimized.

A key part of quantum algorithms for phase estimation is the inverse quantum Fourier transform. This operation can be decomposed into a “semiclassical” form,^{3} where one performs measurements on the control qubits in sequence, with rotations controlled according to the results of previous measurements. In the form of phase estimation as in Shor's algorithm, the control qubits would be in an equal superposition state, which is just a tensor product of $ | + \u27e9$ states on the individual qubits. In that scenario, only one control qubit need be used at a time, because it can be prepared in the $ | + \u27e9$ state, used as a control, then rotated and measured before the next qubit is used.

This procedure with the control qubits in $ | + \u27e9$ states gives a probability distribution for the error approximately a sinc squared, which has a significant probability for large errors. That is still suitable for Shor's algorithm, because it is possible to take large powers of the operators with relatively small cost, which suppresses the phase measurement error. On the other hand, for quantum chemistry where there is a cost of Hamiltonian simulation proportional to time, the large error of the sinc-squared is a problem. Then, it is more appropriate to use qubits in an entangled state,^{4} which was originally derived in an optical context in 1996.^{5}

In 2000, we^{6} analyzed the problem of how to perform measurements on these states in a Mach–Zehnder interferometer.^{7} The same year, Jon Dowling introduced NOON states in the context of lithography^{8} and then, in 2002, showed how NOON states may be used in interferometry for phase measurement.^{9,10} A drawback to using NOON states is that they are highly sensitive to loss. In 2010, one of us (D.W.B.) visited Jon Dowling's group to work on the problem of how to generate states that are more resistant to loss and effectively perform measurements with them. This resulted in the publication (separately from Jon of Ref. 11), followed by our first joint publication.^{12} We continued collaborating with Jon for many years on phase measurement,^{13} as well as state preparation,^{14} and Boson-sampling inspired cryptography.^{15}

In separate work, we showed how to combine results from multiple NOON states in order to provide highly accurate phase measurements suitable for quantum algorithms.^{16} Phase measurement via NOON states is analogous to taking a $ | + \u27e9$ state and performing a controlled *U ^{N}* on a target system in quantum computing. The photons in the arms of the interferometer are analogous to the control qubit in quantum computing, with the phase shift from

*U*instead arising from an optical phase shift between the arms of the interferometer. The NOON state gives very high frequency variation of the probability distribution for the phase, rather than a probability distribution with a single peak. In 2007, we showed how to combine the results from NOON states with different values of

^{N}*N*in order to provide a phase measurement analogous to the procedure giving a sinc-squared distribution in quantum algorithms.

^{16}(It was experimentally demonstrated with multiple passes through the phase shift rather than NOON states.)

A further advance in Ref. 16 was to show how to use an adaptive procedure, still with individual $ | + \u27e9$ states, in order to give the “Heisenberg limited” phase estimate. That is, rather than the mean-square error scaling as it does for the sinc-squared, it scales as it does for the optimal (entangled) control state. This procedure still only uses a single control qubit at a time, so is suitable for using in quantum algorithms where the number of qubits available is strongly limited; this is why it was used, for example, in Ref. 17. On the other hand, although it gives the optimal scaling, the constant factor is not optimal, and improved performance is provided by using the optimal entangled state.

In this paper, we show how to achieve the best of both worlds. That is, we show how to provide the optimal phase estimate (with the correct constant factor), while only increasing the number of control qubits by one. It is, therefore, suitable for quantum algorithms with a small number of qubits, while enabling the minimum complexity for a given required accuracy.

In Sec. II, we discuss the optimal state for phase estimation and how its usage can be combined with the semiclassical quantum Fourier transform. Then, in Sec. III, we introduce a orthogonal basis of states for subsets of qubits and prove a recursive form. Finally, in Sec. IV, we show how the recursive form can be translated into a sequence of two-qubit unitaries to create the optimal state.

## II. PHASE MEASUREMENT USING OPTIMAL QUANTUM STATES

### A. The optimal states

*N*is the total photon number in two modes and

*n*is the photon number in one of the modes, as for example in a Mach–Zehnder interferometer. It is also possible to consider the single-mode case, where

*N*is a maximum photon number and $ | n \u27e9$ is a Fock state.

^{18}

^{7}

^{19}

^{,}

^{20}

### B. Phase measurement with the inverse Fourier transform

*U*with eigenvalue $ e i \varphi $. If the target system is in the corresponding eigenstate of

*U*, denoted $ | \varphi \u27e9$, and if state $ | n \u27e9$ is used to control application of

*U*, then the $\varphi $-dependent state from Eq. (2) is again obtained. In practice, the integer

^{n}*n*is represented in binary in ancilla qubits. Then, the most-significant bit,

*n*

_{1}, is used to control

*U*, the next most significant bit,

*n*

_{2}, is used to control

*U*

^{2}, and so forth. In general,

*m*to be the number of bits. In practice, it is convenient to take

*N*+ 1 to be a power of 2, so $ N = 2 m \u2212 1$. In order to estimate the phase, one wishes to perform the canonical measurement on the ancilla qubits. To explain this measurement, it is convenient to consider the POVM with

*N*+ 1 states $ | \varphi \u02c7 j \u27e9$ with $ \varphi \u02c7 j = 2 \pi j / ( N + 1 )$ for

*j*= 0 to

*N*. Then, the states $ | \varphi \u02c7 \u27e9$ are mutually orthogonal. Such a projective measurement can then be obtained if one can perform the unitary operation

If one aims to obtain the original POVM, one can randomly (with equal probability) select $ \delta \varphi \u2208 [ 0 , 2 \pi / ( N + 1 ) ]$, choose the states with $ \varphi \u02c7 j = 2 \pi j / ( N + 1 ) + \delta \varphi $, and then perform a measurement in the basis $ | \varphi \u02c7 j \u27e9$ with this randomly chosen offset. The complete measurement, including the random choice of $ \delta \varphi $, is then equivalent to the POVM with the set of outcomes over a continuous range of $ \varphi \u02c7$. This approach can be used in order to give a measurement that is covariant (has an error distribution independent of the system phase $\varphi $). In practice, it is not usually needed, so we will not consider it further in this paper.

In order to obtain the estimate for the phase, one should, therefore, perform the inverse quantum Fourier transform on the control qubits. The inverse quantum Fourier transform can be performed in a semiclassical way, by performing measurements on successive qubits followed by controlled rotations.^{3} The usual terminology is the “semiclassical Fourier transform,” though this is the inverse transform. An example with three qubits is given in Fig. 3. The bottom (least significant qubit) is measured first. The result is used to control a phase rotation on the middle qubit. Then, the middle qubit is measured, and the results of both measurements are used to control phase rotations on the top qubit. The net result is the same as performing the inverse quantum Fourier transform and measuring in the computational basis.

A further advantage of this procedure is that the fact that the controlled *U* operations are also performed in sequence means that the sequences can be matched. That is, we have the combined procedure as shown in Fig. 4. In the case where control registers are prepared in an equal superposition state, the qubits are unentangled. This means that preparation of each successive qubit can be delayed until it is needed, as shown in Fig. 5.

What this means is that only one control qubit need be used at once. The preparation of the next control qubit can be delayed until after measurement of the previous one and that qubit can be reset and reused. That is useful in quantum algorithms with a limited number of qubits available and is also useful in quantum phase estimation. In that case, one can replace the control qubits with NOON states with photon numbers that are powers of 2. Then, these NOON states can be measured in sequence to give a canonical measurement of phase, even though a canonical measurement of phase would not be possible on a single two-mode state. In Ref. 16, we demonstrated this approach, using multiple passes through a phase shift rather than NOON states.

The drawback now is that, even though it is possible to perform the canonical measurement, a suboptimal state is being used. We would like to be able to perform measurements achieving the minimum Holevo phase variance. In Ref. 16, we showed that, by using multiple NOON states of each number, it is possible to obtain the desired scaling with total photon number, even though there is a different constant factor so the true minimum error is not achieved.

### C. Performing phase measurement with two control qubits

Up to this point, this section has been revision of prior work. What is new here is that we show how to prepare the optimal state for phase measurement in a sequential way, so the number of qubits that need be used at once is minimized. We will show how the optimal state can be prepared using a sequence of two-qubit operations, as in Fig. 6.

When the optimal state is prepared in this way, its preparation may be delayed until the qubits are needed, as shown in Fig. 7. This is illustrated with three control qubits, where introduction of the third qubit can be delayed until the first qubit is measured (where we are counting the control qubits from the bottom to the top). That is, the first qubit can be measured, reset to $ | 0 \u27e9$, then used as what is shown as the third (top) qubit. This means that even though there are three control qubits drawn, only two control qubits are used. In general, with more qubits in the optimal state, introduction of each additional qubit can be delayed until after measurement of the qubit two places down, so only two control qubits are actually used.

*j*and

*j*+ 1, there will be the correct bipartite entanglement in the split between qubits up to

*j*and qubits from

*j*+ 1 to

*m*. However, at that stage qubits from 1 to

*j*− 1 have not been initialized yet, so the entanglement across the bipartite split (for qubits 1 to

*j*) is represented just on qubit

*j*.

## III. RECURSIVE CONSTRUCTION OF THE OPTIMUM STATE

**Lemma 1.**

*The states*$ | \Phi [ \u2113 ] + \u27e9$

*and*$ | \Phi [ \u2113 ] \u2212 \u27e9$

*defined in Eq. (20) are orthogonal:*

*Proof*. From Eq. (17), we have

**Lemma 2.**

*The states*$ | \Phi \u0303 [ \u2113 ] + \u27e9$

*and*$ | \Phi \u0303 [ \u2113 ] \u2212 \u27e9$

*defined in*

*Eq.*(20)

*and*

*Eq.*(24)

*, have recurrence relation*

*where*

*Proof*. To prove this, we start by noting that

## IV. PREPARING OPTIMUM STATE WITH TWO-QUBIT UNITARIES

*m*− 1, which can be constructed from states $ | \Phi \u0303 [ m \u2212 2 ] \xb1 \u27e9$ on qubits 1 to

*m*− 2, and so forth.

*m*and

*m*− 1, and work back to qubits 1 and 2. It is convenient to describe the operations as acting on qubits initialized as $ | + \u27e9$. Then, we initially perform an operation on qubits

*m*and

*m*− 1 that maps

*m*− 1 need to be represented by $ | \xb1 \u27e9$ on a single qubit.

*m*as

*m*− 1 and

*m*− 2, down to

*U*

_{1}on qubits 1 and 2. The unitary $ U \u2113$ needs to map

After performing this sequence of unitaries, we then need to map $ | \xb1 \u27e9$ to $ | \Phi \u0303 [ 1 ] \xb1 \u27e9$ on qubit 1. This is a simple single-qubit unitary operation, which can be combined with *U*_{1} to give the correct final state with a sequence of two-qubit unitary operations. Thus, our recursive expression for the states gives us a sequence of two-qubit unitaries to create the optimal state.

*i*phase shift on $ | \u2212 \u27e9$.

## V. CONCLUSION

We have shown how to create the optimal state for phase estimation, in the sense of minimizing Holevo variance, using a sequence of two-qubit operations. When combining this sequential process with the semiclassical quantum Fourier transform, we can entangle new qubits after measuring control qubits in such a way that only two control qubits are needed. This means that the qubit that is measured can be reset and used as the new qubit to be entangled, meaning that only two control qubits are used.

In quantum algorithms where phase estimation is needed with a small number of logical qubits, this approach is ideal. Previously the method used was either many entangled qubits, increasing the size of the quantum computer needed, or a single control qubit, which significantly increases the error. In our method, the number of control qubits is only increased by 1, while giving the minimal error. Here, the quantity being exactly minimized is the Holevo variance, which is very close to the mean-square error (MSE) for sharply peaked distributions. If one were interested in minimizing MSE, then these states give the same leading order term for MSE as the minimum MSE,^{20} so these states are still suitable.

Our method of preparing the state, although it has been derived for the specific case of the optimal state for minimizing Holevo variance, could also be applied to other states that are a superposition of two unentangled states. The crucial feature is that the Schmidt number is 2 for any bipartite split across the qubits. One could also consider states with larger Schmidt number and use a larger number of qubits as controls. That could potentially be used for states that are optimal for minimizing other measures of error. For example, one could consider methods of approximating Kaiser windows, or the digital prolate spheroidal sequence, as is suitable for optimizing confidence intervals.^{21}

Another interesting question is whether this procedure could be demonstrated with photons. A scheme with optimal phase states for *N* = 2 using two photons was demonstrated in Ref. 22. With the preparation scheme we have outlined, it would potentially be possible to demonstrate these states with larger *N*, though it would require entangling operations that might require nonlinear optical elements.

## ACKNOWLEDGMENTS

D.W.B. worked on this project under a sponsored research agreement with Google Quantum AI. D.W.B. is also supported by Australian Research Council Discovery Project Nos. DP190102633, DP210101367, and DP220101602.

## AUTHOR DECLARATIONS

### Conflict of Interest

The authors have no conflicts to disclose.

### Author Contributions

**Peyman Najafi:** Formal analysis (equal); Investigation (equal); Writing – original draft (lead). **Pedro Costa:** Formal analysis (supporting); Investigation (supporting); Writing – review & editing (supporting). **Dominic Berry:** Conceptualization (lead); Formal analysis (equal); Funding acquisition (lead); Investigation (equal); Methodology (lead); Project administration (lead); Supervision (lead); Writing – original draft (supporting); Writing – review & editing (lead).

## DATA AVAILABILITY

Data sharing is not applicable to this article as no new data were created or analyzed in this study.

## REFERENCES

*Quantum Probability and Applications to the Quantum Theory of Irreversible Processes*