Parameter optimization method and device of quantum circuit, equipment and storage medium

By constructing parameter vectors and optimization based on parameter direction sets and energy fitting functions, the problem of non-independent parameters in parameterized quantum circuit optimization is solved, and the accuracy and efficiency of optimization are improved.

CN119962699APending Publication Date: 2025-05-09TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311497892.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-09
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

When optimizing parameterized quantum circuits, the prior art fails to effectively handle the situation where multiple quantum gates share the same parameter, resulting in inaccurate optimization results.

Method used

By constructing a parameter vector and optimizing based on the parameter direction set of the vector and the coefficient set of the energy fit function, considering the mutual influence between parameters, ensuring that the optimization process is carried out under the constraints of the parameter direction set.

Benefits of technology

The accuracy and efficiency of quantum line parameter optimization are improved, especially in the case where parameters are not independent, the global optimal solution can be better approached.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119962699A_ABST
    Figure CN119962699A_ABST
Patent Text Reader

Abstract

The invention discloses a parameter optimization method and device of a quantum circuit, equipment and a storage medium, and relates to the field of quantum chemistry. The method comprises the following steps: acquiring an initial parameter vector of the quantum circuit in the nth optimization process, wherein each parameter in the parameter vector is used for controlling at least one quantum gate of the quantum circuit; based on the initial parameter vector, a parameter direction set of the quantum circuit in the nth optimization process is obtained, and the parameter direction in the parameter direction set is used for indicating the optimization direction of the initial parameter vector; under the constraint of the parameter direction set, an energy fitting function of the quantum circuit is solved, a coefficient set is obtained, the energy fitting function is used for fitting energy of a quantum system corresponding to the quantum circuit, and the coefficient set comprises solutions of coefficients of all items in the energy fitting function; and based on the coefficient set and the parameter direction set, optimizing the initial parameter vector to obtain the parameter vector after the nth optimization. According to the embodiment of the invention, the parameter optimization accuracy of the quantum circuit can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of quantum chemistry, and in particular to a method, device, equipment and storage medium for optimizing parameters of a quantum circuit. Background Art

[0002] Parameterized quantum circuits have wide applications in quantum machine learning, chemical simulation, optimization algorithms and other fields. Compared with traditional quantum circuits, parameterized quantum circuits have better flexibility and scalability.

[0003] In the related art, the optimization problem of parameterized quantum circuits is decomposed into solvable sub-problems, and the global optimal solution of the parameters of the parameterized quantum circuit is gradually approached by gradually optimizing the sub-problems. For example, the related art believes that all parameters in the parameterized quantum circuit are independent, and only one or part of the parameters are optimized each time.

[0004] However, for some parameterized quantum circuits (such as UCC (Unitary Coupled-Cluster) quantum circuits), multiple quantum gates may share the same parameter, that is, there is a situation where the parameters are not independent. If we continue to use relevant technologies to optimize such parameterized quantum circuits, the optimized parameters will not be accurate enough. Summary of the invention

[0005] The embodiment of the present application provides a method, device, equipment and storage medium for parameter optimization of a quantum circuit. The technical solution is as follows:

[0006] According to one aspect of an embodiment of the present application, a method for optimizing parameters of a quantum circuit is provided, the method comprising:

[0007] In an n-th optimization process for parameters of a quantum circuit, obtaining an initial parameter vector of the quantum circuit in the n-th optimization process, wherein the parameter vector has parameters of the quantum circuit as elements, each parameter is used to control at least one quantum gate of the quantum circuit, and n is a positive integer;

[0008] Based on the initial parameter vector, a parameter direction set of the quantum circuit in the nth optimization process is obtained, wherein the parameter direction in the parameter direction set is used to indicate the optimization direction of the initial parameter vector;

[0009] Under the constraint of the parameter direction set, solving the energy fitting function of the quantum circuit to obtain a coefficient set; wherein the energy fitting function is used to fit the energy of the quantum system corresponding to the quantum circuit, and the coefficient set includes solutions of the coefficients of each term in the energy fitting function;

[0010] Based on the coefficient set and the parameter direction set, the initial parameter vector is optimized to obtain an n-th optimized parameter vector;

[0011] Based on the parameter vector after the n-th optimization, the quantum circuit after the n-th optimization is obtained.

[0012] According to one aspect of an embodiment of the present application, a parameter optimization device for a quantum circuit is provided, the device comprising:

[0013] An initial parameter acquisition module, used for acquiring an initial parameter vector of the quantum circuit in the nth optimization process for the parameters of the quantum circuit, wherein the parameter vector has the parameters of the quantum circuit as elements, each of which is used to control at least one quantum gate of the quantum circuit, and n is a positive integer;

[0014] A parameter direction acquisition module, used to obtain a parameter direction set of the quantum circuit in the nth optimization process based on the initial parameter vector, wherein the parameter direction in the parameter direction set is used to indicate the optimization direction of the initial parameter vector;

[0015] A coefficient set acquisition module, used to solve the energy fitting function of the quantum circuit under the constraint of the parameter direction set to obtain a coefficient set; wherein the energy fitting function is used to fit the energy of the quantum system corresponding to the quantum circuit, and the coefficient set includes solutions of the coefficients of each term in the energy fitting function;

[0016] A parameter vector optimization module, used to optimize the initial parameter vector based on the coefficient set and the parameter direction set to obtain an n-th optimized parameter vector;

[0017] The quantum circuit optimization module is used to obtain the quantum circuit after the nth optimization based on the parameter vector after the nth optimization.

[0018] According to one aspect of an embodiment of the present application, a computer device is provided, the computer device comprising a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the above method.

[0019] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the above method.

[0020] According to one aspect of the embodiments of the present application, a computer program product is provided, the computer program product comprising a computer program, the computer program being stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above method.

[0021] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0022] By constructing a parameter vector with the parameters of the quantum circuit as elements, and then optimizing the parameter vector based on the parameter direction set corresponding to the parameter vector and the coefficient set of the energy fitting function under the constraint of the parameter direction set, the mutual influence between the parameters and the situation where the parameters are not independent are taken into account, which is conducive to improving the accuracy of parameter optimization of the quantum circuit. In addition, compared with the related art that only optimizes one or part of the parameters at a time, the embodiment of the present application directly optimizes the parameter vector corresponding to the quantum circuit as a whole, which is conducive to improving the parameter optimization efficiency of the quantum circuit. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application;

[0024] Figure 2 is a flow chart of a parameter optimization method for a quantum circuit provided by an embodiment of the present application;

[0025] Figure 3 is a schematic diagram of an optimized landscape provided by an embodiment of the present application;

[0026] Figure 4 is a flowchart of a method for obtaining a coefficient set provided by an embodiment of the present application;

[0027] Figure 5 is a flow chart of a parameter optimization method for a quantum circuit provided by another embodiment of the present application;

[0028] Figure 6 is a graph showing a comparison of convergence efficiency provided by an embodiment of the present application;

[0029] Figure 7 This is a comparison result diagram of robustness to noise provided by an embodiment of the present application;

[0030] Figure 8 is a block diagram of a parameter optimization device for a quantum circuit provided by an embodiment of the present application;

[0031] Fig. 9 is a block diagram of a parameter optimization device for a quantum circuit provided by another embodiment of the present application;

[0032] Fig.10 It is a structural block diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0033] Before introducing the technical solution of the present application, some terms involved in the present application are explained. The following related explanations can be combined arbitrarily with the technical solution of the embodiment of the present application as optional solutions, and they all belong to the protection scope of the embodiment of the present application. The embodiment of the present application includes at least part of the following contents.

[0034] 1. Quantum computing: A computing method based on quantum logic. The basic unit of data storage is Qubit, quantum bit.

[0035] 2. Qubit: The basic unit of quantum computing. Traditional computers use 0 and 1 as the basic units of binary. The difference is that quantum computing can process 0 and 1 at the same time, and the system can be in a linear superposition state of 0 and 1: |ψ>=α|0>+β|1>, where α and β represent the complex probability amplitude of the system on 0 and 1. Their squared modulus |α| 2 ,|β| 2 represent the probabilities of being 0 and 1 respectively.

[0036] 3. Quantum state: The quantum state of a system can be represented as a linear combination of basis states. For example, for a system with 1 qubit, all possible basis states are 0 and 1, while for a system with 3 qubits, all possible basis states are 000, 001, 010, 011, 100, 101, 110, 111, a total of 8. Let these basis states be φ i , then the quantum state can be expressed as ∑ i c i φ i , where c i are the linear combination coefficients.

[0037] 4. Quantum circuit: A representation of a quantum universal computer, representing the hardware implementation of the corresponding quantum algorithm / program under the quantum gate model. The quantum circuit acts on the quantum state, obtains a new quantum state, and completes the quantum calculation. If the quantum circuit contains adjustable parameters for controlling the quantum gate, it is called a parameterized quantum circuit (PQC) or a variational quantum circuit.

[0038] 5. Energy measurement: Perform multiple measurements on the quantum circuit to determine the energy of the corresponding quantum system.

[0039] 6. UCC (Unitary Coupled-Cluster) quantum circuit: a special parameterized quantum circuit, mainly used for quantum calculation of chemical properties of molecular systems, which can be expressed mathematically as Among them, θ i is the i-th parameter in the UCC quantum circuit, G i is θ i The corresponding anti-Hermitian excitation operator. The UCC quantum circuit is essentially simulating the quantum state of the chemical system. Therefore, based on the variational principle, the optimization of θ i The energy of a molecule or material system can be obtained (the quantum state determines the energy), and the optimal θ i Other chemical properties can be further calculated later.

[0040] 7. UCC factor: A component factor in the UCC quantum circuit, that is The entire UCC circuit is obtained by multiplying the UCC factors, which can be efficiently realized on quantum circuits but are difficult to simulate on classical computers.

[0041] 8. Parameter optimization: By optimizing the parameters in the parameterized quantum circuit (i.e. the parameters corresponding to the quantum gate), the parameterized quantum circuit can represent the quantum state of the chemical system, thereby simulating the energy of the chemical system.

[0042] 9. Optimization Landscape: A graphical representation or visual presentation of the relationship between the objective function and the optimized variables, which reflects the various characteristics and features of the optimization problem. For the UCC quantum circuit, the objective function is the energy of the molecular system.

[0043] 10. Average optimization direction: the direction in which the parameter vector (i.e., the vector composed of all parameters of the quantum circuit) changes before and after the last complete iteration.

[0044] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0045] Please refer to Figure 1 , which shows a schematic diagram of a solution implementation environment provided by an embodiment of the present application. The solution implementation environment may include: a terminal device 10 and a server 20.

[0046] The terminal device 10 may be an electronic device such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart home appliance, a multimedia player, a PC (Personal Computer), a smart robot, a vehicle terminal, a wearable device, etc. The terminal device 10 may be installed with a client of a target application, and the target application may be any application for optimizing the parameters of a quantum circuit.

[0047] The server 20 is used to provide background services for the client of the target application in the terminal device 10. For example, the server 20 can be the background server of the target application. The server 20 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, etc. The embodiments of the present application are not limited to this.

[0048] The terminal device 10 and the server 20 can communicate with each other via a network 30. The network 30 can be a wired network or a wireless network.

[0049] Exemplarily, the user inputs the initial guess corresponding to the quantum circuit (i.e., the initial guess value of the parameter), the initial parameter direction set (i.e., the parameter direction set corresponding to the initial guess), and the energy required to be measured for the quantum system corresponding to the quantum circuit in the optimization process into the client in the terminal device 10. Based on these data, the client iteratively optimizes the parameters of the quantum circuit to obtain the optimized parameters, and replaces the initial guess of the quantum circuit with these optimized parameters to obtain the optimized quantum circuit. Optionally, the parameter optimization process can also be completed by the server 20, which is not limited in the embodiment of the present application.

[0050] Below, the technical solution provided by this application will be introduced and explained through method embodiments.

[0051] Please refer to Figure 2 , which shows a flow chart of a method for optimizing the parameters of a quantum circuit provided by an embodiment of the present application. The execution subject of each step of the method may be Figure 1 For the convenience of description, the terminal device 10 or the server 20 in the implementation environment of the illustrated solution is only introduced and explained with the execution subject of each step as the "client in the terminal device 10". The method may include at least one of the following steps (201-205):

[0052] Step 201, in the nth optimization process for the parameters of the quantum circuit, obtaining an initial parameter vector of the quantum circuit in the nth optimization process, the parameter vector has the parameters of the quantum circuit as elements, each parameter is used to control at least one quantum gate of the quantum circuit, and n is a positive integer.

[0053] The quantum circuit in the embodiment of the present application refers to a parameterized quantum circuit, which includes adjustable parameters for controlling quantum gates, and the parameters actually refer to the parameters contained in the quantum gates in the quantum circuit. Among them, the quantum gate (i.e., quantum logic gate) is the basic logic unit for operating quantum bits and is the basis of the quantum circuit.

[0054] The embodiments of the present application do not limit the above quantum circuit. For example, it can be a parameterized quantum circuit for simulating a chemical system, such as a quantum system of chemical molecules, chemical materials, etc. For example, the quantum circuit is a unitary coupled cluster UCC quantum circuit.

[0055] Optimizing the parameters of the quantum circuit, that is, optimizing the parameters of the quantum gates in the quantum circuit. The above optimization process refers to the process of making the quantum circuit after parameter optimization able to accurately represent the quantum state of the quantum system.

[0056] Optionally, the parameter vector is constructed using all parameters of the quantum circuit as elements, such as by taking the parameters contained in the quantum gate as elements in sequence according to the sequence of the quantum gates to construct the parameter vector. Considering that there are multiple quantum gates sharing the same parameter, the parameters corresponding to the quantum gate can be placed in the parameter vector in the order of the quantum gate that appears first among the multiple quantum gates. The embodiment of the present application does not limit the number of elements in the parameter vector, which can be the number of parameters corresponding to the quantum gate after deduplication or the number of parameters corresponding to the quantum gate without deduplication.

[0057] The above optimization process is an iterative process. The initial parameter vector in the embodiment of the present application may refer to the parameter vector to be optimized in each iterative process. For example, the initial parameter vector in the nth optimization process may refer to the parameter vector to be optimized in the nth optimization process. The nth optimization process may refer to any optimization process in the iterative process.

[0058] In one example, the process of determining the initial parameter vector may include the following contents.

[0059] 1. In the first optimization process for the parameters of the quantum circuit, based on the initial guess values ​​of the parameters of the quantum circuit, the initial parameter vector of the quantum circuit in the first optimization process is obtained.

[0060] The initial guess value of the parameter may refer to a value predicted for a global optimal solution of the parameter, where the global optimal solution of the parameter enables the quantum circuit to accurately simulate the quantum state of the quantum system. Alternatively, the initial guess value may also be referred to as an initial guess.

[0061] The embodiments of the present application do not limit the method for obtaining the initial guess. It can be understood that all methods that can be used to determine the initial guess are within the protection scope of the embodiments of the present application. Exemplarily, quantum chemical methods such as MP2 (second-order perturbation theory) can be used to determine the initial guess value of the parameter, and then the initial guess value of the parameter of the quantum circuit is used as an element to construct the initial parameter vector of the quantum circuit during the first optimization process. Among them, the more accurate the initial guess, the closer the initial parameter vector is to the global optimal solution, and the faster the convergence speed of the parameter vector.

[0062] For example, taking the UCC quantum circuit corresponding to the N2 (nitrogen) molecule as an example, refer to Figure 3 , Figure 3 The curves in FIG. 301 are the optimization landscapes 301 corresponding to the parameters in the UCC quantum circuit. The red dots 302 indicate the initial guesses of the parameters determined by the MP2 quantum chemical method. It can be seen that in most cases, the initial guesses are very close to the global optimal solution.

[0063] 2. In the mth optimization process for the parameters of the quantum circuit, the parameter vector after the (m-1)th optimization is determined as the initial parameter vector of the quantum circuit in the mth optimization process, where m is an integer greater than 1 and less than or equal to n.

[0064] The parameter vector after the m-1th optimization refers to the initial parameter vector of the quantum circuit in the m-1th optimization process, and the optimized parameter vector obtained after the m-1th optimization process. The optimized parameter vector is closer to the global optimal solution than the initial parameter vector.

[0065] Optionally, the embodiment of the present application only makes an initial guess in the first optimization process. For the second and subsequent optimization processes, the result of the previous optimization process can be used as the initial parameter vector of the next optimization process, thereby achieving iterative optimization of the parameter vector.

[0066] Step 202: Based on the initial parameter vector, a parameter direction set of the quantum circuit in the nth optimization process is obtained, wherein the parameter direction in the parameter direction set is used to indicate the optimization direction of the initial parameter vector.

[0067] The optimization direction refers to the direction of adjusting the initial parameter vector to the global optimal solution. The parameter direction set may include at least one parameter direction. The number of parameter directions corresponding to the parameter direction set is related to the number of elements corresponding to the initial parameter vector, such as the number of parameter directions corresponding to the parameter direction set is equal to the number of elements corresponding to the initial parameter vector, and the elements in the parameter direction are equal to the number of elements corresponding to the initial parameter vector. The relationship between the parameter direction and the parameter vector can be set and adjusted according to actual use requirements, and the embodiments of the present application are not limited to this.

[0068] In one example, the unit direction of the initial parameter vector may be used as the parameter direction, and the process of obtaining the parameter direction set may include the following contents.

[0069] 1. Get the unit vector of the initial parameter vector, the direction of which is the same as the direction of the component of the initial parameter vector.

[0070] The unit vector in the embodiment of the present application is the above-mentioned unit direction, and the modulus of the unit vector is 1. Exemplarily, if the quantum circuit includes parameter a and parameter b, the parameter vector can be expressed as (a, b), and the unit vector corresponding to the parameter vector can include: (0, 1) and (1, 0); if the quantum circuit includes parameter a, parameter b and parameter c, the parameter vector can be expressed as (a, b, c), and the unit vector corresponding to the parameter vector can include: (0, 0, 1), (0, 1, 0) and (1, 0, 0). In this way, using the unit direction as the parameter direction can simplify the optimization calculation of the parameters, which is beneficial to improving the parameter optimization efficiency of the quantum circuit.

[0071] 2. Combine the unit vectors of the initial parameter vector to obtain the parameter direction set of the quantum circuit in the nth optimization process.

[0072] The embodiment of the present application does not limit the order of combining unit vectors. Exemplarily, based on the above embodiment, by combining (0, 1) and (1, 0), the parameter direction set corresponding to the initial parameter vector can be obtained. Optionally, in each optimization process, the same parameter direction set can be used, or the parameter direction set can be updated and the updated parameter direction set can be used. The embodiment of the present application does not limit this. The method for updating the parameter direction set will be described in detail below and will not be repeated here.

[0073] Step 203, under the constraint of the parameter direction set, solving the energy fitting function of the quantum circuit to obtain a coefficient set; wherein the energy fitting function is used to fit the energy of the quantum system corresponding to the quantum circuit, and the coefficient set includes the solution of the coefficients of each term in the energy fitting function.

[0074] The above energy fitting function can be an optimization landscape of a quantum circuit, which can reflect the relationship between the energy of the quantum system corresponding to the quantum circuit and the parameter vector of the quantum circuit. Since the quantum circuit is essentially simulating the quantum state of the quantum system, the parameters of the quantum circuit can be used to simulate and control the quantum state of the quantum system, and the quantum state of the quantum system determines the energy of the quantum system, and thus the parameters of the quantum circuit can be used to simulate and control the energy of the quantum system.

[0075] The graphical representation corresponding to the energy fitting function can be fitted with a function related to the variable, and then the energy fitting function can be obtained by constructing an equation between the energy and the polynomial constructed by the variable. The coefficients of each term in the energy fitting function are unknown numbers, and the energy corresponding to different values ​​of the variable can be substituted into the energy fitting function to solve for the coefficients of each term.

[0076] In one example, the energy fitting function is a quadratic function of a single variable. Exemplarily, the energy fitting function can be expressed as follows:

[0077]

[0078] in, For quantum circuits in parameter vector The corresponding energy under the condition, a, b and c are the parameters to be solved, x is a single variable, is the initial parameter vector Parameter direction.

[0079] Optionally, in an optimization process, the energy fitting function of the quantum circuit is solved in turn according to each parameter direction in the parameter direction set to obtain a coefficient set corresponding to each parameter direction, and then the coefficient set corresponding to each parameter direction is combined to obtain the coefficient set corresponding to this optimization process.

[0080] For example, taking the energy fitting function as a quadratic function of a single variable as an example, refer to Figure 4 , step 203 may also include the following sub-steps.

[0081] Step 203a: for the i-th parameter direction in the parameter direction set, sample the single variable with the first step length to obtain a variable value set, the variable value set includes three variable values, and i is a positive integer.

[0082] The i-th parameter direction mentioned above may refer to any parameter direction in the parameter direction set. The first step length is the sampling step length of the single variable, which can be set and adjusted according to empirical values. The variable value is the sampling value of the single variable mentioned above.

