Density matrix determination method and device and storage medium

By updating and iterating the density matrix of the target substance, the problem of computational inconsistency caused by inappropriate density matrix is solved, the accuracy and efficiency of quantum computing are improved, and it is suitable for quantum chemical simulation of complex systems.

CN120354957APending Publication Date: 2025-07-22ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410082204.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-19
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

In the prior art, determining the density matrix of the target substance is inappropriate, resulting in the inability to converge the quantum computing process, affecting the calculation accuracy and efficiency, especially in the quantum chemistry simulation of complex systems.

Method used

By obtaining the initial density matrix, initial Fock matrix and transformation matrix of the target substance, the Fock matrix is updated to determine the expansion coefficient, and the high-precision target density matrix is determined by iterating until the density matrix difference meets the preset accuracy.

Benefits of technology

It improves the accuracy and efficiency of energy calculation of target matter, is suitable for quantum computing simulation of complex systems, and promotes the development of quantum chemistry simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120354957A_ABST
    Figure CN120354957A_ABST
Patent Text Reader

Abstract

The invention discloses a density matrix determination method and device and a storage medium. The method comprises the following steps: firstly, obtaining an initial density matrix, an initial Fock matrix and a conversion matrix of a target substance; updating the initial Fock matrix according to the conversion matrix so as to determine an expansion coefficient by using the updated target Fock matrix; and finally, according to the expansion coefficient, executing an iterative operation on the initial density matrix, and taking the current density matrix obtained at the next time as a target density matrix until a difference value of density matrixes obtained at the last time and the last time meets preset precision in the iterative process. According to the method, the high-precision target density matrix is determined according to the initial density matrix, the Fock matrix and the conversion matrix, so that technical support is provided for calculating the energy of the target substance, the calculation precision of the energy of the target substance is improved, the method is more suitable for quantum calculation simulation of a complex system, and development of quantum chemical simulation application is further promoted.
Need to check novelty before this filing date? Find Prior Art

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 determining a density matrix. 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 chemical 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 the synthesis of drugs, the preparation of catalysts, etc. In the prior art, before using quantum chemical calculation software to run the VQE algorithm, it is an important step to determine the density matrix of the target substance. It should be noted that the determination of the density matrix directly affects the calculation process and calculation accuracy, and an inappropriate density matrix often causes the calculation process of the target substance to fail to converge. Therefore, how to select and determine a suitable density matrix, and then calculate the energy of the target substance, has become a problem that needs to be solved urgently. Summary of the invention

[0005] The purpose of the present invention is to provide a method, device and storage medium for determining a density matrix to address the deficiencies in the prior art. It determines a high-precision target density matrix based on an initial density matrix, a Fock matrix and a conversion matrix, thereby providing technical support for calculating the energy of a target substance and improving the calculation accuracy of the target substance energy, making it more suitable for quantum computing simulations of complex systems, and further promoting the development of quantum chemical simulation applications.

[0006] An embodiment of the present application provides a method for determining a density matrix, the method comprising:

[0007] Obtaining the initial density matrix, initial Fock matrix and transformation matrix of the target substance;

[0008] updating the initial Fock matrix according to the conversion matrix to determine the expansion coefficient using the updated target Fock matrix;

[0009] According to the expansion coefficient, perform iterative operations on the initial density matrix until the difference between the density matrices obtained in two consecutive iterations meets the preset precision, and then use the currently obtained density matrix in the latter iteration as the target density matrix.

[0010] Optionally, before obtaining the initial density matrix, the initial Fock matrix, and the transformation matrix of the target substance, the method further includes:

[0011] Obtain the two-electron matrix, the diagonalized overlap matrix, and the nuclear Hamiltonian of the target substance;

[0012] Determine the initial Fock matrix according to the two-electron matrix and the nuclear Hamiltonian of the target substance; and determine the transformation matrix of the target substance by using the diagonalized overlap matrix.

[0013] Optionally, the determining the initial Fock matrix according to the two-electron matrix and the nuclear Hamiltonian of the target substance includes:

[0014] Calculate the initial Fock matrix through the following formula:

[0015]

[0016]

[0017] where respectively represent the initial Fock matrix of electrons with α spin and the initial Fock matrix of electrons with β spin, represents the nuclear Hamiltonian of the target substance, satisfying r represents an electron, |r1 - R A | represents the distance between electron 1 and the nucleus A with atomic number Z A of, is the Laplacian operator, G α and G β respectively represent the two-electron matrix of α spin and the two-electron matrix of β spin, satisfying (μv∣σλ) and (μλ∣σv) represent the two-electron integral tensor, respectively represent the initial density matrix of electrons with α spin and the initial density matrix of electrons with β spin.

[0018] Optionally, the performing an update on the initial Fock matrix according to the transformation matrix to determine the expansion coefficient by using the updated target Fock matrix includes:

[0019] Calculate the updated target Fock matrix according to the transformation matrix, the conjugate transpose of the transformation matrix, and the initial Fock matrix;

[0020] Construct a diagonalized characteristic equation using the updated target Fock matrix;

[0021] Determine the expansion coefficients based on the diagonalized characteristic equation.

[0022] Optionally, the target substance includes a substance with unpaired lone electrons in non-restricted spin orbitals.

[0023] Another embodiment of the present application provides a method for determining the energy of a target substance, the method comprising:

[0024] Calculate the energy of the target substance using the target Fock matrix and the target density matrix;

[0025] Judge whether the difference between the energy of the current target substance and the energy obtained previously meets the accuracy according to the energy of the current target substance obtained;

[0026] If so, use the energy of the current target substance obtained as the ground state energy of the target substance, otherwise update the target density matrix, calculate the energy corresponding to the updated target density matrix, and continue to execute the step of judging whether the difference between the energy of the current target substance and the energy obtained previously meets the accuracy.

[0027] Optionally, for the calculating the energy of the target substance using the target Fock matrix and the target density matrix, the method comprises:

[0028] Calculate the energy of the target substance through the following formula:

[0029]

[0030] where E0 represents the energy of the target substance, respectively represent the target density matrix of α electrons and the target density matrix of β electrons, represents the nuclear Hamiltonian of the target substance, respectively represent the target Fock matrix of α electrons and the target Fock matrix of β electrons.

[0031] Another embodiment of the present application provides a device for determining a density matrix, the device comprising:

[0032] An acquisition module, configured to acquire the initial density matrix, the initial Fock matrix, and the transformation matrix of the target substance;

[0033] An update module, configured to update the initial Fock matrix according to the transformation matrix, so as to determine expansion coefficients by using the updated target Fock matrix;

[0034] An iteration module, configured to perform an iterative operation on the initial density matrix according to the expansion coefficients, until the difference between the density matrices obtained in two consecutive times meets a preset precision during the iteration process, and use the currently obtained density matrix in the latter time as the target density matrix.

[0035] Optionally, before the obtaining module, the apparatus further includes:

[0036] A target substance module, configured to obtain the two-electron matrix, diagonalized overlap matrix, and nuclear Hamiltonian of the target substance;

[0037] A matrix determination module, configured to determine the initial Fock matrix according to the two-electron matrix and nuclear Hamiltonian of the target substance; and determine the transformation matrix of the target substance by using the diagonalized overlap matrix.

[0038] Optionally, the matrix determination module includes:

[0039] A matrix determination unit, configured to calculate the initial Fock matrix through the following formula:

[0040]

[0041]

[0042] Wherein, respectively represent the initial Fock matrix of electrons with α spin and the initial Fock matrix of electrons with β spin, represents the nuclear Hamiltonian of the target substance, satisfying r represents an electron, |r1 - R A | represents the distance between electron 1 and nucleus A with atomic number Z A of, is the Laplacian operator, G α 、G β respectively represent the two-electron matrix of α spin and the two-electron matrix of β spin, satisfying (μv∣σλ), (μλ∣σv) represent the two-electron integral tensor, respectively represent the initial density matrix of electrons with α spin and the initial density matrix of electrons with β spin.

[0043] Optionally, the update module includes:

[0044] An update unit, configured to calculate an updated target Fock matrix according to the transformation matrix, the conjugate transpose of the transformation matrix, and the initial Fock matrix;

[0045] A construction unit, configured to construct a diagonalized characteristic equation by using the updated target Fock matrix;

[0046] A determination unit, configured to determine expansion coefficients based on the diagonalized characteristic equation.

[0047] Another embodiment of the present application provides a device for determining the energy of a target substance, the device including:

[0048] A calculation module, configured to calculate the energy of the target substance by using the target Fock matrix and the target density matrix;

[0049] A judgment module, configured to judge whether the difference between the currently obtained energy of the target substance and the energy obtained in the previous time meets the accuracy according to the currently obtained energy of the target substance;

[0050] An energy determination module, configured to, if so, use the currently obtained energy of the target substance as the ground state energy of the target substance; otherwise, update the target density matrix, calculate the energy corresponding to the updated target density matrix, and continue to execute the step of judging whether the difference between the currently obtained energy of the target substance and the energy obtained in the previous time meets the accuracy.

[0051] An embodiment of the present application provides a storage medium, in which a computer program is stored, and the computer program is configured to execute the method described in any one of the above when running.

[0052] An embodiment of the present application provides an electronic device, including a memory and a processor, a computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described in any one of the above.

[0053] Another embodiment of the present application provides a quantum computer operating system, and the quantum computer operating system realizes the determination of the density matrix according to the method described in any one of the above.

[0054] Compared with the prior art, the present invention first obtains the initial density matrix, the initial Fock matrix, and the transformation matrix of the target substance; then updates the initial Fock matrix according to the transformation matrix to determine the expansion coefficient by using the updated target Fock matrix; and finally, according to the expansion coefficient, performs an iterative operation on the initial density matrix until the difference between the density matrices obtained in two consecutive times meets the preset accuracy during the iterative process, and takes the currently obtained density matrix in the latter time as the target density matrix. It determines a high-precision target density matrix based on the initial density matrix, the Fock matrix, and the transformation matrix, thereby providing technical support for calculating the energy of the target substance, improving the calculation accuracy of the energy of the target substance, being more suitable for quantum computing simulations of complex systems, and further promoting the development of quantum chemistry simulation applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 is a system network block diagram corresponding to a method for determining a density matrix provided by an embodiment of the present invention;

[0056] Figure 2 is a flowchart of a method for determining a density matrix provided by an embodiment of the present invention;

[0057] Figure 3 is a flowchart of a method for determining the energy of a target substance provided by an embodiment of the present invention;

[0058] Figure 4 is a structural diagram of a device for determining a density matrix provided by an embodiment of the present invention;

[0059] Figure 5 is a structural diagram of a device for determining the energy of a target substance provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0060] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention and should not be construed as limiting the present invention.

[0061] An embodiment of the present invention first provides a method for determining a density matrix, which can be applied to an electronic device, such as a computer terminal, specifically, a general computer, a quantum computer, etc.

[0062] The following takes running on a computer terminal as an example to describe it in detail. Figure 1It is a system network block diagram corresponding to a method for determining a density matrix provided by an embodiment of the present invention. The system corresponding to the calculation method of the target substance 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.

