X-ray Raman scattering: a new in situ probe of molecular structure during nucleation and crystallization from liquid solutions

X-ray Raman scattering (XRS) has been used for in situ probing of solute molecule speciation in solution during cooling crystallization. The C and N K-edges of aqueous imidazole were measured as a function of temperature to monitor the transition from the undersaturated state through supersaturation to crystallization. A new jacketed-vessel crystallizer with internal flow was used, which enables thermal control and minimizes radiation damage. We have demonstrated that the C and N K-edges of imidazole are sensitive to changes in local bonding. In line with this, an abrupt change in the N K-edge fine structure indicates the onset of desolvation and crystallization from the supersaturated solution. In contrast, negligible changes are observed in the C and N K-edge spectra acquired during cooling, indicating that the average solvation structure around imidazole molecules does not change significantly while traversing the thermodynamically metastable supersaturated zone. To the best of our knowledge this is the first time X-ray Raman scattering has been used for studying molecular speciation in organic aqueous solutions during crystallization. Time-dependent density functional theory (TD-DFT) calculations of the near-edge spectra were performed using implicit, explicit and combined solvation models to elucidate the likely binding sites of the water molecules. An explicit solvation model with one water molecule coordinating each nitrogen moiety in the imidazole ring accurately reproduces the peak positions and intensities of the XRS spectra of aqueous imidazole solution.


Introduction
Understanding the nucleation of organic solutes from solutions is crucial to control the physical and chemical properties of crystalline products, with relevance for the chemical and the pharmaceutical industries. Current nucleation theory does not allow predictive design of crystallization processes to target crystal properties. More detailed information about molecular transformations and self-assembly processes during nucleation and crystallization is required to progress this research field. [1][2][3][4] Nucleation of crystals from solution must be associated with the formation of solute-solute bonds at the expense of solute-solvent interactions. Classical nucleation theory (CNT) describes this process by postulating a prenucleation equilibrium between solvated solute molecules and small clusters of solute molecules that are held together by solute-solute interactions. CNT further assumes that the balance between the cohesive energy gain in the nascent crystal volume and destabilization by the formation of the crystal/solution interface determines a critical cluster size, above which further crystal growth becomes the thermodynamically spontaneous process. Clusters with subcritical size form and re-dissolve again in the prenucleation equilibrium. One would therefore expect that at high supersaturation an unknown mole fraction of the solute molecules exists in prenucleation clusters 1 in which solute-solvent bonds are replaced by solute-solute interactions. This process is possibly mediated by the solvent molecules in the solvation shells surrounding the solute molecules.
A number of spectroscopic and scattering techniques have been used to probe the interactions of solute molecules in solution generally, and specifically during nucleation. Some of these techniques are: nuclear magnetic resonance (NMR), 5,6 optical microscopy, 7 Raman and Fourier transform infra-red (FTIR) spectroscopy, 8 UV-vis spectroscopy 9 and small-and wide-angle X-ray scattering (SAXS and WAXS). 10 However, with these techniques there has been limited success in providing molecular-level information about the supersaturated state from which nucleation occurs. Neutron diffraction and accompanying structure simulations can provide an excellent molecular representation of solution structures, 11,12 but the measurements are slow and hence not suitable for capturing the structural evolution around solute molecules during nucleation and crystallization.
Near-edge X-ray absorption fine structure (NEXAFS) spectroscopy probes local structure via excitation of core level electrons (usually 1s) to unoccupied states in the valence region of molecules. The technique has recently been shown to be able to detect the formation of prenucleation equilibrium during the reactive interfacial nucleation of metal nanoparticles. [13][14][15] The involvement of valence levels makes NEXAFS also highly sensitive to chemical and physical changes around organic molecules in solution and in the solid state. Differences due to crystal polymorphism, 16 solute-solvent interactions, [17][18][19] protonation and hydrogen bonding 18,20,21 have been reported.
However, NEXAFS of organic molecules is a soft X-ray synchrotron radiation technique requiring ultra-high vacuum (UHV) beamlines, with most available spectrometers housed in UHV chambers as well. NEXAFS measurements on liquids thus require sample handling in a vacuum chamber. This imposes constraints on experimental control that, while probably addressable through novel instrument designs, have so far prevented studies of solution structure under controlled supersaturation conditions. Most commonly used designs are liquid microjets that expand into a vacuum chamber. [22][23][24][25] In a liquid microjet system, evaporative cooling and adiabaticity of the sudden pressure drop prevent control of the temperature, which is required to maintain well-defined supersaturation conditions. Moreover, turbulence and interfaces in the microjet nozzles act as nucleation sites, often resulting in blockage by growth of solid deposits from supersaturated solutions.
X-ray Raman scattering (XRS) is a non-resonant X-ray scattering technique that is an alternative to NEXAFS for probing unoccupied valence density of states. XRS probes not only dipole but also higher-order transitions, depending on the momentum transfer involved. The momentum transfer is related to the angle between the incident beam and the detection angle for the scattered photons. At low momentum transfer (vide infra) the spectra are dominated by dipole transitions. XRS utilizes hard X-rays; hence it is effectively an alternative technique for measuring NEXAFS that avoids the experimental challenges associated with the use of soft X-rays. The deep penetration depth (∼2 mm at 10 keV) of hard X-rays makes XRS a bulk-sensitive technique, with the added benefit of significantly inhibited self-absorption distortions of the spectra. 26 The use of hard X-rays also allows the design of ambient-pressure environmental cells with precise temperature and pressure control. It has been shown previously that these characteristics make the technique suitable for studying molecular structure in the bulk of liquid water and aqueous solutions, 26,27 including comparisons of structure in liquid water and ice 28,29 and exploring the effect of isotope substitution on local structure. 30 More recently, XRS has been applied to examine the effects of organic solutes on the structure of water. 31 Here, we show that XRS can be used as an in situ technique for characterizing solute speciation during cooling crystallization, from the undersaturated state through the metastable zone with high supersaturation until the onset of crystallization.
Imidazole was chosen as the test system for the in situ XRS measurements because it has high solubility in water (∼11 mol L −1 at 25°C (ref. 32)), which ensures good signalto-noise ratios. Moreover, imidazole is of high biological, 33-36 pharmaceutical 37-39 and industrial 40,41 importance. For imidazole in the solid state, X-ray 42,43 and neutron 44 diffraction analysis revealed a motif of hydrogenbonded molecule chains in one direction, with 3D-cohesion involving π-π interactions between the chains. For aqueous solutions, previous studies by UV spectroscopy 9 and energy dispersive X-ray diffraction 45 indicated self-association of the solute molecules by π-π stacking. However, molecular dynamics (MD) simulations illustrated that chain-like hydrogen-bonding is more likely than such stacked structures, both in aqueous solutions at different concentrations 46 and in liquid imidazole. 47 MD simulations also indicated that the local structure around the imidazole molecules does not change strongly as a function of concentration. 46 A recent NEXAFS study of imidazole solutions 17 supported the MD simulation results, in that the N K-edge absorption spectra exhibited only minor changes in the concentration range from 0.5 to 8.2 M. The XRS study reported here complements this NEXAFS study 17 and extends the scope of characterization to the supersaturated state.

Crystallizer design
Commonly used hard X-ray sample environments for liquid samples include microfluidic cells, 48 closed-loop flow cells utilizing peristaltic pumps 49,50 and liquid jets. 51 Since cryogenic cooling is not an option for reducing radiation damage of the sample when studying liquids, circulating or flushing samples is required to reduce the contact time between the sample and the X-ray beam. The use of microfluidic cells is one way of achieving this. However, their stock volume is small, which is convenient for precious or hazardous samples, but may not be sufficient for diluting the influence of radiation-induced chemical changes. Closed-loop flow cells often use higher stock volumes. However, maintaining the equilibrium temperature, and thus the metastable state of the supersaturated system, is challenging across a combination of a stock solution reservoir, flow tubing and the region where X-ray probing takes place, making these cells less attractive for crystallization studies. We have therefore designed a different type of crystallizer ( Fig. 1) built around a jacketed vessel of the type commonly used in laboratory-scale crystallization studies. The design minimizes the potential for radiation damage to the sample through circulation of a large stock volume (∼250 ml) and provides the required temperature control, i.e. the thermodynamic driving force for crystallization. It is therefore possible to follow the structural evolution of a solution from undersaturation through supersaturation to nucleation and crystal growth in a classic cooling crystallization experiment.
At the heart of the crystallizer is a standard jacketed glass vessel. The temperature of the crystallizing solution is controlled through the temperature of the fluid in the jacket. We used water as the temperature control fluid, with a water bath circulator to control its temperature. This jacketed vessel was modified by fitting a system of two concentric tubes to its bottom. The outer cylindrical glass tube has a closed end and was attached to the jacketed vessel using a screw cap connection. It has a Kapton window to allow probing of the sample volume directly underneath using X-rays. The Kapton window was fixed over a 10 mm wide cut-out slot covering a 180°arc. The solution flows continuously past this window and is recycled back into the main bulk of the cell via an inner concentric tube using a peristaltic pump at a flow rate of up to ∼450 ml min −1 to minimize radiation damage. The inner concentric tube diameter is 3.2 mm, which is sufficiently large to minimise turbulence that may induce nucleation. In addition to internal solution circulation, magnetic stirring was used to ensure uniform temperature distribution in the stock solution within the jacketed vessel and to mimic stirring in a real-world crystallizer.

Cooling crystallization studies
Imidazole (Sigma Aldrich, puriss >99.5%) was used without further purification. We noticed that some supplied batches contained small amounts of insoluble matter; such batches were not used for these experiments. Deionized water was used for the preparation of the 10.1 M imidazole solution. The solution had a pH value of 11 at room temperature. For the cooling crystallization study, the C and N K-edge spectra of a 10.1 M aqueous solution of imidazole were measured at 35, 20 and 13°C. The solution was also probed after precipitation of crystals had taken place.
Crystalline imidazole powder was also measured as a reference. The powder sample was pressed into a 13 mm diameter pellet with a thickness of ∼2 mm. The pellet was mounted on a spinning platform and measured with an offcentred beam to minimize radiation damage.
where q is the momentum transfer, ħω is the energy difference between the incident and scattered photon, r is the position relative to the initial state and i and f label the electron initial and final states. Eqn (1) gives a general cross section term for all non-resonant inelastic X-ray scattering events, including scattering from phonons, plasmons, valence electrons (Compton scattering) and core level electrons (X-ray Raman scattering). At low momentum transfer (q), XRS and XAS probe the same transition matrix element for core level electrons and have similar directional sensitivities. 52 The dynamic structure factor for XRS in the low q range (the dipole limit) is presented in eqn (2) and is analogous to the X-ray absorption coefficient. 52 XRS measurements were performed at sector 20-ID of the Advanced Photon Source (APS), Chicago, USA, using the lowenergy resolution inelastic X-ray scattering (LERIX) spectrometer. 53,54 20-ID is an undulator beamline equipped with liquid nitrogen cooled Si(111) and Si(311) monochromators. The Si(311) monochromator was used as it achieves high spectral resolution which is needed for this study. The combined instrumental resolution of the monochromator and the analyzer crystal was ∼0.5 eV. The monochromatized beam was focused using a toroidal mirror to a spot size of 600 μm (horizontal) and 400 μm (vertical). The scattered radiation was analyzed with a combination of Si diced and undiced spherically bent crystal analyzers (SBCA). The SBCAs were tuned to use the Si(555) reflection, and the scattered radiation was detected using NaI scintillators coupled to custom-built amplifier and discriminator electronics. All data were collected using the inverse scanning mode, where the incident photon energy was scanned and the analyzer energy was fixed at 9891 eV. Data were collected from 18 of the 19 crystal spectrometers. The data presented in this study were taken from q6 diced crystal analyzer which is one of the low momentum transfer (q) analyzers with the best signal to noise ratio. This way, the data were collected at a scattering angle of 54°with q value of ∼4.6 Å −1 . The monochromator drift was small (±0.137 eV) and it was monitored through frequent measurement of the elastic scattering peak. The monochromator was detuned by 15% to suppress the contribution from the harmonic component of the beam.
For the liquid samples, typical measurement times at each temperature were 2-3 hours. Over this period, several spectra were collected and checked for consistency before averaging. It is worth noting that no evidence of radiation damage was picked up in the collected spectra (individual spectra are provided in the ESI, † Fig. S1-S9). The LERIX sample chamber was flushed with He gas to reduce background scattering from air. For data analysis, the incident energy was subtracted from the XRS data to obtain near-edge spectra which were then subsequently background subtracted and normalized to the edge step height using Athena software. 55

Computational methods
Excited state density functional theory (DFT) calculations were performed to generate theoretical C K-edge and N K-edge X-ray absorption (XA) spectra of imidazole in the gas, solution and solid phases. All calculations were performed using ORCA version 4.0.2, a quantum chemistry software package. 56 Calculations were carried out using the B3LYP functional 57 and the 6-31G* basis set for the monomeric imidazole molecule, while a minimally augmented def2-TZVP basis set 58 was used for simulating the XA spectra of solvated and solid state imidazole. To speed up the calculations, the D3 dispersion correction 59 was applied to all calculations. RIJCOSX approximation 60 with def2/J auxiliary set was applied to the calculations for solvated and solid state imidazole.
The structure of the monomeric molecule used to represent imidazole in the gas phase was constructed in Avogadro version 1.1.1, a molecular builder and visualization tool with ORCA support. 61 The intramolecular structure was initially optimized in Avogadro using the UFF force field and then further refined using ground state geometry optimization calculations in ORCA. Frequency calculations were run on the optimized structure to ensure that the structure corresponded to the global energy minimum. Finally, time dependent DFT (TD-DFT) calculations were performed on the optimized structure to generate the theoretical near-edge spectra.
To simulate the water solvation shell around the imidazole molecule, both implicit and explicit solvation models were used. In models 2-4, water molecules were explicitly added around the imidazole molecule. The positions of the water molecules shown in Fig. 2 were optimized in ORCA. For comparison, model 1 used an implicit solvation model, the conductor-like polarizable continuum model (CPCM). 62 Model 5 used a hybrid explicit/implicit model which added CPCM to the structure from model 4 where two water molecules bind to the protonated and non-protonated nitrogen atoms in the imidazole ring. The construction of all the solvation models as well as the geometry optimization and frequency calculations were performed using the same procedure as described above for the monomeric imidazole.
To perform excited state simulations (TD-DFT) of solid phase imidazole, a cluster of eight imidazole molecules (Fig. 2) was taken from the crystal structure of imidazole. 44 The calculations were performed for the two circled imidazole molecules (Fig. 2(ii)) in the eight molecule cluster. These two molecules are involved in hydrogen bonding as well as edge-face and π-π stacking with parallel displacement as in the crystal structure. Hence calculations on these molecules should account for the effects of the different types of imidazole-imidazole interactions that exist in the crystal structure.
It should be noted that the excited state DFT calculations presented here only model electronic states below the continuum threshold. In addition, relative changes in the core level potential energies calculated using TD-DFT are more accurate than absolute values, 63,64 thus we introduced an empirical 1s core level energy offset of ∼10.5 eV (±0.4) for the C K-edge and ∼12.3 eV (±0.5) for the N K-edge when comparing calculated and experimental near-edge spectra.

Results and discussion
In Fig. 3, the C and N K-edge spectra of solid and aqueous imidazole measured using X-ray Raman scattering (XRS) are compared to the gas phase imidazole spectrum measured using inner shell electron energy loss spectroscopy (ISEELS). 65 At low momentum transfer, ISEELS 66 and XRS 52 probe dipole transitions and hence are analogous to X-ray absorption (XA) spectra. The strong resonances in the near-edge region of the C and N K-edge spectra correspond to transitions from the 1s core level of the absorbing atom to the unoccupied valence orbitals with π* character. These are followed by the ionization potentials (IP) and broad σ* shape resonances corresponding to multiple scattering at the potential barrier to the bound neighbouring atoms. The energy difference between the centroid of the σ* shape resonances and the IP (usually termed δ) provides a highly sensitive measure of the bond length. 66,67 The sensitivity of δ values to bond length variations as low as 0.001 Å have been previously illustrated for p-aminobenzoic acid 68 and saccharides. 69 Non-linear least-squares fitting using Fityk software 70 was utilized for the deconvolution of the near edge K-edge spectra (Fig. 3). Gaussian functions were used to model the π* and σ* shape resonances. 66 The full width at half maximum (FWHM) of the fitted functions is mainly determined by lifetime broadening, with similar values expected for the ionization potential (IP) step functions and the bound state π* resonances just below the IPs. The FWHMs of the Gaussian peaks modelling the π* resonances vary by ∼1 eV for the C K-edge and ∼0.3 eV for the N K-edge. The C K-edge near-edge peaks are broader because several features contribute to each π* resonance; this is illustrated later in the paper using TD-DFT calculations in which we assigned the contributions from the different carbon atoms to each π* peak. The FWHMs of the This journal is © The Royal Society of Chemistry 2018 σ* shape resonances increase with energy due to lifetime broadening. 66 Arctan functions were used to model the IPs. 66 Considering that imidazole has three different carbon moieties and two different nitrogen moieties, three and two arctan functions were thus used to model the C K-edge and N K-edge IPs respectively. Since the ratio of the different carbon moieties in the imidazole molecule is equal, the width and height of the arctan functions in the C K-edge spectra were constrained to be equal; a similar procedure was followed for the N K-edge. The energy difference between the arctan functions (ΔIP) in the N K-edge spectra was constrained to be equal to the energy difference between the two 1π* peaks (ΔE (1π*)) because it has been illustrated previously that the transitions to π* states are dominated by the core level binding energy shifts. 17 Experimental core level binding energies for C K-edge and N K-edge have been reported for aqueous imidazole solution using X-ray photoelectron spectroscopy (XPS). 71 The energy differences of the arctan functions in the C K-edge for the aqueous solution phase (ΔIP (C2-C5) and ΔIP (C5-C4)) were constrained according to the values reported in the above mentioned XPS studies. 71 ΔIP (N1-N3) is in good agreement with the binding energy differences reported previously. 71 The resulting centroids of the fitted Gaussian and arctan curves are listed alongside the values predicted by ORCA TD-DFT calculations in Tables 1 and 2.

