Method and system for encoding a dataset in a quantum circuit for quantum machine learning
The method enhances quantum machine learning by encoding data in quantum circuits with rotation angles and scaling factors, addressing inefficiencies in existing methods and increasing the expressiveness of quantum neural networks.
Patent Information
- Application Number
- JP2023187392
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2022-11-10
- Filing Date
- 2023-11-01
- Publication Date
- 2025-07-23
- Estimated Expiration
- 2043-11-01
AI Technical Summary
Existing quantum machine learning methods face challenges in efficiently encoding data in parameterized quantum circuits, limiting the expressiveness and training capabilities of quantum neural networks.
A method and system for encoding data in a quantum circuit using a plurality of encoding quantum gates and variational quantum gates, where each gate rotates qubits by a rotation angle proportional to input features and scaling factors, including powers of two, to enhance expressiveness without additional qubits or repetitions, and utilize the Hilbert space efficiently.
The proposed method allows for exponential increase in the number of basis functions represented by the quantum circuit, reducing encoding degeneracy and enhancing expressiveness, enabling optimal model representation in the Hilbert space.
Smart Images

Figure 0007711976000033 
Figure 0007711976000034 
Figure 0007711976000035
Abstract
Description
Technical Field
[0001] The present disclosure relates to a method and system for encoding a dataset in a quantum circuit for quantum machine learning.
Background Art
[0002] Due to the success of quantum computing in the past decade, the foundation of quantum machine learning (QML) has been built. In quantum machine learning, a parameterized quantum circuit (PQC) is used as part of the machine learning procedure. The quantum neural network (QNN) used there can have higher training ability, capacity, and generalization ability than its classical counterpart (see Non-Patent Document 1). Therefore, the advantages of quantum computing are transferred to the field of machine learning, and machine learning may be extended beyond classical limits. Quantum neural networks generally require a procedure for encoding quanta, classical (training) data is mapped to encoded quantum gates, and variational quantum gates can be adapted during training.
[0003] Various architectures of quantum neural networks are known in which (classical) input data is encoded with specific quantum gates and the quantum gates are further trained via machine learning (see Non-Patent Document 2 or Non-Patent Document 3). Non-Patent Document 4 discloses a quantum encoding method for quantum machine learning including a hybrid quantum-classical neural network.
[0004] Efficient encoding of input data can facilitate the training procedure. Non-Patent Document 5 discloses a parameterized quantum circuit for policy optimization in reinforcement learning. The value of the state can be scaled using trainable floating-point variables. Non-Patent Document 6 discloses an encoding procedure for exponentially increasing input data.
Prior Art Documents
Non-Patent Documents
[0005] [Non-Patent Document 1] Power of Quantum Neural Networks by A. Abbas et al. (2020) [Non-Patent Document 2] Phys. Rev. A, 103(3):032430 by M. Schuld et al. (2021) [Non-Patent Document 3] Quantum, 4:226 by A. Perez-Salinas et al. (2020) [Non-Patent Document 4] arXiv:2001.03622 by S. Lloyd et al. (2020) [Non-Patent Document 5] arXiv:2103.05577 by Jerbi et al. (2021) [Non-Patent Document 6] arXiv:2206.12105 by Shin et al. (2022) [Summary of the Invention]
[0006] An object of the present disclosure is to provide an improved technique for encoding data in a quantum circuit, particularly for enhancing the training of parameterized quantum circuits in quantum machine learning.
[0007] To solve this problem, according to the independent claims, a method and a system for encoding a data set in a quantum circuit for quantum machine learning are provided. Further embodiments are disclosed in the dependent claims.
[0008] According to one aspect, a method for encoding a dataset in a quantum circuit for quantum machine learning in a system is provided. The system includes a quantum circuit having a plurality of encoding quantum gates and a plurality of variational quantum gates. The method includes providing a dataset including a plurality of input features; for each input feature of the plurality of input features, applying a plurality of encoding quantum gates to one qubit (quantum bit) or a plurality of qubits, wherein each of the plurality of encoding quantum gates rotates one qubit or a plurality of qubits by a rotation angle proportional to the input feature and one of a plurality of scaling factors, and a different one of the plurality of scaling factors is assigned to each of the plurality of encoding quantum gates, and the plurality of scaling factors includes powers of two; applying a plurality of variational quantum gates to the qubit or the plurality of qubits; determining a plurality of measurement values of the qubit or the plurality of qubits; adjusting the quantum circuit by using the plurality of measurement values to adjust the plurality of variational quantum gates; and determining output data of the dataset from the quantum circuit.
[0009] According to another aspect, a system for encoding a dataset in a quantum circuit for quantum machine learning is provided, the system including a quantum circuit having a plurality of encoding quantum gates and a plurality of variational quantum gates. The system is configured to provide a dataset including a plurality of input features, apply a plurality of encoding quantum gates to one qubit or a plurality of qubits for each input feature of the plurality of input features, wherein each of the plurality of encoding quantum gates rotates one qubit or a plurality of qubits by a rotation angle proportional to the input feature and one of a plurality of scaling factors, and a different one of the plurality of scaling factors is assigned to each of the plurality of encoding quantum gates, and the plurality of scaling factors includes powers of two, apply a plurality of variational quantum gates to the qubit or the plurality of qubits, determine a plurality of measurement values for the qubit or the plurality of qubits, adjust the quantum circuit by using the plurality of measurement values to adjust the plurality of variational quantum gates, and determine output data of the dataset from the quantum circuit.
[0010] As a result, an improved method of encoding data in a quantum circuit can be provided as part of quantum machine learning. By the scaling factors provided to embed input features into the angles of the quantum circuit, most of the underlying Hilbert space of the quantum circuit can be used to determine the output data of an input data set such as a basis decomposition. Spanning the entire Hilbert space can be important for the a priori problem that an optimal model of the data set may exist somewhere as a point in the Hilbert space, but prior knowledge about how to parameterize the quantum circuit may not be available to reach this point.
[0011] By rotating qubits using input features and scaling factors, i.e., by encoding input features in a quantum circuit according to the present invention, for example, the number of basis functions that can be represented by the quantum circuit can increase exponentially (not linearly) depending on the number of qubits or the number of repetitions of the encoding. With the proposed method, a large unitary generator can be decomposed into local Pauli Z rotations. Thus, the expressiveness of the quantum circuit can be enhanced without requiring additional qubits or repetitions of the encoding. The increased expressiveness can be brought about by eliminating the encoding degeneracy of the quantum kernel and efficiently utilizing the available Hilbert space by assigning eigenvectors specific to each dimension.
[0012] Each of the plurality of input features may be a real number. Each of the plurality of scaling factors may be a natural number.
[0013] In the context of the present disclosure, the term "real number" may also include finite-precision approximate numbers of real numbers such as floating-point numbers or arbitrary-precision numbers.
[0014] The dataset may further include a plurality of labels. Each of the labels may be a value of a function of one of the plurality of features. In other words, the dataset may include or be composed of pairs of input features and labels, preferably, each of the labels is associated with one of the input features.
[0015] In the context of the present disclosure, a power of 2 consists of natural numbers, in particular, for a natural number k ≧ 0, the number {2 k} corresponds.
[0016] Furthermore, the plurality of scaling factors may include a number obtained by adding 1 to a power of 2, that is, 2 n-1 + 1 for a natural number n ≧ 2.
[0017] In particular, the plurality of scaling factors may include or be composed of the set {2 0 , 2 1 , …… 2 n-2 , 2 n-1 + 1} for a natural number n > 2, in particular, n > 3, n > 4 or n > 5. Each of the scaling factors may be unique to the respective encoded quantum gate. In other words, a unique scaling factor can be assigned to each of the encoded quantum gates. In particular, the number of scaling factors may be equal to the number of encoded quantum gates.
[0018] For each input feature of the plurality of input features, the plurality of encoded quantum gates may include corresponding (distinct) subsets of the encoded quantum gates. In other words, each of the input features may be assigned to a subset of the encoded quantum gates among the plurality of quantum gates. For example, a subset of the first encoded quantum gates may be assigned to the first input feature, and a subset of the second encoded quantum gates (different from the subset of the first encoded quantum gates) may be assigned to the second input feature. Generally, a subset of the j-th encoded quantum gates can be assigned to the j-th input feature. Here, j is greater than 1 and less than or equal to the number of input features of the dataset.
[0019] Each of the rotation angles may include the product of one of the input features and one of the scaling factors.
[0020] For each of the input features, each of the plurality of encoding quantum gates may rotate one qubit or a plurality of qubits by a rotation angle from a set of rotation angles associated with the input feature. In particular, the set of rotation angles associated with the input feature x may include, for a natural number n > 2, the set {2 0 x, 2 1 x, …… 2 n-2 x, (2 n-1 +1)x} or may be composed of them.
[0021] The number of encoding quantum gates among the plurality of encoding quantum gates may be an (integer) multiple of the number of input features (among the plurality of input features of the dataset).
[0022] The plurality of encoding quantum gates may be applied in parallel or sequentially (in series).
[0023] In particular, the plurality of encoding quantum gates may be applied in parallel to a plurality of qubits. In particular, each of the plurality of encoding quantum gates may be applied to different qubits among the plurality of qubits.
[0024] For each qubit of the plurality of qubits, a (separate) set of measurement values may be determined.
[0025] A subset of the encoding quantum gates assigned to (different) input features of the dataset may be arranged in parallel. For each input feature of the plurality of input features, the plurality of qubits may include a corresponding (separate) subset of qubits. For each input feature of the plurality of input features, the corresponding subset of encoding quantum gates may be applied to the corresponding subset of qubits.
[0026] The plurality of encoding quantum gates may be applied sequentially (in series) to one (single) qubit.
[0027] A subset of the encoded quantum gates assigned to (different) input features of the dataset can be arranged in series. Specifically, the (j + 1)-th subset of encoded quantum gates (assigned to the (j + 1)-th input feature) can be sequentially applied to one qubit after applying the j-th subset of encoded quantum gates (assigned to the j-th input feature). Here, j is greater than 1 and less than the number of input features of the dataset.
[0028] The number of encoded quantum gates may be greater than 2, 3, 4, or 5. The number of encoded quantum gates may also be greater than 10, 15, 20, or 50.
[0029] At least one of the plurality of variational quantum gates may be applied between each two of the plurality of encoded quantum gates. In particular, an intermediate variational layer including a set of intermediate variational quantum gates may be applied between each two of the plurality of encoded quantum gates.
[0030] Applying a plurality of variational quantum gates may include applying an initial variational quantum gate to one qubit or a plurality of qubits before applying the plurality of encoded quantum gates. Also, applying a plurality of variational quantum gates may include applying a final variational quantum gate after applying the plurality of encoded quantum gates.
[0031] Applying a plurality of variational quantum gates may include applying an initial variational layer to one qubit or a plurality of qubits before applying the plurality of encoded quantum gates. The initial variational layer may include a set of initial variational quantum gates.
[0032] Applying a plurality of variational quantum gates may include applying a final variational layer after applying the plurality of encoded quantum gates. The final variational layer may include a set of final variational quantum gates.
[0033] A plurality of (initial and / or intermediate and / or final) variational quantum gates can be determined by a plurality of variational parameters. Further, this method may further include optimizing the variational parameters by repeatedly applying a plurality of encoded quantum gates and a plurality of variational quantum gates to one qubit or a plurality of qubits, determining a plurality of measurement values, and adjusting the quantum circuit until an optimization criterion is reached. Accordingly, the plurality of variational parameters can be trainable.
[0034] At least one of the variational quantum gates, preferably each of the variational quantum gates, can be determined by at least one of the plurality of variational parameters. In particular, each of the variational quantum gates may be determined by (a respective) one of the plurality of variational parameters.
[0035] The plurality of variational parameters may include a plurality of variational rotation angles, preferably by which one qubit or a plurality of qubits can be rotated. In particular, each of the plurality of variational parameters may be a variational rotation angle.
[0036] The plurality of (initial and / or intermediate and / or final) variational quantum gates can include at least one of a Pauli X gate, a Pauli Y gate, a Pauli Z gate, a Hadamard gate, and a CNOT gate. The CNOT gate may be a two-qubit CNOT gate.
[0037] In particular, this method may include determining a loss value from a plurality of measurement values and a reference value by applying a loss function. The loss function may be, for example, a mean squared error loss function. The reference value may be determined from the labels of the dataset. The determination of the loss value may be performed, for example, in a data processing device.
[0038] The optimization criterion may include, for example, a loss value below a threshold value of the loss value.
[0039] The loss value can be determined by a (classical) data processing device. The system may comprise a data processing device. A plurality of measurement values can be received by the data processing device. In particular, the plurality of measurement values can be transmitted from a measurement device configured to provide the plurality of measurement values to the data processing device. A data set may be provided within the data processing device. The plurality of input features may be transmitted (from the data processing device) to a quantum circuit. Alternatively, the loss value can preferably be determined by a quantum processing unit including a quantum circuit.
[0040] Furthermore, the method may include determining a variational parameter gradient from the loss value. Furthermore, adjusting the plurality of variational quantum gates may include adjusting the plurality of variational quantum gates based on the variational parameter gradient.
[0041] The determination of the variational parameter gradient may be performed, for example, in a data processing device. Adjusting the plurality of variational quantum gates based on the variational parameter gradient may include transmitting an adjustment signal (based on and / or including the variational parameter gradient) from the data processing device to the quantum circuit based on the variational parameter gradient. Alternatively, the determination of the variational parameter gradient may be performed in a quantum processing unit.
[0042] The variational parameter gradient can indicate the change in the loss value with respect to the change in the variational parameter. Other alternative means for determining a variational parameter gradient (and / or gradient descent) for adjusting the variational quantum gates may be provided.
[0043] The variational parameter gradient can be determined, for example, by the parameter shift rule and / or the adjoint method.
[0044] The method may include determining output data for approximating the data set, preferably from the quantum circuit. The output data may include a basis decomposition of the data set and / or an approximation function of the data set.
[0045] Determining the output data of a dataset may in particular preferably include determining the basis decomposition of the dataset, particularly from a quantum circuit. The basis decomposition may be determined to approximate the labels of the dataset for the corresponding features of the dataset. In other words, this method may include solving the (non-linear) regression problem of the dataset (using the basis decomposition).
[0046] The basis decomposition may be, for example, a (truncated) Fourier decomposition. Thus, this method may provide a Fourier estimator. In particular, a trigonometric series can be adapted to any function. The larger the number of terms in the Fourier decomposition, the more the estimated value of the input dataset can be improved. An alternative basis decomposition for the above Fourier decomposition may be provided using the proposed encoding.
[0047] Since quantum gates can be represented as elements of a compact group, Fourier analysis may be useful for the analysis of quantum neural networks. The Fourier estimator may first infer the gross correlations in the supplied data. Furthermore, by increasing the number of Fourier terms in the Fourier decomposition, more detailed characteristics of the dataset can be determined.
[0048] One qubit or multiple qubits can be provided by the energy levels of trapped ions. In particular, one qubit or multiple qubits can be provided by the hyperfine states and / or vibrational modes of trapped ions. Alternative embodiments for providing one qubit or multiple qubits are also possible, such as the position of a single photon, photon polarization, or nuclear spin between two modes.
[0049] The above-described embodiments regarding the quantum key distribution method can also be provided correspondingly for a quantum key distribution system.
Brief Description of the Drawings
[0050] Hereinafter, as an example, embodiments will be described with reference to the drawings.
Figure 1
Figure 2
Figure 3
Figure 4a
Figure 4b
Figure 5
Figure 6a
Figure 6b
Figure 7a
Figure 7b
Figure 7c
Figure 8
Figure 9
Figure 10
Figure 11
Figure 12
Figure 13
Figure 14
Figure 15
Figure 16
Figure 17
DETAILED DESCRIPTION OF THE INVENTION
[0051] In FIG. 1, a system for encoding a dataset in a quantum circuit for quantum machine learning is illustrated. This system includes a (classical) data processing device 10 such as a server device, a computer, etc. The data processing device 10 may include a (classical) processor 10a such as a CPU and a (classical) memory unit 10b.
[0052] This system further includes a quantum processing unit (QPU) / quantum processing device 11 having a quantum circuit 11a. Exemplary embodiments of the QPU include the IonQ Harmony® QPU (see K. Wright et al., Nature Comm. 10, 11 (2019)). The quantum circuit may include, for example, a plurality of trapped ions, for example, a chain of trapped ions. Quantum bits (qubits) may be provided by the energy levels of trapped ions (in particular, hyperfine / nuclear spin states or vibrational modes / phonons). Quantum gates such as standard qubit operations and rotation quantum gates may be provided by appropriately applying an electric field (e.g., via laser pulses) to the trapped ions.
[0053] The quantum gates used include single qubit and two-qubit quantum gates based on two-photon Raman transitions. The Raman transitions can be performed by irradiating a pair of counter-propagating beams from a mode-locked 355 nm pulsed laser as follows. One beam is applied globally and simultaneously to all qubits, and the other beam is applied only to individual qubits. The latter beam passes through a multi-channel acousto-optic modulator (AOM) that can modulate the phase, frequency, and amplitude simultaneously.
[0054] In the case of the single qubit quantum gate, the frequency difference between the two beams is set with respect to the value of the input and resonantly drives the spin flip transition. Thus, two quantum gates GPi(φ) and GPi2(φ) are provided, which rotate the state of the qubit by angles π and π / 2 along a predetermined longitudinal axis, respectively. Furthermore, a virtual Z quantum gate can be provided that introduces a phase change to the qubit by facilitating or suppressing subsequent operations in the quantum circuit. Combining these three operations can achieve any rotation inside the Bloch sphere.
[0055] In the case of the two-qubit quantum gate, the XX interaction is generated by motional sideband transitions (K. Wright et al., Nature Comm. 10, 11 (2019)) that are driven non-resonantly via the Molmer and Sorensen approach (K. Molmer and A. Sorensen, Phys. Rev. Lett., 82:1835-1838 (1999)). The XX interaction is a simultaneous bit flip of two qubits and can be applied to any two-qubit trapped ion system via the phase.
[0056] This system also includes an interface 12 for communication between the data processing device 10 and the quantum processing device 11. For example, the measurement value determined from the quantum circuit 11a can be transmitted to the data processing device 10 (e.g., from a measuring device). On the other hand, the variational parameter or its adjustment value may be determined in the data processing device 10 and transmitted to the quantum processing device 11 in order to appropriately adapt the quantum circuit 11a, particularly the variational quantum gate, according to the variational parameter.
[0057] The measurement value can be determined by a quantum measurement, including, for example, the measurement of the population of the ultrafine state of trapped ions. The quantum circuit is repeatedly evaluated (specified by the number of shots), and a single-bit measurement value is measured. In this way, the probability of obtaining a specific quantum state can be determined.
[0058] The software package for QPU control includes, for example, the PENNYLANE (registered trademark) library (by Bergholm et al., arXiv:1811.04968 (2018)). General quantum computing access may be provided, for example, via Amazon Web Services (AWS) Braket (registered trademark).
[0059] The QPU can be connected, for example, using AWS Braket (registered trademark) and IonQ Harmony (registered trademark) as follows (alternative quantum hardware and platforms may be used). Using the data processing device 10, a dataset is provided to an AWS Braket notebook. Subsequently, a template of the quantum circuit is created and sent to the AWS system, where the template of the quantum circuit is optionally adapted and the template of the quantum circuit is further sent to the QPU of IonQ Harmony (registered trademark). There, a (native) quantum circuit is generated or adjusted within the QPU of IonQ Harmony (registered trademark) from the template of the quantum circuit, and single-qubit and two-qubit quantum gates are implemented as described above. Subsequently, the quantum operation to be executed is set up, the quantum circuit is evaluated a predetermined number of times, and the measured results are returned to AWS and then sent from there to the data processing device 10. In the data processing device 10, for example, the expected value can be determined from the measured values as part of (classical) post-processing.
[0060] [Overview of the method] Figure 2 illustrates the training of a quantum neural network. In a first step, a quantum circuit 11a is set up and the variational parameters of the variational quantum gates of the quantum circuit 11a are initialized (randomly). The (input) dataset is split into training samples.
[0061] In a second step, a (first) training sample of the dataset is provided and its features are encoded by the quantum circuit 11a. In a third step, the quantum circuit 11a is evaluated and measured values are determined.
[0062] In the fourth step, the measured values, in particular, the expected values are compared with the reference values. The reference values are determined from the labels of the training samples in the data set. This comparison can be quantified using a loss criterion and can generate a loss value. The second, third, and fourth steps can be repeated for all training samples in the data set, and the corresponding average loss value can be determined by averaging the loss values from all training samples.
[0063] In the fifth step, a variational parameter gradient is determined from the (average) loss value using a quantum gradient calculation method such as a parameter shift rule or an adjoint method.
[0064] In the sixth step, the variational parameters of the variational quantum gates of the quantum circuit 11a are adjusted based on the variational parameter gradient.
[0065] Steps 2 to 6 may be repeated until the loss value reaches a predetermined threshold, that is, until the comparison between the measured value and the reference value becomes satisfactory.
[0066] Thereby, the quantum circuit 11a is optimized. The optimization can be performed, for example, via a stochastic gradient descent method. In this case, the multiple of the gradient becomes the learning rate of the model, and the multiple of the gradient is added to the variational parameter. Preferably, the optimization is performed using an Adam optimizer that enables single-epoch training.
[0067] To determine the variational parameter gradient, a parameter shift rule may be used. That is, for each variational parameter of the QNN, the quantum circuit 11a is further evaluated twice: once by increasing the variational parameter by π / 2, and once by decreasing the variational parameter by π / 2. The derivative with respect to each variational parameter is determined by subtracting the latter from the former and dividing the result by two. This procedure is repeated for all variational parameters to obtain a vector of derivatives, i.e., the variational parameter gradient. The variational parameter gradient represents the direction of the steepest increase in the value of the function. So, to reduce the loss value, a move in the opposite direction is performed. Thus, the quantum circuit 11a is optimized by moving the variational parameters by small steps (learning rate) in the opposite direction of the variational parameter gradient.
[0068] The encoding of a data set in a quantum circuit in which encoding quantum gates are arranged in parallel is illustrated in Figure 3, and the corresponding quantum circuit 11a is illustrated in Figure 4a. For simplicity, the quantum circuit 11a for a single feature x is shown.
[0069] The number of qubits in the quantum circuit 11a is determined as a multiple n of the number m of features in the data set. The multiple n corresponds to the number of encoding qubits repeated for each feature x. All qubits, respectively, can be initially prepared as |0>, resulting in
number
number
number
number
Number
[0070] Normalizing the feature x may include determining the minimum feature x min and the maximum feature x max from the dataset. Normalizing the feature x may further include scaling the feature x
Number
[0071] The second qubit is rotated by 2 1 x, the third qubit is rotated by 2 2 x, the fourth qubit is rotated by 2 3 x. And until the (n - 1)-th qubit is rotated by 2 (n-2) x, the subsequent qubit k is rotated by 2( k-1) x. Therefore, the rotation by 2 (k-1) by the scaling factor 2 (k-1) x is applied in parallel for k = 1,..., n - 1. The final n-th qubit is rotated / encoded by (2 (n-1) +1)(2 (n-1) +1)x. That is, the rotation coefficient of the final qubit increases by 1 compared to the other qubits.
[0072] The qubits x' of the additional dataset are each in a quantum (sub)circuit parallel to the quantum (sub)circuit of the feature x (not shown in FIGS. 4a and 4b) for k = 1, ……, n - 1 by 2 (k-1) by x' and for k = n by (2 (n-1) +1)x, are rotated / encoded.
[0073] Subsequently, a final variational layer with a final variational gate and final variational parameters θ (1) is applied, a quantum measurement of the qubits is performed (e.g., in the Pauli Z basis), and corresponding measurement values are obtained. Further, a controlled NOT (CNOT) quantum gate (denoted by the symbols
Number
Number
[0074] First, the number of repetitions n included in each feature x of the dataset is determined. Further, an initial variational layer including an initial variational parameter variational layer θ
[0075] is included in the initial variational layer (0) including
Number
Number
Number
[0076] The last, n-th encoding k = n corresponds to a Pauli rotation by (2 (n-1) + 1)x at a scaling factor of (2 (n-1) + 1). Therefore, the coefficient of this rotation increases by exactly 1 compared to the previous repetition. The same procedure is repeated for the remaining features x'. The final variational layer
Number
[0077] In FIGS. 7a and 7b, exemplary variational layers in parallel arrangements for the cases of 2 qubits and 3 qubits, respectively
Number
[0078] [Comparison with Quantum Circuits without Scaling] In the following, the quantum circuit according to the present invention is compared with a quantum circuit that does not use the scaling factors {2 0 2 1 ... 2 n-2 2 n-1 +1}. FIGS. 4b and 6b illustrate additional quantum circuits in which the encoded quantum gates are arranged in parallel and sequentially, respectively. The scaling of feature x in the encoded quantum gates is not performed in the additional quantum circuits shown in FIGS. 4b and 6b.
[0079] By simply encoding feature x without performing scaling by a power of 2, the same SU(2) encoded quantum gate (e.g., generator [Number] are used (sequentially or in parallel) to create more encoding layers. The eigenvalues of G0 correspond to the set of numbers 1 / 2{1, -1}, and subtracting these from each other gives the set {-1, 0, 1}. Repeating (or parallelizing) the quantum gates has an additive effect, and when repeated n times, the final set becomes {-n, -n + 1, ……, 0, ……, n + 1, n}.
[0080] Each of the number of sets corresponds to the number of in-phase waves that can determine [Number] Therefore, by repeating the encoding operator S(x) = exp(-iGx) n times, n different Fourier bases are obtained. The function obtained as a result of the quantum circuit 11a (in parallel or sequentially) is given by the following equation.
[0081] [Number] where the coefficient [Number] corresponds to the wave number, and θ k represents the corresponding variational parameter. Therefore, the variational layer can be trained to adjust the Fourier variables of the resulting function and can provide a Fourier approximation f(x) with n Fourier basis elements for the input data set features x and labels y. In the case of parallel without additional scaling of x, the (total) generator is given the quantum bit index as q, the total number of qubits as r, and the Pauli Z matrix as σ z (q) as [Number] which gives. The generator G has 2r + 1 distinct eigenvalues, suggesting that its eigen-spectrum is highly degenerate.
[0082] In contrast, for the quantum circuit 11a with scaling factors {20 , 2 1 , ……2 n-2 , 2 n-1 By including {+1}, an exponentially large number of Fourier bases can be provided for a given number of repeated or parallel encoded quantum gates. This is achieved by changing the general SU(2) encoded quantum gate that generates the generator G into a larger special unitary generator.
[0083] In particular, the degeneracy of G can be reduced by adding new wave numbers to the set {−n, −n + 1, ……, 0, ……, n + 1, n}. For this purpose, the generator is modified in various layers. Without scaling, the diagonal elements of the generator G0 are {−1 / 2, +1 / 2}. However, when the scaling function is introduced as described above, the resulting function is as follows.
[0084]
Number
Number
Number
[0085] The sum of powers of 2 is
Number
Number
[0086] The above can be explained through the example of two qubits, which can be easily extended to three or more qubits. Using two qubits with unscaled parallel-encoded quantum gates generates the following generators.
[0087]
Number
Number
Number
Number
[0088] For n qubits, Gexp corresponds to a diagonal matrix with diagonal values from -2 (n-1) to 2 (n-1) and generates 2 Fourier bases. Thus, through scaling, a continuous Fourier spectrum from -2 n to 2 is created. Therefore, the size of the underlying Hilbert space can be used more efficiently, especially when encoding Fourier series that increase exponentially. (n-1) to 2 (n-1) The encoding used can also be advantageous when passing quantum information from one quantum network (e.g., including quantum circuit 11a) to another. Optionally, the quantum state obtained from quantum circuit 11a includes all corresponding Fourier terms and can be used to modify the Fourier terms as needed for further processing and / or to encode the Fourier terms in a lower-dimensional space. An example of such encoding is a quantum autoencoder in which some of the qubits used are discarded such that the information is encoded in the quantum circuit and the remaining qubits are trained to maximize the information transfer rate.
[0089]
[0090] [Training Results] Below, the training performance (see FIGS. 4a (“parallel exponential”) and 6a (“sequential exponential”)) for encoding feature x in the encoded quantum gate according to the present invention is compared with the case where such encoding is not performed (see FIGS. 4b (“parallel linear”) and 6b (“sequential linear”)), and is evaluated via exemplary quantum circuits including 2 qubits in the parallel case and 2 repetitions in the sequential case. In the encoding according to the present invention, different (Fourier) predefined numbers increase exponentially rather than linearly depending on the number of qubits / repetitions used.
[0091] The training was executed on QMware (registered trademark) hardware using the PENNYLANE (registered trademark) Python package. Using the Adam optimizer, a learning rate ε = 0.1 and a uniform distribution parameter [Number] minimizes the mean squared error (MSE) loss function in
[0092] Each of the exemplary quantum circuits is trained to reproduce a one-dimensional top-hat function. FIG. 8 shows plots of the mean squared error loss as a function of the training epochs used for the parallel exponential case (with scaling) and the parallel linear case (without scaling). FIG. 9 shows the corresponding plots for the sequential exponential case and the sequential linear case.
[0093] FIG. 10 shows a plot of the ground truth of the top-hat function and the approximation functions for the parallel exponential case and the parallel linear case. Each of the ground truth function values corresponds to the label of the input feature. FIG. 11 shows the corresponding plots for the sequential exponential case and the sequential linear case.
[0094] FIGS. 8 to 11 show the advantages of training for the parallel exponential architecture and the sequential exponential architecture. The parallel exponential architecture provides optimal fitting and makes the most of the four Fourier frequencies used. Both linear architectures function similarly with respect to access to the two Fourier frequencies that can be represented.
[0095] FIG. 12 shows a plot of the ground truth of the top hat function and the approximation function in the case of parallel exponential, using the hardware implementation of QMware (registered trademark) simulation and the IonQ Harmony (registered trademark) trapped ion quantum processing unit. The trapped ion QPU used has high fidelity quantum gates realized by laser pumping the trapped ions (see Schindler et al., New J. Phys. 15:123012 (2013)). In particular, the hardware introduced by K. Wright et al., Nature Comm. 10, 11 (2019) with a single qubit fidelity of 0.997 and a two qubit fidelity of 0.9725 was used. The code was implemented via Amazon Web Services (AWS) Braket (registered trademark).
[0096] For the trapped ion adaptation, quantum circuit 11a was evaluated for 100 equally spaced points (input features), using 100 shots each. The relatively small number of 100 shots represents the main noise source. It is expected that as the number of shots increases, a smoother curve closer to the QMware (registered trademark) simulation curve will be obtained.
[0097] FIG. 13 illustrates the Fourier decomposition underlying the approximation functions shown in FIGS. 10 and 11. The first row corresponds to the parallel linear architecture, the second row to the parallel exponential architecture, the third row to the sequential linear architecture, and the fourth row to the sequential exponential architecture. The last column shows the plots of the respective approximation functions and the ground truth functions.
[0098] The first five columns are the basis functions e
Number
[0099] Figures 14 to 17 show plots corresponding to Figures 8 to 11 when using three qubits. In particular, Figures 14 and 15 show plots of the mean squared error loss as a function of the training epochs used in the parallel / sequential exponential case and the parallel / sequential linear case. Figures 16 and 17 show plots of the ground truth of the top hat function and the approximation functions in the parallel / sequential exponential case and the parallel / sequential linear case.
[0100] The features disclosed in this specification, the drawings, and / or the claims can be materials for realizing various embodiments, either alone or in various combinations thereof.
Claims
1. A system comprising a quantum circuit (11a) comprising a plurality of encoded quantum gates and a plurality of variational quantum gates, for encoding a dataset in a quantum circuit for quantum machine learning, the method comprising: The method comprises: providing a dataset comprising a plurality of input features; for each input feature of the plurality of input features, applying the plurality of encoded quantum gates to one qubit or a plurality of qubits, wherein each of the plurality of encoded quantum gates rotates the one qubit or the plurality of qubits by a rotation angle proportional to the input feature and one of a plurality of scaling factors; each of the plurality of encoded quantum gates is assigned a different one of the plurality of scaling factors; the plurality of scaling factors includes powers of two; applying the plurality of variational quantum gates to the qubit or the plurality of qubits; determining a plurality of measurement values of the qubit or the plurality of qubits; adjusting the quantum circuit (11a) by adjusting the plurality of variational quantum gates using the plurality of measurement values; determining output data of the dataset from the quantum circuit (11a). Method.
2. The method according to claim 1, wherein each of the plurality of input features is a real number and / or each of the plurality of scaling factors is a natural number. The method according to claim 1.
3. The method according to claim 1 or 2, wherein the plurality of scaling factors further includes a value obtained by adding 1 to a power of two. The method according to claim 1 or 2.
4. The method according to claim 1 or 2, wherein the plurality of encoded quantum gates are applied in parallel to the plurality of qubits, and each of the plurality of encoded quantum gates is applied to a different one of the plurality of qubits. The method according to claim 1 or 2.
5. The method according to claim 1 or 2, wherein the plurality of encoded quantum gates are sequentially applied to the one qubit. The method according to claim 1 or 2.
6. The method according to claim 5, wherein at least one of the plurality of variational quantum gates is applied between each two of the plurality of encoded quantum gates. The method according to claim 5.
7. Applying the plurality of variational quantum gates includes applying an initial variational quantum gate to the one qubit or the plurality of qubits before applying the plurality of encoded quantum gates and / or applying a final variational quantum gate after applying the plurality of encoded quantum gates. The method according to claim 1 or 2.
8. The plurality of variational quantum gates are determined by a plurality of variational parameters, The method further includes optimizing the variational parameters by repeatedly applying the plurality of encoded quantum gates and the plurality of variational quantum gates to the one qubit or the plurality of qubits, determining the plurality of measurement values, and adjusting the quantum circuit (11a) until an optimization criterion is reached. The method according to claim 1 or 2.
9. The plurality of variational parameters include a plurality of variational rotation angles, and the one qubit or the plurality of qubits are rotatable by the plurality of variational rotation angles. The method according to claim 8.
10. The plurality of variational quantum gates include at least one of a Pauli X gate, a Pauli Y gate, a Pauli Z gate, a Hadamard gate, and a CNOT gate. The method according to claim 1 or 2.
11. The method further includes determining a loss value from the plurality of measurement values and a reference value by applying a loss function. The method according to claim 1 or 2.
12. The method further includes determining a variational parameter gradient from the loss value, wherein adjusting the plurality of variational quantum gates includes adjusting the plurality of variational quantum gates based on the variational parameter gradient. The method according to claim 11.
13. Determining the output data of the data set includes determining a basis decomposition of the data set. The method according to claim 1 or 2.
14. The one qubit or the plurality of qubits are provided by energy levels of trapped ions. The method according to claim 1 or 2.
15. A system for encoding a data set in a quantum circuit for quantum machine learning, the system comprising a quantum circuit (11a) comprising a plurality of encoded quantum gates and a plurality of variational quantum gates, providing a data set including a plurality of input features, for each input feature of the plurality of input features, applying the plurality of encoded quantum gates to one qubit or a plurality of qubits, wherein each of the plurality of encoded quantum gates rotates the one qubit or the plurality of qubits by a rotation angle proportional to the input feature and one of a plurality of scaling factors. Each of the plurality of encoded quantum gates is assigned a different one of the plurality of scaling factors, the plurality of scaling factors includes powers of two, applying the plurality of variational quantum gates to the qubit or the plurality of qubits, determining a plurality of measurement values for the qubit or the plurality of qubits, adjusting the quantum circuit (11a) by adjusting the plurality of variational quantum gates using the plurality of measurement values, configured to determine output data of the data set from the quantum circuit (11a), and system.
Citation Information
Patent Citations
Method for predicting epileptic seizure based on quantum CNN-GRU
CN114947740A
Hybrid quantum calculation architecture for solving quadratic unconstrained binary optimization problem
JP2022058331A
Hybrid quantum calculation architecture for solving system of linear binary relation
JP2022118728A
Simulating Errors of a Quantum Device Using Variational Quantum Channels
US20200334107A1
Method and apparatus for constructing quantum machine learning framework, quantum computer and computer storage medium
US20210182721A1