# Machine learning and Quantum Computing

** Keywords **:

*Quantum Computing, Machine Learning, AI, Algorithms, Finance*

Machine learning (ML) operations applicable to finance include regression for asset pricing, classification for portfolio optimization, clustering for portfolio risk analysis and stock selection, generative modeling such as clustering for market regime detection, feature engineering methods for fraud detection, reinforcement learning for algorithmic trading, and Natural Language Processing (NLP) for risk assessment, financial projections and accounting and auditing. Deep learning is usually used for image recognition and text classification, also as in any use case characterized by large unstructured datasets.

Given the complexity of the algorithms involved, and the size of the data being analysed, ML has been identified as one of the most important domains of applicability of **Quantum Computing (QC)**. In 2019, Google announced having achieved 'quantum supremacy', a state where a quantum computer can handle tasks much more rapidly than supercomputers. Classical computers can only process information in binary format. QC can hold multiples states simultaneously.

The purpose of this article is to bring two topics together: providing an overview of selected **machine learning models** that are important to quantitative research, and review developments which permit these algorithms to run on a **quantum computer **and achieve a speedup.

__Regression__

Linear regression method predicts new labels based on the linear fit of the data. In most cases, the optimal fit parameters are found by minimising the least-squares error between the training data and the predicted values. This is usually done by finding the (pseudo)inverse of the training data matrix, a task which can be extremely expensive computationally for typical industrial datasets.

It exists, however, a powerful linear algebra toolbox allowing its users to diagonalize matrices on quantum computers exponentially faster than on classical computers [__1__]. Wiebe, Braun, and Lloyd are the ones who pioneered the idea of applying this algorithm to execute regression on a quantum computer. They showed that they can encode the modelâ€™s optimal fit parameters into the amplitudes of a quantum state for a sparse training dataset. This can be done in a time which is exponentially faster than the fastest classical algorithm [__2__].

Allow us to provide some examples of the application of regression techniques employing quantum computers in finance:

**Asset Pricing:**assigning prices to different types of instruments such as stocks, bonds, etc. Regression models are used in the evaluation and prediction of spot prices.**Multi-Asset Trend Following Strategy:**applying regression models to forecast 1-day returns of a portfolio by using historical data at different times.**Implied Volatility Estimation:**Regression model is used to determine any changes in the price of a given security. The proposed quantum approach for this application employs the deep quantum neural network.

__Classification__

In ML, classification model predicts the labels for new data points using a model that is fit by a labeled dataset. Depending on the size of the training dataset, and the number of attributes considered, finding a new vectorâ€™s class can mean processing a vast number of high dimensional projections. This can rapidly exceed the confidence with which we can assign a class to the new vector. Therefore, techniques for performing classification algorithms on a quantum computers usually focus on efficiently processing projection operations. AÃ¯meur, Brassard and Gambs pioneered the idea of recasting this problem on a quantum computer by expressing each data point as a quantum state [__3__].

Well-known traditional classification algorithms include Linear Classification, KNN and Support Vector Machines (SVMs). The latest are among the most used supervised machine learning algorithms. These aim to determine the hyperplane that splits a labeled dataset in its two distinct classes. A variety of proposals to implement support vector machines on a quantum computer exist. One among proposed quantum enhancements to the SVM is based on evidence that universal quantum computation, presumably, cannot be efficiently simulated on a classical computer [__4__].

**Classification techniques using quantum computers are utilized for the applications below:**

**Binary Options Reduction:**application of SVM to predict the outcome of exotic options (often used in foreign exchange).**Financial Forecasting:**KNN algorithms in suggesting models to match companyâ€™s recent earning to the historical earnings of competitors to predict future earnings of the company.

__Clustering__

Identification of groups of data points that are close to each other according to certain metrics. Quantum Clustering (**QC**) belongs to the category of density-based algorithms where clusters are defined by regions of higher density of data points.

QC uses the gradient descent method [__link2____]__ to find the minimum quantum potential at a fixed learning rate and determine the center of the cluster. Then, a fixed measuring standard is employed to cluster the sample. However, quantum clustering has some inefficiencies when it comes to execution time, computing distance matrix [__link3__], and learning iterations. To improve the performance of QC algorithms, researchers have suggested new clustering methods [__link4__]. Li Zhi-Hua et al. [__5__] proposed a new distance-based quantum clustering (QC). The technique not only has the advantages of the standard quantum clustering algorithms but also does not need sample preprocessing most of the time and has a fixed clustering distance, which greatly enhances the efficiency.

** Application of clustering techniques using quantum computers in finance:**

**Stock Selection:**Clustering helps investors to spot stocks with similar returns but different risks.

__Reinforcement Learning__

Reinforcement learning (RL) [__6__] is a ML technique where an agent attempts to learn through interactions with the environment an optimal policy (that selects actions maximizing the cumulative future rewards) given that both the transition dynamics and the reward function of the environment are a priori unknown[__link6__].

The employment of quantum computers to perform RL was initially discussed by Dong et al. in 2005 [__7__], with a follow-up in 2008 [__8__]. In their proposal, the potential actions at any given state in the environment are maintained in a quantum superposition, and amplitude amplification is used to enhance the probability of evaluating "how good" an action is at any given state.

**Applications of Reinforcement Learning using quantum computers include:**

**Algorithmic Trading:**automation of trading execution of financial instruments. Predictions are realized in a supervised manner, then followed by the obtention of optimal trading decisions under uncertainty associated with the corresponding predictions and market volatility.**Market Making:**Reinforcement Learning is essential for market makers who have the role of providing liquidity to the market by placing sell and buy orders while generating a profit from the bid-ask spread.

__Conclusion__

In this paper, we have reviewed the state of the art of quantum algorithms for financial applications. We discussed different machine learning techniques, for which several quantum algorithms have been previously proposed in the literature: regression, classification, clustering and reinforcement learning. Considering recent advances in both quantum computing and machine learning, the combination of the 2 techniques - quantum machine learning - is expected to be a promising application of quantum computer in the near future.

__Related works__

Junxu Li, Sabre Kais **Quantum cluster algorithm for data classification, **Materials Theory, Volume5, Article number 6 [__link__]

**The gradient descend method, **[__link2__]

**Distance matrix, **[__link3__]

**Clustering method, **[__link4__]

**The impact of machine learning on UK financial serviced**, [__link5__]

**Quantum Machine Learning for Finance, **[__link6__]

**Quantum Computing**, [__link7__]