CN115099514A - Data processing method and device, electronic equipment and storage medium - Google Patents

Data processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115099514A
CN115099514A CN202210800683.3A CN202210800683A CN115099514A CN 115099514 A CN115099514 A CN 115099514A CN 202210800683 A CN202210800683 A CN 202210800683A CN 115099514 A CN115099514 A CN 115099514A
Authority
CN
China
Prior art keywords
value
constraint
hard
parameter
operator
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210800683.3A
Other languages
Chinese (zh)
Inventor
吴涵卿
陈柄任
袁淏木
吴磊
李鑫
张晓旭
高振涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202210800683.3A priority Critical patent/CN115099514A/en
Publication of CN115099514A publication Critical patent/CN115099514A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • G06N10/60Quantum algorithms, e.g. based on quantum optimisation, quantum Fourier or Hadamard transforms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/06Asset management; Financial planning or analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Strategic Management (AREA)
  • Human Resources & Organizations (AREA)
  • Operations Research (AREA)
  • Accounting & Taxation (AREA)
  • Game Theory and Decision Science (AREA)
  • Marketing (AREA)
  • Finance (AREA)
  • General Business, Economics & Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Computational Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Tourism & Hospitality (AREA)
  • Artificial Intelligence (AREA)
  • Technology Law (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the application provides a data processing method, a data processing device, an electronic device and a storage medium, wherein a first value and an expectation condition are obtained, the first value is an initial value of a plurality of preset types of data of a user, and the expectation condition is a condition which is selected by the user and is expected to be achieved; processing the first value and the expectation condition by using a mean-variance model under integer constraint to obtain a second value, wherein the second value is an optimal solution of the mean-variance model under integer constraint; determining an initial state of a QOA (quantum efficiency optimization) algorithm based on the quantum state corresponding to the second value; carrying out iterative optimization on an operator in the hard-constraint hot start QOA to obtain a target final state of the hard-constraint hot start QOA; a third value is output based on the target final state of the hard constrained hot start QAOA. The technical scheme provided by the embodiment of the application can effectively improve the data processing efficiency and the accuracy of the determined third value.

Description

Data processing method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method and apparatus, an electronic device, and a storage medium.
Background
Markovitz proposes to apply a mathematical statistical approach to the study of portfolio selection by defining risk as the volatility of profitability. The mean-variance model proposed by markovitz is able to obtain an optimal solution for the mean-variance model while satisfying the requirements of as high a yield as possible and as low a risk of uncertainty as possible. The optimal solution of the mean-variance model is the corresponding solution when the two requirements reach the optimal balance. When the investment combination under the integral constraint is determined based on the mean-variance model, a large amount of time needs to be consumed, the accuracy of a calculation result cannot be guaranteed, and the requirements of users cannot be met.
At present, when the optimization problem of the investment portfolio is solved, a Lagrange multiplier method is used for solving a mean-variance model to obtain the optimal solution of the investment portfolio. However, the optimal solution obtained by the method may not be an integer and does not satisfy the integer constraint on the investment portfolio in the actual scene. If the non-integer optimal solution is subjected to rounding processing, the rounded solution is often not the optimal solution of the investment portfolio, so that the accuracy of the obtained investment portfolio is low.
Disclosure of Invention
The embodiment of the application provides a data processing method and device, electronic equipment and a storage medium, and the accuracy of data obtained by data processing can be effectively improved.
In a first aspect, an embodiment of the present application provides a data processing method, where the data processing method includes:
acquiring a first value and an expectation condition, wherein the first value is an initial value of a plurality of preset types of data of a user, and the expectation condition is a condition which is selected by the user and is expected to be achieved;
processing the first value and the expectation condition by using a mean-variance model under integer constraint to obtain a second value, wherein the second value is an optimal solution of the mean-variance model under integer constraint;
determining an initial state of a QOA (quantum efficiency optimization) algorithm based on the quantum state corresponding to the second value;
carrying out iterative optimization on an operator in the hard-constraint hot start QOA to obtain a target final state of the hard-constraint hot start QOA;
outputting a third value based on the target final state of the hard constrained hot start QOA.
Optionally, the operators in the hard-constraint hot start QAOA include a phase separation operator and a hard-constraint blending operator, and both the number of the phase separation operators and the number of the hard-constraint blending operators correspond to the depth value of the hard-constraint hot start QAOA.
The iterative optimization of the operator in the hard-constraint hot start QOA is performed to obtain the target final state of the hard-constraint hot start QOA, and the method comprises the following steps:
alternately acting a phase separation operator and a hard constraint hybrid operator on the initial state to obtain a first final state of the hard constraint hot start QOA;
repeatedly executing the steps for a preset number of times to obtain a preset number of first terminal states, and calculating the terminal state average value of the preset number of first terminal states;
updating a first parameter of the current phase separation operator and a second parameter of the current hard constraint hybrid operator according to the final state average value to obtain a new phase separation operator and a new hard constraint hybrid operator;
if the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator do not satisfy the convergence condition, then
Repeatedly executing the steps until the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator meet the convergence condition;
and determining a preset number of first final states obtained when the convergence condition is met as target final states according to the first parameters of the new phase separation operator and the second parameters of the new hard constraint mixed operator when the convergence condition is met.
Optionally, the updating, according to the final state mean value, the first parameter of the current phase separation operator and the second parameter of the current hard constraint mixed operator to obtain a new phase separation operator and a new hard constraint mixed operator includes:
determining an objective function corresponding to the final state mean value, wherein the objective function is a function in a mean-variance model under integer constraint;
determining a new first parameter and a new second parameter according to the objective function;
updating the first parameter of the current phase separation operator to the new first parameter to obtain a new phase separation operator;
and updating the second parameter of the current hard constraint hybrid operator into the new second parameter to obtain a new hard constraint hybrid operator.
Optionally, the convergence condition is:
||γ′-γ||+||β′-β||<∈;
where γ 'is the new first parameter, γ is the first parameter of the current phase separation operator, β' is the new second parameter, and β is the second parameter of the current hard constraint blending operator.
Optionally, the outputting a third value according to the target final state of the hard-constrained hot start QAOA includes:
determining an objective function corresponding to each first terminal state included in the target terminal states of the hard-constrained hot start QOA, wherein the objective function is a function in a mean-variance model under integer constraint;
determining an objective function with the minimum function value in the plurality of objective functions;
and determining the first final state corresponding to the minimum objective function as a third value, and outputting the third value.
Optionally, the determining an initial state of a hot start quantum approximation optimization algorithm QAOA according to the quantum state corresponding to the second value includes:
according to the formula
Figure BDA0003737474280000031
Determining an initial state of a hard-constrained hot start QOA;
wherein, | ψ 0 >For the initial state of the hard-constrained hot start QAOA,
Figure BDA0003737474280000032
representing the 1 st qubit corresponding to the first predetermined type of data in the ith first value,
Figure BDA0003737474280000033
represents the 2 nd qubit corresponding to the ith first preset type of data, and n is the number of the first preset type of data.
Optionally, the mean-variance model under the integer constraint is represented as:
Figure BDA0003737474280000034
Figure BDA0003737474280000035
0≤s ij ≤1,i∈{1,2,...,n},j∈{1,2}
wherein f (x) is an objective function of a mean-variance model under integer constraint, and lambda belongs to [0, 1 ]]Represents a risk preference coefficient, Σ ═ (σ) ij )∈R n×n A covariance matrix representing the first preset type of data in each first value,
Figure BDA0003737474280000036
representing data of a first predetermined typeCorresponding expected condition vector, 1 ∈ R n Is a vector of 1 for each element of the n-dimension, T represents the cost of a single transaction, y i E { -1, 0, 1} is the ith element of the vector y corresponding to the second preset type of data in the first value,
Figure BDA0003737474280000044
s ij represents the jth qubit corresponding to the ith first predetermined type of data.
Optionally, the phase separation operator is
Figure BDA0003737474280000041
Wherein, gamma is i E [0, 2 π) is a first parameter, C is a Hamiltonian, and the Hamiltonian is an objective function of a mean-variance model under integer constraint;
the hard constraint blending operator is
Figure BDA0003737474280000042
Wherein the content of the first and second substances,
Figure BDA0003737474280000043
the value range of the matrix B is related to the value range of the second parameter.
In a second aspect, an embodiment of the present application provides a data processing apparatus, including:
the device comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a first value and an expectation condition, the first value is an initial value of a plurality of preset types of data of a user, and the expectation condition is a condition which is selected by the user and is expected to be achieved;
the first processing module is used for processing the first value and the expectation condition by using a mean-variance model under integer constraint to obtain a second value, wherein the second value is an optimal solution of the mean-variance model under integer constraint;
the second processing module is used for determining the initial state of the QOA according to the quantum state corresponding to the second value;
the second processing module is also used for carrying out iterative optimization on an operator in the hard-constraint hot start QOA to obtain a target final state of the hard-constraint hot start QOA;
outputting a third value based on the target final state of the hard constrained hot start QOA.
Optionally, the operators in the hard-constraint hot start QAOA include a phase separation operator and a hard-constraint blending operator, and both the number of the phase separation operators and the number of the hard-constraint blending operators correspond to the depth value of the hard-constraint hot start QAOA.
The second quantity module is specifically configured to apply a phase separation operator and a hard constraint hybrid operator alternately to the initial state to obtain a first final state of the hard constraint hot start QAOA; repeatedly executing the steps for a preset number of times to obtain a preset number of first terminal states, and calculating the terminal state average value of the preset number of first terminal states; updating a first parameter of the current phase separation operator and a second parameter of the current hard constraint hybrid operator according to the final state mean value to obtain a new phase separation operator and a new hard constraint hybrid operator; if the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator do not meet the convergence condition, repeating the steps until the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator meet the convergence condition; and determining a preset number of first final states obtained when the convergence condition is met as target final states according to the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator when the convergence condition is met.
Optionally, the second data processing module is specifically configured to determine an objective function corresponding to the final state mean, where the objective function is a function in a mean-variance model under integer constraint; determining a new first parameter and a new second parameter according to the objective function; updating the first parameter of the current phase separation operator to the new first parameter to obtain a new phase separation operator; and updating the second parameter of the current hard constraint hybrid operator into the new second parameter to obtain a new hard constraint hybrid operator.
Optionally, the convergence condition is:
||γ′-γ||+||β′-β||<∈;
wherein γ 'is a new first parameter, γ is a first parameter of a current phase separation operator, β' is a new second parameter, and β is a second parameter of a current hard constraint blending operator.
Optionally, the second processing module is further configured to determine an objective function corresponding to each first final state included in the target final states of the hard-constraint hot start QAOA, where the objective function is a function in a mean-variance model under an integer constraint; determining an objective function with the minimum function value in the plurality of objective functions; and determining the first final state corresponding to the minimum objective function as a third value, and outputting the third value.
Optionally, the second processing module is specifically configured to perform processing according to a formula
Figure BDA0003737474280000051
The initial state of the hard constrained hot start QAOA is determined.
Wherein, | ψ 0 >For the initial state of the hard constrained hot start QAOA,
Figure BDA0003737474280000052
representing the 1 st qubit corresponding to the first predetermined type of data in the ith first value,
Figure BDA0003737474280000053
represents the 2 nd qubit corresponding to the ith first preset type of data, and n is the number of the first preset type of data.
Optionally, the mean-variance model under the integer constraint is represented as:
Figure BDA0003737474280000054
Figure BDA0003737474280000055
0≤s ij ≤1,i∈{1,2,...,n},j∈{1,2}
wherein f (x) is an objective function of a mean-variance model under integer constraint, and λ ∈ [0, 1 ]]Represents a risk preference coefficient, Σ ═ (σ) ij )∈R n×n A covariance matrix representing the first preset type of data in each first value,
Figure BDA0003737474280000064
representing the expected condition vector corresponding to each first preset type of data, 1 ∈ R n Is a vector of 1 for each element of the n-dimension, T represents the cost of a single transaction, y i E { -1, 0, 1} is the ith element of the vector y corresponding to the second preset type of data in the first value,
Figure BDA0003737474280000065
s ij represents the jth qubit corresponding to the ith first predetermined type of data.
Optionally, the phase separation operator is
Figure BDA0003737474280000061
Wherein, γ i E [0, 2 π) is the first parameter, C is the Hamiltonian, which is the objective function of the mean-variance model under integer constraints.
The hard constraint blending operator is
Figure BDA0003737474280000062
Wherein, the first and the second end of the pipe are connected with each other,
Figure BDA0003737474280000063
the value range of the matrix B is related to the value range of the second parameter.
In a third aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory to implement the method described in any one of the possible implementations of the first aspect.
In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, where a computer executable instruction is stored in the computer-readable storage medium, and when a processor executes the computer executable instruction, the method described in any one of the foregoing possible implementation manners of the first aspect is implemented.
In a fifth aspect, this application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program implements the method described in any one of the possible implementation manners of the first aspect.
Therefore, the embodiment of the application provides a data processing method, a data processing device, an electronic device and a storage medium, wherein a first value and an expectation condition are obtained, the first value is an initial value of a plurality of preset types of data of a user, and the expectation condition is a condition which is selected by the user and is expected to be achieved; processing the first value and the expectation condition by using a mean-variance model under integer constraint to obtain a second value, wherein the second value is an optimal solution of the mean-variance model under integer constraint; determining an initial state of a QOA (quantum efficiency optimization) algorithm based on the quantum state corresponding to the second value; iterative optimization is carried out on an operator in the hard-constraint hot start QOA to obtain a target final state of the hot start QOA; a third value is output based on the target final state of the hard constrained hot start QAOA. The technical scheme provided by the embodiment of the application utilizes a mean-variance model under integer constraint to obtain an optimal solution, namely a second value, on a real number domain, and can meet the integer constraint of a real condition on the optimal solution. And determining an initial state of the hard-constrained hot start QOA according to the optimal solution in the real number domain, obtaining a third value by using the hard-constrained hot start QOA, and accelerating the solving efficiency of a mean-variance model by using the parallelism of quantum computation, thereby effectively improving the efficiency of data processing and improving the accuracy of the determined third value.
Drawings
Fig. 1 is a schematic flowchart of a data processing method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a quantum line structure provided in an embodiment of the present application;
fig. 3 is a schematic flowchart of another data processing method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device provided in the present application.
With the foregoing drawings in mind, certain embodiments of the disclosure have been shown and described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
In the embodiments of the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural. In the description of the text of the present application, the character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
The technical scheme provided by the embodiment of the application can be applied to the scene of investment asset allocation. The problem of optimizing investment portfolios is a problem which is always concerned in the financial field, and the main idea is to determine investment portfolios with higher income and lower risk.
At present, the portfolio problem can be solved through a mean-variance model to obtain an optimal solution for the portfolio. However, the optimal solution obtained by this method may not be an integer, and does not conform to the integer constraint of the real condition, for example, the minimum unit of a stock market transaction is 1. Under the integer constraint of the actual condition, the investment combination of the integers can be obtained by rounding the optimal solution obtained by the mean-variance matrix. However, the obtained integer investment portfolio is often not the optimal solution of the mean-variance model, and the accuracy of the investment portfolio obtained by the mean-variance model is reduced.
In order to solve the problem that when the mean-variance matrix is used for solving the optimal solution of the investment portfolio, the obtained investment portfolio does not meet the requirements of an actual scene, integer limits meeting the actual scene can be introduced into the mean-variance model, so that the solution of the mean-variance model can meet the integer constraints of the actual scene, and the solution obtained by the mean-variance model under the integer constraints is optimized through a thermally-started hard-constrained quantum approximation optimization algorithm QOA to obtain a final solution. The accuracy of solving the optimal solution can be effectively improved through a mean-variance model under integer constraint and a hot start hard constraint QOA.
Hereinafter, the data processing method provided in the present application will be described in detail by specific examples. It is to be understood that the following detailed description may be combined with the accompanying drawings, and that the same or similar concepts or processes may not be described in detail in connection with certain embodiments.
Fig. 1 is a schematic flowchart of a data processing method according to an embodiment of the present application. The data processing method may be performed by software and/or hardware means, for example, the hardware means may be a data processing means, and the data processing means may be an electronic device or a processing chip in the electronic device. For example, the electronic device implementing the data processing apparatus in the embodiment of the present application may be a classic computer, or may be a combination of a classic computer and a quantum computer, and the embodiment of the present application is not particularly limited to a computer.
As shown in fig. 1, the data processing method may include:
s101, acquiring a first value and an expectation condition.
The first value is an initial value of a plurality of preset types of data of the user, and the expectation condition is a condition which is selected by the user and is expected to be achieved.
For example, where the first value and the expectation condition are used to calculate the portfolio, the first value may include parameters such as a number of assets, a covariance matrix for the profitability of each asset, the cost of a single transaction, currently held asset data, net investment constraints, and the like. The expectation condition may be an expected return rate vector, risk preference factor for each asset. The present embodiment is described by taking the first value and the expectation condition as an example, but the present embodiment is not limited thereto.
S102, processing the first value and the expectation condition by using a mean-variance model under integer constraint to obtain a second value, wherein the second value is an optimal solution of the mean-variance model under integer constraint.
For example, when the first value and the expectation condition are processed by the mean-variance model under the integer constraint, the first value and the expectation condition may be input into the mean-variance model under the integer constraint, so that the mean-variance model under the integer constraint outputs an optimal solution, for example, an optimal solution of the investment portfolio, according to the input parameters.
It will be appreciated that after the second value is obtained, further processing by the hard-constrained hot-start quantum approximation optimization algorithm QAOA is required according to the second value. Since the hard-constrained hot-start QAOA requires the use of quantum states for operation, the mean-variance model under integer constraint can be expressed by the following equation (1):
Figure BDA0003737474280000091
in the above formula (1), f (x) is an objective function of a mean-variance model under integer constraint, and λ ∈ [0, 1 ]]Represents a risk preference coefficient, Σ ═ (σ) ij )∈R n×n A covariance matrix representing the first preset type of data in each first value,
Figure BDA0003737474280000092
representing the expected condition vector corresponding to each first preset type of data, 1 ∈ R n Is a vector of 1 for each element of the n dimensions, T represents the cost of a single transaction, y i E { -1, 0, 1} is the ith element of the vector y corresponding to the second preset type of data in the first value,
Figure BDA0003737474280000093
s ij indicating the j-th qubit corresponding to the i-th first predetermined type of data.
It can be understood that, when solving the portfolio problem, the first preset type data in the first value is a covariance matrix of the profitability of each asset, and the expected condition vector corresponding to each first preset type data is an expected return rate vector of the profitability of each asset, y i E { -1, 0, 1} is the ith element of the original holding quantity vector y of the asset, which represents the current holding condition of the asset i, s ij A jth qubit for the ith asset. The two qubits corresponding to the asset constitute a quantum state corresponding to the asset, and the quantum state corresponding to each asset corresponds to the investment share of each asset.
For example, when the first value and the expectation condition are processed by using a mean-variance model under integer constraint, the investment share vectors may be mapped onto quantum states first. Taking the value of the investment share as-1, 0, 1 for example, an asset may be encoded with 2 qubits. I.e. the asset contains two qubits in its corresponding quantum state. Wherein, the investment share of-1 represents that the decision maker holds the empty share for the asset, the investment share of 0 represents that the decision maker does not hold the asset, and the investment share of 1 represents that the decision maker holds the share for the asset.
In the quantum domain, one qubit can simultaneously represent |0>And |1>Superposition of the two ground states. The quantum state corresponding to the quantum bit is recorded as | psi>Then we have | ψ>=a|0>+b|1>Wherein the amplitudes a, b satisfy | a 2 +|b| 2 A set of complex numbers equal to 1. In measuring a quantum state as | psi>=a|0>+b|1>Quantum bit of (1), with | a- 2 Probability of (2)To obtain |0>Corresponding to classical bit 0, with | b + 2 Probability of (D) to obtain |1>Corresponding to classical bit 1. In the calculation process, the quantum state | ψ is generally considered>Is a two-dimensional complex vector
Figure BDA0003737474280000101
By analogy, n qubits can represent a 2n dimensional complex vector.
The corresponding relationship between the quantum state corresponding to the asset and the investment share can be seen in the following table 1:
TABLE 1
Quantum state Value of investment share
|00> 0
|01> 1
|10> -1
|11> 0
As shown in table 1, it can be seen that the value of the investment share can be obtained by subtracting the first qubit from the second qubit in the quantum state. The examples of the present application are described by taking the examples shown in table 1 as examples, but do not represent that the examples of the present application are limited thereto.
In the embodiment of the application, the mean-variance model under the integer constraint is set as the mean-variance model under the integer constraint containing the quantum state, so that the expression form of the obtained optimal solution is in the quantum state form, the phenomenon that a large amount of time is wasted due to the fact that the optimal solution is converted into the optimal solution in the quantum state form is avoided, and the data processing efficiency is reduced.
S103, determining an initial state of a QOA (quantum optimization algorithm) based on the quantum state corresponding to the second value.
For example, when the initial state of the hot start quantum approximation optimization algorithm QAOA is determined according to the quantum state corresponding to the second value, the initial state of the hard-constrained hot start QAOA may be determined according to the following formula (2);
Figure BDA0003737474280000102
wherein, | ψ 0 >For the initial state of the hard-constrained hot start QAOA,
Figure BDA0003737474280000103
representing the 1 st qubit corresponding to the first predetermined type of data in the ith first value,
Figure BDA0003737474280000111
represents the 2 nd qubit corresponding to the ith first preset type of data, and n is the number of the first preset type of data. For example, the first preset type data in the first value represents an asset, i.e. n is the number of assets.
In the embodiment of the present application, the initial state of the hard-constraint hot start QAOA can be accurately calculated according to the formula (2), and the second value output by the hard-constraint hot start QAOA is effectively increased.
And S104, carrying out iterative optimization on an operator in the hard-constraint hot start QOA to obtain a target final state of the hard-constraint hot start QOA.
When iterative optimization is performed on an operator in the hard-constraint hot-start QOA, iteration can be performed by using a quantum line constructed according to the hard-constraint hot-start QOA, and a target final state of the hard-constraint hot-start QOA is obtained.
Illustratively, the operators in the hard-constraint hot-start QAOA include a phase separation operator and a hard-constraint blending operator, both of which correspond to depth values of the hot-start QAOA.
When iterative optimization is carried out on an operator in the hard-constraint hot-start QOA to obtain a target final state of the hard-constraint hot-start QOA, a first final state of the hard-constraint hot-start QOA can be obtained by alternately acting a phase separation operator and a hard-constraint mixed operator on an initial state; and repeatedly executing the steps for a preset number of times to obtain a preset number of first final states, and calculating the average value of the preset number of first final states. And updating the first parameter of the current phase separation operator and the second parameter of the current hard constraint hybrid operator according to the final state average value to obtain a new phase separation operator and a new hard constraint hybrid operator.
In the present application, when the phase separation operator and the hard constraint hybrid operator are alternately applied to the initial state, it can be performed by a quantum wire in which the number of the phase separation operator and the hard constraint hybrid operator is related to the depth of the quantum wire.
Taking the number of quantum wires as 4 as an example, a phase separation operator and a hard constraint hybrid operator are alternately applied to the initial state to obtain a chain sub-wire corresponding to the final state, as shown in fig. 2. Fig. 2 is a schematic diagram of a quantum line structure provided in an embodiment of the present application. The quantum wire shown in fig. 2 includes p phase separation operators and p hard constraint hybrid operators, and the p phase separation operators and the p hard constraint hybrid operators are alternately applied to the input initial state, so that the final state can be obtained. The quantum wires in the embodiments of the present application are described with reference to fig. 2 as an example, but the embodiments of the present application are not limited thereto.
In the present application, the phase separation operator can be expressed by the following formula (3):
Figure BDA0003737474280000112
in the above formula (3), γ i E [0, 2 π) as the first parameter, C as the Hamiltonian, HamiltonianAnd an objective function of a mean-variance model under integer constraints.
The hard constraint blending operator can be represented by the following equation (4):
Figure BDA0003737474280000121
in the above-mentioned formula (4),
Figure BDA0003737474280000122
the value range of the matrix B is related to the second parameter.
Further, after obtaining a new phase separation operator and a new hard constraint hybrid operator, judging whether the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator meet a convergence condition. And if the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator do not meet the convergence condition, repeating the steps until the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator meet the convergence condition. And when the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator meet the convergence condition, determining a preset number of first final states which are calculated according to the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator when the convergence condition is met as target final states. Illustratively, when the convergence condition is not satisfied, the above steps need to be performed again, including the step of determining a new plurality of first final states, resulting in a new phase separation operator and a new hard constraint blending operator.
It can be understood that, when it is determined that the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator satisfy the convergence condition, the old parameter is updated by using the new parameter satisfying the convergence condition, and the step of calculating the first final states is performed, so as to determine a preset number of first final states obtained at this time as the target final states.
Illustratively, the operators are mixed by alternating the phase separation operator and the hard constraint on the initial state in the first passWhen the first final state of the hard-constraint hot start QOA is obtained, the first parameter in the phase separation operator is the initial parameter, and the second parameter in the hard-constraint hybrid operator is also the initial parameter, for example, both the initial parameters are the initial parameters
Figure BDA0003737474280000123
Where p represents the depth of the quantum wire, the parameters of the quantum wire are not limited in this application.
The step of calculating the first final state by the preset number of times can obtain one first final state in each execution, so that the preset number of first final states can be obtained after repeating the preset number of times. For example, after 1000 steps of calculating the first final states are performed, 1000 first final states are obtained. The preset number can be set according to actual conditions, and the embodiment of the application does not limit the preset number.
In the embodiment of the application, the final state of the hard-constraint hot start QOA is measured for multiple times, so that the first parameter of the phase separation operator and the second parameter of the hard-constraint hybrid operator are optimized iteratively. And when the obtained new first parameter and the new second parameter meet the convergence condition, the target final state is determined, so that the accuracy of the determined target final state can be effectively improved, and the accuracy of the determined second value is improved.
And judging whether the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator meet the convergence condition or not, wherein the judgment needs to be carried out through the obtained new first parameter and new second parameter and the first parameter and second parameter used last time. For example, the convergence condition is described with reference to the following equation (5):
||γ′-γ||+||β′-β||<∈ (5)
in the above formula (5), γ 'is a new first parameter, γ is a first parameter of the current phase separation operator, β' is a new second parameter, β is a second parameter of the current hard constraint blending operator, and e represents the precision parameter.
It can be understood that the smaller the value of e is, the higher the accuracy of the obtained target final state is. To further enhance the target final state obtainedAccuracy, e can be set to a small positive number, e.g., 10 -3
In the embodiment of the application, the accuracy of the determined target final state can be effectively improved by calculating the Euclidean distance between two continuous first parameters and two continuous second parameters, namely calculating the Euclidean distances between the old and new first parameters and the second parameters.
When a first parameter of a current phase separation operator and a second parameter of a current hard constraint hybrid operator are updated to obtain a new phase separation operator and a new hard constraint hybrid operator, a target function corresponding to a final state mean value can be determined, wherein the target function is a function in a mean-variance model under integer constraint; determining a new first parameter and a new second parameter according to the objective function; updating the first parameter of the current phase separation operator to a new first parameter to obtain a new phase separation operator; and updating the second parameter of the current hard constraint hybrid operator into a new second parameter to obtain a new hard constraint hybrid operator.
For example, a classical algorithm pair may be used to update the first parameter of the current phase separation operator to a new first parameter, and the second parameter of the current hard constraint blending operator to a new second parameter. Such as the classical algorithms of COBYLA, gradient descent, and annealing.
In the embodiment of the application, a new first parameter and a new second parameter are determined according to the objective function, and the parameters in the current phase separation operator and the current hard constraint hybrid operator are updated, so that the obtained target final state is a target final state meeting the convergence condition, and the accuracy of the obtained target final state is improved.
S105, outputting a third value according to the target final state of the hard constraint hot start QOA.
For example, when the third value is output according to the target final state of the hard-constrained hot start QAOA, the target function may be determined by determining a target function corresponding to each first final state included in the target final state of the hard-constrained hot start QAOA, where the target function is a function in a mean-variance model under an integer constraint; determining an objective function with the minimum function value in the plurality of objective functions; and determining the first final state corresponding to the minimum objective function as a third value, and outputting the third value.
In solving the problem of investment portfolio optimization, the objective function in the mean-variance model under integer constraint can be understood as the corresponding optimal solution at risk minimum. Therefore, the first final state corresponding to the minimum objective function is determined as a third value, so that the determined third value is the optimal solution of the investment portfolio obtained when the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator meet convergence. And the obtained investment combination is an optimal investment combination of integer constraint and can meet the practical conditions.
In the embodiment of the present application, the third value is determined according to the objective function with the smallest function value among the plurality of objective functions, so that the determined third value satisfies the integer constraint and is the objective function with the smallest risk value.
Therefore, the data processing method provided by the embodiment of the application obtains the first value and the expectation condition, wherein the first value is an initial value of a plurality of preset types of data of a user, and the expectation condition is a condition which is selected by the user and is expected to be achieved; processing the first value and the expectation condition by using a mean-variance model under integer constraint to obtain a second value, wherein the second value is an optimal solution of the mean-variance model under integer constraint; determining an initial state of a QOA (quantum efficiency optimization) algorithm based on the quantum state corresponding to the second value; carrying out iterative optimization on an operator in the hard-constraint hot start QOA to obtain a target final state of the hard-constraint hot start QOA; a third value is output based on the target final state of the hard constrained hot start QAOA. According to the technical scheme, the optimal solution, namely the second value, in the real number domain is obtained by using the mean-variance model under the integer constraint, and the integer constraint of the optimal solution under the actual condition can be met. And determining an initial state of the hard-constrained hot start QOA according to the optimal solution in the real number domain, obtaining a third value by using the hard-constrained hot start QOA, and accelerating the solving efficiency of a mean-variance model by using the parallelism of quantum computation, thereby effectively improving the efficiency of data processing and improving the accuracy of the determined third value.
The mean-variance model under the integer constraint in the present application can be obtained by transforming a conventional mean-variance model. Taking the solution of the optimization problem of the investment portfolio as an example, the mean-variance model under the integer constraint obtained according to the mean-variance model is described in the present application.
For example, the mean-variance model proposed by markovitz can be expressed by the following equation (6):
Figure BDA0003737474280000151
in the above formula (6), x ∈ R n A vector of shares representing the investment of decision makers in each asset, whose dimension is equal to some element x of the number n, x of assets i > 0 denotes that the decision maker holds a multi-head share x for asset i i ,x i < 0 indicates that the decision maker holds an empty share x for asset i i ,x i 0 denotes that the decision maker did not take the asset i; sigma ═ s (sigma) ij )∈R n×n A covariance matrix representing the profitability of each asset;
Figure BDA0003737474280000154
representing an expected return-on-return vector for each asset; 1 is as large as R n Is a vector of 1 for each element of the n dimensions; eta belongs to [0, 1 ]]A coefficient representing the risk preference of the investment decision-maker is measured, with smaller η indicating a greater willingness of the decision-maker to assume higher risk to achieve higher desired revenue.
Further, adding an integer constraint to the above equation (6) results in the following equation (7):
Figure BDA0003737474280000152
in the above formula (7), λ ∈ [0, 1 ]]Is a coefficient for measuring the risk preference of investment decision maker, its meaning is similar to eta in the above formula (6), and the two differ by only a positive proportionality coefficient; d ∈ Z is the net investment constraint. The remaining variables have the same meanings as in the mean-variance model in formula (6). Due to x i Value ofThe range is { -1, 0, 1}, so for assets with an investable share of k > 1, we can equivalently use k asset references with the same mean and covariance. In the remainder of this patent, "number of assets n" represents the number of assets n after the equivalent transformation has been performed.
For example, consider that a decision maker may already hold a portion of an asset when making an investment decision, and that there may be some transaction cost during the transaction. Therefore, to further enhance the resulting mean-variance model under integer constraints. In the technique of the above equation (7), in consideration of the long transaction cost, the following equation (8) can be obtained:
Figure BDA0003737474280000153
in the above formula (8), T represents the cost of a single market transaction; y is i And E { -1, 0, 1} is the ith element of the original position holding vector y and represents the position holding condition on the asset i before the decision of the decision maker is made. The other parameters have the same meanings as those of the above equations (6) and (7), and are not described in detail herein.
By adding transaction cost items
Figure BDA0003737474280000161
The obtained model is more suitable for the scene of investment portfolio optimization in reality.
Further, the mean-variance model under integer constraint in this application may be expressed by quantum states, and 2 qubits may be used to represent the investment of a single asset, as described in table 1 above. For the combinatorial optimization problem of n assets, the corresponding optimal values need to be found for 2n qubits, and the optimal values are recorded
Figure BDA00037374742800001611
Vector s 1 ,s 2 And correspondingly coding all first-bit qubits and all second-bit qubits of the qubit pairs corresponding to the assets respectively. E.g. s 51 Corresponding to the 1 st of the 5 th assetQubits that list the 9 th bit in a total of 2n qubits. Using the above-mentioned s 1 ,s 2 Substituting x in the above formula (8) results in the above formula (1).
According to the method and the device, the traditional mean-variance model is subjected to variation to obtain the mean-variance model under integer constraint, so that the obtained optimal solution can meet the constraint of practical conditions.
In the above embodiment, only the expressions of the phase separation operator and the hard constraint hybrid operator are described, and the construction method of the phase separation operator and the hard constraint hybrid operator is not described. Hereinafter, a method of constructing the phase separation operator and the hard constraint hybrid operator will be described by using the hamiltonian C in the phase separation operator and the matrix B in the hard constraint hybrid operator.
According to the relation between the Hamiltonian C in the phase separation operator and the objective function f (x), a certain vector x is assumed 0 Corresponding quantum state is
Figure BDA0003737474280000162
The following relationship of equation (9) can be obtained:
Figure BDA0003737474280000163
further, solving the Hamiltonian C in the phase separation operator. As an example of this, it is possible to use,
Figure BDA0003737474280000164
can utilize the Pauli matrix
Figure BDA0003737474280000165
And a unit matrix
Figure BDA0003737474280000166
And (6) solving.
By way of example, let the relationship satisfying the following equation (10):
Figure BDA0003737474280000167
for the above equation (10), and as shown in the following equation (11):
Figure BDA0003737474280000168
for x 0 The ith element x of 0i Existence of
Figure BDA0003737474280000169
From the above equations (8) to (11), the following equation (12) can be obtained:
Figure BDA00037374742800001610
that is, the expression of the hamiltonian C in the phase separation operator can be obtained as follows:
Figure BDA0003737474280000171
illustratively, the expression of the hard-constrained hybrid operator described in equation (4) above, and the method described above for solving for the Hamiltonian C in the phase separation operator. By adopting the fully-connected XY-hybrid operator, the expression of the matrix B in the hard-constraint hybrid operator can be obtained as follows:
Figure BDA0003737474280000172
wherein the content of the first and second substances,
Figure BDA0003737474280000173
is defined by
Figure BDA0003737474280000174
Similar to the definition of the method, only the Paly-z matrix is replaced by the Paly-x matrix
Figure BDA0003737474280000175
And the Pauli-y matrix
Figure BDA0003737474280000176
Suppose all satisfy
Figure BDA00037374742800001710
X corresponds to a quantum state of
Figure BDA0003737474280000177
XY-blending operators capable of guaranteeing in the initial state
Figure BDA0003737474280000178
The quantum state after each step in the hard-constrained hot start QAOA is in
Figure BDA0003737474280000179
And (4) the following steps. Therefore, the obtained share vector corresponding to the final state of the hard-constraint hot start QOA will certainly satisfy
Figure BDA00037374742800001711
The obtained final states are feasible solutions due to the constraint of (2).
For example, after obtaining the hamiltonian C in the phase separation operator and the matrix B in the hard constraint hybrid operator, the corresponding phase separation operator and hard constraint hybrid operator can be constructed in quantum wires using a mainstream quantum programming framework, e.g., Qiskit. The embodiment of the present application does not set any limit to the specific construction process.
Fig. 3 is a schematic flowchart of another data processing method according to an embodiment of the present application. As shown in fig. 3, the data processing method includes the steps of:
step 1, start
And step 2, receiving the parameters.
For example, the received parameter may refer to the first value and the expected condition in the foregoing embodiment, and this embodiment is not described herein again.
And 3, obtaining an optimal solution on a real number domain by using a mean-variance model under integer constraint.
In this step, reference may be made to the description of the first value and the expectation condition by using a mean-variance model under integer constraint to obtain a second value in the above embodiment, which is not described herein again.
And 4, receiving the regular parameters and the error parameters.
For example, the regularization parameter and the error parameter may be received before step 5 is executed, or may be received in step 2, and this embodiment only takes the example that the regularization parameter and the error parameter are not received in step 2, but does not represent that the embodiment of the present application is limited thereto.
And 5, determining the initial state of the hot start quantum approximate optimization algorithm according to the optimal solution in the real number domain.
In this step, the optimal solution on the real number domain can be obtained
Figure BDA0003737474280000181
Re-ordering from large to small to obtain
Figure BDA0003737474280000182
Wherein, the first and the second end of the pipe are connected with each other,
Figure BDA0003737474280000183
Figure BDA0003737474280000184
note the book
Figure BDA0003737474280000185
The corresponding qubit is represented as
Figure BDA0003737474280000186
It will be appreciated that s is assumed 51 Is s 1 The inner largest element is sorted
Figure BDA0003737474280000187
And is
Figure BDA0003737474280000188
Corresponding to the 1 st qubit for the 5 th asset.
Further, if D > 0, let
Figure BDA0003737474280000189
If D is less than 0, let
Figure BDA00037374742800001810
If n-D is odd, then let
Figure BDA00037374742800001811
Figure BDA00037374742800001812
Further, let D' ═ D | +1+ (n- | D |) mod2, then for any qubit
Figure BDA00037374742800001813
It is mixed with
Figure BDA00037374742800001814
Pairing, and recording r ij =s ij + δ, i ═ D ', D' + 1., n, where the positive number δ < 1 is a regularization parameter that can prevent the denominator from being 0, typically 10 -4 The following formula (15) can be obtained by calculation:
Figure BDA00037374742800001815
in the above equation (15), xi is an error parameter, 0 ≦ xi ≦ 0.5, which can prevent the occurrence of an "overfitting" condition when very close to 0 or 1.
Further, let
Figure BDA00037374742800001816
Note the book
Figure BDA00037374742800001817
Figure BDA00037374742800001818
The door prepared in the initial state is operated as
Figure BDA00037374742800001819
And a quantum gate R yij ) The corresponding rectangular formula may be:
Figure BDA00037374742800001820
further, will
Figure BDA00037374742800001821
According to
Figure BDA00037374742800001822
Rearranging the corresponding sequence to obtain
Figure BDA00037374742800001823
Wherein, the first and the second end of the pipe are connected with each other,
Figure BDA00037374742800001824
corresponding to the j < th > qubit corresponding to the i < th > asset being encoded. Another initial state
Figure BDA0003737474280000191
I.e., the tensor product of the plurality of qubits in order, | ψ 0 >Contains information on the relaxed integer constraint solution in the real number domain and must fall within
Figure BDA0003737474280000192
And (4) inside.
And 6, initializing the depth of a quantum line corresponding to the hot start quantum approximation optimization algorithm, and a first parameter of a phase separation operator and a second parameter of a hard constraint hybrid operator.
In this stepThe setting may be performed according to actual conditions, which is not limited in this embodiment. The first parameter of the initialized phase separation operator and the second parameter of the hard constraint blending operator may be
Figure BDA0003737474280000193
The present embodiment is described by way of example only, and is not intended to limit the embodiments of the present application.
And 7, constructing a quantum line according to the initial state of the hot start quantum approximate optimization algorithm, wherein the quantum line comprises a phase separation operator and a hard constraint mixed operator.
In this step, the depth of the constructed quantum wire is the depth initialized in step 6, and the number of depths is the number of phase separation operators and hard constraint mixture operators included in the quantum wire.
And 8, measuring the quantum line for multiple times, and calculating a function mean value.
For example, the method for calculating the first final state in the above embodiments can be referred to for performing multiple measurements on the quantum wire, and the embodiments of the present application are not described herein again.
For example, for the final state | ψ p >M (m is equal to Z) + ) For each measurement (e.g. 1000), calculate | ψ for each measurement p >The objective function value f (x) corresponding to the share vector corresponding to the result of (2) i ) Use of
Figure BDA0003737474280000194
As an estimate of the desired value of the objective function.
And 9, updating the first parameter of the phase separation operator and the second parameter of the hard constraint mixed operator.
In this step, a classical algorithm, such as COBYLA, gradient descent, annealing, etc., may be used to update γ, β according to the objective function expectation value, resulting in a new set of parameter vectors γ ', β'.
Step 10, judging whether Euclidean distances between the updated first parameter and second parameter and the first parameter and the second parameter before updating are smaller than or equal to a preset precision threshold value.
In the step, the euclidean distance | | | γ '- γ | + | | | β' - β | | of the new and old parameter vectors is calculated and compared with a preset precision threshold belonging to the same category as the preset precision threshold. E may be a small positive number, e.g. 10 -3 . The smaller e, the more accurate the algorithm is represented. If | | | gamma '-gamma | + | | | | beta' -beta | | | | is less than or equal to the element corresponding to the E, taking gamma 'and beta' as gamma * ,β * And outputting and executing the following step 11. If | | | γ '- γ | + | | | β' - β | >, then let γ ═ γ ', β ═ β', continue to perform step 8 above.
Step 11, outputting the final state of the quantum circuit according to the updated parameters to obtain the result
In this step, it is assumed that the finally obtained first parameter and second parameter are γ * ,β * Then, it is brought into the quantum wire for the initial state | psi 0 >Evolving to obtain final state
Figure BDA0003737474280000201
To pair
Figure BDA0003737474280000202
Proceed to t (t ∈ Z) + ) The secondary measurements yielded a final state for each measurement. According to the obtained final state, calculating corresponding investment share vectors, calculating corresponding target functions, and taking the minimum target function in the multiple share vectors as the output result x of the whole quantum approximation optimization algorithm * I.e. the investor's optimal investment position-taking plan.
And step 12, ending.
In summary, the technical scheme of the application considers the integer constraint in the actual scene, utilizes the classical optimization algorithm to solve the optimal solution on the real number domain, and designs the initial state of the hard constraint hot start, so that the initial state contains the information of the solution on the relevant real number domain, and the quantum state always falls in the feasible solution subspace under the action of the parameter quantum circuit. In addition, in the numerical simulation process, the technical scheme shows that under the condition that p is 4 and n is 12, the average approximation ratio and the optimal solution of the investment portfolio optimization solution of the A share are respectively 110% and 200% of the existing quantum approximation optimization algorithm scheme, and the improvement is remarkable.
Fig. 4 is a schematic structural diagram of a data processing apparatus 40 according to an embodiment of the present application, and for example, please refer to fig. 4, the data processing apparatus 40 may include:
the obtaining module 401 is configured to obtain a first value and an expectation condition, where the first value is an initial value of a plurality of preset types of data of a user, and the expectation condition is a condition that the user selects and expects to achieve.
A first processing module 402, configured to process the first value and the expectation condition by using a mean-variance model under integer constraint to obtain a second value, where the second value is an optimal solution of the mean-variance model under integer constraint.
And a second processing module 403, configured to determine an initial state of the hard-constrained hot-start quantum approximation optimization algorithm QAOA according to the quantum state corresponding to the second value.
The second processing module 403 is further configured to perform iterative optimization on an operator in the hard-constraint hot start QAOA to obtain a target final state of the hard-constraint hot start QAOA.
A third value is output based on the target final state of the hard constrained hot start QAOA.
Optionally, the operators in the hard constraint hot start QAOA include phase separation operators and hard constraint hybrid operators, and the number of the phase separation operators and the number of the hard constraint hybrid operators both correspond to the depth value of the hard constraint hot start QAOA.
A second quantity module 403, specifically configured to apply a phase separation operator and a hard constraint hybrid operator alternately to the initial state to obtain a first final state of the hard constraint hot start QAOA; repeatedly executing the steps for a preset number of times to obtain a preset number of first terminal states, and calculating the terminal state average value of the preset number of first terminal states; updating a first parameter of the current phase separation operator and a second parameter of the current hard constraint hybrid operator according to the final state mean value to obtain a new phase separation operator and a new hard constraint hybrid operator; if the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator do not meet the convergence condition, repeating the steps until the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator meet the convergence condition; and determining a preset number of first final states which are calculated according to the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator when the convergence condition is met as target final states.
Optionally, the second data processing module 403 is specifically configured to determine an objective function corresponding to the final state mean, where the objective function is a function in a mean-variance model under integer constraint; determining a new first parameter and a new second parameter according to the objective function; updating the first parameter of the current phase separation operator to a new first parameter to obtain a new phase separation operator; and updating the second parameter of the current hard constraint hybrid operator into a new second parameter to obtain a new hard constraint hybrid operator.
Optionally, the convergence condition is:
the | | | gamma '-gamma | + | | | | beta' -beta | | < ∈; wherein γ 'is a new first parameter, γ is a first parameter of a current phase separation operator, β' is a new second parameter, and β is a second parameter of a current hard constraint blending operator.
Optionally, the second processing module 403 is further configured to determine an objective function corresponding to each first final state included in the target final state of the hard-constrained hot start QAOA, where the objective function is a function in a mean-variance model under an integer constraint; determining an objective function with the minimum function value in the plurality of objective functions; and determining the first final state corresponding to the minimum objective function as a third value, and outputting the third value.
Optionally, the second processing module 403 is specifically configured to perform processing according to a formula
Figure BDA0003737474280000211
The initial state of the hard constrained hot start QAOA is determined.
Wherein, | ψ 0 >For the initial state of the hard constrained hot start QAOA,
Figure BDA0003737474280000212
representing the 1 st qubit corresponding to the first predetermined type of data in the ith first value,
Figure BDA0003737474280000213
represents the 2 nd qubit corresponding to the ith first predetermined type of data, and n is the amount of the first predetermined type of data.
Optionally, the mean-variance model under the integer constraint is represented as:
Figure BDA0003737474280000221
Figure BDA0003737474280000225
0≤s ij ≤1,i∈{1,2,...,n},j∈{1,2}
wherein f (x) is an objective function of a mean-variance model under integer constraint, and λ ∈ [0, 1 ]]Represents a risk preference coefficient, Σ ═ (σ) ij )∈R n×n A covariance matrix representing the first preset type of data in each first value,
Figure BDA0003737474280000227
representing the expected condition vector corresponding to each first preset type of data, 1 ∈ R n Is a vector of 1 for each element of the n-dimension, T represents the cost of a single transaction, y i E { -1, 0, 1} is the ith element of the vector y corresponding to the second preset type of data in the first value,
Figure BDA0003737474280000226
s ij indicating the j-th qubit corresponding to the i-th first predetermined type of data.
Optionally, the phase separation operator is
Figure BDA0003737474280000222
Wherein, gamma is i E [0, 2 π) is the first parameter, C is the Hamiltonian, and the objective function of the mean-variance model under integer constraints.
Hard constraint blending operator of
Figure BDA0003737474280000223
Wherein the content of the first and second substances,
Figure BDA0003737474280000224
the value range of the matrix B is related to the second parameter.
The data processing apparatus provided in this embodiment of the present application may execute the technical solution of the data processing method in any embodiment, and the implementation principle and the beneficial effect of the data processing apparatus are similar to those of the data processing method, and reference may be made to the implementation principle and the beneficial effect of the data processing method, which is not described herein again.
Fig. 5 is a schematic structural diagram of an electronic device provided in the present application. As shown in fig. 5, the electronic device 500 may include: at least one processor 501 and memory 502.
The memory 502 is used for storing programs. In particular, the program may include program code comprising computer operating instructions.
Memory 502 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The processor 501 is configured to execute computer-executable instructions stored in the memory 502 to implement the data processing method described in the foregoing method embodiments. The processor 501 may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement the embodiments of the present Application. Specifically, when the data processing method described in the foregoing method embodiment is implemented, the electronic device may be, for example, an electronic device with a processing function, such as a terminal or a server.
Optionally, the electronic device 500 may further include a communication interface 503. In a specific implementation, if the communication interface 503, the memory 502 and the processor 501 are implemented independently, the communication interface 503, the memory 502 and the processor 501 may be connected to each other through a bus and perform communication with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. Buses may be divided into address buses, data buses, control buses, etc., but do not represent only one bus or type of bus.
Optionally, in a specific implementation, if the communication interface 503, the memory 502, and the processor 501 are integrated into a chip, the communication interface 503, the memory 502, and the processor 501 may complete communication through an internal interface.
The present application also provides a computer-readable storage medium, which may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and in particular, the computer-readable storage medium stores program instructions, and the program instructions are used in the method in the foregoing embodiments.
The present application also provides a program product comprising execution instructions stored in a readable storage medium. The at least one processor of the electronic device may read the execution instruction from the readable storage medium, and the execution of the execution instruction by the at least one processor causes the electronic device to implement the data processing method provided by the various embodiments described above.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and these modifications or substitutions do not depart from the scope of the technical solutions of the embodiments of the present application.

Claims (12)

1. A data processing method, comprising:
acquiring a first value and an expectation condition, wherein the first value is an initial value of a plurality of preset types of data of a user, and the expectation condition is a condition which is selected by the user and is expected to be achieved;
processing the first value and the expectation condition by using a mean-variance model under integer constraint to obtain a second value, wherein the second value is an optimal solution of the mean-variance model under integer constraint;
determining an initial state of a QOA (quantum efficiency optimization) algorithm based on the quantum state corresponding to the second value;
carrying out iterative optimization on an operator in the hard-constraint hot start QOA to obtain a target final state of the hard-constraint hot start QOA;
outputting a third value based on the target final state of the hard constrained hot start QOA.
2. The method of claim 1, wherein operators in the hard constraint hot start QOAA comprise phase splitting operators and hard constraint blending operators, the number of phase splitting operators and the number of hard constraint blending operators each corresponding to a depth value of the hard constraint hot start QOAA;
the iterative optimization of the operator in the hard-constraint hot start QOA is performed to obtain the target final state of the hard-constraint hot start QOA, and the method comprises the following steps:
alternately acting a phase separation operator and a hard constraint hybrid operator on the initial state to obtain a first final state of the hard constraint hot start QOA;
repeatedly executing the steps for a preset number of times to obtain a preset number of first terminal states, and calculating the terminal state average value of the preset number of first terminal states;
updating a first parameter of the current phase separation operator and a second parameter of the current hard constraint hybrid operator according to the final state mean value to obtain a new phase separation operator and a new hard constraint hybrid operator;
if the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator do not meet the convergence condition, repeating the steps until the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator meet the convergence condition;
and determining a preset number of first final states which are calculated according to the first parameter of the new phase separation operator and the second parameter of the new hard constraint hybrid operator when the convergence condition is met as target final states.
3. The method according to claim 2, wherein the updating the first parameter of the current phase separation operator and the second parameter of the current hard constraint blending operator according to the final state mean to obtain a new phase separation operator and a new hard constraint blending operator comprises:
determining an objective function corresponding to the final state mean value, wherein the objective function is a function in a mean-variance model under integer constraint;
determining a new first parameter and a new second parameter according to the objective function;
updating the first parameter of the current phase separation operator to the new first parameter to obtain a new phase separation operator;
and updating the second parameter of the current hard constraint hybrid operator into the new second parameter to obtain a new hard constraint hybrid operator.
4. The method according to any one of claims 2, wherein the convergence condition is:
||γ′-γ||+||β′-β||<∈;
wherein γ 'is a new first parameter, γ is a first parameter of a current phase separation operator, β' is a new second parameter, and β is a second parameter of a current hard constraint blending operator.
5. The method of any of claims 1-4, wherein outputting a third value in accordance with the target final state of the hard constrained hot start QOA comprises:
determining an objective function corresponding to each first final state included in the target final states of the hard-constrained hot start QOA, wherein the objective function is a function in a mean-variance model under an integer constraint;
determining an objective function with the minimum function value in the plurality of objective functions;
and determining the first final state corresponding to the minimum objective function as a third value, and outputting the third value.
6. The method according to any one of claims 1 to 4, wherein the determining the initial state of the QOA algorithm comprises:
according to the formula
Figure FDA0003737474270000021
Determining an initial state of a hard constraint hot start QOA;
wherein, | ψ 0 >For the initial state of the hard constrained hot start QAOA,
Figure FDA0003737474270000022
representing the 1 st qubit corresponding to the first predetermined type of data in the ith first value,
Figure FDA0003737474270000023
represents the 2 nd qubit corresponding to the ith first preset type of data, and n is the number of the first preset type of data.
7. The method of claim 1, wherein the mean-variance model under integer constraint is expressed as:
Figure FDA0003737474270000031
wherein f (x) is an objective function of a mean-variance model under integer constraint, and λ ∈ [0, 1 ]]Denotes a risk preference coefficient, sigma ═ o ij )∈R n×n A covariance matrix representing the first preset type of data in each first value,
Figure FDA0003737474270000032
representing the expected condition vector corresponding to each first preset type of data, 1 ∈ R n Is a vector of 1 for each element of the n dimensions, T represents the cost of a single transaction, y i E { -1, 0, 1} is the ith element of the vector y corresponding to the second preset type of data in the first value,
Figure FDA0003737474270000033
s ij indicating the j-th qubit corresponding to the i-th first predetermined type of data.
8. The method of claim 2, wherein the phase separation operator is
Figure FDA0003737474270000034
Wherein, γ i E [0, 2 π) is a first parameter, C is a Hamiltonian, and the Hamiltonian is an objective function of a mean-variance model under integer constraint;
the hard constraint blending operator is
Figure FDA0003737474270000035
Wherein the content of the first and second substances,
Figure FDA0003737474270000036
the value range of the matrix B is related to the value range of the second parameter.
9. A data processing apparatus, characterized by comprising:
the device comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a first value and an expectation condition, the first value is an initial value of a plurality of preset types of data of a user, and the expectation condition is a condition which is selected by the user and is expected to be achieved;
the first processing module is used for processing the first value and the expectation condition by using a mean-variance model under integer constraint to obtain a second value, wherein the second value is an optimal solution of the mean-variance model under integer constraint;
the second processing module is used for determining the initial state of the QOA according to the quantum state corresponding to the second value;
the second processing module is also used for carrying out iterative optimization on an operator in the hard-constraint hot start QOA to obtain a target final state of the hard-constraint hot start QOA;
the second processing module is further configured to output a third value according to the target final state of the hard constrained hot start QOA.
10. An electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer execution instructions;
the processor executes computer-executable instructions stored by the memory to implement the method of any of claims 1-8.
11. A computer-readable storage medium having computer-executable instructions stored thereon, which when executed by a processor, perform the method of any one of claims 1-8.
12. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, is adapted to carry out the method of any one of the preceding claims 1-8.
CN202210800683.3A 2022-07-08 2022-07-08 Data processing method and device, electronic equipment and storage medium Pending CN115099514A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210800683.3A CN115099514A (en) 2022-07-08 2022-07-08 Data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210800683.3A CN115099514A (en) 2022-07-08 2022-07-08 Data processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115099514A true CN115099514A (en) 2022-09-23

Family

ID=83297565

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210800683.3A Pending CN115099514A (en) 2022-07-08 2022-07-08 Data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115099514A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115910220A (en) * 2023-01-03 2023-04-04 北京中科弧光量子软件技术有限公司 Quantum computer-based protein amino acid property encoding method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115910220A (en) * 2023-01-03 2023-04-04 北京中科弧光量子软件技术有限公司 Quantum computer-based protein amino acid property encoding method and system

Similar Documents

Publication Publication Date Title
Saborido et al. Evolutionary multi-objective optimization algorithms for fuzzy portfolio selection
Horvath et al. Deep learning volatility
Wang et al. Portfolio selection and asset pricing
Ruiz-Torrubiano et al. A memetic algorithm for cardinality-constrained portfolio optimization with transaction costs
Kerenidis et al. Quantum algorithms for portfolio optimization
Kaucic Equity portfolio management with cardinality constraints and risk parity control using multi-objective particle swarm optimization
Fécamp et al. Risk management with machine-learning-based algorithms
Cura A rapidly converging artificial bee colony algorithm for portfolio optimization
Miyamoto et al. Pricing multi-asset derivatives by finite-difference method on a quantum computer
EP3855364A1 (en) Training machine learning models
CN115099514A (en) Data processing method and device, electronic equipment and storage medium
Crisan et al. Probabilistic methods for semilinear partial differential equations. Applications to finance
Neykov et al. The least trimmed quantile regression
Ru et al. Probabilistic ordinal regression methods for multiple criteria sorting admitting certain and uncertain preferences
Robinzonov Advances in boosting of temporal and spatial models
Limmer et al. Robust Hedging GANs
Albani et al. Data driven recovery of local volatility surfaces
Lipinski ECGA vs. BOA in discovering stock market trading experts
CN114897172A (en) Data processing method, device, equipment and storage medium
Yu et al. Multi-attribute portfolio selection with genetic optimization algorithms
Silva et al. Using GAN-generated market simulations to guide genetic algorithms in index tracking optimization
Seregina Graphical models and their interactions with machine learning in the context of economics and finance
Keffert Dynamic Asset Allocation using Simulation and Artificial Neural Networks
Vázsonyi Overview of scenario tree generation methods, applied in financial and economic decision making
Chen et al. Quasi-binary encoding based quantum alternating operator ansatz

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination