Energy efficient execution of a neural network

By integrating quantum machine learning models into classical neural networks, the hybrid model addresses inefficiencies and high energy consumption, achieving enhanced performance and reduced energy use through quantum computing principles.

WO2025252389A1PCT designated stage Publication Date: 2025-12-11BUNDESDRUCKEREI GMBH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
PCT/EP2025/062729
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-06-03
Filing Date
2025-05-09
Publication Date
2025-12-11

AI Technical Summary

Technical Problem

Classical neural networks face limitations in handling complex tasks and large datasets, leading to high energy consumption and inefficiencies.

Method used

Integrate quantum machine learning models into selected layers of classical neural networks, leveraging quantum computing principles such as superposition and entanglement to create a hybrid model that reduces energy consumption and enhances performance.

Benefits of technology

The hybrid classical-quantum model achieves significant energy savings and improved efficiency in executing machine learning tasks, particularly by replacing classical layers with quantum layers that utilize quantum parallelism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure EP2025062729_11122025_PF_FP_ABST
    Figure EP2025062729_11122025_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method for executing a trained classical neural network, the neural network comprising multiple layers. The method comprises: selecting at least one layer of the classical neural network, providing a quantum machine learning model, building a training dataset by inferring the classical neural network, using an inference dataset, such that the training dataset comprises entries, each entry of the entries comprising an input that is received by the selected at least one layer and an output that is provided by the selected at least one layer in response to receiving the input during the inference, training the quantum machine learning model using the training dataset, replacing the selected at least one layer of the neural network by the quantum machine learning model, using a hybrid classical and quantum computing system for executing a hybrid classical-quantum machine learning model that resulted from the replacing.
Need to check novelty before this filing date? Find Prior Art

Description

ENERGY EFFICIENT EXECUTION OF A NEURAL NETWORKFIELD OF THE INVENTION

[0001] The present disclosure is directed generally to the field of hybrid classical- quantum machine learning models.BACKGROUND

[0002] Classical neural networks, as the name suggests, operate within the realm of classical computing. They have been extensively studied and utilized, with various architectures and training methods developed over the years. However, as the complexity of tasks and the amount of data involved in machine learning applications increase, the limitations of classical computing become more apparent.SUMMARY

[0003] Example embodiments provide a method for executing a trained classical neural network, the classical neural network comprising multiple layers, the method comprising operations of: selecting at least one layer of the classical neural network; providing a quantum machine learning model; building a training dataset by inferring the classical neural network, using an inference dataset, such that the training dataset comprises entries, each entry of the entries comprising an input that is received by the selected at least one layer and an output that is provided by the selected at least one layer in response to receiving the input during the inference; training the quantum machine learning model using the training dataset; replacing the selected at least one layer of the classical neural network by the quantum machine learning model; using a hybrid classical and quantum (classical- quantum) computing system for executing a hybrid classical-quantum machine learning model that resulted from the replacing.

[0004] Example embodiments provide a computer system for executing a trained classical neural network, the classical neural network comprising multiple layers,the computer system being configured for: selecting at least one layer of the classical neural network; providing a quantum machine learning model; building a training dataset by inferring the classical neural network, using an inference dataset, such that the training dataset comprises entries, each entry of the entries comprising an input that is received by the selected at least one layer and an output that is provided by the selected at least one layer in response to receiving the input during the inference; training the quantum machine learning model using the training dataset; replacing the selected at least one layer of the classical neural network by the quantum machine learning model; controlling a hybrid classical and quantum computing system for executing a hybrid classical-quantum machine learning model that resulted from the replacing.

[0005] Example embodiments provide a computer program product for executing a trained classical neural network, the classical neural network comprising multiple layers, the computer program product comprising instructions for causing a computer system for performing at least the following: selecting at least one layer of the classical neural network; providing a quantum machine learning model; building a training dataset by inferring the classical neural network, using an inference dataset, such that the training dataset comprises entries, each entry of the entries comprising an input that is received by the selected at least one layer and an output that is provided by the selected at least one layer in response to receiving the input during the inference; training the quantum machine learning model using the training dataset; replacing the selected at least one layer of the classical neural network by the quantum machine learning model; controlling a hybrid classical and quantum computing system for executing a hybrid classical- quantum machine learning model that resulted from the replacing.BRIEF DESCRIPTION OF THE DRAWINGS

[0006] In the following, examples are described in greater detail making reference to the drawings in which:

[0007] Fig. 1 is a diagram illustrating a hybrid classical-quantum computing system in accordance with an example of the present subject matter.

[0008] Fig. 2 is a flowchart of a method for executing a trained classical neural network in accordance with an example of the present subject matter.

[0009] Fig. 3 is a block diagram of an exemplary computer system for implementing at least part of the present method in accordance with an example of the present subject matter.

