This site uses cookies. By continuing to use this site you agree to our use of cookies. To find out more, see our Privacy and Cookies policy.
Brought to you by:
Paper

Compact quantum kernel-based binary classifier

, , , and

Published 7 July 2022 © 2022 IOP Publishing Ltd
, , Citation Carsten Blank et al 2022 Quantum Sci. Technol. 7 045007 DOI 10.1088/2058-9565/ac7ba3

2058-9565/7/4/045007

Abstract

Quantum computing opens exciting opportunities for kernel-based machine learning methods, which have broad applications in data analysis. Recent works show that quantum computers can efficiently construct a model of a classifier by engineering the quantum interference effect to carry out the kernel evaluation in parallel. For practical applications of these quantum machine learning methods, an important issue is to minimize the size of quantum circuits. We present the simplest quantum circuit for constructing a kernel-based binary classifier. This is achieved by generalizing the interference circuit to encode data labels in the relative phases of the quantum state and by introducing compact amplitude encoding, which encodes two training data vectors into one quantum register. When compared to the simplest known quantum binary classifier, the number of qubits is reduced by two and the number of steps is reduced linearly with respect to the number of training data. The two-qubit measurement with post-selection required in the previous method is simplified to single-qubit measurement. Furthermore, the final quantum state has a smaller amount of entanglement than that of the previous method, which advocates the cost-effectiveness of our method. Our design also provides a straightforward way to handle an imbalanced data set, which is often encountered in many machine learning problems.

Export citation and abstract BibTeX RIS

1. Introduction

As the quest for fault-tolerant quantum computers continues, noisy intermediate-scale quantum (NISQ) computers are expected to be available in the near future [1], supported by the recent technological advances in quantum computing [29]. Although the size of quantum circuits that NISQ devices can execute reliably is limited, the size of the quantum state space efficiently manipulated by them is much beyond what classical computers can handle. As such an interesting era is within reach, an important task in the quantum computing community is finding commercially relevant applications of the NISQ technology for which quantum advantage can be demonstrated in the near future.

Machine learning has been considered as a promising domain for which quantum computing can shine [1015]. Quantum advantages in machine learning are expected, since quantum computers can in principle store and manipulate the amount of classical information that scales exponentially with the number of qubits [1618]. Moreover, quantum computers can reduce the computational cost exponentially for solving certain basic linear algebra problems [19, 20] that often appear as basic subroutines in machine learning tasks, such as in support vector machine [21] and principal component analysis [22]. However, the size of quantum circuits required for implementing basic linear algebra subroutines on a quantum computer is too large for near-term quantum devices.

Several quantum machine learning algorithms have been proposed to perform the kernel-based classification by exploiting the ability of quantum computers to efficiently evaluate inner products in an exponentially-large Hilbert space [15], and without relying on expensive subroutines [21, 2327]. In particular, references [25, 26] proposed the most simple quantum circuit for utilizing the quantum interference effect now known as the Hadamard-test classifier (HTC) and show that it can be used as a simple model of a kernel-based classifier for real-valued data. If an efficient state preparation routine is known, the algorithm achieves the logarithmic scaling in the dimension and number of the input data with a simple setup. Namely, given a quantum state that encodes the classical data in a specific form, the algorithm only uses a Hadamard gate and the expectation measurement of a two-qubit observable to complete the labeling task. Furthermore, the algorithm is agnostic to the quantum data encoding method, such as amplitude encoding [12] and quantum feature mapping [24].

In this work, we present a kernel-based quantum binary classifier that is even simpler than HTC by introducing compact amplitude encoding (CAE) of real-valued data, which reduces the number of training steps linearly and the number of qubits by two. In CAE, training data belonging to one class is encoded as the real part of the probability amplitudes, while the remaining training data is encoded as the imaginary part. In order to utilize CAE, we show that the single-qubit interfering circuit of the HTC can be generalized to take the imaginary part of the quantum state into account. In this way, the label information encoding is not explicitly executed on a quantum circuit and two sets of data are encoded in a single quantum register, thereby eliminating the state preparation subroutine for preparing the label registers and reducing the number of index qubits. Furthermore, our classifier provides a simple method for assigning arbitrary weights to two training data sets with different labels, which broadens the application of our method to imbalanced data sets in which the number of training data points in two classes are unequal. The CAE also localizes data so that the entanglement is reduced compared to the HTC. Although this finding is only on a numerical basis, we suspect that this is a general feature. This could lead to better performance of the classifier in the NISQ era since less entanglement implies reduced circuit complexity [2831].

The remainder of the paper is organized as follows. Section 2 provides theoretical backgrounds and reviews for this study, such as the description of the classification problem and the existing kernel-based quantum classifier that has been known to be the simplest. Section 3 explains the main classification algorithm proposed in this work. In section 4, we carry out the entanglement analysis with numerical simulations of classification on Iris and Wine data sets as examples. The simulation results show that the classifier proposed in this work is more compact than the HTC with respect to the amount of entanglement the circuit produces. Section 5 concludes and discusses future research directions.

2. Quantum kernel-based classifier

2.1. Binary classification

Classification is a canonical pattern recognition problem that aims to label a data point $\tilde{x}\in {\mathbb{R}}^{N}$ as accurately as possible given a labeled (or training) data set

Since the training data set includes labels, this task can be addressed via a supervised machine learning technique. Among many machine learning approaches, a kernel method provides a straightforward interpretation of the classification process. It is based on choosing a feature space for the data set such that the classification score is defined as a linear function of the similarity (i.e. kernel) between each training data and the test data. This principle naturally connects quantum computing to kernel-based classification since the quantum Hilbert space can be used as the data feature space with a proper definition of the similarity [15, 24].

In this work, we focus on real-valued data as is common in practical machine learning tasks. Moreover, we focus on binary classification (i.e. L = 2) since a multi-class classification can be constructed with binary classifiers by one versus all or one versus one scheme [32]. Note that in binary classification, the two class labels are often denoted as ±1.

2.2. Amplitude encoding

The first step towards utilizing the quantum Hilbert space as the feature space is encoding classical data as a quantum state. Although the best encoding strategy remains an open problem, many previous quantum machine learning algorithms chose to represent a classical vector ${\mathbf{x}}_{j}={({x}_{0j},\dots ,{x}_{(N-1)j})}^{\mathrm{\top }}\in {\mathbb{R}}^{N}$ as probability amplitudes of a quantum state in the following form [12, 21, 22, 25, 33],

Equation (1)

using ⌈log2(N)⌉ qubits, where the input vector is normalized and have unit length, i.e. ||xj || = 1. The above form of data encoding is often called amplitude encoding, and it can be generalized for a set of M data points x1, ..., xM as

Equation (2)

which uses at least ⌈log2(NM)⌉ qubits.

Hereinafter, we will omit the Kronecker product symbol (⊗) and write |i⟩ ⊗ |j⟩ = |ij⟩ whenever the meaning is clear.

2.3. Hadamard-test classifier

A simple model of quantum classifier for real-valued data was introduced in reference [25], and is nowadays referred to as the HTC. This work presents improvements of the HTC in several aspects, and hence this section briefly reviews the algorithm's structure.

For the HTC, the data set $\mathcal{D}$ is encoded in a quantum state as

Equation (3)

where |xj ⟩ and $\vert \tilde{\mathbf{x}}\rangle $ are quantum representatives of the classical training and test data vectors by utilizing an encoding of choice (a feature map). The label yj ∈ {−1, +1} is transformed to the computational basis of the label qubit with the rule yj → |(1 − yj )/2⟩ ∈ {|0⟩, |1⟩}. In the original paper [25], the weights were chosen uniform, i.e. aj = 1/M ∀ j, while it has been shown [27] that it can be used as a variable to be optimized, similar to the treatment in support vector machines. Principally, the HTC applies a Hadamard-test as measurement scheme: this applies a Hadamard gate to the ancillary qubit in order to interfere training and test data states. This is finalized by measuring an expectation value of a two-qubit observable ${\sigma }_{z}^{(\mathrm{a})}{\sigma }_{z}^{(\mathrm{l})}$ on the ancillary and label qubit, leading up to

Equation (4)

