Hybrid quantum-classical classification system and training method for classifying images
A hybrid quantum-classical system with multiple variational quantum circuits processes image features efficiently, addressing quantum device limitations to achieve effective image classification.
Patent Information
- Application Number
- JP2024017066
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2023-03-16
- Filing Date
- 2024-02-07
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2044-02-07
AI Technical Summary
Quantum devices are limited by the number of qubits and circuit depth, restricting the application of noisy intermediate-scale quantum (NISQ) devices in variational quantum circuits, particularly for image classification tasks.
A hybrid quantum-classical computing system that utilizes multiple independent variational quantum circuits to process subsets of features extracted from a grid of input features, combined with classical processing to overcome the limitations of qubit number and circuit depth, leveraging quantum supremacy for image classification.
The system efficiently classifies images by exploiting quantum supremacy despite limited entanglement, achieving results comparable to classical approaches while reducing the need for extensive classical processing power and time.
Smart Images

Figure 0007794483000006 
Figure 0007794483000007 
Figure 0007794483000008
Abstract
Description
[Technical Field]
[0001] The present invention is in the field of quantum computing, more precisely, the present invention relates to a hybrid quantum-classical computing system as part of a trainable classifier. [Background technology]
[0002] Quantum computers provide a platform for controllable quantum mechanical systems whose states and interactions can be controlled to perform computations. Computation is realized by the deterministic evolution of the controllable quantum mechanical systems, e.g., qubits, which are the quantum analogues of classical bits, and the state of the quantum mechanical systems can be measured to determine the outcome of the computation.
[0003] Control operations on these qubits are called quantum gates. Quantum gates can act coherently on qubits to induce changes in the state of a single qubit (so-called single-qubit gates) and to act on multiple qubits (so-called multi-qubit gates), e.g., to entangle the states of multiple qubits and any combination of qubit states. For example, a single-qubit gate can induce a rotation of the electron's spin state by a selectable value, e.g., π / 2. Multi-qubit gates can act coherently on two or more qubits, such as a coherent CNOT operation on the states of two qubits. Multiple quantum gates can be applied in parallel or sequentially to qubits in a quantum computer to perform a computation. Finally, the state of a qubit may be repeatedly measured after applying a sequence of quantum gates to determine the probability of each possible outcome of the computation.
[0004] To compute solutions to problems that are considered intractable on classical computers, quantum computers exploit the special properties of quantum mechanical states, in particular the superposition and entanglement of different quantum states, to find solutions in a relatively small number of computational steps.
[0005] However, because the superposition / entangled states of quantum mechanical systems are inherently volatile (e.g., subject to decoherence), and the control and measurement of these systems are subject to fidelity margins, state-of-the-art quantum computers are currently limited in both the number of controllable quantum mechanical systems (qubits) as well as the number of control actions that can be performed in succession (quantum gates).
[0006] Despite these drawbacks, promising applications exist for near-term available quantum processors, namely noisy intermediate-scale quantum (NISQ) devices, such as variational quantum algorithms. In variational quantum algorithms, the action of quantum gates is parameterized in terms of variational parameters, which can be systematically varied with the aid of classical computational resources, in a manner similar to machine learning. By varying the variational parameters to extremize a cost function that attributes a cost to the output of the variational quantum circuit relative to the optimal solution, the output of the variational quantum circuit can be "trained" to provide an optimal solution to an unseen problem. Entanglement between different qubits can provide access to a large internal state space to provide "quantum supremacy."
[0007] For example, Henderson et al. ("Quanvolutional Neural Networks: Powering Image Recognition with Quantum Circuits") investigate a quantum machine learning (QML) method involving image classification that includes a "quantum convolutional layer" as part of convolutional image encoding. The quantum convolutional layer processes input features according to randomly determined parameterized functions to generate encoded features for analysis by a decoding module, which provides a classification result. [Prior art documents] [Non-patent literature]
[0008] [Non-Patent Document 1] Henderson et al., “Quanvolutional Neural Networks: Powering Image Recognition with Quantum Circuits” Summary of the Invention [Problem to be solved by the invention]
[0009] However, quantum devices are still not widely available, and practical implementations may be limited in both qubit number and circuit depth, which also limits the application of NISQ devices as part of variational quantum circuits.
[0010] In view of this state of the art, it is an object of the present invention to provide an improved classifier for grids of features, such as pixel maps of images, that includes a quantum circuit-based architecture that can efficiently utilize relatively small, realizable quantum devices for approximation tasks. [Means for solving the problem]
[0011] This object is solved by a system, a method and a computer program for classifying images according to the independent claims. The dependent claims relate to preferred embodiments.
[0012] According to a first aspect, the present invention relates to a hybrid quantum-classical computing system for classifying a grid of features provided as input. The system comprises a convolution block comprising a convolution filter configured to receive the grid of features as input and output a plurality of output features for the grid of features based on a trainable configuration of the convolution filter. The system further comprises a flattening layer for converting the filtered grid of output features received from the convolution block into a flattened feature vector. The system further comprises a classification block configured to receive the flattened feature vector and generate an output classification. The classification block comprises a plurality of independent variational quantum circuits, each comprising a plurality of quantum gates operating on a qubit of a qubit register of a respective variational quantum circuit. The plurality of quantum gates comprise variational quantum gates, where the action of the variational quantum gate on the qubit of the qubit register is parameterized according to an associated variational parameter, and an encoding gate for modifying the state of the qubit of the qubit register according to the input feature vector. The variational quantum circuits of the plurality of independent variational quantum circuits receive different subsets of features from the flattened feature vector as input feature vectors, and the measurement outputs of the plurality of independent variational quantum circuits are combined to determine a label for the grid of input features as an output classification.
[0013] In contrast to conventional approaches in which the complexity of available variational quantum circuits limits the number of possible input features, the system uses multiple independent variational quantum circuits to independently process a subset of flattened features extracted from a grid of input features via convolutional blocks. As a result, the system is less limited by the achievable maximum number of processable input features, defined, for example, by the maximum number of features encoded per qubit and the number of available qubits. Surprisingly, the inventors have experimentally found that quantum supremacy for image classification can still be exploited despite the lack of entanglement between all qubits in the multiple variational quantum circuits. Thus, a viable hybrid quantum-classical computing system for processing and classifying a grid of input features can be provided. The labels determined for the grid of input features may correspond to a classification into multiple (predetermined) output classes and / or may be identifiers of objects / patterns detected by the system in the grid of input features.
[0014] The grid of input features may correspond to a two-dimensional or multidimensional array of numerical values that may represent the visual encoding of the images in the data. For example, the grid of input features may be a two-dimensional pixel grid, where the numerical value of each pixel may correspond to a grayscale image encoding, such as a luminance value ranging from black to white. The pixel grid may encode an image of an object to be classified, such as a letter, a number, or an object, e.g., a human face, a scene imagined by a vehicle camera, etc. The classification system then attributes the image to an output class, e.g., a particular letter, a particular number, or a corresponding entry in a face image database.
[0015] Similar to image classification methods known in the art, a grid of input features can be first processed using a convolutional filter, which may be applied to different subsets of the grid to generate filtered grids of output features, where the convolutional filter may perform local operations on groups of adjacent features within the grid of features provided as input. For example, the grid of input features may be used to generate multiple square grids of features, such as a 3x3 or 5x5 grid of features adjacent to the grid of input features. Each of the subsets may be processed by a convolutional filter, which may generate a corresponding filtered feature for the input subset of the grid of features, e.g., through a trained network of artificial neurons. Each of the square grids of features may be processed in parallel by a different convolutional filter, e.g., to extract different image features from the square grid of features, e.g., edges or lines of the square grid of features.
[0016] The filtered features obtained using the convolution filters may generate a filtered grid of features, which may be further processed by additional convolution filters. The convolution block may then output multiple filtered grids of features, e.g., different filtered grids of features corresponding to different filters applied to the grid of input features.
[0017] The filtered grid of features may be flattened into a flattened feature vector, which may be, for example, a list of features derived from the output of the convolution block using an artificial neural network that maps the filtered grid of features to a plurality of features according to a plurality of internal weights and biases.
[0018] In a preferred embodiment, the convolution blocks and / or flattening layers are implemented in classical hardware, specifically using trainable machine learning models.
[0019] The trainable machine learning model may be trained to obtain, or provided as, a trained machine learning model, which may process the filtered grid of output features according to multiple machine learning parameters, such as weights and biases of an artificial neural network. The trained machine learning model may be obtained by defining a machine learning architecture and training the corresponding machine learning parameters in a training process based on historical data and corresponding classes, for example, using stochastic gradient descent or other optimization methods. Following the training process, the trained machine learning model may be configured to generate optimal outputs for a subsequent classification stage of the hybrid quantum-classical computing system.
[0020] In some embodiments, the system comprises a classical processing system and / or AI processing hardware configured to implement the trained machine learning model, in particular the AI processing hardware comprises a GPU, a neural processing unit, analog memory-based hardware, or neuromorphic hardware.
[0021] The processing system may include a single processing unit or multiple processing units that may be functionally connected. The processing unit may include a microcontroller, an ASIC, a PLA (CPLA), an FPGA, or other processing device, including processing devices that operate based on software, hardware, firmware, or a combination thereof, such as the AI processing hardware described above. The processing device may include integrated memory or be capable of communicating with external memory, or both, and may further include interfaces for connecting to sensors, devices, applications, integrated logic circuits, other controllers, etc., and the interfaces may be configured to receive or transmit signals, such as electrical signals, optical signals, wireless signals, acoustic signals, etc.
[0022] The processing system may implement the trained machine learning model using classical hardware and may process an input grid of features to generate a flattened feature vector, which may be subsequently processed by multiple independent variational quantum circuits. Preferably, the number of features in the flattened feature vector is a multiple of the number of qubits in the multiple variational quantum networks.
[0023] In a preferred embodiment, each of the variational quantum circuits of the plurality of independent variational quantum circuits is configured to encode a number of inputs into quantum states of qubits of its qubit register, and the input feature vector includes a number of features that is a multiple of the number of inputs of the variational quantum circuits of the plurality of independent variational quantum circuits.
[0024] The number of inputs may be encoded in all or a subset of the qubits of each variational quantum circuit, e.g., multiple input features may be encoded in a single qubit or in a subgroup of multiple qubits of the variational quantum circuit. In some embodiments, multiple input features may be encoded in the quantum states of multiple qubits of the variational quantum circuit, where the number of qubits may be less than or greater than the number of inputs. In some embodiments, the number of input features may be equally distributed among the qubits of each variational quantum circuit and encoded by manipulating the quantum state of each qubit.
[0025] For example, the flattening layer may generate a feature vector containing N features, and each of the variational quantum networks may contain M qubits, where N=M*K, where K is a natural number greater than 1, i.e., K∈{2; 3; 4; ...}. The flattened feature vector may be separated into K subsets of features that can be processed independently by K independent variational quantum circuits. Each feature in one of the K subsets of features may then be encoded in each of the M qubits of the corresponding variational quantum circuit.
[0026] Independent variational quantum circuits can process subsets of features in parallel and / or sequentially. In other words, multiple different variational quantum circuits may be implemented using the same or different hardware, and the output of each variational quantum circuit may be obtained independently of each other.
[0027] Variational quantum circuits can contain multiple qubits, whose quantum states can be manipulated by the application of quantum gates applied to single qubits and / or multiple qubits, either sequentially or in parallel.
[0028] The qubits may form a qubit register and may be initialized to an initial state, such as the ground state of each qubit. In some embodiments, after initialization of the qubits to their ground states, a superposition state of each qubit in the qubit register is prepared, for example, through the application of a Hadamard gate.
[0029] Subsequently, multiple quantum gates can be applied to the qubits to transform their states into output states. In a variational quantum circuit, the actions of at least some of the quantum gates in a variational quantum network are parameterized so that the measurement output is a function of variational parameters that parameterize the variable actions of the (variational) quantum gates. The combined actions of (at least partially parameterized) quantum gates may be called variational quantum networks, as their operating principles are similar to those of neural networks.
[0030] Furthermore, in a variational quantum circuit, at least one quantum gate is used as an encoding gate, and the action of the encoding gate is based on the input feature vector. For example, the value of the input feature vector can be encoded into a qubit by rotating the state of one qubit proportional to the value of the input feature vector through a single qubit rotation.
[0031] In some embodiments, at least one encoding gate comprises a single qubit rotation proportional to the value of the input feature vector. The encoding gate may be applied k times as part of each variational quantum circuit, where k is an integer value greater than 2 and the variational quantum circuit is parameterized by at least 2k variational parameters. Multiple applications of the encoding gate can effect a re-uploading of the input feature vector into the variational quantum circuit, such that the variational quantum circuit can fit higher-order Fourier series to the labeling function.
[0032] Two-qubit or multi-qubit gates can create superposition states between qubits, such as to exploit the "quantum supremacy" offered by quantum hardware; such gates may hereinafter be referred to as entangled gates. For example, when variational quantum circuits are implemented in quantum devices based on trapped ion systems, the states of different ions in the trapped ion system may be coupled through co-excitation, e.g., transferred via the Molmer-Sorensen interaction. As another example, pairs of qubits in a qubit register may be entangled via (tunable) nearest-neighbor interactions or exchanges of quantum particles to implement two-qubit gates such as CNOT gates.
[0033] In some embodiments, a variational quantum network can be defined in terms of layers of quantum gates that can act on qubits to link them with qubits in a qubit register. A layer of quantum gates can include the cumulative action of multiple coherent operations on the states of qubits in a qubit register. The cumulative action of coherent operations in a layer should generally act on all qubits in a qubit register involved in a computation; in other words, a layer of quantum gates should directly affect the states of all qubits in a qubit register. Each layer should include at least one multi-qubit gate and at least one variational quantum gate (which, in principle, could be the same gate). Those skilled in the art will understand that multiple quantum gates in a layer can be applied to qubits in parallel to shorten the sequence of coherent operations on the states of qubits in the layer. Multiple layers of quantum gates can then be subsequently applied to the qubits to form a variational quantum network, where the variational quantum network is parameterized by the variational parameters of each layer.
[0034] Layers may contain quantum gates of the same type and may be applied sequentially to qubit registers. For example, each layer may feature quantum gates of the same architecture, but different elements of variational parameters may be applied to the variational gates of the layer. In other words, layers may feature the same quantum gate architecture, but the action of the quantum gates on the qubits within each layer may differ based on the variational parameters and / or the input feature vector.
[0035] After the layer of quantum gates operates on the qubits, the qubits can be measured to obtain a characteristic result of the variational quantum circuit relative to a known initial state. The result of the quantum mechanical computation can be measured based on the computational basis states of the qubits. The computational basis states can be orthogonal basis states of a Hilbert space spanned by the tensor product of the basis states of each qubit.
[0036] The initial variational parameters of the variational quantum gate can encode an initial (random) guess of the optimal classifier, and the results of evaluating the variational quantum circuit with the variational parameters can be measured (iteratively) to determine the corresponding label. Based on the label, a cost function can be evaluated classically to attribute a cost to the label, in other words, a measure of the goodness of the label is calculated.
[0037] By training the system, one may iteratively and systematically vary the variational parameters so that the variational quantum circuit approximates the output labels.
[0038] In a preferred embodiment, the variational parameters of one of the plurality of independent variational quantum circuits are different from the variational parameters of another of the plurality of independent variational quantum circuits.
[0039] For example, each of the variational quantum circuits may be associated with a respective variational parameter that may differ from the variational parameters of any of the other variational quantum circuits of the plurality of variational quantum circuits.
[0040] In a preferred embodiment, each of the plurality of independent variational quantum circuits comprises a plurality of layers of quantum gates, each layer of the plurality of layers of quantum gates in particular comprising a variational quantum gate for each of the qubits of the qubit register.
[0041] The inventors have found that additional layers of gates can increase the accessible Fourier space of a qubit, thereby improving classification results. Each layer may include different variational parameters that can be trained, such that the variable behavior of each layer of qubits in a variational quantum circuit can be different. Each layer may also include entanglement gates and / or encoding gates. The encoding gates in each layer may re-encode the same feature from the subset of features into each qubit, or may encode different features of the subset of features, such as to increase the number of features processed by each variational quantum circuit, at the expense of additional gates as part of the quantum circuit.
[0042] In a preferred embodiment, the plurality of independent variational quantum circuits each include at least two qubits in a respective qubit register.
[0043] Variational quantum circuits may, in principle, be designed according to the availability of quantum processing resources; increasing the number of qubits generally increases the accessible Fourier space, which may also increase the complexity of the internal computations performed by the variational quantum circuit. Generally, each variational quantum circuit may process a subset of features from the flattened feature vector corresponding to the number of qubits or a multiple thereof, to analyze a certain number of features extracted by the convolution block and determine therefrom a value indicative of an output label / class, e.g., a number of numeric values equal to the number of qubits in the variational quantum circuit. Each of the multiple variational quantum circuits may comprise an entanglement gate for entangling the quantum states of at least two qubits.
[0044] In a preferred embodiment, each of the plurality of independent variational quantum circuits comprises an entanglement gate for entangling the quantum states of at least two of the qubits of the respective qubit register.
[0045] The entangled states of the qubits in each of the multiple independent variational quantum circuits can be used to determine a corresponding output, which can be used to determine an output class.
[0046] In a preferred embodiment, the output state of all qubits in the qubit register of one of the plurality of independent variational quantum circuits is independent of the action of the quantum gate of another of the plurality of independent variational quantum circuits.
[0047] As a result, variational quantum circuits may be implemented independently, e.g., computed in parallel using separate hardware implementations, or sequentially, e.g., using the same hardware implementation.
[0048] In a preferred embodiment, the quantum states of qubits in different ones of the plurality of independent variational quantum circuits are disentangled prior to measurement.
[0049] In other words, the qubits of different variational quantum circuits may remain independent throughout the computation.
[0050] In a preferred embodiment, multiple independent variational quantum circuits are implemented in quantum hardware.
[0051] In our preliminary experiments, variational quantum circuits are generally implemented in simulations of quantum devices running on classical hardware, and the experiments have shown that the resulting virtual hybrid quantum-classical devices can achieve similar results compared to classical approaches in machine learning, while relying on less trainable parameters that must be optimized during training. Thus, even simulated variational quantum circuits may be useful in some embodiments; i.e., multiple variational quantum circuits may be implemented on a classical computer using a quantum simulator. However, the system preferably implements variational quantum circuits computed on quantum hardware, such as to reduce the classical processing power and computation time required to simulate complex quantum hardware.
[0052] The output of the variational quantum circuit may be measured and mapped to an output feature, e.g., between 0 and 1, for each of the qubits and / or each variational quantum circuit. The output features may then be used by the system to determine an output label / class that corresponds to the grid of input features.
[0053] In a preferred embodiment, the measurement outputs of multiple independent variational quantum circuits are combined using a trainable layer of artificial neurons implemented in classical hardware, in particular a fully connected layer of artificial neurons implemented in classical hardware.
[0054] A layer of artificial neurons can implement connections between the outputs of different independent variational quantum circuits, and a fully connected layer can introduce connections between each of the variational quantum circuits. A trainable layer of artificial neurons can be trained to optimally combine measurement outputs to obtain a label, or can be obtained as a trained layer of artificial neurons. Those skilled in the art will understand that not all qubits need to be measured, or that some of the measurement outputs of one of the variational quantum circuits can be combined or discarded before determining a classification result using a layer of artificial neurons.
[0055] In a preferred embodiment, the trainable parameters of the convolution block, the flattening layer, and the classification block are obtained based on a joint training process, in particular of a machine learning model implemented in classical hardware and multiple independent variational quantum circuits implemented in quantum hardware.
[0056] The joint training process may train a classical layer to extract features appropriate for each classification task, may train a flattening layer to map the features extracted by the convolutional blocks toward the inputs of each of the multiple independent variational quantum circuits, may train the multiple independent variational quantum circuits to generate outputs that advantageously transform the flattened feature vector toward measurement output features indicative of the classification task, and may train a coupled layer of artificial neurons to determine a classification result based on the measurement outputs of the multiple independent variational quantum circuits.
[0057] Those skilled in the art will understand that in some embodiments, the convolution block may not be trained together with the variational quantum circuit; instead, a pre-trained convolution block from a different classification system may be used; or only the multiple variational quantum circuits, the classification block comprising multiple independent variational quantum circuits, and the portion of the flattening layer preceding the coupling layer may be trained in a joint training session, which may reduce the complexity of the training task in some embodiments. In that case, only the parameters of the flattening layer and the coupling layer may be part of the trainable machine learning parameters of the classical portion of the hybrid quantum-classical computing system. The flattening layer may comprise a fully connected layer of artificial neurons, such as for mapping the output of the convolution block to a flattened feature vector as input to the multiple independent variational quantum circuits.
[0058] The system can be trained iteratively, and the variational parameters, machine learning parameters (of the convolutional blocks and / or flattening layers), and coupling parameters, hereafter also collectively referred to as trainable parameters, can be jointly optimized at each step of the iterative process so that the output labels approach the labels of a sample dataset of the same input grid of features.
[0059] The iterative process can mimic the training of classical machine learning models, where output labels are associated with cost values based on a cost function. For example, training can be based on a sample dataset of labels and corresponding sample input feature grids, and the cost function may be a loss function based on the output labels and on sample labels of the sample dataset of the same input grid of features. The cost function may be the mean squared error between the output labels and sample labels of the same input grid of features. Thus, the method for training can be based on the sample dataset of labels and the corresponding input feature grid. Those skilled in the art will understand that when a hybrid quantum-classical computing system is trained, the sample dataset can be constructed, for example, by obtaining data points of the sample dataset including an input grid of features and corresponding labels, and subsequently training the hybrid quantum-classical computing system based on the data points.
[0060] In another example, the optimal label is unknown, but costs can be attributed to candidate solutions based on the problem statement, such as travel times for the traveling salesman problem, and trainable parameters can be varied to extremize (maximize or minimize) the costs.
[0061] The trainable parameters may be updated with known techniques employed in classical machine learning, such as gradient-based optimization algorithms such as stochastic gradient descent or adaptive moment estimation, or gradient-free optimization such as simulated annealing. Preferably, the optimization algorithm is gradient-based, and the method may include determining the gradient of the trainable parameters with respect to the cost attributed to the output label by the cost function.
[0062] Although the system is primarily illustrated with respect to the example of images as input features, those skilled in the art will appreciate that the system may be equally suitable for processing additional information encoded on a grid of features that may not necessarily be related to visual information.
[0063] According to a second aspect, the present invention relates to a method for determining labels for a grid of input features based on a hybrid quantum-classical computation algorithm. The method includes receiving the grid of input features and generating a filtered grid of features based on the grid of input features and a convolutional filter. The convolutional filter is configured to output a plurality of output features for the grid of input features based on a trainable configuration of the convolutional filter. The method further includes flattening the filtered grid of output features into a flattened feature vector and separating the flattened feature vector into a plurality of flattened feature vector subsets. The method further includes encoding each of the flattened feature vector subsets into a qubit of a corresponding variational quantum circuit of a plurality of independent variational quantum circuits. Each of the plurality of independent variational quantum circuits comprises an encoding gate configured to operate on the quantum state of a qubit based on features of a corresponding subset of the plurality of flattened feature vector subsets, a variational quantum gate, where the operation of the variational quantum gate on the qubit of the qubit register is parameterized according to an associated variational parameter, and an entanglement gate for creating a superposition of quantum states of two qubits of the corresponding circuit. The method further comprises obtaining a measurement output based on measuring the output state of each of the plurality of independent variational quantum circuits and combining the measurement outputs of the plurality of independent variational quantum circuits to determine a corresponding output label.
[0064] Preferably, the labels are determined by combining the measurement outputs using a trained machine learning model, preferably a multi-layer perceptron including a fully connected layer of artificial neurons. However, in some embodiments, there may be no classical layer after the quantum layer, but the output after the quantum layer can be a prediction of the output label for the problem, for example, by simply concatenating the measurement outputs or by combining the measurement outputs according to a predetermined combination function. Determining the labels allows for classification of a grid of input features into a predetermined set of output classes.
[0065] The method may use the elements and components of the system according to the first aspect or any combination of its embodiments, or may implement any functionality of said components.
[0066] According to a third aspect, the present invention relates to a method for training a hybrid quantum-classical computing system to approximate a labeling function of a grid of input features. The system comprises a machine learning model implemented on a classical processing system configured to generate a flattened feature vector based on the grid of input features according to a parameterized transfer function, the parameterized transfer function being parameterized by machine learning parameters, and the machine learning model comprising a convolutional layer of artificial neurons. The system further comprises a plurality of independent variational quantum circuits, each comprising a plurality of quantum gates operating on a qubit of a respective qubit register, the quantum gates comprising a variational quantum gate, the parameterized action of the variational quantum gate on the qubit of the qubit register being parameterized according to associated variational parameters, and an encoding gate for modifying the state of the qubit of the qubit register according to the input feature vector. Each of the plurality of independent variational quantum circuits receives a different subset of features from the flattened feature vector as an input feature vector. The system is implemented on a classical processing system and further comprises a combining module configured to receive measurement outputs generated by the plurality of independent variational quantum circuits and combine the measurement outputs of the plurality of independent variational quantum circuits to determine a classification result, the combining being based on a plurality of trainable combining parameters. The method includes providing a sample grid of features to a machine learning model and receiving an output flattened feature vector from the machine learning model. The method further includes separating the output flattened feature vector into a plurality of flattened feature vector subsets, providing each of the flattened feature vector subsets to a corresponding variational quantum circuit of the plurality of variational quantum circuits, and receiving an output label from the combining module based on the measurement outputs of the plurality of independent variational quantum circuits. The method further includes determining parameter updates for the variational parameters and the trainable combining parameters based on values of a loss function for the output label.
[0067] In principle, the machine learning model may already be (partially) trained, and only a portion of the machine learning model, e.g., as part of a flattening layer, may be trained together with multiple independent variational quantum circuits. For example, a portion of a conventional machine learning model based on a convolutional layer may be used as an encoder portion, and the output of the encoder portion of the conventional machine learning model may be mapped to a flattened feature vector by a second portion of the machine learning model, such as to prepare extracted features for processing by multiple independent variational quantum circuits. Thus, only the second portion of the machine learning parameters may be trained together with the variational parameters and the joint parameters. In other examples, all of the machine learning parameters may be trained together with the variational parameters and the joint parameters. In other words, the quantum layer and classical layer of a hybrid quantum-classical computing system may be trained simultaneously, and parameter updates may update both the parameters of the machine learning model and the variational parameters.
[0068] In some embodiments, determining the parameter updates comprises determining a vector of derivatives of the variational parameters as part of the parameter update gradient.
[0069] The trainable parameters can be updated based on a parameter update gradient, and a subset or all of the trainable parameters can be modified based on the value of the gradient and a learning rate value that quantifies the size of the update step.
[0070] In some embodiments, determining the parameter updates is based on stochastic gradient descent, preferably including moment coefficients based on previously determined gradients of the cost function.
[0071] The gradient of the cost function for the variational parameters may be accessible through a parameter shifting rule, in which the variational quantum circuit is evaluated with the shifted variational parameters to determine the partial derivative of the cost function with respect to the shifted variational parameters.
[0072] In some embodiments, the method includes determining a vector of derivatives of variational parameters, and determining the vector of derivatives may include applying a parameter shift rule to a subset or all of said variational gates at each iteration of the iterative process.
[0073] Specifically, quantum gates with eigenvalues ±1 / 2, e.g., 1 / 2{σ x ,σ y ,σ z}, the variational parameter θ j The partial derivative of the function f with respect to It can be determined according to JPEG0007794483000001.jpg17162.
[0074] The partial derivatives of the cost function with respect to the machine learning parameters can be determined using known methods. Thus, different parts of a hybrid quantum-classical computing system can be jointly optimized based on gradients composed of partial derivatives of the cost function with respect to the trainable parameters of both the variational quantum circuit and the machine learning model. For example, a quantum mechanical network can be repeatedly evaluated to determine the partial derivatives of a layer of quantum gates with respect to the variational parameters, and gradients may be classically calculated from the measured partial derivatives as well as classically calculated derivatives of the machine learning parameters.
[0075] However, those skilled in the art will appreciate that the variational parameters can equally be optimized in an optimization algorithm without access to the derivatives, such as by (randomly) sampling the cost function, such as in a Constrained Optimization by Linear Approximation (COBYLA) algorithm or similar algorithm, and the gradient may be an estimated gradient based on an estimate of the energy landscape of the cost function.
[0076] The cost function can then be minimized / maximized by iteratively updating the trainable parameters according to the determined / estimated gradient of the cost function with respect to the trainable parameters, for example using an adaptive moment-based update function.
[0077] In some embodiments, determining the parameter updates is based on an update function of a moving average over the gradient of the cost function and a moving average over the squared gradient of the cost function.
[0078] Because the adaptive moment-based update function depends on a moving average over the gradient of the cost function and a (component of) the square of the moving average over the gradient of the cost function, the variational parameter updates can be smoothed by the first and second moments of the gradient, enabling descent towards an optimized solution even for "noisy" quantum systems.
[0079] In some embodiments, the learning rates for updating the variational parameters and the machine learning parameters are different.
[0080] Optimal performance of a hybrid quantum-classical computing system may require adjusting the relative rates at which the variational parameters and the machine learning parameters are updated during training so that training converges toward a set of trainable parameters in which both the variational quantum circuit and the machine learning model optimally contribute to the output label. For example, the variational quantum circuit and the machine learning model may converge toward their respective optimal solutions at different rates. If the learning rate is not adjusted correctly, during training, the system may fall into a local minimum in which either the variational quantum circuit or the machine learning model contributes less to the output label than an optimally configured hybrid quantum-classical computing system.
[0081] In some embodiments, the learning rate of the variational parameters is higher than the learning rate of the machine learning parameters.
[0082] Different learning rates may be estimated based on individual rates of convergence of the machine learning model and variational parameters, may be based on past optimization results, or may be empirically determined for a hybrid quantum-classical computing system, e.g., on a sample dataset of an input grid of features and corresponding labels.
[0083] In some embodiments, the hybrid quantum-classical computing system may be trained at different ratios of learning rates for updating the variational parameters and the machine learning or joint parameters to determine the optimal ratio of learning rates for updating the variational parameters and the machine learning parameters for the labeling function.
[0084] For example, a hybrid quantum-classical computing system may be initialized with a fixed initialization point, including the same, e.g., randomly determined, starting values of the trainable parameters each time, and training may be repeated from the fixed initialization point with different values of the learning rates of the machine learning model and the variational quantum circuit while recording the final results of the cost function for an input grid of features not used during training (not part of the training dataset). In practice, one learning rate, e.g., the learning rate associated with the variational parameters, may be fixed, while the other(s) learning rate(s), e.g., the learning rates of the machine learning parameters and the coupling parameters, may be varied, which may be the same or different in some embodiments. Those skilled in the art will understand that the learning rate(s) may already be decaying or stepped, and different learning rates may be associated with base learning rates for the machine learning parameters and the variational parameters, respectively.
[0085] Based on the resulting value of the cost function, an optimal learning rate can be selected, and the hybrid quantum-classical computing system may be subsequently performed or further trained based on the previously determined optimal learning rate or ratio thereof.
[0086] By training a system using the method according to the third aspect, the hybrid quantum-classical computing system of the first aspect can be obtained.
[0087] According to a fourth aspect, the present invention relates to a computer program comprising machine-readable instructions which, when executed by a processing system, cause the processing system to perform a method according to any embodiment of the second or third aspect and / or to implement a system according to any embodiment of the first aspect.
[0088] The computer program may be stored on a non-transitory medium as machine-readable instructions that, when executed by a processing system, cause the processing system to perform a method according to any embodiment of the second or third aspect and / or implement a system according to any embodiment of the first aspect.
[0089] The computer program can adjust the training of the hybrid quantum-classical computing system and / or can implement the hybrid quantum-classical computing system to approximate a given labeling function based on previously obtained trainable parameters.
[0090] The computer program may configure multiple variational quantum circuits, for example, by determining architectures and / or variational parameters of the variational quantum circuits. During implementation of the system and / or method, the computer program may provide the flattened feature vector subsets to multiple independent variational quantum circuits and may receive measurement outputs of the variational quantum circuits.
[0091] The computer program may further implement and control a machine learning model that may implement the convolutional blocks and flattening layers, and may also implement a machine learning model for combining measurement outputs of multiple independent variational quantum circuits to determine output labels for a grid of input features.
[0092] In some embodiments, the computer program can control the training of the hybrid quantum-classical computing system and can determine parameter updates for the machine learning parameters, the coupling parameters, and the variational parameters. [Brief explanation of the drawings]
[0093] The features and many advantages of the method and system of the present invention will be best understood from the following detailed description of the preferred embodiment, when read in conjunction with the accompanying drawings. [Figure 1] FIG. 1 is a diagram illustrating an example of a hybrid quantum-classical computing system. [Figure 2] 1 is a flowchart of a method for determining labels for a grid of input features according to an example. [Figure 3A] FIG. 1 is a schematic diagram illustrating another example hybrid quantum-classical computing system. [Figure 3B] FIG. 1 is a schematic diagram illustrating another example hybrid quantum-classical computing system. [Figure 4A] FIG. 1 shows examples of different handwritten symbols taken from the Modified National Institute of Standards and Technology (MNIST) database. [Figure 4B] FIG. 1 shows examples of different handwritten symbols taken from the MNIST database. [Figure 5] FIG. 1 illustrates a method for training a hybrid quantum-classical computing system to approximate a labeling function of a grid of input features, according to an example. [Figure 6A] FIG. 4 shows the results of training a hybrid quantum-classical computing system such as that shown in FIGS. 3A and 3B according to an exemplary implementation. [Figure 6B] FIG. 4 shows the results of training a hybrid quantum-classical computing system such as that shown in FIGS. 3A and 3B according to an exemplary implementation. [Figure 7]FIG. 1 is a diagram illustrating an example of a convolution block including a quantum convolution layer. DETAILED DESCRIPTION OF THE INVENTION
[0094] FIG. 1 illustrates an example of a hybrid quantum-classical computing system 10 for classifying a grid of input features into a predetermined set of output classes. The grid of input features may be image data, and the hybrid quantum-classical computing system 10 may identify objects depicted in the image data according to a predetermined set of output classes, such as a specific object, a specific character, or a specific facial feature. The system 10 may receive the grid of input features at its input, which may take the form of an array of numerical values encoded in an appropriate format. For example, the input grid may be a pixel array, and color / grayscale values may be encoded as a bit sequence for each pixel in the pixel array.
[0095] The grid of input features may be pre-processed, e.g., normalized, and received by convolution block 12, which may process the grid of input features according to a convolution filter to extract detectable features present in the image information. The output of convolution block 12 may be a plurality of filtered grids of features, which may be flattened by flattening layer 14. Flattening layer 14 may process the features of the filtered grid of features to obtain entries of flattened feature vector 16, for example, by pooling the features of the filtered grid of features into a pooled feature map and / or flattening the pooled feature map onto a flattened feature vector 16.
[0096] The convolution block 12 and / or the flattening layer 14 may be implemented by a machine learning model that can be implemented in a classical processing system. The classical processing system may include a GPU and / or an AI processing device and may process the grid of input features according to an internal multilayer perceptron (MLP) having a layer of artificial neurons that process the input based on an activation function that can be parameterized by trainable weights and / or biases for each artificial neuron. The output of the machine learning model may then be generated based on the activation of the artificial neurons in the output layer of the multilayer perceptron. The outputs of the convolution block 12 may be pooled or flattened into a flattened feature vector 16 by the flattening layer 14 of the artificial neurons.
[0097] The flattened feature vector 16 may be separated into multiple flattened feature vector subsets 18 (indicated in FIG. 1 by the dashed lines separating the flattened feature vectors 16), and each of the subsets 18 may be received by an independent one of multiple variational quantum circuits 20 in a classification block 22 of the system 10. The multiple independent variational quantum circuits 20 may each process a respective flattened feature vector subset 18 and each generate a measurement output, which may be combined in a connection layer 24 to classify the grid of input features into predetermined output classes.
[0098] The variational quantum circuit 20 may be implemented at least in part on a quantum device, and the flattened feature vector 16, or a feature vector derived therefrom, is encoded in the quantum state of the quantum device. For example, each subset 18 of the flattened feature vector 16 may include Q values, which may be encoded in quantum states of M=Q / J qubits, where J and M are natural numbers, i.e., J, M, and M, respectively, for encoding multiple features into a single qubit as part of the execution of the independent variational quantum circuit 20. JPEG0007794483000002.jpg12162, and Q mod J=0.
[0099] The quantum state of a quantum device can be manipulated based on the configuration of variational quantum gates, whose action can be parameterized by variational parameters. The output state of the quantum device can be (repeatedly) measured, and a measurement output can be generated based on the repeatedly measured output state.
[0100] The connection layer 24 can combine the measurement outputs, for example based on trainable weighted linear summation, and preferably based on a fully connected layer of artificial neurons, for example an MLP, thereby generating an output label based on the measurement outputs according to internal connection parameters.
[0101] The combination parameters, machine learning parameters, and variational parameters can be trained together, for example based on stochastic gradient descent or a variant thereof, so that the outputs produced by the combination layer 24 can be used as labels that approximate a generally unknown labeling function that can map a grid of input features to output classes.
[0102] 2 schematically illustrates a method for determining labels for a grid of input features, e.g., to classify the grid of input features into a predetermined set of output classes, which may be implemented using the system 10 illustrated in FIG. 1. The method includes receiving the grid of input features and generating a filtered grid of features based on the grid of input features and a convolutional filter (S10), and flattening the filtered grid of features into a flattened feature vector 16 (S12). The method further includes separating the flattened feature vector 16 into a plurality of flattened feature vector subsets 18 (S14), and encoding each of the flattened feature vector subsets 18 into a qubit of a corresponding one of a plurality of independent variational quantum circuits 20 (S16). The method further includes obtaining a measurement output based on measuring an output state of each of the plurality of independent variational quantum circuits 20 (S18), and combining the output states of the plurality of independent variational quantum circuits 20 to determine a corresponding output label (S20).
[0103] The convolutional filter is configured to output multiple output features for the grid of input features based on the trainable configuration of the convolutional filter, and the convolutional filter may be applied to different subgroups of the grid of input features to generate a filtered grid of features, for example, as part of convolution block 12. The different subgroups may be smaller grids of adjacent features, such as 3x3 or 5x5 subgrids, and may be processed according to the convolutional filter to generate filtered values for the filtered grid of features. The convolutional filter may be applied multiple times in parallel, for example, to process all possible subgrids of a particular size of the grid of input features, and different convolutional filters may be applied to the grid of input features to, for example, extract different characteristics from the data, as is known in the art of convolutional neural networks. The output of the convolutional filter may be further processed by additional convolutional filters, for example, to concatenate multiple convolutional layers.
[0104] The filtered grid of features may be flattened by a pooling and flattening layer 14, which may then be processed by a plurality of independent variational quantum circuits 20. Each of the plurality of independent variational quantum circuits 20 comprises an encoding gate configured to act on the quantum states of the qubits of the associated quantum circuit 20 based on the features of a corresponding subset of the plurality of flattened feature vector subsets 18; generally, there will be at least one encoding gate for each qubit of the variational quantum circuit 20. The information encoded within the variational quantum circuit 20 may be processed according to a plurality of variational quantum gates, whose actions on the qubits of the qubit register are parameterized based on associated variational parameters and a plurality of entanglement gates for creating a superposition of quantum states of at least two qubits of the corresponding variational quantum circuit 20.
[0105] For example, the variational quantum circuit 20 may have the state JPEG0007794483000003.jpg12162. Initialize a number of M qubits and use a unitary transformation on the qubit states, e.g., as part of a single qubit rotation, to compute the input features, e.g., {x1,…,x M}. A variational quantum gate can equally be described by a unitary that encapsulates the variational quantum circuit model parameters as operators that can be applied to the quantum states of the qubits. The operators are 0,…,L Finally, the quantum state of a qubit in variational quantum circuit 20 can be parameterized by, for example, the quantum information being decomposed into M classical outputs and the expectation value of circuit 20 being f(x,θ)=〈Ψ(x,θ)|M|Ψ(x,θ)〉,(1) where |Ψ(x,θ)〉 denotes the state of the quantum circuit before the measurement, x is the input feature vector, and θ is the variational parameter.
[0106] However, those skilled in the art will understand that the number of classical outputs, M, and the number of qubits of variational quantum circuit 20 do not have to be the same, as measuring some of the qubits may be sufficient to determine the output labels.
[0107] The measurement outputs can be combined using a machine learning model (MLP), such as a fully connected MLP, which can take the measurement outputs of all variational quantum circuits 20 as input features and output output labels corresponding to the grid of input features.
[0108] 3A shows a detailed example of a system 10 for classifying an image as a grid of input features 26, for example, according to the method shown in FIG. 2. The system 10 includes a convolution block 12 that processes the grid of input features 26 into filtered grids of features 28a-d according to multiple concatenated convolution filters. The processing of the grid of input features 26 is illustrated with exemplary subgroups of features being mapped to features in the filtered grid of features 28a along the solid lines in the figure (depicted as white rectangles in the sample image).
[0109] In the illustrated example, the sample image is a 28x28 feature grayscale image of handwritten numerals, which may be mapped by multiple convolution filters into a tensor, e.g., a 16x28x28 tensor, as a first filtered grid of features 28a, extracting filtered features from each subset of features according to a different filter function. As an example, the convolution filters may have a square kernel with a size of 5x5, which may operate with a 1-pixel stride and apply 2-pixel padding to process all pixels of the sample image. The resulting filters may be subjected to batch normalization followed by an activation function such as ReLU to obtain the first filtered grid of features 28a. The first filtered grid of features 28a may be pooled (e.g., according to max-pooling of features) into a 16x14x14 tensor as a second filtered grid of features 28b, which may be processed by further convolution filter arrangements into a 32x14x14 third filtered grid of features 28c. The third filtered grid of features 28c may be pooled towards, for example, a 32x7x7 grid of features 28d and flattened into an intermediate flattened feature vector 30 having 1568 features. The intermediate flattened feature vector 30 may then be mapped to the flattened feature vector 16 through a fully connected MLP as part of the flattening layer 14, thereby reducing the size of the flattened feature vector 16 towards N features.
[0110] The features of the flattened feature vector 16 may be split into several flattened feature vector subsets 18, which may each be passed to a respective one of a number of independent variational quantum circuits 20 and processed according to trainable variational parameters. The measurement outputs 32 of the variational quantum circuits 20 may then be processed by a fully connected classification MLP 34 to obtain output labels 36. Each of the variational quantum circuits 20 may contain M qubits such that the N features may be split into K=N / M flattened feature vector subsets 18, where K is a natural number greater than 1, i.e., K∈{2; 3; 4; ...}, and we assume that one feature is encoded in each qubit of the variational quantum circuit 20.
[0111] FIG. 3B shows an example of a variational quantum circuit 20 that can be used in the system 10 shown in FIG. 3A.
[0112] 3B, each variational quantum circuit 20 of the plurality of variational quantum circuits 20 comprises a plurality of qubits 38, which may be initialized to an initial quantum state at the start of a computation; for example, the qubits may be initialized to one of the computational basis states |0〉 or |1〉, as shown. Subsequently, a number of encoding gates 40 may be applied to the states of the qubits 38 to encode the input features {x1,...,x5} into the quantum states of the qubits 38; in this example, this may be achieved through a single qubit (X) rotation, with the rotation angle proportional to the respective input feature.
[0113] Rotations of qubit 38 about different axes in the computation space may be described by rotation operators.
[0114] X(θ)=exp(-iσ x θ / 2), (2) and Y(θ)=exp(-iσ y θ / 2), (3) Define each rotation around a respective angle θ. In the figure, the vertical connection between a horizontal line with a black circle at one end and a white circle with a cross embedded in it at the other end represents a "CNOT" gate, which can be mathematically described by:
[0115] JPEG0007794483000004.jpg22158, or JPEG0007794483000005.jpg29158
[0116] The CNOT gate can entangle the states of each two qubits 38, thus bringing them into a superposition state to exploit the quantum supremacy of quantum circuits.
[0117] After the quantum state is encoded in the qubit 38 by the encoding gate 40, the quantum state of the qubit 38 may be transformed according to a plurality of i layers 42 of quantum gates, where each layer 42 may comprise a plurality of variational quantum gates 44 and a plurality of entanglement gates 46. The variational quantum gates 44 are transformed according to variational parameters {w1, w2, ..., w}, which may correspond to respective rotation angles of single-qubit rotation gates as variational quantum gates 44. 15}, where each layer 42 can have different variational parameters. The entanglement gate 46 can entangle the states of multiple qubits 38, such as through application of a CNOT gate as shown in FIG. 3B.
[0118] Although not shown in FIG. 3B, those skilled in the art will understand that encoding gates 40 may be part of layer 42 of quantum gates, for example, to perform data re-uploading of input features and / or to encode multiple input features into each qubit 38 of variational quantum circuit 20.
[0119] After the i layers 42 of quantum gates are sequentially applied to the quantum state of the qubit 38, the state of the qubit 38 may be measured by a detector 48, such as a plurality of single-qubit detectors. Each variational quantum circuit 20 may be run iteratively to determine a measurement output 32 as an expectation value of the final measured quantum state of the qubit 38.
[0120] 3A, each of the independent variational quantum circuits 20 may receive a respective flattened feature vector subset 18 and independently process its respective input features to determine a respective measurement output. Each of the independent variational quantum circuits 20 may use different variational parameters {w1, w2, ..., w} such that each different flattened feature vector subset 18 can be effectively processed by a different variational quantum circuit 20. 15}.
[0121] The measurement outputs 32 can be passed to a machine learning model, in particular a fully connected layer of artificial neurons 34, to combine information obtained from the measurement outputs 32 of multiple variational quantum circuits 20 and obtain output labels 36, etc.
[0122] The hybrid quantum-classical computing system 10 can be trained based on a training dataset of sample data, which may include multiple sample grids 26 of input features and corresponding sample output labels, such as Arabic numerals corresponding to handwritten symbols.
[0123] 4A and 4B show examples of different handwritten symbols taken from the Modified National Institute of Standards and Technology (MNIST) database that can be classified by classification system 10 into matching decimal digits 0-9 (as shown above the symbols). Each of the photographs has a resolution of 28x28 pixels and may be considered a grid of input features 26, with each pixel being an input feature according to its associated grayscale color value. While the handwritten symbols in FIG. 4A can be unambiguously mapped overall to the corresponding digits, the example in FIG. 4B may be misinterpreted by a human classifier.
[0124] Handwritten digit datasets are widely used to test the performance of various neural network (NN) models, where the primary objective is to classify each image by labeling it with a matching class label using a machine-based classifier, which typically involves recognizing which Arabic digits are present in the image.
[0125] The MNIST database has a total of 70,000 images, which are divided into two groups: 60,000 images are designated as training images, and the remaining 10,000 images are designated as test images to evaluate the performance of the machine-based classifier.
[0126] 5 illustrates a method for training a hybrid quantum-classical computing system 10 to approximate a labeling function of a grid of input features 26. The method includes providing a sample grid of features 26 of a sample dataset to a machine learning model (S20) and receiving an output flattened feature vector 16 from the machine learning model (S22). The method further includes separating the output flattened feature vector 16 into a plurality of flattened feature vector subsets 18 and providing each of the flattened feature vector subsets 18 to a corresponding one of a plurality of variational quantum circuits 20 (S24), and receiving an output label from the combination module 24 based on the measurement outputs 32 of the plurality of independent variational quantum circuits 20 (S26). The method further includes determining parameter updates for the variational parameters and the trainable combination parameters based on the values of the loss function and the labels of the output labels 36 (S28).
[0127] The machine learning model may be implemented as a multi-layer perceptron, and the method may begin with initializing trainable parameters for the multiple variational quantum circuits 20 (variational parameters), the machine learning model, and trainable weight coefficients that form combined parameters for combining the outputs of the multiple independent variational quantum circuits 20. A subsequent step may include selecting a loss (cost) function for comparing the output labels 36 generated by the hybrid quantum-classical computing system 10 with sample labels in a training dataset, such as mean squared error (MSE).
[0128] The training algorithm may then iteratively select data points of the training dataset, including a grid of input features 26 and corresponding sample labels, which are processed using a machine learning model followed by multiple independent variational quantum circuits 20. The variational quantum circuits 20 encode each subset 18 of the flattened feature vectors 18 generated by the machine learning model using a selected encoding routine (e.g., angular embedding as shown in FIG. 3B). The expectation values of the selected measurement operators may be measured in parallel or sequentially after executing the multiple independent variational quantum circuits 20, e.g., the expectation value of a qubit 38 being in a “0” or “1” state based on a Z-axis projection.
[0129] A prediction is obtained as an output label 36 by combining the outputs of the variational quantum circuit 20 according to the trainable weights of the connection layer 24, and the predicted output label 36 is compared with the sample labels of the training dataset.
[0130] Additionally, a gradient of the comparison value (cost) may be determined for some or all of the trainable parameters. The next data point may then be processed, e.g., until all data points in the training dataset have been exhausted. Gradients may be determined for all parameters in the system 10, and the average gradient across all data points may be used to update the trainable parameters based on an optimization algorithm, e.g., an adaptive moment estimation algorithm (Adam). The iterative training process may terminate at any point during training, e.g., if the cost function reaches a particular value, plateaus, or loops around a point in parameter space. Those skilled in the art will appreciate that it is not necessary to evaluate the cost function at each iteration step, but that computing the gradient during training may be sufficient.
[0131] Based on the calculated gradients, an average gradient of the processed data points can be determined and used to update the trainable parameters based on the selected optimization algorithm and the selected learning rate, thereby completing one epoch of training.
[0132] Training can then be resumed from the first data point, for example, until it is determined that the parameter updates no longer improve the comparison value, for up to a predetermined number of epochs, or until a predetermined comparison value is reached.
[0133] The configuration and training hyperparameters of the hybrid quantum-classical computing system 10 can be selected based on a labeling function. For example, in the task of labeling a sequence of handwritten characters, such as the examples recorded in the Modified National Institute of Standards and Technology (MNIST) database of handwritten digits, the input layer may be adapted to the size of the database images, and the output layer may be adapted to match the labeling according to actual Arabic digits, for example, ranging from 0 to 9.
[0134] As part of implementing variational quantum circuit 20, an initial circuit definition may be passed to a quantum circuit implementation device, which can adapt variational quantum circuit 20 based on the architecture of the quantum device, such as to optimize variational quantum circuit 20 for quantum hardware. For example, when initial variational quantum circuit 20 specifies a CNOT operation, the hardware implementation may include combining single-qubit and multi-qubit state rotations. Furthermore, multiple gates may be combined into different arrangements of quantum gates, such as to implement variational quantum circuit 20 with hardware-efficient quantum gates.
[0135] Those skilled in the art will appreciate that the number of features in the flattened feature vector 16 is preferably a multiple of the number of qubits 38 in the plurality of variational quantum circuits 20 to avoid wasting processing resources. However, those skilled in the art will appreciate that some inputs to one of the variational quantum circuits 20 may remain fixed values, or that one of the plurality of variational quantum circuits 20 may have a different circuit architecture, e.g., fewer qubits 38, such as to adapt the system 10 or method to a predefined convolutional filtering architecture having a number of features in the flattened feature vector 16 that is not a multiple of the total number of qubits 38 in the plurality of independent variational quantum circuits 20.
[0136] To test the hybrid quantum-classical computing system 10 obtainable by the above-described training method, multiple independent variational quantum circuits 20 were implemented in a classical simulator based on the circuit configuration shown in FIG. 3B , which includes four different independent variational quantum circuits 20, each with three layers 42 of quantum gates operating on five qubits 38. System 10 was compared to a purely classical machine learning classifier that differs from hybrid quantum-classical computing system 10 primarily in that classification block 22 comprises a fully-connected MLP device implemented on classical hardware instead of multiple variational quantum circuits 20.
[0137] Figure 6A shows the results of training a hybrid quantum-classical computing system 10, such as that shown in Figures 3A and 3B (HQNN), compared to the performance of a purely classical convolutional neural network (CNN). The variational quantum circuit 20 is replaced with a multilayer perceptron (MLP), and both systems are trained on the MNIST dataset to predict correct Arabic digits. The left graph tracks the training loss over epochs of training each system, while the right graph tracks the accuracy of each system in predicting the correct labels of handwritten samples of test images in the MNIST dataset. As indicated in the figure legend, the hybrid quantum-classical computing system 10 contains fewer trainable weights (parameters) than the CNN being tested.
[0138] Figure 6B shows a bar graph of the relative performance, i.e., the accuracy of predicting the correct label of unseen handwritten symbols in the validation dataset, of the CNN on the left and the hybrid quantum-classical computing system 10 on the right. Although the number of parameters used to construct the hybrid quantum-classical computing system 10 was approximately eight times smaller than that of the CNN, the hybrid quantum-classical computing system 10 was better at predicting the correct label than the CNN, with a 38% reduction in the probability of attributing an incorrect label and a final accuracy of approximately 99.21%.
[0139] Thus, system 10 using multiple variational quantum circuits 20 can achieve accuracy comparable to or greater than that of a corresponding classical classifier using less trainable parameters. This can be advantageous in situations where the number of samples in the sample dataset for training the classifier is small or relatively few for complex tasks, and classical classifiers can be scaled in complexity depending on the complexity of the task. The inventors have found that even though multiple variational quantum circuits 20 process only a respective subset of flattened feature vectors 16, and even though the correct label typically depends on a complex arrangement of features in feature grid 26, system 10 still accurately attributes matching labels to images, indicating that system 10 can be advantageously applied to classification tasks of feature grids 26 in short-term quantum computing devices.
[0140] In the preceding description, convolution block 12 has generally been implemented as a classical convolution block 12 based on classical convolution filters implemented in classical features. However, those skilled in the art will understand that system 10 and methods generally are not limited to such embodiments, and that convolution block 12 may also be implemented using quantum circuits, for example, using quantum convolution layers.
[0141] 7 shows an example of a convolution block 12 that includes a quantum convolution layer 50. In the illustrated example, quantum convolution layer 50 is configured to receive a grid of features, such as grid of input features 26, or a subset of filtered grids of intermediate features 28a-d, and encode the features into qubits 52 of quantum convolution layer 50. The illustrated quantum convolution layer 50 includes four qubits 52 and may be configured to receive a subset of grid of input features 26 that includes four features, such as a 2×2 subset of grid of input features 26, similar to the operation of a classical convolution filter.
[0142] Quantum convolutional layer 50 may encode input features into the quantum states of qubits 52 via encoding gates 54, e.g., via angle embedding, and may transform the states of qubits 52 through the action of a layer of quantum gates 56. The layer of quantum gates 56 may comprise multi-qubit gates, such as CNOT gates, or may comprise variational quantum gates, whose action on the quantum states of qubits 52 may be determined by respective trainable variational parameters. In the illustrated example, the layer of quantum gates 56 is applied once, although one skilled in the art will understand that the layer of quantum gates 56 may be applied multiple times to transform the initial state of qubits 52.
[0143] After the layer of quantum gates 56 acts on the quantum states of the qubits 52, the quantum states can be measured by a detection assembly 58, for example, multiple single-qubit detectors, which can measure the Z projection of the quantum states of all qubits 52.
[0144] The quantum convolutional layer 50 may be applied in parallel to all possible matching subgroups of the grids 26, 28a-d of features provided as input, e.g., all 2-by-2 square subgroups of adjacent features within the input, and may provide an output for each measured quantum bit, i.e., four measurement outputs. The quantum convolutional layer 50 may feature the same variational parameters for all subgroups of the grids 26, 28a-d of features; in other words, the same quantum convolutional layer 50 may be applied to different subgroups of the grids 26, 28a-d of features provided as input. Each of the measurement outputs may be considered the output of a different filter, such that applying the quantum convolutional layer 50 to the grids 26, 28a-d of features as input results in four different filtered grids 60 of features, which may be further processed by additional quantum convolutional layers 50 or classical convolutional filters (not shown in FIG. 7).
[0145] The quantum convolutional layer 50 can be trained similarly to a classical convolutional layer as described above for the independent variational quantum circuit 20, e.g., by optimizing the variational parameters based on an optimization algorithm including, e.g., adaptive moment estimation and a gradient meter of the variational parameters, e.g., based on a parameter shift rule.
[0146] The filtered grid of features 60 may be flattened by a flattening layer 14 to obtain a flattened feature vector 16, which may be processed by a classification block 22 to obtain output labels 36 for the grid of input features 26, which may be implemented at least in part using a variational quantum circuit 20, as described above.
[0147] The description and illustrations of the preferred embodiment serve only to illustrate the invention and its associated beneficial effects and should not be understood to imply any limitation, the scope of which is to be determined solely by the appended claims. [Explanation of symbols]
[0148] 10 Hybrid quantum-classical computing system 12 Convolution Blocks 14 Planarization layer 16 Flattened feature vector 18 Flattened feature vector subset 20 Variational Quantum Circuits 22 Classification Blocks 24 Connecting layer 26 Grid of input features 28a–d Filtered grid of input features 30 intermediate flattened feature vectors 32 Measurement Output 34 Fully Connected MLP 36 Output Label 38 qubits 40 Encoding Gates 42 layers of quantum gates 44 Variational Quantum Gates 46 Tangled Gate 48 detectors 50 Quantum Convolutional Layer 52 qubits 54 Encoding Gates 56 Layers of Quantum Gates 58 Detection Assembly A filtered grid of 60 features
Claims
1. A hybrid quantum-classical computing system (10) for classifying a grid of input features (26, 28, 28a-d) provided as input, said system (10) comprising: a convolution block (12) comprising a convolution filter configured to receive as input the grid of input features (26, 28, 28a-d) and to output (32) a plurality of output features (28, 28a-d) for the grid of input features (26, 28, 28a-d) based on a trainable configuration of the convolution filter; a flattening layer (14) for converting the filtered grid (28, 28a-d) of output features received from the convolution block (12) into a flattened feature vector (16); a classification block (22) configured to receive the flattened feature vector (16, 18) and generate an output classification, the classification block (22) comprising a plurality of independent variational quantum circuits (20) each comprising a plurality of quantum gates (40, 44, 46) operating on a qubit (38) of a qubit register of the respective independent variational quantum circuit (20), the plurality of quantum gates (40, 44, 46) being variational quantum gates (44) operating on a variational quantum bit (38) of the qubit register; a classification block (22) comprising: a variational quantum gate (44), the action of which is parameterized according to an associated variational parameter; and an encoding gate (40) for modifying the states of the qubits (38) of the qubit register according to an input feature vector (16, 18), wherein each of the plurality of independent variational quantum circuits (20) comprises an entanglement gate (46) for entangling the quantum states of at least two of the qubits (38) of the respective qubit register; Equipped with the independent variational quantum circuits (20) of the plurality of independent variational quantum circuits (20) receive different subsets of features (18) from the flattened feature vector (16) as the input feature vector, for encoding each of the different subsets of features into a qubit (38) of a corresponding independent variational quantum circuit (20) of the plurality of independent variational quantum circuits (20); A hybrid quantum-classical computing system (10) in which measurement outputs (32) of the plurality of independent variational quantum circuits (20) are combined to determine a label (36) of the grid of input features (26, 28, 28a-d) as the output classification.
2. 2. The hybrid quantum-classical computing system of claim 1, wherein the output states of all qubits in the qubit register of one of the plurality of independent variational quantum circuits are independent of the action of quantum gates in another of the plurality of independent variational quantum circuits.
3. 3. The hybrid quantum-classical computing system of claim 1, wherein the variational parameters of one of the plurality of independent variational quantum circuits are different from the variational parameters of another of the plurality of independent variational quantum circuits.
4. 3. The hybrid quantum-classical computing system of claim 1, wherein each of the plurality of independent variational quantum circuits comprises a plurality of layers of quantum gates, each layer of the plurality of layers of quantum gates comprising, in particular, a variational quantum gate for each of the qubits of the qubit register.
5. The hybrid quantum-classical computing system (10) of claim 1 or 2, wherein the plurality of independent variational quantum circuits (20) are implemented in quantum hardware.
6. 3. The hybrid quantum-classical computing system (10) of claim 1 or 2, wherein the convolution block (12) and / or the planarization layer (14) are implemented in classical hardware, in particular using trainable machine learning models.
7. The hybrid quantum-classical computing system (10) of claim 1 or 2, wherein the plurality of independent variational quantum circuits (20) each comprise at least two qubits (38) in a respective qubit register.
8. 3. The hybrid quantum-classical computing system of claim 1, wherein quantum states of the qubits of different independent variational quantum circuits of the plurality of independent variational quantum circuits are disentangled prior to measurement.
9. 3. The hybrid quantum-classical computing system of claim 1, wherein the trainable parameters of the convolution block, the flattening layer, and the classification block are obtained based on a joint training process of a machine learning model implemented in particular on classical hardware and the plurality of independent variational quantum circuits implemented in quantum hardware.
10. 3. The hybrid quantum-classical computing system of claim 1, wherein each of the independent variational quantum circuits of the plurality of independent variational quantum circuits is configured to encode a number of inputs into the quantum states of the qubits of its qubit register, and the input feature vector includes a number of features that is a multiple of the number of inputs of the independent variational quantum circuits of the plurality of independent variational quantum circuits.
11. 3. The hybrid quantum-classical computing system of claim 1, wherein the measurement outputs of the plurality of independent variational quantum circuits are combined using a trainable layer of artificial neurons implemented in classical hardware, in particular a fully connected layer of artificial neurons implemented in classical hardware.
12. 1. A method for determining labels (36) for a grid (26, 28, 28a-d) of input features based on a hybrid quantum-classical computation algorithm, the method comprising: receiving the grid of input features (26, 28, 28a-d) and generating a filtered grid of features (26, 28, 28a-d) based on the grid of input features (26, 28, 28a-d) and a convolution filter, the convolution filter configured to output a plurality of output features for the grid of input features (26, 28, 28a-d) based on a trainable configuration of the convolution filter; flattening the filtered grid of output features into a flattened feature vector (16); separating the flattened feature vector (16) into a plurality of flattened feature vector subsets (16, 18) and encoding each of the flattened feature vector subsets (18) onto a qubit (38) of a corresponding independent variational quantum circuit (20) of a plurality of independent variational quantum circuits (20), each of the plurality of independent variational quantum circuits (20) comprising: a qubit register including a qubit; an encoding gate (40) configured to act on a quantum state of the qubit (38) of the qubit register based on characteristics of the corresponding subset (18) of the plurality of flattened feature vector subsets (16, 18); a variational quantum gate (44) whose action on the qubit (38) of the qubit register is parameterized according to an associated variational parameter; and an entanglement gate (46) for creating a superposition of quantum states of two qubits (38) of the qubit register of the corresponding independent variational quantum circuit (20); obtaining a measurement output (32) based on measuring the output state of each of the plurality of independent variational quantum circuits (20), and combining the measurement outputs (32) of the plurality of independent variational quantum circuits (20) to determine a corresponding output label (36); A method comprising:
13. A method for training a hybrid quantum-classical computing system (10) to approximate a labeling function of an input grid (26, 28, 28a-d) of input features, the system (10) comprising: a machine learning model implemented on a classical processing system configured to generate a flattened feature vector (16, 18) based on the grid of input features (26, 28, 28a-d) according to a parameterized transfer function, the parameterized transfer function being parameterized by parameterized machine learning parameters, the machine learning model comprising a convolutional layer (12) of artificial neurons; a plurality of independent variational quantum circuits (20) each comprising a plurality of quantum gates (40, 44, 46) operating on qubits (38) of a respective qubit register, the plurality of quantum gates (40, 44, 46) comprising: a variational quantum gate (44) whose parameterized action on the qubits (38) of the qubit register is parameterized according to associated variational parameters; and an encoding gate (40) for modifying the states of the qubits (38) of the qubit register according to an input feature vector (16, 18), each of the plurality of independent variational quantum circuits (20) comprising an entanglement gate (46) for entangling quantum states of at least two of the qubits (38) of the respective qubit register; a plurality of independent variational quantum circuits (20), each of which receives a different subset of features (18) from the flattened feature vector (16) as the input feature vector (16, 18); a combination module (24) implemented on a classical processing system and configured to receive measurement outputs (32) generated by the plurality of independent variational quantum circuits (20) and combine the measurement outputs (32) of the plurality of independent variational quantum circuits (20) to determine a classification result, the combination being based on a plurality of trainable combination parameters; wherein the method comprises: providing a sample grid (26, 28, 28a-d) of input features to the machine learning model and receiving an output flattened feature vector (16) from the machine learning model; separating the output flattened feature vector (16) into a plurality of flattened feature vector (16) subsets and providing each of the flattened feature vector (16) subsets to a corresponding independent variational quantum circuit (20) of the plurality of independent variational quantum circuits (20) for encoding each of the plurality of flattened feature vector (16) subsets into a qubit of the corresponding independent variational quantum circuit (20) of the plurality of independent variational quantum circuits (20); receiving an output label (36) from the combination module (24) based on the measurement outputs (32) of the plurality of independent variational quantum circuits (20); determining parameter updates for the variational parameters and the trainable combination parameters based on a value of a loss function for the output labels (36); A method comprising:
14. A non-transitory machine-readable medium storing machine-readable instructions that, when executed by a processing system, cause the processing system to implement or control the system (10) of claim 1 or 2, or perform the method of claim 12 or 13.
Citation Information
Patent Citations
Method and system for estimating ground state energy of quantum system
US20230054868A1