CN117009727A - Matrix decomposition method, device, computer equipment and readable storage medium - Google Patents
Matrix decomposition method, device, computer equipment and readable storage medium Download PDFInfo
- Publication number
- CN117009727A CN117009727A CN202211406946.9A CN202211406946A CN117009727A CN 117009727 A CN117009727 A CN 117009727A CN 202211406946 A CN202211406946 A CN 202211406946A CN 117009727 A CN117009727 A CN 117009727A
- Authority
- CN
- China
- Prior art keywords
- matrix
- unitary
- input
- preset
- preset order
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 239000011159 matrix material Substances 0.000 title claims abstract description 566
- 238000000354 decomposition reaction Methods 0.000 title claims abstract description 83
- 238000000034 method Methods 0.000 title claims abstract description 48
- 239000002096 quantum dot Substances 0.000 claims abstract description 123
- 230000009466 transformation Effects 0.000 claims abstract description 39
- 238000004590 computer program Methods 0.000 claims description 16
- 238000006243 chemical reaction Methods 0.000 claims description 8
- 239000000203 mixture Substances 0.000 claims description 7
- 238000004364 calculation method Methods 0.000 claims description 6
- 238000004422 calculation algorithm Methods 0.000 abstract description 30
- 238000010586 diagram Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 230000004044 response Effects 0.000 description 4
- 239000002131 composite material Substances 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/16—Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Pure & Applied Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Computational Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Algebra (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Complex Calculations (AREA)
Abstract
The application provides a matrix decomposition method, a matrix decomposition device, computer equipment and a readable storage medium, wherein the matrix decomposition method comprises the following steps: acquiring an input matrix, and judging whether the input matrix is a unitary matrix with preset orders; if the input matrix is not the unitary matrix with the preset order, sequentially performing unitary transformation processing and expansion processing on the input matrix to obtain the unitary matrix with the preset order corresponding to the input matrix; calculating a single-quantum bit logic base matrix group corresponding to a unitary matrix with preset orders and coefficients of the single-quantum bit logic base matrix group; and determining a decomposition formula corresponding to the input matrix based on the single-quantum bit logic base matrix group and the coefficients thereof. According to the application, by converting the random matrix into the unitary matrix with the preset order needed by quantum computation and decomposing the unitary matrix into the single-quantum bit logic base matrix, the random matrix can be effectively decomposed into the single-quantum bit logic base matrix which can be identified by a quantum circuit, and the practical application value of the quantum algorithm which needs the data matrix is improved.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a matrix decomposition method, a matrix decomposition device, a computer device, and a readable storage medium.
Background
With the continuous development of quantum technology, related quantum technologies have also received attention from many students, for example, quantum algorithms in quantum technologies, and many students have also proposed many classical quantum algorithms accordingly. Compared with the traditional algorithm, the quantum algorithm can obtain the running speed far exceeding the traditional algorithm when solving the specific problems in certain fields.
However, in the course of research and practice of the prior art, the inventors of the present application found that, although quantum algorithms have significant advantages over conventional algorithms, some quantum algorithms still have certain limitations in solving practical problems. In some practical scenes, the obtained data matrix needs to be decomposed into a single-quantum bit logic base matrix which can be identified by a quantum circuit, and the decomposition difficulty of the data matrix obtained in the practical scenes is high, so that a feasible effective scheme for decomposing the matrix into the single-quantum bit logic base matrix is provided, the practical application value of a quantum algorithm requiring the data matrix is further improved, and the problem to be solved in the quantum field is urgent.
The foregoing description is provided for general background information and does not necessarily constitute prior art.
Disclosure of Invention
In order to solve the technical problems, the application provides a matrix decomposition method, a matrix decomposition device, computer equipment and a readable storage medium, which can effectively decompose any matrix into a single-quantum bit logic base matrix which can be identified by a quantum circuit, and improve the practical application value of a quantum algorithm.
The application provides a matrix decomposition method, which comprises the following steps:
acquiring an input matrix and judging whether the input matrix is a unitary matrix with preset orders;
if the input matrix is not the unitary matrix with the preset order, sequentially performing unitary transformation processing and expansion processing on the input matrix to obtain the unitary matrix with the preset order corresponding to the input matrix;
calculating a single-quantum bit logic base matrix group corresponding to the unitary matrix with the preset order and coefficients of the single-quantum bit logic base matrix group;
and determining a decomposition formula corresponding to the input matrix based on the single-qubit logic base matrix group and the coefficients thereof.
Optionally, the matrix decomposition method further includes:
if the input matrix is the unitary matrix with the preset order, calculating a single-quantum bit logic base matrix group and coefficients thereof corresponding to the unitary matrix with the preset order;
and determining a decomposition formula corresponding to the input matrix based on the single-qubit logic base matrix group and the coefficients thereof.
Optionally, if the input matrix is not the unitary matrix with the preset order, performing unitary transformation processing and expansion processing on the input matrix in sequence to obtain a unitary matrix with the preset order corresponding to the input matrix, including:
if the input matrix is a non-unitary matrix, performing unitary transformation on the input matrix to obtain a unitary matrix corresponding to the input matrix;
if the unitary matrix is not the unitary matrix with the preset order, performing expansion processing on the unitary matrix to obtain the unitary matrix with the preset order.
Optionally, the unitary transformation processing is performed on the input matrix to obtain a unitary matrix corresponding to the input matrix, including:
performing unitary transformation processing on the input matrix through a transformation formula to obtain a unitary matrix corresponding to the input matrix; wherein, the conversion formula is:
wherein B is unitary matrix obtained after unitary transformation processing, A is input matrix, A H Is the transposed conjugate of the input matrix a.
Optionally, the expanding the unitary matrix to obtain the unitary matrix with the preset order number includes:
performing expansion processing on the unitary matrix through an expansion formula to obtain the unitary matrix with the preset order number; wherein, the expansion formula is:
wherein B is unitary matrix obtained after unitary transformation processing, and C is unitary matrix with preset order number obtained after expansion processing.
Optionally, the calculating the single-qubit logical base matrix set and coefficients thereof corresponding to the unitary matrix with the preset order includes:
calculating a single-quantum bit logic base matrix corresponding to the unitary matrix with the preset order according to a first preset formula, wherein the single-quantum bit logic matrix comprises a unit matrix, a Pauloy-X matrix, a Pauloy-Y matrix and a Pauloy-Z matrix; the first preset formula is as follows:
wherein, base i Representing an ith single-qubit logic base matrix group obtained by decomposition, wherein X is a Brinell-X matrix, Y is a Brinell-Y matrix, Z is a Brinell-Z matrix, I is a unit matrix, and n is a positive integer;
calculating the coefficient of the single-quantum bit logic base matrix according to a second preset formula, wherein the second preset formula is as follows:
α i =trace(base i ·C)
wherein alpha is i For the coefficients of the ith single-qubit logic base matrix obtained by decomposition, trace represents the trace of the matrix, and C is the unitary matrix with preset order obtained after expansion.
Optionally, the determining, based on the single-qubit logical base matrix set and the coefficients thereof, a decomposition formula corresponding to the input matrix includes:
acquiring a plurality of single-quantum bit logic base matrixes and corresponding coefficients thereof;
and determining a decomposition formula corresponding to the input matrix based on the plurality of single-qubit logic base matrices and the corresponding coefficients thereof.
Correspondingly, the application also provides a matrix decomposition device, which is characterized by comprising:
the judging module is used for acquiring an input matrix and judging whether the input matrix is a unitary matrix with preset orders or not;
the conversion module is used for sequentially carrying out unitary transformation processing and expansion processing on the input matrix if the input matrix is not the unitary matrix with the preset order number, so as to obtain the unitary matrix with the preset order number corresponding to the input matrix;
the calculation module is used for calculating a single-quantum bit logic base matrix group corresponding to the unitary matrix with the preset order and coefficients thereof;
and the composition module is used for determining a decomposition formula corresponding to the input matrix based on the single-quantum bit logic base matrix group and the coefficients thereof.
The embodiment of the application also provides computer equipment, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the steps of the matrix decomposition method when executing the computer program.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, which when being executed by a processor implements the steps of the matrix factorization method as described above.
The embodiment of the application has the following beneficial effects:
as described above, the present application provides a matrix decomposition method, apparatus, computer device, and readable storage medium, where the method includes: acquiring an input matrix, and judging whether the input matrix is a unitary matrix with preset orders; if the input matrix is not the unitary matrix with the preset order, sequentially performing unitary transformation processing and expansion processing on the input matrix to obtain the unitary matrix with the preset order corresponding to the input matrix; calculating a single-quantum bit logic base matrix group corresponding to a unitary matrix with preset orders and coefficients of the single-quantum bit logic base matrix group; and determining a decomposition formula corresponding to the input matrix based on the single-quantum bit logic base matrix group and the coefficients thereof. According to the embodiment of the application, the random matrix is converted into the unitary matrix with the preset order needed by quantum computation and then decomposed into the single-quantum-bit logic base matrix, so that the random matrix can be effectively decomposed into the single-quantum-bit logic base matrix which can be identified by a quantum circuit, the corresponding quantum algorithm is helped to realize the function, a feasible and effective decomposition scheme is provided for the quantum algorithm in the aspect of data matrix decomposition, and the practical application value of the quantum algorithm which needs the data matrix is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a schematic flow chart of a first implementation of a matrix decomposition method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a second implementation of a matrix decomposition method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a matrix decomposing device according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a first implementation of a computer device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a second implementation of a computer device according to an embodiment of the present application.
The achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments. Specific embodiments of the present application have been shown by way of the above drawings and will be described in more detail below. The drawings and the written description are not intended to limit the scope of the inventive concepts in any way, but rather to illustrate the inventive concepts to those skilled in the art by reference to the specific embodiments.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with aspects of the application as detailed in the accompanying claims.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the element defined by the phrase "comprising one … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element, and furthermore, elements having the same name in different embodiments of the application may have the same meaning or may have different meanings, the particular meaning of which is to be determined by its interpretation in this particular embodiment or by further combining the context of this particular embodiment.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope herein. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context. Furthermore, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It will be further understood that the terms "comprises," "comprising," "includes," and/or "including" specify the presence of stated features, steps, operations, elements, components, items, categories, and/or groups, but do not preclude the presence, presence or addition of one or more other features, steps, operations, elements, components, items, categories, and/or groups. The terms "or", "and/or", "including at least one of", and the like, as used herein, may be construed as inclusive, or mean any one or any combination. For example, "including at least one of: A. b, C "means" any one of the following: a, A is as follows; b, a step of preparing a composite material; c, performing operation; a and B; a and C; b and C; a and B and C ", again as examples," A, B or C "or" A, B and/or C "means" any of the following: a, A is as follows; b, a step of preparing a composite material; c, performing operation; a and B; a and C; b and C; a and B and C). An exception to this definition will occur only when a combination of elements, functions, steps or operations are in some way inherently mutually exclusive.
It should be understood that, although the steps in the flowcharts in the embodiments of the present application are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the figures may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily occurring in sequence, but may be performed alternately or alternately with other steps or at least a portion of the other steps or stages.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrase "if determined" or "if detected (stated condition or event)" may be interpreted as "when determined" or "in response to determination" or "when detected (stated condition or event)" or "in response to detection (stated condition or event), depending on the context.
It should be noted that, in this document, step numbers such as S1 and S2 are adopted, and the purpose of the present application is to more clearly and briefly describe the corresponding content, and not to constitute a substantial limitation on the sequence, and those skilled in the art may execute S2 first and then execute S1 when implementing the present application, which is within the scope of protection of the present application.
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
In the following description, suffixes such as "module", "part" or "unit" for representing elements are used only for facilitating the description of the present application, and have no specific meaning per se. Thus, "module," "component," or "unit" may be used in combination.
At present, when a quantum algorithm faces an actual scene, an obtained data matrix is required to be decomposed into a single-quantum bit logic base matrix which can be identified by a quantum circuit, but the decomposition difficulty of the data matrix obtained in the actual scene is high, and a feasible decomposition scheme is not available at present, so that the practical application value of the quantum algorithm requiring the data matrix is not high.
In order to solve the problems, the application provides a matrix decomposition method, a device, computer equipment and a readable storage medium, which can effectively decompose any matrix into a single-quantum bit logic base matrix which can be identified by a quantum circuit, and improve the practical application value of a quantum algorithm.
Referring to fig. 1, fig. 1 is a flow chart of a first implementation of a matrix decomposition method according to an embodiment of the present application. The matrix decomposition method specifically comprises the following steps:
s1, acquiring an input matrix, and judging whether the input matrix is a unitary matrix with preset orders.
Specifically, for step S1, an input matrix is first obtained, and the input matrix may be any data matrix, and then it is determined whether the input matrix is a unitary matrix of a preset order. In the present embodiment, the preset order is 2 n Order, n is a positive integer.
S2, if the input matrix is not the unitary matrix with the preset order, unitary transformation processing and expansion processing are sequentially carried out on the input matrix, and the unitary matrix with the preset order corresponding to the input matrix is obtained.
Specifically, for step S2, if it is determined that the input matrix is not presentUnitary matrices of preset order, e.g. 2 n And sequentially carrying out unitary matrix transformation processing and expansion processing on the input matrix to obtain a unitary matrix with preset orders corresponding to the input matrix after finishing the processing.
Optionally, in some embodiments, step S2 may specifically include:
s21, if the input matrix is a non-unitary matrix, performing unitary transformation on the input matrix to obtain a unitary matrix corresponding to the input matrix;
s22, if the unitary matrix is not the unitary matrix with the preset order, expanding the unitary matrix to obtain the unitary matrix with the preset order.
Specifically, if the input matrix is not a unitary matrix with a preset order, judging whether the input matrix is a unitary matrix, and if the input matrix is a non-unitary matrix, performing unitary transformation on the input matrix to obtain a unitary matrix corresponding to the input matrix; if the input matrix is a unitary matrix, judging whether the unitary matrix is a unitary matrix with preset orders, and if the input matrix is not the unitary matrix with preset orders, performing expansion processing on the unitary matrix to obtain the unitary matrix with preset orders; if the unitary matrix is a unitary matrix with preset orders, calculating a single quantum bit logic base matrix group corresponding to the unitary matrix with preset orders and coefficients thereof, thereby determining a decomposition formula corresponding to the input matrix.
In some embodiments, how to determine whether the input matrix is unitary is mainly determined whether the input matrix satisfies the following conditions:
A=A H
wherein A represents an input matrix, A H Representing the transposed conjugate of the input matrix a.
If the input matrix (arbitrary matrix) is judged to meet the above condition, the input matrix is judged to be a unitary matrix, otherwise, the input matrix is judged to be a non-unitary matrix.
Optionally, in some embodiments, in step S21, unitary transformation is performed on the input matrix to obtain a unitary matrix corresponding to the input matrix, which may specifically include:
and performing unitary transformation processing on the input matrix through a transformation formula, namely performing unitary transformation processing on the input matrix of the non-unitary matrix, so that the non-unitary matrix is transformed into the unitary matrix, and obtaining the unitary matrix corresponding to the input matrix.
Wherein, the conversion formula is:
wherein, matrix B is unitary matrix obtained by unitary transformation processing of matrix A, matrix A is input matrix A H Is the transposed conjugate of the input matrix a.
Optionally, in some embodiments, the expanding the unitary matrix in step S22 to obtain the unitary matrix with the preset order may specifically include:
performing expansion processing on the unitary matrix B through an expansion formula to obtain a unitary matrix with preset orders; wherein, the expansion formula is:
in the formula, a matrix B is a unitary matrix obtained by unitary transformation processing of a matrix A, and a matrix C is a unitary matrix with preset orders obtained by expansion processing.
In this embodiment, the unitary matrix is expanded to a predetermined order, e.g. 2, mainly based on zero padding n And (5) step. The result of the matrix operation is not changed by the zero padding operation due to the nature of the matrix itself.
S3, calculating a single-quantum bit logic base matrix group corresponding to the unitary matrix with the preset order number and coefficients of the single-quantum bit logic base matrix group.
Specifically, for step S3, the single-qubit logical base matrix set corresponding to the unitary matrix with the preset order obtained in step S2 and coefficients corresponding to a plurality of matrices in the single-qubit logical base matrix set are mainly calculated.
Optionally, in some embodiments, step S3 may specifically include:
calculating a single-quantum bit logic base matrix corresponding to a unitary matrix with preset orders according to a first preset formula, wherein the single-quantum bit logic matrix comprises a unit matrix, a Pauloy-X matrix, a Pauloy-Y matrix and a Pauloy-Z matrix; the first preset formula is as follows:
wherein, base i Representing the ith single-qubit logic base matrix group obtained by decomposition, wherein X is a Brinell-X matrix, Y is a Brinell-Y matrix, Z is a Brinell-Z matrix, I is a unit matrix, and n is a positive integer.
The mathematical expressions of the identity matrix, the Brix-Y matrix and the Brix-Z matrix are respectively as follows:
calculating coefficients corresponding to a plurality of single-quantum bit logic base matrixes in the single-quantum bit logic base matrixes according to a second preset formula; the second preset formula is as follows:
α i =trace(base i ·C)
wherein alpha is i For the coefficients of the ith single-qubit logic base matrix obtained by decomposition, trace represents the trace of the matrix, and C is the unitary matrix with preset order obtained after expansion.
S4, determining a decomposition formula corresponding to the input matrix based on the single-quantum bit logic base matrix group and coefficients thereof.
Specifically, for step S4, based on the multiple matrices in the single-qubit logical base matrix set and the coefficients corresponding to the multiple matrices, a decomposition formula corresponding to the input matrix is obtained by combining, so as to complete the task of decomposing the input matrix into the single-qubit logical base matrix that can be identified by the quantum algorithm.
Optionally, in some embodiments, step S4 may specifically include:
s41, acquiring a plurality of single-quantum bit logic base matrixes and corresponding coefficients thereof;
s42, determining a decomposition formula corresponding to the input matrix based on a plurality of single-quantum bit logic base matrixes and corresponding coefficients thereof.
In a specific embodiment, after a single-qubit logic base matrix group corresponding to the matrix C is calculated, the single-qubit logic base matrix group is calculated after being unfolded, the coefficient of the single-qubit logic base matrix group is calculated, then the coefficient of the single-qubit logic base matrix group is calculated after being unfolded, a plurality of single-qubit logic base matrices and corresponding coefficients thereof are calculated, and therefore a decomposition formula of the matrix C is determined according to the plurality of single-qubit logic base matrices and corresponding coefficients thereof, and the task of decomposing an input matrix into the single-qubit logic base matrix is completed.
For easier understanding of the present application by those skilled in the art, the present embodiment uses non-cac and non-2 n The order matrix a is decomposed by way of example, and this matrix a is expressed as:
calculating coefficients corresponding to a plurality of single-quantum bit logic base matrixes in the single-quantum bit logic base matrixes according to a second preset formula; the second preset formula is as follows:
the observation and judgment of the matrix A show that the matrix A is a non-unitary matrix, and the order is 3, so that the generality is met. First, an original matrix a is converted into a unitary matrix:
then, after expanding the matrix B:
the matrix C is unitary matrix and has an order of 2 3 The order meets unitary and matrix order requirements required for quantum computation.
Next, a single qubit logical basis matrix set of matrix C is calculated. Since the matrix order is 8, n=3, resulting in:
the method comprises the following steps of:
then, the coefficients of the single-qubit logical base matrix group are calculated:
α i =trace(base i ·C)
and (3) unfolding to obtain:
α 1 =trace(base 1 ·C),α 2 =trace(base 2 ·C),...,α 64 =trace(base 64 ·C)
finally, the calculation of the above formula can be obtained:
wherein the coefficients of the single-qubit logic base matrix which are not listed are all 0.
In summary, the decomposition formula of the finally obtained matrix C is:
C=0.25XXX+0.25XYY+0.25XZX+0.25XZZ+0.25XZI+0.25XIX+0.25XIZ+0.25XII-0.25YXY+0.25YYX+0.25YZY+0.25YIY+0.25ZXX-0.25ZYY+0.25IXX-0.25IYY
optionally, in some embodiments, after step S1, the matrix decomposition method may specifically further include:
if the input matrix is a unitary matrix with preset orders, calculating a single-quantum bit logic base matrix group and coefficients thereof corresponding to the unitary matrix with preset orders;
and determining a decomposition formula corresponding to the input matrix based on the single-quantum bit logic base matrix group and the coefficients thereof.
Specifically, if the input matrix obtained in the determining step S1 is a unitary matrix of a predetermined order, for example, 2 n Unitary matrix of order number, directly calculating the 2 without sequentially performing unitary transformation processing and expansion processing on input matrix n And determining a decomposition formula corresponding to the input matrix by the single-quantum bit logic base matrix group corresponding to the unitary matrix of the order and the coefficients thereof.
Referring to fig. 2, fig. 2 is a flow chart of a second implementation of the matrix decomposition method according to the embodiment of the present application. The matrix decomposition method comprises the following specific steps:
acquiring an input matrix, judging whether the input matrix is a unitary matrix, if so, judging whether the input matrix is 2 n If not, then the input matrix is transformed into unitary matrix, and then whether the input matrix is 2 is judged n Unitary matrices of the order; if the unitary matrix is judged to be 2 n Calculating a single-quantum bit logic base matrix group if the unitary matrix of the order is calculated, otherwise, expanding the unitary matrix to be 2 n After unitary matrix of order, calculating single quantum bit logic base matrix group; and calculating the coefficient corresponding to the single-quantum bit logic base matrix group, thereby determining the decomposition of the input matrix and ending the matrix decomposition.
In summary, the matrix decomposition method provided in this embodiment includes: acquiring an input matrix, and judging whether the input matrix is a unitary matrix with preset orders; if the input matrix is not the unitary matrix with the preset order, sequentially performing unitary transformation processing and expansion processing on the input matrix to obtain the unitary matrix with the preset order corresponding to the input matrix; calculating a single-quantum bit logic base matrix group corresponding to a unitary matrix with preset orders and coefficients of the single-quantum bit logic base matrix group; and determining a decomposition formula corresponding to the input matrix based on the single-quantum bit logic base matrix group and the coefficients thereof. According to the embodiment of the application, the random matrix is converted into the unitary matrix with the preset order needed by quantum computation and then decomposed into the single-quantum-bit logic base matrix, so that the random matrix can be effectively decomposed into the single-quantum-bit logic base matrix which can be identified by a quantum circuit, the corresponding quantum algorithm is helped to realize the function, a feasible and effective decomposition scheme is provided for the quantum algorithm in the aspect of data matrix decomposition, the blank of the quantum algorithm in the aspect of data matrix decomposition is filled, and the practical application value of the quantum algorithm which needs the data matrix is improved.
Correspondingly, the application also provides a matrix decomposition device, please refer to fig. 3, fig. 3 is a schematic structural diagram of the matrix decomposition device provided by the application, and the matrix decomposition device comprises a judging module 100, a converting module 200, a calculating module 300 and a composing module 400.
The judging module 100 is configured to obtain an input matrix, and judge whether the single-qubit logical base matrix set input matrix is a unitary matrix with a preset order.
The conversion module 200 is configured to sequentially perform unitary transformation processing and expansion processing on the single-quantum bit logical base matrix set input matrix if the single-quantum bit logical base matrix set input matrix is not a unitary matrix with a preset order number of the single-quantum bit logical base matrix set, so as to obtain a unitary matrix with a preset order number corresponding to the single-quantum bit logical base matrix set input matrix.
The calculating module 300 is configured to calculate a single-qubit logical base matrix set and coefficients thereof corresponding to a unitary matrix of a preset order of the single-qubit logical base matrix set.
The composition module 400 is configured to determine a decomposition formula corresponding to the input matrix of the single-qubit logical base matrix set based on the single-qubit logical base matrix set and the coefficients thereof.
Optionally, in some embodiments, the conversion module 200 may specifically further include:
the unitary transformation unit is used for carrying out unitary transformation processing on the input matrix if the input matrix is a non-unitary matrix to obtain a unitary matrix corresponding to the input matrix;
and the expansion unit is used for carrying out expansion processing on the unitary matrix if the unitary matrix is not the unitary matrix with the preset order number, so as to obtain the unitary matrix with the preset order number.
Optionally, in some embodiments, the computing module 300 may specifically include:
the first calculation unit is used for calculating a single-qubit logic base matrix corresponding to the unitary matrix with the preset order according to a first preset formula, wherein the single-qubit logic matrix comprises a unit matrix, a Pauloy-X matrix, a Pauloy-Y matrix and a Pauloy-Z matrix;
and the second calculation unit is used for calculating the coefficient of the single-quantum bit logic base matrix according to a second preset formula.
Optionally, in some embodiments, the composition module 400 may specifically include:
the first composition unit is used for acquiring a plurality of single-quantum bit logic base matrixes and corresponding coefficients thereof;
and the second composition unit is used for determining a decomposition formula corresponding to the input matrix based on the plurality of single-qubit logic base matrices and the corresponding coefficients thereof.
In summary, in the matrix decomposition device provided by the embodiment of the present application, the judgment module 100 obtains the input matrix, and judges whether the input matrix of the single-qubit logical base matrix set is a unitary matrix with a preset order; if the single-quantum bit logic base matrix set input matrix is not the unitary matrix with the preset order number of the single-quantum bit logic base matrix set through the conversion module 200, sequentially performing unitary transformation processing and expansion processing on the single-quantum bit logic base matrix set input matrix to obtain the unitary matrix with the preset order number corresponding to the single-quantum bit logic base matrix set input matrix; calculating a single-quantum bit logic base matrix group corresponding to a unitary matrix with preset orders of the single-quantum bit logic base matrix group and coefficients of the single-quantum bit logic base matrix group through a calculation module 300; the corresponding decomposition formula of the single-qubit logical base matrix set input matrix is determined by the composition module 400 based on the single-qubit logical base matrix set and the coefficients thereof. According to the embodiment of the application, the random matrix is converted into the unitary matrix with the preset order needed by quantum computation and then decomposed into the single-quantum-bit logic base matrix, so that the random matrix can be effectively decomposed into the single-quantum-bit logic base matrix which can be identified by a quantum circuit, the corresponding quantum algorithm is helped to realize the function, a feasible and effective decomposition scheme is provided for the quantum algorithm in the aspect of data matrix decomposition, the blank of the quantum algorithm in the aspect of data matrix decomposition is filled, and the practical application value of the quantum algorithm which needs the data matrix is improved.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a first implementation of the computer device according to the embodiment of the present application. The computer device comprises a memory 10 and a processor 20, the memory 10 storing a computer program, the processor 20 implementing a matrix decomposition method when executing the computer program, comprising: acquiring an input matrix, and judging whether the input matrix is a unitary matrix with preset orders; if the input matrix is not the unitary matrix with the preset order, sequentially performing unitary transformation processing and expansion processing on the input matrix to obtain the unitary matrix with the preset order corresponding to the input matrix; calculating a single-quantum bit logic base matrix group corresponding to a unitary matrix with preset orders and coefficients of the single-quantum bit logic base matrix group; and determining a decomposition formula corresponding to the input matrix based on the single-quantum bit logic base matrix group and the coefficients thereof.
The embodiment of the application also provides computer equipment, which can be a server. Referring to fig. 5, fig. 5 is a schematic structural diagram of a second implementation of a computer device according to an embodiment of the present application. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer equipment is used for storing data such as matrix decomposition method and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection.
The computer program is executed by a processor to implement a matrix factorization method. The matrix decomposition method comprises the following steps: acquiring an input matrix, and judging whether the input matrix is a unitary matrix with preset orders; if the input matrix is not the unitary matrix with the preset order, sequentially performing unitary transformation processing and expansion processing on the input matrix to obtain the unitary matrix with the preset order corresponding to the input matrix; calculating a single-quantum bit logic base matrix group corresponding to a unitary matrix with preset orders and coefficients of the single-quantum bit logic base matrix group; and determining a decomposition formula corresponding to the input matrix based on the single-quantum bit logic base matrix group and the coefficients thereof.
An embodiment of the present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a matrix decomposition method comprising the steps of: acquiring an input matrix, and judging whether the input matrix is a unitary matrix with preset orders; if the input matrix is not the unitary matrix with the preset order, sequentially performing unitary transformation processing and expansion processing on the input matrix to obtain the unitary matrix with the preset order corresponding to the input matrix; calculating a single-quantum bit logic base matrix group corresponding to a unitary matrix with preset orders and coefficients of the single-quantum bit logic base matrix group; and determining a decomposition formula corresponding to the input matrix based on the single-quantum bit logic base matrix group and the coefficients thereof.
According to the matrix decomposition method, in the embodiment of the application, by converting any matrix into the unitary matrix with the preset order needed by quantum computation and decomposing the unitary matrix into the single-quantum-bit logic base matrix, the random matrix can be effectively decomposed into the single-quantum-bit logic base matrix which can be identified by a quantum circuit, so that the corresponding quantum algorithm is helped to realize the function, a feasible and effective decomposition scheme is provided for the quantum algorithm in the aspect of data matrix decomposition, the blank of the quantum algorithm in the aspect of data matrix decomposition is filled, and the practical application value of the quantum algorithm which needs the data matrix is improved.
It can be understood that the above scenario is merely an example, and does not constitute a limitation on the application scenario of the technical solution provided by the embodiment of the present application, and the technical solution of the present application may also be applied to other scenarios. For example, as one of ordinary skill in the art can know, with the evolution of the system architecture and the appearance of new service scenarios, the technical solution provided by the embodiment of the present application is also applicable to similar technical problems.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The units in the device of the embodiment of the application can be combined, divided and deleted according to actual needs.
In the present application, the same or similar term concept, technical solution and/or application scenario description will be generally described in detail only when first appearing and then repeatedly appearing, and for brevity, the description will not be repeated generally, and in understanding the present application technical solution and the like, reference may be made to the previous related detailed description thereof for the same or similar term concept, technical solution and/or application scenario description and the like which are not described in detail later.
In the present application, the descriptions of the embodiments are emphasized, and the details or descriptions of the other embodiments may be referred to.
The technical features of the technical scheme of the application can be arbitrarily combined, and all possible combinations of the technical features in the above embodiment are not described for the sake of brevity, however, as long as there is no contradiction between the combinations of the technical features, the application shall be considered as the scope of the description of the application.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, a controlled terminal, or a network device, etc.) to perform the method of each embodiment of the present application.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions in accordance with embodiments of the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). Computer readable storage media can be any available media that can be accessed by a computer or data storage devices, such as servers, data centers, etc., that contain an integration of one or more available media. Usable media may be magnetic media (e.g., floppy disks, storage disks, magnetic tape), optical media (e.g., DVD), or semiconductor media (e.g., solid State Disk (SSD)), among others.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the application, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.
Claims (10)
1. A matrix decomposition method, comprising the steps of:
acquiring an input matrix and judging whether the input matrix is a unitary matrix with preset orders;
if the input matrix is not the unitary matrix with the preset order, sequentially performing unitary transformation processing and expansion processing on the input matrix to obtain the unitary matrix with the preset order corresponding to the input matrix;
calculating a single-quantum bit logic base matrix group corresponding to the unitary matrix with the preset order and coefficients of the single-quantum bit logic base matrix group;
and determining a decomposition formula corresponding to the input matrix based on the single-qubit logic base matrix group and the coefficients thereof.
2. The matrix factorization method of claim 1, further comprising:
if the input matrix is the unitary matrix with the preset order, calculating a single-quantum bit logic base matrix group and coefficients thereof corresponding to the unitary matrix with the preset order;
and determining a decomposition formula corresponding to the input matrix based on the single-qubit logic base matrix group and the coefficients thereof.
3. The matrix factorization method according to claim 1, wherein if the input matrix is not the unitary matrix of the preset order, sequentially performing unitary transformation processing and expansion processing on the input matrix to obtain a unitary matrix of the preset order corresponding to the input matrix, comprising:
if the input matrix is a non-unitary matrix, performing unitary transformation on the input matrix to obtain a unitary matrix corresponding to the input matrix;
if the unitary matrix is not the unitary matrix with the preset order, performing expansion processing on the unitary matrix to obtain the unitary matrix with the preset order.
4. The matrix factorization method of claim 3, wherein said performing unitary transformation on said input matrix to obtain a unitary matrix corresponding to said input matrix comprises:
performing unitary transformation processing on the input matrix through a transformation formula to obtain a unitary matrix corresponding to the input matrix; wherein, the conversion formula is:
wherein B is unitary matrix obtained after unitary transformation processing, A is input matrix, A H Is the transposed conjugate of the input matrix a.
5. The matrix factorization method of claim 4, wherein said expanding said unitary matrix to obtain said unitary matrix of predetermined order comprises:
performing expansion processing on the unitary matrix through an expansion formula to obtain the unitary matrix with the preset order number; wherein, the expansion formula is:
wherein B is unitary matrix obtained after unitary transformation processing, and C is unitary matrix with preset order number obtained after expansion processing.
6. The matrix factorization method of claim 5, wherein said calculating a single-qubit logical base matrix set and coefficients thereof corresponding to said unitary matrix of preset order comprises:
calculating a single-quantum bit logic base matrix corresponding to the unitary matrix with the preset order according to a first preset formula, wherein the single-quantum bit logic matrix comprises a unit matrix, a Pauloy-X matrix, a Pauloy-Y matrix and a Pauloy-Z matrix; the first preset formula is as follows:
wherein, base i Representing an ith single-qubit logic base matrix group obtained by decomposition, wherein X is a Brinell-X matrix, Y is a Brinell-Y matrix, Z is a Brinell-Z matrix, I is a unit matrix, and n is a positive integer;
calculating the coefficient of the single-quantum bit logic base matrix according to a second preset formula, wherein the second preset formula is as follows:
α i =trace(base i ·C)
wherein alpha is i For decomposition of the ith single-qubit logical baseThe coefficients of the matrix, trace represents the trace of the matrix, and C is the unitary matrix of the preset order obtained after expansion.
7. The matrix factorization method of claim 6, wherein determining the factorization formula corresponding to the input matrix based on the set of single-qubit logical base matrices and coefficients thereof comprises:
acquiring a plurality of single-quantum bit logic base matrixes and corresponding coefficients thereof;
and determining a decomposition formula corresponding to the input matrix based on the plurality of single-qubit logic base matrices and the corresponding coefficients thereof.
8. A matrix decomposing apparatus, comprising:
the judging module is used for acquiring an input matrix and judging whether the input matrix is a unitary matrix with preset orders or not;
the conversion module is used for sequentially carrying out unitary transformation processing and expansion processing on the input matrix if the input matrix is not the unitary matrix with the preset order number, so as to obtain the unitary matrix with the preset order number corresponding to the input matrix;
the calculation module is used for calculating a single-quantum bit logic base matrix group corresponding to the unitary matrix with the preset order and coefficients thereof;
and the composition module is used for determining a decomposition formula corresponding to the input matrix based on the single-quantum bit logic base matrix group and the coefficients thereof.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of matrix decomposition according to any one of claims 1 to 7 when the computer program is executed.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the matrix decomposition method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211406946.9A CN117009727A (en) | 2022-11-10 | 2022-11-10 | Matrix decomposition method, device, computer equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211406946.9A CN117009727A (en) | 2022-11-10 | 2022-11-10 | Matrix decomposition method, device, computer equipment and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117009727A true CN117009727A (en) | 2023-11-07 |
Family
ID=88564195
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211406946.9A Pending CN117009727A (en) | 2022-11-10 | 2022-11-10 | Matrix decomposition method, device, computer equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117009727A (en) |
-
2022
- 2022-11-10 CN CN202211406946.9A patent/CN117009727A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113221183A (en) | Method, device and system for realizing privacy protection of multi-party collaborative update model | |
US20200389182A1 (en) | Data conversion method and apparatus | |
CN111709415B (en) | Target detection method, device, computer equipment and storage medium | |
CN114611128A (en) | Longitudinal federal learning method, device, system, equipment and storage medium | |
CN114138231B (en) | Method, circuit and SOC for executing matrix multiplication operation | |
CN113222813A (en) | Image super-resolution reconstruction method and device, electronic equipment and storage medium | |
CN111639523B (en) | Target detection method, device, computer equipment and storage medium | |
CN111966473B (en) | Operation method and device of linear regression task and electronic equipment | |
CN117370488A (en) | Data processing method, device, electronic equipment and computer readable storage medium | |
CN117009727A (en) | Matrix decomposition method, device, computer equipment and readable storage medium | |
CN116957006A (en) | Training method, device, equipment, medium and program product of prediction model | |
CN116128021A (en) | Parallel processing method and device based on sequence model | |
US20210224632A1 (en) | Methods, devices, chips, electronic apparatuses, and storage media for processing data | |
CN115965074A (en) | Training method of deep learning model, data processing method, device and equipment | |
CN112862008A (en) | Training method of preference prediction model and prediction method of user preference | |
WO2020063225A1 (en) | Data processing method and apparatus | |
CN113254996A (en) | Graph neural network training method and device, computing equipment and storage medium | |
CN110852202A (en) | Video segmentation method and device, computing equipment and storage medium | |
CN113743121B (en) | Long text entity relation extraction method, device, computer equipment and storage medium | |
CN112818406B (en) | Prediction method and device of score card model | |
CN112417185B (en) | Image key point position calculation method, device, equipment and storage medium | |
CN116630868B (en) | Video classification method, video classification device, medium and electronic equipment | |
CN118396039B (en) | Self-attention mechanism calculation method and reasoning method | |
CN117851632A (en) | Image retrieval method, device, equipment and storage medium based on artificial intelligence | |
CN116910800A (en) | Public opinion monitoring method, public opinion monitoring device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |