A quantum computing simulation method for a system of linear equations and related apparatus

CN118014089BActive Publication Date: 2026-10-20ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410138994.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-31
Publication Date
2026-10-20
Estimated Expiration
2044-01-31

AI Technical Summary

Technical Problem

该方案需要构建非常多的量子线路,占用了过多的量子计算资源,并且需要大量的经典计算资源执行上述分解过程,因此计算过程耗时较长,计算效率偏低,难以在真实量子芯片上运行

Benefits of technology

[0035]与现有技术相比,本发明提供的一种线性方程组的量子计算模拟方法及相关装置,可以构建用于制备线性方程组的近似解的量子态的变分量子线路,和,用于获取该近似解对应的损失函数值的量子态测量线路;其中,该变分量子线路中的变分参数通过利用差分方法确定的梯度更新序列进行迭代更新。并根据变分量子线路和量子态测量线路,生成模拟计算该线性方程组的量子脉冲信号;然后对量子芯片上的量子比特作用该量子脉冲信号,可以获取损失函数值满足预设精度时的变分量子线路制备得到的量子态,将该量子态对应的近似解作为该解线性方程组的目标解。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118014089B_ABST
    Figure CN118014089B_ABST
Patent Text Reader

Abstract

The application discloses a quantum computing simulation method for a linear equation group and a related device, and belongs to the technical field of quantum computing. The method comprises the following steps: constructing a variational quantum circuit for preparing a quantum state of an approximate solution of the linear equation group, and a quantum state measurement circuit for obtaining a loss function value corresponding to the approximate solution. A gradient update sequence determined by using a difference method is used to iteratively update variational parameters in the variational quantum circuit. According to the variational quantum circuit and the quantum state measurement circuit, a quantum pulse signal for simulating the linear equation group is generated. The quantum pulse signal is applied to a quantum bit on a quantum chip, and a quantum state prepared by the variational quantum circuit when the loss function value meets a preset accuracy is obtained. The approximate solution corresponding to the quantum state is taken as a target solution of the linear equation group. The scheme significantly reduces the number of quantum circuits required for simulating the linear equation group, saves a large amount of quantum computing resources, reduces the computing time, greatly improves the computing efficiency, and promotes the further development of a quantum linear solver running on a real quantum chip.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of quantum computing technology, specifically a quantum computing simulation method and related apparatus for linear equation systems. Background Technology

[0002] Solving linear systems is a problem in many scientific and technological fields (e.g., fluid mechanics, finance, biology, chemistry, etc.). Research on how to quickly and accurately solve linear systems has shown significant theoretical and applied value, leading to the development of many effective techniques and methods for solving linear systems. For example, in the field of CFD (Computational Fluid Dynamics), linear equations representing changes in fluid state can be constructed based on various discretization mathematical methods. This allows for numerical experiments, computer simulations, and analytical studies of fluid mechanics problems, including calculating the temperature, density, and other state information of the fluid at different locations in a steady state.

[0003] When simulating linear equations using classical computers, the complexity of classical algorithms increases exponentially with the size of the coefficient matrix, leading to extremely time-consuming computation. Quantum computing, a novel computing approach, utilizes quantum mechanics to construct a computational framework. In certain scenarios, quantum computing offers exponential speedup compared to optimal classical algorithms. Therefore, the computational advantages of quantum computers can be leveraged to simulate different systems, construct their linear equations, and obtain the target solution under predetermined conditions using quantum computing, thus revealing information about the system in its steady-state state.

[0004] In existing technologies, when simulating linear equations using quantum circuits, iterative processes require optimizing circuit parameters to gradually reduce the loss function along the gradient direction. Therefore, multiple quantum circuits need to be constructed to obtain the gradient of the loss function separately. Specifically, the loss function in each iteration step needs to be decomposed on a Pauli basis, and then each decomposed term is measured on a standard basis to determine the gradient of the loss function. This approach requires constructing a large number of quantum circuits, consuming excessive quantum computing resources, and also requires significant classical computing resources to execute the decomposition process. Therefore, the computation is time-consuming and inefficient, making it difficult to run on real quantum chips. Summary of the Invention

[0005] The purpose of this invention is to provide a quantum computing simulation method and related apparatus for linear equation systems, aiming to reduce the number of quantum circuits required to simulate linear equation systems, reduce the computation time, and thus improve computational efficiency.

[0006] One embodiment of the present invention provides a quantum computing simulation method for a system of linear equations, the method comprising:

[0007] A variable quantum circuit is constructed for preparing the quantum state of an approximate solution to a system of linear equations, and a quantum state measurement circuit is constructed for obtaining the loss function value corresponding to the approximate solution; wherein, the variational parameters in the variable quantum circuit are iteratively updated by a gradient update sequence determined using the difference method;

[0008] Based on the variable quantum circuit and the quantum state measurement circuit, a quantum pulse signal is generated to simulate the calculation of the linear equation system;

[0009] The quantum pulse signal is applied to the qubits on the quantum chip to obtain the quantum state prepared by the variable quantum circuit when the loss function value meets the preset accuracy, and the approximate solution corresponding to the quantum state is used as the target solution of the linear equation system.

[0010] Optionally, the gradient update sequence includes the update step size of the variational parameters and the differential gradient sequence calculated based on the loss function; wherein the differential gradient sequence is used to indicate the update direction of each variational parameter.

[0011] Optionally, in each iteration step, the differential gradient sequence is determined based on the loss function value of the previous iteration step, a preset differential step size, and multiple target loss function values; wherein, each target loss function value is obtained by individually adjusting the preset differential step size of a corresponding variational parameter and then measuring it using the quantum state measurement circuit.

[0012] Optionally, in each iteration step, the differential gradient sequence is calculated based on the following steps:

[0013] For each variational parameter θ of the variational quantum circuit i Based on the preset difference step size ∈, the variational parameter is adjusted to θ. i +∈, and use the quantum state measurement circuit to measure and obtain a target loss function value after the variational parameter adjustment;

[0014] Calculate the quotient of each target difference and the preset difference step size ∈, and use it as a corresponding element in the difference gradient sequence; wherein, the target difference is the difference between a target loss function value and the loss function value of the previous iteration step.

[0015] Optionally, the variational parameters and update step size for each iteration are determined based on the following steps:

[0016] Based on the variational parameters of the previous iteration step, the update step size of the previous iteration step, the differential gradient sequence corresponding to the current iteration step, and the latest step size update parameters of the current iteration step, determine the experimental variational parameters of the current iteration step.

[0017] Based on the relationship between the loss function value corresponding to the experimental variational parameters and the loss function value of the previous iteration step, the variational parameters and update step size of the current iteration step are determined.

[0018] Optionally, the step size update parameters include a first step size update sub-parameter and a second step size update sub-parameter; determining the experimental variational parameters of the current iteration step based on the variational parameters of the previous iteration step, the update step size of the previous iteration step, the difference gradient sequence corresponding to the current iteration step, and the latest step size update parameters of the current iteration step includes:

[0019] The product of the update step size of the previous iteration, the first step size update sub-parameter, and the second step size update sub-parameter is used as the experimental update step size of the current iteration.

[0020] The experimental variational parameters for the current iteration step are determined based on the difference between the variational parameters of the previous iteration step and the target product; wherein the target product is the product of the experimental update step size and the differential gradient sequence.

