Method for training classifier and quantum computing system
By training a classifier on a quantum computer, using parameterized quantum gates and reading qubit measurements, the problem of low efficiency in the classification of quantum states in the prior art is solved, and efficient classification of classical and quantum states is achieved, which is suitable for the near-term Application of quantum processors.
Patent Information
- Application Number
- CN202411066156.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2018-01-18
- Filing Date
- 2019-01-16
- Publication Date
- 2024-12-06
AI Technical Summary
Existing machine learning methods are difficult to effectively utilize the advantages of quantum computing in classification tasks, especially when dealing with quantum states other than classical states, and lack a general framework for quantum processors that are available in the near future.
The method of training a classifier on a quantum computer is to prepare multiple qubits, apply parameterized quantum gates to perform unitary transformation, convert the input state to the output state, and determine the prediction classification by reading the qubit measurement, which is updated compared to the classical method The quantum gate is parameterized to reduce sample loss and the parameters are adjusted using the gradient descent method.
It realizes efficient classification of classical and quantum states on quantum computers, provides a general framework suitable for recent quantum processors, can handle tasks that classical artificial neural networks cannot handle, and improves classification accuracy and efficiency.
Smart Images

Figure CN119090021A_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application with the application date of January 16, 2019, application number 201980009225.4, and invention name “Classification using quantum neural networks”. Technical Field
[0002] The present disclosure relates to a classification method that can be implemented on a quantum computing system. The present disclosure also relates to a quantum computing system. Background Art
[0003] Quantum computers are computing devices that exploit quantum superposition and entanglement to solve certain types of problems faster than classical computers. The building block of a quantum computer is the qubit. A qubit is actually a two-level system whose state can be in a superposition of its two states, rather than just in either of the two states like a classical bit.
[0004] Classical machine learning is the field of study in which one or more classical computers learn to perform classes of tasks using feedback generated from experience gained or data collected during the computer's performance of those tasks by machine learning processes. Summary of the invention
[0005] Various embodiments of the invention include methods and systems, which are characterized by what is stated in the independent claims. Various embodiments of the invention are disclosed in the dependent claims.
[0006] According to a first aspect, the specification describes a method of training a classifier implemented on a quantum computer, the method comprising: preparing a plurality of qubits at an input state having a known classification, the plurality of qubits including one or more readout qubits; applying one or more parameterized quantum gates to the plurality of qubits to transform the input state into an output state; determining a predicted classification of the input state using a readout state of the one or more readout qubits at the output state; comparing the predicted classification to the known classification; and updating one or more parameters of the parameterized quantum gates based on the comparison of the predicted classification to the known classification.
[0007] The method may also include iterating until one or more threshold conditions are met.
[0008] The method may also include: determining a readout state of the one or more readout qubits, wherein determining the readout state comprises repeatedly: preparing the plurality of qubits at an input state; applying a parameterized quantum gate to the input state; and measuring the readout state of the one or more readout qubits. Where θ is a parameter of the parameterized quantum gate, and Σ is a generalized Pauli operator acting on one or more qubits in the plurality of qubits.
[0009] Comparing the predicted classification to the known classification can include determining an estimated sample loss.
[0010] Updating one or more parameters may include modifying the parameters to reduce the estimated sample loss.
[0011] The method may include using a gradient descent method to modify one or more parameters.
[0012] Parameterized quantum gates can each implement a parametric unitary transformation.
[0013] Each of the parameterized quantum gates may include one of: a single-qubit quantum gate; a two-qubit quantum gate; or a three-qubit quantum gate.
[0014] One or more of the quantum gates can implement unitary transformations of the following form:
[0015] exp(iθ∑),
[0016] where θ is the parameter of the parameterized quantum gate and Σ is the generalized Pauli operator acting on one or more of the multiple qubits.
[0017] The input state may include a superposition of binary strings.
[0018] The input state can include arbitrary quantum states.
[0019] The method may include preparing input states using a classical artificial neural network.
[0020] The method may include determining a classifier from the readout states using a classical artificial neural network.
[0021] The method may also include applying one or more parameterized unitary operators to transform the plurality of qubits from an unclassified input state to a classified output state; determining a readout state based on a measurement of one or more readout qubits in the classified output state; and classifying the unclassified input state based on the readout state.
[0022] According to a second aspect, the specification describes a method of classification performed using a quantum computer, the method comprising: applying one or more parameterized unitary operators to transform a plurality of qubits from an input state to an output state, determining parameters of one or more parameterized quantum gates using the classifier training method of the first aspect; determining a readout state based on a measurement of one or more readout qubits at the output state; and classifying the input state based on the readout state.
[0023] According to a third aspect, the present specification describes a quantum computing system, comprising: a plurality of qubits; and one or more parameterized quantum gates, wherein the system is configured to perform the method described in any one of the aspects described herein.
[0024] According to a fourth aspect, the specification describes a quantum computing system comprising: a plurality of qubits; and one or more parameterized quantum gates, wherein the system is configured to: prepare the plurality of qubits at an input state having a known classification, the plurality of qubits including one or more readout qubits; apply the one or more parameterized quantum gates to the plurality of qubits to transform the input state into an output state; determine a predicted classification of the input state using the readout state of the one or more readout qubits at the output state; compare the predicted classification to the known classification; and update one or more parameters of the parameterized quantum gate based on the comparison of the predicted classification to the known classification.
[0025] According to a fifth aspect, the specification describes a quantum computing system comprising: a plurality of qubits; and one or more parameterized quantum gates, wherein the system is configured to: apply one or more parameterized unitary operators to transform the plurality of qubits from an unclassified input state to a classified output state, determine parameters of the one or more parameterized quantum gates using a classifier trained using a method comprising the following steps, the method comprising: preparing a plurality of qubits at an input state having a known classification, the plurality of qubits including one or more readout qubits; applying the one or more parameterized quantum gates to the plurality of qubits to transform the input state to an output state; determining a predicted classification of the input state using a readout state of the one or more readout qubits at the output state; comparing the predicted classification to the known classification; and updating one or more parameters of the parameterized quantum gates based on the comparison of the predicted classification to the known classification; determining a readout state based on a measurement of the one or more readout qubits at the classified output state; and classifying the unclassified input state based on the readout state.
[0026] According to another aspect, the specification describes a method for training a classifier, the method comprising: preparing, by a quantum computer, a plurality of qubits in an input state having a known classification, the plurality of qubits including one or more readout qubits, the preparing comprising preparing the input state using a first classical artificial neural network; applying, by the quantum computer, one or more parameterized quantum gates to the plurality of qubits to transform the input state into an output state; determining a predicted classification of the input state using a readout state of the one or more readout qubits in the output state and a second classical artificial neural network; comparing the predicted classification to the known classification; and updating one or more parameters of the parameterized quantum gates based on the comparison of the predicted classification to the known classification.
[0027] According to another aspect, the specification describes a method of classification performed using a quantum computer, the method comprising: applying one or more parameterized quantum gates to transform a plurality of qubits from an input state to an output state, wherein parameters of the one or more parameterized quantum gates have been determined using a classifier training method, the method comprising: preparing a plurality of qubits in an input state having a known classification by a first classical artificial neural network; applying the one or more parameterized quantum gates to the plurality of qubits to transform the input state to the output state; determining a predicted classification of the input state using a readout state of the plurality of qubits in the output state and a second classical artificial neural network; and updating parameters of the one or more parameterized quantum gates based on a comparison of the predicted classification with the known classification; determining a readout state from a measurement of the one or more readout qubits in the output state; and classifying the input state based on the readout state.
[0028] According to another aspect, the specification describes a system comprising: a quantum computing system comprising a plurality of qubits and one or more parameterized quantum gates; and a classical computing system comprising a plurality of artificial neural networks; wherein the system is configured to perform operations for training a classifier on a quantum computer, the operations comprising: preparing a plurality of qubits in an input state having a known classification, the plurality of qubits comprising one or more readout qubits, the preparing comprising preparing the input state using a first classical artificial neural network; applying the one or more parameterized quantum gates to the plurality of qubits to transform the input state into an output state; determining a predicted classification of the input state using the readout state of the one or more readout qubits in the output state and a second classical artificial neural network; comparing the predicted classification to the known classification; and updating one or more parameters of the parameterized quantum gates based on the comparison of the predicted classification to the known classification.
[0029] According to another aspect, the specification describes a quantum computing system, comprising: a plurality of qubits; and one or more parameterized quantum gates, wherein the system is configured to: apply the one or more parameterized quantum gates to transform the plurality of qubits from an input state to an output state, wherein parameters of the one or more parameterized quantum gates have been determined using a classifier training method, the method comprising: preparing, by a first classical artificial neural network, a plurality of qubits in an input state having a known classification; applying the one or more parameterized quantum gates to the plurality of qubits to transform the input state to an output state; determining a predicted classification of the input state using a readout state of the plurality of qubits in the output state and a second classical artificial neural network; and updating parameters of the one or more parameterized quantum gates based on a comparison of the predicted classification with the known classification; determining a readout state from a measurement of the one or more readout qubits in the output state; and classifying the input state based on the readout state. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] For a more complete understanding of the methods, devices and systems described herein, reference is now made to the following drawings, in which:
[0031] Figure 1 An illustrative example of a classification method performed using a quantum computer according to an embodiment is shown;
[0032] Figure 2 A flowchart showing a method for training a classifier using a quantum computer according to an embodiment;
[0033] Figure 3 A flowchart illustrating an example of a method for updating quantum gate parameters using gradient descent according to an embodiment;
[0034] Figure 4 A flow chart showing a method for classifying quantum states according to an embodiment; and
[0035] Figure 5a and Figure 5b A classification system including classical artificial neural network and quantum neural network classifiers according to an embodiment is shown. DETAILED DESCRIPTION
[0036] Figure 1 A schematic overview showing the operation of a classification system implemented using a quantum computer.
[0037] The classification method is performed using a quantum computing system 100 including a plurality of qubits 102. Qubits 102 may be, for example (the following is a non-exhaustive list) superconducting qubits (e.g., "Xmon" or "Gmon" qubits), quantum dots, ionized atoms in ion traps, or spin qubits. Qubits 102 may be maintained at a sufficiently low temperature to maintain coherence between qubits throughout the execution of the quantum algorithm. In embodiments using superconducting qubits, the temperature is maintained below the superconducting critical temperature. In some embodiments, plurality of qubits 102 may include one or more auxiliary qubits (not shown) for storing entangled quantum states.
[0038] The quantum computing system 100 also includes one or more parameterized quantum gates 104 for implementing one or more parameterized unitary transformations U on the plurality of qubits 102. l (θ l) (also referred to herein as "unitary"). Quantum gate 104 comprises a quantum circuit that operates on one or more qubits 102 to perform a logic operation. A non-exhaustive list of quantum gates 104 includes a Hadamard gate, a C-not gate, a phase-shift gate, a Toffoli gate, and / or a controlled U gate. Each quantum gate 104 acts on an input state 106 or an output of a previous quantum gate 104 in sequence. Parameterized quantum gates 104 act on multiple qubits 102 to change the state of multiple qubits 102. In the example shown, L quantum gates 104 are applied to input state 106 in sequence, each quantum gate transforming the state of multiple qubits 102.
[0039] The system is configured to learn parameters of a quantum gate 104 that, when applied to an input state |ψ,m>106 comprising a state to be classified |ψ>108 and one or more readout qubits |m>110, produces an output state 112 from which a predicted classification l′(z) 114 (also referred to herein as a predicted labeling function or predictor) of the state to be classified |ψ>106 can be determined. Measurements are performed on one or more readout qubits 110 of the plurality of qubits 102 to determine a predicted classification 114 of the input state 106 from the output state 112. Figure 1 In the illustrated embodiment, only one readout qubit 110 is used, resulting in a binary prediction classifier. However, in general, other types of classifiers may be implemented using any number of readout qubits 110. The qubit representing the state 108 to be classified may be referred to as a "data qubit".
[0040] The system 100 uses supervised learning to learn parameters of a quantum gate 104 that can obtain a predicted classification l'(z) 114 of an input state 106. A sample state 108 with a known classification l(z) (also referred to herein as a labeling function) is selected from a sample data set S for supervised learning, and an input state 106 including the sample state 108 and one or more readout qubits 110 is prepared. Starting with an initial set of parameters for the quantum gate 104, one or more quantum gates 104 are applied to a first selected input state 106 to generate an output state 112. The state of the one or more readout qubits 110 of the output state 112 is measured to determine a predicted classifier 114 for the sample state 108. The predicted classifier 114 is compared to the known classification of the sample state 108, for example using a sample loss function, and the comparison is used to update the parameters of the quantum gate 10.
[0041] Each time, another sample state 108 with a known classification selected from the training data set S is used to iterate the process until a predetermined threshold condition is met. The parameters of the obtained quantum gate 104 can be used in a quantum computer to implement a classification method for unclassified states. Similar to classical artificial neural networks, the trained quantum classifier can be described as a "quantum neural network".
[0042] Contrary to previous proposals for machine learning on quantum computers, the systems and methods described herein do not require the use of specialized quantum versions of classical artificial neural networks "perceptrons". Furthermore, the methods and systems described herein can be implemented using recently available quantum computing systems. In contrast to classical artificial neural networks, which can only take classical states as input, the systems and methods described herein can accept two classical quantum states as input and classify them. The ability to classify input quantum states in this way is very useful in quantum metrology, where entangled quantum states are used to make high-resolution measurements.
[0043] In the near future, it is expected that quantum computers with gate models of sufficient fidelity will be available to run circuits of sufficient depth to perform tasks that cannot be simulated by classical computers. One approach to designing quantum algorithms to run on such devices is to let the architecture of the hardware determine the set of gates to be used. In contrast to previous work, the approach described in this paper establishes a general framework for supervised learning on quantum devices that is particularly suitable for implementation on near-term available quantum processors.
[0044] Figure 2 A flow chart of a method for training a classifier implemented on a quantum computer according to an embodiment is shown.
[0045] In operation 2.1, provide the initial parameter set of the quantum gate for use with quantum gate 104. The initial set of parameters may be selected, for example, randomly or based on some predefined condition or best guess.
[0046] In some embodiments, the sequence of quantum gates 104 includes L unitary operators selected from some set of experimentally available unitary operators. The sequence of quantum gates 104 implements the unitary operator Given by:
[0047]
[0048] Here, is the parameter (θ L ,θ L-1 ,…θ1), U l (θ l ) is the unitary operator realized by the lth quantum gate.
[0049] Usually, each parameter θ l Multiple parameters may be included, for example in the form of vectors. In some embodiments, each quantum gate is characterized by a single scalar-valued parameter. In these embodiments, each quantum gate is parameterized by a single parameter.
[0050] In some embodiments, quantum gate 104 implements a unitary operator of the form:
[0051] U I (θ l )=exp(iθ l ∑ l )
[0052] where Σ is a generalized Pauli operator acting on one or more qubits. In other words, Σ is an operator from the set {σ x ,σ y ,σ z}. This form of operator is bounded by 1 with respect to the parameter θ l has a gradient. Therefore, as described below, The gradient of the sample loss function will be bounded, avoiding the problems associated with gradient amplification during training of classical artificial neural networks.
[0053] Quantum gate 104 may be implemented in a variety of ways, depending on, for example, the type of qubit 102 used by the system. For example, in a system based on superconducting qubits, an intermediate electrically coupled circuit or a microwave cavity may be used to implement the quantum gate. In a trapped spin-based quantum computer, an example method of implementing a quantum gate includes applying radio frequency pulses to the qubits and utilizing spin-spin interactions to implement a multi-qubit gate.
[0054] At operation 2.2, an n-qubit sample state |ψ>108 having a known classification is selected from a training data set S. The training data set S includes a plurality of sample states 106, each having a known classification. The selected sample state |ψ>108 is then prepared at operation 2.3 in an input state 106 including the selected sample state 106 and one or more readout qubits 110. The readout qubit 110 may be prepared in a known state. For example, the input state 106 may be prepared in the following form:
[0055] |in>=|ψ,m〉
[0056] Here, m represents m readout qubits 110 prepared in a known state.
[0057] At operation 2.4, a sequence of parameterized quantum gates 104 is applied to the selected input state 106 using the current set of parameters. The sequence of quantum gates 104 transforms the plurality of qubits 102 from the input state 106 to the output state 112 by applying a unitary transformation.
[0058] At operation 2.5, the readout state of one or more readout qubits 110 is measured. For example, one or more Pauli operators may be measured on one or more readout qubits 110. In some embodiments, repeated measurements are performed on readout qubits 110 to determine the readout state. To perform repeated measurements, operations 2.3 to 2.5 are repeated a predetermined number of times. In other words, the method includes: repeatedly preparing a plurality of qubits in input state 106; applying parameterized quantum gate 104 to input state 106; and measuring the readout state of one or more readout qubits.
[0059] At operation 2.6, a predicted classifier l'(z) 114 is determined based on the measurement of the one or more readout qubits 110. In some embodiments, predicted classifier 108 may be the state of the one or more readout qubits 110. For example, in a binary classifier, the measurement result of the Pauli operator on the readout qubit 110 may directly provide predicted class 114. In other embodiments, predicted classifier 114 may be a function of the readout state of the one or more readout qubits 110.
[0060] At operation 2 . 7 , the predicted classifier 114 for the input state 106 is compared to the known classifier for the input state 106 .
[0061] A metric can be used to compare the predicted classifier 114 to a known classifier. For example, a sample loss function (or loss function) can be used to compare the predicted classifier 114 to a known classifier. The sample loss function provides a "cost" for a known classification and a predicted classification that do not match. The sample loss function can, for example, be a function that has a minimum value when the predicted classifier 114 matches the known classifier. In these examples, the goal of the training method can be to reduce the average sample loss on the training set to below a threshold.
[0062] There are many examples of sample loss functions that can be used to compare known classifications to predicted classifications 114. For example, for a binary classifier l(ψ) that classifies input states as +1 or -1, and where a single readout qubit is initially set to 1 on a computational basis, an example sample loss that can be used is given by:
[0063]
[0064] Among them, Y n+1 is the σ acting on the readout qubity Since the predicted labeling function (in this example, It is bounded between -1 and 1, so the minimum value of the sample loss is zero.
[0065] At operation 2.8, a threshold condition is checked. The threshold condition is a condition used to determine when to stop the training process. The threshold condition may include one or more of the following: a limit on the number of iterations of operations 2.2 to 2.8; a threshold error rate for the validation state set; and / or a parameter One or more convergence criteria for .
[0066] At operation 2.9, if the threshold condition is not met, one or more parameters of the quantum gate 106 are updated based on a comparison of the predicted classifier 108 of the input state 106 with the known classifier of the input state 106.
[0067] In some embodiments, a gradient descent method is used to compare the predicted classifier of the input state 106 with the known classifier of the sample state 108 and update the parameters. Figure 3 A flow chart showing an example of a method for updating parameters using gradient descent.
[0068] At operation 3.1, the sample loss is estimated. To estimate the sample loss, one or more readout qubits 110 in the output state 112 are repeatedly measured, and the sample loss is calculated based on the measurement results. Copies of the initial state 106 are repeatedly prepared and acted upon by the quantum gate 104 to produce copies of the output state 112, and the readout qubit 110 of each copy of the output state 112 is measured. In order to estimate the sample loss to within δ of the true sample loss with a probability of 99%, the readout state is subjected to at least 2 / δ 2 Measurements.
[0069] In operation 3.2, one of the unitary gate parameters is changed by a small value. The resulting parameter set With the original parameter set A small amount is different in one component. The small amount may be, for example, a predetermined small amount. Alternatively, the small amount may be randomly selected from a range of values, for example.
[0070] At operation 3.3, a new sample loss with a changed parameter is determined. To this end, repeated measurements of one or more readout qubits 110 are performed in the output state A copy of the initial state 106 is prepared and acted upon by a quantum gate 104 to generate a copy of the output state 112, since the "no cloning theorem" prohibits direct copying of the output state; the readout qubit 110 of each copy is measured.
[0071] The gradient of the sample loss with respect to the varying component can then be calculated in operation 3.4. For example, a finite difference method can be used to determine the gradient.
[0072] At operation 3.5, if the gradient of the sample loss has not been calculated with respect to at least one of the parameters, the method returns to operation 3.2 and repeats operations 3.2 to 3.5, each time changing a different parameter. In general, for L parameters, these steps are repeated L times to obtain the gradient of the sample loss with respect to The full gradient estimate
[0073] In operation 3.6, the parameters are updated according to the estimated gradient. Given the estimated gradient By along For example, the following formula can be used to update the parameters:
[0074]
[0075] Where r<1 is the “learning rate”. The learning rate can be a fixed number. In some embodiments, the learning rate varies as the learning progresses.
[0076] Refer again Figure 2 , if the threshold condition is not met, once one or more parameters are updated, the method returns to operation 2.2 and selects another training example (i.e., another sample state 108 with a known classification) and performs operations 2.3 to 2.8 using the updated parameters of the quantum gate 104. In an embodiment where a limit on the number of iterations is used as a threshold condition, the iteration count is increased by one.
[0077] If the threshold condition is met, then the updated parameters are stored and / or output at operation 2.10. These "trained" parameters can be used to implement classification methods on a quantum computer, such as Figure 4 described.
[0078] Figure 4 A flowchart showing a classification method implemented on a quantum computer. The method can be used by Figures 1 to 3 The classification method can be used as a standalone method for classifying input states. Alternatively, the classification method can be used as a subroutine in an algorithm implemented at least in part on a quantum computer. In some embodiments, the classification method can be considered a single pass through the training method, but without any comparison to known classifications or any updates to the weights of the parameterized quantum gates 104. The method can be implemented on a quantum computing system, such as a computer program product. Figure 1 A quantum computing system 100 is described.
[0079] At operation 4.1, an unclassified input state is received. The unclassified input state includes a plurality of qubits 102. The plurality of qubits 102 includes n qubits representing a quantum state 108 to be classified, and one or more readout qubits 110 in a known state. In some embodiments, the quantum state is received from a routine running on a quantum or classical computer and / or experimental equipment. Many other examples are possible. In some embodiments, the method includes preparing an input state 106 based on the received quantum state 108 to be classified.
[0080] At operation 4.2, a plurality of parameterized quantum gates 104 are applied to the input state 106 to transform the input state 106 into the output state 112. Figures 1 to 3 Any of the methods described trains the parameters of the parameterized quantum gate 104 .
[0081] Quantum gate 104 may be implemented in a variety of ways, depending on, for example, the type of qubit 102 used by the system. For example, in a system based on superconducting qubits, an intermediate electrically coupled circuit or a microwave cavity may be used to implement the quantum gate. In a trapped spin-based quantum computer, an example method of implementing a quantum gate includes applying radio frequency pulses to the qubits and utilizing spin-spin interactions to implement a multi-qubit gate.
[0082] In some embodiments, the quantum gates 104 used during the classification method are of the same type and implement the same unitary operation as the quantum gates 104 used in the training method. In other embodiments, the quantum gates 104 used during the classification method are of a different type, although still implementing the same unitary operation as the quantum gates 104 used in the training method using the same parameters.
[0083] At operation 4.3, a readout state of one or more readout qubits 110 is measured. For example, one or more Pauli operators may be measured on one or more readout qubits 110. In some embodiments, the readout state is repeatedly measured to increase the accuracy of the readout state. Repeatedly measuring the readout state includes, for example, applying parameterized quantum gate 104 to a copy of input state 106 to generate output state 112; and measuring the readout state of one or more readout qubits 110 at output state 112.
[0084] At operation 4.4, the quantum state to be classified is classified according to the measured readout state. In some embodiments, the classification is provided directly by the measurement in the readout state. For example, in a binary classifier, a readout state of 1 or -1 can correspond to a classification. In other embodiments, the classification is provided by a function of the measured readout state.
[0085] By way of illustration, several example embodiments and applications will now be described. For convenience, each of these examples is described with respect to binary classification and using a single readout qubit, but it will be appreciated that the methods and systems can be extended to non-binary classification. For example, multiple readout qubits can be used to classify an input state into one or more of a plurality of possible classifications.
[0086] In some embodiments, the system is configured to learn to classify classical binary states. The input state is taken from the set of binary strings z=z1z2…z n , where each z i is a binary digit. For example, each binary digit can take on a value of ±1. In addition, each binary digit can take on a value of 0 or 1. For a binary string of length n, there are 2 n The training data set includes a subset of possible binary strings, each with a known classification l(z), which in this example is treated as a binary label. The classification can represent, for example, subset majority or subset parity.
[0087] During training, select string z from the training dataset 1 A plurality of qubits 102 are prepared in input state 106 to represent a selected string. For example, input state 106 representing a string may be an n+1 qubit state prepared in a computational basis state:
[0088]
[0089] Where m is a readout qubit prepared in a known state. For example, a readout qubit 10 may be prepared in one of the binary states ±1.
[0090] The goal of training is to make the measurement of the property of the readout qubit in the output state correspond to the binary classifier l(z). For example, the quantum gate can be trained so that the measurement of the Pauli operator on the readout qubit 110 (whose possible values are ±1) predicts the classification of the input string z. In the following, although σ y is used as an example of a Pauli operator, but σ can alternatively be used x or z .
[0091] A sequence of parameterized quantum gates 106 is then applied to the input state 106 to generate an output state 112 given by
[0092]
[0093] As mentioned above Figure 2 As mentioned above. yIn an embodiment of the measurement operator used as a read qubit of the output state, the sample loss function is of the form
[0094]
[0095] The sample loss function of the above form can be used to train the parameters
[0096] Before discussing the specific example of applying our method to binary strings, it will be established that quantum neural networks are able to express any two-valued labeling function, albeit at a potentially high cost in circuit depth. n n-bit strings, so we have possible binary labeling functions l(z). Given a labeling function, consider an operator whose operation is defined as follows on the computational basis state:
[0097]
[0098] Among them, X n+1 is the σ acting on the readout qubit x Operator. By rotating the readout qubit string z Correspondingly:
[0099]
[0100] Here, l(z) is interpreted as the operator diagonal in the computational basis. For a binary classifier, since l(z) is +1 or -l, it can be seen that:
[0101]
[0102] This suggests that, at least at some level of abstraction, there is a way to represent any labeling function using quantum circuits.
[0103] U l can be written as the product of two qubit units (i.e. implemented by a sequence of two-qubit quantum gates). For this discussion, it is convenient to switch to a Boolean variable The labeling function l(z) is considered as (1-2B), where the value of B is 0 or 1. Then, according to the bits b1 to b n The Reed-Muller representation of the general B function can be written as:
[0104]
[0105] Addition is mod2, and the coefficient a is either 0 or 1. Note that there is 2 n coefficients, and since each coefficient can have a value ±1, this represents Boolean functions. The formula can be exponentially long.
[0106] Then, depending on the marked unitary U l can be written as:
[0107]
[0108] Viewed as an operator, we see that every term in the Reed-Muller representation of B can be commuted with every other term by computing the diagonal of the basis z. l Each term in B is multiplied by X n+1 , so each term can be exchanged with any other term. Every non-zero term in the Reed-Muller representation is in U l , which results in a controlled bit flip on readout qubit 110. To illustrate this using an example, consider a three-bit term involving bits 2, 7, and 9. This corresponds to the operator:
[0109]
[0110] This is the identity, unless b2=b7=b9=1, in which case it is -iX n+1 Any controlled single-qubit unitary acting on qubit n+1 (where the first n bits are controlled) can be written as n 2 Thus, the labeling function expressed in terms of the Reed-Muller formula with RM terms can be written as the product of RM commutative n+1 qubit operators, and each of these can be written as n 2 This quantum representation result is similar to the classical representation theorem, which states that one can n Any Boolean labeling function can be represented on a neural network with an inner layer of depth 3. Of course, such a huge matrix cannot be represented on a conventional computer. In this case, the method is naturally performed in a Hilbert space of exponential dimension, but exponential circuit depth may be required to express some functions.
[0111] Now that the representation of binary functions has been demonstrated, several example embodiments will now be described.
[0112] In some embodiments, the marking function l(z) is a binary marking indicating the parity of a subset S of bits in the input binary string of length n. The Reed-Muller formula for the subset parity marking is:
[0113]
[0114] Among them, if bit b j In the subset, aj =1, and if bit b j If a is not in the subset j = 0. Add is mod 2. Then, an example unitary method for implementing subset parity check is given by:
[0115]
[0116] Among them, X n+1 is the Pauli operator σ acting on the readout qubit 110 x Here, due to Factors and X n+1 The circuit consists of a sequence of (at most) n swapping two-qubit gates 104, where the readout qubit is one of the two qubits on which each quantum gate 104 acts.
[0117] This unit can be learned using the training method described in this paper. The n parameter is unitary:
[0118]
[0119] To get started, use About Figure 1 The described method learns the best parameters if b j In the subset And if bit b j If it is not in the subset, then θ j = 0. As an example, working from 6 to 16 bits and with random θ j To begin with, using stochastic gradient descent, we can use much less than 2 n We use 10 samples to learn a subset parity labeling function, so that the function can successfully predict the labels of unseen examples. Introducing low levels of labeling noise (e.g., up to 10% labeling noise) does not hinder learning.
[0120] In some embodiments, the labeling function l(z) is a binary label indicating a subset of the bits in the input binary string of length n The majority of subsets In the z=±1 representation of the input string, if the majority of the bits in the subset are +1, then the subset majority is +1, otherwise it is -1. The subset majority can be written as:
[0121]
[0122] Among them, if bit b j In the subset, a j =1, and if bit b j If a is not in the subset j = 0. Consider unitary:
[0123]
[0124] Among them, X n+1 is the Pauli operator σ acting on the readout qubit 110 x , Z j is the Pauli operator σ acting on the jth qubit z , and β is defined below. Conjugated Y n+1 gives:
[0125]
[0126] Make
[0127]
[0128] item The maximum magnitude of is n, so if β is chosen so that it lies in the range 0 < β < π / n, for example 0.9π / n, then the subset majority will be:
[0129]
[0130] This means that even if the individual sample loss is not 1 or -1, the repeated measurements of Y n+1 And rounding the expected value up or down to ±1 can also lead to complete classification errors.
[0131] This unit can be learned using the training method described in this paper. The n parameter is unitary:
[0132]
[0133] To get started, use About Figure 1 The described method learns the best parameters if b j In the subset, θ j =β and if position b j If it is not in the subset, then θ j =0.
[0134] The embodiments described above provide examples of training and using a binary classifier. In general, a binary classifier can be trained to represent any binary function. The quantum gates 104 used can be limited to single-qubit unitary operators.
[0135] In some embodiments, the methods and systems can be used to train an image classifier. In these embodiments, a training set S includes a plurality of images labeled with known classifications. For example, in an embodiment of learning how to classify handwritten digits, the training set includes a plurality of examples of handwritten digits, each with a label corresponding to the digit that the handwritten digit is intended to represent. An example of such a dataset is the MNIST dataset, which includes 55,000 training samples, which are manually labeled 28x28 pixel images representing digits between 0 and 9.
[0136] The input state for image classification includes pixel data of the image being classified. For example, in a black and white image, each qubit in the input state can represent whether a pixel in the input image is black or white. In these examples, the input state can include n qubits representing n pixels of the image, and one or more readout qubits prepared in a known state. In some embodiments, the image being classified includes one or more components / channels, such as color data, brightness, and / or hue representing the image. In these embodiments, each pixel in each channel can be represented by a qubit in the plurality of qubits 102.
[0137] For image classification, the single-qubit quantum gate 104 is taken to be unitary, where Σ is an X, Y, and / or Z operator acting on any one qubit in the plurality of qubits 102. In general, the two-qubit gate is taken to be an XY, YZ, ZX, XX, YY, and / or ZZ operator acting between any pair of different qubits in the plurality of qubits 102.
[0138] In some embodiments, a predetermined number of parameterized gates 104 are randomly selected from the set of possible quantum gates 104. For example, between 500 and 1000 quantum gates may be selected for a binary image classifier. In some embodiments, the initial parameters of the quantum gates 104 may be randomly selected.
[0139] In some embodiments, the two-qubit quantum gate 104 used in image classification is limited to the ZX or XX type. In some of these embodiments, at least one of the two qubits operated by the two-qubit quantum gate is a readout qubit 110. Layers of quantum gates 104 of the same type can be alternated in a quantum computer. For example, a sequence of quantum gates may include alternating three layers of ZX quantum gates and three layers of XX quantum gates. Each layer may include multiple quantum gates. Each layer may include a two-qubit quantum gate operating between one or more readout qubits 110 and each other qubit in the plurality of qubits 102. For example, in a binary classifier, each layer may include n two-qubit quantum gates, each quantum gate acting between a readout qubit 110 and a different one of the n qubits representing the state to be classified.
[0140] Although the above embodiments have been described with respect to image classification, it will be appreciated that they are equally applicable to other classification types that receive character strings as input.
[0141] In contrast to classical artificial neural networks, the system described herein can accept quantum states (which means n-qubit states in arbitrary superpositions) as input. The system can be used to train a classifier for quantum states to classify quantum states based on labels related to the properties of the quantum states.
[0142] Some other embodiments will now be described. In the embodiments described below, a binary classifier of quantum states is used. However, by increasing the number of readout qubits, the method can be extended to other classification types including more than two classifications.
[0143] The input state 106 comprises n qubits representing the state |ψ> to be classified and one or more readout qubits 110. In the embodiments described below, one readout qubit is used and is set to a known initial state |1> on a computational basis, but other initial readout states may be used.
[0144] The binary classifier used in the examples described below corresponds to a Hamiltonian with state is the expected value of positive or negative. This is equivalent to determining whether some. Such classifiers can be useful in finding the minimum energy state of a system controlled by a particular Hamiltonian. For example, the classifier l(|ψ>) is given by
[0145]
[0146] Consider the operator
[0147] U H (β) = exp(iβHX n+1 )
[0148] Here, β is taken as a small positive number. Then
[0149]
[0150] For sufficiently small β, this is approximately
[0151] 2β<|H|ψ〉
[0152] The expected sign of our predicted labeling is therefore consistent with the true labeling. In this sense, the labeling function has been expressed by the quantum circuit with a small classification error. The error is due to the approximation taken for the small β expansion <ψ|sin(2βH)|ψ>. However, the error can be made small if we make β much smaller than the inverse of the H norm.
[0153] For example, consider a graph where on each edge we have a ZZ coupling with a coefficient of +1 or -1 chosen randomly
[0154]
[0155] where the sum is limited to the edges in the graph and J ij is +1 or -1. Suppose there are M terms in H. We can first pick M angles ij and consider circuits that implement unitary units of the form:
[0156]
[0157] When θ ij =βJ ij , this unit will provide a marking function. Figures 1 to 3 The above method learns these weights.
[0158] The quantum state |ψ> exists in 2 n dimensional Hilbert space, so in some embodiments, the quantum states are restricted to those that can be built by applying a few qubits to some simple direct product states. In some embodiments, the training states are restricted to this form.
[0159] For example, eight data qubits and one readout qubit can be trained to classify three regular graphs (which have 12 edges, respectively). In this example, there are twelve parameters θ ij Sequence for forming quantum gate 102 The training state can be a direct product state that depends on eight random angles. States can be formed by rotating each of the eight qubits about the y-axis by an associated random angle, each starting as an eigenstate of the associated X operator. Test states are formed in the same way. Since states are randomly selected from a continuum, there is a high probability that the training set and the test set are different. After being presented with about 1,000 test states, the quantum network correctly labeled 97% of the test states.
[0160] In some embodiments, the class of unitary can include more parameters. For example, a two-layer unitary, where ∑ is XX and ZX, where the first operator acts on one of the eight data qubits and the second operator acts on the readout qubit 110. In the example using three canonical graphs as input, the learning process can achieve less than 3% classification error after seeing about 1000 training examples.
[0161] In some embodiments, the ability of quantum systems to accept quantum states as input can be used to enhance the training of classifiers for traditional input states. For example, with quantum neural networks, the input states can include superpositions of traditional data. A single quantum state is a superposition of computational basis states, each state representing a single sample in a batch of samples, and a single quantum state can be viewed as a quantum encoding of the batch. Here, different phases on the components produce different quantum states.
[0162] For example, consider binary classification. The sample space can be divided into samples labeled +1 and samples labeled -1. Consider the state
[0163]
[0164] and
[0165]
[0166] Among them, N + and N - is the normalization factor, is the phase. In some examples, all phases are set to zero. Each of these states can be viewed as a batch containing all samples with the same label. Returns the equation that gives the unitary associated with any labeling function. Note that the expectation value of this operator for the state |+1> is +1, while the expectation value for the state |-1> is -1. This is because the unitary is diagonal in the computational basis of the data qubits, so the cross terms vanish and the phase is irrelevant. Now consider the unitary that depends on the parameter It is the diagonal in the computational basis of the data qubit. The state Y obtained by applying this operator to |+1> n+1 The expected value of is the average over all samples of the label +1 in the predicted label value of the quantum neural network. For the state |-1>, the state Y obtained by applying this operator to |-1> n+1 The expected value of is the average of all samples with label -1 in the predicted label value of the quantum neural network. In other words, if In the computational basis of the data qubits being diagonal, then
[0167]
[0168] is the empirical risk of the entire sample space. If we can find a parameter that makes it equal to 0 Then the quantum neural network will correctly predict the label of any input in the training set.
[0169] In some embodiments, a set of gates that are diagonals on the basis of computations on data qubits is used. Examples of such sets are the generalized Pauli operators ZX and ZZX, where the Z operator acts on the data qubits and the X operator acts on the readout. Using these gates, the empirical risk formula is the empirical risk of a complete data set for a quantum neural network. The empirical risk can be used as a sample loss function to train the parameters of a quantum neural network. Starting from a random choice of parameters, a minimization algorithm (such as gradient descent) can be used to reduce the empirical risk.
[0170] In some embodiments, the gate set may extend beyond those diagonals of the computational basis for the data qubits.
[0171]
[0172] It can no longer be directly understood as the empirical risk of the quantum neural network acting on the entire sample space. However, driving it to a low value at least means that the states |+1> and |-1> are correctly labeled.
[0173] Figure 5a and Figure 5b An example of a quantum neural network classifier used in combination with a classical artificial neural network is shown. In general, the classification method implemented on the quantum computing system 100 as described herein can be combined with one or more classical artificial neural networks 116. This can improve the accuracy of the classification method.
[0174] A classical artificial neural network 116 includes multiple layers of "neurons" 118, each neuron having connections 120 to one or more neurons in each adjacent layer. In the example shown, the classical artificial neural network 116 has three layers, although fewer or greater numbers of layers are possible. These examples also show fully connected layers, where each neuron 118 is connected to every neuron in an adjacent layer, although partially connected networks are also possible.
[0175] Each neuron 118 accepts one or more inputs and outputs a function of the inputs represented by one or more weights associated with each input. These weights can be trained using standard machine learning techniques to produce the desired output from the neural network 116.
[0176] In some embodiments, the state 108 to be classified is input into a classical artificial neural network 116. The output of the classical artificial neural network 116 can be used as an input to the quantum computing system 100 to generate the input state 106 to be classified according to the above method. An example of such an embodiment is Figure 5a Shown in.
[0177] In some embodiments, the readout states from the readout qubits 110 in the quantum computing system 100 are input into the classical artificial neural network 116. The classical artificial neural network can be trained to determine the predicted classification of the input state using the readout states of the output states of one or more readout qubits in the plurality of qubits. Examples of such embodiments are described in Figure 5b Shown in.
[0178] The implementation of quantum subject matter and quantum operations described in this specification can be implemented in appropriate quantum circuits or more generally in quantum computing systems, including the structures disclosed in this specification and their structural equivalents, or in a combination of one or more of them. The term "quantum computing system" can include, but is not limited to, a quantum computer, a quantum information processing system, a quantum cryptographic system, or a quantum simulator.
[0179] The terms quantum information and quantum data refer to information or data carried, held or stored by a quantum system, wherein the smallest non-trivial system is a qubit, e.g., a system defining a unit of quantum information. It is understood that the term "qubit" encompasses all quantum systems that can be appropriately approximated as a two-level system in the corresponding context. Such a quantum system may include, for example, a multi-level system having two or more levels. For example, such a system may include atoms, electrons, photons, ions, or superconducting qubits. In many implementations, the computational basis states are identified as the ground state and the first excited state, but it is understood that other arrangements for identifying computational states with higher-order excited states are also possible. It is understood that a quantum memory is a device that can store quantum data for a long time with high fidelity and efficiency, such as a light-matter interface, where light is used for transmission and matter is used to store and preserve quantum features of quantum data, such as superposition or quantum coherence.
[0180] Quantum circuit elements can be used to perform quantum processing operations. That is, quantum circuit elements can be configured to exploit quantum mechanical phenomena such as superposition and entanglement to perform operations on data in an uncertain manner. Specific quantum circuit elements such as qubits can be configured to represent information in more than one state at the same time and operate on it. Examples of superconducting quantum circuit elements that can be formed using the processes disclosed herein include circuit elements such as coplanar waveguides, quantum LC oscillators, qubits (e.g., flux qubits or charge qubits), superconducting quantum interference devices (superconducting quantum interference device, SQUID) (e.g., RF-SQUID or DCSQUID), inductors, capacitors, transmission lines, ground planes, etc.
[0181] In contrast, classical circuit elements typically process data in a deterministic manner. Classical circuit elements can be configured to collectively execute instructions of a computer program by performing basic arithmetic, logic, and / or input / output operations on data, where the data is represented in analog or digital form. In some implementations, classical circuit elements can be used to send data to and / or receive data from quantum circuit elements via electrical or electromagnetic connections. Examples of classical circuit elements that can be formed using the processes disclosed herein include rapid single flux quantum (RSFQ) devices, reciprocal quantum logic (RQL) devices, and ERSFQ devices, which are energy-efficient versions of RSFQ that do not use bias resistors. Other conventional circuit elements can also be formed using the processes disclosed herein.
[0182] During operation of a quantum computing system using superconducting quantum circuit elements and / or superconducting classical circuit elements, such as the circuit elements described herein, the superconducting circuit elements are cooled within a cryostat to a temperature that allows the superconducting material to exhibit superconducting properties.
[0183] Although this specification contains many specific implementation details, these details should not be interpreted as limitations on the scope of the claimed protection, but should be regarded as descriptions of features specific to a specific implementation. Specific features described in this specification in the context of separate implementations may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented in multiple implementations or in any appropriate sub-combination. In addition, although features may be described above as working in certain combinations and even initially claimed as such, in some cases, one or more features in the claimed combination may be removed from the combination, and the claimed combination may be directed to a sub-combination or a variant of a sub-combination.
[0184] Similarly, although operations are depicted in a particular order in the accompanying drawings, this should not be understood as requiring that such operations be performed in the particular order shown or in a sequential order, or that all of the operations shown be performed, in order to obtain the desired results. For example, the actions recited in the claims can be performed in a different order and still achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the division of the various components in the above implementations should not be understood as requiring such division in all implementations.
[0185] A number of implementations have been described. However, it will be appreciated that various modifications may be made without departing from the spirit and scope of the invention. Other implementations are within the scope of the following claims.
Claims
1. A method for training a classifier, the method include: preparing, by a quantum computer, a plurality of qubits in input states having a known classification, the plurality of qubits including one or more readout qubits, the preparing comprising preparing the input states using a first classical artificial neural network; Applying one or more parameterized quantum gates to the plurality of qubits by a quantum computer to transform an input state into an output state; determining a predicted classification of the input state using a readout state of one or more readout qubits in the output state and a second classical artificial neural network; comparing the predicted classification to the known classification; and Based on the comparison of the predicted classification with the known classification, one or more parameters of the parameterized quantum gate are updated.
2. The method according to claim 1, further comprising: include: Iterates the prepare, apply, determine, compare, and update operations until one or more threshold conditions are met.
3. The method according to claim 2, further comprising: include: determining a readout state of the one or more readout qubits, wherein determining the readout state comprises repeatedly: preparing a plurality of qubits in an input state; Applying parameterized quantum gates to input states; and A readout state of one or more readout qubits is measured.
4. The method according to claim 1, in, Comparing the predicted classification to the known classification includes determining an estimated sample loss.
5. The method according to claim 4, in, Updating one or more parameters includes modifying the parameters to reduce the estimated sample loss.
6. The method of claim 5 further comprising modifying one or more parameters using a gradient descent method.
7. The method according to claim 1, in, Each of the parameterized quantum gates implements a parameter unitary transformation.
8. The method according to claim 7, in, Each parameterized quantum gate includes one of the following: a single-qubit quantum gate; a two-qubit quantum gate; or a three-qubit quantum gate.
9. The method according to claim 7, in, One or more quantum gates implement a unitary transformation of the form: exp(i02), where θ is the parameter of the parameterized quantum gate and Σ is the generalized Pauli operator acting on one or more of the multiple qubits.
10. The method according to claim 9, in, The gradient of the unitary transform includes a norm bounded by 1.
11. The method according to claim 1, in, The input state includes a superposition of binary strings.
12. The method according to claim 1, in, The input state includes an arbitrary quantum state.
13. The method according to claim 1, further comprising: include: applying one or more parameterized quantum gates to transform the plurality of qubits from unclassified input states to classified output states; determining a readout state from measurements of one or more readout qubits in a categorical output state; and Classify the unclassified input state according to the readout state.
14. The method according to claim 1, in, The classification comprises a binary state classification.
15. A method of classification performed using a quantum computer, the method include: Applying one or more parameterized quantum gates to transform the plurality of qubits from an input state to an output state, wherein parameters of the one or more parameterized quantum gates have been determined using a classifier training method, the method comprising: preparing a plurality of qubits in input states having known classifications by a first classical artificial neural network; applying one or more parameterized quantum gates to the plurality of qubits to transform an input state into an output state; determining a predicted classification of the input state using the readout states of the plurality of qubits in the output state and a second classical artificial neural network; and updating parameters of one or more parameterized quantum gates based on a comparison of the predicted classification with the known classification; determining a readout state from a measurement of one or more readout qubits in an output state; and The input status is classified according to the readout status.
16. The method according to claim 15, in, The classification of the input state includes binary state classification.
17. A system, include: A quantum computing system comprising a plurality of qubits and one or more parameterized quantum gates; as well as Classical computing systems, including multiple artificial neural networks; The system is configured to perform operations for training a classifier on a quantum computer, the operations comprising: preparing a plurality of qubits in input states having a known classification, the plurality of qubits including one or more readout qubits, the preparing comprising preparing the input states using a first classical artificial neural network; applying one or more parameterized quantum gates to the plurality of qubits to transform an input state into an output state; determining a predicted classification of the input state using a readout state of one or more readout qubits in the output state and a second classical artificial neural network; comparing the predicted classification to the known classification; and Based on the comparison of the predicted classification with the known classification, one or more parameters of the parameterized quantum gate are updated.
18. The system according to claim 17, in, The classification of the input state includes binary state classification.
19. A quantum computing system, include: Multiple qubits; as well as One or more parameterized quantum gates, Wherein, the system is configured as follows: Applying one or more parameterized quantum gates to transform the plurality of qubits from an input state to an output state, wherein parameters of the one or more parameterized quantum gates have been determined using a classifier training method, the method comprising: preparing a plurality of qubits in input states having known classifications by a first classical artificial neural network; applying one or more parameterized quantum gates to the plurality of qubits to transform an input state into an output state; determining a predicted classification of the input state using the readout states of the plurality of qubits in the output state and a second classical artificial neural network; and updating parameters of one or more parameterized quantum gates based on a comparison of the predicted classification with the known classification; determining a readout state from a measurement of one or more readout qubits in an output state; and The input status is classified according to the readout status.
20. The system according to claim 19, in, The classification of the input state includes binary state classification.
Citation Information
Patent Citations
Training quantum evolutions using sublogical controls
US20170351967A1
Systems and methods for creating and using quantum boltzmann machines
WO2017066695A1
