Quantum state preparation method, device, equipment and medium

Through variable component quantum algorithm construction and training variable component quantum circuits, the problem of exponential growth of quantum circuit depth in amplitude coding is solved, and efficient and accurate preparation of quantum states is achieved, which is in line with the technical needs of the NISQ era.

CN119416904BActive Publication Date: 2025-05-13GUOKAIKE QUANTUM TECH (ANHUI) CO LTD +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510034752.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-09
Publication Date
2025-05-13
Estimated Expiration
2045-01-09

AI Technical Summary

Technical Problem

Amplitude encoding When preparing quantum circuits, as the number of quantum bits increases, the depth of the quantum circuit increases exponentially, and is susceptible to environmental noise, resulting in a decrease in calculation accuracy and efficiency.

Method used

The variable component quantum circuit includes training parameters is constructed by a variable component quantum algorithm, and the Hamiltonian is set as the negative value of the outer product of the left and right vectors of the target quantum states. The parameters of the quantum circuit are trained using a classical optimizer until the parameters or expected values ​​converge to the set threshold.

Benefits of technology

It realizes efficient and accurate preparation of any quantum state, reduces the depth of the quantum circuit, reduces the use of quantum gates, simplifies the quantum state preparation process, and improves the calculation accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119416904B_ABST
    Figure CN119416904B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and medium for preparing a quantum state, which includes: setting a target quantum state to be prepared; setting a Hamiltonian, which is the negative value of the outer product of the left vector and the right vector of the target quantum state; constructing a variational quantum circuit including training parameters according to the target quantum state; substituting a preset parameter value as a training parameter into the variational quantum circuit to output the training quantum state after the variational quantum circuit evolves; measuring the expected value of the training quantum state after the variational quantum circuit evolves with respect to the Hamiltonian; training the training parameters of the variational quantum circuit by a classical optimizer until the training parameters or the expected value converge to a set threshold; comparing the training parameters or the expected value with the set threshold; and outputting the training quantum state after the variational quantum circuit evolves under convergence as the target quantum state to be prepared. The present invention can efficiently and accurately realize the preparation of any quantum state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of quantum computing technology, and in particular to a quantum state preparation method, device, equipment and medium. Background Art

[0002] Quantum algorithm is an advanced computing method based on the principles of quantum mechanics. It uses quantum bits (Qubit) as the basic unit of information and uses properties such as quantum superposition and quantum entanglement to perform computing tasks. On some specific problems, quantum algorithms have shown superior performance over classical algorithms. For example, Shor's algorithm has an exponential acceleration advantage over classical algorithms when dealing with the problem of prime factorization of large numbers. And Grover's algorithm has a quadratic acceleration effect over classical algorithms in the problem of searching unordered databases. These achievements not only demonstrate the great potential of quantum algorithms in solving complex problems, but also open up a broad path for the future development of quantum computing.

[0003] In the context of the noisy intermediate-scale quantum (NISQ) era, variational quantum algorithms (VQA) have attracted strong attention. VQA is a quantum-classical hybrid algorithm that uses a classical optimizer to optimize the parameters in a parameterized quantum circuit to find the optimal solution or approximate optimal solution to the problem. Common VQAs include the variational quantum eigensolver (VQE), which is used to calculate the ground state energy of molecules; the quantum approximate optimization algorithm (QAOA), which is used to solve combinatorial optimization problems; and quantum neural networks (QNNs). VQA is applicable to a variety of different problems and provides effective solutions for researchers and practitioners through its unique advantages.

[0004] Although amplitude coding is a common and important method for preparing quantum states, the depth of the quantum circuit prepared by it grows exponentially with the increase in the number of quantum bits, which is easily affected by environmental noise, resulting in reduced computing accuracy and efficiency. Summary of the invention

[0005] The purpose of the present invention is to provide a quantum state preparation method, device, equipment and medium.

[0006] An embodiment of the present invention provides a quantum state preparation method, comprising:

[0007] Setting the target quantum state to be prepared;

[0008] Setting a Hamiltonian, wherein the Hamiltonian is the negative value of the outer product of the left vector and the right vector of the target quantum state;

[0009] constructing a variational quantum circuit including training parameters according to a target quantum state;

[0010] Substituting preset parameter values ​​as training parameters into the variational quantum circuit to output a training quantum state after evolution of the variational quantum circuit;

[0011] Measuring the expectation value of the training quantum state after evolution of the variational quantum circuit with respect to the Hamiltonian;

[0012] Training the training parameters of the variational quantum circuit by a classical optimizer until the training parameters or expected values ​​converge to a set threshold;

[0013] Compare the training parameters or expected values ​​with the set thresholds;

[0014] In response to the training parameter or the expected value converging to a set threshold, the training quantum state after evolving through the variational quantum circuit under the convergence condition is output as the target quantum state to be prepared.

[0015] Furthermore, the method further comprises:

[0016] In response to the training parameters or expected values ​​not converging to the threshold, the new training parameters obtained through training are again substituted into the variational quantum circuit, and the expected value measurement step and the training step are repeated until the new training parameters or expected values ​​converge to the threshold.

[0017] Further, the training quantum state after evolution of the variational quantum circuit under convergence is output as the target quantum state to be prepared, including:

[0018] Verifying whether the fidelity between the training quantum state and the target quantum state after evolution of the variational quantum circuit is 1 under convergence;

[0019] In response to the fidelity between the training quantum state after evolving through the variational quantum circuit under convergence and the target quantum state being 1, the training quantum state after evolving through the variational quantum circuit under convergence is output as the target quantum state to be prepared.

[0020] Further, the training quantum state after evolution of the variational quantum circuit under convergence is output as the target quantum state to be prepared, and further includes:

[0021] In response to the fidelity between the training quantum state and the target quantum state after the variational quantum circuit evolution is not equal to 1 under convergence, repeatedly performing the circuit construction step, the parameter substitution step, the expected value measurement step, the training step, the threshold comparison step, and the fidelity verification step until the fidelity between the training quantum state and the target quantum state after the variational quantum circuit evolution is equal to 1 under convergence;

[0022] The variational quantum circuit constructed by repeating the circuit construction step each time is better than the variational quantum circuit constructed by executing the circuit construction step last time in terms of expressibility.

[0023] Furthermore, the method further comprises:

[0024] Converting the Hamiltonian into a Pauli combination; wherein the Pauli combination includes one or more combinations of Pauli operators I, X, Y and Z;

[0025] The variational quantum circuit is executed according to the Pauli combination to measure the expectation value of the training quantum state after the evolution of the variational quantum circuit with respect to the Hamiltonian.

[0026] Furthermore, the expected value is set to -1.

[0027] Furthermore, the method further comprises: verifying whether the fidelity between the optimal quantum state and the target quantum state after evolution of the variational quantum circuit is 1.

[0028] Further, the variational quantum circuit includes a quantum gate carrying training parameters; wherein the quantum gate carrying training parameters includes one or more of the following: an RX gate, an RY gate, an RZ gate, a CRX gate, a CRY gate, and a CRZ gate.

[0029] Furthermore, the target quantum state to be prepared is one of a W state and a GHZ state.

[0030] An embodiment of the present invention provides a quantum state preparation device, comprising:

[0031] A target setting module, used to set the target quantum state to be prepared;

[0032] A Hamiltonian module, used to set the Hamiltonian, which is the negative value of the outer product of the left vector and the right vector of the target quantum state;

[0033] A circuit construction module, used to construct a variational quantum circuit including training parameters according to a target quantum state;

[0034] A parameter substitution module, used to substitute a preset parameter value as a training parameter into the variational quantum circuit to output a training quantum state after evolution of the variational quantum circuit;

[0035] An expectation value measurement module, used to measure the expectation value of the training quantum state after evolution of the variational quantum circuit with respect to the Hamiltonian;

[0036] A circuit training module, used for training the training parameters of the variational quantum circuit by a classical optimizer until the training parameters or expected values ​​converge to a set threshold;

[0037] A threshold comparison module, used to compare the training parameter or expected value with the set threshold;

[0038] The quantum state preparation module is used to respond to the training parameter or expected value converging to a set threshold value, and output the training quantum state after evolution of the variational quantum circuit under convergence as the target quantum state to be prepared.

[0039] Furthermore, the device also includes:

[0040] A conversion module, which is used to convert the Hamiltonian into a Pauli combination; wherein the Pauli combination includes one or more combinations of Pauli operators I, X, Y and Z;

[0041] An execution module is used to execute the variational quantum circuit according to the Pauli combination to measure the expected value of the training quantum state after the evolution of the variational quantum circuit with respect to the Hamiltonian.

[0042] An embodiment of the present invention provides an electronic device, which includes a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the steps of the method described above are implemented.

[0043] An embodiment of the present invention provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the steps of the method described above are implemented.

[0044] The above technical solution of the present invention has the following beneficial technical effects:

[0045] 1. In the embodiment of the present invention, only two types of quantum gates, a single quantum bit gate and a double quantum bit gate capable of generating quantum entanglement, can be set in the constructed variational quantum circuit, and the quantum gate can carry training parameters, and the Hamiltonian can be set to a negative value so that the expected value is continuously reduced during the training process. The gradient descent algorithm can be used to minimize the expected value, and the training parameters are iteratively optimized multiple times to obtain a target variational quantum circuit with optimized and fixed training parameters, and then the target quantum state evolved by the target variational quantum circuit can be output, wherein the fidelity between the optimal quantum state and the target quantum state is 1; in this way, the quantum state corresponding to the original classical vector can be successfully prepared, and its fidelity is as high as 100%; and the classical optimization technology and the quantum circuit algorithm are combined, and this algorithm is not only efficient, but also can accurately realize the preparation of any quantum state, which fully meets the technical requirements of the NISQ era; and the use of multi-qubit gates is avoided, so that the structure of the variational quantum circuit is simplified, the depth of the quantum circuit is reduced, and the use of quantum gates can be reduced, which is easier to implement in physical experiments, and can provide more convenient and efficient quantum state preparation.

[0046] 2. The technical solution of the present invention proposes a simple variational quantum algorithm, whose steps are simple, easy to understand and easy to implement; and clarifies the Hamiltonian corresponding to the classical vector. This process simplifies the complexity of the algorithm and makes the preparation of quantum states more efficient and accurate.

[0047] 3. Judging from the actual operation results of the quantum computing software, the training time of the technical solution of the present invention is relatively short, only about 0.024 seconds; this advantage can realize the rapid preparation and training of quantum states, and further improve the efficiency and performance of quantum state preparation for column vectors with larger test dimensions.

