I Introduction
Quantum computing entered a new stage of development in recent years, as fundamental breakthroughs and public interest fuel the availability of NISQ devices. Both researchers and industry are working to develop quantum algorithms that demonstrate quantum advantage compared to classical computers while accepting current architectures’ constraints. The first step for solving realworld problems with quantum computers is loading data into them. The challenges behind this task are manyfold: the embedding choice affects the possible data transformations, quantum resources are generally scarce and should be accounted for in the embedding choice, and the runtime of existing algorithms for larger datasets due to shared cloud access needs to be considered [1, 2, 3]
. Once data has been embedded into qubits, the actual algorithms run on the quantum data. In recent years, many novel quantum algorithms have been proposed that fit into the category of quantum machine learning. These are quantum versions of classical machine learning algorithms such as
NN classification,means clustering, support vector machine classification, and quantum neural networks
[4, 5, 6, 7, 3].Unfortunately, even in classical computing, tuning adjustable parameters for each machine learning algorithm can be quite tedious and there exist entire software libraries and frameworks to simplify the process. Some basic examples are parallel multicore processing for bruteforce grid search or parameter optimization techniques [8, 9, 10, 11]
. These automated tools help machine learning practitioners train and test algorithms. However, they are usually not a ’silver bullet’ and the art/skill of the trade is in understanding many aspects of data science such as input feature engineering, proper experimental setup, crossvalidation and other techniques. In the quantum era of machine learning, quantum data scientists have additional parameters to tune and consider: data embedding type, number of qubits, general Ansatz type for Parametrized Quantum Circuits (PQCs), number of Ansatz layers for PQCs, measurement type, and postprocessing techniques.
In order to overcome the difficulties in longrunning quantum machine learning training tasks and determining the best QML model for a given data set, we introduce the first steps towards AutoQML, an automated remote deployment system that runs multiple combinations of hyperparameters to build quantum machine learning models and runs them in parallel in the quantum cloud. The system returns statistics, relevant quantum and machine learning metrics, and the best model with its associated hyperparameter values.
The paper is structured as follows. First, we define the concept of AutoQML and define a hybrid classicalquantum cloud architecture developed to implement it in Section II. Following the generic description of the framework, the remaining sections of the paper dive into a specific example of using it for quantum neural network training. Specifically, in Section III
we introduce the fundamentals of quantum neural networks and a special subtype called quantum Generative Adversarial Neural Networks (qGANs). We cover some fundamental properties of these machine learning models and discuss certain tunable parameters and the loss function we wish to optimize. We describe an example usecase for training qGANs to learn the best fitting model for an energy economics usecase in Section
IV.The main contributions of the paper are: we provide the concept and concrete mathematical formulation of the AutoQML problem, and, we define a template for a hybrid cloud architecture which is easily extendable for those wishing to build upon the AutoQML concept. Using the approach, we apply the framework to a sample quantum machine learning problem where we find the best trained qGAN for highly discretized (up to 32 bins) energy price distribution generation.
Ii AutoQML
In order to discuss the proposed framework, we first provide a precise problem definition that mirrors its classical AutoML counterpart as defined in [10].
Definition 1 (AutoQML Problem)
For , let
denote a classical data feature vector and
the corresponding classical data target value. Given a training dataset and the feature vectors of a test dataset drawn from the same underlying data distribution, as well as a classical resource budget , a quantum resource budget , and a loss metric , the AutoQML problem is to automatically produce accurate test set predictions using a quantum machine learning model. The loss of a solution to the AutoQML problem is given by .As in the original definition, the classical resource budget consists of classical memory, CPU clocktime, memory read/write speeds and other constraints. The AutoQML problem encompasses the same classical runtime constraints but also introduces the quantum specific resource budget, which may include factors such as quantum gate operations per second, gate coherence times, qubit counts, and general QPU availability if considering a cloudbased queuing system.
Given this problem definition, we take the first steps towards an automated quantum machine learning framework. In the approach described in the following subsection, we outline a classicalquantum hybrid cloud architecture, which, with a basic deployment configuration, allows for parallelization of a bruteforce approach to hyperparameter search.
Iia Distributed ClassicalQuantum Architecture
We propose a cloudbased solution that enables the distributed execution of experiments, results postprocessing, parameter benchmarking and plot generation. We illustrate the feasibility of our system with an implementation using Microsoft Azure services. All services used have equivalent routines in other cloud platforms, and porting our solution requires minimal effort due to the few services used.
Azure Data Factory is an ETL service that allows to integrate and transform data at scale [12]. We use this service due to its orchestration capabilities, its enablement of serverless parallel processing, and its ability to perform synchronization of tasks based on trigger events.
Our system, depicted in Fig. 1, consists of three different pipelines, executed sequentially after the user submits the experiment configuration file:

