Search

CN-121981295-A - Parameter view acquisition method and related device

CN121981295ACN 121981295 ACN121981295 ACN 121981295ACN-121981295-A

Abstract

The application discloses a parameter view acquisition method and a related device, belonging to the technical field of quantum computation, wherein the method comprises the steps of sampling from parameter combinations of a variable component sub-algorithm to obtain sampling combinations and a measurement matrix, wherein the measurement matrix is determined by the number of the parameter combinations and the sampling proportion during sampling; and according to each sampling combination, running a quantum circuit corresponding to the variable component sub-algorithm carrying the sampling combination to obtain a corresponding sampling loss function value, determining a target sparse vector for representing a transformation result based on the sampling loss function value and a measurement matrix under the condition of transforming the complete loss function value corresponding to all parameter combinations based on a preset sparse basis matrix, and obtaining a parameter view of the variable component sub-algorithm through the target sparse vector and the sparse basis matrix. By applying the embodiment of the application, the function call times can be reduced, and the quantum circuit operation can be reduced, thereby reducing the calculation cost.

Inventors

  • Dou Menghan
  • Request for anonymity

Assignees

  • 本源量子计算科技(合肥)股份有限公司

Dates

Publication Date
20260505
Application Date
20241025

Claims (12)

  1. 1. A method for obtaining a parameter view, the method comprising: sampling from parameter combinations of a variable component sub-algorithm to obtain sampling combinations and a measurement matrix, wherein the measurement matrix is determined by the number of the parameter combinations and the sampling proportion during sampling; aiming at each sampling combination, running a quantum circuit corresponding to the variable component sub-algorithm carrying the sampling combination to obtain a corresponding sampling loss function value; Under the condition that complete loss function values corresponding to all parameter combinations are transformed based on a preset sparse basis matrix, determining a target sparse vector representing a transformation result based on the sampling loss function values and a measurement matrix; And acquiring a parameter view of a variable component sub-algorithm through the target sparse vector and the sparse basis matrix.
  2. 2. The method of claim 1, wherein the sampling from the parameter combinations of the variable component sub-algorithms to obtain a sampling combination and a measurement matrix comprises: determining a parameter combination based on the resolution and the value range of each variation parameter of the variation sub-algorithm; sampling from the parameter combinations according to a preset sampling proportion, and taking the sampled parameter combinations as sampling combinations respectively; and constructing a measurement matrix by using whether the parameter combination is a sampling combination or not.
  3. 3. The method of claim 2, wherein determining the parameter combination based on the resolution, the range of values, of each variation parameter of the variation sub-algorithm comprises: determining the parameter value of each variation parameter based on the resolution and the value range of each variation parameter of the variation sub-algorithm; and determining the parameter combination by arranging and combining different parameter values of different variation parameters.
  4. 4. The method of claim 1, wherein the number of columns of the measurement matrix is the total number of parameter combinations and the number of rows is the total number of sampling combinations; The element values of the measurement matrix are determined by whether the parameter combinations of the corresponding positions are sampling combinations or not; the sampling combination is obtained by using a sampling mode of random non-replacement; Each column of the sparse base matrix is a base, and different bases are mutually orthogonal.
  5. 5. The method of claim 4, wherein the sparse basis matrix is a discrete fourier transform matrix.
  6. 6. The method of claim 1, wherein the determining a target sparse vector representing a transformation result based on the sampling loss function values and a measurement matrix under the condition that the complete loss function values corresponding to all parameter combinations are transformed based on a preset sparse basis matrix comprises: And determining a target sparse vector representing a transformation result based on a condition that a preset sparse base matrix transforms a complete loss function value corresponding to all parameter combinations and a condition that the sampling loss function value and the complete loss function value are transformed by using a measurement matrix.
  7. 7. The method of claim 6, wherein the determining the target sparse vector representing the transform result based on the condition that the complete loss function value corresponding to all parameter combinations is transformed based on the preset sparse basis matrix, and the condition that the sampling loss function value and the complete loss function value are transformed using the measurement matrix, comprises: constructing an optimization equation comprising a condition of transforming the complete loss function values corresponding to all parameter combinations based on a preset sparse basis matrix and a condition of transforming the sampling loss function values and the complete loss function values by using a measurement matrix; and solving the optimization equation, and taking the sparse vector obtained by solving as a target sparse vector.
  8. 8. The method of claim 7, wherein the target sparse vector is a solution that solves for a minimum of non-zero elements in an optimization equation.
  9. 9. The method of claim 6, wherein the obtaining a parametric map of a variable component sub-algorithm from the target sparse vector and the sparse basis matrix comprises: And obtaining a parameter view of a variable component sub-algorithm by using the target sparse vector and the sparse base matrix based on the condition that a preset sparse base matrix transforms the complete loss function value corresponding to all parameter combinations.
  10. 10. A parameter view acquisition device, the device comprising: The first acquisition module is used for sampling from parameter combinations of the variable component sub-algorithm to acquire sampling combinations and a measurement matrix, wherein the measurement matrix is determined by the number of the parameter combinations and the sampling proportion during sampling; The second obtaining module is used for running a quantum circuit corresponding to the variable component sub-algorithm carrying the sampling combination aiming at each sampling combination to obtain a corresponding sampling loss function value; The determining module is used for determining a target sparse vector representing a transformation result based on the sampling loss function value and the measurement matrix under the condition that the complete loss function values corresponding to all parameter combinations are transformed based on a preset sparse basis matrix; the acquisition module is used for acquiring the parameter view of the variable component sub-algorithm through the target sparse vector and the sparse basis matrix.
  11. 11. A computer device comprising a memory storing a computer program and a processor implementing the parameter view acquisition method of any of claims 1-9 when the computer program is executed.
  12. 12. A computer-readable storage medium having stored thereon a computer program which, when executed by a computer, causes the computer to perform the parameter view acquisition method of any one of claims 1 to 9.

Description

Parameter view acquisition method and related device Technical Field The application belongs to the technical field of quantum computing, and particularly relates to a parameter view acquisition method and a related device. Background In the variable component sub-algorithm, the parameter view refers to traversing all parameters, and obtaining a loss function value corresponding to each parameter, so that the obtained loss function performance under the whole parameter space. For example, when two parameters are owned, the parameter view is a two-dimensional contour map. The parameter view is extremely important in researching the expression of a variable component sub-algorithm, and can assist in obtaining a lot of information, such as the point where a loss function is the largest and smallest, the relation between a local optimal value and a global optimal value, the gradient shape of the loss function on the parameter, whether a barren plateau phenomenon (namely gradient exponential disappearance) of the parameter exists, whether the direction of each step of the optimizer is correct in the optimizing process, and the like. Based on the obtained information, properties of the variable component sub-circuit, the optimizer and the like can be further researched, and based on the researched properties, application of the variable component sub-algorithm in the related field can be promoted. In the conventional case, for n parameters, the resolution is m (i.e. m points are taken for each parameter), n m function calls are required (the quantum circuit also needs to run n m times) to obtain the parameter map, resulting in very large calculation overhead. Disclosure of Invention The application aims to provide a parameter view acquisition method and a related device, aiming at reducing calculation cost. One embodiment of the application provides a parameter view acquisition method, which comprises the following steps: sampling from parameter combinations of a variable component sub-algorithm to obtain sampling combinations and a measurement matrix, wherein the measurement matrix is determined by the number of the parameter combinations and the sampling proportion during sampling; aiming at each sampling combination, running a quantum circuit corresponding to the variable component sub-algorithm carrying the sampling combination to obtain a corresponding sampling loss function value; Under the condition that complete loss function values corresponding to all parameter combinations are transformed based on a preset sparse basis matrix, determining a target sparse vector representing a transformation result based on the sampling loss function values and a measurement matrix; And acquiring a parameter view of a variable component sub-algorithm through the target sparse vector and the sparse basis matrix. Optionally, the sampling from the parameter combinations of the variable component sub-algorithm to obtain a sampling combination and a measurement matrix includes: determining a parameter combination based on the resolution and the value range of each variation parameter of the variation sub-algorithm; sampling from the parameter combinations according to a preset sampling proportion, and taking the sampled parameter combinations as sampling combinations respectively; and constructing a measurement matrix by using whether the parameter combination is a sampling combination or not. Optionally, the determining the parameter combination based on the resolution and the value range of each variation parameter of the variation sub-algorithm includes: determining the parameter value of each variation parameter based on the resolution and the value range of each variation parameter of the variation sub-algorithm; and determining the parameter combination by arranging and combining different parameter values of different variation parameters. Optionally, the number of columns of the measurement matrix is the total number of parameter combinations, and the number of rows is the total number of sampling combinations; The element values of the measurement matrix are determined by whether the parameter combinations of the corresponding positions are sampling combinations or not; the sampling combination is obtained by using a sampling mode of random non-replacement; Each column of the sparse base matrix is a base, and different bases are mutually orthogonal. Optionally, the sparse base matrix is a discrete fourier transform matrix. Optionally, under the condition that the complete loss function values corresponding to all parameter combinations are transformed based on a preset sparse basis matrix, determining a target sparse vector representing a transformation result based on the sampling loss function values and a measurement matrix includes: And determining a target sparse vector representing a transformation result based on a condition that a preset sparse base matrix transforms a complete loss function value correspond