Methods, apparatus, equipment and storage media for generating crystal structures
By using the von Mises distribution and Bayesian flow network model, the problems of unstable and inefficient crystal structure generation paths were solved, and high-quality and efficient crystal structure generation was achieved.
Patent Information
- Application Number
- CN202411684271.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-11-22
AI Technical Summary
In existing technologies, the crystal structure generation path is unstable, has high variance, and results in low generation quality and low efficiency.
Using the von Mises distribution as the base distribution, and leveraging a trained Bayesian flow network crystal structure generation model, target crystal structure data is generated through multiple iterations of training and sampling updates.
This improved the stability and efficiency of crystal structure generation, resulting in higher quality crystal structures.
Smart Images

Figure CN119833019B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of crystal technology, and in particular to a method, apparatus, device and storage medium for generating crystal structures. Background Technology
[0002] A 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 determined by the size of the structural units. Crystal materials have a wide range of functions and can be used to prepare various devices such as lasers, LEDs, solar cells, and sensors. They can also be used as catalysts for gas-solid reactions.
[0003] In related technologies, the generation of structures is usually based on a diffusion model, which trains a neural network to denoise a noisy crystal structure in order to generate the crystal structure.
[0004] However, the crystal structure generation path generated by the diffusion model is unstable and has high variance, causing the intermediate states in the generation path to deviate from the data distribution of the stable structure. Furthermore, the crystal structure generated by the diffusion model has low quality and low generation efficiency. Summary of the Invention
[0005] This invention provides a method, apparatus, device, and storage medium for generating crystal structures, which addresses the shortcomings of low-quality crystal structures and low generation efficiency in existing technologies. By using the von Mises distribution as the base distribution and a trained Bayesian flow network crystal structure generation model, the invention generates crystal structures with relatively stable structural quality, thereby greatly improving the generation efficiency of crystal structures.
[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;
[0008] The initial crystal data is input into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data. The Bayesian flow network crystal structure generation model is obtained by iteratively training the belief parameters of the initial crystal data using the Bayesian flow network. The belief parameters are determined by selecting a portion of the initial crystal data as sample data and performing data distribution processing on the sample data, wherein the data distribution is a von Mises distribution.
[0009] Preferably, according to the crystal structure generation method provided by the present invention,
[0010] The Bayesian flow network crystal structure generation model is obtained by iteratively training the belief parameters of the initial crystal data using the Bayesian flow network. The specific steps include:
[0011] The belief parameters are processed using the Bayesian flow network to obtain a normal distribution that follows the initial crystal data, and the corresponding observation samples are determined based on the normal distribution that follows the initial crystal data.
[0012] The observed samples are used to update the corresponding belief parameters to obtain the updated belief parameters;
[0013] The process involves iteratively processing the belief parameters using the Bayesian flow network to obtain a normal distribution that follows the initial crystal data, determining corresponding observation samples based on the normal distribution of the initial crystal data, and updating the corresponding belief parameters using the observation samples to obtain updated belief parameters. This process continues until the number of iterations reaches a preset threshold, at which point the step of updating the belief parameters stops, and the trained Bayesian flow network crystal structure generation model is obtained.
[0014] Preferably, according to the crystal structure generation method provided by 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 includes:
[0015] The initial crystal data is sampled to obtain crystal sample data;
[0016] The crystal sampling data is input into the trained Bayesian flow network crystal structure generation model, and the belief strength value corresponding to the crystal sampling data is output.
[0017] Based on the output belief strength value, the crystal sampling data is sampled and updated to obtain the updated crystal sampling data;
[0018] The process iteratively executes the steps 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 update processing on the crystal sampling data based on the output belief strength value to obtain updated crystal sampling data. This process continues until the belief strength value reaches a preset strength threshold, at which point the iterative execution of updating the crystal sampling data stops, and the crystal sampling data corresponding to the last output belief strength value is used as the target crystal structure data.
[0019] Preferably, according to the crystal structure generation method 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 includes:
[0020] Calculate the shell energy of the crystal structure based on the target crystal structure data;
[0021] The energy on the shell is compared with a preset energy threshold to obtain an energy comparison result, and the state information of the crystal structure is determined based on the energy comparison result.
[0022] Preferably, in a crystal structure generation method provided by the present invention, the step of calculating the shell energy of the crystal structure based on the target crystal structure data includes:
[0023] The total energy of the crystal structure is obtained by calculating the target crystal structure data using a preset density functional theory algorithm.
[0024] The substructures after the crystal structure is decomposed are determined, and the decomposition energy corresponding to each substructure is calculated using the density functional theory algorithm.
[0025] The shell energy of the crystal structure is determined based on the decomposition energy of the substructure and the total energy of the crystal structure.
[0026] Preferably, according to a method for generating a crystal structure provided by the present invention, determining the shell energy of the crystal structure based on the decomposition energy of the substructure and the total energy of the crystal structure includes:
[0027] Determine the target sub-energy from the decomposition energies of the plurality of said decomposition substructures;
[0028] The shell energy of the crystal structure is obtained by calculating the target sub-energy and the total energy of the crystal structure.
[0029] In a second aspect, the present invention also provides a crystal structure generation apparatus, comprising the following modules:
[0030] The acquisition module is used to acquire initial crystal data;
[0031] The 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 iteratively training the belief parameters of the initial crystal data based on the Bayesian flow network; the belief parameters are determined by selecting a portion of the initial crystal data as sample data and performing data distribution processing on the sample data, wherein the data distribution is a von Mises distribution.
[0032] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for generating the crystal structure as described above.
[0033] Fourthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for generating the crystal structure as described above.
[0034] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the method for generating the crystal structure as described above.
[0035] The present invention provides a method, apparatus, device, and storage medium for generating crystal structures. It acquires initial crystal data and inputs this initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data. The Bayesian flow network crystal structure generation model is obtained by iteratively training the Bayesian flow network on the belief parameters of the initial crystal data. The belief parameters are determined by selecting a portion of the initial crystal data as sample data and performing data distribution processing on the sample data; the data distribution is a von Mises distribution. This invention addresses the shortcomings of existing technologies, such as low-quality generated crystal structures and low generation efficiency. By using a von Mises distribution as the base distribution and a pre-trained Bayesian flow network crystal structure generation model, it generates crystal structures with relatively stable structural quality, significantly improving the generation efficiency of crystal structures. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0037] Figure 1This is one of the flowcharts illustrating the crystal structure generation method provided by the present invention.
[0038] Figure 2 This is a schematic diagram of variance comparison during the crystal formation process provided by the present invention.
[0039] Figure 3 This is a schematic diagram of the crystal structure provided by the present invention.
[0040] Figure 4 This is a schematic diagram of the crystal structure generation method provided by the present invention.
[0041] Figure 5 This is a schematic diagram comparing the number of steps in the crystal structure generation process provided by the present invention.
[0042] Figure 6 This is a schematic diagram of the crystal structure generation device provided by the present invention.
[0043] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0045] First, let's analyze some of the terms used in this application:
[0046] Bayesian Flow Network (BFN) is a novel generative model. Its key feature is that it employs a unified framework regardless of whether the data is discrete or continuous. Specifically, based on noisy data samples, it uses Bayesian inference to modify a set of independently distributed parameters, then feeds these parameters into the neural network to obtain an output distribution. This output distribution is no longer composed of independent parameters, thus gaining the ability to capture information from the data.
[0047] Von Mises distribution: In probability theory and directional statistics, the von Mises distribution refers to a continuous probability distribution model on a circle, also known as the circular normal distribution.
[0048] The von Mises probability density function of the cyclic angle x:
[0049] f(x|μ, κ)=exp(κcos(x-μ)) / (2πI0(κ)), where I0(x) is the 0th order modified Bessel function.
[0050] Energy above hull: This is a concept used to measure the thermodynamic stability of a material. It describes the difference in free energy between a material and its most stable possible decomposition products, and is commonly used to determine the stability of a material.
[0051] Discretizing data refers to the process or result of transforming continuous data into discrete data, which implicitly involves a transformation process. Typically, continuous numerical values can be divided into multiple equal-length intervals, and then continuous numerical values within the same interval are represented using the same discrete numerical value (or category).
[0052] In related technologies, structure generation is usually based on diffusion models, which train neural networks to denoise noisy crystal structures in order to generate crystal structures. However, the crystal structure generation path using diffusion models is unstable and has high variance, causing intermediate states in the generation path to deviate from the data distribution of stable structures. Furthermore, crystal structures generated using diffusion models have low quality and low generation efficiency.
[0053] The following combination Figures 1-7 This invention describes a method, apparatus, device, and storage medium for generating crystal structures, which addresses the shortcomings of existing technologies such as low quality and low generation efficiency in generating crystal structures. By using a von Mises distribution as the base distribution and a trained Bayesian flow network crystal structure generation model, the invention generates crystal structures with relatively stable structural quality, thereby greatly improving the generation efficiency of crystal structures.
[0054] Figure 1 This is one of the flowcharts illustrating the crystal structure generation method provided by the present invention, such as... Figure 1 As shown, the method includes, but is not limited to, steps S100 to S200:
[0055] S100, Obtain initial crystal data;
[0056] S200, 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 iteratively training the belief parameters of the initial crystal data using the Bayesian flow network; the belief parameters are determined by selecting a portion of the initial crystal data as sample data and performing data distribution processing on the sample data, wherein the data distribution is a von Mises distribution.
[0057] In step S100 of some embodiments, initial crystal data is acquired.
[0058] It should be noted that initial crystal data can be obtained from a preset database. Initial crystal data may include, but is not limited to, unit cell data, crystal precursor data, lattice parameters, atom type data, three-dimensional coordinates, number of atoms, crystal plane data, etc.
[0059] 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.
[0060] It should be noted that the Bayesian flow network crystal structure generation model is obtained by iteratively training the belief parameters of the initial crystal data using the Bayesian flow network.
[0061] 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.
[0062] Furthermore, the data distribution is a von Mises distribution.
[0063] The initial crystal data can be divided, and a portion of the crystal data can be selected as sample data to construct a von Mises distribution based on the sample data, thereby determining the belief parameters.
[0064] In some embodiments of the present invention, if the probability density function of a continuous random variable X is:
[0065]
[0066] Where k>0, , It is a modified Bessel function of the first kind of order 0.
[0067] Then X is said to follow a von Mises distribution with parameter .
[0068] parameter and It plays a role similar to the mathematical expectation and variance of a normal distribution.
[0069] When k is close to 0, the distribution approaches uniformity; as k increases, the distribution approaches a normal distribution. .
[0070] The von Mises distribution has a similar form to the normal distribution, and:
[0071] .
[0072] It's important to clarify that Bayesian inference is the process of inferring the overall situation from a sample. A major difference between Bayesian and frequentist inference is that frequentist inference assumes the overall frequency is constant, though we cannot know for sure. However, with a sufficiently large sample size, the frequency will gradually converge to the true probability value. Therefore, frequentist inference does not assign a probability to the parameters of the hypothesis or model. For example, frequentist inference wouldn't state "the probability of heads in the next coin toss is 1 / 2," but rather assumes that through numerous experiments (assuming the coin is hard and perfectly fair), the frequency of heads will gradually approach 1 / 2. Therefore, frequentist inference typically provides a statistic as a confidence interval. Bayesian inference, on the other hand, first assigns a prior probability (e.g., the experimenter's empirical assumption of the probability of heads) or a prior probability distribution to the hypothesis based on prior knowledge such as experience and previous research. Then, it uses experimental evidence to refine this prior probability, obtaining a posterior probability or posterior probability distribution that better fits the evidence.
[0073] Bayesian flow networks utilize prior information about the input to output another distribution, which serves as an estimate of the true data distribution. The final samples generated by the model are sampled from this output distribution.
[0074] Figure 2 This is a schematic diagram of variance comparison during the crystal formation process provided by the present invention.
[0075] Figure 2 In this context, "Variance" refers to variance, "Time" refers to time intervals, "Euclidean Space" refers to a special type of vector space used to discuss geometric properties such as length and angles of vectors in a typical three-dimensional space, "Diffusion" refers to a diffusion model, and "BFN" refers to a Bayesian flow network model. The variance comparison of the generation processes of the Bayesian flow network model (BFN) and the diffusion model (Diffusion) described in the embodiments of this invention is as follows: Figure 2 As shown in the figure, it can be clearly seen that the Bayesian flow network model (BFN) described in the embodiments of the present invention has smaller variance and a more stable generation path throughout the entire crystal structure generation process.
[0076] In some embodiments of the present invention, the Bayesian flow network crystal structure generation model is obtained by iteratively training the belief parameters of the initial crystal data using the Bayesian flow network, and the specific steps include:
[0077] The belief parameters are processed using the Bayesian flow network to obtain a normal distribution that follows the initial crystal data, and the corresponding observation samples are determined based on the normal distribution that follows the initial crystal data.
[0078] The observed samples are used to update the corresponding belief parameters to obtain the updated belief parameters;
[0079] The process involves iteratively processing the belief parameters using the Bayesian flow network to obtain a normal distribution that follows the initial crystal data, determining corresponding observation samples based on the normal distribution of the initial crystal data, and updating the corresponding belief parameters using the observation samples to obtain updated belief parameters. This process continues until the number of iterations reaches a preset threshold, at which point the step of updating the belief parameters stops, and the trained Bayesian flow network crystal structure generation model is obtained.
[0080] Understandably, the step of updating the belief parameters is repeated until the number of iterations reaches a preset threshold.
[0081] It should be noted that the preset threshold for the number of iterations is set based on the value that minimizes the difference between the belief parameter and the actual crystal data value. Through multiple rounds of training, a well-trained Bayesian flow network crystal structure generation model is obtained.
[0082] It can also be understood that the input distribution is the distribution that the data follows under "natural conditions", while the output distribution is the joint distribution of the data under certain conditions.
[0083] Let the distribution parameters of D-dimensional data x be a D-dimensional vector θ, then the input distribution is defined as:
[0084] p_{I}(x|\theta) = \prod_{1}^{D} p_{I}(x^{(d)} | \theta^{(d)})
[0085] According to the above formula, the component x^{(d)} of data x in each dimension is determined only by the distribution parameter \theta^{(d)} in the corresponding dimension. The probability density of x is the joint probability density of variables in all dimensions, which is equal to the product of the probability densities p_{I}(x^{(d)} | \theta^{(d)}) of variables in each dimension. This shows that the variables in each dimension are independent; at the same time, each dimension follows the same distribution.
[0086] The output distribution is generated by the Bayesian flow network model using the parameter θ of the input distribution as input. Additionally, a time variable t is added as input to differentiate between each round of information transmission at the input and receiving ends. This helps the receiving end better regulate the output distribution. Because the noise intensity (variance) of the messages sent by the input end varies in each round of transmission, the amount of information in the original data carried also differs. Therefore, the receiving end must flexibly adjust accordingly to achieve more accurate predictions.
[0087] Let the Bayesian flow network model be denoted as ∀Psi, then its output is ∀Psi(∀theta, t), and the output distribution is defined as:
[0088] p_{O}(x|\theta,t) = \prod_{1}^{D} p_{O}(x^{(d)} | \Psi^{(d)}(\theta,t))
[0089] As can be seen from the above formula, although each x^{(d)} is only determined by the corresponding dimension's \Psi^{(d)}(\theta, t), the latter is generated by the \theta^{(d)} of all dimensions, i.e., \theta. Therefore, the variables of x in each dimension interact with other dimensions. Thus, the output distribution has "contextuality", which the input distribution does not have.
[0090] 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 includes:
[0091] The initial crystal data is sampled to obtain crystal sample data;
[0092] The crystal sampling data is input into the trained Bayesian flow network crystal structure generation model, and the belief strength value corresponding to the crystal sampling data is output.
[0093] Based on the output belief strength value, the crystal sampling data is sampled and updated to obtain the updated crystal sampling data;
[0094] The process iteratively executes the steps 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 update processing on the crystal sampling data based on the output belief strength value to obtain updated crystal sampling data. This process continues until the belief strength value reaches a preset strength threshold, at which point the iterative execution of updating the crystal sampling data stops, and the crystal sampling data corresponding to the last output belief strength value is used as the target crystal structure data.
[0095] The sampling and generation process can be understood as follows: Starting with a preset prior, the prior parameters, i.e., the crystal sampling data, are input into the Bayesian flow network model, which outputs another distribution. Samples are taken from this output distribution, and the samples are processed. These samples are then used as observation samples to update the prior, i.e., outputting the belief strength value corresponding to the crystal sampling data. Based on the output belief strength value, the crystal sampling data is sampled and updated to obtain the updated crystal sampling data (i.e., the updated prior). The updated prior parameters (i.e., the updated crystal sampling data) are then input into the Bayesian flow network model to output the corresponding distribution. This process of updating the prior parameters and outputting the corresponding distribution continues until the belief strength value reaches a preset strength threshold. At this point, the iterative process of updating the crystal sampling data stops, and the crystal sampling data corresponding to the last output belief strength value is used as the target crystal structure data. This significantly improves sampling efficiency and generation quality.
[0096] 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:
[0097] Calculate the shell energy of the crystal structure based on the target crystal structure data;
[0098] The energy on the shell is compared with a preset energy threshold to obtain an energy comparison result, and the state information of the crystal structure is determined based on the energy comparison result.
[0099] Understandably, 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. Then, the substructures after the crystal structure is decomposed are determined, and the decomposition energy corresponding to each substructure is calculated using the density functional theory algorithm. Finally, based on the decomposition energy of the substructures and the total energy of the crystal structure, the shell energy of the crystal structure is determined.
[0100] It should be noted that Density Functional Theory (DFT) is a method for studying the electronic structure of multi-electron systems, widely used in physics and chemistry, particularly in materials science and computational chemistry. The main goal of DFT is to use electron density instead of the wave function as the fundamental quantity of study, because electron density has only three variables, while the wave function has 3N variables (N being the number of electrons), making DFT conceptually and computationally simpler.
[0101] The core of DFT is the Hohenberg-Kohn theorem, which consists of two parts:
[0102] First Theorem: The ground state energy of a system is the unique functional of the electron density. This means that the ground state energy can be calculated using the variational principle, with the electron density as the variable.
[0103] Second Theorem: By using the variational principle, with the ground state density as the variable, the energy of the system can be minimized through variation, thereby determining the ground state energy.
[0104] The most common implementation of the DFT is through the Kohn-Sham method. In the Kohn-Sham DFT framework, the many-body problem is simplified to a hypothetical non-interacting electronic system. Electrons in this system move within an effective potential field, which includes the external potential field and the Coulomb interactions between electrons, particularly exchange-correlation interactions.
[0105] In some embodiments of the present invention, determining the shell energy of the crystal structure based on the decomposition energy of the substructure and the total energy of the crystal structure includes:
[0106] Determine the target sub-energy from the decomposition energies of the plurality of said decomposition substructures;
[0107] The shell energy of the crystal structure is obtained by calculating the target sub-energy and the total energy of the crystal structure.
[0108] Understandably, calculating the energy on the shell of a crystal structure involves the following steps:
[0109] 1. Calculate the total energy of the compound: The total energy of the crystal structure (target compound) can be calculated first using methods such as density functional theory (DFT).
[0110] 2. Calculate the energies of possible decomposition products: Within a given chemical system, consider all possible phases composed of adjacent compounds and elements, including compounds with different chemical proportions. For each possible decomposition product, calculate their total energy.
[0111] That is, considering all possible phases composed of adjacent compounds and elements, the decomposition substructures after the crystal structure is decomposed are determined, and the decomposition energy corresponding to each substructure is calculated using the density functional theory algorithm.
[0112] 3. Constructing the convex hull: Plot all possible compounds and their corresponding energy points on the composition and energy diagram to obtain the boundary formed by the lowest energy combination points. This boundary is called the "convex hull".
[0113] The target sub-energy is the energy value corresponding to the lowest energy point in the drawn energy map. Drawing an energy map makes it easier and clearer to determine the energy value boundary.
[0114] 4. Calculate the shell energy of the crystal structure: By comparing the total energy of the crystal structure (target compound) with 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 energy above hull.
[0115] After calculating the shell energy of the crystal structure, the 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 based on the energy comparison result.
[0116] It should be noted that the preset energy threshold is zero.
[0117] If the comparison result indicates that the shell energy 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.
[0118] If the energy value on the shell of a crystal structure is greater than zero, it indicates that the material may decompose into more stable material combinations on the hull. The larger the energy difference, the more significant the thermodynamic instability, indicating that the crystal structure is unstable. This method can be used to quickly predict the stability of crystal structures.
[0119] like Figure 3 The image shown is a schematic diagram of the crystal structure provided by this invention. Figure 3In the dataset, Perov-5, MP-20, and Carbon-24 represent the perovskite, Material Project, and carbon crystal datasets, respectively. CrysBFN is a periodic Bayesian flow network crystal structure generation model. The graph from Perov-5 represents the structure of a stable perovskite crystal generated by the CrysBFN model trained on the Perov-5 dataset; the graph from MP-20 represents the structure of a stable Material Project crystal generated by the CrysBFN model trained on the MP-20 dataset; and the graph from Carbon-24 represents the structure of a carbon crystal generated by the CrysBFN model trained on the Carbon-24 dataset.
[0120] like Figure 4 The diagram shows a method for generating crystal structures provided by the present invention. Figure 4 In this context, "Training" refers to the training process, corresponding to the dashed line on the left side of the diagram; "Sampling" refers to the sampling process, corresponding to the solid line on the left side of the diagram; "Belief Update" refers to the belief update process; and "Periodic Equiv Network" refers to a Bayesian network. The belief parameters are the real data used to train the Bayesian flow network, which can also be referred to as the sample data. All are estimated values. This is the variable used to update the belief parameter.
[0121] In some embodiments of the present invention, for Figure 4 The left-hand diagram illustrates the training and sampling process of this invention. During training, the Bayesian flow network model receives data from a Bayesian flow based on the data distribution. And by outputting an estimated distribution And to improve the belief in the true value M by minimizing the gap between the estimate and the true value. When sampling using a trained network, the CrysBFN periodic Bayesian flow network crystal structure generation model relies on pre-set, uninformed priors. Initially, improvements are made gradually through continuous belief updates until a high fidelity is achieved. .
[0122] Figure 4 The right figure in the figure shows the Bayesian flow of the three modes of the crystal (atomic type, atomic coordinates, and lattice parameters), which is constructed based on discrete distributions, von Mises distributions, and Gaussian distributions.
[0123] Figure 4In the right-hand diagram, "categorical" represents a discrete random variable, which can only take values within a finite geometric range. "Gaussian" represents a continuous value following a Gaussian distribution. This invention proposes modeling beliefs in a periodic space using a von Mises distribution. During sampling, a value 't' ranging from 0 to 1 represents the entire sampling process. The right-hand diagram illustrates that at the beginning of sampling, beliefs are uninformative, following uncertain uniform and Gaussian distributions. Through continuous Bayesian updates, all three data points can reach a peak, a definite, and informative result.
[0124] Furthermore, in some embodiments of the present invention, the periodic repeating atomic coordinates of the crystal are generated in periodic space using a Bayesian flow method. The general process can be summarized as follows:
[0125] 1. Initialization: Set the initial parameters, including the prior mean and variance vector, vocabulary length, and other model parameters.
[0126] 2. Iterative Steps: The algorithm models the interdependencies between all dimensions and modalities through iterative steps.
[0127] 2.1 In each iteration, first construct the parameter combination based on the results of the previous step, and then output the intermediate prediction value through the network model.
[0128] 2.2 A Bayesian update method is used to iteratively update grid parameters, fractional coordinates, and atom types. Bayesian update introduces new observations to adjust the current belief, thus getting closer to the true distribution in each iteration.
[0129] 3. Bayesian Update:
[0130] 3.1 The grid parameters are updated by sampling new values from the normal distribution and combining them with the parameters from the previous step to calculate new mean and weights.
[0131] 3.2 For updating the fractional coordinates, the new angles are sampled using the von Mises distribution, and the coordinates are adjusted in combination with trigonometric functions.
[0132] 3.3 The atom type then undergoes an exponential transformation based on the current parameters, thereby updating its probability distribution.
[0133] Through the aforementioned iterative process, the Bayesian flow network crystal structure generation model algorithm can generate periodically repeating atomic coordinates in the crystal structure, thereby achieving distribution modeling in the periodic space.
[0134] Figure 5 This is a schematic diagram comparing the number of steps in the crystal structure generation process provided by the present invention.
[0135] Figure 5In this context, "Match Rate" refers to the matching rate, "DiffCSP" is a diffusion model from existing technologies, "CrysBFN" is the Bayesian flow network crystal structure generation model of this invention, and "Number of Network Forwards" refers to the number of network forwards, also known as the number of steps or hops. This figure compares the performance of this invention (CrysBFN) and existing technologies (DiffCSP) in the task of predicting stable crystal structures. Figure 5 It can be seen that the present invention achieves better generation results than the diffusion model with more steps when fewer steps are required.
[0136] In some embodiments of the present invention, unlike diffusion models in the prior art, the Bayesian flow network model generates high-likelihood data by performing Bayesian updates in the parameter space.
[0137] For the atom type and lattice parameters, discrete and continuous Bayesian flows are used for generative modeling in some embodiments of the present invention, as detailed below:
[0138] 1. Modeling the generation of lattice parameters:
[0139] For the lattice parameter $\bm{L}$, it is first initialized as a multivariate normal distribution in three-dimensional Euclidean space, with its 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.
[0140] Subsequently, by defining a transformation function $\gamma(t) = 1 - \sigma_1^{2t}$ for time step $t$, a variance update model based on linear entropy precision scheduling is constructed, forming a Bayesian flow distribution for the lattice parameters. This distribution updates the lattice parameters at each time step, optimizing the generation process by minimizing the KL divergence between the sender and receiver distributions.
[0141] After training, the generation process is completed through Bayesian updates based on network predictions, and the final generated lattice parameters are the prediction results of the network.
[0142] 2. Atom type generation modeling:
[0143] For the atom type, its discrete random variables reside in a simplex and are initially distributed as discrete uniform distributions. A Bayesian flow distribution for the atom type is constructed by projecting the class indices as one-hot vectors of length K. This process introduces a predefined precision schedule $\beta^A(t)$, updated at each time step, and performs the Bayesian flow transition by sampling the expectation and Gaussian distribution.
[0144] During the training phase, errors in the generative modeling process are minimized by optimizing a loss function associated with discrete variables. The generation process then proceeds by transitioning states from the Bayesian update in the previous step, thereby generating the atom types. This approach combines Bayesian flow models of continuous and discrete variables, using time steps and network predictions to generate and model complex crystal structures, ensuring symmetry and accuracy in the generation process.
[0145] The present invention provides a method, apparatus, device, and storage medium for generating crystal structures. It acquires initial crystal data and inputs this initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data. The Bayesian flow network crystal structure generation model is obtained by iteratively training the Bayesian flow network on the belief parameters of the initial crystal data. The belief parameters are determined by selecting a portion of the initial crystal data as sample data and performing data distribution processing on the sample data; the data distribution is a von Mises distribution. This invention addresses the shortcomings of existing technologies, such as low-quality generated crystal structures and low generation efficiency. By using a von Mises distribution as the base distribution and a pre-trained Bayesian flow network crystal structure generation model, it generates crystal structures with relatively stable structural quality, significantly improving the generation efficiency of crystal structures.
[0146] The crystal structure generation apparatus provided by the present invention is described below. The crystal structure generation apparatus described below can be referred to in correspondence with the crystal structure generation method described above.
[0147] Reference Figure 6 As shown, the present invention also provides a crystal structure generation apparatus, comprising the following modules:
[0148] Module 610 is used to acquire initial crystal data;
[0149] The 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 iteratively training the belief parameters of the initial crystal data based on the Bayesian flow network; the belief parameters are determined by selecting a portion 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.
[0150] Optionally, the present invention provides a crystal structure generation device, wherein the generation module 620 is specifically used to process the belief parameters using the Bayesian flow network to obtain a normal distribution that follows the initial crystal data, and to determine the corresponding observation samples based on the normal distribution that follows the initial crystal data;
[0151] The observed samples are used to update the corresponding belief parameters to obtain the updated belief parameters;
[0152] The process involves iteratively processing the belief parameters using the Bayesian flow network to obtain a normal distribution that follows the initial crystal data, determining corresponding observation samples based on the normal distribution of the initial crystal data, and updating the corresponding belief parameters using the observation samples to obtain updated belief parameters. This process continues until the number of iterations reaches a preset threshold, at which point the step of updating the belief parameters stops, and the trained Bayesian flow network crystal structure generation model is obtained.
[0153] Optionally, the present invention provides a crystal structure generation device, wherein the generation module 620 is specifically used to sample the initial crystal data to obtain crystal sampling data;
[0154] The crystal sampling data is input into the trained Bayesian flow network crystal structure generation model, and the belief strength value corresponding to the crystal sampling data is output.
[0155] Based on the output belief strength value, the crystal sampling data is sampled and updated to obtain the updated crystal sampling data;
[0156] The process iteratively executes the steps 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 update processing on the crystal sampling data based on the output belief strength value to obtain updated crystal sampling data. This process continues until the belief strength value reaches a preset strength threshold, at which point the iterative execution of updating the crystal sampling data stops, and the crystal sampling data corresponding to the last output belief strength value is used as the target crystal structure data.
[0157] Optionally, the present invention provides a crystal structure generation apparatus, specifically used to calculate the shell energy of the crystal structure based on the target crystal structure data;
[0158] The energy on the shell is compared with a preset energy threshold to obtain an energy comparison result, and the state information of the crystal structure is determined based on the energy comparison result.
[0159] Optionally, the present invention provides a crystal structure generation device, 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;
[0160] The substructures after the crystal structure is decomposed are determined, and the decomposition energy corresponding to each substructure is calculated using the density functional theory algorithm.
[0161] The shell energy of the crystal structure is determined based on the decomposition energy of the substructure and the total energy of the crystal structure.
[0162] Optionally, the present invention provides a crystal structure generation apparatus, specifically used to determine a target sub-energy from the decomposition energies of a plurality of said decomposed substructures;
[0163] The shell energy of the crystal structure is obtained by calculating the target sub-energy and the total energy of the crystal structure.
[0164] The present invention provides a method, apparatus, device, and storage medium for generating crystal structures. It acquires initial crystal data and inputs this initial crystal data into a pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data. The Bayesian flow network crystal structure generation model is obtained by iteratively training the Bayesian flow network on the belief parameters of the initial crystal data. The belief parameters are determined by selecting a portion of the initial crystal data as sample data and performing data distribution processing on the sample data; the data distribution is a von Mises distribution. This invention addresses the shortcomings of existing technologies, such as low-quality generated crystal structures and low generation efficiency. By using a von Mises distribution as the base distribution and a pre-trained Bayesian flow network crystal structure generation model, it generates crystal structures with relatively stable structural quality, significantly improving the generation efficiency of crystal structures.
[0165] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7As shown, the electronic device may include a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, communications interface 720, and memory 730 communicate with each other via the communication bus 740. The processor 710 can call logic instructions in the memory 730 to execute a crystal structure generation method, which includes: acquiring 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 iteratively training the belief parameters of the initial crystal data using a Bayesian flow network; the belief parameters are determined by selecting a portion of the initial crystal data as sample data and performing data distribution processing on the sample data, wherein the data distribution is a von Mises distribution.
[0166] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0167] On the other hand, the present invention also provides a computer program product, which includes a computer program that 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 methods. The method includes: acquiring 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 iteratively training the belief parameters of the initial crystal data based on the Bayesian flow network; the belief parameters are determined by selecting a portion of the initial crystal data as sample data and performing data distribution processing on the sample data, wherein the data distribution is a von Mises distribution.
[0168] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a method for generating crystal structures provided by the methods described above. This method includes: acquiring 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 iteratively training the Bayesian flow network on the belief parameters of the initial crystal data; the belief parameters are determined by selecting a portion of the initial crystal data as sample data and performing data distribution processing on the sample data, wherein the data distribution is a von Mises distribution.
[0169] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0170] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0171] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate 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 iteratively training the Bayesian flow network on the belief parameters of the initial crystal data; the belief parameters are determined by selecting a portion of the initial crystal data as sample data and performing data distribution processing on the sample data, wherein the data distribution is a von Mises distribution; the step of inputting the initial crystal data into the pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data includes: The initial crystal data is sampled to obtain crystal sample data; The crystal sampling data is input into the trained Bayesian flow network crystal structure generation model, and the belief strength value corresponding to the crystal sampling data is output. Based on the output belief strength value, the crystal sampling data is sampled and updated to obtain the updated crystal sampling data; The process iteratively executes the steps 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 update processing on the crystal sampling data based on the output belief strength value to obtain the updated crystal sampling data. This process continues until the belief strength value reaches a preset strength threshold, at which point the iterative execution of updating the crystal sampling data stops, and the crystal sampling data corresponding to the last output belief strength value is used as the target crystal structure data. Calculate the shell energy of the crystal structure based on the target crystal structure data; The energy on the shell is compared with a preset energy threshold to obtain an energy comparison result, and the state information of the crystal structure is determined based on the energy comparison result.
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 iteratively training the belief parameters of the initial crystal data using the Bayesian flow network. The specific steps include: The belief parameters are processed using the Bayesian flow network to obtain a normal distribution that follows the initial crystal data, and the corresponding observation samples are determined based on the normal distribution that follows the initial crystal data. The observed samples are used to update the corresponding belief parameters to obtain the updated belief parameters; The process involves iteratively processing the belief parameters using the Bayesian flow network to obtain a normal distribution that follows the initial crystal data, determining corresponding observation samples based on the normal distribution of the initial crystal data, and updating the corresponding belief parameters using the observation samples to obtain updated belief parameters. This process continues until the number of iterations reaches a preset threshold, at which point the step of updating the belief parameters stops, and the trained Bayesian flow network crystal structure generation model is obtained.
3. The method for generating a crystal structure according to claim 1, characterized in that, The calculation of the shell energy of the crystal structure based on the target crystal structure data includes: The total energy of the crystal structure is obtained by calculating the target crystal structure data using a preset density functional theory algorithm. The substructures after the crystal structure is decomposed are determined, and the decomposition energy corresponding to each substructure is calculated using the density functional theory algorithm. The shell energy of the crystal structure is determined based on the decomposition energy of the substructure and the total energy of the crystal structure.
4. The method for generating a crystal structure according to claim 3, characterized in that, Determining the shell energy of the crystal structure based on the decomposition energy of the substructure and the total energy of the crystal structure includes: Determine the target sub-energy from the decomposition energies of the plurality of said decomposition substructures; The shell energy of the crystal structure is obtained by calculating the target sub-energy and the total energy of the crystal structure.
5. A crystal structure generation apparatus, characterized in that, include: The acquisition module is used to acquire 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. The Bayesian flow network crystal structure generation model is obtained by iteratively training the belief parameters of the initial crystal data using a Bayesian flow network. The belief parameters are determined by selecting a portion of the initial crystal data as sample data and performing data distribution processing on the sample data; the data distribution is a von Mises distribution. Specifically, inputting the initial crystal data into the pre-trained Bayesian flow network crystal structure generation model to generate target crystal structure data involves sampling the initial crystal data to obtain crystal sample data. The crystal sample data is then input into the trained Bayesian flow network crystal structure generation model, which outputs the belief strength value corresponding to the crystal sample data. Based on the output... The process involves: 1) sampling and updating the crystal sample data to obtain updated crystal sample data; 2) iteratively executing the steps of inputting the crystal sample data into the trained Bayesian flow network crystal structure generation model, outputting the belief strength value corresponding to the crystal sample data, and updating the crystal sample data based on the output belief strength value to obtain updated crystal sample data; 3) stopping the iterative execution of updating the crystal sample data when the belief strength value reaches a preset strength threshold, and using the crystal sample data corresponding to the last output belief strength value as the target crystal structure data; 4) calculating the shell energy of the crystal structure based on the target crystal structure data; 5) comparing the shell energy with a preset energy threshold to obtain an energy comparison result, and determining the state information of the crystal structure based on the energy comparison result.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method for generating the crystal structure as described in any one of claims 1 to 4.
7. 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, it implements the method for generating the crystal structure as described in any one of claims 1 to 4.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method for generating the crystal structure as described in any one of claims 1 to 4.
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