Method for realizing Ising solution using variational quantum circuit and system for realizing Ising model
The cost function of Isinhamiltonian through variable component quantum circuits and gradient descent training is solved, and the problem of low computational efficiency in existing quantum computers in large-scale combination optimization problems is achieved, and faster training speed and lower Line depth.
Patent Information
- Application Number
- CN202210115078.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-02
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2042-02-02
AI Technical Summary
Existing quantum computers have low computational efficiency and long time to solve the problem of large-scale combination optimization, and traditional QAOA algorithms have many line depth and learning parameters, resulting in slower training speed.
Variable component quantum circuit is used to quantize the input data through encoding layer, variable layering and measurement layer to construct a cost function that reflects Isin Hamiltonian quantum, and use gradient descent to train spin vectors to solve Isin problem.
Lower line depth and fewer learning parameters are achieved, significantly improving training speed and able to solve large-scale combination optimization problems faster.
Smart Images

Figure CN114444702B_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the field of quantum technology, and more specifically, to a method for implementing an Ising solver using a variational quantum circuit and a system for implementing an Ising model. Background Art
[0002] Typical combinatorial optimization problems are NP-hard problems, usually including the maximum cut problem (Max-Cut), the maximum independent set problem (MIS), the minimum vertex cover problem, the maximum clique problem and the set cover problem, which are widely used in biomedicine, financial strategy, traffic planning, circuit design and other fields. The more common solver is the quantum annealer produced by D-wave, but due to the limitations of its hardware structure, the annealer cannot solve large-scale problems, and its computing speed is not enough compared to simulated annealing. In view of the disadvantages of traditional technology, it is very meaningful to find new alternative methods to solve large-scale combinatorial optimization problems.
[0003] The Quantum Approximate Optimization Algorithm (QAOA) algorithm is a polynomial-time approximate optimization algorithm for solving combinatorial optimization problems, which has the potential to demonstrate quantum supremacy. Approximate optimization, as the name suggests, only requires an approximate solution to the problem. The QAOA (Quantum Approximate Optimization Algorithm) approximate optimization algorithm can be used not only to solve NP-hard complete problems, but also to solve NP-hard problems with higher complexity.
[0004] The Quantum Approximate Optimization Algorithm (QAOA) is one of the most promising algorithms that demonstrate quantum advantage implemented on recent quantum computers. As an approximation algorithm, it does not give the best results, but rather gives "good enough" results and its accuracy depends on the lower bound of the approximation ratio.
[0005] At present, quantum computers are immature, small in scale, and have scarce resources. It is necessary to construct simulation systems with quantum computing capabilities based on traditional computers to provide development paths and tools for quantum algorithms. Existing quantum simulation systems are mainly deployed on supercomputers and cloud computing platforms. Since quantum computers have exponential computing acceleration compared to traditional computers, the main problem in implementing quantum computing simulations on traditional computers is low computing efficiency and long time consumption. Slow computing speed is the key issue that hinders the practical application of quantum computing simulations. The quantum circuit composed of quantum gates is a universal quantum computing model. Through quantum circuit optimization, the computing speed can be significantly improved while keeping the calculation results unchanged.
[0006] The purpose of this application is to seek a method based on universal variational quantum circuits that not only solves the Ising problem but also takes into account the hybrid algorithm of quantum and classical. If it can have a lower circuit depth and fewer circuit learning parameters than the traditional QAOA algorithm, a faster training speed can be achieved. The realization of the aforementioned universal variational quantum circuit for solving the Ising problem is the main purpose of this application. Summary of the invention
[0007] The present application discloses a method for implementing Ising solution using a variational quantum circuit, comprising:
[0008] Quantize the input data using variational quantum circuits;
[0009] According to the measurement results after quantization, a cost function with a spin vector reflecting the Ising Hamiltonian is constructed;
[0010] The cost function is trained by gradient descent to train the spin vector, and the spin vector when the result of the cost function has a minimum value is regarded as the minimum solution of the Ising Hamiltonian.
[0011] The above method, wherein:
[0012] The variational quantum circuit includes a coding layer, a variational layer, and a measurement layer. The coding layer is used to encode input data into a quantum state. The variational layer applies a parameterized unitary transformation to the coded information provided by the coding layer. The measurement layer is used to measure the probability distribution of all quantum bits.
[0013] The above method, wherein:
[0014] The coding layer includes single-bit H, R y , R z Door.
[0015] The above method, wherein:
[0016] For a quantum circuit with N qubits, their initial states are On the Bloch sphere, corresponding to the positive direction of the Z axis in the three-dimensional rectangular coordinate system, the single-bit H, R y , R z The gate is used to rotate the initial state so as to encode the initial state to a corresponding position on the Bloch sphere according to a preset encoding method.
[0017] The above method, wherein:
[0018] The variation layer includes a series of CNOT gates on each quantum circuit. A pair of quantum bits are entangled through the CNOT gates, and the CNOT gate of one quantum bit is controlled by the other quantum bit.
[0019] The above method, wherein:
[0020] In order to achieve the effect of global entanglement between multiple quantum circuits, the multiple CNOT gates of the variable layer form a ring structure, so that the information of other quantum circuits is integrated into each quantum circuit.
[0021] The above method, wherein:
[0022] The variation layer also includes a single-bit quantum rotation gate on each quantum circuit, and the single-bit quantum rotation gate includes a single-bit R x (α), R z (β), R x (γ) gate.
[0023] The above method, wherein:
[0024] Select different rotation angle parameters α, β, γ, and then x (α), R z (β), R x (γ) gates to construct arbitrary single-bit unitary transformation gates, so that the position of any point on the Bloch sphere can be determined by R x (α), R z (β), R x The variation layer is obtained by the rotation operation of the (γ) gate, and any expected entangled state is constructed through the CNOT ring structure and the single-bit rotation gate.
[0025] The above method, wherein:
[0026] The measurements performed by the measurement layer include: the state vector of the single-bit quantum circuit is composed of |0> and |1>, the quantum state of the global quantum circuit is measured, and the probability distribution of the disentangled direct product state of the |0> and |1> states of all quantum bits is obtained, and the probability of each quantum state is between 0 and 1 and satisfies the probability sum is 1.
[0027] The above method, wherein:
[0028] In a quantum circuit with N qubits, the measurement result of the qubit is expressed as the probability distribution of the quantum states |0> and |1> between 0 and 1; for the i-th qubit, the probability difference P is obtained by subtracting the probabilities of the two quantum states |0> and |1>. i The distribution of is set between -1 and 1, i=1,2,…N.
[0029] The above method, wherein:
[0030] Use a nonlinear activation function to act on the probability difference P i To set the spin vector x corresponding to the i-th quantum bit i :
[0031]
[0032] Where γ is the hyperparameter of the nonlinear activation function.
[0033] The above method, wherein:
[0034] The expression of the cost function in the Ising Hamiltonian equivalent form is L = x T Jx;
[0035] where x T is the transpose of x and J is the set coupling matrix.
[0036] The above method, wherein:
[0037] The minimum value of the cost function corresponds to a predetermined quantum state output by the variational quantum circuit. Based on the training of the cost function by gradient descent, the variational quantum circuit finds the predetermined quantum state corresponding to the minimum value of the cost function by learning.
[0038] The above method, wherein:
[0039] During the training process of gradient descent, the parameters of the unitary transformation of the variational quantum circuit are adjusted, and the parameters include the rotation angle of the single-bit quantum rotation gate of the variational layer.
[0040] The above method, wherein:
[0041] The parameter shift rule is used to adjust the parameters α, β, and γ of the single-bit rotation gate of the variable layer, and the function f expressed by the quantum circuit with the input state |x> satisfies the following relationship:
[0042]
[0043] The above relationship is about the gradient of θ, and the angle θ includes parameters α, β, and γ.
[0044] The above method, wherein:
[0045] Based on the measurement results of the variational quantum circuit, a cost function reflecting the Ising Hamiltonian is implemented on a classical computer.
[0046] The above method, wherein:
[0047] The computation of this cost function is implemented on a classical computer.
[0048] The above method, wherein:
[0049] The gradient descent of nonlinear activation functions and cost functions is calculated using classical computers.
[0050] The present application also discloses a system for implementing the Ising model using a variational quantum circuit, comprising:
[0051] Variational quantum circuit, quantizes input data;
[0052] A function construction module, which constructs a cost function with a spin vector reflecting the Ising Hamiltonian according to the measurement results of the variational quantum circuit;
[0053] The training module performs gradient descent training on the cost function, trains the spin vector, and regards the spin vector under the condition that the result of the cost function has a minimum value as the minimum solution of the Ising Hamiltonian.
[0054] The above system, wherein:
[0055] The variational quantum circuit includes a coding layer, a variational layer, and a measurement layer. The coding layer is used to encode input data into a quantum state. The variational layer applies a parameterized unitary transformation to the coded information provided by the coding layer. The measurement layer is used to measure the probability distribution of all quantum bits.
[0056] The above system, wherein:
[0057] The cost function constructed by the function construction module is L=x T Jx,x T is the transpose of x and J is the set coupling matrix;
[0058] The cost function reflects the spin vector x carried by the Ising Hamiltonian;
[0059] In a quantum circuit with N qubits, the measurement result of the qubit is expressed as the probability distribution of the quantum states |0> and |1> between 0 and 1; for the i-th qubit, the probability difference P is obtained by subtracting the probabilities of the two quantum states |0> and |1>. i The distribution of is set between -1 and 1, i = 1, 2, ... N;
[0060] Use a nonlinear activation function to act on the probability difference P i To set the spin vector x corresponding to the i-th quantum bit i :
[0061]
[0062] Where γ is the hyperparameter of the nonlinear activation function.
[0063] Based on the design scheme mentioned in the previous content of this article, this application proposes a quantum-classical hybrid algorithm that uses a universal variational quantum circuit to solve the Ising problem. Compared with the traditional QAOA algorithm, this algorithm has a lower circuit depth, fewer circuit learning parameters, and can achieve faster training speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to make the above-mentioned purposes, features and advantages more obvious and easy to understand, the specific implementation methods are explained in detail below in conjunction with the drawings. After reading the following detailed description and referring to the following drawings, the features and advantages of the present application will become obvious.
[0065] Figure 1 It is an architecture for variational quantum circuits and cost functions and hybrid quantum and classical gradient descent.
[0066] Figure 2 It is an optional embodiment that the variational quantum circuit may include a coding layer and a variational layer and a measurement layer.
[0067] Figure 3 It is the first data encoding layer that encodes the initial state onto the sphere associated with the encoded information.
[0068] Figure 4 It is the second layer variable layer control line that controls the target line to integrate the information of the control line.
[0069] Figure 5 The distribution of the probability difference obtained by subtracting the probabilities of two quantum states is set between positive and negative one.
[0070] Figure 6 The probability difference between the two quantum states is used to set the spin vector corresponding to a quantum bit. DETAILED DESCRIPTION
[0071] The scheme of the present invention will be clearly and completely explained below in conjunction with various embodiments. The described embodiments are only embodiments used for narration and explanation of the present invention rather than all embodiments. Based on these embodiments, the scheme obtained by technicians in this field without making any creative work belongs to the protection scope of the present invention.
[0072] Based on the content introduced in this article, the main topic involves quantum computing or quantum processing, which allows operations to be performed on quantum devices, and the design of its Hamiltonian can at least meet the following goals:
[0073] First, the Ising Hamiltonian can be described as:
[0074]
[0075] Among them Jij Representing the i-th spin x in the Ising Hamiltonian i and the jth spin x j coupling strength.
[0076] The result x of each spin i It is composed of binary values -1 and 1. The goal of solving the Ising problem is to minimize the Ising Hamiltonian and obtain x under the minimum Hamiltonian condition. i The corresponding value is 1 or -1.
[0077] Since this article is quantum related, the relevant content about quantum devices and quantum data is as follows:
[0078] The "quantum device" mentioned herein includes known quantum computing devices and quantum chips, etc., and quantum hardware can also be used to replace the term quantum device. Typical "quantum devices" include but are not limited to: quantum computers, quantum information processing systems or quantum cryptography systems, quantum simulators, and all kinds of devices, equipment and machines for processing quantum data.
[0079] The "quantum data" described herein includes information or data carried, stored or stored by a quantum system, and the smallest non-trivial system is a quantum bit, that is, a system that defines a unit of quantum information. It should be understood that the term "quantum bit" includes all quantum systems that can be appropriately approximated as a two-level system in the corresponding context. Such quantum systems generally include, for example, typical atoms, electrons, photons, ions or superconducting quantum bits, etc.
[0080] See also Figure 1 The system for implementing the Ising model based on a variational quantum circuit involved in the present application mainly includes three core modules, namely a variational quantum circuit 10, a function construction module 20, and a training module 30.
[0081] See also Figure 1 The variational quantum circuit 10 is used to quantize input data or input information. The so-called input data or input information here is usually in a classical state, and the input data or input information can also be replaced by terms such as processing objects. The classical input data or input information is processed by the expected quantization processing program, and then the measurement result that is still in the classical state is returned by the measurement method. This is the main purpose of the variational quantum circuit 10.
[0082] See also Figure 1The function construction module 20 needs to construct a cost function L with a spin vector that can reflect the Ising Hamiltonian based on the measurement results of the variational quantum circuit 10. The core of the cost function construction is that it should have the same equivalent relationship with the traditional Ising Hamiltonian, so the spin vector embedded in the cost function can be equivalent to the minimum solution of the Ising Hamiltonian under the condition of the minimum cost function.
[0083] See also Figure 1 The training module 30 performs gradient descent training on the cost function L, trains the spin vector x, and converts the spin vector x under the condition that the result of the cost function has the minimum value min is regarded as the minimum solution of the Ising Hamiltonian. In other words, the spin vector is trained by gradient descent to obtain the spin vector x when the cost function result is the minimum. min , this vector is a set of solutions that are infinitely close to 1 and -1, and the approach value of this solution to -1 or 1 is the minimum solution of the Ising Hamiltonian.
[0084] See also Figure 1 , showing the three core modules of this application. The core functions of the three core modules are: quantizing the classical input data and then measuring the measurement value of the classical state; constructing a cost function with a spin vector reflecting the Ising Hamiltonian based on the measurement results; and finding the minimum solution of the Ising Hamiltonian. Gradient descent training can be applied to update the parameters in the quantization process. The following explains the three core modules one by one.
[0085] See also Figure 1 The first module is a simulation of a variational quantum circuit (such as variational quantum circuit 10).
[0086] See also Figure 1 , the second module is the cost function construction of the classical computer (such as function construction module 20).
[0087] See also Figure 1 , the third module is quantum and classical mixed gradient descent training (such as training module 30).
[0088] See also Figure 2 The variational quantum circuit 10 includes a coding layer, a variational layer, and a measurement layer.
[0089] See also Figure 2 , the coding layer in the variational quantum circuit 10 is used to encode input data into quantum states.
[0090] See also Figure 2 The variation layer in the variational quantum circuit 10 applies a parameterized unitary transformation to the coding information provided by the coding layer. The unitary transformation can be implemented using implementations such as a universal gate set and a single-bit rotation gate.
[0091] See also Figure 2 The measurement layer in the variational quantum circuit 10 is used to measure the probability distribution of all quantum bits.
[0092] See also Figure 2 In the first module, the variational quantum circuit (VQC) is used: in the general architecture of VQC, it mainly consists of three layers: encoding layer, variational layer and measurement layer. Among them, U(x) is the quantum program that encodes (such as classical) input data x and V(θ) is a variational circuit block with adjustable parameter θ, that is, a part of the quantum circuit. The coherent superposition of the quantum states of two particle systems is called entanglement. During this period, the process of converting the quantum state from the superposition state to a certain basic state through measurement is called the collapse of the quantum state. The role of the measurement layer MEA is just like this. For the measurement layer, quantum information can be in a superposition state of two basic states until it is measured and collapsed to a certain basic state. Among them, U(x) is the part closely related to the encoding layer and the parameter-adjustable V(θ) is the part closely related to the variational layer.
[0093] See also Figure 3 The coding layer includes single-bit H and R on each quantum circuit. y , R z In the field of quantum gates, a single-bit H gate usually refers to a HADAMARD gate. y The gate usually refers to the Pauli Y gate, a single-bit R x In the field of quantum gates, the gate usually refers to the Pauli Z gate. In the first quantum circuit, the single bit R y The door is R y (arctan(x1)) as an example to illustrate the revolving door and single-bit R z The door is As an example, we show the rotation gate, which is the quantum gate layout of the encoding layer on the first quantum circuit. In the second quantum circuit, the single bit R y The door is R y (arctan(x2)) as an example to illustrate the revolving door and single-bit R z The door is As an example, we show the rotation gate, which is the quantum gate layout of the encoding layer on the second quantum circuit. and is the rotation angle. For the sake of brevity, more quantum circuits are not described one by one. For example, the parameters and is the parameter of the third and fourth quantum circuits. The quantum gate layout used in the coding layer is designed as needed and is not limited to the specific example in the figure.
[0094] See also Figure 3For a quantum circuit with N quantum bits, that is, N quantum circuits, the initial states of the N quantum bits are usually set to It can also be considered that when all quantum bits (QUBIT) are initialized to |0>, the overall quantum state becomes as described above Then input the parameterized quantum circuit module. About the coding layer: On the Bloch sphere, corresponding to the positive Z axis in the three-dimensional rectangular coordinate system, the single-bit H, R y , R z The gate is used to rotate the initial state, so that the initial state can be encoded to a corresponding position on the Bloch sphere according to a preset encoding method, or the initial state can be encoded to a position on the sphere related to the encoded information. It can also be considered that the initial state is encoded to a position corresponding to the input data on the Bloch sphere. y , R z The gate is one of the optional implementation examples of the preset encoding method, but it is not the only implementation example.
[0095] See also Figure 4 The variational layer or variational circuit includes a series of CNOT gates on each quantum circuit. A pair of quantum bits are entangled through the CNOT gates, and the CNOT gate of one quantum bit is controlled by the other quantum bit.
[0096] See also Figure 4 In an optional embodiment, for example, entanglement is generated between quantum bits q1 and q2 through a CNOT gate, and the CNOT gate of quantum bit q2 is controlled by quantum bit q1. That is, the CNOT gate on the second quantum circuit is controlled by the first quantum circuit. In this case, the second quantum circuit is the target circuit and the first quantum circuit is the control circuit. The control circuit controls the target circuit, so that the information of the control circuit is integrated into the target circuit, and has no effect on the control circuit.
[0097] See also Figure 4 In an optional embodiment, for example, entanglement is generated between quantum bits q2 and q3 through a CNOT gate, and the CNOT gate of quantum bit q3 is controlled by quantum bit q2. That is, the CNOT gate on the third quantum circuit is controlled by the second quantum circuit. At this time, the third quantum circuit is the target circuit and the second quantum circuit is the control circuit.
[0098] See also Figure 4 In an optional embodiment, for example, entanglement is generated between quantum bits q3 and q4 through a CNOT gate, and the CNOT gate of quantum bit q4 is controlled by quantum bit q3. That is, the CNOT gate on the fourth quantum circuit is controlled by the third quantum circuit. At this time, the fourth quantum circuit is the target circuit and the third quantum circuit is the control circuit.
[0099] See also Figure 4 In an optional embodiment, for example, entanglement is generated between quantum bits q4 and q1 through a CNOT gate, and the CNOT gate of quantum bit q1 is controlled by quantum bit q4. That is, the CNOT gate on the first quantum circuit is controlled by the fourth quantum circuit. At this time, the first quantum circuit is the target circuit and the fourth quantum circuit is the control circuit.
[0100] See also Figure 4 In an optional embodiment, for example, entanglement is generated between quantum bits q1 to q3 through a CNOT gate, and the CNOT gate of quantum bit q3 is controlled by quantum bit q1. That is, the CNOT gate on the third quantum circuit is controlled by the first quantum circuit, and at this time the third quantum circuit is the target circuit and the first quantum circuit is the control circuit.
[0101] See also Figure 4 In an optional embodiment, for example, entanglement is generated between quantum bits q2 to q4 through a CNOT gate, and the CNOT gate of quantum bit q4 is controlled by quantum bit q2. That is, the CNOT gate on the fourth quantum circuit is controlled by the second quantum circuit, and at this time the fourth quantum circuit is the target circuit and the second quantum circuit is the control circuit.
[0102] See also Figure 4 In an optional embodiment, for example, entanglement is generated between quantum bits q3 and q1 through a CNOT gate, and the CNOT gate of quantum bit q1 is controlled by quantum bit q3. That is, the CNOT gate on the first quantum circuit is controlled by the third quantum circuit. At this time, the first quantum circuit is the target circuit and the third quantum circuit is the control circuit.
[0103] See also Figure 4 In an optional embodiment, for example, entanglement is generated between quantum bits q4 and q2 through a CNOT gate, and the CNOT gate of quantum bit q2 is controlled by quantum bit q4. That is, the CNOT gate on the second quantum circuit is controlled by the fourth quantum circuit. At this time, the second quantum circuit is the target circuit and the fourth quantum circuit is the control circuit.
[0104] See also Figure 4 According to the above content, in order to achieve the effect of global entanglement between multiple quantum circuits (such as a quantum circuit with N quantum bits or the four exemplary quantum circuits shown in the figure), the many CNOT gates of the variable layer can form a ring structure as shown in the figure, so that the information of other quantum circuits can be integrated into each quantum circuit. The main reason is that the control circuit can control the target circuit, so that the information of the control circuit can be integrated into the target circuit. It is worth noting that Figure 4The CNOT gate ring structure is not the only way to form a ring. In fact, the CNOT gate ring formation mode is diverse. The so-called ring structure refers to the coupling of different quantum circuits into a ring through many CNOT gates, so that the information of other quantum circuits is integrated into each quantum circuit and the global entanglement effect is achieved between multiple quantum circuits.
[0105] See also Figure 4 , the variational layer or variational circuit includes a single-bit quantum rotation gate on each quantum circuit. The single-bit quantum rotation gate includes a single-bit R x (α), R z (β), R x (γ) gate. For example, each of the first to fourth quantum circuits includes a single-bit quantum rotation R x (α), R z (β), R x (γ) gate. It is usually considered that R x (θ), R y (θ), R z (θ) doors are revolving doors that rotate along the X, Y, and Z axes respectively and the parameter θ is the rotation angle.
[0106] See also Figure 4 , select different rotation angle parameters α, β, γ, and then x (α), R z (β), R x (γ) gates construct arbitrary single-bit unitary transformation gates. The position of any point on the Bloch sphere can be determined by R x (α), R z (β), R x The variational layer can be obtained by the rotation operation of the (γ) gate, and any expected entangled state can be constructed through the CNOT ring structure and the single-bit rotation gate.
[0107] See also Figure 4 , the single-bit revolving door R(α, β, γ) is based on R x (α1), R z (β1), R x The (γ1) gate is used as an example of a rotation gate used in the first quantum circuit, where the parameters α1, β1, and γ1 are the rotation angles. The quantum gate layout used by the variational layer is designed on demand and is not limited to the specific example in the figure.
[0108] See also Figure 4 , the single-bit revolving door R(α, β, γ) is based on R x (α2), R z (β2), R xThe (γ2) gate is explained as an example of a rotation gate used in the second quantum circuit, where the parameters α2, β2, and γ2 are the rotation angles.
[0109] See also Figure 4 , the single-bit revolving door R(α, β, γ) is based on R x (α3), R z (β3), R x The (γ3) gate is explained as an example of a rotation gate used on the third quantum circuit, where the parameters α3, β3, and γ3 are the rotation angles.
[0110] See also Figure 4 , the single-bit revolving door R(α, β, γ) is based on R x (α4), R z (β4), R x The (γ4) gate is used as an example of a rotation gate in the third quantum circuit for explanation, where the parameters α4, β4, and γ4 are the rotation angles. For the sake of brevity, more quantum circuits are not described separately.
[0111] See also Figure 4 , a single quantum bit contains a lot of information, which can be regarded as an infinite number of points on the unit sphere of the Bloch sphere, and in principle can be infinitely binary expanded. However, since the quantum bit collapses when it is observed, the quantum state changes, that is, the measurement step referred to by MEA, so the quantum bit will change its state when it is observed, and it will collapse from the superposition state of |0> and |1> to a specific state corresponding to the measurement result. The behavior of quantum bits collapsing when they are observed is one of the basic principles of quantum mechanics. In actual operation, it can only be determined by measuring the same quantum bits a large number of times.
[0112] See also Figure 4 The measurement implemented by the measurement layer is: the state vector of the single-bit quantum circuit is composed of |0> and |1>, and the quantum state of the global quantum circuit is measured to obtain the probability distribution of the disentangled direct product state of the |0> and |1> states of all quantum bits. Moreover, the probability of each quantum state is between 0 and 1, and the sum of the probabilities of the two quantum states is 1.
[0113] See also Figure 5 , extending from the four quantum circuits mentioned above to N quantum circuits with N quantum bits. The quantum bit measurement result is expressed as the probability distribution of quantum state |0> and quantum state |1> between 0 and 1. The first quantum circuit where the quantum bit q1 is located to the Nth quantum circuit where the quantum bit qN is located is a total of N quantum circuits. Where N is a positive integer.
[0114] See also Figure 5In an optional embodiment, for the i-th quantum bit, i = 1, 2, ... N, the probability difference P is obtained by subtracting the probabilities of the two quantum states |0> and |1> of the i-th quantum bit. i The distribution of is set between -1 and 1. Specific measures include using a nonlinear activation function (such as a tanh function) to act on the probability difference P i , so as to set the spin vector x corresponding to the i-th quantum bit i :
[0115]
[0116] In the spin vector relationship, γ is a hyperparameter of the nonlinear activation function. The probability hypothesis of the quantum state |0> of the i-th quantum bit can be expressed by pi0 and the probability hypothesis of the quantum state |1> can be expressed by pi1. The probability difference between the two quantum states |0> and |1> is P i =pi0-pi1. The probability distribution is expressed as spin x in a specific mathematical way. i The binary value result is -1 and 1. For the i-th quantum bit, the probability of the two quantum states can be subtracted to obtain the probability difference P i The distribution of is between the binary value results -1 and 1. To avoid the probability difference P i Converging within a minimum range (near 0) and not jumping out of the local minimum, using a nonlinear activation function can speed up the binary separation of the probability difference. This minimum range can be defined as a floating value range of the probability difference, the center point of the floating value range is 0, its upper limit is less than 1 and its lower limit is greater than -1. In addition, the larger the value of γ, the steeper the activation function is projected to the discrete region from 0 to 1.
[0117] See also Figure 6 In an optional embodiment, for the i-th quantum bit, the probability difference between the two quantum states |0> and |1> is P i =pi0-pi1 (based on the first module measurement result showing the probability distribution of quantum states |0> and |1> between 0 and 1, that is, the probability difference comes from the measurement result of the variational quantum circuit 10), so as to set the spin vector x corresponding to the i-th quantum bit i And its cost function is The principle is to use a nonlinear activation function on the probability difference of the measurement of each quantum bit to construct the spin vector x, which is the role of the function construction module 20.
[0118] See also Figure 6 In an optional embodiment, for the jth quantum bit, the probability difference between the two quantum states |0> and |1> is P j=pj0-pj1, thereby setting the spin vector x corresponding to the jth quantum bit j And its cost function is j=1, 2, ... N. The function construction module 20 implements function construction based on the measurement results.
[0119] See also Figure 6 , is the Ising Hamiltonian (H Ising ) The equivalent cost function is expressed as L = x T Jx.x T is the transpose of x and J is the set coupling matrix. It is required that the minimum value of the cost function L corresponds to the predetermined quantum state output by the variational quantum circuit 10. Based on the training of the gradient descent of the cost function L, the variational quantum circuit 10 can find the predetermined quantum state corresponding to the minimum value of the cost function L by learning. During the training of the gradient descent, the unitary transformation parameters of the variational quantum circuit 10 are adjusted, and the parameters include the rotation angle of the single-bit quantum rotating gate of the variational layer.
[0120] See also Figure 6 , using the parameter shift rule to adjust the parameters α, β, and γ of the single-bit rotation gate of the variable layer, the function f expressed by the quantum circuit with the input state |x> can be set to satisfy the following relationship:
[0121]
[0122] The above relationship is about the gradient of θ, and the angle θ includes parameters α, β, and γ. All parameters appear as the rotation angles of a single-bit rotating gate. The symbol of the inverted triangle is the gradient operator (total differential in all directions of space), which is also a differential operator in calculus, called the Hamilton operator and is used to represent gradients and divergences. When measuring the derivative of the expected value of a mechanical quantity with respect to the parameter θ, methods such as the parameter shift rule can be used. In order to distinguish, the function f expressed by the quantum circuit related to the input state |xin> can also be considered to be expressed as f(xin,θ), etc. The right side of the gradient relationship about θ is adaptively changed to f(xin,θ±π / 2). Gradient calculation can be combined with existing technologies. The input state is closely related to the input data or input information and allows the expression of the function f to be set arbitrarily.
[0123] See also Figure 1The present application relates to a method for implementing Ising solution using a variational quantum circuit, comprising: firstly quantizing input data using a variational quantum circuit; constructing a cost function with a spin vector reflecting the Ising Hamiltonian based on the measurement results after the quantization processing; then training the cost function by gradient descent, training the spin vector and considering the spin vector when the result of the cost function has a minimum value as the minimum solution of the Ising Hamiltonian.
[0124] See also Figure 3 In the first layer of VQC data, the coding layer consists of single-bit H and R y , R z The gate is composed of , which can realize the encoding of any point on the Bloch sphere. For the circuit of N quantum bits, its initial state is On the Bloch sphere, it corresponds to the positive direction of the Z axis in the three-dimensional rectangular coordinate system, H, R y , R z The gate is used to rotate the initial state, encoding the initial state to a position on the sphere that is associated with the encoded information.
[0125] See also Figure 4 , the second layer of VQC, the variational layer, contains a series of C-not gates and single-bit quantum rotation gates. The C-not gate of the variational layer is applied to a pair of quantum bits to generate quantum bit entanglement: the control line controls the target line, and the target line incorporates the information of the control line, while having no effect on the control line. In order to achieve global entanglement, the C-not gate of the variational layer forms a ring structure, so that each quantum line incorporates the information of other quantum lines, constructing an entangled state and a single-bit rotation gate R (α, β, γ) composed of R x (α), R z (β), R x (γ) Gate composition.
[0126] See also Figure 4 , choose different parameters α, β, γ, R x (α), R z (β), R x (γ) gates can construct any single-bit unitary transformation gate, that is, the position of any point on the Bloch sphere can be determined by R x (α), R z (β), R x The (γ) gate is rotated to obtain the variation layer, and any entangled state is constructed through the C-not ring and the single-bit rotation gate.
[0127] See also Figure 4In the third layer of VQC, the measurement layer, the entangled quantum state is disentangled and measured. The state vector of the single-bit quantum circuit is composed of |0> and |1>. The probability distribution of the disentangled direct product state of all quantum bits |0> and |1> states is obtained by measuring the quantum state of the quantum circuit. The probability of each quantum state is between 0 and 1 and the sum of the probabilities is 1.
[0128] See also Figure 1 In the second module, the cost function of the Ising Hamiltonian is implemented on a classical computer based on the measurement results of the variational quantum circuit. The Ising Hamiltonian can be described as:
[0129]
[0130] Among them J ij Representing the i-th spin x in the Ising Hamiltonian i and the jth spin x j coupling strength.
[0131] The result x of each spin i It consists of binary values -1 and 1. The goal of solving the Ising problem is to minimize the Ising Hamiltonian and obtain the minimum Hamiltonian under x i The corresponding value is 1 or -1.
[0132] See also Figure 6 In the second module, the probability distribution can be expressed in a specific mathematical way as spin x i The binary value results -1 and 1 are expressed as the probability distribution of quantum states |0> and |1> between 0 and 1 based on the measurement results of the first module. For the i-th quantum bit, the probability difference P of the subtraction of the probabilities of the two quantum states i Distributed between -1 and 1.
[0133] See also Figure 6 , in order to avoid the probability difference P i If the value converges to a minimum value near 0 but cannot jump out of the local minimum, a nonlinear activation function can be used to accelerate the binary separation of the probability difference. The nonlinear activation function uses a tanh-like function:
[0134]
[0135] Here, γ is a hyperparameter of the nonlinear activation function, which means that the larger the value of γ, the steeper the activation function is projected into the discrete region from 0 to 1. The activation function is used for the difference in the measurement probability of each qubit to construct the spin vector x.
[0136] See also Figure 6 In the second module, the cost function L = x can be constructed TJx, the calculation of the cost function is realized on a classical computer. According to the different coupling matrices J in the second module, the quantum circuit part in the first module can be appropriately simplified: the minimum value of the cost function constructed by the second module corresponds to a specific quantum state output by the first module, and the circuit searches for the quantum state corresponding to the minimum value by learning.
[0137] See also Figure 6 ,Based on this, in the first module, the parameters of the encoding layer,depth are arbitrary, that is, the initial quantum state for,variational training can be completely random.
[0138] See also Figure 6 Based on this, in the second module, the entanglement state of the circuit in the variation layer can be selected according to the different scales of the problem. The C-not ring can be used to construct a fully entangled quantum state of the circuit, or local entanglement can be achieved, or the circuit can be simplified without using the C-not gate for any entanglement.
[0139] See also Figure 1 In the third module, the cost function is gradient-dropped to train the spin vector x, and the spin vector x is obtained when the cost function result is the minimum. min , this vector is a set of solutions infinitely close to 1 and -1. It is easy to understand that the approaching value of this solution to -1 or 1 is the minimum solution of the Ising Hamiltonian.
[0140] See also Figure 1 In the third module, the classical computer performs gradient descent operations or training on the nonlinear activation function and the cost function. The quantum circuit part uses the parameter shift method to adjust the parameters α, β, and γ of the single-bit rotation gate in the variable layer part of the first module, and derives the analytical gradient of the quantum circuit. For any function f expressed by the quantum circuit with an input state of |x>, its gradient with respect to the parameter θ is:
[0141]
[0142] Based on the above explanation, this application proposes a quantum-classical hybrid algorithm that uses a universal variational quantum circuit to solve the Ising problem. Compared with the traditional QAOA algorithm, this algorithm has a lower circuit depth, fewer circuit learning parameters, and can achieve faster training speed.
[0143] The above description and the accompanying drawings provide typical embodiments of the specific structures of the specific embodiments. The above application content provides existing preferred embodiments, but these contents are not intended to be limiting. After reading the above description, various changes and modifications will undoubtedly be obvious to those skilled in the art. Therefore, the attached claims should be regarded as covering all changes and modifications to the true intent and scope of the present invention. Any and all equivalent scopes and contents within the scope of the claims should be considered to still be within the intent and scope of the present invention.
Claims
1. A method for implementing Ising solution using a variational quantum circuit, characterized in that: include: Quantize the input data using variational quantum circuits; According to the measurement results after quantization, a cost function with a spin vector reflecting the Ising Hamiltonian is constructed; Performing gradient descent training on the cost function to train the spin vector, and considering the spin vector when the result of the cost function has a minimum value as a minimum solution of the Ising Hamiltonian; The variational quantum circuit includes a coding layer, a variational layer, and a measurement layer. The coding layer is used to encode input data into a quantum state. The variational layer applies a parameterized unitary transformation to the coding information provided by the coding layer. The measurement layer is used to measure the probability distribution of all quantum bits. In a quantum circuit with N qubits, the measurement result of the qubit is expressed as the probability distribution of the quantum states |0〉 and |1〉 between 0 and 1. For the i-th qubit, the probability difference P is obtained by subtracting the probabilities of the two quantum states |0〉 and |1〉. i The distribution of is set between -1 and 1, i = 1, 2, ... N; Use a nonlinear activation function to act on the probability difference P i To set the spin vector x corresponding to the i-th quantum bit i : where γ is the hyperparameter of the nonlinear activation function.
2. The method according to claim 1, characterized in that: The coding layer includes single-bit H, R y , R z Door.
3. The method according to claim 2, characterized in that: For a quantum circuit with N qubits, their initial states are On the Bloch sphere, corresponding to the positive direction of the Z axis in the three-dimensional rectangular coordinate system, the single-bit H, R y , R z The gate is used to rotate the initial state so as to encode the initial state to a corresponding position on the Bloch sphere according to a preset encoding method.
4. The method according to claim 1, characterized in that: The variation layer includes a series of CNOT gates on each quantum circuit. A pair of quantum bits are entangled through the CNOT gates, and the CNOT gate of one quantum bit is controlled by the other quantum bit.
5. The method according to claim 4, characterized in that: In order to achieve the effect of global entanglement between multiple quantum circuits, the multiple CNOT gates of the variable layer form a ring structure, so that the information of other quantum circuits is integrated into each quantum circuit.
6. The method according to claim 4, characterized in that: The variation layer also includes a single-bit quantum rotation gate on each quantum circuit, and the single-bit quantum rotation gate includes a single-bit R x (α), R z (β), R x (γ) gate.
7. The method according to claim 6, characterized in that: Select different rotation angle parameters α, β, γ, and then x (α), R z (β), R x (γ) gates to construct arbitrary single-bit unitary transformation gates, so that the position of any point on the Bloch sphere can be determined by R x (α), R z (β), R x The variation layer is obtained by the rotation operation of the (γ) gate, and any expected entangled state is constructed through the CNOT ring structure and the single-bit rotation gate.
8. The method according to claim 1, characterized in that: The measurements performed by the measurement layer include: the state vector of the single-bit quantum circuit is composed of |0〉 and |1〉, the quantum state of the global quantum circuit is measured, and the probability distribution of the disentangled direct product state of the |0〉 and |1〉 states of all quantum bits is obtained, and the probability of each quantum state is between 0 and 1 and satisfies the probability sum is 1.
9. The method according to claim 1, characterized in that: The expression of the cost function in the Ising Hamiltonian equivalent form is L = x T Jx; where x T is the transpose of x and J is the set coupling matrix.
10. The method according to claim 9, characterized in that: The minimum value of the cost function corresponds to a predetermined quantum state output by the variational quantum circuit. Based on the training of the cost function by gradient descent, the variational quantum circuit finds the predetermined quantum state corresponding to the minimum value of the cost function by learning.
11. The method according to claim 10, characterized in that: During the training process of gradient descent, the parameters of the unitary transformation of the variational quantum circuit are adjusted, and the parameters include the rotation angle of the single-bit quantum rotation gate of the variational layer.
12. The method according to claim 7, characterized in that: The parameter shift rule is used to adjust the parameters α, β, and γ of the single-bit rotation gate of the variable layer, and the function f expressed by the quantum circuit with the input state |x〉 satisfies the following relationship: The above relationship is the gradient about θ, and the angle θ includes parameters α, β, and γ.
13. A system for implementing the Ising model using a variational quantum circuit, characterized in that: include: Variational quantum circuit, quantizes input data; A function construction module, which constructs a cost function with a spin vector reflecting the Ising Hamiltonian according to the measurement results of the variational quantum circuit; A training module, performing gradient descent training on the cost function, training the spin vector, and considering the spin vector under the condition that the result of the cost function has a minimum value as a minimum value solution of the Ising Hamiltonian; The variational quantum circuit includes a coding layer, a variational layer, and a measurement layer. The coding layer is used to encode input data into a quantum state. The variational layer applies a parameterized unitary transformation to the coding information provided by the coding layer. The measurement layer is used to measure the probability distribution of all quantum bits. The cost function constructed by the function construction module is L=x T Jx;x T is the transpose of x and J is the set coupling matrix; The cost function reflects the spin vector x carried by the Ising Hamiltonian; In a quantum circuit with N qubits, the measurement result of the qubit is expressed as the probability distribution of the quantum states |0〉 and |1〉 between 0 and 1. For the i-th qubit, the probability difference P is obtained by subtracting the probabilities of the two quantum states |0〉 and |1〉. i The distribution of is set between -1 and 1, i = 1, 2, ... N; Use a nonlinear activation function to act on the probability difference P i To set the spin vector x corresponding to the i-th quantum bit i : Where γ is the hyperparameter of the nonlinear activation function.
Citation Information
Patent Citations
Method and apparatus for performing a quantum computation
CA3125917A1
Schrodinger-Heisenberg variable sub-ground state solving method
CN113344209A