[0010] Fig. 4 is a diagram illustrating a method for training a quantum machine learning model in accordance with an example of the present subject matter.DETAILED DESCRIPTION

[0011] In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular architectures, interfaces, techniques, etc., in order to provide a thorough understanding of the examples. However, it will be apparent to those skilled in the art that the disclosed subject matter may be practiced in other illustrative examples that depart from these specific details. In some instances, detailed descriptions of well-known devices and / or methods are omitted so as not to obscure the description with unnecessary detail.

[0012] Quantum computers can solve complex problems more efficiently than classical computers. The quantum computer leverages the principles of quantum mechanics to perform computations on quantum bits or "qubits", which can exist in multiple states simultaneously. The present subject matter may enable the integration of quantum computing and classical machine learning. The present subject matter may facilitate the execution of trained classical neural networks using quantum machine learning models. The present subject matter may leverage the strengths of both classical and quantum computing, leading to improve performance and efficiency in machine learning applications. Since various classical layers may be replaced by quantum layers, it can be assumed that the resulting hybrid classical-quantum machine learning model can be operated with significantly less energy than the original classical neural network. This may particularly be advantageous as the quantum computers may have significantly lower energy requirements than conventional computers e.g., based, among other things, on the Landauer principle.

[0013] According to an aspect of the present disclosure, there is provided a method for executing a trained classical neural network. The classical neural network may be a neural network (NN) that may be executed on a classical computer. The classical neural network comprises multiple layers such as input layer, hidden layer and output layer. The method comprises selecting at least one layer of the classical neural network.

[0014] The method comprises providing a quantum machine learning model that can implement the functionality of the selected at least one layer of the classical neural network. The quantum machine Learning (QML) model may combine principles of quantum computing with algorithms for machine learning. The QML model may leverage the capabilities of quantum computers, such as superposition, entanglement, and quantum interference, to process information. The QML may aim to enhance the efficiency and performance of machine learning tasks, potentially solving certain problems more rapidly or handling tasks that are intractable for classical computers. The QML model may include a data encoding layer for encoding data into quantum states using various techniques like amplitude encoding or quantum feature maps, which transform classical data into a format suitable for quantum processing. The QML model may include a quantum processing layer for performing quantum operations to manipulate the encoded data. This can involve complex computations that take advantage of quantum parallelism to explore a vast solution space more efficiently. The QML model may include a measurement layer for measuring the output of the quantum computation and collapsing the quantum state to classical information. This step may or may not involve probabilistic outcomes, which may then be interpreted or further processed to solve machine learning tasks.

[0015] The method also includes building a training dataset. The training dataset is built by inferring the classical neural network, using an inference dataset. That is, the trained classical neural network is executed or applied on entries of the inference dataset. Each entry of the entries of the inference dataset may comprise an input for which the task of the classical neural network is to be performed. For example, if the classical neural network is trained for image classification, the entries of the inference dataset may comprise images to be classified. The trainingdataset comprises entries. Each entry of the entries of the training dataset comprises an input and an output. The input may be data received by the selected at least one layer of the classical neural network. The output is provided by the selected at least one layer in response to receiving the input during the inference. Furthermore, the method comprises training the quantum machine learning model using the training dataset. The training process may involve iteratively adjusting the parameters of QML model based on an optimization algorithm's feedback until a cost function is minimized, indicating that the QML model has learned to provide the outputs with reasonable accuracy. After training, the QML model's performance may be evaluated using a separate dataset not seen by the QML model during training to ensure that it generalizes well to new data.

[0016] The method further comprises replacing the selected at least one layer of the classical neural network by the quantum machine learning model. This may result in a hybrid classical-quantum machine learning model. The method includes using a hybrid classical-quantum computing system. The hybrid classical-quantum computing system is used for executing the hybrid classical-quantum machine learning model. The hybrid classical-quantum machine learning model is a result of the replacement of the selected at least one layer with the quantum machine learning model. The hybrid classical-quantum computing system refers to a hybrid classical and quantum computing system and the hybrid classical-quantum machine learning model refers to a hybrid classical and quantum machine learning model. The hybrid classical-quantum machine learning model may comprise one or more quantum components and classical components.