[0021] Optionally, determining the variational parameters and update step size for the current iteration step based on the relationship between the loss function value corresponding to the experimental variational parameters and the loss function value of the previous iteration step includes:

[0022] If the loss function value corresponding to the experimental variational parameter is less than the loss function value of the previous iteration step, the experimental variational parameter is used as the variational parameter of the current iteration step, the experimental update step size is used as the update step size of the current iteration step, and the second step size update sub-parameter is updated to the first preset value.

[0023] Optionally, the method further includes:

[0024] If the loss function value corresponding to the experimental variational parameter is not less than the loss function value of the previous iteration step, the second step length update sub-parameter is updated to the product of the current second step length update sub-parameter and the second preset value.

[0025] Return to the step of multiplying the update step size of the previous iteration step, the first step size update sub-parameter, and the second step size update sub-parameter as the experimental update step size of the current iteration step, until the loss function value corresponding to the experimental variational parameter is less than the loss function value of the previous iteration step.

[0026] Optionally, the quantum state measurement circuit is a Hadamard Test circuit, which includes a first H gate acting sequentially on the auxiliary qubit, a controlled U gate acting on the target qubit, and a second H gate acting on the auxiliary qubit.

[0027] The target qubit is used to store the quantum state prepared by the variable quantum circuit; the control bit of the controlled U gate is the auxiliary qubit, and the matrix form of the U gate includes the terms obtained by decomposing the loss function corresponding to the approximate solution currently prepared by the variable quantum circuit on Pauli.

[0028] Another embodiment of the present invention provides a quantum computing simulation system for linear equation systems, the system comprising a classical processing unit, a quantum measurement and control unit, and a quantum chip, wherein:

[0029] The classical processing unit is used to construct a variable quantum circuit for preparing an approximate solution to a linear equation system, and a quantum state measurement circuit for obtaining the loss function value corresponding to the approximate solution. The variable parameters in the variable quantum circuit are iteratively updated by using a gradient update sequence determined by the difference method, and the constructed variable quantum circuit and the quantum state measurement circuit are sent to the quantum measurement and control unit.

[0030] The quantum measurement and control unit is used to generate quantum pulse signals to simulate the linear equation system according to the variable quantum circuit and the quantum state measurement circuit, and to apply the quantum pulse signals to the qubits on the quantum chip;

[0031] The quantum chip is used to perform the quantum state evolution of the qubit based on the quantum pulse signal;

[0032] The quantum measurement and control unit is also used to obtain the quantum state prepared by the variable quantum circuit when the loss function value meets the preset accuracy, and to take the approximate solution corresponding to the quantum state as the target solution of the linear equation system.

[0033] Another embodiment of the present invention provides a storage medium storing a computer program, wherein the computer program is configured to execute the method described in any of the above embodiments when running.

[0034] Another embodiment of the present invention provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the methods described in any of the above embodiments.

[0035] Compared with existing technologies, the present invention provides a quantum computing simulation method and related apparatus for linear equation systems. This method can construct a variable quantum circuit for preparing quantum states of approximate solutions to the linear equation systems, and a quantum state measurement circuit for obtaining the loss function value corresponding to the approximate solution. The variational parameters in the variable quantum circuit are iteratively updated using a gradient update sequence determined by the difference method. Based on the variable quantum circuit and the quantum state measurement circuit, a quantum pulse signal is generated to simulate the calculation of the linear equation systems. Then, by applying this quantum pulse signal to the qubits on a quantum chip, the quantum state prepared by the variable quantum circuit when the loss function value meets a preset accuracy can be obtained. The approximate solution corresponding to this quantum state is then used as the target solution for the linear equation system.

[0036] The solution provided in this embodiment does not require constructing a large number of quantum circuits to obtain each gradient of the loss function individually. Instead, it uses a small number of quantum circuits that measure the loss function value, and based on the obtained multiple loss function values, approximates the gradient using the idea of ​​difference approximation. Therefore, the gradient update sequence determined by the difference method characterizes the gradient descent direction of the loss function and can be used to indicate the update direction of each variational parameter. Based on this update direction and the update step size of the variational parameters, iteratively updating the variational parameters in the variational quantum circuits can gradually reduce the loss function value until a preset accuracy is met, thereby obtaining the target solution of the linear equation system. Compared with existing methods that construct multiple gradient calculation quantum circuits, this solution significantly reduces the number of quantum circuits required to simulate the linear equation system, saves a lot of quantum computing resources, reduces computation time, greatly improves computational efficiency, and promotes the further development of quantum linear solvers running on real quantum chips. Attached Figure Description

[0037] Figure 1 A network block diagram of a quantum computing system provided in an embodiment of the present invention;

[0038] Figure 2 A flowchart illustrating a quantum computing simulation method for a system of linear equations provided in an embodiment of the present invention;

[0039] Figure 3 This is a schematic diagram of a specific structure of a variable quantum circuit provided in an embodiment of the present invention;

[0040] Figure 4 This is a schematic diagram of a specific structure of a quantum state measurement circuit provided in an embodiment of the present invention;

[0041] Figure 5 A schematic diagram of the structure of a quantum computing simulation system for a system of linear equations provided in an embodiment of the present invention;

[0042] Figure 6This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0043] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0044] Figure 1 This is a network block diagram of a quantum computing system provided in an embodiment of the present invention. The quantum computing system may include a network 110, a server 120, a wireless device 130, a client 140, storage 150, a classical computing unit 160, a quantum computing unit 170, and may also include additional memory, a classical processor, a quantum processor, and other devices not shown.

[0045] Network 110 is a medium used to provide communication links between various devices and computers connected together within a quantum computing system, including but not limited to the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The connection method can be wired, wireless communication links, or fiber optic cables.

[0046] Server 120, wireless device 130, and client 140 are conventional data processing systems that may contain data and application programs or software tools that perform conventional computational processes. Client 140 may be a personal computer or a network computer, so the data may also be provided by server 120. Wireless device 130 may be a smartphone, tablet, laptop, smart wearable device, etc. Storage unit 150 may include database 151, which can be configured to store data such as qubit parameters, quantum logic gate parameters, quantum circuits, and quantum programs.

[0047] The classical computing unit 160 (quantum computing unit 170) may include a classical processor 161 (quantum processor 171) for processing classical data (quantum data) and a memory 162 (memory 172) for storing classical data (quantum data). The classical data (quantum data) may be a boot file, an operating system image, and an application program 163 (application program 173). The application program 163 (application program 173) may be used to implement a quantum algorithm compiled by the quantum computing simulation method for linear equations provided in the embodiments of the present invention.

[0048] Any data or information stored or generated in the classical computing unit 160 (quantum computing unit 170) can also be configured to be stored or generated in another classical (quantum) processing system in a similar manner, and any application executed therein can also be configured to be executed in another classical (quantum) processing system in a similar manner.

[0049] It should be noted that a true quantum computer has a hybrid structure, which includes at least... Figure 1 The system consists of two main parts: the classical computing unit 160, which is responsible for performing classical calculations and control; and the quantum computing unit 170, which is responsible for running quantum programs to achieve quantum computing.

