Quantum simulator based on subspace mapping table
By using a subspace mapping table to store the index pairs of the qubit gate in a quantum emulator, the problem of redundant computing in traditional quantum emulators is solved, and more efficient quantum computing simulation is achieved.
Patent Information
- Application Number
- CN202411344266.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-25
AI Technical Summary
In quantum computing, as the number of qubits increases, traditional quantum simulators need to operate on each qubit, resulting in redundant computing problems and affecting simulation efficiency.
The quantum emulator based on the subspace mapping table is adopted to store the index pairs of qubits by pre-constructing the mapping table to store the qubit gate, reduce real-time index calculations, and directly process them according to the mapping table, thereby improving the application speed of the qubit gate.
The efficiency of the quantum simulator is improved, the time when the quantum gate calculates the positional relationship of each qubit in the quantum system is reduced, and the simulation efficiency is improved.
Smart Images

Figure CN119250217A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of quantum computing, and more specifically, to a quantum simulator based on a subspace mapping table. Background Art
[0002] Quantum simulators, which rely on high-performance computers to simulate quantum computers, play an important role in quantum technology research such as quantum communication, quantum cryptography, and quantum computing. However, in related technologies, each quantum simulator needs to operate on each quantum bit every time a quantum gate is applied. When a quantum simulator uses a large number of quantum bits, significant redundant computing problems will occur, affecting simulation efficiency. Summary of the invention
[0003] The present application provides a quantum simulator based on a subspace mapping table.
[0004] The embodiment of the present application provides a quantum simulator based on a subspace mapping table, the quantum simulator comprising a quantum gate module, the subspace mapping table being configured to store a pre-built mapping table;
[0005] The quantum gate module is configured to simulate a quantum bit gate and access the mapping table to process the quantum bits in the quantum system according to the index in the mapping table to obtain quantum state data to obtain a simulation result.
[0006] In this way, when processing a quantum system according to a quantum bit gate, compared to the prior art, a quantum simulator can obtain the index pairs that need to be updated when a quantum bit gate acts on a specific quantum bit by querying a pre-built mapping table stored in a subspace mapping table. Therefore, there is no need to operate on each quantum bit, which speeds up the application of quantum bit gates and improves the efficiency of the quantum simulator.
[0007] In some embodiments, the mapping table is obtained by the following steps:
[0008] Calculating an index pair of each quantum bit in a quantum system input to the quantum simulator, the index pair being used to indicate a corresponding relationship between a position of each quantum bit and a position of an affected scalar in a quantum state vector corresponding to the quantum system when performing quantum logic processing;
[0009] The mapping table is constructed according to the index pairs.
[0010] In this way, the quantum simulator calculates the index pair of each quantum bit in the quantum system input to the quantum simulator. The index pair is used to indicate the corresponding relationship between the position of each quantum bit and the position of the affected scalar in the quantum state vector corresponding to the quantum system when performing quantum logic processing. Then, the quantum simulator constructs a mapping table based on the index pair. In this way, a mapping table including the index pairs that need to be updated when the quantum bit gate acts on a specific quantum bit is obtained. When the subsequent quantum gate module processes the quantum bits in the quantum system, it does not need to operate on each quantum bit, which speeds up the application of the quantum bit gate and improves the efficiency of the quantum simulator.
[0011] In certain embodiments, calculating an index pair for each quantum bit in a quantum system input to the quantum simulator comprises:
[0012] Set the initial traversal value, traversal step size and index interval;
[0013] Obtain a temporary index pair according to the initial traversal value, the traversal step, the index interval, the position i corresponding to the quantum bit, and the increment value, wherein i is a positive integer less than n, n is the number of quantum bits in the quantum system, and the increment value is less than or equal to i;
[0014] The mapping table is obtained according to the temporary index pair.
[0015] In this way, the quantum simulator sets the initial traversal value, traversal step size, and index interval. Next, the quantum simulator obtains a temporary index pair based on the initial traversal value, traversal step size, index interval, the position i corresponding to the quantum bit, and the increment value, where i is a positive integer less than n, n is the number of quantum bits in the quantum system, and the increment value is less than or equal to i. Finally, the quantum simulator obtains a mapping table based on the temporary index pair. In this way, the positional relationship between the corresponding quantum state vector positions of each quantum bit in the quantum system is obtained by traversing according to the set relevant parameters.
[0016] In some embodiments, obtaining a temporary index pair according to the initial traversal value, the traversal step size, the index interval, the position i corresponding to the quantum bit, and the increment value comprises:
[0017] A first temporary index in the temporary index pair is obtained according to the initial traversal value, the traversal step size and the increase value.
[0018] In this way, the quantum simulator obtains the first temporary index in the temporary index pair according to the initial traversal value, the traversal step length and the increment value. In this way, the quantum simulator obtains the first temporary index through relevant parameters, and subsequently obtains the second temporary index through the first temporary index and the index interval.
[0019] In some embodiments, obtaining a temporary index pair according to the initial traversal value, the traversal step size, the index interval, the position i corresponding to the quantum bit, and the increment value comprises:
[0020] A second temporary index in the temporary index pair is obtained according to the first temporary index and the index interval.
[0021] In this way, the quantum simulator obtains the first temporary index in the temporary index pair according to the initial traversal value, the traversal step length and the added value. Then the second temporary index in the temporary index pair is obtained according to the first temporary index and the index interval. In this way, the computer obtains the second temporary index through the first temporary index and the index interval. The index table can be obtained according to the first temporary index and the second temporary index, reducing the time for the quantum gate to calculate the position relationship of each quantum bit in the quantum system.
[0022] In some embodiments, obtaining a temporary index pair according to the initial traversal value, the traversal step size, the index interval, the position i corresponding to the quantum bit, and the increment value comprises:
[0023] Obtaining a next traversal value according to the initial traversal value and the traversal step length;
[0024] When the next traversal value is less than or equal to the maximum traversal value, a temporary index pair is obtained according to the next traversal value, the position i corresponding to the quantum bit and the increase value, and the maximum traversal value is determined according to the number of quantum bits in the quantum system.
[0025] In this way, the quantum simulator obtains the next traversal value based on the initial traversal value and the traversal step length. Then, when the next traversal value is less than or equal to the maximum traversal value, the quantum simulator obtains a temporary index pair based on the next traversal value, the position i corresponding to the quantum bit, and the increase value. The maximum traversal value is determined according to the number of quantum bits in the quantum system. In this way, the quantum simulator traverses and calculates the temporary index pair corresponding to the position i corresponding to the quantum bit according to the traversal value and the traversal step length without exceeding the set maximum traversal value, ensuring that the index pair corresponding to each quantum bit is calculated completely.
[0026] In some embodiments, obtaining a temporary index pair according to the initial traversal value, the traversal step size, the index interval, the position i corresponding to the quantum bit, and the increase value includes:
[0027] In a case where the next traversal value is greater than the maximum traversal value, the temporary index pair is confirmed as the index pair.
[0028] In this way, when the next traversal value is greater than the maximum traversal value, the quantum simulator confirms the temporary index pair as the index pair. In this way, when the traversal value is greater than the maximum traversal value, the quantum simulator ends the traversal and uses the calculated temporary index pair as the final index pair, which can be used to reduce the time it takes for the quantum gate to calculate the position relationship for each quantum bit in the quantum system.
[0029] In some embodiments, the quantum simulator further comprises a quantum state vector initialization module;
[0030] The quantum state vector initialization module is configured to use classical computing resources to initialize the quantum system to obtain an initial quantum system, so as to construct the mapping table according to the initial quantum system.
[0031] Thus, the quantum simulator further includes a quantum state vector initialization module. The quantum state vector initialization module is configured to use classical computing resources to initialize the quantum system to obtain an initial quantum system, so as to construct a mapping table according to the initial quantum system. Thus, the quantum state vector initialization module is responsible for using classical computing resources to initialize the quantum system in preparation for constructing the mapping table.
[0032] In certain embodiments, the quantum simulator further comprises a quantum state post-processing module;
[0033] The quantum state post-processing module is configured to process the quantum state data to obtain simulation results.
[0034] Thus, the quantum simulator also includes a quantum state post-processing module. The quantum state post-processing module is configured to process the quantum state data to obtain a simulation result. Thus, the quantum simulator processes the quantum state data through the quantum state post-processing module, and can simulate the operation process of the quantum computer, providing an important tool for the research and development of quantum computing.
[0035] In certain embodiments, the quantum simulator further comprises a storage module;
[0036] The storage module is configured to store the quantum state data and the simulation results.
[0037] Thus, the quantum simulator also includes a storage module. The storage module is configured to store quantum state data and simulation results. In this way, the storage quantum simulator generates a large amount of quantum state data when simulating quantum computing. These data reflect the state of quantum bits at different points in time, and can understand and analyze the quantum computing process. And storing simulation results helps researchers analyze and compare different quantum algorithms, as well as the performance of algorithms under different conditions.
[0038] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0040] Figure 1 It is one of the structural schematic diagrams of the quantum simulator of the implementation mode of the present application;
[0041] Figure 2 It is one of the flow charts of the implementation method of the present application;
[0042] Figure 3 This is the second flow chart of the implementation method of the present application;
[0043] Figure 4 This is the third flow chart of the implementation method of this application;
[0044] Figure 5 This is the fourth flow chart of the implementation method of the present application;
[0045] Figure 6 This is the fifth flow chart of the implementation method of the present application;
[0046] Figure 7 This is the sixth flow chart of the implementation method of this application;
[0047] Figure 8 It is a schematic diagram of the structure of a subspace mapping table in an implementation manner of the present application;
[0048] Fig. 9 This is the second structural schematic diagram of the quantum simulator according to the implementation mode of the present application;
[0049] Fig.10 This is the third structural schematic diagram of the quantum simulator according to the implementation mode of the present application;
[0050] Fig.11 This is the fourth structural schematic diagram of the quantum simulator according to the embodiment of the present application;
[0051] Fig.12 It is a schematic diagram of the overall architecture of the quantum simulator of the implementation mode of the present application. DETAILED DESCRIPTION
[0052] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and cannot be understood as limiting the embodiments of the present application.
[0053] In the absence of actual quantum hardware, quantum simulators that rely on high-performance computers to simulate quantum computers play an important role in quantum technology research, such as quantum communication, quantum cryptography, quantum computing, etc. These quantum simulators usually simulate the effects of quantum gates on quantum states through mathematically complex algorithms such as matrix operations and vector transformations.
[0054] However, as the number of quantum bits increases, the problem of redundant computing has become one of its main challenges. This problem stems from the interconnectedness of each quantum bit. In traditional quantum computing simulations, every time a quantum gate is applied, the entire quantum state vector needs to be updated, causing the simulator to operate on all quantum bits, involving large-scale array operations and complex number calculations, thereby reducing simulation efficiency.
[0055] Based on the above questions, please refer to Figure 1 , the embodiment of the present application provides a quantum simulator 100 based on a subspace mapping table 10, the quantum simulator 100 includes a quantum gate module 20, wherein the subspace mapping table 10 is configured to store a pre-built mapping table;
[0056] The quantum gate module 20 is configured to simulate a quantum bit gate and access a mapping table to process the quantum bits in the quantum system according to the indexes in the mapping table to obtain quantum state data to obtain simulation results.
[0057] Specifically, the quantum simulator 100 is a device or software system that uses classical computer resources to simulate the quantum computing process, and may also be referred to as a quantum computing simulator.
[0058] A quantum system is a microscopic particle system governed by the laws of quantum mechanics, with unique characteristics such as wave-particle duality, quantum superposition, and quantum entanglement. A quantum bit is the basic information unit of quantum computing, similar to a bit in classical computing.
[0059] A mapping table is a data structure used to store mapping information of relevant indexes in a quantum state vector to accelerate the process of quantum gates acting on quantum state vectors. The subspace mapping table 10 optimizes the execution efficiency of quantum gates and reduces computational complexity by precalculating and storing index pairs.
[0060] Quantum logic processing involves changing the state of qubits through the use of quantum gates.
[0061] Quantum logic gates are basic operations on quantum bits, similar to logic gates in classical computing. Each quantum logic gate is represented by a unitary matrix, which can perform specific linear transformations on quantum state vectors to achieve changes in the state of quantum bits. Quantum logic gates can also be referred to as quantum gates.
[0062] The quantum state vector is a mathematical tool used to accurately describe the state of a quantum system. In quantum computing, this vector consists of complex elements, each of which represents the probability amplitude of a quantum state, reflecting the probability of the state appearing in quantum measurement. The quantum state vector is also called the quantum state vector.
[0063] A unitary matrix is a complex square matrix whose inverse is equal to its conjugate transpose. In quantum computing, all quantum gates must be represented by unitary matrices to ensure that the total probability of the quantum state, that is, the sum of the squares of the probability amplitudes, remains 1, satisfying the normalization condition of quantum mechanics.
[0064] Quantum state data is used to represent the current state of quantum bits (qubits).
[0065] In the embodiment of the present application, the quantum simulator 100 stores the pre-built mapping table in the subspace mapping table 10. When the quantum simulator 100 simulates the qubit gate to process the qubits in the quantum system through the quantum gate module 20, the quantum simulator 100 accesses the mapping table stored in the subspace mapping table 10 to obtain the index pair that needs to be updated when the qubit gate acts on a specific qubit. The quantum simulator 100 can eliminate the real-time index calculation through the mapping table, and directly process the qubits in the quantum system according to the index pairs in the mapping table to obtain quantum state data.
[0066] To sum up, when processing a quantum system according to a quantum bit gate, compared with the prior art, the quantum simulator 100 of the embodiment of the present application can obtain the index pair that needs to be updated when the quantum bit gate acts on a specific quantum bit by querying the pre-constructed mapping table stored in the subspace mapping table 10. Therefore, there is no need to operate on each quantum bit, which speeds up the application speed of the quantum bit gate and improves the efficiency of the quantum simulator 100.
[0067] See also Figure 2 In some embodiments, the mapping table is obtained by the following steps:
[0068] 011: Calculate the index pair for each qubit in the quantum system input to the quantum simulator;
[0069] 012: Build a mapping table based on the index pair.
[0070] The present application also provides a computer device, including a memory and a processor. The method of the present application can be implemented by the computer device of the present application. Specifically, a computer program is stored in the memory, and the processor is used to calculate the index pair of each quantum bit in the quantum system input to the quantum simulator. And a mapping table is constructed according to the index pair.
[0071] The embodiment of the present application also provides a mapping table construction device. The information protection method of the embodiment of the present application can be implemented by the mapping table construction device of the embodiment of the present application. Specifically, the mapping table construction device includes a calculation module and an encryption module. The acquisition module is used to calculate the index pair of each quantum bit in the quantum system input to the quantum simulator. The construction module is used to construct a mapping table based on the index pair.
[0072] Specifically, in the embodiment of the present application, the quantum simulator 100 calculates the index pair of each quantum bit in the quantum system input to the quantum simulator 100, and the index pair is used to indicate the corresponding relationship between the position of each quantum bit and the position of the affected scalar in the quantum state vector corresponding to the quantum system when performing quantum logic processing. Then, the quantum simulator 100 constructs a mapping table based on the index pair. By pre-calculating and storing these index pairs, the mapping table can optimize the execution efficiency of quantum gates, reduce computational complexity, and thus improve the performance of quantum computing.
[0073] In this way, the quantum simulator 100 calculates the index pair of each quantum bit in the quantum system input to the quantum simulator 100, and the index pair is used to indicate the corresponding relationship between the position of each quantum bit and the position of the affected scalar in the quantum state vector corresponding to the quantum system when performing quantum logic processing. Then, the quantum simulator 100 constructs a mapping table based on the index pair. In this way, a mapping table including the index pairs that need to be updated when the quantum bit gate acts on a specific quantum bit is obtained. When the subsequent quantum gate module processes the quantum bits in the quantum system, it is not necessary to operate on each quantum bit, which speeds up the application speed of the quantum bit gate and improves the efficiency of the quantum simulator 100.
[0074] See also Figure 3 In some embodiments, step 011 (calculating an index pair for each quantum bit in the quantum system input to the quantum simulator 100) includes:
[0075] 0111: Set the initial traversal value, traversal step size and index interval;
[0076] 0112: Obtain a temporary index pair based on the initial traversal value, traversal step, index interval, position i corresponding to the quantum bit, and the increase value;
[0077] 0113: Get the mapping table based on the temporary index pair.
[0078] In some embodiments, the setting module is used to set the initial traversal value, the traversal step size, and the index interval. The processing module is used to obtain a temporary index pair according to the initial traversal value, the traversal step size, the index interval, the position i corresponding to the quantum bit, and the increase value. The processing module is also used to obtain a mapping table according to the temporary index pair.
[0079] In some embodiments, the processor is further configured to set an initial traversal value, a traversal step length, and an index interval, and obtain a temporary index pair according to the initial traversal value, the traversal step length, the index interval, the position i corresponding to the quantum bit, and the increment value, and obtain a mapping table according to the temporary index pair.
[0080] Specifically, the traversal value can be changed. After the index pair corresponding to the current traversal value is calculated, the traversal value will increase a traversal step on the basis of the original value. The traversal value has a corresponding traversal range. The traversal range of the traversal value is related to the number of quantum bits in the quantum system. When the traversal value exceeds the traversal range, the traversal loop ends, and the position i and index pair of the quantum bit acting on the current quantum gate in the quantum system are stored in the index table. The traversal value is a key parameter used to determine the specific scalar position in the quantum state vector that needs to be updated. Specifically, the traversal value is used to calculate the index that needs to be updated for each quantum bit when applying a quantum gate operation.
[0081] The traversal step length refers to the amount by which the traversal value increases each time during the traversal process. The traversal step length is related to the position i of the quantum bit in the quantum system that the current quantum gate acts on.
[0082] The index interval is used to calculate temporary index pairs. The increment value is also variable and can be used to calculate temporary index pairs.
[0083] The temporary index pairs are index pairs that are not temporarily stored in the mapping table during the calculation process. The temporary index pairs may not have calculated all the index pairs for each quantum bit, and some index pairs are missing.
[0084] In the implementation mode of the present application, the quantum simulator 100 sets the initial traversal value to 0, and calculates the traversal step and index interval by the position i corresponding to the quantum bit. Then, the quantum simulator 100 obtains a temporary index pair according to the initial traversal value, the traversal step, the index interval, the position i corresponding to the quantum bit, and the increase value, where i is a positive integer less than n, n is the number of quantum bits in the quantum system, and the increase value is less than or equal to i. Finally, the quantum simulator 100 obtains a mapping table according to the temporary index pair.
[0085] The following is an example to illustrate the construction of the mapping table of the implementation mode of the present application. For a quantum system with n quantum bits, a quantum system with 32 quantum bits is taken as an example. When the state update of each quantum bit is applied to a single-bit quantum gate, there are two key indexes that need to be calculated.
[0086] After the quantum system is initialized to obtain a quantum state vector of length , the quantum simulator 100 calculates the index pair of each quantum bit in the quantum system input to the quantum simulator 100 as follows:
[0087] The traversal value is m, the initial value of the traversal value m is 0, and the traversal step length is 2 i+1 The range of the traversal value m is 0-2 n , n is the number of quantum bits in the quantum system. The increment value is k, the range of k is 0-i, and i is the position of the quantum bit in the quantum system that the current quantum gate acts on. The index interval is 2 i , i is the position of the quantum bit currently acted upon by the quantum gate in the quantum system.
[0088] In this way, the positional relationship between the corresponding quantum state vector positions of each quantum bit in the quantum system is obtained by traversing according to the set relevant parameters.
[0089] See also Figure 4 In some embodiments, step 0112 (obtaining a temporary index pair according to the initial traversal value, the traversal step size, the index interval, the position i corresponding to the quantum bit, and the increment value) includes:
[0090] 01121: Obtain the first temporary index in the temporary index pair according to the initial traversal value, traversal step size and increment value.
[0091] In some embodiments, the processing module is further configured to obtain a first temporary index in the temporary index pair according to the initial traversal value, the traversal step size, and the increment value.
[0092] In some implementations, the processor is further configured to obtain a first temporary index in the temporary index pair according to the initial traversal value, the traversal step size, and the increment value.
[0093] Specifically, the first temporary index is the first specific position in the temporary index pair in which the quantum gate acts on the quantum bit to affect the quantum state vector.
[0094] The quantum simulator 100 adds the initial traversal value and the corresponding increment value to obtain a plurality of first temporary indexes. After the initial traversal value and the corresponding increment value are processed, the initial traversal value and the traversal step length are added to obtain a new traversal value. In this way, the new traversal value and the corresponding increment value are added to obtain a new first temporary index.
[0095] Continuing with the above example, the value of the first temporary index index1 is equal to the sum of the traversal value m and the increase value k, that is, index1=m+k.
[0096] In this way, the quantum simulator 100 obtains the first temporary index index1 through relevant parameters, and can subsequently obtain the second temporary index index2 through the first temporary index index1 and the index interval.
[0097] See also Figure 5 In some embodiments, step 0112 (obtaining a temporary index pair according to the initial traversal value, the traversal step size, the index interval, the position i corresponding to the quantum bit, and the increment value) includes:
[0098] 01122: Obtain a second temporary index in the temporary index pair according to the first temporary index and the index interval.
[0099] In some implementations, the calculation module is used to obtain a second temporary index in the temporary index pair according to the first temporary index and the index interval.
[0100] In some implementations, the processor is further configured to obtain a second temporary index in the temporary index pair according to the first temporary index and the index interval.
[0101] Specifically, the index interval refers to the interval between the first temporary index and the second temporary index, and the value of the index interval is related to the position i of the quantum bit acting on the current quantum gate in the quantum system. The second temporary index is the second specific position associated with the first specific position in the temporary index pair.
[0102] The quantum simulator 100 adds each obtained first temporary index and the index interval to obtain a second temporary index in the temporary index pair.
[0103] Continuing with the above example, the value of the second temporary index index2 is equal to the first temporary index index1 plus the index interval, that is, index2 = index1 + 2 i .
[0104] In this way, the quantum simulator 100 obtains the first temporary index through the relevant parameters, and obtains the second temporary index through the first temporary index and the index interval. The index table can be obtained according to the first temporary index and the second temporary index, reducing the time for the quantum gate to calculate the position relationship of each quantum bit in the quantum system.
[0105] See also Figure 6 In some embodiments, step 0112 (obtaining a temporary index pair according to the initial traversal value, the traversal step size, the index interval, the position i corresponding to the quantum bit, and the increment value) includes:
[0106] 01123: Get the next traversal value based on the initial traversal value and traversal step length;
[0107] 01124: When the next traversal value is less than or equal to the maximum traversal value, a temporary index pair is obtained according to the next traversal value, the position i corresponding to the quantum bit, and the increase value.
[0108] In some embodiments, the calculation module is used to obtain the next traversal value according to the initial traversal value and the traversal step size. The processing module is also used to obtain a temporary index pair according to the next traversal value, the position i corresponding to the quantum bit, and the increase value when the next traversal value is less than or equal to the maximum traversal value.
[0109] In some embodiments, the processor is further configured to obtain a next traversal value according to the initial traversal value and the traversal step length, and when the next traversal value is less than or equal to the maximum traversal value, obtain a temporary index pair according to the next traversal value, the position i corresponding to the quantum bit, and the increment value.
[0110] Specifically, the maximum traversal value is a condition for determining the end of the traversal loop. The traversal loop ends only when the traversal value is greater than the maximum ratio traversal value.
[0111] The quantum simulator 100 obtains the next traversal value according to the initial traversal value and the traversal step length. Then, before processing the next traversal value, the next traversal value is compared with the maximum ratio traversal value to determine whether the next traversal value is greater than the maximum ratio traversal value. When the next traversal value is less than or equal to the maximum traversal value, the quantum simulator 100 uses the next traversal value as a new traversal value, calculates the index corresponding to the quantum bit, and ensures that the index pair of each quantum bit can be completely calculated. The calculation method is consistent with the above-mentioned embodiment and will not be repeated here.
[0112] Continuing with the above example, when all the increment values k corresponding to the current traversal value m have been processed, the traversal value m and the traversal step length 2 are combined. i+1 Add them together to get the next traversal value m1, and determine whether the next traversal value m1 is still between 0 and 2. 32 If the next iteration value is still between 0-2 32 Within the range, the next traversal value m1 is used as the new traversal value, and is continued to be added to the corresponding increase value to obtain a new temporary index pair.
[0113] In this way, the quantum simulator 100 obtains the temporary index pair corresponding to the position i corresponding to the quantum bit according to the traversal value and the traversal step length without exceeding the set maximum traversal value, ensuring that the index pair corresponding to each quantum bit is calculated completely.
[0114] See also Figure 7In some embodiments, step 0112 (obtaining a temporary index pair according to the initial traversal value, the traversal step size, the index interval, the position i corresponding to the quantum bit, and the increment value) includes:
[0115] 01125: When the next traversal value is greater than the maximum traversal value, the temporary index pair is confirmed as an index pair.
[0116] In some implementations, the processing module is further configured to confirm the temporary index pair as an index pair when the next traversal value is greater than the maximum traversal value.
[0117] In some implementations, the processor is further configured to confirm the temporary index pair as the index pair when the next traversal value is greater than the maximum traversal value.
[0118] Specifically, when the next traversal value is greater than the maximum traversal value, the quantum simulator 100 ends the traversal loop, and confirms all the obtained temporary index pairs as index pairs, and stores the index pairs in the mapping table in the subsequent process.
[0119] Continuing with the above example, if the next iteration value is no longer between 0 and 2 32 Within the range, it means that all specific positions and their associations that will be affected by quantum logic processing of the i-th quantum bit have been found, and the position i of the quantum bit acting on the current quantum gate in the quantum system and the obtained temporary index pair are stored in the mapping table.
[0120] In this way, the quantum simulator 100 ends the traversal when the traversal value is greater than the maximum traversal value, and uses the calculated temporary index pair as the final index pair, which can be used to reduce the time for calculating the position relationship of each quantum bit in the quantum gate system.
[0121] See also Figure 8 , Continuing with the above example, the complete process of the example given in the above implementation mode is described below. For a quantum system with n quantum bits, a quantum system with 32 quantum bits is taken as an example below. When the state update of each quantum bit is applied to a single-bit quantum gate, there are two key indexes to be calculated.
[0122] Initialize the quantum system to get a length of 2 32 After the quantum state vector is obtained, the quantum simulator 100 calculates the index pair of each quantum bit in the quantum system input to the quantum simulator 100 as follows:
[0123] The traversal value m is changing. After the index pair corresponding to the current traversal value is calculated, the traversal value m will increase by a traversal step length of 2 based on the original value. i+1. And the traversal value m has a range. The range of the traversal value m is related to the number of quantum bits n in the quantum system. When the traversal value m exceeds the range, the traversal loop ends, and the position i and index pair of the quantum bit acting on the current quantum gate in the quantum system are stored in the index table. The traversal step length is related to the position i of the quantum bit in the quantum system acted by the current quantum gate. The increase value is also variable. For each traversal value m, the increase value increases from 0 to i, increasing by 1 each time. The index interval refers to the interval between the first temporary index and the second temporary index. The value of the index interval is related to the position i of the quantum bit acting on the current quantum gate in the quantum system.
[0124] For the i-th quantum bit, the indexes that need to be updated are the first temporary index index1 and the second temporary index index2. Set the initial value of the traversal value m to 0, and the range of m is 0-2 n In this example, the range of m is 0-2 32 , each increased traversal step is 2 i+1 The index interval is 2 i The increase value is k, and the range of the increase value k is 0-i.
[0125] For each m, the inner loop iterates from 0 to 2 32 , that is, the range of m is from 0 to 2 32 , each time the traversal step length is increased by 2 i +1 .
[0126] Then index1=m+k,index2=index1+2 i .
[0127] Next, the quantum simulator 100 constructs a mapping table according to the index pair, and the mapping table can be used in the quantum simulator.
[0128] Please refer to Fig. 9 In some embodiments, the quantum simulator 100 further includes a quantum state vector initialization module 30. The quantum state vector initialization module 30 is configured to use classical computing resources to initialize the quantum system to obtain an initial quantum system, the initial quantum system including a quantum state vector, so as to construct a mapping table according to the initial quantum system.
[0129] Specifically, the quantum state vector initialization module 30 (Quantum State Vector Initialization Module) uses classical computing resources to set the initial states of quantum bits, which can be ground states, specific superposition states, or entangled states.
[0130] In the implementation manner of the present application, the quantum state vector initialization module 30 can use classical computing resources to initialize the quantum system to obtain an initial quantum system. By initializing the quantum system, a basis is provided for the simulation of the quantum algorithm, so that the subspace mapping table 10 in the quantum simulator 100 can construct a mapping table according to the initial quantum system.
[0131] In this way, the quantum state vector initialization module 30 is responsible for using classical computing resources to initialize the quantum system in preparation for building the mapping table.
[0132] Please refer to Fig.10 In some embodiments, the quantum simulator 100 further includes a quantum state post-processing module 40 .
[0133] The quantum state post-processing module 40 is configured to process the quantum state data to obtain simulation results.
[0134] Specifically, the quantum state post-processing module 40 is responsible for managing and calculating the probability distribution of the quantum state vector. It processes the quantum state after the quantum gate transformation, ensures that the sum of the squares of the amplitudes is 1, supports measurement operations, and calculates the collapse probability of the quantum bit.
[0135] In the implementation manner of the present application, the quantum state post-processing module 40 can process the quantum state data obtained after being processed by the quantum gate module 20 to obtain a simulation result.
[0136] In this way, the quantum simulator 100 processes the quantum state data through the quantum state post-processing module 40, which can simulate the operation process of the quantum computer and provide an important tool for the research and development of quantum computing.
[0137] Please refer to Fig.11 In some embodiments, the quantum simulator 100 further includes a storage module 50. The storage module 50 is configured to store quantum state data and simulation results.
[0138] Specifically, the storage module 50 is responsible for storing the probability amplitude and phase information of the quantum state, and supports fast access and processing of quantum data. The storage module 50 provides the necessary data storage function for the quantum computing simulator, and supports efficient data management and retrieval. The storage module 50 can store quantum state data and simulation results.
[0139] In this way, the storage module 50 stores a large amount of quantum state data generated by the quantum simulator when simulating quantum computing. These data reflect the state of the quantum bit at different time points, which can understand and analyze the quantum computing process. And store the simulation results, which helps researchers analyze and compare different quantum algorithms, as well as the performance of the algorithms under different conditions.
[0140] See also Fig.12 The overall architecture of the quantum simulator 100 is shown in the figure. The quantum simulator 100 processes the input quantum system (32 quantum bits) as follows. After the input quantum system is input to the quantum simulator 100, first, the quantum state vector initialization module 30 initializes the quantum system and sets each quantum bit in the input quantum system to the initial state |0>, which means that in a length of 2 32 In the complex vector, only the first element is set to 1, which means the probability is 100%, and the rest of the elements are 0. Then, when the initialized input quantum system is acted upon by the quantum bit gate for the first time, the subspace mapping table 10 pre-calculates the index pair corresponding to each quantum bit when it is acted upon by the quantum gate, and stores the calculated index pair in the subspace mapping table 10. Subsequently, when the quantum gate module 20 acts upon the quantum bits in the initialized input quantum system, it directly obtains the quantum state vector to be changed from the subspace mapping table 10 without further complicated calculations. Next, after the quantum gate module 20 has processed the input quantum system, the quantum state post-processing module 40 observes the quantum state vector, and the quantum state post-processing module 40 calculates the probability amplitude of each quantum bit and determines the probability of them collapsing to the ground state |0> or |1>. The measurement module can simulate the quantum measurement process and provide the actual output of each quantum bit state. Finally, all measurement results are stored in the storage module 50 for subsequent data analysis and algorithm performance evaluation that may be required.
[0141] In the description of this specification, the descriptions with reference to the terms "specifically", "further", "particularly", "understandably", etc. are intended to mean that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms are not intended to refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0142] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0143] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A quantum simulator based on a subspace mapping table, characterized in that: The quantum simulator includes a quantum gate module, and the subspace mapping table is configured to store a pre-built mapping table; The quantum gate module is configured to simulate a quantum bit gate and access the mapping table to process the quantum bits in the quantum system according to the index in the mapping table to obtain quantum state data to obtain a simulation result.
2. The quantum simulator according to claim 1, characterized in that The mapping table is obtained by the following steps: Calculating an index pair of each quantum bit in a quantum system input to the quantum simulator, the index pair being used to indicate a corresponding relationship between a position of each quantum bit and a position of an affected scalar in a quantum state vector corresponding to the quantum system when performing quantum logic processing; The mapping table is constructed according to the index pairs.
3. The quantum simulator according to claim 2, characterized in that The computing of an index pair for each quantum bit in a quantum system input to the quantum simulator comprises: Set the initial traversal value, traversal step size and index interval; Obtain a temporary index pair according to the initial traversal value, the traversal step, the index interval, the position i corresponding to the quantum bit, and the increment value, wherein i is a positive integer less than n, n is the number of quantum bits in the quantum system, and the increment value is less than or equal to i; The mapping table is obtained according to the temporary index pair.
4. The quantum simulator according to claim 3, characterized in that The step of obtaining a temporary index pair according to the initial traversal value, the traversal step length, the index interval, the position i corresponding to the quantum bit, and the increase value includes: A first temporary index in the temporary index pair is obtained according to the initial traversal value, the traversal step size and the increase value.
5. The quantum simulator according to claim 4, characterized in that The step of obtaining a temporary index pair according to the initial traversal value, the traversal step length, the index interval, the position i corresponding to the quantum bit, and the increase value includes: A second temporary index in the temporary index pair is obtained according to the first temporary index and the index interval.
6. The quantum simulator according to claim 3, characterized in that The step of obtaining a temporary index pair according to the initial traversal value, the traversal step length, the index interval, the position i corresponding to the quantum bit, and the increase value includes: Obtaining a next traversal value according to the initial traversal value and the traversal step length; When the next traversal value is less than or equal to the maximum traversal value, a temporary index pair is obtained according to the next traversal value, the position i corresponding to the quantum bit and the increase value, and the maximum traversal value is determined according to the number of quantum bits in the quantum system.
7. The quantum simulator according to claim 6, characterized in that The step of obtaining a temporary index pair according to the initial traversal value, the traversal step length, the index interval, the position i corresponding to the quantum bit, and the increase value comprises: In a case where the next traversal value is greater than the maximum traversal value, the temporary index pair is confirmed as the index pair.
8. The quantum simulator according to claim 1, characterized in that The quantum simulator also includes a quantum state vector initialization module; The quantum state vector initialization module is configured to use classical computing resources to initialize the quantum system to obtain an initial quantum system, so as to construct the mapping table according to the initial quantum system.
9. The quantum simulator according to claim 1, characterized in that The quantum simulator also includes a quantum state post-processing module; The quantum state post-processing module is configured to process the quantum state data to obtain the simulation result.
10. The quantum simulator according to claim 9, characterized in that The quantum simulator also includes a storage module; The storage module is configured to store the quantum state data and the simulation results.
Citation Information
Patent Citations
Quantum bit virtual mapping method and system
CN108921296A
Simulation of quantum circuits
CN111247538A
Large-scale quantum circuit simulation method based on cooperation of CPU and GPU
CN114595820A
Gene search BLAST acceleration method and system based on quantum technology
CN117275583A
Photon number measurement simulation method, device, equipment and storage medium
CN117391209A