[0017] According to one example (QML provision example), the operation of providing the quantum machine learning model that can implement the functionality of the selected layer(s) may be performed such that the QML model fulfills a replacement criterion. For example, the provision operation may be repeatedly performed until the replacement criterion is fulfilled, wherein in each repetition a different structure of the QML model that can implement the functionality of the selected layer(s) may be provided. The replacement criterion may require at least one of: a maximum size of a quantum circuit representing the QML model or a minimum expressivity of the QML model. The expressivity of the QML model mayrefer to its ability to capture, represent, and process a wide range of functions or patterns within data. The expressivity may, for example, be quantified using a metric such as: number of entangled qubits in the QML model, variety of quantum gates (or quantum transformations) involved in the QML model, or depth of the quantum circuit representing the QML model. In case the replacement criterion cannot be fulfilled, the operation of selection may be repeated to select other one or more layers of the classical neural network and the QML provision example may be repeated. This may be performed until the replacement criterion is fulfilled. In another example, in case the replacement criterion cannot be fulfilled, the replacement criterion may be changed (loosen) and the QML provision example may be repeated. This may be performed until the replacement criterion is fulfilled.

[0018] According to one example, the hybrid classical-quantum computing system is provided in accordance with a web client-server configuration having a server system and a client system. The server system comprises a classical computer and a quantum computer. The client system comprises a classical computer. The execution of the hybrid classical-quantum machine learning model comprises: providing a frontend application on the client system and a corresponding backend application on the server system. The frontend application is configured to execute a classical component of the hybrid classical-quantum machine learning model. The backend application is configured to execute a quantum component of the hybrid classical-quantum machine learning model. The execution of the hybrid classical-quantum machine learning model comprises: executing the frontend application and the backend application, wherein the execution of the frontend application and the backend application comprises a communication of data between the frontend application and the backend application via a web interface. The web interface is provided in accordance with the web client-server configuration.

[0019] The frontend application and the backend application may refer to a frontend part and backend part of a web application respectively. The classical computer on the client system may execute the frontend application. The execution of the frontend application may comprise execution of classical components of the hybrid classical-quantum machine learning model and exchange of data with the backendapplication. This data exchange may enable the frontend application to send processed data to the backend application for quantum processing and receive the results for further analysis or inference. The classical computer on the server system may control execution of the backend application. The execution of the backend application may, for example, comprise the reception of the classical data from the frontend application at the classical computer on the server system and then control the quantum computer to encode the classical data into quantum format, process them in accordance with the QML model and provide measurement results. The communication of data between the frontend and backend applications may be performed through the web interface, allowing for seamless interaction between the classical and quantum components of the hybrid classical-quantum machine learning model.

[0020] According to one example, a replacement method is formed by the selecting operation, the providing operation, the building operation, the training operation, and the replacing operation, wherein the method further comprises before the execution of the hybrid classical-quantum machine learning model: repeating the replacement method one or more times for further selected layers of the neural network. The repetition may, for example, be performed until a criterion is fulfilled. The criterion may require at least one of: a maximum number of layers of the classical neural network is replaced, or a performance improvement of the hybrid classical-quantum machine learning model compared to the classical neural network. The performance improvement may be determined by evaluating or estimating a performance metric for the hybrid classical-quantum machine learning model and the classical neural network and comparing the resulting values. The performance may, for example, be the energy consumed for performing inference and the performance improvement may be a reduction in the energy consumption by the hybrid classical-quantum machine learning model compared to the classical neural network.

[0021] This example may enable to replace multiple parts of the classical neural network with respective quantum machine learning models. The layer(s) to be replaced in the classical neural network in each repetition may, for example, be randomly determined or using a selection criterion as described herein.

[0022] According to one example, the replacement method is performed a minimum number of times such that the execution of the hybrid classical-quantum machine learning model consumes a first energy that is smaller than a second energy consumed by the execution of the classical neural network.

[0023] The replacement method is performed a minimum number of times. This means that multiple layers of the neural network may be replaced by respective QML models. The more replaced layers the less energy may be consumed by the resulting hybrid classical-quantum machine learning model. The purpose of this minimum number of executions may be to ensure that the execution of the hybrid classical-quantum machine learning model consumes a first energy which is less than the energy consumed by the (unmodified) classical neural network. Notably, this first energy is smaller than a second energy. The second energy is consumed by the execution of the (unmodified) classical neural network. This selective replacement may allow for a more targeted integration of quantum computing elements into the hybrid classical-quantum machine learning model.

[0024] In one example, the QML model of the hybrid classical-quantum machine learning model may be dynamically replaced based on the input data. For instance, the method may involve monitoring the performance of the QML model during the execution of the hybrid classical-quantum machine learning model and replacing the QML model with alternative circuits if suboptimal results are observed. This dynamic replacement strategy can adapt the hybrid classical-quantum machine learning model to different types of data and tasks, enhancing its versatility and robustness.

[0025] In one example, the training operation may involve adapting the QML model’s parameters. This adaptation process can be achieved through iterative optimization techniques, such as gradient descent, to improve the accuracy and efficiency of the hybrid classical-quantum machine learning model.

[0026] According to one example, the first energy is smaller than the second energy by a minimum percentage value.

[0027] This difference in energy levels is quantified by a minimum percentage value, which establishes a threshold for the energy differential between the two states. For example, the minimum percentage value may be provided to ensure that the QML model has a desired QML size and / or expressivity.

[0028] According to one example, the (to be replaced) at least one layer of the classical neural network may be selected using the selection criterion. The selection criterion may require that the selected at least one layer is a specific layer of the classical neural network. The specific layer may be a fully connected layer that is between two fully connected layers. Alternatively, the specific layer may be a convolutional layer, recurrent layer, or any other types of layers commonly used in machine learning models.

[0029] According to one example, the selection criterion may require that the selected at least one layer is multiple consecutive fully connected layers. The number of selected fully connected layers may be a predefined number. Compared to singly layers, the multiple fully connected layers may play a role in processing the input data and extracting relevant features for the machine learning model. For example, in case the classical machine learning model is processing image data for a machine learning task, the selected multiple fully connected layers may allow to learn complex patterns and relationships within the image data better than a single layer. Each fully connected layer may perform a series of matrix multiplications and activation functions to transform the input data into a format that is more suitable for the subsequent layers.

[0030] According to one example, the replacement method is executed on a classical computer, wherein the execution comprises simulating execution of the quantum machine learning model during the training operation. The classical resources of the classical computer may be capable of accurately replicating the behavior of the quantum machine learning model during the training process. The simulation of the quantum machine learning model may be constructed based on the selected quantum model's architecture and parameters. This may involve setting up the classical algorithms, data structures, and computational processes that will mimic the behavior of the quantum model during training.

[0031] According to one example, the inference dataset comprises the inputs of a training dataset that has been used to train the classical neural network. The training dataset of the classical neural network may comprise inputs and corresponding labels. For example, for image classification, the training dataset may comprise as inputs images and as labels classes of those images. In this case, the inference dataset may comprise the images (excluding corresponding labels). This content of the inference dataset may be advantageous for example in case the replacement method is repeated, then the same inference dataset may be used in each repetition.

[0032] According to one example, the entries of the inference dataset may be obtained by random sampling of inputs for the selected layer(s) of the classical neural network, wherein the inference of the classical neural network is performed by inputting (directly) each entry of the inference dataset to the selected layer(s). In case the replacement method is repeated, this example may also be repeated for each repetition of the replacement method so that for each repetition a corresponding inference dataset may be provided.

[0033] According to one example, the building operation is performed such that the training dataset for training the QML model comprises a number of entries smaller than the number of entries of the inference dataset. That is, only part of the inference dataset is used to create the training dataset for training the QML model. For example, the entries of the inference dataset that are used to create the training dataset may be randomly selected from the entire inference dataset. For example, if the training dataset consists of 1000 entries and the inference dataset consists of 5000 entries, the method may focus on training the QML model with a limited amount of data. This approach can be beneficial in situations where collecting a large training dataset is challenging or time-consuming.

[0034] In one example, the method may use a data sampling strategy where a representative subset of the inference dataset is used for creating the training dataset. For instance, instead of creating the training dataset from the entire inference dataset, a random sample of entries may be selected to create the training dataset. This sampling approach can help in reducing computationalresources required for training while still capturing the essential patterns present in the larger dataset.

[0035] According to one example, the building comprises comprises: randomly selecting input output pairs that can be used as entries of the training dataset. That is the entire inference dataset may be used to create an initial training dataset and only then the training dataset for training the QML model may be selected from the initial training dataset. Each entry in the initial training dataset comprises an input of the selected layer(s) and corresponding output of the selected layer(s).

[0036] According to one example, the hybrid classical-quantum computing system comprises a classical computer and a collocated quantum computer. The classical computer is responsible for executing the classical components, while the quantum computer is utilized for executing the quantum component. This may enable a localized and secure processing of the hybrid classical-quantum machine learning model.

[0037] According to one example, the quantum machine learning model is a quantum neural network. A quantum neural network is a type of neural network that uses quantum computing principles to perform computations. One way a quantum neural network can be implemented is by utilizing qubits as the basic unit of information processing. Qubits can exist in superposition states, allowing for parallel computation and potentially faster processing of data compared to classical neural networks.

[0038] For example, in a quantum neural network designed for image recognition, the qubits could represent values representing features of an image. The quantum neural network may then perform operations on these qubits to recognize patterns and features within the image.

[0039] According to one example, the classical neural network is a deep neural network (DNN) or a convolutional neural network (CNN).

