Photon number measurement simulation method, device, equipment and storage medium

By obtaining Gaussian's first -order and second -order signs and processing and processing, Hermite uses Hermite to repay the polynomial compression method to solve the problem of limited photon measurement simulation on the classic computer, and realize a wider range of computer language support.

CN117391209BActive Publication Date: 2025-01-28BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When performing photoquantum simulation on classical computers, the number of photons measurement is limited because some computer languages ​​do not support tensor operations, resulting in limited algorithm implementation.

Method used

By obtaining Gaussian's first -order characteristic matrix and second -order signs, it is substituted into the intermediate variable formula and the zero -state probability formula. The reference element is represented by Hermite to the polynomial to obtain the one -dimensional vector compressed by Hermite tensor, and the sample is sampled to obtain the results of the sampling distribution.

Benefits of technology

The high -dimensional Hermite tensor is compressed to one -dimensional, avoiding the problem that the photon number measuring simulation caused by the computer language does not support tensor operation, and expands the type of computer language for photon numbers to measure simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117391209B_ABST
    Figure CN117391209B_ABST
Patent Text Reader

Abstract

The present disclosure provides a photon number measurement simulation method, device, equipment and storage medium, which relates to the field of computer technology and is applied to quantum computing scenarios. The specific implementation scheme is: substitute the first-order characterization matrix and the second-order characterization matrix of the Gaussian state into the intermediate variable formula to obtain the intermediate variable, and substitute the first-order characterization matrix and the second-order characterization matrix into the zero-state probability formula to obtain the zero-state probability. According to the mapping relationship between the linear index and the tensor index, for the subsequent linear index of each target element to be calculated in the Hermite recursive polynomial, the prior linear index to which the reference element for calculating any target element belongs is determined, and the tensor index corresponding to the prior linear index and the subsequent linear index satisfies the setting rules. Then, the intermediate variable and each reference element are substituted into the Hermite recursive polynomial to obtain each target element in the one-dimensional vector. According to each target element and the zero-state probability in the one-dimensional vector, sampling is performed to obtain a sampling distribution result.
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 and is applied to quantum computing scenarios, and in particular to a photon number measurement simulation method, device, equipment and storage medium. Background Art

[0002] As a carrier of information, photons have some unique advantages and have become one of the important choices for realizing quantum computers. However, the research and development of optical quantum computers requires huge costs, including investment in manpower, material resources, and financial resources. Therefore, in order to reduce costs, researchers generally conduct small-scale simulations on classical computers first. In addition, by simulating optical quantum computing and related algorithms on classical computers, it is also possible to verify the correctness of the algorithm, optimize the design of quantum circuits, and predict and analyze the results.

[0003] When performing photon simulation on a classical computer, photon number measurement is an important part of photon computing based on Gaussian states. Summary of the invention

[0004] The present disclosure provides a photon number measurement simulation method, device, equipment and storage medium. According to one aspect of the present disclosure, a photon number measurement simulation method is provided, comprising:

[0005] Obtain a first-order characterization matrix and a second-order characterization matrix of a Gaussian state;

[0006] Substituting the first-order characterization matrix and the second-order characterization matrix into an intermediate variable formula to obtain an intermediate variable, and substituting the first-order characterization matrix and the second-order characterization matrix into a zero-state probability formula to obtain a zero-state probability;

[0007] According to the mapping relationship between the linear index and the tensor index, for the subsequent linear index of each target element to be calculated in the Hermite recursive polynomial, determine the previous linear index to which the reference element used to calculate any of the target elements belongs, wherein the tensor index corresponding to the previous linear index and the tensor index corresponding to the subsequent linear index satisfy a set rule;

[0008] Substituting the intermediate variable and each reference element into the Hermite recursive polynomial to obtain each target element in the one-dimensional vector after Hermite tensor compression;

[0009] Sampling is performed according to each target element in the one-dimensional vector and the zero-state probability to obtain a sampling distribution result.

[0010] According to another aspect of the present disclosure, there is provided a photon number measurement simulation device, comprising:

[0011] An acquisition module, used for acquiring a first-order characterization matrix and a second-order characterization matrix of a Gaussian state;

[0012] A processing module, used for substituting the first-order characterization matrix and the second-order characterization matrix into an intermediate variable formula to obtain an intermediate variable, and substituting the first-order characterization matrix and the second-order characterization matrix into a zero-state probability formula to obtain a zero-state probability;

[0013] A mapping module, for determining, according to a mapping relationship between a linear index and a tensor index, a prior linear index to which a reference element for calculating any target element belongs for a subsequent linear index of each target element to be calculated in a Hermite recursive polynomial, wherein a tensor index corresponding to the prior linear index and a tensor index corresponding to the subsequent linear index satisfy a set rule;

[0014] A recursive module, used for substituting the intermediate variable and each reference element into the Hermite recursive polynomial to obtain each target element in the one-dimensional vector after Hermite tensor compression;

[0015] The sampling module is used to perform sampling according to each target element in the one-dimensional vector and the zero-state probability to obtain a sampling distribution result.

[0016] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the embodiment of the first aspect of the present disclosure.

[0017] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method described in the embodiment of the first aspect of the present disclosure.

[0018] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method described in the embodiment of the first aspect of the present disclosure is implemented.

[0019] The present disclosure provides a method, device, equipment and storage medium for simulating the measurement of photon numbers. By obtaining the first-order characterization matrix and the second-order characterization matrix of the Gaussian state, the first-order characterization matrix and the second-order characterization matrix are substituted into the intermediate variable formula to obtain the intermediate variable, and the first-order characterization matrix and the second-order characterization matrix are substituted into the zero-state probability formula to obtain the zero-state probability. According to the mapping relationship between the linear index and the tensor index, for the subsequent linear index of each target element to be calculated in the Hermite recursive polynomial, the prior linear index to which the reference element for calculating any of the target elements belongs is determined, wherein the tensor index corresponding to the prior linear index and the tensor index corresponding to the subsequent linear index satisfy the set rules. Further, the intermediate variables and each reference element are substituted into the Hermite recursive polynomial to obtain each target element in the one-dimensional vector after the Hermite tensor is compressed. According to each target element in the one-dimensional vector and the zero-state probability, sampling is performed to obtain a sampling distribution result. Since the high-dimensional Hermite tensor is compressed into one dimension, the problem of limited simulation of photon number measurement caused by the fact that some computer languages ​​in related technologies do not support tensor operations is avoided.

[0020] 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

[0021] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0022] Figure 1 It is a schematic diagram of a process of a photon number measurement simulation method provided by the present disclosure;

[0023] Figure 2 is a flow chart of another photon number measurement simulation method provided by an embodiment of the present disclosure;

[0024] Figure 3 is a flow chart of another photon number measurement simulation method provided by an embodiment of the present disclosure;

[0025] Figure 4 It is the comparison matrix between the 4-dimensional tensor index and the linear index when c=2 (only the first 1 / 3 is shown);

[0026] Figure 5 is a structural schematic diagram of a photon number measurement simulation device 500 provided in an embodiment of the present disclosure;

[0027] Figure 6 A schematic block diagram of an example electronic device 600 that may be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0028] 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.

[0029] Photon number measurement is an important part of Gaussian state-based optical quantum computing. Although current research has given a mathematical representation of photon number measurement, there are still problems such as poor compatibility, unclear algorithm framework and logic in the specific implementation algorithm of computer languages ​​such as Python and C++.

[0030] In order to solve these problems, a scheme for efficient measurement of photon number in Gaussian state is proposed. By compressing high-dimensional tensors into one-dimensional vectors, the limitations of different code languages ​​on high-dimensional tensor operations are eliminated, the universality of algorithm implementation is expanded, and the dependence on third-party packages is solved.

[0031] Figure 1 It is a flow chart of a photon number measurement simulation method provided in the present disclosure. The method provided in this embodiment can be executed by an electronic device used for photon number simulation measurement. The electronic device can be a terminal or a server, which is not limited in this embodiment.

[0032] like Figure 1 As shown, the method includes:

[0033] Step 101, obtaining a first-order characterization matrix and a second-order characterization matrix of a Gaussian state.

[0034] Alternatively, the Gaussian state can be fully represented by a first-order characterization matrix and a second-order characterization matrix. The first-order characterization matrix and the second-order characterization matrix of an N-quantum mode Gaussian state are 2N-dimensional vectors respectively. And a 2N×2N square matrix V.

[0035] The first-order characterization matrix includes the coordinate elements and momentum elements of each quantum mode, and the second-order characterization matrix includes the covariance between any two of the sets of coordinate elements and momentum elements of each quantum mode.

[0036] Step 102, substitute the first-order characterization matrix and the second-order characterization matrix into the intermediate variable formula to obtain the intermediate variable, and substitute the first-order characterization matrix and the second-order characterization matrix into the zero-state probability formula to obtain the zero-state probability.

[0037] Among them, the zero state probability is the probability of the vacuum state. The intermediate variable is the parameter used to calculate the subsequent Hermite recursive polynomial.

[0038] Step 103, according to the mapping relationship between linear indices and tensor indices, for the subsequent linear indices of each target element to be calculated in the Hermite recursive polynomial, determine the previous linear index to which the reference element used to calculate any of the target elements belongs, wherein the tensor index corresponding to the previous linear index and the tensor index corresponding to the subsequent linear index satisfy the set rules.

[0039] In this step, since the Hermite recursive polynomial is a high-dimensional tensor, it is necessary to compress the high-dimensional tensor to one dimension to accommodate more languages. In order to achieve this goal, it is necessary to determine the linear indexes in the Hermite recursive polynomial based on the rules satisfied between the tensor indexes in the Hermite recursive polynomial in the relevant technology. In this embodiment, a mapping relationship between linear indices and tensor indices is proposed. According to the mapping relationship, the prior linear index to which the reference element used to calculate any of the target elements belongs is searched so that it meets the set rules between the tensor index corresponding to the prior linear index and the tensor index corresponding to the subsequent linear index.

[0040] Step 104, substituting the intermediate variables and each reference element into the Hermite recursive polynomial to obtain each target element in the one-dimensional vector after the Hermite tensor is compressed.

[0041] Optionally, the value of the first target element to be calculated in the Hermite recursive polynomial is initialized to a set value. For any target element, the reference element and the intermediate variable corresponding to the target element are substituted into the Hermite recursive polynomial to obtain the target element in the one-dimensional vector after the Hermite tensor is compressed.

[0042] Step 105 , performing sampling according to each target element in the one-dimensional vector and the zero-state probability to obtain a sampling distribution result.

[0043] In the disclosed embodiment, by obtaining the first-order characterization matrix and the second-order characterization matrix of the Gaussian state, the first-order characterization matrix and the second-order characterization matrix are substituted into the intermediate variable formula to obtain the intermediate variable, and the first-order characterization matrix and the second-order characterization matrix are substituted into the zero-state probability formula to obtain the zero-state probability. According to the mapping relationship between the linear index and the tensor index, for the subsequent linear index of each target element to be calculated in the Hermite recursive polynomial, the prior linear index to which the reference element used to calculate any of the target elements belongs is determined, wherein the tensor index corresponding to the prior linear index and the tensor index corresponding to the subsequent linear index satisfy the set rules. Then, the intermediate variables and each reference element are substituted into the Hermite recursive polynomial to obtain each target element in the one-dimensional vector after the Hermite tensor is compressed. According to each target element in the one-dimensional vector and the zero-state probability, sampling is performed to obtain a sampling distribution result. By compressing the high-dimensional Hermite tensor into one dimension, the problem of limited photon number measurement simulation caused by the fact that some computer languages ​​in related technologies do not support tensor operations is avoided, and the types of computer languages ​​applicable to photon number measurement simulation are expanded, so that more computer languages ​​can be used for photon number measurement simulation.

[0044] Figure 2 It is a flow chart of another photon number measurement simulation method provided in the present disclosure. The method provided in this embodiment can be executed by an electronic device used for photon number simulation measurement. The electronic device can be a terminal or a server, which is not limited in this embodiment.

[0045] like Figure 2 As shown, the method includes:

[0046] Step 201: Position replacement to obtain a first-order characterization matrix and a second-order characterization matrix of a Gaussian state.

[0047] Optionally, when the order of position variables and momentum variables in the first-order characterization matrix does not conform to the set order, the first-order characterization matrix of the Gaussian state is subjected to position permutation of position variables and momentum variables; and / or, when the order of position variables and momentum variables in the second-order characterization matrix does not conform to the set order, the second-order characterization matrix of the Gaussian state is subjected to position permutation of position variables and momentum variables. The set order includes that the ordering of each momentum variable is before the ordering of the position variable.

[0048] Step 202: Substitute the first-order characterization matrix and the second-order characterization matrix into the intermediate variable formula to obtain intermediate variables, and substitute the first-order characterization matrix and the second-order characterization matrix into the zero-state probability formula to obtain the zero-state probability.

[0049] Step 203, according to the mapping relationship between linear indices and tensor indices, for the subsequent linear indices of each target element to be calculated in the Hermite recursive polynomial, determine the prior linear index to which the reference element used to calculate any of the target elements belongs, wherein the tensor index corresponding to the prior linear index and the tensor index corresponding to the subsequent linear index satisfy that a difference vector obtained by subtracting the tensor index corresponding to the prior linear index from the tensor index corresponding to the subsequent linear index has and only has one value that is a set non-zero value, and the rest of the values ​​are zero; and the tensor index corresponding to the prior linear index does not contain negative numbers.

[0050] By setting this rule, the difference vector and the tensor index corresponding to the previous linear index are consistent with the definition in the related art.

[0051] Optionally, based on the set photon cutoff value and the dimension of the Hermite tensor, a reference matrix is ​​obtained, wherein the reference matrix is ​​used to indicate the mapping relationship between linear indices and tensor indices. According to the photon cutoff value c and the dimension y of the Hermite tensor, the number of elements l of the Hermite tensor is determined; according to the number of elements l of the Hermite tensor, a y×l zero matrix is ​​initialized; based on the photon cutoff value c and the row number of the zero matrix, the minimum cyclic unit of each row in the zero matrix is ​​determined; with the minimum cyclic unit of each row in the zero matrix, the zero matrix is ​​filled with the corresponding number of cycles to obtain the reference matrix.

[0052] Then, according to the subsequent linear index of any target element to be calculated, the mapping relationship between the linear index and the tensor index is queried to determine the tensor index corresponding to the subsequent linear index. Based on the initial tensor index corresponding to the prior linear index, it is verified whether the difference vector between the initial tensor index corresponding to the prior linear index and the tensor index corresponding to the subsequent linear index satisfies the set rule, wherein the difference vector obtained by subtracting the tensor index corresponding to the prior linear index from the tensor index corresponding to the subsequent linear index has only one value that is a set non-zero value, such as 1, and the rest are zero. And, the tensor index corresponding to the prior linear index does not contain negative numbers.

[0053] When the setting rule is met, the linear index corresponding to the initial tensor index is used as the previous linear index to which the reference element belongs.

[0054] When the setting rule is not satisfied, the initial tensor index corresponding to the previous linear index is continuously searched until the tensor index updated after the previous linear index that satisfies the setting rule is found.

[0055] Step 204 , substitute the intermediate variables and each reference element into the Hermite recursive polynomial to obtain each target element in the one-dimensional vector after the Hermite tensor is compressed.

[0056] Optionally, the value of the first target element to be calculated in the Hermite recursive polynomial is initialized to 1. For any target element, the reference element and the intermediate variable corresponding to the target element are substituted into the Hermite recursive polynomial to obtain the target element in the one-dimensional vector after the Hermite tensor is compressed.

[0057] Step 205 , sampling is performed according to each target element in the one-dimensional vector and the zero-state probability to obtain a sampling distribution result.

[0058] Optionally, according to each target element in the one-dimensional vector, a tensor index corresponding to the linear index of each target element is determined. For any target element, the target element and its corresponding tensor index, as well as the zero-state probability, are substituted into an expression of probability distribution to obtain a corresponding element in the probability distribution vector. Based on the probability distribution vector, the sampling distribution result is determined.

[0059] In the disclosed embodiment, by obtaining the first-order characterization matrix and the second-order characterization matrix of the Gaussian state, the first-order characterization matrix and the second-order characterization matrix are substituted into the intermediate variable formula to obtain the intermediate variable, and the first-order characterization matrix and the second-order characterization matrix are substituted into the zero-state probability formula to obtain the zero-state probability. According to the mapping relationship between the linear index and the tensor index, for the subsequent linear index of each target element to be calculated in the Hermite recursive polynomial, the prior linear index to which the reference element used to calculate any of the target elements belongs is determined, wherein the tensor index corresponding to the prior linear index and the tensor index corresponding to the subsequent linear index satisfy the set rules. Then, the intermediate variables and each reference element are substituted into the Hermite recursive polynomial to obtain each target element in the one-dimensional vector after the Hermite tensor is compressed. According to each target element in the one-dimensional vector and the zero-state probability, sampling is performed to obtain a sampling distribution result. By compressing the high-dimensional Hermite tensor into one dimension, the problem of limited photon number measurement simulation caused by the fact that some computer languages ​​in related technologies do not support tensor operations is avoided, and the types of computer languages ​​applicable to photon number measurement simulation are expanded, so that more computer languages ​​can be used for photon number measurement simulation.

[0060] Figure 3 It is a flow chart of another photon number measurement simulation method provided in an embodiment of the present disclosure. The method provided in this embodiment can be executed by an electronic device used for photon number simulation measurement. The electronic device can be a terminal or a server, which is not limited in this embodiment.

[0061] like Figure 3 As shown, the method includes:

[0062] Step 301 , performing coordinate and momentum position permutation on the first-order characterization matrix and the second-order characterization matrix of the Gaussian state.

[0063] The Gaussian state can be fully represented by the first-order characterization moment and the second-order characterization moment, denoted as and V. The first-order characterization matrix and the second-order characterization matrix of an N quantum mode Gaussian state are 2N-dimensional vectors respectively and a 2N×2N square matrix V,

[0064]

[0065]

[0066] in, The subscripts of are 1 to N, indicating the index of the corresponding quantum mode. Indicates the coordinate center position of the Gaussian distribution, which may be referred to as a coordinate element in this application.

[0067] The subscripts of are 1 to N, indicating the index of the corresponding quantum mode. represents momentum and may be referred to as a momentum element in this application.

[0068] cov(X,Y) represents the covariance of X and Y.

[0069] When simulating the measurement of the number of photons in the Gaussian state, we need to permute the coordinates and momentum of the first-order characterization matrix and the second-order characterization matrix of the Gaussian state, that is, the arrangement order is as follows:

[0070]

[0071] Optionally, the method for executing this step can be set to "xpxp2ppxx" to permute the first-order characterization matrix and the second-order characterization matrix of the Gaussian state to be simulated for photon number measurement, including coordinates and momentum, to meet subsequent calculation requirements and adapt to subsequent related formulas.

[0072] The “xpxp2ppxx” method takes two input parameters: (1) the first-order characterization matrix of the Gaussian state (2) The second-order characterization matrix V of the Gaussian state.

[0073] As a possible implementation, the number of quantum modes (qumode) N can be determined, i.e., the first-order characterization matrix half of the dimension; and initialize a zero matrix P of size 2N×2N erm, used to permute the coordinates and momentum positions. Next, gradually fill in elements to construct the specific form of the permutation matrix. Specifically, you can create a loop starting from 0 to N-1 with a step size of 1. In each iteration, the zero matrix P erm The element in the i-th row and 2i+1-th column of P is set to 1; erm The element in the N+ith row and 2ith column is also set to 1. Finally, according to the following formula: Calculate the permuted form of the first-order moment and the second-order moment, and output the permuted first-order representation matrix And the permuted second-order representation matrix V perm .

[0074] Step 302, define the set complex matrix U c , and determine the corresponding real matrix U plus , and the real matrix U mins .

[0075] Optionally, in order to simplify the subsequent formula calculation, the complex matrix U is defined c , real matrix U plus , and the real matrix U mins The addition of these parameters will make the formulas in the subsequent steps more concise.

[0076] For example:

[0077]

[0078] U mins =I 2N -2V perm ;

[0079] U plus =I 2N +2V perm .

[0080] Where I identifies the identity matrix. The subscript indicates the number of dimensions of the identity matrix.

[0081] Step 303, based on the first-order characterization matrix and the complex matrix U c , real matrix U plus and the real matrix U mins , and get the intermediate variables Y and R.

[0082] Optionally, the first-order characterization matrix and the complex matrix U c , real matrix U plus and the real matrix U mins , substitute into the intermediate variable formula to get the intermediate variable.

[0083] The intermediate variables include Y and R, which have corresponding intermediate variable formulas:

[0084]

[0085]

[0086] According to the complex matrix U c , define three matrices: U c The transposed matrix U c T , U c The conjugate matrix U c * , U c The transposed conjugate matrix of

[0087] As a possible implementation method, Y and R are important intermediate parameters in photon number measurement, which are complex vectors with dimensions of 2N and complex matrices of 2N×2N respectively. The method to implement this process is named "CalculateYandR" and inputs 4 parameters: (1) the first-order characterization matrix of the Gaussian state (2) A 2N×2N complex matrix U c ; (3) A 2N×2N real matrix U plus ; (4) A 2N×2N real matrix U mins Through this method, the intermediate variable formula is substituted into the above-mentioned intermediate variable formula, and the intermediate variables Y and R are output.

[0088] Step 304: Based on the first-order characterization matrix and the real matrix U plus , and get the zero state probability.

[0089] Optionally, the first-order characterization matrix and the real matrix U plus , substitute into the zero state (vacuum state) probability formula to obtain the zero state probability P0.

[0090]

[0091] As a possible implementation method, the probability corresponding to the zero state is calculated according to the following formula. The implementation function is “Calculate_P0”, which inputs two parameters: (1) the first-order characterization matrix of the Gaussian state (2) A 2N×2N real matrix U plus . Substitute into the above formula to output the zero state probability P0.

[0092] Step 305: Based on the intermediate variables Y and R, determine the one-dimensional vector after the Hermite tensor is compressed.

[0093] As a possible implementation method, high-dimensional Hermite polynomials are the core calculation step in photon number measurement. Its implementation method can be named "CalculateHermitePolynomials". This method inputs three parameters: (1) intermediate variable Y; (2) intermediate variable R; (3) photon cutoff value c.

[0094] It should be noted that the high-dimensional Hermite recursive polynomial itself is a high-dimensional tensor. However, due to different operations on high-dimensional tensors in different languages ​​and their third-party libraries, some languages ​​and development libraries can directly operate and index tensors, but other languages ​​and development libraries do not support high-dimensional tensor operations and only support one-dimensional and two-dimensional vector and matrix operations. Therefore, more generally, we compress the high-dimensional Hermite recursive polynomial into one dimension for processing at the algorithm level, which can be applied to almost all implementation languages. In this embodiment, the high-dimensional Hermite recursive polynomial is represented by H, and the compressed one-dimensional form is represented by H 1d To express.

[0095] In the recursive process to calculate H 1d Before we start, we need to obtain several variables: calculate the dimension y of the intermediate variable Y, that is, the length of vector Y; calculate H 1d The length of l = (c+1)y, and initialize a zero vector of length l to store the calculated H 1d result.

[0096] Since the calculation of the Hermite recursive polynomial is a recursive process, and in the process it is necessary to judge or calculate some intermediate variables according to the high-dimensional tensor index, this step is in H 1d It is difficult to achieve (because H 1d Only linear indexing is involved). Therefore, a function is needed to convert H 1d The linear index of is converted into the high-dimensional tensor index of H. The index conversion method can be named "GenerateTensorCoors" and called in this step to generate a comparison matrix X of one-dimensional vector linear index and high-dimensional tensor index. The i-th column vector of the comparison matrix X represents the high-dimensional tensor index vector when the linear index is i.

[0097] The Hermite recursion polynomial is as follows:

[0098]

[0099] Where m represents the high-dimensional tensor H m The tensor index of H m The calculation results and the preceding term and That is, the recursive process involves the previous and next indexes, such as the tensor index m and the tensor index me shown in the Hermite recursive polynomial above. k Therefore, the first high-dimensional index ω of the high-dimensional tensor H is initialized former , that is, a zero vector of length y, which is used as the tensor index corresponding to the previous linear index at the start of the recursion; in addition, referring to the related art, the first element of H is assigned a value of 1.

[0100] Next, we will calculate H one by one through a recursive process 1d Specifically, create the first layer of loops, i is initially 1, to l (also H 1d Dimensions), with a step size of 1. Note that although the default linear coordinates start counting from 0, H has been set 1d The first values ​​of and H are both 1, so the first element should be skipped in the loop, and the loop index starts from i=1, not i=0.

[0101] Calculating the Hermite tensor is a recursive process, and the recursive process often needs to calculate the current element value based on the previous element. Based on a pre-generated linear index and high-dimensional index comparison matrix X. According to the index i value of the current loop, the corresponding high-dimensional tensor coordinates are queried, and ω is used latter Indicates. Based on e k =ω latter -ω former , and e k In the definition of this paper, only the kth value is 1, and the rest are 0. Therefore, if we want to determine ω latter The corresponding ω former , it is necessary to calculate ω each time latter -ω former After getting the result, reset the non-zero elements in the result to 0 as the updated e k Based on this updated e k and ω latter Substitute e k =ω latter -ω former Determine former .

[0102] That is to say, the logic of "GenerateTensorCoors" is: according to the current index ω latter and the assumed ω former , let's try to find e k , so that ω latter -e k No negative numbers appear. If negative numbers appear, then e k Unchanged, but updatedω formerFirst, optionally, during the calculation process, you need to obtain e k The serial number k with the value of 1 in the , without storing the entire e k vector; secondly, due to e k Most of the k in ω are concentrated in the last term, so ω latter -ω former The result is judged from back to front. If the element value is 1, the current index is assigned to k, which saves more invalid loop times. In addition, if ω latter -ω former If a negative number appears, former The value after index k is assigned to 0. This is because ω latter -ω former There will be negative numbers, only when there is a carry, the index element value after the carry is 0, so it is necessary to former The value after index k is assigned to 0

[0103] Furthermore, according to ω former ,ω latter , k, using the aforementioned Hermite recursive polynomial to calculate H 1d The specific value of .

[0104] For example: define the first, second, and third terms on the right side of the Hermite recursive polynomial equal sign as H1, H2, and H3, all of which are 0; define an intermediate variable s as 0, and the linear index of H1 is 0.

[0105] Under the first loop, create a second loop, with j starting from 0 and going to y with a step length of 1; in each loop, calculate R kj Y j The value of is accumulated in s. In addition, the linear index is calculated. The result of judgment former Is the jth element in greater than 0? If so, calculate ω j =ω former -e j ; Define the linear index H of H2 and H3 23 is 0; create the third layer for loop to calculate H 23 Linear indices to compute H2 and H3 according to the Hermite recursion polynomial.

[0106] After exiting the second loop, we get The results, then according to H1 can be calculated. Summarize the current results, complete the i-th recursive relationship in the first layer loop, and store H1-H2-H3 in H 1d The i-th position of . And ω latter Assign to ωformer , enter the next cycle.

[0107] Step 306 , performing sampling based on the one-dimensional vector and the zero-state probability P0 to obtain a sampling distribution result.

[0108] As a possible implementation, this method is used to calculate the probability distribution of quantum states and further simulate the distribution of sampling results in real experiments. sampling The method in this part can be named "CalcuProbAndSimSamp". First, "CalcuProbAndSimSamp" calls the method "CalculateP0AndH" to obtain P0 and H 1d Next, calculate the probability distribution vector P 1d , the calculation process still involves the conversion between linear index and tensor index. In order to calculate P one by one 1d The elements in P are first calculated. 1d Length And initialize a zero vector of that length.

[0109] Under the photon number measurement, the probability distribution expression can be calculated by the following formula:

[0110]

[0111] Where m represents the quantum state represented by the number of photons.

[0112]

[0113] Next, calculate P in turn according to the above probability distribution expression 1d It should be noted that by default, values ​​less than 1×10 -15 The probability of is recorded as 0, and the calculated probability P 1d The normalization condition needs to be met for the subsequent sampling process, that is,

[0114]

[0115] Finally, according to the normalized probability distribution P 1d and the expected number of sampling s to simulate the real result. In this step, we will create a loop that repeats s times and in each loop according to P 1d Randomly generate a value between 0 and After the loop ends, we can obtain the final sampling distribution.

[0116] Furthermore, the control matrix can be Figure 4 As shown, Figure 4It is the comparison matrix between the 4-dimensional tensor index and the linear index when c=2 (only the first 1 / 3 is shown).

[0117] Specifically, the comparison matrix X can be generated in the following manner: the comparison matrix is ​​generated according to the set photon cutoff value and the dimension of the Hermite tensor, wherein in the comparison matrix, the linear index i is the column number in the comparison matrix X. That is, each column vector in the comparison matrix is ​​used to indicate the tensor index in the Hermite tensor, and the i-th column vector in the comparison matrix represents the tensor index corresponding to the linear index i.

[0118] As a possible implementation, the control matrix X generation method is named “GenerateTensorCoors” and takes two parameters: (1) the dimension y of the Hermite tensor; (2) the length of each dimension, i.e., c+1.

[0119] First, according to the photon cutoff value c and the dimension y of the Hermite tensor, the number of tensor elements l = (c+1)y is calculated; then, according to l, a y×l zero matrix is ​​initialized to form the final output comparison matrix X; the minimum repeating unit length l is initialized unit To implement a loop, set i from 0 to y-1; this step is to gradually fill each row in the matrix X.

[0120] Specifically, in each loop, we first define a minimum repeating unit u min =1×l min The zero matrix of u min The significance is to find the minimum repeating unit of the current filled row, the minimum repeating unit.

[0121] For example, Figure 4 The case where y=4 and c=2 is shown. In the third row, the minimum repeating unit u min There are 9 elements in total, l min =9, the 9 elements are 000111222; and in the 4th row, the smallest repeating unit has 3 elements, which are 012, l min Equals 3.

[0122] Finally calculate u min The number of times to repeat the current line

[0123]

[0124] It should be noted that the current u min It is still an empty vector, and we need to fill it with elements, from 0 to c. By similar logic, we can calculate the value of each value from 0 to c in u minThe number of repetitions n single-value ,Right now

[0125]

[0126] Therefore, we create a second for loop based on the first loop, setting j from 0 to c. In this loop, each time we move to u min Fill in the value j. In this way, we have completed the construction of a minimum repeating unit.

[0127] Even though we completed min The current row is not filled yet. Similarly, we create a loop, setting j to start from 0 and end at n. min -1. Gradually use u min Fill the current row.

[0128] Finally, it should be noted that since the length of the minimum repeating unit varies with the row number of the control matrix, n min is also changing. Therefore, after one layer of filling, we need to update l using the following formula min

[0129]

[0130] So far, we have completed the construction of the linear index and high-dimensional tensor index comparison matrix X.

[0131] In the disclosed embodiment, by obtaining the first-order characterization matrix and the second-order characterization matrix of the Gaussian state, the first-order characterization matrix and the second-order characterization matrix are substituted into the intermediate variable formula to obtain the intermediate variable, and the first-order characterization matrix and the second-order characterization matrix are substituted into the zero-state probability formula to obtain the zero-state probability. According to the mapping relationship between the linear index and the tensor index, for the subsequent linear index of each target element to be calculated in the Hermite recursive polynomial, the prior linear index to which the reference element used to calculate any of the target elements belongs is determined, wherein the tensor index corresponding to the prior linear index and the tensor index corresponding to the subsequent linear index satisfy the set rules. Then, the intermediate variables and each reference element are substituted into the Hermite recursive polynomial to obtain each target element in the one-dimensional vector after the Hermite tensor is compressed. According to each target element in the one-dimensional vector and the zero-state probability, sampling is performed to obtain a sampling distribution result. By compressing the high-dimensional Hermite tensor into one dimension, the problem of limited photon number measurement simulation caused by the fact that some computer languages ​​in related technologies do not support tensor operations is avoided, and the types of computer languages ​​applicable to photon number measurement simulation are expanded, so that more computer languages ​​can be used for photon number measurement simulation.

[0132] Figure 5is a schematic diagram of the structure of a photon number measurement simulation device 500 provided in an embodiment of the present disclosure. The device provided in this embodiment includes:

[0133] like Figure 5 As shown, the device includes: an acquisition module 501, a processing module 502, a mapping module 503, a recursive module 504 and a sampling module 505.

[0134] The acquisition module 501 is used to acquire the first-order characterization matrix and the second-order characterization matrix of the Gaussian state.

[0135] The processing module 502 is used to substitute the first-order characterization matrix and the second-order characterization matrix into the intermediate variable formula to obtain the intermediate variable, and substitute the first-order characterization matrix and the second-order characterization matrix into the zero-state probability formula to obtain the zero-state probability.

[0136] A mapping module 503 is used to determine, according to a mapping relationship between linear indices and tensor indices, a prior linear index to which a reference element used to calculate any target element to be calculated in a Hermite recursive polynomial, wherein a tensor index corresponding to the prior linear index and a tensor index corresponding to the subsequent linear index satisfy a set rule.

[0137] The recursive module 504 is used to substitute the intermediate variables and the reference elements into the Hermite recursive polynomial to obtain the target elements in the one-dimensional vector after the Hermite tensor is compressed.

[0138] The sampling module 505 is used to perform sampling according to each target element in the one-dimensional vector and the zero-state probability to obtain a sampling distribution result.

[0139] Optionally, the setting rules include: the difference vector obtained by subtracting the tensor index corresponding to the previous linear index from the tensor index corresponding to the subsequent linear index has only one value that is set to a non-zero value, and the remaining values ​​are zero; and the tensor index corresponding to the previous linear index does not contain negative numbers.

[0140] Optionally, the mapping module 503 is used to:

[0141] According to the subsequent linear index of any target element to be calculated, query the mapping relationship between the linear index and the tensor index, and determine the tensor index corresponding to the subsequent linear index;

[0142] Based on the initial tensor index corresponding to the previous linear index, verify whether the initial tensor index corresponding to the previous linear index and the tensor index corresponding to the subsequent linear index satisfy a set rule;

[0143] When the setting rule is met, the linear index corresponding to the initial tensor index is used as the previous linear index to which the reference element belongs.

[0144] Optionally, the mapping module 503 is further configured to:

[0145] When the setting rule is not satisfied, the initial tensor index corresponding to the previous linear index is updated based on the setting rule to obtain the tensor index after the previous linear index is updated.

[0146] Optionally, the recursive module 504 is further configured to:

[0147] Initialize the value of the first target element to be calculated in the Hermite recursive polynomial to be 1.

[0148] Optionally, the mapping module 503 is further configured to:

[0149] Based on the set photon cutoff value and the dimension of the Hermite tensor, a reference matrix is ​​obtained, wherein the reference matrix is ​​used to indicate a mapping relationship between linear indices and tensor indices.

[0150] Optionally, the mapping module 503 is further configured to:

[0151] The comparison matrix is ​​generated according to the set photon cutoff value and the dimension of the Hermite tensor, wherein each column vector in the comparison matrix is ​​used to indicate the tensor index in the Hermite tensor, and the i-th column vector in the comparison matrix represents the tensor index corresponding to the linear index i.

[0152] Optionally, the mapping module 503 is further configured to:

[0153] Determine the number of elements l of the Hermite tensor according to the photon cutoff value c and the dimension y of the Hermite tensor;

[0154] Initialize a y×l zero matrix according to the number of elements l of the Hermite tensor;

[0155] Determining the minimum cyclic unit of each row in the zero matrix based on the photon cutoff value c and the row number of the zero matrix;

[0156] The zero matrix is ​​filled with the corresponding number of cycles using the minimum cycle unit of each row in the zero matrix to obtain the control matrix.

[0157] Optionally, the processing module 502 is further configured to:

[0158] When the order of position variables and momentum variables in the first-order characterization matrix does not conform to the set order, the position of the position variables and momentum variables in the first-order characterization matrix of the Gaussian state is permuted; and / or,

[0159] When the order of position variables and momentum variables in the second-order characterization matrix does not conform to the set order, the positions of the position variables and momentum variables are permuted in the second-order characterization matrix of the Gaussian state.

[0160] Optionally, the processing module 502 is further configured to:

[0161] Get the set complex matrix U c ;

[0162] According to the second-order characterization matrix, determine the corresponding real matrix U plus , and the real matrix U mins ;

[0163] The first-order characterization matrix, the complex matrix U c , real matrix U plus and the real matrix U mins , substitute into the intermediate variable formula to obtain the intermediate variable;

[0164] The first-order characterization matrix and the real matrix U plus , substitute into the zero-state probability formula to obtain the zero-state probability.

[0165] Optionally, the processing module 502 is further configured to:

[0166] The first-order characterization matrix and the complex matrix U c and the real matrix U mins Substitute the formula corresponding to the Y intermediate variable in the intermediate variable formula to obtain the intermediate variable Y.

[0167] Optionally, the processing module 502 is further configured to:

[0168] The complex matrix U c , real matrix U plus and the real matrix U mins , substitute into the formula corresponding to the R intermediate variable in the intermediate variable formula to obtain the intermediate variable R.

[0169] Optionally, the sampling module 505 is used to:

[0170] According to each target element in the one-dimensional vector, determine the tensor index corresponding to the linear index of each target element;

[0171] For any of the target elements, substitute the target element and its corresponding tensor index, and the zero-state probability into the expression of the probability distribution to obtain the corresponding element in the probability distribution vector;

[0172] Based on the probability distribution vector, the sampling distribution result is determined.

[0173] Optionally, the sampling module 505 is used to:

[0174] Normalizing the probability distribution vector;

[0175] Based on the normalized probability distribution vector and the expected number of sampling times, random sampling is performed to obtain the sampling distribution result.

[0176] In the disclosed embodiment, by obtaining the first-order characterization matrix and the second-order characterization matrix of the Gaussian state, the first-order characterization matrix and the second-order characterization matrix are substituted into the intermediate variable formula to obtain the intermediate variable, and the first-order characterization matrix and the second-order characterization matrix are substituted into the zero-state probability formula to obtain the zero-state probability. According to the mapping relationship between the linear index and the tensor index, for the subsequent linear index of each target element to be calculated in the Hermite recursive polynomial, the prior linear index to which the reference element used to calculate any of the target elements belongs is determined, wherein the tensor index corresponding to the prior linear index and the tensor index corresponding to the subsequent linear index satisfy the set rules. Then, the intermediate variables and each reference element are substituted into the Hermite recursive polynomial to obtain each target element in the one-dimensional vector after the Hermite tensor is compressed. According to each target element in the one-dimensional vector and the zero-state probability, sampling is performed to obtain a sampling distribution result. By compressing the high-dimensional Hermite tensor into one dimension, the problem of limited photon number measurement simulation caused by the fact that some computer languages ​​in related technologies do not support tensor operations is avoided, and the types of computer languages ​​applicable to photon number measurement simulation are expanded, so that more computer languages ​​can be used for photon number measurement simulation.

[0177] 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.

[0178] Figure 6A schematic block diagram of an example electronic device 600 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.

[0179] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 602 or a computer program loaded from a storage unit 608 to a RAM (Random Access Memory) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An I / O (Input / Output) interface 606 is also connected to the bus 604.

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

[0181] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as the photon number measurement simulation method. For example, in some embodiments, the photon number measurement simulation method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the photon number measurement simulation method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to execute the photon number measurement simulation method in any other appropriate manner (eg, by means of firmware).

[0182] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may 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.

[0183] 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.

[0184] 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 device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0185] 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).

[0186] The systems and techniques described herein may 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 may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.

[0187] 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.

[0188] It should be noted that artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.

[0189] 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.

[0190] 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 photon number measurement simulation method, comprising: Obtain a first-order characterization matrix and a second-order characterization matrix of a Gaussian state; Substituting the first-order characterization matrix and the second-order characterization matrix into an intermediate variable formula to obtain an intermediate variable, and substituting the first-order characterization matrix and the second-order characterization matrix into a zero-state probability formula to obtain a zero-state probability; According to the mapping relationship between the linear index and the tensor index, for the subsequent linear index of each target element to be calculated in the Hermite recursive polynomial, determine the previous linear index to which the reference element used to calculate any of the target elements belongs, wherein the tensor index corresponding to the previous linear index and the tensor index corresponding to the subsequent linear index satisfy the set rule; Substituting the intermediate variable and each reference element into the Hermite recursive polynomial to obtain each target element in the one-dimensional vector after Hermite tensor compression; Sampling is performed according to each target element in the one-dimensional vector and the zero-state probability to obtain a sampling distribution result.

2. The method according to claim 1, wherein: The setting rules include: The difference vector obtained by subtracting the tensor index corresponding to the previous linear index from the tensor index corresponding to the subsequent linear index has only one value set to a non-zero value, and the remaining values ​​are zero; and The tensor indices corresponding to the prior linear indices do not contain negative numbers.

3. The method according to claim 2, wherein: The determining, according to the mapping relationship between the linear index and the tensor index, for the subsequent linear index of each target element to be calculated in the Hermite recursive polynomial, a prior linear index to which a reference element for calculating any of the target elements belongs includes: According to the subsequent linear index of any target element to be calculated, query the mapping relationship between the linear index and the tensor index, and determine the tensor index corresponding to the subsequent linear index; Based on the initial tensor index corresponding to the previous linear index, verify whether the initial tensor index corresponding to the previous linear index and the tensor index corresponding to the subsequent linear index satisfy a set rule; When the setting rule is met, the linear index corresponding to the initial tensor index is used as the previous linear index to which the reference element belongs.

4. The method according to claim 3, wherein: The method further comprises: When the setting rule is not satisfied, the initial tensor index corresponding to the previous linear index is updated based on the setting rule to obtain the tensor index after the previous linear index is updated.

5. The method according to any one of claims 1 to 4, wherein: The method further comprises: Initialize the value of the first target element to be calculated in the Hermite recursive polynomial to be 1.

6. The method according to any one of claims 1 to 4, wherein: The method further comprises: Based on the set photon cutoff value and the dimension of the Hermite tensor, a reference matrix is ​​obtained, wherein the reference matrix is ​​used to indicate a mapping relationship between linear indices and tensor indices.

7. The method according to claim 6, wherein: The method further comprises: The comparison matrix is ​​generated according to the set photon cutoff value and the dimension of the Hermite tensor, wherein each column vector in the comparison matrix is ​​used to indicate the tensor index in the Hermite tensor, and the i-th column vector in the comparison matrix represents the tensor index corresponding to the linear index i.

8. The method according to claim 7, wherein: The generating the comparison matrix according to the set photon cutoff value and the dimension of the Hermite tensor comprises: Determine the number of elements l of the Hermite tensor according to the photon cutoff value c and the dimension y of the Hermite tensor; Initialize a y×l zero matrix according to the number of elements l of the Hermite tensor; Determining the minimum cyclic unit of each row in the zero matrix based on the photon cutoff value c and the row number of the zero matrix; The zero matrix is ​​filled with the corresponding number of cycles using the minimum cycle unit of each row in the zero matrix to obtain the control matrix.

9. The method according to any one of claims 1 to 4, wherein: Substituting the first-order characterization matrix and the second-order characterization matrix into the intermediate variable formula to obtain the intermediate variable, and substituting the first-order characterization matrix and the second-order characterization matrix into the zero-state probability formula to obtain the zero-state probability, further comprising: When the order of position variables and momentum variables in the first-order characterization matrix does not conform to the set order, the position of the position variables and momentum variables in the first-order characterization matrix of the Gaussian state is permuted; and / or, When the order of position variables and momentum variables in the second-order characterization matrix does not conform to the set order, the positions of the position variables and momentum variables are permuted in the second-order characterization matrix of the Gaussian state.

10. The method according to any one of claims 1 to 4, wherein: Substituting the first-order characterization matrix and the second-order characterization matrix into an intermediate variable formula to obtain an intermediate variable, and substituting the first-order characterization matrix and the second-order characterization matrix into a zero-state probability formula to obtain a zero-state probability, includes: Get the set complex matrix U c ; According to the second-order characterization matrix, determine the corresponding real matrix U plus , and the real matrix U mins ; The first-order characterization matrix and the complex matrix U c , real matrix U plus and the real matrix U mins , substitute into the intermediate variable formula to obtain the intermediate variable; The first-order characterization matrix and the real matrix U plus , substitute into the zero-state probability formula to obtain the zero-state probability.

11. The method according to claim 10, wherein: The first-order characterization matrix and the complex matrix U c , real matrix U plus and the real matrix U mins , substituting into the intermediate variable formula to obtain the intermediate variable, including: The first-order characterization matrix and the complex matrix U c and the real matrix U mins Substitute the formula corresponding to the Y intermediate variable in the intermediate variable formula to obtain the intermediate variable Y.

