Quantum circuit sampling method and device
By using the sampling results of adjacent segmented lines to optimize the number of sampling times of quantum lines, the problem of low sampling efficiency of quantum lines in the prior art is solved, and more efficient quantum line sampling is achieved.
Patent Information
- Application Number
- CN202311244831.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-25
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2043-09-25
AI Technical Summary
The prior art uses quantum line splitting technology to perform quantum line sampling, and the efficiency is low, and all segmented lines need to be executed sequentially, resulting in an increase in the number of samples and seriously reducing the line sampling efficiency.
By using the sampling results of the adjacent previous sampled segmented line, the number of samples of the current segmented line to be sampled for different input quantum states under different measurement bases, and the sampling operation is performed according to the determined number of samples to obtain the sampling results of the current segmented line to be sampled.
The number of sampling times is optimized through the sampling results of adjacent segmented lines, reducing the number and time of changing lines, and improving the sampling efficiency of quantum lines.
Smart Images

Figure CN119692491A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of quantum computing technology, and in particular to a sampling method and device for a quantum circuit. Background Art
[0002] Quantum circuit splitting technology is one of the technical means to alleviate the limited number of bits and circuit operating depth of NISQ (Noisy Intermediate Scale Quantum) computers, and has a wide range of applications in optimization problems based on variational algorithms. Specifically, quantum circuit splitting technology first splits large-bit, high-depth quantum circuits into many small-bit, low-depth segmented circuits that NISQ computers can effectively support. This operation requires cutting bits at specific positions.
[0003] There can be multiple cut qubits in the same segmented circuit. Because of the position of the cutting point in the segmented circuit, some cut qubits are the input of the segmented circuit, and some cut qubits are the output of the segmented circuit. Therefore, different names are used to distinguish the cut qubits based on their roles. For a cut qubit, it is necessary to measure the cut qubit in the previous segmented circuit to determine the input of the next segmented circuit. Therefore, the cut qubit used for measurement in the previous segmented circuit can be called a measurement cut bit. In the next segmented circuit, the cut qubit needs to input the determined quantum state. Therefore, the cut qubit used for input in the next segmented circuit can be called an input cut bit. For example, Figure 1 As shown, q1 is a cut quantum bit. For the segmented circuit containing quantum logic gate U1, quantum bit q1 is a measured cut bit. For the segmented circuit containing quantum logic gate U2, quantum bit q1 is an input cut bit.
[0004] After the quantum circuit is split using the circuit splitting technology, in order to obtain a complete sampling result (binary string), it is necessary to sample each segment according to the time evolution order of each segment (and each segment is only sampled once). This is because the input quantum state of the input cut bit of the current segment circuit to be sampled is determined by the measured value of the measured cut bit of the previous segment circuit; therefore, each sampling needs to execute all segment circuits sequentially, and a total of sampling times exponential in the number of cut bits are required; and each segment circuit is usually different, and each execution of a segment requires a circuit replacement for the NISQ computer, which requires a complete design, compilation, transmission and other operations. This method seriously reduces the circuit sampling efficiency.
[0005] Application Contents
[0006] The purpose of this application is to provide a quantum circuit sampling method and device, aiming to improve the sampling efficiency of the split circuit.
[0007] An embodiment of the present application provides a sampling method for a quantum circuit, the method comprising:
[0008] Using the sampling result of the previous adjacent sampled segmented circuit, determine the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases;
[0009] According to the determined sampling times, a sampling operation of the current segmented circuit to be sampled with different input quantum states under different measurement bases is performed to obtain a sampling result of the current segmented circuit to be sampled;
[0010] Based on the target sampling result and the sampling result of the current segmented line to be sampled, a new target sampling result is obtained, wherein the target sampling result is obtained by combining the segmented sampling results of the segmented line that has been sampled currently.
[0011] Optionally, the method of using the sampling result of the previous adjacent sampled segmented circuit to determine the number of sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases includes:
[0012] From the sampling results of the adjacent previous sampled segmented line, respectively obtain the statistical quantity of the corresponding eigenvalues obtained by the target measurement cutting bit under different measurement bases, wherein the target measurement cutting bit is the measurement cutting bit in the adjacent previous sampled segmented line;
[0013] The obtained statistical quantity and the number of measurement cut bits of the current segmented circuit to be sampled are used to respectively calculate the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases.
[0014] Optionally, the method of using the obtained statistical quantity and the number of measurement cut bits of the current segmented circuit to be sampled to respectively calculate the number of sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases includes:
[0015] Calculate the number of measurement modes using the number of measurement cutting bits and the number of measurement bases of the current segmented line to be sampled;
[0016] The obtained statistical quantity is divided by the number of measurement methods respectively to obtain the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases.
[0017] Optionally, when a result of dividing a statistical quantity by the number of measurement modes is an integer, the division result is used as the number of sampling times of the current segmented circuit to be sampled for the corresponding input quantum state under different measurement bases;
[0018] When the result of dividing a statistical quantity by the number of measurement methods is a non-integer, the integer obtained by the division is adjusted based on the remainder to obtain a new value, which is used as the sampling number of the input quantum state corresponding to the current segmented circuit to be sampled under different measurement bases.
[0019] Optionally, the sum of the sampling times of each segmented line under different measurement bases is a preset total sampling amount.
[0020] Optionally, the segmented sampling result is a sampling result corrected by using a measurement error suppression technique.
[0021] Another embodiment of the present application provides a sampling device for a quantum circuit, the device comprising:
[0022] A determination module, used to determine the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases by using the sampling results of the adjacent previous sampled segmented circuit;
[0023] A first obtaining module is used to perform sampling operations on the current to-be-sampled segmented circuit of different input quantum states under different measurement bases according to the determined sampling times, and obtain sampling results of the current to-be-sampled segmented circuit;
[0024] The second obtaining module is used to obtain a new target sampling result based on the target sampling result and the sampling result of the current segmented line to be sampled, wherein the target sampling result is obtained by combining the segmented sampling results of the currently sampled segmented line.
[0025] Yet another embodiment of the present application provides a quantum super-cooperative operating system, which implements sampling of quantum circuits according to the sampling method described in any one of the above items.
[0026] An embodiment of the present application provides a storage medium, in which a computer program is stored, wherein the computer program is configured to implement any of the above-mentioned sampling methods when running.
[0027] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement any of the above-mentioned sampling methods.
[0028] Compared with the prior art, the present application first uses the sampling results of the adjacent previous sampled segmented circuit to determine the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases; then, according to the determined sampling times, the sampling operation of the current segmented circuit to be sampled for different input quantum states under different measurement bases is performed to obtain the sampling results of the current segmented circuit to be sampled; based on the target sampling results and the sampling results of the current segmented circuit to be sampled, a new target sampling result is obtained. The sampling times of the current segmented circuit to be sampled under different measurement bases are determined by the sampling results of the adjacent previous segmented circuit, and sampling is performed based on the determined sampling times. After all the sampling of a segmented circuit is completed, the circuit is replaced to sample the next segmented circuit, rather than replacing the circuit after sampling a segmented circuit once. This greatly reduces the number of times the circuit is replaced, saves the time for replacing the circuit, and thus improves the efficiency of circuit sampling. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 is a schematic diagram of a split quantum circuit provided by the present application;
[0030] Figure 2 It is a network block diagram of a sampling system of a quantum circuit provided in an embodiment of the present application;
[0031] Figure 3 A schematic diagram of a flow chart of a sampling method for a quantum circuit provided in an embodiment of the present application;
[0032] Figure 4 A schematic diagram of a segmented circuit provided in an embodiment of the present application after decomposition;
[0033] Figure 5 A schematic diagram of a decomposed two-segment circuit provided in an embodiment of the present application;
[0034] Figure 6 A schematic diagram of the structure of a sampling device for a quantum circuit provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and should not be construed as limiting the present application.
[0036] Figure 2 1 is a network block diagram of a sampling system of a quantum circuit provided in an embodiment of the present application. The sampling system of the quantum circuit may include a network 110, a server 120, a wireless device 130, a client 140, a storage unit 150, a classical processing system 160, a quantum processing system 170, and may also include additional memories, classical processors, quantum processors, and other devices not shown.
[0037] The network 110 is a medium for providing communication links between various devices and computers connected together in the sampling system of the quantum circuit, including but not limited to the Internet, corporate intranet, local area network, mobile communication network and their combination. The connection method can be wired, wireless communication links or optical fiber cables.
[0038] The server 120 and the client 140 are conventional data processing systems that may contain data and applications or software tools that perform conventional computing processes. The client 140 may be a personal computer or a network computer, so the data may also be provided by the server 120. The wireless device 130 may be a smart phone, a tablet, a laptop, a smart wearable device, etc. The storage unit 150 may include a database 151, which may be configured to store data such as quantum bit parameters, quantum logic gate parameters, quantum circuits, quantum programs, etc.
[0039] The classical processing system 160 (quantum processing system 170) may include a classical processor 161 (quantum processor 171) for processing classical data (quantum data) and a memory 163 (memory 172) for storing classical data (quantum data). The classical data (quantum data) may be a boot file, an operating system image, and an application 162 (application 173). The application 162 (application 173) may be used to implement a quantum algorithm compiled according to the sampling method of the quantum circuit provided in an embodiment of the present application.
[0040] Any data or information stored or generated in the classical processing system 160 (quantum processing system 170) can also be configured to be stored or generated in another classical (quantum) processing system in a similar manner, and any application program executed by it can also be configured to be executed in another classical (quantum) processing system in a similar manner.
[0041] It should be noted that a true quantum computer is a hybrid structure, which includes at least Figure 1 There are two major parts in it: the classical processing system 160, which is responsible for performing classical calculations and control; and the quantum processing system 170, which is responsible for running quantum programs and thus realizing quantum calculations.
[0042] The classical processing system 160 and the quantum processing system 170 may be integrated into one device or distributed in two different devices. For example, the first device including the classical processing system 160 runs a classical computer operating system, on which quantum application development tools and services are provided, as well as storage and network services required for quantum applications. Users develop quantum applications through the quantum application development tools and services thereon, and send quantum programs to the second device including the quantum processing system 170 through the network services thereon. The second device runs a quantum computer operating system, parses the code of the quantum program through the quantum computer operating system, and compiles it into instructions that can be recognized and executed by the quantum computer measurement and control system. The quantum processor 170 implements the quantum algorithm corresponding to the quantum program according to the instructions.
[0043] In the classic processing system 160 based on silicon chips, the unit of the classic processor 161 is a CMOS tube. This computing unit is not limited by time and coherence, that is, this computing unit is not limited by the length of use and is available at any time. In addition, in the silicon chip, the number of such computing units is also sufficient. At present, the number of computing units in a classic processor is tens of thousands. The number of computing units is sufficient and the computing logic that can be selected by the CMOS tube is fixed, for example: AND logic. When calculating with the help of CMOS tubes, a large number of CMOS tubes are combined with limited logic functions to achieve the calculation effect.
[0044] Unlike this logic unit in the classical processing system 160, the basic computing unit of the quantum processor 171 in the quantum processing system 170 is a quantum bit, and the input of the quantum bit is limited by coherence and coherence time, that is, the quantum bit is limited by the use time and is not available at any time. Making full use of the quantum bit within the available use time of the quantum bit is a key problem in quantum computing. In addition, the number of quantum bits in a quantum computer is one of the representative indicators of the performance of a quantum computer. Each quantum bit realizes the computing function through the logical function configured on demand. In view of the limited number of quantum bits, the logical functions in the field of quantum computing are diverse, such as: Hadamard gate (Hadamard gate, H gate), Pauli-X gate (X gate), Pauli-Y gate (Y gate), Pauli-Z gate (Z gate), X gate, RY gate, RZ gate, CNOT gate, CR gate, iSWAP gate, Toffoli gate, etc. In quantum computing, it is necessary to use limited quantum bits combined with a variety of logical functions to achieve the computing effect.
[0045] Based on these differences, the design of the logical function acting on quantum bits (including the design of whether the quantum bits are used or not and the design of the efficiency of the use of each quantum bit) is the key to improving the computing performance of quantum computers and requires special design. The above-mentioned design for quantum bits is a technical problem that ordinary computing devices do not need to consider or face. Based on this, in order to achieve the efficiency of quantum circuit sampling in quantum computing, this application proposes a quantum circuit sampling method and device, which aims to improve the sampling efficiency of quantum circuits.
[0046] See also Figure 3 , Figure 3 A schematic flow chart of a sampling method for a quantum circuit provided in an embodiment of the present application may include the following steps:
[0047] S301: using the sampling result of the previous adjacent sampled segment circuit, determine the sampling times of the current segment circuit to be sampled for different input quantum states under different measurement bases.
[0048] In order to obtain complete measurement results, the measurement basis can be I / X / Y / Z. When quantum circuits are used to achieve different purposes, one or more can be selected from I / X / Y / Z as the measurement basis in the embodiment of the present application. The difference between the input cutting bits corresponding to the measurement basis X / Y / Z is that the input changes from 0, 1 to +, -, i, -i, 0, 1. The eigenvectors of the measurement basis I and the measurement basis Z are the same and can be combined for processing. The segmented circuit of the embodiment of the present application can be obtained by any quantum circuit splitting technology. For example, using spectral clustering technology, etc., the embodiment of the present application samples the split circuit to obtain the sampling result of the original quantum circuit. How the quantum circuit is split does not affect the sampling of the subsequent segmented circuit.
[0049] The quantum circuit is executed according to a certain timing, so the sampling of different segmented circuits also has an order. The sampling timing of the adjacent previous segmented circuit is adjacent to the sampling timing of the current segmented circuit to be sampled, and is in front of the current segmented circuit to be sampled. The adjacent previous segmented circuit and the current segmented circuit to be sampled include at least one identical quantum bit, and the quantum bit is a measurement cutting bit for the adjacent previous segmented circuit and an input cutting bit for the current segmented circuit to be sampled.
[0050] The sampling result of the adjacent previous sampled segmented circuit includes the sampling results of the segmented circuit for different input quantum states under different measurement bases. The sampling results under different measurement bases are counted and the statistical results are processed to obtain the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases.
[0051] In some possible implementations of the present application, the use of the sampling result of the adjacent previous sampled segmented circuit to determine the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases may include:
[0052] From the sampling results of the adjacent previous sampled segmented line, respectively obtain the statistical quantity of the corresponding eigenvalues obtained by the target measurement cutting bit under different measurement bases, wherein the target measurement cutting bit is the measurement cutting bit in the adjacent previous sampled segmented line;
[0053] The obtained statistical quantity and the number of measurement cut bits of the current segmented circuit to be sampled are used to respectively calculate the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases.
[0054] In the embodiment of the present application, the statistical number of eigenvalues obtained by the target measurement cutting bit under different measurement bases is respectively counted. For example, the preset total sampling amount is 200,000 times, and the first segmented line performs cutting bits and samples them 50,000 times under measurement base I. Assuming that the measured results are 00, 01, 00, 11, 01 (the bold indicates the values measured by the measurement cutting bits), under measurement base I, the number of 0s measured by the measurement cutting bits is 20,000 times, and the number of 1s is 30,000 times. Therefore, 20,000 times and 30,000 times are the statistical numbers mentioned here. The eigenvalues obtained under different measurement bases are all 0 or 1, and the statistical number includes the statistical number of 0 or 1 obtained under different measurement bases. If there are 4 measurement bases, the statistical number obtained is 8.
[0055] The number of measurement cutting bits of the current segmented line to be sampled will affect the measurement of the current segmented line to be sampled. The measurement method will increase exponentially with the number of measurement cutting bits. Therefore, the relationship between the statistical quantity and the number of measurement cutting bits can be used to calculate the number of sampling times under different measurement bases.
[0056] In some possible implementations of the present application, the method of using the obtained statistical quantity and the number of measurement cut bits of the current segmented circuit to be sampled to respectively calculate the number of sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases includes:
[0057] Calculate the number of measurement modes using the number of measurement cutting bits and the number of measurement bases of the current segmented line to be sampled;
[0058] The obtained statistical quantity is divided by the number of measurement methods respectively to obtain the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases.
[0059] In the embodiment of the present application, the number of measurement methods = tl , where l is the number of measurement cut bits of the current segmented line to be sampled, and t is the number of measurement bases. For example, when the measurement base is I / X / Y / Z and the number of measurement cut bits is 2, the measurement method is (I / X / Y / Z) direct product (I / X / Y / Z) = 16.
[0060] When a statistical quantity is divided by the number of measurement methods, the number of samplings of the current segmented circuit to be sampled for the same input quantum state under different measurement bases can be obtained. Specifically, the result of the division can be rounded as the sampling number, or the result of the division can be rounded off as the sampling number. Of course, there are other processing methods, as long as the sum of the sampling numbers obtained under different measurement bases is equal to the corresponding statistical quantity or the difference is within a certain range, and the sampling numbers obtained under different measurement bases are not much different.
[0061] In some possible implementations of the present application, when the result of dividing a statistical quantity by the number of measurement modes is an integer, the division result is used as the number of sampling times of the current segmented circuit to be sampled for the corresponding input quantum state under different measurement bases;
[0062] When the result of dividing a statistical quantity by the number of measurement methods is a non-integer, the integer obtained by the division is adjusted based on the remainder to obtain a new value, which is used as the sampling number of the input quantum state corresponding to the current segmented circuit to be sampled under different measurement bases.
[0063] For example, when the number of statistics for the input quantum state of 1 under the measurement basis X is 80,000, and the number of measurement methods is 4, which are I / X / Y / Z respectively, then the number of samplings for the input quantum state of 1 under different measurement bases is 20,000 times respectively. When the number of statistics for the input quantum state of 1 under the measurement basis X is 6850, and the number of measurement methods is 4, which are I / X / Y / Z respectively, then 6850 / 4=1712...2, then the remainder can be allocated to a randomly selected measurement basis, or the remainder can be allocated to the selected measurement basis according to a certain rule, then the number of samplings for the input quantum state of 1 corresponding to the measurement basis I / X / Y / Z can be 1713 times, 1713 times, 1712 times, and 1712 times respectively.
[0064] In some possible implementations of the present application, the sum of the sampling times of each segmented line under different measurement bases is the preset total sampling amount.
[0065] The preset total sampling amount is set according to the actual situation, and the total number of samplings for each segmented line is the preset total sampling amount. The number of samplings for the first segmented line under different measurement bases can be the divisor of the preset total sampling amount and the number of measurement bases. For example, the preset total sampling amount is 1 million, the measurement base is I / X / Y / Z, and the number of samplings under each measurement base is 250,000 times. Of course, there can be other determination methods, but in the initial stage, the number of samplings under different measurement bases is generally set to be the same, otherwise it may affect the sampling of other segmented lines.
[0066] As the quantum circuit is split, the number of sampling times is also split segment by segment, but the total number of sampling times for each segment is the preset total number of sampling times. Figure 1 For example, U1 is the first segment line and U2 is the second segment line; U1 has only measurement cut bits, and U2 has both input cut bits and measurement cut bits. After line splitting, the measurement and preparation channels between U1 and U2 are expanded, where U1 is decomposed into Figure 4 As shown in the figure, there are four measurement channels (measurement basis), and for the four measurement channels IXYZ, the output of the cutting bit is divided into two cases: 0 and 1. The overall decomposition is as follows: Figure 5 Based on Figure 5 It can be seen that under one measurement basis of the cut bit, there are 2 outputs, that is, in the second segment line, the input cut bit has 2 inputs under one measurement basis, and the 2 inputs are sampled under 4 measurement bases after passing through the second segment line.
[0067] S302: According to the determined sampling times, a sampling operation of the current segmented circuit to be sampled with different input quantum states under different measurement bases is performed to obtain a sampling result of the current segmented circuit to be sampled.
[0068] Under a measurement basis, the current segmented circuit to be sampled is sampled a corresponding number of times in an input quantum state. When the sampling operation is completed for different input quantum states under all measurement bases, the sampling result of the current segmented circuit to be sampled can be obtained. The sampling result is a binary segment. In actual operation, the sampling results under a measurement basis can be stored in a table, and the arrangement order can be the time order of sampling. At the same time, the number of different eigenvalues under different measurement bases is counted as a statistical quantity to determine the next sampling number of the current segmented circuit to be sampled under different measurement bases. Using the statistical quantity of the current sampling result, the currently recorded sampling result statistical quantity table is updated, and then the required statistical quantity can be obtained directly from the sampling result statistical quantity table.
[0069] In some possible implementations of the present application, after performing a sampling operation to obtain a sampling result, the sampling result can be corrected using a measurement error suppression technique to obtain a corrected sampling result, so that a more accurate result can be obtained. The measurement error suppression technique may include a readout error suppression technique.
[0070] S303: Obtain a new target sampling result based on the target sampling result and the sampling result of the current segmented line to be sampled, wherein the target sampling result is obtained by combining the segmented sampling results of the segmented line that has been sampled currently.
[0071] The new target sampling result is obtained by recombining the current target sampling result and the sampling result of the current segmented line to be sampled according to the order of quantum bits. In actual operation, the sampling results of the segmented line are stored in different tables according to different measurement bases, and the elements in these tables are merged into the table corresponding to the target sampling result according to different measurement bases. Specifically, they are contracted into the current target sampling result according to the order of quantum bits.
[0072] After recombining the target sampling result with the sampling result of the last segmented circuit, the sampling result of the original quantum circuit (unsplit quantum circuit) can be obtained. When the sampling result of the cut bit is removed during the final recombination, the final sampling result of the original quantum circuit can be obtained. Figure 1 The quantum circuit shown in the figure takes the measurement basis of I as an example to illustrate the reorganization of the sampling results. Assuming that the total number of sampling times is 5 times (the number of sampling times is generally large in actual applications), the first segmented circuit performs the cutting bit measurement 5 times under I, and assuming that the measured results are 00, 01, 00, 11, 01 (the bold indicates the values sampled by the cutting bits), the number of 0s obtained by the cutting bit sampling is 2, and the number of 1s obtained by the sampling is 3; at this time, according to whether the sampling result of the cutting bit in the first segmented circuit is 0 or 1, the above results can be rearranged to 00, 00, 01, 11, 01 (target sampling result). Then the second segment line needs to input 0 at the input cutting bit and perform 2 samplings, and input 1 for 3 samplings. Assume that the sampling results are 10 / 11 when 0 is input, and 00 / 11 / 11 when 1 is input. The results of these two segments are reorganized one by one in the order of front and back to 0010, 0011, 0100, 1111, 0111. If the second segment line is not the last segment line, the reorganization result is the new target sampling result. If the second segment line is the last segment line, since the cutting bit (the value marked in bold) is only an intermediate process and not the final high output, the final sampling result is 010, 011, 000, 111, 011.
[0073] Assuming that the number of segmented lines is p and the total number of cut bits is m, when the measurement basis is I / X / Y / Z, using the method provided by the prior art, the total number of line changes is O(p·2 4m / ε 2 ), where ε is the accuracy to be achieved. The total number of line changes in the embodiment of the present application can be reduced to O(2·4·4p), where 2 means there are two choices for any measurement base input, and the two 4s represent the previous segment respectively. 4m / ε 2 By transferring to continuous sampling in the same segment, not only an exponential reduction in the number of times the quantum circuit is replaced is achieved, but also an exponential reduction in output accuracy is achieved.
[0074] It can be seen that the present application first uses the sampling results of the adjacent previous sampled segmented circuit to determine the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases; then, according to the determined sampling times, the sampling operation of the current segmented circuit to be sampled for different input quantum states under different measurement bases is performed to obtain the sampling results of the current segmented circuit to be sampled; based on the target sampling results and the sampling results of the current segmented circuit to be sampled, a new target sampling result is obtained. The sampling times of the current segmented circuit to be sampled under different measurement bases are determined by the sampling results of the adjacent previous segmented circuit, and sampling is performed based on the determined sampling times. All sampling of a segmented circuit is completed before the circuit is changed to sample the next segmented circuit, rather than changing the circuit after sampling a segmented circuit once. This greatly reduces the number of times the circuit is changed, saves the time for changing the circuit, and thus improves the efficiency of circuit sampling.
[0075] See also Figure 6 , Figure 6 A schematic diagram of a sampling device for a quantum circuit provided in an embodiment of the present application, and Figure 3 Corresponding to the process shown, the device includes:
[0076] A determination module 601 is used to determine the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases by using the sampling results of the adjacent previous sampled segmented circuit;
[0077] A first obtaining module 602 is used to perform sampling operations on the current to-be-sampled segmented circuit of different input quantum states under different measurement bases according to the determined sampling times, and obtain sampling results of the current to-be-sampled segmented circuit;
[0078] The second obtaining module 603 is used to obtain a new target sampling result based on the target sampling result and the sampling result of the current segmented line to be sampled, wherein the target sampling result is obtained by combining the segmented sampling results of the currently sampled segmented line.
[0079] In some possible implementations of the present application, the first obtaining module 602 may include:
[0080] An obtaining unit, used to obtain the statistical quantity of the corresponding eigenvalues obtained by the target measurement cutting bit under different measurement bases from the sampling result of the adjacent previous sampled segmented line, wherein the target measurement cutting bit is the measurement cutting bit in the adjacent previous sampled segmented line;
[0081] The calculation unit is used to calculate the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases by using the obtained statistical quantity and the number of measurement cutting bits of the current segmented circuit to be sampled.
[0082] In some possible implementations of the present application, the computing unit may be specifically used for:
[0083] Calculate the number of measurement modes using the number of measurement cutting bits and the number of measurement bases of the current segmented line to be sampled;
[0084] The obtained statistical quantity is divided by the number of measurement methods respectively to obtain the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases.
[0085] In some possible implementations of the present application, when the result of dividing a statistical quantity by the number of measurement modes is an integer, the division result is used as the number of sampling times of the current segmented circuit to be sampled for the corresponding input quantum state under different measurement bases;
[0086] When the result of dividing a statistical quantity by the number of measurement methods is a non-integer, the integer obtained by the division is adjusted based on the remainder to obtain a new value, which is used as the sampling number of the input quantum state corresponding to the current segmented circuit to be sampled under different measurement bases.
[0087] In some possible implementations of the present application, the sum of the sampling times of each segmented line under different measurement bases may be a preset total sampling amount.
[0088] In some possible implementations of the present application, the segmented sampling results may be sampling results corrected using a measurement error suppression technique.
[0089] It can be seen that the present application first uses the sampling results of the adjacent previous sampled segmented circuit to determine the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases; then, according to the determined sampling times, the sampling operation of the current segmented circuit to be sampled for different input quantum states under different measurement bases is performed to obtain the sampling results of the current segmented circuit to be sampled; based on the target sampling results and the sampling results of the current segmented circuit to be sampled, a new target sampling result is obtained. The sampling times of the current segmented circuit to be sampled under different measurement bases are determined by the sampling results of the adjacent previous segmented circuit, and sampling is performed based on the determined sampling times. All sampling of a segmented circuit is completed before the circuit is changed to sample the next segmented circuit, rather than changing the circuit after sampling a segmented circuit once. This greatly reduces the number of times the circuit is changed, saves the time for changing the circuit, and thus improves the efficiency of circuit sampling.
[0090] An embodiment of the present application also provides a quantum-super cooperative operating system, which runs on a quantum computer including a quantum processor and / or a supercomputer including a classical processor, and is used to implement sampling of quantum circuits according to the sampling method described in the method side embodiment of the present application.
[0091] An embodiment of the present application further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to implement the steps of any of the above method embodiments when executed.
[0092] Specifically, in this embodiment, the above storage medium may be configured to store a computer program for implementing the following steps:
[0093] S301: using the sampling result of the adjacent previous sampled segment circuit, determining the sampling times of the current segment circuit to be sampled for different input quantum states under different measurement bases;
[0094] S302: performing sampling operations on the current segmented circuit to be sampled with different input quantum states under different measurement bases according to the determined sampling times, and obtaining sampling results of the current segmented circuit to be sampled;
[0095] S303: Obtain a new target sampling result based on the target sampling result and the sampling result of the current segmented line to be sampled, wherein the target sampling result is obtained by combining the segmented sampling results of the segmented line that has been sampled currently.
[0096] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement the steps in any one of the above method embodiments.
[0097] Specifically, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0098] Specifically, in this embodiment, the processor may be configured to implement the following steps through a computer program:
[0099] S301: using the sampling result of the adjacent previous sampled segment circuit, determining the sampling times of the current segment circuit to be sampled for different input quantum states under different measurement bases;
[0100] S302: performing sampling operations on the current segmented circuit to be sampled with different input quantum states under different measurement bases according to the determined sampling times, and obtaining sampling results of the current segmented circuit to be sampled;
[0101] S303: Obtain a new target sampling result based on the target sampling result and the sampling result of the current segmented line to be sampled, wherein the target sampling result is obtained by combining the segmented sampling results of the segmented line that has been sampled currently.
[0102] An embodiment of the present application further provides a computer program product comprising instructions, which, when executed by a computer, enables the computer to perform the sampling of the quantum circuit in any of the above embodiments.
[0103] It can be understood that in the various implementations of this specification, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the implementation methods of this specification.
[0104] It can be understood that the various embodiments described in this specification can be implemented individually or in combination, and the embodiments of this specification are not limited to this.
[0105] Unless otherwise specified, all technical and scientific terms used in the embodiments of this specification have the same meaning as those generally understood by those skilled in the art of the technical field of this specification. The terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the scope of this specification. The term "and / or" used in this specification includes any and all combinations of one or more related listed items. The singular forms of "a", "above", and "the" used in the embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0106] It can be understood that the processor of the embodiment of this specification can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method implementation can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiment of this specification can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of this specification can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0107] It is understood that the memory in the embodiments of this specification may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (programmable ROM, PROM), an erasable programmable read-only memory (erasablePROM, EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The volatile memory may be a random access memory (RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0108] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this specification.
[0109] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method implementation methods and will not be repeated here.
[0110] In the several embodiments provided in this specification, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0111] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0112] In addition, each functional unit in each embodiment of the present specification may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0113] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this specification, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of this specification. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0114] The above is only a specific implementation of this specification, but the protection scope of this application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in this specification, which should be included in the protection scope of this specification. Therefore, the protection scope of this application should be based on the protection scope of the claims.
Claims
1. A sampling method for a quantum circuit, characterized in that: The method comprises: Using the sampling result of the previous adjacent sampled segmented circuit, determine the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases; According to the determined sampling times, a sampling operation of the current segmented circuit to be sampled with different input quantum states under different measurement bases is performed to obtain a sampling result of the current segmented circuit to be sampled; Based on the target sampling result and the sampling result of the current segmented line to be sampled, a new target sampling result is obtained, wherein the target sampling result is obtained by combining the segmented sampling results of the segmented line that has been sampled currently.
2. The sampling method according to claim 1, characterized in that: The method of using the sampling result of the previous adjacent sampled segmented circuit to determine the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases includes: From the sampling results of the adjacent previous sampled segmented line, respectively obtain the statistical quantity of the corresponding eigenvalues obtained by the target measurement cutting bit under different measurement bases, wherein the target measurement cutting bit is the measurement cutting bit in the adjacent previous sampled segmented line; The obtained statistical quantity and the number of measurement cut bits of the current segmented circuit to be sampled are used to respectively calculate the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases.
3. The sampling method according to claim 2, characterized in that: The method uses the obtained statistical quantity and the number of measurement cut bits of the current segmented circuit to be sampled to respectively calculate the number of sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases, including: Calculate the number of measurement modes using the number of measurement cutting bits and the number of measurement bases of the current segmented line to be sampled; The obtained statistical quantity is divided by the number of measurement methods respectively to obtain the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases.
4. The sampling method according to claim 3, characterized in that: When the result of dividing a statistical quantity by the number of measurement modes is an integer, the division result is used as the number of sampling times of the current segmented circuit to be sampled for the corresponding input quantum state under different measurement bases; When the result of dividing a statistical quantity by the number of measurement methods is a non-integer, the integer obtained by the division is adjusted based on the remainder to obtain a new value, which is used as the sampling number of the input quantum state corresponding to the current segmented circuit to be sampled under different measurement bases.
5. The sampling method according to claim 4, characterized in that: The sum of the sampling times of each segmented line under different measurement bases is the preset total sampling amount.
6. The sampling method according to any one of claims 1 to 5, characterized in that: The segmented sampling results are sampling results corrected using measurement error suppression technology.
7. A sampling device for a quantum circuit, characterized in that: The device comprises: A determination module, used to determine the sampling times of the current segmented circuit to be sampled for different input quantum states under different measurement bases by using the sampling results of the adjacent previous sampled segmented circuit; A first obtaining module is used to perform sampling operations on the current segmented circuit to be sampled with different input quantum states under different measurement bases according to the determined sampling times, and obtain sampling results of the current segmented circuit to be sampled; The second obtaining module is used to obtain a new target sampling result based on the target sampling result and the sampling result of the current segmented line to be sampled, wherein the target sampling result is obtained by combining the segmented sampling results of the currently sampled segmented line.
8. A quantitative super-cooperative operating system, characterized in that: The quantum super cooperative operation system implements the sampling of quantum circuits according to the sampling method described in any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to implement the sampling method according to any one of claims 1 to 6 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to implement the sampling method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Multi-quantum-bit quantum Fourier transform line-oriented segmentation method
CN114529003A
Method and device for measuring quantum state of sub-quantum circuit and quantum computer operating system
CN115423109A
Quantum computing task processing method and device and quantum computer operating system
CN115511089A
Quantum circuit execution result determination method and device and quantum computer operating system
CN115511094A
Quantum circuit processing method and device and quantum computer operating system
CN115730669A
Cited By
Optimization method for quantum circuit sampling
CN120317392A
Optimization Methods for Quantum Circuit Sampling
CN120317392B