[label=0.]

Distributed execution of experiments: This pipeline creates a pool of worker nodes, distributes the experiments amongst them, and then each node executes and persists its assigned experiments asynchronously.

Agglomeration and postprocessing of results: This pipeline uses a single container to read the files produced by each node, calculate agglomerate statistics, and persist the processed results. This stage also selects the best performing architectural parameters and stores the corresponding model as a pickle file.

Plot generation and visualization: This pipeline uses a single container to read the processed experiment results and generate and persist the plots specified in the configuration file.
The containers invoked by the three pipelines communicate through atomic reads and writes to a single object store, which in Azure is implemented via blob storage (see Fig. 2). File uploads to this storage can be used as a pipeline trigger in Data Factory. We rely on this feature to enforce the sequential execution of the pipelines, such that one stage only starts when the results of the previous one were persisted.
The initial trigger for the set of experiments is the upload of the parameter search configuration JSON file to blob storage. The second pipeline only begins upon successful completion of the first stage, and, when there are raw result files for as many nodes as defined in the experiment configuration.
Our current implementation distributes the experiments between the nodes following a static scheduling pattern: Before runtime, the total number of experiments is distributed between the available containers in sets of approximately equal size. Each container can communicate and submit jobs to quantum backends, such as the IBM quantum cloud.
Iii Example: Quantum Neural Networks
In order to provide a concrete example of the developed framework described in Section II, we focus on one particular type of quantum machine learning model  the Quantum Neural Network (QNN). QNNs are a type of variational quantum circuit where the unitary gate operations are parametrized. Classical data is first encoded into a quantum state via predetermined gate operations, and the resulting state is then fed into the parametrized circuit Ansatz [13]
. The result is then measured via usual quantum measurement processes and transferred to a classical computer that computes a loss function. In this quantum formulation, the classical notion of backpropagation and standard weight/bias updates is implemented by updating the parameterized rotation gates relative to the result of the loss function calculation. By iteratively minimizing the loss function (for example using gradientbased optimizers such as ADAM or gradientfree methods as SPSA
[14]) and continuing to update the quantum circuit, the process is analogous to training a classical neural network. The attractiveness of QNNs lies in their potential to deliver training and inference speedups as well as their increased generalization capacity in specific scenarios [15]. However, how to accurately compare these benefits between classical and quantum neural networks is still an active area of research.Iiia Quantum GANs
One type of QNN that has been highly investigated both in theory and in terms of applied usecases is the quantum Generative Adversarial Neural Network (qGAN) [16, 17, 18].
By leveraging quantum effects, these algorithms have the potential to outperform their classical counterparts by enabling quadratic speedups on model training, inference and expressive power. Additionally, their noise resilience makes them exceptionally well suited for running on NISQ devices [19, 20, 21].
We consider a generative model to be quantum whenever it uses quantum effects in its subroutines. In the case of GANs, the components that could be potentially quantum are the generator, the discriminator, and the data on which the model is trained. Here, quantum data refers to information whose natural representation is quantum. Fig. 3 describes the basic structure of the qGAN which has its generator implemented in a quantum circuit. The generator model is an arbitrary quantum Ansatz applied onto an initial state . There exist different methods of initial state choices and parameter initialization strategies. Our example QML training application will focus on Bornsampled qGANs with a classical discriminator [22, 23]. In this framework, we want to leverage quantum GANs to provide an efficient Qsample encoding of classical data in a quantum state. This qGAN is well suited to learn from floatingpoint, realvalued data, and it can be modified to learn complex distributions.
For the qGAN application, two important configuration choices need to be determined. First, the initial quantum state which shall be used as input to the variational Ansatz needs to be determined. In [22], the authors provide evidence that an initial state closer to the target Qsample state will have better convergence properties and fit the target distribution better. Second, the actual choice of the Ansatz needs to be determined.
The batches of samples are generated by measuring the qubits of the generator. Zoufal and Situ [22] propose performing a global measurement of the qubit register, also known as Born sampling. In the Bornsampled case, the integer representation of the quantum states is mapped to the real range of the data following the proposed mapping:
(1) 
where are the integer representation of the basis states, is the value range of the distribution and
is the number of generator qubits. The generated batch is combined with one of real samples and fed to the discriminator, which outputs the probability of samples being fake. These batch probabilities are used to compute the qGAN’s loss function and its gradients.
IiiB Model Result Metric
Machine learning algorithms have a plethora of metrics used to measure the outcome of a model’s result on a test set of unseen data. For our illustrative example of the framework which uses qGANs, measuring the degree of similarity between two distributions can be done in several standard ways. The primary metric we will use is the KullbackLieber divergence () which measures the degree of similarity of two distributions. It is also known as relative entropy. Let and
be discrete probability distributions defined in the probability space
. Then the KLdivergence (relative entropy) is given by(2) 
where is the target distribution and is the model.
Iv Application: Auto Training qGAN for Energy Price Distribution
This section applies the automation framework for a particular machine learning task that has applications to energy economics option pricing. In [22], the authors demonstrated that one can use number of gates as opposed to
gates for efficiently loading a generic random distribution into a quantum circuit using a qGAN. Using this advantage, they go on to implement an algorithm that uses quantum amplitude estimation to provide a quadratic runtime improvement for European call option pricing over stand Monte Carlo techniques
[24].In the energy trading sector, one typical data source which is used is the openmarket energy prices. Depending on the country and market, energy prices can be traded and fluctuate in 15minute intervals to guarantee that supply, demand, and network congestion match. Human consumption patterns lead to seasonal, daily, and hourly trends. The upper histogram in Fig. 4
represents the normalized distribution of energy prices in the year 2015 obtained from the EPEX SPOT market between the hours of 00:0001:00. The distribution is nontrivial and will serve as an illustrative example of our framework. The goal is to train a qGAN to efficiently load the distribution so that we may use it in future energy economics quantum algorithms.
Iva Deployment Configuration
In order to run the automated training framework, one must create a suitable configuration file in JSON format. This central configuration file defines machine learning hyperparameters and quantumspecific parameters such as Ansatz type, number of Ansatz repetitions, and quantum hardware backend. An example configuration file is given below:
In this sample configuration file, we capture hundreds of possible qGAN models. Notably, we use existing qGAN architectures from [22, 25] and [26], and, for each circuit Ansatz we train models with multiple layers (1, 2 or 3 applications) along with two different classical discriminator architectures, and
. We also implement three different quantum state initialization strategies (uniform, normal or random) and use the relative entropy as the main performance metric. Due to the large runtime overhead, we experimentally found that for our use case, 10 runs per configuration was an appropriate amount to obtain results based on the mean and variance of the outcomes. The next section discusses some sample results where Table
I presents the statistical outcomes of training runs from the 5qubit fitted distribution.IvB Results
Our framework is set up to detect new training configuration files uploaded to the cloudbased storage account. This event triggers a pipeline that initiates the classicalquantum parallel training as described in Fig. 2. All numeric and plotting results are stored in blob storage, while the models are stored in Python’s pickle format to enable more effortless model loading.
Table I collects the statistic results of an experiment with a 5qubit Zoufal Ansatz for different combinations of initialization strategies and an increasing number of layers. In the table; is the number of Ansatz application layers, and are KolmogorovSmirnov measures of output distribution compared to the target distribution for 10 training runs, and are the same metrics but using the relative entropy (KullbackLieber Divergence) similarity metric, and
is the mean and standard deviation of gate depth after transpilation to IBM Quantum hardware. The best 5 qubit model selected is the uniform 2layer with gate depth 77 (bolded).
Initialization  k  

Uniform  1  0.1780  0.0519  0.5692  0.1325  41.18 
2  0.1104  0.0470  0.3562  0.0947  77.09  
3  0.1540  0.0807  0.4329  0.2479  104.52  
Normal  1  0.1570  0.0389  0.2793  0.0269  203.42 
2  0.1446  0.0531  0.2434  0.0383  238.38  
3  0.1516  0.0305  0.2510  0.0343  271.2  
Random  1  0.3420  0.1676  1.1412  0.6072  33.75 
2  0.1992  0.0970  0.7595  0.3290  74.55  
3  0.1536  0.1034  0.5494  0.4724  101.89 
These qGAN outputs are given in Fig. 5, with the final best model as determined by the framework demonstrated in Fig. 4. Fig. 6 shows a selection of other useful output data which were generated for model comparison. Details such as training loss curves as a function of initialization strategy, circuit Ansatz type, and the entangling capacity for a given circuit are useful for the quantum data engineer to verify that the automation task was a success.
V Conclusion
In this paper, we introduce the notion of Automated Quantum Machine Learning (AutoQML) and emphasize its importance in the future of quantum machine learning. As the first steps towards the solution of the proposed problem, we developed an overarching classicalquantum distributed model training execution framework. From the quantum data engineering perspective, it works by defining an efficient configuration object structure which can be remote deployed to a cloud platform where QML jobs can then run in parallel. The best model is then returned as the final solution. The framework described can be applied to any QML algorithm such as quantum neural networks, kernel methods, clustering, and classification algorithms.
As a first use case of the framework, we apply it for quantum Generative Adversarial Network (qGANs) training for solving a dataloading problem relevant in the energy trading sector.
In implementing the first version of such a solution, we discovered several exciting avenues to explore. The most obvious is the generalization of our model selection algorithm. The bruteforce combinatorial approach to model parallelization and training should be simplified. See, for example, the Bayesian optimization techniques which were recently introduced into the standard Python data science library scikitlearn to create Autosklearn [10, 11]. We envision that similar addons and optimization techniques can be included in our solution architecture in future versions.
Another modelspecific improvement that could be made is the ability to optimize the form of circuit Ansatz (the choice of unitary gates) chosen for a particular machine learning task. Initial steps have been made in this direction for the qGAN data loading problem and will be discussed in future work. In our example usecase, we tested several existing circuit architectures, however, as in classical automated machine learning for neural networks, the ability to automatically determine the specific layer and node (gate) types or counts from scratch will be the future of this application.
In terms of quantum hardware architecture, one can envision the system running QPUspecific analysis, taking into account different qubit connectivities/topologies, chip types/generations, and circuit transpilations that reduce to the specific operational basis gates depending on the exact chip architecture. Certainly, different machine learning models will perform better or worse on newer, more stateoftheart devices with better hardwarespecific properties such as general coherence times, quantum volume, qubit count, qubit connectivity and Circuit Layer Operations Per Second (CLOPS).
From the software architecture and classical cloud perspective, many open topics can also be further investigated. For one, the proposed architecture may generalize to allow for single problems to be run in parallel on multiple QPU devices. In our initial implementation, each classical container can remotesubmit jobs individually to quantum hardware. However, one can imagine performing batched process deployment across different quantum hardware as NISQ devices increase in their capacities and availabilities. This could allow for even more parallelization to explore potential model space.
Another cloudbased solution one might consider is the creation of a Quantum Model Store (QMS). In such a versioncontrolled environment, the resulting optimized models are stored and used for runtime predictions. Standardized solutions will be necessary when hybrid classicalquantum software architectures become a reality in industry. These solutions will be either developed inhouse or offered by cloud providers akin to Microsofts’ AzureML or Amazon Web Services’ Sagemaker.
As quantum machine learning algorithms mature and quantum hardware continues to scale, we expect these types of software architectural patterns to continue developing. In classical machine learning, Automated ML solutions and cloud based machine learning workflows are now mainstream in industry. Cloud providers such as Google, Microsoft and AWS already have platforms for offering access to quantum hardware, so it is a natural extension that AutoQML and model management be adopted in the future.
References
 [1] Yuval R. Sanders, Guang Hao Low, Artur Scherer, and Dominic W. Berry. Blackbox quantum state preparation without arithmetic. Physical Review Letters, 122(2):020502, January 2019. arXiv: 1807.03206.
 [2] Scott Aaronson. Read the fine print. Nature Physics, 11(4):291–293, April 2015.
 [3] Maria Schuld. Quantum machine learning models are kernel methods. arXiv:2101.11020 [quantph, stat], January 2021. arXiv: 2101.11020.
 [4] Seth Lloyd, Masoud Mohseni, and Patrick Rebentrost. Quantum algorithms for supervised and unsupervised machine learning. arXiv preprint arXiv:1307.0411, 2013.
 [5] Patrick Rebentrost, Masoud Mohseni, and Seth Lloyd. Quantum support vector machine for big data classification. Physical review letters, 113(13):130503, 2014.
 [6] Jacob Biamonte, Peter Wittek, Nicola Pancotti, Patrick Rebentrost, Nathan Wiebe, and Seth Lloyd. Quantum machine learning. Nature, 549(7671):195–202, 2017.
 [7] Maria Schuld and Francesco Petruccione. Supervised Learning with Quantum Computers. Quantum Science and Technology. Springer International Publishing, Cham, 2018.

[8]
Yihui He, Ji Lin, Zhijian Liu, Hanrui Wang, LiJia Li, and Song Han.
Amc: Automl for model compression and acceleration on mobile devices.
In
Proceedings of the European conference on computer vision (ECCV)
, pages 784–800, 2018.  [9] Xin He, Kaiyong Zhao, and Xiaowen Chu. Automl: A survey of the stateoftheart. KnowledgeBased Systems, 212:106622, 2021.
 [10] Matthias Feurer, Aaron Klein, Katharina Eggensperger, Jost Tobias Springenberg, Manuel Blum, and Frank Hutter. Autosklearn: efficient and robust automated machine learning. In Automated Machine Learning, pages 113–134. Springer, Cham, 2019.
 [11] Matthias Feurer, Katharina Eggensperger, Stefan Falkner, Marius Lindauer, and Frank Hutter. Autosklearn 2.0: Handsfree automl via metalearning. arXiv preprint arXiv:2007.04074, 2021.
 [12] jonburchel. Azure Data Factory Documentation  Azure Data Factory. https://docs.microsoft.com/enus/azure/datafactory/.
 [13] Renxin Zhao and Shi Wang. A review of Quantum Neural Networks: Methods, Models, Dilemma. arXiv:2109.01840 [quantph], September 2021. arXiv: 2109.01840.
 [14] William Huggins, Piyush Patel, K. Birgitta Whaley, and E. Miles Stoudenmire. Towards Quantum Machine Learning with Tensor Networks. Quantum Science and Technology, 4(2):024001, January 2019. arXiv: 1803.11537.
 [15] Amira Abbas, David Sutter, Christa Zoufal, Aurélien Lucchi, Alessio Figalli, and Stefan Woerner. The power of quantum neural networks. arXiv:2011.00027 [quantph], October 2020. arXiv: 2011.00027.
 [16] PierreLuc DallaireDemers and Nathan Killoran. Quantum generative adversarial networks. Physical Review A, 98(1):012324, July 2018. arXiv: 1804.08641.
 [17] Seth Lloyd and Christian Weedbrook. Quantum generative adversarial learning. Physical Review Letters, 121(4):040502, July 2018. arXiv: 1804.09139.
 [18] Jonathan Romero and Alan AspuruGuzik. Variational quantum generators: Generative adversarial quantum machine learning for continuous distributions. arXiv:1901.00848 [quantph], January 2019. arXiv: 1901.00848.
 [19] HeLiang Huang, Yuxuan Du, Ming Gong, Youwei Zhao, Yulin Wu, Chaoyue Wang, Shaowei Li, Futian Liang, Jin Lin, Yu Xu, Rui Yang, Tongliang Liu, MinHsiu Hsieh, Hui Deng, Hao Rong, ChengZhi Peng, ChaoYang Lu, YuAo Chen, Dacheng Tao, Xiaobo Zhu, and JianWei Pan. Experimental Quantum Generative Adversarial Networks for Image Generation. Physical Review Applied, 16(2):024051, August 2021. arXiv: 2010.06201.
 [20] Jinfeng Zeng, Yufeng Wu, JinGuo Liu, Lei Wang, and Jiangping Hu. Learning and Inference on Generative Adversarial Quantum Circuits. Physical Review A, 99(5):052306, May 2019. arXiv: 1808.03425.
 [21] Xun Gao, Eric R. Anschuetz, ShengTao Wang, J. Ignacio Cirac, and Mikhail D. Lukin. Enhancing Generative Models via Quantum Correlations. arXiv:2101.08354 [condmat, physics:quantph, stat], January 2021. arXiv: 2101.08354.
 [22] Christa Zoufal, Aurélien Lucchi, and Stefan Woerner. Quantum Generative Adversarial Networks for learning and loading random distributions. npj Quantum Information, 5(1):103, December 2019.
 [23] Haozhen Situ, Zhimin He, Yuyi Wang, Lvzhou Li, and Shenggen Zheng. Quantum generative adversarial network for generating discrete distribution. Information Sciences, 538:193–208, October 2020. arXiv: 1807.01235.
 [24] Nikitas Stamatopoulos, Daniel J. Egger, Yue Sun, Christa Zoufal, Raban Iten, Ning Shen, and Stefan Woerner. Option Pricing using Quantum Computers. Quantum, 4:291, July 2020. arXiv: 1905.02666.
 [25] Daniel Herr, Benjamin Obert, and Matthias Rosenkranz. Anomaly detection with variational quantum generative adversarial networks. arXiv:2010.10492 [quantph], October 2020. arXiv: 2010.10492.
 [26] Su Yeon Chang, Steven Herbert, Sofia Vallecorsa, Elías F. Combarro, and Ross Duncan. DualParameterized Quantum Circuit GAN Model in High Energy Physics. arXiv:2103.15470 [quantph], March 2021. arXiv: 2103.15470.
 [27] Sandro Burger and AlePio. Quantum, and cloud icons from nounproject. https://www.nounproject.com.