Variable component sub-line, quantum state amplitude coding method and device, equipment and medium

By constructing variable component quantum circuits and utilizing specific types of quantum gates, the problem of complex vector data encoding in quantum machine learning is solved, and efficient quantum state amplitude coding is achieved, ensuring the integrity and accuracy of information.

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

Patent Information

Application Number
CN202510035086.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-09
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In the field of quantum machine learning, how to efficiently encode complex vector data into quantum states is an urgent problem.

Method used

By constructing a variable component quantum circuit, quantum state amplitude encoding is performed using n qubits arranged in sequence from low to high bits, combining a single qubit uncontrolled U3 quantum gate and a dual qubit controlled U3 quantum gate. The method includes normalizing the complex vector to be encoded, obtaining the initial value of the random parameter, and training the parameters of the variable component quantum circuit through a classical optimizer until the loss value converges.

Benefits of technology

High-efficiency amplitude encoding of the normalized complex vector to be encoded in N=2n dimension is realized, ensuring the completeness and accuracy of information, and accurately mapping the complex vector to be encoded on its corresponding amplitude coded quantum state.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119940563A_ABST
    Figure CN119940563A_ABST
Patent Text Reader

Abstract

The invention discloses a variable component sub-line, a quantum state amplitude coding method, a quantum state amplitude coding device, quantum state amplitude coding equipment and a medium. The variable component sub-line comprises n quantum bits which are sequentially arranged from a low bit to a high bit, the circuit unit comprises one or more first operation columns which can be operated repeatedly, and each first operation column comprises one first uncontrolled U3 quantum gate and (n-1) controlled U3 quantum gates; the first uncontrolled U3 quantum gate is arranged on the first quantum bit at the lowest bit; each controlled U3 quantum gate is arranged on the second quantum bit to the nth quantum bit which are located at the second low position, and the control position of the controlled U3 quantum gate is the previous low-position quantum bit adjacent to the target position of the controlled U3 quantum gate; the second operation column comprises n second uncontrolled U3 quantum gates which are respectively arranged on the n quantum bits; the line unit is located between the input end of the variable component sub-line and the second operation column, and each uncontrolled U3 quantum gate and each controlled U3 quantum gate carry training parameters.
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 variational quantum circuit, a quantum state amplitude encoding method, device, equipment and medium. Background Art

[0002] Quantum computing, with its unique principles of quantum mechanics, has opened a new era in the field of computing. Its core component, the qubit, as the basic unit of information processing, gives quantum algorithms extraordinary computing power through quantum properties such as quantum superposition and quantum entanglement. When dealing with specific problems, quantum algorithms have proven their superior performance over traditional algorithms. Taking the Shor algorithm as an example, it has demonstrated an exponential acceleration of classical algorithms in solving the problem of prime factorization of large numbers, bringing a revolutionary impact to the field of cryptography. The Grover algorithm, on the other hand, has achieved a square-level efficiency improvement over classical search algorithms in the task of searching unordered databases, greatly optimizing the information retrieval process. These groundbreaking achievements not only highlight the huge potential of quantum algorithms in solving complex problems, but also lay a solid foundation for the future development of quantum computing technology, heralding the arrival of a new era of computing.

[0003] In the current era of noisy intermediate-scale quantum (NISQ) computing, variational quantum algorithms (VQA) have become a hot topic for researchers. As an innovative quantum-classical hybrid algorithm, VQA's core is to build variational quantum circuits, and then fine-tune the parameters in these circuits through classical optimizers to seek the optimal solution or its approximate solution to the problem. VQA covers a series of algorithms, including the variational quantum eigensolver (VQE) specifically for calculating the ground state energy of molecules, which provides a new analytical tool for the field of quantum chemistry. In addition, the quantum approximate optimization algorithm (QAOA) has demonstrated its unique advantages in dealing with complex combinatorial optimization problems and provides a new solution to optimization problems. Other VQAs such as quantum neural networks (QNNs) have also shown great potential in their respective application fields. The diversity and adaptability of VQA make it a powerful tool for solving various problems, providing researchers with a series of efficient and innovative solutions, and promoting the application and development of quantum computing technology in multiple fields.

[0004] In the field of quantum machine learning, mapping classical data to quantum states is a crucial step. Amplitude coding, as a widely recognized quantum coding scheme, uses the amplitude characteristics of quantum states to characterize data, allowing quantum systems to process large data sets even with a limited number of quantum bits. Amplitude coding is popular because it can make full use of the multi-dimensional characteristics of quantum superposition states, providing quantum algorithms with the ability to process high-dimensional data. Usually in the field of classical machine learning, algorithms mainly process real vector data; in contrast, in the field of quantum machine learning, quantum algorithms often mainly process complex vector data. Therefore, how to efficiently encode complex vector data into quantum states is a problem that needs to be solved urgently. Summary of the invention

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

[0006] An embodiment of the present invention provides a variational quantum circuit, including:

[0007] n quantum bits arranged in order from low to high, where n is an integer greater than or equal to 2;

[0008] A circuit unit, comprising one or more first operation trains that can be repeatedly operated, each of which comprises a first uncontrolled U3 quantum gate and n-1 controlled U3 quantum gates; the first uncontrolled U3 quantum gate is set on the first quantum bit located at the lowest position; each controlled U3 quantum gate is respectively set on the second quantum bit to the nth quantum bit located at the second lowest position, and the control bit of the controlled U3 quantum gate is the previous low-order quantum bit adjacent to the target bit of the controlled U3 quantum gate;

[0009] The second operation column includes n second uncontrolled U3 quantum gates, which are respectively set on n quantum bits; wherein,

[0010] The circuit unit is located between the input end of the variational quantum circuit and the second operation column, and each uncontrolled U3 quantum gate and controlled U3 quantum gate carries training parameters.

[0011] Furthermore, the controlled U3 quantum gate is a dual-qubit controlled U3 quantum gate.

[0012] Furthermore, two ends of the line unit are respectively connected to the input end of the variable component quantum circuit and one end of the second operation column, and the other end of the second operation column is connected to the output end of the variable component quantum circuit.

[0013] The embodiment of the present invention provides a quantum state amplitude encoding method, based on the variational quantum circuit, comprising:

[0014] Normalize the complex vector to be encoded;

[0015] Get a set of random parameter initial values;

[0016] Substituting the initial value of the parameter into the variational quantum circuit as a training parameter to output a training quantum state after evolution of the variational quantum circuit;

[0017] Calculating a loss value between the normalized complex vector to be encoded and the training quantum state; wherein the loss value is the negative value of the fidelity between the normalized complex vector to be encoded and the training quantum state;

[0018] Constructing a quantum-classical hybrid neural network, training and optimizing the training parameters of the variational quantum circuit in the quantum-classical hybrid neural network by a classical optimizer until the training parameters or the loss value converge to a set threshold;

[0019] In response to the training parameter or the loss value converging to a set threshold, the target quantum state after evolution of the variational quantum circuit is output; wherein the normalized complex vector to be encoded is mapped to the amplitude of the target quantum state.

[0020] Furthermore, the quantum state amplitude encoding method further comprises:

[0021] Determine whether the amplitude of the target quantum state is consistent with the corresponding element in the normalized complex vector to be encoded;

[0022] If the amplitude of the target quantum state is inconsistent with the corresponding element in the normalized complex vector to be encoded, then the modulus of each amplitude in the target quantum state and the modulus of the corresponding element in the normalized complex vector to be encoded, as well as the argument of each amplitude in the target quantum state and the argument of the corresponding element in the normalized complex vector to be encoded are compared respectively;

[0023] If the modulus of each amplitude in the target quantum state is consistent with the modulus of the corresponding element in the normalized complex vector to be encoded and the difference between the argument of each amplitude in the target quantum state and the argument of the corresponding element in the normalized complex vector to be encoded is consistent, then the fidelity of the target quantum state and the normalized complex vector to be encoded is 1.

[0024] Furthermore, the normalizing the complex vector to be encoded includes:

[0025] Determine whether the number of elements of the complex vector to be encoded satisfies N=2 n ;

[0026] If the number of elements of the complex vector to be encoded does not satisfy N = 2 n , then zero padding is performed so that the number of elements of the complex vector to be encoded satisfies N = 2 n ;in,

[0027] The modulus length of the complex vector to be encoded after normalization is 1.

[0028] Furthermore, the loss value is calculated by the following conditional formula:

[0029]

[0030] Where x is the complex vector to be encoded, x = [x0, x1, ..., x N-1 ] T , where T represents transpose, x i is a complex number, and i=0,1,...N-1; |ψ> is the quantum state after evolution; ψ i is the i-th amplitude of the evolved quantum state.

[0031] The embodiment of the present invention provides a quantum state amplitude encoding device, based on the variational quantum circuit, including:

[0032] Normalization module: used to normalize the complex vector to be encoded;

[0033] Acquisition module: used to obtain a set of random parameter initial values;

[0034] Substitution module: used to substitute the initial value of the parameter as the training parameter into the variational quantum circuit to output the training quantum state after the evolution of the variational quantum circuit;

[0035] A calculation module: used to calculate the loss value between the normalized complex vector to be encoded and the training quantum state; wherein the loss value is the negative value of the fidelity between the normalized complex vector to be encoded and the training quantum state;

[0036] Training module: used to train the training parameters of the variational quantum circuit through a classical optimizer until the training parameters or the loss value converge to a set threshold;

[0037] Response module: It is used to output the target quantum state after the evolution of the variational quantum circuit in response to the training parameter or loss value converging to the set threshold; wherein the normalized complex vector to be encoded is mapped to the amplitude of the target quantum state.

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

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

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

[0041] In the embodiment of the present invention, only two types of quantum gates, namely, a single-qubit uncontrolled U3 quantum gate and a double-qubit controlled U3 quantum gate, can be set in the variational quantum circuit, and each U3 quantum gate carries training parameters. The training parameters are iteratively optimized multiple times to obtain a target variational quantum circuit with optimized and fixed parameters, and then the target quantum state evolved by the target variational quantum circuit can be output to achieve N=2 n The invention provides efficient amplitude coding of a normalized complex vector to be encoded of a dimension; when the normalized complex vector to be encoded is mapped to the amplitude of the target quantum state, each element in the normalized complex vector to be encoded is identical or nearly identical to each amplitude of the target quantum state in a one-to-one correspondence; or, when the normalized complex vector to be encoded is mapped to the amplitude of the target quantum state, there is a global phase factor difference between the amplitude of the target quantum state and the normalized complex vector to be encoded, and the fidelity of the target quantum state and the normalized complex vector to be encoded is also achieved to be 1. The technical solution of the present invention combines classical optimization technology with variational quantum algorithms, and can accurately map the complex vector to be encoded to its corresponding amplitude-coded quantum state, ensuring the integrity and accuracy of the information. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0044] Figure 2 It is a flowchart of a quantum state amplitude encoding method according to an embodiment of the present invention.

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

[0046] Figure 4 It is a schematic diagram of the structure of a target variation quantum circuit according to an embodiment of the present invention.

[0047] Figure 5 It is a structural block diagram of a quantum state amplitude encoding device according to an embodiment of the present invention.

[0048] Figure 6 It is a schematic diagram of an electronic device used to implement the quantum state amplitude encoding method of an embodiment of the present invention. DETAILED DESCRIPTION

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

[0050] Those skilled in the art will appreciate that the embodiments of the present invention may be implemented as a quantum state amplitude encoding method, a variational quantum circuit, an electronic device, and a 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.

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

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

[0053] The embodiment of the present invention provides a variational quantum circuit, such as Figure 1 As shown, specifically, it may include:

[0054] n quantum bits arranged in order from low to high, where n is an integer greater than or equal to 2;

[0055] A circuit unit, comprising one or more first operation trains that can be repeatedly operated, each of which comprises a first uncontrolled U3 quantum gate and n-1 controlled U3 quantum gates; the first uncontrolled U3 quantum gate is set on the first quantum bit located at the lowest position; each controlled U3 quantum gate is respectively set on the second quantum bit to the nth quantum bit located at the second lowest position, and the control bit of the controlled U3 quantum gate is the previous low-order quantum bit adjacent to the target bit of the controlled U3 quantum gate;

[0056] The second operation column includes n second uncontrolled U3 quantum gates, which are respectively set on n quantum bits; wherein,

[0057] The circuit unit is located between the input end of the variational quantum circuit and the second operation column, and each uncontrolled U3 quantum gate and controlled U3 quantum gate carries training parameters.

[0058] Specifically, the line unit and the second operation column can be arranged 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 1 , 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. In this embodiment, the variational quantum circuit may include: n quantum bits arranged in sequence from low to high, the n quantum bits may be initialized so that each quantum bit is in the |0> state, and the n quantum bits may be used for N=2 n The dimension of each set of complex vectors to be encoded is N = 2. n , then the number of quantum bits n is the minimum number of quantum bits required to encode classical data, and there is no need to add auxiliary quantum bits. Figure 1The circuit unit in the dotted box shown in may include multiple first operation columns, and the first operation column may be arranged in p columns from left to right in sequence, or it may be defined as the first operation column may be repeatedly arranged in p layers from left to right, that is, the first operation column may be repeatedly operated p times; for example, the first operation column may include 1 first uncontrolled U3 quantum gate and n-1 controlled U3 quantum gates; wherein, the training parameters carried by each uncontrolled U3 quantum gate and the controlled U3 quantum gate are set to θ, ф and γ, and the training parameters θ, ф and γ are set to rotation angles, for example, and are distinguished by setting different subscripts on each training parameter, for example, the subscripts are p1, p2...pn; the second operation column on the right may include n second uncontrolled U3 quantum gates, and the training parameters carried by each second uncontrolled U3 quantum gate are set to θ, ф and γ, and are distinguished by setting different subscripts on each training parameter, for example, the subscripts are 1, 2, 3...n; according to the pre-constructed quantum-classical hybrid neural network, the variational quantum circuit in the quantum neural network is trained and optimized using a classical optimizer The training parameters carried by each uncontrolled U3 quantum gate and controlled U3 quantum gate are optimized through multiple iterations until the set convergence threshold is met, so as to obtain the training parameter value of each U3 quantum gate after iterative optimization, and the training parameter value is fixed to obtain the target variational quantum circuit, and the target quantum state evolved by the target variational quantum circuit can be output to realize amplitude coding of the complex vector to be encoded; since only two types of quantum gates, namely, single-qubit uncontrolled U3 quantum gate and double-qubit controlled U3 quantum gate, are set in the variational quantum circuit provided by the embodiment of the present invention, the use of multi-qubit gates is avoided, so that the structure of the variational quantum circuit is simplified, and the execution efficiency of amplitude coding can be further improved, and the use of quantum gates is reduced; and each U3 quantum gate carries training parameters, which can be iteratively optimized. By combining classical optimization technology and quantum circuit algorithm, the complex vector to be encoded can be accurately mapped to its corresponding amplitude-coded quantum state, so as to ensure the integrity and accuracy of the information.

[0059] In some embodiments, the U3 quantum gate can simulate any single quantum bit rotation operation. For example, the U3 quantum gate can be used to implement any RX, RY or RZ gate rotation operation. The RX, RY or RZ gate is a single quantum bit rotation gate corresponding to the rotation around the X axis, Y axis and Z axis respectively. The matrix form of the RX(θ) gate is as follows:

[0060]

[0061] The matrix form of the RY(θ) gate is shown below:

[0062]

[0063] The matrix form of the RZ(θ) gate is shown below:

[0064]

[0065] If the U3 quantum gate is used to implement a single-qubit rotation gate, appropriate θ, ф and γ parameters can be set. For example:

[0066] 1) If the U3 quantum gate is used to implement the RX(θ) gate, the parameters can be set to U3(θ,0,0);

[0067] 2) If the U3 quantum gate is used to implement the RY(θ) gate, the parameters can be set to U3(θ, л / 2, 0);

[0068] 3) If the U3 quantum gate is used to implement the RZ(θ) gate, the parameters can be set to U3(0,0,θ).

[0069] It can be seen that the U3 quantum gate can realize any single-qubit gate; in quantum computing, a single-qubit gate refers to a unitary transformation acting on a single qubit. Since the U3 quantum gate can be expressed as a combination of rotations around the three principal axes (X, Y, and Z axes) of the Bloch sphere, any unitary transformation of a single qubit on the Bloch sphere can be generated. The matrix form of the U3 quantum gate is shown below:

[0070]

[0071] In the exemplary embodiment, the controlled U3 quantum gate is a two-qubit controlled U3 quantum gate. That is, the control bit of the two-qubit controlled U3 quantum gate is the previous low-order quantum bit of the target bit, which can be recorded as a CU3 quantum gate; compared with multi-qubit gates such as C^4U3 quantum gate, C^3U3 quantum gate and C^2U3 quantum gate, the CU3 quantum gate is easy to implement in physical experiments.

[0072] In an exemplary embodiment, two ends of the circuit unit are respectively connected to an input end of the variational quantum circuit and one end of the second operation column, and the other end of the second operation column is connected to an output end of the variational quantum circuit.

[0073] In some embodiments, the number of first operation trains p is reduced while the number of training iterations is increased, so as to achieve high fidelity (fidelity equal to 1 or close to 1) through more optimization steps with fewer quantum gate operations; or, the number of first operation trains p is increased to reduce the required number of training iterations, and to use deeper quantum circuits to capture more complex quantum states, thereby accelerating the convergence speed, so as to achieve high fidelity. For example, for a dimension of 2 4When the complex vector to be encoded is subjected to amplitude encoding by the variational quantum circuit in the embodiment of the present invention, when the number of the first operation columns is set to 4, the fidelity between the complex vector to be encoded and the training quantum state can eventually reach 1, and the number of training steps is about 5000 steps; therefore, for complex vectors to be encoded with more dimensions, especially with a dimension of 2 n When n is greater than or equal to 3, by appropriately increasing the number of the first operation columns, not only the number of training steps can be reduced, but also the fidelity between the complex vector to be encoded and the quantum state can be guaranteed.

[0074] Figure 2 A schematic flow chart of a quantum state amplitude encoding method according to an embodiment of the present invention is shown. Based on the variational quantum circuit according to the embodiment of the present invention, the method includes the following specific steps:

[0075] S101: normalizing the complex vector to be encoded;

[0076] S102: Obtain a set of random parameter initial values;

[0077] S103: Substituting the initial value of the parameter into the variational quantum circuit as a training parameter to output a training quantum state after evolution of the variational quantum circuit;

[0078] S104: Calculating a loss value between the normalized complex vector to be encoded and the training quantum state; wherein the loss value is a negative value of the fidelity between the normalized complex vector to be encoded and the training quantum state;

[0079] S105: constructing a quantum-classical hybrid neural network, and training and optimizing the training parameters of the variational quantum circuit in the quantum-classical hybrid neural network by a classical optimizer until the training parameters or the loss value converge to a set threshold;

[0080] S106: In response to the training parameter or the loss value converging to a set threshold, the target quantum state after evolution of the variational quantum circuit is output; wherein the normalized complex vector to be encoded is mapped to the amplitude of the target quantum state.

[0081] Specifically, by adopting the variational quantum circuit of the embodiment of the present invention, only two types of quantum gates, namely, a single-qubit uncontrolled U3 quantum gate and a double-qubit controlled U3 quantum gate, can be set in the variational quantum circuit, and each U3 quantum gate carries training parameters. The training parameters are iteratively optimized multiple times to obtain a target variational quantum circuit with optimized and fixed parameters, and then the target quantum state evolved by the target variational quantum circuit can be output to achieve N=2 nThe invention provides efficient amplitude coding of a normalized complex vector to be encoded of a dimension; when the normalized complex vector to be encoded is mapped to the amplitude of the target quantum state, each element in the normalized complex vector to be encoded is identical or nearly identical to each amplitude of the target quantum state in a one-to-one correspondence; or, when the normalized complex vector to be encoded is mapped to the amplitude of the target quantum state, there is a global phase factor difference between the amplitude of the target quantum state and the normalized complex vector to be encoded, and the fidelity of the target quantum state and the normalized complex vector to be encoded is 1. The technical solution of the present invention combines classical optimization technology and quantum circuit algorithm, and can accurately map the complex vector to be encoded to its corresponding amplitude-coded quantum state, ensuring the integrity and accuracy of the information.

[0082] In some embodiments, the quantum state amplitude encoding method may further include the following specific steps:

[0083] S107: When the amplitude of the target quantum state is inconsistent with the normalized complex vector to be encoded, verify whether there is a global phase factor difference between the amplitude of the target quantum state and the normalized complex vector to be encoded; wherein,

[0084] S1071: Calculate the modulus length of each amplitude in the target quantum state, and calculate the modulus length of each element in the normalized complex vector to be encoded;

[0085] S1072: Compare the modulus length of each amplitude in the target quantum state with the modulus length of each element in the normalized complex vector to be encoded to see if they correspond one to one;

[0086] S1073: Calculate the argument of each amplitude in the target quantum state, and calculate the argument of each element in the normalized complex vector to be encoded;

[0087] S1074: Calculate the difference of the arguments of each amplitude in the target quantum state and the arguments of each element in the normalized complex vector to be encoded one by one, so as to obtain a difference set;

[0088] S1075: Compare whether each argument difference in the difference value set is consistent;

[0089] S1076: If the modulus of each amplitude in the target quantum state corresponds one-to-one to the modulus of each element in the normalized complex vector to be encoded, and each argument difference in the difference set is consistent, then it is determined that there is a global phase factor difference between the amplitude of the target quantum state and the normalized complex vector to be encoded; wherein all quantum states that differ by a global phase are the same quantum state.

[0090] Specifically, it is verified whether there is a global phase factor difference between the amplitude of the target quantum state after evolution of the target variational quantum circuit and the normalized complex vector to be encoded; if such a difference exists, it can be known that the fidelity of the target quantum state and the normalized complex vector to be encoded is 1, thereby achieving the accurate mapping of the complex vector to be encoded to its corresponding amplitude-coded quantum state, ensuring the integrity and accuracy of the information.

[0091] In some embodiments, step S101: performing normalization processing on the complex vector to be encoded includes the following specific steps:

[0092] S1011: Determine whether the number of elements of the complex vector to be encoded satisfies N=2 n ;

[0093] S1012: If the number of elements of the complex vector to be encoded does not satisfy N=2 n , then zero padding is performed so that the number of elements of the complex vector to be encoded satisfies N = 2 n ; Among them, the modulus length of the complex vector to be encoded after normalization is 1.

[0094] Specifically, when the number of elements of the complex vector to be encoded after normalization satisfies 2 n When the complex vector to be encoded x=[x0,x1,...,x N-1 ] T , where T represents transpose, x i is a complex number, and i = 0, 1, ... N-1; the quantum state can be prepared by amplitude coding as follows:

[0095]

[0096] Among them, the modulus length of the complex vector x to be encoded after normalization is 1, that is,

[0097]

[0098] It can be seen from this that all component elements of the complex vector x to be encoded can be mapped to the amplitude corresponding to |i> in the quantum state |ψ>.

[0099] If the complex vector to be encoded does not meet the normalization condition, it can be made to meet the normalization condition through a normalization operation, such as extracting a common factor.

[0100] In some embodiments, step S104: calculating the loss value between the normalized complex vector to be encoded and the training quantum state, comprises the following specific steps:

[0101] According to the preset loss function, the fidelity of the normalized complex vector to be encoded and the training quantum state is calculated to obtain the loss value;

[0102] Add a minus sign before the loss value to reversely adjust the training parameters in the variational quantum circuit;

[0103] The loss value is calculated by the following conditional formula:

[0104]

[0105] Where x is the complex vector to be encoded, x = [x0, x1, ..., x N-1 ] T , where T represents transpose, x i is a complex number, and i=0,1,...N-1; |ψ> is the quantum state after evolution; ψ i is the i-th amplitude of the evolved quantum state.

[0106] Among them, the above-mentioned loss function loss can be defined as the fidelity of the complex vector to be encoded and the evolved training quantum state (i.e., the modulus square of the inner product), and adding a minus sign before the loss value can reversely adjust the training parameters in the variational quantum circuit; the minus sign is added to continuously reduce the loss value in the subsequent training process.

[0107] In some embodiments, step S105: constructing a quantum-classical hybrid neural network, training and optimizing the training parameters of the variational quantum circuit in the quantum-classical hybrid neural network by a classical optimizer until the training parameters or the loss value converge to a set threshold, comprises the following specific steps:

[0108] S1051: further training and optimizing the training parameters of the variational quantum circuit using a classical optimizer according to the calculated loss value, and returning a new set of training parameters after each iterative optimization;

[0109] S1052: 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;

[0110] S1053: When the training parameters of the variational quantum circuit are optimized through multiple iterations so that the training parameters or the loss value converge to a set threshold, the training is stopped to obtain the target variational quantum circuit.

[0111] Specifically, for example, the threshold of the loss value can be set to -1, which means that the fidelity of the quantum state obtained by training and the original complex vector to be encoded is close to 1. After multiple iterative optimizations, the loss value may be equal to or close to -1, and the training is stopped. The training parameters are fixed to obtain the target variational quantum circuit; therefore, the quantum final state after the evolution of the target variational quantum circuit can be output to realize amplitude encoding of the normalized complex vector to be encoded.

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

[0113] Step S1: Get an N=2 n The dimensional complex vector to be encoded x, x = [x0, x1, ..., x N-1 ] T , where x i Set to a complex number. If the dimension of the complex vector x to be encoded is not equal to 2 n , you can add appropriate 0 to make its dimension equal to 2 n If the complex vector to be encoded does not satisfy the normalization condition, a normalization operation, such as extracting a common factor, can be performed to make it satisfy the normalization condition.

[0114] For example, if N=16=2 after normalization 4 The dimensional complex vector x to be encoded is as follows:

[0115] [0.27075625+0.08961099j 0.30023999+0.30188747j 0.26944347+0.10346733j0.16456109+0.06782661j 0.07214395+0.02040008j 0.00353354+0.30468214j0.13344195+0.03963427j 0.12472576+0.09985801j 0.16202504+0.02199172j0.14829769+0.06967691j 0.17215614+0.12202373j 0.16844539+0.2777979j0.23587164+0.10709038j 0.22083052+0.30526458j 0.19209658+0.00890671j0.1320851+0.1090195j]

[0116] Specifically, the i-th element in the complex vector x to be encoded can be x i =a i +jb i , where j is an imaginary unit and satisfies j 2 =-1, a i and b i Represents the real and imaginary parts of the i-th element, respectively, a i and b i is a real number; and i = 0, 1, ..., 2n-1. According to the above complex vector x to be encoded, it can be known that n = 4, and the modulus length of the complex vector x to be encoded is 1.

[0117] Step S2: Construct a variational quantum circuit in the above embodiment. The variational quantum circuit may specifically include: n quantum bits arranged in order from low to high, where n is an integer greater than or equal to 2; a circuit unit, which includes one or more first operation columns that can be repeatedly operated, each of which includes a first uncontrolled U3 quantum gate and n-1 controlled U3 quantum gates; the first uncontrolled U3 quantum gate is set on the first quantum bit located at the lowest position; each controlled U3 quantum gate is respectively set on the second to nth quantum bits located at the second lowest position, and the control bit of the controlled U3 quantum gate is the previous low-order quantum bit adjacent to the target bit of the controlled U3 quantum gate; a second operation column, which includes n second uncontrolled U3 quantum gates, which are respectively set on n quantum bits; wherein the circuit unit is located between the input end of the variational quantum circuit and the second operation column, and each uncontrolled U3 quantum gate and the controlled U3 quantum gate carry training parameters.

[0118] For example, according to the N=16=24-dimensional complex vector x to be encoded obtained in step S1 above, a variational quantum circuit ansatz containing 4 quantum bits can be constructed, such as Figure 3As shown, the four quantum bits arranged in order from low to high can be recorded as q0, q1, q2, and q3, wherein, assuming that the number of the first operation column p=4, the first operation column may include 1 first uncontrolled U3 quantum gate and n-1 controlled U3 quantum gates, 1 first uncontrolled U3 quantum gate is set on the quantum bit q0, and n-1 controlled U3 quantum gates are respectively set on the quantum bits q1, q2, and q3 in sequence; wherein, the training parameters θ, ψ, and γ carried by the first uncontrolled U3 quantum gate in the first operation column can be They are represented as a_d0_0, b_d0_0, g_d0_0 respectively; the training parameters θ, ψ, γ carried by the controlled U3 quantum gate in the first operation column can be represented as t_d0_0, p_d0_0, l_d0_0; t_d0_1, p_d0_1, l_d0_1; t_d0_2, p_d0_2, l_d0_2 respectively; the training parameters θ, ψ, γ carried by the first uncontrolled U3 quantum gate in the second first operation column can be represented as a_d1_0, b_d1_0, g_d0_0 respectively. _d1_0; the training parameters θ, ψ, γ carried by the controlled U3 quantum gate in the second first operation column can be expressed as t_d1_0, p_d1_0, l_d1_0; t_d1_1, p_d1_1, l_d1_1; t_d1_2, p_d1_2, l_d1_2; and so on, the training parameters carried by each uncontrolled U3 quantum gate and controlled U3 quantum gate in the third and fourth first operation columns can be obtained; the second operation column on the right may include n second uncontrolled U3 quantum gates, The training parameters θ, ψ, and γ it carries can be expressed as a_d4_0, b_d4_0, g_d4_0; a_d4_1, b_d4_1, g_d4_1; a_d4_2, b_d4_2, g_d4_2; a_d4_3, b_d4_3, g_d4_3; thus, there are a total of 20 parameter-containing quantum gates in the variational quantum circuit ansatz, including only single-qubit U3 quantum gates and dual-qubit controlled U3 quantum gates. All 20 parameter-containing quantum gates carry training parameters. It is worth noting that Figure 3 and Figure 4 The thick solid line in does not belong to the structure of the variational quantum circuit in the embodiment of the present invention, and is only used to distinguish each first operation column.

[0119] Step S3: Obtain a set of initial values ​​of random parameters, substitute the set of initial values ​​of random parameters into the variational quantum circuit ansatz, and output the quantum state |ψ> after the evolution of the variational quantum circuit ansatz, whose corresponding column vector is |ψ>=[ψ0,ψ1,...,ψ N-1 ] T .

[0120] Step S4: Define the loss function loss as the fidelity (norm of the inner product) of the complex vector to be encoded and the quantum state after evolution, that is

[0121]

[0122] In the formula, the negative sign is used to continuously reduce the loss value in the subsequent training process, so that the model parameters can be driven to adjust towards the optimal solution in the subsequent training.

[0123] Step S5: Build a complete quantum-classical hybrid neural network. Use classical optimizers (such as Adam and BFGS) to train and optimize the parameters of the variational quantum circuit ansatz in the quantum neural network. After each iterative optimization, a new set of training parameters will be returned.

[0124] Step S6: Substitute the new training parameters into the variational quantum circuit ansatz, and repeat steps S3-S5 until the training parameters or loss value converge to the set threshold. For example, the threshold of the loss value is set to -1, which means that the fidelity between the quantum state obtained by training and the original complex vector to be encoded is close to 1. After multiple iterations of optimization, the loss value can be equal to or close to -1, and the training stops. Finally, the target variational quantum circuit ansatz_final with fixed parameters is obtained.

[0125] For example, the target variational quantum circuit ansatz_final is Figure 4 As shown, the final fixed parameters after training are as follows:

[0126] [9.7901088e-01-3.9960173e-012.4933659e-02-1.2880703e+00

[0127] -7.7469885e-011-4.3750161e+152.1636546e+00-1.5003237e+00

[0128] -6.3162044e+14-1.6189601e+00-1.3803344e+00-2.7236389e+14

[0129] 6.8746084e-01-2.6895663e-01-3.9875260e-01-1.8163627e+00

[0130] 1.2415557e-011.3813086e+001.9507015e+00-6.8290097e-01

[0131] -4.7241908e-01-1.1373378e+001.8866674e+008.8323718e-01

[0132] 8.5901320e-01-1.0444497e-01-2.2587903e-01-5.9097046e-01

[0133] 6.3667399e-011.1927072e+001.1871394e+00 -8.6159295e-01

[0134] -2.1907225e+00-1.1903194e+00-4.6772256e-01-4.0284714e-01

[0135] 1.0185508e+001.9910568e-01-1.183248e-012.1385446e+00

[0136] 1.4965998e-01-2.9164240e-017.4136186e-011 -1.8145423e-01

[0137] 4.4138968e-011.6150512e+00-6.1327141e-02-5.7291102e-02

[0138] 3.6310770e-025.2562857e-012.0668119e-011.5557659e+00

[0139] 1.1451017e+00-9.4861621e-011.5380784e+000 -2.1403363e-02

[0140] -8.6754489e-011.6310056e+007.2670020e-021.1198203e-01]

[0141] During the entire training process, a total of about 5,000 steps were trained. From the training process below, it can be seen that the fidelity (modulus square of the inner product) between the training quantum state and the original complex vector to be encoded is constantly approaching 1, and finally equal to 1, the negative sign can be ignored, and the training time is short, about 7 seconds, which shows the efficiency of this method. The changes in each training step and loss value during the training process are shown below:

[0142] None

[0143] 0: [-0.07514379]

[0144] 100: [-0.9779471]

[0145] 200:[-0.9962183]

[0146] 300:[-0.9999254]

[0147] 400:[-0.99999696]

[0148] 500:[-0.99999994]

[0149] 600:[-0.9999999]

[0150] 700:[-0.99995196]

[0151] 800:[-1.]

[0152] 900:[-0.999766]

[0153] 1000:[-1.]

[0154] 1100:[-1.]

[0155] 1200:[-0.99999976]

[0156] 1300:[-1.]

[0157] 1400:[-0.9999737]

[0158] 1500:[-1.]

[0159] 1600:[-1.]

[0160] 1700:[-0.9999904]

[0161] 1800:[-1.]

[0162] 1900:[-1.]

[0163] 2000:[-1.]

[0164] 2100:[-0.9999771]

[0165] 2200:[-1.]

[0166] 2300:[-1.]

[0167] …

[0168] 4700:[-0.9999999]

[0169] 4800:[-1.]

[0170] 4900:[-1.] 0:00:07.591561

[0172] Step S7: Output the quantum final state after the target variational quantum circuit ansatz_final evolves. At this time, the quantum final state is the quantum state corresponding to the amplitude encoding of the normalized complex vector to be encoded. 4 The dimensional complex vector x to be encoded realizes amplitude encoding, and the final quantum state |ψ f >As shown below:

[0173]

[0174] Step S8: When the output quantum final state |ψ f > is inconsistent with the complex vector x to be encoded, verify the quantum final state |ψ f > whether there is a global phase factor difference between the amplitude of and the complex vector x to be encoded; the verification process is as follows:

[0175] 1) Calculate the quantum final state |ψ f >The modulus length of each amplitude in and the modulus length of each element in the complex vector x to be encoded, where the modulus length γi of each element can be calculated according to the following conditional formula:

[0176]

[0177] In the formula, a i and b i Respectively represent the real and imaginary parts of the i-th element in the complex vector x to be encoded, a i and b i is a real number;

[0178] For example, for the above quantum final state |ψ f >The modulus length of each amplitude is calculated and the results are as follows: [0.28520002 0.42577002 0.28862654 0.17799102 0.07497272 0.30470259 0.13920357 0.15977524 0.16351069 0.16385079 0.21101549 0.3248777 0.25904396 0.37676598 0.19230298 0.17126503]

[0180] The modulus length of each element in the above complex vector x to be encoded is calculated, and the result is as follows: [0.28520006 0.42577 0.28862653 0.17799101 0.07497275 0.30470263 0.13920355 0.15977527 0 0.1635107 0.163850780 .21101546 0.32487771 0.25904398 0.37676595 0.19230295 0.17126507]

[0182] The module lengths of the two are compared one by one accordingly, and the module lengths of the two are basically the same.

[0183] 2) Calculate the quantum final state |ψ f > and the argument of each element in the complex vector x to be encoded, where the argument βi can be calculated according to the following conditional formula:

[0184]

[0185] For example, for the above quantum final state |ψ f >The argument of each amplitude is calculated and the results are as follows: [1.25407106 1.72258743 1.30109405 1.32540374 1.2100268 2.493652441.22316888 1.60957228 1.06935879 1.37368684 1.55105853 1.96016712 1.360644691.87898624 0.98078558 1.62447509]

[0187] The argument of each element in the complex vector x to be encoded is calculated, and the result is as follows: [0.31961802 0.78813425 0.36664099 0.39095075 0.27557467 1.55919938 0.28871605 0.67511925 0.13490599 0.43923383 0.61660552 1.02571386 0.42619171 0.94453313 0.04633261 0.69002208]

[0189] Calculate the difference in the two angles one by one, and get the following set of difference in the angles: [0.93445304 0.93445318 0.93445306 0.93445299 0.93445213 0.93445306 0.93445283 0.93445303 0.9344528 0.93445301 0.93445301 0.93445327 0.93445298 0.93445311 0.93445297 0.93445302]

[0191] It can be seen that each argument difference value in the argument difference value set is nearly consistent.

[0192] 3) According to the above calculation results, we can know that the quantum final state |ψ f >The modulus of each amplitude in is basically consistent with the modulus of each element in the complex vector x to be encoded, and each difference in the set of argument differences is close to the same, then the quantum final state |ψ f >There is a global phase factor difference with the complex vector x to be encoded, that is, the quantum final state |ψ f >The fidelity of the complex vector x to be encoded is 1, which means that the complex vector amplitude encoding with a fidelity of up to 100% is achieved. Among them, all quantum states that differ by eiθ times can be regarded as the same quantum state, and the above-mentioned argument difference θ≈0.9344.

[0193] In summary, the technical solution of the present invention has the following advantages:

[0194] 1. The technical solution of the present invention can solve the amplitude coding problem of normalized complex vectors, and proposes an innovative variational quantum circuit. Through this variational quantum algorithm, the normalized complex vector can be accurately mapped to its corresponding amplitude-coded quantum state to ensure the integrity and accuracy of the information. Based on this achievement, the variational quantum algorithm can be applied to a wider range of fields to achieve more efficient data processing and deeper information mining. This progress not only expands the application scope of quantum computing, but also lays a solid foundation for future quantum information processing technology.

[0195] 2. The technical solution of the present invention constructs a variational quantum circuit ansatz containing training parameters. This design significantly reduces the number of quantum gates used and optimizes resource consumption. In addition, the variational quantum circuit ansatz only contains the U3 gate of a single quantum bit and the CU3 gate of a double quantum bit, which further improves the execution efficiency of amplitude coding; this optimization not only reduces the number of quantum gate operations, but also reduces the errors that may be introduced by quantum gate operations, thereby providing a strong guarantee for the stability and reliability of quantum information processing. This innovative design not only improves efficiency, but also enhances the robustness of the quantum computing process.

[0196] 3. The technical solution of the present invention has been fully simulated on the MindSpore Quantum quantum computing software platform. The experimental results show that the solution can successfully 4 The amplitude encoding of the normalized complex vector x is implemented, and its corresponding encoded quantum state |ψ is accurately obtained. f >, achieving excellent performance with a fidelity of 1. In addition, the entire training process, from parameter initialization to the final convergence of the model, took only about 7 seconds. This achievement not only verifies the accuracy and efficiency of the technical solution of the present invention in amplitude coding, but also provides a solid technical foundation and practical guidance for further research and practical application of quantum computing.

[0197] 4. The technical solution of the present invention fully considers the feasibility of physical experiments in design and simplifies the construction of quantum circuits. Specifically, for 16-dimensional complex vectors, the number of quantum gates required by this solution is only 20, which significantly reduces the complexity of the quantum circuit. In addition, the variational quantum circuit of this technical solution only relies on the operation of single-qubit gate U3 and double-qubit gate CU3, completely avoiding the use of multi-qubit gates. This design not only reduces the burden on quantum hardware, but also reduces the error rate and complexity in the experiment, thereby increasing the success rate of the experiment. This experimentally friendly design paves the way for experimental verification and practical application of quantum computing technology, and further promotes the process of quantum information science towards practical application.

[0198] Corresponding to the method embodiment of the present invention, the embodiment of the present invention also provides a quantum state amplitude encoding device, based on the variational quantum circuit, such as Figure 5 As shown, specifically, it may include:

[0199] Normalization module 510: used for normalizing the complex vector to be encoded;

[0200] Acquisition module 520: used to acquire a set of random parameter initial values;

[0201] Substitution module 530: used to substitute the initial value of the parameter as the training parameter into the variational quantum circuit to output the training quantum state after the evolution of the variational quantum circuit;

[0202] Calculation module 540: used to calculate the loss value between the normalized complex vector to be encoded and the training quantum state; wherein the loss value is the negative value of the fidelity between the normalized complex vector to be encoded and the training quantum state;

[0203] Training module 550: used to construct a quantum-classical hybrid neural network, train and optimize the training parameters of the variational quantum circuit in the quantum-classical hybrid neural network through a classical optimizer until the training parameters or loss value converge to a set threshold;