N K-edge XRS
The near-edge region of the imidazole N K-edge spectra is dominated by excitations from 1s to the 1π* orbital of the two nitrogen moieties (N3 and N1-H). 17,65 An additional transition into the 2π* valence orbital is observed at the N3 centre for the gas phase spectrum. 65 Comparison of the N K-edge spectra of the three phases reveals a decrease in the energy difference between the two 1π* peaks, from 2.444 eV in the gas phase, to 1.624 eV for the solution and 1.425 eV for the solid (Fig. 3). The energy difference between the two 1π* transitions and IPs for the solution is closer to that of the hydrogen bonded solid than to the gas phase monomer, indicating that hydrogen bonding likely plays an important role in the solution phase of imidazole.
The energy difference between the two 1π* peaks in the solid state (1.425 eV) spectra is in good agreement with previously reported total electron-yield (TEY) NEXAFS spectra for imidazole in the solid state (1.5 eV). 65 Similarly, the 1π* energy difference for the solution phase sample (1.624 eV) is in agreement with previously reported X-ray excited optical luminescence (XEOL) NEXAFS of aqueous imidazole (1.7 eV). 17 However, the intensities of the two π* peaks in the solution phase XRS spectrum reported here are roughly equivalent in contrast with the previously reported NEXAFS spectra measured using XEOL which has a less intense N1 1π* peak. 17 We note that the relationship between core level absorption oscillator strengths and optical photon emission is complex, involving multiple excited state decay pathways that may include the transfer of energy from the absorbing atom to nearby atoms. 72 This may explain the differences in relative intensities between the near-edge features measured using XRS and XEOL.
The experimental and ORCA-calculated features (Table 1) show that the variations in ΔEĲ1π*) and ΔIP between the three phases stem from larger changes in the energy of 1s → 1π* transitions and the IP associated with the protonated N1 moiety when compared to N3, an interpretation that is in line with previously published results combining NEXAFS and StoBe calculations. 17 The energy shifts of the near-edge resonances, the IPs and δ values associated with the N1 moiety are reflected by more significant changes in the lengths of the bonds formed by N1 when compared to N3 ( Table 2). As one goes from gas to solution to solid phases, there is an increase in the N1-H bond length and an associated decrease in the N1-C2 and N1-C5 bond lengths. On the other hand, the C2-N3 bond length is almost identical and the decrease in the N3-C4 bond length is less severe when compared to that associated with N1-C bond lengths. Moreover, the δ values associated with bonds involving the N1 atom are more dependent on the physical state compared with the δ values associated with N3 (Table 1). These observations indicate that the formation of hydrogen bonds with water molecules (N1-H⋯O-H/N3⋯H-O) in the solution sample and with imidazole molecules (N1-H⋯N3) in the solid sample changes the electron density at the N1 site much more than at the N3 site.
A likely explanation is that the hydrogen bonds formed at the N1 centre occur through proton donation with changes in electron density located in the N-H bond. In contrast, the N3 centre acts as a proton acceptor and participates in the aromatic system, which therefore allows significant delocalization of the electron density variation across the aromatic ring resulting in a smaller core level shift due to hydrogen bonding.

C K-edge XRS
We will first define the origin of features in the C K-edge spectra before presenting the XRS spectra of imidazole in the solution and crystalline phases. For that purpose, excited state DFT calculations were performed on an isolated imidazole molecule. Based on these calculations, a schematic molecular orbital diagram was constructed to summarize the atomic and molecular orbital energies associated with the C K-edge absorption spectra (Fig. 5). Similarly to the N K-edge spectra, the near-edge region in the C K-edge spectra is expected to be dominated by transitions into the unoccupied π* states. The calculated XA spectrum for the monomer (Fig. 4) shows a sharp peak corresponding to C4, C5 and C2 1s → 1π* transitions and C4 1s → 2π* transition and a less dominant feature corresponding to C5 and C2 1s → 2π* transitions. The energy centroids of these transitions are listed in Table 3. We now compare the experimental C K-edge spectra of imidazole in solid state and solution with the ISEELS gas phase spectrum previously reported 65 (Fig. 3). The predicted near-edge features in the C K-edge corresponding to the C 1s → 1π* and C 1s → 2π* transitions are identified in the experimental spectra of imidazole in gas, solu-tion and solid phases. The observed energy difference between the two features in the near-edge region of the solid state spectrum (2.043 eV) agrees with previously published TEY data. 65 ORCA calculations for the hydrated imidazole molecule and the molecules in the crystal structure reproduced these features and enabled the identification of the contributions from the different carbon atoms (Fig. 4).
In terms of the C1s binding energies (BE), C2 is expected to have the highest 1s core level BE as it is bonded to both electronegative nitrogen moieties in the imidazole ring. The other two carbon atoms are expected to have lower BE values due to The calculated XA spectra of structural models in bold are presented in Fig. 5. Fig. 4 Comparison of the experimental and calculated C and N K-edge spectra. (i) ISEEL spectra of imidazole in the gaseous phase reported in reference. 65 (ii) XRS spectra of the aqueous solution at 35°C (iii) XRS spectra of solid state imidazole. For the aqueous solution sample, the TD-DFT simulated spectra used model 4 which is shown in Fig. 2. Note that the peak at ∼285.1 eV in the experimental C K-edge of the solution is from the Kapton window contribution.
This journal is © The Royal Society of Chemistry 2018 bonding to only one nitrogen neighbor, and C5 should have a slightly higher value than C4 as it is bonded to the protonated nitrogen atom (N1). This is reflected in the experimental IPs and the ORCA-calculated core level orbital energy values and the π* transition energies, which are the highest for C2 followed by C5 and C4 (Table 3). Similarly, in solid state theophylline 73 and histidine 74 the C1s binding energy for the NC-NH (equivalent to C2 in imidazole) was higher than the other carbon atoms in the imidazole ring of these molecules.
The energy difference between the two C K-edge peaks in the near-edge region for the solution phase is 1.982 eV, which is significantly lower than that observed in the gas phase (2.724 eV) and comparable to that of the solid phase (2.043 eV). This observation indicates that the electron density at the carbon moieties in the hydrogen bonded solution phase is similar to that in the crystalline phase where hydrogen bonding between imidazole molecules in the same plane exists alongside interplanar stacking interactions between hydrogen bonded chains. We should point out that for the solution C K-edge spectrum a fit with comparable quality can be achieved with ionisation potentials about 1 eV higher in energy (this is documented in the ESI †). However, the energy difference between the two peaks in the C K-edge spectra in that fit is similar to the energy difference reported for the gas phase spectrum, suggesting that the electron density for carbon atoms in aqueous solution is similar to that of the monomeric gas phase molecule, which appears implausible. Hence we tentatively prefer the fits presented here (Fig. 3  and 7) as they suggest similar electron density around the carbon moieties in the condensed phases (i.e. solution and solid phases). Note that the peak at 285.095 eV in the C K-edge solution phase spectrum is attributed to the contribution from the Kapton window. In contrast, the contribution of Kapton in the N K-edge spectra is minor due to the smaller atomic ratio of N in Kapton (∼0.051) as compared to C (∼0.564).

