Hans-Beat Bürgi tribute\(\def\hfill{\hskip 5em}\def\hfil{\hskip 3em}\def\eqno#1{\hfil {#1}}\)

Journal logoSTRUCTURAL SCIENCE
CRYSTAL ENGINEERING
MATERIALS
ISSN: 2052-5206

Remarks on X-ray constrained/restrained wavefunction fitting

crossmark logo

aDepartment of Chemistry, Biochemistry and Pharmacy, University of Berne, Freiestr. 12, Bern, CH-3012, Switzerland, bDepartment of Chemistry, University of Zurich, Winterthurerstr. 190, Zürich, CH-8057 Switzerland, and cUniversité de Lorraine and CNRS, Laboratoire de Physique et Chimie Théoriques, 1 Boulevard Arago, Metz, 57050, France
*Correspondence e-mail: hans-beat.buergi@unibe.ch, alessandro.genoni@univ-lorraine.fr

Edited by M. Spackman, University of Western Australia, Australia (Received 17 April 2022; accepted 19 April 2022; online 24 May 2022)

X-ray constrained/restrained wavefunctions (XCWs/XRWs) result from a combination of theory and experiment and are therefore affected by experimental errors and model uncertainties. The present XCW/XRW procedure does not take this into account, thus limiting the meaning and significance of the obtained wavefunctions.

1. Introduction

In 1998, Jayatilaka (1998[Jayatilaka, D. (1998). Phys. Rev. Lett. 80, 798-801.]) presented the X-ray constrained wavefunction (XCW) fitting approach, a method that combines quantum chemistry and X-ray diffraction to produce what the author called an experimental wavefunction. The intention is to find a wavefunction Ψopt and the corresponding electron density ρopt, (i) that is as close as possible to the crystal density ρcryst, i.e. explains the observed structure factor amplitudes to within a weighted mean square deviation Δ between experiment and model and (ii) that simultaneously minimizes the quantum mechanical energy of the investigated system.

At present, XCW fitting (Jayatilaka, 1998[Jayatilaka, D. (1998). Phys. Rev. Lett. 80, 798-801.]; Jayatilaka & Grimwood, 2001[Jayatilaka, D. & Grimwood, D. J. (2001). Acta Cryst. A57, 76-86.]; Grimwood & Jayatilaka, 2001[Grimwood, D. J. & Jayatilaka, D. (2001). Acta Cryst. A57, 87-100.]; Bytheway, Grimwood & Jayatilaka, 2002[Bytheway, I., Grimwood, D. J. & Jayatilaka, D. (2002). Acta Cryst. A58, 232-243.]; Bytheway, Grimwood, Figgis et al., 2002[Bytheway, I., Grimwood, D. J., Figgis, B. N., Chandler, G. S. & Jayatilaka, D. (2002). Acta Cryst. A58, 244-251.]; Grimwood et al., 2003[Grimwood, D. J., Bytheway, I. & Jayatilaka, D. (2003). J. Comput. Chem. 24, 470-483.]) is the last in a series of steps to model ρcryst. The procedure usually begins with Independent Atom Modelling (IAM, with tabulated spherical atomic densities and form factors). It may be followed by interpreting the diffraction data with more refined descriptions of the atomic and bonding electron densities, such as multipole models (MMs) (Stewart, 1976[Stewart, R. F. (1976). Acta Cryst. A32, 565-574.]; Hansen & Coppens, 1978[Hansen, N. K. & Coppens, P. (1978). Acta Cryst. A34, 909-921.]) or quantum mechanical Hirshfeld atom refinements (HARs) (Jayatilaka & Dittrich, 2008[Jayatilaka, D. & Dittrich, B. (2008). Acta Cryst. A64, 383-393.]; Capelli et al., 2014[Capelli, S. C., Bürgi, H.-B., Dittrich, B., Grabowsky, S. & Jayatilaka, D. (2014). IUCrJ, 1, 361-379.]; Kleemiss et al., 2021[Kleemiss, F., Dolomanov, O. V., Bodensteiner, M., Peyerimhoff, N., Midgley, L., Bourhis, L. J., Genoni, A., Malaspina, L. A., Jayatilaka, D., Spencer, J. L., White, F., Grundkötter-Stock, B., Steinhauer, S., Lentz, D., Puschmann, H. & Grabowsky, S. (2021). Chem. Sci. 12, 1675-1692.]). They are usually based on Hartree–Fock (HF) or density functional theory (DFT) calculations, with or without consideration of the environment of the structural fragment that may also be treated quantum mechanically (Jayatilaka & Dittrich, 2008[Jayatilaka, D. & Dittrich, B. (2008). Acta Cryst. A64, 383-393.]; Wieduwilt et al., 2021[Wieduwilt, E. K., Macetti, G. & Genoni, A. (2021). J. Phys. Chem. Lett. 12, 463-471.]; Ruth et al., 2022[Ruth, P. N., Herbst-Irmer, R. & Stalke, D. (2022). IUCrJ, 9, 286-297.]). HAR at correlated levels has also been attempted (Wieduwilt et al., 2020[Wieduwilt, E. K., Macetti, G., Malaspina, L. A., Jayatilaka, D., Grabowsky, S. & Genoni, A. (2020). J. Mol. Struct. 1209, 127934.]). At the last stage, the XCW procedure tries to extract information not included in the preceding steps, typically the polarization due to the crystal environment (Ernst et al., 2020[Ernst, M., Genoni, A. & Macchi, P. (2020). J. Mol. Struct. 1209, 127975.]) as well as correlation (Genoni et al., 2017[Genoni, A., Dos Santos, L. H. R., Meyer, B. & Macchi, P. (2017). IUCrJ, 4, 136-146.]) and relativistic effects (Bučinský et al., 2016[Bučinský, L., Jayatilaka, D. & Grabowsky, S. (2016). J. Phys. Chem. A, 120, 6650-6669.]).

The XCW procedure thus attempts to extract the last little bit of information from a diffraction experiment. In other words, it tries to improve an already quite detailed model of the electron density, whose R factor is typically as low as 1–3%. The likelihood that this information is of similar magnitude as the systematic and random errors in the diffraction data and inadequacies of the quantum chemical model is thus not negligible and creates some unresolved problems concerning the meaning of the results obtained from XCW fitting. Some of these problems, not all of which have been addressed explicitly, are discussed below.

2. A summary of the X-ray constrained/restrained wavefunction approach

As mentioned in the introduction, the XCW fitting approach aims to determine a wavefunction that minimizes the quantum mechanical energy of the considered system and simultaneously maximizes the agreement between experimental and calculated structure factor amplitudes (Jayatilaka, 1998[Jayatilaka, D. (1998). Phys. Rev. Lett. 80, 798-801.]; Jayatilaka & Grimwood, 2001[Jayatilaka, D. & Grimwood, D. J. (2001). Acta Cryst. A57, 76-86.]; Grimwood & Jayatilaka, 2001[Grimwood, D. J. & Jayatilaka, D. (2001). Acta Cryst. A57, 87-100.]; Bytheway et al., 2002[Bytheway, I., Grimwood, D. J. & Jayatilaka, D. (2002). Acta Cryst. A58, 232-243.]; Bytheway, Grimwood, Figgis et al., 2002[Bytheway, I., Grimwood, D. J., Figgis, B. N., Chandler, G. S. & Jayatilaka, D. (2002). Acta Cryst. A58, 244-251.]; Grimwood et al., 2003[Grimwood, D. J., Bytheway, I. & Jayatilaka, D. (2003). J. Comput. Chem. 24, 470-483.]; Jayatilaka, 2012[Jayatilaka, D. (2012). Modern Charge-Density Analysis, edited by C. Gatti & P. Macchi, pp 213-257. Dordrecht: Springer Netherlands.]). The problem is mathematically equivalent to finding the wavefunction that minimizes the energy under the constraint

[{\rm GoF}^{\,2} = \Delta \eqno (1),]

where GoF2 is the squared goodness-of-fit given by the following expression:

[{\rm GoF}^{2} = {{1}\over{{N}_{\rm refl}-{N}_{\rm par}}}\sum _{r = 1}^{{N}_{\rm refl}}{{{(|{F}_{r}^{\rm exp}| -\eta |{F}_{r}^{\rm calc}(\Psi )|)}^{2}}\over{{{(\sigma }_{r}^{\rm exp})}^{2}}}, \eqno(2)]

[| F_r^{\rm calc}({\Psi}) |] is the r-th structure factor amplitude calculated from a model electron density ρ(Ψ); [| F_r^{\rm exp}|] is the r-th observed structure factor amplitude with [\sigma _r^{\rm exp}] as its estimated standard uncertainty; η is a scale factor that puts the calculated structure factor amplitudes on the same scale as the experimental ones; Nrefl is the number of experimental observations, and Npar the number of parameters. Furthermore, as indicated by Jayatilaka and collaborators in the seminal papers on the technique, in principle Δ should be set equal to 1.0 (Jayatilaka, 1998[Jayatilaka, D. (1998). Phys. Rev. Lett. 80, 798-801.]; Jayatilaka & Grimwood, 2001[Jayatilaka, D. & Grimwood, D. J. (2001). Acta Cryst. A57, 76-86.]; Grimwood & Jayatilaka, 2001[Grimwood, D. J. & Jayatilaka, D. (2001). Acta Cryst. A57, 87-100.]; Bytheway, Grimwood & Jayatilaka, 2002[Bytheway, I., Grimwood, D. J. & Jayatilaka, D. (2002). Acta Cryst. A58, 232-243.]; Bytheway, Grimwood, Figgis et al., 2002[Bytheway, I., Grimwood, D. J., Figgis, B. N., Chandler, G. S. & Jayatilaka, D. (2002). Acta Cryst. A58, 244-251.]; Grimwood et al., 2003[Grimwood, D. J., Bytheway, I. & Jayatilaka, D. (2003). J. Comput. Chem. 24, 470-483.]). This implies that the objective of XCW fitting is the determination of an `experimental wavefunction' that reproduces – on average – the experimental structure factor amplitudes to within one standard deviation of the experimental measurements.

To minimize the energy of the system under the constraint expressed by relation (1)[link], the following functional has been introduced:

[J(\Psi ) = {E}_{\rm QM}(\Psi )+\lambda \big\{{\rm GoF}^{2}(\Psi )-\Delta \big\}. \eqno(3)]

The first term on the right-hand side is the quantum mechanical energy of the system [i.e. [E_{\rm QM}({\Psi} )] = [\langle {\Psi}| {\hat H} |{\Psi} \rangle], with [\hat H] as the Hamiltonian operator], and λ is a Lagrange multiplier that has the dimension of an energy. To achieve the aim of XCW fitting, functional J must be made stationary with respect to both the wavefunction Ψ and the Lagrange multiplier λ. However, in the current implementation of the XCW technique, the second stationary condition (i.e. the one with respect to λ) is never considered and, for this reason, the functional that is really minimized is the following one:

[J(\Psi ) = {E}_{\rm QM}(\Psi )+\lambda {\rm GoF}^{\,2}(\Psi ). \eqno(4)]

This implies that the present XCW method simply attempts to determine the wavefunction that minimizes the energy of the system under examination and that reproduces as much as possible the measured X-ray diffraction data. λ thus loses its original meaning of Lagrange multiplier; instead, it can be considered as the weight of the experimental data in the computations and simply becomes an external parameter that is gradually changed during the XCW procedure (see below). The term λGoF2(Ψ) in equation (4)[link] is a restraint in the crystallographic sense and the method should better be called X-ray restrained wavefunction (XRW) approach (Jayatilaka, 2012[Jayatilaka, D. (2012). Modern Charge-Density Analysis, edited by C. Gatti & P. Macchi, pp 213-257. Dordrecht: Springer Netherlands.]; Grabowsky et al., 2017[Grabowsky, S., Genoni, A. & Bürgi, H.-B. (2017). Chem. Sci. 8, 4159-4176.]; Ernst et al., 2020[Ernst, M., Genoni, A. & Macchi, P. (2020). J. Mol. Struct. 1209, 127975.]; Macetti et al., 2021[Macetti, G., Macchi, P. & Genoni, A. (2021). Acta Cryst. B77, 695-705.]) or X-ray regularization procedure (Davidson et al., 2022a[Davidson, M. L., Grabowsky, S. & Jayatilaka, D. (2022a). Acta Cryst. B78, 312-332.]). For the sake of completeness, it is mentioned here that one of the present authors has very recently proposed to reformulate the Jayatilaka technique by explicitly considering the stationary condition of functional (3[link]) with respect to λ (Genoni, 2022[Genoni, A. (2022). Acta Cryst. A78. https://doi.org/10.1107/S2053273322003746.]). Only in that case does λ regain its meaning as a Lagrange multiplier, and the approach can then be called X-ray constrained wavefunction (XCW) method.

In this work, we focus on the original and current version of the Jayatilaka strategy, but refer to it as X-ray restrained wavefunction (XRW) technique. Furthermore, although multi-determinant versions of this method have already been developed (Genoni, 2017[Genoni, A. (2017). Acta Cryst. A73, 312-316.]; Casati et al., 2017[Casati, N., Genoni, A., Meyer, B., Krawczuk, A. & Macchi, P. (2017). Acta Cryst. B73, 584-597.]; Genoni et al., 2018[Genoni, A., Franchini, D., Pieraccini, S. & Sironi, M. (2018). Chem. Eur. J. 24, 15507-15511.], 2019[Genoni, A., Macetti, G., Franchini, D., Pieraccini, S. & Sironi, M. (2019). Acta Cryst. A75, 778-797.]), for simplicity and without losing generality, we limit our discussion to the original and most used version of the Jayatilaka strategy, namely the case in which the wavefunction to be determined has the analytical form of a single Slater determinant.

For the single Slater determinant wavefunction ansatz, it is possible to show (Jayatilaka, 1998[Jayatilaka, D. (1998). Phys. Rev. Lett. 80, 798-801.]; Jayatilaka & Grimwood, 2001[Jayatilaka, D. & Grimwood, D. J. (2001). Acta Cryst. A57, 76-86.]; Grimwood et al., 2003[Grimwood, D. J., Bytheway, I. & Jayatilaka, D. (2003). J. Comput. Chem. 24, 470-483.]) that finding the wavefunction which minimizes functional (4)[link] corresponds to determining the molecular orbitals {φi} that satisfy the following modified Hartree–Fock equations (for a 2N-electron closed-shell system):

[\big[{\hat F}+\lambda {\hat v}_{\rm XRW}\big] {\varphi }_{i} = {\epsilon }_{i}\, {\varphi }_{i} \eqno(5).]

[\hat F] is the usual Fock operator used in quantum chemistry, while the XRW operator [{\hat v}_{\rm XRW}] is

[{\hat v}_{\rm XRW} = \sum _{r = 1}^{{N}_{\rm refl}}{K}_{r} \Big[{\rm Re}\big\{{F}_{r}^{\rm calc}\big\} {\hat I}_{r, R}+ {\rm Im} \big\{{F}_{r}^{\rm calc}\big\} {\hat I}_{r, C}\Big] \eqno(6)]

with

[{F}_{r}^{\rm calc} = 2\sum _{i = 1}^{N}\langle {\varphi }_{i}\big|{\hat I}_{r}\big|{\varphi }_{i}\rangle = 2\Bigg[\sum _{i = 1}^{N}\langle {\varphi }_{i}\big|{\hat I}_{r,R}\big|{\varphi }_{i}\rangle +i \sum _{i = 1}^{N}\langle {\varphi }_{i}\big|{\hat I}_{r,C}|{\varphi }_{i}\rangle \Bigg] \eqno(7)]

and

[{K}_{r} = {{2\eta }\over{{N}_{\rm refl}-{N}_{\rm par}}} {{\eta \big|{F}_{r}^{\rm calc}\big|-\big|{F}_{r}^{{\rm exp}}\big|}\over{{{(\sigma }_{r}^{\rm exp})}^{2} \big|{F}_{r}^{\rm calc}\big|}}. \eqno(8)]

[{\hat I}_{r, R}] and [{\hat I}_{r, C}] in equation (7)[link] are the real and imaginary parts, respectively, of the one-electron scattering operator

[{\hat I}_{r} = \sum _{k = 1}^{{N}_{m}}\exp\Big[{i2\pi ({{\bf R}}_{k}{\bf r}+{{\bf r}}_{{\bf k}})\cdot ({\bf B}{{\bf h}}_{r})}\Big] = {\hat I}_{r, R}+i \,{\hat I}_{r, C}, \eqno(9)]

where Nm is the number of symmetry-unique positions in the unit-cell, {Rk, rk} are the roto-translations associated with the unit-cell symmetry operations (Rk and rk being a rotation matrix and a translation vector, respectively), B is the reciprocal lattice matrix, and hr is the vector of Miller indices associated with the r-th reflection.

Note that the term [{\hat v}_{\rm XRW}] can be seen as a perturbation with weight λ to the traditional Fock operator [\hat F] of quantum chemistry. However, [{\hat v}_{\rm XRW}] depends on the experimentally determined structure factor amplitudes. Given that experimental measurements are subject to random measurement errors, [{\hat v}_{\rm XRW}] is subject to random error too and will differ somewhat for different X-ray experiments performed on the same system under the same experimental conditions. In other words, [\lambda {\hat v}_{\rm XRW}] not only accounts for shortcomings of the model of the electron density but is also characterized by a random component.

The interpretation of [\lambda {\hat v}_{\rm XRW}] as a perturbation operator can be traced back to a pioneering idea by Weiss from the 1960s (Weiss, 1966[Weiss, R. J. (1966). X-ray Determination of Electron Distributions. Amsterdam: North-Holland Publishing Company.]). He envisaged the possibility of correcting the deficiencies of the Hartree–Fock model by recovering effects of electron correlation from the experimental X-ray diffraction data. More recently, the relation between Weiss' original ideas and the XRW approach has been highlighted by Macchi (2022[Macchi, P. (2022). Quantum Crystallography: Expectations versus Reality. Cham, Switzerland: Springer. ]) in a review on origins, state of the art and perspectives of quantum crystallography.

Expressing the molecular orbitals {φi} in equations (5)[link] and (7)[link] in terms of a set of basis functions (as it is usually done in quantum chemistry), the modified Hartree–Fock equations expressed by relation (5)[link] straightforwardly transform to modified Roothaan–Hall matrix equations:

[\left[{\bf F}+\lambda {\bf v}\right]{\bf C} = {\bf S}{\bf C}{\bf E}, \eqno(10)]

with F as the typical Fock matrix of quantum chemistry calculations, C as the matrix whose columns contain the coefficients that expand the molecular orbitals {φi} in the chosen basis, E as the diagonal matrix of the orbital energies, and v as the matrix associated with the operator [{\hat v}_{\rm XRW}], which obviously has the same dimensions as the Fock matrix and is weighted by the external multiplier λ.

In the current version of the XRW approach, equations (10) are solved self-consistently for different values of λ by following a `trial and error' procedure. This means that the molecular orbitals obtained through the computation with λ(i) at the i-th step are used as guess for the calculation with λ(i+1) = λ(i) + Δλ. The procedure is usually iterated, but without a clear and definitive criterion to stop. Several different halting criteria have been proposed over the years. For a review see Davidson et al. (2022a[Davidson, M. L., Grabowsky, S. & Jayatilaka, D. (2022a). Acta Cryst. B78, 312-332.]); for two recent proposals see Davidson et al. (2022b[Davidson, M. L., Grabowsky, S. & Jayatilaka, D. (2022b). Acta Cryst. B78, 397-415.]). For reasons that will be discussed in §3[link], none of these seems convincing. The consequence is that although the XRW process should be halted at GoF2 ∼ 1.0, the final value of GoF2 often remains greater than the desired value or, under some circumstances, the calculations may go on beyond the desired limit to a final GoF2 value that is lower than 1.0.

The present version of the XRW procedure assumes that the nuclear positions and the atomic displacement parameters are known (to within their uncertainties). As also mentioned in the Introduction[link], these parameters may be obtained with the help of HAR (Capelli et al., 2014[Capelli, S. C., Bürgi, H.-B., Dittrich, B., Grabowsky, S. & Jayatilaka, D. (2014). IUCrJ, 1, 361-379.]) since structural parameters resulting from Hirshfeld atom refinements of X-ray diffraction data are almost as accurate as those obtained through neutron diffraction experiments (Woińska et al., 2016[Woińska, M., Grabowsky, S., Dominiak, P. M., Woźniak, K. & Jayatilaka, D. (2016). Sci. Adv. 2, e1600192.]). HAR also provides a starting point for the XRW procedure in the form of the final HAR wavefunction Ψ and, consequently, of the final electron density ρ, which hereafter will be called Ψref and ρref, respectively, with a corresponding squared goodness-of-fit [GoF2]ref. Note, however, that, given accurate atomic positions and ADPs, the quantities Ψref, ρref and [GoF2]ref might also be obtained from a level of theory and a basis set different from those used for the Hirshfeld atom refinement. No problem so far.

The subsequent XRW procedure modifies Ψref (and ρref) to Ψopt (and ρopt) until one obtains the best fitting of the experimental crystal density ρexp or, equivalently, the best fitting of its Fourier transforms [F_r^{\rm exp}]. In other words, the XRW method tries to extract information from the measured structure factor amplitudes [| F_r^{\rm exp}|] that is not already contained in [| F_{r}^{\rm ref}(\Psi_{\rm ref}) |], such as polarization, electron correlation and relativistic effects. An XRW fitting adjusts – at least in principle – all molecular orbital coefficients. However, for a 2N-electron closed shell system described by a single Slater determinant, there are N × (NbfN) independent parameters to be determined (with Nbf as the number of basis functions used in the calculation). This number is usually about an order of magnitude larger than the number of observations Nrefl. It is therefore important to choose the λ value or, alternatively, the target value for GoF2 in such a way that the procedure produces the best approximation Ψopt to Ψcryst, with Ψopt as little contaminated as possible by imponderables of the diffraction experiment or the quantum mechanical method used, i.e. systematic and random error.1 The problem of choosing λ has been termed the halting problem. For reasons given in §3[link], it is our opinion that no tried-and-tested, convincing solution of this problem has been presented so far.

3. Some difficulties

To gain more insight into the XRW fitting process, a few cases with specific assumptions about [|{F}_{r}^{\rm exp}|], [| F_r^{\rm ref}(\Psi_{\rm ref} ) |] and [\sigma _r^{\rm exp}] are analyzed. Some of these assumptions are unrealistic but provide a reference for gaining insights into the fitting procedure applied to more realistic cases.

(A) First of all, let us assume the unrealistic case with:

(i) [| F_r^{\rm exp}|] = [| F_r^{\rm cryst} + {\Delta}F_r^{\rm RE} |], where [{\Delta}F_r^{\rm RE}] is the random error in [| F_r^{\rm exp}|];

(ii) [F_r^{\rm ref}] = [F_r^{\rm cryst}];

(iii) [\sigma _r^{\rm exp}] are trustworthy and normally distributed estimates of the random errors of [|F_r^{\rm exp}|];

In this case, GoF2 (Ψref) = 1 and it is trustworthy. Therefore, no further fitting is indicated.

(B) Making the same assumptions as in case (A) except that the uncertainties [\sigma _r^{\rm exp}] unknowingly underestimate the random errors [{{\Delta}}F_r^{\rm RE}] of [| F_r^{\rm exp} \big|].

In this situation, GOF2 (Ψref) > 1 and further fitting is indicated. However, any such fitting would lead to wavefunctions [{\Psi}_\lambda ] and thus to structure factor amplitudes [F_r^{{\rm calc},\lambda }] which include contributions from both [{F}_{r}^{\rm cryst}] and [{{\Delta}}F_r^{\rm RE}]. In other words: for any non-zero value of λ, the XRW procedure merely fits experimental noise! For different experiments of the same substance under the same conditions, the random errors will be distributed differently and, consequently, the fit will look different. Underestimating [\sigma_{r}^{\rm exp}] is not uncommon in actual experiments. Note that this conclusion would not hold if, under the given assumptions, [{\hat v}_{\rm XRW}] = 0. However, this seems unlikely and has certainly not been shown to be the case.

(C) Another artificial case assumes that

(i) [\left| {F_r^{\rm exp}} \right| = \left| {F_r^{\rm cryst}} \right|] (i.e. no random errors are included);

(ii) [\sigma _r^{\rm exp} = 1] for all reflections;

(iii) Ψref is based on a quantum mechanical model with a basis set that is insufficiently flexible to reproduce Ψcryst.

This situation corresponds to the case of theoretically generated structure factor amplitudes and the fitting leads to [| F_r^{\rm calc}|] = [| F_r^{\lambda }|] and [| F_r^{\rm exp}|] = [| F_r^{\rm cryst}|] = [|F_r^{\lambda} + {\Delta}F_r^{\lambda}|], where [{\Delta}F_r^{\lambda}] is the part of [F_r^{\rm exp}] that cannot be modelled with [{\Psi}_{\lambda}]. Given the shortcomings of the basis set, [|{F}_{r}^{\rm exp}|-\eta |{F}_{r}^{\lambda }({\Psi }_{\lambda })| ] ≠ 0; GoF2 [({\Psi}_{\lambda }) ] ≠ 0 as well, but its expectation value is unknown because it depends on the unknown limitations of the model used. GoF2[(\Psi_\lambda)] is expected to decrease with increasing the number of basis functions (and thus the number of parameters that can be optimized).

For this kind of problem, a way to find an optimal λ has been proposed, albeit based on electron densities rather than on their Fourier transforms, the structure factors (Tozer et al., 1996[Tozer, D. J., Ingamells, V. E. & Handy, N. C. (1996). J. Chem. Phys. 105, 9200-9213.]). Equations analogous to equations (10[link]) are solved by combining Ψref with three different values of λ and extracting an optimal λ from the three results. One of the procedures proposed in Davidson et al. (2022b[Davidson, M. L., Grabowsky, S. & Jayatilaka, D. (2022b). Acta Cryst. B78, 397-415.]), although inspired by Tozer et al. (1996[Tozer, D. J., Ingamells, V. E. & Handy, N. C. (1996). J. Chem. Phys. 105, 9200-9213.]), is different. It updates Ψref at each fitting step until a halting point is reached. It has not been shown that the two procedures are equivalent, i.e. lead to the same result. In any case, the important point is that the choice of Ψref affects the GoF2 independently of [\sigma _r^{\rm exp}] and in an unpredictable way.

(D) For a more realistic case of XRW fitting, it is assumed that:

(i) [\left| {F_r^{\rm exp}} \right| = \left| {F_r^{\rm cryst} + {{\Delta}}F_r^{\rm RE}} \right|];

(ii) [F_r^{\rm ref} \ne F_r^{\rm cryst}];

(iii) Ψref is based on a quantum mechanical model with a basis set that is likely to be insufficiently flexible to reproduce Ψcryst;

(iv) the [\sigma _r^{\rm exp}] are trustworthy and normally distributed estimates of the random errors of [| {F_r^{\rm exp}} |].

In this case, the fitting leads to [| {F_r^{\rm calc}} | = | {F_r^\lambda } |] and [\big| {F_r^{\rm exp}} | = | {F_r^{\rm cryst} + {{\Delta}}F_r^{\rm RE}| = |F_r^\lambda + {{\Delta}}F_r^\lambda } |], in analogy to case (C). However, in contrast to that situation, the modifications of [F_r^{\rm ref}] in [F_r^\lambda] correct not only for inadequacies of Ψref, but also absorb into the model parts of [{{\Delta}}F_r^{\rm RE}], i.e. some of the experimental noise, similarly to case (B). The two contributions are of unknown magnitudes and thus [F_r^\lambda] has an undefined uncertainty on two accounts. Conversely [{{\Delta}}F_r^\lambda] accounts for those parts of [F_r^{\rm cryst}] and [{{\Delta}}F_r^{\rm RE}] that could not be absorbed into [F_r^\lambda]. It is thus unclear again to know the expectation value of GoF2 and λ.

(E) The most realistic case in XRW fitting makes the same assumptions as in (D) except that:

(i) [| {F_r^{\rm exp}}| = | F_r^{\rm cryst} + {\Delta}F_r^{\rm SE} + {\Delta}F_r^{\rm RE} |], where [{\Delta F}_{r}^{\rm SE}] represents a systematic error of [| F_r^{\rm exp} |] due to inadequacies of the processing of the primary data, e.g. the frames from the diffraction experiment;

(ii) the [\sigma _r^{\rm exp}] values are not trustworthy estimates of the random errors of [| {F_r^{\rm exp}}|] because they are too small, too large or show an unusual (non-normal) distribution.

In this situation, the fitting leads to [| {F_r^{\rm calc}}| = | {F_r^\lambda } |] and [| {F_r^{\rm exp}} | = | {F_r^{\rm cryst} + {{\Delta}}F_r^{\rm SE} + {{\Delta}}F_r^{\rm RE}| = |F_r^\lambda + {{\Delta}}F_r^\lambda }|], in analogy to cases (C) and (D). However, unlike (C) and (D), the calculated [F_r^\lambda] correct not only for inadequacies of Ψref, but also absorb into the model parts of [{{\Delta}}F_r^{\rm SE} + {{\Delta}}F_r^{\rm RE}], i.e. some of the systematic and random errors. The three contributions are again of unknown magnitudes and thus [F_r^\lambda] has undefined meaning and uncertainty. Conversely [{{\Delta}}F_r^\lambda] accounts for those parts of [F_r^{\rm cryst}], [{{\Delta}}F_r^{\rm SE}] and [{{\Delta}}F_r^{\rm RE}] that could not be absorbed into [F_r^\lambda]. If, in addition, the quality of the [\sigma _r^{\rm exp}] values is unknown, estimating the expectation values of GoF2 and λ is further aggravated.

In a recent paper, Davidson et al. (2022a[Davidson, M. L., Grabowsky, S. & Jayatilaka, D. (2022a). Acta Cryst. B78, 312-332.]) consider the XRW fitting approach as a regularization problem, i.e. the process of adding information in order to solve an ill-posed problem or to prevent overfitting [here we use the term `regularization' as defined in https://en.wikipedia.org/wiki/Regularization_(mathematics)]. In the present case there are two ways of looking at this problem: either as adding experimental information to a quantum chemical model that is insufficient to determine Ψcryst on its own, or as adding theoretical quantum mechanical information to a model of the experiment that is usually strongly underdetermined because the number of coefficients in the wavefunction exceeds the number of observed structure factor amplitudes by far. In both cases the question arises as to how much extra information is required to get an optimal result, i.e. what is the optimal magnitude of λ and how should an optimal mix of calculated and experimental information be defined anyway? This is an alternative formulation of what has been called the halting problem (Davidson et al., 2022a[Davidson, M. L., Grabowsky, S. & Jayatilaka, D. (2022a). Acta Cryst. B78, 312-332.],b[Davidson, M. L., Grabowsky, S. & Jayatilaka, D. (2022b). Acta Cryst. B78, 397-415.]). If one can reasonably assume that the model of equation (4)[link] is sufficiently flexible to determine Ψcryst and that the [\sigma _r^{\rm exp}] values are truthful estimates of the experimental uncertainties, one might choose a value of λ that results in GoF2 = 1. However, these conditions are rarely fulfilled implying that the choice of an appropriate final value for GoF2 remains an open problem in the XRW scheme.

In both ways of looking at the problem, systematic and random errors also introduce uncertainty in the wavefunction, Ψopt, not only in the choice of λ or of the final GoF2 value. Since the goal of the exercise is to find an `experimental' X-ray restrained wavefunction and thus an experimental electron density function ρopt, an additional question arises: what are the uncertainties in Ψop or ρopt? Which parts of ρopt are reliable and which are not? The present XRW fitting algorithm provides no information on this question. In contrast, least-squares modelling of the crystal electron density ρopt through more traditional methods (e.g. multipole models) determines a set of parameters, their standard uncertainties, and mutual correlations. There are statistical criteria for judging the significance of introducing additional parameters into the model, such as Hamilton's R factor ratio test (Hamilton, 1965[Hamilton, W. C. (1965). Acta Cryst. 18, 502-510.]). Such criteria help preventing overfitting by the model. The uncertainty of ρopt can be estimated through propagation of error or analogous procedures. None of these options are available in the present XRW algorithm. Note that the problem raised in this paragraph would also affect the reformulation of the Jayatilaka approach recently envisaged by one of the present authors (Genoni, 2022[Genoni, A. (2022). Acta Cryst. A78. https://doi.org/10.1107/S2053273322003746.]), although, in that case, if convergence is achieved, one can obtain the desired value Δ of statistical agreement between observed and calculated structure factor amplitudes.

In summary, there are several difficulties with the outcome of an XRW fitting and the meaning of an X-ray restrained wavefunction:

(i) an X-ray restrained wavefunction models random error to an unknown degree, while the more traditional least-squares optimization determines expectation values of parameters together with their uncertainties. XRW fitting with its quantum mechanical minimization condition determines parameters too, but not necessarily their expectation values and without uncertainty.

(ii) an X-ray restrained wavefunction models systematic errors in the structure factors or inadequacies of the atomic basis set to an unknown degree (as does a least-squares procedure), thereby obscuring the statistical meaning of GoF2.

(iii) no procedure is available at present to quantify, at least approximately, the relative and absolute magnitudes of random and systematic errors, and of basis-set inadequacies in the optimized density ρopt.

(iv) another non-negligible drawback associated with both the XRW and XCW approaches has been alluded to before: it is the problem of correctly defining GoF2 and its expectation value. Even among developers of the XRW/XCW approach, it is still unclear today which value to assign to Npar in equation (2)[link]. In some circumstances, it is simply set equal to the number of adjustable parameters used in the `wavefunction refinement' (such as λ when it is manually adjusted in the XRW calculations); in other cases, for example when the XRW computation follows a Hirshfeld atom refinement, Npar includes the number of atomic positions and ADPs determined through the preliminary structural refinement; finally, in one of the seminal papers of the X-ray restrained wavefunction approach (Grimwood et al., 2003[Grimwood, D. J., Bytheway, I. & Jayatilaka, D. (2003). J. Comput. Chem. 24, 470-483.]), it is pointed out that Npar should vary as a function of λ, approaching the number of molecular orbital coefficients when λ becomes large [which in most practical applications would lead to a negative value in the denominator of the first factor on the right-hand side of equation (2)[link]]. This uncertainty in the definition of Npar further aggravates establishing the final and desired value of GoF2 and, consequently, determining the correct value of λ.

Therefore, due to above-mentioned problems, an X-ray restrained wavefunction loses – to an unknown degree – its intended meaning as a representation of ρopt, because it cannot be decided whether the XRW density ρλ = ρopt, i.e. it cannot be decided whether or not the final electron density distribution resulting from the XRW process corresponds to the best possible representation of the real electron density ρcryst. For the same reasons the halting problem is ill defined.

4. Possible remedies

What can be done to alleviate these uncertainties?

(a) The data: utmost care is needed to get [\left| {F_r^{\rm exp}} \right|] minimally contaminated by systematic errors. It should be clearly separated from diffuse scattering and very carefully corrected for the properties of the sample (absorption, extinction, etc.), the detector (non-linear response, oblique incidence, etc.) and other imponderables of the experiment. Such corrections are ideally based on physical rather than empirical models of the factors to be accounted for. Good data, ideally coming from more than one sample, tend to minimize effects of some systematic errors, [{{\Delta}}F_r^{\rm SE}]. Data should be tested for consistency between and within samples.

(b) The [\sigma _r^{\rm exp}] values should be trustworthy and their distribution tested for consistency between and within samples. Experiments that produce small, trustworthy [\sigma _r^{\rm exp}] values minimize effects of [{{\Delta}}F_r^{\rm RE}]. Good [\sigma _r^{\rm exp}] values help to make GoF2 quantities more meaningful, of course provided that the number of extra (effective) parameters coming from the XRW fitting can be estimated. So far this is not done. [({\eta | {F_r^{\rm calc}} | - | {F_r^{\rm exp}} |)/\sigma _r^{\rm exp}}] should be tested for outliers with defined criteria before and after XRW fitting, e.g. with normal probability plots.

(c) Separate analysis of experimental data should be done for different choices of data: splitting data into parts (cross validation; Krause et al., 2017[Krause, L., Niepötter, B., Schürmann, C. J., Stalke, D. & Herbst-Irmer, R. (2017). IUCrJ, 4, 420-430.]), looking at different samples separately, and combining all data. It is expected that such a procedure leads to different [F_r^\lambda] because the influence of [{{\Delta}}F_r^{\rm SE} + {{\Delta}}F_r^{\rm RE}] will be different. Comparisons and analysis of different [{\rho _\lambda }] for the same compound could be a first step towards characterizing experimental uncertainty.

(d) To gain a fuller picture of the influence of experimental uncertainty, including the part coming from the atomic positional and displacement parameters, the following iterative procedure might be used in validation experiments: the initial XRW electron density can serve to define Hirshfeld atoms which are used in turn for refining atomic positions and displacement parameters. This might be followed by another XRW fit, etc., until convergence is reached, following the spirit of the XWR (X-ray wavefunction refinement) approach already envisaged and proposed by Grabowsky and collaborators (Grabowsky et al., 2012[Grabowsky, S., Luger, P., Buschmann, J., Schneider, T., Schirmeister, T., Sobolev, A. N. & Jayatilaka, D. (2012). Angew. Chem. Int. Ed. 51, 6776-6779.]; Woińska et al., 2017[Woińska, M., Jayatilaka, D., Dittrich, B., Flaig, R., Luger, P., Woźniak, K., Dominiak, P. M. & Grabowsky, S. (2017). ChemPhysChem, 18, 3334-3351.]).

(e) In addition, the results should be tested by analysing the same data starting from different models Ψref (e.g. HF, DFT and different basis sets). If the different XRW fittings give comparable results for [{\Psi _\lambda }], the analysis can be considered robust.

(f) One could also think of comparing results from alternative expressions for GoF2, e.g. one that includes the phases of the structure factors:

[{\rm GoF}^{2}(\Psi ) = {{1}\over{V({N}_{\rm refl}-{N}_{\rm par})}} \sum _{r = 1}^{{N}_{\rm refl}}{{{\big[{F}_{r}^{\rm exp}-\eta {F}_{r}^{\rm calc} (\Psi )\big]}^{2}}\over{{({\sigma }_{r}^{\rm exp})}^{2}}} \eqno(11)]

or some function of their Fourier transform, i.e. some function of the difference density. Since the XRW fitting comes into play at the very end of the ρcryst modelling, it can reasonably be assumed that the phases of [F_r^{\rm exp}] and [F_r^{\rm calc}({{\Psi}} )] are the same (in the centrosymmetric case) or very close to each other (in the non-centrosymmetric case). This definition would be more akin to a restraint based on the difference electron density, provided one includes a complete set of structure factors up to the resolution limit of the experimental data and GoF2 is divided by the volume V of the unit cell.

(g) For many of the open problems, a better understanding of the XRW procedure could be obtained from a well crafted study with known, predefined [F_r^{\rm cryst}], [{{\Delta}}F_r^{\rm SE}], [{{\Delta}}F_r^{\rm RE}], [F_r^{\rm exp}] and [\sigma _r^{\rm exp}] combined in various ways, e.g. as mentioned for cases (A)–(E) above.

Footnotes

1According to the IUCr definition, a systematic error is a contribution to the difference between an estimate and the true value of a quantity due to deficiencies of the model (https://www.iucr.org/resources/commissions/crystallographic nomenclature/statdes/terms.html). In the case of structure factors, such contributions may arise from two sources. On the one hand, from an inadequate model of the diffraction experiment needed to relate the raw intensity observations to what is commonly called the observed structure factor amplitude, [|F_{r}^{\rm exp}|]. The symbol [|F_{r}^{\rm exp}|] is somewhat misleading as it does not represent a direct experimental estimate, but rather a derived quantity that depends on assumptions and on estimates or measurements of factors affecting the measurement process (background, X-ray absorption, X-ray beam polarization, extinction, etc.). If such factors are insufficiently accounted for, the derived quantity [|F_{r}^{\rm exp}|] will be unreliable to an unknown degree. On the other hand, an inadequate model of the electron density distribution, e.g. an insufficiently flexible basis used in the quantum mechanical calculation, can also cause systematic differences between [\left| {F_r^{\rm exp}} \right|] and [\left| {F_r^{\rm calc}} \right|].

Acknowledgements

We thank Max Davidson, Simon Grabowsky and Dylan Jayatilaka for extended discussions and for giving us access to the preliminary versions of their manuscripts (Davidson et al., 2022a[Davidson, M. L., Grabowsky, S. & Jayatilaka, D. (2022a). Acta Cryst. B78, 312-332.],b[Davidson, M. L., Grabowsky, S. & Jayatilaka, D. (2022b). Acta Cryst. B78, 397-415.]) before publication.

References

First citationBučinský, L., Jayatilaka, D. & Grabowsky, S. (2016). J. Phys. Chem. A, 120, 6650–6669.  Web of Science PubMed Google Scholar
First citationBytheway, I., Grimwood, D. J., Figgis, B. N., Chandler, G. S. & Jayatilaka, D. (2002). Acta Cryst. A58, 244–251.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationBytheway, I., Grimwood, D. J. & Jayatilaka, D. (2002). Acta Cryst. A58, 232–243.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationCapelli, S. C., Bürgi, H.-B., Dittrich, B., Grabowsky, S. & Jayatilaka, D. (2014). IUCrJ, 1, 361–379.  Web of Science CSD CrossRef CAS PubMed IUCr Journals Google Scholar
First citationCasati, N., Genoni, A., Meyer, B., Krawczuk, A. & Macchi, P. (2017). Acta Cryst. B73, 584–597.  Web of Science CSD CrossRef IUCr Journals Google Scholar
First citationDavidson, M. L., Grabowsky, S. & Jayatilaka, D. (2022a). Acta Cryst. B78, 312–332.  CrossRef IUCr Journals Google Scholar
First citationDavidson, M. L., Grabowsky, S. & Jayatilaka, D. (2022b). Acta Cryst. B78, 397–415.  CrossRef IUCr Journals Google Scholar
First citationErnst, M., Genoni, A. & Macchi, P. (2020). J. Mol. Struct. 1209, 127975.  Web of Science CrossRef Google Scholar
First citationGenoni, A. (2017). Acta Cryst. A73, 312–316.  Web of Science CrossRef IUCr Journals Google Scholar
First citationGenoni, A. (2022). Acta Cryst. A78. https://doi.org/10.1107/S2053273322003746Google Scholar
First citationGenoni, A., Dos Santos, L. H. R., Meyer, B. & Macchi, P. (2017). IUCrJ, 4, 136–146.  Web of Science CrossRef CAS PubMed IUCr Journals Google Scholar
First citationGenoni, A., Franchini, D., Pieraccini, S. & Sironi, M. (2018). Chem. Eur. J. 24, 15507–15511.  Web of Science CrossRef CAS PubMed Google Scholar
First citationGenoni, A., Macetti, G., Franchini, D., Pieraccini, S. & Sironi, M. (2019). Acta Cryst. A75, 778–797.  Web of Science CrossRef IUCr Journals Google Scholar
First citationGrabowsky, S., Genoni, A. & Bürgi, H.-B. (2017). Chem. Sci. 8, 4159–4176.  Web of Science CrossRef CAS PubMed Google Scholar
First citationGrabowsky, S., Luger, P., Buschmann, J., Schneider, T., Schirmeister, T., Sobolev, A. N. & Jayatilaka, D. (2012). Angew. Chem. Int. Ed. 51, 6776–6779.  Web of Science CSD CrossRef ICSD CAS Google Scholar
First citationGrimwood, D. J., Bytheway, I. & Jayatilaka, D. (2003). J. Comput. Chem. 24, 470–483.  Web of Science CrossRef PubMed CAS Google Scholar
First citationGrimwood, D. J. & Jayatilaka, D. (2001). Acta Cryst. A57, 87–100.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationHamilton, W. C. (1965). Acta Cryst. 18, 502–510.  CrossRef CAS IUCr Journals Web of Science Google Scholar
First citationHansen, N. K. & Coppens, P. (1978). Acta Cryst. A34, 909–921.  CrossRef CAS IUCr Journals Web of Science Google Scholar
First citationJayatilaka, D. (1998). Phys. Rev. Lett. 80, 798–801.  Web of Science CrossRef CAS Google Scholar
First citationJayatilaka, D. (2012). Modern Charge-Density Analysis, edited by C. Gatti & P. Macchi, pp 213–257. Dordrecht: Springer Netherlands.  Google Scholar
First citationJayatilaka, D. & Dittrich, B. (2008). Acta Cryst. A64, 383–393.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationJayatilaka, D. & Grimwood, D. J. (2001). Acta Cryst. A57, 76–86.  Web of Science CrossRef CAS IUCr Journals Google Scholar
First citationKleemiss, F., Dolomanov, O. V., Bodensteiner, M., Peyerimhoff, N., Midgley, L., Bourhis, L. J., Genoni, A., Malaspina, L. A., Jayatilaka, D., Spencer, J. L., White, F., Grundkötter-Stock, B., Steinhauer, S., Lentz, D., Puschmann, H. & Grabowsky, S. (2021). Chem. Sci. 12, 1675–1692.  Web of Science CSD CrossRef CAS Google Scholar
First citationKrause, L., Niepötter, B., Schürmann, C. J., Stalke, D. & Herbst-Irmer, R. (2017). IUCrJ, 4, 420–430.  Web of Science CSD CrossRef CAS PubMed IUCr Journals Google Scholar
First citationMacchi, P. (2022). Quantum Crystallography: Expectations versus Reality. Cham, Switzerland: Springer.   Google Scholar
First citationMacetti, G., Macchi, P. & Genoni, A. (2021). Acta Cryst. B77, 695–705.  Web of Science CrossRef IUCr Journals Google Scholar
First citationRuth, P. N., Herbst-Irmer, R. & Stalke, D. (2022). IUCrJ, 9, 286–297.  Web of Science CSD CrossRef CAS PubMed IUCr Journals Google Scholar
First citationStewart, R. F. (1976). Acta Cryst. A32, 565–574.  CrossRef CAS IUCr Journals Web of Science Google Scholar
First citationTozer, D. J., Ingamells, V. E. & Handy, N. C. (1996). J. Chem. Phys. 105, 9200–9213.  CrossRef CAS Web of Science Google Scholar
First citationWeiss, R. J. (1966). X-ray Determination of Electron Distributions. Amsterdam: North-Holland Publishing Company.  Google Scholar
First citationWieduwilt, E. K., Macetti, G. & Genoni, A. (2021). J. Phys. Chem. Lett. 12, 463–471.  Web of Science CrossRef CAS PubMed Google Scholar
First citationWieduwilt, E. K., Macetti, G., Malaspina, L. A., Jayatilaka, D., Grabowsky, S. & Genoni, A. (2020). J. Mol. Struct. 1209, 127934.  Web of Science CrossRef Google Scholar
First citationWoińska, M., Grabowsky, S., Dominiak, P. M., Woźniak, K. & Jayatilaka, D. (2016). Sci. Adv. 2, e1600192.  Web of Science PubMed Google Scholar
First citationWoińska, M., Jayatilaka, D., Dittrich, B., Flaig, R., Luger, P., Woźniak, K., Dominiak, P. M. & Grabowsky, S. (2017). ChemPhysChem, 18, 3334–3351.  Web of Science PubMed Google Scholar

This article is published by the International Union of Crystallography. Prior permission is not required to reproduce short quotations, tables and figures from this article, provided the original authors and source are cited. For more information, click here.

Journal logoSTRUCTURAL SCIENCE
CRYSTAL ENGINEERING
MATERIALS
ISSN: 2052-5206
Follow Acta Cryst. B
Sign up for e-alerts
Follow Acta Cryst. on Twitter
Follow us on facebook
Sign up for RSS feeds