Enhancing the performance of Variational Quantum Classifiers with hybrid autoencoders
G. Maragkopoulos A. Mandilara A. Tsili D. Syvridis











quantikz2,backgrounds,fit,decorations.pathreplacing




ε


theoremTheorem[section]
lemma[theorem]Lemma
proposition[theorem]Proposition
corollary[theorem]Corollary
proof[1][Proof]

  #1
definition[1][Definition]

  #1
example[1][Example]

  #1
remark[1][Remark]

  #1


APS/123-QED






Department of Informatics and Telecommunications, National and Kapodistrian
University of Athens, Panepistimiopolis, Ilisia, 15784, Greece



Department of Informatics and Telecommunications, National and Kapodistrian
University of Athens, Panepistimiopolis, Ilisia, 15784, Greece
Eulambia Advanced Technologies, Agiou Ioannou 24, Building Complex C, Ag. Paraskevi, 15342, Greece


Department of Informatics and Telecommunications, National and Kapodistrian
University of Athens, Panepistimiopolis, Ilisia, 15784, Greece



Department of Informatics and Telecommunications, National and Kapodistrian
University of Athens, Panepistimiopolis, Ilisia, 15784, Greece
Eulambia Advanced Technologies, Agiou Ioannou 24, Building Complex C, Ag. Paraskevi, 15342, Greece

§ ABSTRACT 


Variational Quantum Circuits (VQC) lie at the forefront of quantum machine learning research. Still, the use  of quantum networks for real data processing remains  challenging  as the  number of available qubits cannot accommodate a large dimensionality of data  –if the usual angle encoding scenario is used. To achieve dimensionality reduction, Principal Component Analysis  is routinely  applied as a pre-processing method  before the embedding of the classical features on qubits. In this work, we  propose an alternative method which reduces the dimensionality of a given dataset by taking into account the specific quantum embedding that comes after. This method aspires to make quantum machine learning with VQCs more versatile and effective on   datasets of high dimension. At a second step,  we propose a quantum inspired classical autoencoder model which can be used to encode information in low latent spaces. The power of our proposed models is exhibited via numerical tests. We show that our targeted dimensionality reduction method considerably  boosts  VQC's performance and we also identify cases for which the second model outperforms classical linear autoencoders in terms of reconstruction loss.



Enhancing the performance of Variational Quantum Classifiers with hybrid autoencoders
     Dimitris Syvridis
    MOX - Dipartimento di Matematica “F. Brioschi”, Politecnico di
Milano, via Bonardi 9, 20133 Milan, Italy

    ^1 arashandrea.roknian@mail.polimi.it

    ^2 anna.scotti@polimi.it

    ^3 alessio.fumagalli@polimi.it
    September 9, 2024
===============================================================================================================================================================================================================================================









§ INTRODUCTION


Quantum hardware  reaches new milestones faster than expected and IBM's roadmap indicates that quantum computers will be  capable of running 1 billion gates beyond 2033 <cit.>.
Still, Quantum Machine Learning (QML) faces numerous challenges not only at hardware level but also at design level,  with the domain  trying to compete with, the  more established  in real world applications, classical approaches <cit.>. One of the challenges  concerns the encoding of high-dimensional classical data into qubit states. In literature one mainly encounters four  types of encodings: basis, amplitude, Hamiltonian and angle encoding <cit.> –also known as time-evolution or rotation encoding.  While amplitude encoding is the most efficient in terms of qubit resources, popular packages <cit.> reveal that at this moment, angle encoding is the most widely used for QML models built with Variational Quantum Circuits (VQCs). 
However, considering angle encoding, the number of qubits is, in practice, as large as the dimension of the embedded data <cit.>, making the task intractable both for simulations and experiments.
One way to reduce the number of qubits is to increase the number of features per qubit by performing
repetitions of layers  across the quantum circuit <cit.>. In  a second approach  Principal Component Analysis (PCA) method is used to reduce the dimensionality before embedding  the extracted components to  a VQC  <cit.>. Still the question  whether more adapted methods exist for reducing the dimension of classical data before quantum embedding remains. 

To address this question, different suggestions have been put forward and tested during the last years. In <cit.> pre-trained models are used as a preface for quantum circuits, enhancing the ability of the last to classify images. In <cit.>, a supervised hybrid system  optimizes quantum embedding with the help of classical deep learning. In <cit.>, the authors integrate classical vision transformers in a VQC to create hybrid units which are then jointly trained. This hybrid model is a supervised learning model, demonstrating promising results. 
In recent works <cit.>, explore different flavours of angle encoding in various datasets, providing further evidence on angle encoding being the most prevalent encoding method. 

