Target system energy calculation method and device and storage medium
By determining the target density matrix in quantum chemistry calculation, the problem of density matrix selection in the prior art affecting the calculation accuracy is solved, and a higher precision target system energy calculation is achieved, which is suitable for quantum computing simulation of complex systems.
Patent Information
- Application Number
- CN202311198193.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-15
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2043-09-15
AI Technical Summary
In the prior art, before running the VQE algorithm using quantum chemocomputing software, obtaining the Hamiltonian operator of the target system requires an initial density matrix. The selection of the density matrix directly affects the calculation process and calculation accuracy, and an inappropriate density matrix may cause the calculation process to fail to converge.
By determining the Fock matrix based on the electronic integral and the initial density matrix in the target system to be simulated, and performing iterative operations on the initial density matrix until the density matrix difference meets the preset accuracy during the iteration process, the target density matrix is determined, and the target system energy is then calculated.
It improves the calculation accuracy of the energy of the target system, is suitable for quantum computing simulation of complex systems, and promotes the development of quantum chemical simulation applications.
Smart Images

Figure CN119647614A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of quantum computing technology, and in particular to a method, device and storage medium for calculating the energy of a target system. Background Art
[0002] Quantum computers are physical devices that follow the laws of quantum mechanics to perform high-speed mathematical and logical operations, store and process quantum information. When a device processes and calculates quantum information and runs quantum algorithms, it is a quantum computer. Quantum computers have become a key technology under research because they have the ability to process mathematical problems more efficiently than ordinary computers. For example, they can speed up the time to crack RSA keys from hundreds of years to a few hours.
[0003] Quantum computing simulation is a simulation that uses numerical calculations and computer science to simulate calculations that follow the laws of quantum mechanics. As a simulation program, it uses the basic laws of quantum bits in quantum mechanics and the high-speed computing power of computers to characterize the spatiotemporal evolution of quantum states.
[0004] With the continuous improvement of quantum chemistry theory, computational chemistry has become an important tool for chemists to explain experimental phenomena, predict experimental results, and guide experimental design. It has been widely used in drug synthesis, catalyst preparation, and other aspects.
[0005] In the prior art, before using quantum chemical calculation software to run the VQE algorithm, it is an important step to obtain the Hamiltonian operator of the target system. For example, quantum chemical calculation software uses the HF method to calculate the Hamiltonian of the target system, which requires an initial density matrix, i.e., the initial guess of the density matrix. It should be noted that the choice of density matrix directly affects the calculation process and calculation accuracy, and an inappropriate density matrix often causes the calculation process of the target system to fail to converge. Therefore, how to select and determine a suitable density matrix, and then calculate the energy of the target system, has become a problem that needs to be solved urgently. Summary of the invention
[0006] The purpose of the present invention is to provide a method, device and storage medium for calculating the energy of a target system to address the deficiencies in the prior art. The method determines a target density matrix and calculates the energy of the target system, thereby improving the calculation accuracy of the energy of the target system. The method is suitable for quantum computing simulation of complex systems and further promotes the development of quantum chemical simulation applications.
[0007] An embodiment of the present application provides a method for calculating the energy of a target system, the method comprising:
[0008] Determine the Fock matrix based on the electron integral in the target system to be simulated and the initial density matrix;
[0009] According to the Fock matrix, an iterative operation is performed on the initial density matrix until the difference between the density matrices obtained twice before and after the iteration meets the preset accuracy, and the current density matrix obtained the last time is used as the target density matrix;
[0010] Based on the obtained target density matrix, the energy of the target system to be simulated is calculated.
[0011] Optionally, determining the Fock matrix according to the electron integral in the target system to be simulated and the initial density matrix includes:
[0012] The Fock matrix is determined by the following formula:
[0013]
[0014] in, is the Fock matrix, σ is the spin channel, H pq Determined from the derivative of the electron integral with respect to the initial density matrix, J pq is the Coulomb matrix, satisfying J pq =∑ μv P μv (μν|pq), (μν|pq) is the electron integral tensor, P μv is the initial density matrix, a and b are hybridization coefficients, is a switching matrix that satisfies It is determined by the derivative of the exchange-correlation energy of the target system with respect to the initial density matrix.
[0015] Optionally, before determining the Fock matrix according to the electron integral in the target system to be simulated and the initial density matrix, the method further includes:
[0016] Obtain the first overlap matrix S of the target system to be simulated, and calculate the second overlap matrix corresponding to the first overlap matrix S
[0017] Optionally, performing an iterative operation on the initial density matrix according to the Fock matrix until a difference between the density matrices obtained twice before and after the iteration meets a preset accuracy, and taking the current density matrix obtained the last time as the target density matrix, includes:
[0018] The current density matrix is determined by the following formula:
[0019]
[0020] Among them, P pq is the current density matrix, r is the cyclic subscript, n is the number of electron orbitals, cpr is the p-th row and r-th column component of the c matrix, c qr is the qth row and rth column component of the c matrix, c pr or c qr Determined according to the second overlap matrix, satisfying c r is the reduced eigenvector matrix.
[0021] Optionally, calculating the energy of the target system to be simulated based on the obtained target density matrix includes:
[0022] The energy of the target system to be simulated is calculated by the following formula:
[0023] E=E XC +E K +E nuc +E H
[0024] Wherein, E is the energy of the target system to be simulated, E XC is the exchange-correlation energy of the target system to be simulated, E K is the kinetic energy of the target system to be simulated, E nuc is the repulsive energy of the target system to be simulated, E H is the Hartree Fock energy of the target system to be simulated; and E XC =∑ p W p ρ p Z p , W is the integral grid weight vector, ρ is the electron density of the target system to be simulated, Z p is the exchange-correlation energy term obtained from the universal function, is the kinetic energy term of the single electron integral A, is the potential energy term of the single electron integral A, and satisfies
[0025] Optionally, after calculating the energy of the target system to be simulated based on the obtained target density matrix, the method further includes:
[0026] According to the energy of the target system to be simulated currently obtained, judging whether the difference between the energy currently obtained and the energy previously obtained meets the accuracy;
[0027] If so, the energy of the target system to be simulated currently obtained is used as the energy of the target system to be simulated; otherwise, the target density matrix is updated, the energy corresponding to the updated target density matrix is calculated, and the step of determining whether the difference between the current energy and the previously obtained energy meets the accuracy is continued.
[0028] Another embodiment of the present application provides a device for calculating target system energy, the device comprising:
[0029] A determination module, used for determining a Fock matrix according to an electron integral in a target system to be simulated and an initial density matrix;
[0030] An iteration module is used to perform an iterative operation on the initial density matrix according to the Fock matrix until the difference between the density matrices obtained twice before and after the iteration meets the preset accuracy, and the current density matrix obtained the last time is used as the target density matrix;
[0031] A calculation module is used to calculate the energy of the target system to be simulated based on the obtained target density matrix.
[0032] An embodiment of the present application provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute any of the above methods when running.
[0033] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute any one of the methods described above.
[0034] Yet another embodiment of the present application provides a quantum computer operating system, which implements a method for calculating the energy of a target system according to any of the methods described above.
[0035] Compared with the prior art, the present invention first determines the Fock matrix according to the electron integral in the target system to be simulated and the initial density matrix, and then performs an iterative operation on the initial density matrix according to the Fock matrix, until the difference between the density matrices obtained twice before and after the iteration meets the preset accuracy, and then uses the current density matrix obtained the last time as the target density matrix, and finally calculates the energy of the target system to be simulated based on the obtained target density matrix. It determines the target density matrix and calculates the energy of the target system, thereby improving the calculation accuracy of the energy of the target system, which is suitable for quantum computing simulation of complex systems and further promotes the development of quantum chemical simulation applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1It is a system network block diagram corresponding to a method for calculating target system energy provided by an embodiment of the present invention;
[0037] Figure 2 is a flow chart of a method for calculating energy of a target system provided by an embodiment of the present invention;
[0038] Figure 3 It is a schematic diagram of the structure of a device for calculating target system energy provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0039] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, but should not be construed as limiting the present invention.
[0040] The embodiment of the present invention first provides a method for calculating the energy of a target system. The method can be applied to electronic devices, such as computer terminals, specifically ordinary computers, quantum computers, etc.
[0041] The following describes it in detail by taking running on a computer terminal as an example. Figure 1 1 is a system network block diagram corresponding to a method for calculating target system energy provided by an embodiment of the present invention. The system corresponding to the method for calculating target system energy may include a network 110, a server 120, a wireless device 130, a client 140, a storage unit 150, a classical processing system 160, a quantum processing system 170, and may also include additional memories, classical processors, quantum processors, and other devices not shown.
[0042] The network 110 is a medium for providing communication links between various devices and computers connected together in the system corresponding to the target system energy calculation method, including but not limited to the Internet, corporate intranet, local area network, mobile communication network and their combination. The connection method can be wired, wireless communication links or optical fiber cables.
[0043] The server 120 and the client 140 are conventional data processing systems that may contain data and applications or software tools that perform conventional computing processes. The client 140 may be a personal computer or a network computer, so the data may also be provided by the server 120. The wireless device 130 may be a smart phone, a tablet, a laptop, a smart wearable device, etc. The storage unit 150 may include a database 151, which may be configured to store data such as quantum bit parameters, quantum logic gate parameters, quantum circuits, quantum programs, etc.
[0044] The classical processing system 160 (quantum processing system 170) may include a classical processor 161 (quantum processor 171) for processing classical data (quantum data) and a memory 163 (memory 172) for storing classical data (quantum data). The classical data (quantum data) may be a boot file, an operating system image, and an application 162 (application 173). The application 162 (application 173) may be used to implement a quantum algorithm compiled according to a method for calculating the energy of a target system provided in an embodiment of the present invention.
[0045] Any data or information stored or generated in the classical processing system 160 (quantum processing system 170) can also be configured to be stored or generated in another classical (quantum) processing system in a similar manner, and any application program executed by it can also be configured to be executed in another classical (quantum) processing system in a similar manner.
[0046] It should be noted that a true quantum computer is a hybrid structure, which includes at least Figure 1 There are two major parts in it: the classical processing system 160, which is responsible for performing classical calculations and control; and the quantum processing system 170, which is responsible for running quantum programs and thus realizing quantum calculations.
[0047] The classical processing system 160 and the quantum processing system 170 may be integrated into one device or distributed in two different devices. For example, the first device including the classical processing system 160 runs a classical computer operating system, on which quantum application development tools and services are provided, as well as storage and network services required for quantum applications. Users develop quantum applications through the quantum application development tools and services thereon, and send quantum programs to the second device including the quantum processing system 170 through the network services thereon. The second device runs a quantum computer operating system, parses the code of the quantum program through the quantum computer operating system, and compiles it into instructions that can be recognized and executed by the quantum computer measurement and control system. The quantum processor 170 implements the quantum algorithm corresponding to the quantum program according to the instructions.
[0048] In the classic processing system 160 based on silicon chips, the unit of the classic processor 161 is a CMOS tube. This computing unit is not limited by time and coherence, that is, this computing unit is not limited by the length of use and is available at any time. In addition, in the silicon chip, the number of such computing units is also sufficient. At present, the number of computing units in a classic processor is tens of thousands. The number of computing units is sufficient and the computing logic that can be selected by the CMOS tube is fixed, for example: AND logic. When calculating with the help of CMOS tubes, a large number of CMOS tubes are combined with limited logic functions to achieve the calculation effect.
[0049] Unlike this logic unit in the classical processing system 160, the basic computing unit of the quantum processor 171 in the quantum processing system 170 is a quantum bit, and the input of the quantum bit is limited by coherence and coherence time, that is, the quantum bit is limited by the use time and is not available at any time. Making full use of the quantum bit within the available use time of the quantum bit is a key problem in quantum computing. In addition, the number of quantum bits in a quantum computer is one of the representative indicators of the performance of a quantum computer. Each quantum bit realizes the computing function through the logical function configured on demand. In view of the limited number of quantum bits, the logical functions in the field of quantum computing are diverse, such as: Hadamard gate (Hadamard gate, H gate), Pauli-X gate (X gate), Pauli-Y gate (Y gate) Pauli-Z gate (Z gate), X gate, RY gate, RZ gate, CNOT gate, CR gate, iSWAP gate, Toffoli gate, etc. In quantum computing, it is necessary to use limited quantum bits combined with a variety of logical functions to achieve the computing effect.
[0050] Based on these differences, the design of the logical function acting on the quantum bit (including the design of whether the quantum bit is used or not and the design of the efficiency of the use of each quantum bit) is the key to improving the computing performance of the quantum computer, and requires special design. The above-mentioned design for quantum bits is a technical problem that ordinary computing devices do not need to consider or face. Based on this, in order to realize the calculation method of the target system energy in quantum computing, the present invention provides a method, device and storage medium for calculating the target system energy to solve the deficiencies in the prior art. It determines the target density matrix and calculates the target system energy, thereby reducing the number of calculation iterations of the target system energy and improving the iteration efficiency, further promoting the development of quantum chemical simulation applications.
[0051] For a long time, the theoretical explanation of the energy and properties of molecules and materials at the atomic level has been considered one of the most direct applications of quantum computing, and it has received widespread attention as a new computing paradigm. Compared with classical computing, the computing power of quantum computing increases exponentially with the increase in the number of quantum bits. With continuous development, breakthroughs have occurred in many fields, including pharmaceuticals, photovoltaics, aviation, electronics, and energy generation. One of the most likely applications of quantum computers is to simulate quantum systems, among which molecules are common quantum systems in nature, and calculating the energy of molecular systems is one of the main goals of quantum chemistry.
[0052] Under the Born-Oppenheimer approximation, that is, separating the slower degree of freedom of nuclear motion from the faster degree of freedom of electron motion, the basic goal of electronic structure theory can be expressed as solving the eigenstates of the following multi-electron Hamiltonian:
[0053]
[0054] The right side of the equation represents the kinetic energy of the electron, the external potential energy of the electron in the electrostatic potential field of the nucleus, the electrostatic repulsion potential energy between electrons, and the electrostatic repulsion potential energy between nuclei. N e Represents the number of electrons, N n represents the number of atoms, r i represents the coordinates of the ith electron, R I represents the coordinates of the Ith atom, Z I represents the atomic number of the Ith atom, is the kinetic energy operator, satisfying For this electronic Hamiltonian, the nuclear coordinates R I is a parameter, and the last term in the above formula is a constant.
[0055] With the energy expression, according to the Hohenberg-Kohn theory, we only need to vary the electron density and find the electron density with zero variation to complete the solution of the system's ground state. According to the variational principle, we can get the core of the entire density functional theory (DFT) - the Kohn-Sham equation. In physics and quantum chemistry, specifically for the Kohn-Sham equation in density functional theory, it is a non-interactive Schrödinger equation. The virtual system of non-interacting particles (usually electrons) produces the same density as any given interacting particle system. It can be expressed as:
[0056]
[0057] Among them, v ext (r) represents the external potential field, ν H (r) represents the Hartree potential field, represents the exchange-correlation potential field, represents the single electron orbital energy, represents the single electron orbital wave function.
[0058] To solve the Kohn-Sham equation, the KS-SCF (Kohn-Sham Self Consistent Field) method can be used. That is, the energy expression is set to zero under the orthogonal normalization constraint condition for the orbital (collectively known as molecular orbital, Molecular Orbital, MO), and the desired solution can be obtained. According to the linear variation principle, it means to find the coefficient matrix C σ Since the energy is expressed in terms of density matrices, we must first use the chain rule:
[0059]
[0060] The derivative of the single electron term with respect to the density matrix can be used to calculate H pq
[0061]
[0062] in, χ μ (r), χ v (r) are all basis functions.
[0063] It should be noted that in quantum chemistry, basis functions are functions with certain properties used to describe the wave function of the target system, and are the basis of quantum chemical ab initio calculations. Simply put, the wave function of a target system can always be expanded using a set of orthogonal and complete functions, which can be called basis functions. It is the basis of the infinite-dimensional Hilbert space, the wave function is a vector in the Hilbert space, and the corresponding operator can also be expressed as a matrix under this set of bases. In the embodiment of the present application, the molecular orbital of the target system to be simulated can be expressed in the form of basis functions by the following formula:
[0064]
[0065] in, is the wave function of the i-th atom, σ is the spin channel, i is the atomic number, M is the number of basis functions in the basis set, μ is the basis function number, c is the coefficient matrix, and the basis function χ μ (r) satisfies {χ μ (r),μ=1,2,…,M}.
[0066] See also Figure 2 , Figure 2 It is a flow chart of a method for calculating the energy of a target system provided in an embodiment of the present invention.
[0067] This embodiment provides an embodiment of a method for calculating the energy of a target system. The method for calculating the energy of a target system includes:
[0068] S201: Determine the Fock matrix according to the electron integral in the target system to be simulated and the initial density matrix.
[0069] Specifically, the target system to be simulated is first determined, which may include the number of electrons, orbital information, coordinate information, etc. of the target system to be simulated. The number of electrons refers to the number of electrons contained in the target system. Electrons are a kind of elementary particles, generally referring to the number of electrons outside the nucleus of the target system; orbital information is a mathematical method to describe the probability of finding electrons in a specific space outside the nucleus of the target system, and indicates the possible position of electrons in three-dimensional space.
[0070] It should be noted that before determining the Fock matrix according to the electron integral in the target system to be simulated and the initial density matrix, the method may further include: obtaining a first overlap matrix S of the target system to be simulated, and calculating a second overlap matrix corresponding to the first overlap matrix S
[0071] For example, for the target system of hydrogen molecules to be simulated, which contains four single electron spin molecular orbitals and two electrons, according to the number of hydrogen molecule electrons and orbital information, the coordinates of the two hydrogen atoms can be (0,0,0) and (0,0,0.74), respectively, and the basis set is the STO-3G basis set, the charge is set to 0, and the spin multiplicity is set to 1. The first overlap matrix S and the single electron integral A can be calculated:
[0072]
[0073]
[0074] It should be noted that the double electron integral G in the electron integral information is a four-dimensional tensor. For ease of presentation, it can be represented as a block matrix in the following form:
[0075]
[0076]
[0077] G 12 =G 21
[0078]
[0079]
[0080] On this basis, construct the initial density matrix and get the initial density matrix P0:
[0081]
[0082] Then, the Fock matrix F is constructed according to the electron integral in the target system to be simulated and the initial density matrix, and its specific form can be as follows:
[0083]
[0084] in, is the Fock matrix, σ is the spin channel, H pq Determined from the derivative of the electron integral with respect to the initial density matrix, J pq is the Coulomb matrix, satisfying J pq =∑ μv P μv(μν|pq), (μν|pq) is the electron integral tensor, P μν is the initial density matrix, a and b are hybridization coefficients, is a switching matrix that satisfies It is determined by the derivative of the exchange-correlation energy of the target system with respect to the initial density matrix.
[0085] Through linear algebra methods, we can get and F r ,Right now:
[0086]
[0087]
[0088]
[0089] S202: performing an iterative operation on the initial density matrix according to the Fock matrix until the difference between the density matrices obtained twice in the iteration process meets the preset accuracy, and taking the current density matrix obtained in the last iteration as the target density matrix.
[0090] Specifically, the current density matrix is determined by the following formula:
[0091]
[0092] Among them, P pq is the current density matrix, r is the cyclic subscript, n is the number of electron orbitals, c pr is the p-th row and r-th column component of the c matrix, c qr is the qth row and rth column component of the c matrix, c pr or c qr Determined according to the second overlap matrix, satisfying c r is the reduced eigenvector matrix. For example, if the c matrix and the eigenvector matrix c r They are:
[0093]
[0094]
[0095] According to the matrix c, an updated density matrix can be obtained according to the formula:
[0096]
[0097] The updated density matrix is then as follows:
[0098]
[0099] Then calculate whether the difference between the density matrices obtained twice before and after meets the preset accuracy (for example, the accuracy is 10 -5 ), namely P pq′ With P pq Is the difference less than 10? -5 If so, the current density matrix P pq′ as the target density matrix.
[0100] S203: Calculating the energy of the target system to be simulated based on the obtained target density matrix.
[0101] Specifically, calculating the energy of the target system to be simulated based on the obtained target density matrix may include:
[0102] The energy of the target system to be simulated is calculated by the following formula:
[0103] E=E XC +E K +E nuc +E H
[0104] Wherein, E is the energy of the target system to be simulated, E XC is the exchange-correlation energy of the target system to be simulated, E K is the kinetic energy of the target system to be simulated, E nuc is the repulsive energy of the target system to be simulated, E H is the Hartree Fock energy of the target system to be simulated; and E XC =∑ p W p ρ p Z p , W is the integral grid weight vector, ρ is the electron density of the target system to be simulated, Z p is the exchange-correlation energy term obtained from the universal function, is the kinetic energy term of the single electron integral A, is the potential energy term of the single electron integral A, and satisfies
[0105] It should be noted that the derivative of the Hartree Fock energy with respect to the density matrix will give the Coulomb matrix J:
[0106]
[0107] The exchange matrix K can be calculated by the derivative of the kinetic energy of the target system to be simulated σ :
[0108]
[0109] The derivative of the exchange-correlation energy of the target system to be simulated can be denoted by V xc,σ matrix:
[0110]
[0111] In summary, the derivative of the energy of the target system to be simulated with respect to the density matrix can be used to calculate the Fock matrix F σ
[0112]
[0113] Finally, consider the Lagrangian Taking the derivative of the expansion coefficient, we get:
[0114]
[0115] Through the first overlap matrix S of the basis set, that is:
[0116] S μν =∫χ μ (r) χ ν (r)dr
[0117] Using the Fock matrix F σ , the first overlap matrix S and the Lagrange multiplier The symmetry of The following equation can be derived:
[0118] F σ C σ =SC σ E σ
[0119] The above equation is the core equation of KSSCF that needs to be solved. The energy of the target system to be simulated can be divided into four parts: exchange correlation energy E XC , Hartree Fock Energy E H , kinetic energy E K and repulsion energy E nuc , where E XC The expression is:
[0120]
[0121] Where W represents the integral grid weight vector, ρ represents the electron density of the system, and Z p represents the exchange-correlation energy obtained according to different functional types, usually it is ρ and Function of equal variables.
[0122] Among them, W is calculated as follows:
[0123]
[0124]
[0125]
[0126] The expression for kinetic energy is:
[0127]
[0128] in, is the kinetic energy term of the single electron integral A.
[0129] Repulsion Energy E nuc The expression is:
[0130]
[0131] in, is the potential energy term of the single electron integral A, and
[0132] Hartree Fock Energy E H From the Coulomb matrix J we get:
[0133]
[0134] The final energy expression of the target system to be simulated is:
[0135] E=E XC +E K +E nuc +E H
[0136] In an optional implementation, since the functional expression of the exchange-correlation energy is very complicated, the full-space integration of a certain integrand F(r) can be used in the calculation of the present application, that is:
[0137] I=∫F(r)dr
[0138] For a finite molecular system, such a full-space integral is obviously not an efficient approach if it is integrated using a uniform real-space grid. This application proposes to assign a weight value of each atom's contribution to each point r in space, and the integral can be converted into the sum of the integrals centered on each atom, that is:
[0139]
[0140] Here, for each point in space, the sum of the weights of each atom is 1, that is:
[0141]
[0142] Integral at each atom center, the integrand is the original function multiplied by the weight function, that is:
[0143] F I (r) = ω I (r)F(r)
[0144] In a polyatomic molecular system, each point r in space is assigned to the nearest atom, that is, only one atom has a weight of 1, and the weights of all other atoms are 0. The region belonging to each atom obtained by this method is a polyhedron.
[0145] In an optional implementation, after calculating the energy of the target system to be simulated based on the obtained target density matrix, the method may further include:
[0146] According to the energy of the target system to be simulated currently obtained, judging whether the difference between the energy currently obtained and the energy previously obtained meets the accuracy;
[0147] If so, the energy of the target system to be simulated currently obtained is used as the energy of the target system to be simulated; otherwise, the target density matrix is updated, the energy corresponding to the updated target density matrix is calculated, and the step of determining whether the difference between the current energy and the previously obtained energy meets the accuracy is continued.
[0148] Specifically, according to the energy of the target system to be simulated, it is determined whether the difference between the current energy and the energy obtained last time meets the accuracy, where the accuracy can be set by the user according to the calculation requirements. If so, the ground state energy of the target system is directly obtained; otherwise, according to the above formula for determining the current density matrix, the density matrix is updated, and the energy corresponding to the updated density matrix is calculated, so that the ground state energy that satisfies the target system to be solved is finally obtained.
[0149] The above is a complete iterative process. A new round of iteration can be started by continuing to use the updated density matrix until the accuracy condition is met and the iteration ends. In the entire solution process, the acquisition of the target density matrix plays a vital role.
[0150] It can be seen that the present invention first determines the Fock matrix according to the electron integral in the target system to be simulated and the initial density matrix, and then performs an iterative operation on the initial density matrix according to the Fock matrix, until the difference between the density matrices obtained twice before and after the iteration meets the preset accuracy, and then the current density matrix obtained the last time is used as the target density matrix, and finally based on the obtained target density matrix, the energy of the target system to be simulated is calculated. It determines the target density matrix and calculates the energy of the target system, thereby improving the calculation accuracy of the energy of the target system, which is suitable for quantum computing simulation of complex systems and further promotes the development of quantum chemical simulation applications.
[0151] See also Figure 3 , Figure 3 is a schematic diagram of a target system energy calculation device provided by an embodiment of the present invention, and Figure 2 Corresponding to the process shown, the device includes:
[0152] A determination module 301 is used to determine a Fock matrix according to the electron integral and the initial density matrix in the target system to be simulated;
[0153] Iteration module 302 is used to perform an iterative operation on the initial density matrix according to the Fock matrix until the difference between the density matrices obtained twice before and after the iteration meets the preset accuracy, and the current density matrix obtained the last time is used as the target density matrix;
[0154] The calculation module 303 is used to calculate the energy of the target system to be simulated based on the obtained target density matrix.
[0155] Compared with the prior art, the present invention first determines the Fock matrix according to the electron integral in the target system to be simulated and the initial density matrix, and then performs an iterative operation on the initial density matrix according to the Fock matrix, until the difference between the density matrices obtained twice before and after the iteration meets the preset accuracy, and then uses the current density matrix obtained the last time as the target density matrix, and finally calculates the energy of the target system to be simulated based on the obtained target density matrix. It determines the target density matrix and calculates the energy of the target system, thereby improving the calculation accuracy of the energy of the target system, which is suitable for quantum computing simulation of complex systems and further promotes the development of quantum chemical simulation applications.
[0156] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0157] Specifically, in this embodiment, the above storage medium may be configured to store a computer program for performing the following steps:
[0158] S201: determining a Fock matrix according to the electron integral in the target system to be simulated and the initial density matrix;
[0159] S202: performing an iterative operation on the initial density matrix according to the Fock matrix until the difference between the density matrices obtained twice before and after the iteration meets the preset accuracy, and taking the current density matrix obtained the last time as the target density matrix;
[0160] S203: Calculating the energy of the target system to be simulated based on the obtained target density matrix.
[0161] Specifically, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0162] An embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0163] Specifically, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0164] Specifically, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0165] S201: determining a Fock matrix according to the electron integral in the target system to be simulated and the initial density matrix;
[0166] S202: performing an iterative operation on the initial density matrix according to the Fock matrix until the difference between the density matrices obtained twice before and after the iteration meets the preset accuracy, and taking the current density matrix obtained the last time as the target density matrix;
[0167] S203: Calculating the energy of the target system to be simulated based on the obtained target density matrix.
[0168] An embodiment of the present invention further provides a quantum computer operating system, which implements a method for calculating the energy of a target system according to any of the above method embodiments provided in an embodiment of the present invention.
[0169] An embodiment of the present application also provides a quantum computer operating system, which implements the calculation of the energy of a target system according to any of the methods described above.
[0170] An embodiment of the present application also provides a quantum computer, wherein the quantum computer includes the quantum computer operating system.
[0171] The above describes in detail the structure, features and effects of the present invention based on the embodiments shown in the drawings. The above is only a preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the drawings. Any changes made according to the concept of the present invention, or modifications to equivalent embodiments with equivalent changes, which still do not exceed the spirit covered by the description and drawings, should be within the protection scope of the present invention.
Claims
1. A method for calculating the energy of a target system, characterized in that: The method comprises: Determine the Fock matrix based on the electron integral in the target system to be simulated and the initial density matrix; According to the Fock matrix, an iterative operation is performed on the initial density matrix until the difference between the density matrices obtained twice before and after the iteration meets the preset accuracy, and the current density matrix obtained the last time is used as the target density matrix; Based on the obtained target density matrix, the energy of the target system to be simulated is calculated.
2. The method according to claim 1, characterized in that The method of determining the Fock matrix according to the electron integral in the target system to be simulated and the initial density matrix comprises: The Fock matrix is determined by the following formula: in, is the Fock matrix, σ is the spin channel, H pq Determined from the derivative of the electron integral with respect to the initial density matrix, J pq is the Coulomb matrix, satisfying J pq =∑ μν P μv (μν|pq), (μν|pq) is the electron integral tensor, P μv is the initial density matrix, a and b are hybridization coefficients, is a switching matrix that satisfies It is determined by the derivative of the exchange-correlation energy of the target system with respect to the initial density matrix.
3. The method according to claim 2, characterized in that Before determining the Fock matrix according to the electron integral in the target system to be simulated and the initial density matrix, the method further includes: Obtain the first overlap matrix S of the target system to be simulated, and calculate the second overlap matrix corresponding to the first overlap matrix S 4. The method according to claim 3, characterized in that The iterative operation of the initial density matrix is performed according to the Fock matrix until the difference between the density matrices obtained twice before and after the iteration meets the preset accuracy, and the current density matrix obtained the last time is used as the target density matrix, including: The current density matrix is determined by the following formula: Among them, P pq is the current density matrix, r is the cyclic subscript, n is the number of electron orbitals, c pr is the p-th row and r-th column component of the c matrix, c qr is the qth row and rth column component of the c matrix, c pr or c qr Determined according to the second overlap matrix, satisfying c r is the reduced eigenvector matrix.
5. The method according to claim 1 or 4, characterized in that: The step of calculating the energy of the target system to be simulated based on the obtained target density matrix comprises: The energy of the target system to be simulated is calculated by the following formula: E=E XC +E K +E nuc +E H Wherein, E is the energy of the target system to be simulated, E XC is the exchange-correlation energy of the target system to be simulated, E K is the kinetic energy of the target system to be simulated, E nuc is the repulsive energy of the target system to be simulated, E H is the Hartree Fock energy of the target system to be simulated; and E XC =∑ p W p ρ p Z p , W is the integral grid weight vector, ρ is the electron density of the target system to be simulated, Z p is the exchange-correlation energy term obtained from the universal function, is the kinetic energy term of the single electron integral A, is the potential energy term of the single electron integral A, and satisfies 6. The method according to claim 5, characterized in that After calculating the energy of the target system to be simulated based on the obtained target density matrix, the method further includes: According to the energy of the target system to be simulated currently obtained, judging whether the difference between the energy currently obtained and the energy previously obtained meets the accuracy; If so, the energy of the target system to be simulated currently obtained is used as the energy of the target system to be simulated; otherwise, the target density matrix is updated, the energy corresponding to the updated target density matrix is calculated, and the step of determining whether the difference between the current energy and the previously obtained energy meets the accuracy is continued.
7. A device for calculating target system energy, characterized in that: The device comprises: A determination module, used for determining a Fock matrix according to an electron integral in a target system to be simulated and an initial density matrix; An iteration module is used to perform an iterative operation on the initial density matrix according to the Fock matrix until the difference between the density matrices obtained twice before and after the iteration meets the preset accuracy, and the current density matrix obtained the last time is used as the target density matrix; A calculation module is used to calculate the energy of the target system to be simulated based on the obtained target density matrix.
8. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 6 when executed.
9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 6.
10. A quantum computer operating system, characterized in that: The quantum computer operating system implements a method for calculating the energy of a target system according to the method described in any one of claims 1 to 6.
Citation Information
Patent Citations
Simulating materials using quantum computation
CN110023966A
Molecular electron energy information calculation method and system
CN110867215A
Method and device for calculating energy of target system based on quantum chemistry and medium
CN114492815A
Method and device for determining initial parameters of test state of target system and medium
CN114528996A
Data processing method and device for quantum chemistry system
CN115527629A