[0204] Response module 560: It is used to output the target quantum state after the evolution of the variational quantum circuit in response to the training parameter or loss value converging to the set threshold; wherein the normalized complex vector to be encoded is mapped to the amplitude of the target quantum state.

[0205] In another aspect, the present invention further provides an electronic device, see Figure 6 , Figure 6 1 is a block diagram of the structure principle of an electronic device according to an embodiment of the present invention. Figure 6 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 amplitude encoding method in the above-mentioned embodiment is implemented.

[0206] 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 an 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 magnetic 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, typically the memory 602 includes a tangible (non-transitory) computer-readable storage medium (such as a memory device) encoded with executable instructions, wherein when the stored executable instructions are executed by the processor 601 (such as executed by one or more processors), the quantum state amplitude encoding method in the embodiment of the present invention can be implemented.

[0207] In one example, Figure 6 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.

[0208] The bus 610 includes hardware, software, or both, and can couple the components of the online data traffic metering 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 buses. The bus 610 may include one or more buses. Although the embodiments of the present invention describe or illustrate a specific bus, the embodiments of the present invention may consider any suitable bus or interconnection method.

[0209] 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 amplitude encoding method is implemented.

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

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

[0212] 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 variational quantum circuit, characterized in that: include: n quantum bits arranged in order from low to high, where n is an integer greater than or equal to 2; A circuit unit, comprising one or more first operation trains that can be repeatedly operated, each of which comprises a first uncontrolled U3 quantum gate and n-1 controlled U3 quantum gates; the first uncontrolled U3 quantum gate is set on the first quantum bit located at the lowest position; each controlled U3 quantum gate is respectively set on the second quantum bit to the nth quantum bit located at the second lowest position, and the control bit of the controlled U3 quantum gate is the previous low-order quantum bit adjacent to the target bit of the controlled U3 quantum gate; The second operation column includes n second uncontrolled U3 quantum gates, which are respectively set on n quantum bits; wherein, The circuit unit is located between the input end of the variational quantum circuit and the second operation column, and each of the uncontrolled U3 quantum gate and the controlled U3 quantum gate carries a training parameter.

2. The variational quantum circuit according to claim 1, characterized in that: The controlled U3 quantum gate is a two-qubit controlled U3 quantum gate.

3. The variational quantum circuit according to claim 1, characterized in that: Two ends of the line unit are connected to the input end of the variable component quantum circuit and one end of the second operation column respectively, and the other end of the second operation column is connected to the output end of the variable component quantum circuit.

4. A quantum state amplitude encoding method, characterized in that: Based on the variational quantum circuit according to any one of claims 1 to 3, comprising: Normalize the complex vector to be encoded; Get a set of random parameter initial values; Substituting the initial value of the parameter into the variational quantum circuit as a training parameter to output a training quantum state after evolution of the variational quantum circuit; Calculating a loss value between the normalized complex vector to be encoded and the training quantum state; wherein the loss value is the negative value of the fidelity between the normalized complex vector to be encoded and the training quantum state; Training the training parameters of the variational quantum circuit by a classical optimizer until the training parameters or the loss value converge to a set threshold; In response to the training parameter or the loss value converging to a set threshold, the target quantum state after evolution of the variational quantum circuit is output; wherein the normalized complex vector to be encoded is mapped to the amplitude of the target quantum state.

5. The quantum state amplitude encoding method according to claim 4, characterized in that: Also includes: Determine whether the amplitude of the target quantum state is consistent with the corresponding element in the normalized complex vector to be encoded; If the amplitude of the target quantum state is inconsistent with the corresponding element in the normalized complex vector to be encoded, then the modulus of each amplitude in the target quantum state and the modulus of the corresponding element in the normalized complex vector to be encoded, as well as the argument of each amplitude in the target quantum state and the argument of the corresponding element in the normalized complex vector to be encoded are compared respectively; If the modulus of each amplitude in the target quantum state is consistent with the modulus of the corresponding element in the normalized complex vector to be encoded and the difference between the argument of each amplitude in the target quantum state and the argument of the corresponding element in the normalized complex vector to be encoded is consistent, then the fidelity of the target quantum state and the normalized complex vector to be encoded is 1.

6. The quantum state amplitude encoding method according to claim 4, characterized in that: The normalizing process of the complex vector to be encoded includes: Determine whether the number of elements of the complex vector to be encoded satisfies N=2 n ; If the number of elements of the complex vector to be encoded does not satisfy N = 2 n , then zero padding is performed so that the number of elements of the complex vector to be encoded satisfies N = 2 n ;in, The modulus length of the complex vector to be encoded after normalization is 1.

7. The quantum state amplitude encoding method according to claim 4, characterized in that: The loss value is calculated by the following conditional formula: Where x is the complex vector to be encoded, x = [x0, x1, ..., x N-1 ] T , where T represents transpose, x i is a complex number, and i=0,1,...N-1; |ψ> is the quantum state after evolution; ψ i is the i-th amplitude of the evolved quantum state.

8. A quantum state amplitude encoding device, characterized in that: Based on the variational quantum circuit according to any one of claims 1 to 3, comprising: Normalization module: used to normalize the complex vector to be encoded; Acquisition module: used to obtain a set of random parameter initial values; Substitution module: used to substitute the initial value of the parameter as the training parameter into the variational quantum circuit to output the training quantum state after the evolution of the variational quantum circuit; A calculation module: used to calculate the loss value between the normalized complex vector to be encoded and the training quantum state; wherein the loss value is the negative value of the fidelity between the normalized complex vector to be encoded and the training quantum state; Training module: used to train the training parameters of the variational quantum circuit through a classical optimizer until the training parameters or the loss value converge to a set threshold; Response module: It is used to output the target quantum state after the evolution of the variational quantum circuit in response to the training parameter or loss value converging to the set threshold; wherein the normalized complex vector to be encoded is mapped to the amplitude of the target quantum state.

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 4 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 4 to 7 is implemented.

Citation Information

Cited By

  • Linear complexity quantum state preparation method based on tensor decomposition and quantum circuit construction system

    CN121599151A