In this work, we propose a new method  for enhancing the encoding of high dimensional classical data into qubits by adjusting the idea of classical autoencoders (AE) to quantum variational methods, presented in Section  <ref>. We call the model  PCA-embedded quantum autoencoder (PQAE), since this consists from a classical autoencoding structure, the quantum data-embedding block of the VQC 
under study and a kernel PCA (KPCA) method that uses the generated quantum kernels. 
In contrast to existing encoding methods for QML, the proposed PQAE works with datasets of arbitrary size and complexity, by creating an autoencoder which re-generates the dataset with  a bottleneck layer that has the same structure as  the data embedding scheme of the VQC. A classical KPCA method is interjected after the bottleneck  enabling this hybrid method to treat a big number of qubits.  
In addition, we propose a quantum inspired classical model for dimesionality reduction as a secondary model, named quantum-inspired autoencoder (QAE). 
QAEs shares many similarities with PQAEs, yet their advantages come from a different scope. QAEs are classical models which regenerate the dataset using a quantum inspired transformation in the `bottleneck' layer which changes the data representation. 

The numerical results of Section <ref> show that PQAEs  can give an important boost in the VQCs performance as compared to PCA method. QAE also does achieve lower reconstruction error than common linear AEs in four typical classification tasks: Iris, Wines, Seed and (binary) MNIST datasets. Let us finally note that both proposed methods are unsupervised learners, meaning that the encoding is indifferent to the target of the task, thus the same encoded data could also be used for a range of classification tasks or regression.

Various methods in literature have claimed the name `quantum autoencoder', some of which we list in the following. In <cit.>, a quantum autoencoder is trained to compress quantum states, a task beyond classical capabilities. The compression occurs inside the quantum circuit, making it a quantum input to quantum output autoencoder, which differs from our classical input to classical output approach. In <cit.>, the authors directly follow the proposed scheme in <cit.>, and the quantum autoencoder is followed-up by a quantum classifier. This has a similar flavour to our approach, as they use a classifier after the encoder. In <cit.>, the authors construct a  fully quantum variational autoencoder, which is applicable for both classical and quantum data compression. Their proposed model is a direct translation of classical autoencoders in a quantum computer, in contrast, the models that we propose offer a hybrid approach that is not associated with an existing classical model.  In <cit.>, a model where a classical autoencoder is dressed with a quantum circuit is introduced. In this model, the trainable weights are present in both the classical and quantum parts of the model, in our approach we only train 
`classical weights' and use KPCA as well, with the goal of passing the data in the VQC. Finally,  quantum inspired activation functions are used in <cit.>, as the authors demonstrated that quantum activation functions are efficient in feature selection of input images, which showcase the potential of applying quantum inspired methods as we do with the QAE model. 




§ BASIC CONCEPTS AND METHODS

In order to make this work self-contained, we briefly describe here the basic classical and quantum methods
which we use to build the new models.




 §.§  PCA method and Classical Autoencoders



PCA is a statistical technique used for dimensionality reduction, widely applied in data analysis and Machine Learning (ML) <cit.>. It aims to transform a dataset with a high-number of features into a lower-dimensional form while retaining as much variability  as possible. 
Given n,   N-dimensional samples, 𝐱_i∈ℝ^N with i=1, …,n,   one first forms the data matrix  𝐗∈ℝ^n × N.  PCA begins by computing the covariance matrix 𝐂∈ℝ^N × N of  𝐗, given by:

    𝐂 = 1/n𝐗^⊤𝐗 .

 The eigenvectors 𝐯_1, 𝐯_2, …, 𝐯_N ∈ℝ^N of 𝐂 capture the directions of maximum variance in the data while the corresponding eigenvalues  λ_1, λ_2, …, λ_N
 are assumed in descending order. One chooses the first k eigenvectors, with k<N as the principal components and uses them 
to reduce the dimension of the initial data from N to k by projecting 
the data matrix 𝐗 on the space spanned by the k N-dimensional principal components.



KPCA  <cit.> offers a flexible approach as compared to traditional PCA, when the relationships between the data variables  𝐱_i are nonlinear. It operates by mapping the data into a higher-dimensional feature space using a kernel function k(𝐱_i, 𝐱_j) that computes the similarity between the data points 𝐱_i and 𝐱_j. In KPCA, instead of computing the covariance matrix directly, the kernel matrix 𝐊∈ℝ^n with elements K_ij = k(𝐱_i, 𝐱_j) is computed. The eigenvectors 𝐚_1, 𝐚_2, …, 𝐚_n and corresponding eigenvalues α_1, α_2, …, α_n of 𝐊 capture the principal components in the higher-dimensional space. To reduce dimensions using KPCA, one simply selects the eigenvectors of the kernel matrix with the highest eigenvalues.


AEs are a type of Neural Network (NN) used for unsupervised learning, particularly employed in the field of representation learning and dimensionality reduction <cit.>. The basic function of an AE is to learn a compressed representation of the input data. This is achieved by first reducing the dimensionality of the input, then reconstructing the original input from this representation, and train the weights in the model so that  a loss function between input and output is minimized, see Fig. <ref>.

In more detail, the encoder part of an AE network takes an input data 𝐱_i ∈ℝ^N and maps it to a lower-dimensional latent space representation 𝐳_i ∈ℝ^k. This process involves a series of transformations, usually implemented through L layers of NN units, represented as:

    𝐳_i = E(𝐱_i) = E_L(E_L-1(… E_1(𝐱_i) … )) .
 where E_j with j=1,…,L denotes the j-th layer of the encoder.
The decoder part of the AE network takes the compressed representation 𝐳_i (output of the encoder) and attempts to reconstruct the original input data 𝐱_i from it. The reconstruction process involves a series of inverse transformations, typically implemented through layers that mirror the encoder, represented as:

    𝐱_𝐢 = D(𝐳_i) = D_0(D_1(… D_L-1(𝐳_i) … ))
 where D_j where j=1,…,L denotes the j-th layer of the decoder, and 𝐱_𝐢 is the reconstructed output. The goal is to make 𝐱_𝐢 as close to 𝐱_i as possible by minimizing a loss function. For the analysis in this work we  employ the loss function of Mean Squared Error (MSE) defined as

    MSE = 1/n∑_i=1^n (𝐱_i - 𝐱_i)^2  .



AEs can be used as an alternative method to PCA for dimensionality reduction. Interestingly in <cit.>  is proven that  PCA is equivalent to shallow AEs consisting of only linear activation functions.  







 §.§ VQCs and Quantum Kernels



VQCs stand for quantum circuits built under specific architectural  ansatzes and with parametrized/variational quantum gates within.
 VQCs were introduced with the conception of Variational Quantum Algorithms (VQAs) <cit.> which are hybrid (quantum-classical)  algorithms  designed to address a big variety of computational  tasks by performing optimization in the parameters of a VQC.  A VQA adjusts the design of the    VQC, the measurements process on the output qubit states, the classical cost function built from these outputs and  the classical optimization techniques to the specific problem under study. 

In this work, we deal with the complex issue of encoding classical data to be processed in a VQC in the context of classification <cit.>, a supervised ML task. For such tasks, the simplest form of a VQC consists of two components:  the data-embedding or encoding block  and the variational or parametrised block. The data encoding block is the part of the quantum circuit where a classical data 𝐱 is encoded into the qubits' state |ϕ(𝐱) ⟩,  generating  the  quantum  feature map: 𝐱→ |ϕ(𝐱) ⟩ from the real space to the Hilbert space. In the variational block a sequence of parameterized quantum gates is applied on the encoded quantum state, and then the parameters, θ⃗ of these gates are optimized through a classical optimization process. The unitary action of the encoding block on the quantum states, followed by the variational part of the circuit can be described as |ψ_out⟩ = V̂(θ⃗) Û(ϕ(𝐱)) |ψ_in⟩ where habitually |ψ_in⟩=|00…0 ⟩. By repeated measurements on    the quantum state  |ψ_out⟩ for a selected observable,  one can derive probabilities for each label as for an NN.

Since in our model we mostly occupy with the encoding block of the VQC, let us focus on the encoding methods. Generally speaking, the most “qubit” efficient encoding method is the amplitude encoding method where a 2^n dimensional normalized vector 𝐱 is mapped on the state of n qubits as |ϕ(𝐱)⟩ = ∑_i=1^2^n x_i |i⟩. However while there are algorithmic procedures for preparing the quantum state |ϕ(𝐱)⟩ the number of gates in the related circuits is increasing exponentially with n <cit.>. In this work, we assume angle encoding in VQCs as this is the most `physical' encoding method, using classical features to parametrise angles of rotation gates which are in turn experimentally tunable parameters.
More specifically, we implement  Pauli Feature Maps, meaning that the classical data are embedded in the quantum circuit via angle encoding in single-qubit gates using the Pauli operators σ̂_x, σ̂_y, σ̂_z. For example, the trivial case of this encoding method leverages the product of a feature x ∈[0,1] with the Pauli operator  σ̂_y  as R_y(x π)=e^-i(x πσ̂_y/2). This expresses the incorporation of the feature x in  the  gate R_y(ϕ) that  rotates the Bloch vector of a state around the y axis for an angle ϕ. Such angle encodings can be performed using multiple features and Pauli gates, as e^-i∑x_iσ̂_i, increasing the complexity of the feature map <cit.>.
In addition to single qubit gates  used for the embedding of data,  the encoding circuit also includes entangling gates for exploiting in full extend the Hilbert space  and further increasing the complexity of the quantum feature map.