[0050] The aforementioned classical computing unit 160 and quantum computing unit 170 can be integrated into a single device or distributed across two different devices. For example, a first device including the classical computing unit 160 runs a classical computer operating system, providing quantum application development tools and services, as well as the storage and network services required for quantum applications. Users develop quantum programs using the quantum application development tools and services on the second device, and send these quantum programs to a second device including the quantum computing unit 170 via the network services. The second device runs a quantum computer operating system, which parses and compiles the quantum program's code into instructions that the quantum processor 170 can recognize and execute. The quantum processor 170 then implements the quantum algorithm corresponding to the quantum program based on these instructions.

[0051] The computing units of the classic processor 161 within the classic computing unit 160 are based on CMOS transistors on a silicon chip. These computing units are not limited by time or coherence; that is, they are available at any time without time constraints. Furthermore, the number of such computing units in a silicon chip is sufficient; currently, a single classic processor 161 contains tens of thousands of computing units. Given this sufficient number and the fixed selectable computing logic of the CMOS transistors (e.g., AND logic), computational performance is achieved by combining a large number of CMOS transistors with a limited set of logic functions during operation.

[0052] In the quantum computing unit 170, the basic computing unit of the quantum processor 171 is the qubit. The input of a qubit is limited by coherence and coherence time; that is, a qubit is limited by its available usage time and is not always readily available. Making full use of qubits within their available usage time is a key challenge in quantum computing. Furthermore, the number of qubits in a quantum computer is one of the representative indicators of its performance. Each qubit performs computational functions through on-demand configured logical functions. Given the limited number of qubits and the diverse logical functions available in quantum computing, such as Hadamard gates (H gates), Pauli-X gates (X gates), Pauli-Y gates (Y gates), Pauli-Z gates (Z gates), X gates, RY gates, RZ gates, CNOT gates, CR gates, iSWAP gates, Tofoli gates, etc., quantum computing requires combining a limited number of qubits with diverse logical function combinations to achieve computational effects.

[0053] Based on these differences, the design of classical logic functions applied to CMOS transistors and the design of quantum logic functions applied to qubits are significantly and fundamentally different. The design of classical logic functions applied to CMOS transistors does not need to consider the individuality of CMOS transistors. For example, the representation of a CMOS transistor in a silicon chip is its individual identifier, location, and usable time of each CMOS transistor. Therefore, classical algorithms composed of classical logic functions only express the operational relationship of the algorithm, not the algorithm's dependence on individual CMOS transistors.

[0054] Quantum logic functions applied to qubits need to consider the individuality of each qubit, such as its position within the quantum chip, its relationship with surrounding qubits, and the duration of its usable time. Therefore, quantum algorithms composed of quantum logic functions not only express the computational relationships within the algorithm but also its dependence on the individual qubits.

[0055] A quantum chip can include qubits and channels for controlling them. Quantum logic gates are implemented using analog signals. Different combinations of analog signals are applied to the qubits through these channels, thereby creating quantum circuits with different functions to process data. Therefore, the design of quantum logic functions in the qubits (including the design of whether qubits are used and the design of the efficiency of each qubit) is crucial for improving the computational performance of quantum computers and requires special design. This is the unique characteristic of quantum algorithms based on quantum logic functions, and it is fundamentally and significantly different from classical algorithms based on classical logic functions. The aforementioned design considerations for qubits are technical problems that ordinary computing devices do not need to consider or address.

[0056] To simulate a target system using quantum computing methods and solve the corresponding linear equations, the following steps are required: First, obtain the linear equation set Ax = b, where x represents a physical quantity to be determined in the target system. Then, by simulating the target system and performing quantum state evolution using quantum computing methods, the information of the physical quantity can be obtained. Specifically, in one implementation, such as simulating a fluid system in the field of CFD, the linear equation set Ax = b can be used to represent the state changes of each grid cell in a discretized grid of the target fluid; where vector x represents the difference between the fluid state of each grid cell at the current time and the previous time; vector b represents the residual vector related to the fluid state and the coordinate information of the grid cell at the previous time; and matrix A represents the coefficient matrix related to the fluid state and the coordinate information of the grid cell at the previous time.

[0057] Furthermore, in the quantum computing simulation of this linear equation system, the information of the linear equation system can be encoded into qubits. Specifically, this involves encoding the coefficient matrix A and residual vector b of the linear equation system into corresponding quantum states. In one implementation, the information of the aforementioned classical data can be encoded into the Hamiltonian corresponding to the linear equation system, and Hamiltonian simulation can be used instead of converting the classical data into quantum states. That is, based on the coefficient matrix A and residual vector b, a Hamiltonian corresponding to the linear equation system Ax = b is constructed. The ground state (i.e., the lowest energy state) of this Hamiltonian corresponds to the solution of the linear equation system. When the loss function constructed based on this Hamiltonian reaches its minimum value, the solution of the linear equation system is determined.

[0058] Furthermore, a commonly used quantum circuit for quantum state encoding and iterative optimization of loss functions is the variable quantum circuit. The variational parameter in the variable quantum circuit is the rotation angle of the parameterized quantum logic gate. In the quantum computing simulation of linear equations, the corresponding loss function value can be changed by adjusting the rotation angle of the parameterized quantum logic gate.

[0059] See Figure 2 , Figure 2 A quantum computing simulation method for a system of linear equations is provided in this embodiment of the invention. The method includes the following steps:

[0060] Step 201: Construct a variable quantum circuit for preparing the quantum state of the approximate solution of the linear equation system, and a quantum state measurement circuit for obtaining the loss function value corresponding to the approximate solution;

[0061] The variational parameters in the variational quantum circuit are iteratively updated using a gradient update sequence determined by the difference method.

[0062] Step 202: Generate a quantum pulse signal to simulate the calculation of the linear equation system based on the variable quantum circuit and the quantum state measurement circuit.

[0063] Step 203: Apply the quantum pulse signal to the qubits on the quantum chip to obtain the quantum state prepared by the variable quantum circuit when the loss function value meets the preset accuracy, and take the approximate solution corresponding to the quantum state as the target solution of the linear equation system.

[0064] Specifically, existing schemes for simulating the linear equation system corresponding to the target system using quantum computing mainly include the following steps: constructing the Hamiltonian, selecting the fitting method, obtaining the gradient of the loss function, quantum state tomography, and optimizing the fitting parameters. The form of the Hamiltonian corresponding to the linear equation system Ax = b is usually fixed; for example, the constructed Hamiltonian H can be... Where A is the coefficient matrix of the linear equation system. Let I be the transpose and conjugate matrix of A, I be the identity matrix, and b be the residual vector of the linear equation system, which has been normalized and satisfies the following condition:<b|b> =1.

[0065] Without loss of generality, it is assumed that the coefficient matrix A is a self-conjugate matrix; otherwise, in one implementation, it can be taken as... This allows the constructed system of linear equations C to be... A C x =C b It holds and satisfies matrix C A Self-conjugation allows the newly constructed linear equation system to be simulated using quantum computing, enabling the calculation of the solution x of the original linear equation system Ax=b.

[0066] Furthermore, as is known to those skilled in the art, the simulation method for quantum computation of linear equation systems can be a parameterized quantum circuit, such as a variable quantum circuit containing multiple parametric quantum logic gates. The simulation parameters are the variational parameters in the variable quantum circuit. For example, the selected simulation method can be Hardware Efficient Ansatz (HEA), a highly versatile simulation method. In one embodiment, the specific structure of the variable quantum circuit corresponding to HEA can be as follows: Figure 3 As shown, the portion of the quantum circuit within the dashed box represents a Layer of High-Efficiency Hardware Arrangement (HEA). This variable quantum circuit can be composed of multiple HEA layers, with each HEA layer containing parametric quantum logic gates called RY gates. For parametric quantum logic gates The rotation angle can be used to encode the quantum state of an approximate solution to a system of linear equations through multiple RY gates in each level of efficient hardware simulation layer.

[0067] The proposed parameters in the above proposed method can be defined as θ = {θ1, ..., θ} i ,…θ I}, where the number of proposed parameters is I, and thus this proposed method can be described as follows: That is, this hypothetical approach can realize the following quantum state evolution: U(θ)|0>=|φ>, and the above hypothetical approach can be simplified to U θ Therefore, the loss function constructed based on the Hamiltonian H can be defined as follows: in, Since Uθ is the transpose and conjugate of Uθ, the loss function Lθ can be simplified to L.

[0068] After obtaining the quantum state of the approximate solution to the linear equation system using variational quantum circuitry, in order to continuously optimize the variational parameter θ during the iteration process so that the loss function L(θ) gradually decreases along the gradient direction, it is necessary to obtain the gradient of the loss function, that is, to obtain the differential gradient of L(θ). This allows each variational parameter to be updated to θ. i =θ i -λg i Where gradient g is the update direction of variational parameter θ, and λ is the update step size of variational parameter θ.

[0069] Furthermore, in current schemes for simulating linear equations using quantum computing, obtaining the differential gradient g requires constructing a large number of quantum circuits to obtain each differential gradient g separately. i For example, when implementing this scheme, the loss function L(θ) first needs to be decomposed on a Pauli base, resulting in:

[0070]

[0071] Based on the above decomposition method, the following can be generated: and<b|A|φ> Three items, of which It can be further broken down into:

[0072]

[0073] Then take the above formula Decomposition on Pauliji yields:

[0074]