[0040] In one example implementation of the provision operation, the number of outputs of the last layer of the selected at least one layer may be determined. A quantum system may be defined. The quantum system may be defined by a number of qubits. The number of qubits that may be used to encode the outputs in the quantum system may depend on the encoding method. For example, for an amplitude encoding, the classical data may be encoded into the amplitudes of a quantum state. Thus, a vector of N real numbers may be represented using a number of log2(N) qubits because each qubit can represent 2 amplitudes (0 and 1 states). For angle encoding, the angles of quantum gates may be used to encode data. In this case one qubit may be used per value of N values, encoding each value into the angle of a rotation gate applied to the qubit. Once the quantum system is defined, one may define a quantum circuit that can act as a neural network, using the qubits for processing and encoding the network’s parameters. The quantum circuit may, for example, be selected from a predefined set of quantum circuit templates that can implement a neural network. In another example, the quantum circuit that can act as the neural network may be designed. This may involve selecting quantum gates (like rotation gates, entangling gates, etc.) to manipulate the qubits and encode the parameters of the QML model. The gates and their parameters (angles for rotation gates, for instance) may, for example, be provided analogously to the weights involved in the selected layer(s) of the classical neural network. The gates, parameterized by angles or other parameters, may act as the "weights" of the network. Quantum operations, especially non-linear transformations facilitated by measurement, entanglement, and superposition, may introduce non-linearity and complexity into the processing capability of the network analogously with activation functions. The number of the layers in the selected at least one layer may be associated with the depth of the quantum circuit (number of gate layers).

[0041] Fig. 1 is a diagram illustrating a hybrid classical and quantum computing system 100 in accordance with an example of the present subject matter. The hybrid classical and quantum computing system 100 comprises a client system 100B and a server system 100A. Each of the client system and the server system may be a computing system. Only one client system is shown for simplification of the description; however, it is not limited to as other client systems may be providedwhere each other client system may be configured to operate as described with reference to client system 100B.

[0042] The server system 100A comprises a classical computer 101. The server system 100A may further comprise a quantum computer 102. An example implementation of the classical computer 101 is described with reference to Fig. 3. The quantum computer 102 may comprise qubits. For example, qubits may be part of quantum registers 105.1 through 105.L. The classical computer 101 may be configured to control operation of the quantum computer 102. The classical computer 101 may use an interface 103 with the quantum computer 102 to control operation of the quantum computer 102 in accordance with an example of the present subject matter. The classical computer 101 may comprise a backend application 107.

[0043] The client system 100B comprises a classical computer 110. The classical computer 110 may comprise a frontend application 117. An example implementation of the classical computer 110 is described with reference to Fig. 3.

[0044] The classical computer 101 may act as the intermediary between the classical computer 110 and the quantum computer 102. The classical computer101 may receive data from the classical computer 110 and then controls the operation of the quantum computer 102 according to the data. The classical computer 101 may also handle tasks like scheduling, because quantum resources can be limited, and multiple users might be trying to access the quantum computer102 simultaneously.

[0045] The client system 100B may be configured to communicate with the server system 100A through one or more networks, wherein the one or more networks 120 may comprise a local area network (LAN), a radio access network (RAN), a metropolitan area network (MAN), a wide area network (WAN), Worldwide Interoperability for Microwave Access (WIMAX), a wireless local area network (WLAN), all or a portion of the Internet, any other communication system or a combination thereof.

[0046] The communication of data between the frontend application 117 and backend application 107 may, for example, be performed through a web interface. The web interface may, for example, utilize RESTful APIs or WebSocket protocols to ensure efficient and real-time communication between the client and server systems. For example, the frontend application 117 may be implemented using a framework like TensorFlow or PyTorch, while the backend application 107 may leverage a quantum development platform such as Qiskit or Cirq. By combining diverse technologies, the hybrid classical-quantum machine learning model can benefit from the strengths of both classical and quantum computing paradigms, leading to improved performance and accuracy in various applications.

[0047] In an alternative example implementation of the hybrid classical-quantum computing system, the server system 100A may be provided as the hybrid classical- quantum computing system, where the classical computer 101 performs the classical component of the hybrid classical-quantum machine learning model.

[0048] FIG. 2 is a flowchart of a method for executing a trained classical neural network according to an example of the present subject matter. For the purpose of explanation, the method described in FIG. 2 may be implemented in the system illustrated in FIG. 1 but is not limited to this implementation.

[0049] At least one layer of the classical neural network may be selected in step 201.

[0050] A quantum machine learning model may be provided in step 203. A training dataset may be built in step 205 by inferring the classical neural network using an inference dataset. The training dataset comprises entries, wherein each entry of the entries comprises an input that is received by the selected at least one layer and an output that is provided by the selected at least one layer in response to receiving the input during the inference.

[0051] The quantum machine learning model may be trained in step 207 using the training dataset.

[0052] The selected at least one layer of the neural network may be replaced by the quantum machine learning model in step 209.

[0053] A hybrid classical-quantum computing system may be used in step 211 for executing a hybrid classical-quantum machine learning model that resulted from the replacing.

[0054] Steps 201 to 209 may form the replacement method. In one example implementation of the method of Fig. 2, the replacement method may be repeated for replacing other one or more layer(s) of the classical neural network with respective QML model. The repetition may be performed until a criterion is fulfilled. The criterion may require at least one of: a maximum number of layers of the classical neural network is replaced, or a performance improvement of the hybrid classical-quantum machine learning model compared to the classical neural network. The performance improvement may be determined by evaluating a performance metric for the hybrid classical-quantum machine learning model compared to the classical neural network and comparing the resulting values. The performance may, for example, be the energy consumed for performing inference and the performance improvement may be a reduction in the energy consumption by the hybrid classical-quantum machine learning model compared to the classical neural network.

[0055] Fig. 3 is a block diagram of an exemplary computer system for implementing at least part of the present method in accordance with an example of the present subject matter.

[0056] The components of the computer system 302 may include, but are not limited to, one or more processors or processing units 303, a storage system 311 , a memory unit 305, and a bus 307 that couples various system components including memory unit 305 to processor 303. The storage system 311 may include for example a hard disk drive (HDD). The memory unit 305 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory.

[0057] The computer system 302 may also communicate with one or more external devices such as a keyboard, a pointing device, a display 313, etc.; one or more devices that enable a user to interact with computer system 302; and / or any devices (e.g., network card, modem, etc.) that enable the computer system 302 to communicate with one or more other computing devices. Such communication can occur via I / O interface(s) 319. Still yet, the computer system 302 can communicate with one or more networks such as a local area network (LAN), a general wide area network (WAN), and / or a public network (e.g., the Internet) via a network adapter 309. As depicted, the network adapter 309 communicates with the other components of the computer system 302 via bus 307.

[0058] The memory unit 305 is configured to store applications that are executable on the processor 303. For example, the memory unit 305 may comprise an operating system as well as one or more application programs. The application programs comprise instructions that when executed enable to perform the method described with reference to FIG. 2.

[0059] For example, the computer system 302 may be configured to execute steps 201 to 211 . For step 211 , the computer system 302 may control the hybrid classical- quantum computing system to execute the hybrid classical-quantum ML model. For training step 207, the computer system 302 may either control the quantum computer 102 to perform the training or may act as a quantum simulator to simulate the execution of the training step 207.

[0060] Fig. 4 is a block diagram illustrating a method for creating a hybrid classical- quantum machine learning model in accordance with an example of the present subject matter. For the purpose of explanation, the method described in FIG. 4 may be implemented in the system illustrated in FIG. 1 but is not limited to this implementation.

[0061] A classical neural network 400 is shown as comprising four layers, namely, an input layers L1 , hidden layers L2 and L3 and an output layer L4. In this example, the fully connected hidden layer L3 of the classical neural network 400 is selected in order to be replaced with the quantum neural network 401. The quantum neural network 401 comprises one layer of gates and may thus be referred to as quantumneural network layer. The hidden layer L3 comprises four nodes and configured to receive four input data referred to as i1 , i2, i3 and i4. The hidden layer L3 is configured to output four outputs o1 , o2, o3 and o4.

[0062] The quantum neural network 401 is provided with a quantum system based on the number of outputs inputs i1 though i4. The number of qubit of the quantum system, may depend on the encoding method used. For simplification of the description, the number of qubits is provided equal to the number of inputs of the hidden layer L3. This may enable to encode the four inputs i1 through i4 of the hidden layer L3 in a quantum state defined by the four qubits of the quantum neural network 401 .

[0063] Hence, a resulting hybrid classical-quantum machine learning model may comprise layers L1 , L2, QNN layer 401 and layer L4. The classical components of the hybrid classical-quantum machine learning model comprise layers L1 , L2 and L4, while the quantum component of hybrid classical-quantum machine learning model comprises the QNN layer 401 .

[0064] As indicated in FIG. 4, the classical components of the classical neural network 400 may be comprised in the classical computer 110 of the client system 100B, while the quantum neural network 401 is implemented in the quantum computer 102 of the server system 100A. The classical computer 101 may be configured to receive the inputs i1 through i4 of the replaced layer L3 and encode them in a quantum state of the four qubits used to define quantum neural network 401. The outputs n1 , n2, n3 and n4 which resulted from the measurement of the quantum system of the quantum neural network 401 may be sent by the classical computer 101 to the classical computer 110. The outputs n1 , n2, n3 and n4 may be provided as input to the output layer L4 in order to obtain the result of a task performed by the hybrid classical-quantum machine learning model.

[0065] Following the example of FIG. 4, the building and training steps 205-207 may, for example, be implemented as follows.

[0066] An inference dataset may be provided. Each entry of the inference dataset comprises a vector of the input values that can be input into the input layer L1 of the classical neural network 400. The inference of the classical neural network 400may comprise inputting each entry of the inference dataset to the classical neural network 400 and obtain the outcome at the output layer L4.

[0067] For building the training dataset to train the QNN layer 401 according to the present subject matter, inputs and outputs of the layer L3 may be collected during the inference. Each entry of the training dataset may comprise a distinct pair of vectors. The first vector of the pair comprises the four inputs (i1 , i2, i3, i4) of the replaced layer L3. The second vector of the pair comprises the four outputs (o1 , o2, o3, o4) that are provided by the replaced layer L3 in response to receiving the first vector. The training dataset may comprise pairs of input-output vectors: pairl : [{i1 , i2, i3, i4}, {o1 , o2, o3, o4}], pair2: [{i1 , i2, i3, i4}, {o1 , o2, o3, o4}] etc. For example, for each entry of the inference dataset a corresponding entry in the training dataset may be obtained.

[0068] During training of the QNN layer 401 , for a current pair of the training dataset, the QNN layer 401 may receive as input {i1 , i2, i3, i4} that are encoded in its quantum state and provide a vector of four measurements {n1 , n2, n3, n4}. This vector of measurements may be compared against the outputs {o1 , o2, o3, o4} of the current pair to evaluate a loss function. The training may be performed until the loss function fulfills a convergence criterion.

[0069] As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as an apparatus, method, computer program or computer program product. Accordingly, aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.” Furthermore, aspects of the present invention may take the form of a computer program product embodied in one or more computer readable medium(s) having computer executable code embodied thereon. A computer program comprises the computer executable code or "program instructions".

[0070] The term “computer system” refers to data processing hardware and encompasses all kinds of apparatus, devices, and machines for processing data, including by way of example, a programmable processor, a computer, or multiple processors or computers. The apparatus can also be or further include specialpurpose logic circuitry, e.g., a central processing unit (CPU), a FPGA (field programmable gate array), or an ASIC (application specific integrated circuit). In some implementations, the data processing apparatus and / or special purpose logic circuitry may be hardware-based and / or software-based. The apparatus can optionally include code that creates an execution environment for computer programs, e.g., code that constitutes processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of them. The present disclosure contemplates the use of data processing apparatuses with or without conventional operating systems, for example LINUX, UNIX, WINDOWS, MAC OS, ANDROID, IOS or any other suitable conventional operating system.

[0071] Any combination of one or more computer readable medium(s) may be utilized. The computer readable medium may be a computer readable storage medium. A ‘computer-readable storage medium’ as used herein encompasses any tangible storage medium which may store instructions which are executable by a processor of a computing device. The computer-readable storage medium may be referred to as a computer-readable non-transitory storage medium. The computer- readable storage medium may also be referred to as a tangible computer readable medium. In some embodiments, a computer-readable storage medium may also be able to store data which is able to be accessed by the processor of the computing device.

[0072] ‘Computer memory’ or ‘memory’ is an example of a computer-readable storage medium. Computer memory is any memory which is directly accessible to a processor. ‘Computer storage’ or ‘storage’ is a further example of a computer- readable storage medium. Computer storage is any non-volatile computer-readable storage medium. In some embodiments computer storage may also be computer memory or vice versa.

[0073] A ‘processor’ as used herein encompasses an electronic component which is able to execute a program or machine executable instruction or computer executable code. References to the computing device comprising “a processor” should be interpreted as possibly containing more than one processor or processing core. The processor may for instance be a multi-core processor. A processor mayalso refer to a collection of processors within a single computer system or distributed amongst multiple computer systems. The term computing device should also be interpreted to possibly refer to a collection or network of computing devices each comprising a processor or processors. The computer executable code may be executed by multiple processors that may be within the same computing device or which may even be distributed across multiple computing devices.

[0074] Computer executable code may comprise machine executable instructions or a program which causes a processor to perform an aspect of the present invention. Computer executable code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages and compiled into machine executable instructions. In some instances the computer executable code may be in the form of a high level language or in a pre-compiled form and be used in conjunction with an interpreter which generates the machine executable instructions on the fly.

[0075] Generally, the program instructions can be executed on one processor or on several processors. In the case of multiple processors, they can be distributed over several different entities. Each processor could execute a portion of the instructions intended for that entity. Thus, when referring to a system or process involving multiple entities, the computer program or program instructions are understood to be adapted to be executed by a processor associated or related to the respective entity.

[0076] While the invention has been illustrated and described in detail in the drawings and foregoing description, such illustration and description are to be considered illustrative or exemplary and not restrictive; the invention is not limited to the disclosed examples.

Claims

CLAIMS1 . A method for executing a trained classical neural network (400), the classical neural network comprising multiple layers, the method comprising: selecting (201 ) at least one layer of the classical neural network (400); providing (203) a quantum machine learning model (401 ); building (205) a training dataset by inferring the classical neural network, using an inference dataset, such that the training dataset comprises entries, each entry of the entries comprising an input that is received by the selected at least one layer and an output that is provided by the selected at least one layer in response to receiving the input during the inference; training (207) the quantum machine learning model (401 ) using the training dataset; replacing (209) the selected at least one layer of the classical neural network (401 ) by the quantum machine learning model; using (211 ) a hybrid classical and quantum computing system (100) for executing a hybrid classical-quantum machine learning model that resulted from the replacing.

2. The method of any of the preceding claims, the hybrid classical and quantum computing system (100) being provided in accordance with a web clientserver configuration having a server system (100A) comprising a classical computer (101 ) and a quantum computer (102) and a client system (100B) comprising a classical computer (110), wherein the executing comprises: providing a frontend application (117) on the client system, the frontend application being configured to execute a classical part of the hybrid classical-quantum machine learning model;providing a backend application (107) on the server system, the backend application being configured to execute a quantum part of the hybrid classical-quantum machine learning model; executing the frontend application and the backend application, wherein the execution comprises a communication of data between the frontend application and the backend application via a web interface.

3. The method of claim 1 or 2, a replacement method comprising the selecting, the providing, the building, the training, and the replacing; the method further comprising before the executing: repeating the replacement method one or more times for further selected layers of the classical neural network.

4. The method of any of the preceding claims, wherein the replacement method is performed a minimum number of times such that the execution of the hybrid classical-quantum machine learning model consumes a first energy that is smaller than a second energy consumed by the execution of the classical neural network.

5. The method of claim 4, wherein the first energy is smaller than the second energy by a minimum percentage value.

6. The method of any of the preceding claims, the selected at least one layer being a fully connected layer that is between two fully connected layers.

7. The method of any of the preceding claims 1 to 5, the selected at least one layer being multiple fully connected layers.

8. The method of any of the preceding claims, a replacement method comprising the selecting, the providing, the building, the training, and the replacing; wherein the replacement method is executed on a classical computer, the execution comprising simulating execution of the quantum machine learning model during the training.

9. The method of any of the preceding claims, the inference dataset being inputs of a training dataset that has been used to train the classical machine learning model.

10. The method of any of the preceding claims 1 to 8, each entry of the inference dataset comprising randomly sampled input values of the selected one or more layers, wherein the inference of the inferring of the classical neural network comprises providing each entry of the inference dataset as input to the selected one or more layers.

11. The method of any of the preceding claims, the building being performed such that the training dataset comprises a number of entries smaller than the inference dataset.

12. The method of claim 11 , the building comprises: randomly selecting input output pairs that can be used as entries of the training dataset.

13. The method of any of the preceding claims, the hybrid classical-quantum computing system comprising a classical computer and a collocated quantum computer.

14. The method of any of the preceding claims, the quantum machine learning model being a quantum neural network.

15. The method of any of the preceding claims, the classical neural network being a DNN or a CNN.

16. The method of any of the preceding claims, wherein the provision of the quantum machine learning model may be performed one or more times until the QML model fulfills a replacement criterion, wherein the replacement criterion requires at least one of: a maximum size of a quantum circuit representing the QML model or a minimum expressivity of the QML model.

17. A computer system (302) for executing a trained classical neural network (400), the classical neural network comprising multiple layers, the computer system being configured for: selecting at least one layer of the classical neural network; providing a quantum machine learning model; building a training dataset by inferring the classical neural network, using an inference dataset, such that the training dataset comprises entries, each entry of the entries comprising an input that is received by the selected at least one layer and an output that is provided by the selected at least one layer in response to receiving the input during the inference; training the quantum machine learning model using the training dataset; replacing the selected at least one layer of the classical neural network by the quantum machine learning model; controlling a hybrid classical and quantum computing system (100) for executing a hybrid classical-quantum machine learning model that resulted from the replacing.

18. A computer program product for executing a trained classical neural network, the classical neural network comprising multiple layers, the computer program product comprising instructions for causing a computer system for performing at least the following: selecting at least one layer of the classical neural network; providing a quantum machine learning model; building a training dataset by inferring the classical neural network, using an inference dataset, such that the training dataset comprises entries, each entry of the entries comprising an input that is received by the selected at least one layer and an output that is provided by the selected at least one layer in response to receiving the input during the inference;training the quantum machine learning model using the training dataset; replacing the selected at least one layer of the classical neural network by the quantum machine learning model; controlling a hybrid classical and quantum computing system for executing a hybrid classical-quantum machine learning model that resulted from the replacing.

Citation Information

Patent Citations

  • Classical neural network with selective quantum computing kernel components

    US20200285947A1