[0048] 4. The circuit depth of the technical solution of the present invention depends on the selection of the variational quantum circuit ansatz. It is only necessary to set a variational quantum circuit ansatz with a shallower depth and stronger expression ability to complete the preparation of any quantum state, which makes the solution easier to implement in physical experiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the drawings in the embodiment of the present invention are briefly introduced below.

[0050] Figure 1 It is a flowchart of a quantum state preparation method according to an embodiment of the present invention.

[0051] Figure 2 It is a structural schematic diagram of a variational quantum circuit according to an embodiment of the present invention.

[0052] Figure 3 It is a structural schematic diagram of a target variation quantum circuit according to an embodiment of the present invention.

[0053] Figure 4 It is a schematic diagram of the structure of another variational quantum circuit according to an embodiment of the present invention.

[0054] Figure 5 Schematic diagram of the structure of another target variation quantum circuit according to an embodiment of the present invention.

[0055] Figure 6 It is a structural block diagram of a quantum state preparation device according to an embodiment of the present invention.

[0056] Figure 7 It is a schematic diagram of an electronic device used to implement a quantum state preparation method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0057] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that the purpose of providing these embodiments is to make the principles and spirit of the present invention clearer and more thorough, so that those skilled in the art can better understand and implement the principles and spirit of the present invention. The exemplary embodiments provided herein are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments herein, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0058] Those skilled in the art will appreciate that the embodiments of the present invention may be implemented as a quantum state preparation method, quantum circuit, electronic device, and computer-readable storage medium. Therefore, the present disclosure may be implemented in at least one of the following forms: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0059] In this document, terms such as first, second, etc. are only used to distinguish one entity (or operation) from another entity (or operation), and do not require or imply any order or association between these entities (or operations). In this document, the elements (such as parts, components, processes, steps) defined by the sentence "including..." do not exclude the existence of other elements in addition to the listed elements, that is, other elements that are not explicitly listed may also be included. In this document, any elements and their quantities in the drawings are used for illustration rather than limitation, and any names in the drawings are only used for distinction and do not have any limiting meaning.

[0060] The principle and spirit of the present invention are explained in detail below with reference to several exemplary or representative embodiments of the present invention.

[0061] Quantum state preparation refers to the process of converting a quantum system from an initial state to a target state. In quantum algorithms, it is usually necessary to convert quantum bits from a known initial state (such as the ground state |0>) to a specific target state for subsequent quantum operations and calculations.

[0062] Specifically, in the process of using quantum algorithms to solve classical problems, it is first necessary to convert classical information into corresponding quantum states for subsequent quantum algorithm processing. This operation can be defined as quantum state preparation. Currently, amplitude coding is a common coding method that uses the amplitude of quantum states to represent data. This coding method can efficiently utilize multiple dimensions of quantum states, allowing quantum algorithms to process large-scale data on smaller quantum systems.

[0063] Although amplitude coding is a common and important method for preparing quantum states, the depth of the quantum circuit prepared by it grows exponentially with the increase in the number of quantum bits, which is easily affected by environmental noise, resulting in reduced computing accuracy and efficiency.

[0064] In view of this, an embodiment of the present invention proposes a quantum state preparation method, which can efficiently and accurately realize the preparation of any quantum state through a variational quantum algorithm.

[0065] Figure 1 A schematic flow chart of a method for preparing a quantum state according to an embodiment of the present invention is shown, and the method comprises the following steps:

[0066] S110: Setting the target quantum state to be prepared.

[0067] Specifically, the quantum state to be prepared can be any quantum state such as a W state, a GHZ state or a BELL state, and the target quantum state to be prepared corresponds to the original classical vector after normalization; for example, the amplitude of the target quantum state to be prepared is set to a real number and has n quantum bits; n is an integer greater than or equal to 1.

[0068] S120: Setting a Hamiltonian, wherein the Hamiltonian is the negative value of the outer product of the left vector and the right vector of the target quantum state.

[0069] Specifically, when preparing a quantum state, the corresponding Hamiltonian needs to be set; the right vector of the target quantum state is , its left arrow is , for The conjugate transpose of With Saya Each element in the matrix is ​​multiplied two by two to obtain the corresponding product, and each product is negatively valued to form the corresponding Hermitian matrix, thereby obtaining the Hamiltonian. By setting the Hamiltonian to a negative value, the expected value is continuously reduced during the training process. For example, the gradient descent algorithm can be used to minimize the expected value, so that the training parameters carried by the quantum gates in the variational quantum circuit are the optimal parameters.

[0070] S140: Construct a variational quantum circuit including training parameters according to the target quantum state.

