Measurement simulation method, device, equipment and storage medium for quantum circuit
By extracting elements of the target quantum mode as a representation in quantum circuit simulation, random sampling and conditional state representation matrix determination are solved, and the problems of high time complexity and high zero-difference measurement complexity in Gaussian quantum circuit simulation are improved. efficiency.
Patent Information
- Application Number
- CN202311330954.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-13
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2043-10-13
AI Technical Summary
In the Gaussian state-based quantum circuit simulation, the problem of high time complexity and low efficiency, especially the time complexity of the quantum gate to the Gaussian state transformation is O(N3), and the implementation steps of zero-difference measurement are cumbersome and complex, and the implementation of zero-difference measurement is high. , resulting in cumbersome calculation steps and low efficiency.
By obtaining the representation matrix of the initial Gaussian state, transform according to the transformation function of the quantum gate in the quantum line, extract elements of the target quantum mode as the representation, random sampling is performed to determine the zero-difference measurement result, and the Gaussian is characterized by the characterization and transformation of the target quantum mode and the Gaussian is obtained according to the characterization and transformation of the target quantum mode. The state characterization matrix determines the measured conditional state characterization matrix, and directly extracts the required elements to reduce the amount of calculation and reduce the time complexity.
The calculation amount during the calculation process is greatly reduced, the time complexity of the calculation is reduced, the calculation steps are simplified, the efficiency of the simulation process is improved, the two rearrangements are avoided, and more efficient quantum circuit simulation is achieved.
Smart Images

Figure CN117391208B_ABST
Abstract
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 measurement simulation method, device, equipment and storage medium for quantum circuits. Background Art
[0002] In the research and development of quantum circuits based on Gaussian states, the cost of directly building a hardware platform to verify algorithms or hardware devices is very high. A more economical solution is to conduct small-scale simulations in classical computers to verify the effectiveness, and then conduct large-scale construction and deployment, which can reduce costs.
[0003] In the quantum circuit simulation algorithm based on Gaussian state, there are situations with high time complexity and low efficiency. Summary of the invention
[0004] The present disclosure provides a measurement simulation method, apparatus, device and storage medium for quantum circuits.
[0005] According to one aspect of the present disclosure, a measurement simulation method for a quantum circuit is provided, comprising:
[0006] Obtain the characterization matrix of the initial Gaussian state;
[0007] According to the transformation function of the quantum gate in the quantum circuit, the characterization matrix of the initial Gaussian state is transformed to obtain the characterization matrix of the transformed Gaussian state;
[0008] Extracting an element corresponding to a target quantum mode from the characterization matrix of the transformed Gaussian state as a characterization of the target quantum mode, and performing random sampling to determine a homodyne measurement result of the target quantum mode;
[0009] According to the characterization of the target quantum mode and the characterization matrix of the Gaussian state after the transformation, the characterization matrix of the conditional state after the measurement of the target quantum mode is determined.
[0010] According to another aspect of the present disclosure, a measurement simulation device for a quantum circuit is provided, comprising:
[0011] An acquisition module, used for acquiring a representation matrix of an initial Gaussian state;
[0012] A transformation module, used for transforming the characterization matrix of the initial Gaussian state according to the transformation function of the quantum gate in the quantum circuit to obtain the characterization matrix of the transformed Gaussian state;
[0013] An extraction module, used to extract an element corresponding to a target quantum mode from the characterization matrix of the transformed Gaussian state as a characterization of the target quantum mode, and to perform random sampling to determine a homodyne measurement result of the target quantum mode;
[0014] The determination module is used to determine the characterization matrix of the conditional state after measuring the target quantum mode according to the characterization of the target quantum mode and the characterization matrix of the Gaussian state after the transformation.
[0015] 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.
[0016] 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.
[0017] 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.
[0018] The present disclosure provides a measurement simulation method and device for quantum circuits, which obtains a characterization matrix of an initial Gaussian state, transforms the characterization matrix of the initial Gaussian state according to the transformation function of the quantum gate in the quantum circuit, and obtains a characterization matrix of the transformed Gaussian state. Then, from the characterization matrix of the transformed Gaussian state, the elements corresponding to the target quantum mode are extracted as the characterization of the target quantum mode, so as to randomly sample and determine the zero-difference measurement result of the target quantum mode, and determine the characterization matrix of the conditional state after the target quantum mode is measured according to the characterization of the target quantum mode and the characterization matrix of the transformed Gaussian state. Since the elements corresponding to the target quantum mode are directly extracted as the characterization of the target quantum mode when performing zero-difference measurement simulation on the target quantum mode, the amount of calculation in the operation process is greatly reduced, the time complexity of the calculation is reduced, and the entire simulation process can be executed more efficiently.
[0019] 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
[0020] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0021] Figure 1 A schematic diagram of a flow chart of a method for measuring and simulating a user quantum circuit provided in an embodiment of the present disclosure;
[0022] Figure 2 A schematic diagram of a flow chart of another quantum circuit measurement simulation method provided by an embodiment of the present disclosure;
[0023] Figure 3 A schematic diagram of the structure of a measurement simulation device 300 for a quantum circuit provided by an embodiment of the present disclosure;
[0024] Figure 4 A schematic block diagram of an example electronic device 400 that may be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0025] 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.
[0026] In the quantum circuit simulation algorithm based on Gaussian states, there are problems of high time complexity and low efficiency.
[0027] First, the time complexity of quantum gate transformation to Gaussian state is high. When the existing method realizes the transformation of quantum gate to Gaussian state, each quantum mode (qumode) needs to be executed 16N times. 3 +4N 2 multiplication operations and 16N 3 -4N 2 The time complexity of addition operation is O(N 3 ). However, in general, a quantum circuit usually has a lot of quantum gates. Especially in the field of machine learning using Gaussian state-based optical circuits, its performance is directly affected by the depth of the quantum circuit. Therefore, quantum circuit simulation based on the original method is very inefficient when facing large-scale quantum circuits.
[0028] Secondly, the implementation steps of homodyne measurement are cumbersome and complex. In the related art, homodyne measurement needs to implement a rearrangement process in the initial stage to reorganize the first-order moment and second-order moment of the Gaussian state. After performing the measurement, it is also necessary to implement an inverse process to reorganize the conditional quantum state into the form of 2N quantum modes. However, this only implements the measurement of one quantum mode. When simulating large-scale quantum circuits, the number of quantum modes and the number of quantum modes that need to be measured are often large. In addition, the above process assumes that under the condition of one sampling, the statistical number of measurements (number of samplings) directly affects the error bar of the result, and the number of samplings often needs to be set larger. In summary, considering the actual simulation performance, the calculation steps of the original algorithm are cumbersome, the complexity is high, and the efficiency is low.
[0029] In the disclosed embodiment, when performing zero-difference measurement simulation on the target quantum mode, the elements corresponding to the target quantum mode are directly extracted as the representation of the target quantum mode, which greatly reduces the amount of calculation in the operation process, reduces the time complexity of the calculation, and avoids the process of two rearrangements. The entire simulation process can be executed more efficiently.
[0030] Figure 1 A flow chart of a method for measuring and simulating a user quantum circuit provided by an embodiment of the present disclosure is shown as follows: Figure 1 As shown, it can be executed by an electronic device for simulating quantum circuits, and the electronic device can be a server, a terminal, etc., which is not limited in this embodiment.
[0031] like Figure 1 As shown, including:
[0032] Step 101, obtaining a characterization matrix of an initial Gaussian state.
[0033] Among them, the characterization matrix includes the first-order characterization matrix and the second-order characterization matrix. The Gaussian state can be fully represented by the first-order characterization moment and the second-order characterization moment, which can be expressed 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,
[0034]
[0035] 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.
[0036] 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.
[0037] cov(X,Y) represents the covariance of X and Y.
[0038] Step 102, transforming the characterization matrix of the initial Gaussian state according to the transformation function of the quantum gate in the quantum circuit to obtain the characterization matrix of the transformed Gaussian state.
[0039] In the framework of Gaussian state quantum circuits, there are several commonly used quantum gates, such as phase gates, single-mode compression gates, controlled phase gates, beam splitters, and dual-mode compression gates. Each quantum gate corresponds to a set of symplectic transformations (S, d), where S represents a linear transformation and d represents a translation operation. The transformation of the Gaussian state by the quantum gate is equivalent to the transformation of the first-order characterization matrix and the second-order characterization matrix of the Gaussian state, which can be expressed as,
[0040]
[0041] It should be noted that, assuming that the quantum circuit has N quantum modes, that is, N-qumode Gaussian state. If a single quantum mode quantum gate is executed on the kth quantum mode according to (Formula 2), S and d must first be expanded to a 2N×2N matrix and a 2N-dimensional vector, that is, (Formula 3) and (Formula 4), through direct summation, and then substituted into (Formula 2), that is,
[0042]
[0043]
[0044] Where I and 0 represent the 2×2 identity matrix and the 2-dimensional zero matrix respectively.
[0045] Step 103, extracting the element corresponding to the target quantum mode from the characterization matrix of the transformed Gaussian state as the characterization of the target quantum mode, and performing random sampling to determine the homodyne measurement result of the target quantum mode.
[0046] Optionally, the target quantum mode is the quantum mode to be measured. From the characterization matrix of the transformed Gaussian state, the element corresponding to the target quantum mode is extracted as the characterization of the target quantum mode. As a possible implementation method, the index of the target quantum mode is k, where the value range of k is an integer between 0 and N; N is the total number of quantum modes contained in the quantum circuit. Furthermore, according to the index k of the target quantum mode, the coordinate element corresponding to the index k is extracted from the first-order characterization matrix of the transformed Gaussian state. The covariance element between the coordinate elements corresponding to the index k is extracted from the characterization of the target quantum mode. Random sampling is performed in a Gaussian distribution centered on the coordinate element and with a variance of the covariance element to obtain the zero-difference measurement result of the target quantum mode.
[0047] Step 104, determining a characterization matrix of a conditional state after measuring the target quantum mode according to the characterization of the target quantum mode and the characterization matrix of the Gaussian state after transformation.
[0048] At the simulation level, the simulation of homodyne measurement needs to achieve two goals: (1) obtain the homodyne measurement result after performing homodyne measurement on the target quantum mode, denoted as u; (2) calculate the first-order representation matrix of the conditional state after measurement and the second-order representation matrix V condition form.
[0049] In the previous step 103, the homodyne measurement result u has been obtained, and in this step, the characterization matrix of the conditional state is calculated.
[0050] Step 105 , performing measurement simulation based on the homodyne measurement result and the characterization matrix of the conditional state after the target quantum mode measurement.
[0051] Optionally, the homodyne measurement result and the characterization matrix of the conditional state after the target quantum mode is measured are output as the result obtained by measuring and simulating the target quantum mode.
[0052] In this embodiment, the characterization matrix of the initial Gaussian state is obtained, and the characterization matrix of the initial Gaussian state is transformed according to the transformation function of the quantum gate in the quantum circuit to obtain the characterization matrix of the transformed Gaussian state. Then, from the characterization matrix of the transformed Gaussian state, the elements corresponding to the target quantum mode are extracted as the characterization of the target quantum mode, so as to determine the characterization matrix of the conditional state after the target quantum mode is measured according to the characterization of the target quantum mode and the characterization matrix of the transformed Gaussian state. It can be seen that when performing homodyne measurement simulation on the target quantum mode, the elements corresponding to the target quantum mode are directly extracted as the characterization of the target quantum mode, which greatly reduces the amount of calculation in the operation process, reduces the time complexity of the calculation, and avoids the process of two rearrangements, so that the entire simulation process can be executed more efficiently.
[0053] As a possible implementation method, according to the characterization of the target quantum mode and the characterization matrix of the Gaussian state after transformation, the first-order characterization matrix of the conditional state after the target quantum mode is measured is determined: , determine the column vector based on the elements of the 2kth column, substitute the first-order characterization matrix and column vector of the transformed Gaussian state into the set first-order formula, and obtain the first-order characterization matrix of the conditional state. The first-order formula is used to indicate that the first-order characterization matrix of the conditional state is determined based on the difference between the first-order characterization matrix of the transformed Gaussian state and the column vector. In the first-order formula, the column vector has a corresponding first coefficient, and the first coefficient corresponding to the column vector in the first-order formula can be determined according to the difference between the coordinate element and the zero-difference measurement result, and according to the covariance element. Finally, reset the element corresponding to the target quantum mode in the first-order characterization matrix of the conditional state to zero.
[0054] Optionally, according to the characterization of the target quantum mode and the characterization matrix of the Gaussian state after the transformation, the second-order characterization matrix V of the conditional state after the target quantum mode is measured is determined: condition When determining the column vector based on the elements of the 2kth column, the column vector is multiplied by the transposed product of the column vector, and the second-order characterization matrix of the transformed Gaussian state is substituted into the set second-order formula to obtain the second-order characterization matrix of the conditional state. The second-order formula is used to indicate the second-order characterization matrix of the conditional state, which is determined based on the difference between the second-order characterization matrix of the transformed Gaussian state and the product. In the second-order formula, the product has a corresponding second coefficient, and the covariance element between the coordinates corresponding to the index k can be extracted from the second-order characterization matrix of the transformed Gaussian state, and the second coefficient is determined based on the covariance element. Finally, the submatrix corresponding to the target quantum mode in the second-order characterization matrix of the conditional state is reset to the unit matrix, and the elements associated with the target quantum mode are reset to zero.
[0055] It can be seen that compared with the prior art, two rearrangements are required to organize the matrix into the required form, while in this embodiment, the rearrangement step is not required, and the required elements can be directly extracted and substituted into the first-order formula and the second-order formula for calculation, thereby simplifying the calculation process.
[0056] Figure 2 A schematic diagram of a flow chart of another quantum circuit measurement simulation method provided by an embodiment of the present disclosure, such as Figure 2 As shown, it can be executed by an electronic device for simulating quantum circuits, and the electronic device can be a server, a terminal, etc., which is not limited in this embodiment.
[0057] Step 201, input the number N of set quantum modes of the quantum circuit to be simulated.
[0058] Step 202: Determine the first-order characterization matrix and the second-order characterization matrix of the initial Gaussian state according to the input quantity N.
[0059] Optionally, a first-order characterization matrix and a second-order characterization matrix of N quantum mode Gaussian states are respectively a 2N-dimensional zero vector and a 2N×2N identity matrix.
[0060] Step 203: input the action sequence of the quantum gates in the quantum circuit.
[0061] The action sequence of quantum gates in a quantum circuit is used to indicate the quantum gates contained in the quantum circuit and the order of the quantum gates.
[0062] Step 204 , determining the type of each quantum gate, and calling the corresponding transformation function based on the quantum gate type to perform transformation operations on the first-order characterization matrix and the second-order characterization matrix of the initial Gaussian state.
[0063] Optionally, transformation functions corresponding to each quantum gate type are pre-stored, and the corresponding transformation functions are sequentially called based on the quantum gate type in accordance with the action sequence to perform transformation operations on the first-order characterization matrix and the second-order characterization matrix of the initial Gaussian state.
[0064] For example, when the quantum gate type is Phase gate, also known as phase gate or rotation gate, the symplectic transformation (S, d) of this type of quantum gate is:
[0065]
[0066] Among them, φ is the phase parameter of the phase gate.
[0067] Step 205, traverse each quantum gate in the quantum circuit in sequence until all transformation operations are completed.
[0068] Step 206, obtaining a first-order characterization matrix and a second-order characterization matrix of the transformed Gaussian state.
[0069] Alternatively, the first-order characterization matrix of the transformed Gaussian state can be written as The second-order characterization matrix of the transformed Gaussian state can be denoted as V.
[0070] Step 207 , simulating homodyne measurement based on the first-order characterization matrix and the second-order characterization matrix of the transformed Gaussian state.
[0071] Optionally, in this step, the input is: the first-order characterization matrix of the transformed Gaussian state and a second-order characterization matrix V, as well as an array consisting of the indices of the quantum modes on which measurements are to be performed.
[0072] According to the index of the first quantum mode in the array composed of the indices of the quantum modes to be measured, a homodyne measurement is simulated to obtain the result u obtained after random sampling during the simulated homodyne measurement, and the result is stored, and the first-order characterization matrix and second-order characterization moment of the conditional state after the measurement of the quantum mode are obtained.
[0073] Based on the first-order characterization matrix and second-order characterization moment of the conditional state after the measurement of the quantum mode, the simulated homodyne measurement is performed again according to the index of the first quantum mode in the array composed of the index of the quantum mode to be measured, and the cycle is repeated until the homodyne measurement of each quantum mode in the array is completed.
[0074] The homodyne measurement process performed for each target quantum mode k is as follows:
[0075] The index of the target quantum mode is known to be k, and the 2kth and 2k+1th columns are directly extracted from the second-order representation matrix V of the transformed Gaussian state, denoted as R k , which is a 2N×2 matrix,
[0076]
[0077] in,
[0078]
[0079]
[0080] From the first-order characterization matrix of the transformed Gaussian state Extract the coordinate element corresponding to index k from Extract the coordinate element corresponding to k The covariance elements between in, For the sake of simplicity, it can be recorded as variance B 11 . In the coordinate element is centered, and its variance is the covariance element B 11 Gaussian distribution Random sampling is performed in the process, and the random value obtained by random sampling is used as the homodyne measurement result u of the target quantum mode. The random sampling process simulates the process of random changes in the measured value caused by hardware or software factors during the measurement process.
[0081] Among them, the distribution of the random value u of random sampling is shown in the following formula:
[0082]
[0083] After obtaining the zero-difference measurement result of the target quantum mode with the current index k, it is also necessary to store the zero-difference measurement result of the target quantum mode with the determined index k and perform the following steps to reorganize the first-order characterization matrix and the second-order characterization matrix of the Gaussian state to obtain the first-order characterization matrix and the second-order characterization matrix of the conditional state.
[0084] The first-order formula for determining the first-order characterization matrix of the conditional state is as follows:
[0085]
[0086] The second-order formula for determining the second-order characterization matrix of the conditional state is as follows:
[0087]
[0088] Will V. Substituting and u into the above first-order formula and second-order formula, we can get the first-order representation matrix of the conditional state and the second-order representation matrix V condition Compared with the conditional state formula in the prior art, substituting fixed parameters simplifies the formula, reduces the calculation steps to a certain extent, and further improves the calculation efficiency.
[0089] Then, the elements corresponding to the target quantum mode in the first-order characterization matrix of the conditional state are reset to zero. The submatrix corresponding to the target quantum mode in the second-order characterization matrix of the conditional state is reset to the unit matrix, and the elements associated with the target quantum mode are reset to zero. The characterization matrix is reorganized.
[0090] Step 208: output simulation results.
[0091] Optionally, all stored random sampling results are output as the results of this simulation.
[0092] In this embodiment, the characterization matrix of the initial Gaussian state is obtained, and the characterization matrix of the initial Gaussian state is transformed according to the transformation function of the quantum gate in the quantum circuit to obtain the characterization matrix of the transformed Gaussian state. Then, from the characterization matrix of the transformed Gaussian state, the elements corresponding to the target quantum mode are extracted as the characterization of the target quantum mode, so as to determine the characterization matrix of the conditional state after the target quantum mode is measured according to the characterization of the target quantum mode and the characterization matrix of the transformed Gaussian state. It can be seen that when performing homodyne measurement simulation on the target quantum mode, the elements corresponding to the target quantum mode are directly extracted as the characterization of the target quantum mode, which greatly reduces the amount of calculation in the operation process, reduces the time complexity of the calculation, and avoids the process of two rearrangements, so that the entire simulation process can be executed more efficiently.
[0093] Figure 3 A schematic diagram of a measurement simulation device 300 for a quantum circuit provided by an embodiment of the present disclosure is shown in FIG. Figure 3 As shown, it includes: an acquisition module 301, a transformation module 302, an extraction module 303, a determination module 304 and a simulation module 305.
[0094] An acquisition module 301 is used to acquire a characterization matrix of an initial Gaussian state;
[0095] A transformation module 302, configured to transform the characterization matrix of the initial Gaussian state according to a transformation function of a quantum gate in a quantum circuit, to obtain a characterization matrix of a transformed Gaussian state;
[0096] The extraction module 303 is used to extract the element corresponding to the target quantum mode from the characterization matrix of the transformed Gaussian state as the characterization of the target quantum mode, and perform random sampling to determine the homodyne measurement result of the target quantum mode.
[0097] The determination module 304 is used to determine the representation matrix of the conditional state after measuring the target quantum mode according to the representation of the target quantum mode and the representation matrix of the transformed Gaussian state.
[0098] The simulation module 305 is used to perform measurement simulation based on the homodyne measurement result and the characterization matrix of the conditional state after the target quantum mode is measured.
[0099] Optionally, the characterization matrix includes a second-order characterization matrix. Based on this, the extraction module 303 is used to:
[0100] According to the index k of the target quantum mode, extracting the elements of the 2kth and (2k+1)th columns from the second-order characterization matrix of the transformed Gaussian state as the characterization of the target quantum mode, wherein the value range of k is an integer between 0 and N; N is the total number of quantum modes contained in the quantum circuit;
[0101] According to the index k of the target quantum mode, extracting the coordinate element corresponding to the index k from the first-order characterization matrix of the transformed Gaussian state;
[0102] extracting covariance elements between coordinate elements corresponding to index k from the representation of the target quantum mode;
[0103] Random sampling is performed in a Gaussian distribution centered at the coordinate element and with a variance equal to the covariance element to obtain a homodyne measurement result of the target quantum mode.
[0104] Optionally, the characterization matrix also includes a first-order characterization matrix. The determination module 304 is used to:
[0105] Determine a column vector based on the elements of the 2kth column;
[0106] Substitute the first-order characterization matrix of the transformed Gaussian state and the column vector into a set first-order formula to obtain the first-order characterization matrix of the conditional state.
[0107] Optionally, a first-order formula is used to indicate:
[0108] The first-order characterization matrix of the conditional state is determined based on the difference between the first-order characterization matrix of the transformed Gaussian state and the column vector.
[0109] Optionally, in the first-order formula, the column vector has a corresponding first coefficient. Based on this, the determination module 304 is further configured to:
[0110] According to the index k of the target quantum mode, extracting the coordinate element corresponding to the index k from the first-order characterization matrix of the transformed Gaussian state;
[0111] Extracting the covariance element between the coordinates corresponding to index k from the second-order characterization matrix of the transformed Gaussian state;
[0112] Random sampling is performed in a Gaussian distribution centered at the coordinate element and with a variance equal to the covariance element to obtain a homodyne measurement result of the target quantum mode;
[0113] A first coefficient corresponding to the column vector in the first-order formula is determined according to the difference between the coordinate element and the homodyne measurement result and according to the covariance element.
[0114] Optionally, the first coefficient is determined based on a ratio of a difference between the coordinate element and the homodyne measurement result to the covariance element.
[0115] Optionally, the determination module 304 is further configured to:
[0116] The elements corresponding to the target quantum mode in the first-order characterization matrix of the conditional state are reset to zero.
[0117] Optionally, the determination module 304 is configured to:
[0118] Determine a column vector based on the elements of the 2kth column;
[0119] The product of the column vector and the transposed column vector and the second-order characterization matrix of the transformed Gaussian state are substituted into a set second-order formula to obtain the second-order characterization matrix of the conditional state.
[0120] Optionally, a second order formula is used to indicate:
[0121] The second-order characterization matrix of the conditional state is determined based on the difference between the second-order characterization matrix of the transformed Gaussian state and the product.
[0122] Optionally, in the second-order formula, the product has a corresponding second coefficient, and the determination module 304 is further configured to:
[0123] Extracting the covariance element between the coordinates corresponding to index k from the second-order characterization matrix of the transformed Gaussian state;
[0124] The second coefficient is determined based on the covariance element.
[0125] Optionally, the second coefficient is the reciprocal of the covariance element.
[0126] Optionally, the determination module 304 is further configured to:
[0127] The submatrix corresponding to the target quantum mode in the second-order representation matrix of the conditional state is reset to a unit matrix, and the elements associated with the target quantum mode are reset to zero.
[0128] Optionally, the transformation module 302 is used to:
[0129] Get the identity of each quantum gate in the quantum circuit;
[0130] According to the identifiers of the quantum gates and the order of the quantum gates in the quantum circuit, the corresponding transformation functions are sequentially called to transform the characterization matrix of the initial Gaussian state to obtain the characterization matrix of the transformed Gaussian state.
[0131] Optionally, the quantum gate in the quantum circuit includes at least one of the following: a phase gate, a single-mode compression gate, a controlled phase gate, a beam splitter and a dual-mode compression gate.
[0132] In this embodiment, the characterization matrix of the initial Gaussian state is obtained, and the characterization matrix of the initial Gaussian state is transformed according to the transformation function of the quantum gate in the quantum circuit to obtain the characterization matrix of the transformed Gaussian state. Then, from the characterization matrix of the transformed Gaussian state, the elements corresponding to the target quantum mode are extracted as the characterization of the target quantum mode, so as to determine the characterization matrix of the conditional state after the target quantum mode is measured according to the characterization of the target quantum mode and the characterization matrix of the transformed Gaussian state. It can be seen that when performing homodyne measurement simulation on the target quantum mode, the elements corresponding to the target quantum mode are directly extracted as the characterization of the target quantum mode, which greatly reduces the amount of calculation in the operation process, reduces the time complexity of the calculation, and avoids the process of two rearrangements, so that the entire simulation process can be executed more efficiently.
[0133] 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.
[0134] Figure 4A schematic block diagram of an example electronic device 400 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.
[0135] like Figure 4 As shown, the device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 402 or a computer program loaded from a storage unit 408 to a RAM (Random Access Memory) 403. In RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An I / O (Input / Output) interface 405 is also connected to the bus 404.
[0136] A number of components in the device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0137] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 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, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 401 performs the various methods and processes described above, such as a measurement simulation method for a quantum circuit. For example, in some embodiments, the measurement simulation method for a quantum circuit may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the computing unit 401, one or more steps of the measurement simulation method for a quantum circuit described above may be executed. Alternatively, in other embodiments, the computing unit 401 may be configured to execute the measurement simulation method for quantum circuits in any other appropriate manner (eg, by means of firmware).
[0138] 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.
[0139] 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.
[0140] 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.
[0141] 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).
[0142] 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.
[0143] 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.
[0144] 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.
[0145] 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.
[0146] 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 measurement simulation method for a quantum circuit, comprising: Obtain the characterization matrix of the initial Gaussian state; According to the transformation function of the quantum gate in the quantum circuit, the characterization matrix of the initial Gaussian state is transformed to obtain the characterization matrix of the transformed Gaussian state; Extracting an element corresponding to a target quantum mode from the characterization matrix of the transformed Gaussian state as a characterization of the target quantum mode, and performing random sampling to determine a homodyne measurement result of the target quantum mode; Determining a characterization matrix of a conditional state after measuring the target quantum mode according to the characterization of the target quantum mode and the characterization matrix of the transformed Gaussian state; A measurement simulation is performed based on the homodyne measurement result and a characterization matrix of the conditional state after the target quantum mode measurement.
2. The method according to claim 1, wherein: The characterization matrix includes a second-order characterization matrix; extracting an element corresponding to a target quantum mode from the characterization matrix of the transformed Gaussian state as a characterization of the target quantum mode, and performing random sampling to determine a homodyne measurement result of the target quantum mode, including: According to the index k of the target quantum mode, extracting the elements of the 2kth and (2k+1)th columns from the second-order characterization matrix of the transformed Gaussian state as the characterization of the target quantum mode, wherein the value range of k is an integer between 0 and N; N is the total number of quantum modes contained in the quantum circuit; According to the index k of the target quantum mode, extracting the coordinate element corresponding to the index k from the first-order characterization matrix of the transformed Gaussian state; extracting covariance elements between coordinate elements corresponding to index k from the representation of the target quantum mode; Random sampling is performed in a Gaussian distribution centered at the coordinate element and with a variance equal to the covariance element to obtain a homodyne measurement result of the target quantum mode.
3. The method according to claim 2, wherein: The characterization matrix also includes a first-order characterization matrix; the characterization matrix of the conditional state after measuring the target quantum mode is determined according to the characterization of the target quantum mode and the characterization matrix of the transformed Gaussian state, including: Determine a column vector based on the elements of the 2kth column; Substitute the first-order characterization matrix of the transformed Gaussian state and the column vector into a set first-order formula to obtain the first-order characterization matrix of the conditional state.
4. The method according to claim 3, wherein: The first order formula is used to indicate: The first-order characterization matrix of the conditional state is determined based on the difference between the first-order characterization matrix of the transformed Gaussian state and the column vector.
5. The method according to claim 4, wherein: In the first-order formula, the column vector has a corresponding first coefficient, and the method further includes: A first coefficient corresponding to the column vector in the first-order formula is determined according to the difference between the coordinate element and the homodyne measurement result and according to the covariance element.
6. The method according to claim 5, wherein: The first coefficient is determined based on the ratio between the difference between the coordinate element and the homodyne measurement result and the covariance element.
7. The method according to claim 3, wherein: The method further comprises: The elements corresponding to the target quantum mode in the first-order characterization matrix of the conditional state are reset to zero.
8. The method according to claim 2, wherein: Determining the characterization matrix of the conditional state after measuring the target quantum mode according to the homodyne measurement result of the target quantum mode and the characterization matrix of the Gaussian state after the transformation includes: Determine a column vector based on the elements of the 2kth column; The product of the column vector and the transposed column vector and the second-order characterization matrix of the transformed Gaussian state are substituted into a set second-order formula to obtain the second-order characterization matrix of the conditional state.
9. The method according to claim 8, wherein: The second order formula is used to indicate: The second-order characterization matrix of the conditional state is determined based on the difference between the second-order characterization matrix of the transformed Gaussian state and the product.
10. The method according to claim 9, wherein: In the second-order formula, the product has a corresponding second coefficient, and the method further includes: Extracting the covariance element between the coordinates corresponding to index k from the second-order characterization matrix of the transformed Gaussian state; The second coefficient is determined based on the covariance element.
11. The method according to claim 10, wherein: The second coefficient is the reciprocal of the covariance element.
12. The method according to claim 8, wherein: The method further comprises: The submatrix corresponding to the target quantum mode in the second-order representation matrix of the conditional state is reset to a unit matrix, and the elements associated with the target quantum mode are reset to zero.
13. The method according to any one of claims 1 to 12, wherein: The method of transforming the characterization matrix of the initial Gaussian state according to the transformation function of the quantum gate in the quantum circuit to obtain the characterization matrix of the transformed Gaussian state includes: Get the identity of each quantum gate in the quantum circuit; According to the identifiers of the quantum gates and the order of the quantum gates in the quantum circuit, the corresponding transformation functions are sequentially called to transform the characterization matrix of the initial Gaussian state to obtain the characterization matrix of the transformed Gaussian state.
14. The method according to claim 13, wherein: The quantum gate in the quantum circuit includes at least one of the following: a phase gate, a single-mode compression gate, a controlled phase gate, a beam splitter and a dual-mode compression gate.
15. A measurement simulation device for a quantum circuit, comprising: An acquisition module, used for acquiring a characterization matrix of an initial Gaussian state; A transformation module, used for transforming the characterization matrix of the initial Gaussian state according to the transformation function of the quantum gate in the quantum circuit to obtain the characterization matrix of the transformed Gaussian state; An extraction module, used to extract an element corresponding to a target quantum mode from the characterization matrix of the transformed Gaussian state as a characterization of the target quantum mode, and to perform random sampling to determine a homodyne measurement result of the target quantum mode; A determination module, used to determine a characterization matrix of a conditional state after measuring the target quantum mode according to the characterization of the target quantum mode and the characterization matrix of the Gaussian state after the transformation; A simulation module is used to perform measurement simulation based on the homodyne measurement result and the characterization matrix of the conditional state after the target quantum mode is measured.
16. The device according to claim 15, wherein: The representation matrix includes a second-order representation matrix; the extraction module is used to: According to the index k of the target quantum mode, extracting the elements of the 2kth and (2k+1)th columns from the second-order characterization matrix of the transformed Gaussian state as the characterization of the target quantum mode, wherein the value range of k is an integer between 0 and N; N is the total number of quantum modes contained in the quantum circuit; According to the index k of the target quantum mode, extracting the coordinate element corresponding to the index k from the first-order characterization matrix of the transformed Gaussian state; extracting covariance elements between coordinate elements corresponding to index k from the representation of the target quantum mode; Random sampling is performed in a Gaussian distribution centered at the coordinate element and with a variance equal to the covariance element to obtain a homodyne measurement result of the target quantum mode.
17. The device according to claim 16, wherein: The characterization matrix also includes a first-order characterization matrix; the determination module is used to: Determine a column vector based on the elements of the 2kth column; Substitute the first-order characterization matrix of the transformed Gaussian state and the column vector into a set first-order formula to obtain the first-order characterization matrix of the conditional state.
18. The device according to claim 17, wherein: The first order formula is used to indicate: The first-order characterization matrix of the conditional state is determined based on the difference between the first-order characterization matrix of the transformed Gaussian state and the column vector.
19. The device according to claim 18, wherein In the first-order formula, the column vector has a corresponding first coefficient, and the determination module is further used for: According to the index k of the target quantum mode, extracting the coordinate element corresponding to the index k from the first-order characterization matrix of the transformed Gaussian state; Extracting the covariance element between the coordinates corresponding to index k from the second-order characterization matrix of the transformed Gaussian state; Random sampling is performed in a Gaussian distribution centered at the coordinate element and with a variance equal to the covariance element to obtain a homodyne measurement result of the target quantum mode; A first coefficient corresponding to the column vector in the first-order formula is determined according to the difference between the coordinate element and the homodyne measurement result and according to the covariance element.
20. The device according to claim 19, wherein The first coefficient is determined based on the ratio between the difference between the coordinate element and the homodyne measurement result and the covariance element.
21. The device according to claim 17, wherein: The determining module is further used for: The elements corresponding to the target quantum mode in the first-order characterization matrix of the conditional state are reset to zero.
22. The device according to claim 16, wherein: The determining module is used to: Determine a column vector based on the elements of the 2kth column; The product of the column vector and the transposed column vector and the second-order characterization matrix of the transformed Gaussian state are substituted into a set second-order formula to obtain the second-order characterization matrix of the conditional state.
23. The device according to claim 22, wherein: The second order formula is used to indicate: The second-order characterization matrix of the conditional state is determined based on the difference between the second-order characterization matrix of the transformed Gaussian state and the product.
24. The device according to claim 23, wherein: In the second-order formula, the product has a corresponding second coefficient, and the determination module is further used to: Extracting the covariance element between the coordinates corresponding to index k from the second-order characterization matrix of the transformed Gaussian state; The second coefficient is determined based on the covariance element.
25. The device according to claim 24, wherein: The second coefficient is the reciprocal of the covariance element.
26. The device according to claim 22, wherein: The determining module is further used for: The submatrix corresponding to the target quantum mode in the second-order representation matrix of the conditional state is reset to a unit matrix, and the elements associated with the target quantum mode are reset to zero.
27. The device according to any one of claims 15 to 26, wherein: The transformation module is used for: Get the identity of each quantum gate in the quantum circuit; According to the identifiers of the quantum gates and the order of the quantum gates in the quantum circuit, the corresponding transformation functions are sequentially called to transform the characterization matrix of the initial Gaussian state to obtain the characterization matrix of the transformed Gaussian state.
28. The device according to claim 27, wherein The quantum gate in the quantum circuit includes at least one of the following: a phase gate, a single-mode compression gate, a controlled phase gate, a beam splitter and a dual-mode compression gate.
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 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 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 to 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
Quantum state information conversion method
CN110598867A
High-safety source-independent quantum random number generation device and method
CN110851111A