The effects of solvation
The sensitivity of the near-edge spectra to intermolecular interactions between imidazole and water is illustrated by the calculated spectra for the solvation structure models presented in Fig. 2. The structural model using two explicit water molecules, one added at each side of the imidazole ring (model 4), gave best agreement with the experimental N K-edge spectrum in terms of spectral features and relative energies of the peaks (Fig. 6 and Table 4). The energy difference between the two main 1π* peaks in the N K-edge near-edge  region is greater in the XA spectra generated with explicit solvation models 2 and 3 (where water was added at one side of the imidazole ring only) than in the experimental spectrum ( Fig. 6 and Table 4). This is associated with a shorter internal N1-H bond and longer hydrogen bonds between the imidazole and water molecules ( Table 2). The variations between the calculated C K-edge spectra for the three explicit solvation models were minimal, indicating that the interaction of water with the N moieties results in similar effects on the C members of the aromatic ring (Fig. 6). The implicit solvation model accounts for the long range effects of the solvent, which was previously found necessary to determine the vertical and adiabatic ionization potentials of imidazole in aqueous solution. 75 The implicit solvation model (model 1) gave some agreement with the experimental data; however, it shows an extra feature between the two main peaks at 400.826 eV, which is associated with the N3 1s → 2π* transition. This extra feature is only visible in the spectrum of the gas phase species (Fig. 3). The calculated energy differences between the N3 2π* and 1π* peaks are ∼1.160 eV for the monomeric molecule (analogous to gas phase system), ∼0.995-1.113 eV for the explicit solvation models (models 2-4, Table 4) and ∼0.816 eV for the implicit model (model 1). The transition from the N3 1s core to the 2π* valence orbital is shifted to lower energy in the implicit solvation model and is associated with the higher N3-C internal bond lengths when compared to the monomeric molecule and the explicit solvation models (Table 2). These changes in internal bond lengths seem to affect the C K-edge as well, with the second feature in the C K-edge shifted to lower energy compared with the experimental spectrum (Fig. 6).
A combined model where implicit solvation was used to account for the long range effects and explicit water molecules were added to account for local effects was also considered (model 5). In this case, the relative energies for the two 1π* peaks are underestimated compared with the experimental spectrum and, similarly to the implicit solvation model (model 1), the calculated transition from N3 1s → 2π* is shifted to lower energy. The N3 1s → 2π* transition was not resolved as an individual peak because the energy of the N1 1s → 1π* transition is underestimated and the two peaks overlap. The C K-edge spectrum calculated using model 5 is similar to that of the implicit solvation model (model 1).
Although the C and N K-edge spectra generated from model 4 are in good agreement with the experimental spectra, increasing the number of water molecules is expected to decrease the hydrogen bond length between water and imidazole molecules and consequently the energy split between the two 1π* peaks. This has been illustrated by previously reported micro-hydrated cluster models that were used to simulate NEXAFS spectra 17 where the addition of water molecules lowers the energy differences between the two 1π* peaks and the two IPs. Moreover, it was concluded that explicit solvation to include the second coordination shell did not account for the long-range effects of the bulk solvent nor, naturally, for solute-solute interactions. Implicit solvation which accounts for long range effects of the solvent underestimates the transition to the 2π* valence orbitals.
In situ measurements in the metastable supersaturated zone As described in the introduction, according to classical nucleation theory (CNT) the formation of crystal nuclei is believed to be preceded by self-association of solute molecules and formation of clusters with significant solute-solute interactions. Previous studies, as well as our results for the undersaturated concentrated solutions, have indicated that hydrogen bonding 17,46 and π-π interactions 9,45 are the dominant intermolecular interactions in aqueous imidazole solutions. TD-DFT calculations with our structural models show that the N K-edge spectra are highly sensitive to changes in hydrogen bonding at the N moieties of imidazole. Comparison of the C K-edge in the three phases (gas, solution and solid) reveals that the C K-edge is sensitive to intermolecular interactions between solute-solvent and solute-solute molecules.
To capture the structural evolution of a supersaturated aqueous solution of imidazole, C and N K-edge XRS spectra were collected during cooling crystallization (Fig. 7). The spectra for the two edges were collected outside the metastable zone of a 10.1 M aqueous solution of imidazole (at 35°C) and then in the metastable zone (at 20°C and 13°C). A subsequent N K-edge spectrum was significantly different from the spectra in the metastable zone, prompting visual inspection of the crystallisation vessel which indicated the presence This journal is © The Royal Society of Chemistry 2018 of crystals. The photon energy difference between the two peaks in the C K-edge is ∼2.002 eV (±0.051) for the solution at different temperatures (35°C, 20°C and 13°C). Similarly, the photon energy difference between the two 1π* peaks in the N K-edge spectra is ∼1.624 eV (±0.019) for the solution at different temperatures and ∼1.553 eV after crystal formation (Fig. 7). The variation in the spectral features of the C and N K-edge XRS spectra during cooling is minor and a change is observed in the N K-edge spectra once crystals have formed.
The minimal change observed in the C and N K-edge during cooling crystallization indicates that the average local co-ordination around the imidazole molecules does not change significantly during the cooling crystallization process. This outcome of our in situ measurements in the metastable zone is reminiscent of previous NEXAFS results for non-saturated aqueous solutions of imidazole, where minimal variation in the N K-edge spectra was detected as a function of concentration. 17 They are also in line with a recent molecular dynamics simulation that suggested the solvation of the imidazole nitrogen moieties remained almost identical for different concentrations. 46 This suggests that the concentrationdependent structure of aqueous imidazole can be described  Tables 3 and 1 respectively. Note that the peak at ∼285.1 eV in the solution C K-edge is from the Kapton window. Table 4 Energy difference (ΔE) between 1s → π* spectral features in the near-edge region of the C and N K-edge spectra for the monomeric imidazole molecule and the five solvation structural models shown in Fig. 2 Structural models ΔE (N1 1π*-N3 1π*)/eV in terms of interactions between hydrated imidazole molecules rather than direct imidazole-imidazole interactions. By implication, desolvation of hydrated imidazole monomers appears to be the key step in nucleation of imidazole crystals. A recent simulation of NaCl nucleation from supersaturated solutions similarly suggested that the desolvation of the ions determines the attachment rate of monomers at the interface between the nuclei and the solution, rather than the diffusive flux of molecules as assumed by CNT. 76 Moreover, CNT assumes that the internal structure of the critical nuclei is similar to that of the final crystals. It is interesting to note in this context, that the C and N K-edge spectra varied minimally during cooling crystallization and were distinct from those of the crystalline phase. It therefore appears that any structuring due to aggregation of monomers in the metastable zone prior to nucleation, if it exists, does not reflect the structure of the final crystalline product. This is in line with previous suggestions that the pre-nuclei differ drastically in terms of structure and composition from the bulk phase. 5,8,77,78 Other "non-classical" nucleation mechanisms have been explored both theoretically and experimentally such as the two-step nucleation mechanism 4 and prenucleation cluster mechanism. 2 In two-step nucleation, formation of metastable dense liquid-like clusters is predicted to precede the nucleation event. Numerical simulation of homogenous solutions 79 and DFT calculations 80 showed that such liquid-liquid separation may occur near the metastable critical point. However, crystallization experiments did not provide evidence that this phase separation takes place. 7 This indicates that the predicted phase separation is due to a liquid-liquid miscibility gap inside the metastable zone and should not be confused with nucleation mechanisms. 1,7 Prenucleation clusters are thermodynamically stable associates in the solution, with a structure that may be similar or dissimilar to the final crystallized product. 2 However, their presence has only been illustrated for inorganic systems. 2 It is worthwhile to examine how realistic it is that prenucleation clusters can be detected by experimental techniques probing the overall composition of the nucleating solution. Arguably, the concentration of solute molecules in prenucleation clusters should be small in comparison with the mole fraction in the remaining bulk saturated solution. How realistic, therefore, is it that techniques such as XRS capture their presence? We can arrive at an estimate by considering that XRS was able to capture the changes in the N K-edge spectral features induced by nucleation. Let us, for the moment, make the assumption that the solution after crystal formation consists of imidazole crystals in a saturated imidazole solution (noting that this might be a simplification requiring further consideration, see below). The balance between solid state and solution state imidazole molecules is reflected by the photon energy difference between the two 1π* peaks in the N K-edge spectra. For the post-nucleation solution we determined an intermediate value between those for the crystalline phase and the undersaturated solution (at 35°C) (Fig. 8). The observed decrease to 1.553 eV (Table 1, Fig. 8) is approximately 1/3 (∼36%) of the decrease expected if all imidazole transitioned into the crystalline form. This suggests that the imidazole molecules in the precipitated crystals were approximately 1/3 of all the imidazole molecules previously present in solution, with the remainder staying as solute molecules in a saturated solution. If nucleation of imidazole from aqueous solutions would pass through a prenucleation cluster stage it may involve up to 1/3 of the solute molecules. That no significant changes in the spectra were observed prior to the detection of crystals may therefore suggest that the fraction of solute molecules involved in cluster formation before nucleation is much lower than the fraction of molecules assembled in the crystallized product, or it may signify that imidazole-water binding remains the dominant structural motif upon cluster formation, with similar local solvation of imidazole in the undersaturated and in the supersaturated state. If prenucleation clusters are formed then imidazole-imidazole interactions do not appear to change the electronic structure of imidazole to the same extent as the hydrogen bonds to water molecules. Any selfassociation or cluster formation would thus involve interactions between hydrated imidazole molecules, which have not yet stripped off their inner solvation shell. In this case the N and C K-edges would not appear to be sensitive enough to detect evidence for cluster formation. The alternative explanation for our observations would be that only a very small fraction of imidazole molecules are involved in self-association and cluster formation, or perhaps that the average lifetime of clusters is so short as to result in an undetectable low concentration over time.
It should be noted that these observations were made with solutions that contained imidazole concentrations around 10.1 mol L −1 prior to nucleation. The number of water molecules available per imidazole molecule in these solutions is significantly below four. Our results indicate an inner solvation shell of at least two hydrogen-bonded water molecules, which leaves only one or two free solvent molecules per Fig. 8 The photon energy difference between the two 1π* peaks in the N K-edge spectra for solution during cooling crystallization (35°C, 20°C, 13°C), after crystallization and for solid phase.
This journal is © The Royal Society of Chemistry 2018 imidazole for forming the liquid solution. This suggests that the solubility of imidazole is limited by the availability of solvent molecules. The fact that we do not observe any difference to undersaturated solutions prior to nucleation is remarkable, but also underlines the importance of local hydrogen bonding in this system.
However, returning to the point made above that assuming imidazole crystals in saturated imidazole solution may be an unrealistic simplification, the precipitated crystals that were detected after crystallization event may have a different structure and composition, for example representing unknown imidazole hydrates. This could also explain why the energy difference between the two 1π* peaks in the N K-edge spectra is at an intermediate value between that of the solid state and solution state. In this case the fraction of precipitated solid might well be higher than the estimate given above, because hydrogen bonds to water would be retained, and a lesser effect on the N K-edge would be expected than for non-hydrated imidazole. Unfortunately, examining other fitted peak parameters such as FWHMs (FWHM are provided in ESI † Table S2) does not allow us to shed further light on this issue. For example, from the N K-edge spectra of the solid and the solution in Fig. 3 one may expect slight broadening of the peak arising from the N1 nitrogen, due to an energy difference of 0.2 eV between the solid and the solution. However, the expected broadening effect would be within less than 0.1 eV, which we cannot reliably resolve with the quality of the available spectra. Additional studies will be needed to clarify these points further. Complementary work with other techniques sensitive to short-range structure, and with much faster data acquisition times (e.g. X-ray pair distribution function, XPDF, measurements) may be helpful. It may then be possible to shed more light on hydrogen and proton positions using excited state density functional theory (DFT) calculations.

