Quantum circuit decomposition method, quantum circuit and quantum chip
By constructing quantum gate operation pool and variable layering methods, quantum circuit decomposition is optimized, and the problems of high computing costs and large line overhead in the existing technology are solved, and efficient quantum circuit decomposition and expression capabilities are achieved.
Patent Information
- Application Number
- CN202510857353.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-06-25
AI Technical Summary
The prior art has problems such as high computational cost, large search space, and difficulty in finding the optimal decomposition solution when decomposing quantum lines. Especially in NISQ-type quantum computers, a large number of SWAP gates are required to lead to large line overhead.
By building candidate quantum gate operation pools, generating coding layers and variable layers, performing parameter training and strategy evaluation, selecting quantum gates that meet gradient requirements, reducing redundancy, optimizing quantum circuit depth, and reducing the number of SWAP gates.
The quantum line decomposition is achieved at shallow line depth, reducing the redundancy of the quantum line, improving the expression ability, and reducing the number of SWAP gates in the subsequent mapping process.
Smart Images

Figure CN120373483A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum compilation technology, and in particular, to a quantum circuit decomposition method, a quantum circuit, and a quantum chip. Background Art
[0002] Quantum computing has a natural parallel computing ability based on the entanglement and superposition characteristics of quantum bits, and has gradually become a new computing paradigm. Many quantum algorithms such as Shor's algorithm and Grover's algorithm have theoretical advantages over classical algorithms in solving specific problems. With the development of quantum computers, the implementation of many quantum algorithms has also become possible. Currently, quantum computers are in the noisy intermediate-scale quantum (NISQ) type, rather than large-scale and fault-tolerant quantum computers. Therefore, when implementing quantum algorithms on quantum computers, it is necessary to consider hardware limitations such as circuit depth, connectivity between qubits, and the instruction set of basic gates that can be implemented by quantum computers. For a given quantum circuit, how to decompose it into basic quantum gates that are as short as possible and can be implemented on a quantum computer is a fundamental problem in quantum information processing tasks such as quantum computing and quantum simulation.
[0003] Quantum circuit decomposition is to decompose an arbitrary quantum gate into a circuit composed of a specific set of gates to implement quantum algorithms on NISQ-type quantum computers. The goal of optimizing quantum circuit decomposition is to ensure that the number of gates, circuit depth, and the number of two-qubit gates (CNOT gates) after optimization are as small as possible. Otherwise, a large number of SWAP gates need to be introduced for qubit mapping, resulting in a huge circuit overhead.
[0004] Currently, methods that can be adopted include exhaustive search method, pattern matching algorithm, and reinforcement learning algorithm, etc. The exhaustive search method enumerates all possible circuit combination methods, and then selects the optimal circuit from the above combinations through a traversal method. Although this method guarantees the optimal result, it requires a large amount of computational cost, and as the problem scale increases, the search space grows exponentially, limiting its application in large-scale logical quantum circuits.
[0005] The pattern matching algorithm is to pre-define the equivalent substitution rules of gates, and then perform local substitution of sub-circuits by traversing the entire circuit. In dealing with the problem of quantum circuit decomposition, due to the limited and fixed pre-defined rules, the pattern matching algorithm is only applicable to the decomposition of specific local sub-circuits and is difficult to decompose the overall quantum circuit.
[0006] The reinforcement learning algorithm defines quantum gates as actions, enabling the agent to perform adaptive exploration and learning. For each decision made, the environment provides a corresponding reward. By interacting with the environment, the optimal action is selected to maximize the reward. The reinforcement learning-based method requires the agent to undergo extensive training, which takes a long time. Moreover, as the search depth increases, it is extremely easy to fall into local optimality and difficult to find the optimal decomposition scheme for the overall quantum circuit. Summary of the Invention
[0007] The purpose of the present invention is to address the deficiencies in the prior art and propose a quantum circuit decomposition method, a quantum circuit, and a quantum chip.
[0008] To achieve the above objective, the present invention adopts the following technical solutions: A quantum circuit decomposition method includes: S1. Construct a candidate quantum gate operation pool based on the target quantum chip; S2. Determine the number of qubits in the variational quantum circuit according to the dimension of the gate to be decomposed, and then generate an encoding layer; S3. Based on the encoding layer, continue to add a variational layer to the variational quantum circuit; S4. Initialize the parameters of the variational quantum circuit, then perform parameter training, and confirm whether the combination of the current variational layer meets the preset gate decomposition accuracy according to the training results; If so, the current variational quantum circuit meets the requirements for target quantum circuit decomposition; If not, execute step S5; S5. Continue to add a variational layer to the variational quantum circuit, where the added variational layer is constructed by obtaining quantum gates from a preset quantum gate operation pool; S6. Perform policy evaluation on the quantum gates in the added variational layer to select the quantum gates that meet the gradient requirements and form corresponding variational parameters, and return to step S4.
[0009] As a further description of the above technical solution: The method of continuing to add a variational layer to the variational quantum circuit based on the encoding layer includes: Connect a parametric rotation gate to the qubit to establish an encoding layer; Select quantum gates from the candidate quantum gate operation pool to establish a variational layer connected to the encoding layer, where one side of the variational layer is connected to the rotation gate.
[0010] As a further description of the above technical solution: The method of parameter training for the variational quantum circuit includes: Calculate the square of the fidelity between the quantum state of the unitary matrix of the quantum circuit before decomposition and the quantum state of the unitary matrix of the variational quantum circuit after decomposition as the approximation degree of the unitary matrices before and after decomposition; Calculate the loss function according to the approximation degree, and obtain the variational parameters corresponding to the minimum loss function.
[0011] As a further description of the above technical solution: The method for confirming whether the combination of the current variational layer meets the preset gate decomposition accuracy according to the training result includes: Take the approximation degree of the unitary matrix before and after the decomposition as the gate decomposition accuracy, and compare it with the preset gate decomposition accuracy; If it is greater than the preset gate decomposition accuracy, it is determined that the gate decomposition accuracy meets the decomposition requirements, and the current variational quantum circuit meets the target quantum circuit decomposition requirements; If it is not greater than the preset gate decomposition accuracy, obtain a new quantum gate from the candidate quantum gate operation pool.
[0012] As a further description of the above technical solution: The method for performing a strategy evaluation on the quantum gates in the added variational layer includes: Derive the expectation of the loss function according to the quantum gates of the new variational layer and the variational parameters, and then calculate through the parameter shift rule to establish a gradient calculation model of the loss function with respect to the variational parameters; Obtain the gradient of the loss function according to the input variational parameters, and determine whether it meets the gradient requirements. If it meets, jointly perform parameter training on the combination of the variational layers. If it does not meet, obtain quantum gates again.
[0013] As a further description of the above technical solution: The gradient requirement is the quantum gate corresponding to the maximum gradient of the loss function.
[0014] As a further description of the above technical solution: The candidate quantum gate operation pool is the quantum gate corresponding to the two-qubit gate instruction and / or the single-qubit gate instruction.
[0015] As a further description of the above technical solution: Measure the variational quantum circuit that meets the preset gate decomposition accuracy through the measurement layer, and then perform gradient optimization training through the optimizer.
[0016] It also includes a quantum circuit, and the quantum circuit is applicable to the quantum circuit decomposition method described in any one of the above technical solutions, including: Encoding layer; The encoding layer is connected to one side of the variational layer; The other side of the variational layer is connected to the input side of the measurement layer for performing variational quantum circuit measurement; The output side of the measurement layer is connected to the optimizer for performing gradient optimization training; Among them, the encoding layer is composed of quantum bits and parametric rotation gates; The variational layer is composed of at least one or more quantum gates corresponding to two-bit gate instructions and / or single-bit gate instructions.
[0017] It also includes a quantum chip, which includes the quantum circuit decomposition method and the quantum circuit described in any one of the above technical solutions.
[0018] The above technical solution has the following advantages or beneficial effects: 1. Generate a candidate quantum gate operation pool according to the chip topology structure, evaluate the strategy of the obtained quantum gates, and adjust the structure of the variational quantum circuit, which can adapt to the decomposition of the unitary matrix in any quantum circuit, reduce the redundancy of the quantum circuit, and improve the expression ability of the quantum circuit.
[0019] 2. Use the approximate values of the unitary matrix before and after the quantum circuit decomposition to evaluate the gate decomposition accuracy, and evaluate the strategy of the variational quantum circuit, and sequentially increase the variational quantum circuit for training, so as to realize the decomposition of the quantum circuit with a shallower circuit depth, minimize the number of gates after decomposition, and further reduce the number of SWAP gates that need to be inserted in the subsequent circuit mapping process. Description of the Drawings
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to these drawings.
[0021] Figure 1 It is a flowchart of the quantum circuit decomposition method proposed by the present invention; Figure 2 It is a flowchart of the method for constructing a variational quantum circuit in the present invention; Figure 3 It is a flowchart of the method for judging whether the gate decomposition accuracy meets the preset gate decomposition accuracy in the present invention; Figure 4 It is a flowchart of the method for evaluating the strategy of quantum gates in the present invention; Figure 5 It is a structural schematic diagram of the quantum circuit proposed by the present invention.
[0022] Legend Explanation: 1. Encoding layer; 2. Variational layer; 3. Measurement layer; 4. Optimizer. Detailed Embodiments
[0023] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0024] Since the connectivity between qubits in current quantum chips is limited, not any two qubits can perform entanglement operations. And because the set of gate operation instructions supported by current quantum computers is a collection of some single-qubit gates and two-qubit gates, quantum compilation needs to be introduced when executing quantum algorithms to convert the logical quantum circuit into a physical quantum circuit. The existing quantum compilation methods first decompose the quantum gates and then perform qubit mapping according to the topological structure of the actual chip. Usually, a large number of SWAP gates need to be introduced after the quantum gate decomposition for qubit mapping, resulting in a huge circuit overhead.
[0025] Refer to Figure 1 , an embodiment provided by the present invention: a quantum circuit decomposition method, including: S1. Construct a candidate quantum gate operation pool according to the target quantum chip; S2. Determine the number of qubits in the variational quantum circuit according to the dimension of the gate to be decomposed, and then generate an encoding layer; S3. Based on the encoding layer, continue to add a variational layer to the variational quantum circuit; S4. Initialize the parameters of the variational quantum circuit, then perform parameter training, and confirm whether the combination of the current variational layer meets the preset gate decomposition accuracy according to the training results; If so, the current variational quantum circuit meets the requirements of the target quantum circuit decomposition; If not, execute step S5; S5. Continue to add a variational layer to the variational quantum circuit, where the added variational layer is constructed by obtaining quantum gates from a preset quantum gate operation pool; S6. Perform a strategy evaluation on the quantum gates in the added variational layer to select quantum gates that meet the gradient requirements and form corresponding variational parameters, and return to step S4.
[0026] In this embodiment, a candidate quantum gate operation pool is generated according to the topological structure of the quantum chip. The positions where single-qubit gates and two-qubit gates can act (where entanglement operations can occur between two qubits) are selected, and the corresponding quantum gates are added to construct a variational quantum circuit. The variational layers of the variational quantum circuit are trained. First, a variational layer is selected for parameter initialization. According to the gate decomposition accuracy obtained after training, it is judged whether it is greater than the preset gate decomposition accuracy. If it is not greater, additional variational layers need to be added. Quantum gates are retrieved again from the candidate quantum gate operation pool for strategy evaluation to judge whether the gradient requirement is met. If not, retrieve again until the gradient requirement is met. A new variational quantum circuit is constructed with the corresponding quantum gates. After obtaining a new variational layer, variational layer training is performed again until the gate decomposition accuracy is greater than the preset gate decomposition accuracy, completing the decomposition of the quantum circuit. Generating a candidate quantum gate operation pool according to the chip topological structure, performing strategy evaluation on the obtained quantum gates, and adjusting the structure of the variational quantum circuit can adapt to the decomposition of unitary matrices in any quantum circuit, reduce the redundancy of the quantum circuit, and improve the expressive ability of the quantum circuit. Performing strategy evaluation on the variational quantum circuit and sequentially increasing the variational quantum circuit for training can thus achieve the decomposition of the quantum circuit with a relatively shallow circuit depth, minimize the number of gates after decomposition, and further reduce the number of SWAP gates that need to be inserted during the subsequent circuit mapping process.
[0027] Referring to Figure 2 , the method for continuously adding a variational layer to the variational quantum circuit based on the encoding layer includes: S11: Connect a parameterized rotation gate to a qubit to establish an encoding layer; S12: Select a quantum gate from the candidate quantum gate operation pool and establish a variational layer connected to the encoding layer, where one side of the variational layer is connected to the rotation gate.
[0028] In this embodiment, the corresponding qubits are determined according to the topological structure of the quantum chip. A parameterized RY rotation gate is applied to the qubits to prepare the initial state of the qubits as the encoding layer. Then, two-qubit gates and single-qubit gates are randomly retrieved from the candidate quantum gate operation pool, where the number of selected gates can be defined, and a variational layer is established and connected to the encoding layer.
[0029] The method for parameter training of the variational quantum circuit includes: Calculate the square of the fidelity between the quantum state of the unitary matrix of the quantum circuit before decomposition and the quantum state of the unitary matrix of the variational quantum circuit after decomposition as the approximation degree of the unitary matrices before and after decomposition; Calculate the loss function according to the approximation degree to obtain the variational parameters corresponding to the minimum loss function.
[0030] In this embodiment, assuming that the quantum gate instruction set supported by the quantum computer is g, the goal of quantum circuit decomposition is to decompose U into a set of elementary gates, that is:
[0031] Assume that the unitary matrix of the quantum circuit before decomposition is represented as U, and the unitary matrix of the variational quantum circuit after decomposition is represented as V. For any quantum state , the quantum states evolved by these two unitary matrices are denoted as and . Measuring the closeness of these two quantum states can indirectly evaluate the closeness of the unitary matrices before and after decomposition. Then the approximation degree between U and V is defined as:
[0032] where is the fidelity.
[0033] Training the variational layer is done by calculating the loss function. The definition of the loss function is related to the problem to be optimized. The difference between the unitary matrices before and after compilation is calculated using the closeness of the quantum states before and after compilation as described above. The parameters are updated and trained by minimizing the loss function, and the loss function is defined as:
[0034] When F is closer to 0, it indicates that the difference between the unitary matrices before and after compilation is smaller, that is, the decomposition accuracy is higher.
[0035] Find a set of optimal variational parameters to minimize the loss function, that is:
[0036] where are the variational parameters, which need to be updated according to the training results of each time, and the updated variational parameters are used for the next training, are the optimal variational parameters, is the loss function.
[0037] Referring to Figure 3 , the method for confirming whether the combination of the current variational layer meets the preset gate decomposition accuracy according to the training results includes: S21: Use the approximation degree of the unitary matrices before and after decomposition as the gate decomposition accuracy and compare it with the preset gate decomposition accuracy; S22: If it is greater than the preset gate decomposition accuracy, it is determined that the gate decomposition accuracy meets the decomposition requirements, and the current variational quantum circuit meets the target quantum circuit decomposition requirements; S23: If it is not greater than the preset gate decomposition accuracy, obtain a new quantum gate from the candidate quantum gate operation pool.
[0038] In this embodiment, the approximation degree of the unitary matrix before and after decomposition is used as the gate decomposition accuracy, which is compared with the preset gate decomposition accuracy. In the ideal state, when F = 1, it means that the fidelity of these two quantum states is 1, that is, it means that the variational quantum circuit unitary matrix V after decomposition is an exact compilation of the quantum circuit unitary matrix U before decomposition.
[0039] However, in practice, exact compilation is very difficult to achieve by approximation methods. Therefore, a preset gate decomposition accuracy is set as the standard for judging the approximate compilation of quantum circuits, that is:
[0040] where is the preset gate decomposition accuracy, and the preset gate decomposition accuracy is between 0 and 1. In this embodiment, the closer the preset gate decomposition accuracy of the gate decomposition accuracy is to 1, the better. However, in practice, only an approximate solution can be obtained. A preset gate decomposition accuracy can be set to 0.99. If it is greater than 0.99, it can be considered a quantum circuit decomposition with a higher accuracy.
[0041] Referring to Figure 4 , the method for evaluating the strategy of the quantum gates in the added variational layer includes: S31: According to the quantum gates and variational parameters of the new variational layer, take the derivative of the expectation of the loss function, and then calculate through the parameter shift rule to establish a gradient calculation model of the loss function with respect to the variational parameters; S32: Obtain the gradient of the loss function according to the input variational parameters, and judge whether it meets the gradient requirements. If it meets, jointly perform parameter training on the combination of the variational layers. If it does not meet, re-obtain the quantum gates.
[0042] In this embodiment, when the preset gate decomposition accuracy of the gate accuracy is not satisfied, re-obtain the quantum gates from the candidate quantum gate operation pool to generate a variational quantum circuit, and evaluate the strategy of the quantum gates. If the gradients of the variational quantum circuits before and after the addition of the quantum gates are lower than the predefined gradient requirements, the quantum gates need to be re-selected until the gradient requirements are met for the next round of variational layer training.
[0043] Calculate the variational quantum circuit through the parameter shift rule. The parameter shift rule is based on the idempotency of the Hermitian operator. For a variational quantum circuit: , where the idempotent Hermitian operator H satisfies , and I is the identity matrix.
[0044] Take the derivative of the expectation of the loss function, calculate the variational quantum circuit through the parameter shift rule, and establish a gradient calculation model of the loss function with respect to the variational parameters of the variational quantum circuit, that is:
[0045] Among them, is the derivative of the expectation of the loss function, M is the measurement operator, is the initial state, is the variational quantum circuit, is 's conjugate transpose, and tr is the trace operation.
[0046] Increase the parameters in the quantum circuit by π / 2 and decrease them by π / 2 respectively and subtract them to obtain the objective function value as the gradient of the loss function with respect to the variational parameter .
[0047] According to the input variational parameter, obtain the gradient of the loss function, compare it with the gradient requirement to determine whether it meets the requirement. If it meets the requirement, jointly train the variational layer of the new variational quantum circuit and the obtained variational quantum circuit. If it does not meet the requirement, re-obtain the quantum gates and perform policy evaluation.
[0048] The gradient requirement is the quantum gate corresponding to the maximum gradient of the loss function.
[0049] In this embodiment, the gradient requirements are different when calculating the gradients with different gate decompositions, preset gate decomposition accuracies, and variational parameters. To meet the gradient requirements, a quantum gate with the largest calculated gradient can be selected from the current candidate quantum gate operation pool for addition.
[0050] The candidate quantum gate operation pool is the quantum gate corresponding to the two-qubit gate instruction and / or the single-qubit gate instruction.
[0051] In this embodiment, when selecting quantum gates, a two-qubit gate is selected for the first time to make each qubit entangled as much as possible, and a two-qubit gate should act between adjacent qubits; the number and position of the single-qubit gates can be randomly selected. After that, the number and position of the single-qubit gates and two-qubit gates can be randomly specified. After completion, the parameters are initialized, which is actually the initialization of the parameters of the single-qubit rotation gate. Generally, they can be randomly selected in the interval (0, 2π).
[0052] Measure the variational quantum circuit that meets the preset gate decomposition accuracy through the measurement layer, and then perform gradient optimization training through the optimizer.
[0053] In this embodiment, due to the limited number of measurements and the easy occurrence of the barren plateau phenomenon as the number of bits increases (when the number of bits of the quantum computer is large, the current framework of the quantum neural network is easily unable to be effectively trained, the measured objective function becomes very flat, resulting in too low a gradient to continue training), and it falls into a local optimum. Optionally, the Adam optimizer is used for gradient optimization training. Compared with the standard stochastic gradient descent, the Adam optimizer will automatically adjust the learning rate for different parameters during the training process, so as to converge faster. The Adam optimizer adaptively adjusts the learning rate for each parameter by adjusting the first moment (the mean of the gradient) and the second moment (the variance of the gradient) of each parameter. Specifically, the Adam optimizer adjusts the learning rate of each parameter according to the historical information of the parameter gradient, so that the parameter update step size with a larger gradient is smaller, while the parameter update step size with a smaller gradient is larger, realizing gradient optimization training.
[0054] Referring to Figure 5 , there is also an embodiment of a quantum circuit. The quantum circuit is applicable to any one of the above-mentioned quantum circuit decomposition methods, and includes: Encoding layer 1; The encoding layer 1 is connected to one side of the variational layer 2; The other side of the variational layer 2 is connected to the input side of the measurement layer 3 for performing variational quantum circuit measurement; The output side of the measurement layer 3 is connected to the optimizer 4 for performing gradient optimization training; Among them, the encoding layer 1 is composed of quantum bits and rotation gates with parameters; The variational layer 2 is composed of at least one or more quantum gates corresponding to two-qubit gate instructions and / or single-qubit gate instructions.
[0055] In this embodiment, the corresponding quantum bits are confirmed according to the topological structure of the quantum chip to generate a candidate quantum gate operation pool; a parameterized RY rotation gate is set on one side of each quantum bit to prepare the initial state of the quantum bit as the encoding layer 1. Quantum gates corresponding to two-qubit gates and / or single-qubit gates are obtained from the candidate quantum gate operation pool, and after strategy evaluation, the variational layer 2 is constructed. UG is the quantum gate selected through strategy evaluation from the candidate quantum gate operation pool. Quantum gates corresponding to two-qubit gates are preferentially selected for connection. Among them, one side of the two-qubit gate is connected to the RY rotation gate, and the other side is connected to a single-qubit gate. On the other side of the variational layer, the measurement layer 3 and the optimizer 4 are connected in sequence. The measurement layer 3 is an existing quantum circuit measurement layer. After measuring the problem to be optimized, the objective function is obtained. The optimizer 4 is the Adam optimizer, which performs gradient optimization training on the objective function.
[0056] It is understandable that the quantum circuit provided by the embodiment of the present invention corresponds to the above quantum circuit decomposition method. For the explanations, examples, beneficial effects, etc. of relevant content, reference can be made to the corresponding content in the quantum circuit decomposition method, which will not be elaborated here.
[0057] There is also an embodiment of a quantum chip, which includes any one of the quantum circuit decomposition methods and quantum circuits in the above technical solutions.
[0058] Since this quantum chip adopts all the technical solutions of the above embodiments, it at least has all the beneficial effects brought by the technical solutions of the above embodiments, which will not be elaborated one by one here.
[0059] It should be noted that through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform. In this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or device including the said element.
[0060] Finally, it should be noted that the above are only the preferred embodiments of the present invention and are not used to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A quantum circuit decomposition method, characterized in that, Including: S1. Construct a candidate quantum gate operation pool according to the target quantum chip; S2. Determine the number of qubits in the variational quantum circuit according to the dimension of the gate to be decomposed, and then generate an encoding layer; S3. Based on the encoding layer, continue to add a variational layer to the variational quantum circuit; S4. Initialize the parameters of the variational quantum circuit, then perform parameter training, and confirm whether the combination of the current variational layers meets the preset gate decomposition accuracy according to the training results; If so, the current variational quantum circuit meets the requirements for decomposing the target quantum circuit; If not, execute step S5; S5. Continue to add a variational layer to the variational quantum circuit, where the added variational layer is constructed by obtaining quantum gates from a preset quantum gate operation pool; S6. Perform strategy evaluation on the quantum gates in the added variational layer to select the quantum gates that meet the gradient requirements, and form corresponding variational parameters, and return to step S4.
2. The quantum circuit decomposition method according to claim 1, characterized in that: The method of continuing to add a variational layer to the variational quantum circuit based on the encoding layer includes: Connect a parametric rotation gate to a qubit to establish an encoding layer; Select a quantum gate from the candidate quantum gate operation pool to establish a variational layer connected to the encoding layer, where one side of the variational layer is connected to the rotation gate.
3. The quantum circuit decomposition method according to claim 1, wherein: The method of parameter training for the variational quantum circuit includes: Calculate the square of the fidelity between the quantum state of the unitary matrix of the quantum circuit before decomposition and the quantum state of the unitary matrix of the variational quantum circuit after decomposition as the approximation degree of the unitary matrices before and after decomposition; Calculate the loss function according to the approximation degree to obtain the variational parameters corresponding to the minimum loss function.
4. The quantum circuit decomposition method according to claim 3, wherein: The method of confirming whether the combination of the current variational layers meets the preset gate decomposition accuracy according to the training results includes: Use the approximation degree of the unitary matrices before and after decomposition as the gate decomposition accuracy and compare it with the preset gate decomposition accuracy; If it is greater than the preset gate decomposition accuracy, it is determined that the gate decomposition accuracy meets the decomposition requirements, and the current variational quantum circuit meets the requirements for decomposing the target quantum circuit; If it is not greater than the preset gate decomposition accuracy, obtain a new quantum gate from the candidate quantum gate operation pool.
5. The quantum circuit decomposition method according to claim 3, wherein: The method of performing strategy evaluation on the quantum gates in the added variational layer includes: Derive the expectation of the loss function according to the quantum gates of the new variational layer and the variational parameters, and then calculate through the parameter shift rule to establish a gradient calculation model of the loss function with respect to the variational parameters; Obtain the gradient of the loss function according to the input variational parameters, and judge whether it meets the gradient requirements. If it meets, jointly perform parameter training on the combination of the variational layers. If it does not meet, re-obtain the quantum gates.
6. The quantum circuit decomposition method according to claim 5, wherein: The gradient requirement is the quantum gate corresponding to the maximum gradient of the loss function.
7. The quantum circuit decomposition method according to claim 1, wherein: The candidate quantum gate operation pool is a quantum gate corresponding to a two-bit gate instruction and / or a single-bit gate instruction.
8. The quantum circuit decomposition method according to claim 2, wherein: Measure the variational quantum circuit that meets the preset gate decomposition accuracy through a measurement layer, and then perform gradient optimization training through an optimizer.
9. A quantum circuit, characterized in that, The quantum circuit is applicable to the quantum circuit decomposition method described in any one of claims 1-8 above, including: An encoding layer; The encoding layer is connected to one side of the variational layer; The other side of the variational layer is connected to the input side of the measurement layer for performing variational quantum circuit measurement; The output side of the measurement layer is connected to an optimizer for performing gradient optimization training; Among them, the encoding layer is composed of qubits and rotation gates with parameters; The variational layer is composed of quantum gates corresponding to at least one or more two-qubit gate instructions and / or single-qubit gate instructions.
10. A quantum chip, characterized in that, The quantum chip includes the quantum circuit decomposition method according to any one of claims 1-8 and the quantum circuit according to claim 9.
Citation Information
Patent Citations
Model training method, data processing method and device based on quantum computing
CN117151204A
Method and system for encoding data set in quantum circuit for quantum machine learning
CN118014096A
Method for solving Hamiltonian expected value of preset quantum circuit and related device
CN118504697A
Construction method and device of variable component sub-circuit, medium and electronic device
CN118863078A
Quantum Modulation Classifier System and Method
US20240428113A1
Cited By
Hardware sensing quantum circuit synthesis method based on multi-task graph neural network
CN121413792A