Finally, another flavour of KPCA can emerge if  classical kernels are replaced by quantum kernels. The latter are expressed as

    k(x, x') = |⟨ϕ(x) | ϕ(x') ⟩|^2

and can be understood as a similarity measure between data points 𝐱, 𝐱'  in the  space which emerges from the quantum feature map of an embedding circuit: 𝐱→ | ϕ(𝐱) ⟩, <cit.>.
The elements of a quantum kernel matrix can be experimentally estimated
via the  SWAP or  Inversion tests and then have the same use as classical ones <cit.>. Quantum kernels become particularly interesting when 
 the quantum feature map is not classically computable  and in consequence  quantum kernels are speculated to provide  quantum advantage <cit.>.  
In this work we employ KPCA with quantum kernels for another aim. We employ them as a method of extracting  information from  the data-embedding part of the VQC  and  the input data. In addition, under the assumption that there is access to the quantum circuit and possibility for performing SWAP tests KPCA with quantum kernels places our proposed method  tractable even for a large number of qubits.
 



§ THE PQAE AND QAE MODELS 


In this section we present  PQAE and QAE models. The first is a pre-processing method of classical data
which is adjusted to the data-embedding part of a VQC. This has a hybrid classical-quantum structure and
 requires access to the specialized hardware of the quantum circuit. QAE consists of  a feature map emulating a quantum feature map, embedded in the bottleneck layer of a classical AE. QAE  runs exclusively on classical hardware. 



 §.§ PQAE for encoding on qubit states


The goal of PQAE is to transform classical data into a format that quantum circuits can  efficiently use. The PQAE learns how to compress and encode classical data into this format by passing it through the feature map and then reconstructing it back to the original dataset. To do this effectively, it uses the same feature map as the VQC that will process the data later. 
 
Given the data-encoding block of a VQC of n_q qubits and an N-dimensional train dataset,  PQAE is an algorithmic procedure that employs a classical network and a quantum circuit, see Fig. <ref>. The goal of the discussed machine learning method is to adjust the input parameters of the classical network, so that the overall loss – in this case given by the MSE – is minimised across the dataset. The procedure comprises (iteratively) repeated epochs and this stops when convergence in the value of MSE is achieved. For each epoch the train dataset is randomly divided in batches of M data, and for each batch the updating of the classical weights is performed as follows:  

    
  * Every data point of the batch is passed via the same classical linear layers, which have the structure of the encoding layer of an AE, see Fig. <ref>.  The aim of this step is to adjust the dimensionality of data, N, to the number of qubits,  n_q.
    
  * The values on the n_q neurons are then used as features for the data-encoding layer of the VQC under study.
     Each i data  point produces a quantum state |ψ_i⟩,  with i=1,… M.
    
  * A SWAP or Inversion test is used to estimate the M × M quantum kernel matrix k_i,j= |⟨ψ_i | ψ_j ⟩|^2.
    
  * Afterwards KPCA is performed using the quantum kernel k_i,j and this outputs n_d ≤ M  principal components of dimension M.
    
  * The elements of principal components are attributed to the related data of the batch and one proceeds by passing this n_d-dimensional vector via  a series of classical hidden layers   until the original dimensionality N is restored.
    
  * The  mean squared error (MSE) is calculated for the batch, Eq.(<ref>), and the weights in classical encoding and decoding layers are updated according to a gradient optimization method.

One  repeats the procedure for all batches and then proceed to the next epoch.





We note here that practically the number of qubits n_q can be close to  the number of features N, when N is small, or when technological advances allow for more qubits. Moreover, the latent dimension n_d can be considered greater than n_q the emdedding is performed in
in the Hilbert space  of dimension 2^n_q. Therefore, without loss of generality we assume  that n_q ≤ n_d < N. Finally in this work  we  restrict the structure of classical encoding and decoding layers to linear ones.

Let us describe a case example in order to further clarify the  PQAE algorithmic procedure. Suppose that a dataset with N = 100 features is given and they want to use a VQC with n_q = 4 qubits and a ZZ feature map. The ZZ feature map was introduced in <cit.> and has been used successfully in <cit.> for solving classification tasks . In order to efficiently encode these 100 features into 4 qubits the PQAE method is  used. They start with a hidden layer that maps 100 nodes to 32 nodes, and then another hidden layer that maps 32 nodes to 4 nodes. This could be alternatively done   through multiple hidden layers or directly from 100 to 4. The 4 nodes are then passed to a quantum computer using the ZZFeatureMap for encoding. The output data are now encoded  on   qubits,  and they  calculate the kernel matrix using the quantum algorithmic procedure of SWAP or Inversion test. They then perform KPCA  with the quantum kernels to reduce the data in the transformed space. Let one select the top 4 principal components (n_d=4).  Finally, they use linear layers to decode from n_d=4 to 32, and then from 32 to 100, reproducing the input data. The weights of the connections between nodes are trained to reduce MSE. After training, the PQAE model can be used to encode new unseen test data into  VQC, effectively serving as a “qubit encoding” black box.







 §.§ QAEs for dimensionality reduction 


In the PQAE method the KPCA is used to extract information  from a large Hilbert space and bring it back to
the classical space in a compact way. Thus this component is necessary for the accessibility of the method in the case
of many qubits. Here, we  re-consider the model omitting the KPCA. Unavoidably the model
that we build is not useful for encoding in many qubits, but on the other hand this can be seen as an unconventional classical AE 
where its bottleneck layer is `dressed' with a quantum feature map. In the next section, we investigate  its advantages numerically.


QAEs begin by reducing the dimensionality of the input N-dimensional data to a smaller set of L neurons. This reduction step is analogous to the initial compression phase in classical AEs and the encoded neurons are represented by Eq.(<ref>). The operator that creates the next layer of neurons, which is derived from the output of the feature map, is represented with Eq.(<ref>) 
    e^-i ∑_j=1^L z_j ĝ_j  .
 where the variables, z_j with j=1,…,L are used to parametrize an SU(n) rotation and the ĝ_j operators are a subset of the n^2 - 1 generators of the related Lie algebra <cit.>. For simplicity let us set here L=n^2-1 and the application of the method to the more general case L<n^2-1 is, then, straightforward. The features of the initial data points are encoded in a unitary matrix of the form


    [    a    b; -b^*  a^* ]
    
with a,b ∈ℂ satisfying |a|^2+|b|^2=1, which is the SU(2) case (or single qubit case).  We extract the elements of the first column of this n× n matrix, which can is equivalent to the action of operating  the  unitary matrix on the ground state of an n-dimensional quantum system.
Alternatively one can use the average values over each row's elements, that corresponds to the operation on a state that is in equal superposition over all states of the computational basis. Either way, one obtains 2n real numbers, which for n>2 are parametrically dependent to each other
and adhere to the normalization condition. These real numbers are encoded on 2n neurons and then the decoding starts until the original dimensionality is reached. We note that, the dimensionality of the bottleneck of any autoencoder, is determined by the layer with the fewest neurons. Only in the SU(2) case, this occurs in the layer before the feature map. In all other cases, where n>2, the bottleneck is in the layer after the feature map. The whole procedure is schematically presented in Fig. <ref>.





Since QAEs aim to offer a fruitful representation in the latent space, batched QAEs form a variant where input data is processed in m batches, enhancing scalability and performance. Following Fig. <ref>, segments of the reduced representation of the data is passed through the feature map. For example, starting with an 100  dimensional input, one can reduce the dimension to 12 with classical layers and separate these features in m=4 batches. Then, using four Pauli feature maps with 3 generators per batch, 16 real outputs are produced and processed for decoding via the classical layers. In this way, the feature map is essentially used more than once, offering greater encoding capabilities. The non-batched case presented earlier is a special case of batched QAEs with m=1.








§ NUMERICAL RESULTS 

In order to exhibit the efficacy of the proposed methods we first apply the PQAE model for encoding classical data on a VQC and  compare the results with those obtained via PCA.  We then apply QAE methodology for dimensionality
reduction of data and we compare its reconstruction capability with  the one of classical linear AEs. For all tasks, PyTorch <cit.> is used to construct the AEs and the ADAM and RMSprop optimizers are used for training the PQAE and QAE models accordingly. The VQCs for the Iris, Wines and Seed dataset, are implemented in IBM's Qiskit <cit.>. All programs and datasets are available on GitHub <cit.>.




 §.§ Encoding  VQCs with PQAE method 


VQCs in IBM's Qiskit are composed of a Pauli feature map in the data-encoding block and a parametrized ansatz in the variational block. In this approach, we use a PQAE to encode the classical data into qubits for four different datasets available in scikit-learn <cit.>, namely Iris  (N=4), Wines (N=13), Seed (N=7) and MNIST (N=64). The transformed data are then passed to a VQC in order to solve the corresponding classification task. For all datasets, we set-up a n_q=4 qubit VQC using Qiskit's ZZFeatureMap with 2 repetitions and a Real Amplitudes ansatz with 3 repetitions. The classical encoding part of the PQAE consists of one linear layer which transforms the data from ℝ^N to ℝ^n_q and the decoding part consists of a linear layer which transforms the reduced space ℝ^n_d to ℝ^N.  The optimization procedure is repeated using 10 different random seeds and we collect the results with  best accuracy for both PQAE and PCA methods. In both cases, we train the VQC for 100 epochs. The results are reported in Table <ref>. PQAEs increased the VQC's accuracy across three out of four datasets, as compared to PCA or Raw encoding, with the most remarkable achievement in accuracy being 97% in the Iris dataset, even surpassing the accuracy of qutrit-based quantum neural networks, which aspire to offer an improvement over qubit methods <cit.>. 





The advantage exhibited by PQAE stems from the fact that this pre-processing model is trained to minimize the reconstruction MSE, ensuring that the encoded data retain the essential features of the original data while filtering out multicollinearity and irrelevant information. This training acts as an unsupervised feature extraction mechanism, resulting in a cleaner and more manageable data representation. Furthermore, by utilizing the same quantum feature map in both the PQAE and the VQC ensures consistent data transformation, aligning the features learned during the autoencoder's training with those used by the VQC. This consistency allows the VQC to focus on fine-tuning its decision boundaries rather than representing the data itself. Consequently, the dimensionality reduction achieved by PQAE enables the VQC to operate on a more compact and informative data representation, leading to faster convergence and better generalization. 

The combination of classical and quantum methods in the approach that we present  leverages the strengths of both. 
The classical autoencoder excels at unsupervised feature extraction and multicollinearity reduction, while the quantum feature map and VQC capitalize on the expressive power of quantum computations for classification.










 §.§ QAEs vs classical linear AE for dimensionality reduction


QAEs provide an exploration primitive of the synergy between quantum and classical ML techniques. By integrating quantum feature maps into classical autoencoder architectures, we investigate the improvement prospects of data processing tasks based on quantum mechanics over classical  alternatives, while providing numerical results. The comparison of reconstruction error between QAE and AEs provides a framework for analyzing the expressive power of given quantum transformations. 


The output of the exponential map used in QAE produces features which follow an l^2-normalization, and thus it is sensible to apply the method on data having this same property. For specific types of data, e.g. wavefunctions, this property  naturally occurs, for others this can be imposed by taking the extra step of normalization. All models in this study are compared with classical linear AEs which follow the exact same architecture as the QAEs, except for the feature map, see for instance Fig. <ref>, subfig. (a).


We start our numerical investigations with the  Iris dataset, that is first normalized. We use QAE
to reduce its feature space from ℝ^4 to ℝ^3 at the bottleneck, and in Table <ref> we compare the results, i.e, MSE, with the one achieved by a classical AE of  same architecture. The Seed dataset is treated in a similar way, and its feature space is reduced  from ℝ^7 to ℝ^3.
In Table <ref> we exhibit that QAE can offer improvement to non normalized data, as well, using  the Wines dataset, with the dimensionality of data reduced from ℝ^13 to ℝ^12. We achieve this result by using a batched QAE with m = 4 batches. As depicted in Fig. <ref>, subfig. (b), QAE starts with a `classical' layer which reduces the dimensionality from ℝ^13 to ℝ^12. This  is followed up by  four feature maps. The output of the feature maps provides the values for a layer of 16 neurons. A decoding layer follows reducing the dimensions  back to ℝ^13. This procedure  achieves a reduction greater than 50% on the MSE  achieved by  the corresponding classical AE of Fig. <ref>, subfig. (a).

Furthermore, we implement a QAE model with an alternative feature map to the one presented in Section <ref>. In the latter case, the feature map described by the Eqs.(<ref>)-(<ref>) induces an encoding from ℝ^3 to ℝ^4. Here, we experiment with a quantum-inspired map that we name Bloch encoding, which gets a 2-dimensional input and outputs a 3-dimensional vector, i.e., 
 ℝ^2→ℝ^3. This is achieved via the Bloch vector representation of a qubit: 
    |ψ⟩ = cos(θ/2) |0⟩ + e^iϕsin(θ/2) |1⟩
 
 where as input we consider the angles θ, ϕ and as  output
 the three real numbers: {cos(θ/2), sin(θ/2) cos(ϕ), sin(θ/2) sin(ϕ) }.
 The latent space offered by such a feature map is thus further reduced from 3 to 2. 
We apply the  QAE model equipped with the Bloch feature map to the normalized Iris dataset so as to reduce the bottleneck dimension to 2. The improvements over AE can be found in Table <ref> where one may see that this type of QAE bottleneck reduces the MSE  by almost 2.5 times.


Finally in Fig. <ref> we compare the QAEs' results  presented in Tables <ref>-<ref>  with those  reached by AEs equipped with polynomial feature map. Notably, the latter  exhibit very good  performance as compared to other kernels <cit.>. In more details we use the map {x_1, x_2}→{x_1^2, x_2^2, x_1x_2} for the ℝ^2→ℝ^3 case and the slightly altered version of the habitual polynomial feature map {x_1, x_2, x_3}→{x_1^2, x_2^2, x_3^2, x_1x_2+x_1x_3+x_2x_3}, to match the ℝ^3→ℝ^4 case. In every dataset, the comparisons show an advantage for the QAE method over the polynomial feature maps.


































 


§ DISCUSSION 

In this work we have introduced PQAE, a method for reducing the dimensions of features of classical data sets that is tailored to the
quantum feature map of a VQC. The method uses a hybrid structure: a classical linear AE with the bottleneck layer made of  the quantum feature map
of the data-embedding circuit of the VQC.
The input of the quantum feature map is a batch of train data which have passed through the encoding layer of the AE.  Its output is the quantum kernel matrix for the batch  that is consequently  used for KPCA. The vector comprising the principal components of the quantum kernel matrix
is the output treated by the decoding layer of the AE. 
The numerical results of  Section <ref>
support the claim that this hybrid method  of pre-processing can considerably boost the performance of a VQC in solving classification tasks.
In addition, the quantum-inspired model  QAEs and batched QAEs,    create new possibilities for dimensionality reduction of classical data, since we have identified cases where they  greatly outperform simple linear AEs of the same latent dimension.

There are several points which can be further investigated in order to potentially  improve the performance of the proposed models. In this work, we employ MSE as a measure of reproducibility of datasets but other  measures could be proven more fit to our methods. We also exclusively use a linear structure for the classical layers in the models as well as for the classical AEs with which we compare the results.   An extension to nonlinear activation functions seems necessary for completeness. Furthermore, all numerical examples in this work concern quantum circuits made of qubits even though the methodology supports an extension to qudits. In a future work where more
complicated data sets and multi-class problems are investigated, we would be interested in employing the methods for qudit circuits. Finally, PQAE has been developed and exhibited for variational quantum classifiers but the methodology could be adapted to other variational algorithmic procedures, such as variational quantum regressors, which also require uploading of classical data on quantum circuits. 




§ ACKNOWLEDGEMENTS

This work was supported by   the project Hellas QCI co-funded by the European Union under the Digital Europe Programme  grant agreement  No.101091504. A.M. and D.S. acknowledge partial support from the European Union’s Horizon
Europe research and innovation program under grant agreement No.101092766 (ALLEGRO Project).