[0075] Where J = J(i) is U i (θ i The number of terms in the Pauliji decomposition. c j It is the coefficient of each term, σ j It is the Pauli basic unit. The advantage of the above decomposition method is that it is... The terms generated by the decomposition are measurable, thus allowing the terms of the gradient of the loss function L(θ) to be measured and obtained separately through multiple quantum circuits.

[0076] Then, assuming the Hamiltonian in the above scheme It can be graded on Pauliji as follows: The number of terms obtained from the decomposition is K; U in each of the terms obtained from the above decomposition i (θ iLet J be the number of terms decomposed on the Paulige scale, and I be the number of parameters proposed in the above scheme. Then we can obtain that when simulating the linear equations corresponding to the target system using existing quantum computing methods, the total number of quantum circuits required to directly measure the differential gradient g of the loss function is O(IJK). The decomposition method in the above scheme greatly reduces the depth of each quantum circuit, but it also leads to an increase in the classical computational cost for calculating the decomposition process, and an increase in the total number of quantum circuits.

[0077] Therefore, in step 201 above, to reduce the number of quantum circuits required to simulate the linear equation system, the solution provided in this embodiment of the invention can approximate the gradient based on multiple obtained loss function values ​​using the idea of ​​difference approximation. The difference method is a numerical method for differential equations that approximates the derivative through finite differences to seek an approximate solution to the differential equation.

[0078] In this embodiment, by obtaining multiple loss function values ​​of the loss function of the linear equation system, multiple approximate derivatives of the loss function can be obtained through finite difference, thereby approximating the differential gradient of the loss function. Therefore, a large number of gradient calculation circuits are not required to obtain gradient information; only a small number of loss function calculation circuits are needed to approximate the gradient. Thus, the total number of quantum circuits required to simulate the linear equation system is reduced from O(IJK) to O(IK), and one less controlled σ is found in each running quantum circuit. j This not only significantly reduces the number of quantum circuits required to simulate linear equations, but also saves a large amount of quantum computing resources, reduces computation time, greatly improves computational efficiency, and promotes the further development of quantum linear solvers running on real quantum chips.

[0079] Specifically, in one implementation, the quantum state measurement circuit used to obtain the loss function value corresponding to each approximate solution can be a Hadamard Test circuit, and the specific structure of the Hadamard Test circuit can be as follows: Figure 4 As shown in the figure, the qubit with an initial state of |0> is an auxiliary qubit, and the quantum state |φ> of the target qubit is the quantum state of the approximate solution of the linear equation system prepared by the above variable quantum circuit. By decomposing the loss function corresponding to the approximate solution prepared by the above variable quantum circuit on a Pauli basis, we can obtain:

[0080]

[0081] Then we can base the σ generated by the decomposition k The project constructs multiple controlled U gates, which, under the control of auxiliary qubits, act on the quantum state |φ> of the target qubit.

[0082] The Hadamard test is a commonly used method for measuring quantum states, which can be used to determine the quantum state |φ> relative to the reference state |σ. k The phase of the target qubit relative to the reference state is a key subroutine in many quantum algorithms, such as quantum phase estimation. The Hadamard Test works as follows: First, a Hadamard transform is applied to the control bit, and a controlled U-gate is applied to the quantum state; after applying the controlled U-gate, another Hadamard transform is applied to the control bit, and the result is measured on a standard basis. By repeating the Hadamard test multiple times and averaging the results, the phase of the target qubit relative to the reference state can be estimated.

[0083] Among them, it is necessary to observe <φ|σ k When |φ> has a real part, S=I, which is equivalent to having no effect. We only need to observe the auxiliary qubit; the probability of an observation being 0 minus the probability of an observation being 1 is <φ|σ. k The real part of |φ> needs to be observed. Similarly, the real part of <φ|σ needs to be observed. k When |φ> has an imaginary part, S = diag{1, -i}. We still only need to observe the auxiliary qubit; the probability of an observation being 0 minus the probability of an observation being 1 is <φ|σ. k The imaginary part of |φ>. In the solution provided in this embodiment of the invention, the loss function value is a real number, so the above-mentioned S gate can be omitted.

[0084] Correspondingly, a quantum circuit for obtaining the gradient of the loss function can also be constructed based on the Hadamard Test circuit described above. This requires that the matrix form of the U-gate be based on each of the aforementioned differential gradients. The drawback of using the above quantum circuits to obtain the gradient of the loss function by modifying the decomposition form accordingly is that a large number of quantum circuits need to be constructed separately.

[0085] As one embodiment of the present invention, the variational parameters in the variational quantum circuit are iteratively updated using a gradient update sequence determined by the difference method. The gradient update sequence includes the update step size of the variational parameters and the difference gradient sequence calculated based on the loss function.

[0086] The differential gradient sequence is used to indicate the update direction of each variational parameter.

[0087] Specifically, in one implementation, the gradient update sequence can be the product of the update step size of the variational parameter and the differential gradient sequence. The differential gradient sequence is calculated based on the loss function and includes multiple approximate gradients of the loss function obtained by performing differential operations on multiple loss function values. These gradients are used to indicate the update direction of each variational parameter, i.e., the rotation direction of the parametric quantum logic gate. The update step size is used to indicate the change in the rotation angle of the parametric quantum logic gate in each iteration step.

[0088] In each iteration step, the differential gradient sequence is determined based on the loss function value of the previous iteration step, the preset differential step size, and multiple target loss function values;

[0089] Each of the target loss function values ​​is obtained by individually adjusting a corresponding variational parameter to a preset difference step size and then measuring it using the quantum state measurement circuit.

[0090] In one implementation, the differential gradient sequence can be calculated based on the following steps:

[0091] Step 2011, for each variational parameter θ of the variational quantum circuit i Based on the preset difference step size ∈, the variational parameter is adjusted to θ. i +∈, and use the quantum state measurement circuit to measure the target loss function value after the variational parameter adjustment.

[0092] Specifically, in the initial iteration step, the initial variational parameters θ = {θ1,…,θ} can first be obtained using the quantum state measurement circuit described above. i ,…θ I The corresponding initial loss function value L(θ1,…,θ) i ,…,θ I If the initial loss function value does not meet the preset precision, the variational parameters need to be iterated repeatedly to gradually reduce the loss function value in each iteration step. The initial variational parameters can be arbitrary or empirical values ​​set by those skilled in the art; similarly, the preset precision η of the loss function value can be preset to η = 10. -8 Or 10 -9 , etc., are not specifically limited here. Accordingly, if the initial loss function value meets the preset accuracy, the approximate solution corresponding to the quantum state prepared by the variational quantum circuit based on the initial variational parameters can be used as the target solution of the linear equation system.

[0093] If the initial loss function value does not meet the preset accuracy, then in the first iteration step, each variational parameter θ can be adjusted based on the preset difference step size ∈. i Adjusted separately to θ i+∈, and after each adjustment, the corresponding target loss function value is obtained using the above quantum state measurement circuit. For example, the first variational parameter θ1 is adjusted to θ1+∈, thereby obtaining the corresponding target loss function value L1(θ1+∈), ..., the i-th variational parameter θ I Adjusted separately to θ I +∈, thus obtaining the corresponding target loss function value L. I (θ I +∈); thus obtaining a sequence of I target loss function values.

[0094] The preset difference step size ∈ represents the precision of approximating the gradient of the loss function using the difference method. When its value is too large, the low precision may make it difficult to achieve the target approximation effect, thus preventing the loss function value from decreasing. When its value is too small, the high precision will increase the number of iterations required. Therefore, the value of the preset difference step size ∈ needs to take into account the above specific situations. For example, it can be set to 10. -1 10 -3 Or 10 -5 etc., without making specific limitations here.

[0095] Step 2012: Calculate the quotient of each target difference and the preset difference step size ∈, and use it as a corresponding element in the difference gradient sequence; wherein, the target difference is the difference between a target loss function value and the loss function value of the previous iteration step.

[0096] Specifically, by performing the above step 2011, a sequence of I target loss function values ​​has been obtained, and then a target loss function value L can be calculated for each value. i (θ i +∈) and the loss function value L(θ1,…,θ) of the previous iteration step i ,…,θ I The difference between the target difference and the preset difference step size is used as the target difference value. Then, the quotient of each target difference value and the preset difference step size is calculated as the difference gradient sequence d = {d1, ...,d2}. i ,…d I The corresponding element d in} i ,Right now:

[0097]

[0098] The sequence element d i Then the corresponding term g in the differential gradient g of the approximate loss function i d i ≈g iFurthermore, as ∈→0, ‖dg‖→0. Then, based on the product of the difference gradient sequence d and the update step size of the variational parameters, the variational parameters in the next iteration step can be updated. The loss function value of the next iteration step is obtained again, and it is determined whether the preset accuracy is met. Thus, the loss function value is gradually reduced through iterative loops until the preset accuracy is met, at which point the target solution of the linear equation system can be obtained.

[0099] As can be seen, in this embodiment, by reasonably setting the preset difference step size ∈, the differential gradient of the loss function can be approximated quickly and accurately through the difference method, thereby constructing the difference gradient sequence of the loss function. Then, the product of the difference gradient sequence and the update step size of the variational parameters can be calculated, and the variational parameters in the variational quantum circuit can be updated iteratively to gradually reduce the value of the loss function until the preset accuracy is met, at which point the target solution of the linear equation system can be obtained.

[0100] As one embodiment of the present invention, the variational parameters and update step size of each iteration step can be determined based on the following steps:

[0101] Step 301: Determine the experimental variational parameters of the current iteration step based on the variational parameters of the previous iteration step, the update step size of the previous iteration step, the differential gradient sequence corresponding to the current iteration step, and the latest step size update parameters of the current iteration step.

[0102] Specifically, determining the experimental variational parameters of the current iteration step based on the variational parameters of the previous iteration step, the update step size of the previous iteration step, the difference gradient sequence corresponding to the current iteration step, and the latest step size update parameters of the current iteration step may include the following steps:

[0103] Step 3011: Determine the experimental update step size for the current iteration step based on the result of the four arithmetic operations between the update step size of the previous iteration step and the latest step size update parameter of the current iteration step.

[0104] Step 3012: Determine the experimental variational parameters for the current iteration step based on the difference between the variational parameters of the previous iteration step and the target product; wherein the target product is the product of the experimental update step size and the differential gradient sequence.

[0105] Specifically, to ensure that the variational parameters in each iteration are optimized compared to the previous iteration (i.e., the loss function value in each iteration is smaller than the loss function value in the previous iteration), it may be necessary to perform multiple experimental adjustments to the variational parameters in each iteration. Therefore, in each iteration, the experimental variational parameters are the experimental values ​​of the variational parameters that are continuously optimized in that iteration until their corresponding loss function values ​​are smaller than the loss function value in the previous iteration. Only then are these values ​​used as the final variational parameters for that iteration.

[0106] Similarly, the experimental update step size is the experimental value of the update step size continuously optimized in this iteration step, corresponding to the experimental variational parameter. The experimental update step size that satisfies the above conditions can be used as the final update step size of this iteration step. As one embodiment of the present invention, in order to further accelerate the descent speed of the loss function value, a variable step size update parameter α can be preset, and its value range can be α>1.0. Thus, during the iteration process, the latest step size update parameter α of the current iteration step and the update step size λ of the previous iteration step can be used as the basis for the update. ref The result of the four arithmetic operations is compared with the update step size of the previous iteration step. The update step size of the current iteration step is then increased to obtain the experimental update step size of the current iteration step.

[0107] In one implementation, the step size update parameter α can be in the range of α > 1.0, thus allowing the acquisition of the update step size λ from the previous iteration. ref The product of the latest step size update parameter α and the current iteration step α is αλ ref The experimental update step size is determined by the finite difference gradient sequence d corresponding to the current iteration step, obtained using the difference method. The experimental update step size αλ is then calculated. ref The product of the differential gradient sequence d and the objective product αλ is the product of the objective product αλ. ref d. Then, the variational parameter θ of the previous iteration step can be calculated. t Product with target αλ ref The difference in d is used as the current experimental variational parameter θ. t -αλ ref d.

[0108] In another implementation, the step size update parameter may include a first step size update sub-parameter with a fixed value and a second step size update sub-parameter with a variable value; the determination of the experimental update step size for the current iteration step based on the arithmetic operation result between the update step size of the previous iteration step and the latest step size update parameter of the current iteration step may include:

[0109] The product of the update step size of the previous iteration, the first step update sub-parameter, and the second step update sub-parameter is used as the experimental update step size of the current iteration.

[0110] That is, the step size update parameter α mentioned above can include a first step size update sub-parameter α1 with a fixed value and a second step size update sub-parameter α2 with a variable value, and the update step size λ of the previous iteration step can be used as the update step size. ref The product of the first step long update sub-parameter α1 and the second step long update sub-parameter α2 is used as the experimental update step size α1α2λ for the current iteration step. refWherein, the value of α1 can be in the range of α1>1.0, and the initial value of α2 can be 1. Therefore, based on the first step length update sub-parameter and the second step length update sub-parameter, the effect of amplifying the update step size during the iteration process can also be achieved, thereby accelerating the decrease of the loss function value; and since the second step length update sub-parameter is variable, it can be adjusted and optimized multiple times in each iteration step, so that the loss function value corresponding to that iteration step is minimized as much as possible.

[0111] Step 302: Based on the relationship between the loss function value corresponding to the experimental variational parameters and the loss function value of the previous iteration step, determine the variational parameters and update step size of the current iteration step.

[0112] Specifically, determining the variational parameters and update step size for the current iteration step based on the relationship between the loss function value corresponding to the experimental variational parameters and the loss function value of the previous iteration step may include:

[0113] If the loss function value corresponding to the experimental variational parameter is less than the loss function value of the previous iteration step, the experimental variational parameter is used as the variational parameter of the current iteration step, the experimental update step size is used as the update step size of the current iteration step, and the second step size update sub-parameter is updated to the first preset value.

[0114] If the loss function value corresponding to the experimental variational parameter is not less than the loss function value of the previous iteration step, the second step length update sub-parameter is updated to the product of the current second step length update sub-parameter and the second preset value.

[0115] Return to the step of multiplying the update step size of the previous iteration step, the first step size update sub-parameter, and the second step size update sub-parameter as the experimental update step size of the current iteration step, until the loss function value corresponding to the experimental variational parameter is less than the loss function value of the previous iteration step.

[0116] In the above implementation, the experimental update step size α1α2λ of the current iteration step is obtained. ref Then, the current experimental variational parameter θ can be calculated. t -α1α2λ ref d, then the variational quantum circuit can be adjusted based on the experimental variational parameters, and the corresponding loss function value can be obtained using the quantum state measurement circuit. The loss function value corresponding to the experimental variational parameters can be compared with the loss function value of the previous iteration step.

[0117] If the loss function value corresponding to the experimental variational parameter is less than the loss function value of the previous iteration, it indicates that the experimental variational parameter has an optimization effect on reducing the loss function value, and the experimental variational parameter θ can be adjusted. t -α1α2λ refd, as the variational parameter of the current iteration step, updates the experimental step size α1α2λ. ref The second step size is used as the update step size for the current iteration step, and the second step size update sub-parameter is updated to a first preset value, for example, the first preset value can be kept unchanged at 1. Thus, when the loss function value of the current iteration step meets the preset accuracy, the target solution of the linear equation system can be determined. When the preset accuracy is not met temporarily, the gradient update sequence for the next iteration step can be determined by the difference method, and in the next iteration step, the variational parameters and update step size can be updated based on the above step size update parameters.

[0118] If the loss function value corresponding to the experimental variational parameter is not less than the loss function value of the previous iteration, it indicates that the current experimental variational parameter θ t -α1α2λ ref Since d has no effect on reducing the loss function value, it is necessary to continue adjusting the experimental variational parameters and experimental update step size until the adjusted loss function value is less than the loss function value of the previous iteration step.

[0119] Due to the current experimental variational parameter θ t -α1α2λ ref d has no effect on reducing the loss function value, while the differential gradient sequence d is obtained through the difference method and has high accuracy; therefore, we can consider whether it is the update step size λ of the previous iteration. ref An unreasonable setting can lead to an excessively large experimental update step size, particularly since the first step update sub-parameter α1 amplifies the experimental update step size. This can result in excessively large changes in the experimental variational parameters, preventing the loss function value from decreasing. In one implementation, the second step update sub-parameter can be updated to the product of the current second step update sub-parameter and a second preset value. The second preset value can be a value between 0 and 1, allowing the experimental update step size to be greater than the update step size λ of the previous iteration during multiple adjustments. ref and less than λ ref The steps are varied to obtain a more reasonable experimental update step size.

[0120] For example, the initial value of the first step update sub-parameter α1 can be 1.2, and the initial value of the second step update sub-parameter α2 can be 1, with a second preset value of 0.5. Therefore, the experimental update step size obtained from the first adjustment can be 1.2 × 1 × λ. ref =1.2λ ref The update step size in this experiment is compared to the update step size λ of the previous iteration. ref The scale has been increased, and thus the experimental variational parameter obtained from the first adjustment is θ. t -1.2λ ref d. Then, if the loss function value L(θ) corresponding to the variational parameters of this experiment... t -1.2λref d) The loss function value L(θ) is less than that of the previous iteration step. t Then the variational parameter θ of the experiment can be... t -1.2λ ref d is used as the variational parameter for the current iteration step, updating the step size of the experiment by 1.2λ. ref It serves as the update step size for the current iteration step.

[0121] If the loss function value corresponding to the variational parameter of the experiment is L(θ) t -1.2λ ref d) The loss function value L(θ) is not less than that of the previous iteration step. t If this happens, the experimental update step size can be adjusted again. Specifically, the second step size update sub-parameter α2 is updated to the product of the current second step size update sub-parameter 1 and the second preset value 0.5, which is 1 × 0.5 = 0.5. Then, the process returns to the step of determining the experimental variational parameters for the current iteration step based on the variational parameters of the previous iteration step, the update step size of the previous iteration step, the differential gradient sequence corresponding to the current iteration step, and the latest step size update parameters of the current iteration step. That is, in the second adjustment, the experimental update step size is changed to 1.2 × 0.5 × λ. ref =0.6λ ref The experimental update step size at this point is smaller than the update step size λ of the previous iteration. ref The experimental variational parameter obtained from the first adjustment is θ. t -0.6λ ref d, and then determine the loss function value L(θ) corresponding to the variational parameters of the experiment again. t -0.6λ ref d) Is it less than the loss function value L(θ) of the previous iteration step? t The above method allows for iterative adjustment of the experimental update step size and experimental variational parameters until the loss function value corresponding to the experimental variational parameters of the current iteration step is less than the loss function value of the previous iteration step.

[0122] In one implementation, the iterative update process of the variational parameters in each iteration step can be defined as the outer iteration; and the adjustment process of the experimental update step size and the experimental variational parameters within each iteration step can be defined as the inner iteration. The ultimate goal of the outer iteration is to continuously optimize the value of the variational parameters so that the loss function value gradually decreases; the ultimate goal of the inner iteration is to dynamically adjust the update step size of the variational parameters so that the loss function value decreases in each iteration step compared to the previous iteration step. The upper limit of the number of iterations for both the outer and inner iterations can be preset, denoted by the outer iteration parameter t. max and inner iteration parameter p max .

[0123] Therefore, within each iteration step, when the number of inner iterations reaches p...max If the quantum computation simulation of the current linear equation system fails, it is necessary to reset parameters such as the preset precision η, preset difference step size ∈, first step size update sub-parameter α1, second step size update sub-parameter α2, or initial update step size λ0. This should be done when the outer iteration count reaches t. max Alternatively, when the loss function value of a certain iteration step reaches the preset precision η, the quantum computation simulation of the linear equation system can be stopped, and the quantum state prepared by the variable quantum circuit when the loss function value satisfies the preset precision can be obtained. The approximate solution corresponding to the quantum state can be used as the target solution of the linear equation system.

[0124] As can be seen, the solution provided in this embodiment of the invention, by setting a fixed first-step update sub-parameter α1 and a variable second-step update sub-parameter α2, not only can the experimental update step size be gradually increased in each iteration step, thereby accelerating the decrease of the loss function value, but it can also perform more precise iterative processing on the experimental update step size and experimental variational parameters when the initial adjustment of the experimental variational parameters is not ideal, so that the loss function gradually decreases in each iteration step as much as possible, thus improving the success rate of simulating linear equation systems through quantum computing.

[0125] As one embodiment of the present invention, the quantum state measurement circuit in the above embodiment can be a Hadamard Test circuit, including a first H gate acting sequentially on the auxiliary qubit, a controlled U gate acting on the target qubit, and a second H gate acting on the auxiliary qubit.

[0126] The target qubit is used to store the quantum state prepared by the variable quantum circuit; the control bit of the controlled U gate is the auxiliary qubit, and the matrix form of the U gate includes the terms obtained by decomposing the loss function corresponding to the approximate solution currently prepared by the variable quantum circuit on Pauli.

[0127] As one embodiment of the present invention, the method may further include:

[0128] Determine whether the loss function value of the current iteration step meets the preset precision. If not, use the difference method to determine the gradient update sequence for the next iteration step.

[0129] Specifically, in the solution provided by this embodiment of the invention, after determining the variational parameters and update step size through the above scheme in each iteration step, the variational parameters in the variational quantum circuit can be updated accordingly. Based on the updated variational quantum circuit and quantum state measurement circuit, the quantum measurement and control unit can generate quantum pulse signals to simulate the calculation of the linear equation system, and apply the above quantum pulse signals to the qubits on the quantum chip to obtain the loss function value. Then, it is determined whether the loss function value of the current iteration step meets the preset accuracy. If it does not meet the accuracy, the gradient update sequence of the next iteration step can be determined using the difference method. If it meets the accuracy, the quantum state prepared by the variational quantum circuit in the iteration step can be tomographically analyzed, and the approximate solution corresponding to the quantum state can be used as the target solution of the linear equation system.

[0130] See Figure 5 , Figure 5 A quantum computing simulation system for a system of linear equations is provided in this embodiment of the invention. The system includes a classical processing unit 501, a quantum measurement and control unit 502, and a quantum chip 503, wherein:

[0131] The classical processing unit 501 is used to construct a variable quantum circuit for preparing an approximate solution to a linear equation system, and a quantum state measurement circuit for obtaining the loss function value corresponding to the approximate solution. The variable parameters in the variable quantum circuit are iteratively updated by using a gradient update sequence determined by the difference method. The constructed variable quantum circuit and the quantum state measurement circuit are then sent to the quantum measurement and control unit 502.

[0132] The quantum measurement and control unit 502 is used to generate quantum pulse signals to simulate the linear equation system according to the variable quantum circuit and the quantum state measurement circuit, and to apply the quantum pulse signals to the qubits on the quantum chip 503.

[0133] The quantum chip 503 is used to perform the quantum state evolution of the qubit based on the quantum pulse signal.

[0134] The quantum measurement and control unit 502 is also used to obtain the quantum state prepared by the variable quantum circuit when the loss function value meets the preset accuracy, and to take the approximate solution corresponding to the quantum state as the target solution of the linear equation system.

[0135] The specific functions and effects of the quantum computing simulation system for the aforementioned linear equations can be explained by referring to other embodiments in this specification, and will not be repeated here. Each unit in the quantum computing simulation system for the linear equations can be implemented entirely or partially through software, hardware, or a combination thereof. Each unit can be embedded in or independent of the processor in a computer device in hardware form, or it can be stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each unit.

[0136] Specifically, the quantum computing simulation method for the above-mentioned linear equation system can be achieved through... Figure 1 The quantum computing system shown is implemented. The function of the classical processing unit 501 can be implemented based on network 110 and classical computing unit 160. First, the user can construct the variable quantum circuit and quantum state measurement circuit through server 120, wireless device 130, or client 140, and store the quantum circuit in database 151 in storage unit 150. Through network 110, classical computing unit 160 can obtain the loss function value in each iteration step and iteratively update the variational parameters in the variable quantum circuit using the gradient update sequence determined by the difference method.

[0137] Both the quantum measurement and control unit 502 and the quantum chip 503 are contained in the quantum computing unit 170. The quantum measurement and control unit 502 can convert the quantum logic gates in the above-mentioned variable quantum circuit into corresponding analog signals, that is, it can generate various combinations of quantum pulse signals; and through the channel in the quantum chip 503 that controls the qubits, the corresponding quantum pulse signals are sequentially applied to the qubits in the quantum chip, so that the quantum state entanglement of the above-mentioned qubits evolves.

[0138] The quantum measurement and control unit 502 can also apply the quantum pulse signal corresponding to the quantum state measurement circuit to the aforementioned quantum bit through the channel for controlling the quantum bit, thereby measuring the loss function value. Then, it performs quantum state tomography on the quantum state prepared by the variable quantum circuit when the loss function value meets the preset accuracy, transforming the quantum state into an approximate solution in classical data form, which serves as the target solution for the linear equation system.

[0139] Please see Figure 6 This specification also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the quantum computing simulation system method for linear equations in any of the above embodiments. Please refer to... Figure 6 The computer device can be a classical computer or a quantum computer.

[0140] This specification also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer, causes the computer to perform the quantum computing simulation system method for linear equations in any of the above embodiments.

[0141] This specification also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the quantum computing simulation system method for linear equations in any of the above embodiments.

[0142] It is understood that the specific examples in this specification are only intended to help those skilled in the art better understand the implementation methods described herein, and are not intended to limit the scope of the invention.

[0143] It is understood that in the various embodiments of this specification, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not limit the implementation process of the embodiments of this specification in any way.

[0144] It is understood that the various implementation methods described in this specification can be implemented individually or in combination, and the implementation methods in this specification are not limited in this respect.

[0145] Unless otherwise stated, all technical and scientific terms used in the embodiments of this specification have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of this specification. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items. The singular forms "a," "the," and "the" as used in the embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0146] It is understood that the processor in the embodiments of this specification can be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this specification. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this specification can be directly implemented by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above methods.

[0147] It is understood that the memory in the embodiments of this specification may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM). It should be noted that the memory in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0148] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this specification.

[0149] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the aforementioned method implementations, and will not be repeated here.

[0150] In the several embodiments provided in this specification, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0151] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0152] In addition, the functional units in the various embodiments of this specification can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0153] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of this specification, in essence, or the parts that contribute to the prior art, or parts of the technical solutions, can be embodied in the form of software products. These computer software products are stored in a storage medium and include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this specification. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0154] The above description is merely a specific embodiment of this specification, but the scope of protection of this invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this specification should be included within the scope of protection of this specification. Therefore, the scope of protection of this invention should be determined by the scope of the claims.

Claims

1. A quantum computing simulation method for a system of linear equations, characterized in that, The method includes: A variable quantum circuit is constructed for preparing the quantum state of an approximate solution to a system of linear equations, and a quantum state measurement circuit is constructed for obtaining the loss function value corresponding to the approximate solution; wherein, the variational parameters in the variable quantum circuit are iteratively updated by a gradient update sequence determined using a difference method; the gradient update sequence includes the update step size of the variational parameters and the difference gradient sequence calculated based on the loss function; Based on the variable quantum circuit and the quantum state measurement circuit, a quantum pulse signal is generated to simulate the calculation of the linear equation system; Apply the quantum pulse signal to the qubits on the quantum chip to obtain the quantum state prepared by the variable quantum circuit when the loss function value meets the preset accuracy, and take the approximate solution corresponding to the quantum state as the target solution of the linear equation system; The variational parameters and update step size for each iteration are determined based on the following steps: Based on the variational parameters of the previous iteration step, the update step size of the previous iteration step, the differential gradient sequence corresponding to the current iteration step, and the latest step size update parameter of the current iteration step, the experimental variational parameters of the current iteration step are determined; the step size update parameters include a first step size update sub-parameter and a second step size update sub-parameter; wherein, the product of the update step size of the previous iteration step, the first step size update sub-parameter, and the second step size update sub-parameter is used as the experimental update step size of the current iteration step, so as to amplify the update step size during the iteration process; Based on the difference between the variational parameters of the previous iteration step and the target product, the experimental variational parameters of the current iteration step are determined, wherein the target product is the product of the experimental update step size and the differential gradient sequence. If the loss function value corresponding to the experimental variational parameter is less than the loss function value of the previous iteration step, the experimental variational parameter is used as the variational parameter of the current iteration step, the experimental update step size is used as the update step size of the current iteration step, and the second step size update sub-parameter is updated to the first preset value. If the loss function value corresponding to the experimental variational parameter is not less than the loss function value of the previous iteration step, update the second step size update sub-parameter to the product of the current second step size update sub-parameter and the second preset value, and return to execute the step of taking the product of the update step size of the previous iteration step, the first step size update sub-parameter, and the second step size update sub-parameter as the experimental update step size of the current iteration step, until the loss function value corresponding to the experimental variational parameter is less than the loss function value of the previous iteration step; the second preset value is a number between 0 and 1.

2. The method as described in claim 1, characterized in that, The differential gradient sequence is used to indicate the update direction of each variational parameter.

3. The method as described in claim 2, characterized in that, In each iteration step, the differential gradient sequence is determined based on the loss function value of the previous iteration step, the preset differential step size, and multiple target loss function values; wherein, each target loss function value is obtained by individually adjusting the preset differential step size of a corresponding variational parameter and then measuring it using the quantum state measurement circuit.

4. The method as described in claim 3, characterized in that, In each iteration step, the differential gradient sequence is calculated based on the following steps: For each variational parameter of the variational quantum circuit Based on the preset difference step size Adjust the variational parameter to The quantum state measurement circuit is used to measure and obtain a target loss function value after the variational parameter adjustment; Calculate each target difference with the preset difference step size. The quotient is used as a corresponding element in the differential gradient sequence; wherein, the target difference is the difference between a target loss function value and the loss function value of the previous iteration step.

5. The method according to any one of claims 1-4, characterized in that, The quantum state measurement circuit is a Hadamard Test circuit, which includes a first H gate acting sequentially on the auxiliary qubit and a controlled gate acting on the target qubit. Gate, and a second H gate acting on the auxiliary qubit; The target qubit is used to store the quantum state obtained from the preparation of the variable quantum circuit; the controlled The control bit of the gate is the auxiliary qubit, which The matrix form of the gate includes the terms obtained by decomposing the loss function corresponding to the approximate solution currently prepared by the variable quantum circuit on Pauli.

6. A quantum computing simulation system for a system of linear equations, characterized in that, The system includes a classical processing unit, a quantum measurement and control unit, and a quantum chip, wherein: The classical processing unit is used to construct a variable quantum circuit for preparing an approximate solution to a linear equation system, and a quantum state measurement circuit for obtaining the loss function value corresponding to the approximate solution. The variable parameters in the variable quantum circuit are iteratively updated using a gradient update sequence determined by the difference method. The constructed variable quantum circuit and the quantum state measurement circuit are then sent to the quantum measurement and control unit. The gradient update sequence includes the update step size of the variable parameters and a difference gradient sequence calculated based on the loss function. The quantum measurement and control unit is used to generate quantum pulse signals to simulate the linear equation system according to the variable quantum circuit and the quantum state measurement circuit, and to apply the quantum pulse signals to the qubits on the quantum chip; The quantum chip is used to perform the quantum state evolution of the qubit based on the quantum pulse signal; The quantum measurement and control unit is also used to obtain the quantum state prepared by the variable quantum circuit when the loss function value meets the preset accuracy, and to take the approximate solution corresponding to the quantum state as the target solution of the linear equation system. The variational parameters and update step size for each iteration are determined based on the following steps: Based on the variational parameters of the previous iteration step, the update step size of the previous iteration step, the differential gradient sequence corresponding to the current iteration step, and the latest step size update parameter of the current iteration step, the experimental variational parameters of the current iteration step are determined; the step size update parameters include a first step size update sub-parameter and a second step size update sub-parameter; wherein, the product of the update step size of the previous iteration step, the first step size update sub-parameter, and the second step size update sub-parameter is used as the experimental update step size of the current iteration step, so as to amplify the update step size during the iteration process; Based on the relationship between the loss function value corresponding to the experimental variational parameters and the loss function value of the previous iteration step, the variational parameters and update step size of the current iteration step are determined. Based on the difference between the variational parameters of the previous iteration step and the target product, the experimental variational parameters of the current iteration step are determined, wherein the target product is the product of the experimental update step size and the differential gradient sequence. If the loss function value corresponding to the experimental variational parameter is less than the loss function value of the previous iteration step, the experimental variational parameter is used as the variational parameter of the current iteration step, the experimental update step size is used as the update step size of the current iteration step, and the second step size update sub-parameter is updated to the first preset value. If the loss function value corresponding to the experimental variational parameter is not less than the loss function value of the previous iteration step, update the second step size update sub-parameter to the product of the current second step size update sub-parameter and the second preset value, and return to execute the step of taking the product of the update step size of the previous iteration step, the first step size update sub-parameter, and the second step size update sub-parameter as the experimental update step size of the current iteration step, until the loss function value corresponding to the experimental variational parameter is less than the loss function value of the previous iteration step; the second preset value is a number between 0 and 1.

7. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the method described in any one of claims 1-5 when it is run.

8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Hardware-efficient variational quantum eigenvalue solver for quantum computing machines

    CN111095307A

  • All-optical bubble matrix calculator based on gradient descent algorithm and implementation method

    CN117032391A