Method for generating amplitude preparation circuit, quantum state preparation method and device
By setting the amplitude to be prepared in the upper left corner of the unitary matrix and combining the Pauli rotation gate and H-gate optimization circuit, the problem of insufficient efficiency and accuracy of existing amplitude preparation is solved, and more efficient and accurate quantum state preparation is achieved.
Patent Information
- Application Number
- CN202410648899.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-23
- Publication Date
- 2025-11-25
AI Technical Summary
Existing amplitude preparation methods are not efficient and accurate in quantum computing, making it difficult to meet the requirements of specific amplitude distributions.
By setting the amplitude to be prepared in the upper left corner of the unitary matrix, the amplitude is prepared using the circuit corresponding to the unitary matrix. The amplitude preparation circuit is optimized by combining the Pauli rotating gate and the H gate.
It achieves more efficient and accurate amplitude preparation, reduces computational complexity, simplifies the number of logic gates at the chip level, and improves the accuracy and success rate of quantum state preparation.
Smart Images

Figure CN121010001A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of quantum computing, and in particular to a method, a method and apparatus for generating amplitude preparation circuits, and quantum state preparation. Background Technology
[0002] Quantum computers, with their immense computing power, offer new possibilities for overcoming the current limitations of computing. This is reflected in two aspects: firstly, quantum computers guarantee exponential or polynomial speedups over classical computers on specific problems; secondly, the manipulation techniques for quantum systems are becoming increasingly sophisticated, enabling high-fidelity gate implementation and reasonable coherence times for multi-qubit devices. A series of calculations based on recent quantum devices demonstrate the enormous potential and application value of quantum computing in the future, making it the most likely path to breaking through the limits of classical computing power.
[0003] In quantum computing, the input states may require a specific amplitude distribution. These algorithms may rely on superposition states with specific amplitudes to perform their computational tasks, such as quantum amplitude estimation, quantum search algorithms, and quantum simulation algorithms. Amplitude preparation ensures that the algorithm can run correctly and achieve the expected performance.
[0004] Ensuring the accuracy of amplitude preparation is beneficial for accurate calculations using the prepared amplitude. However, existing amplitude preparation methods are not very capable of preparing amplitudes, resulting in low accuracy and efficiency in amplitude preparation. Summary of the Invention
[0005] The purpose of this application is to provide a method, a quantum state preparation method and apparatus for generating amplitude preparation circuits. The aim is to realize that by setting the amplitude to be prepared in the upper left corner of a unitary matrix, the circuit corresponding to the unitary matrix can be used as the amplitude preparation circuit of the amplitude to be prepared. In this way, it is equivalent to using a circuit with greater computing power to prepare the amplitude of the amplitude to be prepared, so that the amplitude preparation can be performed more efficiently and accurately.
[0006] One embodiment of this application provides a method for generating an amplitude preparation circuit, the method comprising: obtaining a first matrix, wherein the main diagonal elements of the first matrix are used to indicate the amplitude to be prepared, and the other elements of the first matrix other than the main diagonal elements are 0;
[0007] Based at least on the first block matrix mentioned above, construct a unitary matrix, wherein the first block matrix is set at the top left corner of the unitary matrix;
[0008] Based on the above unitary matrix, a first amplitude preparation circuit corresponding to the above unitary matrix is obtained, wherein the above first amplitude preparation circuit is used to prepare the above amplitude to be prepared.
[0009] In some embodiments, the lower right corner of the unitary matrix is also the first block matrix, the lower left corner and the upper right corner of the unitary matrix are negative matrices, and the sum of the modulus of each matrix element in the second block matrix and the modulus of the matrix elements at the same position in the first block matrix is 1.
[0010] In some embodiments, the first amplitude preparation circuit includes a Pauli rotating gate, the rotation angle of which is determined by the amplitude to be prepared.
[0011] In some embodiments, the construction of a unitary matrix, at least based on the block matrix described above, includes:
[0012] Based on the matrix expressions corresponding to the block matrix and the Pauli rotary gate, the unitary matrix is constructed. When the amplitude to be prepared is real data, the Pauli rotary gate is an RY gate; when the amplitude to be prepared includes imaginary data, the Pauli rotary gate includes an RX gate.
[0013] In some embodiments, the first amplitude preparation circuit further includes an H gate whose operating timing is prior to the Pauli rotating gate; wherein the H gate acts on the target qubit, and the Pauli rotating gate acts on both the target qubit and the auxiliary qubit; the target qubit is used to generate the quantum state to be prepared, and the auxiliary qubit is used to determine whether the target qubit generates the quantum state to be prepared.
[0014] In some embodiments, the above method further includes:
[0015] The Pauli rotating gate in the first amplitude preparation circuit is optimized and updated to obtain the second amplitude preparation circuit.
[0016] One embodiment of this application provides a method for preparing a quantum state, characterized by comprising:
[0017] Obtain the amplitude preparation circuit generated in the manner provided by the above-described method for generating the amplitude preparation circuit; run the above-described amplitude preparation circuit and measure the auxiliary qubit to obtain the target quantum state when the quantum state of the auxiliary qubit collapses to the |0> state, and determine the amplitude of the above-described target quantum state as the amplitude to be prepared.
[0018] One embodiment of this application provides an amplitude preparation circuit, which is generated in the manner provided by the method for generating the amplitude preparation circuit described above.
[0019] One embodiment of this application provides an apparatus for generating an amplitude preparation circuit, comprising:
[0020] An acquisition unit is used to acquire a block matrix, wherein the main diagonal elements of the block matrix are used to indicate the amplitude to be prepared, and the other elements of the block matrix other than the main diagonal elements are 0;
[0021] A building unit is used to construct a unitary matrix based at least on the aforementioned block matrix, wherein the aforementioned block matrix is located at the upper left corner of the aforementioned unitary matrix;
[0022] The unit is used to obtain a first amplitude preparation circuit corresponding to the unitary matrix, wherein the first amplitude preparation circuit is used to prepare the amplitude to be prepared.
[0023] One embodiment of this application provides a quantum state preparation apparatus, comprising:
[0024] The acquisition unit is used to acquire the amplitude preparation circuit generated in accordance with the manner provided by the method for generating the amplitude preparation circuit described above;
[0025] The operating unit is used to run the above-mentioned amplitude preparation circuit and measure the auxiliary qubit to obtain the target quantum state when the quantum state of the auxiliary qubit collapses to the |0> state, and to determine the amplitude of the target quantum state as the amplitude to be prepared.
[0026] One embodiment of this application provides a storage medium storing a computer program, wherein the computer program is configured to implement any of the methods described above when running.
[0027] One embodiment of this application provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to implement any of the methods described above.
[0028] Compared with the prior art, this application sets the main diagonal element of the block matrix as the amplitude to be prepared, while the other elements are 0. In this way, the block matrix is equivalent to a diagonal matrix, which is beneficial to construct a unitary matrix using the block matrix. In the unitary matrix, the amplitude to be prepared is set in the upper left corner of the unitary matrix. Then, the circuit corresponding to the unitary matrix can be used to prepare the amplitude of the quantum state to be prepared. This can also be understood as using a larger-scale operator to prepare the quantum state to be prepared, which helps to prepare the quantum state to be prepared more efficiently and accurately. Attached Figure Description
[0029] Figure 1 A network block diagram of a quantum hardware simulation computing system provided in this disclosure embodiment;
[0030] Figure 2 A schematic flowchart of a method for generating an amplitude preparation circuit is provided for an embodiment of this disclosure;
[0031] Figure 3 This is a schematic diagram of a possible quantum circuit corresponding to a unitary matrix, provided in an embodiment of this disclosure.
[0032] Figure 4 A schematic diagram of the equivalent circuit structure of a 3-bit amplitude circuit provided in an embodiment of this disclosure;
[0033] Figure 5 A schematic diagram of the optimized equivalent circuit structure of a 3-bit amplitude circuit provided in an embodiment of this disclosure;
[0034] Figure 6 A schematic flowchart of a quantum state preparation method provided in an embodiment of this disclosure;
[0035] Figure 7 A schematic diagram of a possible circuit layout for amplitude preparation using Walsh transform provided in this embodiment of the disclosure;
[0036] Figure 8 A schematic diagram of the apparatus for generating an amplitude preparation circuit provided in an embodiment of this disclosure;
[0037] Figure 9 This is a schematic diagram of the quantum state preparation apparatus provided in an embodiment of the present disclosure. Detailed Implementation
[0038] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0039] Figure 1 This application provides a network block diagram of a system for generating an amplitude preparation circuit. The system for generating the amplitude preparation circuit may include a network 110, a server 120, a wireless device 130, a client 140, a storage unit 150, a classical processing system 160, a quantum processing system 170, and may also include additional memory, a classical processor, a quantum processor, and other devices not shown.
[0040] Network 110 is a medium used to provide a communication link between various devices and computers connected together within a system for generating amplitude preparation circuits, including but not limited to the Internet, corporate intranets, local area networks, mobile communication networks and combinations thereof, and the connection method can be wired, wireless communication links or fiber optic cables, etc.
[0041] Server 120 and client 140 are conventional data processing systems that may contain data and applications or software tools that perform conventional computational processes. Client 140 may be a personal computer or a network computer, so the data may also be provided by server 120. Wireless device 130 may be a smartphone, tablet, laptop, smart wearable device, etc. Storage unit 150 may include database 151, which can be configured to store data such as qubit parameters, quantum logic gate parameters, quantum circuits, and quantum programs.
[0042] The classical processing system 160 (quantum processing system 170) may include a classical processor 161 (quantum processor 171) for processing classical data (quantum data) and a memory 163 (memory 172) for storing classical data (quantum data). The classical data (quantum data) may be a boot file, an operating system image, and an application program 162 (application program 173). The application program 162 (application program 173) may be used to implement a quantum algorithm compiled according to the quantum hardware simulation calculation method for generating amplitude preparation circuits provided in the embodiments of this application.
[0043] Any data or information stored or generated in the classical processing system 160 (quantum processing system 170) can also be configured to be stored or generated in another classical (quantum) processing system in a similar manner, and any application executed therein can also be configured to be executed in another classical (quantum) processing system in a similar manner.
[0044] It should be noted that a true quantum computer has a hybrid structure, which includes at least... Figure 1 The system consists of two main parts: the classical processing system 160, which is responsible for performing classical calculations and control; and the quantum processing system 170, which is responsible for running quantum programs and thus realizing quantum computing.
[0045] The aforementioned classical processing system 160 and quantum processing system 170 can be integrated into a single device or distributed across two different devices. For example, the first device, including the classical processing system 160, runs a classical computer operating system that provides quantum application development tools and services, as well as the storage and network services required for quantum applications. Users develop quantum applications using the quantum application development tools and services on the second device and send the quantum program to the second device, including the quantum processing system 170, via the network services. The second device runs a quantum computer operating system, which parses the code of the quantum program and compiles it into instructions that can be recognized and executed by the quantum computer control system. The quantum processor 170 then implements the quantum algorithm corresponding to the quantum program based on these instructions.
[0046] In the classic silicon-based processing system 160, the units of the classic processor 161 are CMOS transistors. These computing units are not limited by time or coherence; that is, they are available at any time without time constraints. Furthermore, the number of these computing units in a silicon chip is sufficient; currently, a classic processor contains tens of thousands of computing units. The sufficient number of computing units and the fixed selectable computing logic of the CMOS transistors, such as AND logic, allow for computational efficiency through a combination of numerous CMOS transistors and limited logic functions.
[0047] Unlike the logic units in the classical processing system 160, the basic computational unit of the quantum processor 171 in the quantum processing system 170 is the qubit. The input of a qubit is limited by coherence and coherence time; that is, a qubit is limited by its available usage time and is not always readily available. Making full use of qubits within their available usage time is a key challenge in quantum computing. Furthermore, the number of qubits in a quantum computer is one of the representative indicators of its performance. Each qubit performs computational functions through on-demand configured logic functions. Given the limited number of qubits and the diverse logic functions available in quantum computing, such as Hadamard gates (H gates), Pauli-X gates (X gates), Pauli-Y gates (Y gates), Pauli-Z gates (Z gates), X gates, RY gates, RZ gates, CNOT gates, CR gates, iSWAP gates, Tofoli gates, etc., quantum computing requires combining a limited number of qubits with diverse logic function combinations to achieve computational effects.
[0048] Based on these differences, the design of logical functions applied to qubits (including the design of whether qubits are used and the design of the efficiency of each qubit's use) is crucial to improving the computational performance of quantum computers and requires specialized design. The aforementioned design considerations for qubits are technical issues that ordinary computing devices do not need to address.
[0049] like Figure 2 As shown, this disclosure provides a method for generating an amplitude preparation circuit, which can be used to prepare an amplitude generation circuit. The execution subject of the method for generating an amplitude preparation circuit can be a quantum computer. The method for generating an amplitude preparation circuit includes steps 201-203.
[0050] Step 201: Obtain the first matrix block.
[0051] Here, the diagonal elements of the first matrix are used to indicate the amplitude to be prepared, and all other elements of the first matrix except the diagonal elements are 0.
[0052] As an example, the first block of the matrix can be understood as a diagonal matrix, which helps in constructing a unitary matrix using the first block of the matrix.
[0053] Step 202: Construct a unitary matrix based at least on the first block matrix.
[0054] Here, the first matrix is set at the top left corner of the aforementioned unitary matrix.
[0055] Here, it can be understood that the amplitude to be prepared is set in the upper left corner of the unitary matrix.
[0056] As an example, if the amplitude to be prepared is set in the upper left corner of the constructed unitary matrix, the circuit corresponding to the unitary matrix can be used to generate the amplitude to be prepared.
[0057] It should be understood that setting the amplitude to be prepared in the upper left corner of a matrix to construct a unitary matrix facilitates the design and control of other elements within the unitary matrix, leading to efficient construction of the unitary matrix. For example, the amplitude to be prepared can be set in the upper left corner of an M×M matrix, and the amplitude can also be placed on the main diagonal of the M×M matrix; this method efficiently makes the M×M matrix a unitary matrix, and because the amplitude to be prepared is set in the upper left corner of the M×M matrix, it also makes the quantum state to be prepared more clearly defined, and is also beneficial for implementing the circuit for preparing the quantum state at the circuit level.
[0058] That is, in this disclosure, by setting the amplitude to be prepared in the upper left corner of the unitary matrix, it is possible to prepare the amplitude of the quantum state to be prepared using a circuit adapted to the unitary matrix, which is equivalent to preparing the quantum state using a larger-scale operator, thereby helping to prepare the quantum state more accurately.
[0059] Step 203: Based on the unitary matrix, obtain the first amplitude preparation circuit corresponding to the unitary matrix.
[0060] Here, the first amplitude preparation circuit is used to prepare the amplitude to be prepared.
[0061] It should be understood that the unitary matrix provides a method for precisely controlling the evolution of quantum states. Therefore, a first amplitude preparation circuit corresponding to the unitary matrix is obtained, and the amplitude to be prepared is prepared using the first amplitude preparation circuit, thereby enabling efficient and accurate preparation of the amplitude to be prepared.
[0062] As can be seen, in this disclosure, the main diagonal element of the block matrix is set as the amplitude to be prepared, while the other elements are 0. In this way, the block matrix is equivalent to a diagonal matrix, which is beneficial for constructing a unitary matrix using the block matrix. In the unitary matrix, the amplitude to be prepared is set in the upper left corner of the unitary matrix. Then, the circuit corresponding to the unitary matrix can be used to prepare the amplitude of the quantum state to be prepared. This can also be understood as using a larger-scale operator to prepare the quantum state to be prepared, which helps to prepare the quantum state to be prepared more efficiently and accurately.
[0063] In some implementations, a unitary matrix can be understood as a large-scale operator, while a block matrix can be understood as a small-scale operator. Setting the top left corner of the unitary matrix as a block matrix is equivalent to embedding a small-scale operator into a larger-scale operator. In this way, the computational resources and capabilities of the large-scale operator can be utilized for computation, thereby improving computational efficiency and ensuring computational accuracy.
[0064] To facilitate understanding, the relationship between block matrices and unitary matrices can be illustrated using the following diagram showing the transformation of matrices.
[0065]
[0066] In this process, setting the top-left corner of matrix U as block matrix A yields a new unitary matrix. The dot (·) can be understood as a constituent element of the unitary matrix. It should be understood that the number of elements a dot can represent can be limited according to the actual situation. For example, a unitary matrix can be an N x N matrix, where N can be a positive integer. For instance, a unitary matrix U can be a 4 x 4 matrix or an 8 x 8 matrix, etc.
[0067] Here, the element values on the main diagonal of the block matrix can indicate the amplitude to be prepared, while the element values outside the main diagonal are set to 0. In this way, the block matrix is equivalent to a diagonal matrix, which can reduce the computational complexity. In this way, the block matrix A does not need to be constructed as a unitary matrix, but only the amplitude of the quantum state to be prepared needs to be set on the main diagonal of the block matrix A.
[0068] For example, when the quantum state to be prepared is: The matrix expression for block matrix A can be:
[0069] It should be understood that since the block matrix A is set at the top left corner of the unitary matrix U, the operator U can be used to approximate A. In this case, it is equivalent to embedding a smaller-scale operator in a larger-scale operator, and thus realize the preparation of quantum states in the smaller-scale operator. When the amplitude preparation circuit generated in this way is used to prepare the target quantum state, the preparation of the target quantum state can be achieved more accurately.
[0070] It should be understood that this disclosure can be interpreted as applying block-encoding technology, setting the block matrix in the upper left corner of the unitary matrix. This is equivalent to utilizing the computational power of the unitary matrix for amplitude preparation, making the preparation of the amplitude to be prepared more efficient and accurate. Moreover, this method does not require the block matrix to be a unitary matrix.
[0071] In some embodiments, a scaling factor can be set for the block matrix. Scaling the block matrix makes it easier to set the scaled block matrix as a unitary matrix, or it can easily form a new unitary matrix from the scaled block matrix. Furthermore, setting a scaling factor also helps to adjust the amplitude of the quantum state, thereby helping to optimize the preparation accuracy and reduce errors in the amplitude preparation process.
[0072] As an example, by setting a scaling factor, a scaled version of the block matrix A can be used to approximate the block matrix A, which helps to better utilize unitary matrices to perform calculations on the block matrix A.
[0073] To facilitate understanding, we can refer to the following explanation of the unitary matrix U and its variants:
[0074]
[0075] Here, It can be understood as a unitary matrix, and This can be understood as a variation of the unitary matrix U, meaning that the result of the block matrix A can be replaced by the result of the unitary matrix U. In other words, A can be used to indicate the block matrix, α can be used to indicate the scaling factor, and α can be a positive real number.
[0076] As can be seen, α can be understood as a scaling factor. α is a positive real number, and by setting α, the block matrix A can be scaled. Thus, when A is approximated by the block-encoding operator U, the result will be α times A. This helps to realize and manipulate smaller operators in larger quantum systems and facilitates more accurate acquisition of the target quantum state to be prepared.
[0077] In some implementations, a predefined inequality must be satisfied between the unitary matrix and the block matrix so that the calculation result of the unitary matrix can be equivalent to that of the block matrix.
[0078] Among them, the predefined inequalities include:
[0079]
[0080] Where m can be a positive integer, and m can be used to indicate the number of qubits encoded; ε can be a positive real number, and ε can be used to indicate the allowed error threshold.
[0081] It should be understood that when the unitary matrix and the block matrix need to satisfy a predefined inequality, the difference between the unitary matrix and the actual block matrix is already less than the predefined threshold. Therefore, the unitary matrix can be used to replace the block matrix for amplitude calculation and preparation. In other words, the unitary matrix is constructed using the amplitude to be prepared in the above way.
[0082] In some embodiments, the error threshold can be determined based on the application scenario corresponding to the amplitude to be prepared.
[0083] It should be understood that different application scenarios may have different amplitude requirements. That is, some application scenarios have lower amplitude requirements, thus requiring lower specifications for the amplitude preparation circuit, while other scenarios may require higher amplitude, thus requiring higher specifications for the amplitude preparation circuit. Therefore, the error threshold can be determined according to the actual application scenario, so that the amplitude preparation circuit can be prepared more reasonably.
[0084] In other words, ε can be determined based on the actual situation. For example, when ε is set low, it can indicate high preparation accuracy, while when ε is set high, there may be some error. That is, the preparation accuracy can be dynamically adjusted by setting the value of ε.
[0085] It should be understood that the upper left corner of the unitary matrix U is set as a block matrix A, which can be understood as an operator acting on s bits. The elements on the main diagonal of the block matrix A can indicate the target quantum state (amplitude to be prepared) to be prepared. The purpose of this disclosure is to generate an amplitude preparation circuit for preparing the amplitude to be prepared.
[0086] For example, a block matrix A is an operator operating on s bits, where α is a positive real number and m is a positive integer. An operator that operates on a unitary matrix U of (s+m) bits is called an (α,m,ε)-block encoding of A; and it can satisfy... Thus, applying U to a state composed of m qubits and s arbitrary qubits yields a result very close to that of applying α times A to s qubits, with the error not exceeding a predefined threshold ε.
[0087] In some embodiments, the lower right corner of the unitary matrix is also the first block matrix, the lower left corner and the upper right corner of the unitary matrix are the second blocks matrix, which are negative matrices of each other, and the sum of the modulus of each matrix element in the second block matrix and the modulus of the matrix elements at the same position in the first block matrix is 1.
[0088] To facilitate understanding, we can illustrate this with a specific matrix. For example, the expression for the first matrix is: At this point, if we consider the first matrix as a single element, and combine this with the arrangement of the matrices corresponding to the RY gate (the matrix expression for the RY gate is: Then we can obtain the expression for a unitary matrix. Specifically, the expression for a unitary matrix can be:
[0089] As an example, this method allows for more efficient construction of unitary matrices using the first block of the matrix. Furthermore, when the first block of the matrix is treated as a single element, the unitary matrix can also be understood as the unitary matrix corresponding to the RY gate.
[0090] In some embodiments, the first amplitude preparation circuit includes a Pauli rotating gate, the rotation angle of which is determined by the amplitude to be prepared.
[0091] As an example, this disclosure can be understood as a possible schematic diagram of a quantum circuit corresponding to a unitary matrix, by Figure 3 It can be seen that the first amplitude preparation circuit may include multiple controlled rotating gates, Ra(α1), Ra(α2)...Ra(α... M α1, α2…α M This can be understood as a rotation angle, while F1…FM can be related to α1, α2…α M Correspondingly, α1, α2, ..., α can be determined based on F1…FM. M The specific value can be determined by mapping the amplitude to a phase using a quantum Fourier transform, and then determining the rotation angle.
[0092] As an example, since the Pauli rotating gate is continuous, quantum states of arbitrary amplitude can be prepared by changing the rotation angle. The first amplitude preparation circuit composed of the Pauli rotating gate helps to reduce errors and improve the accuracy of calculations.
[0093] In some embodiments, step 202 (constructing a unitary matrix based at least on the first block matrix) may specifically include:
[0094] Based on the block matrix and the matrix expression corresponding to the Pauli rotating door, a unitary matrix is constructed.
[0095] Here, when the amplitude to be prepared is real data, the Pauli rotary gate is an RY gate; when the amplitude to be prepared includes imaginary data, the Pauli rotary gate is an RX gate.
[0096] That is, in this disclosure, when the amplitude to be prepared is real data, the Pauli rotary gate in the first amplitude preparation circuit is an RY gate. For example, when the application scenario is a financial scenario, it may be necessary to use real data (financial data is usually real data). In this scenario, the Pauli rotary gate in the first amplitude preparation circuit can be determined to be an RY gate.
[0097] Correspondingly, when the application scenario is medical imaging, optical wave calculation, etc., the Pauli rotating gate in the initial amplitude preparation circuit is determined to include the RX gate (that is, in this case, the application scenario to be prepared may require the use of imaginary data), for example, it can include both the RX gate and the RY gate.
[0098] It should be understood that the RY gate can change the amplitude on both the X and Y axes simultaneously, but not the phase (because no imaginary unit is introduced). The RX gate, on the other hand, can primarily change the amplitude on the X-axis and also change the phase (because an imaginary unit is introduced). Therefore, selecting the appropriate type of Pauli rotating gate based on the specific application scenario helps to make the final first amplitude preparation circuit more compatible with the specific application scenario and helps to reduce the complexity of the first amplitude preparation circuit.
[0099] In other words, this disclosure can be understood as determining whether the data corresponding to the amplitude to be prepared includes imaginary data based on the actual application scenario, thereby determining the type of Pauli rotating gate included in the first amplitude preparation circuit. This makes the first amplitude preparation circuit more compatible with the application scenario of the quantum state to be prepared, which not only facilitates the efficient preparation of the amplitude to be prepared, but also helps to reduce the complexity of the amplitude preparation circuit.
[0100] In some embodiments, the first amplitude preparation circuit further includes an H-gate whose timing precedes that of the Pauli rotating gate.
[0101] Here, the H gate acts on the target qubit, and the Pauli rotation gate acts on both the target qubit and the auxiliary qubit; the target qubit is used to generate the quantum state to be prepared, and the auxiliary qubit is used to determine whether the target qubit generates the quantum state to be prepared.
[0102] As an example, the first amplitude preparation circuit includes an H-gate, which can facilitate the transformation of the quantum state of the target qubit, thereby helping to better realize the quantum superposition state.
[0103] As an example, after the H gate changes the quantum state, the Pauli rotation gate in the first amplitude preparation circuit acts on the target qubit and the auxiliary qubit. In this way, the quantum state can be prepared simply by controlling the rotation angle of the qubit, which makes the overall target amplitude preparation circuit relatively simple.
[0104] To make it easier to understand, you can combine... Figure 3 To explain, Figure 3 This can be understood as a schematic diagram of a quantum circuit corresponding to a possible unitary matrix, in Figure 3 In Chinese, the Pauli revolving door can be understood as the RY door, which is... Figure 3 It is evident that an H-gate can be placed before the RY gate, which facilitates the conversion of the target bit from the ground state to a superposition state, thereby contributing to more efficient preparation of the amplitude of the quantum state to be prepared. An RY gate can also be placed in the second amplitude preparation circuit. Figure 3 The 301 in the diagram can be understood as an equivalent circuit diagram of an RY gate. An RY gate includes multiple single-bit rotation gates and controlled NOT gates. This allows the qubits (target qubit and auxiliary qubit) to be rotated. In this way, the amplitude of the target qubit can be adjusted in a certain way through the auxiliary qubit, thus better obtaining the amplitude of the quantum state to be prepared.
[0105] In some embodiments, the above method may further include: optimizing and updating the Pauli rotating gate in the first amplitude preparation circuit to obtain a second amplitude preparation circuit.
[0106] Here, the second amplitude preparation circuit can be used to prepare the amplitude to be prepared.
[0107] As an example, optimizing and updating the Pauli rotating gate in the first amplitude preparation circuit can reduce some logic gates in the first amplitude preparation circuit, thereby obtaining a second amplitude preparation circuit. That is, the second amplitude preparation circuit has fewer logic gates than the first amplitude preparation circuit, making it more suitable for chip-level implementation. Therefore, this disclosure utilizes the second amplitude preparation circuit to prepare the quantum state to be prepared, which is more conducive to achieving the preparation of the quantum state for the amplitude to be prepared.
[0108] In some implementations, the specific optimization process for the Pauli revolving door can be found in our publicly disclosed optimization method for the revolving door (application number: CN202311848056.8). For the sake of brevity, the optimization process will not be described in detail here. It should be understood that optimizing and updating the Pauli revolving door can reduce the number of logic gates in the second amplitude preparation circuit, thereby facilitating the implementation of the second amplitude circuit at the chip level.
[0109] As can be seen, in this disclosure, a unitary matrix is constructed based on the amplitude to be prepared, and the amplitude to be prepared is set in the upper left corner of the unitary matrix. This allows the circuit corresponding to the unitary matrix to be used for the preparation of the amplitude to be prepared. This can also be understood as using a larger-scale operator to prepare the amplitude to be prepared, thus contributing to more efficient and accurate amplitude preparation. Furthermore, in determining the second amplitude preparation circuit, a first amplitude preparation circuit composed of Pauli rotating gates is first determined, and then the Pauli rotating gates in the first amplitude preparation circuit are optimized and updated to obtain the second amplitude preparation circuit. This results in a smaller number of logic gates in the obtained second amplitude preparation circuit, which is beneficial for implementing the second amplitude preparation circuit at the chip level.
[0110] In other words, the method disclosed herein generates a second amplitude preparation circuit with a relatively small number of logic gates, which facilitates the implementation of the second amplitude preparation circuit at the chip level. Furthermore, when the second amplitude circuit is used to prepare the amplitude to be prepared, the amplitude to be prepared can be prepared more accurately and efficiently.
[0111] It should be understood that since unitary matrices are easy to implement at the circuit level, constructing unitary matrices based on the quantum state to be prepared also helps to more efficiently determine the second amplitude circuit used to prepare the quantum state to be prepared.
[0112] In some implementations, when the application scenario of this disclosure is financial data processing, since financial data is usually real data, the amplitude to be prepared is also real data. Therefore, the first amplitude preparation circuit can be constructed by RY gates. Based on the simplification method for RY gates, the equivalent circuit of the amplitude preparation circuit can be optimized, which can reduce the number of logic gates (controlled NOT gates) contained in the equivalent circuit of the second amplitude preparation circuit, thereby helping to better implement the second amplitude preparation circuit at the chip level.
[0113] It should be understood that controlled NOT gates can be set between the auxiliary bit circuit and the target quantum circuit in the equivalent circuit corresponding to the first amplitude preparation circuit, and the number and position of the controlled NOT gates can be determined by the control relationship between the target bit and the auxiliary bit. In this way, the number of controlled NOT gates can be reduced to a certain extent, thereby allowing the obtained second amplitude preparation circuit to be better implemented at the chip level.
[0114] Since the circuit to be optimized only includes single-bit rotating gates and double-bit controlled gates, it is possible to determine which controlled gates can be replaced or optimized based on the actual control relationship.
[0115] To make it easier to understand, you can combine... Figure 4-5 This further explains the route optimization approach disclosed herein. For example... Figure 4 The diagram shows one possible amplitude generation circuit according to this disclosure. Figure 5 This can be understood as a schematic diagram of a quantum circuit optimized by the optimized concept adopted in this disclosure. Figure 4 In the middle, R a This can be understood as a revolving door; and it should be understood that after the RY transformation, the RY(2θ) gate transforms the cosα|0>+sinα|1> state into the cos(α+θ)|0>+sin(α+θ)|1> state, while the X gate transforms the cosα|0>+sinα|1> state into the cos(π / 2-α)|0>+sin(π / 2-α)|1> state. Thus, the optimized quantum circuit representation can be expressed as follows: Figure 5 The uniform rotation control section is shown.
[0116] As can be seen, this method requires only N-1 CX gates to accurately prepare the qubit state, where N can indicate the number of rotation gates per qubit. For example, the qubit state from top to bottom is |100>, and the quantum state to be realized on the last qubit is RY(α4). Figure 5 From the perspective of the uniform rotation control circuit, the final effect achieved is the quantum state: RY(π-θ1-θ2-θ3-θ4+θ5+θ6+θ7+θ8)
[0117] This creates an equation between α4 and θ, and the same equation can be constructed using the same method; this approach also reduces the number of CX gates. If the initial state is not |0>, but a fixed, non-entangled cosα|0>+sinα|1> state, then α can be added to the left side of the equation. That is, this circuit is adaptable to most ground states, thus allowing most quantum fabrication circuits to be optimized using this method. Optimizing the amplitude fabrication circuit of this disclosure based on this idea allows for better implementation at the chip level.
[0118] Please continue to participate. Figure 6 This disclosure provides a method for preparing a quantum state, including steps S601 and S602.
[0119] Step S601: Obtain the amplitude preparation circuit generated by the above-described method for generating the amplitude preparation circuit.
[0120] As an example, the specific implementation of the amplitude generation circuit has been described in the above embodiments, and will not be repeated here for the sake of brevity.
[0121] Here, the amplitude preparation circuit can be understood as the first amplitude preparation circuit or the second amplitude preparation circuit mentioned above.
[0122] Step S602: Run the amplitude preparation circuit and measure the auxiliary qubit to obtain the target quantum state when the quantum state of the auxiliary qubit collapses to the |0> state, and determine the amplitude of the target quantum state as the amplitude to be prepared.
[0123] As an example, when the auxiliary bit quantum collapses to the |0> state, the amplitude of the quantum state to be prepared can be characterized. The target quantum state can be understood as the quantum state corresponding to the target qubit.
[0124] To better understand the ideas behind this disclosure, specific examples can be used to further illustrate them. For instance, the quantum state to be prepared is: The corresponding amplitude preparation circuit can be designed as follows: Assume the initial state (i.e., the initial state input to the amplitude generation circuit) is as follows: This state can be achieved through Figure 5 The expression obtained from the H gate in this state, after applying U, can be transformed into: At this point, the auxiliary qubit can be observed when it collapses into the |0> state. The quantum state is: and This can be understood as the amplitude to be prepared. When the observed auxiliary bit state is |0>, the quantum state collapses into the amplitude to be prepared.
[0125] As can be seen, this method allows for the preparation of amplitudes using uniformly rotating RY gates, making quantum computing more flexible and enabling more efficient preparation of the amplitudes to be prepared.
[0126] To better understand the benefits of this disclosure, a theoretical comparison can be made between the Walsh transform and amplitude preparation methods commonly used in related technologies and the methods disclosed herein, as follows:
[0127] Can be combined Figure 7 To explain, Figure 7 This can be understood as a possible circuit diagram for Walsh transform and amplitude preparation. Figure 7 In the middle, the inequality can be satisfied. Here, D can be understood as the similarity to the target state, and P is the success probability of the route. The specific equations for D and P can be:
[0128]
[0129] In this disclosure, one possible circuit expression is as follows: At this point, the success rate of preparing the amplitude of the quantum state to be prepared can be expressed as: This must be greater than the overall success rate of Walsh transform and amplitude preparation. Furthermore, this disclosure can also use the following expression:
[0130] In this way, the success rate of amplitude preparation can be guaranteed at least the same as that of the Walsh transform.
[0131] Furthermore, this disclosure method can directly... In the range [0, π / 2]
[0132] Use directly Instead, unlike the Walsh transform and amplitude preparation, it does not use... To approximate The ability to prepare the target state can also improve the accuracy of the preparation.
[0133] Furthermore, regarding the depth of the quantum circuit, the number of CX gates is O(N) due to the optimization of the circuit using a uniform rotating gate method; the quantum circuit is shallower, thereby reducing the difficulty of chip implementation.
[0134] Further performance analysis was conducted using normalized quantum states. To prepare The Walsh transform and the scheme for amplitude preparation are as follows: The scheme disclosed herein can also use ε1 for amplitude amplification, which, since it can be normalized, can be expressed as follows: The state at this point is f. i ′={min(ε1f i ,1)}。Then the probability of success can be written as Fidelity calculation is The scheme disclosed herein can be represented as follows: At this point, it is only necessary to make This indicates that the performance of the amplitude preparation circuit provided by this disclosure is superior to that given by the Walsh transform and amplitude preparation. Furthermore, in practical applications, even better performance can be achieved by selecting a more optimal ε1. For the sake of brevity, further details are omitted here.
[0135] In other words, compared with related technologies, the solution disclosed herein has improved in terms of preparation success rate, preparation readiness, and preparation performance; therefore, compared with related technologies, the method disclosed herein can perform amplitude preparation more efficiently and accurately.
[0136] In some embodiments, this disclosure also provides an amplitude preparation circuit generated by the method described above for generating an amplitude preparation circuit.
[0137] It should also be understood that the amplitude preparation circuit here can be understood as the first amplitude preparation circuit or the second amplitude preparation circuit mentioned above.
[0138] See Figure 8 , Figure 8 This is a schematic diagram of the structure of an apparatus 800 for generating amplitude preparation circuits provided in an embodiment of this application. Figure 2 Corresponding to the process shown, the above-mentioned apparatus includes:
[0139] The acquisition unit 801 is used to acquire a first matrix, wherein the main diagonal elements of the first matrix are used to indicate the amplitude to be prepared, and the other elements of the first matrix other than the main diagonal elements are 0;
[0140] Construction unit 802 is used to construct a unitary matrix based at least on the first block matrix, wherein the first block matrix is located at the upper left corner of the unitary matrix;
[0141] Unit 803 is used to obtain a first amplitude preparation circuit corresponding to the unitary matrix based on the unitary matrix, wherein the first amplitude preparation circuit is used to prepare the amplitude to be prepared.
[0142] In some embodiments of this application, the lower right corner of the unitary matrix is also the first block matrix, the lower left corner and the upper right corner of the unitary matrix are negative matrices, and the sum of the modulus of each matrix element in the second block matrix and the modulus of the matrix elements at the same position in the first block matrix is 1.
[0143] In some embodiments of this application, the first amplitude preparation circuit includes a Pauli rotating gate, the rotation angle of which is determined by the amplitude to be prepared.
[0144] In some embodiments of this application, the above-mentioned construction unit 802 is further used to: construct the above-mentioned unitary matrix based on the matrix expression corresponding to the above-mentioned block matrix and the Pauli rotating gate, wherein when the amplitude to be prepared is real data, the above-mentioned Pauli rotating gate is an RY gate; when the amplitude to be prepared includes imaginary data, the above-mentioned Pauli rotating gate includes an RX gate.
[0145] In some embodiments of this application, the first amplitude preparation circuit further includes an H gate whose operating timing is prior to the Pauli rotating gate; wherein the H gate acts on the target qubit, and the Pauli rotating gate acts on both the target qubit and the auxiliary qubit; the target qubit is used to generate the quantum state to be prepared, and the auxiliary qubit is used to determine whether the target qubit generates the quantum state to be prepared.
[0146] In some embodiments of this application, the apparatus for generating the amplitude preparation circuit is further used to: optimize and update the Pauli revolving door in the first amplitude preparation circuit to obtain the second amplitude preparation circuit.
[0147] See Figure 9 , Figure 9 This is a schematic diagram of the structure of a quantum state preparation device provided in an embodiment of this application, and... Figure 6 Corresponding to the process shown, the above-mentioned apparatus includes:
[0148] The acquisition unit 901 is used to acquire the amplitude preparation circuit generated in accordance with the manner provided by the method for generating the amplitude preparation circuit described above.
[0149] The operation unit 902 is used to run the above-mentioned amplitude preparation circuit and measure the auxiliary qubit to obtain the target quantum state when the quantum state of the auxiliary qubit collapses to the |0> state, and to determine the amplitude of the target quantum state as the amplitude to be prepared.
[0150] This application also provides a storage medium storing a computer program, wherein the computer program is configured to implement the steps in any of the above method embodiments when it is run.
[0151] Specifically, in this embodiment, the storage medium can be configured to store a computer program for implementing the following steps:
[0152] Obtain the first matrix, wherein the main diagonal elements of the first matrix are used to indicate the amplitude to be prepared, and all other elements of the first matrix except the main diagonal elements are 0;
[0153] Based at least on the first block matrix mentioned above, construct a unitary matrix, wherein the first block matrix is set at the top left corner of the unitary matrix;
[0154] Based on the aforementioned unitary matrix, a first amplitude preparation circuit corresponding to the aforementioned unitary matrix is obtained, wherein the aforementioned first amplitude preparation circuit is used to prepare the aforementioned amplitude to be prepared; or,
[0155] Obtain the target amplitude preparation circuit generated in accordance with the method provided above for generating the amplitude preparation circuit; run the amplitude preparation circuit and measure the auxiliary qubit to obtain the target quantum state when the quantum state of the auxiliary qubit collapses to the |0> state, and determine the amplitude of the target quantum state as the amplitude to be prepared.
[0156] This application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to implement the steps in any of the above method embodiments.
[0157] Specifically, the aforementioned electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the aforementioned processor, and the input / output device is connected to the aforementioned processor.
[0158] Specifically, in this embodiment, the processor described above can be configured to implement the following steps via a computer program:
[0159] Obtain the first matrix, wherein the main diagonal elements of the first matrix are used to indicate the amplitude to be prepared, and all other elements of the first matrix except the main diagonal elements are 0;
[0160] Based at least on the first block matrix mentioned above, construct a unitary matrix, wherein the first block matrix is set at the top left corner of the unitary matrix;
[0161] Based on the aforementioned unitary matrix, a first amplitude preparation circuit corresponding to the aforementioned unitary matrix is obtained, wherein the aforementioned first amplitude preparation circuit is used to prepare the aforementioned amplitude to be prepared; or,
[0162] Obtain the target amplitude preparation circuit generated in accordance with the method provided above for generating the amplitude preparation circuit; run the amplitude preparation circuit and measure the auxiliary qubit to obtain the target quantum state when the quantum state of the auxiliary qubit collapses to the |0> state, and determine the amplitude of the target quantum state as the amplitude to be prepared.
[0163] The above description of the structure, features and effects of this application is based on the embodiments shown in the drawings. The above description is only a preferred embodiment of this application. However, this application does not limit the scope of implementation to what is shown in the drawings. Any changes made in accordance with the concept of this application, or modifications to equivalent embodiments, that do not exceed the spirit covered by the specification and drawings, should be within the protection scope of this application.
Claims
1. A method for generating an amplitude preparation circuit, characterized in that, include: Obtain a first matrix, wherein the main diagonal elements of the first matrix are used to indicate the amplitude to be prepared, and all other elements of the first matrix except the main diagonal elements are 0; A unitary matrix is constructed based at least on the first block matrix, wherein the first block matrix is located at the top left corner of the unitary matrix; Based on the unitary matrix, a first amplitude preparation circuit corresponding to the unitary matrix is obtained, wherein the first amplitude preparation circuit is used to prepare the amplitude to be prepared.
2. The method according to claim 1, characterized in that, The lower right corner of the unitary matrix is also the first block matrix. The lower left and upper right corners of the unitary matrix are negative matrices of each other, and the sum of the modulus of each matrix element in the second block matrix and the modulus of the matrix elements at the same position in the first block matrix is 1.
3. The method according to claim 2, characterized in that, The first amplitude preparation circuit includes a Pauli rotating gate, the rotation angle of which is determined by the amplitude to be prepared.
4. The method according to claim 3, characterized in that, The construction of a unitary matrix based at least on the block matrix includes: Based on the block matrix and the matrix expression corresponding to the Pauli rotating gate, the unitary matrix is constructed, wherein when the amplitude to be prepared is real data, the Pauli rotating gate is an RY gate; when the amplitude to be prepared includes imaginary data, the Pauli rotating gate includes an RX gate.
5. The method according to claim 3 or 4, characterized in that, The first amplitude preparation circuit further includes an H gate whose operating timing is located before the Pauli rotating gate; wherein the H gate acts on the target qubit, and the Pauli rotating gate acts on both the target qubit and the auxiliary qubit; the target qubit is used to generate the quantum state to be prepared, and the auxiliary qubit is used to determine whether the target qubit generates the quantum state to be prepared.
6. The method according to claim 5, characterized in that, The method further includes: The Pauli rotating gate in the first amplitude preparation circuit is optimized and updated to obtain the second amplitude preparation circuit.
7. A method for preparing amplitude, characterized in that, include: Obtain the amplitude preparation circuit generated as described in any one of claims 1-6; The amplitude preparation circuit is run and the auxiliary qubit is measured to obtain the target quantum state when the quantum state of the auxiliary qubit collapses to the |0> state, and the amplitude of the target quantum state is determined as the amplitude to be prepared.
8. An amplitude generation circuit, characterized in that, The amplitude generation circuit is generated in any of the manner described in claims 1-6.
9. An apparatus for generating an amplitude preparation circuit, characterized in that, include: An acquisition unit is used to acquire a block matrix, wherein the main diagonal elements of the block matrix are used to indicate the amplitude to be prepared, and the other elements of the block matrix other than the main diagonal elements are 0; A construction unit is configured to construct a unitary matrix based at least on the block matrix, wherein the block matrix is positioned at the top left corner of the unitary matrix; The unit is used to obtain a first amplitude preparation circuit corresponding to the unitary matrix based on the unitary matrix, wherein the first amplitude preparation circuit is used to prepare the amplitude to be prepared.
10. A quantum state preparation apparatus, characterized in that, include: The acquisition unit is used to acquire the amplitude preparation circuit generated in any of the methods described in claims 1-6; The running unit is used to run the amplitude preparation circuit and measure the auxiliary bit to obtain the target quantum state when the auxiliary bit quantum state collapses to the |0> state, and to determine the amplitude of the target quantum state as the amplitude to be prepared.
11. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to implement the method described in any one of claims 1 to 7 when it is run.
12. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to implement the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Quantum hardware simulation calculation method and device for uniformly controlling quantum revolving door
CN117829300A
Cited By
Data processing method, quantum circuit generation method and related device
CN121960812A