[0071] Specifically, the variational quantum circuit constructed according to the target quantum state may be provided with n quantum bits and quantum gates carrying training parameters. The constructed variational quantum circuit has a sufficiently strong expression capability, that is, it has the ability to prepare a larger number of quantum states, which means that it is easier to train the quantum state evolution to obtain the optimal quantum state, so that the fidelity between the optimal quantum state and the target quantum state can be equal to 1 or close to 1. Among them, the quantum gate carrying the training parameters can be, for example, an RX gate, an RY gate, an RZ gate, a CRX gate, a CRY gate, and a CRZ gate; in this embodiment, the variational quantum circuit may include: n quantum bits arranged in order from low to high, and n quantum bits may be initialized so that each quantum bit is in the |0> state. Since the target quantum state to be prepared has a corresponding set of N=2 n dimensional unit vectors, so n qubits can be used to prepare the optimal quantum state; since the dimension of each set of unit vectors is N=2 n , then the number of quantum bits n is the minimum number of quantum bits applied to the quantum state preparation of classical data, and there is no need to add auxiliary quantum bits; the quantum gates of the variational quantum circuit can, for example, select single-qubit gates and double-qubit gates that can generate quantum entanglement, and the training parameters carried by the quantum gates are, for example, rotation angles; therefore, the constructed variational quantum circuit only needs to perform the operations of single-qubit gates and double-qubit gates. In this way, the variational quantum circuit provided by the embodiment of the present invention only has two types of quantum gates, single-qubit gates and double-qubit gates, thereby avoiding the use of multi-qubit gates, simplifying the structure of the variational quantum circuit, reducing the depth of the quantum circuit, and reducing the use of quantum gates, making it easier to implement in physical experiments, and providing more convenient and efficient quantum state preparation.

[0072] S150: Substituting a preset parameter value as a training parameter into the variational quantum circuit to output a training quantum state after evolution of the variational quantum circuit.

[0073] S160: Measuring the expectation value of the Hamiltonian of the training quantum state after evolution of the variational quantum circuit.

[0074] S170: Training the training parameters of the variational quantum circuit by using a classical optimizer until the training parameters or expected values ​​converge to a set threshold.

[0075] Specifically, a quantum-classical hybrid neural network can be constructed first. The quantum-classical hybrid neural network can include the variational quantum circuit constructed in the above step S140. The classical optimizer can be, for example, Adam or BFGS. The training parameters of the variational quantum circuit in the quantum-classical hybrid neural network are trained and optimized by the classical optimizer. Each iterative optimization will return a new set of parameters for optimizing the performance of the quantum-classical hybrid neural network prepared by quantum.

[0076] S180: Compare the training parameter or expected value with the set threshold.

[0077] Specifically, for example, the threshold of the expected value is set to -1, and the Hamiltonian is set to a negative value so that the expected value is continuously reduced during the training process. The gradient descent algorithm can be used to minimize the expected value. When the measured expected value is not equal to -1 or is not close to -1, the training parameters in the variational quantum circuit continue to be iteratively trained; when the measured expected value is equal to -1 or is close to -1, the training parameters in the variational quantum circuit can be stopped.

[0078] S190: In response to the training parameter or the expected value converging to a set threshold, the training quantum state after evolution through the variational quantum circuit under convergence is output as a target quantum state to be prepared.

[0079] In an embodiment of the present invention, only two types of quantum gates, a single quantum bit gate and a double quantum bit gate capable of generating quantum entanglement, may be set in the constructed variational quantum circuit, and the quantum gate may carry training parameters, and the Hamiltonian may be set to a negative value so that the expected value is continuously reduced during the training process. The gradient descent algorithm may be used to minimize the expected value, and the training parameters may be iteratively optimized multiple times to obtain a target variational quantum circuit with optimized and fixed training parameters, and then the optimal quantum state after the evolution of the target variational quantum circuit may be output as the target quantum state to be prepared, wherein the output optimal quantum state may be consistent with the target quantum state. Or the output optimal quantum state and the target quantum state may differ from each other by only one global phase, so that the optimal quantum state corresponding to the original classical vector can be successfully prepared, and its fidelity can be as high as 1 or close to 1; the technical solution of the present invention combines classical optimization technology and quantum circuit algorithm, which is not only efficient, but also can accurately realize the preparation of any quantum state, which fully meets the technical requirements of the NISQ era; and avoids the use of multi-qubit gates, simplifies the structure of the variational quantum circuit, reduces the depth of the quantum circuit, and can reduce the use of quantum gates, which is easier to implement in physical experiments, and can provide more convenient and efficient quantum state preparation.

[0080] In some embodiments, before step S160: measuring the expectation value of the training quantum state after the evolution of the variational quantum circuit with respect to the Hamiltonian, the following specific steps are also included:

[0081] S131: converting the Hamiltonian into a Pauli combination; wherein the Pauli combination includes one or more combinations of Pauli operators I, X, Y and Z;

[0082] S132: executing a variational quantum circuit according to the Pauli combination to measure an expectation value of a training quantum state after evolution through the variational quantum circuit with respect to a Hamiltonian.

[0083] Specifically, by converting the Hamiltonian into a Pauli combination, it is easier to physically implement operations on quantum bits through various Pauli operators, and it is easier to measure the expectation value of the Hamiltonian of the training quantum state after evolution through the variational quantum circuit.

[0084] In some embodiments, the method further comprises the following steps:

[0085] S171: In response to the training parameters or expected values ​​not converging to the threshold, the new training parameters obtained through training are again substituted into the variational quantum circuit, and the expected value measurement step (step S160) and the training step (step S170) are repeated until the new training parameters or expected values ​​converge to the threshold. Further, step S171 may include the following specific steps:

[0086] S1711: further training and optimizing the training parameters of the variational quantum circuit by a classical optimizer according to the measured expected value of the training quantum state with respect to the Hamiltonian, and returning a new set of training parameters after each iterative optimization;

[0087] S1712: Substituting the new training parameters into the variational quantum circuit again to output the training quantum state after the variational quantum circuit has evolved again;