The superscripts a and l are the qubits on which the corresponding operator is applied, namely the ancillary and the label qubit, respectively. The connection between the HTC and the field of kernel methods is based on this equation. One can see that the kernel function is $k({\mathbf{x}}_{j},\tilde{\mathbf{x}})=\langle {\mathbf{x}}_{j}\vert \tilde{\mathbf{x}}\rangle $. Consequently, the right-hand side of equation (4) defines the classification score, which is denoted by f. Therefore, HTC assigns a new label to the test data by the rule

Equation (5)

3. Compact classifier

3.1. Generalization

The generalization of the interference circuit of the HTC was discussed in reference [34] as a means to show that the Hadamard gate is the optimal choice for minimizing the number of sampling. In this work, we take a step further and utilize the generalized interference circuit to reduce the quantum circuit cost of the HTC.

The generalized interference circuit for the HTC uses Rz (ϕ)Ry (θ0) in place of the first Hadamard gate, and uses Ry (θ1) in place of the last Hadamard gate, where Rz (ϕ) = cos(ϕ/2)I − i sin(ϕ/2)σz and Ry (θ) = cos(θ/2)I − i sin(θ/2)σy are the single-qubit rotation gates. As shown in reference [34], the two-qubit expectation value measured in the generalized interference circuit is

Equation (6)

While the original HTC only uses the real part of the inner product (i.e., $\langle \tilde{\mathbf{x}}\vert {\mathbf{x}}_{j}\rangle $) in the classification algorithm, the generalized interference circuit opens up the possibility of harnessing the imaginary part as well. Since the goal of this paper is to utilize the imaginary part, we set θ0 = π/2 and θ1 = −π/2 for simplicity. In this case, equation (6) becomes

Equation (7)

The above result can also be obtained by applying a single-qubit rotation gate Rz (ϕ) to the ancilla qubit of the HTC in equation (3).

3.2. Compact amplitude encoding

The main idea in this work is based on the observation that if cos(ϕ) and sin(ϕ) in equation (7) have the same sign, then the real and imaginary parts of the state overlap contributes with opposite sign. Thus by encoding the training data with label +1 (−1) to real (imaginary) part of the probability amplitudes of the quantum state, the binary classification can be done without explicitly preparing the label register. This leads to reducing the number of qubits by one. Note that when the number of training data vectors in two classes is the same, $\mathrm{cos}(\phi )=\mathrm{sin}(\phi )=1/\sqrt{2}$. In section 3.3, we discuss how to control ϕ for imbalanced data set.

With this background, the CAE is introduced to utilize the imaginary part as follows. In CAE, two N-dimensional real vectors ${\mathbf{x}}_{k}^{+}={({x}_{0k}^{+},\dots ,{x}_{(N-1)k}^{+})}^{\mathrm{\top }}$ and ${\mathbf{x}}_{k}^{-}={({x}_{0k}^{-},\dots ,{x}_{(N-1)k}^{-})}^{\mathrm{\top }}$ with the corresponding labels indicated by the superscript (±) are loaded in a quantum state in the following form,

Equation (8)

where ${\Vert}{\mathbf{x}}_{k}^{+}{{\Vert}}^{2}+{\Vert}{\mathbf{x}}_{k}^{-}{{\Vert}}^{2}=1$ to satisfy the normalization condition. Note that various scaling methods can be employed to satisfy this condition, and one of the natural ways is to scale each vector so that ${\Vert}{\mathbf{x}}_{k}^{\pm }{\Vert}=1/\sqrt{2}$. We implicitly assume this way of normalizing vectors unless stated otherwise. The above equation shows that two N-dimensional vectors are encoded in ⌈log2(N)⌉ qubits. The subscript c in equation (8) distinguishes the quantum state from amplitude encoding, and indicates that the classical vector is encoded via CAE. It is important to note that |⋅⟩c means two data points are encoded in the state vector, whereas the ordinary ket vector without the subscript c means one data point is encoded. In addition, we define two more states as

Equation (9)

Then the state overlap between two quantum registers, one encodes an N-dimensional real vector $\tilde{\mathbf{x}}$ via amplitude encoding (equation (1)) and the other encodes two N-dimensional real vectors ${\mathbf{x}}_{k}^{+}$ and ${\mathbf{x}}_{k}^{-}$ via CAE (equation (8)) is

Equation (10)

3.3. Compact quantum binary classifier

The compact quantum machine learning algorithm that implements the binary classifier from equation (5) is constructed as follows. We first prepare an initial state that encodes the data set $\mathcal{D}$ as

Equation (11)

where the subscript c indicates that the state is prepared via CAE. It is important to note that ${\sum }_{j=1}^{M/2}{\,b}_{j}=1$, and hence the set of weights is different from that of the HTC which satisfies ${\sum }_{j=0}^{M-1}{\,a}_{j}=1$. For example, for a set of uniform weights, bj = 2/M and aj = 1/M. For simplicity, we assume that the number of data with label +1 denoted by M+ is equal to the number of data with label −1 denoted by M. The state above is easier to prepare than the state required in HTC shown in equation (3) since the label information is not explicitly encoded and the relative phase e−iϕ can be added by applying a single-qubit rotation gate Rz (ϕ) on the ancilla qubit. Moreover, since two training data are encoded in one quantum register, the number of terms in the summation is decreased by a factor of 2, meaning that the dimension of the index register is also decreased by a factor of 2. After the state preparation, the rest of the algorithm only requires a Hadamard gate and the measurement of the ancilla qubit in the σz basis. The Hadamard gate interferes the copies of the new input and the training inputs to produce a state

Equation (12)

The probability to measure the ancilla qubit in |0⟩ is given as

By denoting ${\kappa }_{j}={\langle \tilde{\mathbf{x}}\vert {\mathbf{x}}_{j}\rangle }_{\mathrm{c}}$, the above equation can be written as

Equation (13)

Similarly, the probability to measure the ancilla qubit in |1⟩ can be calculated as

Equation (14)

Therefore, the expectation value of the σz operator measured on the ancilla qubit is

Equation (15)

By setting $\mathrm{cos}(\phi )=\mathrm{sin}(\phi )=1/\sqrt{2}$ and using equation (10), we arrive at

Equation (16)

Since the state overlap for the training data in class +1 (−1) always have the positive (negative) sign, the above equation can be written in its final form as

Equation (17)

where ${b}_{m}^{\prime }={b}_{m+M/2}^{\prime }={b}_{m}$ for m = 0, ..., M/2 − 1 and ${\sum }_{j=0}^{M-1}{b}_{j}^{\prime }=2$. This outcome is similar to the classification score in the Hadamard classifier obtained by the two-qubit measurement. The constant factor of 1/2 is attributed to the different normalization conditions between the set of weights bj and aj as described below equation (11). We refer to this classifier as compact Hadamard classifier (CHC). The CHC is obtained with a single-qubit measurement implying that one can bypass the standardization of the training data set required in HTC for increasing the post-selection probability. The comparison of quantum circuits for implementing HTC and CHC is depicted in figure 1.

Figure 1.

Figure 1. The comparison of quantum circuits for the HTC (left) and CHC (right). The half-filled circles indicate that the unitary operation is the uniformly controlled gate [35, 36]. For the HTC, the filled rectangle connected with a vertical line to X applied to the label qubit indicates that the number of control qubits depends on the imbalance in the label proportion.

Standard image High-resolution image

The reduction of quantum circuit sizes, which is of critical importance in practice, achieved with CHC is as follows. By introducing a controllable relative phase between two computational basis states of the ancilla qubit and using CAE, the number of qubits is reduced by two, one for the label register and another in the index register. Then the quantum operations for encoding the training data set is reduced from M gates controlled by log2(M) index qubits to M/2 gates controlled by log2(M) − 1 index qubits. Having one fewer controlled qubit can further reduce the quantum circuit depth by a factor of two [37]. Therefore, the number of operations for encoding the training data set xj is reduced by a factor of four. The number of operations in CHC is also reduced due to the removal of operations for explicitly encoding the label information in a separate register. The number of gates needed for preparing the label register in HTC is 1 when the number of data belonging to each class is equal since one controlled-NOT gate controlled by one of the index qubits applied to the label qubit can split the Hilbert space into two subspaces with an equal number of 0's and 1's in the label qubit. But the number of operation increases linearly with the difference in the number of data with different labels. For example, if αM and βM data belong to class +1 and −1, respectively, where α + β = 1, then the number of operations necessary to encode label information grows as |αβ|M. Therefore, in total, our compact classifier can reduce the number of operations at least by a factor of four, while the reduction can be larger depending on the label distribution of the given training data set. Furthermore, the two-qubit measurement scheme used in HTC is reduced to single-qubit measurement.

As elucidated above, the number of training data vectors in two classes may be different. In this case, the real or imaginary part of the quantum state is zero for the missing data. The difference in the number of training data vectors in two classes can later be compensated by controlling the weights between the real and imaginary parts of the state overlap by finding ϕ that satisfies

where M± is the number of training data points in ±1 class.

Table 1 presents the classification accuracy of proof-of-concept experiments. We divided Iris and Wine datasets into training and test sets with a ratio of 80/20 and two classes and used the second and third features of the Iris dataset and the two principal components of the Wine dataset. We performed a search among 40 combinations of four training patterns (two from each class) and selected the combination with the best training accuracy. We used these four selected training points to evaluate the test accuracy. The use of two features and four training points allowed us to perform experiments in a small-scale quantum device. The accuracies and standard deviations in table 1 are obtained from 30 repetitions of the random division into training and test sets. The experimental results are from ibmq_manila, a quantum computer with five superconducting qubits available on the IBM quantum cloud service.

Table 1. Classification accuracy for the compact classifier on Iris dataset for 30 random separations obtained by simulation (sim) and experiment (exp). We used ibmq_manila, a quantum computer made available by IBM via cloud access, to obtain the experimental (exp) results. The standard deviation appears between parenthesis.

DatasetAccuracy (sim)Accuracy (exp)
Iris class 1 & 20.998 (0.009)0.952 (0.064)
Iris class 1 & 30.998 (0.009)0.965 (0.550)
Iris class 2 & 30.922 (0.059)0.853 (0.092)
Wine class 1 & 20.930 (0.046)0.894 (0.074)
Wine class 1 & 30.882 (0.072)0.829 (0.101)
Wine class 2 & 30.694 (0.068)0.657 (0.081)

3.4. Smallest quantum binary classifier

Let us denote $\vert {\Psi}({\mathbf{x}}_{j},\tilde{\mathbf{x}})\rangle =(\vert 0\rangle {\vert {\mathbf{x}}_{j}\rangle }_{\mathrm{c}}+{\text{e}}^{-\text{i}\phi }\vert 1\rangle \vert \tilde{\mathbf{x}}\rangle )/\sqrt{2}$. By allowing classical sampling from an ensemble $\left\{{a}_{j},\vert {\Psi}({\mathbf{x}}_{j},\tilde{\mathbf{x}})\rangle \right\}$, where aj is the probability to choose jth state, we can have the mixed state

Equation (18)

It is easy to verify that the expectation measurement of σx operator (equivalent to application of a Hadamard gate followed by σz measurement) yields the same outcome as shown in equation (15). In this approach, the index register is unnecessary, and hence we further reduce the number of qubits by ⌈log2(M)⌉ and the number of gates by O(poly(M)). This the smallest kernel-based binary classifier; one only requires ⌈log2(N)⌉ qubits for encoding the data set, and a qubit for measurement.

3.5. Connection to quantum feature mapping

Under certain restrictions, the compact encoding scheme can be applied to the quantum feature mapping framework introduced in reference [23] to store two training data in one quantum register. In principle, this can be done with the state preparation

Equation (19)

with a feature map UΦ(x)|0⟩L = |Φ(x)⟩ that maps N-dimensional data to L = O(N) qubits. Of course, the above state must satisfy $\langle {\Phi}({\mathbf{x}}_{k}^{+})\vert {\Phi}({\mathbf{x}}_{k}^{-})\rangle =0$. The feature map also needs to satisfy $\langle {\Phi}(\tilde{\mathbf{x}})\vert {\Phi}({\mathbf{x}}_{k}^{\pm })\rangle \in \mathbb{R}$ for all k. One way to prepare the above state is to apply unitary transformation

to |0⟩L . Since V is unitary, it must satisfy ${U}_{{\Phi}}({\mathbf{x}}_{k}^{+}){U}_{{\Phi}}{({\mathbf{x}}_{k}^{-})}^{{\dagger}}-{U}_{{\Phi}}({\mathbf{x}}_{k}^{-}){U}_{{\Phi}}{({\mathbf{x}}_{k}^{+})}^{{\dagger}}=0$. Finding an appropriate feature map that satisfies the above conditions while retaining the quantum advantage is a difficult task and we leave it as an interesting open problem.

Given that the state in equation (19) can be prepared, one can follow the strategy from the previous section. More explicitly, classical sampling from a set

with probability aj followed by the expectation measurement of σx operator yields

which is reduced to the classifier of equation (17) when ϕ = π/4.

4. Entanglement analysis

Understanding the fundamental source of the quantum advantage is of critical importance for establishing the ground for further developments of new ideas. The quantum resource we considered in this section is the entanglement of the system. Besides the fundamental perspective, entanglement is also deeply connected to the quantum circuit complexity. More specifically, it has been reported that lower amount of entanglement required in a quantum algorithm implies reduction in the number of entangling gates during state preparation [2831].

The measure of entanglement we use in this work is the Meyer–Wallach [38] measure, which calculates a value linearly related to the mean single-qubit purity of the state [39],

Equation (20)

where ρk is the single-qubit density matrix obtained by partitioning |ψ⟩ into one qubit and n − 1 qubits. The Meyer–Wallach measure is also occupied in quantifying the entangling capability of a variational quantum circuit due to its scalability and ease of computation [40]. Additionally, we also apply the geometric measure of entanglement [4143] with

Equation (21)

where the minimization is over all states |ϕ⟩ that are product states, i.e., $\vert \phi \rangle ={\otimes }_{l=1}^{n}\vert {\phi }^{l}\rangle $ with each |ϕl ⟩ being a local state. This can be efficiently approximated by Tucker decomposition [44].

To compare the Meyer–Wallach and geometric entanglement of the final states of the CHC and HTC, we use the Iris and Wine data sets [45]. We are interested in the value

Equation (22)

The final state of each classifier is created and the measure for entanglement is calculated. The data sets used were primarily chosen for reproducibility and the different feature sizes: Iris has four features (N = 4) and Wine has 13 (N = 13), for which we pad with zeros excess features due to the qubit nature. Encoding the final state, we use a number of samples of each class M = 2m (for m = 0, 1, 2, 3, 4, 5) from a test vs train split of 2/3 train and 1/3 test chosen at random. As both data sets are not binary, we limit data to the first two classes, after all, we are not interested in the actual classification, but in the entanglement structure. The numerical survey shows that the both Meyer–Wallach and geometrical entanglement in the CHC is always lower than that of the HTC for all sample size 2m+1 and each data set. The results are shown in figure 2 and table 2. In particular, the minimum Δ of each set shows that the value is always positive, hence the CHC is more resource saving in terms of entanglement. Note that there are several, non-equivalent, measures of entanglement, and a complete survey over all possible measures is beyond the scope of this work. Nevertheless, the trend we observed from evaluating two entanglement monotones advocates the compactness of the CHC.

Figure 2.

Figure 2. This figure shows the final state entanglement difference Δ of equation (22) between the HTC and the proposed compact classifier for the (a) Meyer–Wallach and (b) the geometric measure of entanglement. It shows that for two example data sets the difference is always positive, meaning that the HTC's final state always has higher entanglement. The feature dimension is 4 for the Iris data and 13 for the Wine data.

Standard image High-resolution image

Table 2. Data of the difference between the entanglement (Meyer–Wallach) of the HTC and the compact classifier proposed here from a statistical description of the distribution, i.e. ${{\Delta}}^{(m)}={Q}_{\text{HTC}}^{(m)}(\vert {\psi }_{\mathrm{f}}\rangle )-{Q}_{\text{CQBC}}^{(m)}(\vert {\psi }_{\mathrm{f}}\rangle )$. Each value is for a data type and a number of training data that are indicated in the first row as (data type, number of data). It can be seen that the minimum is always greater than zero. The Iris data set has four features, while the Wine data has 13 features. The table exhibits a trend that the entanglement difference decreases as the number of data register qubit increases. The table shows the statistical description using the mean, standard deviation, the minimum and maximum and finally the 25, 50, 75 percentiles.

 (Iris, 1)(Iris, 2)(Iris, 4)(Iris, 8)(Iris, 16)(Iris, 32)(Wine, 1)(Wine, 2)(Wine, 4)(Wine, 8)(Wine, 16)(Wine, 32)
