Quantum Circuit Simulation Method, Apparatus, and Electronic Device
By representing quantum operations as a matrix form of supercomputer and performing appropriate operation conversion, the problem of low simulation efficiency of quantum circuits under quantum noise is solved, and more efficient calculations and simpler code maintenance are achieved.
Patent Information
- Application Number
- CN202311660692.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2043-12-05
AI Technical Summary
In the prior art, the simulation efficiency of quantum circuits under quantum noise is low, the calculation complexity is high, and the code complexity and maintenance are difficult.
By representing quantum operations as a matrix form of supercomputer and using the acting bits as the target index sequence, the quantum states are subjected to a shift axis operation and matrix shaping operations, which are converted into a standard matrix product problem, thereby reducing the computational complexity.
It improves the efficiency of quantum circuit simulation under quantum noise, reduces the computational complexity and code complexity, and improves maintainability and computing performance.
Smart Images

Figure CN117669751B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of quantum computing technology, in particular to the field of quantum circuit technology, and specifically relates to a quantum circuit simulation method, apparatus, and electronic device. Background Art
[0002] Quantum computing, as a frontier research field in the field of information science, has attracted extensive research interest and investment from the academic and industrial communities. By leveraging characteristics such as quantum superposition and quantum entanglement, it has potential computing speed and information processing capabilities that far exceed the limits of classical computers. However, to realize a quantum computer that can be used in practical applications, numerous technical challenges must be overcome, one of which is to address the problem of quantum noise.
[0003] Therefore, it is crucial to study the simulation of quantum circuits under quantum noise, which can better understand and analyze the impact of quantum noise on computing performance, and at the same time provide important support for improving the reliability and performance of quantum computers. In related technologies, quantum mixed states are usually vectorized, thereby transforming the problems of quantum gates or quantum noise and quantum state calculations into matrix-vector multiplication problems. Summary of the Invention
[0004] The present disclosure provides a quantum circuit simulation method, apparatus, and electronic device.
[0005] According to a first aspect of the present disclosure, there is provided a quantum circuit simulation method, including:
[0006] Obtain the structural information of a quantum circuit, where the quantum circuit includes N quantum operations, the N quantum operations include quantum noise, and N is a positive integer;
[0007] Based on the structural information, obtain the matrix representation of the superoperator of the quantum operations in the quantum circuit and the qubits acted on by the quantum operations;
[0008] For each quantum operation, perform a target operation on the first tensor representation of the first quantum state in the quantum circuit simulation process in the order of the qubits acted on by the quantum operation as the target index, to obtain the matrix representation of the first quantum state, and perform matrix multiplication processing on the matrix representation of the superoperator of the quantum operation and the matrix representation of the first quantum state, to obtain the simulation result of the quantum circuit;
[0009] Wherein, the target operation includes a shift-axis operation and a matrix reshaping operation, the first quantum state is evolved from the initial quantum state of the quantum circuit through quantum operations, and the simulation result is used to determine the task result of the quantum computing task executed by the quantum circuit under quantum noise.
[0010] According to a second aspect of the present disclosure, there is provided a quantum circuit simulation device, including:
[0011] A first acquisition module, configured to acquire the structural information of a quantum circuit, where the quantum circuit includes N quantum operations, the N quantum operations include quantum noise, and N is a positive integer;
[0012] A second acquisition module, configured to acquire the matrix representation of the superoperator of the quantum operation and the acting qubits of the quantum operation in the quantum circuit based on the structural information;
[0013] An operation module, configured to perform a target operation on the first tensor representation of the first quantum state during the simulation process of the quantum circuit in the order of the acting qubits of each quantum operation to obtain the matrix representation of the first quantum state;
[0014] A processing module, configured to perform matrix multiplication processing on the matrix representation of the superoperator of the quantum operation and the matrix representation of the first quantum state to obtain the simulation result of the quantum circuit;
[0015] Wherein, the target operation includes a shift-axis operation and a matrix shaping operation, the first quantum state is evolved from the initial quantum state of the quantum circuit through quantum operations, and the simulation result is used to determine the task result of the quantum computing task executed by the quantum circuit under quantum noise.
[0016] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0017] At least one processor; and
[0018] A memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute any one of the methods in the first aspect.
[0020] According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, and the computer instructions are used to cause a computer to execute any one of the methods in the first aspect.
[0021] According to a fifth aspect of the present disclosure, there is provided a computer program product, including a computer program, and the computer program implements any one of the methods in the first aspect when executed by a processor.
[0022] The technology according to the present disclosure solves the problem that the efficiency of quantum circuit simulation under quantum noise in the related art is relatively low.
[0023] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:
[0025] Figure 1 is a schematic flowchart of a quantum circuit simulation method according to the first embodiment of the present disclosure;
[0026] Figure 2 is a complete schematic flowchart of an exemplary quantum circuit simulation method;
[0027] Figure 3 is a schematic structural diagram of a quantum circuit simulation device according to the second embodiment of the present disclosure;
[0028] Figure 4 is a schematic block diagram of an exemplary electronic device for implementing the embodiments of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0029] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted below.
[0030] First Embodiment
[0031] As Figure 1 shown, the present disclosure provides a quantum circuit simulation method, including the following steps:
[0032] Step S101: Obtain the structural information of the quantum circuit, where the quantum circuit includes N quantum operations, the N quantum operations include quantum noise, and N is a positive integer.
[0033] In this embodiment, the quantum circuit simulation method relates to the field of quantum computing technology, especially the field of quantum circuit technology. It can be widely applied to the scenario of quantum circuit simulation under quantum noise and has potential impacts on the practical applications of quantum computing, such as information security, materials science, pharmaceuticals, and artificial intelligence. The quantum circuit simulation method of the embodiments of the present disclosure can be executed by the quantum circuit simulation device of the embodiments of the present disclosure. The quantum circuit simulation device of the embodiments of the present disclosure can be configured in any electronic device to execute the quantum circuit simulation method of the embodiments of the present disclosure.
[0034] In the related art, quantum circuit simulation under quantum noise based on the density matrix is one of the mainstream methods. This method mainly describes the quantum circuit under quantum noise through the density matrix representation of the quantum mixed state and the Kraus operator sum representation of the quantum noise. Then, the density matrix evolution method is used to simulate the noise effect.
[0035] This method allows for the accurate simulation of quantum circuits under quantum noise. However, its computational complexity is closely related to the number of Kraus operators. Considering an n - qubit quantum circuit and a quantum noise containing L m - qubit Kraus operators, to calculate the result of the action of this quantum noise on the quantum state, L contractions of (m, m) - order tensors and (n, n) - order tensors are required.
[0036] To improve the simulation efficiency, a quantum noise circuit simulation method based on the superoperator representation can be provided. This method vectorizes the quantum mixed state and represents the quantum gate or quantum noise in the form of a superoperator, thus transforming the problem of calculating the quantum gate or quantum noise and the quantum state into a matrix - vector multiplication problem. The specific steps of the quantum noise simulation scheme based on the superoperator representation are as follows:
[0037] Vectorize the initial quantum state and represent the quantum gate and quantum noise in the matrix form of a superoperator;
[0038] Calculate the result of the action of the quantum gate or quantum noise on the quantum state. This process involves matrix - vector multiplication in a non - standard form. The key step is to reverse - deduce the positions of the affected elements in the quantum state vector according to the qubits acted on by the quantum gate or quantum noise, and then calculate the affected vector elements, thereby updating the quantum state after the action;
[0039] Repeatedly execute the above process until all quantum gates and quantum noises are processed to obtain the vector of the final quantum state.
[0040] However, in this method, non - standard form matrix - vector multiplication needs to be performed, and the positions of the affected elements of the quantum state vector need to be reverse - deduced. Since the calculation needs to be performed at discontinuous memory locations, it may lead to cache misses. Therefore, it may result in a slower calculation speed, making the simulation efficiency of the quantum circuit under quantum noise relatively low.
[0041] Moreover, an efficient matrix - vector multiplication function needs to be written by oneself. As the scale of the quantum circuit increases and the types of quantum gates or quantum noises become complex, a large number of matrix - vector multiplication functions need to be written and maintained. This will lead to an increase in code complexity and a decrease in maintainability. Therefore, it increases the complexity of code programming and maintenance, making the performance of the quantum circuit simulation under quantum noise strongly related to the performance of the non - standard form matrix - vector multiplication algorithm.
[0042] Moreover, since it involves non-standard matrix multiplication operations, it is not possible to directly utilize highly optimized matrix multiplication libraries to improve performance, which may lead to performance degradation and pose challenges to performance improvement.
[0043] The purpose of this embodiment is to transform the tensor contraction problem in the quantum circuit simulation process under quantum noise into a standard matrix multiplication problem, thereby improving the computing performance and further enhancing the efficiency of quantum noise circuit simulation.
[0044] The structural information can be the circuit diagram of the quantum circuit or a list of operation instructions for the quantum circuit, and specific limitations are not imposed here. Among them, the structural information can indicate that the quantum circuit includes n qubits and N quantum operations, as well as the arrangement order of the qubits of the n qubits and the N quantum operations, where both n and N are positive integers.
[0045] The N quantum operations include quantum gates and quantum noise, and the N quantum operations of the quantum circuit can be expressed as M k which is a quantum gate or a quantum noise and can be collectively referred to as a quantum operation.
[0046] In addition, for the quantum operation that is quantum noise, in the structural information of the quantum circuit, it can also include the qubits on which the quantum noise acts and the type of the quantum noise, etc.
[0047] The structural information of the quantum circuit generated by the device or input by the user can be obtained, or the structural information of the quantum circuit sent by other devices can be received, and specific limitations are not imposed here.
[0048] Step S102: Based on the structural information, obtain the matrix representation of the superoperator of the quantum operation in the quantum circuit and the qubits on which the quantum operation acts.
[0049] Based on the structural information of the quantum circuit, the indication information of each quantum operation can be obtained. This indication information can include the type of the quantum operation (such as the quantum gate being a CNOT gate) and the qubits on which it acts, etc. Correspondingly, based on the indication information of the quantum operation, the matrix representation of the superoperator of the quantum operation in the quantum circuit and the qubits on which the quantum operation acts can be determined.
[0050] In this step, by using the superoperator representation of the quantum operation, it is represented as a binary tuple of the matrix form of the superoperator and the qubits on which it acts, so that the matrix multiplication isomorphism technique can be used to reduce the complexity of the quantum noise and quantum state tensor contraction calculation.
[0051] In addition, based on the structural information of the quantum circuit, the density matrix of the initial quantum state of the quantum circuit can also be obtained, and the density matrix of the initial quantum state is transformed into a tensor representation.
[0052] Step S103: For each quantum operation, taking the acting qubits of the quantum operation as the target index order, perform target operations on the first tensor representation of the first quantum state during the quantum circuit simulation process to obtain the matrix representation of the first quantum state;
[0053] Step S104: Perform matrix multiplication on the matrix representation of the superoperator of the quantum operation and the matrix representation of the first quantum state to obtain the simulation result of the quantum circuit.
[0054] Among them, the target operations include axis shifting operations and matrix reshaping operations. The first quantum state is evolved from the initial quantum state of the quantum circuit through quantum operations. The simulation result is used to determine the task result of the quantum computing task executed by the quantum circuit under quantum noise. The first quantum state is evolved from the initial quantum state of the quantum circuit through one or more quantum operations. Before obtaining the final quantum state, the intermediate quantum states during the evolution process can all be referred to as the first quantum state.
[0055] In step S103, according to the order of quantum operations in the quantum circuit, for each quantum operation, taking its acting qubits as the target index order, perform axis shifting operations and matrix reshaping operations on the first tensor representation of the first quantum state during the quantum circuit simulation process.
[0056] Among them, the first quantum state can be the quantum state before the evolution of this quantum operation. At the beginning of the evolution of the quantum circuit, the first quantum state is the initial quantum state of the quantum circuit. Under quantum noise, the initial quantum state can be in the tensor form of a high-dimensional quantum pure state, which can be represented by a 2n-order tensor, where n is the number of qubits in the quantum circuit.
[0057] After performing axis shifting operations and matrix reshaping operations on the first tensor representation of the first quantum state for the acting qubits of the current quantum operation, matrix multiplication can be performed based on the matrix representation of the superoperator of the current quantum operation and the matrix representation of the first quantum state to achieve tensor contraction processing of the quantum state and the quantum operation, and update the first quantum state.
[0058] Among them, for the current quantum operation, when steps S103 and S104 are completed, if there are still unprocessed quantum operations in the quantum circuit, steps S103 and S104 are looped until all quantum operations are simulated to obtain the simulation result of the quantum circuit.
[0059] For the current quantum operation M k , obtain the matrix representation S M of its superoperator, and its acting qubits (q 0 ,…,q m-1 ). The matrix representation of the superoperator is shown in the following formula (1).
[0060]
[0061] Taking the operation bits (q 0 , …, q m-1 ) as the target index order, perform tensor shift on the first quantum state, which is represented by the following formula (2).
[0062]
[0063] Among them, in the above formula (2), I is the index remaining among the qubits of the first quantum state except for the operation bits of the current quantum operation.
[0064] Perform a matrix shaping operation on the tensor representation after the shift operation on the first quantum state, as shown in the following formula (3).
[0065]
[0066] Among them, A is the matrix representation of the first quantum state.
[0067] Through the shift operation, the matrix shaping operation, and representing the quantum operation as the matrix representation of a superoperator, the matrix representation of the first quantum state and the matrix representation of the superoperator of the quantum operation can be subjected to matrix multiplication processing. Therefore, the problem of tensor contraction of the quantum state and the quantum operation can be converted into a matrix multiplication problem, that is, perform matrix multiplication processing on the matrix representation of the superoperator of the quantum operation and the matrix representation of the first quantum state to complete the tensor contraction calculation of the quantum state and the quantum operation, and obtain the matrix representation of the updated first quantum state, as shown in the following formula (4).
[0068]
[0069] Among them, A ′ is the matrix representation of the updated first quantum state.
[0070] After that, shape the matrix representation of the updated first quantum state into a tensor form, and perform a shift operation on the tensor representation of the updated first quantum state so as to move its tensor index order to the qubit order of the initial quantum state, so that the first tensor representation of the updated first quantum state can be obtained. In the case where the quantum operation is not completed, the next quantum operation of the quantum circuit can be obtained, and continue the quantum circuit simulation under quantum noise based on the first tensor representation of the updated first quantum state until all the quantum operations of the quantum circuit are completed.
[0071] By converting a quantum operation into the matrix representation of a superoperator, and taking the qubits acted on by the current quantum operation as the target index sequence, a shift operation and a matrix shaping operation are performed on the first tensor representation of the first quantum state to convert it into a matrix representation, so that the matrix representation of the first quantum state and the matrix representation of the superoperator of the current quantum operation can be subjected to matrix multiplication processing. In this way, the tensor contraction of the quantum state and the quantum operation can be converted into the matrix multiplication processing of the matrix representation of the superoperator of the quantum operation and the matrix representation of the first quantum state, thereby utilizing the matrix multiplication isomorphism technique to achieve the tensor contraction calculation of the quantum state and the quantum operation in the quantum circuit simulation process.
[0072] Correspondingly, in the case of obtaining the simulation result of the quantum circuit, quantum state measurement can be performed based on this simulation result to determine the task result of the quantum computing task executed by the quantum circuit under quantum noise, which is more in line with the actual scenario of the execution of the quantum computing task. The quantum computing task can be a task in the field of quantum computing, such as tasks like quantum communication, quantum computing protocols, and quantum key distribution protocols.
[0073] In this embodiment, a quantum gate or quantum noise is represented as a binary tuple of the matrix form of a superoperator and the qubits acted on, and the vectorization of the quantum state is converted into a tensor representation to convert the calculation of the quantum operation and the quantum state into a single tensor contraction process; then, taking the qubits acted on by the quantum operation in the quantum circuit as the target index sequence, a shift operation and a matrix shaping operation are performed on the first tensor representation of the first quantum state in the quantum circuit simulation process to convert it into a matrix representation, so that the matrix representation of the first quantum state and the matrix representation of the superoperator of the current quantum operation are subjected to matrix multiplication processing. In this way, the tensor contraction of the quantum state and the quantum operation can be converted into the matrix multiplication processing of the matrix representation of the superoperator of the quantum operation and the matrix representation of the first quantum state, thereby utilizing the matrix multiplication isomorphism technique to achieve the tensor contraction calculation of the quantum state and the quantum operation in the quantum circuit simulation process, and further reducing the computational complexity, improving the computational efficiency between the quantum operation and the quantum state, and improving the simulation efficiency of the quantum circuit under quantum noise.
[0074] Moreover, it has a high degree of unity for different types of quantum noise and quantum gate calculation methods, and the calculation logic is relatively simple. It is applicable to various calculation methods of quantum states, quantum gates, and quantum noise. The code required for implementation is more concise and the code volume is small, so it has high maintainability, which helps the long-term stability and scalability of the code. In addition, standard matrix multiplication calculation can be adopted, and the core calculation includes standard matrix multiplication calculation. Therefore, it can continuously benefit from the optimization methods of the matrix multiplication algorithm and is also easy to be expanded and improved in the future optimization of the matrix multiplication algorithm to always maintain high efficiency.
[0075] Generally, a quantum gate can be represented by a unitary operator U, and a quantum noise ε can be represented by a set of Kraus operators {E k}. Optionally, the matrix representation of the superoperator of the quantum operation in the quantum circuit is obtained as follows:
[0076] Based on the structural information, obtain the operator representation of the quantum operation in the quantum circuit; in the case where the quantum operation is a quantum gate, the operator representation of the quantum operation is a unitary operator, and in the case where the quantum operation is a quantum noise, the operator representation of the quantum operation is a Kraus operator;
[0077] Based on the operator representation, determine the matrix representation of the superoperator of the quantum operation.
[0078] In this embodiment, the indication information of the quantum operation can be obtained based on the structural information of the quantum circuit, and based on this indication information, the unitary operator U of the quantum gate and the Kraus operator of the quantum noise can be determined.
[0079] The quantum gate and the quantum noise can be initialized and represented in the matrix form of the superoperator. Based on the unitary operator U of the quantum gate, the transformation shown in the following formula (5) is performed on the quantum gate, and based on the Kraus operator of the quantum noise, the transformation shown in the following formula (6) is performed on the quantum noise.
[0080]
[0081]
[0082] where S U is the matrix representation of the superoperator of the quantum gate, S ε is the matrix representation of the superoperator of the quantum noise, represents the complex conjugate of the quantum operation M.
[0083] In this way, the matrix representation of the superoperator of the quantum operation can be obtained simply.
[0084] Optionally, obtaining the simulation result of the quantum circuit includes:
[0085] When the simulation of the quantum operation in the quantum circuit is completed, shape the matrix representation of the quantum state obtained by the matrix product processing into a tensor representation;
[0086] Taking the arrangement order of the qubits in the initial quantum state of the quantum circuit as the target index order, perform a transposition operation on the tensor representation of the quantum state obtained by the matrix product processing to obtain the simulation result.
[0087] In this way, the simulation process of the quantum circuit can be completed, and the determination of the simulation result of the quantum circuit can be realized.
[0088] Optionally, the initial quantum state is in the form of a tensor of quantum pure states, represented by a 2n-order tensor, where n is the number of qubits in the quantum circuit.
[0089] In this embodiment, the initial quantum state density matrix corresponding to the quantum circuit is a 2n-order tensor. By performing the transformation shown in (7) below on the initial quantum state density matrix, a quantum mixed state can be represented in the form of a tensor of high-dimensional quantum pure states.
[0090]
[0091] In this way, the simulation process of the quantum circuit under quantum noise can be simplified.
[0092] Optionally, in the case of evolution under the quantum noise, the obtained first quantum state is in the form of a tensor of a quantum mixed state, and the first tensor representation of the first quantum state is obtained by the following method:
[0093] Taking the initial quantum state as the starting quantum state, perform tensor contraction of the quantum state and the quantum operation based on the 2n-order tensor representation;
[0094] Determine the calculation result of the tensor contraction as the first tensor representation.
[0095] If the initial quantum state is a quantum pure state, after the evolution of the quantum noise, the calculation result of the tensor contraction between its quantum state and the quantum operation will no longer be a quantum pure state but a quantum mixed state, but it is still represented by a 2n-order tensor.
[0096] During the quantum circuit simulation process, the tensor contraction of the quantum state and the quantum operation can be transformed into matrix product processing according to the above matrix product isomorphism technique to obtain the matrix representation of the first quantum state, and then perform matrix reshaping operation to reshape the matrix representation into a tensor form to obtain the first tensor representation. Repeat this process until the simulation result is obtained.
[0097] It should be noted that for a quantum circuit containing quantum noise, whether it is a quantum pure state or a quantum mixed state, tensor contraction can be performed in the same way, that is, taking the acting qubits of the quantum operation as the target index order, performing target operations on the first tensor representation of the first quantum state (which can be a quantum pure state or a quantum mixed state) during the quantum circuit simulation process to obtain the matrix representation of the first quantum state, and performing matrix product processing on the matrix representation of the superoperator of the quantum operation and the matrix representation of the first quantum state. In this way, the simulation method of the quantum circuit is relatively simple and the efficiency is relatively high.
[0098] The following uses a specific example to illustrate in detail the specific process of the quantum circuit simulation method of this embodiment, as Figure 2 shown:
[0099] Step 1: Input a quantum circuit containing n qubits and N quantum operations, where the N quantum operations include quantum noise;
[0100] Step 2: Initialize the initial quantum state density matrix corresponding to the quantum circuit as a tensor form of a high-dimensional quantum pure state, which is a 2n-order tensor;
[0101] Step 3: Initialize quantum gates and quantum noise, represented as the matrix form of superoperators and the binary tuple of acting qubits;
[0102] Step 4: When the quantum operations in the quantum circuit are not all processed, obtain the current quantum operation, and get its matrix representation of the superoperator and the acting qubits;
[0103] Step 5: Perform tensor axis shifting on the quantum state in the order of the acting qubits of the current quantum operation as the target index;
[0104] Step 6: Perform matrix reshaping operations on the quantum state;
[0105] Step 7: Perform a standard matrix product based on the matrix representation of the superoperator of the current quantum operation and the matrix representation of the quantum state to obtain the updated matrix form of the quantum state;
[0106] Step 8: Reshape the updated matrix form of the quantum state into a tensor representation.
[0107] Step 9: Shift the tensor representation of the quantum state so as to move its tensor index order to the qubit order of the initial quantum state;
[0108] Step 10: When all the quantum operations in the quantum circuit are processed, obtain the simulation result of the quantum circuit.
[0109] In this embodiment, first, the quantum mixed state is represented as a tensor form of a high-dimensional quantum pure state, and the quantum gate / quantum noise is represented as the matrix form of a superoperator and the binary tuple of acting qubits; then, the calculation of the quantum gate / quantum noise and the quantum state is transformed into a single tensor contraction process; by introducing the matrix product isomorphism technology, the calculation of the quantum gate / quantum noise and the quantum state is transformed into a standard matrix product calculation to improve the calculation efficiency of the quantum gate / quantum noise and the quantum state, thereby improving the simulation efficiency of the quantum circuit under quantum noise. It is applicable to the simulation of quantum circuits under quantum noise containing arbitrary quantum noise and quantum gates, and has the characteristics of high maintainability and less required code volume.
[0110] Second Embodiment
[0111] As Figure 3 shown, the present disclosure provides a quantum circuit simulation device 300, including:
[0112] The first acquisition module 301 is configured to acquire the structural information of a quantum circuit, where the quantum circuit includes N quantum operations, the N quantum operations include quantum noise, and N is a positive integer;
[0113] The second acquisition module 302 is configured to acquire the matrix representation of the superoperator of the quantum operation and the acting qubits of the quantum operation in the quantum circuit based on the structural information;
[0114] The operation module 303 is configured to perform a target operation on the first tensor representation of the first quantum state during the simulation process of the quantum circuit for each quantum operation in the order of the acting qubits of the quantum operation as the target index, to obtain the matrix representation of the first quantum state;
[0115] The processing module 304 is configured to perform matrix multiplication processing on the matrix representation of the superoperator of the quantum operation and the matrix representation of the first quantum state to obtain the simulation result of the quantum circuit;
[0116] Wherein, the target operation includes a shift-axis operation and a matrix reshaping operation, the first quantum state is obtained by evolving from the initial quantum state of the quantum circuit through the evolution of quantum operations, and the simulation result is used to determine the task result of the quantum computing task executed by the quantum circuit under quantum noise.
[0117] Optionally, the matrix representation of the superoperator of the quantum operation in the quantum circuit is obtained by the following method:
[0118] Based on the structural information, obtain the operator representation of the quantum operation in the quantum circuit; when the quantum operation is a quantum gate, the operator representation of the quantum operation is a unitary operator, and when the quantum operation is quantum noise, the operator representation of the quantum operation is a Kraus operator;
[0119] Based on the operator representation, determine the matrix representation of the superoperator of the quantum operation.
[0120] Optionally, the processing module 304 is further configured to:
[0121] When the simulation of the quantum operation in the quantum circuit is completed, reshape the matrix representation of the quantum state obtained by the matrix multiplication processing into a tensor representation;
[0122] Perform a shift-axis operation on the tensor representation of the quantum state obtained by the matrix multiplication processing in the order of the arrangement of the qubits in the initial quantum state of the quantum circuit as the target index to obtain the simulation result.
[0123] Optionally, the initial quantum state is in the form of a tensor of a quantum pure state and is represented by a 2n-order tensor, where n is the number of qubits in the quantum circuit.
[0124] Optionally, in the case of evolving through the quantum noise, the obtained first quantum state is in the form of a tensor of a quantum mixed state, represented by a 2n-order tensor. The first tensor representation of the first quantum state is obtained by the following method:
[0125] Using the initial quantum state as the starting quantum state, perform tensor contraction of the quantum state and quantum operations based on the 2n-order tensor representation;
[0126] Determine the calculation result of the tensor contraction as the first tensor representation.
[0127] The quantum circuit simulation device 300 provided by the present disclosure can implement each process implemented by the quantum circuit simulation method embodiment and can achieve the same beneficial effects. To avoid repetition, it will not be elaborated here.
[0128] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved are all in compliance with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0129] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0130] Figure 4 A schematic block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0131] As Figure 4 shown, the device 400 includes a computing unit 401, which can execute various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 402 or the computer program loaded from the storage unit 408 into the random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other through a bus 404. The input / output (I / O) interface 405 is also connected to the bus 404.
[0132] Multiple 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, etc.; a storage unit 408, such as a disk, an optical disc, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. Communication unit 409 allows device 400 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0133] Computing unit 401 can be various general-purpose and / or special-purpose processing components with 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 dedicated 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. Computing unit 401 executes the various methods and processes described above, such as the quantum circuit simulation method. For example, in some embodiments, the quantum circuit simulation method can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program can be loaded and / or installed onto device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by computing unit 401, one or more steps of the quantum circuit simulation method described above can be executed. Alternatively, in other embodiments, computing unit 401 can be configured to execute the quantum circuit simulation method in any other suitable manner (e.g., by means of firmware).
[0134] Various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGA), application-specific integrated circuits (ASIC), application-specific standard products (ASSP), systems-on-chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special or general-purpose programmable processor, receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0135] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program codes can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0136] In the context of the present disclosure, a machine-readable medium can 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. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, 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 disk, 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.
[0137] In order to provide interaction with a user, the systems and techniques described herein 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 the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and the input received from the user can be in any form (including acoustic input, voice input, or tactile input).
[0138] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (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 herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
[0139] A computer system can include a client and a server. The client and the server are generally far from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, or a server of a distributed system, or a server incorporating blockchain.
[0140] It should be understood that various forms of the processes shown above can be used, steps can be reordered, added, or deleted. For example, the steps recited in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this is not limited herein.
[0141] The above specific embodiments do not constitute a limitation on the protection scope of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the protection scope of this disclosure.
Claims
1. A quantum circuit simulation method, comprising: Obtaining the structural information of a quantum circuit, where the quantum circuit includes N quantum operations, the N quantum operations include quantum noise, and N is a positive integer; Based on the structural information, obtaining the matrix representation of the superoperator of the quantum operation in the quantum circuit and the qubits acted on by the quantum operation; For each quantum operation, taking the qubits acted on by the quantum operation as the target index order, performing a target operation on the first tensor representation of the first quantum state during the quantum circuit simulation process to obtain the matrix representation of the first quantum state, and performing matrix multiplication processing on the matrix representation of the superoperator of the quantum operation and the matrix representation of the first quantum state to obtain the simulation result of the quantum circuit; wherein the target operation includes a shift-axis operation and a matrix reshaping operation, the first quantum state is obtained through the evolution of the quantum operation starting from the initial quantum state of the quantum circuit, and the simulation result is used to determine the task result of the quantum computing task executed by the quantum circuit under quantum noise; The step of, for each quantum operation, taking the qubits acted on by the quantum operation as the target index order, performing a target operation on the first tensor representation of the first quantum state during the quantum circuit simulation process to obtain the matrix representation of the first quantum state, includes: For each quantum operation, taking the qubits (q 0 , …, q m-1 ) on which the quantum operation acts as the target index order, based on perform tensor axis shifting on the first quantum state; where I is the index remaining among the qubits of the first quantum state except for the qubits on which the current quantum operation acts, and n is the number of qubits in the quantum circuit; Based on performing a matrix shaping operation on the tensor representation after the axis shift operation on the first quantum state; where A is the matrix representation of the first quantum state.
2. The method according to claim 1, wherein, The matrix representation of the superoperator of the quantum operation in the quantum circuit is obtained by the following method: Based on the structural information, obtaining the operator representation of the quantum operation in the quantum circuit; when the quantum operation is a quantum gate, the operator representation of the quantum operation is a unitary operator, and when the quantum operation is quantum noise, the operator representation of the quantum operation is a Kraus operator; Based on the operator representation, determining the matrix representation of the superoperator of the quantum operation.
3. The method according to claim 1, wherein, The step of obtaining the simulation result of the quantum circuit includes: When the simulation of the quantum operation in the quantum circuit is completed, reshaping the matrix representation of the quantum state obtained by the matrix multiplication processing into a tensor representation; Taking the arrangement order of the qubits in the initial quantum state of the quantum circuit as the target index order, performing a shift-axis operation on the tensor representation of the quantum state obtained by the matrix multiplication processing to obtain the simulation result.
4. The method according to claim 1, wherein, The initial quantum state is in the form of a tensor of a quantum pure state, represented by a 2n-order tensor, where n is the number of qubits in the quantum circuit.
5. The method according to claim 4, wherein, Under the evolution of the quantum noise, the obtained first quantum state is in the form of a tensor of a quantum mixed state, represented by a 2n-order tensor, and the first tensor representation of the first quantum state is obtained by the following method: Taking the initial quantum state as the starting quantum state, performing tensor contraction of the quantum state and the quantum operation based on the 2n-order tensor representation; Determining the calculation result of the tensor contraction as the first tensor representation.
6. A quantum circuit simulation device, comprising: A first acquisition module, configured to acquire structure information of a quantum circuit, where the quantum circuit includes N quantum operations, the N quantum operations include quantum noise, and N is a positive integer; A second acquisition module, configured to acquire a matrix representation of a superoperator of a quantum operation and the acting qubits of the quantum operation in the quantum circuit based on the structure information; An operation module, configured to perform a target operation on a first tensor representation of a first quantum state during the simulation process of the quantum circuit in the order of the acting qubits of each quantum operation as a target index sequence, to obtain a matrix representation of the first quantum state; A processing module, configured to perform matrix multiplication processing on the matrix representation of the superoperator of the quantum operation and the matrix representation of the first quantum state, to obtain a simulation result of the quantum circuit; Wherein, the target operation includes a shift-axis operation and a matrix reshaping operation, the first quantum state is evolved from an initial quantum state of the quantum circuit through quantum operations, and the simulation result is used to determine a task result of a quantum computing task executed by the quantum circuit under quantum noise; The operation module is specifically configured to: For each quantum operation, taking the qubits (q 0 , …, q m-1 ) on which the quantum operation acts as the target index order, based on perform tensor axis shifting on the first quantum state; where I is the index remaining among the qubits of the first quantum state except for the qubits on which the current quantum operation acts, and n is the number of qubits in the quantum circuit; Based on Perform a matrix shaping operation on the tensor representation after the shift operation of the first quantum state; where A is the matrix representation of the first quantum state.
7. The apparatus according to claim 6, Wherein, The matrix representation of the superoperator of the quantum operation in the quantum circuit is obtained by the following method: Based on the structure information, obtain an operator representation of the quantum operation in the quantum circuit; when the quantum operation is a quantum gate, the operator representation of the quantum operation is a unitary operator, and when the quantum operation is quantum noise, the operator representation of the quantum operation is a Kraus operator; Based on the operator representation, determine the matrix representation of the superoperator of the quantum operation.
8. The apparatus according to claim 6, Wherein, The tensor contraction module is further configured to: When the simulation of the quantum operation in the quantum circuit is completed, reshape the matrix representation of the quantum state obtained by the matrix multiplication processing into a tensor representation; Perform a shift-axis operation on the tensor representation of the quantum state obtained by the matrix multiplication processing in the order of the arrangement of the qubits in the initial quantum state of the quantum circuit as a target index sequence, to obtain the simulation result.
9. The apparatus according to claim 6, Wherein, The initial quantum state is a tensor form of a pure quantum state, represented by a 2n-order tensor, and n is the number of qubits in the quantum circuit.
10. The apparatus according to claim 9, Wherein, Under the evolution of the quantum noise, the obtained first quantum state is a tensor form of a mixed quantum state, represented by a 2n-order tensor, and the first tensor representation of the first quantum state is obtained by the following method: Taking the initial quantum state as a starting quantum state, performing tensor contraction of the quantum state and the quantum operation based on the 2n-order tensor representation; Determine the calculation result of the tensor contraction as the first tensor representation.
11. An electronic device, Including: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method according to any one of claims 1-5.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein, the computer instructions are used to cause the computer to execute the method according to any one of claims 1-5.
13. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-5.
Citation Information
Patent Citations
Quantum computing processing method and device and electronic equipment
CN116167446A