# Fileset

[Rapid  comprehensive search of crystalline phases from X-ray diffraction in seconds via GPU-accelerated Bayesian variational inference.pdf](https://mdr.nims.go.jp/filesets/2f4ec8ae-bdeb-4b05-a386-6d8047d95c16/download)

## Creator

[Ryo Murakami](https://orcid.org/0000-0001-8585-9268), [Kenji Nagata](https://orcid.org/0000-0001-9894-4461), [Yoshitaka Matsushita](https://orcid.org/0000-0002-4968-8905), [Masahiko Demura](https://orcid.org/0000-0002-7308-3041)

## Rights

[Creative Commons BY Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/)

## Other metadata

[Rapid, comprehensive search of crystalline phases from X-ray diffraction in seconds via GPU-accelerated Bayesian variational inference](https://mdr.nims.go.jp/datasets/64573b9f-708f-425c-a31d-a9891444c16c)

## Fulltext

Rapid, comprehensive search of crystalline phases from X-ray diffraction in seconds via GPU-acceleraScience and Technology of Advanced Materials: MethodsISSN: 2766-0400 (Online) Journal homepage: www.tandfonline.com/journals/tstm20Rapid, comprehensive search of crystallinephases from X-ray diffraction in seconds via GPU-accelerated Bayesian variational inferenceRyo Murakami, Kenji Nagata, Yoshitaka Matsushita & Masahiko DemuraTo cite this article: Ryo Murakami, Kenji Nagata, Yoshitaka Matsushita & Masahiko Demura(2025) Rapid, comprehensive search of crystalline phases from X-ray diffraction in secondsvia GPU-accelerated Bayesian variational inference, Science and Technology of AdvancedMaterials: Methods, 5:1, 2485016, DOI: 10.1080/27660400.2025.2485016To link to this article:  https://doi.org/10.1080/27660400.2025.2485016© 2025 The Author(s). Published by NationalInstitute for Materials Science in partnershipwith Taylor & Francis GroupPublished online: 17 Apr 2025.Submit your article to this journal Article views: 345View related articles View Crossmark dataFull Terms & Conditions of access and use can be found athttps://www.tandfonline.com/action/journalInformation?journalCode=tstm20https://www.tandfonline.com/journals/tstm20?src=pdfhttps://www.tandfonline.com/action/showCitFormats?doi=10.1080/27660400.2025.2485016https://doi.org/10.1080/27660400.2025.2485016https://www.tandfonline.com/action/authorSubmission?journalCode=tstm20&show=instructions&src=pdfhttps://www.tandfonline.com/action/authorSubmission?journalCode=tstm20&show=instructions&src=pdfhttps://www.tandfonline.com/doi/mlt/10.1080/27660400.2025.2485016?src=pdfhttps://www.tandfonline.com/doi/mlt/10.1080/27660400.2025.2485016?src=pdfhttp://crossmark.crossref.org/dialog/?doi=10.1080/27660400.2025.2485016&domain=pdf&date_stamp=17%20Apr%202025http://crossmark.crossref.org/dialog/?doi=10.1080/27660400.2025.2485016&domain=pdf&date_stamp=17%20Apr%202025https://www.tandfonline.com/action/journalInformation?journalCode=tstm20Rapid, comprehensive search of crystalline phases from X-ray diffraction in seconds via GPU-accelerated Bayesian variational inferenceRyo Murakami a, Kenji Nagatab, Yoshitaka Matsushitaa and Masahiko DemuraaaResearch Network and Facility Services Division, National Institute for Materials Science, Tsukuba, Japan; bCenter for Basic Research on Materials, National Institute for Materials Science, Tsukuba, JapanABSTRACTIn analysis of X-ray diffraction data, identifying the crystalline phase is important for interpreting the material. The typical method is identifying the crystalline phase from the coincidence of the main diffraction peaks. This method identifies crystalline phases by matching them as individual crystalline phases rather than as combinations of crystalline phases, in the same way as the greedy method. If multiple candidates are obtained, the researcher must subjectively select the crystalline phases. Thus, the identification results depend on the researcher’s experience and knowledge of materials science. To solve this problem, we have developed a Bayesian estimation method to identify the combination of crystalline phases, taking the entire profile into account. This method estimates the Bayesian posterior probability of crystalline phase combinations by performing an approximate exhaustive search of all possible combinations. It is a method for identifying crystalline phases that takes into account all peak shapes and phase combinations. However, it takes a few hours to obtain the analysis results. The aim of this study is to develop a Bayesian method for crystalline phase identification that can provide results in seconds, which is a practical calculation time. We introduce variational sparse estimation and GPU computing. Our method is able to provide results within 10 seconds even when analysing 250 candidate crystalline phase combinations. Furthermore, the crystalline phases identified by our method are consistent with the results of previous studies that used a high-precision algorithm.IMPACT STATEMENTWe introduce variational sparse estimation and GPU computing. Our method is able to provide the combination of crystalline phases within 10 seconds even when analysing 250 candidate crystalline phase combinations.ARTICLE HISTORY Received 16 January 2025  Revised 17 March 2025  Accepted 24 March 2025 KEYWORDS X-ray diffraction; GPU computing; sparse modeling; bayesian inference; model selectionCONTACT Ryo Murakami MURAKAMI.Ryo@nims.go.jp Research Network and Facility Services Division, National Institute for Materials Science, Tsukuba, Ibaraki 305-0044, JapanSCIENCE AND TECHNOLOGY OF ADVANCED MATERIALS: METHODS 2025, VOL. 5, NO. 1, 2485016 https://doi.org/10.1080/27660400.2025.2485016© 2025 The Author(s). Published by National Institute for Materials Science in partnership with Taylor & Francis Group  This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. The terms on which this article has been published allow the posting of the Accepted Manuscript in a repository by the author(s) or with their consent.http://orcid.org/0000-0001-8585-9268http://www.tandfonline.comhttps://crossmark.crossref.org/dialog/?doi=10.1080/27660400.2025.2485016&domain=pdf&date_stamp=2025-04-111. IntroductionIn analysis of X-ray diffraction (XRD) data, identifying constituent crystalline phases is a fundamental and critical step that affects the process of material research. A conventional identification method is to use the main diffraction peaks of each phase. For example, the Hanawalt method, which is often used when a material is supposed to consist of multiple crystalline phases, first identifies one crystalline phase whose main peaks are in positions that match those of the experimentally observed high-intensity peaks (2θ value or d value). Next, the same peak- matching procedure is applied to the peaks that have yet to be assigned. This method repeats this procedure until all the peaks are assigned and proposes candidates for the constituent crystalline phases.In the conventional method, if two or more crystal phases with similar diffraction angles are present, the first identification of a phase with higher-intensity peaks may preclude the successive identification of the remaining phases. This occurs because the method repeatedly matches individual phases to determine the set of phases like a greedy strategy rather than evaluate all the possible combinations of constituent phases. Moreover, because the conventional method only compares the relative intensities and diffraction angles of a limited number of high-intensity peaks, it does not consider the entire diffraction profile. Consequently, it cannot quantitatively assess the reliability of the identification results. When multiple candidate solutions are proposed, the researcher must subjectively select the appropriate solution, leading the final identification outcome to depend on the researcher’s experience and expertise.To solve the above problems, we have developed a method for estimating the combination of crystalline phases using Bayesian inference, taking the entire profile into account. This method estimates the Bayesian posterior probability of crystalline phase combinations by performing an approximate exhaustive search of all possible combinations and taking into account all peak shapes. This method can identify the crystalline phase appropriately even when there are multiple phases with similar peaks. In addition, the reliability of the identification can be quantitatively evaluated using a probability distribution. There is, however, the problem that it takes a few hours to obtain the analysis results because it uses a fitting function with a large computational cost to search for combinations of crystalline phases and profile parameters using a sampling method based on the Markov chain Monte Carlo (MCMC) method. Specifically, an analysis using 250 candidate crystalline phase combinations took approximately 3 hours.The aim of this study is to develop a Bayesian method for crystalline phase identification that can provide analysis results in seconds, which is a practical calculation time. We introduce variational sparse estimation and GPU computing. As a result, our method is able to provide results within 10  seconds even when analysing 250 given candidate crystalline phase combinations.2. Strategy2.1. Concept for accelerationWe aim to achieve Bayesian identification of a crystalline phase combination in seconds by taking into account the overall shape of the profile. Figure 1 shows the overview of the accelerated strategy in our method compared with the previous method [1]. This study tries to accelerate Bayesian crystalline identification in terms of both the algorithm and computing.For the algorithm, we introduce variational inference instead of the MCMC method to accelerate crystalline phase identification using Bayesian estimation. Variational inference can reduce the computational cost and the time required for convergence compared with the MCMC method because it solves an inference problem as an optimization problem for which the gradient method can be used. However, the model of the previous method [1] introduces discrete variables for crystalline phase identification. Because of these discrete variables, gradient-based optimization is not efficient with this model as is. To solve the problem, we apply continuous relaxation like L1 regularization to the discrete variables. In this study, sparsity is introduced into the intensity parameters using properties of the gamma distribution. Our method differs from previous works by using a continuous relaxation of the model, so it is possible to use acceleration algorithms. Our method uses stochastic variational inference (SVI) [2] to estimate the Bayesian posterior distribution, which is faster than the MCMC method used in previous work.For computing, our method uses a GPU to accelerate crystalline phase identification. The rate-limiting factor in crystalline identification, which takes into account the profile shape, is calculating the profile function that generates the diffraction peak. This study focuses on the fact that XRD profile calculations can be performed independently and in parallel for parameter sets and inputs. Here, the inputs are the diffraction angle and the information on candidate crystalline phases. We can implement a function that generates peaks in the single program multiple data (SPMD) architecture [3], which allows multiple processors to work together to execute a program, enabling parallel processing to obtain results more quickly. Therefore, GPU computing enables us to generate the profile function for each crystalline phase faster than CPU computing. GPU computing is highly Sci. Technol. Adv. Mater. Meth. 5 (2025) 2                                                                                                                                       R. MURAKAMI et al.effective for generating XRD profiles, which involve a huge number of combinations of parameters and inputs.2.2. Prior distribution design for SVIIn this study, we redesign the prior distribution to introduce SVI efficiently. Our method identifies the crystalline phases using a prior distribution with sparsity for continuous variables instead of introducing discrete variables as in a previous study. The intensity parameter hk can only be positive, that is, hk 2 Rþ0 . The prior distribution of the intensity parameter is set as the gamma distribution, which is a general probability distribution with a positive value range. The gamma distribution Gamð�Þ is described by the shape parameter α and scale parameter λ as follows: hk,Gamðhk; α; λÞ ¼λαΓðαÞhα� 1k expð� λhkÞ: (1) The expected value and variance in a gamma distribution are EGamðhk; α; λÞ½hk� ¼αλ; V Gamðhk;α;λÞ½hk� ¼αλ2 : (2) Here, we apply sparse modelling to the intensity parameter hk based on the assumption that only a few of the candidate combination phases are included in the measurement data. That is, we set a prior distribution with sparse intensity hk. We set a gamma distribution with the shape parameter α ¼ 1 (which is the exponential distribution) as the prior distribution to achieve sparsity: hk,Gamðhk; α ¼ 1; λÞ ¼ λ expð� λhkÞ: (3) This prior distribution setting is equivalent to the Laplace distribution (L1 regularization) with a positive range. Therefore, the estimated intensity parameters have sparsity. The hyperparameter λ corresponds to the intensity scale from the definition of the gamma distribution. Therefore, we set the maximum measured signal, η ¼ maxðY � BÞ, to be the expected value. In other words, because the shape parameter is set as α ¼ 1, we set the scale parameter as λ ¼ η� 1.2.3. GPU computing to generate an XRD profileFor crystalline phase identification that takes into account the profile shape, the bottleneck in calculation time is due to calculating the function that generates the peaks. In XRD data analysis, the number of candidate crystalline phase factors F k and number of peaks Mk are huge. Therefore, to calculate the fitting model, it is necessary to calculate the triple loop PKk¼1PMkm¼1PNi¼1 Forwordðxi; pðkÞm ; IðkÞm ; ΦðkÞÞ to get the forward model. The inputs (xi, pðkÞm and IðkÞm ) are Figure 1. Overview of the accelerated strategy in our method compared with the previous method [1]. This study tries to accelerate Bayesian crystalline identification in terms of both the algorithm and computing. The upper row figure shows the estimation flow in our method. The middle row figure shows the way to accelerate identification of crystalline phase combinations in our method. The lower row figure shows the previous method.Sci. Technol. Adv. Mater. Meth. 5 (2025) 3                                                                                                                                       R. MURAKAMI et al.given static values, and the parameter set ΦðkÞ is updated for each optimization step.This study focused on the fact that XRD profile calculations can be performed independently and in parallel for parameter set ΦðkÞ and inputs (xi, pðkÞm and IðkÞm ). A peak is generated using SPMD architecture, which is suitable for vector mapping and calculations in GPU computing. Figure 2 shows the tensor representation of the parameter structure for generating peaks for vector mapping. As shown in the figure, we apply vector mapping of the parameter structure into functions that generate a peak, and the functions form the tensor. Furthermore, vectorization makes it possible to use GPU computing. In our method, the peak-generating function is vectorized on the GPU to enable high-speed calculation.We used the JAX library [4], which is developed by Google, to implement vectorized mapping of the function that generates the peaks. Vectorizing functions can be easily implemented using the vmap method in JAX. We can map to tensor space by applying vmap multiple times. JAX is GPU-compatible, so it can be run on a GPU without any changes to the programming code.If the number of peaks Mk differs for each crystalline phase, it is not possible to express it as a tensor. For this reason, it is necessary to introduce a dummy variable so that Mk becomes Mmax in the implementation. Mmax is the maximum value of Mk. The dummy variable should be set so that it does not affect the profile.3. Method3.1. XRD data for verificationThe measurement sample was a mixture of multiple types of TiO2: anatase, brookite, and rutile. The mixture ratios were equal (1/1/1 wt. %). We prepared measurement samples such that the crystalline phases were homogeneous. Consequently, we measured the XRD data using monochromatic X-rays of Cu Kα1. A non-reflecting plate cut from a specific orientation of a single crystal of silicon was used as the sample plate. The diffraction angles (2θ) were in the range 10–60 [�], with the values of 2θ corresponding to x¼ ð10:00; 10:02; 10:04; . . . ; 60:00ÞT.Our method tried to estimate the crystalline phase in measurement samples from 50 candidates. Candidate crystalline phases were obtained from AtomWork-Adv [5] as described in the literature [1].3.2. Algorithm for estimating an approximate posterior distributionWe assume that the observed data fðY;XÞg ¼ fðxi; yiÞgNi¼0 are stochastically distributed owing to statistical noise in the measurement. Our aim is to estimate the posterior distribution pðΦjYÞ of the parameter set Φ. First, we consider the joint distribution pðY;ΦÞ, which can be expanded to pðY;ΦÞ ¼ pðΦjYÞpðYÞ. Using Bayes’ theorem to swap the orders of Y and Φ, we can expand pðY;ΦÞ ¼ pðYjΦÞpðΦÞ. Hence, the posterior distribution pðΦjYÞ is expressed as pðΦjYÞ ¼pðYjΦÞpðΦÞpðYÞ; (4) where pðΦjYÞ and pðΦÞ are the posterior and prior distributions, respectively, in the Bayesian inference; pðYjΦÞ is the conditional probability of Y under given the model parameter set Φ, which is a probability distribution explained by statistical noise. We call the Figure 2. Tensor representation of the parameter structure for calculating peak profiles on a GPU. It is constructed by mapping functions to tensors.Sci. Technol. Adv. Mater. Meth. 5 (2025) 4                                                                                                                                       R. MURAKAMI et al.probability pðYjΦÞ the likelihood. The normalized constant pðYÞ is expressed as pðYÞ ¼ZpðY;ΦÞdΦ ¼ZpðYjΦÞpðΦÞdΦ: (5) This is called the marginal likelihood, which is an important measure of how much the model explains the observation data.We introduce variational inference to rapidly obtain this posterior distribution. Variational inference is a method for approximating the posterior distribution pðΦjYÞ using a specific family of distributions qðΦÞ that are easy to deal with (e.g. the Gaussian distribution): pðΦjYÞ � qðΦÞ. Assuming a specific distribution and parameter independence makes it possible to estimate the posterior distribution in the same way as in a gradient-based optimization problem.The marginal log-likelihood ln pðYÞ, that is, the model evidence, can be decomposed into two functional terms: ln pðYÞ ¼ L½q� þ KL½qjjp� � L½q�; (6) where KL represents the Kullback-Leibler divergence, and we set q ¼ qðΦÞ and p ¼ pðΦjYÞ. These functional terms denote L½q� :¼ZqðΦÞ lnpðYjΦÞPðΦÞqðΦÞdΦ; (7) KL½qjjp� :¼ �ZqðΦÞ lnpðΦjYÞqðΦÞdΦ: (8) According to the definition of the KL divergence, it is impossible for KL½qjjp� to be negative, that is, KL½qjjp� � 0. Therefore, L½q� becomes the lower bound of model evidence ln pðYÞ. That is why L½q� is generally called the evidence lower bound (ELBO) [6]. We can estimate the approximate posterior distribution q̂ by maximizing the ELBO L½q�: q̂ ¼ argmaxqL½q�: (9) To implement the variational Bayesian inference, we consider restricting the distribution class of qðΦÞ. In this study, we assume that qðΦÞ can be expressed as the mean field approximation Qϕ2Φ qðϕÞ. Moreover, we assume that each posterior distribution can be approximated by a Gaussian distribution Nðϕ; μ; σ2Þ: qðΦÞ �Yϕ2ΦqðϕÞ �Yϕ2ΦNðϕ; μ ¼ μϕ; σ2 ¼ σ2ϕÞ;(10) where hyperparameters μ and σ2 are the mean and standard deviation of the Gaussian distribution, respectively. We estimate these hyperparameters using variational inference based on the ELBO to obtain the approximate posterior distribution.4. Results and discussionFirst, we compare the execution times of different algorithms and different computations. There was no significant difference between the computational efficiencies of our modelling and the previous modelling in the MCMC method. Therefore, to make comparisons easier, the model was unified with the prior distribution we designed. In this study, we conducted computational experiments on a total of four combinations using either SVI or the MCMC method for the algorithm and either a CPU or GPU for the computing. In the MCMC method, we performed 1000 sampling steps and 1000 burn-in steps. For the SVI, we performed 1000 optimization steps. Figure 3 and Table 1 show the execution times for each algorithm and computation. In the figure, the y-axis denotes calculation time [second] for the log-scale. The results for identifying the crystalline phase are consistent across all methods. The method using the GPU and SVI was the fastest of all these methods, providing the results in 7.2 seconds for this case. We have achieved a practical time for Bayesian estimation of a crystalline Figure 3. Execution times for each algorithm and implementation.Table 1. Execution times [seconds] of different algorithms and computing implementations.Computing Algorithm CPU GPUMCMC method 10371.5 sec 1326.9 secSVI metohod 260.8 sec 7.2 secSci. Technol. Adv. Mater. Meth. 5 (2025) 5                                                                                                                                       R. MURAKAMI et al.phase combination that takes the overall profile shape into account.We show the selection result for our method using shrinkage estimation. Figure 4 shows the resulting area ratios [%] estimated by our method for each crystalline phase. The x- and y-axes denote the area ratio and crystalline phases, respectively. The grey dashed line is the prepared mixing ratio of the measured sample. The red dashed line is the threshold for an area fraction of 1 [%] or less. This figure confirms that the intensity not included in the measurement sample was reduced to zero because our method used a distribution with sparsity as the prior distribution of the intensity parameters. Our method allows identification of three true crystalline phases of TiO2: anatase, brookite, and rutile. Furthermore, the estimated ratio is close to the prepared mixing ratio.Figure 5(a) shows the fitting results via the profile function for the measured XRD data. In Figure 5(a), the black and red lines indicate the measured XRD data and the fitting profile functions, respectively. Figure 5(b) shows the peak components of the three crystalline phases anatase, brookite, and rutile, indicated by the red, green, and blue lines, respectively. The estimated profile function facilitates a good fit of the XRD data. Even though we analysed 50 candidate crystalline phases, the analysis succeeded in providing results in 7.2 seconds.We used SVI instead of the MCMC method to identify crystalline phases quickly. In contrast to the Figure 4. Area ratios [%] estimated by our method for each crystalline phase.Sci. Technol. Adv. Mater. Meth. 5 (2025) 6                                                                                                                                       R. MURAKAMI et al.MCMC method, SVI estimates the posterior distribution assuming that there is no correlation between the parameters, which is the mean field approximation. While SVI can achieve high-speed estimation, the mean field approximation is not always appropriate depending on the model and data. We focus on the intensity parameters of anatase, brookite, and rutile and determine whether there is any correlation in the posterior distribution obtained by the MCMC method. Furthermore, we compare the posterior distributions obtained using the MCMC and SVI methods. Figure 6(a-c) shows the two-paired posterior Figure 5. Results of profile analysis for measured XRD data using our method. (a) Fitting results via the profile function for the measured XRD data. (b) Peak components of the three crystalline phases of TiO2: anatase, brookite, and rutile.Figure 6. Posterior distributions of intensity parameters. (a)-(c) two-paired posterior distribution of intensity parameters. (d)-(f) comparisons of posterior distributions obtained by the MCMC method and SVI.Sci. Technol. Adv. Mater. Meth. 5 (2025) 7                                                                                                                                       R. MURAKAMI et al.distribution of intensity, which is the primary parameter. Figure 6(d-f) shows comparisons of posterior distributions obtained by the MCMC method and SVI. Panels (a)-(c) do not show an effective correlation in intensity parameters. This suggests that the mean field approximation is a reasonable assumption for the intensity parameters. In panels (d)-(f), each MAP solution is similar. However, there are differences in the width of the estimated posterior distribution. SVI underestimates the width of the posterior distribution of the strength parameter of brookite. This might be due to the poor crystallinity of brookite and its small integral intensity compared with other crystalline phases.5. ConclusionWe aimed to develop a Bayesian method that can identify crystalline phases in seconds using variational sparse inference and GPU computing. This method succeeded in providing results in 7.2  seconds even though we analysed 250 candidate crystalline phase combinations. Furthermore, the crystalline phases identified by our method were consistent with the precise calculations of the MCMC method. We have achieved identification in seconds with Bayesian estimation of crystalline phases that takes the overall profile shape into account.Disclosure statementNo potential conflict of interest was reported by the author(s).FundingThis work was supported by GteX Program Japan Grant Number [JPMJGX23S6]. We would like to thank Dr. Hayaru Shouno (The University of Electro- Communications) and Dr. Hideki Yoshikawa (NIMS) for useful discussions.ORCIDRyo Murakami http://orcid.org/0000-0001-8585-9268References[1] Murakami R, Matsushita Y, Nagata K, et al. Bayesian estimation to identify crystalline phase structures for x-ray diffraction pattern analysis. Sci Techno Adv Mater: Methods. 2024;4(1):2300698. doi: 10.1080/ 27660400.2023.2300698  [2] Hoffman MD, Blei DM, Wang C, et al. Stochastic variational inference. J Mach Learn Res. 2013;14 (40):1303–1347. Available from: http://jmlr.org/ papers/v14/hoffman13a.html [3] Auguin M, Larbey F. Opsila: an advanced SIMD for numerical analysis and signal processing. In: Microcomputers: developments in industry, business, and education, Ninth EUROMICRO Symposium on Microprocessing and Microprogramming; Madrid; 1983 Sep 13. Vol. 16. p. 311–318.[4] Bradbury J, Frostig R, Hawkins P, et al. JAX: composable transformations of Python+NumPy programs. 2018. Available from: http://github.com/jax-ml/jax [5] Xu Y, Yamazaki M, Villars P. Inorganic materials database for exploring the nature of material. Jpn J Appl Phys. 2011 nov;50(11S):11RH02. doi: 10. 1143/JJAP.50.11RH02  [6] Kingma DP. Auto-encoding variational bayes. arXiv preprint arXiv:13126114. 2013.[7] Toraya H. Array-type universal profile function for powder pattern fitting. J Appl Crystallogr. 1990 Dec;23(6):485–491. doi: 10.1107/S002188989000704X  [8] Erb D. Pybaselines: a python library of algorithms for the baseline correction of experimental data. 2024. Available from: https://github.com/derb12/ pybaselines [9] Wertheim GK, Butler MA, West KW, et al. Determination of the gaussian and lorentzian content of experimental line shapes. Rev Sci Instru. 1974;45 (11):1369–1371. doi: 10.1063/1.1686503Sci. Technol. Adv. Mater. Meth. 5 (2025) 8                                                                                                                                       R. MURAKAMI et al.https://doi.org/10.1080/27660400.2023.2300698https://doi.org/10.1080/27660400.2023.2300698http://jmlr.org/papers/v14/hoffman13a.htmlhttp://jmlr.org/papers/v14/hoffman13a.htmlhttp://github.com/jax-ml/jaxhttps://doi.org/10.1143/JJAP.50.11RH02https://doi.org/10.1143/JJAP.50.11RH02https://doi.org/10.1107/S002188989000704Xhttps://github.com/derb12/pybaselineshttps://github.com/derb12/pybaselineshttps://doi.org/10.1063/1.1686503AppendiesAppendix A. ModelA.1. Problem settingThe purpose is to estimate the profile parameters and crystalline phase structures in the measured sample, considering the measured XRD data D ¼ fðxi; yiÞgNi¼1 and the candidate crystal structure F . Here, xi 2 ð0; 180Þand yi 2 N denote the diffraction angle 2θ [�] and diffraction intensity [counts], respectively.The candidate crystal structure factor set F is expressed as F ¼ fF kjk 2 f1; 2; . . . ;Kgg; (A1) where F k ¼ fðpðkÞm ; IðkÞm Þjm 2 f1; 2; . . . ;Mkgg � F ; (A2) where K 2 N is the number of candidate crystal structures, and F k is the k-th crystalline structure factor. The elements of the crystal structure factor pðkÞm 2 ð0; 180Þ and IðkÞm 2 ½0; 1� are the diffraction angle (peak position) [�] and relative intensity of the m-th diffraction peak in F k for a crystalline structure k. The symbol Mk 2 N denotes the number of peaks in F k. In this study, the candidate crystalline structure factor set F is provided.A.2. Profile functionXRD data can be represented by a profile function fF ðxi; ΦÞ : R ! Rþ0 , which is a linear sum of the signal spectrum SF ðxi; ΦÞand the background Bðxi; ΦÞ: yi � fF ðxi; ΦÞ; (A3) ¼ SF ðxi; ΦÞ þ BðxiÞ; (A4) where ðxi; yiÞ denote the measured data points, the function SF ðxi; ΦÞ denotes the signal spectrum based on the candidate crystal structures F , and the function BðxiÞ denotes the background.The signal spectrum SF ðxi; ΦÞ is expressed as a linear sum of the profile function (peaks) CF kðxi; ΦðkÞÞ : R ! Rþ0 in a crystal structure F k among several candidates [7]:  SF ðxi; ΦÞ ¼XKk¼1hkCF kðxi; ΦðkÞÞ: (A5) We estimated the background BðxnÞ using pybaselines [8] before peak extraction. The pybaselines can perform mostly model- free background estimation through the iterative least squares method.In this study, we use SVI to estimate the posterior distribution PðΦjYÞ. The settings for the prior distribution PðΦÞ are described in Appendix B.The profile function CF kðxi; ΦðkÞÞ of candidate crystal structure k is defined as CF kðxi; ΦðkÞÞ ¼XMkm¼1IðkÞm V xi; ρmk;wk; rk� �; (A6) ¼XMkm¼1IðkÞm fð1 � rkÞGðxi; ρmk;wkÞ þ rkLðxi; ρmk;wkÞg; (A7) where ρmk ¼ pðkÞm þ μk; (A8) where μk 2 R and rk 2 ½0; 1� are the peak shift and Gauss-Lorentz ratio at the peak of crystal structure k, respectively; ρmk 2 R is the peak position of the peak function; VðxiÞ : R ! Rþ0 is a pseudo-Voigt function [9]; GðxiÞ : R ! Rþ0 and LðxiÞ : R ! Rþ0 are Gaussian and Lorentz functions, respectively. where Aðxi; αkÞ ¼αk ðxi � ρkÞ1 ðxi < ρkÞ;�(A9) ¼ signðxi � ρkÞαk � 12þαk þ 12; (A10) Function Aðxi; αkÞ : R ! R expresses the peak asymmetry, and αk 2 Rþ is the asymmetry parameter for the peak function. Furthermore, signð�Þ : R ! f� 1; 1g is the sign function, and secðxÞ is the trigonometric function secðxÞ ¼ 1= cosðxÞ.To derive pðYjΦÞ, we consider the observation process for fðxi; yiÞg at the observation data points. Assuming that the observed data are independent of each other, the conditional probability of the observed data fðY;XÞg can be expressed as Sci. Technol. Adv. Mater. Meth. 5 (2025) 9                                                                                                                                       R. MURAKAMI et al.PðYjΦÞ ¼YNi¼0pðyijΦÞ: (A11) Because XRD spectra are count data, the conditional probability pðyijΦÞ of the intensity yi for the diffraction angle xi follows a Poisson distribution PoiðyijfF ðxi; ΦÞÞ: pðyijΦÞ ¼ PoiðyijfF ðxi; ΦÞÞ (A12) ¼fF ðxi; ΦÞyi expð� fF ðxi; ΦÞÞyi!: (A13) The negative log-likelihood function � ln PðYjΦÞ is expressed as � ln pðYjΦÞ ¼ �XNi¼1ln pðyijΦÞ; (A14) ¼ �XNi¼1ln PoiðyijfF ðxi; ΦÞÞ; (A15) ¼ �XNi¼1yi ln fF ðxi; ΦÞ � fF ðxi; ΦÞ � ln yi!f g: (A16) Appendix B. ConfigurationB.1. Calculator specificationThe calculator was an Intel Xeon(R) Platinum 8280 with a 2.70 GHz CPU (112 threads) and a Tesla V100S-PCIE -32GB GPU.B.2. Configuration of prior distributionWe set the prior distribution over the parameter set Φ of the profile function as follows: Profile pattern shift : μk,NormðμN ¼ 0:00; σN ¼ 0:03Þ;Peak asymmetry : αk,NormðμN ¼ 1:00; σN ¼ 0:20Þ;Lorentz � Gaussian ratio : rk,UniðuU ¼ 0:00; lU ¼ 1:00Þ;Peak width parameter : wk,GamðαG ¼ 3:00; λG ¼ 100:00Þ;where the probability distribution GamðkG; θGÞ is the gamma distribution and αG 2 Rþ and λG 2 Rþ are the shape and scale parameters, respectively. The probability distribution NormðμN ; σNÞ is a normal distribution, and μN 2 R and σN 2 Rþ are the mean and standard deviation, respectively. The probability distribution UniðuU ; lUÞ is a uniform distribution, with uU 2 R and lU 2 R being the maximum and minimum values, respectively.Sci. Technol. Adv. Mater. Meth. 5 (2025) 10                                                                                                                                     R. MURAKAMI et al. Abstract Abstract 1. Introduction 2. Strategy 2.1. Concept for acceleration 2.2. Prior distribution design for SVI 2.3. GPU computing to generate an XRD profile 3. Method 3.1. XRD data for verification 3.2. Algorithm for estimating an approximate posterior distribution 4. Results and discussion 5. Conclusion Disclosure statement Funding ORCID References Appendies Appendix A. Model A.1. Problem setting A.2. Profile function Appendix B. Configuration B.1. Calculator specification B.2. Configuration of prior distribution