[0083] Optionally, the quality of the energy fitting function depends on the selection of a single variable x. When the optimized parameters are close to the global optimal solution, the smaller x is, the higher the quality of the energy fitting function. However, quantum computers themselves have statistical errors, and unless a large number of measurements are performed, each energy measurement value is significantly affected by noise. When noise exists, setting x to a smaller value does not guarantee an improvement in the quality of the energy fitting function, but may instead result in a large error.

[0084] Based on these observations, in the embodiment of the present application, when the variable value is taken as a smaller value, the first step length is also set to a smaller value, such as 0.1, 0.15, 0.2, etc., which can make the first step length smaller under different variable values. The difference between them is large, which makes the different The difference between the energies measured under the condition is large, so that it is more robust to noise (a smaller step size will fully consider the influence of noise), thereby improving the fitting quality of the energy fitting function.

[0085] For example, reference Figure 3 Due to the characteristics of quantum gates, the parameters of quantum circuits are generally [-π,π]. Figure 3 It can be seen that when x is around 1, the optimization landscape of the UCC quantum circuit is more in line with the shape of a quadratic function. Therefore, in the embodiment of the present application, the sampling step of x can be fixed to 0.1, and the value range of x can be limited to [-1, 1], so that the quadratic function can be fitted more effectively and the noise can be more robust. For example, the variable value set can include 0.1, 0 and -0.1.

[0086] Since the above energy fitting function is a quadratic function of a single variable, there are only three terms (i.e., quadratic term, linear term and constant term) whose coefficients are unknown (i.e., a, b and c). It is only necessary to obtain three different variable values ​​and the energy under the three different variable values ​​to solve a, b and c. This can effectively reduce the workload of energy measurement and is conducive to improving the parameter optimization efficiency of quantum circuits.

[0087] Step 203b: for each variable value in the variable value set, based on the variable value, the parameter vector corresponding to the ith parameter direction, and the ith parameter direction, obtain the measurement parameter corresponding to the variable value.

[0088] The parameter vector corresponding to the ith parameter direction refers to the parameter vector to be adjusted in the ith parameter direction. For example, when i is greater than 1, the parameter vector corresponding to the ith parameter direction may refer to the parameter vector adjusted in the i-1th parameter direction; when i is equal to 1, the parameter vector corresponding to the ith parameter direction may refer to the initial parameter vector.

[0089] The measurement parameters refer to the parameters used for energy measurement, which can be expressed as follows: in, is the parameter vector corresponding to the i-th parameter direction, is the i-th parameter direction, x is the variable value, and thus the measurement parameters of the three different variable values ​​are obtained.

[0090] Step 203c: based on the measurement parameters corresponding to the values ​​of the variables, an energy set corresponding to the quantum circuit is obtained, where the energy set includes the energy corresponding to the quantum circuit under the measurement parameters.

[0091] According to the three measurement parameters corresponding to the i-th parameter direction, the energy of the quantum circuit under the three measurement parameters is measured respectively to obtain the energy set corresponding to the i-th parameter direction. The measured energy can be expressed as: For example, the measurement parameters are set as the parameters of the quantum circuit to obtain the quantum state corresponding to the quantum circuit, and then the energy of the quantum system corresponding to the quantum circuit is obtained based on the quantum state measurement.

[0092] Step 203d, bringing each energy in the energy set into the energy fitting function for solution, and obtaining the coefficient set corresponding to the i-th parameter direction; wherein the coefficient set includes the solution of the coefficient of the quadratic term, the solution of the coefficient of the linear term and the solution of the constant term of the energy fitting function.

[0093] Optionally, by substituting the three variable values ​​and the three energies into the energy fitting function, three equations can be obtained. By solving the three equations, the solutions of the coefficients of the quadratic terms, the coefficients of the linear terms and the constant terms (i.e. a, b and c mentioned above) can be obtained.

[0094] It should be noted that the acquisition of coefficient sets in each parameter direction should be carried out in correspondence with the parameter vector adjustment process in each parameter direction. For example, after obtaining the coefficient set corresponding to the i-th parameter direction, the parameter vector adjustment process in the i-th parameter direction is performed based on the coefficient set corresponding to the i-th parameter direction, and then the coefficient set corresponding to the i+1-th parameter direction is obtained. For ease of understanding, the acquisition of coefficient sets is explained separately here.

[0095] Step 204 , based on the coefficient set and the parameter direction set, the initial parameter vector is optimized to obtain the parameter vector after the nth optimization.

[0096] Optionally, in each optimization process, the initial parameter vector is iteratively adjusted according to the parameter directions in the parameter direction set and the coefficient sets corresponding to the parameter directions, so as to obtain the optimized parameter vector corresponding to the optimization process.

[0097] In one example, taking the energy fitting function as a quadratic function of a single variable as an example, step 204 may also include the following content.

[0098] 1. For the i-th parameter direction in the parameter direction set, based on the i-th parameter direction and the coefficient set corresponding to the i-th parameter direction, the parameter vector corresponding to the i-th parameter direction is adjusted to obtain the i-th adjusted parameter vector.

[0099] Optionally, when i is equal to 1, the parameter vector corresponding to the i-th parameter direction is the initial parameter vector, and when i is greater than 1, the parameter vector corresponding to the i-th parameter direction is the parameter vector adjusted for the i-1th time. The adjusted parameter vector refers to the parameter vector after the parameter direction is adjusted, such as the parameter vector after the i-th adjustment refers to the parameter vector after the i-th parameter direction is adjusted. The adjusted parameter vector is generally closer to the global optimal solution than the parameter vector before adjustment.

[0100] Exemplarily, the adjustment process of the parameter vector may be as follows:

[0101] (1) Based on the solution of the coefficient of the quadratic term and the solution of the coefficient of the linear term in the coefficient set corresponding to the i-th parameter direction, the adjustment parameter is obtained.

[0102] Optionally, the solution of the coefficient of the linear term is divided by the solution of the coefficient of the quadratic term to obtain a first division value, and then the adjustment parameter is obtained according to the first division value. Exemplarily, the adjustment parameter can be expressed as: b / 2a; wherein a is the solution of the coefficient of the quadratic term, and b is the solution of the coefficient of the linear term.

[0103] (2) Based on the adjustment parameter, the i-th parameter direction is adjusted to obtain the adjusted i-th parameter direction.

[0104] Optionally, the adjustment parameter and the ith parameter direction are multiplied to obtain the adjusted ith parameter direction, which can be expressed as:

[0105] (3) Based on the adjusted i-th parameter direction, the parameter vector corresponding to the i-th parameter direction is adjusted to obtain the i-th adjusted parameter vector.

[0106] Optionally, the parameter vector corresponding to the i-th parameter direction is subtracted from the adjusted i-th parameter direction to obtain the i-th adjusted parameter vector, which can be expressed as: It can be used to represent the optimization of the parameter vector corresponding to the i-th parameter direction in the i-th parameter direction, that is, the parameter vector corresponding to the i+1-th parameter direction

[0107] 2. When the i-th parameter direction is the last parameter direction in the parameter direction set, the parameter vector adjusted for the i-th time is determined as the parameter vector after the n-th optimization.