[0088] S1713: When the training parameters of the variational quantum circuit are optimized through multiple iterations so that the training parameters or expected values ​​converge to a set threshold, the training is stopped.

[0089] Specifically, in the deep learning of the machine, the gradient descent algorithm is used to minimize the loss function, that is, the loss value calculated by the loss function is minimized to obtain the optimal training parameters. In the embodiment of the present invention, the significant characteristics of the ground state of the quantum system may include, but are not limited to, the energy of the Hamiltonian in the ground state can be minimized. In order to obtain the ground state of the quantum system, the energy expectation value of the training quantum state with respect to the Hamiltonian can be regarded as the loss function to be optimized, for example, the rotation angle of each single quantum bit gate (such as the RY gate) in the variational quantum circuit is adjusted using the gradient descent method, so as to optimize the energy expectation value of the training quantum state with respect to the Hamiltonian. By setting the Hamiltonian to a negative value so that the expected value is continuously reduced during the training process, the gradient descent algorithm can be used to minimize the expected value, that is, the expected value can approach -1, so as to obtain the optimal training parameters. Substitute the returned new training parameters into the variational quantum circuit to output the training quantum state after the variational quantum circuit evolves again, measure the variational quantum circuit to obtain the expected value of the training quantum state with respect to the Hamiltonian, and use the result obtained from this measurement for further training, and reversely adjust the training parameters in the variational quantum circuit; when the expected value obtained by measurement is the smallest, that is, it approaches -1, stop training, and obtain the optimal training parameters; at this time, fix the training parameters to obtain the target variational quantum circuit.

[0090] In some embodiments, the method may further include the following specific steps:

[0091] The expected value is set equal to -1 or close to -1 to stop training the training parameters in the variational quantum circuit; thus, the fidelity between the optimal quantum state after evolution of the variational quantum circuit and the target quantum state is equal to 1 or close to 1.

[0092] In some embodiments, step S190: outputting the training quantum state after evolution of the variational quantum circuit under convergence as the target quantum state to be prepared may include the following steps:

[0093] S191: Verify whether the fidelity between the training quantum state and the target quantum state after evolution of the variational quantum circuit is 1 under convergence;

[0094] S192: In response to the fidelity between the training quantum state after evolving through the variational quantum circuit under convergence and the target quantum state being 1, outputting the training quantum state after evolving through the variational quantum circuit under convergence as the target quantum state to be prepared.

[0095] Specifically, if the fidelity between the training quantum state and the target quantum state after evolution through the variational quantum circuit under convergence is verified to be 1, the training quantum state after evolution through the variational quantum circuit under convergence is determined as the optimal quantum state. That is, by verifying whether the training quantum state after evolution through the variational quantum circuit is consistent with the target quantum state, or the output training quantum state differs from the target quantum state by only one global phase, it can be determined whether the training parameters at this time are optimal, and then the target variational quantum circuit with optimal and fixed training parameters can be determined, so that the fidelity between the optimal quantum state after evolution through the target variational quantum circuit and the target quantum state is close to or equal to 1.

[0096] In some embodiments, step S190: outputting the training quantum state after evolution of the variational quantum circuit under convergence as the target quantum state to be prepared may also include the following steps:

[0097] S193: In response to the fidelity between the training quantum state and the target quantum state after the evolution of the variational quantum circuit being not equal to 1 under convergence, repeatedly executing the circuit construction step (S140), the parameter substitution step (S150), the expected value measurement step (S160), the training step (S170), the threshold comparison step (S180), and the fidelity verification step (S191), until the fidelity between the training quantum state and the target quantum state after the evolution of the variational quantum circuit being equal to 1 under convergence;

[0098] The variational quantum circuit constructed by repeating the circuit construction step each time is better than the variational quantum circuit constructed by executing the circuit construction step last time in terms of expressibility. Further, step S193 may include the following specific steps:

[0099] S1931: If the fidelity between the training quantum state and the target quantum state after the current variational quantum circuit evolves under convergence is not equal to 1, a new variational quantum circuit is constructed; wherein the new variational quantum circuit is configured to be able to prepare a larger number of quantum states compared to the current variational quantum circuit; that is, the new variational quantum circuit has a stronger expressive ability in terms of expressibility;

[0100] S1932: Optimize the training parameters of the new variational quantum circuit through multiple iterations, so that the training parameters or expected values ​​converge to the set threshold, and stop training;

[0101] S1933: Verify again whether the fidelity between the training quantum state and the target quantum state after evolution through the new variational quantum circuit under convergence is 1.

[0102] Specifically, for any classical real vector, through the above-mentioned training steps, as long as the expression ability of the selected variational quantum circuit ansatz is sufficient, the corresponding quantum state preparation can be achieved; and through the above-mentioned verification steps, the fidelity between the original classical real vector and the prepared target quantum state can be as high as 1 or close to 1, which can fully prove the accuracy of the technical solution of the present invention in quantum state preparation.

[0103] In some embodiments, the quantum gate carrying the training parameters includes one or more of the following: an RX gate, an RY gate, an RZ gate, a CRX gate, a CRY gate, and a CRZ gate.

[0104] The implementation methods and advantages of the embodiments of the present invention are described above through multiple embodiments. The specific processing process of the embodiments of the present invention is described in detail below with reference to specific examples.

[0105] Example 1

[0106] Step S11: Assume that the target quantum state to be prepared is the w state, that is,

[0107]

[0108] Step S12: Construct the Hamiltonian Ham required to prepare the w state, that is

[0109]

[0110]

[0111]

[0112] in, for The conjugate transpose of For the right loss, Specifically, the matrix of the above Hamiltonian Ham is as follows:

[0113]

[0114] Step S13: The Hamiltonian Ham is further converted into a series of Pauli string combinations, that is, the Pauli matrix may include Pauli operators I, X, Y, and Z. For example, the above-constructed Hamiltonian Ham is converted into a Pauli matrix as follows:

[0115]

[0116] Step S14: construct a variational quantum circuit ansatz to be trained with n quantum bits and sufficient expression ability according to the target quantum state. It is particularly important to note that the stronger the expression ability, that is, the more quantum states can be prepared, the easier it is to train the quantum state to evolve to the optimal quantum state, and thus it is more likely that the fidelity between the optimal quantum state obtained by evolution and the target quantum state is equal to 1 or close to 1.

[0117] For example, the variational quantum circuit ansatz to be trained constructed according to the target quantum state in the above step S11 is as follows: Figure 2 As shown, the variational quantum circuit may include 3 quantum bits, which are arranged from low to high as q0, q1, and q2. The 3 quantum bits can be initialized so that each quantum bit is in the |0> state; the variational quantum circuit can arrange each quantum gate in sequence from front to back and perform quantum operations. The "front" and "back" mentioned here refer to the "front" and "back" in the sense of time, corresponding to Figure 2 , that is, the left is the front and the right is the back, in the order from front to back, that is, in the order from left to right. Among them, the variational quantum circuit can be provided with 1 RY gate, 1 CRY gate, 2 CNOT gates and 1 X gate from left to right, the RY gate is set on the quantum bit q0, the training parameter carried by the RY gate is a1, the target bit of the CRY gate is the quantum bit q1, the control bit is the quantum bit q0, the training parameter carried by the CRY gate is a2, the target bits of the two CNOT gates are quantum bits q1 and q2, and the control bits are quantum bits q0 and q1; the X gate can be set on the quantum bit q0; the training parameters carried by the RY gate and the CRY gate are, for example, the rotation angle.

[0118] Step S15: measuring the expected value exp of the training quantum state |Ψ> after the evolution of the variational quantum circuit to be trained ansatz with respect to the Hamiltonian Ham, that is, exp=<Ψ|Ham|Ψ>.

[0119] Step S16: Construct a complete quantum-classical hybrid neural network, train and optimize all training parameters of the variational quantum circuit ansatz to be trained in the quantum-classical hybrid neural network through a classical optimizer (such as Adam, BFGS, etc.), and return a new set of parameters.

[0120] Step S17: Substitute the new parameters into ansatz, and repeat steps S15-S16 until the training parameters converge to the set threshold, so that the expected value exp is as close to -1 as possible. Finally, a variational quantum circuit ansatz_final with fixed parameters is obtained.

[0121] For example, the variational quantum circuit constructed in the above step S14 is measured, and the expected value exp of the evolved training quantum state with respect to the Hamiltonian Ham is further trained to achieve the expected value exp as close to -1 as possible. The closer the absolute value of the measured expected value is to 1, the closer the fidelity between the training quantum state and the target quantum state is to 1. In other words, the closer the training quantum state is to the target quantum state, the more the corresponding quantum state preparation is achieved. Finally, the variational quantum circuit ansatz_final with fixed parameters obtained after training is as follows: Figure 3 As shown, the training time is short, about 0.024017333984375 seconds.

[0122] Step S19: Output the optimal quantum state after the target variational quantum circuit ansatz_final evolves with fixed parameters , which can further verify the optimal quantum state Whether the fidelity with the w state is 1 or close to 1;

[0123] The optimal quantum state of the final output for

[0124]

[0125] because =0.5773502691896258. It is not difficult to see that the fidelity of the optimal quantum state prepared at this time and the w state is 1.

[0126] Step S20: If the optimal quantum state finally output If the fidelity of the state w is not equal to 1, then return to step S14, reselect another variational quantum circuit ansatz with stronger expression ability, and then repeat steps S15 to S19 until the optimal quantum state is output. The fidelity with the w state is equal to 1 or close to 1.

[0127] Example 2

[0128] The similarities between Example 2 and Example 1 are not repeated here, but the difference is that:

[0129] Step S21: Assume that the target quantum state to be prepared is the GHZ state, that is,

[0130]

[0131] Step S22: Construct the Hamiltonian Ham required to prepare the GHZ state, that is,

[0132]

[0133]

[0134]

[0135] in, for The conjugate transpose of For the right loss, Specifically, the matrix of the above Hamiltonian Ham is as follows:

[0136]

[0137] Step S23: The Hamiltonian Ham is further converted into a series of Pauli string combinations, namely

[0138]

[0139] Step S24: The variational quantum circuit ansatz constructed according to the target quantum state in the above step S21 is as follows: Figure 4 As shown, the variational quantum circuit can be provided with 1 RY gate and 2 CRX gates from left to right. The RY gate is set on the quantum bit q0, and the training parameter carried by the RY gate is a1. The target bits of the CRX gate are quantum bits q1 and q2, and the control bits are quantum bits q0 and q1; the training parameters carried by the two CRX gates are a2 and a3 respectively.

[0140] Step S25: Measure the training quantum state Regarding the expected value exp of the Hamiltonian Ham, further training is performed to achieve the expected value exp as close to -1 as possible. The target variational quantum circuit ansatz_final obtained after training is as follows Figure 5 As shown in the figure, the training time is short, about 0.03055858612060547 seconds. The optimal parameters after training are {a1: 1.570796325608108 (π / 2), a2: -3.1415926533952447 (-π), a3:3.1415926528002585 (π)}, and the expected value is -1.0.

[0141] Step S26: The optimal quantum state finally output for

[0142]

[0143] The fidelity between the optimal quantum state prepared at this time and the GHZ state is 1.

[0144] Corresponding to the method embodiment of the present invention, the present invention also provides a quantum state preparation device, such as Figure 6 As shown, specifically, it may include:

[0145] A target setting module 510 is used to set a target quantum state to be prepared;

[0146] A Hamiltonian module 520, used to set a Hamiltonian, wherein the Hamiltonian is the negative value of the outer product of the left vector and the right vector of the target quantum state;

[0147] A circuit construction module 530, for constructing a variational quantum circuit including training parameters according to a target quantum state;

[0148] A parameter substitution module 540 is used to substitute a preset parameter value as a training parameter into the variational quantum circuit to output a training quantum state after evolution of the variational quantum circuit;

[0149] An expectation value measurement module 550, used to measure the expectation value of the training quantum state after the evolution of the variational quantum circuit with respect to the Hamiltonian;

[0150] A circuit training module 560, configured to train the training parameters of the variational quantum circuit by using a classical optimizer until the training parameters or expected values ​​converge to a set threshold;

[0151] A threshold comparison module 570, for comparing a training parameter or an expected value with a set threshold;

[0152] The quantum state preparation module 580 is used to output the training quantum state evolved through the variational quantum circuit under convergence as the target quantum state to be prepared in response to the training parameter or expected value converging to a set threshold.

[0153] In some embodiments, the device may further include:

[0154] A conversion module, which is used to convert the Hamiltonian into a Pauli combination; wherein the Pauli combination includes one or more combinations of Pauli operators I, X, Y and Z;

[0155] An execution module is used to execute the variational quantum circuit according to the Pauli combination to measure the expected value of the training quantum state after the evolution of the variational quantum circuit with respect to the Hamiltonian.

[0156] In another aspect, the present invention further provides an electronic device, see Figure 7 , Figure 7 1 is a block diagram of the structure principle of an electronic device according to an embodiment of the present invention. Figure 7 As shown, the electronic device includes a processor 601 and a memory 602 storing computer program instructions; when the processor 601 executes the computer program instructions, the quantum state preparation method in the above-mentioned embodiment is implemented.

[0157] Specifically, the processor 601 may include a central processing unit (CPU) or a graphics processing unit (GPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention. The memory 602 may include a memory for data or instructions. For example, the memory 602 may be at least one of the following: a hard disk drive (HDD), a read-only memory (ROM), a random access memory (RAM), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, a universal serial bus (USB) drive, or other physical / tangible memory storage device. For another example, the memory 602 includes a removable or non-removable (or fixed) medium. For another example, the memory 602 may be inside or outside the integrated gateway disaster recovery device. The memory 602 may be a non-volatile solid-state memory. In other words, the memory 602 generally includes a tangible (non-transitory) computer-readable storage medium (such as a memory device) encoded with executable instructions, wherein the stored executable instructions are executed by the processor 601 (such as executed by one or more processors), and the quantum state preparation method in the embodiment of the present invention can be implemented.

[0158] In one example, Figure 7 The electronic device shown may also include a communication interface 603 and a bus 610. The processor 601, the memory 602, and the communication interface 603 are connected and communicate with each other via the bus 610. The communication interface 603 is mainly used to implement communication between modules, devices, units, and / or devices in the electronic device.

[0159] The bus 610 includes hardware, software or both, and can couple the components of the online data traffic billing device to each other. For example, the bus may include at least one of the following: an accelerated graphics port (AGP) or other graphics bus, an enhanced industrial standard architecture (EISA) bus, a front-side bus (FSB), a hypertransport (HT) interconnect, an industrial standard architecture (ISA) bus, an infinite bandwidth interconnect, a low pin count (LPC) bus, a memory bus, a microchannel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standard association local (VLB) bus or other suitable bus. The bus 610 may include one or more buses. Although the embodiments of the present invention describe or show a specific bus, the embodiments of the present invention may consider any suitable bus or interconnection method.

[0160] On the other hand, an embodiment of the present invention further provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the aforementioned quantum state preparation method is implemented.

[0161] The flowchart and / or block diagram of the method and system of the embodiment of the present invention are described above by way of example, and various aspects of the related aspects are described. It should be understood that each box or combination thereof in the flowchart and / or block diagram can be implemented by computer program instructions, or by dedicated hardware that performs specified functions or actions, or by a combination of dedicated hardware and computer instructions. For example, these computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to form a machine that enables these instructions executed by such a processor to enable the implementation of the functions / actions specified in each box or combination thereof in the flowchart and / or block diagram. Such a processor can be a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit.

[0162] The functional blocks shown in the structural block diagram of the embodiment of the present invention can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc.; when implemented in software, it is a program or code segment used to perform the required task. The program or code segment can be stored in a memory, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0163] It should be noted that the present invention is not limited to the specific configurations and processes described above or shown in the figures. The above is only a specific implementation mode of the present invention. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the described system, device, module or unit can refer to the corresponding process in the method embodiment without further description. It should be understood that the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can think of various equivalent modifications or substitutions within the technical scope disclosed by the present invention, and these modifications or substitutions should be covered within the protection scope of the present invention.

Claims

1. A method for preparing a quantum state, characterized in that: include: S110: Set the target quantum state to be prepared. The target quantum state to be prepared has a set of corresponding 2 n is a unit vector of dimensions, n is the number of quantum bits in the variational quantum circuit; S120: Setting a Hamiltonian, wherein the Hamiltonian is the negative value of the outer product of the left vector and the right vector of the target quantum state; S140: constructing a variational quantum circuit including training parameters according to a target quantum state, wherein the variational quantum circuit includes n quantum bits and a quantum gate carrying the training parameters, wherein the quantum gate includes a single quantum bit gate and a double quantum bit gate capable of generating quantum entanglement; S150: Substituting a preset parameter value as a training parameter into the variational quantum circuit to output a training quantum state after evolution of the variational quantum circuit; S160: measuring the expectation value of the Hamiltonian of the training quantum state after the evolution of the variational quantum circuit; S170: training the training parameters of the variational quantum circuit by a classical optimizer until the training parameters or expected values ​​converge to a set threshold; S180: Compare the training parameter or expected value with a set threshold; S190: In response to the training parameter or expected value converging to a set threshold, outputting the training quantum state after evolution of the variational quantum circuit under convergence as the target quantum state to be prepared; wherein, The expected value is set to converge to -1.

2. The method according to claim 1, characterized in that: Also includes: In response to the training parameters or expected values ​​not converging to the threshold, the new training parameters obtained through training are again substituted into the variational quantum circuit, and steps S160 and S170 are repeated until the new training parameters or expected values ​​converge to the threshold.

3. The method according to claim 1, characterized in that Outputting the training quantum state after evolution of the variational quantum circuit under convergence as the target quantum state to be prepared includes: Verifying whether the fidelity between the training quantum state and the target quantum state after evolution of the variational quantum circuit is 1 under convergence; In response to the fidelity between the training quantum state after evolving through the variational quantum circuit under convergence and the target quantum state being 1, the training quantum state after evolving through the variational quantum circuit under convergence is output as the target quantum state to be prepared.

4. The method according to claim 3, characterized in that: Outputting the training quantum state after evolution of the variational quantum circuit under convergence as the target quantum state to be prepared, further comprising: In response to the fidelity between the training quantum state after the evolution of the variational quantum circuit and the target quantum state being not equal to 1 under convergence, repeatedly performing steps S140 to S190 until the fidelity between the training quantum state after the evolution of the variational quantum circuit and the target quantum state being equal to 1 under convergence; The variational quantum circuit constructed by repeating the circuit construction step each time is better than the variational quantum circuit constructed by executing the circuit construction step last time in terms of expressibility.

5. The method according to claim 1, characterized in that Also includes: Converting the Hamiltonian into a Pauli combination; wherein the Pauli combination includes one or more combinations of Pauli operators I, X, Y and Z; The variational quantum circuit is executed according to the Pauli combination to measure the expectation value of the training quantum state after the evolution of the variational quantum circuit with respect to the Hamiltonian.

6. The method according to claim 1, characterized in that The variational quantum circuit includes a quantum gate carrying training parameters; wherein the quantum gate carrying training parameters includes one or more of the following: an RX gate, an RY gate, an RZ gate, a CRX gate, a CRY gate, and a CRZ gate.

7. The method according to claim 1, characterized in that The target quantum state to be prepared is one of a W state and a GHZ state.

8. A quantum state preparation device, characterized in that: include: The target setting module is used to set the target quantum state to be prepared. The target quantum state to be prepared has a set of corresponding 2 n is a unit vector of dimensions, n is the number of quantum bits in the variational quantum circuit; A Hamiltonian module, used to set the Hamiltonian, which is the negative value of the outer product of the left vector and the right vector of the target quantum state; A circuit construction module, used to construct a variational quantum circuit including training parameters according to a target quantum state, wherein the variational quantum circuit includes n quantum bits and quantum gates carrying training parameters, wherein the quantum gates include single-qubit gates and double-qubit gates capable of generating quantum entanglement; A parameter substitution module, used to substitute a preset parameter value as a training parameter into the variational quantum circuit to output a training quantum state after evolution of the variational quantum circuit; An expectation value measurement module, used to measure the expectation value of the training quantum state after evolution of the variational quantum circuit with respect to the Hamiltonian; A circuit training module, used for training the training parameters of the variational quantum circuit by a classical optimizer until the training parameters or expected values ​​converge to a set threshold; A threshold comparison module is used to compare the training parameter or expected value with the set threshold; A quantum state preparation module is used to output the training quantum state evolved through the variational quantum circuit as the target quantum state to be prepared in response to the training parameter or expected value converging to a set threshold; wherein, The expected value is set to converge to -1.

9. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; when the electronic device executes the computer program instructions, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Thermal state preparation method and equipment under quantum system and storage medium

    CN116245184A