Mean0.2510.2300.1860.1710.1570.1440.0640.0630.0620.0620.0590.057
Std0.0830.0610.0370.0260.0170.0160.0280.0200.0160.0110.0100.008
Min0.0720.1050.1110.1100.1140.1050.0200.0310.0380.0400.0450.044
25%0.1900.1880.1590.1510.1460.1320.0430.0480.0500.0530.0520.051
50%0.2560.2300.1800.1720.1600.1470.0600.0600.0600.0600.0570.056
75%0.3120.2780.2110.1850.1670.1570.0780.0720.0710.0700.0650.063
Max0.4720.4200.2690.2370.1910.1680.1320.1290.1250.0880.0890.074

The analysis with Iris and Wine data sets asserts that the classifier presented in this work is compact in the sense that it requires less entanglement for binary classification. The observed reduced entanglement has useful consequences. As mentioned in the beginning of this section, the lower entanglement allows for the reduction in the number of entangling gates by exploiting the consequential low Schmidt-rank of bi-partitions [30, 31]. Furthermore, if entanglement is lower, then an approximation with even less entangling operations can be found. We suspect that this can be a useful trait for machine learning protocols, because approximation errors in the state preparation will likely only affect near-decision boundary classifications. Even though the methods described in references [30, 31] are computationally expensive subroutines like singular value decomposition, the reduction in the state preparation complexity can be beneficial in the NISQ era, if the classification error due to the approximation is less than that due to the hardware imperfections and decoherence.

5. Conclusion

This work proposes a compact quantum binary classifier whose quantum circuit size is smaller than that of the HTC, which was previously considered to be the simplest kernel-based quantum classifier. Thus, our method is placed above existing kernel-based quantum classifiers as the potential application of NISQ computing. The compact quantum classifier is enabled by CAE we introduced in this work. This technique encodes one training data point from each class as the real and the imaginary part of the probability amplitude of a computational basis state. Since the label information of training data is implicitly encoded, there is no need to use a separate quantum register to explicitly encode the label information as required in previous methods. The removal of the label register naturally further reduces the two-qubit measurement scheme required in previous methods to the single-qubit measurement. Furthermore, the ease with which unbalanced data can be encoded and the applicability of feature maps is highlighted as good traits for applications. Using binary classification tasks with Iris and Wine data sets, we show that the quantum classifier proposed in this work is compact also in the sense that it requires less entanglement than the HTC.

State preparation is responsible for the main cost of CHC, HTC, and many machine learning algorithms. With a reduction in entanglement, one can attempt to create state preparation algorithms that are more efficient than the available alternatives. Reducing the circuit depth of CHC based on this intuition and the number of repetitions to generate a quantum advantage over classical algorithms for big data classification remains an important future work. Another interesting future research direction is to examine the possibility to create compact versions of other machine learning data initialization methods. For instance, some kernel methods as qubit encoding requires one qubit for each data feature. One could investigate how to reduce the required number of qubits without a reduction in the accuracy of a classifier. In addition, understanding the reason behind the reduced amount of entanglement created in the CHC algorithm compared to HTC remains an interesting open question. Answering this question could also help in designing a compact version of existing quantum machine learning algorithms. This could also lead to the discovery of quantum-inspired machine learning algorithms. Furthermore, analytical analysis of the entanglement difference (Δ) for the given size of the samples (M) and the features (N) remains to be done. Another interesting question is the condition on the unitary when using quantum feature maps to encode data, both in terms of expressibility and complexity. Since the HTC and CHC construct a binary classifier based on the quantum interference effect, one can speculate that quantum coherence plays a critical role. Quantum coherence can be regarded as a resource, and it has been rigorously studied within the framework of resource theory in references [4648]. Connection between quantum coherence and non-classical correlation has also been studied in references [49, 50]. Performing quantum resource theoretic analysis on the HTC and CHC is also remains as a potential future work.

Acknowledgments

This researchis supported by the National Research Foundation of Korea (NRF-2019R1I1A1A01050161, NRF-2021M3H3A1038085, and NRF-2022M3E4A1074591), and the South African Research Chair Initiative of the Department of Science and Technology and the National Research Foundation.

Data availability statement

The source code and data used in this study are available from the corresponding author upon reasonable request.

Please wait… references are loading.
10.1088/2058-9565/ac7ba3