WO2021218480A1 - 基于模拟量子算法的数据搜索方法、装置及设备 - Google Patents

基于模拟量子算法的数据搜索方法、装置及设备 Download PDF

Info

Publication number
WO2021218480A1
WO2021218480A1 PCT/CN2021/081810 CN2021081810W WO2021218480A1 WO 2021218480 A1 WO2021218480 A1 WO 2021218480A1 CN 2021081810 W CN2021081810 W CN 2021081810W WO 2021218480 A1 WO2021218480 A1 WO 2021218480A1
Authority
WO
WIPO (PCT)
Prior art keywords
values
processing function
search
value
sets
Prior art date
Application number
PCT/CN2021/081810
Other languages
English (en)
French (fr)
Inventor
陈宇
谢昌谕
陈玉琴
张胜誉
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to KR1020217031511A priority Critical patent/KR20210134724A/ko
Priority to JP2021549943A priority patent/JP7176127B2/ja
Priority to EP21773270.0A priority patent/EP3933616A4/en
Publication of WO2021218480A1 publication Critical patent/WO2021218480A1/zh
Priority to US17/523,840 priority patent/US11782937B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2462Approximate or statistical queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/18Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06N20/10Machine learning using kernel methods, e.g. support vector machines [SVM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/01Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N7/00Computing arrangements based on specific mathematical models
    • G06N7/01Probabilistic graphical models, e.g. probabilistic networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the embodiments of the present application relate to the field of computer technology, and in particular to a data search method, device, and equipment based on an analog quantum algorithm.
  • quantum computing With the development of quantum computing technology, there are more and more applications of quantum computing. Compared with classical computing, quantum computing has greatly improved the efficiency of data processing.
  • the adiabatic quantum calculation in quantum computing uses search paths to process data, and an accurate search path can improve the efficiency of adiabatic quantum calculations.
  • the embodiments of the present application provide a data search method, device and equipment based on an analog quantum algorithm.
  • the technical solution is as follows:
  • a data search method based on an analog quantum algorithm includes:
  • first state data and second state data are created.
  • the first state corresponding to the first state data is a state with the same selection probability of the plurality of candidate data.
  • the second state corresponding to the two-state data is a state where the target data that meets the search condition has been searched;
  • a first search path is created based on the first state data and the second state data, the start point of the first search path refers to the first state, and the end point refers to the second state, the first The search path includes multiple coefficients with undetermined values;
  • the first processing function includes the plurality of coefficients, and the output value of the first processing function is determined by the first search path, the first Convergence of the output value of the processing function indicates that the values of the multiple coefficients meet the target;
  • each set of values includes multiple values corresponding to the multiple coefficients, and the multiple values in different value sets are not completely the same;
  • the second search path is used to search for the target data in the plurality of candidate data.
  • a data search device in another aspect, includes:
  • the state data creation module is used to create first state data and second state data according to multiple candidate data to be searched, and the first state corresponding to the first state data is the selection probability of the multiple candidate data In the same state, the second state corresponding to the second state data is a state in which target data satisfying the search condition has been searched;
  • the first path creation module is configured to create a first search path according to the first state data and the second state data, where the start point of the first search path refers to the first state, and the end point refers to the In the second state, the first search path includes multiple coefficients with undetermined values;
  • the first function acquisition module is configured to acquire a first processing function corresponding to the first search path, where the first processing function includes the multiple coefficients, and the output value of the first processing function is determined by the first processing function.
  • the search path is determined, and the convergence of the output value of the first processing function indicates that the values of the multiple coefficients meet the target;
  • a set acquisition module configured to traverse at least two sets of values of the first search path, each set of values includes multiple values corresponding to the multiple coefficients, and multiple values in different value sets are not completely the same;
  • An output value obtaining module configured to obtain the output value of the first processing function based on an analog quantum algorithm when the values of the multiple coefficients are multiple values in the traversed value set;
  • the second path acquisition module is configured to, when the output value of the first processing function converges, use multiple values in the set of values corresponding to the converged output value as the values of the multiple coefficients to obtain the first Two search paths;
  • the data search module is configured to use the second search path to search for the target data in the multiple candidate data.
  • the probability acquisition unit is also used for:
  • the at least two sets of values satisfy the Gaussian distribution, obtaining the average value and variance corresponding to the at least two sets of values;
  • the conditional probability corresponding to the at least two sets of values is obtained.
  • the first path creation module is further used for:
  • the first search path is created according to the first state data, the second state data, and the target search duration.
  • the first search path also includes the target search duration, and the target search duration indicates that the The time required for the transition from the first state to the second state.
  • the types of the multiple candidate data are different, the search condition includes the target type, and the data search module is further used for:
  • a computer device in another aspect, includes a processor and a memory, and at least one piece of program code is stored in the memory, and the at least one piece of program code is loaded and executed by the processor to implement the following The operations performed in the data search method based on the analog quantum algorithm.
  • a computer-readable storage medium is provided, and at least one program code is stored in the computer-readable storage medium, and the at least one program code is loaded and executed by a processor, so as to realize The operation performed in the algorithm's data search method.
  • FIG. 1 is a flowchart of a method for obtaining a search path based on an analog quantum algorithm according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of an estimated function obtained by fitting a Gaussian process regression algorithm according to an embodiment of the present application
  • FIG. 3 is a flowchart of a method for obtaining a value set according to an embodiment of the present application
  • FIG. 4 is a schematic diagram of a method for obtaining a set of values provided by an embodiment of the present application
  • FIG. 5 is a schematic diagram of a search effect based on a linear path, a nonlinear path, and a second search path according to an embodiment of the present application;
  • FIG. 6 is a schematic diagram of another search effect based on a linear path, a nonlinear path, and a second search path provided by an embodiment of the present application;
  • FIG. 7 is a schematic diagram of a search effect based on a second search path provided by an embodiment of the present application.
  • FIG. 8 is a flowchart of another method for obtaining a search path based on an analog quantum algorithm according to an embodiment of the present application.
  • FIG. 9 is a flowchart of a data search method based on an analog quantum algorithm provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a data search device provided by an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of another data search device provided by an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a terminal provided by an embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of a server provided by an embodiment of the present application.
  • first processing function may be referred to as the second processing function
  • second processing function may be referred to as the first processing function
  • each refers to each of the corresponding plurality.
  • the multiple coefficients include 20 coefficients, and each coefficient refers to each of the 20 coefficients.
  • Quantum computing A calculation method based on quantum logic.
  • the basic unit of data storage in quantum computing is the qubit (Qubit).
  • Qubit is the basic unit of quantum computing.
  • classical calculations 0 and 1 are used as the basic units of the binary system.
  • the data is in either state of 0 or 1.
  • quantum computing the data can be 0 or 1 at the same time. That is to say, 0 and 1 can exist at the same time in quantum computing, that is, there is a linear superposition state of 0 and 1.
  • quantum computing can improve the speed and possibility of computing due to the linear superposition state in quantum computing.
  • the linear superposition state can be as shown in formula (1):
  • Ground state the eigenstate with the lowest energy.
  • Separable state and entangled state For a pure state: If
  • Adiabatic quantum computing a way of quantum computing.
  • the mathematical definition is: for two initial state Hamiltonian H0 and final state Hamiltonian H1 that act on n particles and each particle has p states and k local areas, the ground state of the initial state Hamiltonian H0 is The only separable state, the process in which the output state of the initial state Hamiltonian approaches the ground state of the final state Hamiltonian H1 under the action of the L 2 norm is called adiabatic quantum calculation.
  • the Hamiltonian is used to describe the total energy in the quantum system
  • the initial state Hamiltonian is the initial total energy in the quantum system
  • the final state Hamiltonian is the final total energy in the quantum system.
  • the L 2 norm refers to obtaining the square root after obtaining the sum of the squares of each element.
  • the quantum system is based on the time-dependent Hamiltonian H(s) , Starting from the ground state of the initial state Hamiltonian H0, the output state of the final initial state Hamiltonian H0 is close to the ground state of the final state Hamiltonian H1 under the action of the L 2 norm. This process is the adiabatic quantum calculation.
  • Fidelity It is used to indicate the closeness between the output state of the adiabatic quantum calculation process and the ground state of the final state Hamiltonian H1. The closer the output state is to the ground state of the final state Hamiltonian H1, the greater the fidelity, the fidelity The value range of degree is 0 to 1.
  • Optimal search path For a fixed evolution time T, obtain the function s(t), so that by substituting the evolution time T into formula (2), a minimum value can be output, and formula (3) is an expression of Schrödinger’s equation Form, Schrodinger equation is a basic equation in quantum computing, used to describe quantum dynamics in quantum systems.
  • the problem of obtaining the optimal search path is converted to the problem of obtaining the solution of formula (2) and formula (3), and the optimal search path is the following formula (2) and formula (3)
  • ⁇ (T)> is a column vector
  • is a Hermitian conjugate row vector corresponding to the column vector, these two vectors are used to represent the quantum pure state in the quantum system; Means to find the first-order partial derivative for
  • ⁇ (t)>; H 1 and H 0 are two known parameters; i is an imaginary unit; when t 0,
  • ⁇ (0)>
  • FIG. 1 is a flowchart of a method for obtaining a search path based on an analog quantum algorithm provided by an embodiment of the present application.
  • the execution subject of the embodiment of this application is a computer device.
  • the computer device is a classic computer device.
  • the computer device is a terminal, which is a portable, pocket-sized, handheld, and other types of terminals, such as mobile phones, computers, tablet computers, notebook computers, desktop computers, smart speakers, smart watches, etc., but not Limited to this.
  • the computer device is a server, which is an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, Cloud servers for basic cloud computing services such as network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
  • the computer device is a quantum computer device, which is a type of physical device that follows the laws of quantum mechanics to perform high-speed mathematical and logical operations, and store and process quantum information.
  • the characteristics of quantum computer equipment mainly include faster operation speed, stronger information processing ability, and wider application range. The more information processed by quantum computer equipment, the more advantageous it will be for quantum computer equipment to perform calculations, and the more accurate calculations can be ensured. See Figure 1, the method includes.
  • the computer device acquires a first search path, where the first search path includes multiple coefficients whose values are undetermined.
  • the expression form of the first search path has been determined, the relationship between the multiple coefficients has been determined, the independent variable has been determined, and the relationship between the independent variable and the multiple coefficients has been determined, but the multiple coefficients The value of has not yet been determined.
  • the values of the multiple coefficients are arbitrary values, and different values are set for the multiple coefficients to obtain different search paths corresponding to the first search path.
  • T is the evolution time
  • t is the independent variable
  • b j is a coefficient whose value is undetermined
  • the value range of j is 1 to positive infinity
  • j is a positive integer.
  • the above formula (4) is the expression form of the first search path in the frequency domain.
  • high-frequency oscillation easily interferes with the state of the quantum, turning the quantum state into an excited state with higher energy, and Adiabatic quantum calculations need to change the quantum state into a lower energy ground state, so it needs to be truncated at a high frequency with a frequency of M. That is to say, in the above formula (4), the value range of j is no longer from 1 to positive infinity. , But becomes 1 to M.
  • M is any low frequency frequency, such as any value smaller than the reference low frequency frequency, and M is a positive integer.
  • the embodiment of the present application only takes the first search path shown in the above formula (5) as an example for description.
  • the first search path is another expression form.
  • the embodiment of the present application There is no restriction on the expression form of the first search path.
  • the computer device obtains the first processing function corresponding to the first search path.
  • the first processing function is calculated from the first search path and other functions, that is, the first The output value of the processing function is determined by the first search path.
  • the expression form of the first processing function has been determined, and in the first processing function, except for the multiple coefficients included in the first search path and whose values are not determined, the values of other coefficients have been determined. The relationship between the two has been determined, the independent variable has been determined, and the relationship between the independent variable and multiple coefficients has been determined.
  • the first processing function also includes multiple coefficients with undetermined values, if data is input to the first processing function, the values of the multiple coefficients need to be determined before the output value of the first processing function can be determined.
  • the first processing function is the objective function of the first search path.
  • the first search path and the first processing function satisfy the following relationship:
  • ⁇ (T)> in formula (2) is the first processing function
  • s(t) in formula (3) is the first search path.
  • the values of multiple coefficients in the first search path s(t) are determined each time, so that after the first search path s(t) is substituted into the first processing function, the value of the variable t in the first processing function is T
  • the output value of the first processing function is the minimum value
  • the determined first search path s(t) is substituted into the first processing function multiple times, the output value of the first processing function converges, and the last determined value can be determined
  • the values of multiple coefficients in the first search path s(t) meet the target.
  • the embodiment of the present application only uses the first processing function determined by formula (2) and formula (3) as an example for description.
  • the first processing function is in other expression forms.
  • the embodiment of the present application does not limit the expression form of the first processing function.
  • the computer device obtains the output value of the first processing function based on the analog quantum algorithm when the values of the multiple coefficients are multiple values in the value set.
  • the computer device traverses at least two sets of values of the first search path, and based on an analog quantum algorithm, obtains that when the values of multiple coefficients are multiple values in the traversed value set, the first For the output value of the processing function, an output value of the first processing function is obtained according to a set of values, and the output value is the output value corresponding to the value set.
  • the computer device obtains the output value of the first processing function, it needs to traverse multiple sets of values until the output value of the first processing function converges. In the case that the output value of the first processing function does not converge, step 104 is executed. When the output value of the first processing function converges, step 106 is executed.
  • the output value of the first processing function does not converge means that the output value of the first processing function corresponding to the at least two sets of values that has been traversed does not converge to a certain value; the output value of the first processing function converges means that the output value of the first processing function has Among the at least two sets of numerical values that have been traversed, the output values of the first processing function corresponding to the at least two sets of numerical values that have been traversed most recently converge to the same numerical value.
  • the value converged by the first processing function is determined according to the first processing function.
  • the analog quantum algorithm includes multiple sub-functions and the calculation method of the first processing function is determined based on the multiple sub-functions. Based on the analog quantum algorithm, the computer device processes multiple values in the numerical set to obtain multiple sub-functions. The first values output by the sub-functions are subjected to arithmetic processing on the first values output by the multiple sub-functions according to the operation mode to obtain the output value of the first processing function.
  • the first processing function is a very complex function. Multiple values in the value set are directly used as the values of the multiple coefficients and substituted into the first processing function. The output value cannot be obtained, but the simulated quantum algorithm can Perform operations on multiple sub-functions in accordance with the calculation method to obtain the first processing function.
  • the multiple sub-functions are relatively simple functions. Taking multiple values in the numerical set as the values of the multiple coefficients and substituting them into the sub-functions can be obtained. The output value of each sub-function is the first value, and the multiple first values are calculated according to the operation mode to obtain the output value of the first processing function.
  • the computer device performs function fitting on the acquired at least two sets of numerical values and the corresponding output values to obtain output values corresponding to the at least two sets of numerical values.
  • the second processing function of the distribution is the case that the output value of the first processing function does not converge.
  • the computer device traverses at least two sets of values of the first search path, and obtains the output values corresponding to the at least two sets of values based on the simulated quantum algorithm. Perform function fitting on the two sets of numerical values and the corresponding output values to obtain the second processing function used to describe the distribution of the output values corresponding to the at least two sets of numerical values.
  • the Gaussian process regression algorithm is a machine learning algorithm that uses Gaussian process to perform regression analysis on data. It can use multiple known data points corresponding to the original objective function to fit the fitting function corresponding to the original objective function. .
  • the first processing function in the embodiment of the present application is the original objective function, and the obtained at least two value sets and corresponding output values are corresponding to the first processing function and are known at least two values. If there are two data points, the following steps are used to fit the acquired data points to obtain the second processing function.
  • the computer device obtains at least two sets of values and the corresponding output value of the first processing function.
  • the first processing function is an undetermined function, and the first processing function is a high-dimensional function, that is, the dimension of the feasible region of the first processing function
  • the number is high-dimensional, for example, x ⁇ R d , d ⁇ 20, which means that the feasible region is 20-dimensional.
  • the embodiment of the present application is described by taking k value sets that have been obtained as an example.
  • the k value sets are: x 1 , x 2 ,...x k , and the k value sets all satisfy the value of the coefficient of the first processing function
  • the range requirement is to substitute multiple values from the k value sets into the first processing function to obtain the output value of the k value set corresponding to the first processing function: [f(x 1 ), f(x 2 ),...,F(x k )]. That is to say, based on the analog quantum algorithm, the k value sets are processed to obtain the output value of the first processing function.
  • k is a positive integer
  • x represents a set of values.
  • the Gaussian distribution of the output value of the first processing function corresponding to the k value sets is as follows Formula (6) shows:
  • x 1:k represents the first value set to the k-th value set
  • ⁇ 0 represents the expected value corresponding to the value set
  • ⁇ 0 represents the covariance matrix
  • ⁇ 0 (x 1 ,x 1 ) Represents the covariance matrix determined according to the value set x 1
  • ⁇ 0 (x 1:k , x 1: k ) represents the covariance matrix corresponding to the k value sets, namely:
  • ⁇ 0 (x 1:k ,x 1:k ) [ ⁇ 0 (x 1 ,x 1 ),..., ⁇ 0 (x 1 ,x k );...; ⁇ 0 (x k ,x 1 ),... , ⁇ 0 (x k ,x k )].
  • the computer device performs function fitting on the acquired at least two sets of numerical values and corresponding output values to obtain a second processing function used to describe the distribution of the output values corresponding to the at least two sets of numerical values.
  • the computer device obtains the conditional probabilities corresponding to the at least two sets of values when the at least two sets of values satisfy the Gaussian distribution, and according to the at least two sets of values and the corresponding output values and conditional probabilities, The second processing function is adjusted to obtain the adjusted second processing function.
  • the conditional probability represents the probability of obtaining the second processing function based on the at least two sets of numerical values and the corresponding output values under the condition that the distribution of the output values corresponding to the at least two sets of numerical values satisfies the Gaussian distribution.
  • the Gaussian distribution is a multivariate Gaussian distribution.
  • the posterior probability for the second processing function is obtained, and the posterior probability is As the conditional probability corresponding to at least two sets of values.
  • the average value and the variance corresponding to the at least two sets of values are obtained; according to the average value and the variance, the conditional probability corresponding to the at least two sets of values is obtained.
  • ⁇ k (x) represents the average value of the second processing function
  • the average value ⁇ k (x) is shown in the following formula (8):
  • ⁇ k (x) ⁇ 0 (x,x 1:k ) ⁇ 0 (x 1:k ,x 1:k ) -1 (f(x 1:k )- ⁇ 0 (x 1:k ))+ ⁇ 0 (x) (8)
  • x 1:k represents the first value set to the k-th value set
  • ⁇ 0 (x) represents the expected value corresponding to the value set x
  • ⁇ 0 (x 1:k ) represents the corresponding value of the k value set
  • the expected value of ⁇ 0 (x 1:k ) [ ⁇ 0 (x 1 ), ⁇ 0 (x 2 ),..., ⁇ 0 (x k )]
  • ⁇ 0 represents the covariance matrix
  • ⁇ 0 (x 1 ,x 1 ) represents the covariance matrix determined according to the data x 1
  • ⁇ 0 (x 1:k ,x 1:k ) represents the covariance matrix corresponding to the set of k values.
  • ⁇ 0 represents the covariance matrix
  • ⁇ 0 (x 1 ,x 1 ) represents the covariance matrix determined according to the value set x 1
  • ⁇ 0 (x 1:k ,x 1:k ) represents the corresponding value of the k value set Covariance matrix
  • the conditional probability is determined according to Bayes' rule, where Bayes' rule is used to describe the probability that event 2 is established when event 1 is established, and event 1 is established when event 2 is established.
  • Bayes' rule is used to describe the probability that event 2 is established when event 1 is established, and event 1 is established when event 2 is established.
  • the relationship between the probabilities Therefore, according to Bayes' rule, it is determined that when f(x 1:k ) satisfies the Gaussian distribution, the probability that [f(x 1:k ),f(x)] also satisfies the Gaussian distribution.
  • the curve diagram 201 is a curve corresponding to the estimated function predicted based on the 8 data points when 8 data points are obtained.
  • the curve diagram 201 has a larger shaded part, which indicates that the predicted curve is not accurate enough.
  • the curve diagram 202 in FIG. 2 shows the curve corresponding to the second processing function predicted based on the 17 data points when 17 data points are acquired. It can be seen that the Gaussian process regression algorithm can be compared based on the 17 data points. The curve of the first processing function corresponding to these data points is accurately drawn, which means that the Gaussian process regression algorithm can quickly and accurately estimate the function.
  • the embodiment of the present application only takes the process of obtaining the second processing function based on the above at least two sets of values as an example for description.
  • the second processing function is initialized first.
  • the above steps are used to adjust the second processing function that has been obtained, and the adjusted second processing function is obtained. After that, it can continue to be based on the other at least two sets of values, and repeat the above steps to continue the adjustment.
  • the adjusted second processing function is adjusted again, and so on, a more accurate second processing function can be obtained.
  • the computer device obtains the updated value set, so that the output value obtained after the multiple values in the updated value set are processed by the expectation function is the maximum output value of the expectation function.
  • the Gaussian process regression algorithm can be used to obtain the second processing function corresponding to the first processing function more accurately, but if necessary, a more accurate second processing function can be obtained.
  • the best choice for the expected function is the first processing function, that is, the first processing function is used as the expected function, but the first processing function is still an unknown function, so the expected function corresponding to the expected improvement (EI) is obtained.
  • the computer device obtains the maximum output value among the output values of the first processing function corresponding to the at least two sets of values.
  • the output value f(x 1:n ) corresponding to the set of n values is obtained, and the current maximum output value can be defined
  • n is a positive integer, Used to represent the largest output value among n output values.
  • the computer device determines the expected function corresponding to the second processing function according to the difference between the second processing function and the maximum output value.
  • the expectation function is a function for obtaining the mean value of the maximum value of the difference and zero.
  • the desired function is defined as shown in the following formula (10):
  • n represents the currently determined n output values
  • EI n represents the expected function when n output values have been determined
  • the maximum value is 0 or
  • E represents averaging
  • averaging E n represents the n-th output values have been determined.
  • ⁇ n (x) represents the average value corresponding to n output values
  • ⁇ n (x) represents the standard deviation corresponding to n output values
  • is the cumulative function
  • the computer equipment uses a gradient algorithm to determine a set of values corresponding to the maximum output value of the desired function as an updated value set.
  • the update rule of the defined value set is shown in the following formula (12):
  • the output value of the aforementioned desired function is the maximum output value
  • the corresponding value set x is the newly acquired value set.
  • the output value of the expected function converges to 0 it means that the output value corresponding to the multiple known value sets already has a maximum value, that is, it converges to the maximum value.
  • the output value of the first processing function also converges .
  • Figure 4 shows a schematic diagram of the process of updating a set of values, obtaining a set of values, and processing multiple values in the set of values based on a simulated quantum algorithm to obtain the first values corresponding to multiple sub-functions.
  • the first value corresponding to multiple sub-functions and the operation mode of the first processing function is determined according to the multiple sub-functions, the output value of the first processing function is determined, and the current value set and corresponding output value, as well as the previous value set and corresponding output
  • the data set and the corresponding output value are fitted to obtain the second processing function, and the expected function corresponding to the second processing function is processed to obtain the value set corresponding to the maximum output value of the expected function, As a set of updated values.
  • multiple numerical values in the first set of numerical values are preset, and the multiple numerical values are set randomly or set based on experience. Except for the first set of values, all other sets of values are obtained in step 105.
  • the computer device uses multiple values in the value set corresponding to the converged output value as values of multiple coefficients to obtain the second search path.
  • the convergence of the output value of the first processing function means that the output values corresponding to multiple value sets converge to the same value. Since the above process of obtaining the output value of the second processing function is a cyclical process, When the output value corresponding to the value set converges, multiple values in the last obtained set of values are used as values of multiple coefficients, and the multiple values are substituted into the first search path to obtain the second search path. Subsequently, the data can be processed according to the second search path.
  • the second search path in the embodiments of the present application is a search path based on quantum computing. Due to the existence of linear superposition states in quantum computing, compared with classical computing, the second search path in quantum computing has a faster data processing speed. Fast, can improve the efficiency of data processing.
  • the obtained second search path is applied to a quantum computer, and the Grover search (a quantum search algorithm) problem in quantum computing is solved according to the obtained second search path.
  • Grover search a quantum search algorithm
  • the classical algorithm It takes 2 n times to search for the target object, but because the quantum computer can achieve secondary acceleration, it only needs to try 2 n/2 times at most to search for the target object.
  • the Grover search based on adiabatic quantum calculation is to design the optimal search path for the two Hamiltonians H0 and H1 given below.
  • H 0 I-
  • H 1 I-
  • I is the identity matrix
  • m> is the target binary string.
  • the ground state of the initial state Hamiltonian H0 is evolved to the ground state of the final state Hamiltonian H1
  • the schematic diagram of the evolution process is shown in Figure 5, the abscissa is the evolution time, the ordinate is the fidelity, curve 1 is the curve corresponding to the linear path, curve 2 is the curve corresponding to the Roland-Cerf path, and curve 3 is the optimal
  • the schematic diagram 501 in Fig. 5 is a schematic diagram of the evolution corresponding to 6 qubits
  • FIG. 5 is a schematic diagram of the evolution corresponding to 8 qubits
  • the schematic diagram 503 in Fig. 5 is corresponding to 10 qubits
  • the schematic diagram of the evolution of, the schematic diagram 504 in FIG. 5 is a schematic diagram of the evolution corresponding to 12 qubits.
  • the second search path is used to respectively evolve 6 qubits, 8 qubits, 10 qubits and 12 qubits.
  • 6 qubits correspond to curve 11 and 8 qubits correspond to Curve 12
  • 10 qubits corresponds to curve 13
  • 12 qubits corresponds to curve 14.
  • the first search path includes multiple coefficients with undetermined values, and the values of the multiple coefficients are respectively determined through the reinforcement learning model to obtain the second search path.
  • the reinforcement learning model is to try multiple optional values for each coefficient, and finally determine an optional value.
  • the reinforcement learning model needs to be tried multiple times, resulting in low efficiency in determining the value, and low efficiency in obtaining the second search path.
  • the value set will be updated to obtain the new output value of the first processing function based on the updated value set.
  • the Gaussian process regression algorithm is used The Gaussian process regression algorithm is aimed at continuous functions that lack a specific symmetrical structure and geometric structure, and are difficult to obtain gradient information. It only takes a short time to complete the processing of this complex function, and the processing efficiency is high.
  • the Gaussian process regression algorithm can process noise-containing functions, and can process multiple types of functions. It has a wide range of applications. When acquiring the second search path, even if the processing function corresponding to the second search path is more complicated The function of, can also be processed quickly by using Gaussian process regression algorithm.
  • the use of the reinforcement learning model can only process discrete data, but cannot directly process continuous functions.
  • the search path obtained by using the reinforcement learning model is only the local optimal search path, and the search path acquisition in this application In the method, continuous functions can be processed, and the second search path obtained is the global optimal search path.
  • the method provided in the embodiments of the present application can determine the values of multiple coefficients of the first search path to obtain the second search path. Compared with the search path obtained by using other values for the multiple coefficients, the first search path is used. Second, when the search path processes data, the data processing speed is the fastest.
  • FIG. 8 is a flowchart of a method for obtaining a search path based on an analog quantum algorithm provided by an embodiment of the present application.
  • the execution subject of the embodiment of the present application is a computer device. Referring to FIG. 8, the method includes.
  • the computer device obtains a first search path and a first processing function corresponding to the first search path.
  • step 801 The implementation of obtaining the first search path and the corresponding first processing function in step 801 is the same as the implementation of step 101 and step 102 in the embodiment shown in FIG. 1, and will not be repeated here.
  • the computer device processes multiple values in the acquired value set based on the analog quantum algorithm to obtain the first value output by the multiple sub-functions.
  • the analog quantum algorithm includes multiple sub-functions and the operation mode of the first processing function is determined according to the multiple sub-functions.
  • the multiple sub-functions include multiple coefficients with undetermined values.
  • the multiple coefficients are the same as the multiple coefficients with undetermined values included in the first processing function, or the multiple coefficients are related to the first processing function.
  • a processing function includes multiple coefficients with undetermined values.
  • each sub-function includes a coefficient with an undetermined value, or, among the multiple sub-functions, a reference number of sub-functions includes a coefficient with an undetermined value, and other sub-functions except the reference number of sub-functions Does not include coefficients whose values are not determined.
  • the embodiment of the present application is based on an analog quantum algorithm
  • multiple values in the acquired value set are processed to obtain the first value output by the multiple sub-functions.
  • the first value output by each sub-function included in the analog quantum algorithm has a corresponding physical meaning. For example, if the first value output by the sub-function represents quantum speed, quantum mass, etc., the analog quantum algorithm represents the first processing function Sub-functions corresponding to multiple physical quantities.
  • the computer device performs an operation on the first value output by the multiple sub-functions according to the operation mode to obtain the output value of the first processing function.
  • the computer device After the computer device obtains the output value of the first processing function, it obtains the output value of the first processing function corresponding to the at least two sets of values that have been traversed, and determines whether the output value of the first processing function converges. If the value converges, step 807 is executed, and if the output value of the first processing function does not converge, step 804 is executed.
  • the computer device When the output value of the first processing function does not converge, the computer device performs function fitting on the acquired at least two sets of numerical values and the corresponding output values to obtain output values corresponding to the at least two sets of numerical values.
  • the second processing function of the distribution When the output value of the first processing function does not converge, the computer device performs function fitting on the acquired at least two sets of numerical values and the corresponding output values to obtain output values corresponding to the at least two sets of numerical values.
  • the second processing function of the distribution When the output value of the first processing function does not converge, the computer device performs function fitting on the acquired at least two sets of numerical values and the corresponding output values to obtain output values corresponding to the at least two sets of numerical values.
  • step 804 The implementation manner of obtaining the second processing function in step 804 is the same as the implementation manner of step 104 in the embodiment shown in FIG. 1, and will not be repeated here.
  • the computer device obtains the maximum output value of the output values corresponding to the at least two sets of values, and determines the expected function corresponding to the second processing function according to the difference between the second processing function and the maximum output value.
  • the computer device uses a gradient algorithm to determine a set of values corresponding to the maximum output value of the desired function, as an updated set of values, and step 802 is repeated.
  • step 805 The implementation manner of determining the desired function in step 805 and the implementation manner of obtaining the updated value set in step 806 are the same as the implementation manner of step 105 in the embodiment shown in FIG. 1, and will not be repeated here.
  • the computer device uses multiple values in the value set corresponding to the converged output value as values of multiple coefficients to obtain a second search path.
  • the search path acquisition method since in the process of traversing the value set of the first search path, different values of multiple coefficients can be processed in one traversal, and the output value of the first processing function In the case of convergence, take multiple values in the set of values corresponding to the converged output value as the values of multiple coefficients to obtain the second search path, and only need to traverse a few times to make the output of the first processing function The value converges to quickly obtain accurate values of multiple coefficients, thereby improving the efficiency of obtaining the second search path.
  • the search path acquisition method based on the analog quantum algorithm shown in FIG. 1 or FIG. 8 can be applied in a search scenario, using a search path to search for target data among multiple candidate data.
  • the following uses a search scenario as an example to describe a data search method based on an analog quantum algorithm.
  • FIG. 9 is a flowchart of a data search method based on an analog quantum algorithm provided by an embodiment of the present application.
  • the execution subject of the embodiment of the present application is a computer device, and the method includes.
  • the computer device creates first state data and second state data according to multiple candidate data to be searched.
  • the candidate data is an item, image or other data.
  • the candidate data is data in different forms, which is not limited in the embodiment of the present application.
  • the first state data is used to describe the state of the multiple candidate data when the search for the multiple candidate data has not yet started
  • the second state data is used to describe the state of the multiple candidate data when the target data has been searched.
  • the first state corresponding to the first state data is a state in which multiple candidate data have the same selection probability
  • the second state corresponding to the second state data is a state in which target data satisfying the search condition has been searched.
  • the search for multiple candidate data has not yet started, and the selection probabilities of multiple candidate data are the same, that is, the computer device performs multiple candidate data for the first time.
  • searching the possibility of selecting any one of the multiple candidate data is the same; when multiple candidate data is in the second state, the target data has been searched, and the probability of selecting the target data is 1. That is, when the computer device searches multiple candidate data for the last time, it must select the target data.
  • the computer device searches for n candidate data for the first time, it selects any candidate data from the n candidate data, and the probability of selecting any candidate data is 1/n .
  • the first state data includes selection probabilities of multiple candidate data
  • the second state data includes reference probabilities.
  • the multiple selection probabilities are determined according to the number of candidate data, and the reference probability is 1. For example, if there are 20 candidate data, and one target data needs to be selected from these 20 candidate data, it can be determined that the selection probability included in the first state data is 1/20.
  • the multiple candidate data are located in different positions.
  • searching for the target data in the multiple candidate data it is necessary to start the search from any initial position, and the end position is the target data location.
  • the first state data includes start position information
  • the second state data includes end position information.
  • the searched location information is the same as the end location information, it means that the target data has been searched.
  • the computer device creates a first search path according to the first state data and the second state data.
  • the implementation of creating the first search path in step 902 is the same as the implementation of acquiring the first search path in step 101, except that the first search path includes multiple coefficients with undetermined values, the first The start point of the search path refers to the first state, and the end point refers to the second state.
  • the computer device creates the first search path according to the first state data, the second state data, and the target search duration.
  • the first search path also includes a target search duration
  • the target search duration represents the duration required for the first state to be converted to the second state.
  • the target search duration is any duration, for example, 1 minute, 2 minutes, or other durations.
  • a search path satisfies the requirements of the target search duration, the first state data, and the second state data.
  • T is the target search time
  • t is an independent variable
  • b j is a coefficient whose value is undetermined
  • the value range of j is 1 to positive infinity
  • j is a positive integer.
  • the first state data is (0, 1)
  • the second state data is (T, 0)
  • other search paths satisfying the first state data and the second state data are created.
  • the computer device obtains the first processing function corresponding to the first search path.
  • the first processing function includes multiple coefficients, and the output value of the first processing function is determined by the first search path, and the convergence of the output value of the first processing function indicates that the values of the multiple coefficients meet the target.
  • the computer device obtains the output value of the first processing function based on the analog quantum algorithm when the values of the multiple coefficients are multiple values in the value set.
  • the computer device performs function fitting on the acquired at least two sets of numerical values and the corresponding output values to obtain output values corresponding to the at least two sets of numerical values.
  • the second processing function of the distribution is the case where the output value of the first processing function does not converge.
  • the computer device obtains the updated value set, so that the output value obtained after the multiple values in the updated value set are processed by the expectation function is the maximum output value of the expectation function.
  • the computer device uses multiple values in the value set corresponding to the converged output value as values of multiple coefficients to obtain a second search path.
  • the implementation manner of determining the second search path in step 903 to step 907 is the same as the implementation manner of determining the second search path in step 102 to step 106 in the embodiment shown in FIG. 1, and will not be repeated here.
  • the computer device uses the second search path to search for target data among multiple candidate data.
  • the computer device uses the second search path to search for target data among multiple candidate data. If the searched candidate data meets the search condition, it means that the candidate data is the target data.
  • the multiple candidate data are of different types
  • the search condition includes the target type
  • the computer device uses the second search path to search the multiple candidate data for target data that meets the target type.
  • the candidate data is 20 candidate items
  • the search condition is the target item type, that is, the target item of the target item type needs to be searched out from the 20 candidate items .
  • the search starts from the beginning of the search path.
  • the probability that the target item can be selected in the first search is 1/20. If the target item is selected in the first search, the probability becomes 1.
  • the search ends; if the target item is not found in the first search, the probability that the target item can be selected in the second search is 1/19; if the target item is selected in the second search, the probability becomes 1, then End the search; if the target item is not found in the second search, the probability that the target item can be selected in the third search becomes 1/18, and the search for the remaining candidate items continues until the target item is found.
  • the multiple candidate data includes data of the same type
  • the search condition includes a data identifier or other data characteristics that can uniquely represent the target data.
  • the embodiment of the present application does not limit the form of the candidate data and the search conditions.
  • the candidate data is data in multiple forms, and the search conditions are determined according to the form of the candidate data.
  • the value set of the first search path since the value set of the first search path is traversed, different values of multiple coefficients can be processed in one traversal, and when the output value of the first processing function converges Next, take multiple values in the set of values corresponding to the converged output value as the values of multiple coefficients to obtain the second search path, so only a small number of traversals are needed to make the output value of the first processing function converge , To quickly obtain accurate values of multiple coefficients, thereby improving the efficiency of obtaining the second search path.
  • the first search path is created based on the first state data and the second state data corresponding to the multiple candidate data, the acquired second search path is suitable for the multiple candidate data, and the second search data can be used Quickly search for target data among multiple candidate data.
  • the second search path is the search path with the shortest search time and the fastest search speed, in the process of searching the target data using the second search path, the target data can be quickly searched from multiple candidate data according to the search conditions , Improve the efficiency of data search.
  • the second search path is a data search method based on quantum computing, and the efficiency of searching target data using the second search path is higher than that of searching target data using classical computing.
  • FIG. 10 is a schematic structural diagram of a data search device provided by an embodiment of the present application. See Figure 10, the device includes.
  • the state data creation module 1001 is configured to create first state data and second state data according to multiple candidate data to be searched, and the first state corresponding to the first state data is a state with the same selection probability of multiple candidate data , The second state corresponding to the second state data is a state where the target data that meets the search condition has been searched;
  • the first path creation module 1002 is configured to create a first search path according to the first state data and the second state data.
  • the start point of the first search path refers to the first state, and the end point refers to the second state, and the first search path includes Multiple coefficients with undetermined values;
  • the first function acquisition module 1003 is configured to acquire a first processing function corresponding to the first search path.
  • the first processing function includes multiple coefficients, and the output value of the first processing function is determined by the first search path.
  • the output value convergence indicates that the values of multiple coefficients meet the target;
  • the set acquisition module 1004 is used to traverse at least two sets of values of the first search path, each set of values includes multiple values corresponding to multiple coefficients, and the multiple values in different value sets are not completely the same;
  • the output value obtaining module 1005 is configured to obtain the output value of the first processing function when the values of the multiple coefficients are multiple values in the traversed value set based on the analog quantum algorithm;
  • the second path acquisition module 1006 is configured to, when the output value of the first processing function converges, use multiple values in the value set corresponding to the converged output value as values of multiple coefficients to obtain the second search path
  • the data search module 1007 is configured to use the second search path to search for target data among multiple candidate data.
  • the output value of the first processing function converges Next, take multiple values in the set of values corresponding to the converged output value as the values of multiple coefficients to obtain the second search path, so only a small number of traversals are needed to make the output value of the first processing function converge , To quickly obtain accurate values of multiple coefficients, thereby improving the efficiency of obtaining the second search path.
  • the first search path is created based on the first state data and the second state data corresponding to the multiple candidate data, the acquired second search path is suitable for the multiple candidate data, and the second search data can be used Quickly search for target data among multiple candidate data.
  • the apparatus further includes:
  • the information obtaining module 1008 is configured to obtain at least two sets of values that have been traversed, and the output value of the first processing function corresponding to the at least two sets of values when the output value of the first processing function does not converge;
  • the second function acquisition module 1009 is used to perform function fitting on at least two sets of numerical values and corresponding output values to obtain a second processing function.
  • the second processing function is used to describe the distribution of output values corresponding to the at least two sets of numerical values,
  • the second processing function includes multiple coefficients;
  • the set update module 1010 is used to obtain the updated value set, so that the output value obtained after multiple values in the updated value set are processed by the expectation function is the maximum output value of the expectation function, and the expectation function is used to describe the second processing The expected return of the function.
  • the second function obtaining module 1009 includes:
  • the probability obtaining unit 1019 is configured to obtain the conditional probabilities corresponding to the at least two sets of values when the at least two sets of values meet the Gaussian distribution, and the conditional probabilities indicate that the distribution of the output values corresponding to the at least two sets of values meets the conditions of the Gaussian distribution Next, obtain the probability of the second processing function based on at least two sets of values and corresponding output values;
  • the function adjustment unit 1029 is configured to adjust the obtained second processing function according to at least two sets of values and corresponding output values and conditional probabilities to obtain the adjusted second processing function.
  • the collective update module 1010 is also used for:
  • the expected function corresponding to the second processing function determines the expected function corresponding to the second processing function, and the expected function is a function for obtaining the mean value of the difference and the maximum value of 0;
  • the gradient algorithm is used to determine a set of values corresponding to the maximum output value of the desired function as the updated value set.
  • the probability obtaining unit 1019 is further configured to:
  • conditional probabilities corresponding to at least two sets of values are obtained.
  • the analog quantum algorithm includes multiple sub-functions and the operation mode of the first processing function is determined according to the multiple sub-functions.
  • the output value obtaining module 1005 includes:
  • the first value obtaining unit 1015 is configured to process multiple values in the traversed value set based on the analog quantum algorithm to obtain the first values output by the multiple sub-functions respectively;
  • the output value obtaining unit 1025 is configured to perform operations on the first values output by the multiple sub-functions according to the operation mode to obtain the output value of the first processing function.
  • the first path creation module 1002 is also used for:
  • a first search path is created.
  • the first search path also includes the target search time length.
  • the target search time length represents the time required to convert the first state to the second state.
  • the types of multiple candidate data are different, the search conditions include the target type, and the data search module 1007 is also used for:
  • the second search path is used to search for target data that meets the target type among multiple candidate data.
  • An embodiment of the present application also provides a computer device, which includes a processor and a memory, at least one piece of program code is stored in the memory, and the at least one piece of program code is loaded by the processor and performs the following operations:
  • first state data and second state data are created.
  • the first state corresponding to the first state data is a state with the same selection probability of multiple candidate data, and the second state data corresponds to the first state data.
  • the second state is the state where the target data that meets the search conditions has been searched;
  • the start point of the first search path refers to the first state
  • the end point refers to the second state
  • the first search path includes multiple coefficients with undetermined values
  • the first processing function includes multiple coefficients.
  • the output value of the first processing function is determined by the first search path.
  • the convergence of the output value of the first processing function indicates the selection of multiple coefficients. Value meets the target;
  • each set of values includes multiple values corresponding to multiple coefficients, and multiple values in different value sets are not completely the same;
  • the second search path is used to search for target data among multiple candidate data.
  • the at least one piece of program code is loaded by the one or more processors and performs the following operations:
  • the second processing function is used to describe the distribution of output values corresponding to the at least two sets of numerical values, and the second processing function includes a plurality of coefficients;
  • the updated value set is acquired, so that the output value obtained after multiple values in the updated value set are processed by the expectation function is the maximum output value of the expectation function, and the expectation function is used to describe the expected return of the second processing function.
  • the at least one piece of program code is loaded by the one or more processors and performs the following operations:
  • conditional probabilities corresponding to the at least two sets of values When at least two sets of values meet the Gaussian distribution, obtain the conditional probabilities corresponding to the at least two sets of values.
  • the conditional probability indicates that the distribution of the output values corresponding to the at least two sets of values meets the Gaussian distribution and is based on the at least two sets of values. Probability of the set and the corresponding output value to obtain the second processing function;
  • the obtained second processing function is adjusted to obtain the adjusted second processing function.
  • the at least one piece of program code is loaded by the one or more processors and performs the following operations:
  • the expected function corresponding to the second processing function determines the expected function corresponding to the second processing function, and the expected function is a function for obtaining the mean value of the difference and the maximum value of 0;
  • the gradient algorithm is used to determine a set of values corresponding to the maximum output value of the desired function as the updated value set.
  • the at least one piece of program code is loaded by the one or more processors and performs the following operations:
  • conditional probabilities corresponding to at least two sets of values are obtained.
  • the analog quantum algorithm includes multiple sub-functions and the operation mode of the first processing function is determined according to the multiple sub-functions, and the at least one program code is loaded by the one or more processors and performs the following operations:
  • the first value output by the multiple sub-functions is operated to obtain the output value of the first processing function.
  • the at least one piece of program code is loaded by the one or more processors and performs the following operations:
  • a first search path is created.
  • the first search path also includes the target search time length.
  • the target search time length represents the time required to convert the first state to the second state.
  • the types of multiple candidate data are different
  • the search condition includes the target type
  • the at least one piece of program code is loaded by the one or more processors and performs the following operations:
  • the second search path is used to search for target data that meets the target type among multiple candidate data.
  • Fig. 12 shows a schematic structural diagram of a terminal 1200 provided by an exemplary embodiment of the present application.
  • the terminal 1200 is used to execute the steps performed by the terminal in the above-mentioned data search method based on the analog quantum algorithm.
  • the terminal 1200 includes a processor 1201 and a memory 1202.
  • the processor 1201 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on.
  • the processor 1201 may adopt at least one hardware form among DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array, Programmable Logic Array). accomplish.
  • the processor 1201 may also include a main processor and a coprocessor.
  • the main processor is a processor used to process data in the awake state, also called a CPU (Central Processing Unit, central processing unit); the coprocessor is A low-power processor used to process data in the standby state.
  • the processor 1201 may be integrated with a GPU (Graphics Processing Unit, image processing interactor), and the GPU is used to render and draw content that needs to be displayed on the display screen.
  • the processor 1201 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computing operations related to machine learning.
  • AI Artificial Intelligence
  • the memory 1202 may include one or more computer-readable storage media, which may be non-transitory.
  • the memory 1202 may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices and flash memory storage devices.
  • the non-transitory computer-readable storage medium in the memory 1202 is used to store at least one instruction, and the at least one instruction is used by the processor 1201 to implement the simulation-based Data search method of quantum algorithm.
  • the terminal 1200 may optionally further include: a peripheral device interface 1203 and at least one peripheral device.
  • the processor 1201, the memory 1202, and the peripheral device interface 1203 may be connected by a bus or a signal line.
  • Each peripheral device can be connected to the peripheral device interface 1203 through a bus, a signal line, or a circuit board.
  • the peripheral device includes: at least one of a display screen 1204 and a power supply 1205.
  • the peripheral device interface 1203 may be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 1201 and the memory 1202.
  • the processor 1201, the memory 1202, and the peripheral device interface 1203 are integrated on the same chip or circuit board; in some other embodiments, any one of the processor 1201, the memory 1202, and the peripheral device interface 1203 or The two can be implemented on a separate chip or circuit board, which is not limited in this embodiment.
  • the display screen 1204 is used to display a UI (User Interface, user interface).
  • the UI can include graphics, text, icons, videos, and any combination thereof.
  • the display screen 1204 also has the ability to collect touch signals on or above the surface of the display screen 1204.
  • the touch signal may be input to the processor 1201 as a control signal for processing.
  • the display screen 1204 may also be used to provide virtual buttons and/or virtual keyboards, also called soft buttons and/or soft keyboards.
  • the display screen 1204 may be one display screen 1204, which is provided with the front panel of the terminal 1200; in other embodiments, there may be at least two display screens 1204, which are respectively arranged on different surfaces of the terminal 1200 or in a folded design; In still other embodiments, the display screen 1204 may be a flexible display screen, which is arranged on the curved surface or the folding surface of the terminal 1200. Furthermore, the display screen 1204 can also be set as a non-rectangular irregular pattern, that is, a special-shaped screen.
  • the display screen 1204 may be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode), etc.
  • the power supply 1205 is used to supply power to various components in the terminal 1200.
  • the power source 1205 may be alternating current, direct current, disposable batteries, or rechargeable batteries.
  • the rechargeable battery may support wired charging or wireless charging.
  • the rechargeable battery can also be used to support fast charging technology.
  • FIG. 12 does not constitute a limitation to the terminal 1200, and may include more or fewer components than shown in the figure, or combine certain components, or adopt different component arrangements.
  • FIG. 13 is a schematic structural diagram of a server provided by an embodiment of the present application.
  • the server 1300 may have relatively large differences due to different configurations or performance, and may include one or more processors (Central Processing Units, CPU) 1301 and one Or more than one memory 1302, where at least one program code is stored in the memory 1302, and the at least one program code is loaded and executed by the processor 1301 to implement the methods provided by the foregoing method embodiments.
  • the server may also have components such as a wired or wireless network interface, a keyboard, an input and output interface for input and output, and the server may also include other components for implementing device functions, which will not be described in detail here.
  • the server 1300 may be used to execute the steps performed by the server in the data search method based on the analog quantum algorithm.
  • the computer device can also be a quantum computer device, and the quantum computer device can also be used to execute the steps in the above-mentioned data search method based on an analog quantum algorithm.
  • the embodiment of the present application also provides a computer-readable storage medium, in which at least one piece of program code is stored, and the at least one piece of program code is loaded by a processor and performs the following operations:
  • first state data and second state data are created.
  • the first state corresponding to the first state data is a state with the same selection probability of multiple candidate data, and the second state data corresponds to the first state data.
  • the second state is the state where the target data that meets the search conditions has been searched;
  • the start point of the first search path refers to the first state
  • the end point refers to the second state
  • the first search path includes multiple coefficients with undetermined values
  • the first processing function includes multiple coefficients.
  • the output value of the first processing function is determined by the first search path.
  • the convergence of the output value of the first processing function indicates the selection of multiple coefficients. Value meets the target;
  • each set of values includes multiple values corresponding to multiple coefficients, and multiple values in different value sets are not completely the same;
  • the second search path is used to search for target data among multiple candidate data.
  • the at least one piece of program code is loaded by the processor and performs the following operations:
  • the second processing function is used to describe the distribution of output values corresponding to the at least two sets of numerical values, and the second processing function includes a plurality of coefficients;
  • the updated value set is acquired, so that the output value obtained after multiple values in the updated value set are processed by the expectation function is the maximum output value of the expectation function, and the expectation function is used to describe the expected return of the second processing function.
  • the at least one piece of program code is loaded by the processor and performs the following operations:
  • conditional probabilities corresponding to the at least two sets of values When at least two sets of values meet the Gaussian distribution, obtain the conditional probabilities corresponding to the at least two sets of values.
  • the conditional probability indicates that the distribution of the output values corresponding to the at least two sets of values meets the Gaussian distribution and is based on the at least two sets of values. Probability of the set and the corresponding output value to obtain the second processing function;
  • the obtained second processing function is adjusted to obtain the adjusted second processing function.
  • the at least one piece of program code is loaded by the processor and performs the following operations:
  • the expected function corresponding to the second processing function determines the expected function corresponding to the second processing function, and the expected function is a function for obtaining the mean value of the difference and the maximum value of 0;
  • the gradient algorithm is used to determine a set of values corresponding to the maximum output value of the desired function as the updated value set.
  • the at least one piece of program code is loaded by the processor and performs the following operations:
  • conditional probabilities corresponding to at least two sets of values are obtained.
  • the analog quantum algorithm includes multiple sub-functions and the operation mode of the first processing function is determined according to the multiple sub-functions, and the at least one piece of program code is loaded by the processor and performs the following operations:
  • the first value output by the multiple sub-functions is operated to obtain the output value of the first processing function.
  • the at least one piece of program code is loaded by the processor and performs the following operations:
  • a first search path is created.
  • the first search path also includes the target search duration.
  • the target search duration represents the duration required to convert the first state to the second state.
  • the types of the multiple candidate data are different
  • the search condition includes the target type
  • the at least one piece of program code is loaded by the processor and performs the following operations:
  • the second search path is used to search for target data that meets the target type among multiple candidate data.
  • the embodiment of the present application also provides a computer program in which at least one piece of program code is stored, and the at least one piece of program code is loaded and executed by a processor to implement the data search method based on an analog quantum algorithm in the above-mentioned embodiment The operation performed.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Computing Systems (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computational Linguistics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Algebra (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Medical Informatics (AREA)
  • Fuzzy Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Operations Research (AREA)
  • Complex Calculations (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本申请提供一种基于模拟量子算法的数据搜索方法、装置、设备及存储介质,数据搜索方法包括:根据待搜索的多个备选数据,创建第一搜索路径(902);获取第一搜索路径对应的第一处理函数(903);遍历第一搜索路径的至少两组数值集合,基于模拟量子算法,获取第一处理函数的输出值(904);在第一处理函数的输出值收敛的情况下,将收敛的输出值对应的数值集合中的多个数值分别作为多个系数的取值,得到第二搜索路径(907),采用第二搜索路径搜索目标数据(908)。通过本申请能够快速获取多个系数的准确取值,提高获取第二搜索路径的效率。

Description

基于模拟量子算法的数据搜索方法、装置及设备
本申请要求于2020年04月26日提交、申请号为202010337586.6、发明名称为“基于模拟量子算法的数据搜索方法、装置及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及计算机技术领域,特别涉及一种基于模拟量子算法的数据搜索方法、装置及设备。
背景技术
随着量子计算技术的发展,量子计算的应用也越来越多,与经典计算相比,量子计算在很大程度上提高了数据处理效率。量子计算中的绝热量子计算采用搜索路径对数据进行处理,而准确的搜索路径能够提高绝热量子计算的效率。
发明内容
本申请实施例提供了一种基于模拟量子算法的数据搜索方法、装置及设备。所述技术方案如下:
一方面,提供了一种基于模拟量子算法的数据搜索方法,所述方法包括:
根据待搜索的多个备选数据,创建第一状态数据和第二状态数据,所述第一状态数据对应的第一状态为所述多个备选数据的选取概率相同的状态,所述第二状态数据对应的第二状态为已经搜索到满足搜索条件的目标数据的状态;
根据所述第一状态数据和所述第二状态数据创建第一搜索路径,所述第一搜索路径的起点指代所述第一状态,且终点指代所述第二状态,所述第一搜索路径包括取值未确定的多个系数;
获取所述第一搜索路径对应的第一处理函数,所述第一处理函数包括所述多个系数,且所述第一处理函数的输出值由所述第一搜索路径确定,所述第一处理函数的输出值收敛指示所述多个系数的取值满足目标;
遍历所述第一搜索路径的至少两组数值集合,每组数值集合包括所述多个系数对应的多个数值,且不同的数值集合中的多个数值不完全相同;
基于模拟量子算法,获取在所述多个系数的取值分别为遍历的数值集合中的多个数值的情况下,所述第一处理函数的输出值;
在所述第一处理函数的输出值收敛的情况下,将收敛的输出值对应的数值集合中的多个数值分别作为所述多个系数的取值,得到第二搜索路径;
采用所述第二搜索路径,在所述多个备选数据中搜索所述目标数据。
另一方面,提供了一种数据搜索装置,所述装置包括:
状态数据创建模块,用于根据待搜索的多个备选数据,创建第一状态数据 和第二状态数据,所述第一状态数据对应的第一状态为所述多个备选数据的选取概率相同的状态,所述第二状态数据对应的第二状态为已经搜索到满足搜索条件的目标数据的状态;
第一路径创建模块,用于根据所述第一状态数据和所述第二状态数据创建第一搜索路径,所述第一搜索路径的起点指代所述第一状态,且终点指代所述第二状态,所述第一搜索路径包括取值未确定的多个系数;
第一函数获取模块,用于获取所述第一搜索路径对应的第一处理函数,所述第一处理函数包括所述多个系数,且所述第一处理函数的输出值由所述第一搜索路径确定,所述第一处理函数的输出值收敛指示所述多个系数的取值满足目标;
集合获取模块,用于遍历所述第一搜索路径的至少两组数值集合,每组数值集合包括所述多个系数对应的多个数值,且不同的数值集合中的多个数值不完全相同;
输出值获取模块,用于基于模拟量子算法,获取在所述多个系数的取值分别为遍历的数值集合中的多个数值的情况下,所述第一处理函数的输出值;
第二路径获取模块,用于在所述第一处理函数的输出值收敛的情况下,将收敛的输出值对应的数值集合中的多个数值分别作为所述多个系数的取值,得到第二搜索路径;
数据搜索模块,用于采用所述第二搜索路径,在所述多个备选数据中搜索所述目标数据。
在一种可能实现方式中,概率获取单元,还用于:
在所述至少两组数值集合满足所述高斯分布的情况下,获取所述至少两组数值集合对应的平均值及方差;
根据所述平均值及所述方差,获取所述至少两组数值集合对应的条件概率。
在另一种可能实现方式中,所述第一路径创建模块,还用于:
根据所述第一状态数据、所述第二状态数据和目标搜索时长,创建所述第一搜索路径,所述第一搜索路径还包括所述目标搜索时长,所述目标搜索时长表示将所述第一状态转换为所述第二状态所需的时长。
在另一种可能实现方式中,所述多个备选数据的类型不同,所述搜索条件包括目标类型,所述数据搜索模块,还用于:
采用所述第二搜索路径,在所述多个备选数据中搜索满足所述目标类型的目标数据。
另一方面,提供了一种计算机设备,所述计算机设备包括处理器和存储器,所述存储器中存储有至少一条程序代码,所述至少一条程序代码由所述处理器加载并执行,以实现如所述基于模拟量子算法的数据搜索方法中所执行的操作。
另一方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一条程序代码,所述至少一条程序代码由处理器加载并执行,以实现如所述基于模拟量子算法的数据搜索方法中所执行的操作。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请实施例的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种基于模拟量子算法的搜索路径获取方法的流程图;
图2是本申请实施例提供的一种采用高斯过程回归算法拟合得到估计函数的示意图;
图3是本申请实施例提供的一种数值集合获取方法的流程图;
图4是本申请实施例提供的一种数值集合获取方法的示意图;
图5是本申请实施例提供的一种基于线性路径、非线性路径及第二搜索路径的搜索效果的示意图;
图6是本申请实施例提供的另一种基于线性路径、非线性路径及第二搜索路径的搜索效果的示意图;
图7是本申请实施例提供的一种基于第二搜索路径的搜索效果的示意图;
图8是本申请实施例提供的另一种基于模拟量子算法的搜索路径获取方法的流程图;
图9是本申请实施例提供的一种基于模拟量子算法的数据搜索方法的流程图;
图10是本申请实施例提供的一种数据搜索装置的结构示意图;
图11是本申请实施例提供的另一种数据搜索装置的结构示意图;
图12是本申请实施例提供的一种终端的结构示意图;
图13是本申请实施例提供的一种服务器的结构示意图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
可以理解,本申请所使用的术语“第一”、“第二”、“第三”等可在本文中用于描述各种概念,但除非特别说明,这些概念不受这些术语限制。这些术语仅用于将一个概念与另一个概念区分。举例来说,在不脱离本申请的范围的情况下,可以将第一处理函数称为第二处理函数,将第二处理函数称为第一处理函数。
本申请所使用的术语“每个”、“多个”等,多个包括两个或两个以上,每个是指对应的多个中的每一个。举例来说,多个系数包括20个系数,而每个系数是指这20个系数中的每一个系数。
为了便于理解本申请实施例提供的基于模拟量子算法的数据搜索方法,下面对涉及到的关键词进行解释。
量子计算:一种基于量子逻辑进行计算的计算方式,量子计算中存储数据 的基本单位是量子比特(Qubit)。
量子比特:量子比特是量子计算的基本单位。经典计算中采用0和1作为二进制的基本单位,则采用经典计算对数据进行计算的过程中,数据为0和1中的任一种状态;而量子计算中数据能够同时为0或1,也就是说,量子计算中0和1能够同时存在,即存在0和1的线性叠加态。那么,量子计算与经典计算相比,由于量子计算中存在线性叠加态,能够提高计算速度和可能性。其中,线性叠加态可如公式(1)所示:
|ψ>=α|0>+β|1>  (1)
其中,|ψ>表示线性叠加态,α表示数据的状态为0时的概率幅,β代表数据的状态为1时的概率幅,α和β均为复数。因此,采用α的模平方|α| 2表示数据处于0的概率,采用β的模平方|β| 2表示数据处于1的概率。
本征态:对于一个厄米共轭的矩阵H,满足方程H|ψ>=E|ψ>的解称为H的本征态|ψ>,|ψ>具有本征能量E。
基态:能量最低的本征态。
可分态和纠缠态:对于一个纯态:
Figure PCTCN2021081810-appb-000001
如果|ψ>能够被分解成
Figure PCTCN2021081810-appb-000002
则将该纯态称为可分态,如果|ψ>不能够被分解成
Figure PCTCN2021081810-appb-000003
则将该纯态称为纠缠态。
绝热量子计算:一种量子计算方式。数学定义为:对于两个作用在n个粒子且每个粒子拥有p个状态和k局域的初态哈密顿量H0和末态哈密顿量H1,其中,初态哈密顿量H0的基态是唯一的可分态,初态哈密顿量的输出态在L 2范数作用下接近末态哈密顿量H1的基态的过程,称之为绝热量子计算。其中,哈密顿量用于描述量子系统中的总能量,初态哈密顿量即为量子系统中初始时的总能量,末态哈密顿量即为量子系统中最终的总能量。其中,L 2范数是指求取各元素的平方和之后求取平方根。
定义搜索路径对应的函数s(t)=1-t/T,t的取值范围为[0,T],T即为量子系统的演化时间,量子系统依据含时哈密顿量H(s),从初态哈密顿量H0的基态开始演化,最后的初态哈密顿量H0的输出态在L 2范数作用下接近末态哈密顿量H1的基态,这个过程就是绝热量子计算。其中,含时哈密顿量为:H(s)=sH0+(1-s)H1,s为定义的函数s(t)。
保真度:用于表示绝热量子计算过程的输出态与末态哈密顿量H1的基态之间的相近程度,输出态越接近末态哈密顿量H1的基态,保真度越大,保真度的取值范围为0到1。
最优的搜索路径:对于固定的演化时间T,获取函数s(t),以使将演化时间T代入公式(2)中,可以输出一个最小值,公式(3)为薛定谔方程的一种表达形式,薛定谔方程为量子计算中的一种基本方程,用于描述量子系统中的量子动力学。
本申请实施例中,将获取最优的搜索路径的问题转换为获取公式(2)和公式(3)的解的问题,则最优的搜索路径为下述公式(2)和公式(3)的解:
min {s(t)}<ψ(T)|H 1|ψ(T)>  (2)
Figure PCTCN2021081810-appb-000004
其中,|ψ(T)>为一个列向量,<ψ(T)|为与列向量对应的一个厄米共轭的行向量,这两个向量用于表示量子系统中量子纯态;
Figure PCTCN2021081810-appb-000005
表示对|ψ(t)>求一阶偏导数;H 1和H 0为两个已知参数;i为虚数单位;当t=0时,|ψ(0)>=|g 0>,|g 0>表示初始哈密顿量H0的基态。
图1是本申请实施例提供的一种基于模拟量子算法的搜索路径获取方法的流程图。本申请实施例的执行主体为计算机设备。在一种可能实现方式中,该计算机设备为经典计算机设备。可选地,计算机设备为终端,该终端为便携式、袖珍式、手持式等多种类型的终端,如手机、计算机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能手表等,但并不局限于此。可选地,计算机设备为服务器,该服务器是独立的物理服务器,或者是多个物理服务器构成的服务器集群或者分布式系统,或者是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN(Content Delivery Network,内容分发网络)、以及大数据和人工智能平台等基础云计算服务的云服务器。在另一种可能实现方式中,该计算机设备为量子计算机设备,量子计算机设备是一类遵循量子力学规律进行高速数学和逻辑运算、存储及处理量子信息的物理装置。量子计算机设备的特点主要有运行速度较快、处置信息能力较强、应用范围较广等。量子计算机设备信息处理量愈多,量子计算机设备实施运算也就愈加有利,也就更能确保运算具备精准性。参见图1,该方法包括。
101、计算机设备获取第一搜索路径,该第一搜索路径包括取值未确定的多个系数。
本申请实施例中,第一搜索路径的表达形式已确定,多个系数之间的关系已确定,自变量已确定,且自变量与多个系数之间的关系已确定,但该多个系数的取值还未确定。可选地,该多个系数的取值为任意数值,为该多个系数设置不同的数值,能够得到第一搜索路径对应的不同搜索路径。
在一种可能实现方式中,定义第一搜索路径为s(t)=1-t/T,对该第一搜索路径进行傅里叶变换,得到如下述公式(4)所示的搜索路径:
Figure PCTCN2021081810-appb-000006
其中,T为演化时间,t为自变量,b j为取值未确定的系数,j的取值范围为1到正无穷,且j为正整数。
上述公式(4)是第一搜索路径在频域上的表达形式,由于在绝热量子计算过程中,高频振荡容易对量子的状态产生干扰,将量子态变为能量更高的激发态,而绝热量子计算需要将量子态变为能量较低的基态,因此需要以频率数为M进行高频截断,也就是说,上述公式(4)中,j的取值范围不再是1到正无穷,而是变为1到M。可选地,M为任一低频频率,如小于参考低频频率的任一数值,且M为正整数。
因此,下述公式(5)为最终获取的第一搜索路径,该第一搜索路径中需要 确定M个系数的数值:
Figure PCTCN2021081810-appb-000007
需要说明的是,本申请实施例仅是以上述公式(5)所示的第一搜索路径为例进行说明,在另一实施例中,第一搜索路径为其他的表达形式,本申请实施例对第一搜索路径的表达形式不做限制。
102、计算机设备获取第一搜索路径对应的第一处理函数。
本申请实施例中,第一处理函数与第一搜索路径之间存在关联,可选地,该第一处理函数是由第一搜索路径与其他的函数经过运算得到的,也即是,第一处理函数的输出值由第一搜索路径确定。该第一处理函数的表达形式已确定,且第一处理函数中除第一搜索路径包括的、取值未确定的该多个系数之外,其他系数的取值均已确定,多个系数之间的关系已确定、自变量已确定,且自变量与多个系数之间的关系已确定。
由于第一处理函数也包括上述取值未确定的多个系数,则如果将数据输入至第一处理函数,需要先确定多个系数的取值,才能够确定第一处理函数的输出值。
并且,由于多个系数的取值不同,第一处理函数的输出值也不同,则为多个系数取不同的数值,当该第一处理函数的输出值收敛于参考数值时,则表示多个系数的取值满足目标。因此该第一处理函数即为该第一搜索路径的目标函数。
在一种可能实现方式中,第一搜索路径与第一处理函数满足以下关系:
min {s(t)}<ψ(T)|H 1|ψ(T)>  (2)
Figure PCTCN2021081810-appb-000008
其中,公式(2)中的<ψ(T)|H 1|ψ(T)>即为第一处理函数,公式(3)中的s(t)即为第一搜索路径。每次确定第一搜索路径s(t)中多个系数的取值,以使将第一搜索路径s(t)代入第一处理函数中后,第一处理函数中变量t的取值为T时,第一处理函数的输出值为最小值,且多次将确定的第一搜索路径s(t)代入第一处理函数,第一处理函数的输出值均收敛,则能够确定最后一次确定的第一搜索路径s(t)中多个系数的取值满足目标。
需要说明的是,本申请实施例仅是根据公式(2)及公式(3)确定的第一处理函数为例进行说明,在另一实施例中,该第一处理函数为其他的表达形式,本申请实施例对第一处理函数的表达形式不做限制。
103、计算机设备基于模拟量子算法,获取在多个系数的取值为数值集合中的多个数值的情况下,第一处理函数的输出值。
本申请实施例中,计算机设备遍历第一搜索路径的至少两组数值集合,基于模拟量子算法,获取在多个系数的取值分别为遍历的数值集合中的多个数值的情况下,第一处理函数的输出值,则根据一组数值集合会得到第一处理函数的一个输出值,则该输出值即为该数值集合对应的输出值。计算机设备获取第一处理函数的输出值的过程中,需要遍历多组数值集合,直至第一处理函数的输出值收敛,在第一处理函数的输出值不收敛的情况下,执行步骤104,在第一 处理函数的输出值收敛的情况下,执行步骤106。
其中,第一处理函数的输出值不收敛是指已遍历完成的至少两组数值集合对应的第一处理函数的输出值均不收敛于某一数值;第一处理函数的输出值收敛是指已遍历完成的至少两组数值集合中,最新遍历完成的至少两组数值集合对应的第一处理函数的输出值收敛于同一数值。其中,第一处理函数所收敛的数值根据第一处理函数确定。
在一种可能实现方式中,模拟量子算法包括多个子函数及根据多个子函数确定第一处理函数的运算方式,计算机设备基于模拟量子算法,对数值集合中的多个数值进行处理,分别得到多个子函数输出的第一数值,按照运算方式,对多个子函数输出的第一数值进行运算处理,得到第一处理函数的输出值。
可选地,第一处理函数为一个很复杂的函数,直接将数值集合中的多个数值作为该多个系数的取值,代入第一处理函数中,无法得到输出值,但是模拟量子算法能够对多个子函数按照运算方式进行运算,得到第一处理函数,该多个子函数是较为简单的函数,将数值集合中的多个数值作为该多个系数的取值,代入子函数中,能够得到每个子函数输出的第一数值,从而对多个第一数值按照运算方式进行运算,即可得到第一处理函数的输出值。
104、计算机设备在第一处理函数的输出值不收敛的情况下,对已获取的至少两组数值集合及对应的输出值进行函数拟合,得到用于描述至少两组数值集合对应的输出值的分布的第二处理函数。
本申请实施例中,计算机设备遍历第一搜索路径的至少两组数值集合,基于模拟量子算法获取了至少两组数值集合对应的输出值,则计算机设备采用高斯过程回归算法,对已获取的至少两组数值集合及对应的输出值进行函数拟合,得到用于描述至少两组数值集合对应的输出值的分布的第二处理函数,即根据第二处理函数能够确定至少两组数值集合对应的第一处理函数的输出值的分布情况。其中,高斯过程回归算法是一种利用高斯过程对数据进行回归分析的机器学习算法,能够采用原始目标函数对应的、已知的多个数据点,拟合得到该原始目标函数对应的拟合函数。
在一种可能实现方式中,本申请实施例中的第一处理函数即为原始目标函数,已获取的至少两个数值集合及对应的输出值为第一处理函数对应的、已知的至少两个数据点,则采用下述步骤对已获取的数据点进行拟合得到第二处理函数。
(1)计算机设备获取至少两组数值集合及对应的第一处理函数的输出值。
可选地,对于第一处理函数f(x)来说,该第一处理函数为未确定的函数,且该第一处理函数为一个高维函数,即该第一处理函数的可行域的维数为高维,例如,x∈R d,d≤20,表示可行域为20维。
本申请实施例以已获取了k个数值集合为例进行说明,k个数值集合为:x 1,x 2,…x k,且该k个数值集合均满足第一处理函数对系数的取值范围的要求,则将该k个数值集合中的多个数值分别代入第一处理函数中,得到该k个数值集合对应第一处理函数的输出值:[f(x 1),f(x 2),…,f(x k)]。也就是说,基于模拟量子算法,对k个数值集合进行处理,得到第一处理函数的输出值。其中,k为 正整数,x表示一个数值集合。
在一种可能实现方式中,在该k个数值集合对应的第一处理函数的输出值满足高斯分布的情况下,则该k个数值集合对应的第一处理函数的输出值的高斯分布如下述公式(6)所示:
f(x 1:k)~N(μ 0(x 1:k),Σ 0(x 1:k,x 1:k))  (6)
其中,x 1:k表示第一个数值集合到第k个数值集合,f(x 1:k)表示k个数值集合对应的第一处理函数的输出值,即:f(x 1:k)=[f(x 1),f(x 2),…,f(x k)],μ 0表示数值集合对应的期望值,μ 0(x 1:k)表示k个数值集合对应的期望值,即μ 0(x 1:k)=[μ 0(x 1),μ 0(x 2),…,μ 0(x k)];Σ 0表示协方差矩阵,Σ 0(x 1,x 1)表示根据数值集合x 1确定的协方差矩阵,Σ 0(x 1:k,x 1:k )表示k个数值集合对应的协方差矩阵,即:
Σ 0(x 1:k,x 1:k)=[Σ 0(x 1,x 1),…,Σ 0(x 1,x k);…;Σ 0(x k,x 1),…,Σ 0(x k,x k)]。
(2)计算机设备对已获取的至少两组数值集合及对应的输出值进行函数拟合,得到用于描述至少两组数值集合对应的输出值的分布的第二处理函数。
在一种可能实现方式中,计算机设备在至少两组数值集合满足高斯分布的情况下,获取至少两组数值集合对应的条件概率,根据至少两组数值集合及对应的输出值和条件概率,对第二处理函数进行调整,得到调整后的第二处理函数。其中,条件概率表示至少两组数值集合对应的输出值的分布满足高斯分布的条件下,基于至少两组数值集合及对应的输出值得到第二处理函数的概率。可选地,高斯分布为多元高斯分布。
在第一处理函数的任意输出值的联合分布满足高斯分布的情况下,且基于已获取的至少两组数值集合对应的输出值,得到对于第二处理函数的后验概率,将该后验概率作为至少两组数值集合对应的条件概率。
可选地,在至少两组数值集合满足高斯分布的情况下,获取至少两组数值集合对应的平均值及方差;根据平均值及方差,获取至少两组数值集合对应的条件概率。
例如,将上述k个数值集合及对应的第一处理函数的输出值,作为已知的k个数据点,根据已知的k个数据点,判断第一处理函数在数值集合为x时的输出值f(x),则根据高斯回归过程的假设,[f(x 1:k),f(x)]满足高斯分布,根据贝叶斯法则,确定条件概率如下述公式(7)所示:
Figure PCTCN2021081810-appb-000009
其中,μ k(x)表示第二处理函数的平均值,
Figure PCTCN2021081810-appb-000010
表示第一处理函数的方差,平均值μ k(x)如下述公式(8)所示:
μ k(x)=Σ 0(x,x 1:k0(x 1:k,x 1:k) -1(f(x 1:k)-μ 0(x 1:k))+μ 0(x)  (8)
其中,x 1:k表示第一个数值集合到第k个数值集合,f(x 1:k)表示k个数值集合对应的第一处理函数的输出值,即:f(x 1:k)=[f(x 1),f(x 2),…,f(x k)],μ 0(x)表示数值集合x对应的期望值,μ 0(x 1:k)表示k个数值集合对应的期望值,即μ 0(x 1:k)=[μ 0(x 1),μ 0(x 2),…,μ 0(x k)];Σ 0表示协方差矩阵,Σ 0(x 1,x 1)表示根据数据x 1确定的协方差矩阵,Σ 0(x 1:k,x 1:k)表示k个数值集合对应的协方差矩阵。
方差
Figure PCTCN2021081810-appb-000011
如下述公式(9)所示:
Figure PCTCN2021081810-appb-000012
其中,Σ 0表示协方差矩阵,Σ 0(x 1,x 1)表示根据数值集合x 1确定的协方差矩阵,Σ 0(x 1:k,x 1:k)表示k个数值集合对应的协方差矩阵。
在上述确定条件概率的过程中,根据贝叶斯法则,确定条件概率,其中,贝叶斯法则用于描述事件1成立的情况下事件2成立的概率,与事件2成立的情况下事件1成立的概率之间的关系。因此,根据贝叶斯法则,确定f(x 1:k)满足高斯分布时,[f(x 1:k),f(x)]也满足高斯分布的概率。
举例来说:采用高斯过程回归算法,根据已知的多个数据点,确定该多个数据点对应的函数,参见图2,假设存在一个第一处理函数f(x)=x*sin(x)-2x*cos(x),从该第一处理函数中获取多个数据点,再根据该多个数据点还原出第一处理函数。图2中的实线为第一处理函数对应的曲线,黑色的点表示获取到的数据点,虚线是根据高斯过程回归算法得到的估计函数(第二处理函数)对应的曲线,阴影对应95%的置信区间,即估计函数的曲线可存在的范围。图2中的曲线示意图201为获取到8个数据点时,根据该8个数据点预测得到的估计函数对应的曲线,曲线示意图201中有较大的阴影部分,表示预测的曲线还不够准确。图2中的曲线示意图202为获取到17个数据点时,根据该17个数据点预测得到的第二处理函数对应的曲线,能够看出利用高斯过程回归算法,根据17个数据点已经能够比较准确描绘这些数据点对应的第一处理函数的曲线,也就是说高斯过程回归算法能够快速准确地对函数进行估计处理。
需要说明的是,本申请实施例仅是以根据上述至少两组数值集合得到第二处理函数的过程为例进行说明,可选地,针对于多组数值集合,先初始化第二处理函数,每次根据至少两组数值集合,采用上述步骤对已得到的第二处理函数进行调整,得到调整后的第二处理函数,之后还能够继续根据其他的至少两组数值集合,重复采用上述步骤继续对调整后的第二处理函数进行再次调整,以此类推,即可得到更为准确的第二处理函数。
105、计算机设备获取更新的数值集合,以使更新的数值集合中的多个数值采用期望函数进行处理后得到的输出值为期望函数的最大输出值。
上述步骤104中根据已知的k个数值集合及对应的输出值,采用高斯过程回归算法能够较为准确地得到第一处理函数对应的第二处理函数,但是如果需要得到更加准确的第二处理函数,则需要继续获取新的数值集合及对应的输出值,以根据更多的数值集合及对应的输出值得到更加准确的第二处理函数,而如何获取新的数值集合是关键。因此获取用于描述第二处理函数的期望收益的期望函数,采用该期望函数指示获取更新的数值集合。其中,期望函数最好的选择就是第一处理函数,即将第一处理函数作为期望函数,但是第一处理函数仍是一个未知的函数,因此获取改良期望(EI,Expected Improvement)对应的期望函数。
在一种可能实现方式中,参见图3,采用下述步骤获取更新的数值集合。
1051、计算机设备获取至少两组数值集合对应的第一处理函数的输出值中的最大输出值。
关于期望函数:对于第一处理函数来说,获取了n个数值集合对应的输出 值f(x 1:n),则能够定义当前的最大输出值为
Figure PCTCN2021081810-appb-000013
Figure PCTCN2021081810-appb-000014
其中,n为正整数,
Figure PCTCN2021081810-appb-000015
用于表示n个输出值中的最大输出值。当再获取到一个新的数值集合及对应的输出值(x,f(x))时,当前的最大输出值要么是
Figure PCTCN2021081810-appb-000016
Figure PCTCN2021081810-appb-000017
要么是f(x),即
Figure PCTCN2021081810-appb-000018
则根据新的数值集合将当前的最大值提高
Figure PCTCN2021081810-appb-000019
其中,记号“+”定义为a +=max(a,0)。
1052、计算机设备根据第二处理函数与最大输出值的差值,确定第二处理函数对应的期望函数。
其中,期望函数为求取该差值和0的最大值的均值的函数。
在一种可能实现方式中,定义期望函数如下述公式(10)所示:
Figure PCTCN2021081810-appb-000020
其中,n表示当前已确定的n个输出值,EI n表示已确定n个输出值时的期望函数,
Figure PCTCN2021081810-appb-000021
表示新的数值集合对应的输出值对当前的最大值的提高,该最大值为0或
Figure PCTCN2021081810-appb-000022
E表示求均值,E n表示已确定n个输出值时求均值。
将上述公式(7)代入公式(10)中,得到的简化之后的期望函数如下述公式(11)所示:
Figure PCTCN2021081810-appb-000023
其中,
Figure PCTCN2021081810-appb-000024
μ n(x)表示n个输出值对应的平均值,σ n(x)表示n个输出值对应的标准差,
Figure PCTCN2021081810-appb-000025
为密度函数,Φ为累计函数。
1053、计算机设备采用梯度算法,确定期望函数的最大输出值对应的一组数值集合,作为更新的数值集合。
在一种可能实现方式中,根据确定的第二处理函数对应的期望函数,定义数值集合的更新法则如下述公式(12)所示:
x n+1=argmaxEI n(x)  (12)
也就是说,当上述期望函数的输出值为最大输出值时,对应的数值集合x即为新获取的数值集合。另外,当期望函数的输出值收敛至0时,表示已知的多个数值集合对应的输出值已经存在最大值,也即是收敛于该最大值,此时第一处理函数的输出值也收敛。
另外,图4示出了一种更新数值集合的流程示意图,获取一组数值集合,基于模拟量子算法对一组数值集合中的多个数值进行处理,得到多个子函数对应的第一数值,根据多个子函数对应的第一数值及根据多个子函数确定第一处理函数的运算方式,确定第一处理函数的输出值,根据当前的数值集合及对应的输出值以及之前的数值集合及对应的输出值,根据高斯过程回归算法,对数据集合及对应的输出值进行拟合,得到第二处理函数,对第二处理函数对应的期望函数进行处理,得到期望函数的最大输出值对应的数值集合,作为一组更新的数值集合。
可选地,本申请实施例中,第一组数值集合中的多个数值是预先设置的,该多个数值为随机设置,或者为也根据经验设置。除第一组数值集合之外,其他的数值集合均采用步骤105获取。
106、计算机设备在第一处理函数的输出值收敛的情况下,将收敛的输出值对应的数值集合中的多个数值分别作为多个系数的取值,得到第二搜索路径。
本申请实施例中,第一处理函数的输出值收敛是指多个数值集合对应的输出值收敛于同一数值,由于上述获取第二处理函数的输出值的过程是一个循环过程,则在多个数值集合对应的输出值收敛时,将最后获取的一组数值集合中的多个数值分别作为多个系数的取值,将该多个数值代入第一搜索路径中,得到第二搜索路径。后续即可根据该第二搜索路径对数据进行处理。
本申请实施例中的第二搜索路径是基于量子计算的搜索路径,由于量子计算中存在线性叠加态,因此,与经典计算相比,在量子计算中采用第二搜索路径对数据的处理速度更快,能够提高数据处理效率。
在一种可能实现方式中,将获取的第二搜索路径应用于量子计算机中,根据获取的第二搜索路径,解决量子计算中的Grover搜索(一种量子搜索算法)问题。对于量子计算中的Grover搜索,假设有n个比特,每个比特对应0和1两个状态,则对该n个比特进行编码,能够编码2 n个物体,经典算法在最差的情况下,需要尝试2 n次才能够搜索到目标物体,但是由于量子计算机能够实现二次加速,也就是最多只需要尝试2 n/2次,即可搜索到目标物体。
基于绝热量子计算的Grover搜索,也就是对于下面给定的两个哈密顿量H0、H1,设计最优的搜索路径。
H 0=I-|φ><φ|,H 1=I-|m><m|
其中,
Figure PCTCN2021081810-appb-000026
I是单位矩阵,|m>是目标二进制字符串。
分别采用传统的线性路径、Roland-Cerf路径(一种非线性路径)、以及采用上述步骤得到的第二搜索路径,将初态哈密顿量H0的基态演化至末态哈密顿量H1的基态,则演化过程的示意图如图5所示,横坐标为演化时间,纵坐标为保真度,曲线1为线性路径对应的曲线,曲线2为Roland-Cerf路径对应的曲线,曲线3为最优的搜索路径对应的曲线,图5中的示意图501为6个量子比特对应的演化示意图,图5中的示意图502为8个量子比特对应的演化示意图,图5中的示意图503为10个量子比特对应的演化示意图,图5中的示意图504为12个量子比特对应的演化示意图。
从图5中能够看出,采用传统的线性路径,演化结束之后保真度无法达到1,而采用Roland-Cerf路径和第二搜索路径,演化结束之后保真度能够达到1,并且采用第二搜索路径比采用Roland-Cerf路径到达保真度为1时的时间短,速度更快,提高了绝热量子计算的效率。
另外,从图5中还能够看出,随着量子比特的数目变大,采用线性路径进行演化的效果逐渐变差,这是由于线性路径在任何时刻的速率都是一样的,那么在能隙很小的时候,相同的速率很容易将量子的能量激发到高能级的状态上去,导致无法回到基态。
将上述图5所示的演化过程采用另一种形式进行表现,如图6所示,图6中的横坐标为t/T,纵坐标为路径,曲线1为线性路径对应的曲线,曲线2为Roland-Cerf路径对应的曲线,曲线3为第二搜索路径对应的曲线,图6中的示意图601为6个量子比特对应的演化示意图,图6中的示意图602为8个量子 比特对应的演化示意图,图6中的示意图603为10个量子比特对应的演化示意图,图6中的示意图604为12个量子比特对应的演化示意图。如图7所示,采用第二搜索路径分别对6个量子比特、8个量子比特、10个量子比特及12个量子比特进行演化的示意图,6个量子比特对应曲线11,8个量子比特对应曲线12,10个量子比特对应曲线13,12个量子比特对应曲线14。
从图6和图7能够看出,第二搜索路径在
Figure PCTCN2021081810-appb-000027
时变得较为平坦,这是由于
Figure PCTCN2021081810-appb-000028
处的能隙最小,符合量子力学的物理规律。
相关技术中,第一搜索路径中包括取值未确定的多个系数,通过强化学习模型分别确定多个系数的取值,得到第二搜索路径。但是,强化学习模型是通过对每个系数的多个可选数值进行尝试,最终确定一个可选数值,在获取第二搜索路径的过程中,如果取值未确定的每个系数对应有大量的可选数值,则强化学习模型需要尝试多次,导致确定取值的效率较低,从而导致第二搜索路径的获取效率较低。
本申请实施例提供的方法,由于对第一搜索路径的数值集合进行遍历的过程中,一次遍历即可分别对多个系数的不同取值进行处理,在第一处理函数的输出值收敛的情况下,将收敛的输出值对应的数值集合中的多个数值分别作为多个系数的取值,得到第二搜索路径,因此只需要遍历较少的次数即可使第一处理函数的输出值收敛,以快速获取多个系数的准确取值,从而提高获取第二搜索路径的效率。
并且,当第一处理函数的输出值不收敛时,会更新数值集合,以根据更新的数值集合获取新的第一处理函数的输出值,在更新数值集合的过程中,采用了高斯过程回归算法,该高斯过程回归算法针对连续的、缺乏特定的对称结构和几何结构、难以获取梯度信息的函数,仅需要较短的时间,即可完成对这种复杂的函数的处理,处理效率高。且高斯过程回归算法能够对含有噪声的函数进行处理,能够对多种类型的函数进行处理,应用范围大,则在获取第二搜索路径时,即使该第二搜索路径对应的处理函数是较为复杂的函数,也能够采用高斯过程回归算法快速处理。
并且,由于经典计算中对复杂的函数进行处理时,时间成本和经济成本较高,而对于量子系统来说,量子系统中经历量子相变时,量子系统会变得较为复杂,也就意味着,该量子系统对应的函数会变为较为复杂的函数,采用本申请中的方法能够对复杂的函数快速处理,降低了时间成本和经济成本。
并且,采用强化学习模型只能够对离散的数据进行处理,而无法直接处理连续的函数,导致采用强化学习模型得到的搜索路径仅是局域最优的搜索路径,而本申请中的搜索路径获取方法,能够对连续的函数进行处理,则得到的第二搜索路径为全局最优的搜索路径。
并且,本申请实施例提供的方法,能够确定第一搜索路径的多个系数的取值,得到第二搜索路径,与该多个系数采用其他取值而得到的搜索路径相比,采用该第二搜索路径对数据进行处理时,数据处理速度最快。
图8是本申请实施例提供的一种基于模拟量子算法的搜索路径获取方法的流程图。本申请实施例的执行主体为计算机设备,参见图8,该方法包括。
801、计算机设备获取第一搜索路径及第一搜索路径对应的第一处理函数。
步骤801中获取第一搜索路径及对应的第一处理函数的实施方式与上述图1所示的实施例中的步骤101和步骤102的实施方式同理,在此不再赘述。
802、计算机设备基于模拟量子算法,对获取的数值集合中的多个数值进行处理,得到多个子函数输出的第一数值。
其中,模拟量子算法包括多个子函数及根据多个子函数确定第一处理函数的运算方式。该多个子函数中包括取值未确定的多个系数,可选地,该多个系数与第一处理函数中包括的取值未确定的多个系数相同,或者,该多个系数是对第一处理函数中包括的取值未确定的多个系数进行运算得到的。可选地,每个子函数均包括取值未确定的系数,或者,多个子函数中的参考数量的子函数包括取值未确定的系数,而除参考数量的子函数之外的其他子函数中不包括取值未确定的系数。
另外,由于本申请实施例中是基于模拟量子算法,对获取的数值集合中的多个数值进行处理,得到多个子函数输出的第一数值。那么,模拟量子算法中包括的每个子函数输出的第一数值均有对应的物理含义,例如,子函数输出的第一数值表示量子速度、量子质量等,则模拟量子算法将第一处理函数表示为多个物理量对应的子函数。
803、计算机设备按照运算方式,对多个子函数输出的第一数值进行运算,得到第一处理函数的输出值。
计算机设备获取到第一处理函数的输出值之后,获取已经遍历的至少两组数值集合对应的第一处理函数的输出值,判断第一处理函数的输出值是否收敛,在第一处理函数的输出值收敛的情况下,则执行步骤807,在第一处理函数的输出值不收敛的情况下,则执行步骤804。
804、计算机设备在第一处理函数的输出值不收敛的情况下,对已获取的至少两组数值集合及对应的输出值进行函数拟合,得到用于描述至少两组数值集合对应的输出值的分布的第二处理函数。
步骤804中获取第二处理函数的实施方式与上述图1所示的实施例中的步骤104的实施方式同理,在此不再赘述。
805、计算机设备获取至少两组数值集合对应的输出值中的最大输出值,根据第二处理函数与该最大输出值的差值,确定第二处理函数对应的期望函数。
806、计算机设备采用梯度算法,确定期望函数的最大输出值对应的一组数值集合,作为更新的一组数值集合,重复执行步骤802。
步骤805中确定期望函数的实施方式及步骤806中获取更新的数值集合的实施方式与上述图1所示的实施例中的步骤105的实施方式同理,在此不再赘述。
807、计算机设备在第一处理函数的输出值收敛的情况下,将收敛的输出值对应的数值集合中的多个数值分别作为多个系数的取值,得到第二搜索路径。
本申请实施例提供的搜索路径获取方法,由于对第一搜索路径的数值集合 进行遍历的过程中,一次遍历即可分别对多个系数的不同取值进行处理,在第一处理函数的输出值收敛的情况下,将收敛的输出值对应的数值集合中的多个数值分别作为多个系数的取值,得到第二搜索路径,只需要遍历较少的次数即可使第一处理函数的输出值收敛,以快速获取多个系数的准确取值,从而提高获取第二搜索路径的效率。
上述图1或图8所示的基于模拟量子算法的搜索路径获取方法可以应用于搜索场景下,采用搜索路径,在多个备选数据中搜索目标数据。下面以应用于搜索场景为例,对基于模拟量子算法的数据搜索方法进行说明。
图9是本申请实施例提供的一种基于模拟量子算法的数据搜索方法的流程图。参见图9,本申请实施例的执行主体为计算机设备,该方法包括。
901、计算机设备根据待搜索的多个备选数据,创建第一状态数据和第二状态数据。
可选地,备选数据为物品、图像或其他数据,根据实际的搜索场景的不同,该备选数据为不同形式的数据,本申请实施例对此不做限制。第一状态数据用于描述还未开始对多个备选数据进行搜索时多个备选数据的状态,第二状态数据用于描述已经搜索到目标数据时多个备选数据的状态。
其中,第一状态数据对应的第一状态为多个备选数据的选取概率相同的状态,第二状态数据对应的第二状态为已经搜索到满足搜索条件的目标数据的状态。
也就是说,多个备选数据处于第一状态时,还未开始对多个备选数据进行搜索,多个备选数据的选取概率均相同,即计算机设备第一次对多个备选数据进行搜索时,选取到多个备选数据中的任一备选数据的可能性是相同的;多个备选数据处于第二状态时,已经搜索到目标数据,目标数据的选取概率为1,即计算机设备最后一次对多个备选数据进行搜索时,选取到的必然是目标数据。
例如,有n个备选数据,计算机设备第一次对n备选数据进行搜索时,从n个备选数据中选取任一备选数据,该任一备选数据的选取概率为1/n。
在一种可能实现方式中,第一状态数据中包括多个备选数据的选取概率,第二状态数据中包括参考概率,该多个选取概率根据备选数据的数量确定,参考概率为1。例如,有20个备选数据,需要从这20个备选数据中选取1个目标数据,则能够确定第一状态数据中包括的选取概率为1/20。
在一种可能实现方式中,该多个备选数据位于不同的位置,则在多个备选数据中搜索目标数据时,需要从任一初始位置开始进行搜索,终止位置即为目标数据所在的位置,那么,第一状态数据包括起点位置信息,第二状态数据包括终点位置信息。后续在搜索过程中,如果搜索到的位置信息与终止位置信息相同,则表示搜索到目标数据。
902、计算机设备根据第一状态数据和第二状态数据创建第一搜索路径。
步骤902中创建第一搜索路径的实施方式与上述步骤101中获取第一搜索路径的实施方式同理,不同的是,除第一搜索路径包括取值未确定的多个系数之外,第一搜索路径的起点指代第一状态,且终点指代第二状态。
在一种可能实现方式中,计算机设备根据第一状态数据、第二状态数据和目标搜索时长,创建第一搜索路径。其中,第一搜索路径还包括目标搜索时长,该目标搜索时长表示第一状态转换为第二状态所需的时长。可选地,目标搜索时长为任意时长,例如,为1分钟、2分钟或其他时长。
以目标搜索时长为T,第一状态数据为(0,1),第二状态数据为(T,0)为例,创建第一搜索路径为s(t)=1-t/T,该第一搜索路径满足目标搜索时长、第一状态数据和第二状态数据的要求。
对该第一搜索路径s(t)=1-t/T的形式进行变换,得到如下述公式(4)所示的第一搜索路径:
Figure PCTCN2021081810-appb-000029
其中,T为目标搜索时长,t为自变量,b j为取值未确定的系数,j的取值范围为1到正无穷,且j为正整数。
需要说明的是,本申请实施例仅是以第一状态数据为(0,1),第二状态数据为(T,0),创建的第一搜索路径为s(t)=1-t/T为例进行说明,在另一实施例中,创建其他满足第一状态数据和第二状态数据的搜索路径。
903、计算机设备获取第一搜索路径对应的第一处理函数。其中,第一处理函数包括多个系数,且第一处理函数的输出值由第一搜索路径确定,第一处理函数的输出值收敛指示多个系数的取值满足目标。
904、计算机设备基于模拟量子算法,获取在多个系数的取值为数值集合中的多个数值的情况下,第一处理函数的输出值。
905、计算机设备在第一处理函数的输出值不收敛的情况下,对已获取的至少两组数值集合及对应的输出值进行函数拟合,得到用于描述至少两组数值集合对应的输出值的分布的第二处理函数。
906、计算机设备获取更新的数值集合,以使更新的数值集合中的多个数值采用期望函数进行处理后得到的输出值为期望函数的最大输出值。
907、计算机设备在第一处理函数的输出值收敛的情况下,将收敛的输出值对应的数值集合中的多个数值分别作为多个系数的取值,得到第二搜索路径。
步骤903-步骤907中确定第二搜索路径的实施方式与上述图1所示的实施例中步骤102-步骤106中确定第二搜索路径的实施方式同理,在此不再赘述。
908、计算机设备采用第二搜索路径,在多个备选数据中搜索目标数据。
本申请实施例中,计算机设备采用第二搜索路径,在多个备选数据中搜索目标数据,如果搜索到的备选数据满足搜索条件,则表示该备选数据即为目标数据。
在一种可能实现方式中,多个备选数据的类型不同,搜索条件包括目标类型,计算机设备采用第二搜索路径,在多个备选数据中搜索满足目标类型的目标数据。
例如,备选数据为20个备选物品,需要从20个备选物品中选取1个目标物品,搜索条件为目标物品类型,即需要从20个备选物品中搜索出目标物品类型的目标物品。则在搜索过程中,从搜索路径的起点开始搜索,此时第一次进行搜索能够选取到目标物品的概率为1/20,如果第一次搜索就选取到目标物品, 则概率变为1,则结束搜索;如果第一次搜索没有搜索到目标物品,则第二次进行搜索能够选取到目标物品的概率为1/19,如果第二次搜索选取到目标物品,则概率变为1,则结束搜索;如果第二次搜索还没有搜索到目标物品,则第三次进行搜索能够选取到目标物品的概率变为1/18,继续对剩余的备选物品进行搜索,直至搜索到目标物品。
可选地,多个备选数据中包括类型相同的数据,搜索条件包括数据标识或其他能够唯一表示该目标数据的数据特征。
需要说明的是,本申请实施例对备选数据的形式、搜索条件不做限制,根据实际的应用场景,该备选数据为多种形式的数据,搜索条件根据备选数据的形式确定。
本申请实施例提供的方法,由于对第一搜索路径的数值集合进行遍历的过程中,一次遍历即可分别对多个系数的不同取值进行处理,在第一处理函数的输出值收敛的情况下,将收敛的输出值对应的数值集合中的多个数值分别作为多个系数的取值,得到第二搜索路径,因此只需要遍历较少的次数即可使第一处理函数的输出值收敛,以快速获取多个系数的准确取值,从而提高获取第二搜索路径的效率。并且,由于第一搜索路径是根据多个备选数据对应的第一状态数据和第二状态数据进行创建的,获取的第二搜索路径适用于该多个备选数据,能够采用第二搜索数据在对多个备选数据中快速搜索出目标数据。
并且,由于获取的第二搜索路径为搜索时间最短、搜索速度最快的搜索路径,采用第二搜索路径搜索目标数据的过程中,能够根据搜索条件快速从多个备选数据中搜索到目标数据,提高了数据搜索效率。并且,与经典计算中的数据搜索方式相比较,第二搜索路径是基于量子计算的数据搜索方式,采用第二搜索路径搜索目标数据的效率高于采用经典计算搜索目标数据的效率。
图10是本申请实施例提供的一种数据搜索装置的结构示意图。参见图10,该装置包括。
状态数据创建模块1001,用于根据待搜索的多个备选数据,创建第一状态数据和第二状态数据,第一状态数据对应的第一状态为多个备选数据的选取概率相同的状态,第二状态数据对应的第二状态为已经搜索到满足搜索条件的目标数据的状态;
第一路径创建模块1002,用于根据第一状态数据和第二状态数据创建第一搜索路径,第一搜索路径的起点指代第一状态,且终点指代第二状态,第一搜索路径包括取值未确定的多个系数;
第一函数获取模块1003,用于获取第一搜索路径对应的第一处理函数,第一处理函数包括多个系数,且第一处理函数的输出值由第一搜索路径确定,第一处理函数的输出值收敛指示多个系数的取值满足目标;
集合获取模块1004,用于遍历第一搜索路径的至少两组数值集合,每组数值集合包括多个系数对应的多个数值,且不同的数值集合中的多个数值不完全相同;
输出值获取模块1005,用于基于模拟量子算法,获取在多个系数的取值分 别为遍历的数值集合中的多个数值的情况下,第一处理函数的输出值;
第二路径获取模块1006,用于在第一处理函数的输出值收敛的情况下,将收敛的输出值对应的数值集合中的多个数值分别作为多个系数的取值,得到第二搜索路径
数据搜索模块1007,用于采用第二搜索路径,在多个备选数据中搜索目标数据。
本申请实施例提供的装置,由于对第一搜索路径的数值集合进行遍历的过程中,一次遍历即可分别对多个系数的不同取值进行处理,在第一处理函数的输出值收敛的情况下,将收敛的输出值对应的数值集合中的多个数值分别作为多个系数的取值,得到第二搜索路径,因此只需要遍历较少的次数即可使第一处理函数的输出值收敛,以快速获取多个系数的准确取值,从而提高获取第二搜索路径的效率。并且,由于第一搜索路径是根据多个备选数据对应的第一状态数据和第二状态数据进行创建的,获取的第二搜索路径适用于该多个备选数据,能够采用第二搜索数据在对多个备选数据中快速搜索出目标数据。
在一种可能实现方式中,参见图11,装置还包括:
信息获取模块1008,用于在第一处理函数的输出值不收敛的情况下,获取已遍历完成的至少两组数值集合,以及至少两组数值集合对应的第一处理函数的输出值;
第二函数获取模块1009,用于对至少两组数值集合及对应的输出值进行函数拟合,得到第二处理函数,第二处理函数用于描述至少两组数值集合对应的输出值的分布,第二处理函数包括多个系数;
集合更新模块1010,用于获取更新的数值集合,以使更新的数值集合中的多个数值采用期望函数进行处理后得到的输出值为期望函数的最大输出值,期望函数用于描述第二处理函数的期望收益。
在另一种可能实现方式中,参见图11,第二函数获取模块1009,包括:
概率获取单元1019,用于在至少两组数值集合满足高斯分布的情况下,获取至少两组数值集合对应的条件概率,条件概率表示至少两组数值集合对应的输出值的分布满足高斯分布的条件下,基于至少两组数值集合及对应的输出值得到第二处理函数的概率;
函数调整单元1029,用于根据至少两组数值集合及对应的输出值和条件概率,对已得到的第二处理函数进行调整,得到调整后的第二处理函数。
在另一种可能实现方式中,参见图11,集合更新模块1010,还用于:
获取至少两组数值集合对应的第一处理函数的输出值中的最大输出值;
根据第二处理函数与最大输出值的差值,确定第二处理函数对应的期望函数,期望函数为求取差值和0的最大值的均值的函数;
采用梯度算法,确定期望函数的最大输出值对应的一组数值集合,作为更新的数值集合。
在另一种可能实现方式中,参见图11,概率获取单元1019,还用于:
在至少两组数值集合满足高斯分布的情况下,获取至少两组数值集合对应的平均值及方差;
根据平均值及方差,获取至少两组数值集合对应的条件概率。
在另一种可能实现方式中,参见图11,模拟量子算法包括多个子函数及根据多个子函数确定第一处理函数的运算方式,输出值获取模块1005,包括:
第一数值获取单元1015,用于基于模拟量子算法,对遍历的数值集合中的多个数值进行处理,分别得到多个子函数输出的第一数值;
输出值获取单元1025,用于按照运算方式,对多个子函数输出的第一数值进行运算,得到第一处理函数的输出值。
在另一种可能实现方式中,第一路径创建模块1002,还用于:
根据第一状态数据、第二状态数据和目标搜索时长,创建第一搜索路径,第一搜索路径还包括目标搜索时长,目标搜索时长表示将第一状态转换为第二状态所需的时长。
在另一种可能实现方式中,多个备选数据的类型不同,搜索条件包括目标类型,数据搜索模块1007,还用于:
采用第二搜索路径,在多个备选数据中搜索满足目标类型的目标数据。
本申请实施例还提供了一种计算机设备,该计算机设备包括处理器和存储器,存储器中存储有至少一条程序代码,该至少一条程序代码由处理器加载并执行如下操作:
根据待搜索的多个备选数据,创建第一状态数据和第二状态数据,第一状态数据对应的第一状态为多个备选数据的选取概率相同的状态,第二状态数据对应的第二状态为已经搜索到满足搜索条件的目标数据的状态;
根据第一状态数据和第二状态数据创建第一搜索路径,第一搜索路径的起点指代第一状态,且终点指代第二状态,第一搜索路径包括取值未确定的多个系数;
获取第一搜索路径对应的第一处理函数,第一处理函数包括多个系数,且第一处理函数的输出值由第一搜索路径确定,第一处理函数的输出值收敛指示多个系数的取值满足目标;
遍历第一搜索路径的至少两组数值集合,每组数值集合包括多个系数对应的多个数值,且不同的数值集合中的多个数值不完全相同;
基于模拟量子算法,获取在多个系数的取值分别为遍历的数值集合中的多个数值的情况下,所述第一处理函数的输出值;
在第一处理函数的输出值收敛的情况下,将收敛的输出值对应的数值集合中的多个数值分别作为多个系数的取值,得到第二搜索路径;
采用第二搜索路径,在多个备选数据中搜索目标数据。
在一种可能实现方式中,该至少一条程序代码由该一个或多个处理器加载并执行如下操作:
在第一处理函数的输出值不收敛的情况下,获取已遍历完成的至少两组数值集合,以及至少两组数值集合对应的第一处理函数的输出值;
对至少两组数值集合及对应的输出值进行函数拟合,得到第二处理函数,第二处理函数用于描述至少两组数值集合对应的输出值的分布,第二处理函数 包括多个系数;
获取更新的数值集合,以使更新的数值集合中的多个数值采用期望函数进行处理后得到的输出值为期望函数的最大输出值,期望函数用于描述第二处理函数的期望收益。
在一种可能实现方式中,该至少一条程序代码由该一个或多个处理器加载并执行如下操作:
在至少两组数值集合满足高斯分布的情况下,获取至少两组数值集合对应的条件概率,条件概率表示至少两组数值集合对应的输出值的分布满足高斯分布的条件下,基于至少两组数值集合及对应的输出值得到第二处理函数的概率;
根据至少两组数值集合及对应的输出值和条件概率,对已得到的第二处理函数进行调整,得到调整后的第二处理函数。
在一种可能实现方式中,该至少一条程序代码由该一个或多个处理器加载并执行如下操作:
获取至少两组数值集合对应的第一处理函数的输出值中的最大输出值;
根据第二处理函数与最大输出值的差值,确定第二处理函数对应的期望函数,期望函数为求取差值和0的最大值的均值的函数;
采用梯度算法,确定期望函数的最大输出值对应的一组数值集合,作为更新的数值集合。
在一种可能实现方式中,该至少一条程序代码由该一个或多个处理器加载并执行如下操作:
在至少两组数值集合满足高斯分布的情况下,获取至少两组数值集合对应的平均值及方差;
根据平均值及方差,获取至少两组数值集合对应的条件概率。
在一种可能实现方式中,模拟量子算法包括多个子函数及根据多个子函数确定第一处理函数的运算方式,该至少一条程序代码由该一个或多个处理器加载并执行如下操作:
基于模拟量子算法,对遍历的数值集合中的多个数值进行处理,分别得到多个子函数输出的第一数值;
按照运算方式,对多个子函数输出的第一数值进行运算,得到第一处理函数的输出值。
在一种可能实现方式中,该至少一条程序代码由该一个或多个处理器加载并执行如下操作:
根据第一状态数据、第二状态数据和目标搜索时长,创建第一搜索路径,第一搜索路径还包括目标搜索时长,目标搜索时长表示将第一状态转换为第二状态所需的时长。
在一种可能实现方式中,多个备选数据的类型不同,搜索条件包括目标类型,该至少一条程序代码由该一个或多个处理器加载并执行如下操作:
采用第二搜索路径,在多个备选数据中搜索满足目标类型的目标数据。
下面以计算机设备为终端为例进行说明。图12示出了本申请一个示例性实 施例提供的终端1200的结构示意图。该终端1200用于执行上述基于模拟量子算法的数据搜索方法中终端所执行的步骤。
通常,终端1200包括有:处理器1201和存储器1202。
处理器1201可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器1201可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器1201也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central Processing Unit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器1201可以在集成有GPU(Graphics Processing Unit,图像处理的交互器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器1201还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。
存储器1202可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器1202还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器1202中的非暂态的计算机可读存储介质用于存储至少一个指令,该至少一个指令用于被处理器1201所具有以实现本申请中方法实施例提供的基于模拟量子算法的数据搜索方法。
在一些实施例中,终端1200还可选包括有:外围设备接口1203和至少一个外围设备。处理器1201、存储器1202和外围设备接口1203之间可以通过总线或信号线相连。各个外围设备可以通过总线、信号线或电路板与外围设备接口1203相连。具体地,外围设备包括:显示屏1204和电源1205中的至少一种。
外围设备接口1203可被用于将I/O(Input/Output,输入/输出)相关的至少一个外围设备连接到处理器1201和存储器1202。在一些实施例中,处理器1201、存储器1202和外围设备接口1203被集成在同一芯片或电路板上;在一些其他实施例中,处理器1201、存储器1202和外围设备接口1203中的任意一个或两个可以在单独的芯片或电路板上实现,本实施例对此不加以限定。
显示屏1204用于显示UI(User Interface,用户界面)。该UI可以包括图形、文本、图标、视频及其它们的任意组合。当显示屏1204是触摸显示屏时,显示屏1204还具有采集在显示屏1204的表面或表面上方的触摸信号的能力。该触摸信号可以作为控制信号输入至处理器1201进行处理。此时,显示屏1204还可以用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,显示屏1204可以为一个,设置终端1200的前面板;在另一些实施例中,显示屏1204可以为至少两个,分别设置在终端1200的不同表面或呈折叠设计;在再一些实施例中,显示屏1204可以是柔性显示屏,设置在终端1200的弯曲表面上或折叠面上。甚至,显示屏1204还可以设置成非矩形的不规则图形,也即异形屏。显示屏1204可以采用LCD(Liquid Crystal Display,液晶显示屏)、OLED(Organic Light-Emitting Diode,有机发光二极管)等材质制备。
电源1205用于为终端1200中的各个组件进行供电。电源1205可以是交流电、直流电、一次性电池或可充电电池。当电源1205包括可充电电池时,该可充电电池可以支持有线充电或无线充电。该可充电电池还可以用于支持快充技术。
本领域技术人员可以理解,图12中示出的结构并不构成对终端1200的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。
下面以计算机设备为服务器为例进行说明。图13是本申请实施例提供的一种服务器的结构示意图,该服务器1300可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(Central Processing Units,CPU)1301和一个或一个以上的存储器1302,其中,存储器1302中存储有至少一条程序代码,该至少一条程序代码由处理器1301加载并执行以实现上述各个方法实施例提供的方法。当然,该服务器还可以具有有线或无线网络接口、键盘以及输入输出接口等部件,以便进行输入输出,该服务器还可以包括其他用于实现设备功能的部件,在此不做赘述。
服务器1300可以用于执行上述基于模拟量子算法的数据搜索方法中服务器所执行的步骤。
需要说明的是,计算机设备还可以为量子计算机设备,量子计算机设备也能够用于执行上述基于模拟量子算法的数据搜索方法中的步骤。
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有至少一条程序代码,该至少一条程序代码由处理器加载并执行如下操作:
根据待搜索的多个备选数据,创建第一状态数据和第二状态数据,第一状态数据对应的第一状态为多个备选数据的选取概率相同的状态,第二状态数据对应的第二状态为已经搜索到满足搜索条件的目标数据的状态;
根据第一状态数据和第二状态数据创建第一搜索路径,第一搜索路径的起点指代第一状态,且终点指代第二状态,第一搜索路径包括取值未确定的多个系数;
获取第一搜索路径对应的第一处理函数,第一处理函数包括多个系数,且第一处理函数的输出值由第一搜索路径确定,第一处理函数的输出值收敛指示多个系数的取值满足目标;
遍历第一搜索路径的至少两组数值集合,每组数值集合包括多个系数对应的多个数值,且不同的数值集合中的多个数值不完全相同;
基于模拟量子算法,获取在多个系数的取值分别为遍历的数值集合中的多个数值的情况下,所述第一处理函数的输出值;
在第一处理函数的输出值收敛的情况下,将收敛的输出值对应的数值集合中的多个数值分别作为多个系数的取值,得到第二搜索路径;
采用第二搜索路径,在多个备选数据中搜索目标数据。
在一种可能实现方式中,该至少一条程序代码由处理器加载并执行如下操作:
在第一处理函数的输出值不收敛的情况下,获取已遍历完成的至少两组数值集合,以及至少两组数值集合对应的第一处理函数的输出值;
对至少两组数值集合及对应的输出值进行函数拟合,得到第二处理函数,第二处理函数用于描述至少两组数值集合对应的输出值的分布,第二处理函数包括多个系数;
获取更新的数值集合,以使更新的数值集合中的多个数值采用期望函数进行处理后得到的输出值为期望函数的最大输出值,期望函数用于描述第二处理函数的期望收益。
在一种可能实现方式中,该至少一条程序代码由处理器加载并执行如下操作:
在至少两组数值集合满足高斯分布的情况下,获取至少两组数值集合对应的条件概率,条件概率表示至少两组数值集合对应的输出值的分布满足高斯分布的条件下,基于至少两组数值集合及对应的输出值得到第二处理函数的概率;
根据至少两组数值集合及对应的输出值和条件概率,对已得到的第二处理函数进行调整,得到调整后的第二处理函数。
在一种可能实现方式中,该至少一条程序代码由处理器加载并执行如下操作:
获取至少两组数值集合对应的第一处理函数的输出值中的最大输出值;
根据第二处理函数与最大输出值的差值,确定第二处理函数对应的期望函数,期望函数为求取差值和0的最大值的均值的函数;
采用梯度算法,确定期望函数的最大输出值对应的一组数值集合,作为更新的数值集合。
在一种可能实现方式中,该至少一条程序代码由处理器加载并执行如下操作:
在至少两组数值集合满足高斯分布的情况下,获取至少两组数值集合对应的平均值及方差;
根据平均值及方差,获取至少两组数值集合对应的条件概率。
在一种可能实现方式中,模拟量子算法包括多个子函数及根据多个子函数确定第一处理函数的运算方式,该至少一条程序代码由处理器加载并执行如下操作:
基于模拟量子算法,对遍历的数值集合中的多个数值进行处理,分别得到多个子函数输出的第一数值;
按照运算方式,对多个子函数输出的第一数值进行运算,得到第一处理函数的输出值。
在一种可能实现方式中,该至少一条程序代码由处理器加载并执行如下操作:
根据第一状态数据、第二状态数据和目标搜索时长,创建第一搜索路径,第一搜索路径还包括目标搜索时长,目标搜索时长表示将第一状态转换为第二 状态所需的时长。
在一种可能实现方式中,多个备选数据的类型不同,搜索条件包括目标类型,该至少一条程序代码由处理器加载并执行如下操作:
采用第二搜索路径,在多个备选数据中搜索满足目标类型的目标数据。
本申请实施例还提供了一种计算机程序,该计算机程序中存储有至少一条程序代码,该至少一条程序代码由处理器加载并执行,以实现上述实施例的基于模拟量子算法的数据搜索方法中所执行的操作。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,该程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上仅为本申请实施例的可选实施例,并不用以限制本申请实施例,凡在本申请实施例的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (15)

  1. 一种基于模拟量子算法的数据搜索方法,应用于计算机设备,所述方法包括:
    根据待搜索的多个备选数据,创建第一状态数据和第二状态数据,所述第一状态数据对应的第一状态为所述多个备选数据的选取概率相同的状态,所述第二状态数据对应的第二状态为已经搜索到满足搜索条件的目标数据的状态;
    根据所述第一状态数据和所述第二状态数据创建第一搜索路径,所述第一搜索路径的起点指代所述第一状态,且终点指代所述第二状态,所述第一搜索路径包括取值未确定的多个系数;
    获取所述第一搜索路径对应的第一处理函数,所述第一处理函数包括所述多个系数,且所述第一处理函数的输出值由所述第一搜索路径确定,所述第一处理函数的输出值收敛指示所述多个系数的取值满足目标;
    遍历所述第一搜索路径的至少两组数值集合,每组数值集合包括所述多个系数对应的多个数值,且不同的数值集合中的多个数值不完全相同;
    基于模拟量子算法,获取在所述多个系数的取值分别为遍历的数值集合中的多个数值的情况下,所述第一处理函数的输出值;
    在所述第一处理函数的输出值收敛的情况下,将收敛的输出值对应的数值集合中的多个数值分别作为所述多个系数的取值,得到第二搜索路径;
    采用所述第二搜索路径,在所述多个备选数据中搜索所述目标数据。
  2. 根据权利要求1所述的方法,其中,所述基于模拟量子算法,获取在所述多个系数的取值分别为遍历的数值集合中的多个数值的情况下,所述第一处理函数的输出值之后,所述方法还包括:
    在所述第一处理函数的输出值不收敛的情况下,获取已遍历完成的至少两组数值集合,以及所述至少两组数值集合对应的所述第一处理函数的输出值;
    对所述至少两组数值集合及对应的输出值进行函数拟合,得到第二处理函数,所述第二处理函数用于描述所述至少两组数值集合对应的输出值的分布,所述第二处理函数包括所述多个系数;
    获取更新的数值集合,以使所述更新的数值集合中的多个数值采用期望函数进行处理后得到的输出值为所述期望函数的最大输出值,所述期望函数用于描述所述第二处理函数的期望收益。
  3. 根据权利要求2所述的方法,其中,所述对所述至少两组数值集合及对应的输出值进行函数拟合,得到第二处理函数,包括:
    在所述至少两组数值集合满足高斯分布的情况下,获取所述至少两组数值集合对应的条件概率,所述条件概率表示所述至少两组数值集合对应的输出值的分布满足所述高斯分布的条件下,基于所述至少两组数值集合及对应的输出值得到所述第二处理函数的概率;
    根据所述至少两组数值集合及对应的输出值和条件概率,对已得到的第二处理函数进行调整,得到调整后的所述第二处理函数。
  4. 根据权利要求2所述的方法,其中,所述获取更新的数值集合,以使所述更新的数值集合中的多个数值采用期望函数进行处理后得到的输出值为所述期望函数的最大输出值,包括:
    获取所述至少两组数值集合对应的所述第一处理函数的输出值中的最大输出值;
    根据所述第二处理函数与所述最大输出值的差值,确定所述第二处理函数对应的所述期望函数,所述期望函数为求取所述差值和0的最大值的均值的函数;
    采用梯度算法,确定所述期望函数的最大输出值对应的一组数值集合,作为所述更新的数值集合。
  5. 根据权利要求3所述的方法,其中,所述在所述至少两组数值集合满足高斯分布的情况下,获取所述至少两组数值集合对应的条件概率,包括:
    在所述至少两组数值集合满足所述高斯分布的情况下,获取所述至少两组数值集合对应的平均值及方差;
    根据所述平均值及所述方差,获取所述至少两组数值集合对应的条件概率。
  6. 根据权利要求1所述的方法,其中,所述模拟量子算法包括多个子函数及根据所述多个子函数确定所述第一处理函数的运算方式,所述基于模拟量子算法,获取在所述多个系数的取值分别为遍历的数值集合中的多个数值的情况下,所述第一处理函数的输出值,包括:
    基于所述模拟量子算法,对所述遍历的数值集合中的多个数值进行处理,分别得到所述多个子函数输出的第一数值;
    按照所述运算方式,对所述多个子函数输出的第一数值进行运算,得到所述第一处理函数的输出值。
  7. 根据权利要求1所述的方法,其中,所述根据所述第一状态数据和所述第二状态数据创建第一搜索路径,包括:
    根据所述第一状态数据、所述第二状态数据和目标搜索时长,创建所述第一搜索路径,所述第一搜索路径还包括所述目标搜索时长,所述目标搜索时长表示将所述第一状态转换为所述第二状态所需的时长。
  8. 根据权利要求1-7任一项所述的方法,其中,所述多个备选数据的类型不同,所述搜索条件包括目标类型,所述采用所述第二搜索路径,在所述多个备选数据中搜索所述目标数据,包括:
    采用所述第二搜索路径,在所述多个备选数据中搜索满足所述目标类型的 目标数据。
  9. 一种数据搜索装置,所述装置包括:
    状态数据创建模块,用于根据待搜索的多个备选数据,创建第一状态数据和第二状态数据,所述第一状态数据对应的第一状态为所述多个备选数据的选取概率相同的状态,所述第二状态数据对应的第二状态为已经搜索到满足搜索条件的目标数据的状态;
    第一路径创建模块,用于根据所述第一状态数据和所述第二状态数据创建第一搜索路径,所述第一搜索路径的起点指代所述第一状态,且终点指代所述第二状态,所述第一搜索路径包括取值未确定的多个系数;
    第一函数获取模块,用于获取所述第一搜索路径对应的第一处理函数,所述第一处理函数包括所述多个系数,且所述第一处理函数的输出值由所述第一搜索路径确定,所述第一处理函数的输出值收敛指示所述多个系数的取值满足目标;
    集合获取模块,用于遍历所述第一搜索路径的至少两组数值集合,每组数值集合包括所述多个系数对应的多个数值,且不同的数值集合中的多个数值不完全相同;
    输出值获取模块,用于基于模拟量子算法,获取在所述多个系数的取值分别为遍历的数值集合中的多个数值的情况下,所述第一处理函数的输出值;
    第二路径获取模块,用于在所述第一处理函数的输出值收敛的情况下,将收敛的输出值对应的数值集合中的多个数值分别作为所述多个系数的取值,得到第二搜索路径;
    数据搜索模块,用于采用所述第二搜索路径,在所述多个备选数据中搜索所述目标数据。
  10. 根据权利要求9所述的装置,其中,所述装置还包括:
    信息获取模块,用于在所述第一处理函数的输出值不收敛的情况下,获取已遍历完成的至少两组数值集合,以及所述至少两组数值集合对应的所述第一处理函数的输出值;
    第二函数获取模块,用于对所述至少两组数值集合及对应的输出值进行函数拟合,得到第二处理函数,所述第二处理函数用于描述所述至少两组数值集合对应的输出值的分布,所述第二处理函数包括所述多个系数;
    集合更新模块,用于获取更新的数值集合,以使所述更新的数值集合中的多个数值采用期望函数进行处理后得到的输出值为所述期望函数的最大输出值,所述期望函数用于描述所述第二处理函数的期望收益。
  11. 根据权利要求10所述的装置,其中,所述第二函数获取模块,包括:
    概率获取单元,用于在所述至少两组数值集合满足高斯分布的情况下,获取所述至少两组数值集合对应的条件概率,所述条件概率表示所述至少两组数 值集合对应的输出值的分布满足所述高斯分布的条件下,基于所述至少两组数值集合及对应的输出值得到所述第二处理函数的概率;
    函数调整单元,用于根据所述至少两组数值集合及对应的输出值和条件概率,对已得到的第二处理函数进行调整,得到调整后的所述第二处理函数。
  12. 根据权利要求10所述的装置,其中,所述集合更新模块,还用于:
    获取所述至少两组数值集合对应的所述第一处理函数的输出值中的最大输出值;
    根据所述第二处理函数与所述最大输出值的差值,确定所述第二处理函数对应的所述期望函数,所述期望函数为求取所述差值和0的最大值的均值的函数;
    采用梯度算法,确定所述期望函数的最大输出值对应的一组数值集合,作为所述更新的数值集合。
  13. 根据权利要求9所述的装置,其中,所述模拟量子算法包括多个子函数及根据所述多个子函数确定所述第一处理函数的运算方式,所述输出值获取模块,包括:
    第一数值获取单元,用于基于所述模拟量子算法,对所述遍历的数值集合中的多个数值进行处理,分别得到所述多个子函数输出的第一数值;
    输出值获取单元,用于按照所述运算方式,对所述多个子函数输出的第一数值进行运算,得到所述第一处理函数的输出值。
  14. 一种计算机设备,其特征在于,所述计算机设备包括处理器和存储器,所述存储器中存储有至少一条程序代码,所述至少一条程序代码由所述处理器加载并执行,以实现如权利要求1至8任一权利要求所述的基于模拟量子算法的数据搜索方法中所执行的操作。
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有至少一条程序代码,所述至少一条程序代码由处理器加载并执行,以实现如权利要求1至8任一权利要求所述的基于模拟量子算法的数据搜索方法中所执行的操作。
PCT/CN2021/081810 2020-04-26 2021-03-19 基于模拟量子算法的数据搜索方法、装置及设备 WO2021218480A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
KR1020217031511A KR20210134724A (ko) 2020-04-26 2021-03-19 시뮬레이션된 양자 알고리즘에 기초한 데이터 검색 방법 및 장치 및 디바이스
JP2021549943A JP7176127B2 (ja) 2020-04-26 2021-03-19 量子シミュレーションアルゴリズムに基づくデータサーチ方法、装置及び機器並びにコンピュータプログラム
EP21773270.0A EP3933616A4 (en) 2020-04-26 2021-03-19 METHOD AND APPARATUS FOR DATA RESEARCH BASED ON AN ANALOG QUANTUM ALGORITHM AND DEVICE
US17/523,840 US11782937B2 (en) 2020-04-26 2021-11-10 Data search method and apparatus based on quantum simulated algorithm, and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010337586.6 2020-04-26
CN202010337586.6A CN111241356B (zh) 2020-04-26 2020-04-26 基于模拟量子算法的数据搜索方法、装置及设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/523,840 Continuation US11782937B2 (en) 2020-04-26 2021-11-10 Data search method and apparatus based on quantum simulated algorithm, and device

Publications (1)

Publication Number Publication Date
WO2021218480A1 true WO2021218480A1 (zh) 2021-11-04

Family

ID=70880790

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/081810 WO2021218480A1 (zh) 2020-04-26 2021-03-19 基于模拟量子算法的数据搜索方法、装置及设备

Country Status (6)

Country Link
US (1) US11782937B2 (zh)
EP (1) EP3933616A4 (zh)
JP (1) JP7176127B2 (zh)
KR (1) KR20210134724A (zh)
CN (1) CN111241356B (zh)
WO (1) WO2021218480A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111241356B (zh) 2020-04-26 2020-08-11 腾讯科技(深圳)有限公司 基于模拟量子算法的数据搜索方法、装置及设备
CN112651509B (zh) * 2020-10-14 2022-04-22 腾讯科技(深圳)有限公司 量子线路的确定方法及装置
CN115907016B (zh) * 2021-09-30 2024-06-14 本源量子计算科技(合肥)股份有限公司 一种基于量子计算搜索目标范围值的方法及相关装置
CN114819166B (zh) * 2022-05-27 2023-05-30 北京大学 一种量子系统的演化方法及装置
CN118014095A (zh) * 2024-04-10 2024-05-10 国开启科量子技术(安徽)有限公司 分布式的多目标量子搜索方法、装置、介质及设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103324978A (zh) * 2013-07-03 2013-09-25 哈尔滨工程大学 基于多目标量子蚁群算法的多目标决策引擎参数优化方法
US20170330101A1 (en) * 2016-05-13 2017-11-16 Microsoft Technology Licensing, Llc Training a quantum optimizer
US20190266213A1 (en) * 2018-02-26 2019-08-29 Microsoft Technology Licensing, Llc Short path quantum procedures for solving combinatorial optimization problems
CN110969254A (zh) * 2019-10-22 2020-04-07 天津大学 一种基于绝热量子算法求解超图Ramsey数方法
CN111241356A (zh) * 2020-04-26 2020-06-05 腾讯科技(深圳)有限公司 基于模拟量子算法的数据搜索方法、装置及设备

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008128338A1 (en) 2007-04-19 2008-10-30 D-Wave Systems Inc. Systems, methods, and apparatus for automatic image recognition
CN105531725B (zh) * 2013-06-28 2018-03-13 D-波系统公司 用于对数据进行量子处理的系统和方法
CN103902826B (zh) * 2014-04-02 2017-02-01 哈尔滨工程大学 一种冲击噪声环境下的多移动目标跟踪方法
US20180011981A1 (en) * 2016-07-05 2018-01-11 The Regents Of The University Of Michigan Quantum-based machine learning for oncology treatment
US10275721B2 (en) 2017-04-19 2019-04-30 Accenture Global Solutions Limited Quantum computing machine learning module
CN107248014B (zh) * 2017-06-27 2020-09-08 安徽师范大学 基于量子布谷鸟搜索算法的智能垃圾回收路径规划方法
CN107742156A (zh) * 2017-10-18 2018-02-27 浙江工商大学 基于优化量子随机行走搜索算法的量子相干性方法
US10452990B2 (en) 2017-11-28 2019-10-22 International Business Machines Corporation Cost function deformation in quantum approximate optimization
WO2019241879A1 (en) * 2018-06-18 2019-12-26 1Qb Information Technologies Inc. Variationally and adiabatically navigated quantum eigensolvers
CN109241022A (zh) * 2018-09-11 2019-01-18 天津理工大学 一种基于蓝光存储的档案管理系统及其蚁群搜索算法
CN109816113A (zh) * 2019-01-23 2019-05-28 深圳市永达电子信息股份有限公司 基于分布式量子计算机的搜索方法及系统
CN110162536B (zh) * 2019-04-10 2021-07-16 深圳大学 一种量子搜索方法、系统、电子装置及存储介质
CN110990638B (zh) * 2019-10-28 2023-04-28 北京大学 基于fpga-cpu异构环境的大规模数据查询加速装置及方法
CN111027703B (zh) * 2019-12-11 2024-04-05 本源量子计算科技(合肥)股份有限公司 一种量子线路查询的方法、装置、存储介质及电子装置
CN111027702B (zh) * 2019-12-11 2023-12-15 本源量子计算科技(合肥)股份有限公司 一种实现量子线路替换的方法、装置、存储介质和电子装置
CN110929294B (zh) * 2020-02-03 2020-05-26 成都信息工程大学 单向传输的量子数据库隐私查询方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103324978A (zh) * 2013-07-03 2013-09-25 哈尔滨工程大学 基于多目标量子蚁群算法的多目标决策引擎参数优化方法
US20170330101A1 (en) * 2016-05-13 2017-11-16 Microsoft Technology Licensing, Llc Training a quantum optimizer
US20190266213A1 (en) * 2018-02-26 2019-08-29 Microsoft Technology Licensing, Llc Short path quantum procedures for solving combinatorial optimization problems
CN110969254A (zh) * 2019-10-22 2020-04-07 天津大学 一种基于绝热量子算法求解超图Ramsey数方法
CN111241356A (zh) * 2020-04-26 2020-06-05 腾讯科技(深圳)有限公司 基于模拟量子算法的数据搜索方法、装置及设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LI FENGGUANG: "Research on Analysis and Optimization of Adiabatic Quantum Search Algorithm", CHINESE DOCTORAL DISSERTATIONS FULL-TEXT DATABASE, UNIVERSITY OF CHINESE ACADEMY OF SCIENCES, CN, 15 May 2019 (2019-05-15), CN , XP055862233, ISSN: 1674-022X *

Also Published As

Publication number Publication date
EP3933616A4 (en) 2022-07-06
US11782937B2 (en) 2023-10-10
EP3933616A1 (en) 2022-01-05
US20220067040A1 (en) 2022-03-03
KR20210134724A (ko) 2021-11-10
CN111241356A (zh) 2020-06-05
JP7176127B2 (ja) 2022-11-21
JP2022533809A (ja) 2022-07-26
CN111241356B (zh) 2020-08-11

Similar Documents

Publication Publication Date Title
WO2021218480A1 (zh) 基于模拟量子算法的数据搜索方法、装置及设备
US10546066B2 (en) End-to-end learning of dialogue agents for information access
US20210201198A1 (en) Method, electronic device, and storage medium for generating node representations in heterogeneous graph
US11954418B2 (en) Grouping of Pauli strings using entangled measurements
US20220012387A1 (en) Information processing device, information processing system, information processing method, and storage medium
Piatkowski et al. Integer undirected graphical models for resource-constrained systems
AU2020271608B2 (en) Adiabatic progression with intermediate re-optimization to solve hard variational quantum problems in quantum computing
CN115906918A (zh) 预训练模型的微调方法及其装置
US20220012307A1 (en) Information processing device, information processing system, information processing method, and storage medium
US11362663B2 (en) Quantum pulse determining method, apparatus, device and readable storage medium
WO2022039809A1 (en) Hyperparameter transfer via the theory of infinite-width neural networks
WO2023174189A1 (zh) 图网络模型节点分类方法、装置、设备及存储介质
CN116167446B (zh) 量子计算处理方法、装置及电子设备
US20230289501A1 (en) Reducing Resources in Quantum Circuits
US20220012306A1 (en) Information processing device, information processing system, information processing method, and storage medium
US11966450B2 (en) Calculation device, calculation method, and computer program product
JP7306432B2 (ja) 情報処理方法、情報処理装置及びプログラム
JP7472062B2 (ja) 計算装置、計算方法およびプログラム
WO2024034688A1 (ja) 学習装置、推論装置及びモデル作成方法
CN116167447B (zh) 量子电路处理方法、装置及电子设备
JP7474242B2 (ja) 情報処理装置、情報処理システム、情報処理方法、記憶媒体およびプログラム
WO2022066156A1 (en) Node embedding via hash-based projection of transformed personalized pagerank

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2021549943

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 20217031511

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2021773270

Country of ref document: EP

Effective date: 20210929

NENP Non-entry into the national phase

Ref country code: DE