[0108] When the i-th parameter direction is not the last parameter direction in the parameter direction set, the parameter vector corresponding to the i+1-th parameter direction is adjusted based on the coefficient sets corresponding to the i+1-th parameter direction and the i+1-th parameter direction to obtain the parameter vector after the i+1-th adjustment, until the last parameter direction in the parameter direction set.

[0109] Optionally, after traversing each parameter direction in the parameter direction set corresponding to the n-th optimization process, a parameter vector after the n-th optimization is obtained.

[0110] Step 205, based on the parameter vector after the n-th optimization, obtain the quantum circuit after the n-th optimization.

[0111] Optionally, the initial parameter vector of the quantum circuit in the nth optimization process is replaced by the parameter vector after the nth optimization, so as to obtain the quantum circuit after the nth optimization.

[0112] When the energy corresponding to the quantum circuit after the nth optimization meets the iteration stop condition, the optimization of the parameters of the quantum circuit is stopped to obtain the optimized quantum circuit, that is, the quantum circuit after the nth optimization is determined as the optimized quantum circuit.

[0113] Among them, the iteration stop condition refers to the condition for stopping the optimization iteration, which may include at least one of the following: the energy change corresponding to two adjacent optimization processes is less than a threshold, the energy change during the iteration process tends to be stable, the parameter vector change corresponding to two adjacent optimization processes is less than a threshold, and the parameter vector change during the iteration process tends to be stable.

[0114] When the energy corresponding to the quantum circuit after the nth optimization does not meet the iteration stop condition, the parameters of the quantum circuit are continuously optimized based on the quantum circuit after the nth optimization, such as optimizing the initial parameter vector in the n+1th optimization process based on the parameter direction set in the n+1th optimization process to obtain the parameter vector after the n+1th optimization, until the optimized quantum circuit meets the iteration stop condition.

[0115] In summary, the technical solution provided by the embodiment of the present application constructs a parameter vector with the parameters of the quantum circuit as elements, and then optimizes the parameter vector based on the parameter direction set corresponding to the parameter vector and the coefficient set of the energy fitting function under the constraint of the parameter direction set, taking into account the mutual influence between the parameters and the situation where the parameters are not independent, which is conducive to improving the accuracy of parameter optimization of the quantum circuit. In addition, compared with the related art that only optimizes one or part of the parameters at a time, the embodiment of the present application directly optimizes the parameter vector corresponding to the quantum circuit as a whole, which is conducive to improving the parameter optimization efficiency of the quantum circuit.

[0116] In addition, by fitting the optimization landscape of quantum circuits (such as UCC quantum circuits) with a quadratic function of a single variable, it is only necessary to measure the energy under three different variable values ​​each time the parameters of the quantum circuit are adjusted, thereby reducing the workload of energy measurement during the parameter optimization process and improving the parameter optimization efficiency of the quantum circuit.

[0117] In addition, in the process of sampling variable values, sampling with smaller step sizes and smaller value requirements can effectively improve the robustness to noise, thereby improving the accuracy of parameter optimization of quantum circuits.

[0118] In some embodiments, the parameter direction The practice of setting it as a unit vector may lead to slow parameter convergence. Therefore, the embodiment of the present application also supports the use of an average optimization direction method to update the parameter direction set in the iterative process to speed up the parameter convergence of the quantum circuit. The above step 202 may also include the following content.

[0119] In the first optimization process of the parameters of the quantum circuit, the process of obtaining the parameter direction set can be as follows:

[0120] 1. Get the unit vector of the initial parameter vector in the first optimization process.

[0121] The method for obtaining the unit vector is the same as that described in the above embodiment and will not be repeated here.

[0122] 2. Combine the unit vectors of the initial parameter vectors in the first optimization process to obtain the parameter direction set of the quantum circuit in the first optimization process.

[0123] In the process of optimizing the parameters of the quantum circuit for the mth time, the process of obtaining the parameter direction set can be as follows:

[0124] 1. Obtain the parameter direction set of the quantum circuit in the m-1th optimization process.

[0125] Since the average optimization direction method acts on the next optimization process, for the m-th optimization process, it is necessary to obtain the parameter direction set in the m-1-th optimization process as a basis for updating.

[0126] 2. Eliminate the target parameter direction in the parameter direction set in the m-1th optimization process to obtain a transition parameter direction set.

[0127] Among them, the target parameter direction refers to the parameter direction that causes the energy of the quantum system to drop the most during the m-1th optimization process. Optionally, for each parameter direction in the parameter direction concentration during the m-1th optimization process, the adjusted parameter vector corresponding to each parameter direction is obtained, and then based on the adjusted parameter vector corresponding to each parameter direction, the energy of the quantum system corresponding to the quantum circuit under the adjusted parameter vector corresponding to each parameter direction is obtained, and then based on the energy changes corresponding to each parameter direction, the parameter direction with the most energy drop is determined as the target parameter direction.

[0128] 3. Obtain the first difference between the parameter vector after the m-th optimization and the initial parameter vector during the m-th optimization process.

[0129] The first difference represents the average direction of the parameter vector change after the last optimization process. For example, suppose the parameter direction set The parameter vectors before and after optimization are (i.e. the optimized parameter vector) and (i.e. the initial parameter vector), then the first difference can be expressed as The average direction of the parameter vector change can represent the overall optimization direction of the parameters, which is more accurate than the direction of a single parameter, thus helping to speed up the convergence of parameter optimization.

[0130] 4. Use the first difference as the first parameter direction in the transition parameter direction set to obtain the parameter direction set of the quantum circuit in the mth optimization process.

[0131] Will Add as the first parameter direction in the transition parameter direction set, and you can get the parameter direction set of the quantum circuit in the mth optimization process. The reason for deleting the above target parameter direction is: the target parameter direction and the newly added There may be a large overlap, and removing the target parameter direction can minimize the linear correlation of each parameter direction in the parameter direction set.

[0132] Optionally, you can also first Add to the parameter direction set of the previous round Then, the above target parameter direction is eliminated to obtain the parameter direction set of the quantum circuit in the current optimization process.

[0133] In summary, the technical solution provided in the embodiment of the present application adopts the "average optimization direction" to perform the next iterative optimization, thereby accelerating the convergence of parameter optimization.

[0134] In some embodiments, reference Figure 5 , taking the UCC quantum circuit as an example, the parameter optimization process of the UCC quantum circuit can be as follows:

[0135] 1. The client obtains the initial parameter vector and the initial parameter direction set V corresponding to the UCC quantum circuit.

[0136] Optionally, based on a first guess at the parameters of the UCC quantum circuit, construct an initial parameter vector Based on the unit direction of the initial parameter vector, an initial parameter direction set V is constructed. The initial parameter direction set V includes multiple parameter directions.

[0137] 2. The client determines whether V has been traversed.

[0138] The client adopts the parameter direction in V in turn For the initial parameter vector After all the parameter directions in V are used, the client determines that V has been traversed.

[0139] 3. If V is not traversed, the client optimizes the parameter vector along the parameter direction.

