Method, device, electronic device and storage medium for obtaining quantum final state vector

By splitting the quantum final state vector acquisition process as an independent step and using multi-threading to perform in parallel, the problem of low efficiency in obtaining quantum final state vectors in optical quantum computing is solved, and the computing performance is significantly improved.

CN117391205BActive Publication Date: 2025-05-09BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311327421.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-13
Publication Date
2025-05-09
Estimated Expiration
2043-10-13

AI Technical Summary

Technical Problem

In the process of optical quantum computing, it is difficult for the prior art to efficiently acquire quantum final state vectors, which affects the performance of optical quantum computing.

Method used

By determining the quantum quantum mode number N and the truncation number C of the quantum, obtain the photon combination of the truncation number C, sort the elements to determine the vector, determine the position index sequence based on the number of quantum modes and the number of elements, and finally determine the list of final state vectors.

Benefits of technology

The acquisition process of the quantum final state vector is split into independent steps, so that it can be executed in parallel with multiple threads, reducing the time-consuming and improving efficiency in obtaining the quantum final state vector.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117391205B_ABST
    Figure CN117391205B_ABST
Patent Text Reader

Abstract

The present disclosure proposes a method, device, electronic device and storage medium for obtaining a quantum final state vector, which relates to the field of computer technology, and in particular to the technical fields such as quantum computing. The specific implementation scheme is: determine the number of quantum modes N and the truncation number C of the quantum; obtain the photon combination whose sum is the truncation number C; sort the elements in each photon combination to determine all vectors corresponding to each photon combination; based on the number of quantum modes N and the number of elements L contained in each photon combination, determine all position index sequences corresponding to each photon combination; based on each position index sequence and vector corresponding to each photon combination, determine the final state vector list. In this way, the list of quantum final state vectors can be determined without performing a complex data traversal process, which reduces the complexity and time consumption of obtaining the quantum final state vector and improves efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, in particular to technical fields such as quantum computing, and specifically to a method, device, electronic device and storage medium for obtaining a quantum final state vector. Background Art

[0002] In the process of optical quantum computing, obtaining the final state vector of the quantum state is an important step. The performance of optical quantum computing can be improved through more efficient acquisition methods. Summary of the invention

[0003] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.

[0004] According to a first aspect of the present disclosure, a method for obtaining a quantum final state vector is provided, comprising:

[0005] Determine the quantum mode number N and cutoff number C of the quantum;

[0006] Obtaining photon combinations whose sum is the cutoff number C, wherein the element value in each of the photon combinations is greater than 0;

[0007] Sorting the elements in each of the photon combinations to determine all vectors corresponding to each of the photon combinations;

[0008] Based on the number N of quantum modes and the number L of elements contained in each of the photon combinations, all position index sequences corresponding to each of the photon combinations are determined, wherein each of the position index sequences contains L position indexes;

[0009] Based on each position index sequence and vector corresponding to each of the photon combinations, a final state vector list is determined.

[0010] According to a second aspect of the present disclosure, a device for obtaining a quantum final state vector is provided, comprising:

[0011] A first determination module is used to determine the quantum mode number N and the truncation number C of the quantum;

[0012] A first acquisition module is used to acquire photon combinations whose sum is the cutoff number C, wherein the element value in each photon combination is greater than 0;

[0013] A second determination module is used to sort the elements in each of the photon combinations to determine all vectors corresponding to each of the photon combinations;

[0014] A third determination module is used to determine all position index sequences corresponding to each photon combination based on the number N of quantum modes and the number L of elements contained in each photon combination, wherein each position index sequence contains L position indexes;

[0015] The fourth determination module is used to determine a final state vector list based on each position index sequence and vector corresponding to each of the photon combinations.

[0016] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0017] at least one processor; and

[0018] a memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for obtaining the quantum final state vector as described in the first aspect.

[0020] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method for obtaining a quantum final state vector as described in the first aspect.

[0021] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising computer instructions, which, when executed by a processor, implement the steps of the method for obtaining a quantum final state vector as described in the first aspect.

[0022] The method, device, electronic device and storage medium for obtaining a quantum final state vector provided by the present disclosure have the following beneficial effects:

[0023] In the present disclosure, the quantum mode number N and the truncation number C of the quantum are first determined, and then the photon combination whose sum is the truncation number C is obtained, and then the elements in each photon combination are sorted to determine all vectors corresponding to each photon combination, and then based on the quantum mode number N and the number of elements L contained in each photon combination, all position index sequences corresponding to each photon combination are determined, and finally, based on each position index sequence and vector corresponding to each photon combination, the final state vector list is determined. Thus, based on the quantum mode number N and the truncation number C, the process of obtaining the quantum final state vector is decoupled into multiple independent steps, so that the process of obtaining the quantum final state vector can be executed in parallel by multiple threads, which reduces the time consumption of obtaining the quantum final state vector and improves efficiency.

[0024] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, which are used to better understand the present solution and do not constitute a limitation of the present disclosure, wherein:

[0026] Figure 1 is a flow chart of a method for obtaining a quantum final state vector according to an embodiment of the present disclosure;

[0027] Figure 2 is a flow chart of a method for obtaining a quantum final state vector according to another embodiment of the present disclosure;

[0028] Figure 3 It is a structural schematic diagram of a photon combination decision tree provided by the present disclosure;

[0029] Figure 4 is a flow chart of a method for obtaining a quantum final state vector according to another embodiment of the present disclosure;

[0030] Figure 5 is a schematic diagram of a process of traversing a first vector provided by the present disclosure;

[0031] Figure 6 is a schematic diagram of the structure of a device for obtaining a quantum final state vector according to an embodiment of the present disclosure;

[0032] Figure 7 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0033] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0034] The embodiments of the present disclosure relate to technical fields such as quantum computing.

[0035] Quantum computing is a new computing model that follows the laws of quantum mechanics to control quantum information units for computing. Compared with traditional general-purpose computers, its theoretical model is a universal Turing machine; the theoretical model of a general-purpose quantum computer is a universal Turing machine reinterpreted using the laws of quantum mechanics. From the perspective of computable problems, quantum computers can only solve problems that traditional computers can solve, but in terms of computing efficiency, due to the existence of quantum mechanics superposition, some known quantum algorithms are faster than traditional general-purpose computers in processing problems. The following describes the method, device, electronic device and storage medium for obtaining the quantum final state vector of the embodiments of the present disclosure with reference to the accompanying drawings.

[0036] It should be noted that the execution subject of the method for obtaining the quantum final state vector of this embodiment is a device for obtaining the quantum final state vector, which can be implemented by software and / or hardware, and can be configured in an electronic device, which may include but is not limited to a terminal, a server, etc. In the embodiment of the present disclosure, the device for obtaining the quantum final state vector is configured in a system for obtaining the quantum final state vector as an example for explanation.

[0037] The method for obtaining a quantum final state vector proposed in an embodiment of the present disclosure includes: determining the number N of quantum modes and the truncation number C of a quantum; obtaining a photon combination whose sum is the truncation number C, wherein the element values ​​in each photon combination are greater than 0; sorting the elements in each photon combination to determine all vectors corresponding to each photon combination; based on the number N of quantum modes and the number L of elements contained in each of the photon combinations, determining all position index sequences corresponding to each photon combination, wherein each position index sequence contains L position indexes; and determining a final state vector list based on each position index sequence and vector corresponding to each photon combination.

[0038] In the disclosed embodiment, the process of determining the quantum final state vector is split into the following steps: determining a photon combination whose sum is a cutoff number C, sorting the elements in the photon combination, and determining the position index sequence corresponding to each photon combination. Thus, the quantum final state vector can be obtained without performing C+1 photon number traversal processes for each element in the quantum final state vector, which greatly reduces the complexity and time consumption of the process of obtaining the quantum modal vector and improves efficiency.

[0039] It is understandable that in the process of optical quantum computing, after obtaining the quantum final state vector, the probability distribution of the quantum can be determined by combining the quantum initial state vector. Therefore, by adopting the method for obtaining the quantum final state vector provided by the present disclosure, the complexity and time consumption of the process of obtaining the quantum final state vector are reduced, and the time consumption of the optical quantum computing process is also reduced, thereby improving the efficiency of optical quantum computing.

[0040] The method for obtaining the quantum final state vector provided by the present disclosure is further described below in conjunction with the following embodiments of the figures.

[0041] Figure 1 It is a flowchart of a method for obtaining a quantum final state vector according to an embodiment of the present disclosure.

[0042] like Figure 1 As shown, the method for obtaining the quantum final state vector includes:

[0043] S101: Determine the quantum mode number N and the truncation number C of the quantum.

[0044] The number of quantum modes (qumodes), N, is used to characterize how many qumodes there are in a quantum. For an N-qumode quantum, the quantum final state vector includes N elements. The cutoff number, C, is used to constrain the sum of the values ​​of each element in the quantum final state vector.

[0045] In the disclosed embodiment, after determining the cutoff number C, the elements constituting the quantum final state vector can be determined, and {0, 1, 2, ..., C} can be selected from the following combinations. In other words, the value of each element in the quantum final state vector can be any value in the combination, and it is only necessary to ensure that the sum of each element is C.

[0046] S102: Obtain a photon combination whose sum is a cutoff number C.

[0047] Among them, since the elements with values ​​of 0 in the quantum final state vector have no effect on the sum of the elements in the final state vector finally calculated, the element values ​​in each photon combination obtained in the present disclosure are greater than 0.

[0048] In the disclosed embodiment, the system for acquiring the quantum final state vector can acquire elements with values ​​greater than 0 one by one for combination, and each time an element is added, the sum of the values ​​of the elements currently included in the combination is calculated. When the sum is equal to the cutoff number C, the combination can be regarded as a photon combination.

[0049] It should be noted that the photon combination may contain one element or multiple elements, but the number of elements should be less than N. And, since the sum of the values ​​of all elements in the photon combination is equal to C, the value of each element should be less than or equal to C.

[0050] Optionally, a candidate element sequence may be determined according to the cutoff number C, and then a photon combination may be generated based on each element in the candidate element sequence.

[0051] Among them, the element value in the candidate element sequence is greater than 0 and less than or equal to C, the value of the i+1th element in the candidate element sequence is greater than the ith element, and i is a positive integer less than C.

[0052] In the disclosed embodiment, the candidate element sequence can be determined to be {1, 2, ..., C} by the cutoff number C, and then the system for acquiring the quantum final state vector can use the elements in the candidate element sequence to combine to obtain a photon combination whose element values ​​sum to the cutoff number C. By acquiring elements in the candidate element sequence for combination, the range of element values ​​can be reduced, invalid calculations can be avoided, and the efficiency of acquiring photon combinations can be improved, thereby providing conditions for improving the efficiency of acquiring the final state vector.

[0053] It should be noted that in the present disclosure, in order to ensure that no repeated vectors are obtained after the elements in the photon combination are subsequently sorted, an unordered photon combination can be obtained. That is to say, when the elements in two photon combinations are the same but the order of the elements is different, the two photon combinations are considered to be repeated combinations, and one of the photon combinations needs to be deleted. For example, the elements in the photon combination (1,1,2) and the photon combination (2,1,1) can be arranged from large to small, and the results are both (1,1,2). Then, the two photon combinations can be considered to be repeated, and only any one of the photon combinations can be retained. Alternatively, when obtaining the photon combination, it is also possible to limit the element added to the photon combination each time to be greater than or equal to the previous element, and the present disclosure does not limit this.

[0054] S103: Sort the elements in each photon combination to determine all vectors corresponding to each photon combination.

[0055] In the disclosed embodiment, the elements in each photon combination may be sorted to obtain all situations when the elements in the photon combination are sorted in different orders, so as to obtain all vectors corresponding to the photon combination.

[0056] For example, for the photon combination (1,2,3), after sorting the elements 1, 2, and 3 in the combination, the corresponding vectors are [1 2 3] T , [1 3 2] T , [2 1 3] T , [2 3 1] T , [3 1 2] T , [3 2 1] T , or the photon combination (1,1,2), after sorting the elements 1, 1 and 2 in the combination, the corresponding vectors are [1 1 2] T , [1 2 1] T , [2 1 1] T .

[0057] It should be noted that since the operations of sorting elements in different photon combinations are independent of each other, multiple threads can be used to perform element sorting operations on all photon combinations at the same time, which reduces the time to determine all vectors and improves the efficiency of obtaining the corresponding vectors of the photon combinations.

[0058] That is to say, the system for acquiring the quantum final state vector can start a new thread to sort the elements therein every time a photon combination is obtained, thereby determining all the vectors corresponding to each photon combination by sorting the elements in multiple photon combinations in parallel based on multiple threads.

[0059] It should be noted that, since the final state vector of the quantum can also be obtained by traversing the selectable values ​​of each element, when C and / or N are relatively large, the complexity of the traversal process will increase dramatically, and will be accompanied by many invalid attempts. Therefore, in the present disclosure, all disordered quantum combinations corresponding to the final state vector of the quantum are first obtained, and then the quanta in each quantum combination are sorted, so that all non-empty subvectors in all final state vectors of the quantum can be obtained. Therefore, since there is no need to traverse the optional values ​​of each element, it can not only greatly reduce the complexity and time consumption of the process of obtaining the final state vector of the quantum. And in this way, the process of determining the final state vector of the quantum is divided into independent different stages, so that the process of determining the final state vector of the quantum can be executed in parallel by multiple threads, which provides conditions for further reducing the time consumption of the process and improving the utilization rate of system resources.

[0060] S104: Based on the number N of quantum modes and the number L of elements contained in each photon combination, determine all position index sequences corresponding to each photon combination.

[0061] Each position index sequence includes L position indexes.

[0062] In the disclosed embodiment, according to the number of quantum modes N, it can be determined that there are N elements in the final state vector, that is, corresponding to N position indexes. If the number of elements contained in the photon combination is L, that is, the L elements are the elements corresponding to the L position indexes in the quantum final state vector, then the position index sequence composed of each L position index in the N position indexes can be determined as a position index sequence corresponding to the photon combination, thereby obtaining all position index sequences. This ensures the integrity and reliability of the position index sequence, and further improves the accuracy of the final state vector.

[0063] For example, N=4, the number of elements L contained in the photon combination is 3, and the position indexes corresponding to the final state vectors are A1, A2, A3, and A4, respectively. The possible situations of selecting 3 position indexes include: A1, A2, and A3, or A1, A2, and A4, or A1, A3, and A4, or A2, A3, and A4. In other words, all the position index sequences corresponding to the photon combination are A1A2A3, A1A2A4, A1A3A4, and A2A3A4.

[0064] S105: Determine a final state vector list based on each position index sequence and vector corresponding to each photon combination.

[0065] Among them, the number of elements contained in the final state vector is N.

[0066] In the disclosed embodiment, all vectors corresponding to each photon combination can be used to fill the N-dimensional zero vector according to each position index sequence corresponding to the photon combination to obtain the final state vector. Then, based on all the obtained final state vectors, a final state vector list can be further obtained.

[0067] For example, N=3, the zero vector is [0 0 0] T , and the position index corresponding to each element is A1, A2, A3. From C=2, we can get the photon combination (2) and (1,1) whose element sum is C. Then according to the vector [2] corresponding to the photon combination (2) T , and the corresponding position index sequence includes: A1, A2 or A3, the final state vector list corresponding to the photon combination (2) includes: [2 0 0] T , [0 2 0] T and [0 0 2] T . Then according to the vector [1 1] corresponding to the photon combination (1,1) T , and the corresponding position index sequence includes: A1A2, A1A3 or A2A3, the final state vector list corresponding to the photon combination (1,1) includes: [1 1 0] T , [1 0 1] T and [0 1 1] T . Therefore, when N = 3 and C = 2, the final state vector list is [20 0] T , [0 2 0] T , [0 0 2] T , [1 1 0] T , [1 0 1] T and [0 1 1] T .

[0068] Optionally, the vector corresponding to the photon combination may be traversed based on the position index sequence corresponding to the photon combination, wherein the position index sequence includes the position index W corresponding to the hth element in the vector. h In the case of , the hth element is determined as the position index W in the final state vector h , and set the elements of the remaining positions in the final state vector that do not correspond to the position index to 0.

[0069] For example, when N is 4, the position indexes are A1, A2, A3, A4, and the position index sequences corresponding to the photon combination (1, 2, 3) are A1A2A3, A1A2A4, A1A3A4, and A2A3A4. So for the vector [1 2 3] T For example, when the position index sequence is A1A2A3, the position index W corresponding to the first element 1 in the vector h A1, the position index corresponding to the second element 2 in the vector is W h A2, the position index corresponding to the third element 3 in the vector is W h is A3, then the final state vector is [1 2 3 0] T , and so on, when the position index sequence is A1A2A4, the corresponding final state vector is [1 2 0 3] T , when the position index sequence is A1A3A4, the corresponding final state vector is [1 0 2 3] T , and when the position index sequence is A2A3A4, the corresponding final state vector is [01 2 3] T .

[0070] In the disclosed embodiment, the elements in the vector are filled into the corresponding positions in the final state vector through the corresponding position indexes, and the element 0 is filled into the positions in the final state vector that do not correspond to the position indexes, thereby ensuring the accuracy and element integrity of the final state vector.

[0071] In this embodiment, the system for acquiring the quantum final state vector first determines the quantum mode number N and the truncation number C of the quantum, then acquires the photon combination whose sum is the truncation number C, then sorts the elements in each photon combination, determines all vectors corresponding to each photon combination, and then determines all position index sequences corresponding to each photon combination based on the quantum mode number N and the number of elements L contained in each photon combination, and finally determines the final state vector list based on each position index sequence and vector corresponding to each photon combination. Thus, based on the quantum mode number N and the truncation number C, the process of acquiring the quantum final state vector is decoupled into multiple independent steps, so that the process of acquiring the quantum final state vector can be executed in parallel by multiple threads, which reduces the time consumption of acquiring the quantum final state vector and improves efficiency.

[0072] Figure 2 It is a flowchart of a method for obtaining a quantum final state vector proposed in another embodiment of the present disclosure.

[0073] like Figure 2 As shown, the method for obtaining the quantum final state vector includes:

[0074] S201: Determine the quantum mode number N and the truncation number C of the quantum.

[0075] S202: According to the cutoff number C, determine a candidate element sequence.

[0076] The description of S201 and S202 can be specifically referred to the above embodiment, which will not be repeated here.

[0077] S203: Generate a first combination based on the jth element in the candidate element sequence.

[0078] Wherein, j is a positive integer less than or equal to C. The first combination refers to a combination containing only one element.

[0079] In the disclosed embodiment, each element of the candidate element sequence {1, 2, ..., C} can be used to generate the first combination. That is, the first element 1 in the candidate element sequence {1, 2, ..., C} can be first taken to generate the first combination. Then the second element 2 in the candidate element sequence {1, 2, ..., C} is taken to generate the first combination, ... Finally, the Cth element C in the candidate element sequence {1, 2, ..., C} is taken to generate the first combination.

[0080] Combine the following Figure 3 To explain, Figure 3 is a schematic diagram of the structure of the photon combination decision tree. When C is 2, Figure 3 As shown, the first element 1 in the candidate element sequence {1, 2} can be selected to fill in the empty combination to generate the first combination (1). Then the second element 2 in the candidate element sequence {1, 2} can be selected to fill in the empty combination to generate the first combination (2).

[0081] S204: When the value of the element in the first combination is equal to C, determine that the first combination is a photon combination, and the total number of photon combinations is 1.

[0082] In the embodiment of the present disclosure, when j is equal to C, the value of the element in the first combination is equal to C, then it can be determined that the first combination is a photon combination, and there is no situation where other photon combinations are obtained by adding other elements to the first combination. At this time, the total number of photon combinations is 1.

[0083] like Figure 3As shown, C is 2, and the value of the element in the first combination (2) is equal to C, so the first combination (2) is a photon combination.

[0084] Alternatively, when the value of the element in the first combination is less than C and the first number of elements in the first combination is less than N, the condition that the sum of the element values ​​is C can be satisfied by adding elements to the first combination, so the first combination can be expanded based on the kth element in the candidate element sequence to obtain the second combination. Then, when the sum of the elements in the second combination is equal to C, the second combination is determined to be a photon combination, and the operation of generating the first combination is returned based on the j+1th element in the candidate element sequence.

[0085] Wherein, k is a positive integer greater than or equal to j and less than C.

[0086] In the embodiment of the present disclosure, when the value of the element in the first combination is less than C, and the first number of elements in the first combination is less than N, an element greater than or equal to element j in the first combination can be selected from the candidate element sequence {1, 2, ..., C}, and the first combination is expanded to obtain multiple second combinations, and the second combination whose sum of elements is equal to C is determined as a photon combination, and the second combination whose sum of elements is greater than C is deleted, and then the j+1th element in the candidate element sequence is returned to perform the operation of generating the first combination. By limiting the obtained combination, the value of the latter element must be greater than or equal to the value of the previous element, it is avoided to obtain repeated combinations and the efficiency of obtaining photon combinations is improved.

[0087] like Figure 3 As shown, when j is 1, C is 2, and N is 4, since 1<2, 1<4, the sum of the elements in the first combination (1) is less than C, and the first number of elements included is less than N, then the elements greater than or equal to 1 in the candidate element sequence {1, 2} can be used to expand the first combination respectively to obtain the second combinations (1, 1) and (1, 2). Because 1+1=2, 1+2>2, it can be determined that the second combination [1, 1] is a photon combination. Then, based on the j+1=2th element 2 in the candidate element sequence {1, 2}, the operation of generating the first combination is returned.

[0088] It should be noted that, in some cases, after obtaining the second combination, the sum of the elements in the second combination may be less than C, and the second number of elements in the second combination may be less than N. Therefore, based on the mth element in the candidate element sequence, the operation of expanding the second combination may be returned until the sum of the elements in the new combination is equal to or greater than C, or until the third number of elements in the new combination is greater than or equal to N. Then, the new combination containing the sum of the elements equal to C may be determined as a photon combination, and the combination containing the sum of the elements greater than C may be discarded.

[0089] Wherein, m is a positive integer greater than or equal to k and less than C.

[0090] For example, C is 4, N is 3, the elements in the second combination (1,2) are 1 and 2, and 1+2<4, and the number of elements is less than 3. Then, based on the elements greater than or equal to 2 in the candidate element sequence {1,2,3,4}, the second combination (1,2) can be expanded to obtain new combinations (1,2,2), (1,2,3) or (1,2,4). Since the sum of the elements in the new combination is greater than 4, there is no photon combination.

[0091] In the disclosed embodiment, the second combination whose sum of elements is less than C and whose number of elements is less than N is expanded multiple times, and the expansion operation is stopped when the sum of the elements in the expanded combination is equal to or greater than C, or the third number of included elements is greater than or equal to N, thereby achieving decision pruning in the process of acquiring photon combinations, reducing unnecessary calculations, and further improving the efficiency of acquiring photon combinations while ensuring the validity of the newly acquired combinations.

[0092] Alternatively, after obtaining the second combination, when the sum of the elements in the second combination is less than C and the second number of elements included in the second combination is equal to N, the system for acquiring the quantum final state vector cannot continue to increase the sum of the elements by increasing the number of elements, so the j+1th element in the candidate element sequence can be used to replace the second element in the second combination to obtain an updated second combination.

[0093] For example, C is 4, N is 2, the elements in the second combination (1,1) are 1, 1, and 1+1<4, and the number of elements is equal to 2. Then, based on the candidate element sequence {1, 2, 3, 4}, the second element 1 in the second combination (1,1) can be replaced with the adjacent next element in the candidate element sequence {1, 2, 3, 4}.

[0094] Then, when the sum of the elements in the updated second combination is equal to C, the updated second combination can be used as a photon combination. Alternatively, when the sum of the elements in the updated second combination is less than C, the j+2th element in the candidate element sequence is used to replace the second element of the updated second combination until the sum of the elements in the updated second combination is equal to C.

[0095] For example, C is 4, N is 2, the elements in the second combination (1,1) are 1, 1, and 1+1<4, the number of elements is equal to 2. At this time, even if the second element 1 in the second combination (1,1) is replaced with 2, 1+2<4 is still true. Then you can continue to replace the second element with a larger element 3, so that 1+3=4, and get a photon combination.

[0096] In the disclosed embodiment, by increasing the value of a single element in a combination in which the number of elements is equal to N, the condition that the sum of the elements in the photon combination is equal to C is gradually satisfied, making the acquired photon combination more comprehensive and reliable.

[0097] S205: Based on the number N of quantum modes and the number L of elements contained in each photon combination, determine all position index sequences corresponding to each photon combination.

[0098] S206: Determine a final state vector list based on each position index sequence and vector corresponding to each photon combination.

[0099] The description of S205 and S206 can be specifically referred to the above embodiment, which will not be repeated here.

[0100] In this embodiment, firstly, the first combination is generated based on the jth element in the candidate element sequence, and then, when the value of the element in the first combination is equal to C, the first combination is determined to be a photon combination, and the total number of photon combinations is 1. Thus, combinations are generated based on each element in the candidate element sequence, and after any combination is generated, the sum of the values ​​of the elements in the combination is judged to determine whether it is a photon combination, which further improves the efficiency of obtaining photon combinations and provides conditions for improving the efficiency of obtaining the final state vector.

[0101] Figure 4 It is a flowchart of a method for obtaining a quantum final state vector proposed in another embodiment of the present disclosure.

[0102] like Figure 4 As shown, the method for obtaining the quantum final state vector includes:

[0103] S401: Determine the quantum mode number N and the truncation number C of the quantum.

[0104] S402: Obtain a photon combination whose sum is a cutoff number C.

[0105] The description of S401 and S402 can be specifically referred to the above embodiment, which will not be repeated here.

[0106] S403: Determine the first vector corresponding to the photon combination.

[0107] The value of the n+1th element in the first vector is greater than or equal to the value of the nth element, n is a positive integer less than M, and M is the number of elements included in the first vector.

[0108] In the embodiment of the present disclosure, the acquired photon combination may contain multiple photon combinations with the same elements but different order of elements, for example [1 1 2] T and [1 2 1] T , since the elements corresponding to the two photon combinations are the same, repeated vectors will be obtained when the elements are sorted later, resulting in a waste of resources. Therefore, by determining the first vector corresponding to the photon combination, we can obtain [1 1 2] T and [1 2 1] T The corresponding first vectors are all [1 1 2] T Then, the elements in the first vector are sorted, which avoids repeated operations, further improves the efficiency of obtaining the corresponding vectors of the photon combination, and reduces resource waste.

[0109] S404: Determine a first marking vector.

[0110] The first marking vector is a zero vector containing M elements, and the elements in the first marking vector are used to mark whether the corresponding elements in the first vector have been used to generate a new vector corresponding to the photon combination.

[0111] S405: Based on the first marking vector, traverse the elements in the first vector to generate other vectors corresponding to the photon combination.

[0112] In the disclosed embodiment, the system for acquiring the quantum final state vector can take out any element from the first vector and fill it into the first element position of the second vector having the same number of elements as the first vector, and change the element at the position corresponding to the first marking vector in the first vector from 0 to 1, and then take out another element from the remaining elements of the first vector and fill it into the second element position in the second vector, and modify the element at the corresponding position in the first marking vector, and traverse each element in the first vector in turn. When the elements in the first marking vector are all 1, other vectors corresponding to the photon combination are generated.

[0113] It should be noted that when the first vector contains multiple identical elements, the other vectors generated after traversal may be identical. For example, for the first vector [1 1 2] containing two elements 1T , when the first element 1 is taken out, then the second element 1 is taken out, and then the element 2 is taken out, the other vectors generated are [1 1 2] T and [1 2 1] T , or when the second element 1 is taken out first, then the first element 1 is taken out, and then the element 2 is taken out, the other vectors generated are still [1 1 2] T and [1 2 1] T Therefore, when traversing the elements in the first vector, it is necessary to determine whether the same elements in the vector are taken out to prune the vector generation process to avoid wasting resources.

[0114] Optionally, when the value of the x+1th element in the first vector is different from that of the xth element, or when the value of the x+1th element is the same as that of the xth element, and the value of the xth element in the first marker vector associated with the second vector to be generated is 1, the x+1th element in the first vector can be determined as an element in the second vector corresponding to the photon combination, and the value of the x+1th element in the first marker vector associated with the second vector is set to 1, where x is a positive integer less than M. Then, when all elements in the first marker vector associated with the second vector are 1, the second vector can be determined to be a vector corresponding to the photon combination.

[0115] The first marking vector associated with the second vector to be generated refers to the first marking vector used to mark whether each element used to generate the second vector is taken out from the first vector.

[0116] In the disclosed embodiment, by judging whether the value of the currently taken out x+1th element is different from the value of the xth element in the first vector, or the xth element identical to the x+1th element has been filled into the second vector to be generated, the x+1th element in the first vector can be directly filled into the second element, thereby avoiding meaningless repeated operations, reducing resource waste, and further improving the efficiency of obtaining the final state vector. Alternatively, when the value of the x+1th element is the same as the value of the xth element, and the value of the xth element in the first tag vector associated with the second vector to be generated is 0, the current traversal process is terminated.

[0117] In the disclosed embodiment, when the value of the x+1th element in the first vector is the same as the value of the xth element, but the value of the element corresponding to the xth element in the first tag vector is 0, it means that the xth element in the first vector has not been taken out yet, which is easy to produce repeated vector results with the situation of taking out the xth element first and then taking out the x+1th element, so the current traversal process of taking out the x+1th element first and then taking out the xth element can be terminated. By judging whether the same elements in the vector are taken out, the vector generation traversal process is pruned to avoid resource waste and further improve the efficiency of obtaining the final state vector.

[0118] Combine the following Figure 5 To further explain the above process, Figure 5 This is a schematic diagram of the process of traversing the first vector. Figure 5 As shown, the first vector is [1 1′2] T , the corresponding first label vector is f = [0 0 0] T . It should be noted that 1′ is used to represent the second element 1 in the first vector only for the convenience of distinguishing it from the first element 1 in the description process. It is essentially the same as element 1. First, the first element 1 in the first vector can be taken out as the first element of the second vector, and the first marking vector is modified to f=[1 0 0] T , the remaining elements of the first vector are 1′ and 2, and then the second element 1′ is taken out from the first vector. Since the value of the second element 1′ is the same as the value of the first element 1, but the value of the first element corresponding to element 1 in the first marking vector is 1, element 1′ can be used as the second element of the second vector, and the first marking vector is modified to f=[1 1 0] T , then take out the third element 2 as the third element of the second vector. At this time, the first marking vector is modified to f = [1 1 1] T , thus, we can get the second vector as [1 1′2] T Similarly, we can take out 1, 2 and 1′ in turn to get the second vector [1 2 1′] T , thus completing the loop of taking out the first element which is 1.

[0119] Then, first take out the second element 1′ in the first element. At this time, the first label vector is f=[0 1 0] T , since the value of the second element 1′ is the same as the value of the first element 1, but the value of the first element corresponding to element 1 in the first tag vector is 0, the current loop should be terminated. It should be noted that in order to show the process more intuitively, Figure 5 The content of this cycle is retained in Figure 5The content of this loop process can be clearly determined: first take out the second element 1′ and analyze it. Then get the second vector [1′1 2] T and [1′2 1] T , which are the same as the two second vectors obtained in the previous loop.

[0120] Alternatively, you can first take out element 2 from the first vector, then take out 1, and then take out 1′ to get the second vector [2 1 1′] T , and discard the case where element 2 is taken out first, then 1′, and then 1. So according to the above analysis, after traversing the first vector, the other vectors corresponding to the photon combination are [1 2 1] T , [2 1 1] T .

[0121] It should be noted that Figure 5 Only the corresponding marking vector f during the process of taking out some elements is shown.

[0122] S406: Based on the number N of quantum modes and the number L of elements contained in each photon combination, determine all position index sequences corresponding to each photon combination.

[0123] S407: Determine a final state vector list based on each position index sequence and vector corresponding to each photon combination.

[0124] The vector corresponding to the photon combination includes the first vector and other vectors.

[0125] The description of S406 and S406 above can be specifically referred to the above embodiment, which will not be repeated here.

[0126] In this embodiment, by determining the first vector corresponding to the photon combination and the first marking vector, and then traversing the elements in the first vector based on the first marking vector to generate other vectors corresponding to the photon combination, all vectors corresponding to the photon combination are obtained. The use of the marking vector makes the acquisition of the vector corresponding to the photon combination more organized, further improving the accuracy and reliability of the final state vector.

[0127] Figure 5 It is a schematic diagram of the structure of a device for obtaining a quantum final state vector proposed in one embodiment of the present disclosure.

[0128] like Figure 6 As shown, the device 600 for obtaining the quantum final state vector includes:

[0129] A first determination module 601 is used to determine the quantum mode number N and the truncation number C of the quantum;

[0130] A first acquisition module 602 is used to acquire photon combinations whose sum is a cutoff number C, wherein the element value in each photon combination is greater than 0;

[0131] The second determination module 603 is used to sort the elements in each photon combination and determine all vectors corresponding to each photon combination;

[0132] A third determination module 604 is used to determine all position index sequences corresponding to each photon combination based on the number N of quantum modes and the number L of elements contained in each photon combination, wherein each position index sequence contains L position indexes;

[0133] The fourth determination module 605 is used to determine a final state vector list based on each position index sequence and vector corresponding to each photon combination.

[0134] In some embodiments, the first acquisition module 602 is specifically configured to:

[0135] According to the cutoff number C, determine the candidate element sequence, wherein the element value in the candidate element sequence is greater than 0 and less than or equal to C, and the value of the i+1th element in the candidate element sequence is greater than the ith element, where i is a positive integer less than C;

[0136] Based on each element in the candidate element sequence, a photon combination is generated.

[0137] In some embodiments, the first acquisition module 602 is specifically configured to:

[0138] Generate a first combination based on the j-th element in the candidate element sequence, where j is a positive integer less than or equal to C;

[0139] In the case where the value of the element in the first combination is equal to C, the first combination is determined to be one photon combination, and the total number of photon combinations is 1.

[0140] In some embodiments, the first acquisition module 602 is further used to:

[0141] When the value of the element in the first combination is less than C and the first number of elements in the first combination is less than N, the first combination is expanded based on the kth element in the candidate element sequence to obtain a second combination, where k is a positive integer greater than or equal to j and less than C;

[0142] When the sum of the elements in the second combination is equal to C, the second combination is determined to be a photon combination, and the operation of generating the first combination is returned based on the j+1th element in the candidate element sequence.

[0143] In some embodiments, the first acquisition module 602 is further used to:

[0144] When the sum of the elements in the second combination is less than C and the second number of elements in the second combination is less than N, based on the mth element in the candidate element sequence, return to perform the operation of expanding the combination until the sum of the elements in the new combination obtained is equal to or greater than C, or until the third number of elements in the new combination obtained is greater than or equal to N, where m is a positive integer greater than or equal to k and less than C;

[0145] A new combination whose sum of elements is equal to C is determined as a photon combination, and a combination whose sum of elements is greater than C is discarded.

[0146] In some embodiments, the first acquisition module 602 is further used to:

[0147] When the sum of the elements in the second combination is less than C and the second number of elements in the second combination is equal to N, replace the second element in the second combination with the j+1th element in the candidate element sequence to obtain an updated second combination;

[0148] When the sum of the elements in the updated second combination is less than C, the j+2th element in the candidate element sequence is used to replace the second element in the updated second combination until the sum of the elements in the updated second combination is equal to C.

[0149] In some embodiments, the second determining module 603 is specifically configured to:

[0150] Determine a first vector corresponding to the photon combination, wherein a value of an n+1th element in the first vector is greater than or equal to a value of an nth element, where n is a positive integer less than M, and M is the number of elements included in the first vector;

[0151] Determine a first marking vector, wherein the first marking vector is a zero vector containing M elements, and the elements in the first marking vector are used to mark whether the corresponding elements in the first vector have been used to generate a new vector corresponding to the photon combination;

[0152] Based on the first label vector, the elements in the first vector are traversed to generate other vectors corresponding to the photon combination.

[0153] In some embodiments, the second determining module 603 is specifically configured to:

[0154] In the case where the values ​​of the x+1th element and the xth element in the first vector are different, or in the case where the values ​​of the x+1th element and the xth element are the same and the value of the xth element in the first marking vector associated with the second vector to be generated is 1, the x+1th element in the first vector is determined as an element in the second vector corresponding to the photon combination, and the value of the x+1th element in the first marking vector associated with the second vector is set to 1, where x is a positive integer less than M;

[0155] When all elements in the first marking vector associated with the second vector are 1, the second vector is determined to be a vector corresponding to the photon combination.

[0156] In some embodiments, the second determining module 603 is specifically configured to:

[0157] When the value of the x+1th element is the same as the value of the xth element, and the value of the xth element in the first label vector associated with the second vector to be generated is 0, the current traversal process is terminated.

[0158] In some embodiments, the second determining module 603 is specifically configured to:

[0159] Based on multiple threads, the elements in each photon combination are sorted in parallel to determine all vectors corresponding to each photon combination.

[0160] In some embodiments, the third determining module 604 is specifically configured to:

[0161] A position index sequence composed of each L position indexes among the N position indexes is determined as a position index sequence corresponding to the photon combination.

[0162] In some embodiments, the fourth determining module 605 is specifically configured to:

[0163] Based on the position index sequence corresponding to the photon combination, the vector corresponding to the photon combination is traversed, and the position index W corresponding to the hth element in the vector is included in the position index sequence h In the case of , the hth element is determined as the position index W in the final state vector h , and determine the elements of the remaining positions in the final state vector that do not correspond to the position index sequence as 0, where the number of elements contained in the final state vector is N.

[0164] It should be noted that the above explanation of the method for obtaining the quantum final state vector is also applicable to the device for obtaining the quantum final state vector of this embodiment, and will not be repeated here.

[0165] In this embodiment, the system for acquiring the quantum final state vector first determines the quantum mode number N and the truncation number C of the quantum, then acquires the photon combination whose sum is the truncation number C, then sorts the elements in each photon combination, determines all vectors corresponding to each photon combination, and then determines all position index sequences corresponding to each photon combination based on the quantum mode number N and the number of elements L contained in each photon combination, and finally determines the final state vector list based on each position index sequence and vector corresponding to each photon combination. Thus, based on the quantum mode number N and the truncation number C, the process of acquiring the quantum final state vector is decoupled into multiple independent steps, so that the process of acquiring the quantum final state vector can be executed in parallel by multiple threads, which reduces the time consumption of acquiring the quantum final state vector and improves efficiency.

[0166] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0167] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0168] like Figure 7 As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0169] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0170] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as a method for obtaining a quantum final state vector. For example, in some embodiments, the method for obtaining a quantum final state vector may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the method for obtaining a quantum final state vector described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform a method for obtaining a quantum final state vector in any other appropriate manner (e.g., by means of firmware).

[0171] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0172] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0173] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0174] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0175] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0176] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0177] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0178] In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In the description of the present disclosure, the words "if" and "if" used can be interpreted as "at the time of" or "when" or "in response to determination" or "under the circumstances of".

[0179] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for obtaining a quantum final state vector, the method being performed by a system for obtaining a quantum final state vector, comprising: Determine the quantum mode number N and cutoff number C of the quantum; Obtaining photon combinations whose sum is the cutoff number C, wherein the element value in each of the photon combinations is greater than 0; Sorting the elements in each of the photon combinations to determine all vectors corresponding to each of the photon combinations; Based on the number N of quantum modes and the number L of elements contained in each of the photon combinations, all position index sequences corresponding to each of the photon combinations are determined, wherein each of the position index sequences contains L position indexes; Determine a final state vector list based on each position index sequence and vector corresponding to each of the photon combinations; The step of sorting the elements in each of the photon combinations to determine all vectors corresponding to each of the photon combinations includes: Based on multiple threads, the elements in each photon combination are sorted in parallel to determine all vectors corresponding to each photon combination.

2. The method of claim 1, wherein: The obtaining and the photon combination having the cutoff number C comprises: Determine a candidate element sequence according to the cutoff number C, wherein the element values ​​in the candidate element sequence are greater than 0 and less than or equal to C, and the value of the i+1th element in the candidate element sequence is greater than the ith element, where i is a positive integer less than C; The photon combination is generated based on each element in the candidate element sequence.

3. The method of claim 2, wherein: The generating the photon combination based on each element in the candidate element sequence comprises: Generate a first combination based on the jth element in the candidate element sequence, where j is a positive integer less than or equal to C; When the value of the element in the first combination is equal to C, the first combination is determined to be one of the photon combinations, and the total number of photon combinations is 1.

4. The method of claim 3, wherein: After generating the first combination based on the j-th element in the candidate element sequence, the method further includes: When the value of the element in the first combination is less than C and the first number of elements in the first combination is less than N, the first combination is expanded based on the kth element in the candidate element sequence to obtain a second combination, where k is a positive integer greater than or equal to j and less than C; In the case that the sum of the elements in the second combination is equal to C, the second combination is determined to be a photon combination, and the operation of generating the first combination is returned based on the j+1th element in the candidate element sequence.

5. The method of claim 4, wherein: After obtaining the second combination, the method further includes: In the case that the sum of the elements in the second combination is less than C and the second number of elements in the second combination is less than N, based on the mth element in the candidate element sequence, returning to perform the operation of expanding the combination until the sum of the elements in the acquired new combination is equal to or greater than C, or until the third number of elements in the acquired new combination is greater than or equal to N, where m is a positive integer greater than or equal to k and less than C; A new combination whose sum of elements is equal to C is determined as one of the photon combinations, and a combination whose sum of elements is greater than C is discarded.

6. The method of claim 5, wherein: After obtaining the second combination, the method further includes: When the sum of the elements in the second combination is less than C and the second number of elements in the second combination is equal to N, replace the second element in the second combination with the j+1th element in the candidate element sequence to obtain an updated second combination; When the sum of the elements in the updated second combination is less than C, the j+2th element in the candidate element sequence is used to replace the second element in the updated second combination until the sum of the elements in the updated second combination is equal to C.

7. The method according to any one of claims 1 to 6, wherein: The step of sorting the elements in each of the photon combinations to determine all vectors corresponding to each of the photon combinations includes: Determine a first vector corresponding to the photon combination, wherein a value of an n+1th element in the first vector is greater than or equal to a value of an nth element, where n is a positive integer less than M, and M is the number of elements included in the first vector; Determine a first marking vector, wherein the first marking vector is a zero vector including M elements, and the elements in the first marking vector are used to mark whether corresponding elements in the first vector have been used to generate a new vector corresponding to the photon combination; Based on the first marking vector, elements in the first vector are traversed to generate other vectors corresponding to the photon combination.

8. The method of claim 7, wherein: The traversing the elements in the first vector based on the first tag vector to generate other vectors corresponding to the photon combination includes: In a case where the values ​​of the x+1th element and the xth element in the first vector are different, or in a case where the values ​​of the x+1th element and the xth element are the same and the value of the xth element in the first marking vector associated with the second vector to be generated is 1, the x+1th element in the first vector is determined as an element in the second vector corresponding to the photon combination, and the value of the x+1th element in the first marking vector associated with the second vector is set to 1, where x is a positive integer less than M; When all elements in the first marking vector associated with the second vector are 1, the second vector is determined to be a vector corresponding to the photon combination.