[0063] The network 110 is a medium for providing communication links between various devices and computers connected together within the system corresponding to the method for determining the density matrix, including but not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof. The connection method may adopt wired, wireless communication links, or fiber optic cables, etc.

[0064] The server 120 and the client 140 are conventional data processing systems, which may contain data and have application programs or software tools for performing conventional calculation 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 computer, a smart wearable device, etc. The storage unit 150 may include a database 151, which may be configured to store data such as qubit parameters, quantum logic gate parameters, quantum circuits, and quantum programs.

[0065] 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 program 162 (application program 173). The application program 162 (application program 173) may be used to implement a quantum algorithm compiled according to the method for determining the density matrix provided by the embodiment of the present invention.

[0066] Any data or information stored or generated in the classical processing system 160 (quantum processing system 170) may also be configured to be stored or generated in another classical (quantum) processing system in a similar manner. Similarly, any application program executed by it may also be configured to be executed in another classical (quantum) processing system in a similar manner.

[0067] It should be noted that a real quantum computer is of a hybrid structure, which at least includes Figure 1 two major parts: the classical processing system 160, which is responsible for performing classical calculations and controls; the quantum processing system 170, which is responsible for running quantum programs to implement quantum calculations.

[0068] The above-mentioned classical processing system 160 and quantum processing system 170 can 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 the storage and network services required for quantum applications. Users develop quantum applications through the quantum application development tools and services thereon, and send the 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.

[0069] In the classical processing system 160 based on a silicon chip, the unit of the classical processor 161 is a CMOS transistor. Such a computing unit is not limited by time and coherence, that is, such a computing unit is not limited by the usage duration and is available at any time. In addition, in a silicon chip, the number of such computing units is also sufficient. Currently, the number of computing units in a classical processor is in the thousands. The number of computing units is sufficient and the selectable computing logic of the CMOS transistor is fixed, for example: AND logic. When operating with CMOS transistors, a large number of CMOS transistors are combined with limited logic functions to achieve the operation effect.

[0070] Different from such logic units 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. The input of a quantum bit is limited by coherence and also by the coherence time, that is, a quantum bit is limited by the usage duration and is not available at any time. Making full use of quantum bits within the available usage duration of quantum bits 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 logic function configured as needed. Given the limited number of quantum bits, while the logic functions in the field of quantum computing are diverse, for example: 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. When performing quantum computing, it is necessary to combine a limited number of quantum bits with diverse logic function combinations to achieve the operation effect.

[0071] Based on these differences, the logical function acting on the design of qubits (including the design of whether to use qubits and the design of the usage efficiency of each qubit) is the key to improving the computing performance of quantum computers and requires special design. The above-mentioned design for qubits is a technical problem that ordinary computing devices do not need to consider and do not need to face. Due to hardware limitations in this application, current quantum chips can only run some basic and specific quantum logic gates. Therefore, it is necessary to compile and optimize quantum circuits so that the compiled quantum circuits can run on quantum chips. However, there are often some redundant circuits in the compiled quantum circuits, which affects the running efficiency of the quantum circuits. How to solve the above problems has become an important research content at present. This application provides an optimization method, device, and medium for quantum circuits to solve the deficiencies in the prior art. By setting optimization conditions, a quantum circuit that meets the optimization conditions is obtained and an optimization operation is performed, realizing a reduction in the number of quantum logic gates in the quantum circuit, making the depth of the optimized quantum circuit smaller, and providing a basis for improving the computing efficiency of the quantum circuit on the quantum chip.

[0072] See Figure 2 , Figure 2 is a schematic flowchart of a method for determining a density matrix provided by an embodiment of the present invention.

[0073] An embodiment of the present invention provides a method for determining a density matrix. The method for determining the density matrix includes:

[0074] S201: Obtain the initial density matrix, initial Fock matrix, and transformation matrix of the target substance.

[0075] Specifically, first, determine the target substance to be simulated, which may include determining the number of electrons, orbital information, coordinate information, etc. of the target substance to be simulated. Among them, the number of electrons is the number of electrons contained in the target substance. An electron is a basic particle, generally referring to the number of extranuclear electrons of the target substance; orbital information is a mathematical method to describe the probability of finding an electron in a specific space outside the atomic nucleus of the target substance and indicates the possible positions of the electrons in three-dimensional space.

[0076] The density matrix describes the quantum system of the target substance. In a quantum system in a pure state, the system state can be described by a single state vector. However, in a mixed state, the system state cannot be described by a single state vector, and a density matrix is needed. The density matrix is analogous to the quantum mechanical description of the phase space probability measure in classical statistical mechanics (i.e., the probability distribution of position and momentum). Mixed states usually occur when the experimenter does not know which specific states are being manipulated, such as systems in thermal equilibrium (or chemical equilibrium), systems with uncertain or randomly varying states. If a quantum system has two or more interacting subsystems, even if the entire system is in a pure state, each subsystem must be considered a mixed state. The density matrix is an important tool in the theory of quantum decoherence.

[0077] In quantum chemistry, the Fock matrix is an operator used to describe the electronic state, which includes the electron kinetic energy, nuclear attraction, and the interaction between electrons. The Fock matrix is the basis of density functional theory in the DFT method and can be used to calculate the electronic structure and energy of the target substance.

[0078] In an alternative implementation, before obtaining the initial density matrix, initial Fock matrix, and transformation matrix of the target substance, the method may further include:

[0079] 1. Obtain the two-electron matrix, diagonalized overlap matrix, and nuclear Hamiltonian of the target substance.

[0080] In quantum chemical calculations, the two-electron matrix (Two-Electron Integral Matrix), diagonalized overlap matrix (Diagonalized Overlap Matrix), and nuclear Hamiltonian (Nuclear Hamiltonian) are all key concepts used to describe the electronic structure and properties of the target substance.

[0081] Among them, the two-electron integral matrix in the two-electron matrix takes into account the repulsive interaction between electrons. It is a four-dimensional matrix, usually denoted as (μv∣σλ), where μ, v, σ, λ represent the indices of the basis functions. The two-electron integrals can be calculated using quantum chemistry software packages (such as Gaussian, Psi4, etc.). During the calculation, these software packages will calculate these integrals based on the selected basis set (such as STO-3G) and the molecular geometry.

[0082] The diagonalized overlap matrix describes the degree of overlap between different basis functions. Diagonalizing the overlap matrix means finding a transformation such that the transformed basis functions are orthogonal to each other. In quantum chemical calculations, an orthonormalization process (such as Through orthogonalization to obtain a diagonalized overlap matrix or an orthogonal basis set, quantum chemistry software packages usually automatically handle the orthogonalization of the basis set.

[0083] The nuclear Hamiltonian describes the interaction between the atomic nuclei and electrons and the repulsion between atomic nuclei. Under the Born - Oppenheimer approximation, the atomic nuclei are regarded as stationary point charges, so the nuclear Hamiltonian can be simplified to an operator that only contains electron coordinates. The nuclear Hamiltonian is usually regarded as a fixed term in electronic structure calculations because it does not depend on the quantum state of electrons. In actual quantum chemistry calculations, the specific form of the nuclear Hamiltonian is determined by the selected basis set and the molecular geometry and is calculated by the quantum chemistry software package.

[0084] Exemplarily, to obtain the two - electron matrix, diagonalized overlap matrix, and nuclear Hamiltonian of the target substance, the following steps are usually required using a quantum chemistry software package:

[0085] Select a basis set: Select a suitable basis set according to the requirements of calculation accuracy and calculation resources;

[0086] Input the target substance: Input the geometric configuration and atomic types of the target substance molecule into the software package;

[0087] Perform preliminary calculations: Run the software package, which will calculate various necessary integrals and matrix elements according to the input molecular structure and basis set;

[0088] Extract results: Extract the information of the required two - electron matrix, diagonalized overlap matrix, and nuclear Hamiltonian from the output file or calculation results of the software package.

[0089] 2. Determine the initial Fock matrix according to the two - electron matrix and nuclear Hamiltonian of the target substance; and determine the transformation matrix of the target substance using the diagonalized overlap matrix.

[0090] Specifically, the Fock matrix is an important concept in electronic structure calculations, which describes the interaction between electrons. The initial Fock matrix can be constructed according to the given two - electron matrix and nuclear Hamiltonian.

[0091] Exemplarily, the determining the initial Fock matrix according to the two - electron matrix and nuclear Hamiltonian of the target substance may include:

[0092] Calculate the initial Fock matrix through the following formula:

[0093]

[0094]

[0095] where, respectively represent the initial Fock matrix of electrons with α spin and the initial Fock matrix of electrons with β spin, represents the nuclear Hamiltonian of the target substance, satisfying r represents an electron, |r1 - R A | represents the distance between electron 1 and nucleus A with atomic number Z A of, is the Laplacian operator, G α 、G β respectively represent the two - electron matrix of α spin and the two - electron matrix of β spin, satisfying (μv∣σλ), (μλ∣σv) represent two - electron integral tensors, respectively represent the initial electron density matrix of α spin and the initial electron density matrix of β spin.

[0096] It can be seen from the above formula that the Fock matrix and depend on the unknown density matrices and while the density matrices are actually determined by the expansion coefficients C α and C β . And solving the Pople - Nesbet equation is actually to obtain the minimum eigenvalue (ground - state energy) and its orbit, that is, this set of expansion coefficients C α and C β . The unknown variables to be solved determine the equation to be solved, and this equation is a non - linear equation, so it needs to be solved iteratively. However, before solving, it is necessary to convert FC = SCε into a typical eigenvalue equation F′C′ = C′ε before iterative solution of the eigenvalue equation can be carried out. This step is also called basis - set orthonormalization.

[0097] For example, taking α spin as an example, the above Pople - Nesbet equation FC = SCε is not a typical eigenvalue equation. The overlap matrix S comes from the fact that the basis set used is not orthogonal, so the overlap matrix needs to be changed to the identity matrix to transform the equation into F′C′ = C′ε for easy solution. That is, there must exist such a transformation matrix X such that And because S is a Hermitian matrix, there exists a unitary matrix U such that s is the diagonal matrix of the eigenvalues of the overlap matrix S. Therefore, the symmetric diagonalization method can be used to solve the transformation matrix X, that is, At this time, let the new coefficient matrix C′ be C′ = X -1 C, then C = XC′. Substituting it into the original equation gives FXC′ = SXC′ε. Left - multiplying gives The original Pople-Nesbet equation FC = SCε can be transformed into the form of F′C′ = C′ε, where C′ = XC -1 C. It can be determined only by obtaining the transformation matrix X, and the transformation matrix can be obtained from X ≡ S -1 / 2 obtained.

[0098] S202: Update the initial Fock matrix according to the transformation matrix to determine the expansion coefficients using the updated target Fock matrix.

[0099] Specifically, the transformation matrix is used to convert the original basis functions into orthogonalized basis functions. The Fock matrix is updated using the transformation matrix. During the process of updating the Fock matrix, the initial Fock matrix is converted into the Fock matrix under the orthogonalized basis functions using the transformation matrix. This step usually involves matrix transformation operations, multiplying the initial Fock matrix by the transformation matrix to obtain the updated Fock matrix under the orthogonalized basis functions.

[0100] Exemplarily, the updating the initial Fock matrix according to the transformation matrix to determine the expansion coefficients using the updated target Fock matrix may include:

[0101] Calculating the updated target Fock matrix according to the transformation matrix, the conjugate transpose of the transformation matrix, and the initial Fock matrix; constructing a diagonalized eigenvalue equation using the updated target Fock matrix; and determining the expansion coefficients based on the diagonalized eigenvalue equation.

[0102] Calculating the new target Fock matrix F′ through the transformation matrix X, that is:

[0103]

[0104]

[0105] The diagonalized eigenvalue equation F′C′ = C′ε, that is:

[0106] F α ′C α ′ = C α ′ε α

[0107] F β ′C β ′ = C β ′ε β

[0108] The expansion coefficient C is a parameter used to describe the linear combination coefficients of the electron wave function in electronic structure calculations. Determining the expansion coefficients based on the diagonalized eigenvalue equation, that is:

[0109] C α = XC α ′

[0110] C β = XC β ′

[0111] It should be noted that in quantum chemical calculations, this process usually requires multiple iterations until the expansion coefficients and the Fock matrix converge. In each iteration, the basis functions are updated according to the expansion coefficients obtained in the previous step, and the Fock matrix is recalculated using the updated basis functions. By continuously iterating and adjusting the expansion coefficients until the convergence criterion is met, the final electronic structure and properties can be obtained.

[0112] It should be noted that the updated expansion coefficient C determines the molecular orbital ψ i , expressed as:

[0113]

[0114]

[0115] The molecular orbitals constitute the spin orbitals, expressed as:

[0116]

[0117] Furthermore, it determines the one- and two-electron integrals, and a more accurate second quantization Hamiltonian is obtained:

[0118]

[0119]

[0120]

[0121] S203: According to the expansion coefficient, perform an iterative operation on the initial density matrix until the difference between the density matrices obtained in two consecutive times meets the preset accuracy during the iteration process, and use the currently obtained density matrix in the latter time as the target density matrix.

[0122] Specifically, first, a new target density matrix P0 can be obtained according to the expansion coefficient, and the specific calculation can be performed according to the following formula:

[0123]

[0124]

[0125] Calculate the difference between the updated current target density matrix and the initial density matrix. Until the difference between the density matrices obtained in two consecutive iterations meets the preset accuracy, the current density matrix obtained in the latter iteration is used as the target density matrix. For example, calculate whether the difference between the density matrices obtained in two consecutive iterations meets the preset accuracy (for example, the accuracy is 10 -5 ), that is, whether the difference between P and P0 is less than 10 -5 . If so, the current density matrix P0 is used as the target density matrix.

[0126] It should be noted that the target substance includes substances with unrestricted spin orbitals containing unpaired lone electrons. When determining the target density matrix and solving the ground state energy, the ground state of most molecules is a singlet state, and the correct ground state and energy can be obtained by using RHF (Restricted Hartree - Fock equation). However, for systems such as oxygen molecules, the ground state is a triplet state. In this case, the triplet state of the molecule needs to be solved to obtain the correct ground state energy. In addition, when calculating chemical reaction mechanisms, especially in photochemical reactions, the reactants and products are usually radical molecules, that is, molecular systems containing unpaired lone electrons. The RHF method can only handle systems where all electrons in the molecular orbitals are paired and cannot handle systems with unpaired electrons in the molecular orbitals. Such systems need to be calculated and processed using an unrestricted model. The generalized Hartree - Fock characteristic equation can be expressed in terms of spin orbitals as:

[0127] f(x1)χ i (x1) = ε i χ i (x1)

[0128] where f(x1) is the Fock operator, χ i (x1) is the spin orbital, ε i is the energy of the spin orbital, and the parameter x includes the three - dimensional spatial coordinate vector of a single electron and the spin variable ω.

[0129] When using restricted spin orbitals, χ i (x1) in the above formula is expressed as:

[0130]

[0131] Electrons with α - spin and β - spin are represented by the same set of spatial orbitals ψ j : {ψ j |j = 1,2,…,K}, ω is the spin variable, α(ω) is spin - up, and β(ω) is spin - down.

[0132] When using unrestricted spin orbitals, χi (x1) is expressed as:

[0133]

[0134] That is, the electron with α spin is represented by a set of spatial orbitals as: The electron with β spin is represented by another set of spin orbitals as: Substituting the non - restrictive spin orbitals into the Hartree - Fock characteristic equation and integrating over the spin variable ω, a set of Fock equations with different spins can be obtained:

[0135]

[0136]

[0137] Among them,

[0138] f α (r1) = ∫dω1α * (ω1)f a (x1)α(ω1)

[0139] f β (r1) = ∫dω1β * (ω1)f β (x1)β(ω1)

[0140] Substitute f a (x1), f β (r1) into the following formula:

[0141]

[0142] Among them, P 12 is a permutation operator, that is, exchanging the coordinates of electron 1 and electron 2, the following expanded expression is obtained:

[0143]

[0144]

[0145] Among them:

[0146]

[0147]

[0148]

[0149] In the above formula, the Laplace operator contains the differentiation with respect to each coordinate of a single electron, Z Ais the atomic number of nucleus A, |R A -r i | represents the distance between nucleus A and electron i. is the distance between electron 1 and electron 2, i.e.,

[0150] According to the above two Fock operators f α and f β , it can be seen that the two Fock equations are coupled and cannot be solved independently. That is to say, f α depends on the molecular orbital of spin β in the f β depends on the molecular orbital of spin α in the Therefore, these two equations must be solved through a synchronous iterative process. Solving the Fock equation is the core of the UHF-VQE algorithm. The next step will specifically describe how to perform the actual solution from the perspective of numerical solution.

[0151] Since the solution of the Fock equation involves very complex calculus calculations, it is very difficult to directly calculate the exact analytical solution of the molecular orbital on a computer. Therefore, in actual calculations, the molecular basis set is usually represented by a linear combination of a set of known atomic basis sets. The introduction of the known basis set transforms the Fock equation from an integral equation into a matrix equation form, so that it can be solved by the mathematical method of solving matrices, which is more conducive to efficient computer solution. Therefore, after introducing the basis set {φ μ |μ = 1, 2, …, K}, the molecular orbitals of different spins can be expanded in this basis set:

[0152]

[0153]

[0154] Substituting the above formula into the molecular orbitals of the Fock equations of different spins, we can get (taking the α spin as an example below):

[0155]

[0156] Next, multiply both sides of the equation by and integrate over the three-dimensional space coordinates of electron 1, we can get:

[0157]

[0158] In the above formula, the Fock matrix of α spin is defined as:

[0159]

[0160] Its mathematical meaning is the Fock operator f α in the matrix form expanded under the basis set {φ μ}. Define the overlap matrix as:

[0161]

[0162] Similarly, the expression of the β-spin Fock equation under the same basis set can be obtained and is abbreviated as the following form:

[0163]

[0164]

[0165] These two equations are the Pople-Nesbet equations under unrestricted spin orbitals. The matrices ε α and ε β are both diagonal matrices of different spin orbital energies:

[0166]

[0167] C α and C β are the expansion coefficients of different spin orbitals, which are square matrices of type K×K:

[0168]

[0169] Then expand the Fock operator f α and f β in the Fock matrix defined above, and expand it with the atomic basis set to obtain the final expression.

[0170] For example, first expand the operators f α and f β in the Fock matrix, and the following can be obtained:

[0171]

[0172]

[0173] In the above formula is the core-Hamiltonian matrix, and this term can be determined after a given basis set:

[0174]

[0175] Next, expand the molecular orbitals and in the Fock matrix expression with the atomic basis set:

[0176]

[0177]

[0178] Among them, (μv∣σλ) is a two-electron integral, and its expression is:

[0179]

[0180] All the subscripts μvσλ take values from 1 to K. In the above formula and are the density matrices of α-spin and β-spin, which are defined by the expansion coefficients of their corresponding spins, and their expressions are:

[0181]

[0182]

[0183] It can be seen that the present invention first obtains the initial density matrix, the initial Fock matrix and the transformation matrix of the target substance; then updates the initial Fock matrix according to the transformation matrix to determine the expansion coefficients by using the updated target Fock matrix; finally, according to the expansion coefficients, perform iterative operations on the initial density matrix until the difference between the density matrices obtained in two consecutive times meets the preset accuracy during the iteration process, and use the currently obtained density matrix in the latter time as the target density matrix. It provides technical support for calculating the energy of the target substance by determining the target density matrix with high precision based on the initial density matrix, the Fock matrix and the transformation matrix, and improves the calculation accuracy of the energy of the target substance, making it more suitable for quantum computational simulations of complex systems, and further promoting the development of quantum chemical simulation applications.

[0184] In an alternative embodiment, referring to Figure 3 , Figure 3 is a schematic flowchart of a method for determining the energy of a target substance provided by an embodiment of the present invention. Based on the above-determined target density matrix and target Fock matrix, calculate the energy of the target substance, which specifically includes the following steps:

[0185] S301: Calculate the energy of the target substance by using the target Fock matrix and the target density matrix;

[0186] S302: According to the currently obtained energy of the target substance, determine whether the difference between the currently obtained energy of the target substance and the energy obtained in the previous time meets the accuracy;

[0187] S303: If so, use the energy of the target substance obtained currently as the ground state energy of the target substance; otherwise, update the target density matrix, calculate the energy corresponding to the updated target density matrix, and continue to execute the step of determining whether the difference between the energy of the current target substance and the energy obtained previously meets the accuracy requirement.

[0188] Specifically, based on the energy of the target substance calculated using the above-mentioned target Fock matrix and target density matrix, determine whether the difference between the energy of the current target substance and the energy obtained previously meets the accuracy requirement, where the accuracy can be set by the user according to the calculation requirements. If so, use the energy of the target substance obtained currently as the ground state energy of the target substance; otherwise, update the target density matrix, calculate the energy corresponding to the updated target density matrix, and continue to execute the step of determining whether the difference between the energy of the current target substance and the energy obtained previously meets the accuracy requirement, so as to finally obtain the ground state energy that satisfies the target substance.

[0189] The above is a complete iteration process. A new round of iteration can be started by means of the updated target density matrix until the accuracy condition is met and the iteration ends. In the whole solution process, obtaining the target density matrix plays a crucial role.

[0190] Exemplarily, for calculating the energy of the target substance using the target Fock matrix and the target density matrix, the method includes:

[0191] Calculate the energy of the target substance through the following formula:

[0192]

[0193] where E0 represents the energy of the target substance, respectively represent the target density matrix of α electrons and the target density matrix of β electrons, represents the nuclear Hamiltonian of the target substance, respectively represent the target Fock matrix of α electrons and the target Fock matrix of β electrons.

[0194] It can be seen that in this application, the energy of the target substance is calculated by using the target Fock matrix and the target density matrix; then, based on the energy of the target substance obtained currently, determine whether the difference between the energy of the current target substance and the energy obtained previously meets the accuracy requirement; if so, use the energy of the target substance obtained currently as the ground state energy of the target substance; otherwise, update the target density matrix, calculate the energy corresponding to the updated target density matrix, and continue to execute the step of determining whether the difference between the energy of the current target substance and the energy obtained previously meets the accuracy requirement. Through the target Fock matrix and the target density matrix, the energy of the target substance is calculated, thereby improving the calculation accuracy of the energy of the target substance.

[0195] See Figure 4 , Figure 4 which is a schematic structural diagram of a density matrix determination device provided by an embodiment of the present invention, corresponding to the process shown in Figure 2 . The device includes:

[0196] An acquisition module 401, configured to acquire an initial density matrix, an initial Fock matrix, and a transformation matrix of a target substance;

[0197] An update module 402, configured to update the initial Fock matrix according to the transformation matrix, so as to determine expansion coefficients by using the updated target Fock matrix;

[0198] An iteration module 403, configured to perform an iterative operation on the initial density matrix according to the expansion coefficients, until the difference between the density matrices obtained in two consecutive times meets a preset accuracy during the iteration process, and use the currently obtained density matrix in the latter time as the target density matrix.

[0199] Specifically, before the acquisition module, the device further includes:

[0200] A target substance module, configured to acquire a two-electron matrix, a diagonalized overlap matrix, and a nuclear Hamiltonian of a target substance;

[0201] A matrix determination module, configured to determine an initial Fock matrix according to the two-electron matrix and the nuclear Hamiltonian of the target substance; and determine the transformation matrix of the target substance by using the diagonalized overlap matrix.

[0202] Specifically, the matrix determination module includes:

[0203] A matrix determination unit, configured to calculate the initial Fock matrix through the following formula:

[0204]

[0205]

[0206] wherein, respectively represent the initial Fock matrix of electrons with α spin and the initial Fock matrix of electrons with β spin, represents the nuclear Hamiltonian of the target substance, satisfying r represents an electron, |r1 - R A | represents the distance between electron 1 and nucleus A with atomic number Z A , is the Laplacian operator, G α , G βRespectively represent the two - electron matrix of α - spin and the two - electron matrix of β - spin, satisfying (μv∣σλ) and (μλ∣σv) represent the two - electron integral tensors, Respectively represent the initial electron density matrix of α - spin and the initial electron density matrix of β - spin.

[0207] Specifically, the update module includes:

[0208] An update unit, configured to calculate the updated target Fock matrix according to the transformation matrix, the conjugate transpose of the transformation matrix, and the initial Fock matrix;

[0209] A construction unit, configured to construct a diagonalized characteristic equation by using the updated target Fock matrix;

[0210] A determination unit, configured to determine the expansion coefficients based on the diagonalized characteristic equation.

[0211] It can be seen that the present invention first obtains the initial density matrix, the initial Fock matrix, and the transformation matrix of the target substance; then updates the initial Fock matrix according to the transformation matrix to determine the expansion coefficients by using the updated target Fock matrix; finally, performs iterative operations on the initial density matrix according to the expansion coefficients until the difference between the density matrices obtained in two consecutive times meets the preset accuracy during the iterative process, and takes the currently obtained density matrix in the latter time as the target density matrix. It provides technical support for calculating the energy of the target substance by determining a high - precision target density matrix based on the initial density matrix, the Fock matrix, and the transformation matrix, thereby improving the calculation accuracy of the energy of the target substance, being more applicable to quantum - computing simulations of complex systems, and further promoting the development of quantum - chemical simulation applications.

[0212] See Figure 5 , Figure 5 is a schematic structural diagram of a device for determining the energy of a target substance provided by an embodiment of the present invention, corresponding to the process shown in Figure 3 The device includes:

[0213] A calculation module 501, configured to calculate the energy of the target substance by using the target Fock matrix and the target density matrix;

[0214] A judgment module 502, configured to judge whether the difference between the currently obtained energy of the target substance and the energy obtained in the previous time meets the accuracy;

[0215] An energy determination module 503, configured to, if so, use the energy of the target substance currently obtained as the ground state energy of the target substance; otherwise, update the target density matrix, calculate the energy corresponding to the updated target density matrix, and continue to execute the step of determining whether the difference between the energy of the current target substance and the energy obtained in the previous time meets the accuracy.

[0216] It can be seen that in this application, the energy of the target substance is calculated by using the target Fock matrix and the target density matrix; then, according to the energy of the target substance currently obtained, it is determined whether the difference between the energy of the current target substance and the energy obtained in the previous time meets the accuracy; if so, the energy of the target substance currently obtained is used as the ground state energy of the target substance; 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 energy of the current target substance and the energy obtained in the previous time meets the accuracy is continued. It calculates the energy of the target substance through the target Fock matrix and the target density matrix, thereby improving the calculation accuracy of the energy of the target substance.

[0217] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0218] Specifically, in this embodiment, the above storage medium may be configured to store a computer program for executing the following steps:

[0219] S201: Obtain an initial density matrix, an initial Fock matrix, and a transformation matrix of the target substance;

[0220] S202: Update the initial Fock matrix according to the transformation matrix to determine expansion coefficients by using the updated target Fock matrix;

[0221] S203: According to the expansion coefficients, perform an iterative operation on the initial density matrix until the difference between the density matrices obtained in two consecutive times meets a preset accuracy during the iteration process, and use the current density matrix obtained in the latter time as the target density matrix.

[0222] Specifically, in this embodiment, the above storage medium may include, but is not limited to: various media such as a USB flash drive, a read-only memory (ROM for short), a random access memory (RAM for short), a mobile hard disk, a magnetic disk, or an optical disc that can store a computer program.

[0223] An embodiment of the present invention further provides an electronic device, including 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.

[0224] Specifically, the above electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0225] Specifically, in this embodiment, the above processor may be configured to execute the following steps through a computer program:

[0226] S201: Obtain the initial density matrix, the initial Fock matrix, and the transformation matrix of the target substance;

[0227] S202: Update the initial Fock matrix according to the transformation matrix to determine the expansion coefficient by using the updated target Fock matrix;

[0228] S203: Perform an iterative operation on the initial density matrix according to the expansion coefficient until the difference between the density matrices obtained in two consecutive times meets a preset accuracy during the iteration process, and use the currently obtained density matrix in the latter time as the target density matrix.