[0140] If the current parameter direction is not the last parameter direction in V, the client continues to optimize the parameter vector along the next parameter direction and continues to execute from step 2. The method for optimizing the parameter vector along the parameter direction is the same as that described in the above embodiment and will not be repeated here, that is, under the constraint of the parameter direction, the energy fitting function of the UCC quantum circuit is solved to obtain a coefficient set, and then based on the coefficient set and the parameter direction, the parameter vector is adjusted to obtain an adjusted parameter vector.

[0141] 4. If V has been traversed, the client determines whether the parameters have converged.

[0142] If the current parameter direction is the last parameter direction in V, the client detects whether the optimized quantum circuit satisfies the iteration stop condition. If it is detected that the optimized quantum circuit satisfies the iteration stop condition, it is determined that the parameters have converged.

[0143] 5. If the parameters have not converged, the client updates V and continues to execute from step 2.

[0144] Optionally, the client updates V using the “average optimization direction” method, and uses the updated V to optimize the parameter vector adjusted in this round of iterations.

[0145] If the parameters have converged, the client ends the parameter optimization process and obtains the optimized UCC quantum circuit. Optionally, the optimized UCC quantum circuit can be integrated into some quantum computing chemical simulation platforms to provide services such as quantum state simulation and chemical property calculation. Optionally, the technical solution provided in the embodiment of the present application can be referred to as SOAP, i.e. Sequential Optimization with Approximate Parabola, approximate parabola sequence optimization.

[0146] The technical solution provided in the embodiment of the present application can significantly improve the parameter optimization efficiency of the UCC quantum circuit. Figure 6 , Figure 6 SOAP is compared with other gradient-free optimizers implemented in SciPy (such as Nelder-Mead, COBYLA, and Powell). The vertical axis reflects the accuracy of molecular energy, the higher the better, and the horizontal axis is the number of energy calculations used by the optimizer, that is, the consumption of quantum computing resources. Figure 6 The chemical systems studied include N2 molecules, hydrogen chains consisting of 8 H, and CH4 methane molecules. In these molecules, the bond lengths are set from arrive There are 15 systems in total.

[0147] like Figure 6 As shown, in these 15 systems, the convergence efficiency of curve 601 corresponding to SOAP is higher than the convergence efficiency of curve 602 corresponding to Nelder-Mead, the convergence efficiency of curve 603 corresponding to COBYLA, and the convergence efficiency of curve 604 corresponding to Powell. Therefore, SOAP performs better than other optimizers. Among them, L-BFGS-B is a gradient-based optimizer with huge overhead, but the results are generally the most accurate. Its corresponding results can be regarded as the optimal energy that can be obtained by the UCC quantum circuit (i.e., curve 605). It can be seen that the optimization accuracy corresponding to SOAP is also relatively high. Optionally, the above simulations are all performed using a classical simulator of a quantum computer.

[0148] refer to Figure 7 , which shows the comparative results of further considering the effect of noise in the optimization process. For example, in each energy calculation, a noise with a standard deviation of 0.001 is added to the result of the energy calculation to simulate the effect of quantum noise. For each system and each method, five independent optimizations are performed, and the standard deviation of the optimized energy is represented by the shaded part. Figure 7It can be seen that among these 15 systems, the shaded portion of curve 701 corresponding to SOAP (i.e., the standard deviation of the optimized energy) is better than the shaded portion of curve 702 corresponding to Nelder-Mead, the shaded portion of curve 703 corresponding to COBYLA, and the shaded portion of curve 704 corresponding to Powell. It can be seen that the SOAP method is almost unaffected by noise, while other methods are sensitive to noise and may even fail completely in some cases.

[0149] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0150] Please refer to Figure 8 , which shows a block diagram of a quantum circuit parameter optimization device provided by an embodiment of the present application. The device 800 may include: an initial parameter acquisition module 801, a parameter direction acquisition module 802, a coefficient set acquisition module 803, a parameter vector optimization module 804 and a quantum circuit optimization module 805.

[0151] The initial parameter acquisition module 801 is used to obtain the initial parameter vector of the quantum circuit in the nth optimization process for the parameters of the quantum circuit, wherein the parameter vector has the parameters of the quantum circuit as elements, each of which is used to control at least one quantum gate of the quantum circuit, and n is a positive integer.

[0152] The parameter direction acquisition module 802 is used to obtain a parameter direction set of the quantum circuit in the nth optimization process based on the initial parameter vector, wherein the parameter direction in the parameter direction set is used to indicate the optimization direction of the initial parameter vector.

[0153] The coefficient set acquisition module 803 is used to solve the energy fitting function of the quantum circuit under the constraint of the parameter direction set to obtain a coefficient set; wherein the energy fitting function is used to fit the energy of the quantum system corresponding to the quantum circuit, and the coefficient set includes the solution of the coefficients of each term in the energy fitting function.

[0154] The parameter vector optimization module 804 is used to optimize the initial parameter vector based on the coefficient set and the parameter direction set to obtain the parameter vector after the nth optimization.

[0155] The quantum circuit optimization module 805 is used to obtain the quantum circuit after the nth optimization based on the parameter vector after the nth optimization.

[0156] In some embodiments, the initial parameter acquisition module 801 is used to:

[0157] In a first optimization process for the parameters of the quantum circuit, based on an initial guess value of the parameters of the quantum circuit, an initial parameter vector of the quantum circuit in the first optimization process is obtained;

[0158] Alternatively, in the mth optimization process for the parameters of the quantum circuit, the parameter vector after the (m-1)th optimization is determined as the initial parameter vector of the quantum circuit in the mth optimization process, where m is an integer greater than 1 and less than or equal to n.

[0159] In some embodiments, Fig. 9 As shown, the parameter direction acquisition module 802 includes: a unit vector acquisition submodule 802a and a parameter direction acquisition submodule 802b.

[0160] The unit vector acquisition submodule 802a is used to acquire the unit vector of the initial parameter vector, where the direction of the unit vector is the same as the direction of the component of the initial parameter vector.

[0161] The parameter direction acquisition submodule 802b is used to combine the unit vectors of the initial parameter vector to obtain a parameter direction set of the quantum circuit in the nth optimization process.

[0162] In some embodiments, the parameter direction acquisition submodule 802b is used to:

[0163] In a first optimization process for the parameters of the quantum circuit, unit vectors of initial parameter vectors in the first optimization process are combined to obtain a parameter direction set of the quantum circuit in the first optimization process;

[0164] Alternatively, in the m-th optimization process for the parameters of the quantum circuit, a parameter direction set of the quantum circuit in the m-1-th optimization process is obtained; the target parameter direction in the parameter direction set in the m-1-th optimization process is eliminated to obtain a transition parameter direction set, where the target parameter direction refers to the parameter direction that causes the energy of the quantum system to drop the most in the m-1-th optimization process; a first difference between the parameter vector after the m-th optimization and the initial parameter vector in the m-th optimization process is obtained; the first difference is used as the first parameter direction in the transition parameter direction set to obtain the parameter direction set of the quantum circuit in the m-th optimization process.

[0165] In some embodiments, the energy fitting function is a quadratic function of a single variable; the coefficient set acquisition module 803 is used to:

[0166] For the i-th parameter direction in the parameter direction set, sampling the single variable with the first step length to obtain a variable value set, wherein the variable value set includes three variable values, and i is a positive integer;

