Simulation implementation circuit system and method based on Hamiltonian simulation

By using simulation based on Hamiltonian simulation on ordinary classical computers, the high-order Hamiltonian simulation is simulated and evolved using module decomposition method and constructive function method, the problems of high computational complexity and low efficiency in solving systems of higher-order linear equations are solved, and high-efficiency quantum solution for 8×8-dimensional linear equations are realized.

CN120069110APending Publication Date: 2025-05-30XIDIAN UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510110012.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently simulate and solve systems of higher-order linear equations, especially systems of Hermi matrix linear equations of order 8 and above, resulting in high computational complexity and low efficiency.

Method used

The circuit system is implemented based on Hamiltonian simulation, and the higher-order Hamiltonian is simulated and evolved through the module decomposition method and the construction function method. A special sub-circuit is designed to realize the control mechanism of multiple qubits, reducing the circuit complexity and improving the solution efficiency.

Benefits of technology

Implementing quantum solutions for 8×8-dimensional linear equation systems on ordinary classical computers reduces hardware requirements, expands the application range, improves computing efficiency, and simplifies circuit design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120069110A_ABST
    Figure CN120069110A_ABST
Patent Text Reader

Abstract

The invention relates to a simulation implementation circuit system and method based on Hamiltonian simulation. The Hamiltonian simulation problem of solving a high-order linear equation set through an HHL algorithm is solved. The system is connected with an input quantum state module, a phase estimation module, a controlled rotation module, an inverse phase estimation module and a measurement module. The input quantum state module generates a uniform entangled state by using Hadamard gate and controlled NOT gate operations. The phase estimation module reconstructs the Hamiltonian as the tensor product of the sub-Hamiltonian, a sub-circuit is designed to be embedded into the main circuit, and the reverse process is used for the inverse phase estimation module. The method comprises the following steps: constructing a system; preparing a linear equation set; performing high-order Hamiltonian simulation evolution; constructing a sub-circuit; operating the measurement main circuit and calculating; and verifying the system. According to the method, Hamiltonian evolution is simulated through a module construction method and a function construction method, 8-order linear equation set solving is achieved on a classical computer, and the circuit solving performance and efficiency are improved. The method is applied to the field of scientific engineering, such as molecular dynamics simulation and data fitting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of circuit physical computing, mainly relates to the classical simulation of quantum algorithms, and specifically is a simulation implementation method based on Hamiltonian simulation. It is mainly applied to scenarios such as physical simulation in molecular dynamics and data fitting in machine learning. Background Technique

[0002] The statements in this part merely provide background technical information related to the present invention, and do not necessarily constitute prior art or existing technology.

[0003] As an emerging computing paradigm, quantum computing, relying on the unique principles of quantum mechanics such as superposition, entanglement, and coherence, has opened up new ways to solve complex problems that are difficult for traditional computers to handle, and plays a key role in the scientific and technological development in the scientific field. It can accelerate scientific research. For example, in materials science, it can predict the behavior of new materials through quantum simulation, helping scientists design new materials and avoid expensive and time-consuming physical experiments; it can optimize complex systems in fields such as transportation networks and energy distribution, bringing exponential acceleration to the solution of NP-hard problems; in financial modeling, it can improve mathematical models and enhance the prediction accuracy of problems such as financial market risk assessment and portfolio optimization; in the innovation of cryptography, it has given birth to secure communication protocols such as quantum key distribution; in the fields of machine learning and artificial intelligence, it can improve feature extraction, classification tasks, and neural network training, etc., and enhance the performance of AI systems.

[0004] With the rapid development of the quantum computing field, numerous innovative quantum algorithms have emerged one after another. These algorithms utilize the unique properties of quantum mechanics, such as quantum entanglement and quantum parallelism, enabling quantum algorithms to show the potential to outperform traditional computing methods when dealing with specific types of problems, such as the problem of factoring large integers, simulating complex systems, and optimization problems. For example, the Shor quantum algorithm can factor large integers in polynomial time, which is difficult to achieve on classical computers; the Grover quantum algorithm achieves square root-level acceleration in unordered database search. In the problem of solving linear equations, the HHL algorithm (Harrow-Hassidim-Lloyd algorithm) provides exponential acceleration beyond the known best classical algorithm (conjugate gradient method). However, transforming the theoretical advantages of these algorithms into practical applications is a major challenge.

[0005] Currently, there are mainly two approaches to implementing quantum algorithms: physical implementation based on real quantum computer hardware and simulation using classical computers. In terms of physical implementation, researchers run quantum algorithms through quantum computing cloud platforms, from which they can intuitively understand their performance in an actual quantum environment. However, this method also faces significant technical obstacles. Existing quantum computers usually have a small number of qubits, and the coherence time of these qubits is short, making them vulnerable to interference from the external environment and generating noise, resulting in a high error rate in algorithm implementation. In addition, due to the high cost of research and maintenance of quantum hardware and the relative scarcity of experimental resources, this further limits the scale and complexity of quantum algorithms that can be executed.

[0006] On the other hand, classical simulation provides a way to explore quantum algorithms without relying on expensive and technically demanding quantum hardware. Through classical computers, researchers can simulate larger-scale quantum systems and more complex quantum algorithms, and deeply understand the evolution of quantum states over time, the interaction mechanisms between qubits, and the effects of different quantum gate operations. This method not only reduces the cost threshold of research but also helps to identify defects in quantum algorithm design and provides valuable insights for improving algorithms.

[0007] Although classical simulation cannot fully replicate real quantum behavior, especially when dealing with a large number of qubits, it is still an essential part of advancing quantum computing research. With the continuous progress of quantum technology, classical simulation will continue to play an important role in connecting theory with practical applications.

[0008] The problem of solving linear equations (Linear Systems Problem, LSP) is a common type of problem: given a matrix A and a vector b, find a vector x such that Ax = b. The Quantum Linear Systems Problem (QLSP) is the quantum version of the classical linear equations problem. The HHL quantum algorithm can be used to solve QLSP, and in specific cases, it can provide exponential acceleration compared to the classical conjugate gradient method.

[0009] In terms of the circuit implementation of the HHL algorithm, Ji et al. published "Demonstration of Quantum Linear Equation Solver on the IBM Qiskit Platform" at the DCABES conference in 2020, publicly presenting the quantum circuits corresponding to the HHL algorithm for 4 qubits and 7 qubits, and conducting simulation experiments on the IBM qiskit development platform. They only solved fixed linear equations of order 2 and order 4, with a relatively limited solution scope and lacking universality. Xie Haoshan et al. published "Simulation Implementation of the HHL Algorithm Based on the 'Songshan' Supercomputer System" in a computer science journal, using the MPI+OpenMP hybrid parallel programming model to achieve parallel acceleration for the phase estimation module in the HHL algorithm, and conducting research on the circuit simulation implementation of the HHL algorithm on a relatively large scale. Currently, most research and implementation of the HHL algorithm mainly focus on linear equations with a low number of qubits, usually limited to dealing with linear equations of order 2 or order 4. Xie Haoshan et al. need to rely on a supercomputer to solve linear equations of order 8 and higher. That is, there is currently no example of simulating the HHL algorithm for matrices of order 8 and above on ordinary classical computers. Solving linear equations of order 8 and above requires relying on the powerful computing power of supercomputers, greatly restricting the application scope and popularity of the HHL algorithm.

[0010] Simulating the HHL algorithm on ordinary classical computers faces many difficulties, especially when it comes to higher-order matrices. These difficulties include, but are not limited to, precisely preparing quantum states, Hamiltonian simulation, and ensuring the accuracy of quantum gate operations. The existence of these problems makes it extremely difficult to run complex quantum algorithms in a classical computing environment.

[0011] In the simulation implementation of the HHL algorithm, the most critical difficulty lies in the problem of Hamiltonian simulation. Due to the complexity in actual quantum systems and the limitations of computing resources, most current research on Hamiltonian simulation only stays at the theoretical level and lacks actual circuit simulation implementation. Especially for the Hamiltonian of matrices in a specific form, its precise simulation still faces huge challenges on classical computers.

[0012] For current high-order Hermitian matrices, their corresponding Hamiltonians often have complex structures and characteristics, resulting in a relatively high circuit complexity for simulating the evolution of the Hamiltonian. It is difficult for ordinary computers to precisely represent and operate on the Hamiltonian matrix. In addition, when the HHL algorithm solves high-order linear equations, the quantum gate sequence is relatively complex and the designed circuit depth is relatively large, making the solution efficiency and performance of the circuit poor. Therefore, it is difficult to implement on ordinary classical computers. Summary of the Invention

[0013] In view of the deficiencies and problems existing in the prior art, the present invention provides a simulation implementation circuit system and method for Hamiltonian simulation with stronger generality and capable of achieving higher orders on a general classical computer.

[0014] The present invention is a simulation implementation circuit system based on Hamiltonian simulation, which is used to solve a linear equation set to be solved. It is sequentially connected with: an input quantum state module, a phase estimation module, a controlled rotation module, an inverse phase estimation module, and a measurement module; the input quantum state module is sequentially connected with a system initial quantum state unit, a target register component, and a quantum state basic unit capable of storing vector b. In the target register component, by constructing quantum gate operations in the main circuit, the selected qubits can store the preset vector b and transmit it to the phase estimation module; the phase estimation module is sequentially connected with a phase estimation register component, a Hadamard transform link, a Hamiltonian simulation evolution link, an inverse quantum Fourier transform link, and a target register component; the controlled rotation module includes an auxiliary register component, a controlled rotation link, and a phase estimation register component. The control terminal is connected to the qubits of the phase estimation register, and the target terminal acts on the qubits of the auxiliary register. By adjusting the rotation angle of the rotation gate, the auxiliary qubits are subjected to controlled rotation and the processed quantum state is transmitted to the inverse phase estimation module; the inverse phase estimation module is sequentially connected with a phase estimation register component, a quantum Fourier transform link, a Hamiltonian simulation evolution link, a Hadamard transform link, and a target register component, reversing the changes introduced in the previous phase estimation module, restoring the system to the preset state and transmitting it to the measurement module; the measurement module receives the quantum state from the inverse phase estimation module, extracts classical information from it, and by measuring the entire simulation implementation circuit system, collapses the quantum state in the target register to a specific classical result, and counts the result to obtain an approximate solution of the entire linear equation set to be solved; it is characterized in that the linear equation set to be solved is an 8th-order Hermitian matrix linear equation set; in the input quantum state module, a mixed operation unit of Hadamard gates and controlled-NOT gates is provided between the system initial quantum state unit and the quantum state basic unit capable of storing vector b to implement a uniformly superposed quantum entanglement state presented in the form of a tensor product; the Hamiltonian simulation evolution link in the phase estimation module is a high-order Hamiltonian simulation evolution link based on the module decomposition method and the construction function method. In this link, the Hamiltonian matrix of any power is analyzed, decomposed, and reconstructed into multiple smaller sub-Hamiltonians, that is, the evolution of the simulated sub-Hamiltonians is simulated. Special sub-circuits are designed for each sub-Hamiltonian, and a unique identifier Custom Operation{num} is assigned to ensure tracking management, and the sub-circuits are set as controlled gates, and the sub-Hamiltonians corresponding to the control qubits are selectively executed according to the states of the control qubits in the controlled gates to implement the control mechanism of multiple qubits; there is also a high-order Hamiltonian evolution link in the inverse phase estimation module that is the same as the high-order Hamiltonian simulation evolution link based on the module decomposition method and the construction function method, that is, a high-order Hamiltonian evolution link with the same structure but opposite direction as the high-order Hamiltonian simulation evolution link in the phase estimation module. Generally, the quantum solution of an 8×8-dimensional linear equation set is realized on an ordinary classical computer without relying on a high-performance computing platform.

[0015] The present invention is also a simulation implementation method based on Hamiltonian simulation, which is implemented on the simulation implementation circuit system based on Hamiltonian simulation described in claims 1-4. It is characterized in that the Hamiltonian of the high-order sparse matrix is simulated and evolved by using the module decomposition method or the construction function method to solve the problem of solving the linear equation system of the 8th-order Hermitian matrix, including the following steps:

[0016] Step 1: Construct a simulation implementation circuit system based on Hamiltonian simulation: The constructed simulation implementation circuit system based on Hamiltonian simulation is used to solve the linear equations of Hermitian matrices to be solved. It is sequentially connected with: an input quantum state module, a phase estimation module, a controlled rotation module, an inverse phase estimation module, and a measurement module; the input quantum state module is sequentially connected with a system initial quantum state unit, a target register component, and a quantum state basic unit that can store vector b. In the target register component, by constructing quantum gate operations in the main circuit, the selected qubits can store the preset vector b and transmit it to the phase estimation module; the phase estimation module is sequentially connected with a phase estimation register component, a Hadamard transform link, a Hamiltonian simulation evolution link, an inverse quantum Fourier transform link, and a target register component; the controlled rotation module includes an auxiliary register component, a controlled rotation link, and a phase estimation register component. The control end is connected to the qubits of the phase estimation register, and the target end acts on the qubits of the auxiliary register. By adjusting the rotation angle of the rotation gate, the auxiliary qubits are subjected to controlled rotation and the processed quantum state is transmitted to the inverse phase estimation module; the inverse phase estimation module is sequentially connected with a phase estimation register component, a quantum Fourier transform link, a Hamiltonian simulation evolution link, a Hadamard transform link, and a target register component, reversing the changes introduced in the previous phase estimation module, restoring the system to the preset state and transmitting it to the measurement module; the measurement module receives the quantum state from the inverse phase estimation module, extracts classical information from it, and by measuring the entire simulation implementation circuit system, collapses the quantum state in the target register to a specific classical result, and an approximate solution of the entire linear equations to be solved can be obtained; the key lies in that the linear equations to be solved are linear equations of an 8th-order Hermitian matrix; in the input quantum state module, a mixed operation unit of Hadamard gates and controlled-NOT gates is provided between the system initial quantum state unit and the quantum state basic unit that can store vector b to realize a uniformly superposed quantum entanglement state presented in the form of a tensor product; the Hamiltonian simulation evolution link in the phase estimation module is a high-order Hamiltonian simulation evolution link based on the module decomposition method and the construction function method. In this link, the Hamiltonian matrix of any power is analyzed, decomposed, and reconstructed into multiple smaller sub-Hamiltonians, that is, the evolution of the sub-Hamiltonians is simulated. Special sub-circuits are designed for each sub-Hamiltonian, and a unique identifier Custom Operation{num} is assigned to ensure tracking management. The sub-circuits are set as controlled gates, and the sub-Hamiltonians corresponding to the control qubits are selectively executed according to the states of the control qubits in the controlled gates to realize the control mechanism of multiple qubits;In the inverse phase estimation module, there is also a high-order Hamiltonian simulation evolution link similar to that based on the module decomposition method and the construction function method, that is, a high-order Hamiltonian evolution link with the same structure but opposite direction as the high-order Hamiltonian simulation evolution link in the phase estimation module. Overall, it realizes the quantum solution of an 8×8-dimensional linear equation system to be solved on a general classical computer without relying on a high-performance computing platform.

[0017] Construct a basic main circuit framework without any specific units and components in the above simulation implementation circuit system, and add three quantum register components, namely an auxiliary register component, a phase estimation register component, and a target register component. The auxiliary register component is used to store auxiliary qubits, the phase estimation register component is used to store the binary representation of the eigenvalues of the coefficient matrix A, and the target register component is used to store the column vector b of the linear equation system to be solved and the solution vector x of the equation system. The three quantum register components are initially set to the system initial quantum state unit 0.

[0018] Step 2: Make initial preparations for the linear equation system to be solved: The linear equation system to be solved is a linear equation system of an 8th-order Hermitian matrix. Select a Hermitian matrix in the form of the tensor product of different Pauli matrices and the identity matrix as the coefficient matrix of the linear equation system to be solved. For the selection of the column vector of the linear equation system to be solved, select a uniform quantum entangled state as the column vector of this linear equation system. When the three qubits in the target register component are all in an equally probable superposition state, this entangled state can be obtained. Then, the mapping from the system initial quantum state unit to this uniform quantum entangled state can be realized by applying Hadamard gates and controlled-NOT gates to each qubit in the target register component respectively. Calculate the theoretical analytical solution of the linear equation system to be solved through LU decomposition of the above linear equation system.

[0019] Step 3: Simulate the evolution of the high-order Hamiltonian based on the module decomposition method and the construction function method: In the high-order Hamiltonian simulation evolution link based on the module decomposition method and the construction function method in the phase estimation module, first initialize an 8th-order unit complex matrix U A as the base matrix, obtain Hamiltonian matrices of different powers by iteratively looping the exponential function of the coefficient matrix of the linear equation system to be solved, and decompose the Hamiltonian matrix into the product of a unitary matrix and a diagonal matrix according to the evolution rule of the Hamiltonian matrix. Obtain the power parameters of the sub-Hamiltonian and the specification of the qubit positions respectively through the module decomposition method and the construction function method to simulate the evolution of the sub-Hamiltonian.

[0020] Step 3.1: Use the module decomposition method to simulate the evolution of the sub-Hamiltonian. According to the transformation relationship between the phase rotation gate and the Hamiltonian matrix of the diagonal matrix, decompose the sub-Hamiltonian in the form of the tensor product of Pauli matrices correspondingly, and identify the basic quantum gate sequence that can directly act on specific target qubits in the target register, which corresponds to the interaction terms between different qubits in the simulation implementation circuit system;

[0021] Step 3.2: Use the construction function method to simulate the evolution of the sub-Hamiltonian. First, define a function CU() to construct the controlled-U gate operation matrix under specific conditions. This function receives the Hamiltonian matrix after different power operations as input and embeds it into a complex identity matrix of a larger dimension to form a 16-order controlled Hamiltonian matrix to simulate the evolution behavior of the sub-Hamiltonian;

[0022] Step 4: Construct the sub-circuit of the controlled gate and embed it into the main circuit: Create a temporary sub-circuit in the main circuit to store the above-mentioned custom quantum gate sequence. This sub-circuit accepts the basic quantum gate sequence corresponding to the sub-Hamiltonian and the required parameters, and executes a series of quantum gate sequences including controlled-NOT gates, NOT gates, and phase rotation gates on the specified qubits to realize the simulation evolution of the sub-Hamiltonian; Package the custom quantum gate sequence on the sub-circuit into a composite gate and assign a label Custom Operation{num} to it, where num represents the power parameter corresponding to the sub-Hamiltonian matrix; After completing all necessary sub-circuit designs, integrate all the designed sub-circuits into the main circuit, set the control qubit as the qubit in the phase estimation register component, and pass it to the corresponding sub-circuit together with the target qubit as parameters to ensure that each sub-circuit can correctly receive and process this information;

[0023] Step 5: Run the measurement on the main circuit and calculate the result: Run the above-integrated main circuit in python, measure the states of the qubits in the entire simulation implementation circuit system in the measurement module to obtain corresponding different classical results, count the results, and calculate the probability distribution of the results to obtain the experimental solution of the linear equation system to be solved;

[0024] Step 6: Verify the entire simulation implementation circuit system: Measure the accuracy of its simulation implementation circuit system by comparing the fidelity between the experimental solution and the theoretical analytical solution, and analyze the difference by calculating the error evaluation algorithm between the experimental solution and the analytical solution to ensure the reliability of the quantum operation.

[0025] The present invention proposes a method for solving the difficult problem of Hamiltonian simulation evolution in the solution of high-order linear equations, solves the problems of low circuit solution performance and efficiency and high circuit complexity caused by the difficulty of decomposing the corresponding Hamiltonian into a sequence of elementary gates, and constructs a general circuit design scheme for solving high-order linear equations on a general classical computer.

[0026] Compared with the prior art, the technical advantages of the present invention are as follows:

[0027] Reducing hardware requirements: Compared with the existing simulation studies on the HHL quantum algorithm, the present invention reduces the complexity of the quantum circuit by proposing a method for Hamiltonian simulation evolution, enabling the HHL quantum algorithm to achieve quantum solution of 8×8 dimensional linear equations on a general computer without relying on a high-performance computing platform. This means that the demand for hardware resources is greatly reduced, enabling more researchers and developers to access and utilize quantum algorithms for research and development.

[0028] Expanding the application scope: By adjusting the number of qubits in the phase estimation register component, multi-qubit control of Hamiltonian matrices with different powers is achieved, affecting the measurement accuracy of the phase estimation module. Two different scales of quantum circuits with 13 and 20 qubits are designed and implemented. The present invention not only improves the number of qubits used, but also can handle matrix solution problems of higher dimensions (such as 8th-order Hermitian matrices). This represents a significant improvement over the prior art in both the use of qubits and the dimension of the solved matrix, broadening the application field of quantum computing.

[0029] Improving efficiency and simplifying design: The present invention introduces the module decomposition method and the construction function method to address the design and efficient simulation of complex quantum circuits. The module decomposition method disassembles the complex Hamiltonian circuit into sub-circuits of sub-Hamiltonians corresponding to different powers according to the evolution rules of the Hamiltonian and the relationship between elementary quantum gates, simplifying the design process and improving the circuit simulation efficiency; the construction function method embeds Hamiltonian matrices with different powers into the matrices corresponding to controlled gate operations through construction functions and converts them into quantum objects recognizable in quantum circuits, enhancing the readability and maintainability of the code, making it possible to have a general circuit design scheme for the high-order sparse matrix HHL algorithm, and further improving the efficiency of problem-solving.

[0030] Enhancing generality and adaptability: The present invention can not only effectively handle various QLSPs (Quantum Linear System Problems) of high-order sparse matrices, but also be extended to the solution of linear problems of all sparse matrices represented in the form of tensor products. This flexibility and wide applicability are difficult to match by the prior art, laying a foundation for the application of quantum computing in the solution of larger-scale linear equations. Description of the Drawings

[0031] Figure 1 It is a schematic circuit diagram of the HHL algorithm;

[0032] Figure 2 It is a block diagram of the components of the simulation implementation circuit system based on Hamiltonian simulation of the present invention;

[0033] Figure 3 It is a schematic flow diagram of the simulation implementation circuit system based on Hamiltonian simulation of the present invention;

[0034] Figure 4 It is a schematic diagram of the steps of the simulation implementation method based on Hamiltonian simulation of the present invention;

[0035] Figure 5 It is a schematic flow diagram of the module decomposition method of the present invention;

[0036] Figure 6 It is a schematic flow diagram of the construction function method of the present invention;

[0037] Figure 7 It is a schematic circuit diagram of the Hamiltonian circuit of Pauli matrices in different tensor product forms of the present invention;

[0038] Figure 8 It is the Hamiltonian of the tensor product form matrix of the present invention of the schematic circuit diagram;

[0039] Figure 9 It is a schematic circuit diagram of the simulation implementation circuit system using the module decomposition method with 14 qubits of the present invention;

[0040] Figure 10 It is a measurement result diagram of the circuit simulation of the HHL algorithm using the module decomposition method under different qubit scales of the present invention;

[0041] Figure 11 It is a schematic circuit diagram of the simulation implementation circuit system using the construction function method with 13 qubits of the present invention;

[0042] Figure 12 It is a measurement result diagram of the circuit simulation of the HHL algorithm using the construction function method under different qubit scales of the present invention. Detailed Implementation Manner

[0043] The following clearly and completely describes the technical solutions in the embodiments of the present invention with reference to 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 belong to the scope of protection of the present invention.

[0044] Embodiment 1

[0045] In many current engineering fields, the need to solve large-scale linear equations is extremely common and urgent. In scientific research, climate simulation needs to process a vast amount of meteorological data and accurately simulate the complex changes in the climate by solving high-order linear equations; in materials science, the study of the relationship between the microscopic structure and macroscopic properties of materials relies on solving high-order linear equations to analyze the interactions between atoms. In industrial production, such as the design of aircraft in the aerospace field, large-scale linear equations need to be solved for structural mechanics analysis to ensure the safety and reliability of the aircraft.

[0046] However, the existing solutions face many difficulties. On a quantum computer, although it theoretically has powerful computing capabilities to handle such problems, in reality, the cost of a real quantum computer is extremely high, restricting its widespread application. Moreover, the number of qubits that can be achieved currently is too small to meet the computing resource requirements for solving high-order linear equations. On a general computer, due to the limitations of classical algorithms, when faced with high-order linear equations, the computational complexity grows exponentially, resulting in an overly long computing time or even being unable to obtain results within a reasonable time.

[0047] Therefore, the present invention conducts in-depth research and proposes a simulation implementation circuit system and method based on Hamiltonian simulation. The core idea is to utilize the hardware resources of a general computer and, through algorithm design and circuit construction, simulate the evolution process of the Hamiltonian in quantum computing to break through the bottleneck of traditional computing methods in dealing with high-order linear equations. By deeply studying the internal relationship and conversion relationship between the Hamiltonian matrix and the diagonal matrix in quantum mechanics, and using the properties of quantum states and the functions of basic quantum gates, a circuit system and method capable of simulating quantum computing behavior in a classical computer environment are designed to achieve the efficient solution of high-order linear equations.

[0048] The present invention is a simulation implementation circuit system based on Hamiltonian simulation, which is used to solve the linear equations to be solved. Refer to Figure 1, which are sequentially connected with: an input quantum state module, a phase estimation module, a controlled rotation module, an inverse phase estimation module, and a measurement module. The simulation implementation circuit system formed by connecting all the modules is simply referred to as the main circuit. In this system, the target register component, the phase estimation register component, and the auxiliary register component are not set independently of each other, but share the same set of physical registers to undertake the responsibilities of each register component under different modules; the input quantum state module is sequentially connected with a system initial quantum state unit (i.e., a data loading unit), a target register component, and a quantum state basic unit that can store vector b. In the target register component, by constructing quantum gate operations in the main circuit, the selected qubits can store the preset vector b and transmit it to the phase estimation module, that is, store vector b in the selected quantum state and transmit it to the phase estimation module; the phase estimation module is sequentially connected with a phase estimation register component, a Hadamard transform link, a Hamiltonian simulation evolution link, an inverse quantum Fourier transform link, and a target register component, estimating the phase information of the eigenvalues of the Hamiltonian matrix, encoding the eigenvalues of the corresponding coefficient matrix in binary form onto the qubits in the phase estimation register component, and then transmitting the acted quantum state unit to the controlled rotation module; the controlled rotation module includes an auxiliary register component, a controlled rotation link, and a phase estimation register component. The control qubit of the controlled rotation operation in this module is the qubit of the phase estimation register component, and the target qubit is the qubit of the auxiliary register component. The rotation angle θ of the rotation gate is adjusted according to the eigenvalue of the coefficient matrix j = 2arcsin(C / λ j ), where λ j is the eigenvalue of the coefficient matrix and C is a constant. Perform phase rotation gates with different rotation angles on the auxiliary qubit and transmit the processed quantum state to the inverse phase estimation module; the inverse phase estimation module is sequentially connected with a phase estimation register component, a quantum Fourier transform link, a Hamiltonian simulation evolution link, a Hadamard transform link, and a target register component, reversing the changes introduced in the previous phase estimation module, restoring the system to the preset state and transmitting the quantum state to the measurement module; the measurement module receives the quantum state of the system from the inverse phase estimation module, collapses the quantum state in the target register component to a specific classical result by measuring the entire simulation implementation circuit system, counts the results and calculates the probability distribution to obtain an approximate solution of the entire linear equation system to be solved. See Figure 2 , Figure 2It is a block diagram of the constituent modules of the simulation implementation circuit system based on Hamiltonian simulation of the present invention. The linear equation system to be solved in the present invention is an 8th-order Hermitian matrix linear equation system; in the input quantum state module, a hybrid operation unit of Hadamard gates and controlled-NOT gates is provided between the system initial quantum state unit and the quantum state basic unit that can store vector b, achieving the conversion of classical data to the quantum state basic unit, and realizing a uniformly superposed quantum entanglement state presented in the form of a tensor product, so that the quantum state units corresponding to the column vectors and solution vectors of the linear equation system are adapted to the constructed simulation implementation circuit system. The Hamiltonian simulation evolution link in the phase estimation module of the present invention is a high-order Hamiltonian simulation evolution link based on the module decomposition method and the construction function method. In this link, the Hamiltonian matrix of any power is analyzed, decomposed and reconstructed into multiple smaller sub-Hamiltonians, that is, the evolution of the simulated sub-Hamiltonians is simulated, and a dedicated sub-circuit is designed for each sub-Hamiltonian, and a unique identifier Custom Operation{num} is assigned to ensure tracking management, and the sub-circuit is set as a controlled gate, and the sub-Hamiltonian corresponding to the control qubit is selectively executed according to the state of the control qubit in the controlled gate, realizing the control mechanism of multiple qubits; there is also a high-order Hamiltonian simulation evolution link based on the module decomposition method and the construction function method in the inverse phase estimation module, that is, a high-order Hamiltonian evolution link with the same structure and opposite direction as the high-order Hamiltonian simulation evolution link in the phase estimation module. Generally, the quantum solution of an 8×8 dimensional linear equation system is realized on an ordinary classical computer and can be extended to the solution of higher-order linear equation systems without relying on a high-performance computing platform.

[0049] The specific solution of the present invention is to first construct a main circuit including an auxiliary register component, a phase estimation register component and a target register component in the simulation implementation circuit system and initialize it to the system initial quantum state unit. Then, make initial preparations for the 8th-order Hermitian matrix linear equation system to be solved, select the coefficient matrix and column vectors, and realize the mapping from the initial state to the target state through specific quantum gate operations. Then, based on the module decomposition method and the construction function method, the high-order Hamiltonian is simulated and evolved, the Hamiltonian matrix is disassembled and the relevant parameters of the sub-Hamiltonians are obtained by different methods to simulate its evolution. After that, the sub-circuit of the controlled gate is constructed and embedded in the main circuit, and the sub-Hamiltonian simulation evolution is realized through the design of a custom quantum gate sequence and composite gates. Finally, the entire simulation implementation circuit system is verified, the experimental solution is obtained by calculating the probability distribution, and compared with the theoretical analytical solution to ensure reliability.

[0050] The present invention successfully bypasses the high costs of quantum computing hardware and the limited number of qubits, without relying on expensive and technologically immature quantum computing devices, and can realize the solution of high-order linear equation systems only through ordinary computer resources, reducing the cost and technical barriers of applying quantum computing methods.

[0051] The present invention solves the problem that ordinary computers are difficult to simulate the evolution of the corresponding Hamiltonian when dealing with linear equations with high complexity. When facing such tasks, traditional methods often lead to excessively long calculation times or even unable to complete the calculation due to the exponential growth of the computational complexity. Moreover, the Hamiltonian structure and characteristics corresponding to high-order sparse Hermitian matrices are complex. As the matrix order increases, the number of qubits involved in the Hamiltonian increases, and the quantum state space grows exponentially, making it difficult for ordinary computers to accurately represent and operate. The present invention realizes the rapid solution of high-order linear equations and improves the computational efficiency by simulating the Hamiltonian evolution process in quantum computing and combining innovative method design and circuit construction. The present invention proposes to use the module decomposition method and the construction function method to simulate the Hamiltonian evolution, realizes the simulation of the HHL algorithm on ordinary computers, and is particularly optimized for the solution of linear equations of order 8 and above. By introducing two innovative technologies, the present invention can more effectively approximate the simulation of the Hamiltonian at different evolution times, improves the feasibility and performance on classical computers, expands the application scenarios of the HHL algorithm, and promotes the connection between quantum computing theory and practice.

[0052] In the simulation implementation circuit system based on Hamiltonian simulation, there is a close and clear causal relationship among the components, jointly supporting the function of solving high-order linear equations on ordinary computers.

[0053] As the basic framework of the entire system, the main circuit is constructed without any components and units in order to accommodate various functional components subsequently. The introduction of the auxiliary register component, the phase estimation register component, and the target register component is based on specific computational requirements. The auxiliary register component is used to store auxiliary qubits, which are used to assist in the inversion of eigenvalues in the controlled rotation module. The phase estimation register component is used to store the binary representation of the eigenvalues of the coefficient matrix A. The target register component is used to store the column vector of the linear equation to be solved and the solution vector of the equation, which is the core data carrier of the entire calculation. All calculation operations ultimately aim to obtain the solution vector of the equation stored in this register component.

[0054] For the step of making initial preparations for the linear equation to be solved, the selection of specific coefficient matrices and column vectors and the realization of the mapping from the initial state to the target state through specific quantum gate operations are based on the requirements of subsequent Hamiltonian simulation evolution. The selection of the coefficient matrix and the column vector determines the nature and characteristics of the equation, and the preparation of the qubits in the target register component to a specific quantum state through operations such as Hadamard gates and controlled-NOT gates is to make the system enter an initial state suitable for Hamiltonian simulation evolution and lay a foundation for subsequent calculations.

[0055] The simulation evolution process of the high-order Hamiltonian based on the module decomposition method and the construction function method is the core calculation step of the entire system. Initialize an 8th-order unit complex matrix as the base matrix, and obtain Hamiltonian matrices of different powers by iteratively calculating the exponential function of the coefficient matrix in a loop. This is because the evolution of the Hamiltonian matrix is closely related to the solution of linear equations. Decompose the Hamiltonian matrix into the product of a unitary matrix and a diagonal matrix, and obtain the relevant parameters of the sub-Hamiltonian through the module decomposition method and the construction function method, in order to more precisely simulate the evolution process of the Hamiltonian and then solve the linear equations. The module decomposition method disassembles the sub-Hamiltonian in the form of the tensor product of Pauli matrices, and identifies the basic quantum gate sequence that can directly act on specific target qubits in the target register. This is based on the purpose of realizing the evolution of the sub-Hamiltonian through quantum gate operations, and the objects of action of these quantum gate sequences are the qubits in the target register component. By operating on these qubits, the evolution of the Hamiltonian is simulated. The construction function method constructs the controlled-U gate operation matrix under specific conditions by defining the function CU(), embeds the Hamiltonian matrices after different power operations into a complex unit matrix of a larger dimension to simulate the evolution of the sub-Hamiltonian, and the simulated evolution of the sub-Hamiltonian will ultimately affect the solution vector stored in the target register component. Construct the simulated evolution of the sub-Hamiltonian into a controlled gate operation and embed its sub-circuit into the main circuit. Create a temporary sub-circuit to store the custom quantum gate sequence corresponding to the simulated evolution of the sub-Hamiltonian and encapsulate it into a composite gate. This is to modularize complex quantum gate operations for convenient invocation and control in the main circuit. Set the control qubit as the qubit in the phase estimation register component and pass it together with the target qubit as parameters to the corresponding sub-circuit. This is because the eigenvalue information stored in the phase estimation register component is related to the evolution of the sub-Hamiltonian. Through the action of the control qubit, the execution of the quantum gate sequence in the sub-circuit can be precisely controlled according to the eigenvalue information, realizing precise operation on the qubits in the target register component and thus affecting the calculation of the solution vector.

[0056] Embodiment 2

[0057] The simulation implementation circuit system and method based on Hamiltonian simulation are the same as those in Embodiment 1. In the high-order Hamiltonian simulation evolution process based on the module decomposition method and the construction function method in the phase estimation module of the present invention, in this evolution process, the qubits in the phase estimation register component are called as control qubits and the Hamiltonian matrices of different powers are applied to the qubits in the target register component. In order to implement the simulation operations of the Hamiltonian of different powers, first, for the 8th-order linear equations to be solved, calculate the exponential function of its coefficient matrix as the Hamiltonian matrices of different powers according to different evolution times of the system, and then according to the evolution rules of the Hamiltonian Decompose the Hamiltonian matrices of different powers e -iHt into the product form of the unitary matrix U and the diagonal matrix e -iDt . Using the properties after the expansion of the tensor product represent the diagonal Hamiltonian matrix as the tensor product product form of the second-order sub-Hamiltonian, and act the sub-Hamiltonian on the qubits in the target register component according to the decomposition order. Perform custom operations of quantum gates on the sub-Hamiltonians acting on different qubits, and according to the conversion relationship between the phase rotation gate and the Pauli matrix, including R Z (t)=XR Z (-t)X, decompose the sub-Hamiltonian into a series of basic quantum gate operations and add them to the custom operations, including single-qubit gates, Hadamard gates, CNOT gates, NOT gates (Pauli-X gates), and phase rotation gates. These quantum gate operations receive the power exponent of the controlled U gate, the position of the control qubit, and the position of the target qubit as parameters, and implement quantum gate operations acting on different qubits according to different parameters. By combining these basic operation quantum gate sequences, simulate the evolution behavior of the sub-Hamiltonian. See Figure 7 , Figure 7 which is the schematic diagram of the Hamiltonian circuit of the Pauli matrix in the form of tensor product of the present invention, where Figure 7 (a) is the schematic diagram of the Hamiltonian circuit corresponding to the matrix , Figure 7 (b) is the schematic diagram of the Hamiltonian circuit corresponding to the matrix , Figure 7 (c) is the schematic diagram of the Hamiltonian circuit corresponding to the matrix .

[0058] For the coefficient matrices of different linear equations to be solved, the exponential function of the coefficient matrix is calculated according to different evolution times of the system as the Hamiltonian matrix of different powers. Then, the matrix form is analyzed and decomposed into the tensor product product form of sub-Hamiltonians, and decomposed into second-order sub-Hamiltonians. For the simulated evolution of the Hamiltonian matrices of different powers corresponding to the linear systems to be solved, two analysis methods are carried out respectively: the module decomposition method and the construction function method. The module decomposition method disassembles the tensor product form of Pauli matrices correspondingly, and identifies the sub-Hamiltonian fragments that can directly act on specific target qubits in the target register, which correspond to the interaction terms between different qubits in the corresponding circuit system, and can accurately act on the selected target qubits without changing the states of other irrelevant qubits. The construction function method first defines a general function that receives the coefficient matrix of the linear equation system as input and returns the corresponding Hamiltonian matrix, and gradually realizes the different power operations of the matrix through loop iteration. A function CU() is designed to construct the controlled-U gate operation matrix under specific conditions. This function receives the Hamiltonian matrix after different power operations as input and embeds it into a complex unit matrix of a larger dimension to form a 16-order controlled Hamiltonian matrix to simulate the evolution behavior of the sub-Hamiltonian.

[0059] Since the high-order linear equations to be solved are difficult to handle with traditional methods in terms of computational complexity, it is necessary to rely on the parallelism advantage of quantum computing. Calculating different powers of the Hamiltonian matrix based on the evolution time of the system is to accurately reflect the state changes of the system at different times, providing a basis for the Hermitian matrix decomposition and quantum gate operations in the phase estimation module and the inverse phase estimation module. The reason why the Hamiltonian matrix of the present invention is decomposed into sub-Hamiltonians acting on one qubit is that the operations at the qubit level are easier to implement and control, and can make full use of the characteristics of quantum mechanics for calculation. Customizing quantum gate operations according to the conversion relationship between the phase rotation gate and the Pauli matrix is to accurately split the Hamiltonian matrix of different powers and simulate the evolution behavior of the sub-Hamiltonian. And the ultimate goal of these operations is to efficiently and accurately solve high-order linear equations. Each step is closely connected, with a clear causal relationship, jointly constituting a complete and efficient computing system.

[0060] Embodiment 3

[0061] The simulation implementation circuit system and method based on Hamiltonian simulation are the same as those in Embodiments 1-2. In the present invention, for the simulation of the evolution of the sub-Hamiltonian in the high-order Hamiltonian simulation evolution link based on the module decomposition method and the construction function method in the phase estimation module, when constructing the corresponding sub-circuits for different sub-Hamiltonians, first, the relationship between the basic quantum gates including the phase rotation gate and the NOT gate and the diagonal Hamiltonian matrix includes diag[e-it , e it = R Z (2t) = XR Z (-t)XR Z (t) determines the corresponding basic quantum gate sequence, that is, it is disassembled and placed in the sub-circuit in the order of NOT gate, phase rotation gate, and NOT gate. The rotation angle of the phase rotation gate is determined according to the system evolution time t corresponding to the Hamiltonian matrix of different powers. See Figure 8 , Figure 8 is the matrix in the form of tensor product of the present invention Schematic diagram of the circuit of the Hamiltonian. The constructed sub-Hamiltonian circuit obtains the matrix representation equivalent to its circuit by using the Operator class, and calculates the fidelity between its equivalent matrix and the sub-Hamiltonian matrix to evaluate the accuracy of the construction of the sub-Hamiltonian circuit. The value of the fidelity close to 1 ensures that the sub-circuit segment is accurately mapped to the controlled operation on a single or multiple qubits acting on the target register component; and restrictions are imposed on the topological structure of these sub-Hamiltonian components and the operations of different controlled gates, and redundant gate operations are removed. For example, when two consecutive NOT gates (i.e., X gates) act on the same qubit, their effects cancel each other out, so the NOT gate operation can be removed, simplifying the original complex multi-qubit interaction process, simplifying the circuit structure, and realizing the evolution of the sub-Hamiltonian in the simulation implementation circuit system. The evolution process of the Hamiltonian of different powers in the main circuit is the iterative calculation of matrices of different powers in the controlled U gate operation. Then, for different sub-Hamiltonians, different control qubits and the corresponding target qubit positions can be found. After encapsulating the sub-circuits corresponding to the above sub-Hamiltonians, traverse the different qubits of the phase estimation register component in turn and connect the qubit with the qubits in the corresponding target register component to construct controlled gate operations, including controlled NOT gates and controlled phase rotation gates. The sub-Hamiltonian circuit is embedded into the main circuit through the QuantumCircuit.append() function, and the main circuit is run to solve the 8th-order linear equations to be solved.

[0062] When simulating the evolution of the sub-Hamiltonian, this scheme ensures the accurate mapping of the sub-circuit segment to the controlled operation of the qubits in the target register component by calculating the fidelity between the matrix and the Hamiltonian simulation circuit, guaranteeing the calculation accuracy and reducing errors caused by the deviation between the circuit and the theory. Integrating the sub-circuit corresponding to the sub-Hamiltonian into the main circuit realizes the systematic integration of solving the 8th-order linear equations, avoids compatibility problems, improves the calculation efficiency, and facilitates the management and debugging of the calculation process. Restricting the topological structure and different controlled gate operations simplifies the complex multi-qubit interaction process, reduces the difficulty of circuit design and implementation, decreases potential errors, and improves the utilization efficiency of computing resources. Using the different qubits of the phase estimation register to control the Hamiltonian operations of different powers in sequence, clarifying the positions of the control qubits and target qubits and the power exponents required for the controlled operations of the sub-circuit, improves the accuracy of qubit operations, and thus enhances the stability and reliability of the entire calculation process.

[0063] Embodiment 4

[0064] The simulation implementation circuit system and method based on Hamiltonian simulation are the same as those in Embodiments 1-3. The input quantum state module of the present invention provides the quantum state basic unit of the vector b that can be stored in the linear equations to be solved for the phase estimation module. It is responsible for receiving and processing classical data, enabling the classical information to be converted into a form suitable for the quantum circuit system and accurately mapped to the quantum state in the ground state form, preparing for the subsequent simulation implementation circuit system. First, it receives the column vectors and coefficient matrices corresponding to the given linear equations, analyzes their mathematical structures and characteristics, and represents the classical information in the form of quantum ground states 0 and 1 through the base encoding mechanism, i.e., the digital encoding mechanism. By calculating the transformation relationship between the initial quantum state unit of the system and the quantum state basic unit of the vector b that can be stored, the corresponding mapping is found, and the mapping is disassembled into a suitable sequence of quantum gate operations. The operation combination of Hadamard gates and controlled-NOT gates is applied in this sequence. By applying the Hadamard gate to each qubit, a quantum superposition state in which the probability of each qubit being in 0 and 1 is equal can be obtained, and then the controlled-NOT gate is used to change the state of the selected qubit, allowing the simulation implementation circuit system to gradually construct a complex quantum entangled state.

[0065] First, for the linear equations to be solved, the following uniform quantum entangled state is selected as the column vector of the linear equations in the input quantum state module.

[0066]

[0067] When the three qubits in the target register component are all in a superposition state with equal probabilities, the uniform quantum entanglement state can be obtained. From the principles of quantum mechanics, the superposition state with equal probabilities endows the quantum system with unique parallel computing capabilities, laying a foundation for the subsequent efficient solution of linear equations. Then, the mapping from the initial quantum state unit of the system to this uniform quantum entanglement state can be achieved by applying the Hadamard gate and the controlled-NOT gate to each qubit in the target register component respectively. Among them, the Hadamard gate (abbreviated as the H gate) converts a qubit from the classical 0 or 1 state to a superposition state, creating conditions for the generation of quantum entanglement. For the 3 qubits with an initial state of 0 in the solution register, perform the Hadamard transformation on them, that is, apply the H gate to these 3 qubits respectively. At this time, each qubit will change from the single 0 state to a superposition state. The controlled-NOT gate (CNOT gate) is used to establish a correlation between qubits, and the above-mentioned quantum entanglement state can be obtained by flipping the state of the target qubit by controlling the state of the qubit.

[0068] Embodiment 5

[0069] The present invention is also a simulation implementation method based on Hamiltonian simulation, which is implemented on the above-mentioned simulation implementation circuit system based on Hamiltonian simulation. The simulation implementation circuit system and method based on Hamiltonian simulation are the same as those in Embodiments 1-4. Refer to Figure 4 , Figure 4 is a schematic diagram of the steps of the simulation implementation method based on Hamiltonian simulation of the present invention. The Hamiltonian of the high-order sparse matrix is simulated and evolved by using the module decomposition method or the construction function method to solve the problem of solving an 8th-order linear equation to be solved, including the following steps:

[0070] Step 1: Construct a simulation implementation circuit system based on Hamiltonian simulation: The constructed simulation implementation circuit system based on Hamiltonian simulation is used to solve the linear equations of Hermitian matrices. It is sequentially connected with: an input quantum state module, a phase estimation module, a controlled rotation module, an inverse phase estimation module, and a measurement module. The simulation implementation circuit system formed by connecting all modules is simply referred to as the main circuit. In this system, the target register component, the phase estimation register component, and the auxiliary register component are not set independently, but reuse the same set of physical registers to undertake the responsibilities of each register component under different modules. The input quantum state module is sequentially connected with a system initial quantum state unit (i.e., a data loading unit), a target register component, and a quantum state basic unit that can store vector b. In the target register component, by constructing quantum gate operations in the main circuit, the selected qubits can store the preset vector b and transmit it to the phase estimation module. That is, vector b is stored in the selected quantum state and transmitted to the phase estimation module; the phase estimation module is sequentially connected with a phase estimation register component, a Hadamard transform link, a Hamiltonian simulation evolution link, an inverse quantum Fourier transform link, and a target register component. It estimates the phase information of the Hamiltonian eigenvalue, encodes it onto the qubits in the phase estimation register, and then transmits the acted quantum state unit to the controlled rotation module; the controlled rotation module includes an auxiliary register component, a controlled rotation link, and a phase estimation register component. The control end is connected to the qubits of the phase estimation register, and the target end acts on the qubits of the auxiliary register. By adjusting the rotation angle of the rotation gate, the auxiliary qubits are controlled to rotate and the processed quantum state is transmitted to the inverse phase estimation module; the inverse phase estimation module is sequentially connected with a phase estimation register component, a quantum Fourier transform link, a Hamiltonian simulation evolution link, a Hadamard transform link, and a target register component. It reverses the changes introduced in the previous phase estimation module, restores the system to the preset state and transmits it to the measurement module; the measurement module receives the quantum state from the inverse phase estimation module and extracts classical information from it. By measuring the entire simulation implementation circuit system, the quantum state in the target register collapses to a specific classical result, and an approximate solution to the entire linear equations to be solved can be obtained.The key lies in that the linear equation system to be solved is a linear equation system of an 8th-order Hermitian matrix; in the input quantum state module, a hybrid operation unit of Hadamard gates and controlled-NOT gates is provided between the system initial quantum state unit and the quantum state basic unit that can store vector b, to achieve a uniformly superposed quantum entanglement state presented in the form of a tensor product; the Hamiltonian simulation evolution link in the phase estimation module is a high-order Hamiltonian simulation evolution link based on the module decomposition method and the construction function method. In this link, the Hamiltonian matrix of any power is analyzed, decomposed, and reconstructed into multiple smaller sub-Hamiltonians, that is, the evolution of the sub-Hamiltonians is simulated. Special sub-circuits are designed for each sub-Hamiltonian, and a unique identifier CustomOperation{num} is assigned to ensure tracking management, and the sub-circuits are set as controlled gates, and the sub-Hamiltonians corresponding to the control qubits are selectively executed according to the states of the control qubits in the controlled gates, to achieve the control mechanism of multiple qubits; there is also a high-order Hamiltonian simulation evolution link based on the module decomposition method and the construction function method in the inverse phase estimation module, that is, a high-order Hamiltonian evolution link with the same structure but opposite direction as the high-order Hamiltonian simulation evolution link in the phase estimation module. Overall, the quantum solution of the 8×8-dimensional linear equation system to be solved is realized on an ordinary classical computer without relying on a high-performance computing platform.

[0071] In the above simulation implementation circuit system, a basic main circuit framework without any specific units and components is constructed, and three quantum register components are added, namely an auxiliary register component, a phase estimation register component, and a target register component. The auxiliary register component is used to store auxiliary qubits, the phase estimation register component is used to store the binary representation of the eigenvalues of the coefficient matrix A, and the target register component is used to store the column vector b of the linear equation system to be solved and the solution vector x of the equation system. When dealing with the problem of the linear equation system of an 8th-order Hermitian matrix, 3 qubits can be used to represent the column vector and the solution vector, so the number of qubits in the target register component is 3, and the three quantum register components are initially set to the system initial quantum state unit 0.

[0072] Step 2: Make initial preparations for the linear equation system to be solved: The linear equation system to be solved is a linear equation system of an 8th-order Hermitian matrix. Select Hermitian matrices in the form of the tensor product of different Pauli matrices and the identity matrix as the coefficient matrices of the linear equation system to be solved. For the selection of the column vectors of the linear equation system to be solved, a uniform quantum entanglement state is selected as the column vectors of this linear equation system. When the three qubits in the target register component are all in an equally probable superposition state, this entanglement state can be obtained. Then the mapping from the system initial quantum state unit to this uniform quantum entanglement state can be realized by applying Hadamard gates and controlled-NOT gates to each qubit in the target register component respectively.

[0073] Step 3: Perform simulation evolution on the high-order Hamiltonian based on the module decomposition method and the construction function method: In the high-order Hamiltonian simulation evolution process based on the module decomposition method and the construction function method in the phase estimation module, first initialize an 8th-order unit complex matrix U A as the base matrix, obtain Hamiltonian matrices of different powers by iteratively calculating the exponential function of the coefficient matrix of the linear equation system to be solved, and according to the evolution rule of the Hamiltonian matrix Decompose the Hamiltonian matrix into the product of a unitary matrix and a diagonal matrix, and obtain the power parameters of the sub-Hamiltonian and the designation of the qubit positions respectively through the module decomposition method and the construction function method to simulate the evolution of the sub-Hamiltonian.

[0074] Step 3.1: Use the module decomposition method to simulate the evolution of the sub-Hamiltonian. According to the transformation relationship between the phase rotation gate and the Hamiltonian matrix of the diagonal matrix, including diag[e -it ,e it = R Z (2t) = XR Z (-t)XR Z (t), decompose the sub-Hamiltonian in the form of the tensor product of Pauli matrices correspondingly to obtain a basic quantum gate sequence composed of NOT gates and phase rotation gates, and identify the basic quantum gate sequence that can directly act on specific target qubits in the target register, which corresponds to the interaction terms between different qubits in the simulation implementation circuit system.

[0075] Step 3.2: Use the construction function method to simulate the evolution of the sub-Hamiltonian. First, define a function CU() to construct a controlled-U gate operation matrix under specific conditions. This function receives the Hamiltonian matrix after different power operations as input and embeds it into a complex unit matrix of a larger dimension to form a 16th-order controlled Hamiltonian matrix to simulate the evolution behavior of the sub-Hamiltonian.

[0076] Step 4: Construct the sub-circuit of the controlled gate and embed it into the main circuit: Create a temporary sub-circuit in the main circuit to store the above-mentioned custom quantum gate sequence. This sub-circuit accepts the basic quantum gate sequence corresponding to the sub-Hamiltonian and the required parameters (i.e., the power of the controlled gate and the positions of the specified qubits), and executes a series of quantum gate sequences including controlled-NOT gates, NOT gates, and phase rotation gates on the specified qubits to achieve the simulation evolution of the sub-Hamiltonian. Package the custom quantum gate sequence on the sub-circuit into a composite gate and assign it a label Custom Operation{num}, where num represents the power parameter corresponding to the sub-Hamiltonian matrix. After completing all necessary sub-circuit designs, integrate all the designed sub-circuits into the main circuit to obtain the integrated main circuit, and set the control qubits to the qubits in the phase estimation register component, and pass them together with the target qubits as parameters to the corresponding sub-circuits to ensure that each sub-circuit can correctly receive and process this information.

[0077] Step 5: Run and measure the main circuit and calculate the results: Run the above-mentioned integrated main circuit in Python, measure the states of the qubits in the entire simulation implementation circuit system in the measurement module to obtain the corresponding different classical results, count the results, and calculate the probability distribution of the results to obtain the experimental solution of the linear equations to be solved.

[0078] Step 6: Verify the entire simulation implementation circuit system: Measure the accuracy of its simulation implementation circuit system by calculating the fidelity between the experimental solution and the theoretical analytical solution, and analyze the differences by calculating the error evaluation algorithm between the experimental solution and the analytical solution to ensure the reliability of the quantum operation.

[0079] For the 8th-order linear system to be solved, the present invention utilizes the principles of linear algebra and quantum mechanics. By calculating the exponential function of the coefficient matrix of the linear equations to be solved, the Hamiltonian matrix of the corresponding power is obtained. The order of the obtained Hamiltonian matrix is the same as that of the original coefficient matrix, both being 8th order. Furthermore, by using the properties of the tensor product, the 8th-order Hamiltonian matrices of different powers are analyzed, decomposed, and reconstructed, and transformed into the product form of the tensor product of 2nd-order sub-Hamiltonians. Each 2nd-order sub-Hamiltonian can be intuitively converted into an operation acting on 1 qubit. Then, according to the disassembly order of the sub-Hamiltonians, the positions of the control qubits and the target qubits can be determined, thereby effectively mapping to the specific gate operations in the quantum circuit. By further disassembling the sub-Hamiltonians into the basic quantum gate sequences, the basic quantum gate sequences acting on a single qubit can be found, including the controlled-NOT gate, the NOT gate, and the phase rotation gate. These basic quantum gates accept specific parameters, such as the power exponent of the controlled-U gate and the specified qubit positions. By combining these basic quantum gate operations, the evolution behavior of the sub-Hamiltonian is simulated, and the quantum gate operations corresponding to this behavior are added to the custom circuit operation sequence to complete the simulation of the entire Hamiltonian evolution. For each custom basic gate operation sequence, first, a sub-circuit that is independent and does not contain any basic units is created in the simulation implementation circuit system. The custom operations of the corresponding specific 2nd-order sub-Hamiltonian are embedded into the sub-circuit to ensure that each sub-circuit focuses on implementing the evolution of a single sub-Hamiltonian. The sub-circuit is encapsulated into a composite gate and given a unique identifier "CustomOperation{num}", where num represents the corresponding power parameter of the sub-Hamiltonian matrix, facilitating subsequent tracking, identification, and management of the sub-circuit. To implement the controlled mechanism of multiple control qubits, by selecting specific control qubits and target qubits, the custom basic quantum gate operations in the above sub-circuit are converted into the form of controlled gate operations, ensuring that the custom operations in the corresponding sub-circuit are only executed when the control qubits are in the preset state. This process extends the control logic by adding additional control qubits to achieve complex multiple control qubit operations. After completing all the necessary sub-circuit designs, they are integrated into the main quantum circuit, and the control qubits are set as the qubits in the phase estimation register component and passed to the corresponding sub-circuits together with the target qubits as parameters to ensure that each sub-circuit can correctly receive and process this information. This process allows complex Hamiltonian simulation operations to be decomposed and distributed for processing in multiple sub-circuits, thereby optimizing and simplifying the overall circuit structure. Finally, the entire simulation implementation circuit system is verified to ensure that each sub-circuit works as expected and at the same time confirm that the overall circuit achieves the desired Hamiltonian evolution effect.

[0080] The present invention proposes a method for solving the difficult problem of Hamiltonian simulation evolution in the solution of high-order linear equations, which not only helps to deeply understand quantum systems, accurately characterize complex quantum behaviors, accelerate quantum chemistry calculations, and lay a foundation for the design of new materials and drugs, but also provides support in the fields of materials science, quantum information processing, etc. By efficiently solving linear equations, it achieves exponential acceleration compared with traditional algorithms, solves the problems of low performance and efficiency in circuit solving, and overcomes the challenge of high circuit complexity caused by the difficulty of decomposing the Hamiltonian into a sequence of elementary gates. This method constructs a general circuit design scheme for solving high-order linear equations on ordinary classical computers, provides a new approach for many scientific and engineering problems, promotes the practical application of quantum computing, and shows great application potential in many fields such as machine learning, data mining, financial risk assessment, and communication signal processing.

[0081] In view of the problems of low efficiency and dependence on high-performance platforms in the existing computing methods when dealing with 8th-order Hermitian matrix linear equations, this scheme starts from constructing the framework of the simulation implementation circuit system and gradually promotes the construction of each module. In the input quantum state module, through the hybrid operation of Hadamard gates and controlled-NOT gates, a uniformly superposed quantum entangled state is realized. In the phase estimation module and the inverse phase estimation module, the module decomposition method and the construction function method are respectively used. By decomposing the Hamiltonian matrix and constructing the corresponding basic quantum gate sequence as its sub-circuit to simulate the evolution of the high-order Hamiltonian. Through the simulation evolution of the high-order Hamiltonian matrix, the phase estimation module better approximates the eigenvalues of the coefficient matrix of the linear equation to be solved, and transmits the binary representation of the eigenvalues to the controlled rotation module to adjust the angle of the rotation gate. Finally, the measurement module counts the results of the simulation implementation circuit system and calculates the probability distribution to obtain the experimental solution of the linear equation to be solved. By calculating the fidelity and error between the experimental solution and the theoretical solution, the performance of the simulation implementation circuit system is evaluated. The verification of the entire simulation implementation circuit system in the present invention is based on the purpose of ensuring the accuracy of the calculation results. By calculating the probability distribution to obtain the experimental solution and comparing it with the theoretical analytical solution, this is to test the calculation results of all the previous steps and verify the reliability of the entire system. If the fidelity between the experimental solution and the theoretical analytical solution is high and the error is small, it indicates that the design and operation steps of the previous components are correct and effective. Otherwise, the system needs to be adjusted and optimized.

[0082] For each component of the simulation implementation circuit system, from the construction of the basic framework, data storage and preparation, core calculation steps to result verification, the design and operation of each component are based on specific causal relationships and cooperate closely to jointly achieve the solution of high-order linear equations on ordinary computers.

[0083] Example 6

[0084] The simulation implementation circuit system and method based on Hamiltonian simulation are the same as those in Embodiments 1-5. For the simulation evolution of the high-order Hamiltonian based on the module decomposition method and the construction function method, the high-order Hamiltonian simulation evolution is realized based on the module decomposition method. See Figure 5 Specifically, it includes the following steps:

[0085] 3.1.1. Customize quantum gate operations on specified qubits: Define one or more custom quantum operations for different qubits in the entire quantum main circuit. For the system of linear equations in the form of the tensor product of Pauli matrices and the identity matrix, add NOT gates and single-qubit rotation gates R rotating around the z-axis to three qubits in the target quantum register component in sequence according to the decomposition order of the sub-Hamiltonian. Z (), the rotation angle of which is determined according to the form of the matrix of the decomposed sub-Hamiltonian under the rotation gate. The above operations accept specific parameters (such as the power of the controlled operation and the position of the specified control qubit), and perform a series of quantum gate operations on the selected qubits, including single-qubit gates, controlled NOT gates, NOT gates, and phase rotation gates, to implement the corresponding sub-Hamiltonian simulation operations.

[0086] 3.1.2. Create a sub-circuit and encapsulate it into a composite gate: For Hamiltonian matrices with different powers, create a temporary sub-circuit in the simulation implementation circuit system that does not contain any specific units and components. Put the above-mentioned sequence of custom quantum basic gates into the sub-circuit in sequence, and use the Operator() instruction to encapsulate the custom operations on the sub-circuit into a circuit composite gate, and assign it a unique label CustomOperation{num} for easy identification and management.

[0087] 3.1.3. Transformation of controlled operations: By selecting the qubits in the phase estimation register component as control qubits and the qubits in the target register as target qubits, using gate.control(num_ctrl_qubits) in Qiskit, only the position of the control qubit needs to be specified to convert the above-mentioned custom circuit composite gate object into a controlled gate operation, so that when the control qubit is in a specific preset state, the custom basic gate operation will be executed, realizing the controlled gate operation.

[0088] 3.1.4. Realize multi-level control by specifying different powers: Realize the controlled gate operations with different powers of the coefficient matrix of the system of linear equations by specifying different power parameter values and different positions of the control qubits, realize the interaction terms between sub-Hamiltonians, and complete the simulation evolution of the Hamiltonian.

[0089] 3.1.5. Embed the above - constructed sub - circuit into the main circuit: Set the control qubits as different qubits in the phase - estimation register component, and together with the corresponding target qubits and the powers of the Hamiltonian matrix, pass them as parameters to the sub - circuit to achieve the distributed processing of complex Hamiltonian simulation operations. Embed the whole link into the phase - estimation module circuit to solve the linear equations to be solved.

[0090] The module - decomposition method simplifies the circuit design and simulation process by decomposing the complex Hamiltonian evolution circuit into sub - Hamiltonian modules acting on specific qubits according to the structure and characteristics of the Hamiltonian matrix. By constructing the corresponding quantum - gate operations for the sub - Hamiltonian modules acting on specific qubits, putting them into the sub - circuit and encapsulating them as gates, it realizes the management and control of the quantum - circuit structure, provides an effective method to handle large - scale quantum circuits, and reduces the demand for computing resources. When the traditional simulation method executes the same sub - Hamiltonian simulation operation multiple times, it needs to store the complete circuit structure each time, while the module - decomposition method only needs to store the sub - circuit structure once and uses it for different operations through a reuse mechanism, simplifying the complex calculation process.

[0091] The module - decomposition method realizes the simulation of different powers of the Hamiltonian on different qubits of a classical computer by changing the parameters of the quantum - gate sequence. During the process of creating and encapsulating the sub - circuit and controlling multiple qubits, the classical computer can accurately determine the structure of each sub - circuit, the selection of control qubits and target qubits according to the set rules and algorithms to achieve different - power controlled operations. Through the above steps, the module - decomposition method can extend the problem - solving of the HHL quantum algorithm to the solution of linear problems of all sparse Hermitian matrices represented in the form of tensor products.

[0092] Embodiment 7

[0093] The simulation implementation circuit system and method based on Hamiltonian simulation are the same as those in Embodiments 1 - 6. In step 3.2 of the present invention, the module - decomposition method and the construction - function method are used to simulate the evolution of high - order Hamiltonians. For the simulation evolution of high - order Hamiltonian simulation based on the construction - function method, see Figure 6 Specifically, it includes the following steps:

[0094] 3.2.1. Initialization of the basis matrix: For the coefficient matrix A of the linear equations to be solved, construct an 8 - order unit complex - number matrix U A as the basis matrix for subsequent iterative operations of different powers of the Hamiltonian matrix.

[0095] 3.2.2. Gradually iterate to obtain different - power operations of the matrix: By performing operations on the Hamiltonian matrix U APerform cyclic iteration and repeat num times (num is the power to be achieved) to obtain the Hamiltonian matrix corresponding to the power. In each iteration, the product with the current matrix is calculated using the evolution time τ of the quantum system and the number of qubits n in the phase estimation register, i.e., e -iAτ , and gradually accumulate to the required power k. This step is based on the computational theory of matrix exponentiation in linear algebra, especially the approximation method for the time evolution operator e -iHt .

[0096] 3.2.3. Specify control qubits to construct controlled gate operations: Further define a general function CU() to construct the matrix of the controlled-U gate operation under specific conditions. This function accepts the Hamiltonian matrix U A after different power operations as input. First, initialize a 16th-order complex identity matrix U, and place the matrix U A obtained by cyclic iteration in the lower right corner of U to form a 16th-order controlled-U operation. U A will only be applied to the target qubit when the control qubit is in a specific state (i.e., state 1). Then the function CU() can generate the corresponding controlled-U gate according to the input power matrix.

[0097] 3.2.4. Package the constructed controlled gate operation: Use the Operator class in Qiskit to create an operation corresponding to the above quantum general function, and then use the U.to_instruction() function to convert it into a quantum gate instruction. This operation packages the above controlled gate operation U, that is, instantiate an Operator object so that the controlled gate operation can be used as part of a quantum circuit.

[0098] 3.2.5. Integrate the constructed circuit into the main circuit: Integrate the sub-circuit corresponding to the controlled gate operation into the circuit design of the main circuit, and run the entire simulation implementation circuit system to solve the problem of the linear equations to be solved.

[0099] The construction function method defines a general function CU(), which accepts the Hamiltonian matrix U AAs the input, and calculate the Hamiltonian of different powers in a step-by-step cumulative manner; only one matrix multiplication operation is required in each loop, reducing the computational complexity from the relatively high complexity of directly calculating high powers to a relatively low level. Since the powers are calculated step by step, it is not necessary to store the complete matrices of all intermediate powers. Only the intermediate results of the current calculation need to be retained for the next iteration, reducing the storage pressure caused by storing a large number of intermediate matrices during high-power calculations, reducing the computational complexity of classical simulations, and improving the computational efficiency; calculating the Hamiltonian of the corresponding power by simply adjusting the number of loops, without the need to separately redesign the algorithm for each new power, making this method not limited by the matrix size and characteristics.

[0100] Example 8

[0101] The simulation implementation circuit system and method based on Hamiltonian simulation are the same as those in Embodiments 1-7. For the tensor product form of different Pauli matrices, considering that the linear equation system to be solved is an 8th-order Hermitian matrix linear equation system, its target register requires 3 qubits to store quantum states. Therefore, consider the tensor product form of 3 2D Pauli matrices. First, explore the tensor product cases of the identity matrix and different Pauli matrices. There are various combination ways here, including the tensor product of 1 identity matrix and 2 Pauli matrices, the tensor product of 2 identity matrices and 1 Pauli matrix, and the tensor product of 3 Pauli matrices, a total of 45 different forms. The Hamiltonian of the above forms can all be simulated by circuits. Next, deeply study the tensor product form of two identity matrices and the Pauli matrix σ x That is

[0102] According to the properties of the tensor product, we can get According to the evolution rule of the Hamiltonian And the relationship between the phase rotation gate and the diagonal Hamiltonian matrix, further disassemble the matrix of e -iXt Perform matrix disassembly Take the evolution time of the system as t = π, then the Hamiltonian simulation can be applied to the corresponding 3 qubits through a parallel strategy, and combined with the simulation of the Pauli matrix Hamiltonian on a single qubit, the corresponding quantum circuit construction diagram can be obtained. See Figure 7 , Figure 7 That is the schematic diagram of the Hamiltonian circuit of the Pauli matrix in the above different tensor product forms, where Figure 7 (a) is the schematic diagram of the Hamiltonian circuit corresponding to the matrix , Figure 7 (b) is the schematic diagram of the Hamiltonian circuit corresponding to the matrix , Figure 7 (c) is the schematic diagram of the Hamiltonian circuit corresponding to the matrix Schematic diagram of the corresponding Hamiltonian circuit. Specifically, this parallel processing allows the application of Hamiltonian evolution to multiple qubits simultaneously, and for each qubit, the local Hamiltonian represented by Pauli matrices can also be independently simulated. This method not only improves the parallelism of the simulation but also enables the capture of the interactions and dynamic behaviors within the system.

[0103] Based on this, select the tensor product form of another typical Pauli matrix for simulation. Then the Hamiltonian acting on 3 qubits is Take the evolution time of the system as t = π and perform the corresponding circuit simulation. Since there are interactions between the qubits corresponding to this matrix, its Hamiltonian involves all the qubits in the system. However, it can still be split using classical methods. If the parity of n qubits in the computational ground state is even, the phase shift applied to the sub-circuit is e -it , otherwise it is e it . Calculate the parity check result through 3 controlled-NOT gates in the target register component and store the result in an auxiliary qubit; then perform appropriate phase transformations according to the obtained parity check result, and finally perform the inverse operation on the entire circuit to remove the newly added auxiliary bit. Also, due to the relationship between Pauli matrices X = HZH, and there is Put the above decomposition and parity check process into the circuit diagram, then the circuit diagram of the complete Hamiltonian of matrix is obtained. See Figure 8 .

[0104] Solve the linear equations for the tensor product forms of different Pauli matrices. Consider the tensor product of 3 2D Pauli matrices and explore Hamiltonian simulations under various combination methods. Use the tensor product properties and Hamiltonian evolution rules, etc. to disassemble the relevant matrices to obtain the tensor product form of the sub-Hamiltonians, decompose the sub-Hamiltonians into sequences of basic quantum gates through the transformation relationship between Pauli matrices and phase rotation gates, and obtain the circuit diagram of the Hamiltonian through a parallel strategy. On this basis, perform the simulation on the tensor product form of , and use classical methods to disassemble and combine operations such as parity check to obtain the complete Hamiltonian circuit diagram.

[0105] Example 9

[0106] The simulation implementation circuit system and method based on Hamiltonian simulation are the same as those in Examples 1-8. The present invention uses the module decomposition method to simulate the evolution of high-order Hamiltonians and realizes the solution of the linear equations to be solved. Consider the tensor product form of Pauli matrices To solve it, first, use the circuit implementation of the Hamiltonian simulation in the form of tensor product described above as the circuit setup in the subcircuit. That is, add a working qubit to calculate the result of the parity check, and add corresponding quantum basic gates such as controlled-NOT gates and phase rotation gates to the control qubits to achieve the simulation of the sub-Hamiltonian in the form. Then, encapsulate the above subcircuit into a quantum composite gate. Set the qubits in the phase estimation register as the control qubits for the controlled gate operation, and the qubits in the target register component as the target qubits. And according to different control qubits, control different powers of the matrix in turn. Implement different power operations through a for loop. Then, put the constructed subcircuit into the entire main circuit.

[0107] First, select 13 qubits to perform circuit simulation on the entire simulation implementation circuit system. Also, because an additional working qubit is added to assist in the Hamiltonian simulation stage, there are a total of 14 qubits in the circuit, including 1 qubit in the auxiliary register component and 1 newly added working qubit, 3 qubits in the target register component, and 9 qubits in the phase estimation register component. See Figure 9 , Figure 9 for the quantum circuit diagram of the simulation implementation circuit system with 14 qubits. The circuit in the sub-operation Custom Operation{num} is the Hamiltonian circuit diagram of the matrix in the phase estimation module. Similarly, the circuit in the inverse sub-operation Uncompute Custom Operation{num} is the sub-Hamiltonian circuit in the inverse phase estimation module, that is, the reverse operation of the Hamiltonian circuit in the above phase estimation module.

[0108] Run the above constructed quantum circuit 100,000 times on the Qiskit simulation platform and then measure the simulation implementation circuit system. Consider the case of selecting specific qubits from the state vector of the entire quantum system to be in a specific state (that is, selecting the case where the auxiliary qubit is 1 after measurement), count the measurement results, and use the Matplotlib library to draw a statistical histogram. Obtain the experimental solution of the linear equations to be solved by calculating the probability distribution of the occurrence times of different results. At the same time, use the numpy.linalg.solve function in the numpy library to solve the linear equations to be solved using LU decomposition to obtain the theoretical analytical solution. See Figure 10 , Figure 10 (a) is the case of the matrix The count graph of the measurement results obtained after solving the linear equations, where the first bit of the 13-bit binary string on the abscissa represents the measurement result of the auxiliary qubit, the last 3 bits are the measurement results of the quantum state in the target register component, and the middle 9 bits are the measurement results of the quantum state in the corresponding phase estimation register component.

[0109] The theoretical analytical solution and the experimental solution of the linear equations to be solved are respectively normalized, that is

[0110]

[0111] where x is the normalized theoretical analytical solution, p is the normalized experimental solution. By calculating the fidelity and error between the experimental solution and the analytical solution, the fidelity of the linear equations to be solved under the condition of 14 qubits is 0.9998452789633938, and the error is 0.004398081668604836, which proves the feasibility of the module decomposition method for solving the linear equations under 14 qubits.

[0112] In order to improve the accuracy of eigenvalue estimation in the phase estimation module and make a comparison, the present invention additionally selects 20 qubits to simulate and implement the solution of the above-mentioned linear equations in the form of tensor product. Together with an additional 1 working qubit, there are a total of 21 qubits, including 1 qubit in the auxiliary register component and 1 newly added working qubit, 3 qubits in the target register component, and 16 qubits in the phase estimation register component. When constructing the simulation implementation circuit system of 21 qubits, the same gate construction method and rotation angle selection criteria as those of the 14-qubit circuit are adopted to ensure that the quantum circuit under 21 qubits is an extended graph of the circuit under 14 qubits.

[0113] After running the quantum circuit constructed under 21 qubits 100,000 times on the Qiskit simulation platform, the simulation implementation circuit system is measured, and the statistical histogram of the measurement results is drawn. See Figure 10 , Figure 10 (b) is the count graph of the measurement results after solving the linear equations of the matrix under 21 qubits, where the first bit of the 20-bit binary string on the abscissa represents the measurement result of the auxiliary qubit, the last 3 bits are the measurement results of the quantum state in the target register component, and the middle 16 bits are the corresponding measurement results of the quantum state in the phase estimation register component. By calculating the probability distribution of the measurement results, the experimental solution of the linear equations to be solved is obtained and normalized to be

[0114] p = [0.1241334, 0.12746036, 0.12457168, 0.12451191, 0.12315722, 0.12335644, 0.12710176, 0.12570723] T 。

[0115] The fidelity of the linear equation system of matrix under the condition of 21 qubits is calculated to be 0.9998540955910445, and the error is 0.004270914716985135.

[0116] When solving for the tensor product form of the Pauli matrices a working qubit is added to calculate the parity check result, and corresponding quantum basic gates such as controlled-NOT gates and phase rotation gates are added to the control qubits to realize the sub-circuit design of the sub-Hamiltonian. These sub-circuits are encapsulated into composite gates recognizable by the main circuit, operate according to different powers of the Hamiltonian matrix, and are integrated into the main circuit. The experimental verification shows that the same linear equation system is solved respectively in the simulation implementation circuit systems of 14 qubits and 21 qubits. After running through the Qiskit simulation platform and measuring the main circuit, high-fidelity and low-error results are obtained respectively, which proves the effectiveness and applicability of the simulation implementation circuit system. Moreover, as the number of qubits increases, the fidelity of the simulation implementation circuit system gets closer to 1 and the error is smaller, which fully shows that the circuit performance has been significantly improved and further verifies the effectiveness and applicability of the simulation implementation circuit system in solving higher-order linear equation systems.

[0117] Example 10

[0118] The simulation implementation circuit system and method based on Hamiltonian simulation are the same as those in Examples 1-9. The present invention uses the construction function method to simulate the evolution of the high-order Hamiltonian to realize the solution of the linear equation system to be solved. Considering the solution of the tensor product form of the Pauli matrices first, 13 qubits are selected to perform circuit simulation on the entire simulation implementation circuit system, including 1 qubit in the auxiliary register component, 3 qubits in the target register component, and 9 qubits in the phase estimation register component.

[0119] For the circuit design of the Hamiltonian matrix with different powers in the phase estimation module, the power of matrix A is calculated by repeatedly calculating the base matrix multiplied by exp(iA·2π / 512) to obtain the iterated Hamiltonian matrix U A , where 512 = 2 9This is because the number of qubits in the phase estimation register component is 9. The Hamiltonian matrix after iteration is used as the input of the function CU() to obtain the matrix corresponding to the controlled gate operation. This matrix corresponding to the controlled gate operation involves the control qubit and the target qubit. According to the power of the matrix, the control qubits are sequentially set to the qubits in the phase estimation register component, and the target qubit is set to the qubit in the target register component. When the control qubit is in a specific state, the corresponding Hamiltonian matrix will be applied to the target qubit. The Operator class of Qiskit is used to encapsulate this controlled matrix into a quantum operation, which converts the matrix form into a quantum operation object that can be processed. Through the U.to_instruction() function instruction, the above quantum operation object is converted into a quantum instruction that the circuit can process, and a name containing a power parameter is set for it for subsequent tracking and identification, which is convenient for distinguishing and managing different operations in the entire circuit system. The quantum instruction is encapsulated into a quantum composite gate and stored in the sub-circuit, and the sub-circuit is embedded into the phase estimation module in the main circuit to realize the estimation of the eigenvalues of the matrix. In the controlled rotation module, the unitary operator U representing the mapping λ can be represented in binary a controlled rotation on each qubit of which can be implemented within O(k) gates (where k is the number of qubits in the phase estimation register), and for consecutive qubits the rotation angles are halved successively, so the rotation angles are also halved successively in the linear equation system problem to be solved. See Figure 11 , Figure 11 which is the quantum circuit diagram of the simulation implementation circuit system with 13 qubits.

[0120] The quantum circuit constructed with 13 qubits is run 100,000 times on the Qiskit simulation platform, and then the simulation implementation circuit system is measured, and the statistical histogram of the measurement results is drawn. See Figure 12 (a), Figure 12 (a) is the result count diagram for solving the matrix with 13 qubits. The experimental solution of the linear equation system to be solved is obtained by calculating the probability distribution of the results, and the theoretical analytical solution of the linear equation system to be solved is obtained by using the numpy.linalg.solve function in the numpy library to perform LU decomposition. The experimental solution and the theoretical analytical solution are normalized respectively, and then we get

[0121]

[0122] Where x is the theoretically analytical solution after normalization, and p is the experimental solution after normalization. By calculating the fidelity and error between the experimental solution and the analytical solution, the fidelity of the linear equation system to be solved under the condition of 13 qubits is 0.99997926, and the error is 0.005988739433303134, which proves the feasibility of the construction function method in solving this linear equation system.

[0123] Similarly, in order to improve the estimation accuracy of eigenvalues in the phase estimation process, the present invention additionally selects 20 qubits for simulation implementation, including 1 auxiliary qubit, 3 qubits in the solution register, and 16 qubits in the phase estimation register. When constructing the quantum circuit diagram of 20 qubits, the same gate construction method and angle selection criteria as those of the 13-qubit circuit are adopted. That is, although the number of qubits increases, the core design principles and algorithm logics remain consistent, ensuring a smooth transition and expansion from 13 qubits to 20 qubits. On the other hand, this also illustrates the universality of the classical simulation scheme of the simulation implementation circuit system proposed in this paper.

[0124] Conduct circuit simulation on it. The normalized experimental solution of the linear equation system of the matrix under 20 qubits is p = [0.1247, 0.1268, 0.126275, 0.1256, 0.1253, 0.124325, 0.123425, 0.123975] T .

[0125] See Figure 12 (b), Figure 12 (b) is the count diagram of the measurement results of the linear equation system for solving the matrix under the condition of 20 qubits. The fidelity of this linear equation system under the condition of 20 qubits is 0.99998536, and the error is 0.0027069170655932644.

[0126] Based on two different methods, namely the module decomposition method and the construction function method, the simulation evolution of the Hamiltonian is carried out. The present invention respectively conducts simulation implementation on the solution problems of different 8th-order Hermitian matrices and explores their performances with different numbers of qubits. Figure 10 And Figure 12 The data show that with the increase in the number of qubits, the effect of solving the linear equation system is significantly improved, the fidelity will be closer to 1, and the error will be closer to 0. The essential reason is that the increase in the number of qubits will improve the estimation accuracy of eigenvalues in the phase estimation process. See Figure 9 And Figure 11It can be seen that both the module decomposition method and the construction function method can effectively simulate the evolution of the Hamiltonian. Especially under the module decomposition method, the fidelity is higher. In addition, by simulating Hermitian matrices in different tensor product forms, the feasibility of the present invention in solving the problem of large matrix linear equations (QLSP) is verified again.

[0127] In summary, the present invention is a simulation implementation circuit system and method based on Hamiltonian simulation, which solves the problem of Hamiltonian simulation in the solution of high-order linear equations by the high-order HHL algorithm. The simulation implementation circuit system based on Hamiltonian simulation is used to solve the linear equations to be solved, and is successively connected with: an input quantum state module, a phase estimation module, a controlled rotation module, an inverse phase estimation module, and a measurement module. The linear equations to be solved in the present invention are 8th-order Hermitian matrix linear equations; in the input quantum state module, a hybrid operation unit of Hadamard gates and controlled-NOT gates is provided between the system initial quantum state unit and the quantum state basic unit capable of storing vector b, so as to realize a uniformly superposed quantum entangled state presented in the form of a tensor product. The Hamiltonian simulation evolution link in the phase estimation module of the present invention is a high-order Hamiltonian simulation evolution link based on the module decomposition method and the construction function method. In this link, the Hamiltonian matrix of any power is analyzed, decomposed, and reconstructed into multiple smaller sub-Hamiltonians, that is, the evolution of the simulated sub-Hamiltonians is carried out. Special sub-circuits are designed for each sub-Hamiltonian, and a unique identifier Custom Operation{num} is given to ensure tracking management, and the sub-circuits are set as controlled gates, and the sub-Hamiltonians corresponding to the control qubits are selectively executed according to the states of the control qubits in the controlled gates, so as to realize the control mechanism of multiple qubits; there is also a high-order Hamiltonian simulation evolution link based on the module decomposition method and the construction function method in the inverse phase estimation module, that is, a high-order Hamiltonian evolution link with the same structure and opposite direction as the high-order Hamiltonian simulation evolution link in the phase estimation module. Generally, the quantum solution of an 8×8 dimensional linear equation system is realized on an ordinary classical computer without relying on a high-performance computing platform. The simulation implementation method based on Hamiltonian simulation of the present invention successively executes the following steps: constructing a simulation implementation circuit system based on Hamiltonian simulation; making initial preparations for the linear equations to be solved; simulating the evolution of the high-order Hamiltonian based on the module decomposition method and the construction function method; constructing a sub-circuit of the controlled gate and embedding it into the main circuit; running and measuring the main circuit and calculating the results; and verifying the entire simulation implementation circuit system. In the simulation implementation of the HHL quantum algorithm on a classical computer, the present invention combines linear algebra methods, proposes the module construction method and the construction function method, and approximately simulates the Hamiltonian evolution of the Hermitian matrix, solves the problems of low circuit solution performance and efficiency and high circuit complexity caused by the difficulty of decomposing the corresponding Hamiltonian into a basic gate sequence, verifies the applicability of the HHL quantum algorithm in the solution of high-order linear equations, and reduces the circuit depth on the premise of ensuring the circuit fidelity, and improves the performance and efficiency of circuit simulation. The present invention is applied to scientific engineering fields, such as physical simulation in molecular dynamics, data fitting in machine learning, etc.

Claims

1. A simulation circuit system based on Hamiltonian simulation is used to solve a linear equation group to be solved, and is connected in sequence: an input quantum state module, a phase estimation module, a controlled rotation module, an inverse phase estimation module, and a measurement module; the input quantum state module is connected in sequence with a system initial quantum state unit, a target register component, and a quantum state basic unit capable of storing a vector b, and in the target register component, a quantum gate operation is constructed in the main circuit so that the selected quantum bit can store a preset vector b and transmit it to the phase estimation module; the phase estimation module is connected in sequence with a phase estimation register component, a Hadamard transformation link, a Hamiltonian simulation evolution link, an inverse quantum Fourier transformation link, and a target register component; the controlled rotation module includes an auxiliary register component, a controlled rotation link, and a phase estimation register component. The control end is connected to the quantum bit of the phase estimation register, and the target end acts on the quantum bit of the auxiliary register. By adjusting the rotation angle of the rotating gate, the auxiliary quantum bit is controlled to rotate and the processed quantum state is transmitted to the inverse phase estimation module; the inverse phase estimation module is sequentially connected to the phase estimation register component, the quantum Fourier transform link, the Hamiltonian simulation evolution link, the Hadamard transform link, and the target register component, reverses the changes introduced in the previous phase estimation module, restores the system to a preset state and transmits it to the measurement module; the measurement module receives the quantum state from the inverse phase estimation module, extracts classical information from it, and measures the entire simulation circuit system to collapse the quantum state in the target register to a specific classical result, and counts the results to obtain an approximate solution to the entire linear equation group to be solved; it is characterized in that The linear equations to be solved are 8th-order Hermitian matrix linear equations; in the input quantum state module, a mixed operation unit of a Hadamard gate and a controlled NOT gate is provided between the system initial quantum state unit and the quantum state basic unit capable of storing the vector b, so as to realize a uniform superposition quantum entangled state presented in the form of a tensor product; the Hamiltonian simulation evolution link in the phase estimation module is a high-order Hamiltonian simulation evolution link based on a module decomposition method and a construction function method, in which the Hamiltonian matrix of any power is analyzed, decomposed and reconstructed into a plurality of smaller sub-Hamiltonians, i.e., the evolution of the sub-Hamiltonians is simulated, and a special sub-circuit is designed for each sub-Hamiltonian, and a unique identifier Custom is assigned. Operation{num} is used to ensure tracking management, and the sub-circuit is set as a controlled gate. According to the state of the control quantum bit in the controlled gate, the sub-Hamiltonian corresponding to the control quantum bit is selectively executed to realize the control mechanism of multiple quantum bits. In the inverse phase estimation module, there is also a high-order Hamiltonian simulation evolution link based on the module decomposition method and the construction function method, that is, a high-order Hamiltonian evolution link with the same structure and opposite direction as the high-order Hamiltonian simulation evolution link in the phase estimation module. Overall, the quantum solution of the 8×8 dimensional linear equations is realized on an ordinary classical computer without relying on a high-performance computing platform.

2. The circuit system for realizing the simulation based on Hamiltonian simulation according to claim 1, characterized in that: In the high-order Hamiltonian simulation evolution link based on the module decomposition method and the construction function method in the phase estimation module, the quantum bits of the phase estimation register component are called as control quantum bits in this evolution link and Hamiltonian matrices of different powers are applied to the quantum bits in the target register component. In order to realize the Hamiltonian simulation operation of different powers, firstly, for the linear equations to be solved, the exponential function of its coefficient matrix is ​​calculated according to the different evolution times of the system as the Hamiltonian matrix of different powers, and then the form of the matrix is ​​analyzed to decompose it into the tensor product form of the sub-Hamiltonian, and decomposed into a 2nd-order sub-Hamiltonian; for the sub-Hamiltonian acting on different quantum bits, the quantum gate is customized, and according to the conversion relationship between the phase rotation gate and the Pauli matrix, a series of basic quantum gates are added to the customization, including single quantum bit gates, CNOT gates, NOT gates, and phase rotation gates. These quantum gates accept specific parameters, and the specific parameters are the power index of the controlled U gate and the location of the specified quantum bit. By combining these basic quantum gate sequences, the evolution behavior of the sub-Hamiltonian is simulated.

3. The circuit system for realizing the simulation based on Hamiltonian simulation according to claim 1 or 2, characterized in that: The evolution of the simulated sub-Hamiltonian in the phase estimation module is based on the modular decomposition method and the construction function method. The corresponding sub-circuit is constructed for different sub-Hamiltonians. The relationship between the phase rotation gate and the diagonal Hamiltonian matrix is ​​diag[e -it ,e it ]=R Z (2t) = XR Z (-t)XR Z (t) Determine the corresponding basic quantum gate sequence, and at the same time, control the Hamiltonian operations of different powers in turn according to the different quantum bits of the phase estimation register component in the phase estimation module to determine the positions of the control quantum bits and the corresponding target quantum bits required in the controlled operation of the sub-circuit and the corresponding power index, and ensure that the fidelity between the calculation matrix and the corresponding Hamiltonian simulation circuit is close to 1 to ensure that the sub-circuit fragments are accurately mapped to the controlled operations on a single or multiple quantum bits acting on the target register component; and restrict the topological structure of these sub-Hamiltonian components and the operations of different controlled gates, simplify the original complex multi-qubit interaction process, and realize the evolution of the sub-Hamiltonian in the simulation circuit system; integrate the sub-circuit corresponding to the above sub-Hamiltonian into the main circuit to solve the 8th-order linear equation group to be solved.

4. The circuit system for realizing the simulation based on Hamiltonian simulation according to claim 1, characterized in that: The input quantum state module provides the phase estimation module with the quantum state basic unit of the storable vector b in the linear equation group to be solved. First, the column vector and coefficient matrix corresponding to the given linear equation group are received, and the mathematical structure and characteristics thereof are analyzed. The classical information is represented in the form of quantum ground states |0> and |1> through a basis coding mechanism, i.e., a digital coding mechanism; a mapping from the initial quantum state unit of the system to the quantum state basic unit of the storable vector b is found, and the mapping is disassembled into a suitable quantum gate operation sequence, in which an operation combination of a Hadamard gate and a controlled NOT gate is applied. By applying a Hadamard gate to each quantum bit, a quantum superposition state in which the probability of each quantum bit being 0 and 1 is equal can be obtained, and then a controlled NOT gate is used to change the state of the selected quantum bit, i.e., a simulation circuit system is allowed to gradually construct a complex quantum entangled state.

5. A simulation implementation method based on Hamiltonian simulation, implemented on the simulation implementation circuit system based on Hamiltonian simulation according to claims 1-4, characterized in that: The modular decomposition method or the construction function method is used to simulate the evolution of the Hamiltonian of the high-order sparse matrix to solve the linear equations of the 8th-order Hermitian matrix, including the following steps: Step 1: Construct a simulation implementation circuit system based on Hamiltonian simulation: The constructed simulation implementation circuit system based on Hamiltonian simulation solves the linear equations of the Hermitian matrix to be solved, and is connected in sequence: input quantum state module, phase estimation module, controlled rotation module, inverse phase estimation module, measurement module; the input quantum state module is connected in sequence with the system initial quantum state unit, target register component, and quantum state basic unit that can store vector b. In the target register component, by constructing quantum gate operation in the main circuit, the selected quantum bit can store the preset vector b and transmit it to the phase estimation module; the phase estimation module is connected in sequence with the phase estimation register component, Hadamard transform link, Hamiltonian simulation evolution link, inverse quantum Fourier transform link, and target register component; the controlled rotation module includes an auxiliary register group The control end is connected to the quantum bit of the phase estimation register, and the target end acts on the quantum bit of the auxiliary register. By adjusting the rotation angle of the rotating door, the auxiliary quantum bit is controlled to rotate and the processed quantum state is transmitted to the inverse phase estimation module; the inverse phase estimation module is sequentially connected to the phase estimation register component, the quantum Fourier transform link, the Hamiltonian simulation evolution link, the Hadamard transform link, and the target register component, reverses the changes introduced in the previous phase estimation module, restores the system to a preset state and transmits it to the measurement module; the measurement module receives the quantum state from the inverse phase estimation module, extracts classical information from it, and measures the entire simulation circuit system to collapse the quantum state in the target register to a specific classical result, so that the approximate solution of the entire linear equation group to be solved can be obtained; The key is that the linear equations to be solved are linear equations of 8th-order Hermitian matrices; in the input quantum state module, a mixed operation unit of a Hadamard gate and a controlled NOT gate is provided between the system initial quantum state unit and the quantum state basic unit that can store the vector b, so as to realize a uniform superposition quantum entangled state presented in the form of a tensor product; the Hamiltonian simulation evolution link in the phase estimation module is a high-order Hamiltonian simulation evolution link based on the module decomposition method and the construction function method, in which the Hamiltonian matrix of any power is analyzed, decomposed and reconstructed into multiple smaller sub-Hamiltonians, that is, the evolution of the sub-Hamiltonians is simulated, and a special sub-circuit is designed for each sub-Hamiltonian, and a unique identifier Custom is assigned. Operation{num} is used to ensure tracking management, and the sub-circuit is set as a controlled gate. According to the state of the control quantum bit in the controlled gate, the sub-Hamiltonian corresponding to the control quantum bit is selectively executed to realize the control mechanism of multiple quantum bits. In the inverse phase estimation module, there is also a high-order Hamiltonian simulation evolution link based on the module decomposition method and the construction function method, that is, a high-order Hamiltonian evolution link with the same structure and opposite direction as the high-order Hamiltonian simulation evolution link in the phase estimation module. Overall, the quantum solution of the 8×8 dimensional linear equations to be solved is realized on an ordinary classical computer without relying on a high-performance computing platform. In the above-mentioned simulation implementation circuit system, a basic main circuit framework without any specific units and components is constructed, and three quantum register components are added, namely, an auxiliary register component, a phase estimation register component and a target register component, wherein the auxiliary register component is used to store auxiliary quantum bits, the phase estimation register component is used to store the binary representation of the eigenvalues ​​of the coefficient matrix A, and the target register component is used to store the column vector |b> of the input linear equation group to be solved and the solution vector |x> of the equation group. The three quantum register components are initially set to the system initial quantum state unit |0>; Step 2: Make initial preparations for the linear equations to be solved: The linear equations to be solved are linear equations of 8th-order Hermitian matrices. Select Hermitian matrices in the form of tensor products of different Pauli matrices and unit matrices as the coefficient matrices of the linear equations to be solved. For the selection of column vectors of the linear equations to be solved, select a uniform quantum entangled state in the input quantum state module. As the column vector of the linear equation group, when the three quantum bits in the target register component are in a superposition state with equal probability, the entangled state can be obtained. Then, the mapping between the initial quantum state unit of the system and the uniform quantum entangled state can be realized by acting on each quantum bit in the target register component with a Hadamard gate and a controlled NOT gate, and the theoretical analytical solution of the linear equation group to be solved is calculated by LU decomposition. Step 3: Simulate the evolution of the high-order Hamiltonian based on the modular decomposition method and the building function method: In the phase estimation module, the high-order Hamiltonian simulation evolution link based on the modular decomposition method and the building function method first initializes an 8th-order unit complex matrix U A As the basis matrix, the Hamiltonian matrix of different powers is obtained by cyclically iterating the exponential function of the coefficient matrix of the linear equations to be solved, and the Hamiltonian matrix is ​​decomposed into the product of the unitary matrix and the diagonal matrix according to the evolution rule of the Hamiltonian matrix. The power parameters of the sub-Hamiltonian and the designation of the quantum bit position are obtained by the modular decomposition method and the construction function method respectively, so as to simulate the evolution of the sub-Hamiltonian; Step 3.1: Use the modular decomposition method to simulate the evolution of the sub-Hamiltonian. According to the transformation relationship between the Hamiltonian matrix of the phase rotation gate and the diagonal matrix, the sub-Hamiltonian in the form of the tensor product of the Pauli matrix is ​​correspondingly disassembled to identify the basic quantum gate sequence that can directly act on the specific target quantum bit in the target register, which corresponds to the interaction terms between different quantum bits in the simulation circuit system; Step 3.2: Use the construction function method to simulate the evolution of the sub-Hamiltonian. First, define a function CU() to construct a controlled U-gate operation matrix under specific conditions. This function receives the Hamiltonian matrix after different power operations as input and embeds it into a complex unit matrix of a larger dimension to form a 16-order controlled Hamiltonian matrix to simulate the evolution behavior of the sub-Hamiltonian. Step 4: Construct a subcircuit of controlled gates and embed it into the main circuit: Create a temporary subcircuit in the main circuit to store the above-mentioned custom quantum gate sequence. The subcircuit accepts the basic quantum gate sequence corresponding to the sub-Hamiltonian and the required parameters, and executes a series of quantum gate sequences including controlled NOT gates, NOT gates and phase rotation gates on the specified quantum bits to realize the simulated evolution of the sub-Hamiltonian; encapsulate the custom quantum gate sequence on the subcircuit into a composite gate and assign it a label Custom Operation{num}, where num represents the corresponding power parameter of the sub-Hamiltonian matrix; after completing all necessary subcircuit designs, integrate all designed subcircuits into the main circuit, set the control quantum bit as the quantum bit in the phase estimation register component, and pass it together with the target quantum bit as a parameter to the corresponding subcircuit to ensure that each subcircuit can correctly receive and process this information; Step 5: Run the measurement main circuit and calculate the results: Run the above integrated main circuit in Python, measure the state of the quantum bits of the entire simulation circuit system in the measurement module to obtain the corresponding different classical results, count the results, and calculate the probability distribution of the results to obtain the experimental solution of the linear equations to be solved; Step 6: Verify the entire simulation circuit system: Measure the accuracy of the simulation circuit system by comparing the fidelity between the experimental solution and the theoretical analytical solution, and analyze the difference by calculating the error evaluation algorithm between the experimental solution and the analytical solution to ensure the reliability of quantum operations.

6. The simulation implementation method based on Hamiltonian simulation according to claim 5 is characterized in that: The high-order Hamiltonian is simulated and evolved based on the modular decomposition method and the construction function method described in step 3, wherein the high-order Hamiltonian simulated evolution is realized based on the modular decomposition method, specifically including the following steps: 3.1.

1. Customize quantum gate operations on specified qubits: define one or more custom quantum operations for different qubits in the entire quantum main circuit. For the linear equations in the form of tensor product of Pauli matrix and identity matrix, add NOT gate and single quantum rotation gate R rotating around z axis to the three qubits in the target quantum register component according to the decomposition order of sub-Hamiltonian. Z (), whose rotation angle is determined according to the form of the matrix of the decomposed sub-Hamiltonian under the rotation gate. The above operations accept specific parameters and perform a series of quantum gate operations on the selected quantum bits, including single-qubit gates, controlled NOT gates, NOT gates, and phase rotation gates, to achieve the corresponding sub-Hamiltonian simulation operations; 3.1.

2. Create a subcircuit and encapsulate it into a composite gate: For Hamiltonian matrices of different powers, create a temporary subcircuit that does not contain any specific units and components in the simulation implementation circuit system, put the above-mentioned custom quantum basic gate operations into the subcircuit in sequence, and encapsulate the custom operations on the subcircuit into a circuit composite gate, and assign it a unique label Custom Operation{num} for easy identification and management; 3.1.

3. Conversion of controlled operations: By selecting the qubits in the phase estimation register component as control qubits and the qubits in the target register as target qubits, the gate.control() function in Qiskit is used to convert the above-mentioned custom circuit compound gate into a controlled gate operation, so that when the control qubit is in a specific preset state, the custom basic gate operation will be executed, thus realizing the controlled gate operation; 3.1.

4. Realize multi-level control by specifying different powers: By specifying different power parameter values ​​and different control qubits, the controlled gate operations of different powers of the coefficient matrix of the linear equations are realized, the interaction terms between the sub-Hamiltonians are realized, and the simulated evolution of the Hamiltonian is completed; 3.1.

5. Embed the above-constructed sub-circuit into the main circuit: set the control quantum bit to different quantum bits in the phase estimation register, and pass it to the sub-circuit as parameters together with the corresponding target quantum bit and the power of the Hamiltonian matrix, so as to realize the distributed processing of complex Hamiltonian simulation operations, embed the whole link into the phase estimation module circuit, and realize the solution of the linear equations to be solved.

7. The simulation implementation method based on Hamiltonian simulation according to claim 5 is characterized in that: The simulation evolution of the high-order Hamiltonian based on the modular decomposition method and the construction function method described in step 3.2, wherein the simulation evolution of the high-order Hamiltonian simulation based on the construction function method specifically includes the following steps: 3.2.

1. Initialization of the basis matrix: For the coefficient matrix A of the linear equations to be solved, construct an 8th-order unit complex matrix U A As the basis matrix, it is used to subsequently iterate the Hamiltonian matrix of different powers; 3.2.

2. Step by step iteration to obtain different power operations of the matrix: By A Perform a loop iteration, repeat num times (num is the power to be achieved) to obtain the Hamiltonian matrix of the corresponding power, where the evolution time τ of the quantum system and the number of quantum bits n in the phase estimation register are used in each iteration to calculate the product with the current matrix, that is, e -iAτ , gradually accumulated to the required power k; 3.2.

3. Specify the control qubit to construct the controlled gate operation: further define a general function CU() to construct the controlled U gate operation matrix under specific conditions. This function accepts the Hamiltonian matrix U after different power operations. A As input, first initialize a 16-order complex identity matrix U, and iterate the matrix U A Placed in the lower right corner of U, forming a 16-order controlled U Operation, when controlling the quantum bit to a specific state (i.e. state | 1 >) U A Only then will it be applied to the target quantum bit; 3.2.

4. Encapsulate the constructed controlled gate operation: Use the Operator class in Qiskit to create an operation corresponding to the above quantum universal function and then convert it into a quantum gate instruction. This operation encapsulates the above controlled gate operation U, that is, instantiate an Operator object so that the controlled gate operation can be used as part of the quantum circuit; 3.2.

5. Integrate the constructed circuit into the main circuit: embed the sub-circuit corresponding to the controlled gate operation into the main circuit, and run the circuit system for the entire simulation to solve the linear equation problem to be solved.

Citation Information

Cited By

  • Flow field evolution method and device based on quantum calculation and vortex representation

    CN121168690A