[0229] An embodiment of the present invention further provides a quantum computer operating system, and the quantum computer operating system determines the density matrix according to any one of the above method embodiments provided in the embodiment of the present invention.

[0230] An embodiment of the present application further provides a quantum computer operating system, and the quantum computer operating system determines the density matrix according to the method in any one of the above.

[0231] An embodiment of the present application further provides a quantum computer, and the quantum computer includes the above quantum computer operating system.

[0232] The above has described in detail the structure, features, and effects of the present invention according to 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 implementation scope shown in the drawings. Any changes made according to the concept of the present invention, or equivalent embodiments modified into equivalent changes, should still be within the protection scope of the present invention as long as they do not exceed the spirit covered by the description and the drawings.

Claims

1. A method for determining a density matrix, characterized in that The method includes: Obtaining an initial density matrix, an initial Fock matrix, and a transformation matrix of a target substance; Updating the initial Fock matrix according to the transformation matrix to determine expansion coefficients by using the updated target Fock matrix; Performing an iterative operation on the initial density matrix according to the expansion coefficients until the difference between the density matrices obtained in two consecutive times meets a preset accuracy in the iterative process, and taking the currently obtained density matrix in the latter time as the target density matrix.

2. The method according to claim 1, characterized in that Before obtaining the initial density matrix, the initial Fock matrix, and the transformation matrix of the target substance, the method further includes: Obtaining a two-electron matrix, a diagonalized overlap matrix, and a nuclear Hamiltonian of the target substance; Determining the initial Fock matrix according to the two-electron matrix and the nuclear Hamiltonian of the target substance; and determining the transformation matrix of the target substance by using the diagonalized overlap matrix.

3. The method according to claim 2, characterized in that, The determining the initial Fock matrix according to the two-electron matrix and the nuclear Hamiltonian of the target substance includes: Calculating the initial Fock matrix through the following formula: Among them, respectively represent the initial Fock matrix of electrons with α spin and the initial Fock matrix of electrons with β spin, represents the nuclear Hamiltonian of the target substance, satisfying r represents an electron, |r1 - R A | represents the distance between electron 1 and nucleus A with atomic number Z A of, is the Laplacian operator, G α 、G β respectively represent the two - electron matrix of α spin and the two - electron matrix of β spin, satisfying (μv|σλ), (μλ|σv) represent the two - electron integral tensor, respectively represent the initial electron density matrix of α spin and the initial electron density matrix of β spin.

4. The method according to claim 3, characterized in that, The updating the initial Fock matrix according to the transformation matrix to determine expansion coefficients by using the updated target Fock matrix includes: Calculating the updated target Fock matrix according to the transformation matrix, the conjugate transpose of the transformation matrix, and the initial Fock matrix; Constructing a diagonalized characteristic equation by using the updated target Fock matrix; Determining the expansion coefficients based on the diagonalized characteristic equation.

5. The method according to claim 4, wherein The target substance includes a substance with unrestricted spin orbitals containing unpaired lone electrons.

6. A method for determining the energy of a target substance, characterized in that, The method includes: Calculating the energy of the target substance by using the target Fock matrix and the target density matrix according to any one of claims 1 to 5; Judging whether the difference between the currently obtained energy of the target substance and the energy obtained in the previous time meets the accuracy; If so, taking the currently obtained energy of the target substance as the ground state energy of the target substance; otherwise, updating the target density matrix, calculating the energy corresponding to the updated target density matrix, and continuing to perform the step of judging whether the difference between the currently obtained energy of the target substance and the energy obtained in the previous time meets the accuracy.

7. The method according to claim 6, wherein The calculating the energy of the target substance by using the target Fock matrix and the target density matrix, the method includes: Calculating the energy of the target substance through the following formula: Among them, E0 represents the energy of the target substance, respectively represent the target density matrix of α electrons and the target density matrix of β electrons, represents the nuclear Hamiltonian of the target substance, respectively represent the target Fock matrix of α electrons and the target Fock matrix of β electrons.

8. An apparatus for determining a density matrix, characterized in that, The apparatus includes: An obtaining module, configured to obtain an initial density matrix, an initial Fock matrix, and a transformation matrix of a target substance; An updating module, configured to update the initial Fock matrix according to the transformation matrix to determine expansion coefficients by using the updated target Fock matrix; An iterative module, configured to perform an iterative operation on the initial density matrix according to the expansion coefficients until the difference between the density matrices obtained in two consecutive times meets a preset accuracy in the iterative process, and taking the currently obtained density matrix in the latter time as the target density matrix.

9. A storage medium, characterized in that, A computer program is stored in the storage medium, wherein the computer program is configured to execute the method according to any one of claims 1 to 5 or claims 6 to 7 when running.

10. 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 execute the method according to any one of claims 1 to 5 or claims 6 to 7.