[0167] For each variable value in the variable value set, based on the variable value, the parameter vector corresponding to the i-th parameter direction, and the i-th parameter direction, obtaining a measurement parameter corresponding to the variable value;

[0168] Based on the measurement parameters corresponding to the respective variable values, an energy set corresponding to the quantum circuit is obtained, wherein the energy set includes the energy corresponding to the quantum circuit under the measurement parameters;

[0169] Each energy in the energy set is brought into the energy fitting function for solving, and a coefficient set corresponding to the i-th parameter direction is obtained; wherein the coefficient set includes the solution of the coefficient of the quadratic term, the solution of the coefficient of the linear term and the solution of the constant term of the energy fitting function.

[0170] In some embodiments, the energy fitting function is a quadratic function of a single variable; Fig. 9 As shown, the parameter vector optimization module 804 includes: a parameter vector adjustment submodule 804a and a parameter vector optimization submodule 804b.

[0171] The parameter vector adjustment submodule 804a is used to adjust the parameter vector corresponding to the i-th parameter direction in the parameter direction set based on the i-th parameter direction and the coefficient set corresponding to the i-th parameter direction, so as to obtain the parameter vector after the i-th adjustment; wherein, when i is equal to 1, the parameter vector corresponding to the i-th parameter direction is the initial parameter vector, and when i is greater than 1, the parameter vector corresponding to the i-th parameter direction is the parameter vector after the i-1-th adjustment.

[0172] The parameter vector optimization submodule 804b is used to determine the parameter vector adjusted for the ith time as the parameter vector optimized for the nth time when the ith parameter direction is the last parameter direction in the parameter direction set.

[0173] In some embodiments, the parameter vector adjustment submodule 804a is used to:

[0174] Obtaining adjustment parameters based on solutions of coefficients of quadratic terms and coefficients of linear terms in the coefficient set corresponding to the i-th parameter direction;

[0175] Based on the adjustment parameter, the i-th parameter direction is adjusted to obtain an adjusted i-th parameter direction;

[0176] Based on the adjusted i-th parameter direction, the parameter vector corresponding to the i-th parameter direction is adjusted to obtain the i-th adjusted parameter vector.

[0177] In some embodiments, the quantum circuit optimization module 805 is used to stop optimizing the parameters of the quantum circuit when the energy corresponding to the quantum circuit after the nth optimization meets the iteration stop condition, so as to obtain the optimized quantum circuit.

[0178] In some embodiments, the quantum circuit is a unitarily coupled cluster (UCC) quantum circuit.

[0179] In summary, the technical solution provided by the embodiment of the present application constructs a parameter vector with the parameters of the quantum circuit as elements, and then optimizes the parameter vector based on the parameter direction set corresponding to the parameter vector and the coefficient set of the energy fitting function under the constraint of the parameter direction set, taking into account the mutual influence between the parameters and the situation where the parameters are not independent, which is conducive to improving the accuracy of parameter optimization of the quantum circuit. In addition, compared with the related art that only optimizes one or part of the parameters at a time, the embodiment of the present application directly optimizes the parameter vector corresponding to the quantum circuit as a whole, which is conducive to improving the parameter optimization efficiency of the quantum circuit.

[0180] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0181] Please refer to Fig.10 , which shows a block diagram of a computer device provided in one embodiment of the present application. The computer device can be used to implement the parameter optimization method of the quantum circuit provided in the above embodiment, which specifically may include the following contents.

[0182] The computer device 1000 includes a central processing unit (such as a CPU (Central Processing Unit), a GPU (Graphics Processing Unit) and an FPGA (Field Programmable Gate Array)) 1001, a system memory 1004 including a RAM (Random-Access Memory) 1002 and a ROM (Read-Only Memory) 1003, and a system bus 1005 connecting the system memory 1004 and the central processing unit 1001. The computer device 1000 also includes a basic input / output system (Input Output System, I / O system) 1006 for helping various devices in the server to transmit information, and a large-capacity storage device 1007 for storing an operating system 1013, an application program 1014 and other program modules 1015.

[0183] The basic input / output system 1006 includes a display 1008 for displaying information and an input device 1009 such as a mouse and a keyboard for user inputting information. The display 1008 and the input device 1009 are connected to the central processing unit 1001 through an input / output controller 1010 connected to the system bus 1005. The basic input / output system 1006 may also include an input / output controller 1010 for receiving and processing inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 1010 also provides output to a display screen, a printer, or other types of output devices.

[0184] The mass storage device 1007 is connected to the central processing unit 1001 via a mass storage controller (not shown) connected to the system bus 1005. The mass storage device 1007 and its associated computer readable medium provide non-volatile storage for the computer device 1000. That is, the mass storage device 1007 may include a computer readable medium (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.

[0185] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other solid-state storage technology, CD-ROM, DVD (Digital Video Disc) or other optical storage, cassettes, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that the computer storage medium is not limited to the above. The above-mentioned system memory 1004 and mass storage device 1007 can be collectively referred to as memory.

[0186] According to the embodiment of the present application, the computer device 1000 can also be connected to a remote computer on the network through a network such as the Internet. That is, the computer device 1000 can be connected to the network 1012 through the network interface unit 1011 connected to the system bus 1005, or the network interface unit 1011 can be used to connect to other types of networks or remote computer systems (not shown).

[0187] The memory further includes a computer program, which is stored in the memory and configured to be executed by one or more processors to implement the parameter optimization method of the quantum circuit.

[0188] In some embodiments, a computer-readable storage medium is also provided, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor, the parameter optimization method of the quantum circuit described above is implemented.

[0189] Optionally, the computer-readable storage medium may include: ROM (Read-Only Memory), RAM (Random Access Memory), SSD (Solid State Drives) or an optical disk, etc. Among them, the random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).

[0190] In some embodiments, a computer program product is also provided, the computer program product comprising a computer program, the computer program being stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above-mentioned parameter optimization method for a quantum circuit.

[0191] It should be noted that, before collecting the relevant data of the user and in the process of collecting the relevant data of the user, the embodiment of the present application can display a prompt interface, a pop-up window or output a voice prompt information, and the prompt interface, pop-up window or voice prompt information is used to prompt the user that the relevant data is currently being collected, so that the present application only starts to execute the relevant steps of obtaining the relevant data of the user after obtaining the confirmation operation issued by the user to the prompt interface or pop-up window, otherwise (that is, when the confirmation operation issued by the user to the prompt interface or pop-up window is not obtained), the relevant steps of obtaining the relevant data of the user are terminated, that is, the relevant data of the user is not obtained. In other words, all user data collected by this application are processed strictly in accordance with the requirements of the laws and regulations of the relevant countries, and the informed consent or separate consent of the subject of personal information is obtained with the consent and authorization of the user. The subsequent data use and processing behavior is carried out within the scope of authorization of the laws and regulations and the subject of personal information, and the collection, use and processing of relevant user data need to comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the parameters, quantum circuits, energy, etc. involved in this application are all obtained with full authorization.

[0192] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application are not limited to this.

[0193] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for optimizing parameters of a quantum circuit, characterized in that: The method comprises: In an n-th optimization process for parameters of a quantum circuit, obtaining an initial parameter vector of the quantum circuit in the n-th optimization process, wherein the parameter vector has parameters of the quantum circuit as elements, each parameter is used to control at least one quantum gate of the quantum circuit, and n is a positive integer; Based on the initial parameter vector, a parameter direction set of the quantum circuit in the nth optimization process is obtained, wherein the parameter direction in the parameter direction set is used to indicate the optimization direction of the initial parameter vector; Under the constraint of the parameter direction set, solving the energy fitting function of the quantum circuit to obtain a coefficient set; wherein the energy fitting function is used to fit the energy of the quantum system corresponding to the quantum circuit, and the coefficient set includes solutions of the coefficients of each term in the energy fitting function; Based on the coefficient set and the parameter direction set, the initial parameter vector is optimized to obtain an n-th optimized parameter vector; Based on the parameter vector after the n-th optimization, the quantum circuit after the n-th optimization is obtained.

2. The method according to claim 1, characterized in that In the nth optimization process for the parameters of the quantum circuit, obtaining the initial parameter vector of the quantum circuit in the nth optimization process includes: In a first optimization process for the parameters of the quantum circuit, based on an initial guess value of the parameters of the quantum circuit, an initial parameter vector of the quantum circuit in the first optimization process is obtained; or, In the mth optimization process for the parameters of the quantum circuit, the parameter vector after the (m-1)th optimization is determined as the initial parameter vector of the quantum circuit in the mth optimization process, where m is an integer greater than 1 and less than or equal to n.

3. The method according to claim 1, characterized in that: The step of obtaining a parameter direction set of the quantum circuit in the nth optimization process based on the initial parameter vector includes: Obtaining a unit vector of the initial parameter vector, wherein the direction of the unit vector is the same as the direction of the component of the initial parameter vector; The unit vectors of the initial parameter vectors are combined to obtain a parameter direction set of the quantum circuit in the nth optimization process.

4. The method according to claim 3, characterized in that The method further comprises: In a first optimization process for the parameters of the quantum circuit, unit vectors of initial parameter vectors in the first optimization process are combined to obtain a parameter direction set of the quantum circuit in the first optimization process; or, In the m-th optimization process for the parameters of the quantum circuit, a parameter direction set of the quantum circuit in the m-1-th optimization process is obtained; a target parameter direction in the parameter direction set in the m-1-th optimization process is eliminated to obtain a transition parameter direction set, wherein the target parameter direction refers to a parameter direction that causes the energy of the quantum system to decrease the most in the m-1-th optimization process; a first difference between the parameter vector after the m-th optimization and the initial parameter vector in the m-th optimization process is obtained; the first difference is used as the first parameter direction in the transition parameter direction set to obtain the parameter direction set of the quantum circuit in the m-th optimization process.

5. The method according to claim 1, characterized in that The energy fitting function is a quadratic function of a single variable; Under the constraint of the parameter direction set, the energy fitting function of the quantum circuit is solved to obtain a coefficient set, including: For the i-th parameter direction in the parameter direction set, sampling the single variable with the first step length to obtain a variable value set, wherein the variable value set includes three variable values, and i is a positive integer; For each variable value in the variable value set, based on the variable value, the parameter vector corresponding to the i-th parameter direction, and the i-th parameter direction, obtaining a measurement parameter corresponding to the variable value; Based on the measurement parameters corresponding to the respective variable values, an energy set corresponding to the quantum circuit is obtained, wherein the energy set includes the energy corresponding to the quantum circuit under the measurement parameters; Each energy in the energy set is brought into the energy fitting function for solving, and a coefficient set corresponding to the i-th parameter direction is obtained; wherein the coefficient set includes the solution of the coefficient of the quadratic term, the solution of the coefficient of the linear term and the solution of the constant term of the energy fitting function.

6. The method according to claim 1, characterized in that The energy fitting function is a quadratic function of a single variable; The optimizing the initial parameter vector based on the coefficient set and the parameter direction set to obtain the parameter vector after the nth optimization includes: For the i-th parameter direction in the parameter direction set, based on the i-th parameter direction and the coefficient set corresponding to the i-th parameter direction, the parameter vector corresponding to the i-th parameter direction is adjusted to obtain the parameter vector adjusted for the i-th time; wherein, when i is equal to 1, the parameter vector corresponding to the i-th parameter direction is the initial parameter vector, and when i is greater than 1, the parameter vector corresponding to the i-th parameter direction is the parameter vector adjusted for the i-1th time; In a case where the i-th parameter direction is the last parameter direction in the parameter direction set, the parameter vector adjusted for the i-th time is determined as the parameter vector optimized for the n-th time.

7. The method according to claim 6, characterized in that The adjusting the parameter vector corresponding to the i-th parameter direction based on the i-th parameter direction and the coefficient set corresponding to the i-th parameter direction to obtain the i-th adjusted parameter vector includes: Obtaining adjustment parameters based on solutions of coefficients of quadratic terms and coefficients of linear terms in the coefficient set corresponding to the i-th parameter direction; Based on the adjustment parameter, the i-th parameter direction is adjusted to obtain an adjusted i-th parameter direction; Based on the adjusted i-th parameter direction, the parameter vector corresponding to the i-th parameter direction is adjusted to obtain the i-th adjusted parameter vector.

8. The method according to claim 1, characterized in that After obtaining the n-th optimized quantum circuit based on the parameter vector after the n-th optimization, the method further includes: When the energy corresponding to the quantum circuit after the n-th optimization satisfies the iteration stop condition, the optimization of the parameters of the quantum circuit is stopped to obtain the optimized quantum circuit.

9. The method according to claim 1, characterized in that: The quantum circuit is a unitarily coupled cluster (UCC) quantum circuit.

10. A parameter optimization device for a quantum circuit, characterized in that: The device comprises: An initial parameter acquisition module, used for acquiring an initial parameter vector of the quantum circuit in the nth optimization process for the parameters of the quantum circuit, wherein the parameter vector has the parameters of the quantum circuit as elements, each of which is used to control at least one quantum gate of the quantum circuit, and n is a positive integer; A parameter direction acquisition module, used to obtain a parameter direction set of the quantum circuit in the nth optimization process based on the initial parameter vector, wherein the parameter direction in the parameter direction set is used to indicate the optimization direction of the initial parameter vector; A coefficient set acquisition module, used to solve the energy fitting function of the quantum circuit under the constraint of the parameter direction set to obtain a coefficient set; wherein the energy fitting function is used to fit the energy of the quantum system corresponding to the quantum circuit, and the coefficient set includes solutions of the coefficients of each term in the energy fitting function; A parameter vector optimization module, used to optimize the initial parameter vector based on the coefficient set and the parameter direction set to obtain an n-th optimized parameter vector; The quantum circuit optimization module is used to obtain the quantum circuit after the nth optimization based on the parameter vector after the nth optimization.

11. A computer device, characterized in that: The computer device comprises a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which is loaded and executed by a processor to implement the method according to any one of claims 1 to 9.

13. A computer program product, characterized in that The computer program product comprises a computer program, wherein the computer program is stored in a computer-readable storage medium, and a processor reads and executes the computer program from the computer-readable storage medium to implement the method according to any one of claims 1 to 9.