12. The method according to claim 10, wherein: The first-order characterization matrix and the complex matrix U c , real matrix U plus and the real matrix U mins , substituting into the intermediate variable formula to obtain the intermediate variable, including: The complex matrix U c , real matrix U plus and the real matrix U mins , substitute into the formula corresponding to the R intermediate variable in the intermediate variable formula to obtain the intermediate variable R.

13. The method according to any one of claims 1 to 4, wherein: The sampling is performed according to each target element in the one-dimensional vector and the zero-state probability to obtain a sampling distribution result, including: According to each target element in the one-dimensional vector, determine the tensor index corresponding to the linear index of each target element; For any of the target elements, substitute the target element and its corresponding tensor index, and the zero-state probability into the expression of the probability distribution to obtain the corresponding element in the probability distribution vector; Based on the probability distribution vector, the sampling distribution result is determined.

14. The method according to claim 13, wherein: The determining the sampling distribution result based on the probability distribution vector includes: Normalizing the probability distribution vector; Based on the normalized probability distribution vector and the expected number of sampling times, random sampling is performed to obtain the sampling distribution result.

15. A photon number measurement simulation device, comprising: An acquisition module, used for acquiring a first-order characterization matrix and a second-order characterization matrix of a Gaussian state; A processing module, used for substituting the first-order characterization matrix and the second-order characterization matrix into an intermediate variable formula to obtain an intermediate variable, and substituting the first-order characterization matrix and the second-order characterization matrix into a zero-state probability formula to obtain a zero-state probability; A mapping module, for determining, according to a mapping relationship between a linear index and a tensor index, a prior linear index to which a reference element for calculating any target element belongs for a subsequent linear index of each target element to be calculated in a Hermite recursive polynomial, wherein a tensor index corresponding to the prior linear index and a tensor index corresponding to the subsequent linear index satisfy a set rule; A recursive module, used for substituting the intermediate variable and each reference element into the Hermite recursive polynomial to obtain each target element in the one-dimensional vector after Hermite tensor compression; The sampling module is used to perform sampling according to each target element in the one-dimensional vector and the zero-state probability to obtain a sampling distribution result.

16. The device according to claim 15, wherein: The setting rules include: The difference vector obtained by subtracting the tensor index corresponding to the previous linear index from the tensor index corresponding to the subsequent linear index has only one value set to a non-zero value, and the remaining values ​​are zero; and The tensor indices corresponding to the prior linear indices do not contain negative numbers.

17. The device according to claim 16, wherein: The mapping module is used to: According to the subsequent linear index of any target element to be calculated, query the mapping relationship between the linear index and the tensor index, and determine the tensor index corresponding to the subsequent linear index; Based on the initial tensor index corresponding to the previous linear index, verify whether the initial tensor index corresponding to the previous linear index and the tensor index corresponding to the subsequent linear index satisfy a set rule; When the setting rule is met, the linear index corresponding to the initial tensor index is used as the previous linear index to which the reference element belongs.

18. The device according to claim 17, wherein: The mapping module is further used for: When the setting rule is not satisfied, the initial tensor index corresponding to the previous linear index is updated based on the setting rule to obtain the tensor index after the previous linear index is updated.

19. The device according to any one of claims 15 to 18, wherein: The recursive module is also used for: Initialize the value of the first target element to be calculated in the Hermite recursive polynomial to be 1.

20. The device according to any one of claims 15 to 18, wherein: The mapping module is further used for: Based on the set photon cutoff value and the dimension of the Hermite tensor, a reference matrix is ​​obtained, wherein the reference matrix is ​​used to indicate a mapping relationship between linear indices and tensor indices.

21. The device according to claim 20, wherein: The mapping module is further used for: The comparison matrix is ​​generated according to the set photon cutoff value and the dimension of the Hermite tensor, wherein each column vector in the comparison matrix is ​​used to indicate the tensor index in the Hermite tensor, and the i-th column vector in the comparison matrix represents the tensor index corresponding to the linear index i.

22. The device according to claim 21, wherein The mapping module is further used for: Determine the number of elements l of the Hermite tensor according to the photon cutoff value c and the dimension y of the Hermite tensor; Initialize a y×l zero matrix according to the number of elements l of the Hermite tensor; Determining the minimum cyclic unit of each row in the zero matrix based on the photon cutoff value c and the row number of the zero matrix; The zero matrix is ​​filled with the corresponding number of cycles using the minimum cycle unit of each row in the zero matrix to obtain the control matrix.

23. The device according to any one of claims 15 to 18, wherein: The processing module is further used for: When the order of position variables and momentum variables in the first-order characterization matrix does not conform to the set order, the position of the position variables and momentum variables in the first-order characterization matrix of the Gaussian state is permuted; and / or, When the order of position variables and momentum variables in the second-order characterization matrix does not conform to the set order, the positions of the position variables and momentum variables are permuted in the second-order characterization matrix of the Gaussian state.

24. The device according to any one of claims 15 to 18, wherein: The processing module is further used for: Get the set complex matrix U c ; According to the second-order characterization matrix, determine the corresponding real matrix U plus , and the real matrix U mins ; The first-order characterization matrix and the complex matrix U c , real matrix U plus and the real matrix U mins , substitute into the intermediate variable formula to obtain the intermediate variable; The first-order characterization matrix and the real matrix U plus , substitute into the zero-state probability formula to obtain the zero-state probability.

25. The device according to claim 24, wherein: The processing module is further used for: The first-order characterization matrix and the complex matrix U c and the real matrix U mins Substitute the formula corresponding to the Y intermediate variable in the intermediate variable formula to obtain the intermediate variable Y.

26. The device according to claim 24, wherein: The processing module is further used for: The complex matrix U c , real matrix U plus and the real matrix U mins , substitute into the formula corresponding to the R intermediate variable in the intermediate variable formula to obtain the intermediate variable R.

27. The device according to any one of claims 15 to 18, wherein: The sampling module is used for: According to each target element in the one-dimensional vector, determine the tensor index corresponding to the linear index of each target element; For any of the target elements, substitute the target element and its corresponding tensor index, and the zero-state probability into the expression of the probability distribution to obtain the corresponding element in the probability distribution vector; Based on the probability distribution vector, the sampling distribution result is determined.

28. The device according to claim 27, wherein The sampling module is used for: Normalizing the probability distribution vector; Based on the normalized probability distribution vector and the expected number of sampling times, random sampling is performed to obtain the sampling distribution result.

29. 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 perform the method according to any one of claims 1 to 14.

30. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-14.

31. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Bayesian quantum dissipation environment parameter estimation method based on Gaussian state and homodyne measurement

    CN116822126A

  • Quantum Computer with Exact Compression of Quantum States

    US20210374550A1