9. The method of claim 7, wherein: The traversing the elements in the first vector based on the first tag vector to generate other vectors corresponding to the photon combination includes: When the value of the x+1th element is the same as the value of the xth element and the value of the xth element in the first tag vector associated with the second vector to be generated is 0, the current traversal process is terminated.

10. The method according to any one of claims 1 to 6, wherein: The step of determining all position index sequences corresponding to each photon combination based on the number N of quantum modes and the number L of elements contained in each photon combination includes: A position index sequence formed by each L position indexes among the N position indexes is determined as a position index sequence corresponding to the photon combination.

11. The method of claim 10, wherein: The step of determining a final state vector list based on each position index sequence and vector corresponding to each photon combination includes: Based on the position index sequence corresponding to the photon combination, the vector corresponding to the photon combination is traversed, and the position index sequence includes the position index corresponding to the hth element in the vector In the case of , the hth element is determined as the position index in the final state vector , and determine the elements of the remaining positions in the final state vector that do not correspond to the position index sequence as 0, wherein the number of elements included in the final state vector is N.

12. A device for obtaining a quantum final state vector, the device being configured in a system for obtaining a quantum final state vector, comprising: A first determination module is used to determine the quantum mode number N and the truncation number C of the quantum; A first acquisition module is used to acquire photon combinations whose sum is the cutoff number C, wherein the element value in each photon combination is greater than 0; A second determination module is used to sort the elements in each of the photon combinations to determine all vectors corresponding to each of the photon combinations; A third determination module is used to determine all position index sequences corresponding to each photon combination based on the number N of quantum modes and the number L of elements contained in each photon combination, wherein each position index sequence contains L position indexes; A fourth determination module, used to determine a final state vector list based on each position index sequence and vector corresponding to each of the photon combinations; Wherein, the second determining module is specifically used to: Based on multiple threads, the elements in each photon combination are sorted in parallel to determine all vectors corresponding to each photon combination.

13. The device of claim 12, wherein: The first acquisition module is specifically used to: Determine a candidate element sequence according to the cutoff number C, wherein the element values ​​in the candidate element sequence are greater than 0 and less than or equal to C, and the value of the i+1th element in the candidate element sequence is greater than the ith element, where i is a positive integer less than C; The photon combination is generated based on each element in the candidate element sequence.

14. The device of claim 13, wherein: The first acquisition module is specifically used to: Generate a first combination based on the jth element in the candidate element sequence, where j is a positive integer less than or equal to C; When the value of the element in the first combination is equal to C, the first combination is determined to be one of the photon combinations, and the total number of photon combinations is 1.

15. The device of claim 14, wherein: The first acquisition module is further used for: When the value of the element in the first combination is less than C and the first number of elements in the first combination is less than N, the first combination is expanded based on the kth element in the candidate element sequence to obtain a second combination, where k is a positive integer greater than or equal to j and less than C; In the case that the sum of the elements in the second combination is equal to C, the second combination is determined to be a photon combination, and the operation of generating the first combination is returned based on the j+1th element in the candidate element sequence.

16. The device of claim 15, wherein: The first acquisition module is further used for: In the case that the sum of the elements in the second combination is less than C and the second number of elements in the second combination is less than N, based on the mth element in the candidate element sequence, returning to perform the operation of expanding the combination until the sum of the elements in the acquired new combination is equal to or greater than C, or until the third number of elements in the acquired new combination is greater than or equal to N, where m is a positive integer greater than or equal to k and less than C; A new combination whose sum of elements is equal to C is determined as one of the photon combinations, and a combination whose sum of elements is greater than C is discarded.

17. The device of claim 16, wherein: The first acquisition module is further used for: When the sum of the elements in the second combination is less than C and the second number of elements in the second combination is equal to N, replace the second element in the second combination with the j+1th element in the candidate element sequence to obtain an updated second combination; When the sum of the elements in the updated second combination is less than C, the j+2th element in the candidate element sequence is used to replace the second element in the updated second combination until the sum of the elements in the updated second combination is equal to C.

18. The device according to any one of claims 12 to 17, wherein: The second determining module is specifically used to: Determine a first vector corresponding to the photon combination, wherein a value of an n+1th element in the first vector is greater than or equal to a value of an nth element, where n is a positive integer less than M, and M is the number of elements included in the first vector; Determine a first marking vector, wherein the first marking vector is a zero vector including M elements, and the elements in the first marking vector are used to mark whether corresponding elements in the first vector have been used to generate a new vector corresponding to the photon combination; Based on the first marking vector, elements in the first vector are traversed to generate other vectors corresponding to the photon combination.

19. The device of claim 18, wherein: The second determining module is specifically used to: In a case where the values ​​of the x+1th element and the xth element in the first vector are different, or in a case where the values ​​of the x+1th element and the xth element are the same and the value of the xth element in the first marking vector associated with the second vector to be generated is 1, the x+1th element in the first vector is determined as an element in the second vector corresponding to the photon combination, and the value of the x+1th element in the first marking vector associated with the second vector is set to 1, where x is a positive integer less than M; When all elements in the first marking vector associated with the second vector are 1, the second vector is determined to be a vector corresponding to the photon combination.

20. The apparatus of claim 18, wherein: The second determining module is specifically used to: When the value of the x+1th element is the same as the value of the xth element and the value of the xth element in the first tag vector associated with the second vector to be generated is 0, the current traversal process is terminated.

21. The device according to any one of claims 12 to 17, wherein: The third determination module is specifically used to: A position index sequence formed by each L position indexes among the N position indexes is determined as a position index sequence corresponding to the photon combination.

22. The device of claim 21, wherein: The fourth determining module is specifically used for: Based on the position index sequence corresponding to the photon combination, the vector corresponding to the photon combination is traversed, and the position index sequence includes the position index corresponding to the hth element in the vector In the case of , the hth element is determined as the position index in the final state vector , and determine the elements of the remaining positions in the final state vector that do not correspond to the position index sequence as 0, wherein the number of elements included in the final state vector is N.

23. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method for obtaining a quantum final state vector according to any one of claims 1 to 11.

24. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: in, The computer instructions are used to enable the computer to execute the method for obtaining a quantum final state vector according to any one of claims 1 to 11.

25. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the steps of the method for obtaining a quantum final state vector according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Symmetrically parallel controlled bidirectional quantum secure direct communication method

    CN106850197A

  • Method and equipment for determining state of target object through quantum circuit

    CN115423107A