CN115169568B - Quantum calculation processing method and device and electronic equipment - Google Patents
Quantum calculation processing method and device and electronic equipment Download PDFInfo
- Publication number
- CN115169568B CN115169568B CN202210858691.3A CN202210858691A CN115169568B CN 115169568 B CN115169568 B CN 115169568B CN 202210858691 A CN202210858691 A CN 202210858691A CN 115169568 B CN115169568 B CN 115169568B
- Authority
- CN
- China
- Prior art keywords
- quantum
- column vector
- target
- list
- measurement
- 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.)
- Active
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 17
- 238000004364 calculation method Methods 0.000 title description 14
- 239000013598 vector Substances 0.000 claims abstract description 346
- 238000005259 measurement Methods 0.000 claims description 147
- 239000011159 matrix material Substances 0.000 claims description 88
- 230000008521 reorganization Effects 0.000 claims description 67
- 238000012545 processing Methods 0.000 claims description 52
- 238000000034 method Methods 0.000 claims description 39
- 230000006798 recombination Effects 0.000 claims description 35
- 238000005215 recombination Methods 0.000 claims description 35
- 238000010606 normalization Methods 0.000 claims description 8
- 230000008569 process Effects 0.000 description 21
- 238000004088 simulation Methods 0.000 description 16
- 230000006870 function Effects 0.000 description 14
- 238000004590 computer program Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 7
- 239000002096 quantum dot Substances 0.000 description 7
- 230000001131 transforming effect Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 238000013461 design Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000012937 correction Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 230000009897 systematic effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N10/00—Quantum computing, i.e. information processing based on quantum-mechanical phenomena
- G06N10/80—Quantum programming, e.g. interfaces, languages or software-development kits for creating or handling programs capable of running on quantum computers; Platforms for simulating or accessing quantum computers, e.g. cloud-based quantum computing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N10/00—Quantum computing, i.e. information processing based on quantum-mechanical phenomena
- G06N10/20—Models of quantum computing, e.g. quantum circuits or universal quantum computers
-
- 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)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- Mathematical Analysis (AREA)
- Evolutionary Computation (AREA)
- Data Mining & Analysis (AREA)
- Condensed Matter Physics & Semiconductors (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Computational Mathematics (AREA)
- Artificial Intelligence (AREA)
- Superconductor Devices And Manufacturing Methods Thereof (AREA)
Abstract
The disclosure provides a quantum computing processing method and device and electronic equipment, and relates to the technical field of computers, in particular to the technical field of quantum computing. The specific implementation scheme is as follows: acquiring first quantum state information and quantum operation information corresponding to a quantum computing model, wherein the quantum computing model comprises M quantum systems, the first quantum state information comprises a first list and a first column vector, the first list stores the identification of the M quantum systems according to the arrangement sequence represented by the first column vector, and the quantum computing model is used for executing quantum computing tasks; performing quantum state operation based on the first quantum state information and the quantum operation information to obtain second quantum state information, wherein the second quantum state information comprises a second list and a second column vector, and the second list stores the identifications of the N quantum systems according to the arrangement sequence represented by the second column vector; based on the second quantum state information, a task result of the quantum computing task is determined.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a quantum computing processing method and apparatus, and an electronic device.
Background
In classical simulations of quantum computing, quantum state information is typically stored using column vectors, and the column vectors used to characterize the quantum states are typically stored in a default quantum system order.
After performing the quantum state operation based on the quantum state information, the obtained column vectors are usually operated so that the system order corresponding to the column vectors matches the default system order.
Disclosure of Invention
The disclosure provides a quantum computing processing method and device and electronic equipment.
According to a first aspect of the present disclosure, there is provided a quantum computation processing method including:
obtaining first quantum state information and quantum operation information corresponding to a quantum computing model, wherein the quantum computing model comprises M quantum systems, the first quantum state information comprises a first list and a first column vector used for representing quantum states of the M quantum systems, the first list stores identifications of the M quantum systems according to an arrangement sequence represented by the first column vector, the quantum computing model is used for executing quantum computing tasks, and M is a positive integer;
performing quantum state operation based on the first quantum state information and the quantum operation information to obtain second quantum state information, wherein the second quantum state information comprises a second list and a second column vector for representing quantum states of N quantum systems in the quantum computing model, the second list stores identifications of the N quantum systems according to an arrangement order represented by the second column vector, and N is a positive integer less than or equal to M;
determining a task result of the quantum computing task based on the second quantum state information.
According to a second aspect of the present disclosure, there is provided a quantum computation processing apparatus including:
an obtaining module, configured to obtain first quantum state information and quantum operation information corresponding to a quantum computing model, where the quantum computing model includes M quantum systems, the first quantum state information includes a first list and a first column vector for characterizing quantum states of the M quantum systems, the first list stores identities of the M quantum systems in an arrangement order characterized by the first column vector, the quantum computing model is configured to perform a quantum computing task, and M is a positive integer;
a quantum state operation module, configured to perform quantum state operation based on the first quantum state information and the quantum operation information to obtain second quantum state information, where the second quantum state information includes a second list and a second column vector for characterizing quantum states of N quantum systems in the quantum computation model, the second list stores identities of the N quantum systems in an arrangement order characterized by the second column vector, and N is a positive integer less than or equal to M;
a determining module for determining a task result of the quantum computing task based on the second quantum state information.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any one of the methods of the first aspect.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform any one of the methods of the first aspect.
According to a fifth aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements any of the methods of the first aspect.
According to the technology disclosed by the invention, the problem of low simulation efficiency of the quantum computing model is solved, and the simulation efficiency of the quantum computing model is improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a schematic flow diagram of a quantum computing processing method according to a first embodiment of the disclosure;
FIG. 2 is a diagram of a data structure for characterizing quantum state information, as an example in this embodiment;
fig. 3 is a schematic structural diagram of a quantum computing processing device according to a second embodiment of the present disclosure;
FIG. 4 is a schematic block diagram of an example electronic device used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
First embodiment
As shown in fig. 1, the present disclosure provides a quantum computation processing method, including the steps of:
step S101: obtaining first quantum state information and quantum operation information corresponding to a quantum computing model, wherein the quantum computing model comprises M quantum systems, the first quantum state information comprises a first list and a first column vector for representing quantum states of the M quantum systems, the first list stores identification of the M quantum systems according to an arrangement order represented by the first column vector, and the quantum computing model is used for executing quantum computing tasks.
Wherein M is a positive integer.
In the embodiment, the quantum computing processing method relates to the technical field of computers, in particular to the technical field of quantum computing, and can be widely applied to the simulation scene of a quantum computing model. The quantum computing processing method of the disclosed embodiment can be executed by the quantum computing processing device of the disclosed embodiment. The quantum computing processing apparatus of the embodiments of the present disclosure may be configured in any electronic device to execute the quantum computing processing method of the embodiments of the present disclosure. The electronic device may be a server or a terminal device, and is not limited specifically here.
The quantum computation model may be any model, such as a quantum circuit model, a one-way quantum computer (1 WQC) measurement mode, a quantum network protocol computation model, a quantum error correction code protocol computation model, a measurement-based quantum computation model, and the like.
The quantum computing model may include M quantum systems, each quantum system may correspond to a qubit, and typically may store 1 qubit of quantum states with a column vector size of 2 x 1, and the column vector size required to store the M qubit of quantum statesIs 2 M ×1。
In the related art, matrix representation of quantum states requires determining the order of their quantum systems, e.g. |0> 1 |1> 2 And |1> 2 |0> 1 Physically representing the same quantum state, i.e. quantum system 1 is in the zero state and quantum system 2 is in the one state. But if the identification of the quantum system is ignored, e.g. |0>|1>And |1>|0>It represents a different quantum state. To avoid confusion, a default systematic order is typically specified, for example, in the written order of quantum states from left to right, with the first left bit beginning corresponding to the quantum state of the first qubit, the second bit corresponding to the quantum state of the 2 nd qubit, and so on. After specifying the default order, the matrix representation of all quantum states needs to follow this order.
However, when matrix operation is performed on the quantum states, the order of the quantum system is inevitably disturbed, and some additional operations are required to be performed in order that the quantum system is consistent with the default system order after the operation, so that the simulation efficiency of the quantum computation model is low. In addition, the method of storing the column vectors used for representing the quantum states in the default sequence of the quantum system is not suitable for the scene that the number of the quantum system changes, for example, an algorithm with adaptive quantum measurement measures a part of quantum states, and regulates and controls the evolution of other quantum states through the measurement result.
In the embodiment, a new data structure is adopted to store the matrix representation of the quantum state, and the quantum state operation in the quantum computation model simulation process is performed according to the matrix representation, so that the purpose of improving the simulation efficiency of the quantum computation model is achieved.
Fig. 2 is a schematic diagram of a data structure for characterizing quantum state information according to an example in this embodiment, and as shown in fig. 2, the data structure specifies that data for characterizing quantum state information includes two parts, one part is a quantum state column vector, and the other part is an ordered list system formed by quantum system identifiers corresponding to the two parts, and the contents of the two parts are in one-to-one correspondence. By storing the quantum state column vectors and the quantum system identifications corresponding to the quantum state column vectors, a quantum state can be depicted more accurately.
Wherein one fundamental operation of a quantum state may be a tensor product operation with another quantum state. For the quantum state column vector, tensor product operation can be performed on the column vector for representing the quantum state, and for the ordered list systems, the quantum system identification of the tensor product operation can be spliced front and back in sequence.
For example, for two quantum systems |0> 1 |1> 2 The storage mode of the quantum state information can be any one of the following modes:
vector=[[0],[1],[0],[0]],systems=[1,2];
vector=[[0],[0],[1],[0]],systems=[2,1]。
in a specific implementation, a data result used for representing quantum state information may be defined through a programming language, taking Python as an example, the quantum state may be defined as a quantum state class, which has two class attributes, namely vector and systems, respectively, and a basic operation on the quantum state may be implemented as a quantum state class method.
The first quantum state information may be quantum state information of M quantum systems in a quantum computing model defined and stored according to the data structure shown in fig. 2, and may include two parts, a first column of vectors, which may be derived from tensor product operations for quantum states of the M quantum systems, and a first list, which may store identities of the M quantum systems in an order of arrangement of the tensor product operations characterized by the first column of vectors. The identifier stored in the first list may be a numeric label or a letter identifier, and is not limited specifically here.
The quantum operation information may be a quantum state operation required to be performed in a quantum computation model simulation process, where the quantum state operation may include a quantum system replacement operation, a quantum state evolution operation, a quantum measurement operation, and the like.
The quantum operation information may include information related to one, two or even a plurality of quantum state operations, and in the case of including information related to two or even a plurality of quantum state operations, the information may be arranged in a simulation order of the quantum state operations in the quantum computing model and sequentially processed in the simulation order when the quantum state operations are subsequently performed.
Information characterizing the quantum computing model may be parsed to obtain quantum operational information.
Step S102: and performing quantum state operation based on the first quantum state information and the quantum operation information to obtain second quantum state information, wherein the second quantum state information comprises a second list and a second column vector for representing quantum states of N quantum systems in the quantum computing model, and the second list stores the identifications of the N quantum systems according to the arrangement order represented by the second column vector.
Wherein N is a positive integer less than or equal to M.
In this step, in the simulation process of the quantum computing model, the quantum state operation may be performed based on the first quantum state information and the quantum operation information to realize the simulation of the quantum computing model. The quantum state operation may refer to quantum operation on a quantum state of a quantum system in a quantum computing model, and the quantum operation may include, but is not limited to, quantum system replacement operation, quantum state evolution operation, quantum measurement operation, and the like.
When quantum operation is carried out on quantum states, an ordered list formed by quantum state column vectors and corresponding quantum system identifications needs to be updated simultaneously, and data of the two parts need to be updated simultaneously in any quantum operation, so that one quantum state can be accurately depicted by simultaneously storing and operating the quantum state column vectors and the corresponding quantum system identifications, and the defects of the storage mode of quantum state information in the related technology on the calculation operation times and the applicable scenes are effectively overcome.
The second column vector may be a column vector for representing the quantum state of the N quantum systems in the quantum computing model, which is obtained after the quantum state operation is performed, and the second column vector may not be stored according to a default system order, and after the quantum state operation is performed, some additional operations are not required to be performed so that the quantum state is stored according to the default system order, and only the first list needs to be updated correspondingly, so that the obtained second list may store the identifiers of the N quantum systems according to the arrangement order represented by the second column vector, and thus, the quantum state of the quantum system can be accurately depicted, the additional operations after the quantum state operation can be reduced, and the simulation efficiency of the quantum computing model can be improved.
Step S103: determining a task result of the quantum computing task based on the second quantum state information.
In this step, the quantum state operation, which may include a quantum measurement operation, may be continued based on the second quantum state information to obtain a task result of the quantum computing task. The quantum computing models are different, the executed quantum computing tasks are different, and correspondingly, the task results of the quantum computing tasks are different. Such as quantum network protocol design tasks, quantum error correction code protocol design tasks, and the like.
In this embodiment, by obtaining first quantum state information and quantum operation information corresponding to a quantum computing model, the quantum computing model includes M quantum systems, the first quantum state information includes a first list and a first column vector for characterizing quantum states of the M quantum systems, the first list stores identifiers of the M quantum systems in an arrangement order characterized by the first column vector, and the quantum computing model is configured to perform a quantum computing task; performing quantum state operation based on the first quantum state information and the quantum operation information to obtain second quantum state information, wherein the second quantum state information comprises a second list and a second column vector for representing quantum states of N quantum systems in the quantum computing model, and the second list stores identifications of the N quantum systems according to an arrangement order represented by the second column vector; determining a task result for the quantum computing task based on the second quantum state information. Therefore, by simultaneously storing and operating the quantum state column vectors and the quantum system identifications corresponding to the quantum state column vectors, one quantum state can be accurately described, and the defects of the storage mode of quantum state information in the related technology in the aspects of calculation operation times and applicable scenes are effectively overcome, so that the simulation efficiency of a quantum calculation model can be improved, and further quantum calculation tasks can be efficiently processed.
Optionally, the quantum operation information includes a first operation type and a first identifier, the first operation type indicates that the permutation operation is performed on the order of the M quantum systems based on the first identifier, the quantum state operation includes the permutation operation, and the step S102 specifically includes:
determining a position index of the first identifier in the first list;
under the condition that the quantum state of a first target quantum system represented by the position index is not at the head in the arrangement sequence of the first column of vectors, determining first recombination parameter information based on the position index, wherein the first target quantum system is a quantum system corresponding to the first identifier;
performing first data reorganization processing on the first column vector based on the first reorganization parameter information to obtain a second column vector, wherein the quantum states of the first target quantum system in the second column vector are at the head in the arrangement sequence of the second column vector, and the relative positions of the quantum states of the second target quantum system in the first column vector and the second target quantum system in the second column vector are unchanged, and the second target quantum system comprises the quantum systems of the M quantum systems except for the first target quantum system;
and updating the first list according to the arrangement sequence represented by the second column vector to obtain the second list.
In this embodiment, the quantum operation information may include information related to a quantum system permutation operation, and the information related to the quantum system permutation operation may include a first operation type and a first identifier, the first operation type indicating that the permutation operation is performed on the order of the M quantum systems based on the first identifier, and the permutation operation does not change any property of the quantum state.
In the case of resolving to the quantum operation information comprising information related to a quantum system permutation operation, a position index of the first identifier in the first list may be determined. The position index may represent the position of the first identifier in the first list, for example, the first identifier is 5, the first list is [1,2,5,3,4], and if the position index starts from 0, the position index of the first identifier is 2.
When the quantum state of the quantum system corresponding to the position index representing the first identifier is at the head of the arrangement order of the first column vector, that is, index =0, it indicates that the quantum state of the quantum system is already arranged at the head of the first column vector, and the first quantum state information may be determined as the second quantum state information.
In a case that the position index indicates that the quantum state of the quantum system corresponding to the first identifier is not at the head of the arrangement order of the first column vector, first reorganization parameter information may be determined based on the position index, where the first reorganization parameter information is used to replace the quantum state of the quantum system corresponding to the first identifier to the head of the column vector, and keep the relative positions of the quantum states of other quantum systems in the arrangement order of the column vector unchanged.
The position indexes are different, the first recombination parameter information is different, and the position indexes correspond to the first recombination parameter information one to one.
Then, based on the first reassembly parameter information, a first data reassembly process may be performed on the first column vector to obtain the second column vector. Specifically, the first data reconstruction process may be performed on the first column vector by using a transform reshape function and a transpose function. The reshape function is used for performing data reorganization on the first column vector through data dimension reorganization, for example, the one-dimensional column vector is transformed into a two-dimensional matrix, the transpose function is used for transposing the data dimension so as to transpose the quantum state of the quantum system corresponding to the first identifier to the head of the column vector, and then the data are transformed into the one-dimensional column vector through the reshape function to obtain second quantum state information.
Correspondingly, the first list is updated to obtain the second list, specifically, the first identifier may be deleted from the first list, and the first identifier is added to the head of the deleted list to obtain the second list.
In this embodiment, the position index of the first identifier in the first list is determined; under the condition that the quantum state of a first target quantum system represented by the position index is not at the head in the arrangement sequence of the first column of vectors, determining first recombination parameter information based on the position index, wherein the first target quantum system is a quantum system corresponding to the first identifier; performing first data recombination processing on the first column vector based on the first recombination parameter information to obtain a second column vector; and updating the first list according to the arrangement sequence represented by the second column vector to obtain the second list. Therefore, the sequential replacement operation of the M quantum systems can be realized based on the first quantum state information represented by the data structure shown in FIG. 2, and a foundation is laid for quantum state evolution and quantum measurement in a subsequent quantum computation model.
Optionally, the determining the first reassembly parameter information based on the position index includes:
in a case that the quantum state of the first target quantum system characterized by the position index is at a last bit in an arrangement order of the first column of vectors, determining the first reorganization parameter information as a first parameter, the first parameter including two reorganization variables and two permutation variables, a value of the reorganization variable being determined based on a length of the first column of vectors;
in a case that the position index represents that the quantum state of the first target quantum system is not at the last bit in the arrangement order of the first column vector, determining the first reorganization parameter information as a second parameter, wherein the second parameter comprises three reorganization variables and three permutation variables, and the values of the reorganization variables are determined based on the length of the first column vector and the position index;
wherein the reorganization variable is to control a dimension of data reorganization and a length of the dimension, and the permutation variable is to permute the quantum states of the first target quantum system to a leading bit of a column vector to characterize the quantum states of the M quantum systems.
In this embodiment, when the quantum state of the first target quantum system represented by the position index is at the last position in the arrangement order of the first column vectors, the first column vectors may be divided into two parts, which are the vector part before the first identifier and the vector part corresponding to the first identifier, and correspondingly, the first reassembly parameter information is determined as the first parameter.
The first parameters include two rebinning variables for transforming the first column vector into a two-dimensional matrix and each rebinning variable may control the data length of the dimension, and two permutation variables for characterizing the order of the two dimensions to permute the quantum states of the quantum system to which the first identification corresponds to the first bit of the column vector for characterizing the quantum states of the M quantum systems.
Correspondingly, in a case that the quantum state of the first target quantum system represented by the position index is not at the last position in the arrangement order of the first column of vectors, that is, at the middle position between the first position and the last position, the first column of vectors may be divided into three parts, which are a vector part before the first identifier, a vector part corresponding to the first identifier, and a vector part after the first identifier, and accordingly, the first reassembly parameter information is determined as the second parameter.
The second parameters include three rebinned variables for transforming the first column vector into a three-dimensional tensor and each rebinned variable may control the data length of the dimension, and three permuted variables for characterizing the order of the three dimensions to permute the quantum states of the first identified corresponding quantum system to the first bits of the column vector for characterizing the quantum states of the M quantum systems.
In particular, the process of permuting the order of the M quantum systems based on the first identity is as follows:
inputting: the first quantum state information comprises a quantum state column vector, namely a first column vector, which is represented by a vector, a quantum system identification list, namely a first list, which is represented by systems, and an identification needing a preposed quantum system, namely a first identification, which is represented by A.
And (3) outputting: the quantum state column vector after quantum system pre-positioning, i.e. the second column vector, is denoted by new vector, and the corresponding quantum system identification list, i.e. the second list, is denoted by new systems.
Step 0: recording the length of the systems as size;
step 1: finding the position index corresponding to the A in the systems, and marking the position index as index;
step 2_1: if index =0, the quantum system is indicated to be at the head, and vector and systems are directly returned;
step 2_2: if index = size-1, it indicates that the quantum system needing to be preposed is at the last position of the system;
defining the first reorganization parameter information as a first parameter, including: new _ shape = [ 2] (size-1) ,2],new_axis=[1,0]Two recombination variables are respectively 2 (size-1) And 2, the two permutation variables are 1 and 0, respectively;
step 2_3: if 0-index-size-1, indicating that the quantum system needing preposition is in the middle of systems;
defining the first reorganization parameter information as a second parameter, including: new _ shape = [ 2] index ,2,2 (size-index-1) ],new_axis=[1,0,2]Three recombination variables are each 2 index 2 and 2 (size-index-1) The three permutation variables are 1,0 and 2 respectively;
and step 3: the vector is operated by adopting a reshape function and a transpose function to obtain a new column vector, namely a second column vector, and the operation process is as follows:
new_vector=reshape(transpose(reshape(vector,new_shape),new_axis),[2 size ,1]);
and 4, step 4: a is deleted from the systems and added to the top of the deleted list, resulting in new _ systems.
It should be noted that, if the quantum systems need to be adjusted to a specific order, rather than merely replacing a certain quantum system to the first position, the quantum systems can be replaced by repeatedly invoking the process of the replacement operation. For example, the quantum system [3,2,1] needs to be adjusted to [1,2,3], a process of a permutation operation can be invoked to permute the quantum system identified as 2 to the first bit, so as to obtain an arrangement sequence [2,3,1] of the corresponding quantum system, and on this basis, a process of a permutation operation is invoked to permute the quantum system identified as 1 to the first bit, so as to obtain a quantum state column vector corresponding to the arrangement sequence [1,2,3] of the quantum system.
In this embodiment, the first reorganization parameter information is defined according to the arrangement order of the quantum states of the first target quantum system represented by the position index in the first column vector, so that the quantum state permutation of the quantum system at any position can be easily realized.
Optionally, the quantum operation information includes a second operation type, an evolution matrix, and K second identifiers, where the second operation type indicates that a quantum state evolution operation is performed on a quantum system corresponding to the second identifier based on the evolution matrix, the quantum state operation includes the quantum state evolution operation, K is a positive integer, and the step S102 specifically includes:
determining third quantum state information based on the first quantum state information and the K second identifications, wherein the third quantum state information comprises a third list and a third column vector for representing the quantum states of the M quantum systems, the quantum states of a third target quantum system are at the head in the arrangement order of the third column vector, the third target quantum system is a quantum system corresponding to the K second identifications, and the third list stores the identifications of the M quantum systems in the arrangement order represented by the third column vector;
determining second recombination parameter information based on the number of the second identifications;
performing second data recombination processing on the third column vector based on the second recombination parameter information to obtain a first target matrix;
multiplying the first target matrix and the evolution matrix to obtain an evolution result matrix;
performing third data recombination processing on the evolution result matrix based on third recombination parameter information to obtain the second column vector, wherein the third recombination parameter information is determined based on the length of the first list; and determining the third list as the second list.
In this embodiment, the quantum operation information may include information related to a quantum state evolution operation, and the information related to the quantum state evolution operation may include a second operation type, an evolution matrix, and a second identifier, where the second operation type indicates that a quantum system corresponding to the second identifier is subjected to a quantum state evolution operation based on the evolution matrix.
The quantum state evolution operation is to perform corresponding evolution on a specified quantum system. For example, for the 1 st quantum system, the Paglie X gate evolution is realized, the 2 nd quantum system and the 3 rd quantum system are subjected to controlled NOT gate evolution, and the quantum gates required to be evolved are different, and the evolution matrixes thereof are also different.
In the case that the quantum operation information includes information related to the quantum state evolution operation, the third quantum state information may be determined based on the first quantum state information and the K second identifiers. K of the second labels may form a list, denoted by labels, and the first quantum state and the first list may be replaced in the sequence of labels by the above replacement operation, so that the quantum system in labels is at the forefront of the systems, and the relative position of the second label in labels is kept unchanged.
For example, systems = [0,1,2,3,4], labels = [3,4,1,2], and the third list obtained after substitution is [3,4,1,2,0].
The second reconfiguration parameter information may be determined based on the number of second identities. For example, the number of the second identifiers is width, and the second reconfiguration parameter information may be shape = [2 = width ,2 size-width ]The objective is to transform the third column vector into a two-dimensional matrix with a data length of 2 for each dimension width And 2 size-width And carrying out evolution operation based on the two-dimensional matrix and the evolution matrix.
Correspondingly, the first target matrix is a two-dimensional matrix with rows and columns each having a length of 2 width And 2 size-width 。
Then, multiplying the first target matrix and the evolution matrix to obtain an evolution result matrix, and transforming the evolution result matrix to the evolution matrix based on the third recombination parameter informationColumn vector, obtaining a second column vector, and the third reconfiguration parameter information may be [ 2] size ,1]。
The process of the quantum state evolution operation is as follows:
inputting: the first quantum state information comprises a quantum state column vector, namely a first column vector, which is represented by a vector, a quantum system identification list, namely a first list, which is represented by systems, a list labels of a quantum system needing quantum state evolution, and a corresponding quantum gate matrix, namely an evolution matrix, which is represented by a gate.
And (3) outputting: and the quantum state column vector after the quantum state evolution and the corresponding quantum system identification list.
Step 0: note that the length of the systems is size, and the length of the labels is width;
step 1: replacing vector and systems in the sequence of labels through a replacement operation process, so that the quantum systems in labels are at the forefront of the list of systems, and keeping the relative positions of the quantum systems in labels unchanged; recording the quantum state column vector after the replacement operation, namely the third column vector as new _ vector _ tmp, and recording the corresponding quantum system identification list, namely the third list as new _ systems;
step 2: determining second recombination parameter information based on width as shape = [2 = width ,2 (size-width) ];
And 3, step 3: calculating the third column vector by adopting a reshape function and a transpose function to obtain a new column vector, namely a second column vector, wherein the calculation process is as follows;
new_vector=reshape(gate@reshape(new_vector_tmp,shape),[2 size ,1]) (ii) a Wherein @ is matrix multiplication, and is used for multiplying a first target matrix (obtained by a reset _ vector _ tmp, shape) by an evolution matrix to obtain an evolution result matrix, and then based on third recombination parameter information [ 2] size ,1]Converting the evolution result matrix into a column vector to obtain a second column vector;
and 4, step 4: and returning the calculation result new _ vector of the quantum state column vector and a corresponding quantum system identification list new _ systems.
In this embodiment, third quantum state information is determined based on the first quantum state information and K second identifiers; determining second recombination parameter information based on the number of the second identifications; performing second data recombination processing on the third column vector based on the second recombination parameter information to obtain a first target matrix; multiplying the first target matrix and the evolution matrix to obtain an evolution result matrix; performing third data recombination processing on the evolution result matrix based on third recombination parameter information to obtain the second column vector, wherein the third recombination parameter information is determined based on the length of the first list; and determining the third list as the second list. In this manner, the evolution of quantum states in the quantum computing model may be achieved based on the first quantum state information.
It should be noted that if a series of quantum gate evolutions need to be performed on the quantum state, only the process of the quantum state evolution operation needs to be repeatedly invoked. In addition, the process of performing the quantum state evolution operation based on the first quantum state information can embody core differences from the simulation mode of the quantum computation model in the related art. Specifically, after the quantum state evolution operation, the corresponding quantum system is not necessarily the same as the input quantum system identification list systems. In the related art, only the storage of the quantum state column vectors is considered, and it is default that all quantum states correspond to the quantum system identifier as a continuous positive integer starting from 0, so after the evolution of the quantum states is completed, additional operations need to be continuously applied, and the sequence of the quantum system of the quantum states is adjusted to be consistent with the default sequence.
A specific example is given below for ease of understanding. For example, there is a 4 qubit quantum state, the quantum system is arranged in the order [0,1,2,3], and a Paulix gate is applied to qubit 1. In this embodiment, the above permutation operation may be invoked first to obtain a quantum state column vector and a corresponding quantum system sequence [1,0,2,3], and then matrix multiplication is performed on the corresponding evolution matrix of the pauli X gate and the quantum state column vector, and a calculation result is returned. At this time, the quantum system order of the quantum states is still [1,0,2,3], which is different from the quantum system order [0,1,2,3] before evolution, but this does not affect the following quantum operation. However, in the related art, it is necessary to further adjust the quantum system order of the evolved quantum states to the default order [0,1,2,3], and since the dimension of the quantum state column vector is usually large, frequent performing of these additional operations on a large-scale matrix will greatly reduce the computational efficiency thereof. Therefore, in this embodiment, by storing and operating the quantum state column vectors and the quantum system identifications corresponding to the quantum state column vectors, a quantum state can be accurately depicted, and the shortcomings of the storage mode of quantum state information in the related art in terms of the number of calculation operations and applicable scenes are effectively overcome, so that the simulation efficiency of the quantum calculation model can be improved.
Optionally, the quantum operation information includes a third operation type and a third identifier, where the third operation type indicates that a quantum measurement operation is performed on a quantum system corresponding to the third identifier based on a measurement basis vector corresponding to the third operation type, where the quantum state operation includes the quantum measurement operation, and the step S102 specifically includes:
determining fourth quantum state information based on the first quantum state information and the third identification, wherein the fourth quantum state information comprises a fourth list and a fourth column vector for representing quantum states of the M quantum systems, quantum states of a fourth target quantum system are at the head in the arrangement order of the fourth column vector, the fourth target quantum system is a quantum system corresponding to the third identification, and the fourth list stores identifications of the M quantum systems in the arrangement order represented by the fourth column vector;
performing fourth data reconstruction processing on the fourth column vector based on fourth reconstruction parameter information to obtain a second target matrix, wherein the fourth reconstruction parameter information is determined based on the length of the first list;
multiplying the measurement basis vector by the second target matrix to obtain a third target matrix;
performing fifth data reorganization processing on the third target matrix based on fifth reorganization parameter information to obtain a fifth column vector for representing quantum states of the quantum systems of the M quantum systems except the fourth target quantum system, wherein the fifth reorganization parameter information is determined based on the lengths of the first list;
determining the second column vector based on the fifth column vector; and deleting the third identifier in the first list to obtain the second list.
In this embodiment, the quantum operation information may include information related to a quantum measurement operation, and the information related to the quantum measurement operation may include a third operation type and a third identifier, where the third operation type indicates that a quantum measurement operation is performed on a quantum system corresponding to the third identifier based on a measurement basis vector corresponding to the third operation type.
A quantum measurement operation is the measurement of a specified quantum system on a quantum state to obtain a corresponding measurement and a measured quantum state. Since any quantum measurement can be equivalently replaced by performing corresponding quantum gate evolution on the quantum state and then performing Z measurement (measurement based on calculation), the following detailed description of the quantum measurement operation process is given by taking Z measurement as an example without loss of generality, and the rest of measurement operations are similar to the Z measurement mode in the same manner.
In the case of resolving information relevant to the quantum measurement operation, fourth quantum state information may be determined based on the first quantum state information and the third identification. The first quantum state and the first list can be subjected to sequential permutation of the quantum systems through the permutation operation, so that the quantum system corresponding to the third identifier is at the head of the systems, and the sequential relative positions of other quantum systems are kept unchanged.
Then, a fourth data reconstruction process may be performed on the fourth column vector based on the fourth reconstruction parameter information, so as to transform the third column vector into a two-dimensional matrix, and perform a measurement operation based on the two-dimensional matrix and the measurement basis vector, that is, multiply the measurement basis vector and the two-dimensional matrix (second target matrix) to obtain a third target matrix. Wherein the fourth reconfiguration parameter information may be [2, 2% size-1 ]。
Performing fifth data reorganization processing on the third target matrix based on fifth reorganization parameter information to obtain a representationA fifth column vector of quantum states of the quantum system other than the fourth target quantum system. Wherein the fifth reassembly parameter information may be [ 2] size-1 ,1]。
And then, determining a quantum state measurement result of the quantum system corresponding to the third identifier based on the fifth column vector, outputting a second column vector corresponding to the quantum state measurement result according to the quantum state measurement result, and deleting the third identifier in the first list to obtain a second list. In this manner, quantum measurement of the quantum state may be achieved based on the first quantum state information.
Optionally, the measurement basis vectors include a first measurement basis vector and a second measurement basis vector, the first measurement basis vector is used for performing a quantum measurement operation on the first measurement result, the second measurement basis vector is used for performing a quantum measurement operation on the second measurement result, the number of the fifth column vectors is two, and determining the second column vector based on the fifth column vector includes:
determining a first probability value that a measurement is the first measurement based on a first target column vector; and determining a second probability value for the measurement being the second measurement based on a second target column vector; the first target column vector is the fifth column vector obtained by performing quantum measurement operation based on the first measurement basis vector, and the second target column vector is the fifth column vector obtained by performing quantum measurement operation based on the second measurement basis vector;
selecting random numbers based on the probability distribution determined by the first probability value and the second probability value to obtain a target measurement result of the quantum state of the fourth target quantum system;
performing normalization processing on the first target column vector to obtain the second column vector under the condition that the target measurement result is the first measurement result;
and under the condition that the target measurement result is the second measurement result, performing normalization processing on the second target column vector to obtain the second column vector.
In this embodiment, the first measurement result may be 0, the second measurement result may be 1, the first measurement basis vector may be used for performing a quantum measurement operation on the first measurement result, and may be a row vector represented by b0= [ [1,0] ] and the second measurement basis vector may be used for performing a quantum measurement operation on the second measurement result, and may be a row vector represented by b1= [ [0,1] ].
The procedure for the quantum measurement operation is as follows:
inputting: the quantum state column vector (first column vector), the quantum system identifier list systems (first list), the quantum system identifier to be measured (third identifier), is denoted by B.
And (3) outputting: the measurement results are combined with the quantum state column vector (second column vector) and the corresponding quantum system identification list (second list) after quantum measurement.
Step 0: recording the length of the systems as size;
step 1: note that a measurement basis vector b0= [ [1,0] ], b1= [ [0,1] ];
and 2, step: by calling the process of the replacement operation, the quantum systems corresponding to the vector and the third identifier B in the systems are sequentially preposed, so that the quantum system corresponding to the third identifier B is at the head of the systems; recording the quantum state column vector after the replacement operation as new _ vector _ tmp (fourth column vector), and recording the corresponding quantum system identification list as new _ systems _ tmp (fourth list);
and step 3: and operating the quantum state column vector through a reshape function to obtain a new column vector, namely a fifth column vector, wherein the operation process is as follows:
new_vector0=reshape(b0@reshape(new_vector_tmp,[2,2 (size-1) ]),[2 (size-1) ,1]);
new_vector1=reshape(b1@reshape(new_vector_tmp,[2,2 (size-1) ]),[2 (size-1) ,1]);
where @ is matrix multiplication, which can be performed by reshape (new _ vector _ tmp, [2, 2] (size-1) ]) Transforming the fourth column vector to a two-dimensional matrix to obtain a second target matrix, multiplying b0 and b1 with the second target matrix respectively to obtain two third target matrices, and dividing the two third target matrices by a reshape functionRespectively transforming the two third target matrixes into column vectors to obtain a fifth column vector new _ vector0 and a fifth column vector new _ vector1;
and 4, step 4: calculating a measurement probability
Determining a first probability value prob0 with a measurement result of 0 based on a fifth column vector new _ vector0, prob0 being the square of the vector modulo length of new _ vector 0;
determining a second probability value prob1 with a measurement result of 1 based on the fifth column vector new _ vector1, where prob1 is a square of a vector modulo length of new _ vector1;
and 5: according to the probability distribution [ prob0, prob1], a random number selection function is utilized to randomly select a value outgome, wherein the outgome belongs to {0,1};
step 6: if outcontrol =0, then a measurement of 0 is returned, the quantum state column vector(second column vector), the corresponding quantum system identification list is an ordered list (second list) formed by deleting B for systems; if outome =1, the measurement result is returned as 1, and the quantum state column vector(second column vector) the corresponding quantum system identification list is an ordered list (second list) of systems with B removed.
Second embodiment
As shown in fig. 3, the present disclosure provides a quantum computation processing apparatus 300 including:
an obtaining module 301, configured to obtain first quantum state information and quantum operation information corresponding to a quantum computing model, where the quantum computing model includes M quantum systems, the first quantum state information includes a first list and a first column vector for characterizing quantum states of the M quantum systems, the first list stores identities of the M quantum systems in an arrangement order characterized by the first column vector, the quantum computing model is configured to perform a quantum computing task, and M is a positive integer;
a quantum state operation module 302, configured to perform a quantum state operation based on the first quantum state information and the quantum state operation information, to obtain second quantum state information, where the second quantum state information includes a second list and a second column vector for characterizing quantum states of N quantum systems in the quantum computing model, where the second list stores identifiers of the N quantum systems in an arrangement order characterized by the second column vector, where N is a positive integer less than or equal to M;
a determining module 303, configured to determine a task result of the quantum computing task based on the second quantum state information.
Optionally, the quantum operation information includes a first operation type and a first identifier, the first operation type indicates that the M quantum systems are permuted in order based on the first identifier, the quantum state operations include the permutation operations, the quantum state operation module 302 includes:
a first determining unit, configured to determine a position index of the first identifier in the first list;
a second determining unit, configured to determine, based on the position index, first reorganization parameter information when the quantum state of the first target quantum system represented by the position index is not at a head in the arrangement order of the first column of vectors, where the first target quantum system is a quantum system corresponding to the first identifier;
a first data reorganization processing unit, configured to perform first data reorganization processing on the first column vector based on the first reorganization parameter information, so as to obtain a second column vector, where a sequence of quantum states of the first target quantum system in the second column vector is at a first position in the second column vector, and a relative position of a quantum state of a second target quantum system in the first column vector and a relative position of a quantum state of the second target quantum system in the second column vector remain unchanged, where the second target quantum system includes quantum systems of the M quantum systems except for the first target quantum system;
and the updating unit is used for updating the first list according to the arrangement sequence represented by the second column vector to obtain the second list.
Optionally, the second determining unit is specifically configured to:
determining the first reorganization parameter information as a first parameter under the condition that the position index represents that the quantum state of the first target quantum system is at the last position in the arrangement order of the first column of vectors, wherein the first parameter comprises two reorganization variables and two permutation variables, and the values of the reorganization variables are determined based on the length of the first column of vectors;
in a case that the position index characterizes a quantum state of the first target quantum system in an arrangement order of the first column vector not being at a last bit, determining the first reorganization parameter information as a second parameter, the second parameter including three reorganization variables and three permutation variables, a value of the reorganization variable being determined based on a length of the first column vector and the position index;
wherein the reorganization variable is to control a dimension of data reorganization and a length of the dimension, and the permutation variable is to permute the quantum states of the first target quantum system to a leading bit of a column vector used to characterize the quantum states of the M quantum systems.
Optionally, the quantum operation information includes a second operation type, an evolution matrix, and K second identifiers, where the second operation type indicates that a quantum state evolution operation is performed on a quantum system corresponding to the second identifier based on the evolution matrix, the quantum state operation includes the quantum state evolution operation, K is a positive integer, and the quantum state operation module 302 includes:
a third determining unit, configured to determine third quantum state information based on the first quantum state information and the K second identifiers, where the third quantum state information includes a third column and a third column vector for characterizing quantum states of the M quantum systems, an arrangement order of quantum states of a third target quantum system in the third column vector is at a head, the third target quantum system is a quantum system corresponding to the K second identifiers, and the third column table stores identifiers of the M quantum systems in an arrangement order characterized by the third column vector;
a fourth determination unit configured to determine second reconfiguration parameter information based on the number of the second identifiers;
the second data recombination processing unit is used for performing second data recombination processing on the third column vector based on the second recombination parameter information to obtain a first target matrix;
the first multiplication processing unit is used for multiplying the first target matrix and the evolution matrix to obtain an evolution result matrix;
a third data reassembly unit, configured to perform third data reassembly on the evolution result matrix based on third reassembly parameter information to obtain the second column vector, where the third reassembly parameter information is determined based on the length of the first list; and determining the third list as the second list.
Optionally, the quantum operation information includes a third operation type and a third identifier, where the third operation type indicates that a quantum measurement operation is performed on a quantum system corresponding to the third identifier based on a measurement basis vector corresponding to the third operation type, where the quantum state operation includes the quantum measurement operation, and the quantum state operation module 302 includes:
a fifth determining unit, configured to determine fourth quantum state information based on the first quantum state information and the third identifier, where the fourth quantum state information includes a fourth column and a fourth column vector for characterizing quantum states of the M quantum systems, a quantum state of a fourth target quantum system is first in an arrangement order of the fourth column vector, the fourth target quantum system is a quantum system corresponding to the third identifier, and the fourth column stores identifiers of the M quantum systems in an arrangement order characterized by the fourth column vector;
a fourth data reassembly unit, configured to perform fourth data reassembly on the fourth column vector based on fourth reassembly parameter information to obtain a second target matrix, where the fourth reassembly parameter information is determined based on the length of the first list;
the second multiplication processing unit is used for multiplying the measurement base vector and the second target matrix to obtain a third target matrix;
a fifth data reorganization processing unit, configured to perform fifth data reorganization processing on the third target matrix based on fifth reorganization parameter information, to obtain a fifth column vector for characterizing quantum states of the quantum systems of the M quantum systems except for the fourth target quantum system, where the fifth reorganization parameter information is determined based on lengths of the first list;
a sixth determining unit configured to determine the second column vector based on the fifth column vector; and deleting the third identifier in the first list to obtain the second list.
Optionally, the measurement basis vectors include a first measurement basis vector and a second measurement basis vector, the first measurement basis vector is used for performing a quantum measurement operation on a first measurement result, the second measurement basis vector is used for performing a quantum measurement operation on a second measurement result, and the number of the fifth column vectors is two; the sixth determining unit is specifically configured to:
determining a first probability value that a measurement is the first measurement based on a first target column vector; and determining a second probability value for the measurement being the second measurement based on a second target column vector; the first target column vector is the fifth column vector obtained by performing quantum measurement operation based on the first measurement basis vector, and the second target column vector is the fifth column vector obtained by performing quantum measurement operation based on the second measurement basis vector;
selecting random numbers based on the probability distribution determined by the first probability value and the second probability value to obtain a target measurement result of the quantum state of the fourth target quantum system;
performing normalization processing on the first target column vector to obtain the second column vector under the condition that the target measurement result is the first measurement result;
and under the condition that the target measurement result is the second measurement result, performing normalization processing on the second target column vector to obtain the second column vector.
The quantum computing processing apparatus 300 provided by the present disclosure can implement each process implemented by the quantum computing processing method embodiment, and can achieve the same beneficial effects, and for avoiding repetition, the details are not repeated here.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations and do not violate the good customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 4 shows a schematic block diagram of an example electronic device that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 4, the apparatus 400 includes a computing unit 401 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 402 or a computer program loaded from a storage unit 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
A number of components in the device 400 are connected to the I/O interface 405, including: an input unit 406 such as a keyboard, a mouse, or the like; an output unit 407 such as various types of displays, speakers, and the like; a storage unit 408 such as a magnetic disk, optical disk, or the like; and a communication unit 409 such as a network card, modem, wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server combining a blockchain.
It should be understood that various forms of the flows shown above, reordering, adding or deleting steps, may be used. For example, the steps described in the present disclosure may be executed in parallel or sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.
Claims (12)
1. A quantum computation processing method comprising:
obtaining first quantum state information and quantum operation information corresponding to a quantum computing model, wherein the quantum computing model comprises M quantum systems, the first quantum state information comprises a first list and a first column vector used for representing quantum states of the M quantum systems, the first list stores identifications of the M quantum systems according to an arrangement sequence represented by the first column vector, the quantum computing model is used for executing quantum computing tasks, and M is a positive integer;
performing quantum state operation based on the first quantum state information and the quantum operation information to obtain second quantum state information, where the second quantum state information includes a second list and a second column vector for characterizing quantum states of N quantum systems in the quantum computation model, the second list stores identities of the N quantum systems in an arrangement order characterized by the second column vector, and N is a positive integer less than or equal to M;
determining a task result of the quantum computing task based on the second quantum state information;
the quantum-operation information comprising a first operation type and a first identification, the first operation type indicating a permutation operation to be performed on an order of the M quantum systems based on the first identification, the quantum-state operations comprising the permutation operation, the quantum-state operations performed based on the first quantum-state information and the quantum-operation information comprising:
determining a position index of the first identifier in the first list;
under the condition that the quantum state of a first target quantum system represented by the position index is not at the head in the arrangement sequence of the first column of vectors, determining first recombination parameter information based on the position index, wherein the first target quantum system is a quantum system corresponding to the first identifier;
performing first data reorganization processing on the first column vector based on the first reorganization parameter information to obtain a second column vector, wherein the quantum states of the first target quantum system in the second column vector are at the head in the arrangement sequence of the second column vector, and the relative positions of the quantum states of the second target quantum system in the first column vector and the second target quantum system in the second column vector are unchanged, and the second target quantum system comprises the quantum systems of the M quantum systems except for the first target quantum system;
and updating the first list according to the arrangement sequence represented by the second column vector to obtain the second list.
2. The method of claim 1, wherein said determining first reassembly parameter information based on said position index comprises:
determining the first reorganization parameter information as a first parameter under the condition that the position index represents that the quantum state of the first target quantum system is at the last position in the arrangement order of the first column of vectors, wherein the first parameter comprises two reorganization variables and two permutation variables, and the values of the reorganization variables are determined based on the length of the first column of vectors;
in a case that the position index represents that the quantum state of the first target quantum system is not at the last bit in the arrangement order of the first column vector, determining the first reorganization parameter information as a second parameter, wherein the second parameter comprises three reorganization variables and three permutation variables, and the values of the reorganization variables are determined based on the length of the first column vector and the position index;
wherein the reorganization variable is to control a dimension of data reorganization and a length of the dimension, and the permutation variable is to permute the quantum states of the first target quantum system to a leading bit of a column vector used to characterize the quantum states of the M quantum systems.
3. The method of any one of claims 1 to 2, wherein the quantum operation information includes a second operation type, an evolution matrix, and K second identifiers, the second operation type indicates that a quantum state evolution operation is performed on a quantum system corresponding to the second identifier based on the evolution matrix, the quantum state operation includes the quantum state evolution operation, K is a positive integer, and the performing a quantum state operation based on the first quantum state information and the quantum operation information includes:
determining third quantum state information based on the first quantum state information and the K second identifications, wherein the third quantum state information comprises a third list and a third column vector for representing the quantum states of the M quantum systems, the quantum states of a third target quantum system are at the head in the arrangement order of the third column vector, the third target quantum system is a quantum system corresponding to the K second identifications, and the third list stores the identifications of the M quantum systems in the arrangement order represented by the third column vector;
determining second reconfiguration parameter information based on the number of the second identifiers;
performing second data recombination processing on the third column vector based on the second recombination parameter information to obtain a first target matrix;
multiplying the first target matrix and the evolution matrix to obtain an evolution result matrix;
performing third data recombination processing on the evolution result matrix based on third recombination parameter information to obtain the second column vector, wherein the third recombination parameter information is determined based on the length of the first list; and determining the third list as the second list.
4. The method of any one of claims 1 to 2, wherein the quantum operation information includes a third operation type and a third identifier, the third operation type indicates that a quantum measurement operation is performed on a quantum system corresponding to the third identifier based on a measurement basis vector corresponding to the third operation type, the quantum state operation includes the quantum measurement operation, and the performing a quantum state operation based on the first quantum state information and the quantum operation information includes:
determining fourth quantum state information based on the first quantum state information and the third identification, the fourth quantum state information including a fourth column and a fourth column vector for characterizing quantum states of the M quantum systems, quantum states of a fourth target quantum system being first in an arrangement order of the fourth column vector, the fourth target quantum system being a quantum system corresponding to the third identification, the fourth column storing identifications of the M quantum systems in an arrangement order characterized by the fourth column vector;
performing fourth data reconstruction processing on the fourth column vector based on fourth reconstruction parameter information to obtain a second target matrix, wherein the fourth reconstruction parameter information is determined based on the length of the first list;
multiplying the measurement basis vector by the second target matrix to obtain a third target matrix;
performing fifth data reorganization processing on the third target matrix based on fifth reorganization parameter information to obtain a fifth column vector for representing quantum states of the quantum systems of the M quantum systems except the fourth target quantum system, wherein the fifth reorganization parameter information is determined based on the lengths of the first list;
determining the second column vector based on the fifth column vector; and deleting the third identifier in the first list to obtain the second list.
5. The method of claim 4, wherein the measurement basis vectors include a first measurement basis vector for performing a quantum measurement operation on a first measurement result and a second measurement basis vector for performing a quantum measurement operation on a second measurement result, the number of fifth column vectors being two, the determining the second column vector based on the fifth column vector comprising:
determining a measurement as a first probability value of the first measurement based on a first target column vector; and determining a second probability value for the measurement being the second measurement based on a second target column vector; the first target column vector is the fifth column vector obtained by performing quantum measurement operation based on the first measurement basis vector, and the second target column vector is the fifth column vector obtained by performing quantum measurement operation based on the second measurement basis vector;
selecting random numbers based on the probability distribution determined by the first probability value and the second probability value to obtain a target measurement result of the quantum state of the fourth target quantum system;
performing normalization processing on the first target column vector under the condition that the target measurement result is the first measurement result to obtain a second column vector;
and under the condition that the target measurement result is the second measurement result, performing normalization processing on the second target column vector to obtain the second column vector.
6. A quantum computation processing apparatus comprising:
an obtaining module, configured to obtain first quantum state information and quantum operation information corresponding to a quantum computing model, where the quantum computing model includes M quantum systems, the first quantum state information includes a first list and a first column vector for characterizing quantum states of the M quantum systems, the first list stores identities of the M quantum systems in an arrangement order characterized by the first column vector, the quantum computing model is configured to perform a quantum computing task, and M is a positive integer;
a quantum state operation module, configured to perform quantum state operation based on the first quantum state information and the quantum state operation information to obtain second quantum state information, where the second quantum state information includes a second list and a second column vector for characterizing quantum states of N quantum systems in the quantum computing model, the second list stores identifiers of the N quantum systems in an arrangement order characterized by the second column vector, and N is a positive integer less than or equal to M;
a determining module, configured to determine a task result of the quantum computing task based on the second quantum state information;
the quantum-operation information comprising a first operation type and a first identification, the first operation type indicating a permutation operation on an order of the M quantum systems based on the first identification, the quantum-state operations comprising the permutation operation, the quantum-state operation module comprising:
a first determining unit, configured to determine a position index of the first identifier in the first list;
a second determining unit, configured to determine, based on the position index, first reorganization parameter information when the quantum state of the first target quantum system represented by the position index is not at a head in the arrangement order of the first column of vectors, where the first target quantum system is a quantum system corresponding to the first identifier;
a first data reorganization processing unit, configured to perform first data reorganization processing on the first column vector based on the first reorganization parameter information to obtain a second column vector, where an arrangement order of quantum states of the first target quantum system in the second column vector is at a head position in the second column vector, and a relative position of a quantum state of a second target quantum system in the first column vector and a relative position of a quantum state of the second target quantum system in the second column vector are unchanged, where the second target quantum system includes a quantum system of the M quantum systems except for the first target quantum system;
and the updating unit is used for updating the first list according to the arrangement sequence represented by the second column vector to obtain the second list.
7. The apparatus according to claim 6, wherein the second determining unit is specifically configured to:
determining the first reorganization parameter information as a first parameter under the condition that the position index represents that the quantum state of the first target quantum system is at the last position in the arrangement order of the first column of vectors, wherein the first parameter comprises two reorganization variables and two permutation variables, and the values of the reorganization variables are determined based on the length of the first column of vectors;
in a case that the position index characterizes a quantum state of the first target quantum system in an arrangement order of the first column vector not being at a last bit, determining the first reorganization parameter information as a second parameter, the second parameter including three reorganization variables and three permutation variables, a value of the reorganization variable being determined based on a length of the first column vector and the position index;
wherein the reorganization variable is to control a dimension of data reorganization and a length of the dimension, and the permutation variable is to permute the quantum states of the first target quantum system to a leading bit of a column vector used to characterize the quantum states of the M quantum systems.
8. The apparatus of any one of claims 6 to 7, wherein the quantum operation information includes a second operation type, an evolution matrix, and K second identifiers, the second operation type indicates that a quantum state evolution operation is performed on a quantum system corresponding to the second identifier based on the evolution matrix, the quantum state operation includes the quantum state evolution operation, K is a positive integer, and the quantum state operation module includes:
a third determining unit, configured to determine third quantum state information based on the first quantum state information and the K second identifiers, where the third quantum state information includes a third list and a third column vector used for representing quantum states of the M quantum systems, a quantum state of a third target quantum system is at a head in an arrangement order of the third column vector, the third target quantum system is a quantum system corresponding to the K second identifiers, and the third list stores identifiers of the M quantum systems in an arrangement order represented by the third column vector;
a fourth determination unit configured to determine second reconfiguration parameter information based on the number of the second identifiers;
the second data recombination processing unit is used for performing second data recombination processing on the third column vector based on the second recombination parameter information to obtain a first target matrix;
the first multiplication processing unit is used for multiplying the first target matrix and the evolution matrix to obtain an evolution result matrix;
a third data reassembly unit, configured to perform third data reassembly on the evolution result matrix based on third reassembly parameter information to obtain the second column vector, where the third reassembly parameter information is determined based on the length of the first list; and determining the third list as the second list.
9. The apparatus of any one of claims 6 to 7, wherein the quantum operation information includes a third operation type and a third identifier, the third operation type indicates that a quantum measurement operation is performed on a quantum system corresponding to the third identifier based on a measurement basis vector corresponding to the third operation type, the quantum state operation includes the quantum measurement operation, and the quantum state operation module includes:
a fifth determining unit, configured to determine fourth quantum state information based on the first quantum state information and the third identifier, where the fourth quantum state information includes a fourth column and a fourth column vector for characterizing quantum states of the M quantum systems, a quantum state of a fourth target quantum system is first in an arrangement order of the fourth column vector, the fourth target quantum system is a quantum system corresponding to the third identifier, and the fourth column stores identifiers of the M quantum systems in an arrangement order characterized by the fourth column vector;
a fourth data reassembly unit, configured to perform fourth data reassembly on the fourth column vector based on fourth reassembly parameter information to obtain a second target matrix, where the fourth reassembly parameter information is determined based on the length of the first list;
the second multiplication processing unit is used for multiplying the measurement base vector and the second target matrix to obtain a third target matrix;
a fifth data reorganization processing unit, configured to perform fifth data reorganization processing on the third target matrix based on fifth reorganization parameter information, to obtain a fifth column vector for characterizing quantum states of the quantum systems of the M quantum systems except for the fourth target quantum system, where the fifth reorganization parameter information is determined based on lengths of the first list;
a sixth determining unit configured to determine the second column vector based on the fifth column vector; and deleting the third identifier in the first list to obtain the second list.
10. The apparatus of claim 9, wherein the measurement basis vectors comprise a first measurement basis vector for performing a quantum measurement operation on a first measurement result and a second measurement basis vector for performing a quantum measurement operation on a second measurement result, the number of the fifth column vectors being two; the sixth determining unit is specifically configured to:
determining a first probability value that a measurement is the first measurement based on a first target column vector; and determining a second probability value for the measurement being the second measurement based on a second target column vector; the first target column vector is the fifth column vector obtained by performing quantum measurement operation based on the first measurement basis vector, and the second target column vector is the fifth column vector obtained by performing quantum measurement operation based on the second measurement basis vector;
selecting random numbers based on the probability distribution determined by the first probability value and the second probability value to obtain a target measurement result of the quantum state of the fourth target quantum system;
performing normalization processing on the first target column vector under the condition that the target measurement result is the first measurement result to obtain a second column vector;
and under the condition that the target measurement result is the second measurement result, performing normalization processing on the second target column vector to obtain the second column vector.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210858691.3A CN115169568B (en) | 2022-07-20 | 2022-07-20 | Quantum calculation processing method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210858691.3A CN115169568B (en) | 2022-07-20 | 2022-07-20 | Quantum calculation processing method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115169568A CN115169568A (en) | 2022-10-11 |
CN115169568B true CN115169568B (en) | 2023-03-10 |
Family
ID=83496001
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210858691.3A Active CN115169568B (en) | 2022-07-20 | 2022-07-20 | Quantum calculation processing method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115169568B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115796293B (en) * | 2022-11-28 | 2024-07-05 | 北京百度网讯科技有限公司 | Quantum circuit operation method, device, apparatus, storage medium and program product |
CN115907025B (en) * | 2022-12-06 | 2023-08-22 | 北京百度网讯科技有限公司 | Quantum network protocol simulation method and device and electronic equipment |
CN116151383B (en) * | 2023-02-20 | 2023-10-03 | 北京百度网讯科技有限公司 | Quantum computing processing method and device and electronic equipment |
CN116167446B (en) * | 2023-02-20 | 2023-12-22 | 北京百度网讯科技有限公司 | Quantum computing processing method and device and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005250563A (en) * | 2004-03-01 | 2005-09-15 | Nippon Telegr & Teleph Corp <Ntt> | Quantum algorithm operation device, method for it, program, and storage medium |
CN111709531A (en) * | 2020-06-23 | 2020-09-25 | 南方科技大学 | Quantum state construction method and device, quantum computer equipment and storage medium |
WO2021055029A1 (en) * | 2019-09-20 | 2021-03-25 | Microsoft Technology Licensing, Llc | Quantum bit prediction |
CN113222150A (en) * | 2020-01-21 | 2021-08-06 | 合肥本源量子计算科技有限责任公司 | Quantum state transformation method and device |
CN114021728A (en) * | 2021-11-04 | 2022-02-08 | 北京百度网讯科技有限公司 | Quantum data measuring method and system, electronic device, and medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114374440B (en) * | 2022-01-10 | 2023-07-18 | 北京百度网讯科技有限公司 | Quantum channel classical capacity estimation method and device, electronic equipment and medium |
-
2022
- 2022-07-20 CN CN202210858691.3A patent/CN115169568B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005250563A (en) * | 2004-03-01 | 2005-09-15 | Nippon Telegr & Teleph Corp <Ntt> | Quantum algorithm operation device, method for it, program, and storage medium |
WO2021055029A1 (en) * | 2019-09-20 | 2021-03-25 | Microsoft Technology Licensing, Llc | Quantum bit prediction |
CN113222150A (en) * | 2020-01-21 | 2021-08-06 | 合肥本源量子计算科技有限责任公司 | Quantum state transformation method and device |
CN111709531A (en) * | 2020-06-23 | 2020-09-25 | 南方科技大学 | Quantum state construction method and device, quantum computer equipment and storage medium |
CN114021728A (en) * | 2021-11-04 | 2022-02-08 | 北京百度网讯科技有限公司 | Quantum data measuring method and system, electronic device, and medium |
Non-Patent Citations (2)
Title |
---|
Using and reusing coherence to realize quantum processes;María García Díaz1,Kun Fang等;《Verein zur Forderung des Open Access Publizierens in den Quantenwissenschaften》;第1-28页 * |
量子算法及其在图像处理中的应用;庞朝阳等;《四川师范大学学报(自然科学版)》(第04期);第2+116-134页 * |
Also Published As
Publication number | Publication date |
---|---|
CN115169568A (en) | 2022-10-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115169568B (en) | Quantum calculation processing method and device and electronic equipment | |
CN112529201B (en) | Entangled quantum state conversion method, device, equipment, storage medium and product | |
CN113342345A (en) | Operator fusion method and device of deep learning framework | |
CN115577790B (en) | Hamiltonian amount simulation method, device, equipment and storage medium | |
CN115759269B (en) | Method, device, equipment and storage medium for determining characteristic information | |
WO2023221416A1 (en) | Information generation method and apparatus, and device and storage medium | |
CN114580645A (en) | Simulation method, device and equipment for random quantum measurement and storage medium | |
JP2022062274A (en) | Function processing method, device, and electronic apparatus | |
JP2022068327A (en) | Node grouping method, apparatus therefor, and electronic device therefor | |
CN114091128A (en) | Determination method and device for layout scheme and electronic equipment | |
CN114693934A (en) | Training method of semantic segmentation model, video semantic segmentation method and device | |
CN115577791A (en) | Information processing method and device based on quantum system | |
CN113902118B (en) | Quantum measurement equipment calibration method and device, electronic equipment and medium | |
CN116167446B (en) | Quantum computing processing method and device and electronic equipment | |
CN113344213A (en) | Knowledge distillation method, knowledge distillation device, electronic equipment and computer readable storage medium | |
CN115116552A (en) | Molecular energy calculation method and device for quantum chemical simulation | |
CN115906987A (en) | Deep learning model training method, virtual image driving method and device | |
CN116151383B (en) | Quantum computing processing method and device and electronic equipment | |
CN114048863A (en) | Data processing method, data processing device, electronic equipment and storage medium | |
CN113642319A (en) | Text processing method and device, electronic equipment and storage medium | |
CN116090573B (en) | Method, device, equipment and storage medium for simulating non-local quantum operation | |
CN116739098B (en) | Quantum measurement device performance estimation method and device, electronic device and medium | |
CN113806310B (en) | Contrast method and related products | |
CN116739097B (en) | Quantum measurement device performance estimation method and device, electronic device and medium | |
CN114862037A (en) | Solving method and solving method of power generation cost optimization function |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |