A classical-quantum hybrid oracle architecture for Boolean oracle identification in the noisy intermediate-scale quantum era
Quantum algorithms have the potential to be very powerful. However, to exploit quantum parallelism, some quantum algorithms require an embedding of large classical data into quantum states. This embedding can cost a lot of resources, for instance by implementing quantum random-access memory (QRAM). An important instance of this is in quantum-enhanced machine learning algorithms. We propose a new way of circumventing this requirement by using a classical-quantum hybrid architecture where the input data can remain classical, which differs from other hybrid models. We apply this to a fundamental computational problem called Boolean oracle identification, which offers a useful primitive for quantum machine learning algorithms. Its aim is to identify an unknown oracle amongst a list of candidates while minimising the number of queries to the oracle. In our scheme, we replace the classical oracle with our hybrid oracle. We demonstrate both theoretically and numerically that the success rates of the oracle query can be improved in the presence of noise and also enables us to explore a larger search space. This also makes the model suitable for realisation in the current era of noisy intermediate-scale quantum (NISQ) devices. Furthermore, we can show our scheme can lead to a reduction in the learning sample complexity. This means that for certain sizes of learning samples, our classical-quantum hybrid learner can complete the learning task faithfully whereas a classical learner cannot.
Introduction.—Quantum computation promises quantum speed-ups with many well-studied quantum algorithms Shor (1997); Grover (1997); Harrow et al. (2009). However, many of these appear difficult to achieve in near-term quantum devices in the “noisy intermediate-scale quantum (NISQ)” era, which run on only a few hundred noisy qubits Preskill (2018). Apart from computational resources, some of these algorithms also demand very high costs in initializing ‘big’ classical data into quantum states Aaronson (2015). An important instance of this is the use of quantum random-access memory (QRAM) Giovannetti et al. (2008a, b). Herein, we touch on an important question: if it is possible to achieve a NISQ era quantum advantage in computation by also avoiding large resource costs in preparation of input quantum states that embed classical data.
One approach is to introduce a classical-quantum hybrid strategy. Studies exploring the useful interplay between “classical” and “quantum” have recently received increasing attention, offering the possibility for near-term quantum realization Bang et al. (2014); McClean et al. (2016); Mitarai et al. (2018); McCaskey et al. (2018); Sohn et al. (2019); Peng et al. (2016). Consistent with this trend, we also consider a classical-quantum hybrid architecture, in which () the large input data remains classical and () achieving the quantum advantage is enabled by small-scale quantum devices, which is realizable in NISQ era without, or by minimizing, the use of QRAM Yoo et al. (2014); Lee et al. (2019); Bang et al. (2019).
We apply our framework to the “Boolean oracle identification” problem, which aims to identify the correct oracle amongst a list of candidates Ambainis et al. (2004). To solve this problem, we employ a classical-quantum hybrid oracle design satisfying () and (). Here, we assume that this hybrid oracle generates incorrect outputs with errors arising from noisy (internal) quantum devices. This is often casted in realistic models, referred to as noisy query model Buhrman et al. (2007); Cross et al. (2015); Bang et al. (2019). In this setting, we demonstrate, both analytically and numerically, that our hybrid oracle can exhibit higher success rates of query if the amount and variance in the errors are not too large. It thus enhances our ability to explore a much larger candidate-solution space and enables us to deal with larger problems.
The oracle identification problem also offers a useful primitive for quantum machine learning (QML) studies Schuld et al. (2015); Biamonte et al. (2017), Here we also establish the link to a quantum advantage in QML. More specifically, the quantum advantage in Boolean oracle identification leads to a reduction in the sample complexity bound in the “probably-approximately-correct (PAC)” learning model Valiant (1984); Langley (1995). This result is also applicable to other related problems, e.g., learning-with-error (LWE) Regev (2009).
Boolean oracle identification.—This is a fundamental computational problem and is defined as follows Ambainis et al. (2004); Childs et al. (2013): Given a Boolean oracle which maps an -bit binary string ( ) to a binary value , the task is to identify , while minimizing the number of queries to the oracle. In classical computation, the input data is classical. The query complexity of the problem is , where is the set of candidate and . On the other hand, the corresponding quantum algorithm usually begins by changing these classical inputs to corresponding form of quantum states, e.g., , in order to exploit superpositions in the quantum state. Thus, a (fully-)quantum oracle maps to for . In the absence of noise, the computation power of the classical query carries over to the quantum cases Kothari (2014); Arunachalam and de Wolf (2016); Ciliberto et al. (2018).
A classical-quantum hybrid oracle.—In our scheme, we consider a hybrid oracle , with -bit classical “input/output (I/O)” channels. We allow classical data signals and a single qubit [See Fig. 1(a)]. Then the oracle operation implements . Here, the query-output state is defined, without loss of generality, as
where is the probability of getting the correct query output Cross et al. (2015); Bang et al. (2019). A measurement is performed on to identify the oracle’s answer. Note here that the classical input remains unaltered during and after the oracle operation.
This oracle can be realized by a circuit illustrated in Fig. 1(b). The circuit contains gates acting on the ancilla qubit: the single-qubit gate and of gates () conditioned on the classical bit values in . Here the gates are
where , , and are the Pauli operators. This circuit realization of the oracle is inspired by the binary-classification formula Gupta et al. (2006)
where () are known as the Reed-Muller coefficients. Each has a corresponding gate operation , where means that leaves the bit-signal unchanged (identity) and means that flips the bit-signal (logical-not) Toffoli (1980). Thus, the oracle is characterized by a fixed set of operators for a given . The circuit in Fig. 1(b) is universal since the form of Eq. (3) realizes all possible Boolean functions. Note that since the oracle is treated as a black-box, the gates are predetermined 111The oracle is assumed to be already given, so the complexity associated with a realization of the circuit will not be considered here..
Now we can consider systematic error that can occur in the circuit, which arises from errors in the gates and no errors are present for the classical signal . These errors in gates can eventually cause the failure of the query with probability —which is often referred to as “classification error model” Regev (2009). In a fully-classical model, these errors are usually modeled in the following way: the bit-signal is flipped (i.e., ) with a certain probability before or after applying -th gate . Then the corresponding quantum error can be described by , where is the state passing through the gate . Here is a bit-flip operation defined by . Such an error model is realistic, for instance, in ion-trap and super-conducting qubits, where the above systematic errors are caused by imperfect control pulses on primitive gates like , Debnath et al. (2016).
Analysis.—We now analyze the query-success probability , defined in Eq. (1). Here, the subscripts “” and “” refer to when the ancilla state in our oracle is respectively quantum or classical. First, let us define a set whose elements are taken to be the indices of the gates which are ‘activated’ (i.e., when the corresponding classical control bit ). The number of these activating gates is given by , where the factor denotes the Hamming-weight of , i.e., the number of ’s satisfying for . Then, can be written in terms of . When the ancilla state is classical, can be estimated as
where is defined as the average error probability; i.e., . The variance of the error probability , is assumed to be small. Here the factor , which we call the “characteristic constant”, is defined as
where it is assumed that . From Eq. (4), the interpretation of the characteristic constant is the characteristic number of steps of the gate operations, i.e., here, allowed before the oracle gives completely random outputs.
When the ancilla state is quantum however, the corresponding success probability is
we can show that becomes unity in the limit of . Thus, so long as the gate errors are regular () Cross et al. (2015), our hybrid oracle makes no mistakes. We can see that our gates in Eq. (2) clearly satisfies the anti-commutation relation in Eq. (7). This anticommutation relation enables the amplitudes associated with gate errors to be ‘canceled out’ by destructive interference. For the detailed analysis, see Sec. S1 of the Supplementary Information.
However, it is impractical to achieve such a perfect errorlessness, since in a realistic situation . Furthermore, we should also consider another type of quantum error, phase-flip. This is also crucial to study in generating a successful query output since the amplitudes changed by the errors would interfere in a disorderely way due to the phase-flip 222Such a feature is very often encountered in many physics models, for example when dealing with the localization problems Eleuch et al. (2017).. Consequently, has a form analogous to that in Eq. (4). Here the characteristic constant is replaced with an ‘effective’ characteristic constant where again . Here is defined in terms of an effective average error that ’s experience. is much smaller than , because comes from remaining errors only after destructive interference. Interesting, this feature
does not depends on , but rather on the variance .
From this feature we can show a quantum advantage with our scheme. We begin with the average Hamming weight for a given number of input-bit strings. Then, on average, our hybrid oracle is useful up to the length of input-bit strings, whereas is the upper limit in the purely classical case. So if our hybrid oracle can be useful for larger bit-string inputs. It also implies expansion of the search space which can be explored by the given noisy oracle, approximately from to , where the factor . In addition to our theoretical analysis, we include accompanying numerical simulations, in which are evaluated by counting a large number () of queries for each given number of and they are averaged over the trials () again. To simulate a more realistic scenario, it is assumed that ’s are drawn from a normal distribution . We assume further that the ancilla qubit also suffers from the phase-flip on each gate with probability , drawn from . Indeed, the obtained simulation results confirm our theoretical analysis, allowing us to identify and for a given noise level. For example, when with , our hybrid oracle would be applicable up to even in the presence of of phase-flip, whereas would be the limit of the purely classical case. Equivalently, the hybrid oracle can cover up to size of the candidate space, which is much larger than allowed in the classical case. The identified and are listed in Table S3. For details on the methods and results of the numerical analysis see Sec. S2 in the Supplementary Information.
A quantum machine learning advantage.—The quantum advantage described above can also be applied to quantum machine learning. It leads to a reduction in the sample complexity bound in the probably-approximately-correct (PAC) learning model Valiant (1984); Langley (1995). To see this, consider a learning algorithm with access to our hybrid oracle. Then the bound of the learning sample complexity can be found as follows. First, let us sample a sequence of the training data of a binary classification problem, where denotes an outcome of the measurement performed on . Here, if the sampling is carried out with
we can define a legitimate learner—a so-called (, )-PAC learner—that finds in the hypothesis space . Here and are defined as the inaccuracy and learning-failure probability, respectively.
Here, it is nontrivial to evaluate , particularly when the oracle is erroneous. By comparison to previous studies Angluin and Slonim (1994), can be found in our case where
Here is the average query-success probability, given by . Using a purely classical oracle on the other hand, the classical counterpart to is , which has the same form as except it is defined using instead of . Since is characterized by instead of , we can show the reduction of the sample complexity where we previously derived . We can rewrite to a more useful form
From this, we see in the regime of small , there is only a small increment of the sample complexity bound. For large enough however, this increases abruptly. Therefore, for large our hybrid oracle allows to define a (, )-PAC learner, whereas one cannot be defined with a fully-classical oracle. However, it should be noted that if is too large (roughly, when ), it is also impractical to define a legitimate PAC learner even with the quantum learning advantage. This result is comparable with the recent QML study in Ref. Cross et al. (2015); Grilo et al. (2019). However, what is more remarkable in our case is that the quantum learning advantage is achieved with classical input data directly without need of embedding the classical data into quantum states at all. This differs from most other quantum-enhanced machine learning algorithms. To see this feature clearly, numerical simulations are carried out, where are evaluated by repeating trials for randomly sampled inputs 333In other words, each bit () in are to be either or with probability .. Here we look at the range of to . In these simulations, we assume with and with . In Fig. 2, we plot the dependence of and on . This agrees well with our theoretical predictions. See Sec. S3 of the Supplementary Information for more detailed method and analysis.
Summary.—We have studied how a quantum advantage might be achieved on devices in the NISQ era by employing a classical-quantum hybrid architecture. For solving the Boolean oracle identification problem, the key feature in our proposal is that the input data can remain completely classical and does not need to be embedded into a quantum state before quantum processing. In fact, our protocol can be achieved with only a single qubit. We show that not only can this new hybrid framework reduce the query complexity of the problem, exploring much larger search space, but it also effective in the presence of realistic noise. Furthermore, we can establish a link to the speed-up of QML, where we generalize the quantum advantage in oracle identification to a reduction of the learning sample complexity in a quantum learning problem. These results can also be applied to several other tasks. For example, our result are highly suggestive of a possible connection with post-quantum cryptography, exhibiting a similar conclusion to Ref. Grilo et al. (2019), particularly with classical samples. The quantum advantage presented here is also believed to be possible experimentally Lee et al. (2019). Our new classical-quantum hybrid framework is therefore both timely and significant, facilitating present-day and near-future quantum technologies .
Acknowledgements.—This research was implemented as a research project on developing quantum machine learning and quantum algorithm (No. 2018-104) by the ETRI affiliated research institute. MW was supported by NCN grants 2015/19/B/ST2/01999 and 2017/26/E/ST2/01008. MP was supported under FNP grant First Team/2016-1/5.
- Shor (1997) P. W. Shor, SIAM J. comput. 26, 1484 (1997).
- Grover (1997) L. K. Grover, Phys. Rev. Lett. 79, 325 (1997).
- Harrow et al. (2009) A. W. Harrow, A. Hassidim, and S. Lloyd, Physical review letters 103, 150502 (2009).
- Preskill (2018) J. Preskill, Quantum 2, 79 (2018).
- Aaronson (2015) S. Aaronson, Nature Physics 11, 291 (2015).
- Giovannetti et al. (2008a) V. Giovannetti, S. Lloyd, and L. Maccone, Phys. Rev. Lett. 100, 160501 (2008a).
- Giovannetti et al. (2008b) V. Giovannetti, S. Lloyd, and L. Maccone, Phys. Rev. A 78, 052310 (2008b).
- Bang et al. (2014) J. Bang, J. Ryu, S. Yoo, M. Pawłowski, and J. Lee, New Journal of Physics 16, 073017 (2014).
- McClean et al. (2016) J. R. McClean, J. Romero, R. Babbush, and A. Aspuru-Guzik, New Journal of Physics 18, 023023 (2016).
- Mitarai et al. (2018) K. Mitarai, M. Negoro, M. Kitagawa, and K. Fujii, Physical Review A 98, 032309 (2018).
- McCaskey et al. (2018) A. McCaskey, E. Dumitrescu, D. Liakh, and T. Humble, arXiv preprint arXiv:1805.09279 (2018).
- Sohn et al. (2019) I. Sohn, J. Bang, and J. Heo, Scientific reports 9, 3302 (2019).
- Peng et al. (2016) T. Peng, A. Harrow, M. Ozols, and X. Wu, arXiv preprint arXiv:1904.00102 (2016).
- Yoo et al. (2014) S. Yoo, J. Bang, C. Lee, and J. Lee, New Journal of Physics 16, 103014 (2014).
- Lee et al. (2019) J.-S. Lee, J. Bang, S. Hong, C. Lee, K. H. Seol, J. Lee, and K.-G. Lee, Phys. Rev. A 99, 012313 (2019).
- Bang et al. (2019) J. Bang, A. Dutta, S.-W. Lee, and J. Kim, Physical Review A 99, 012326 (2019).
- Ambainis et al. (2004) A. Ambainis, K. Iwama, A. Kawachi, H. Masuda, R. H. Putra, and S. Yamashita, in Annual Symposium on Theoretical Aspects of Computer Science (Springer, 2004), pp. 105–116.
- Buhrman et al. (2007) H. Buhrman, I. Newman, H. Rohrig, and R. de Wolf, Theory of Computing Systems 40, 379 (2007).
- Cross et al. (2015) A. W. Cross, G. Smith, and J. A. Smolin, Physical Review A 92, 012327 (2015).
- Schuld et al. (2015) M. Schuld, I. Sinayskiy, and F. Petruccione, Contemporary Physics 56, 172 (2015).
- Biamonte et al. (2017) J. Biamonte, P. Wittek, N. Pancotti, P. Rebentrost, N. Wiebe, and S. Lloyd, Nature 549, 195 (2017).
- Valiant (1984) L. G. Valiant, Communications of the ACM 27, 1134 (1984).
- Langley (1995) P. Langley, Elements of machine learning (Morgan Kaufmann, 1995).
- Regev (2009) O. Regev, Journal of the ACM (JACM) 56, 34 (2009).
- Childs et al. (2013) A. M. Childs, R. Kothari, M. Ozols, and M. Roetteler, in 8th Conference on the Theory of Quantum Computation, Communication and Cryptography (TQC 2013) (Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, 2013), vol. 22 of Leibniz International Proceedings in Informatics (LIPIcs), pp. 50–79.
- Kothari (2014) R. Kothari, in 31st International Symposium on Theoretical Aspects of Computer Science (STACS 2014) (Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, 2014), vol. 25 of Leibniz International Proceedings in Informatics (LIPIcs), pp. 482–493, ISBN 978-3-939897-65-1, ISSN 1868-8969.
- Arunachalam and de Wolf (2016) S. Arunachalam and R. de Wolf, arXiv preprint arXiv:1607.00932 (2016).
- Ciliberto et al. (2018) C. Ciliberto, M. Herbster, A. D. Ialongo, M. Pontil, A. Rocchetto, S. Severini, and L. Wossnig, Proc. R. Soc. A 474, 20170551 (2018).
- Gupta et al. (2006) P. Gupta, A. Agrawal, and N. K. Jha, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 25, 2317 (2006).
- Toffoli (1980) T. Toffoli, in International Colloquium on Automata, Languages, and Programming (Springer, 1980), pp. 632–644.
- Debnath et al. (2016) S. Debnath, N. M. Linke, C. Figgatt, K. A. Landsman, K. Wright, and C. Monroe, Nature 536, 63 (2016).
- Angluin and Slonim (1994) D. Angluin and D. K. Slonim, Machine Learning 14, 7 (1994).
- Grilo et al. (2019) A. B. Grilo, I. Kerenidis, and T. Zijlstra, Physical Review A 99, 032314 (2019).
- Eleuch et al. (2017) H. Eleuch, M. Hilke, and R. MacKenzie, Physical Review A 95, 062114 (2017).
Appendix S1 S1. Detailed calculations of
Here, we present the procedure to calculate in Eq. (6) of the main manuscript. We start by analyzing the simple case, i.e., of . In particular, we consider an input satisfying for arbitrary and for all . Subsequently, only two gates and are activated with . In a purely classical query, is given as
where is the probability that a bit-flip error will occur at (). Meanwhile, is calculated as below:
where is the error operation, defined in the main manuscript. Using the properties in Eq. (7) of the main manuscript, i.e., and , we can evaluate the following:
Subsequently, using Eq. (S14), we can obtain
This factor is from quantum superposition and clearly indicates the enhancement of the success probability with the condition . In Fig. S3, we depict the graphs of with respect to and . It is noteworthy that our hybrid oracle always yields correct results, i.e., , provided that , even though and are large. This is the most remarkable feature in our classical–quantum hybrid query.
Subsequently, we consider the case of , where a set of four gates, , , , and , are to be activated with . We subsequently calculate as follows:
To proceed with the calculation, we introduce an identity , where the state () is defined with the following properties:
Using a mathematical method of substituting the identity between and in Eq. (S17), we can obtain
Furthermore, after some algebraic simplifications, we can arrive at
Here, is defined as for , similarly to Eq. (S16). Subsequently, using Eq. (S19) and Eq. (S20), we demonstrate that the quantum advantage can be achieved with the positive factors 444Note that Eq. (S20) could be negative thus exhibiting the disadvantage, e.g., when or for all input . However, the aforementioned situation is not likely to occur in real physical systems.. Consistent with the case of , we observed that becomes unity when .
By observing the two cases above, we can infer that the same method, i.e., of introducing the identities, can be used to calculate for arbitrary higher Hamming-weight inputs. The most remarkable construction, i.e., having unity query-success probability with equal error probabilities, can be generalized as well. Therefore, it can be sufficiently concluded that the enhancement in the query-success probability can be achieved for an arbitrary Hamming-weight in our hybrid query.
Appendix S2 S2. Numerical analyses with realistic conditions
As mentioned in the main manuscript, in a more realistic situation, the amplitudes related to the errors are not completely canceled out owing to a nonzero , and exhibits an analogous form to in Eq. (4) of the main manuscript, with an ââeffective” characteristic constant . Here, the effective average error is expected to be much smaller than . This feature results in the quantum advantage that does not depend on the degree of but only on , i.e., how ââvarying” they are.
|(c.f., )||(c.f., )|
To corroborate and extend our theoretical predictions, we perform a numerical analysis. It starts with an input of . We subsequently evaluate by counting the number of “” (e.g.,, “success”) and “” (e.g.,, “failure”), such that , where and denote the numbers of success and failure, respectively, and . Here, we use the Monte-Carlo approach to mimic quantum measurement statistics. This simulation is repeated for different values of (for ) satisfying 555This condition enables us to analyze the data statistically (i.e., by averaging over the trials) without losing generality, even though in each simulation is changed with different .. First, as an extreme but illustrative example, we consider the case of , i.e., by assuming for all possible . As results, we present the graphs of versus as dots in Fig. S4(a) for , , and , where each data point of is obtained by averaging over trials. Here, it is observed that decays fast to , indicating good agreement with Eq. (4) of the main manuscript. The data of are, meanwhile, shown to be unity without depending on the degree of , as predicted. Next, we consider a realistic situation, assuming that is drawn from a normal distribution for all (and hence for ). Here, we set with , , and . The simulation results are shown in Fig. S4(b). For all cases of , both and decay to ; however, is much slower. It is also observed that the data of matched well with Eq. (4) of the main manuscript, thus allowing us to identify the effective characteristic constant . The identified values of and are listed in Tab. S2; they manifest the predicted condition in Eq. (8) of the main manuscript.
|(c.f., )||(c.f., )|
For a more realistic condition, we consider another type of error, i.e., phase-flip in the assistant qubit that would be crucial for maintaining a higher success rate of the query. In particular, we assume that the phase-flip errors primarily occur when the qubit travels between and with a certain probability . First, when (or equivalently, ) for all , the phase-flip errors do not affect the query process and becomes unity. In the realistic case, namely of , however, it is predicted that the amplitudes of the bit-flip errors would interfere disorderly owing to the phase-flip, and eventually the quantum advantage becomes smaller, as described in our main manuscript. Thus, we perform the simulations and present the data of in Fig. S5. Here, is assumed to be drawn from for all . The simulation data are generated for , and . Here, we set with . The data are well fitted by Eq. (4) of our main manuscript, and are well estimated from the data (see Tab. S3). As expected, the quantum advantage becomes less pronounced as is increased; however, it can still exhibit a higher success rate of the query. It is noteworthy that the data obtained for both are almost identical (up to the second digit of a decimal).
Appendix S3 S3. Reduction in learning sample complexity in the framework of probably-approximately-correct (PAC) learning
In a probably-approximately-correct (PAC) learning model Valiant08-S (), a learner (or equivalently, a learning algorithm) samples a finite set of training data () by accessing an oracle, aiming at obtaining the best hypothesis close to for a given set, e.g., , of the hypothesis . Here, is typically assumed to be drawn uniformly. Subsequently, a learning algorithm is a (, )-PAC learner (under uniform distribution), if the algorithm obtains an -approximated correct with probability ; more specifically, satisfying
where denotes the error. Here, if identified by the algorithm agrees with
of samples constructed from the oracle, then Eq. (S22) holds. Here, denotes the cardinality of . Eq. (S23) is known as the bound of the sample complexity Valiant08-S (); Langley96-S (), i.e., it yields the minimum number of training samples to successfully learn satisfying Eq. (S22). Such a sample complexity bound derived from the previous studies can directly be carried over to our scenario; in our classical–quantum hybrid query scheme, the same sample complexity bound exists, because and identified by the measurement on are classical.
However, in the case where the oracle is not perfect, the bound of sample complexity in Eq. (S23) is modified as follows: First, we draw a sequence of the training data sampled from our classical–quantum hybrid oracle, where denotes the outcome of the measurement performed on . Subsequently, if the sampling is performed with
It is noteworthy that in the purely classical case, the corresponding factor, e.g., , is given with instead of . Thus, we can derive the reduction in the sample complexity with the condition from . To view this explicitly, we rewrite in Eq. (S25) to a more useful form: