Mg(H2O)2[TeO2(OH)4]: a polytypic structure with a two-mode disordered stacking arrangement

Crystals of the polytypic Mg(H2O)2[TeO2(OH)4] feature one-dimensional diffuse scattering owing to correlated disorder.


Introduction
Orthotellurates(VI) of alkaline earth metals with general formula M 2 M 0 [Te VI O 6 ] bear interesting crystal-chemical and physico-chemical aspects, and a number of these phases and their solid solutions are structurally well characterized (Prior et al., 2005;Fu et al., 2008). The structures of nearly all alkaline earth metal tellurates (except Be) with a single M II cation and the general formula M II 3 [Te VI O 6 ] have been elucidated [M = Mg: Schulz & Bayer (1971); M = Ca: Hottentot & Loopstra (1981); M = Sr, Ba: Stö ger et al. (2010)]. The structures of these tellurates are characterized by rigid, practically regular, octahedral [TeO 6 ] 6À units. Ca 3 [TeO 6 ] (P2 1 /n, Z = 2), Sr 3 [TeO 6 ] (P1, Z = 32) and Ba 3 [TeO 6 ] (I4 1 /a, Z = 80) are hettotypes of the double perovskite structure type, where the M II atom occupies two positions with distinctly different coordination spheres. The ionic radius of Mg II , on the other hand, is incompatible with the large voids required by the double perovskite aristotype and therefore Mg 3 [TeO 6 ] (R3, Z = 2) crystallizes in a different structure type, isotypic with Mn 3 [TeO 6 ] (Weil, 2006).
During our ongoing studies of hydrous derivatives of M 3 [TeO 6 ] phases with M = Mg, Ca, Sr, Ba we obtained single crystals of the title compound, Mg(H 2 O) 2 [TeO 2 (OH) 4 ], with a unique crystal structure. So far, hydrous alkaline earth tellu- ISSN 2052-5206 rates have only been described for Ba (Weil et al., 2016). We report here on the structure determination and description of the polytypic structure as well as on thermal behavior of Mg(H 2 O) 2 [TeO 2 (OH) 4 ].
Symbols used are summarized in Appendix A.

Synthesis and crystal growth
Crystals of Mg(H 2 O) 2 [TeO 2 (OH) 4 ] were grown in gelatin using a gel diffusion technique (Heinisch, 1996). Three gelatin sheets ($4.5 g) were dissolved in a solution of KOH (4.34 g,85%wt) and Te(OH) 6 (7.89 g) in water (300 ml). From this mixture, 25 ml of the solution were introduced into a large test tube. After solidification, the gel was covered with 10 ml of a neutral gelatin solution, prepared by dissolving one gelatin sheet ($1.5 g) in water (100 ml). After solidification of the second gelatin layer, it was covered with Mg II solution (10 ml, 0.5%wt) which was obtained by dissolving MgCl 2 Á6H 2 O (4.16 g) in water (100 ml). The test tube was sealed with wrapping film and kept at 295 K for one month. Squarebipyramidal crystals of Mg(H 2 O) 2 [TeO 2 (OH) 4 ] had formed at the interface of both gelatin layers. The gel was cut with a scalpel and crystals with an adequate size for single-crystal diffraction were isolated under a polarizing microscope.

Data collection
Diffraction intensities for structure refinements were collected at room temperature using fine-sliced !and '-scans on a Bruker KAPPA APEX II diffractometer equipped with a CCD camera (Mo K radiation, graphite-monochromated). Bragg intensities were reduced using the SAINT-Plus software (Bruker, 2017). An absorption correction was applied using a multi-scan approach with SADABS (Bruker, 2017) using the 4/mmm Laue group.
Inspection of the diffraction pattern (reconstructed reciprocal space layers) revealed lines with pronounced diffuse scattering. For the quantitative analysis of the diffuse scattering, a second crystal was measured with special attention paid to minimization of artifacts on a Stoe IPDS-II imageplate diffractometer using graphite-monochromated Mo K radiation produced by a conventional sealed X-ray tube operated at 50 kV and 40 mA. A 0.5 mm fiber optic collimator and beam stop were positioned in such a way that the free beam path in air was 30 mm long, with the crystal in the center. Compared to the default setup, this arrangement has a significant shorter air beam path and the background caused by air-scattering is reduced. The sample-to-detector distance was set to 100 mm. For further background correction, 46 frames were collected under the same conditions without the sample. These frames were averaged and used as background in further processing. The data collection was run as a 180 !scan using 0.2 rotation and 2 min exposure times, resulting in 900 measured frames. Reference frames were collected every 2 h using 1 min exposures over a 10 ! rotation. Evaluation of the 29 reference frames did not show any significant change of the intensities.
The experimentally determined background was subtracted from all measured raw data frames. Furthermore, a masking procedure was applied to flag overexposed spots. XDS (Kabsch, 2010) was used to determine the orientation matrix for further processing with a modified version of Xcavate (Estermann & Steurer, 1998;Estermann, 2001). Intensity scaling of the original 32-bit images was obtained with Xcavate, and shading of non-measured areas and extraction of line profiles were performed with ImageJ (Abrà moff et al., 2004). One-dimensional streak profiles were extracted by manually determining the lateral center of the streaks and summing over 20 pixels segments perpendicular to the streaks. Further diffraction experiments on a crystal (70 mm Â 70 mm Â 80 mm) kept for six years in gelatin at room conditions have been performed at the X06DA beamline of the Swiss Light Source (Paul Scherrer Institute, Villigen, Switzerland). Monochromated radiation of 0.7085 Å was utilized to collect 1800 data frames during a 180 rotation of the crystal (0.3 seconds per frame) using a Pilatus 2M-F detector. Data collection was controlled by DA+ (Wojdyla et al., 2018), evaluation of the orientation matrix and reconstruction of the reciprocal space layers were performed using XDS and Xcavate.
Details of the data collections are summarized in Table 1.

Refinement
The crystal structure of Mg(H 2 O) 2 [TeO 2 (OH) 4 ] was solved using the charge flipping method implemented in SUPER-FLIP (Palatinus & Chapuis, 2007) and refined against F 2 in Jana2006 (Petříček et al., 2014). Owing to disorder, the H atoms could not be located reliably and thus were not considered in the refinements. All atoms were refined using anisotropic atomic displacement parameters (ADPs). More details on different modeling and refinement attempts are given below (x3.8).

Calculation of diffuse scattering
Experimental peak broadening of the one-dimensional intensity profiles was estimated by fitting Gaussian distributions to sharp reflections using the least squares (LS) solver Ceres (Agarwal et al., 2020) refining the origin, reciprocal basis vector length, variance (all in pixels) and the individual intensities (in arbitrary units). The overall peak shape of the sharp reflections was well described by a Gaussian, only the base was better described by a Lorentz (Cauchy) distribution. One-dimensional diffuse scattering was calculated using the analytical expressions derived below. Atomic coordinates and ADPs of single layers were taken from the single-crystal refinements. The atomic form factors were calculated using polynomial approximations tabulated in International Tables for Crystallography (Brown et al., 2006). Calculations were performed on a one-dimensional grid with four times the resolution of experimental data and later downsampled to the experimental grid.
Correlation parameters were estimated using a simple coordinate-descent algorithm optimizing in turn the origin (in pixels), the length of the reciprocal basis vector (in pixels) and the correlation parameter (unitless). Each variable was determined using a golden-section search. When multiple rods were refined concurrently, a hierarchical coordinate-descent was performed. In an outer loop, the correlation parameter was refined, in an inner loop the origin and basis vector length of each rod.
The validity of such a trivial search was confirmed by noting that the loss function possesses a single local minimum in each coordinate. The process was stopped when the change in all variables fell below a threshhold of 0.001 in the respective unit. The scale factor was determined after each cycle using a simple linear least-squares regression with unit weight, which also provided the loss function R p ¼ P jI obs À I calc j 2 = P jI obs j 2 . Refinements using the weighting functions w = 1/(I obs ) e (e = 1,2), which are used in powder diffraction (Toraya, 1998), led to unreasonable peak shapes owing to an exaggerated emphasis on the intensities of 'valleys' (local minima between peaks).

Thermal analysis
Simultaneous thermal analysis (STA) measurements in the temperature range 30-900 C were performed with a $50 mg sample in a corundum crucible on a NETZSCH STA 449 C Jupiter system coupled with a Aeolos quadrupole mass analyzer. The quartz capillary was kept at 250 C. The measured mass signals were 2 (H 2 ), 12 (C), 14 (N), 15 (CH 3 ), 16 (CH 4 , O), 17 (OH), 18 (H 2 O), 28 (N 2 , CO), 32 (O 2 ) and 44 (CO 2 ). All measurements were performed under a flowing argon atmosphere (20 ml min À1 ) and heating rates of 10 K min À1 . Base line corrections of the TG curves were carried out by measuring the empty alumina crucible prior to each measurement. Temperature-dependent powder X-ray diffraction measurements (PXRD) were performed on a PANalytical X'Pert PRO diffractometer using a HTK1200 Anton-Paar high-temperature oven chamber mounted on the diffractometer. Prior to the measurement, the sample was finely ground and placed on a glass ceramic (Marcor) sample holder (depth 0.5 mm). The zero point was calibrated with a LaB 6 standard and automatically adjusted during the measurements with a PC-controllable alignment stage. The samples were heated under atmospheric conditions at 10 K min À1 to the respective measurement temperature and kept for 5 min before measurement of each step to ensure temperature stability.

Crystal chemistry
Mg(H 2 O) 2 [TeO 2 (OH) 4 ] crystallizes as polytypes composed of distinct crystallo-chemical layers, designated as L n , where n is a sequential number (Fig. 1). The L n layers possess (idealized) p4/m symmetry (Kopsky & Litvin, 2006) with a square lattice spanned by (a, b). c 0 is the vector perpendicular to the layer planes with the length of one layer width. Henceforth, all directions and Miller indices will be given with respect to the basis (a, b, c 0 ). The L n layers are composed of close to regular [MO 6 ] (M = Mg, Te) octahedra, which are connected by corners forming sheets (Fig. 2).
Both octahedra are located on sites with symmetry 4/m and are tilted by $26 in opposite directions about [001], thus leaving rhomboidal voids with a long and a short diameter of '5.0 and '2.5 Å , respectively. The M positions are alternately occupied with Te and Mg atoms in a checkerboard pattern.
The O atoms connected only to Te and Mg are labeled O1 and O2, respectively. The shared O atom is O3 (Fig. 2). The [MgO 6 ] octahedron is slightly larger than the [TeO 6 ] octahedron with an average Mg-O distance of 2.056 Å compared to the average Te-O distance of 1.929 Å . Selected distances and angles are compiled in Table 2.
The rigid conformation of the octahedral [TeO 6 ] 6À anion and the Te-O distances are characteristic for oxotellurates(VI). Reviews on the crystal chemistry of these compounds were given by Kratotochvíl & Jenšovský (1986), Loub (1993), Levason (1997) and Christy et al. (2016). An octahedral coordination is the most common coordination for Mg II cations, and the average Mg-O distance of 2.057 Å compares well to the maximum of the distribution of Mg-O distances of 2.1 Å given in a survey on Mg-O coordination polyhedra (Blatov et al., 1999;Gagné & Hawthorne, 2016).
Bond valence sums (BVSs) are a useful tool to assign H atoms, in particular for those cases where H atoms cannot be located, e.g. in the presence of heavy atoms, from X-ray diffraction data (Donnay & Allmann, 1970). Neglecting the contributions of H atoms, in the ideal case, the O atoms of H 2 O molecules, OH À ions and O 2À ions have total BVS of 0, 1 and 2 valence units (v.u.), respectively. Bond valence calculations based on the I42d model of x3.8 with v i ¼ exp½ðR o À R i Þ=b (Brown, 2002)  According to these BVSs, the Te atoms are bonded to two OH À anions (O1) and the Mg atoms to two H 2 O molecules (O2). The remaining two H atoms per formula unit are connected to two out of four bridging O3 atoms, amounting to one per rhomboidal void. Thus, the structural arrangement of the compound can be expressed with the connectivity formula 2 1 ½MgðH 2 OÞ 2=1 ðO=OHÞ 4=2 TeðOHÞ 2=1 . This is in agreement with crystallo-chemical considerations and corresponds to an electronically neutral structure. Moreover, the Te-O bond lengths distribution in the [TeO 2 (OH) 4 ] 2À octahedron is in good agreement with those of other structures comprising this type of anion (Weil, 2004(Weil, , 2007Weil et al., 2017).

Polytypism
The origin of the L n+1 layer is related to the origin of the adjacent L n layer by a translation of a=2 þ c 0 or b=2 þ c 0 , as indicated in Fig. 2. In these two different stacking possibilities the locations of the Te and Mg atoms are exchanged. An alternation of the two will henceforth be called Te/Mg exchange. Moreover, every L n layer can appear in two orientations related by m h100i operations. A change in orientation will be called orientation inversion. The four resulting stacking possibilities are shown in Fig. 3.

Order-disorder description
The order-disorder (OD) theory (Dornberger-Schiff & Grell-Niemann, 1961) has been devised to explain the common occurrence of polytypism in all classes of compounds.
It is based on layers, which do not necessarily correspond to layers in the crystallo-chemical sense (Grell, 1984). The crucial point in an OD description is that pairs of adjacent layers are equivalent, which corresponds to the vicinity condition (VC). However, pairs of adjacent layers without [Figs. 3(a) and 3(c)] and with orientation inversion [Figs. 3(b) and 3(d)] are not equivalent and therefore violate the VC. The particular layer choice as described here is therefore not of the OD type.
An OD description can nevertheless be achieved by 'slicing' the structure into two kinds of layers, designated as A 1 and A 2 (Fig. 1, left). The structure then belongs to a tetragonal category IV OD family built of two kinds of non-polar (with respect to the stacking direction) layers.    The OD groupoid family symbol reads as according to the notation of . The first line of the symbol gives the name of the layers, the second their symmetry and the third one possible arrangement of adjacent layers. Note that in OD theory, layer group symbols with five directions are sometimes necessary to describe tetragonal OD groupoid families. Here, because it is not necessary to distinguish between the [100] and [010] directions, as well as the [110] and ½110 directions, the usual symbols can be used.
The . Thus, the O1 and O2 atoms are located at the layer interfaces and belong to both OD layers. The layer symmetries were deduced under the assumption of a disordered hydrogen-bonding network.
The third line of the symbol indicates that, in one possible arrangement, the origins of the A 1 n and A 2 nþ1 layers are spaced by ra + sb + c 0 /2. According to the stacking rules described above, (r, s) adopt the values ð 1 2 ; 0Þ or equivalently ð0; 1 2 Þ, i.e. the 4 [001] and 2 [001] axes of the A 1 and A 2 layers coincide. Note that in contrast to many other OD families, here the parameters adopt a precise value because adjacent layers share common atoms (O1 and O2) located on special positions.
The NFZ relationship (Ď urovič, 1997) is a formalism to determine the alternative stacking possibilities in a family of OD structures. It is based on the groups G n of those operations of the A n layers that do not reverse the orientation with respect to the stacking direction (--POs according to the OD terminology). For the A 1 and A 2 layers, G n is p4 and pmm2, respectively. Because the adjacent layers are not equivalent, the NFZ relationship reads as Thus, given an A 1 n layer, the adjacent A 2 nþ1 layer can appear in two orientations (with pmma and pmmb symmetry), which are related by the fourfold rotation of the A 1 n layer. For an Given an A 2 n layer, the adjacent A 1 nþ1 layer can likewise appear in two positions, which in this case are related by the m h100i reflections of the A 2 n layer. By following these stacking rules, an infinity of polytypes can be constructed, which are equivalent to the non-OD polytypes described in the previous section. The usefulness of the OD description does not only lie in the concise symmetry classification. It also sheds light on the crystallo-chemical reasons of the polytypism by splitting them into two distinct contributions. On the one hand (A 2 nÀ1 ! A 1 n ! A 2 nþ1 ), the orientations of the hydrogen-bonding network to both sides of the [TeO 6 ] and [MgO 6 ] octahedra may be the same, or different. On the other hand (A 1 nÀ1 ! A 2 n ! A 1 nþ1 ), the interlayer hydrogen bonding independent of the orientation of the octahedral sheets.

Maximum degree of order polytypes
Polytypes of a maximum degree of order (MDO) are a central concept of OD theory (Dornberger-Schiff, 1982;. MDO polytypes cannot be decomposed into simpler polytypes, i.e. into polytypes composed only of a selection of pairs, triples or any n-tuples of adjacent layers. Experience shows that the majority of macroscopically ordered polytypes are of the MDO type.
There are two kinds of A 1 nÀ1 A 2 n A 1 nþ1 triples, namely with and without orientation inversion. Moreover, there are two kinds of A 2 nÀ1 A 1 n A 2 nþ1 triples, namely with and without Te/Mg exchange.
All other stacking arrangements can be divided into fragments of MDO polytypes, which therefore represent the 'alphabet' of an OD family.
Atomic coordinates for all four MDO polytypes are listed in Table 3.   where + and À symbols mark groups located above and below the drawing plane, respectively.

Family structure
The family structure of an OD family is a fictitious structure in which all stacking possibilities are realized to the same degree. It plays an important role in the elucidation of OD structures. The family structure of Mg(H 2 O) 2 [TeO 2 (OH) 4 ] has F4/mmm symmetry (non-standard setting of I4/mmm) with c = 2c 0 (coordinates in Table 3).
For a fixed A 1 n layer, the adjacent A 2 nþ1 layer can appear in two orientations related by the 4 [001] operation. Each of these two orientations gives rise to two orientations of the A 1 nþ2 layer, which are related by the m h100i operations of the A 2 nþ1 layer. Thus, in the family structure the A 1 layers are an equal superposition of four positions (Te/Mg disorder and orientation disorder) with c4/mmm (non-standard setting of p4/mmm) symmetry [ Fig. 4(b)].
According to analogous reasoning in the A 2 layers of the family structure, the OH À anions and H 2 O molecules are disordered in a 1:1 ratio [ Fig. 5(b)]. These disordered layers possess c4/emm (non-standard setting of p4/nmm) symmetry.

Diffraction pattern
The diffraction pattern of Mg(H 2 O) 2 [TeO 2 (OH) 4 ] features rods with sharp reflections and rods with broader reflections on top of prominent one-dimensional diffuse scattering (Fig. 6). Such diffraction patterns are characteristic for polytypes with translationally equivalent layers (Jeffery, 1953;Ferraris et al., 2008), and were the inspiration for the name 'OD' (Bragg reflections: order; streaks: disorder).
In Mg(H 2 O) 2 [TeO 2 (OH) 4 ], the L n layers are not translationally equivalent, since they can appear in two orientations. As will be shown below, in this case the reason of the rods lacking diffuse scattering lies in the particular makeup of the L n layers, namely the similar size of the [MgO 6 ] and the [TeO 6 ] octahedra.
In the reciprocal basis ða Ã ; b Ã ; c Ã 0 Þ T ¼ ða=a 2 ; b=b 2 ; c 0 =c 2 0 Þ T , the structure factor F(hk) of a polytype can be calculated as the sum of the structure factors F n (hk) of the individual L n layers: Since the translation lattices of all layers are spanned by (a, b), F n (hk) is only non-zero for h; k 2 Z. The structure factor F n (hk) can be decomposed into the contributions F O n ðhkÞ of the O3 atom and F M n ðhkÞ of the remaining atoms (Te, Mg, O1, O2): The The origin of the L n layer can be written as with n ; n 2 Z and 0 = 0 = 0. Since the origin shift from L n to L n+1 is either a/2 + c 0 or b/2 + c 0 , n + n is even, if and only if, n is even, which can be expressed by with m n 2 Z. The Mg, Te, O1 and O2 atoms are not affected by orientation inversion, since the eigensymmetry of their (layer group) orbits is p4/mmm, which contains the reflection relating both orientations. These parts of the layers are therefore obtained from the L 0 layer by translation along o n . According to equations (3) and (4), F M n can therefore be written in terms of Note that since Mg, Te, O1 and O2 are located on fourfold rotation axes, their displacements are isotropic in the (001) plane and, therefore, disregarding desymmetrization, the reflection at [100] has no influence on their (harmonic) ADPs.
The orientation of the L n layer will be described by ! n = 0, 1, n 2 Z. If O3 is located on the x þ y ¼ 1 2 line, which is perfectly realized if d(Te-O3) = d(Mg-O3), ! n = 1 corresponds to an additional translation of (a + b)/2 with respect to o n . If the displacement of the O3 atom is likewise isotropic in the (001) plane, F O n can be written in terms of If h + k is even, then (h + k) n and (h + k)( n + ! n ) are likewise even and equations (5) and (7) simplify to and and therefore and where is the Dirac delta distribution. Note that the last equals sign represents an abuse of notation as the given function series does not converge at any point [technically, the series converges in the distributional sense (Bricogne, 2010)].
In summary, on rods h + k even only sharp reflections are observed at = l/2, l 2 Z, where h, k and l are all even or all odd. This corresponds to the diffraction pattern of a crystal with a tetragonal F-centered (tF) lattice with the centered reciprocal basis ða Ã ; b Ã ; c Ã 0 =2Þ. These reflections correspond to the diffraction pattern of the family structure (x3.5) and are called the family reflections. All stacking arrangements, ordered or disordered, contribute equally (proportional to their volume fraction) to these reflections, since neither n , n nor ! n contribute to equation (12).
On rods h + k odd the simplifications above do not apply and diffraction intensities can appear at arbitrary positions. Bragg reflections on these rods are called characteristic reflections, because they are generated only by certain polytypes. The characteristic reflections of MDO 1/2 are located at = l/2, l 2 Z, those of MDO 3/4 at ¼ l=2 þ 1 4 , l 2 Z. The calculations above were derived under the assumption that d(Te-O3) = d(Mg-O3), whereas the actual structure deviates from this assumption [1.906 (3) versus 2.064 (2) Å ]. Moreover, ordered polytypes typically feature desymmetrization (Ď urovič, 1979). For example, in the MDO 3/4 polytypes, the O3 atom is located slightly off the z = 0 reflection plane of the p4/m layer symmetry (Table 3). Distinctly enlarged ADPs of the O1 and O2 atoms show that they are located on the fourfold axis (which is a twofold axis in the actual MDO 3/4 polytypes) only on average (Fig. 7). These deviations may lead to violations of the systematic non-crystallographic absences, namely faint streaking and very weak characteristic reflections on h + k even rods.

Rods with insignificant contribution of O3
To differentiate between the effects of orientation inversion and Te/Mg exchange on the diffraction pattern, it is useful to note that the fractional coordinates x and y of the O3 atom,  which is essentially the only atom affected by orientation inversion, are close to 1 3 and 1 6 , respectively. If the O3 atom is idealized as being located on such a position, the L 0 layer contains up to translation two O3 atoms at ðx; y; zÞ T ¼ ð 1 3 ; 1 6 ; 0Þ T ; ðÀ 1 6 ; 1 3 ; 0Þ T and the two atoms obtained by inversion at the origin. If, moreover, the displacements of the O3 atom are considered as being isotropic in the (001) where f O (hk) is the atomic form factor of O. Note that the structure factor is real and contains only cos terms owing to the inversion at the origin. If h is divisible by three, i.e. h = 3h 0 , h 0 2 Z, this expression simplifies for rods h + k odd to (h 0 is even, if and only if, h is even and therefore k À h 0 is odd). The same argument can be applied to rods with k divisible by three. Thus for h or k divisible by three, equation (2) simplifies to and equation (1) can ultimately be written as The variable ! n , which describes the orientation of the octahedra, does not affect rods h + k odd with either h or k divisible by three, and any significant diffuse scattering or Bragg reflections on these rods are due to the arrangement of the Te and Mg atoms.
To illustrate the effect in absolute terms, plots of jF M 0 j 2 and jF O 0 j 2 against are given in Fig. 8 for the 10 and 12 rods. Indeed, for 10 the contribution of F O 0 is negligible when compared to F M 0 . On the other hand, 12 features significant contribution at low scattering angles. In particular, this rod (including symmetry equivalents) has the highest relative contribution of F O 0 .

Classical refinements
To determine atomic coordinates and ADPs, classical independent atom model refinements were performed. In a first refinement, only the family reflections were considered. Excellent reliability factors are thus obtained (Table 4). In the family structure, Te/Mg exchange and orientation inversion are realized in 50% of the layers. In principle, the O3 atom is disordered over four positions. Nevertheless, only two positions could be resolved, because the Te-O3 and Mg-O3 distances are nearly equal. Likewise, the O1 and O2 atoms could not be separated without introduction of distance restraints and therefore were refined as a single O1/O2 position. Plots of jF M 0 j 2 and jF O 0 j 2 against for the 10 and 12 rods. Only ! 0 are shown, because the structure factors are essentially symmetric by reflection at the = 0 plane. jF O 0 j 2 is practically 0 and therefore barely to be seen at the bottom of the chart. Table 4 Comparison of the refinements.
The MDO 3 :MDO 4 ratio was derived from the occupancy of the O3/O3 0 positions. The (MDO 1/2 ):(MDO 3/4 ) ratio was determined from the occupancy ratio of the Te/Mg positions.  (9) On top of the lines of diffuse scattering at h + k odd are located elongated peaks where the characteristic reflections of MDO 3/4 are expected (Fig. 6). No peaks corresponding to MDO 1/2 were observed (though see x3.13). One has to realize that treating these peaks as Bragg reflections in classical refinements will inevitably introduce systematic errors.
Owing to the systematic non-space group absences (x3.6), reflection conditions cannot differentiate between MDO 3 (I4 1 /a) and MDO 4 (I42d). Moreover, owing to diffuse scattering on rods h + k odd, intensities in violation of the I-centring are observed. Thus, classical space group determination is unreliable and the diffractometer software strongly suggests the space group I4 1 /amd (c = 4c 0 ), which is the space group of a 1:1 superposition of MDO 3 and MDO 4 .
The first model was generated and refined using this I4 1 /amd symmetry, where the O3 atom is disordered with a 1:1 occupation ratio about the m [100] reflection plane. To achieve satisfying residuals, occupational disorder of the Te and Mg atoms (with Mg 0 and Te 0 ) had to be introduced, corresponding to a contribution of MDO 1/2 fragments.
Based on the refined model in I4 1 /amd, the symmetry was reduced by an index of 2 to I4 1 /a (MDO 3 ) and I42d (MDO 4 ), respectively. The linear parts of the lost operations were retained as the twin law and the twin volume ratio was refined. The disordered O3 position was split in both cases into two distinct positions (O3 and O3 0 ). The coordinates and ADPs of O3 and O3 0 were constrained to be equal with respect to the m [100] operation and the occupancies were refined and constrained to a sum of 1. A comparison of the refinements is given in Table 4. The volume fraction of MDO 3/4 (as opposed to MDO 1/2 ) was derived from the occupancy of Te as |2occ(Te) À 1|. Likewise, the volume fraction of the major domain of the MDO 3 /MDO 4 pair was derived as |2occ(O3) À 1| (see Appendix B).
According to these refinements, there was $10-15% of MDO 1/2 present in the crystal under investigation. Estimating the MDO 3 :MDO 4 ratio is more difficult. According to the refinement with the best reliability factors (I42d), there are approximately equal amounts of MDO 3 and MDO 4 , which would correspond to a 50% chance of orientation inversion. The I4 1 /a refinement on the other hand suggests an MDO 3 :MDO 4 ratio of $2:1, which shows the difficulty of deriving these values from routine refinements. The fundamental problem is that a disordered stacking is in general not equivalent to a superposition of MDO polytypes.
Allotwinning, i.e. the association of macroscopic domains of distinct polytypes (Nespolo et al., 1999), was ruled out owing to diffuse scattering. Indeed, such models did not lead to improved reliability factors. Likewise, placing the characteristic and family reflections on different scales to avoid the Ď urovič effect (Nespolo & Ferraris, 2001) led to unreliable refinements because the ratio of polytypes and the ratio of the scales correlate (Hans et al., 2015). As will be shown below (x3.10) Te/Mg exchange does occur and thus the single-scale refinements are preferred, even though the quantification of Te/Mg exchange is inaccurate.
In summary, neither the amount of MDO 1/2 nor the MDO 3 :MDO 4 ratio can be quantified reliably with routine refinements, demonstrating the inherent difficulties of structurally characterizing such compounds. Nevertheless, these refinements are crucial to determine Mg-O and Te-O distances.

Disorder model
To quantify the diffuse scattering, a simple growth model was derived from the OD interpretation given in x3.3. The crystal is described as an alternating succession of A 1 and A 2 OD layers. According to the OD description, pairs of adjacent OD layers are geometrically equivalent, but triples may differ. Therefore, in the simplest growth model the A n layer depends on the A nÀ1 and A nÀ2 layers. Since there are two kinds of A 1 nÀ2 A 2 nÀ1 A 1 n triples and two kinds of A 2 nÀ2 A 1 nÀ1 A 2 n triples (x3.4), this model is fully determined by two parameters. P MgTe describes the probability of A 2 nÀ2 A 1 nÀ1 A 2 n without Mg/Teinversion and P orient the probability of A 1 nÀ2 A 2 nÀ1 A 1 n triples without orientation inversion. In some cases, it will be more convenient to express these probabilities in terms of the correlation coefficients This two-parameter model is sufficient to describe all four MDO polytypes and also of equal overlays of MDO polytypes, as listed in Table 5. In this trivial model, each layer triple is considered independent of the previous triple. In more refined models, the orientation-inversion probability could depend on the occurrence of Mg/Te inversion and vice versa. Additional parameters would then be required.
Growth models are conveniently expressed as Markov chains (Welberry, 2010 Table 5 Extreme growth model parameters and the corresponding polytypes. Note that the statistical stackings (P MgTe = 0 or P orient = 0) are strictly speaking not overlays or the family structure, but behave as such. where each step corresponds to a new triple of OD layers, which has two OD layers in common with the previous triple. This Markov chain has a period of two since an A 1 layer is only added after every second step (and likewise for A 2 ). Such chains are developed into two (or more for higher periods) independent chains, here from the nth triple to the n+2nd triple. These two Markov chains are most conveniently expressed in terms of the crystal-chemical L n layers: The first Markov chain describes the relation of the origin of the L n and L n+1 layers and the second chain the orientation of the L n layer. The chains are independent, because one OD layer triple does not depend on the previous triple. Each chain can be considered as an independent nearest-neighbor model, since the o n depends only on o nÀ1 and ! n on ! n-1 .
For P MgTe , P orient 6 ¼ 0,1, the Markov chains converge to the equilibrium states P(Áo n = a/2) = P(Áo n = b/2) = P(! n = 0) = P(! n = 1) = 1 2 , i.e. after an infinity of layers, both origin shifts and both layer orientations are equally likely. In the following only this general case will be considered.

Diffuse scattering
To calculate the diffraction pattern of disordered structures, it is advantageous to directly calculate the intensity I(hk) = |F(hk)| 2 in terms of pair correlations between layers (Welberry, 2010): where an overline designates the complex conjugate. The orientation of the L n layer is flipped with respect to the L 0 layer if ! n = 1. To express the structure factor of such a layer, it will be related to the structure factor F À 0 of the mirrored L 0 layer: The hk argument of F will henceforth be omitted for brevity. The diffraction intensity can then be expressed in terms of probabilities: where P Á;Á Án expresses the probability that the origins of the L n and L n+Án layers are separated by Á n a/2 + Á n b/2 + Ánc (up to a full layer lattice translation). P þ Án and P À Án are the probabilities that the L n and L n+Án layers possess the same, respectively opposite, orientation. s Án , the sum over Á and Á, is the pair-correlation function of layers spaced by Ánc 0 . It should be stressed that equation (29) is only valid for an equal probability of both layer orientations (P orient 6 ¼ 0, 1, large domain size) and independence of both Markov chains. On the flip side, it is valid for more complex growth models with interactions over more than one layer width.
From the stacking rules it follows that P 1;0 Án = P 0;1 Án = 0 for Án even and P 0;0 Án = P 1;1 Án = 0 for Án odd. Since, as has been shown above, significant diffuse scattering is only observed on rods h + k odd, let us concentrate on these. Then, the exponential factor of the Á = Á = 1 terms in equation (29) is exp½2iðh=2 þ k=2 þ ÁnÞ = À exp½2iÁn. Factoring out the probabilities, for Án even we thus obtain In analogy, for Án odd and h + k odd, exp½2iðk=2 þ ÁnÞ = À exp½2iðh=2 þ ÁnÞ (if k is odd h is even and vice-versa) and therefore Let us now derive the 'pair distribution' probabilities. Obviously, the starting state of the growth model is P 0;0 0 = 1 and P 1;1 0 = 0. As has been noted above, in non-degenerate cases (P MgTe 6 ¼ 0,1), the equation (23) converges to an equilibrium state where the origin shifts Áo n = a/2+ c 0 and Áo n = b/2 + c 0 are equally likely and therefore P 1;0 1 = P 0;1 1 = 1 2 . Repeated application of equation (23) to theses initial states gives the general case (see Appendix C): Note that for negative Án, the same reasoning applies and therefore the absolute value of Án is used in the exponents. In analogy, according to the Markov chain equation (24) the probabilities describing the orientations are By substituting equation (35) into equation (32) it follows that s Án = 0 for odd Án. Note that this is only valid for the simple nearest-neighbor model of equation (23). In more general growth models, these terms adopt non-zero values.
For even Án, from equations (33) and (34) it follows that P 0;0 Án À P 1;1 Án = (c MgTe ) |Án|/2 and equation (31) becomes Ultimately, the intensity on rods h + k odd therefore is [see equation (30)] where m = Án/2 and By identifying two geometric series (see Appendix D), an analytical expression of I(hk) can be given as To avoid the unwieldy expressions in the parentheses, we will introduce the function family which describes the shape of one-dimensional diffuse scattering produced by a structure with a simple nearest-neighbor correlation of À1 < c < 1 (Welberry, 2010). d c (x) is generally (except for c = 0) a function with periodicity 1, featuring peaks which are sharper for increasing |c|. For |c| approaching 1, d c (x) converges to a Dirac comb with sharp reflections for integer x (c ! 1) or half-integer x (c ! À1). For c = 0, d c is the constant function d 0 (x) = 1. Using d c , equation (42) simplifies to which shows that the diffuse scattering is the sum of two independent shape-functions of the nearest-neighbor correlation c MgTe and c 0 . The factor jF 0 þ F À 0 j 2 corresponds to the (hypothetical) intensity of an superposition of both orientations of the L 0 layer and jF 0 À F À 0 j 2 to the intensity of the difference of the electron density of these two orientations.
Since c 0 depends on the square of c orient [equation (41)], c MgTe and c 0 are of the same sign [sgn(c MgTe ) = sgn(c 0 )]. Thus, the location of the peaks depends only on c MgTe , but not on c orient . For c MgTe > 0, I(hk) has peaks at = l/2, l 2 Z and for c MgTe < 0 at = l/2 + 1 4 , l 2 Z as is expected for MDO 1/2 -like and MDO 3/4 -like stacking arrangements, respectively.
Moreover, note that from |c orient | < 1 follows that |c 0 | < |c MgTe | and therefore ordering of the orientation inversion can never lead to sharper peaks for a given c MgTe , whereas its disorder can lead to more diffuse peaks.
But most remarkably, under the given assumptions (nearest-neighbor model, negligible desymmetrization, c MgTe , c orient 6 ¼ AE 1) the diffuse scattering is identical for pairs of c orient with the same absolute value.

Estimation of the correlation coefficients
Assuming the idealization d(Te-O3) = d(Mg-O3), orientation inversion corresponds to a translation of O3 by (a + b)/2 (see x 3.6). Using the decomposition which for h + k odd becomes Thus, equation (44) becomes Conveniently, as has been shown above, jF O 0 j is negligible for rods h + k odd with h or k divisible by three (Fig. 8). Thus, these rods can be used to estimate c MgTe with only a negligible contribution of c orient . Fig. 9(a) gives I(10) plots for different values of c MgTe calculated using only the jF M 0 j 2 term of equation (48). To research papers estimate c MgTe , a simultaneous LS optimization was performed on the rods listed in Table 6. Fig. 9(b) shows the result of the LS optimization without convolution of the experimental peak shape for the 01 rod. As expected, an additional convolution with the experimental peak shape results in a slightly more negative correlation c MgTe (À0.353 versus À0.338). Since the refinements without convolution result generally in better fits (Table 6), we will henceforth assume the latter value. The agreement of the experimental and calculated curves is reasonable, though not perfect as the experimental peaks are somewhat narrower. Even though a stronger negative correlation c MgTe leads to narrower peaks, it is in disagreement with the strong diffuse scattering between the peaks. We suppose that the sample is composed of domains with different c MgTe values, some with stronger and some with weaker correlations. A model taking into account interactions over more than the nearest-neighbor can be ruled out, since such models produce valleys of different shapes (Welberry, 2010).
Given c MgTe , |c orient | can be determined from the h + k odd rods with neither h nor k divisible by three. Fig. 10(a) gives I(12) plots with c MgTe = À0.338 derived from the 10 rod and |c orient | = 0, 0.9, where the contribution of the jF O 0 j term is shown separately. The 12 rod features the highest relative contribution of the O3 atom to the scattering intensity (x3.6). Even on this rod and with the extreme values of |c orient |, the effect on the peak shape is rather subtle.
Independent LS optimization with fixed c MgTe yielded a zero correlation of |c orient | for all rods listed in Table 7. The refinement of the 12 rod is displayed in Fig. 10(b). Again, without convolution of the experimental peak broadening slightly improved residuals are obtained. However, in both cases a zero c orient is derived. We conclude that the orientation of the [MgO 6 ] and [TeO 6 ] octahedra is mostly random, which means that the problem of identical diffraction for pairs of structures becomes a moot point, since the sign of c orient % 0 is irrelevant.  Table 6 Residuals of the concurrent refinement of the h + k even rods with h or k divisible by three.

Figure 9
Intensity I(10) of the 10 rod (a) calculated for various c MgTe values and (b) with c MgTe optimized against experimental data. Intensity is absolute, i.e. zero intensity is at the bottom of the chart.

Figure 10
Intensity I(12) of the 12 rod with fixed c MgTe = À0.338 (a) calculated for |c orient | = 0.9 and |c orient | = 0.0 and (b) with |c orient | = 0 optimized against experimental data. Intensity is absolute. Additionally, the contributions of (a) the jF O 0 j 2 term and (b) the jF M 0 j 2 and jF O 0 j 2 terms are shown.
3.12. Diffuse scattering on h + k even rods As has been argued above, pairs of structures with c orient of the same absolute value produce the same diffraction intensity on h + k odd rods. Moreover, under the idealization of d(Te-O3) = d(Mg-O3) the h + k even rods are identical for all stacking arrangements. Thus, such pairs of idealized structures can be considered as homometric.
Since these assumptions are not perfectly realized, very weak diffuse scattering is likewise observed on rods h + k even (Fig. 11). In principle, this could be used to determine the sign of c orient .
The diffuse scattering on these rods can be derived in analogy to x3.10. However, for h + k even the equalities exp[2i(h/2+k/2+Án)] = exp[2iÁn] and exp[2i(h/2 +Án)] = exp[2i(k/2+Án)] hold, since h and k are either both even or both odd. Conveniently, these terms can be generalized to exp[2i(Ánh/2+Án)] for even and odd Án (see x3.6). Factoring out the probabilities of equation (29), the leading factors in the equations analogous to equations (31) and (32) are P 0;0 Án þ P 1;1 Án = P 0;1 Án þ P 1;0 Án = 1. Ultimately, the general expression for s Án on rods h + k even is which also holds for more general growth models. Substituting the probabilities of equations (36) and (37), the intensity I(hk) is (setting m = Án) The first term corresponds to the Bragg peaks of the family structure, again committing the abuse of notation. For h + k even, equation (45) becomes Thus, as shown in x3.6, under the assumption d(Te-O3) = d(Mg-O3), only family reflections are observed on rods h + k even. Non-equal Te-O and Mg-O distances lead to a nonvanishing jF 0 À F À 0 j 2 and thus diffuse scattering as described in the second term of equation (51). For distinctly positive c orient one would expect additional peaks on top of the family reflections and valleys between the family reflections. For negative c orient , additional peaks would be observed between the family reflections. This is consistent with the MDO 1 and MDO 2 polytypes: the lattice of the former (c orient = 1) does not allow for reflections between family reflections owing to the Bcentering, whereas the latter (c orient = À1) has a primitive Bravais lattice and features systematic non-space group absences in the idealized case, which should be observable for noticeable deviations therefrom.
In the actual diffraction pattern (Fig. 11), the minute streaks are basically structureless, confirming the low correlation c orient % 0. Tiny sharp spots are observed, which can however be explained by /2 radiation. To prove this assignment, a Mg(H 2 O) 2 [TeO 2 (OH) 4 ] crystal was quickly scanned using synchrotron radiation, which confirmed the structureless diffuse scattering on rods h + k even (Fig. 12).
It has to be noted that equation (51) does not allow for a simple quantitative estimation of the diffuse scattering in cases where c orient 6 ¼ 0, because the |F 0 À F À 0 j 2 factor does not only represent the deviation of the equidistance of O3 from Mg and Te, but also generally the deviation from the idealized p4/m symmetry, which certainly exists as shown by enlarged ADPs. Moreover, the origin difference between adjacent layers might deviate slightly from the ideal Áo = a/2 + c 0 /2 or Áo = b/2 + c 0 /2, which would likewise invalidate the reasoning in x3.5 and lead to faint diffuse scattering.  Table 7 Residuals of the individual refinements of the h + k even rods with h or k divisible by three.  Figure 11 1kl layer with intensities scaled to make weakest effects visible.
All these deviations from the idealized model can not be simply derived from single-crystal experiments, since they will differ depending on the adjacent layers. Owing to missing structural data of all MDO polytypes, these would have to be derived by relaxation, for example with DFT methods.
In any case, this is of no concern here, since there appears to be no significant c orient .
In summary, we propose a model with a negative correlation of the Mg/Te stacking c MgTe % À0.34 and a c orient % 0 correlation of the orientation, with the caveat that the peak shape is not described perfectly, as the crystals might be composed of domains with varying c MgTe .
3.13. Rearrangement of the crystal structure over time The synchrotron measurement described in the previous section was performed on a newly isolated crystal seasoned for six years at 15-35 C in a closed glass vial containing residual gel from the synthesis. Much to our surprise, in this experiment additional sharp characteristic reflections were observed on rods h + k odd at integer and half-integer -values [ Fig. 13(a)], as would be expected for MDO 1/2 polytypes. To confirm the appearance of ordered domains, a different crystal was measured in-house and likewise featured sharp reflections with h + k odd [ Fig. 13(b)], though only half as many.
For ordered MDO 1/2 polytypes (c MgTe = 1), the simplifications of x3.10 do not apply and therefore macroscopic MDO 1 and MDO 2 polytypes produce distinctly different intensities on rods h + k odd. The sharp reflections of the second crystal can be indexed with the B-centered cell of the MDO 1 polytype [h + 2 even, Fig. 14(a)]. The location of the sharp reflections of the first crystals could in principle be explained by the MDO 2 polytype. According to structure factor calculations,  1k plane of crystals seasoned for six years collected (a) at the X06DA beamline and (b) the IPDS in-house system.

Figure 14
Comparison of the 12 and 21 rods of crystals seasoned for six years measured at (a) the IPDS in-house system and (b) the X06DA beamline.
for MDO 2 one would expect alternately strong and weak characteristic reflections at opposite positions on 12 and 21 rods. In the actual crystal though, the strong and weak characteristic reflections appear at the same -values [ Fig. 14(b)], which means that the characteristic reflections are probably due to two MDO 1 orientation states, related by a fourfold rotation.
The shape of the diffuse scattering essentially stays the same during seasoning of the crystals (Fig. 15). We conclude that the disordered domains slowly convert to ordered MDO 1 polytypes.
We recently measured three newly isolated crystals of the same synthesis batch after an additional one year time-period and all of them clearly contained ordered MDO 1 fragments. One of the crystals was twinned by fourfold rotation. The amount of diffuse scattering did not decrease significantly compared to the previous year. Thus, the kinetics and preconditions of the transition are not yet understood.

Thermal behavior
The thermal decomposition of Mg(H 2 O) 2 [TeO 2 (OH) 4 ] is connected with a multi-step mechanism between 30-900 C. The hydrous phase is stable up to a temperature of $160 C in the oven chamber ( Fig. 16; PXRD), followed by an amorphization. According to the TG/DTA curves ( Fig. 17; STA), the onsets of the associated mass loss and the endothermic effect due to dehydration are at $195 C. We ascribe the different temperatures of the Mg(H 2 O) 2 [TeO 2 (OH) 4 ] stability field to the different timescales of the two measurement techniques. Whereas the temperature-dependent PXRD measurement is slow due to stepwise heating rates and long measurement times, the STA measurement is much faster with continuous heating rates and much shorter measurement times. The mass loss of $25% up to a temperature of 500 C is due to release of water and oxygen according to the mass spectra. The amorphous phase remains up to 510 C where first reflections appear, indicating a crystallization of new phases as shown by a two-step exothermal effect at $550 C, also asso-ciated with a release of small amounts of water (onset DTA first step 545 C, second step 575 C). The diffuse nature of the reflections in the stability field between $510 C and 570 C makes a clear assignment difficult. Besides weak reflections that could be unambiguously assigned to the formation of Mg 3 [TeO 6 ], a relationship with trirutile-type Co[Sb 2 O 6 ] (Reimers et al., 1989)   Comparison of the 12 rods of a freshly synthesized crystal and a crystal seasoned for six years, both measured at the IPDS in-house system.  mass analyzer during the preceding decomposition step. The assumed mixed-valent phase transforms above 570 C into a phase for which the diffraction pattern could be related to Mg[TeO 4 ] (Sleight et al., 1972), which is stable until $660 C. Above this temperature another phase is formed for which a relation to a known phase could not be made. Above $710 C only the reflections of Mg 3 [TeO 6 ] are visible, associated with another small mass loss of $3% in the TG curve under further release of oxygen. Above this temperature no further mass loss is observed until 900 C. We currently cannot interpret the significant endothermal effect in the DTA curve in this temperature interval (onset 824 C). Since no further mass loss is observed here, this effect could be related either to a structural phase transition of (parts of) the remaining material or to a melting of an amorphous content thereof. Both effects cannot be related with the temperature-dependent diffraction pattern, e.g. by splitting or vanishing of reflections or a significantly broader background. It should be noted that the same material heated up to 1000 C in another experiment similar to the STA study resulted in the complete formation of a glass. In

Conclusion and outlook
The correlated disorder of Mg(H 2 O) 2 [TeO 2 (OH) 4 ] is notable because it can be decomposed into two modes, which can be treated separately. It demonstrates the difficulties of a quantitative structure determination inherent to data sets with a significant diffuse scattering. In such cases, refinements against Bragg reflections are not sufficient and information on correlated disorder has to be derived from diffuse scattering. But even such descriptions can be ambiguous. Here, pairs of entirely different structures with opposite sign of c orient produce virtually indistinguishable diffraction patterns. Using a small degree of idealization, simple analytical expressions describing the diffuse scattering can be derived, which allow for extremely fast calculations and a more thorough insight on the observed diffraction phenomena.
A crucial feature in the polytypism of Mg(H 2 O) 2 -[TeO 2 (OH) 4 ] is the hydrogen-bonding network that connects adjacent layers. Its role has been ignored in this X-ray study owing to disorder and the weak scattering power of the hydrogen atoms. A study using neutron diffraction might reveal a very different picture, possibly even necessitating the introduction of a third correlation parameter and different OD-layer symmetries.
APPENDIX A Symbols used / : Proportional to. % : Almost equal to.
x : Real. w, e : Weighting function and exponent in weighting function. L n : Crystal-chemical layer with sequential index n. A 1 n , A 2 nþ1 : OD layers (A 1 n : octahedra, A 2 nþ1 : hydrogenbonding network). G n : Group of operations of the OD layer A n not inverting the layer orientation. ½G : H : Index of the subgroup H of G. a, b : Layer lattice basis vectors. c 0 : Vector perpendicular to layer plane with the length of one L n layer width. c : Basis vector of a specific polytype. a, b, c 0 : Lengths of the vectors a, b, c 0 . r, s : Metric parameters describing the relative positions of adjacent OD layers. a*, b*, c Ã 0 : Basis vectors of the dual basis to a, b, c 0 . h, k, : Reciprocal coordinates with respect to (a*, b*, c Ã 0 ) (h, k: integers; : real). F, I : Structure factor and intensity (I = |F| 2 ) of a polytype or disordered stacking arrangement. s Án : Sum term in the calculation of I. F n : Structure factor of the L n layer. F M n , F O n : Contributions of the non-O3 atoms and the O3 atom to F n ¼ F M þ F O n , respectively. F À 0 : Structure factor of the L 0 layer reflected at (100). T O3 : Displacement parameter of the O3 atom. f O : Atomic form factor of O. d(O1-O2) : Distance between atoms O1 and O2. o n : Origin of the L n layer. Áo n : Origin shift from the L n to the L n+1 layer. n , n : Origin of the L n layer in coordinates: Áo n = n a/2 + n b/2. ! n : Orientation of the L n layer (! = 0,1). Á, Á, Án : Relative origin shift between two layers Áa + Áb + Á nc 0 up to layer lattice translation (Á, Á = 0, 1). P( . . . ) : Probability that the expression . . . holds. P MgTe : Probability that the origin shifts o n and o n+1 are equal. P orient : Probability that the orientation of two adjacent layers is the same (! n equals ! n+1 ). c MgTe , c orient : Nearest-neighbor correlations c MgTe = 2P MgTe À 1 and c orient = 2P orient À1. d c (x) : Shape of the diffuse scattering with nearest-neighbor correlation c. P Á;Á Án : Probability that the origin shift of the (L n , L n+Án ) layer pair is Áa + Áb + Ánc 0 . P þ Án , P À Án : Probabilities that the L n and L n+Án possess the (! n = ! n+Án ) or opposite (! n 6 ¼ ! n+Án ) orientation, respectively. R p : Residuals for fitting one-dimensionally diffuse scattering: R p ¼ P jI obs À I calc j 2 = P jI obs j 2 .

APPENDIX B Derivation of volume fractions from occupancies
The volume fraction of polytypes were derived from refinements using expressions of the type |2occ À 1|, where occ is the occupancy of an atom. This may seem surprising and is due to the symmetry used in the refinements. Consider a superposition of MDO 3 and MDO 4 , which conveniently possess the same unit-cell parameters. Both polytypes differ in the position of the O3 atoms, which will be considered up to fourfold rotation and translation. Representative O3 atoms of MDO 3 and MDO 4 are listed in the first and second row of Table 8, respectively. A 1 À x : x MDO 3/4 superposition then possesses the O3 occupancies shown in the third row. However, when refined using the MDO 4 symmetry (I42d), the O3 positions equivalent in MDO 4 are averaged, leading to the occupancies listed in the last row.
Thus, such a refinement features two O3 positions with the occupancies occ(O3) = (1AE x)/2 which leads to x = |2occ(O3) À 1|. Note that an occupancy of occ(O3) = 0 likewise corresponds to MDO 4 , but with a different origin. An analoguous argument can be made for the Mg/Te sites.
APPENDIX D Derivation of the peak shape induced by nearestneighbor growth models The shape of the diffuse scattering due to nearest-neighbor correlated stacking arrangements is long known [see Welberry (2010), and references therein]. It will be briefly derived here for a general nearest-neighbor correlation c using geometric series.
Atom positions are idealized and given with respect to the MDO 3/4 cell (c = 4c 0 ).