CN116151383B - Quantum computing processing method and device and electronic equipment - Google Patents
Quantum computing processing method and device and electronic equipment Download PDFInfo
- Publication number
- CN116151383B CN116151383B CN202310158602.9A CN202310158602A CN116151383B CN 116151383 B CN116151383 B CN 116151383B CN 202310158602 A CN202310158602 A CN 202310158602A CN 116151383 B CN116151383 B CN 116151383B
- Authority
- CN
- China
- Prior art keywords
- quantum
- target
- vector
- target vector
- identification list
- 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
- 239000013598 vector Substances 0.000 claims abstract description 477
- 238000012545 processing Methods 0.000 claims abstract description 41
- 238000005259 measurement Methods 0.000 claims description 166
- 239000011159 matrix material Substances 0.000 claims description 69
- 238000000034 method Methods 0.000 claims description 39
- 230000008521 reorganization Effects 0.000 claims description 28
- 230000006798 recombination Effects 0.000 claims description 17
- 238000005215 recombination Methods 0.000 claims description 17
- 238000003860 storage Methods 0.000 claims description 17
- 238000012216 screening Methods 0.000 claims description 7
- 238000009826 distribution Methods 0.000 claims description 5
- 238000010606 normalization Methods 0.000 claims description 4
- 239000002096 quantum dot Substances 0.000 description 28
- 230000008569 process Effects 0.000 description 15
- 238000004088 simulation Methods 0.000 description 13
- 238000004590 computer program Methods 0.000 description 10
- 238000004364 calculation method Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 7
- 238000013461 design Methods 0.000 description 5
- 238000004422 calculation algorithm Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000012937 correction Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000012546 transfer Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000009466 transformation Effects 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
- 230000001413 cellular effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000005094 computer simulation Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000001105 regulatory effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
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/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)
- Mathematical Analysis (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Condensed Matter Physics & Semiconductors (AREA)
- Computational Mathematics (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Artificial Intelligence (AREA)
- Superconductor Devices And Manufacturing Methods Thereof (AREA)
Abstract
The disclosure provides a quantum computing processing method, a quantum computing processing device and electronic equipment, relates to the technical field of quantum computing, and particularly relates to the technical field of quantum circuits. The specific implementation scheme is as follows: acquiring quantum operation information of a quantum circuit; determining a width of the quantum circuit based on the quantum operation information; based on the width, a first quantum state of the quantum circuit is determined, the first quantum state comprising: the quantum system identification device comprises M first vectors used for representing M sub-quantum states and M first lists corresponding to the M first vectors one by one, wherein the M sub-quantum states indicate input states of the quantum circuit, and the first lists store quantum system identifications corresponding to the sub-quantum states according to an arrangement sequence represented by the first vectors; and executing quantum operation on the sub-quantum states of the M sub-quantum states based on the quantum operation information and the first quantum state to obtain a task result of a quantum computing task.
Description
Technical Field
The disclosure relates to the technical field of quantum computing, in particular to the technical field of quantum circuits, and specifically relates to a quantum computing processing method, a quantum computing processing device and electronic equipment.
Background
In classical simulation of quantum computing, column vectors are typically used to store quantum state information, and column vectors used to characterize 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 vector is generally operated so that the system order corresponding to the column vector is consistent with the default system order.
Disclosure of Invention
The disclosure provides a quantum computing processing method, a quantum computing processing device and electronic equipment.
According to a first aspect of the present disclosure, there is provided a quantum computing processing method, comprising:
acquiring quantum operation information of a quantum circuit, wherein the quantum circuit is used for executing quantum computing tasks;
determining a width of the quantum circuit based on the quantum operation information;
based on the width, a first quantum state of the quantum circuit is determined, the first quantum state comprising: the quantum system identification device comprises M first vectors used for representing M sub-quantum states and M first lists corresponding to the M first vectors one by one, wherein the M sub-quantum states indicate input states of the quantum circuit, the first lists store quantum system identifications corresponding to the sub-quantum states according to an arrangement sequence represented by the first vectors, and M is a positive integer;
And executing quantum operation on the sub-quantum states of the M sub-quantum states based on the quantum operation information and the first quantum state to obtain a task result of the quantum computing task.
According to a second aspect of the present disclosure, there is provided a quantum computing processing apparatus comprising:
the quantum computing device comprises an acquisition module, a quantum computing module and a processing module, wherein the acquisition module is used for acquiring quantum operation information of a quantum circuit, and the quantum circuit is used for executing quantum computing tasks;
a first determining module for determining a width of the quantum circuit based on the quantum operation information;
a second determining module for determining a first quantum state of the quantum circuit based on the width, the first quantum state comprising: the quantum system identification device comprises M first vectors used for representing M sub-quantum states and M first lists corresponding to the M first vectors one by one, wherein the M sub-quantum states indicate input states of the quantum circuit, the first lists store quantum system identifications corresponding to the sub-quantum states according to an arrangement sequence represented by the first vectors, and M is a positive integer;
and the quantum operation module is used for executing quantum operation on the quantum states in the M sub-quantum states based on the quantum operation information and the first quantum state to obtain a task result of the quantum computing task.
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 storing computer instructions for causing a computer to perform any 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 lower operation efficiency of the quantum circuit is solved, and the operation efficiency of the quantum circuit is improved, so that the execution efficiency of quantum computing tasks is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a flow diagram of a quantum computing processing method according to a first embodiment of the present disclosure;
FIG. 2 is a schematic diagram of an exemplary data structure for characterizing quantum state information in the present embodiment;
fig. 3 is a schematic structural view of a quantum computing processing apparatus 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 in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one 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 computing processing method, including the steps of:
step S101: quantum operation information of a quantum circuit is acquired, wherein the quantum circuit is used for executing quantum computing tasks.
In this embodiment, the quantum computing processing method relates to the technical field of quantum computing, in particular to the technical field of quantum circuits, and can be widely applied to the field of quantum computing processing. The quantum computing processing method of the embodiments of the present disclosure may be performed by the quantum computing processing apparatus of the embodiments of the present disclosure. The quantum computing processing apparatus of the embodiments of the present disclosure may be configured in any electronic device to perform the quantum computing processing method of the embodiments of the present disclosure.
The quantum computing provides a brand new and very promising information processing mode by utilizing the specific operation rule in the quantum world. At present, quantum computers are still in their primary stage of development, so the cost of manufacture, operation and maintenance is extremely expensive. Fortunately, the mode of using classical computer simulation quantum algorithm is enough to satisfy the demands of most scientific researches, teaching and the like. Therefore, how to improve the simulation capability of classical computers on quantum algorithms is a great concern in the industry.
In classical simulation of quantum computing, column vectors are typically used to store quantum state information. The column vector required for storing 1 qubit information is 2×1, and the column vector required for storing K qubits information is 2 K X 1, the length of the column vector storing the quantum state information, increases exponentially with the corresponding number of bits. Therefore, in classical simulation of quantum computation, it is necessary to repeatedly perform matrix operations on such a very large-scale column vector.
In the related art, the column vector representation of the 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 in zero state and quantum system 2 in one state. But if the identity of the quantum system is ignored, e.g. |0>|1>And |1>|0>And then represent different quantum states. To avoid confusion, a default set of system sequences is typically specified, such as writing the states from left to right, starting with the first bit on the left to the quantum state of the first qubit, the second bit to the quantum state of the 2 nd qubit, and so on. After a default order is specified, the column vector representations of all quantum states need to follow this order.
However, when the quantum state is operated, the sequence of the quantum system is inevitably disturbed, and in order to make the sequence of the quantum system consistent with that of the default system after the operation, some additional operations are required, so that the operation efficiency of the quantum circuit is lower. In addition, the manner of storing column vectors for representing quantum states by default sequence of the contracted quantum system is not suitable for a scene that the number of the quantum systems is changed, for example, an algorithm with adaptive quantum measurement is adopted to measure a part of quantum states, and the evolution of other quantum states is regulated and controlled by the measurement result. And each quantum state evolution, including the action of each quantum gate or each quantum measurement, requires multiple transformations of the column vector of quantum states. The repeated high-frequency transformation operation of the super-large-scale column vector greatly limits the classical simulation efficiency of quantum computing, namely the execution efficiency of quantum computing tasks.
The number of operation operations can be effectively reduced by simultaneously storing and operating the column vector of the quantum state and the list of the corresponding quantum systems thereof, and by replacing the quantum system sequence of the quantum state when the quantum state is operated. However, when the evolution and measurement of the quantum state are performed, the corresponding evolution and measurement operation needs to be applied to the complete quantum state, and when the number of quantum bits involved in the equivalent subsystem is large, the process still needs to consume a large amount of computing resources.
The present embodiment aims at storing the form of sub-quantum state so that the operation is only needed in the corresponding sub-stateOn column vectors of quantum states, without always applying to 2 of the complete quantum states of a quantum circuit K The operation is carried out on the column vector of the X1, so that the calculation complexity of the operation of a large matrix can be reduced, the classical simulation efficiency of quantum calculation is improved, and the execution efficiency of a quantum calculation task is improved. This will be described in detail below.
In step S101, the quantum circuit may be a standard quantum circuit or a generalized quantum circuit, that is, a dynamic quantum circuit. The quantum circuit is used for executing quantum computing tasks, such as quantum network protocol design tasks, quantum error correction code protocol design tasks and the like.
Where standard quantum circuits refer to quantum circuits in which quantum measurement operations are all located after quantum gate operations, while dynamic quantum circuits refer to quantum circuits that include reset operations, intermediate measurements, and quantum gate operations controlled by classical information. In the following embodiments, a quantum circuit will be described in detail taking a dynamic quantum circuit as an example.
The quantum operation information may include a quantum operation to be performed during operation of the quantum circuit, wherein the quantum operation may include a quantum state evolution operation, a quantum measurement operation, a reset operation on a quantum state, and the like.
The quantum operation information may include information about one, two, or even a plurality of quantum operations, and in the case where information about two or even a plurality of quantum operations is included, the information may be arranged in a simulation order of quantum operations in the quantum circuit and sequentially processed in the simulation order when the quantum operations are subsequently performed.
Information characterizing the quantum circuit, such as a quantum circuit diagram, may be parsed to obtain quantum operation information, or alternatively, pre-stored quantum operation information for the quantum circuit may be obtained. The quantum operation information may be represented by an ordered list including operation instructions stored in an order of operation of the quantum circuit, the operation instructions being for indicating quantum operation of the quantum circuit.
Step S102: based on the quantum operation information, a width of the quantum circuit is determined.
In this step, an operation instruction in the ordered list may be obtained, where the operation instruction may include a qubit targeted by a quantum operation, and the width of the quantum circuit may be determined based on a target qubit, which may be a largest qubit among qubits targeted by the quantum operation.
For example, when the target qubit is 5, the width of the quantum circuit can be determined to be 6.
Step S103: based on the width, a first quantum state of the quantum circuit is determined, the first quantum state comprising: the quantum system identification device comprises M first vectors used for representing M sub-quantum states and M first lists corresponding to the M first vectors one by one, wherein the M sub-quantum states indicate input states of the quantum circuit, and the first lists store quantum system identifications corresponding to the sub-quantum states according to an arrangement sequence represented by the first vectors.
Wherein M is a positive integer.
It is noted that each step of evolution and measurement of a quantum circuit operates only on individual quantum systems of quantum states in the quantum circuit, e.g., common single-bit quantum gates and double-bit quantum gates act on only one or two qubits, and quantum measurements act on only one qubit. If these qubits are independent of the other qubits (i.e., in tensor product form), then the actual operation will be independent of the other qubits.
In consideration of the calculation characteristics, a new quantum state data structure can be provided in the embodiment, the quantum state data is stored in a subsystem mode as far as possible, and in each step of operation, only the related subsystem is operated, so that the time and space complexity of operation is greatly reduced.
For example, a quantum circuit includes K quantum systems, that is, K qubits, and in the related art, a K-bit quantum state is stored, and if it can be written as a tensor product of quantum states on a subsystem, it is only necessary to store column vectors of the quantum states of the subsystem separately, and not to store a dimension of 2 K Column vector x 1. For example,the tensor product of quantum states on the subsystem written into one Q bit and one K-Q bit is written into the subsystem, and then only one 2 is needed to be stored respectively Q X 1 and a 2 K-Q Column vectors of x 1.
That is, if different systems of one quantum state are independent of each other, the quantum state may be stored by sub-states of sub-states independent of each other, where each sub-quantum state includes a column vector of the quantum state and an ordered list system of corresponding quantum system identifiers, respectively. If all systems on one quantum state are associated, then the corresponding sub-quantum state is itself. In addition, a sub-quantum state itself may be understood as a quantum state, and the sub-quantum state itself.
Fig. 2 is a schematic diagram of an exemplary data structure for representing quantum state information in this embodiment, where the data structure is shown in fig. 2, where the data structure is defined that data for representing a complete quantum state includes M parts, each of which represents a quantum state of a subsystem, and is called a sub-quantum state, where the M sub-quantum states may indicate an input state of the quantum circuit, that is, a tensor product operation of the M sub-quantum states may obtain the input state of the quantum state.
Each sub-quantum state may include two sub-parts, one of which is a quantum state column vector (i.e., a first vector), and the other of which is an ordered list system (i.e., a first list) formed by quantum system identifiers corresponding to the sub-quantum states, and the contents of the two sub-parts are in one-to-one correspondence. By means of simultaneously storing the column vectors of the sub-quantum states and the corresponding quantum system identifications, operation can be carried out on the relevant sub-systems only during each step of operation, and therefore the time and space complexity of operation can be greatly reduced.
In an alternative embodiment, each quantum system may be considered as one sub-quantum state, i.e. if the width is K, K sub-quantum states may be stored, i.e. M equals K. In practice, the data structure may be stored in a list, each part of the list being a sub-quantum state. The data result for representing the sub-quantum state can be defined through a program language, taking Python as an example, the sub-quantum state can be defined as a class Quantum State, the class has two class attributes, namely a column vector and a system identification system, and the basic operation of the sub-quantum state can be realized as a class method of the Quantum State class.
For example, if the input state of one quantum circuit is zero state, the corresponding input state of one K-bit quantum circuit may be represented by the data structure shown in fig. 2 as the following formula (1):
zero_state = [substate_1, substate_2, … substate_K] (1)
wherein, the column vector of the sub-quantum state_i is [ [1 ]],[0]]Quantum system identification systems are [ i ]]. That is, only K2×1 column vectors need to be stored, not one 2 K Column vector x 1.
Step S104: and executing quantum operation on the sub-quantum states of the M sub-quantum states based on the quantum operation information and the first quantum state to obtain a task result of the quantum computing task.
In this step, the first quantum state may be used as an initial state, corresponding quantum operations may be performed according to the arrangement sequence of the operation instructions in the quantum operation information, and after each operation instruction is performed, an output state of the quantum circuit after the operation instruction is performed may be obtained, for example, a second quantum state, where the second quantum state is the same as the data structure of the first quantum state, and related information of sub-quantum states is stored.
And then, the second quantum state can be used as the input state of the next operation instruction to continuously evolve and operate the quantum circuit. Correspondingly, under the condition that the operation instruction is completed, namely the evolution of the quantum circuit is completed, a task result of the quantum computing task can be obtained.
In the quantum operation process, based on the quantum bit of the quantum system indicated by the operation instruction, a sub-quantum state comprising the quantum bit can be obtained from M sub-quantum states, and quantum operation on the sub-quantum state is executed, so that when the quantum state is operated, only a relevant part is selected from the sub-quantum states of the quantum state to operate.
In the present embodiment, by being stored at the same timeBased on the storage and operation quantum state column vector and the corresponding quantum system identification mode, a sub-quantum state (sub state) structure is introduced to improve the performance of quantum circuit simulation and expand the use scene of quantum circuit simulation. In this way, the operation is only performed on the column vector of the corresponding sub-quantum state, and does not always need to be performed on 2 of the complete quantum state K X 1, and in turn may reduce additional operations after the quantum state operation. This will bring about an exponential scale improvement in memory storage and central processing unit computation during the operation of the quantum circuits. Therefore, the operation efficiency of the quantum circuit can be improved, and the execution efficiency of the quantum computing task can be improved.
In addition, in the dynamic quantum circuit, the measurement operation is allowed to be performed in the middle of the quantum circuit, and the step naturally breaks the association between the measured quantum bit and other quantum bits, so that the quantum state data structure can be directly applied to the simulation operation of the dynamic quantum circuit.
Optionally, the quantum operation information includes a first operation instruction, and the step S104 specifically includes:
determining a first identification list of the quantum system aimed at by the first operation instruction;
screening from the M first vectors based on the first identification list to obtain a first target vector, wherein the first target vector is a first vector corresponding to a first target list in the M first lists, and the first target list has an intersection with the first identification list;
performing quantum operation on the quantum system corresponding to the first identification list based on the first operation instruction and the first target vector to obtain a second target vector and a second identification list corresponding to the second target vector;
updating the first quantum state based on the second target vector and the second identification list to obtain a second quantum state, wherein the second quantum state comprises: the quantum circuit comprises N second vectors used for representing N sub-quantum states and N second lists corresponding to the N second vectors one by one, wherein the N sub-quantum states indicate output states of the quantum circuit after the first operation instruction is operated, the second lists store quantum system identifications corresponding to the sub-quantum states according to an arrangement sequence represented by the second vectors, and N is a positive integer;
And determining a task result of the quantum computing task based on the second quantum state.
In this embodiment, the quantum operation information may include a first operation instruction, and the first operation instruction may be a quantum state evolution operation (such as a quantum gate operation), a quantum measurement operation, or a reset operation.
The first operation instruction may include a qubit of a quantum system for which the quantum operation is performed, and correspondingly, the qubit may be obtained from the first operation instruction, so that a first identification list of the quantum system for which the first operation instruction is performed may be determined. The first identifier list may include one qubit or two qubits, which is not specifically limited herein.
A first list of targets having intersections with the first list of identifications may be obtained from the M first lists based on qubits of the quantum systems in the first list of identifications. If the first operation instruction is not the operation instruction ordered in the first, after the previous operation instruction is run, and M first lists are updated, a first target list which has an intersection with the first identification list is obtained from the updated list.
The number of the first target lists may be one or two, which is not particularly limited herein. For example, the first operation instruction indicates a single qubit operation, the first identification list may include qubit 0, and the first target list may be one, that is, may be the first list including qubit 0. For another example, the first operation instruction indicates that the first operation instruction is a double-qubit operation, and the first identification list may include a qubit 1 and a qubit 2, and the first target list may be two, that is, a first list including a qubit 1 and a first list including a qubit 2, respectively.
Under the condition that the first target list is obtained, a first target vector corresponding to the first target list can be obtained through screening from M first vectors, and accordingly sub-quantum states of quantum operations required to be executed by the first operation instruction can be obtained.
In an alternative embodiment, if the sub-quantum state related to the first operation instruction is one, the sub-quantum state corresponding to the first target vector is directly used as the quantum state operated by the first operation instruction.
In another optional embodiment, if the number of sub-quantum states related to the first operation instruction is at least two, performing tensor product operation on at least two first target vectors to obtain a third target vector; and combining the first target lists corresponding to the at least two first target vectors according to the tensor product operation order to obtain a third identification list corresponding to the third target vector, wherein the sub-quantum state formed by the third target vector and the third identification list can be correspondingly used as the quantum state operated by the first operation instruction.
And then, aiming at the quantum state operated by the first operation instruction, executing the quantum operation corresponding to the first operation instruction on the quantum system corresponding to the first identification list to obtain a second target vector and a second identification list corresponding to the second target vector, wherein the second target vector and the second identification list corresponding to the second target vector form a new sub-quantum state after the quantum operation is executed.
The number of second target vectors may be one or two, and is not particularly limited herein. For example, in a scenario, when the first operation instruction is an operation instruction of quantum measurement, if a quantum state operated by the first operation instruction corresponds to at least two quantum systems, after the first operation instruction is executed, two new sub-quantum states can be obtained, that is, two second target vectors can be obtained.
Then, the first quantum state may be updated based on the second target vector and the second identification list, that is, the sub-quantum state portion related to the subsystem operation is updated, to obtain a second quantum state. The second quantum state may include: and the N sub-quantum states are used for indicating output states of the quantum circuit after the first operation instruction is operated.
Wherein, M can be equal to N, M can be smaller than N, M can be larger than N, and the magnitude relation between M and N can be different according to the difference of the first operation instructions. For example, when the first operation instruction is single-quantum bit operation, the number of updated sub-quantum states in the second quantum state is the same as the number of sub-quantum states in the first quantum state. For another example, when the first operation instruction is a two-quantum bit operation, since two sub-quantum states are combined into one quantum state in a scene, the number of sub-quantum states in the updated second quantum state may be smaller than the number of sub-quantum states in the first quantum state.
Based on the update of the second quantum state, the second quantum state can be used as the input state of a new operation instruction, and the corresponding quantum operation is continuously executed until the execution of the operation instruction in the quantum operation information is completed, so that the task result of the quantum computing task is obtained. Such as quantum network protocol design tasks, quantum error correction code protocol design tasks, etc.
In this embodiment, the quantum state of the quantum circuit is updated until the operation instruction of the quantum circuit is completed by acquiring a corresponding quantum state from the first quantum state according to the qubit of the quantum system aimed at by the first operation instruction to perform quantum operation, and obtaining a task result of the quantum computing task when the quantum operation is completed. Therefore, when the quantum state is operated, the relevant part is selected from the sub-quantum state of the quantum state according to the operation instruction to operate, so that the accurate execution of the operation instruction is realized.
Optionally, the quantum system corresponding to the first identification list is subjected to quantum operation based on the first operation instruction and the first target vector, so as to obtain a second target vector and a second identification list corresponding to the second target vector, which includes:
Performing front operation of a quantum system on a third target vector based on the first identification list to obtain a fourth target vector, wherein the arrangement sequence of quantum states of a first target quantum system in the fourth target vector is at the first position of the fourth target vector, the relative position of quantum states of a second target quantum system in the third target vector and the relative position of quantum states of the second target quantum system in the fourth target vector are kept unchanged, the first target quantum system is a quantum system corresponding to the first identification list, the second target quantum system comprises quantum systems except for the first target quantum system in the quantum systems corresponding to the first target list, and the third target vector is determined based on the first target vector;
and carrying out quantum operation corresponding to the first operation instruction based on the fourth target vector to obtain a second target vector and a second identification list corresponding to the second target vector.
In this embodiment, when the number of first target vectors is one, the first target vector may be determined as the third target vector, and when the number of first target vectors is at least two, tensor product operation may be performed on at least two first target vectors to obtain the third target vector.
On the basis of simultaneously storing the quantum state column vector and the corresponding quantum system identification mode, one of the basic operations of the quantum state is to perform a pre-operation on the quantum system, and the operation does not change any property of the quantum state. For example: i0> 1 |1> 2 And |1> 2 |0> 1 Physically representing the same quantum state. For a generally given quantum state, one of its quantum systems may be transformed to the forefront of all systems.
The front-end operation process of the quantum system is specifically as follows:
input: a quantum system identification list system (a third identification list corresponding to a third target vector) is needed by a front quantum system (a first identification list);
and (3) outputting: the quantum state column vector (namely, the fourth target vector) after the system is arranged in front of the system and corresponds to the system identification list (namely, the fourth identification list corresponding to the fourth target vector).
Step 1: recording the length of the subsystem list system as size;
step 2: finding a position index corresponding to a system needing to be arranged in front in the system identification list system, and marking the position index as index;
step 3: if index=0, then it indicates that the system is already at the forefront, returning directly to vector and systems; if index=size-1, indicating that the system requiring the preamble is in the last bit of the systems, the variable new_shape= [2 can be defined size-1 ,2],new_axis=[1,0]The method comprises the steps of carrying out a first treatment on the surface of the If 0 is<index<size-1, which means that the system requiring the preamble is in the middle of the systems, can define the variable new_shape= [2 index ,2,2 size-index-1 ],new_axis=[1,0,2];
Step 4: the new vector is obtained by computing the quantum column vector by means of a reshape and a transfer function, new_vector=reshape (transfer (new_shape), new_axis, [2 ] size ,1]);
Step 5: deleting the system from the system list, adding the system to the forefront of the deleted list, and recording the new list as new_systems;
step 6: and returning a calculation result new_vector of the quantum state column vector (namely a fourth target vector) and a corresponding system identification list new_systems (fourth identification list).
It should be noted that if the quantum systems need to be adjusted to the specified order, not just one of the systems is advanced, this may be achieved by repeatedly calling up the front-end operation of the quantum system. For example, the quantum system [3,2,1] is adjusted to [1,2,3], the front operation of the quantum system can be called to advance the quantum system 2 to obtain the corresponding quantum system sequence [2,3,1], and on the basis, the quantum system 1 is advanced to obtain the quantum state corresponding to the quantum system sequence [1,2,3 ].
And then, quantum operation corresponding to the first operation instruction can be performed based on the fourth target vector and the fourth identification list, so as to obtain a second target vector and a second identification list corresponding to the second target vector. Therefore, by means of simultaneous storage and operation of quantum state column vectors and corresponding quantum system identifiers, one quantum state can be more accurately described, and the defects of the quantum state information storage mode in the aspects of calculation operation times and application scenes can be effectively overcome through front-end operation of the quantum system, additional operations after quantum state operation (namely, the sequence of the quantum system is adjusted to a default sequence) can be reduced, and the running efficiency of the quantum circuit is improved.
Optionally, the number of the first target vectors is at least two, and the method further includes:
performing tensor product operation on at least two first target vectors to obtain a third target vector;
and merging the first target lists corresponding to at least two first target vectors according to the tensor product operation order to obtain a third identification list corresponding to the third target vector.
In this embodiment, when the number of the first target vectors is at least two, sub-quantum states corresponding to the at least two first target vectors may be combined to generate a new quantum state for subsequent evolution operation, a column vector (i.e., a third target vector) of the quantum state is obtained by tensor product operation of the at least two first target vectors, and a quantum system identifier list (i.e., a third identifier list) of the quantum state is obtained by sequentially combining the at least two first target lists in sequence. In this manner, sub-quantum states may be combined to enable execution of operational instructions.
Optionally, the first operation instruction includes an evolution matrix and a first operation type, the first operation type indicates that quantum state evolution operation is performed on a quantum system corresponding to the first identification list based on the evolution matrix, and the quantum operation corresponding to the first operation instruction is performed based on the fourth target vector, so as to obtain a second target vector and a second identification list corresponding to the second target vector, where the quantum state evolution operation includes:
Determining first reorganization parameter information based on the identification number of the first identification list;
based on the first reorganization parameter information, performing first data reorganization processing on the fourth target vector to obtain a first target matrix;
multiplying the first target matrix with the evolution matrix to obtain an evolution result matrix;
performing second data recombination processing on the evolution result matrix based on second recombination parameter information to obtain the second target vector, wherein the second recombination parameter information is determined based on the length of a third identification list corresponding to the third target vector;
and determining a fourth identification list as a second identification list corresponding to the second target vector, wherein the fourth identification list is obtained by performing front-end operation of a quantum system on the third identification list based on the first identification list.
In this embodiment, the first operation instruction may indicate a quantum state evolution operation, which may include an evolution matrix and a first operation type, where the first operation type indicates that the quantum state evolution operation is performed on the quantum system corresponding to the first identifier list based on the evolution matrix.
The quantum state evolution operation is to correspondingly evolve the quantum system specified by the first identification list. For example, the 1 st quantum system is subjected to the brix gate evolution, the 2 nd quantum system and the 3 rd quantum system are subjected to the control not gate evolution, the quantum gates needing to be evolved are different, and the evolution matrixes are also different.
Under the condition that the first operation instruction is analyzed to be quantum state evolution operation, the first reorganization parameter information can be determined based on the identification number of the first identification list. For example, the number of identifiers is width, and the first reorganization parameter information may be shape= [2 width ,2 size-width ]The purpose is to transform the fourth target vector into a two-dimensional matrix, and the data length of each dimension is 2 respectively width And 2 size-width And performing evolution operation based on the two-dimensional matrix and the evolution matrix.
Correspondingly, the first target matrix is a two-dimensional matrix, and the lengths of the rows and the columns are respectively 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 a column vector based on second recombination parameter information to obtain a second target vector, wherein the second recombination parameter information is a binary vectorThe size may be determined based on the length of a fourth identification list obtained by performing a quantum system pre-operation on a third identification list based on the first identification list, the third identification list being [0,1,2,3,4 ]]The first identification list is [3,4,1,2 ]]The fourth identification list obtained by the front-end operation of the quantum system is [3,4,1,2,0 ]]The second recombination parameter information may be [2 ] size ,1]. And determining the fourth identification list as a second identification list corresponding to the second target vector.
The process of quantum state evolution operation is as follows:
input: a quantum state list of quantum states, a quantum system identification list needing to be evolved (namely a first identification list), and a corresponding quantum gate matrix gate (namely an evolution matrix);
and (3) outputting: the quantum state column vector (namely the second target vector) after quantum state evolution and the corresponding quantum system identification list (namely the second identification list) are obtained.
Step 1: initializing two empty lists, namely, releas_substates and other_substates;
step 2: traversing a sub-state list substates of the searched quantum state (which can be a first quantum state), and adding the sub-state (namely, the sub-state corresponding to the first target vector) into the list releas_substates if the identification list (which can be the first list) of the current sub-state system and the list labels (namely, the first identification list) of the quantum system needing to be evolved have common elements; otherwise, if no common element exists, adding the sub-state into a list other_substates;
step 3: merging (i.e., performing tensor product operation) the elements in the remote_substates to generate a new quantum state merge_state for subsequent evolution operation, wherein a column vector (i.e., a third target vector) of the quantum state is obtained by tensor product operation of the elements in the remote_substates, and a quantum system identification list (a third identification list) is a result obtained by sequentially merging the quantum system identification lists of the elements in the remote_substates;
Step 4: recording the length of a quantum system identification list system (third identification list) of the quantum state merge_state generated by merging the sub-states as size; the length of a quantum system identification list labels (namely a first identification list) needing to be evolved is width;
step 5: through the prepositive operation of the quantum system, the column vector and the system identification list of the combined quantum state merge_state are subjected to the prepositive operation of the quantum system according to the sequence of the list labels, so that the quantum system in the labels is at the forefront of all systems, and the relative positions of elements in the labels are kept unchanged; the quantum state column vector after the step operation is denoted as a merge_vector (namely a fourth target vector), and the system representation list is denoted as merge_systems (namely a fourth identification list);
step 6: definition variable shape= [2 ] width ,2 size-width ];
Step 7: the column vector of the combined quantum state is calculated and updated by the reshape and the transfer function, and the merge_vector=reshape (gate@reshape) [2 ] size ,1]) Wherein @ is matrix multiplication;
step 8: updating the merge_state (which can update the first quantum state) by taking the updated merge_vector (namely the second target vector) and the merge_systems (namely the second identification list) as column vectors and system identification lists of the subsystem after evolution is completed, and adding the updated merge_state into a list other_substates to obtain a new subsystem list (namely a subsystem list of the second quantum state) after quantum state evolution;
Step 9: other_substates are returned as output results.
In this embodiment, the evolution of the quantum state in the quantum circuit may be implemented based on the first quantum state.
It should be noted that, if a series of quantum gate evolution needs to be performed on the quantum state, only the process of invoking the quantum state evolution operation is needed to be repeated. In addition, the process of performing quantum state evolution operation based on the first quantum state can embody the core distinction of the operation mode of the quantum circuit in the related technology. Specifically, in the conventional quantum circuit simulation, only the column vector storage of the quantum states is considered, and all the quantum states are defaulted to be continuous positive integers starting from 0 corresponding to the system labels, so that after the evolution of the quantum states is completed, additional operations need to be continuously applied, and the system sequence of the quantum states is adjusted to be consistent with the defaulted sequence; while this embodiment reduces unnecessary matrix operations by operating on both the column vectors and the system identification list. In addition, the quantum state is stored in a mode of storing the sub-state, so that the complete quantum state action evolution operation is not needed, and only the relevant quantum system involved in the evolution is needed to be operated, thereby reducing the computational complexity and improving the computational efficiency.
Optionally, the first operation instruction includes a second operation type and a measurement basis vector, the second operation type indicates that quantum measurement operation is performed on a quantum system corresponding to the first identifier list based on the measurement basis vector, and quantum operation corresponding to the first operation instruction is performed based on the fourth target vector, so as to obtain a second target vector and a second identifier list corresponding to the second target vector, where the quantum measurement operation includes:
performing third data reorganization on the fourth target vector based on third reorganization parameter information to obtain a second target matrix, wherein the third reorganization parameter information is determined based on the length of a third identification list corresponding to the third target vector;
multiplying the measurement base vector with the second target matrix to obtain a third target matrix;
based on fourth reconfiguration parameter information, fourth data reconfiguration processing is carried out on the third target matrix, and a fifth target vector is obtained;
and determining a second target vector and a second identification list corresponding to the second target vector based on the fifth target vector.
In this embodiment, the first operation instruction may indicate a quantum measurement operation, which may include a second operation type and a measurement basis vector, where the second operation type indicates that the quantum measurement operation is performed on the quantum system corresponding to the first identifier list based on the measurement basis vector.
The quantum measurement operation is to measure a quantum system specified on a quantum state to obtain a corresponding measurement result and a measured quantum state. Since any quantum measurement can be equivalently replaced by performing corresponding quantum gate evolution on a quantum state and then performing Z measurement (measurement under a calculation basis), without losing generality, a detailed description will be given below with respect to a process of a quantum measurement operation by taking Z measurement as an example, and the rest of measurement operations are similar to those of the Z measurement.
When the first operation instruction is analyzed to be quantum measurement operation, third data reorganization processing can be performed on the fourth target vector based on third reorganization parameter information, so that the fourth target vector is transformed into a two-dimensional matrix, measurement operation is performed based on the two-dimensional matrix and a measurement base vector, that is, multiplication processing is performed on the measurement base vector and the two-dimensional matrix (second target matrix), and a third target matrix is obtained. Wherein the third recombinant parameter information may be [2,2 ] size-1 ]。
And carrying out fourth data recombination processing on the third target matrix based on fourth recombination parameter information to obtain a fifth target vector. Wherein the fourth reconfiguration parameter information may be [2 ] size-1 ,1]。
And then, based on the fifth target vector, determining a second target vector and a second identification list corresponding to the second target vector. In this way, quantum measurement of the quantum states in the quantum circuit can be achieved based on the first quantum state.
Optionally, the measurement basis vector includes a first measurement basis vector and a second measurement basis vector, the first measurement basis vector is used for performing quantum measurement operation on a first measurement result, the second measurement basis vector is used for performing quantum measurement operation on a second measurement result, the number of the fifth target vectors is two, and the determining, based on the fifth target vector, a second target vector and a second identification list corresponding to the second target vector includes:
determining a measurement result as a first probability value of the first measurement result based on a first result vector; and determining a second probability value for a measurement as the second measurement based on a second result vector; the first result vector is the fifth target vector obtained by performing quantum measurement operation based on the first measurement basis vector, and the second result vector is the fifth target vector obtained by performing quantum measurement operation based on the second measurement basis vector;
selecting random numbers based on probability distribution determined by the first probability value and the second probability value to obtain a target measurement result corresponding to the first target quantum system;
and determining a second target vector and a second identification list corresponding to the second target vector based on the target measurement result and the identification number in the first target list.
Optionally, the determining, based on the target measurement result and the number of identifiers in the first target list, a second target vector and a second identifier list corresponding to the second target vector includes at least one of the following:
under the condition that the number of the identifiers is 1, determining a preset vector corresponding to the target measurement result as a second target vector, and determining the first target list as a second identifier list corresponding to the second target vector;
under the condition that the number of the identifiers is larger than 1, determining a preset vector corresponding to the target measurement result as a second target vector of a first sub-quantum state, and determining the first identifier list as the second identifier list of the first sub-quantum state; and carrying out normalization processing on the fifth target vector corresponding to the target measurement result to obtain a second target vector of a second sub-quantum state, determining a fifth identification list as the second identification list of the second sub-quantum state, and deleting the list after the first identification list for a fourth identification list by the fifth identification list.
In this embodiment, the first measurement result may be 0, the second measurement result may be 1, the first measurement basis vector may be a row vector for performing a quantum measurement operation on the first measurement result, denoted by b0= [ [1,0] ], and the second measurement basis vector may be a row vector for performing a quantum measurement operation on the second measurement result, denoted by b1= [ [0,1] ].
The process of quantum measurement operation is as follows:
input: sub-states of quantum states, quantum system identification system (i.e., first identification list) to be measured;
and (3) outputting: as a result of the measurement, a list of sub-states of the measured quantum states (i.e., a list of sub-states of the second quantum state).
Step 1: traversing a sub-state list of quantum states (which can be a first quantum state), if the quantum system identification system to be measured is in the identification list system of the current sub-state system, recording that the sub-state is a remote_sub-state, and removing the sub-state from the sub-states;
step 2: the column vector of the quantum state of the record state release_sub state (namely a third target vector) is a release_vector, the quantum system identification list is release_systems (a third identification list), the list length is size, and the first measurement base vector b0= [ [1,0] ], the second measurement base vector b1= [ [0,1] ];
step 3: the quantum state column vector of the sub-state releasant_sub and the quantum system identification list are pre-arranged according to the system to be measured through the pre-arrangement operation of the quantum system, so that the system in the system is at the forefront of the releasant_systems list; the quantum state column vector after the step operation is recorded as a releasant_vector_perm (namely a fourth target vector), and corresponds to a quantum system identification list releasant_systems_perm (fourth identification list);
Step 4: the column vector of the quantum state (i.e., the fourth target vector) is operated on by a reshape function to obtain a new vector (i.e., the fifth target vector), specifically,
new_vector0=reshape(b0@reshape(relevant_vector_perm,[2,2 size-1 ]),
[2 size-1 ,1]) New_vector0 is the first result vector;
new_vector1=reshape(b1@reshape(relevant_vector_perm,[2,2 size-1 ]),
[2 size-1 ,1]) New_vector1 is the second result vector;
wherein @ is matrix multiplication;
step 5: calculating a measurement probability, wherein prob0 (i.e. a first probability value) is the square of the vector modulo length of new_vector0, and prob1 (i.e. a second probability value) is the square of the vector modulo length of new_vector 1;
step 6: randomly selecting a value outome according to the probability distribution [ prob0, prob1] by using a random number selection function, wherein the value of outome is E {0,1};
step 7: if outome=0, then the measurement is returned to 0, and the column vector of the remaining system quantum states after measurementIf outome=1, then the return measurement is 1, post_vector is +.>
Step 8: determining a second target vector and a second identification list corresponding to the second target vector based on the target measurement result and the identification number in the first target list, so that quantum operation corresponding to the first operation instruction can be realized based on a fourth target vector; thereafter, the quantum state is updated, specifically as follows:
a) If the sub-state releas_sub-state is a single-qubit system (i.e. the number of labels is 1), the column vector is updated according to the measurement result. Specifically, if outome=0, then releas_vector= [ [1], [0] ] (i.e., the preset vector [ [1], [0] ] is determined as the second target vector); if outome=1, releasant_vector= [ [0], [1] ] (i.e., determining the preset vector [ [0], [1] ] as the second target vector); adding the measured sub-states (comprising the second target vector and the second identification list) into a sub-state list of the quantum states again, namely updating the first quantum state based on the second target vector and the second identification list to obtain a second quantum state;
b) If the sub-state is a multiple-quantum bit system (i.e., the number of identifiers is greater than 1), two new sub-states, sub-state 1 (i.e., the first sub-quantum state) and sub-state 2 (i.e., the second sub-quantum state) are generated. When outome=0, the column vector of the substate1 is [ [1], [0] ]; when outome=1, the column vector of substate1 is [ [0], [1] ]; in addition, the quantum system identifier (i.e., the second identifier list) of the sub-state 1 is the measured system identifier system, the column vector of the sub-state 2 is the post_vector, and the quantum system identifier list (i.e., the fifth identifier list) is a list formed by deleting the system (the first identifier list) from the release_systems_perm list (i.e., the fourth identifier list); and adding the substate1 and the substate2 into a quantum state sub-state list substate.
Thus, the second target vector and the second identification list can be determined, so that the sub-state list of the quantum state is updated.
It should be noted that, if multiple systems in one quantum state need to be measured, only the process of calling the quantum measurement operation needs to be repeated to measure sequentially. In addition, the process of this quantum measurement operation represents a core distinction from the related art. Generally, after the quantum state is obtained, the quantum measurement is randomly sampled directly through the probability amplitude of the quantum state, and the quantum state on the rest system after the measurement of part of the quantum system is not concerned. The quantum measurement operation process can only measure part of bits of one quantum state, and can continue to operate the quantum states on other systems after the measurement is completed, so that the method has stronger operability and richer application scenes.
For example, in many quantum network protocols, quantum error correction code protocols, quantum computation based on measurement, and other scenarios, it is necessary to measure part of the quantum system, and then regulate the evolution of the rest of the quantum bits according to the measurement result. The quantum state data structure in this embodiment and the above-mentioned process of quantum measurement operation can be well adapted to these scenarios.
In addition, the embodiment does not need to carry out quantum measurement operation on the complete quantum state, but only needs to carry out operation on a subsystem related to measurement, thereby reducing the calculation complexity of matrix operation and improving the calculation efficiency. In addition, after the measurement is completed, the quantum system to be measured and other quantum systems are mutually independent, and the quantum system to be measured and the other quantum systems are stored in a form of sub-quantum states, so that on one hand, the memory consumption can be reduced, and on the other hand, the execution of the subsequent reset operation can be facilitated.
Optionally, the first operation instruction includes a third operation type and a reset vector, the third operation type indicates that the quantum system corresponding to the first identification list is subjected to a reset operation based on the reset vector, and the quantum system corresponding to the first identification list is subjected to a quantum operation based on the first operation instruction and the first target vector, so as to obtain a second target vector and a second identification list corresponding to the second target vector, which includes:
Under the condition that the number of the identifiers in the first target list is 1, replacing the first target vector with the reset vector to obtain a second target vector;
and determining the first target list as a second identification list corresponding to the second target vector.
In a dynamic quantum circuit, measurements are allowed in the middle of the quantum circuit and the measured quantum system is reset for use in subsequent operations. In this embodiment, the first operation instruction may indicate a reset operation, which may include a third operation type and a reset vector, where the third operation type indicates that the reset operation is performed on the quantum system corresponding to the first identifier list based on the reset vector.
When the first operation instruction is analyzed to be the reset operation, the number of the identifiers in the first target list can be determined, and when the number of the identifiers in the first target list is 1, the first target vector is replaced by the reset vector, so that a second target vector is obtained; and determining the first target list as a second identification list corresponding to the second target vector.
The reset operation is as follows:
input: quantum state list substates of quantum states, quantum system identification system to be reset (i.e., first identification list), quantum state column vector to be reset (i.e., reset vector);
And (3) outputting: a list of quantum states after reset (i.e., a list of sub-states of the second quantum state).
Step 1: traversing and searching a quantum state sub-state list, and if the quantum system identification system needing to be reset is in the identification list system of the current sub-state system, recording the sub-state as a remote_sub-state;
step 2: if the length of the quantum system identification list of the releasant_substate is greater than 1, indicating that the quantum system needing to be reset possibly has association with other systems, and performing error processing (namely prompting that the operation is not allowed); because the data structure in this embodiment adopts sub-quantum state storage, it can be very convenient to determine whether there is a correlation between different sub-systems, which cannot be directly achieved by using the whole sub-state storage form in the related art. If the length of the quantum system identification list of the releast_substate is equal to 1, replacing the quantum state column vector of the releast_substate with a vector;
step 3: the list of substates is returned as output.
In this way, a reset of the quantum states in the quantum circuit may be achieved based on the first quantum state.
Also, quantum measurement operations naturally break the association of the measured qubit with other qubits, while reset operations also need to take into account whether the system being reset has an association with other systems. The quantum state data structure in the embodiment can reflect whether different systems in the quantum state are associated or not, so that the quantum state data structure can be directly applied to simulation of a dynamic quantum circuit and has a wider application range.
Optionally, the step S103 specifically includes:
determining a target identifier, wherein the target identifier is a quantum system identifier reset by a second operation instruction indication, and the quantum operation information comprises the second operation instruction;
and dividing a quantum system based on the target identifiers and the widths to obtain the first quantum states, wherein the M first lists comprise second target lists, and the second target lists are lists of the target identifiers.
In this embodiment, the target identifier may be determined based on the second operation instruction (which indicates the reset operation) in the quantum operation information, where the quantum system corresponding to the target identifier is the quantum system that needs to be reset.
The quantum system can be divided based on the target mark and the width of the quantum circuit to obtain a first quantum state, and the target mark can be used as a single list to form a sub-quantum state so as to avoid the association between the quantum system corresponding to the target mark and other quantum systems, thus ensuring the normal operation of the reset operation of the quantum system corresponding to the target mark.
Second embodiment
As shown in fig. 3, the present disclosure provides a quantum computing processing apparatus 300, comprising:
An obtaining module 301, configured to obtain quantum operation information of a quantum circuit, where the quantum circuit is configured to perform a quantum computing task;
a first determining module 302, configured to determine a width of the quantum circuit based on the quantum operation information;
a second determining module 303, configured to determine a first quantum state of the quantum circuit based on the width, where the first quantum state includes: the quantum system identification device comprises M first vectors used for representing M sub-quantum states and M first lists corresponding to the M first vectors one by one, wherein the M sub-quantum states indicate input states of the quantum circuit, the first lists store quantum system identifications corresponding to the sub-quantum states according to an arrangement sequence represented by the first vectors, and M is a positive integer;
and the quantum operation module 304 is configured to perform quantum operations on the quantum states in the M sub-quantum states based on the quantum operation information and the first quantum state, so as to obtain a task result of the quantum computing task.
Optionally, the quantum operation information includes a first operation instruction, and the quantum operation module 304 includes:
a first determining submodule, configured to determine a first identification list of a quantum system for which the first operation instruction is directed;
The screening sub-module is used for screening and obtaining a first target vector from the M first vectors based on the first identification list, wherein the first target vector is a first vector corresponding to a first target list in the M first lists, and the first target list and the first identification list have an intersection;
the quantum operation sub-module is used for carrying out quantum operation on the quantum system corresponding to the first identification list based on the first operation instruction and the first target vector to obtain a second target vector and a second identification list corresponding to the second target vector;
the updating sub-module is configured to update the first quantum state based on the second target vector and the second identifier list to obtain a second quantum state, where the second quantum state includes: the quantum circuit comprises N second vectors used for representing N sub-quantum states and N second lists corresponding to the N second vectors one by one, wherein the N sub-quantum states indicate output states of the quantum circuit after the first operation instruction is operated, the second lists store quantum system identifications corresponding to the sub-quantum states according to an arrangement sequence represented by the second vectors, and N is a positive integer;
And the second determination submodule is used for determining a task result of the quantum computing task based on the second quantum state.
Optionally, the quantum operation submodule includes:
the front-end operation unit is used for carrying out front-end operation of a quantum system on a third target vector based on the first identification list to obtain a fourth target vector, the arrangement sequence of quantum states of a first target quantum system in the fourth target vector is in the first position, the relative position of the quantum states of a second target quantum system in the third target vector and the relative position of the quantum states of the second target quantum system in the fourth target vector are kept unchanged, the first target quantum system is a quantum system corresponding to the first identification list, the second target quantum system comprises quantum systems except the first target quantum system in the quantum systems corresponding to the first target list, and the third target vector is determined based on the first target vector;
and the quantum operation unit is used for carrying out quantum operation corresponding to the first operation instruction based on the fourth target vector to obtain a second target vector and a second identification list corresponding to the second target vector.
Optionally, the number of the first target vectors is at least two, and the apparatus further includes:
the tensor product operation module is used for carrying out tensor product operation on at least two first target vectors to obtain the third target vector;
and the merging module is used for merging the first target lists corresponding to at least two first target vectors according to the tensor product operation order to obtain a third identification list corresponding to the third target vector.
Optionally, the first operation instruction includes an evolution matrix and a first operation type, where the first operation type indicates that quantum state evolution operation is performed on a quantum system corresponding to the first identifier list based on the evolution matrix, and the quantum operation unit is specifically configured to:
determining first reorganization parameter information based on the identification number of the first identification list;
based on the first reorganization parameter information, performing first data reorganization processing on the fourth target vector to obtain a first target matrix;
multiplying the first target matrix with the evolution matrix to obtain an evolution result matrix;
performing second data recombination processing on the evolution result matrix based on second recombination parameter information to obtain the second target vector, wherein the second recombination parameter information is determined based on the length of a third identification list corresponding to the third target vector;
And determining a fourth identification list as a second identification list corresponding to the second target vector, wherein the fourth identification list is obtained by performing front-end operation of a quantum system on the third identification list based on the first identification list.
Optionally, the first operation instruction includes a second operation type and a measurement basis vector, where the second operation type indicates that quantum measurement operation is performed on a quantum system corresponding to the first identifier list based on the measurement basis vector; the quantum operation unit is specifically used for:
performing third data reorganization on the fourth target vector based on third reorganization parameter information to obtain a second target matrix, wherein the third reorganization parameter information is determined based on the length of a third identification list corresponding to the third target vector;
multiplying the measurement base vector with the second target matrix to obtain a third target matrix;
based on fourth reconfiguration parameter information, fourth data reconfiguration processing is carried out on the third target matrix, and a fifth target vector is obtained;
and determining a second target vector and a second identification list corresponding to the second target vector based on the fifth target vector.
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 quantum measurement operation on a first measurement result, the second measurement basis vector is used for performing quantum measurement operation on a second measurement result, and the number of the fifth target vectors is two, and the quantum operation unit is further configured to:
determining a measurement result as a first probability value of the first measurement result based on a first result vector; and determining a second probability value for a measurement as the second measurement based on a second result vector; the first result vector is the fifth target vector obtained by performing quantum measurement operation based on the first measurement basis vector, and the second result vector is the fifth target vector obtained by performing quantum measurement operation based on the second measurement basis vector;
selecting random numbers based on probability distribution determined by the first probability value and the second probability value to obtain a target measurement result corresponding to the first target quantum system;
and determining a second target vector and a second identification list corresponding to the second target vector based on the target measurement result and the identification number in the first target list.
Optionally, the quantum operation unit is further configured to:
under the condition that the number of the identifiers is 1, determining a preset vector corresponding to the target measurement result as a second target vector, and determining the first target list as a second identifier list corresponding to the second target vector;
under the condition that the number of the identifiers is larger than 1, determining a preset vector corresponding to the target measurement result as a second target vector of a first sub-quantum state, and determining the first identifier list as the second identifier list of the first sub-quantum state; and carrying out normalization processing on the fifth target vector corresponding to the target measurement result to obtain a second target vector of a second sub-quantum state, determining a fifth identification list as the second identification list of the second sub-quantum state, and deleting the list after the first identification list for a fourth identification list by the fifth identification list.
Optionally, the first operation instruction includes a third operation type and a reset vector, where the third operation type indicates that the quantum system corresponding to the first identifier list is subjected to a reset operation based on the reset vector, and the quantum operation submodule includes:
A replacing unit, configured to replace the first target vector with the reset vector to obtain a second target vector when the number of identifiers in the first target list is 1;
and the determining unit is used for determining the first target list as a second identification list corresponding to the second target vector.
Optionally, the second determining module 303 is specifically configured to:
determining a target identifier, wherein the target identifier is a quantum system identifier reset by a second operation instruction indication, and the quantum operation information comprises the second operation instruction;
and dividing a quantum system based on the target identifiers and the widths to obtain the first quantum states, wherein the M first lists comprise second target lists, and the second target lists are lists of the target identifiers.
The quantum computing processing device 300 provided in the present disclosure can implement each process implemented by the quantum computing processing method embodiment, and can achieve the same beneficial effects, so that repetition is avoided, and no further description is provided herein.
In the technical scheme of the disclosure, the related processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the personal information of the user accord with the regulations of related laws and regulations, and the public order colloquial is not violated.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
FIG. 4 illustrates 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. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary 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 suitable 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 RAM 403, various programs and data required for the operation of device 400 may also be stored. The computing unit 401, ROM 402, and RAM 403 are connected to each other by a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Various components in device 400 are connected to I/O interface 405, including: an input unit 406 such as a keyboard, a mouse, etc.; 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, etc.; 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.
The computing unit 401 may be a variety of general purpose and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 401 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 401 performs the respective methods and processes described above, such as a quantum computing processing method. For example, in some embodiments, the quantum computing processing method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 408. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 400 via the ROM 402 and/or the communication unit 409. When a computer program is loaded into RAM 403 and executed by computing unit 401, one or more steps of the quantum computing processing method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the quantum computing processing method by any other suitable means (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On 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, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code 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 code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. 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. The 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 portable 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 pointing device (e.g., a mouse or 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 may 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 input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background 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 background, 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 a client and a server. The client and server are typically 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 incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.
Claims (20)
1. A quantum computing processing method, comprising:
acquiring quantum operation information of a quantum circuit, wherein the quantum circuit is used for executing quantum computing tasks;
determining a width of the quantum circuit based on the quantum operation information;
based on the width, a first quantum state of the quantum circuit is determined, the first quantum state comprising: the quantum system identification device comprises M first vectors used for representing M sub-quantum states and M first lists corresponding to the M first vectors one by one, wherein the M sub-quantum states indicate input states of the quantum circuit, and the first lists store quantum system identifications corresponding to the sub-quantum states according to an arrangement sequence represented by the first vectors;
Based on the quantum operation information and the first quantum state, performing quantum operation on the sub-quantum states of the M sub-quantum states to obtain a task result of the quantum computing task;
the quantum operation information includes a first operation instruction, and the executing quantum operation on the sub-quantum states in the M sub-quantum states based on the quantum operation information and the first quantum state, to obtain a task result of the quantum computing task, includes:
determining a first identification list of the quantum system aimed at by the first operation instruction;
screening from the M first vectors based on the first identification list to obtain a first target vector, wherein the first target vector is a first vector corresponding to a first target list in the M first lists, and the first target list has an intersection with the first identification list; m is an integer greater than 1;
performing quantum operation on the quantum system corresponding to the first identification list based on the first operation instruction and the first target vector to obtain a second target vector and a second identification list corresponding to the second target vector;
updating the first quantum state based on the second target vector and the second identification list to obtain a second quantum state, wherein the second quantum state comprises: the quantum circuit comprises N second vectors used for representing N sub-quantum states and N second lists corresponding to the N second vectors one by one, wherein the N sub-quantum states indicate output states of the quantum circuit after the first operation instruction is operated, the second lists store quantum system identifications corresponding to the sub-quantum states according to an arrangement sequence represented by the second vectors, and N is a positive integer;
And determining a task result of the quantum computing task based on the second quantum state.
2. The method of claim 1, wherein the quantum operating the quantum system corresponding to the first identification list based on the first operation instruction and the first target vector, to obtain a second target vector and a second identification list corresponding to the second target vector, includes:
performing front operation of a quantum system on a third target vector based on the first identification list to obtain a fourth target vector, wherein the arrangement sequence of quantum states of a first target quantum system in the fourth target vector is at the first position of the fourth target vector, the relative position of quantum states of a second target quantum system in the third target vector and the relative position of quantum states of the second target quantum system in the fourth target vector are kept unchanged, the first target quantum system is a quantum system corresponding to the first identification list, the second target quantum system comprises quantum systems except for the first target quantum system in the quantum systems corresponding to the first target list, and the third target vector is determined based on the first target vector;
And carrying out quantum operation corresponding to the first operation instruction based on the fourth target vector to obtain a second target vector and a second identification list corresponding to the second target vector.
3. The method of claim 2, wherein the number of first target vectors is at least two, the method further comprising:
performing tensor product operation on at least two first target vectors to obtain a third target vector;
and merging the first target lists corresponding to at least two first target vectors according to the tensor product operation order to obtain a third identification list corresponding to the third target vector.
4. The method of claim 2, wherein the first operation instruction includes an evolution matrix and a first operation type, the first operation type indicates that quantum state evolution operation is performed on a quantum system corresponding to the first identification list based on the evolution matrix, the quantum operation corresponding to the first operation instruction is performed based on the fourth target vector, and a second target vector and a second identification list corresponding to the second target vector are obtained, including:
determining first reorganization parameter information based on the identification number of the first identification list;
Based on the first reorganization parameter information, performing first data reorganization processing on the fourth target vector to obtain a first target matrix;
multiplying the first target matrix with the evolution matrix to obtain an evolution result matrix;
performing second data recombination processing on the evolution result matrix based on second recombination parameter information to obtain the second target vector, wherein the second recombination parameter information is determined based on the length of a third identification list corresponding to the third target vector;
and determining a fourth identification list as a second identification list corresponding to the second target vector, wherein the fourth identification list is obtained by performing front-end operation of a quantum system on the third identification list based on the first identification list.
5. The method of claim 2, wherein the first operation instruction includes a second operation type and a measurement basis vector, the second operation type indicates that quantum measurement operations are performed on the quantum system corresponding to the first identification list based on the measurement basis vector, the quantum operations corresponding to the first operation instruction are performed based on the fourth target vector, and a second target vector and a second identification list corresponding to the second target vector are obtained, including:
Performing third data reorganization on the fourth target vector based on third reorganization parameter information to obtain a second target matrix, wherein the third reorganization parameter information is determined based on the length of a third identification list corresponding to the third target vector;
multiplying the measurement base vector with the second target matrix to obtain a third target matrix;
based on fourth reconfiguration parameter information, fourth data reconfiguration processing is carried out on the third target matrix, and a fifth target vector is obtained;
and determining a second target vector and a second identification list corresponding to the second target vector based on the fifth target vector.
6. The method of claim 5, 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 the fifth target vectors being two, the determining a second target vector and a second identification list corresponding to the second target vector based on the fifth target vector, comprising:
Determining a measurement result as a first probability value of the first measurement result based on a first result vector; and determining a second probability value for a measurement as the second measurement based on a second result vector; the first result vector is the fifth target vector obtained by performing quantum measurement operation based on the first measurement basis vector, and the second result vector is the fifth target vector obtained by performing quantum measurement operation based on the second measurement basis vector;
selecting random numbers based on probability distribution determined by the first probability value and the second probability value to obtain a target measurement result corresponding to the first target quantum system;
and determining a second target vector and a second identification list corresponding to the second target vector based on the target measurement result and the identification number in the first target list.
7. The method of claim 6, wherein the determining a second target vector and a second list of identifications corresponding to the second target vector based on the target measurement and a number of identifications in the first target list comprises at least one of:
under the condition that the number of the identifiers is 1, determining a preset vector corresponding to the target measurement result as a second target vector, and determining the first target list as a second identifier list corresponding to the second target vector;
Under the condition that the number of the identifiers is larger than 1, determining a preset vector corresponding to the target measurement result as a second target vector of a first sub-quantum state, and determining the first identifier list as the second identifier list of the first sub-quantum state; and carrying out normalization processing on the fifth target vector corresponding to the target measurement result to obtain a second target vector of a second sub-quantum state, determining a fifth identification list as the second identification list of the second sub-quantum state, and deleting the list after the first identification list for a fourth identification list by the fifth identification list.
8. The method of claim 1, wherein the first operation instruction includes a third operation type and a reset vector, the third operation type indicates that a quantum system corresponding to the first identification list is subjected to a reset operation based on the reset vector, and the quantum system corresponding to the first identification list is subjected to a quantum operation based on the first operation instruction and the first target vector, so as to obtain a second target vector and a second identification list corresponding to the second target vector, which includes:
under the condition that the number of the identifiers in the first target list is 1, replacing the first target vector with the reset vector to obtain a second target vector;
And determining the first target list as a second identification list corresponding to the second target vector.
9. The method of claim 1, wherein the determining a first quantum state of the quantum circuit based on the width comprises:
determining a target identifier, wherein the target identifier is a quantum system identifier reset by a second operation instruction indication, and the quantum operation information comprises the second operation instruction;
and dividing a quantum system based on the target identifiers and the widths to obtain the first quantum states, wherein the M first lists comprise second target lists, and the second target lists are lists of the target identifiers.
10. A quantum computing processing apparatus, comprising:
the quantum computing device comprises an acquisition module, a quantum computing module and a processing module, wherein the acquisition module is used for acquiring quantum operation information of a quantum circuit, and the quantum circuit is used for executing quantum computing tasks;
a first determining module for determining a width of the quantum circuit based on the quantum operation information;
a second determining module for determining a first quantum state of the quantum circuit based on the width, the first quantum state comprising: the quantum system identification device comprises M first vectors used for representing M sub-quantum states and M first lists corresponding to the M first vectors one by one, wherein the M sub-quantum states indicate input states of the quantum circuit, and the first lists store quantum system identifications corresponding to the sub-quantum states according to an arrangement sequence represented by the first vectors;
The quantum operation module is used for executing quantum operation on the quantum states in the M sub-quantum states based on the quantum operation information and the first quantum state to obtain a task result of the quantum computing task;
the quantum operation information includes a first operation instruction, and the quantum operation module includes:
a first determining submodule, configured to determine a first identification list of a quantum system for which the first operation instruction is directed;
the screening sub-module is used for screening and obtaining a first target vector from the M first vectors based on the first identification list, wherein the first target vector is a first vector corresponding to a first target list in the M first lists, and the first target list and the first identification list have an intersection; m is an integer greater than 1;
the quantum operation sub-module is used for carrying out quantum operation on the quantum system corresponding to the first identification list based on the first operation instruction and the first target vector to obtain a second target vector and a second identification list corresponding to the second target vector;
the updating sub-module is configured to update the first quantum state based on the second target vector and the second identifier list to obtain a second quantum state, where the second quantum state includes: the quantum circuit comprises N second vectors used for representing N sub-quantum states and N second lists corresponding to the N second vectors one by one, wherein the N sub-quantum states indicate output states of the quantum circuit after the first operation instruction is operated, the second lists store quantum system identifications corresponding to the sub-quantum states according to an arrangement sequence represented by the second vectors, and N is a positive integer;
And the second determination submodule is used for determining a task result of the quantum computing task based on the second quantum state.
11. The apparatus of claim 10, wherein the quantum operation submodule comprises:
the front-end operation unit is used for carrying out front-end operation of a quantum system on a third target vector based on the first identification list to obtain a fourth target vector, the arrangement sequence of quantum states of a first target quantum system in the fourth target vector is in the first position, the relative position of the quantum states of a second target quantum system in the third target vector and the relative position of the quantum states of the second target quantum system in the fourth target vector are kept unchanged, the first target quantum system is a quantum system corresponding to the first identification list, the second target quantum system comprises quantum systems except the first target quantum system in the quantum systems corresponding to the first target list, and the third target vector is determined based on the first target vector;
and the quantum operation unit is used for carrying out quantum operation corresponding to the first operation instruction based on the fourth target vector to obtain a second target vector and a second identification list corresponding to the second target vector.
12. The apparatus of claim 11, wherein the number of first target vectors is at least two, the apparatus further comprising:
the tensor product operation module is used for carrying out tensor product operation on at least two first target vectors to obtain the third target vector;
and the merging module is used for merging the first target lists corresponding to at least two first target vectors according to the tensor product operation order to obtain a third identification list corresponding to the third target vector.
13. The apparatus of claim 11, wherein the first operation instruction includes an evolution matrix and a first operation type, the first operation type indicating a quantum state evolution operation of a quantum system corresponding to the first identification list based on the evolution matrix, the quantum operation unit being specifically configured to:
determining first reorganization parameter information based on the identification number of the first identification list;
based on the first reorganization parameter information, performing first data reorganization processing on the fourth target vector to obtain a first target matrix;
multiplying the first target matrix with the evolution matrix to obtain an evolution result matrix;
Performing second data recombination processing on the evolution result matrix based on second recombination parameter information to obtain the second target vector, wherein the second recombination parameter information is determined based on the length of a third identification list corresponding to the third target vector;
and determining a fourth identification list as a second identification list corresponding to the second target vector, wherein the fourth identification list is obtained by performing front-end operation of a quantum system on the third identification list based on the first identification list.
14. The apparatus of claim 11, wherein the first operation instruction includes a second operation type and a measurement basis vector, the second operation type indicating a quantum measurement operation for a quantum system corresponding to the first identification list based on the measurement basis vector; the quantum operation unit is specifically used for:
performing third data reorganization on the fourth target vector based on third reorganization parameter information to obtain a second target matrix, wherein the third reorganization parameter information is determined based on the length of a third identification list corresponding to the third target vector;
multiplying the measurement base vector with the second target matrix to obtain a third target matrix;
Based on fourth reconfiguration parameter information, fourth data reconfiguration processing is carried out on the third target matrix, and a fifth target vector is obtained;
and determining a second target vector and a second identification list corresponding to the second target vector based on the fifth target vector.
15. The apparatus of claim 14, wherein the measurement basis vectors include a first measurement basis vector for performing a quantum measurement operation for a first measurement result and a second measurement basis vector for performing a quantum measurement operation for a second measurement result, the number of the fifth target vectors being two, the quantum operation unit further configured to:
determining a measurement result as a first probability value of the first measurement result based on a first result vector; and determining a second probability value for a measurement as the second measurement based on a second result vector; the first result vector is the fifth target vector obtained by performing quantum measurement operation based on the first measurement basis vector, and the second result vector is the fifth target vector obtained by performing quantum measurement operation based on the second measurement basis vector;
Selecting random numbers based on probability distribution determined by the first probability value and the second probability value to obtain a target measurement result corresponding to the first target quantum system;
and determining a second target vector and a second identification list corresponding to the second target vector based on the target measurement result and the identification number in the first target list.
16. The apparatus of claim 15, wherein the quantum operation unit is further configured to:
under the condition that the number of the identifiers is 1, determining a preset vector corresponding to the target measurement result as a second target vector, and determining the first target list as a second identifier list corresponding to the second target vector;
under the condition that the number of the identifiers is larger than 1, determining a preset vector corresponding to the target measurement result as a second target vector of a first sub-quantum state, and determining the first identifier list as the second identifier list of the first sub-quantum state; and carrying out normalization processing on the fifth target vector corresponding to the target measurement result to obtain a second target vector of a second sub-quantum state, determining a fifth identification list as the second identification list of the second sub-quantum state, and deleting the list after the first identification list for a fourth identification list by the fifth identification list.
17. The apparatus of claim 10, wherein the first operation instruction includes a third operation type and a reset vector, the third operation type indicating a reset operation of a quantum system corresponding to the first list of identifications based on the reset vector, the quantum operation submodule comprising:
a replacing unit, configured to replace the first target vector with the reset vector to obtain a second target vector when the number of identifiers in the first target list is 1;
and the determining unit is used for determining the first target list as a second identification list corresponding to the second target vector.
18. The apparatus of claim 10, wherein the second determining module is specifically configured to:
determining a target identifier, wherein the target identifier is a quantum system identifier reset by a second operation instruction indication, and the quantum operation information comprises the second operation instruction;
and dividing a quantum system based on the target identifiers and the widths to obtain the first quantum states, wherein the M first lists comprise second target lists, and the second target lists are lists of the target identifiers.
19. 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-9.
20. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310158602.9A CN116151383B (en) | 2023-02-20 | 2023-02-20 | Quantum computing processing method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310158602.9A CN116151383B (en) | 2023-02-20 | 2023-02-20 | Quantum computing processing method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116151383A CN116151383A (en) | 2023-05-23 |
CN116151383B true CN116151383B (en) | 2023-10-03 |
Family
ID=86354091
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310158602.9A Active CN116151383B (en) | 2023-02-20 | 2023-02-20 | Quantum computing processing method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116151383B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108154240A (en) * | 2017-12-29 | 2018-06-12 | 合肥本源量子计算科技有限责任公司 | A kind of quantum wire simulation system of low complex degree |
US11373113B1 (en) * | 2021-01-12 | 2022-06-28 | River Lane Research Ltd. | Methods and apparatus for parallel quantum computing |
CN114841352A (en) * | 2022-05-11 | 2022-08-02 | 北京百度网讯科技有限公司 | Quantum calculation processing method and device and electronic equipment |
CN115169568A (en) * | 2022-07-20 | 2022-10-11 | 北京百度网讯科技有限公司 | Quantum calculation processing method and device and electronic equipment |
CN115577792A (en) * | 2022-09-29 | 2023-01-06 | 北京百度网讯科技有限公司 | Information processing method and device based on quantum system |
US11558069B1 (en) * | 2018-09-13 | 2023-01-17 | PsiQuantum Corp. | Conversion of Pauli errors to erasure errors in a photonic quantum computing system |
CN115668232A (en) * | 2020-05-29 | 2023-01-31 | 微软技术许可有限责任公司 | Implementation of N-qubit quantum gates |
-
2023
- 2023-02-20 CN CN202310158602.9A patent/CN116151383B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108154240A (en) * | 2017-12-29 | 2018-06-12 | 合肥本源量子计算科技有限责任公司 | A kind of quantum wire simulation system of low complex degree |
US11558069B1 (en) * | 2018-09-13 | 2023-01-17 | PsiQuantum Corp. | Conversion of Pauli errors to erasure errors in a photonic quantum computing system |
CN115668232A (en) * | 2020-05-29 | 2023-01-31 | 微软技术许可有限责任公司 | Implementation of N-qubit quantum gates |
US11373113B1 (en) * | 2021-01-12 | 2022-06-28 | River Lane Research Ltd. | Methods and apparatus for parallel quantum computing |
CN114841352A (en) * | 2022-05-11 | 2022-08-02 | 北京百度网讯科技有限公司 | Quantum calculation processing method and device and electronic equipment |
CN115169568A (en) * | 2022-07-20 | 2022-10-11 | 北京百度网讯科技有限公司 | Quantum calculation processing method and device and electronic equipment |
CN115577792A (en) * | 2022-09-29 | 2023-01-06 | 北京百度网讯科技有限公司 | Information processing method and device based on quantum system |
Non-Patent Citations (4)
Title |
---|
Quantum NETwork: from theory to practice;Kun Fang et.al;《arXiv:2212.01226v1 [quant-ph] 》;第1-36页 * |
量子稳定子码的码字纠缠;陈小余;;中国科学:物理学 力学 天文学(03);全文 * |
量子计算模拟平台发展综述;魏璐 等;《微电子学与计算机》;第39卷(第11期);第1-10页 * |
陈小余 ; .量子稳定子码的码字纠缠.中国科学:物理学 力学 天文学.2015,(03),全文. * |
Also Published As
Publication number | Publication date |
---|---|
CN116151383A (en) | 2023-05-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7273108B2 (en) | MODEL TRAINING METHOD, APPARATUS, ELECTRONIC DEVICE, STORAGE MEDIUM, PROGRAM | |
CN115169568B (en) | Quantum calculation processing method and device and electronic equipment | |
CN116151384B (en) | Quantum circuit processing method and device and electronic equipment | |
CN113657483A (en) | Model training method, target detection method, device, equipment and storage medium | |
CN116167446B (en) | Quantum computing processing method and device and electronic equipment | |
CN114580645A (en) | Simulation method, device and equipment for random quantum measurement and storage medium | |
CN114693934A (en) | Training method of semantic segmentation model, video semantic segmentation method and device | |
CN114494814A (en) | Attention-based model training method and device and electronic equipment | |
CN114218931A (en) | Information extraction method and device, electronic equipment and readable storage medium | |
WO2009142011A1 (en) | Decision device with minimum power transmission loss system, method, and program | |
US20200210853A1 (en) | Optimization calculation method and information processing apparatus | |
CN116611527B (en) | Quantum circuit processing method and device and electronic equipment | |
CN116151383B (en) | Quantum computing processing method and device and electronic equipment | |
CN116151381B (en) | Quantum circuit processing method and device and electronic equipment | |
CN113642654B (en) | Image feature fusion method and device, electronic equipment and storage medium | |
CN115577787A (en) | Quantum amplitude estimation method, device, equipment and storage medium | |
CN113642319A (en) | Text processing method and device, electronic equipment and storage medium | |
JP5736336B2 (en) | Matrix vector product computing device, matrix vector product computing method, and matrix vector product computing program | |
CN116167447B (en) | Quantum circuit processing method and device and electronic equipment | |
CN116187464B (en) | Blind quantum computing processing method and device and electronic equipment | |
CN112580803B (en) | Model acquisition method, apparatus, electronic device, storage medium, and program product | |
CN116187458B (en) | Quantum circuit processing method and device and electronic equipment | |
CN116362340B (en) | Quantum device performance comparison method and device, electronic device and medium | |
CN117787424A (en) | Quantum circuit processing method and device and electronic equipment | |
CN117313881A (en) | Quantum circuit classification method and device and electronic equipment |
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 | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40088379 Country of ref document: HK |
|
GR01 | Patent grant | ||
GR01 | Patent grant |