Investment optimization method and device
By constructing a discrete model and using the Grover algorithm, the difficulty of solving the portfolio optimization problem when there are asset constraints and income correlation changes is solved, and efficient portfolio optimization is achieved.
Patent Information
- Application Number
- CN202411762025.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-04-04
AI Technical Summary
When portfolio optimization problems are affected by asset constraints, income correlation changes and transaction costs, the difficulty of solving them significantly increases, resulting in unstable optimal trading trajectory.
By constructing a discrete model of portfolio assets, performing quasi-binary encoding, converting it into a discrete quadratic unconstrained binary optimization model, and using the Grover algorithm for solving it, obtaining the target investment share of each asset.
This method flexibly controls the value range of investment shares through quasi-binary coding, improves the effectiveness of solution efficiency and resolving, reduces the difficulty of solving portfolio optimization problems, and obtains the best portfolio investment plan.
Smart Images

Figure CN119762233A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of quantum computing technology, and in particular relates to an investment optimization method and device. Background Art
[0002] When conducting portfolio investment, the portfolio optimization problem is generally solved by designing and solving a single set of linear equations to obtain the best investment plan.
[0003] However, when investments have certain constraints, and the returns and correlations of assets are greatly affected by time, as well as the transaction costs of buying and selling assets, the optimal trading trajectory is not always optimal, which makes solving portfolio optimization problems more difficult. Summary of the Invention
[0004] The embodiments of the present application provide an investment optimization method and device, which can solve the problem of difficulty in solving investment portfolio optimization problems.
[0005] In a first aspect, an embodiment of the present application provides an investment optimization method, comprising:
[0006] Constructing a discretization model of the portfolio assets based on the constraint range of each asset, wherein each discretization variable in the discretization model is used to represent the investment share of each asset;
[0007] Performing quasi-binary encoding on each of the discretized variables to obtain a quantum initial state of each of the discretized variables;
[0008] According to each of the quantum initial states, the discretization model is converted into a post-discrete quadratic unconstrained binary optimization model;
[0009] The Grover algorithm is used to solve the discrete quadratic unconstrained binary optimization model to obtain the target investment share of each asset.
[0010] In one embodiment, constructing a discretization model of the portfolio assets according to the constraint range of each asset includes:
[0011] For each of the assets, the discretization variable is set according to the upper and lower investment limits of the asset, the investment share and a preset precision parameter;
[0012] The discretization model is constructed according to the discretization variables of each of the assets.
[0013] In one embodiment, the expression of the discretized variable of the i-th asset is x i ∈[0,R i ], i∈[1,N], where wi is the investment share of the i-th asset, x i is the discretized variable of the i-th asset, u i is the investment limit of the i-th asset, l i is the investment lower limit of the i-th asset, α is the preset accuracy parameter, R i is the upper limit of investment after discretization, N represents the number of assets constituting the portfolio assets; the discretization model is W = αX + L, where W∈R N×1 , X∈R N×1 , U∈R N×1 , L∈R N×1 .
[0014] In one embodiment, performing quasi-binary encoding on each of the discretized variables to obtain the quantum initial state of each of the discretized variables includes:
[0015] For each of the assets, determining the encoded length of the asset according to the discretized investment upper limit of the discretized variable of the asset;
[0016] Determining the number of qubits required for each bit in the binary system according to the encoded length and the discrete post-investment upper limit;
[0017] The discretized variable is quasi-binary encoded according to the encoded length and the number of quantum bits required for each bit to obtain the quantum initial state.
[0018] In one embodiment, the quasi-binary coded expression is Among them, f represents the quasi-binary coding method, b is a binary variable, and b ij represents the j-1th qubit of the i-th discretized variable in binary, b ij =2^j-1,n i is the encoded length, ni is the value rounded down from the result of log2(Ri+1), and h ij The number of qubits required to represent the j-1th bit of the i-th discretized variable in binary, h ij =bin j (R i -2^n i +1)+1.
[0019] In one embodiment, the expression of the discrete post-quadratic unconstrained binary optimization model is: Where W∈R N×1 , X∈R N×1 , U∈R N×1 , L∈R N ×1, q is the risk factor, q∈(0,+∞), E represents the minimum target return, ∑ represents the covariance matrix of the return, l i is the lower limit of investment in the ith asset, and T is used for transposition.
[0020] In one embodiment, the Grover algorithm is used to solve the quadratic unconstrained binary optimization model to obtain the target investment share of each asset, including:
[0021] Performing an evaluation conversion on the discrete post-quadratic unconstrained binary optimization model to obtain an objective function, wherein the discrete post-quadratic unconstrained binary optimization model is used to solve a minimum value, and the objective function is used to solve a maximum value;
[0022] constructing a first operator of the objective function based on a preset threshold;
[0023] Processing the first operator using an Oracle operator to obtain a second operator and a quantum state corresponding to a target value, wherein the target value is a value of the discretized variable greater than a preset threshold;
[0024] constructing a Grover diffusion operator according to the quantum state of the target value;
[0025] Using a Grover operator, iteratively calculating the Grover diffusion operator until the probability of finding the maximum value of the objective function is greater than or equal to the optimal probability, thereby obtaining the quantum target state of each of the assets;
[0026] The target investment share of each asset is determined according to the quantum target state of each asset.
[0027] In one embodiment, the objective function is expressed as max b (aX+L) T -q(aX+L) T ∑(aX+L), the expression of the first operator is The expression of the second operator is The expression of the Grover diffusion operator is Wherein, y is the preset threshold, n represents the number of input registers, t represents the number of output registers, ψ represents the quantum initial state, H represents the Hadamard gate, H represents the single-qubit gate used to construct the quantum superposition state, I represents the Identity gate, and I represents an identity operation.
[0028] The method according to claim 7, characterized in that the preset threshold is the maximum value of the objective function.
[0029] In a second aspect, an embodiment of the present application provides an investment optimization device, comprising:
[0030] A construction module is used to construct a discretization model of the investment portfolio assets according to the constraint range of each asset, wherein each discretization variable in the discretization model is used to represent the investment share of each asset;
[0031] An encoding module, configured to perform quasi-binary encoding on each of the discretized variables to obtain a quantum initial state of each of the discretized variables;
[0032] A solution module is used to convert the discretization model into a quadratic unconstrained binary optimization model according to each of the quantum initial states; and solve the quadratic unconstrained binary optimization model using a Grover algorithm to obtain a target investment share for each of the assets.
[0033] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0034] The embodiments of the present application construct a discretization model of the portfolio assets based on the constraint range of each asset. Each discretization variable in the discretization model is used to represent the investment share of each asset. Each discretization variable is quasi-binary encoded to obtain the quantum initial state of each discretization variable. The investment share of each asset integer can be represented by quasi-binary, providing a basis for solving the investment ratio using quantum computing. In addition, because the quasi-binary encoding can flexibly control the encoding range, the actual value range of the investment share can be precisely controlled, thereby improving the efficiency and effectiveness of subsequent solutions.
[0035] And by converting the discretized model into a discrete quadratic unconstrained binary optimization model based on the initial states of each quantum; using the Grover algorithm, the discrete quadratic unconstrained binary optimization model is solved to obtain the target investment share of each asset, and using quantum computing to calculate the target investment share of each asset, the optimal combination investment plan is obtained, reducing the difficulty of solving the problem.
[0036] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0038] Figure 1 This is a flow chart of an investment optimization method provided in one embodiment of the present application;
[0039] Figure 2 This is an example diagram of a circuit framework of a first operator provided in one embodiment of the present application;
[0040] Figure 3 This is an example diagram of a circuit framework of an investment optimization method provided in one embodiment of the present application;
[0041] Figure 4 It is a structural diagram of an investment optimization device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0042] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0043] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0044] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0045] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0046] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0047] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0048] Investment optimization is a core issue in finance and a highly sought-after issue within the financial industry. It involves asset portfolio allocation, market risk analysis, and asset pricing.
[0049] When investing in a portfolio, one typically designs and solves a single linear equation to solve the portfolio optimization problem and arrive at the optimal investment plan. The optimal investment plan typically aims to achieve a fixed return while minimizing the portfolio's risk.
[0050] However, when investments have certain constraints, and the returns and correlations of assets are greatly affected by time, as well as the transaction costs of buying and selling assets, the optimal trading trajectory is not always optimal, which makes solving portfolio optimization problems more difficult.
[0051] Among them, investment constraints include investing in fixed increments and liquidity restrictions.
[0052] In one embodiment, Figure 1 This is a flow chart of the investment optimization method provided by an embodiment of the present application. Figure 1 As shown, the method includes:
[0053] S11: Construct a discretization model of the portfolio assets based on the constraint range of each asset.
[0054] Among them, each discretized variable in the discretization model is used to represent the investment share of each asset.
[0055] S12: Perform quasi-binary encoding on each discretized variable to obtain the quantum initial state of each discretized variable.
[0056] S13: According to each quantum initial state, the discretized model is converted into a post-discrete quadratic unconstrained binary optimization model.
[0057] S14: Using the Grover algorithm, the discrete quadratic unconstrained binary optimization model is solved to obtain the target investment share of each asset.
[0058] In one implementation, step S11 includes:
[0059] S111: For each asset, set a discretized variable based on the asset's investment upper limit, investment lower limit, investment share, and preset precision parameters.
[0060] In the application, for each asset, the investment range of the asset is determined based on the constraint range, and the upper and lower investment limits of the asset are obtained. The investment share of the asset is within the constraint range.
[0061] A discretization model is constructed by introducing a very small preset precision parameter. After discretizing the investment upper and lower limits, as well as the investment share, these discretized upper and lower limits are treated as integers, providing a foundation for constructing the discretization model. The corresponding discretized variables are integers. The discretized variables are then set based on the discretized upper and lower limits, as well as the discretized investment share, to map the investment share within the constraint range to the discretized constraint range.
[0062] Specifically, the expression of the discretized variable of the i-th asset is x i ∈[0,R i ], i∈[1,N],w i =αx i +l i , w i ∈[l i ,u i ].
[0063] Among them, w i is the investment share of the i-th asset, x i is the discretized variable of the i-th asset, u i is the investment limit of the i-th asset, l i is the lower limit of investment in the ith asset, α is the preset precision parameter, R i is the upper limit of investment after discretization, and N represents the number of assets that constitute the portfolio assets.
[0064] By discretizing the variables, the investment share of the asset is [l i ,u i ] is mapped to [0,R i ]. It is understandable that the discrete degree of investment shares can be controlled by presetting precision parameters to improve the accuracy and flexibility of the algorithm.
[0065] S112: Construct a discretization model based on the discretization variables of each asset.
[0066] In the application, a discretized variable matrix is constructed based on the discretized variables of each asset. Based on the lower investment limits of each asset, an investment lower limit matrix is constructed. Based on the upper investment limits of each asset, an investment upper limit matrix is constructed. A discretized model is constructed based on the discretized variable matrix, the lower investment limit matrix, and the upper investment limit matrix.
[0067] Specifically, the discretization model is W = αX + L, where W∈R N×1 , X∈R N×1 , U∈R N×1 , L∈R N×1 .
[0068] In a possible implementation, a quasi-binary encoding function is set. The expression of the quasi-binary encoding is Among them, f represents the quasi-binary coding method, b is a binary variable, and b ij represents the j-1th qubit of the i-th discretized variable in binary, h ij The number of qubits required to represent the j-1th bit of the i-th discretized variable in binary.
[0069] Correspondingly, step S12 includes:
[0070] S121: For each asset, determine the encoded length of the asset based on the discretized investment upper limit of the asset's discretized variable.
[0071] In the application, ni is the value of the calculation result of log2(Ri+1) rounded down, n i For each asset, the encoded length is determined based on the upper limit of the discretized investment of the asset's discretized variable.
[0072] S122: Determine the number of qubits required for each bit in the binary system based on the encoded length and the upper limit of the discrete investment.
[0073] In the application, using h ij =bin j (R i -2^n i +1)+1, according to the encoded length and the upper limit of the discrete post-investment, determine the 0th, 1st, ..., j-1th, nth i -The number of qubits required for 1 bit, and get the number of qubits required for each bit.
[0074] S123: Perform quasi-binary encoding on the discretized variables according to the encoded length and the number of quantum bits required for each bit to obtain the quantum initial state.
[0075] In the application, use b ij=2^j-1, according to the encoded length and the number of qubits required for each bit, the quantum initial state corresponding to the discretized variable is determined. When all qubits are set to 1, it indicates the upper bound of the range. When all qubits are set to 0, it indicates the lower bound of the range. If k bits (k <n i -1) has fewer than 2 qubits, a replacement can be made, replacing one 2^k qubit on the same asset with two 2^k-1 qubits to make the division of integers more detailed while keeping the upper limit of the qubit range unchanged.
[0076] For example, R i =17,n i =4,h i =[1,1,2,1], b i1 =2^0,b i2 =2^1,b i3 =2^2,b i4 =2^3, which means one 8-qubit, one 4-qubit, two 2-qubits and one 1-qubit. i =b i4 +b i3 +2b i2 +b i1 =1*2^3+1*2^2+2*2^1+1*2^0, and obtain the quantum initial state: |ψ i >=|b i4 b i3 b i2 b i1 >.
[0077] The discretized variables are quasi-binary encoded by the quasi-binary encoding function to create the quantum state corresponding to the feasible solution. Multiple quantum bits can be used to represent different b ij The value of , which reduces the number of qubits used to represent each asset logarithmically, and compared with traditional binary coding, it can solve the problem that traditional binary coding only satisfies R i =2^n-1 constraint to perform encoding.
[0078] In one possible implementation, the quadratic unconstrained binary optimization initial model can determine the proportion of funds invested in each asset in the total funds, given the covariance matrix and expected returns of N assets, and thus obtain the investment share of each asset. Based on the above quasi-binary coding, a discrete post-quadratic unconstrained binary optimization model is constructed.
[0079] Step S13 includes:
[0080] The quantity to be solved in the initial quadratic unconstrained binary optimization model is replaced by a discretized model to obtain the corresponding discretized quadratic unconstrained binary optimization model.
[0081] Specifically, the expression of the initial model of quadratic unconstrained binary optimization is The expression of the discretized quadratic unconstrained binary optimization model is: Where W∈R N×1 , X∈R N×1 , U∈R N×1 , L∈R N ×1 , q is the risk factor, q∈(0,+∞), E represents the minimum target return, ∑ represents the covariance matrix of the return, l i is the lower limit of investment in the ith asset, and T is used for transposition.
[0082] Among them, the discretized quadratic unconstrained binary optimization model is a quadratic polynomial about binary variables, which provides a basis for solving it using the Grover algorithm.
[0083] In one possible implementation, the Grover algorithm is used to solve the discretized quadratic unconstrained binary optimization model, and then the optimal binary variables are extracted from the quantum calculation results, and then the optimal discretized variables are obtained, and then the optimal investment portfolio share is obtained through calculation.
[0084] Step S14 includes:
[0085] S141: Perform evaluation transformation on the discretized quadratic unconstrained binary optimization model to obtain the objective function.
[0086] Among them, the discretized quadratic unconstrained binary optimization model is used to solve the minimum value, and the objective function is used to solve the maximum value.
[0087] In the application, since the Grover operator solves the maximum value, the minimum value of the discrete quadratic unconstrained binary optimization model is converted to the maximum value, and the discrete quadratic unconstrained binary optimization model is processed to obtain the objective function. Among them, the expression of the objective function is max b (aX+L) T -q(aX+L) T ∑(aX+L) The objective function is a quadratic polynomial in binary variables.
[0090] S142: Constructing a first operator of the objective function based on a preset threshold.
[0091] In the application, based on the preset threshold, a polynomial represented by the first operator A representing the objective function is constructed, wherein the preset threshold is the maximum value of the objective function, specifically the maximum value of the objective function in the last measurement, and is initially set to 0.
[0092] For example, Figure 2This is an example diagram of the circuit framework of the first operator provided in one embodiment of the present application. Figure 2 As shown, each input register passes through a Hadamard gate, H shown in the figure, where H is a single-qubit gate used to construct a quantum superposition state. n A set of quantum bits Control unitary operator unitary operator U G (θ) to the output register |z> t , whose expression is
[0093]
[0094] Among them, b j The construction of the corresponding subset XOR implementation.
[0095] The general form of a polynomial in n variables is
[0096] Among them, b J is a non-zero coefficient, each subset There are corresponding Monomial, thus completing the superposition encoding of polynomial values.
[0097] Specifically, when constructing the first operator A based on quantum coding, for each subset Applying controlled geometric sequence transformations b J For non-zero coefficients, the inverse QFT transform is applied. n and output register |z> t Starting from the equal superposition state, use the unitary operator U G Controlled application of (θ) where the angle parameter corresponds to a non-zero coefficient a J , where J is a subset of {1,…,n}. At the end of the circuit, a single application of the inverse quantum Fourier transform (QFT) to U G (θ) is used to decode the periodic signal encoded by the code. The expression of the first operator is y is the preset threshold, t is the number of output registers, and n is the number of input registers.
[0098] S143: Using the Oracle operator, the first operator is processed to obtain the second operator and the quantum state corresponding to the marked target value.
[0099] The target value is the value of the discretized variable that is greater than the preset threshold.
[0100] In applications, the Oracle operator is used to find the state of interest and to mark the quantum state of the target value by flipping the phase of the quantum state of the target value while retaining the phase of the quantum state of the non-target value. Output register |z> t The value of f(b)-y is represented in the register. The sign bit in the register can be used to determine whether the condition of f(b)-y is met. All quantum states that meet f(b)-y are marked, so that the solution b with the objective function value better than y can be found using Grover search. The expression of the second operator is
[0101]
[0102] S144: Construct a Grover diffusion operator based on the quantum state of the target value.
[0103] In the application, the Grover diffusion algorithm is used to reverse the mean of all amplitudes in the marked quantum states, so that the amplitudes of all quantum states with target values are amplified and the amplitudes of quantum states with non-target values are reduced. The expression of the Grover diffusion operator is Where ψ is the quantum initial state, H is the Hadamard gate, H is the single-qubit gate used to construct the quantum superposition state, and I is the Identity gate, where I represents an identity operation.
[0104] S145: Using the Grover operator (quantum search algorithm, Grover Algorithm), iteratively calculate the Grover diffusion operator until the probability of finding the maximum value of the objective function is greater than or equal to the optimal probability, and obtain the quantum target state of each asset.
[0105] In this application, the Grover operator is used to iterate and measure the results. The optimal solution of each Grover algorithm is set to a preset threshold y, and the Grover operation is repeated until the probability of finding the maximum value of the objective function is greater than or equal to the optimal probability. The solution at the maximum objective function corresponds to the optimal solution for the portfolio. The optimal binary variable is extracted from the quantum computation results.
[0106] Generally, the optimal probability is set to the maximum probability.
[0107] S146: Determine the target investment share of each asset based on the quantum target state of each asset.
[0108] In the application, the quantum target state of each asset is converted into the value of the corresponding discretized variable, and then the target investment share is calculated based on the value of the discretized variable.
[0109] In a possible implementation, a circuit framework is proposed to implement the method. Figure 3This is an example diagram of the circuit framework of the investment optimization method provided in one embodiment of the present application. Figure 3 As shown in the figure, A represents the first operator A, which is used to represent the polynomial shown in the target function. G^(2^t-1) in the figure is used to find the state of interest. By flipping the phase of the quantum state of the target value while retaining the phase of the quantum state of the non-target value, the quantum state of the target value is marked and used for Grover iteration operation. The measurement module in the figure is used to measure the results of the Grover operation.
[0110] As can be understood, this embodiment improves the encoding algorithm of the existing quadratic unconstrained binary optimization model, enabling discretized variables to represent both the presence or absence of an asset and the precise investment share of that asset. Furthermore, by leveraging the high parallelism and rapid repetitive computation of quantum computing on a single problem, the solution scope is narrowed, enabling a better approach to finding the optimal investment portfolio. The use of quantum computing can address the speed limitations of existing algorithms that use methods such as Monte Carlo to sample distribution functions.
[0111] This embodiment constructs a discretization model of the portfolio assets based on the constraint range of each asset. Each discretized variable in the discretization model is used to represent the investment share of each asset. Each discretized variable is quasi-binary encoded to obtain the quantum initial state of each discretized variable. The quasi-binary representation of the investment share of each asset as an integer provides a basis for solving the investment ratio using quantum computing. In addition, because the quasi-binary encoding can flexibly control the encoding range, the actual value range of the investment share can be precisely controlled, thereby improving the efficiency and effectiveness of subsequent solutions.
[0112] And by converting the discretized model into a discrete quadratic unconstrained binary optimization model based on the initial states of each quantum; using the Grover algorithm, the discrete quadratic unconstrained binary optimization model is solved to obtain the target investment share of each asset, and using quantum computing to calculate the target investment share of each asset, the optimal combination investment plan is obtained, reducing the difficulty of solving the problem.
[0113] It should be understood that the order of execution of the steps in the above embodiments does not imply a specific order of execution. The order of execution of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of this application. Furthermore, the data collection in the above embodiments is legal, and its use or implementation does not involve any infringement on the public interest.
[0114] Corresponding to the method described in the above embodiment, for the sake of convenience of explanation, only the part related to the embodiment of the present application is shown.
[0115] In one embodiment, Figure 4: This is a schematic diagram of the structure of an investment optimization device provided in one embodiment of the present application. The device includes:
[0116] The construction module 10 is used to construct a discretization model of the investment portfolio assets according to the constraint range of each asset. Each discretization variable in the discretization model is used to represent the investment share of each asset.
[0117] The encoding module 11 is used to perform quasi-binary encoding on each discretized variable to obtain the quantum initial state of each discretized variable.
[0118] The solution module 12 is used to convert the discretized model into a quadratic unconstrained binary optimization model according to each quantum initial state; and solve the quadratic unconstrained binary optimization model using the Grover algorithm to obtain the target investment share of each asset.
[0119] In one embodiment, the construction module is specifically used to set discretization variables for each asset according to the asset's investment upper limit, investment lower limit, investment share and preset precision parameters; and construct a discretization model based on the discretization variables of each asset.
[0120] In one embodiment, the encoding module is specifically configured to determine, for each asset, the encoded length of the asset based on the upper limit of the discrete investment of the asset's discretized variable; determine the number of qubits required for each binary position based on the encoded length and the upper limit of the discrete investment; and perform quasi-binary encoding on the discretized variable based on the encoded length and the number of qubits required for each position to obtain a quantum initial state.
[0121] In one embodiment, a solution module is specifically configured to perform an evaluation conversion on a discrete post-quadratic unconstrained binary optimization model to obtain an objective function, wherein the discrete post-quadratic unconstrained binary optimization model is used to solve a minimum value, and the objective function is used to solve a maximum value; construct a first operator of the objective function based on a preset threshold; utilize an Oracle operator to process the first operator to obtain a second operator and a quantum state corresponding to a marked target value, wherein the target value is a value of the discretized variable greater than a preset threshold; construct a Grover diffusion operator based on the quantum state of the target value; utilize the Grover operator to iteratively calculate the Grover diffusion operator until the probability of searching for a maximum value of the objective function is greater than or equal to the optimal probability, thereby obtaining a quantum target state for each asset; and determine a target investment share for each asset based on the quantum target state of each asset.
[0122] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium can at least include: any entity or device capable of carrying computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, mobile hard disk, magnetic disk, or optical disk. In some cases, the computer-readable medium cannot be an electric carrier signal or telecommunication signal.
[0123] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0124] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0125] In the embodiments provided in this application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely illustrative. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0126] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of the solution of this embodiment according to actual needs.
[0127] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. An investment optimization method, characterized in that: include: According to the constraint range of each asset, a discretization model of the investment portfolio assets is constructed, wherein each discretization variable in the discretization model is used to characterize the investment share of each asset; Performing quasi-binary coding on each of the discretized variables to obtain a quantum initial state of each of the discretized variables; According to each of the quantum initial states, the discretization model is converted into a post-discretization quadratic unconstrained binary optimization model; The Grover algorithm is used to solve the discrete quadratic unconstrained binary optimization model to obtain the target investment share of each asset.
2. The method according to claim 1, characterized in that The discrete model of the investment portfolio assets is constructed according to the constraint range of each asset, including: For each of the assets, the discretization variable is set according to the upper and lower investment limits of the asset, the investment share and a preset precision parameter; The discretization model is constructed according to the discretization variables of each of the assets.
3. The method according to claim 2, characterized in that: The expression of the discretized variable of the i-th asset is x i ∈[0,R i ], i∈[1,N], where w i is the investment share of the i-th asset, x i is the discretized variable of the i-th asset, u i is the investment limit of the i-th asset, l i is the investment lower limit of the i-th asset, α is the preset precision parameter, R i is the upper limit of investment after discretization, N represents the number of assets constituting the portfolio assets; the discretization model is W = αX + L, where W∈R N×1 , X∈R N×1 , U∈R N×1 , L∈R N×1 .
4. The method according to claim 2, characterized in that: The step of performing quasi-binary encoding on each of the discretized variables to obtain a quantum initial state of each of the discretized variables comprises: For each of the assets, determining the encoded length of the asset according to the discretized investment upper limit of the discretized variable of the asset; Determining the number of quantum bits required for each bit in the binary system according to the encoded length and the discrete post-investment upper limit; The discretized variable is quasi-binary encoded according to the encoded length and the number of quantum bits required for each bit to obtain the quantum initial state.
5. The method according to claim 4, characterized in that The quasi-binary coded expression is Among them, f represents the quasi-binary coding method, b is a binary variable, and b ij represents the j-1th qubit of the i-th discretized variable in binary, b ij =2^j-1,n i is the encoded length, n i log2(R i +1) is rounded down to the integer value, h ij The number of qubits required to represent the j-1th bit of the i-th discretized variable in binary, h ij =bin j (R i -2^n i +1)+1.
6. The method according to claim 4, characterized in that The expression of the discrete quadratic unconstrained binary optimization model is: Where W∈R N×1 , X∈R N×1 , U∈R N×1 , L∈R N×1 , q is the risk factor, q∈(0,+∞), E represents the minimum target return, ∑ represents the covariance matrix of the return, l i is the lower limit of investment for the ith asset, and T is used for transposition.
7. The method according to claim 4, characterized in that The Grover algorithm is used to solve the quadratic unconstrained binary optimization model to obtain the target investment share of each asset, including: Performing evaluation conversion on the discrete post-quadratic unconstrained binary optimization model to obtain an objective function, wherein the discrete post-quadratic unconstrained binary optimization model is used to solve a minimum value, and the objective function is used to solve a maximum value; Based on a preset threshold, construct a first operator of the objective function; Using an Oracle operator, processing the first operator to obtain a second operator and a quantum state corresponding to a marked target value, wherein the target value is a value of the discretized variable greater than the preset threshold; constructing a Grover diffusion operator according to the quantum state of the target value; Using the Grover operator, iteratively calculating the Grover diffusion operator until the probability of searching for the maximum value of the objective function is greater than or equal to the optimal probability, thereby obtaining the quantum target state of each of the assets; The target investment share of each asset is determined according to the quantum target state of each asset.
8. The method according to claim 7, characterized in that The expression of the objective function is max b (aX+L) T -q(aX+L) T ∑(aX+L), the expression of the first operator is The expression of the second operator is The expression of the Grover diffusion operator is Wherein, y is the preset threshold, n represents the number of input registers, t represents the number of output registers, ψ represents the quantum initial state, H represents the Hadamard gate, H represents the single quantum bit gate used to construct the quantum superposition state, I represents the Identity gate, and I represents an identity operation.
9. The method according to claim 7, characterized in that: The preset threshold is the maximum value of the objective function.
10. An investment optimization device, characterized in that: include: A construction module, used to construct a discretization model of the investment portfolio assets according to the constraint range of each asset, wherein each discretization variable in the discretization model is used to characterize the investment share of each asset; An encoding module, used for performing quasi-binary encoding on each of the discretized variables to obtain a quantum initial state of each of the discretized variables; A solution module is used to convert the discretization model into a quadratic unconstrained binary optimization model according to each of the quantum initial states; and solve the quadratic unconstrained binary optimization model using the Grover algorithm to obtain the target investment share of each of the assets.
Citation Information
Patent Citations
Investment portfolio decision generation method and device, electronic equipment and storage medium
CN114998025A
Investment portfolio optimization method and system based on quantum optimization algorithm
CN115660861A