Crystal structure generation method, device and equipment and storage medium
By adopting the von Mises distribution and Bayesian flow network model in the crystal structure generation, the problems of low crystal structure quality and low generation efficiency in the prior art are solved, and a more stable and efficient crystal structure generation is achieved.
Patent Information
- Application Number
- CN202411684271.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-11-22
AI Technical Summary
The crystal structure generated in the prior art has low quality and low generation efficiency during the generation process.
By using the von Mises distribution as the base distribution, the target crystal structure data is generated using the trained Bayesian stream network crystal structure generation model. This model performs multiple iterative training on the belief parameters of the initial crystal data based on Bayesian stream network to generate a more stable crystal structure.
A crystal structure with relatively stable generated structure quality is realized, greatly improving the generation efficiency of generated crystal structure.
Smart Images

Figure CN119833019A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of crystal technology, and in particular to a method, device, equipment and storage medium for generating a crystal structure. Background Art
[0002] Crystal is a structure composed of a large number of microscopic material units (atoms, ions, molecules, etc.) arranged in an orderly manner according to certain rules. Therefore, the arrangement rules and crystal morphology can be studied and judged from the size of the structural units. Crystal materials are very versatile and can be used to prepare various devices such as lasers, LEDs, solar cell sensors, etc., and can also be used as catalysts for gas-solid reactions.
[0003] In the related art, the generation of the structure is usually based on a diffusion model, and a neural network is trained to denoise the noisy crystal structure to generate the crystal structure.
[0004] However, the crystal structure generation path generated by the diffusion model is unstable and has a high variance, which causes the intermediate states in the generation path to deviate from the data distribution of the stable structure. In addition, the crystal structure generated by the diffusion model has low quality and low generation efficiency during the generation process. Summary of the invention
[0005] The present invention provides a method, device, equipment and storage medium for generating a crystal structure, which are used to solve the defects of low quality of the crystal structure generated in the prior art and low generation efficiency during the generation process, and achieves generation of a crystal structure with relatively stable structural quality by using von Mises distribution as a base distribution and a trained Bayesian flow network crystal structure generation model, thereby greatly improving the generation efficiency of the crystal structure.
[0006] In a first aspect, the present invention provides a method for generating a crystal structure, comprising the following steps.
[0007] Obtain initial crystal data; The initial crystal data is input into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data; wherein the Bayesian flow network crystal structure generation model is obtained by performing multiple iterative training on the belief parameters of the initial crystal data based on the Bayesian flow network; the belief parameters are determined by selecting part of the initial crystal data as sample data and performing data distribution processing on the sample data, and the data distribution is von Mises distribution.
[0008] Preferably, according to a method for generating a crystal structure provided by the present invention, The Bayesian flow network crystal structure generation model is obtained by performing multiple iterative training of the belief parameters of the initial crystal data on the Bayesian flow network, and the specific steps include: Processing the belief parameters using the Bayesian flow network to obtain a normal distribution that obeys the initial crystal data, and determining corresponding observation samples based on the normal distribution that obeys the initial crystal data; Using the observed samples to update the corresponding belief parameters to obtain updated belief parameters; Iterative execution utilizes the Bayesian flow network to process the belief parameters to obtain a normal distribution that obeys the initial crystal data, and determines corresponding observation samples based on the normal distribution that obeys the initial crystal data, and uses the observation samples to update the corresponding belief parameters to obtain updated belief parameters, until the number of iterative executions reaches a preset threshold, stops executing the step of updating the belief parameters, and obtains the trained Bayesian flow network crystal structure generation model.
[0009] Preferably, according to a method for generating a crystal structure provided by the present invention, the initial crystal data is input into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data, comprising: Performing sampling processing on the initial crystal data to obtain crystal sampling data; Inputting the crystal sampling data into the trained Bayesian flow network crystal structure generation model, and outputting the belief strength value corresponding to the crystal sampling data; Based on the output belief strength value, performing sampling update processing on the crystal sampling data to obtain updated crystal sampling data; Iteratively execute the step of inputting the crystal sampling data into the trained Bayesian flow network crystal structure generation model, outputting the belief strength value corresponding to the crystal sampling data, and performing sampling and updating processing on the crystal sampling data based on the output belief strength value to obtain the updated crystal sampling data, until the belief strength value reaches a preset strength threshold, then stop iteratively executing the step of updating the crystal sampling data, and use the crystal sampling data corresponding to the belief strength value output for the last time as the target crystal structure data.
[0010] Preferably, according to a method for generating a crystal structure provided by the present invention, after the step of inputting the initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data, the method comprises: Calculating the on-shell energy of the crystal structure based on the target crystal structure data; The on-shell energy is compared with a preset energy threshold to obtain an energy comparison result, and the state information of the crystal structure is determined according to the energy comparison result.
[0011] Preferably, according to a method for generating a crystal structure provided by the present invention, the step of calculating the shell energy of the crystal structure based on the target crystal structure data comprises: Calculating the target crystal structure data using a preset density functional theory algorithm to obtain the total energy of the crystal structure; Determine the decomposed substructures after the crystal structure is decomposed, and calculate the decomposition energy corresponding to each decomposed substructure using the density functional theory algorithm; The on-shell energy of the crystal structure is determined based on the decomposed energies of the decomposed substructures and the total energy of the crystal structure.
[0012] Preferably, according to a method for generating a crystal structure provided by the present invention, determining the on-shell energy of the crystal structure based on the decomposition energy of the decomposed substructure and the total energy of the crystal structure comprises: determining a target sub-energy from said decomposed energies of a plurality of said decomposed sub-structures; The target sub-energy and the total energy of the crystal structure are calculated to obtain the on-shell energy of the crystal structure.
[0013] In a second aspect, the present invention further provides a device for generating a crystal structure, comprising the following modules: An acquisition module, used for acquiring initial crystal data; A generation module is used to input the initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data; wherein the Bayesian flow network crystal structure generation model is obtained by multiple iterative training of the belief parameters of the initial crystal data based on the Bayesian flow network; the belief parameters are determined by selecting part of the initial crystal data as sample data and performing data distribution processing on the sample data, and the data distribution is von Mises distribution.
[0014] In a third aspect, the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a method for generating a crystal structure as described above is implemented.
[0015] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for generating a crystal structure as described in any one of the above.
[0016] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-described methods for generating a crystal structure.
[0017] The crystal structure generation method, device, equipment and storage medium provided by the present invention obtain initial crystal data; input the initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data; wherein the Bayesian flow network crystal structure generation model is obtained by multiple iterations of training the belief parameters of the initial crystal data based on the Bayesian flow network; the belief parameters are determined by selecting part of the initial crystal data as sample data and performing data distribution processing on the sample data, and the data distribution is von Mises distribution. It is used to solve the defects of low quality of crystal structures generated in the prior art and low generation efficiency during the generation process, and realizes the generation of crystal structures with relatively stable structural quality by using von Mises distribution as the base distribution and using the trained Bayesian flow network crystal structure generation model, which greatly improves the generation efficiency of the generated crystal structure. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 This is one of the flow charts of the method for generating the crystal structure provided by the present invention.
[0020] Figure 2 It is a schematic diagram of variance comparison in the crystal formation process provided by the present invention.
[0021] Figure 3 It is a visualized schematic diagram of the crystal structure of the crystal provided by the present invention.
[0022] Figure 4 It is a schematic diagram of the method for generating the crystal structure provided by the present invention.
[0023] Figure 5 It is a schematic diagram of the comparison of the steps in the crystal structure generation process provided by the present invention.
[0024] Figure 6 It is a schematic structural diagram of a device for generating a crystal structure provided by the present invention.
[0025] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] First, some nouns involved in this application are analyzed: Bayesian Flow Network (BFN) is a new generative model. Its characteristic is that it adopts a unified framework for both discrete and continuous data, that is, based on the noise data sample, a set of independently distributed parameters are modified using Bayesian reasoning, and then the input is passed to the neural network to obtain the output distribution. This output distribution is no longer an independent parameter, so it has the ability to capture information in the data.
[0028] Von Mises distribution: In probability theory and directional statistics, von Mises distribution refers to a continuous probability distribution model on a circle, also known as circular normal distribution.
[0029] The probability density function of the von Mises distribution for the cycle angle x is: f(x|μ, κ)=exp(κcos(x-μ)) / (2πI0(κ)), where I0(x) is the modified Bessel function of order 0.
[0030] Energy above hull: is a concept used to measure the thermodynamic stability of a material. It describes the free energy gap of a material relative to the most stable possible decomposition product and is usually used to judge the stability of a material.
[0031] Discretization of data means the process or result of converting continuous data into discrete data, which implies a conversion process. Usually, continuous values can be divided into multiple equal-length value intervals, and then the continuous values in the same interval are represented by the same discrete value (or category).
[0032] In the related art, the generation of structures is usually based on a diffusion model, and a neural network is trained to denoise the noisy crystal structure to generate a crystal structure. However, the generation path of the crystal structure generated by the diffusion model is unstable and has a high variance, so that the intermediate state in the generation path deviates from the data distribution of the stable structure. In addition, the crystal structure generated by the diffusion model has low quality and low generation efficiency during the generation process.
[0033] Combine the following Figure 1-Figure 7 The present invention describes a method, device, equipment and storage medium for generating a crystal structure, which are used to solve the defects of low quality of the crystal structure generated in the prior art and low generation efficiency during the generation process, and achieves generation of a crystal structure with relatively stable structural quality by using von Mises distribution as the base distribution and a trained Bayesian flow network crystal structure generation model, thereby greatly improving the generation efficiency of the crystal structure.
[0034] Figure 1 It is one of the flow charts of the method for generating the crystal structure provided by the present invention, such as Figure 1 As shown, the method includes but is not limited to steps S100 to S200: S100, acquiring initial crystal data; S200, inputting the initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data; wherein the Bayesian flow network crystal structure generation model is obtained by performing multiple iterative training on the belief parameters of the initial crystal data based on the Bayesian flow network; the belief parameters are determined by selecting part of the initial crystal data as sample data and performing data distribution processing on the sample data, and the data distribution is von Mises distribution.
[0035] In step S100 of some embodiments, initial crystal data is acquired.
[0036] It should be noted that the initial crystal data can be obtained from a preset database, and the initial crystal data may include but is not limited to unit cell data, crystal original data, lattice parameters, atomic type data, three-dimensional coordinates, number of atoms, crystal plane data, etc.
[0037] In step S200 of some embodiments, the initial crystal data is input into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data.
[0038] It should be noted that the Bayesian flow network crystal structure generation model is obtained by performing multiple iterative training of the belief parameters of the initial crystal data based on the Bayesian flow network.
[0039] Furthermore, the belief parameter is determined by selecting a portion of the initial crystal data as sample data and performing data distribution processing on the sample data.
[0040] Furthermore, the data distribution is von Mises distribution.
[0041] The initial crystal data can be divided, and part of the crystal data can be screened out from the initial crystal data as sample data, so as to construct the von Mises distribution according to the sample data and further determine the belief parameters.
[0042] In some embodiments of the present invention, if the probability density function of the continuous random variable X is: Where k>0, , is a deformed Bessel function of the first kind of order 0.
[0043] Then X is said to obey the von Mises distribution with parameter .
[0044] parameter and The function played is similar to the mathematical expectation and variance of the normal distribution.
[0045] When k is close to 0, the distribution tends to be uniform, and as k increases, the distribution tends to be normal. .
[0046] The von Mises distribution is similar in form to the normal distribution, and: .
[0047] It should be noted that Bayesian inference is the process of using samples to infer the overall situation. One of the biggest differences between Bayesian inference and frequentist inference is that the frequentist believes that the frequency of the population is certain, but we cannot know it accurately. However, when the sample size is large enough, the frequency will gradually converge to the true probability value. Therefore, frequentist inference does not assign a probability to the hypothesis or model parameters. For example, in frequentist inference, there is no such statement as "the probability of the next coin flipping is 1 / 2", but it is believed that after continuous and large-scale experiments (if this coin is hard and perfectly uniform), the frequency of the head facing up will gradually approach 1 / 2. Therefore, frequentist inference generally gives statistics as confidence intervals. Bayesian inference first assigns a prior probability (for example, the probability of the coin facing up based on experience) or a prior probability distribution to the hypothesis based on prior knowledge such as experience and previous research, and then uses the evidence obtained from the experiment to correct this prior probability to obtain a posterior probability or posterior probability distribution that better fits the evidence.
[0048] The Bayesian flow network will use the input prior to further output another distribution as an estimate of the true data distribution. The samples generated by the final model are sampled from this output distribution.
[0049] Figure 2 It is a schematic diagram of variance comparison in the crystal formation process provided by the present invention.
[0050] Figure 2 Variance in the equation means variance, Time means time, and Euclidean Space means Euclidean space, which refers to a special type of vector space that discusses geometric properties such as length and angle for vectors in a normal three-dimensional space. Diffusion means diffusion model. BFN means Bayesian flow network model. The variance comparison of the generation process of the Bayesian flow network model (BFN) and the diffusion model (Diffusion) recorded in the embodiments of the present invention is as follows: Figure 2 As shown in the figure, it can be clearly seen that the Bayesian flow network model (BFN) recorded in the embodiment of the present invention has a smaller variance in the entire crystal structure generation process and a more stable generation path.
[0051] In some embodiments of the present invention, the Bayesian flow network crystal structure generation model is obtained by performing multiple iterative training of the belief parameters of the initial crystal data based on the Bayesian flow network, and the specific steps include: Processing the belief parameters using the Bayesian flow network to obtain a normal distribution that obeys the initial crystal data, and determining corresponding observation samples based on the normal distribution that obeys the initial crystal data; Using the observed samples to update the corresponding belief parameters to obtain updated belief parameters; Iterative execution utilizes the Bayesian flow network to process the belief parameters to obtain a normal distribution that obeys the initial crystal data, and determines corresponding observation samples based on the normal distribution that obeys the initial crystal data, and uses the observation samples to update the corresponding belief parameters to obtain updated belief parameters, until the number of iterative executions reaches a preset threshold, stops executing the step of updating the belief parameters, and obtains the trained Bayesian flow network crystal structure generation model.
[0052] It can be understood that the step of updating the belief parameter is repeated until the number of iterations reaches a preset threshold.
[0053] It should be noted that the setting of the preset number threshold is based on the value set when the gap between the belief parameter and the actual crystal data value is the smallest. After multiple rounds of training, the trained Bayesian flow network crystal structure generation model is also obtained.
[0054] It can also be understood that the input distribution is the distribution that the data obeys under "natural conditions", while the output distribution is the joint distribution of the data under certain conditions.
[0055] Let the distribution parameter of D-dimensional data x be D-dimensional vector \theta, then the input distribution is defined as: p_{I}(x|\theta) = \prod_{1}^{D} p_{I}(x^{(d)} | \theta^{(d)}) According to the above formula, the component x^{(d)} of the data x in each dimension is only determined by the distribution parameter \theta^{(d)} in the corresponding dimension. The probability density of x is the joint probability density of the variables in all dimensions, which is equal to the product of the probability densities p_{I}(x^{(d)} | \theta^{(d)}) of the variables in each dimension, indicating that the variables in each dimension are independent; at the same time, each dimension obeys the same distribution.
[0056] The output distribution is generated by the Bayesian flow network model with the input distribution parameter \theta as input. In addition, the time variable t is added as input to distinguish each round of information transmission between the input information end and the receiving information end, which will better help the receiving information end to regulate the output distribution. Because the noise intensity (variance) contained in the message sent by the input information end in each round of transmission is different, the amount of information carried by the original data is also different, so the receiving information end must also flexibly adjust accordingly, so that it can guess more accurately.
[0057] Let the Bayesian flow network model be \Psi, then its output is \Psi(\theta, t), so the output distribution is defined as: p_{O}(x|\theta,t) = \prod_{1}^{D} p_{O}(x^{(d)} | \Psi^{(d)}(\theta,t)) From the above formula, we can see that although each x^{(d)} is determined only by \Psi^{(d)}(\theta, t) of the corresponding dimension, the latter is generated by \theta^{(d)} of all dimensions, i.e. \theta. Therefore, the variables of x in each dimension interact with other dimensions. Therefore, the output distribution has "contextual ability", which the input distribution does not have.
[0058] In some embodiments of the present invention, the step of inputting the initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data comprises: Performing sampling processing on the initial crystal data to obtain crystal sampling data; Inputting the crystal sampling data into the trained Bayesian flow network crystal structure generation model, and outputting the belief strength value corresponding to the crystal sampling data; Based on the output belief strength value, performing sampling update processing on the crystal sampling data to obtain updated crystal sampling data; Iteratively execute the step of inputting the crystal sampling data into the trained Bayesian flow network crystal structure generation model, outputting the belief strength value corresponding to the crystal sampling data, and performing sampling and updating processing on the crystal sampling data based on the output belief strength value to obtain the updated crystal sampling data, until the belief strength value reaches a preset strength threshold, then stop iteratively executing the step of updating the crystal sampling data, and use the crystal sampling data corresponding to the belief strength value output for the last time as the target crystal structure data.
[0059] It can be understood that the sampling generation process is roughly as follows: starting from a preset prior, inputting the prior parameter, i.e., the crystal sampling data, into the Bayesian flow network model will output another distribution, sampling from the output distribution and performing some processing on the sample, and then using it as an observed sample to update the prior, i.e., outputting the belief strength value corresponding to the crystal sampling data, and based on the output belief strength value, performing sampling update processing on the crystal sampling data to obtain the updated crystal sampling data (i.e., updated prior). Then, the updated prior parameter (i.e., updated crystal sampling data) is continuously input into the Bayesian flow network model to make it output the corresponding distribution, and the prior parameter is continuously updated and the Bayesian flow network model is allowed to output the corresponding distribution. Until the belief strength value reaches the preset strength threshold, the iterative execution of the step of updating the crystal sampling data is stopped, and the crystal sampling data corresponding to the belief strength value output for the last time is used as the target crystal structure data. The sampling efficiency and generation quality can be greatly improved.
[0060] In some embodiments of the present invention, after the step of inputting the initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data, the method includes: Calculating the on-shell energy of the crystal structure based on the target crystal structure data; The on-shell energy is compared with a preset energy threshold to obtain an energy comparison result, and the state information of the crystal structure is determined according to the energy comparison result.
[0061] It can be understood that in order to test and verify the stability of the generated crystal structure, the target crystal structure data is first calculated using a preset density functional theory algorithm to obtain the total energy of the crystal structure, and then the decomposition substructures of the crystal structure are determined, and the density functional theory algorithm is used to calculate the decomposition energy corresponding to each decomposition substructure, and finally, based on the decomposition energy of the decomposition substructure and the total energy of the crystal structure, the shell energy of the crystal structure is determined.
[0062] It should be noted that Density Functional Theory (DFT) is a method used to study the electronic structure of multi-electron systems, which is widely used in physics and chemistry, especially in materials science and computational chemistry. The main goal of DFT is to use electron density instead of wave function as the basic research quantity, because electron density has only three variables, while wave function has 3N variables (N is the number of electrons), which makes DFT simpler in concept and calculation.
[0063] The core of DFT is the Hohenberg-Kohn theorem, which is divided into two parts: First Theorem: The ground state energy of a system is the only functional of the electron density. This means that the ground state energy can be calculated using the variational principle with the electron density as a variable.
[0064] Theorem 2: Through the variational principle, with the ground state density as a variable, the energy of the system can be minimized through variation, thereby determining the ground state energy.
[0065] The most common way to implement DFT is through the Kohn-Sham method. In the Kohn-Sham DFT framework, the multi-body problem is simplified to the problem of a fictitious non-interacting electron system. The electrons in this system move in an effective potential field, which includes the external potential field and the Coulomb interaction between electrons, especially the exchange correlation.
[0066] In some embodiments of the present invention, determining the on-shell energy of the crystal structure based on the decomposition energy of the decomposed substructure and the total energy of the crystal structure comprises: determining a target sub-energy from said decomposed energies of a plurality of said decomposed sub-structures; The target sub-energy and the total energy of the crystal structure are calculated to obtain the on-shell energy of the crystal structure.
[0067] It can be understood that the steps to calculate the energy on the shell of the crystal structure include the following steps: 1. Calculate the total energy of the compound: You can use methods such as density functional theory (DFT) to first calculate the total energy of the crystal structure (target compound).
[0068] 2. Calculate the energy of possible decomposition products: In a given chemical system, consider all possible phases composed of adjacent compounds and elements, including compounds with different chemical composition ratios. For each possible decomposition product, calculate their total energy.
[0069] That is, all possible phases composed of adjacent compounds and elements are considered, the decomposed substructures after the crystal structure is decomposed are determined, and the decomposition energy corresponding to each decomposed substructure is calculated using the density functional theory algorithm.
[0070] 3. Construct the convex hull: Plot all possible compounds and their corresponding energy points in the composition and energy diagram to obtain the boundary formed by the lowest energy combination points. This boundary is the so-called "convex hull".
[0071] The target sub-energy is the energy value corresponding to the point with the lowest energy in the drawn energy graph. By drawing the energy graph, the energy value boundary can be determined more easily and clearly.
[0072] 4. Calculate the energy above the shell of the crystal structure: By comparing the total energy of the crystal structure (target compound) and the energy of the closest point on the convex hull (target sub-energy), the "energy difference" of the crystal structure (target compound) relative to the convex hull is calculated, which is the energy above hull.
[0073] After calculating the on-shell energy of the crystal structure, the on-shell energy is compared with a preset energy threshold to obtain an energy comparison result, and the state information of the crystal structure is determined according to the energy comparison result.
[0074] It should be noted that the preset energy threshold is zero.
[0075] If the comparison result indicates that the energy on the shell of the crystal structure is zero, it means that the crystal structure (compound) is thermodynamically stable, that is, the state of the crystal structure is stable.
[0076] If the energy value on the shell of the crystal structure is greater than zero, it means that the material may be decomposed into a more stable combination of substances on the convex hull. The larger the energy difference, the more significant the thermodynamic instability, indicating that the state of the crystal structure is unstable. In this way, the stability of the crystal structure can be quickly predicted.
[0077] like Figure 3 Shown is a schematic diagram of the visualization of the crystal structure of the crystal provided by the present invention. Figure 3Perov-5, MP-20, and Carbon-24 are perovskite, material project, and carbon crystal datasets, respectively. CrysBFN is a periodic Bayesian flow network crystal structure generation model. The Perov-5 graph represents the structure of a stable perovskite crystal generated by the model CrysBFN trained on the Perov-5 dataset, the MP-20 graph represents the structure of a stable material project generated by the model CrysBFN trained on the MP-20 dataset, and the Carbon-24 graph represents the structure of a carbon crystal generated by the model CrysBFN trained on the Carbon-24 dataset.
[0078] like Figure 4 Shown is a schematic diagram of the method for generating the crystal structure provided by the present invention. Figure 4 The meaning of Training in the figure is training, which corresponds to the dotted line on the left side of the figure. The meaning of Sampling is sampling, which corresponds to the solid line on the left side of the figure. The meaning of Belief Update is belief updating, and the meaning of Periodic Equiv Network is Bayesian network. The belief parameters of the real data input into the Bayesian flow network training can also be called sample data. All are estimated values. is the variable used to update the belief parameters.
[0079] In some embodiments of the present invention, for Figure 4 The left figure in FIG. 1 is an overview of the training and sampling process of the present invention. During training, the Bayesian stream network model receives the Bayesian stream based on the data distribution. , and outputs an estimated distribution , and minimize the gap between the estimated and true value to improve the belief in the true value M When using the trained network for sampling, the CrysBFN periodic Bayesian flow network crystal structure generation model is based on a preset, uninformative prior At the beginning, we gradually improve by continuously updating our beliefs until we get a high-fidelity .
[0080] Figure 4 Right: A Bayesian flow diagram showing the three modes of the crystal (atom type, atomic coordinates, and lattice parameters) constructed based on discrete, von Mises, and Gaussian distributions.
[0081] Figure 4The categorical in the right figure represents a discrete random variable, and the variable can only take values within a finite size geometry. Gaussian represents a continuous value that obeys a Gaussian distribution. The embodiment of the present invention proposes to model beliefs on a periodic space through the von Mises distribution. When sampling, a t from 0 to 1 is used to represent the entire sampling process. What the right figure wants to express is that at the beginning of sampling, the belief is uninformative, uncertain uniform distribution and Gaussian distribution. After continuous Bayesian updating, the three data can reach a peak, certain, and informative result.
[0082] Furthermore, in some embodiments of the present invention, the periodically repeated atomic coordinates of a crystal are generated in a periodic space by a Bayesian flow method. The general process can be summarized as follows: 1. Initialization: Set the initial parameters, including the prior mean and variance vectors, vocabulary length, and other model parameters.
[0083] 2. Loop step: The algorithm models the interdependence between all dimensions and modes through the loop step.
[0084] 2.1. In each cycle, a parameter combination is first constructed based on the results of the previous step, and the intermediate prediction value is output through the network model.
[0085] 2.2. Use the Bayesian update method to iteratively update the grid parameters, fractional coordinates, and atom types. Bayesian updating introduces new observations to adjust the current belief, thereby getting closer to the true distribution in each iteration.
[0086] 3. Bayesian Update: 3.1 The grid point parameters are updated by sampling new values of the normal distribution and calculating the new mean and weight based on the parameters in the previous step.
[0087] 3.2 For the update of fractional coordinates, use von Mises distribution to sample new angles and combine trigonometric functions to adjust the coordinates.
[0088] 3.3 The atom type is exponentially transformed according to the current parameters to update its probability distribution.
[0089] Through the above-mentioned iterative process, the Bayesian flow network crystal structure generation model algorithm can generate periodically repeated atomic coordinates in the crystal structure, thereby realizing distribution modeling in the periodic space.
[0090] Figure 5 It is a schematic diagram of the comparison of the steps in the crystal structure generation process provided by the present invention.
[0091] Figure 5The Match Rate in the figure is the matching rate, DiffCSP is the diffusion model of the prior art, CrysBFN is the Bayesian flow network crystal structure generation model of the embodiment of the present invention, and Number of Network Forwards is the number of network forwardings, which also means the number of steps and hops. This figure shows the comparison of the effects of the present invention (CrysBFN) and the prior art solution (DiffCSP) on the task of predicting the stable structure of the crystal. Figure 5 It can be seen that the present invention achieves better generation effect with fewer steps than the diffusion model with more steps.
[0092] In some embodiments of the present invention, unlike the diffusion model in the prior art, the Bayesian flow network model generates high-likelihood data by performing Bayesian updating in parameter space.
[0093] For atomic types and lattice parameters, discrete and continuous Bayesian flows are used for generative modeling in some embodiments of the present invention. The specific process is as follows: 1. Generative modeling of lattice parameters: For the lattice parameter $\bm{L}$, it is first initialized to a multivariate normal distribution in three-dimensional Euclidean space, with initial parameters $\vmu_0^L$ and $\vrho_0^L$ set to $\bm{0}{3\times3}$ and $\bm{1}{3\times3}$, respectively. This initialization ensures that the initial Markov process follows a Dirac distribution while maintaining O(3) symmetry.
[0094] Subsequently, by defining the transformation function $\gamma(t) = 1 - \sigma_1^{2t}$ at time step $t$, a variance update model based on linear entropy precision scheduling is constructed to form a Bayesian flow distribution for lattice parameters. This distribution updates the lattice parameters at each time step and optimizes the generation process by minimizing the KL divergence between the sender and receiver distributions.
[0095] After training, the generation process is completed through Bayesian updating based on the network prediction, and the final generated lattice parameters are the prediction results of the network.
[0096] 2. Generative modeling of atomic types: For atomic types, their discrete random variables are located in a simplex, and the initial distribution is a discrete uniform distribution. The Bayesian flow distribution of atomic types is constructed by projecting the category index into a one-hot vector of length K. This process introduces a predefined accuracy schedule $\beta^A(t)$, which is updated at each time step, and the Bayesian flow is transferred by sampling the expectation and Gaussian distribution.
[0097] During the training phase, the error in the generative modeling process is minimized by optimizing the loss function associated with discrete variables. The generation process completes the generation of atomic types by transferring states from the Bayesian update of the previous step. This method combines the Bayesian flow model of continuous and discrete variables, generates and models complex crystal structures through time steps and network predictions, and ensures symmetry and accuracy in the generation process.
[0098] The crystal structure generation method, device, equipment and storage medium provided by the present invention obtain initial crystal data; input the initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data; wherein the Bayesian flow network crystal structure generation model is obtained by multiple iterations of training the belief parameters of the initial crystal data based on the Bayesian flow network; the belief parameters are determined by selecting part of the initial crystal data as sample data and performing data distribution processing on the sample data, and the data distribution is von Mises distribution. It is used to solve the defects of low quality of crystal structures generated in the prior art and low generation efficiency during the generation process, and realizes the generation of crystal structures with relatively stable structural quality by using von Mises distribution as the base distribution and using the trained Bayesian flow network crystal structure generation model, which greatly improves the generation efficiency of the generated crystal structure.
[0099] The device for generating a crystal structure provided by the present invention is described below. The device for generating a crystal structure described below and the method for generating a crystal structure described above can be referred to each other.
[0100] Reference Figure 6 As shown, the present invention also provides a device for generating a crystal structure, comprising the following modules: An acquisition module 610 is used to acquire initial crystal data; A generation module 620 is used to input the initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data; wherein the Bayesian flow network crystal structure generation model is obtained by performing multiple iterative training on the belief parameters of the initial crystal data based on the Bayesian flow network; the belief parameters are determined by selecting part of the initial crystal data as sample data and performing data distribution processing on the sample data, and the data distribution is von Mises distribution.
[0101] Optionally, a crystal structure generation device provided by the present invention, generation module 620, is specifically used to process the belief parameter using the Bayesian flow network to obtain a normal distribution that obeys the initial crystal data, and determine the corresponding observation sample based on the normal distribution that obeys the initial crystal data; Using the observed samples to update the corresponding belief parameters to obtain updated belief parameters; Iterative execution utilizes the Bayesian flow network to process the belief parameters to obtain a normal distribution that obeys the initial crystal data, and determines corresponding observation samples based on the normal distribution that obeys the initial crystal data, and uses the observation samples to update the corresponding belief parameters to obtain updated belief parameters, until the number of iterative executions reaches a preset threshold, stops executing the step of updating the belief parameters, and obtains the trained Bayesian flow network crystal structure generation model.
[0102] Optionally, the present invention provides a device for generating a crystal structure, wherein the generating module 620 is specifically used to perform sampling processing on the initial crystal data to obtain crystal sampling data; Inputting the crystal sampling data into the trained Bayesian flow network crystal structure generation model, and outputting the belief strength value corresponding to the crystal sampling data; Based on the output belief strength value, performing sampling update processing on the crystal sampling data to obtain updated crystal sampling data; Iteratively execute the step of inputting the crystal sampling data into the trained Bayesian flow network crystal structure generation model, outputting the belief strength value corresponding to the crystal sampling data, and performing sampling and updating processing on the crystal sampling data based on the output belief strength value to obtain the updated crystal sampling data, until the belief strength value reaches a preset strength threshold, then stop iteratively executing the step of updating the crystal sampling data, and use the crystal sampling data corresponding to the belief strength value output for the last time as the target crystal structure data.
[0103] Optionally, a crystal structure generation device provided by the present invention is specifically used to calculate the shell energy of the crystal structure based on the target crystal structure data; The on-shell energy is compared with a preset energy threshold to obtain an energy comparison result, and the state information of the crystal structure is determined according to the energy comparison result.
[0104] Optionally, a crystal structure generation device provided by the present invention is specifically used to calculate the target crystal structure data using a preset density functional theory algorithm to obtain the total energy of the crystal structure; Determine the decomposed substructures after the crystal structure is decomposed, and calculate the decomposition energy corresponding to each decomposed substructure using the density functional theory algorithm; The on-shell energy of the crystal structure is determined based on the decomposed energies of the decomposed substructures and the total energy of the crystal structure.
[0105] Optionally, a crystal structure generation device provided by the present invention is specifically used to determine a target sub-energy from the decomposed energies of a plurality of the decomposed sub-structures; The target sub-energy and the total energy of the crystal structure are calculated to obtain the on-shell energy of the crystal structure.
[0106] The crystal structure generation method, device, equipment and storage medium provided by the present invention obtain initial crystal data; input the initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data; wherein the Bayesian flow network crystal structure generation model is obtained by multiple iterations of training the belief parameters of the initial crystal data based on the Bayesian flow network; the belief parameters are determined by selecting part of the initial crystal data as sample data and performing data distribution processing on the sample data, and the data distribution is von Mises distribution. It is used to solve the defects of low quality of crystal structures generated in the prior art and low generation efficiency during the generation process, and realizes the generation of crystal structures with relatively stable structural quality by using von Mises distribution as the base distribution and using the trained Bayesian flow network crystal structure generation model, which greatly improves the generation efficiency of the generated crystal structure.
[0107] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the method for generating a crystal structure, the method comprising: obtaining initial crystal data; inputting the initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data; wherein the Bayesian flow network crystal structure generation model is obtained by performing multiple iterations of training the belief parameters of the initial crystal data based on the Bayesian flow network; the belief parameters are determined by selecting part of the initial crystal data as sample data and performing data distribution processing on the sample data, and the data distribution is von Mises distribution.
[0108] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0109] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the crystal structure generation method provided by the above-mentioned methods, and the method includes: obtaining initial crystal data; inputting the initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data; wherein the Bayesian flow network crystal structure generation model is obtained by performing multiple iterative training on the belief parameters of the initial crystal data based on the Bayesian flow network; the belief parameters are determined by selecting part of the initial crystal data as sample data and performing data distribution processing on the sample data, and the data distribution is a von Mises distribution.
[0110] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the crystal structure generation method provided by the above-mentioned methods, the method comprising: obtaining initial crystal data; inputting the initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data; wherein the Bayesian flow network crystal structure generation model is obtained by performing multiple iterative training on the belief parameters of the initial crystal data based on the Bayesian flow network; the belief parameters are determined by selecting part of the initial crystal data as sample data and performing data distribution processing on the sample data, and the data distribution is a von Mises distribution.
[0111] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0112] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating a crystal structure, characterized in that: include: Obtain initial crystal data; The initial crystal data is input into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data; wherein the Bayesian flow network crystal structure generation model is obtained by performing multiple iterative training on the belief parameters of the initial crystal data based on the Bayesian flow network; the belief parameters are determined by selecting part of the initial crystal data as sample data and performing data distribution processing on the sample data, and the data distribution is von Mises distribution.
2. The method for generating a crystal structure according to claim 1, characterized in that: The Bayesian flow network crystal structure generation model is obtained by performing multiple iterative training of the belief parameters of the initial crystal data on the Bayesian flow network, and the specific steps include: Processing the belief parameters using the Bayesian flow network to obtain a normal distribution that obeys the initial crystal data, and determining corresponding observation samples based on the normal distribution that obeys the initial crystal data; Using the observed samples to update the corresponding belief parameters to obtain updated belief parameters; Iterative execution utilizes the Bayesian flow network to process the belief parameters to obtain a normal distribution that obeys the initial crystal data, and determines corresponding observation samples based on the normal distribution that obeys the initial crystal data, and uses the observation samples to update the corresponding belief parameters to obtain updated belief parameters, until the number of iterative executions reaches a preset threshold, stops executing the step of updating the belief parameters, and obtains the trained Bayesian flow network crystal structure generation model.
3. The method for generating a crystal structure according to claim 2, characterized in that: The step of inputting the initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data comprises: Performing sampling processing on the initial crystal data to obtain crystal sampling data; Inputting the crystal sampling data into the trained Bayesian flow network crystal structure generation model, and outputting the belief strength value corresponding to the crystal sampling data; Based on the output belief strength value, performing sampling update processing on the crystal sampling data to obtain updated crystal sampling data; Iteratively execute the step of inputting the crystal sampling data into the trained Bayesian flow network crystal structure generation model, outputting the belief strength value corresponding to the crystal sampling data, and performing sampling and updating processing on the crystal sampling data based on the output belief strength value to obtain the updated crystal sampling data, until the belief strength value reaches a preset strength threshold, then stop iteratively executing the step of updating the crystal sampling data, and use the crystal sampling data corresponding to the belief strength value output for the last time as the target crystal structure data.
4. The method for generating a crystal structure according to claim 1, characterized in that: After the step of inputting the initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data, the method comprises: Calculating the on-shell energy of the crystal structure based on the target crystal structure data; The on-shell energy is compared with a preset energy threshold to obtain an energy comparison result, and the state information of the crystal structure is determined according to the energy comparison result.
5. The method for generating a crystal structure according to claim 4, characterized in that: The step of calculating the shell energy of the crystal structure based on the target crystal structure data comprises: Calculating the target crystal structure data using a preset density functional theory algorithm to obtain the total energy of the crystal structure; Determine the decomposed substructures after the crystal structure is decomposed, and calculate the decomposition energy corresponding to each decomposed substructure using the density functional theory algorithm; The on-shell energy of the crystal structure is determined based on the decomposed energies of the decomposed substructures and the total energy of the crystal structure.
6. The method for generating a crystal structure according to claim 5, characterized in that: The determining the on-shell energy of the crystal structure based on the decomposed energy of the decomposed substructure and the total energy of the crystal structure comprises: determining a target sub-energy from said decomposed energies of a plurality of said decomposed sub-structures; The target sub-energy and the total energy of the crystal structure are calculated to obtain the on-shell energy of the crystal structure.
7. A device for generating a crystal structure, characterized in that: include: An acquisition module, used for acquiring initial crystal data; A generation module is used to input the initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data; wherein the Bayesian flow network crystal structure generation model is obtained by multiple iterative training of the belief parameters of the initial crystal data based on the Bayesian flow network; the belief parameters are determined by selecting part of the initial crystal data as sample data and performing data distribution processing on the sample data, and the data distribution is von Mises distribution.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for generating a crystal structure according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating a crystal structure according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for generating a crystal structure according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Graph neural network-based indefinite 3D structure generation method and system, and storage medium
CN114334028A
Organic crystal structure prediction method, device, equipment and storage medium
CN116130018A
Molecular generation method and device based on Bayesian flow network
CN118471369A
Method and apparatus for crystal structure optimization
US20150127307A1
Molecular crystal energy calculation method and apparatus and storage medium
WO2023115639A1