Conclusions
X-ray Raman scattering (XRS) of the C and N K-edge spectra was used to follow the structural evolution of aqueous imidazole in situ during cooling crystallization. A jacketed batch crystallizer with internal flow enabled precise thermal control of the system and minimized any effects of radiation damage on the spectra. Comparison of the C and N K-edge XRS spectra of imidazole in solution and in the solid phase illustrated the sensitivity of the near-edges to changes in the local bonding of the imidazole molecules. DFT calculations confirmed the sensitivity of the C K-edge and N K-edge to imidazole-water and imidazole-imidazole hydrogen bonding. Only minimal changes were observed in the C and N K-edge spectra during cooling until an abrupt change in the N K-edge spectra indicated the onset of crystallization. The observed relative shift of the π* resonances indicated that approximately 1/3 of dissolved imidazole molecules had formed crystalline product. This also determines that the upper limit for molecules involved in prenucleation clustering in aqueous imidaz-ole is approximately 1/3 of all solute molecules. There was no evidence for changes due to prenucleation clustering in the C and N K-edge spectra, indicating that molecules with a significantly changed inner solvation shell are at most a small mole fraction. This suggests that the nucleation of imidazole takes place from a highly concentrated solution which is dominated by local hydrogen bonding to water in the inner solvation shell around the imidazole molecules. It follows that the breakage of these solute-solvent hydrogen bonds during desolvation is likely to be the key step in the nucleation of imidazole crystals from aqueous phase.

Conflicts of interest
There are no conflicts to declare.