Finding alike supercells of two crystals

ABSTRACT An algorithm is proposed that finds supercells of two arbitrary crystals that are ‘alike’, or in other words, have almost the same lattice parameters. The given input is the primitive cells of two crystals, crystal 1 and 2, and their supercell sizes, N and N’, respectively, and the output is transformation matrices to (almost) maximally orthogonalized alike supercells. The algorithm was applied to comparison of prototypical sc, bcc, fcc, and hcp crystals, as well as perovskite crystals. The proposed algorithm can be used to identify orientational relationships between crystals and, in addition, provide relationships on all basis vectors. Further applications of the algorithm include the conversion of basis vectors between closely related crystals with very different choices of basis vectors and grain boundary model generation using an approximate coincidence site lattice. GRAPHICAL ABSTRACT IMPACT STATEMENT An algorithm is proposed that finds supercells of two arbitrary crystals that are “alike”, which is useful when comparing crystals described differently and generating grain boundary models.


Introduction
Supercells of crystals with lattices that appear quite dissimilar may be alike each other.For instance, the primitive cells of bcc and fcc crystals have very different appearance, but they both have cubic supercells.The bcc to fcc transformation has been studied extensively because of the martensitic transformation in steels.The orientational relationships (ORs) between two crystals are typically described using planes parallel to each other and a direction in each plane that are parallel to each other and are denoted in the form {hkl}//{h′k′l′} and <uvw>//<u′v′w′>.The OR in cubic crystals can be alternatively described using a common axis <uvw> and an angle of rotation ω.The [100], [010], and [001] directions of two crystals are superimposed, and then one is rotated by an angle ω around a rotation axis <uvw> [1].
Very similar crystals might be refined using very different settings.The space group type of perovskite materials differs significantly depending on how the symmetry is lowered.For instance, the five-atom unit cell of BaTiO 3 can have cubic, tetragonal, orthorhombic, or rhombohedral symmetry depending on the temperature [2].The lowered symmetry when B-site octahedra are tilted differently is given in Refs.[3][4][5].The number of formula units in the crystallographic conventional cell varies between 1, 2, 4, 6, and 8 among them (Table 1).Layered lithium-ion battery cathode materials with O3 stacking according to the notation by Delmas et al. [6] are based on the rocksalt structure where Li-rich and transition metal-rich cation layers alternate along the (111) direction.The prototypical compound, LiCoO 2 , has R � 3m (number 166) symmetry [7].Other compounds in this family include Li 2 MnO 3 with C2/m symmetry (number 12) [8] and Li(Ni x Li 1/3-2/3 Mn 2/3-x/3 )O 2 that can be refined both as an O3-layered structure (space group R � 3m) and as a spinel structure (space group Fd � 3m, number 227) [9].There must be an almost cubic supercell for these compounds, but how to derive such an almost cubic supercell from a primitive or conventional cell is not always obvious.
Conventional grain boundary (GB) model generation uses a three-dimensional (3D) coincidence site lattice (CSL) between two constituent crystals, although an alternative approach requiring only twodimensional (2D) periodicity shared by the 2D lattices of the two GB planes has been proposed by Hinuma et al. [10] In the CSL approach, grains are superimposed such that a subset of lattice points of each crystal overlaps, thereby sharing a CSL.Subsequently, relatively straightforward exploration of various symmetrical or asymmetrical GBs is possible by choosing a GB plane that intersects some dense or sparse 2D array of CSL points in the common 3D CSL [10].An exact CSL is only possible in cubic lattices with any rotation axis, tetragonal lattices with rotation axis <001>, and hexagonal lattices with rotation axis <0001> [11].There is much literature on the CSL of a tilt GB, originally in the cubic system [12][13][14][15] and later in the hexagonal system [16].
Making GB models based on the CSL approach are possible for non-cubic crystals when there is a supercell that is close to cubic for each crystal.First, the transformation matrix between supercells of a low symmetry lattice and a proxy simple cubic lattice is identified for the two crystals that constitute a grain boundary.The ratio of supercell sizes between the two crystals needs to be carefully chosen, and the number of supercell sizes can be increased together until a reasonable match is obtained.The lattices of the cubic supercells are then used to obtain an exact CSL relation, and the cubic lattices are transformed back into the original crystals while maintaining the CSL relation between them.The crystals need to be strained in order to attain an exact CSL for GB model generation, and how to strain is up to the GB model designer.For example, the lattice may be fixed to those of the first crystal, second crystal, or somewhere in between.Comparison of two crystals that are to comprise a grain boundary in Ref. [10] focuses on finding a shared 2D lattice rather than finding basis vectors forming an (appropriate) CSL, but there was no algorithm to look for similar 3D lattices.
This study proposes an algorithm to find supercells of two arbitrary crystals that are 'alike', or in other words, the lattice parameters are almost the same.The given input is the primitive cells of two crystals, 1 and 2, with basis vectors a P , b P , and c P and a′ P , b′ P , and c′ P , respectively, and their supercell sizes, N and N', respectively.The output is a transformation matrix of crystal 1 into an N-supercell, and its primed counterpart, where det(S) = N and det(S′) =N′.
The proposed algorithm can be used to identify ORs using the parallel plane and direction description and, in addition, provide relationships on all basis vectors.Further applications of the algorithm include conversion of basis vectors between closely related crystals with very different choices of basis vectors and GB model generation through an approximate CSL.[47].Structures 11 and 12 take the hexagonal manganite (HM) Structure, 13 takes the ilmenite (IL) structure, and 14 takes the hexagonal perovskite (HP) structure, respectively.Z and z are the number of formula units in the conventional and primitive cells, respectively.Illustrations of the crystals are given in the supplementary material of ref. [47].

Outline
This work focuses on searching supercells with 'alike' shape of two arbitrary crystals.The supercells are chosen to be (almost) maximally orthogonalized to limit the number of supercells that need to be compared.
The conventional cell and a primitive cell of each crystal can be obtained using symmetry search code such as spglib or phonopy [17,18].Basis vectors are taken to be right-handed.
Volume-normalized N-and N′-supercells are defined to have basis vectors . ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi and . ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi which are hydrostatically scaled N-and N′-supercells such that the volume of the supercells becomes unity.The alikeness is described by angle and length difference indices.The former is related to interaxial angles and reflects information on basis vector lengths to some extent, and the latter is determined solely by basis vector lengths: These indices are symmetric with respect to nonprimed and primed basis vectors.The minimum possible values are both 0; δ a ¼ 0 when all lattice parameters are the same between crystals 1 and 2, and S j j from the arithmetic-geometric mean relation.The value of ãS � bS appearing in δ a is zero when ãS and bS are perpendicular, or in other words, the interaxial angle α is 90°.Therefore, shear deformation of an orthorhombic lattice results in a non-zero δ a , and a more profound deformation results in a larger δ a .The value of � is also zero when the lattice parameters a, b, and α are the same between the two crystals.
The term ãS � ãS in δ l is the square of basis vector length a.The value ãS �ã S ã0 S �ã 0 S þ ã0 S �ã 0 S ãS �ã S takes the smallest value of 2 when ãS j j and ã0 S j j and increases when the relative difference increases.
(Almost) maximally orthogonalized supercells [19], summarized as follows, are used for comparison.A basis vector b is maximally orthogonalized to a basis vector a when b j j takes the smallest possible value when the area of the 2D unit cell, A ¼ a � b j j, is fixed and a j j � b j j.In other words, cos θ j j b j j � a j j=2 where θ is the angle between a and b.In this case, a is also maximally orthogonalized to b.When a and b are given and a j j � c j j and b j j � c j j, and the volume of the 3D unit cell V ¼ a � b ð Þ � c is fixed (which holds among all N-supercells), basis vector c is maximally orthogonalized to a and b when c j j takes the smallest possible value, and if so, a and b are both maximally orthogonalized to c. Similarly, when basis vector b is maximally orthogonalized to lattice vector a, lattice vector b′ is almost maximally orthogonalized with tolerance and lattice vector c′ is almost maximally orthogonalized with tolerance ε c to a and b when The tolerances ε b and ε c for almost maximally orthogonalized supercells are defined arbitrarily.
An algorithm to find (almost) maximally orthogonalized supercells, with volume N times a primitive cell (N-supercell) of an arbitrary crystal, is given in Hinuma [19].(Almost) maximally orthogonalized supercells are constructed by initially setting a limitation of a j j � b j j � c j j and then finding candidates of a, b, and c in this order because there are upper limits to lengths of a j j and b j j and, therefore, a and b can be exhaustively searched efficiently.The limitation on lengths can be removed subsequently by permutating and/or inverting basis vectors.

Algorithm
The following algorithm finds the relation between 'alike' supercells with given size.
(1) Basis vectors of a primitive cell of crystal 1, a P , b P , and c P , are obtained, for example, by using symmetry search software.(2) (Almost) maximally orthogonalized N-supercells are obtained according to Hinuma [19].(3) Optional: a unique basis vector choice is identified for each set of lattice parameters, and then others are discarded.(4) Optional: basis vectors of the conventional cell are denoted as a C , b C , and c C .The transformation matrix P is defined as Using the transformation matrix Supercells where all elements of M are all integers are identified, and then others are discarded.Noninteger elements in M can appear in crystals with centering.
(5) ðã S ; bS ; cS Þ is derived using Equation ( 3). ( 6) Primed counterparts for crystal 2 are obtained.(7) There is no intrinsic limitation on the symmetry of the crystals nor the size of N and N', but there is a double loop over all supercells of each crystal to check for uniqueness and another double loop over (unique) supercells of crystals 1 and 2 to compare alikeness.The number of supercells increases roughly as O(N 2 ), forcing the calculation of an O (N 4 ) subroutine.

Obtaining a unique set of N-supercells for each lattice parameter set
Often, only one basis vector choice is necessary for each lattice parameter set.As an example, three choices, out of 24, of 1-supercells for a simple cubic cell are a S ; b The most convenient choice is typically the first one, and some measure to ensure that the first is selected, rather than a random choice, is preferable.This is possible by denoting the elements of M in Equation ( 8) as and sorting supercells in descending order of Finding the unique choice may be implemented as follows.Inner products of basic vectors are regarded as strings of characters, which are concatenated and stored in an array.A C-style pseudocode is: char array1[10000]; float eps = 1e-10; (loop over all supercells){ sprintf (array1, ''%0.8f%0.8f %0.8f %0.8f %0.8f % 0.8f'', aa+eps, bb+eps, cc+eps, ab+eps, bc+eps, cc+eps) } Here, aa = a S � a S , ab = a S � b S , and so on.
Converting floating point numbers into strings removes very small inaccuracies in decimal numbers.Some implementations round very small negative numbers such as −10 −12 to −0.00000000 and very small positive numbers for example, 10 −12 to 0.00000000.These two numbers should be treated as the same number, thus adding a small number, for example, eps = 10 −10 , results in rounding of both numbers to positive 0.00000000.
Duplicates of the string are subsequently removed by comparing pairs of the concatenated strings and, in case of a match, discarding the supercell with smaller u.

Trivial case of sc to sc
The trivial case of alikeness between two 1-supercells of two simple cubic crystals, which are simply the conventional cells, is discussed first.The lattice parameter a of the two crystals is irrelevant because the volume is ultimately scaled to unity and thus a becomes unity.There are 24 1-supercells in a cubic crystal.Once each of a P or À a P , b P or À b P , and c P or À c P are chosen as basis vectors, there are 3 unique choice, and similarly its primed counterpart, is possible using section 2.3.

fcc to hcp
The fcc and hcp crystal structures are close to each other.Close-packed atoms arranged in a triangular pattern are stacked in ABCABC and ABABAB patterns in the former and latter, respectively.The relation between fcc and 'ideal' (c=a ¼ ffi ffi ffi ffi ffi ffi ffiffi 8=3 p ) hcp crystals is investigated here.The primitive cells of fcc and hcp crystals contain one and two atoms, respectively.Supercells with four or six atoms that are alike each other within the range δ a +δ l < 0.3 are shown in Figure 1.Matrices M (defined in Equation ( 8)) and M′ are also shown.The obvious alike supercells with δ a = δ l = 0 are illustrated in Figure 1(c).There are additionally two and three supercell combinations, containing four and six atoms, respectively, that are relatively alike.These combinations are not intuitive but relatively easy for a computer to derive them.However, the smallest δ a +δ l within these five combinations is relatively large at 0.17 in Figure 1(a), thus combinations other than Figure 1(c) are less likely to be encountered.Burgers [20] discussed the transformation of bcc structure β-Zr to hcp structure α-Zr upon heating at around 862°C [21], while Fe undergoes a pressureinduced phase transition from bcc to hcp at roughly 13 GPa [22][23][24].

bcc to hcp
Alike supercells of bcc and hcp with δ a +δ l <0.2 and up to four atoms are shown in Figure 2(a-d) together with their M and M′, respectively.Figure 2(a) is the unique combination with two-atom supercells.This satisfies the OR that Burgers found in Zr [20], which is {110}//{0001} and <111>//<11 20>.2(b-d) shows unique combinations for four-atom supercells.Figure 2(b,c) are 1 × 1 × 2 and ffi ffi ffi 2 p � ffi ffi ffi 2 p � 1 supercells of Figure 2(a), respectively.Making a H×K×L supercell changes δ a but not δ l , while supercells of other shapes result in different δ a and δ l .In contrast, Figure 2(d) is a subtle result.The hcp supercells of Figure 2(c,d) are the same, but the bcc supercells are different.The relatively high indices and large δ a in Figure 2(d) make this combination less intuitive and less likely to happen.The Burgers OR of {110}// {0001} and <111>//<11 � 20> is satisfied in these supercells.Figure 2(e-g) show the supercells in Figure 2(c,d) viewed from the <110> direction or the <0001> direction.Burgers stated that there are 12 possible orientations in a transformed Zr crystal because a cubic lattice has six {110} planes and, if the basis vectors in the basal plane are <110> and <001>; (this assumption is not explicitly stated by Burgers), there are two choices of the <111> direction [20].The basal plane basis vector choices are shown as solid arrows and the diagonal <111> direction is shown as dashed arrows in Figure 2(e).On the other hand, when the basis vectors are <311> and <111> as in the case of Figure 2(d), there are three basis vector choices of <311> and <111> with different diagonal <111> choices (solid and dashed arrows in Figure 2(f), respectively) in each of the {110} planes.This gives rise to 18 possible orientations.The basal plane basis vectors in Figure 2(e,f) are alike the basis vectors for hcp in Figure 2(g).
Figures 3 and 4 show alike supercells with two to six atoms and δ a +δ l <0.35.Trivial H � K � L supercells of a lower N-supercell pair are excluded.Supercells related by the Bain and Pitsch ORs are found in Figure 3(a,b), respectively.These two pairs of supercells are the two unique combinations for two-atom supercells.The two supercells with the Bain OR are orthorhombic, thus shear strain is not necessary for transformation between these supercells.In contrast, shear strain is necessary in the Pitsch OR.KS and NW ORs are found in the same supercell combinations with six atoms in Figure 4(a,g), which suggests that atoms move similarly during transformations resulting in KS and NW ORs.However, the strain should be different.The fcc and bcc supercells in Figure 4(a) are alike a hcp supercell, as shown in Figure 1(c).The pair in Figure 4(a) is more alike than Figure 4(g), thus transformation between the two supercells is more plausible than the latter.

Perovskites
Perovskite crystals can be classified hierarchically based on structure and composition [3].Glazer compiled a list and proposed notations for 23 static tilt systems of perovskite crystals covering 15 space group types [32].Their supergroup-subgroup relations were summarized by Howard and Stokes [33].A comparison of categorizations between these two works is summarized in Ref. [34].Howard et al. showed that 1:1 B-site ordered, or double perovskites, with composition A 2 NN'X 6 can take 12 tilt systems including the aristotype Fm � 3m [4].Recently, Adams and Churakov published a list of dynamic octahedral tilting systems comprising 19 tilt systems covering 12 space group types [5].
The lists of tilt systems discussed above do not exhaustively represent distortions in perovskite systems because distortion other than tilts can happen, which is the case in the two low-temperature polymorphs of BaTiO 3 .Ferroelectric crystals cannot be microscopically centrosymmetric, although high-temperature phases are macroscopically refined in centrosymmetric space group types.SrTaO 2 N and BaTaO 2 N are relaxortype ferroelectrics [35][36][37] demonstrating high dielectric constants (κ) of few thousand to over 10,000 near room temperature [38,39].The space groups are refined in centrosymmetric I4/mcm (140) [38][39][40] and Pm � 3m (221) [38,40], respectively; the latter retains its high Pm � 3m symmetry even down to 4 K [41].However, local short-range ordering of distortions is experimentally suggested, which breaks the centrosymmetry and allows ferroelectric behavior [42][43][44][45].First-principles calculations of total energies at 0 K suggests formation of chain motifs that breaks the symmetry [46].
The diversity of symmetry in perovskites suggests the need of transforming basis vectors between different crystal structures to, for example, allow easy comparison of displacement in atom positions.The rest of this section discusses alikeness in different polymorphs of two perovskite oxides.

LaScO 3
Fisher et al. calculated LiScO 3 in 14 different crystal structures (polymorphs) using density functional theory [47].Illustrations and lattice parameters of the crystal structures are given in the supplementary information of Ref. [47], and relevant information is summarized in Table 1.The smallest values of δ a and δ l necessary to claim alikeness between two polymorphs are given in Tables 3 and 4, respectively.Denoting the number of formula units in the conventional and primitive cells in crystal 1 as Z and z, respectively, and the counterparts in crystal 2 as Z′ and z′ respectively, N = ZZ′/z and N′ = ZZ′/z′, respectively, were used.The values of δ a_cut and δ l_cut were both 0.2.Alike supercells were found between all perovskite structures but not always when hexagonal manganite structure 11 and the hexagonal perovskite structures were involved.The δ a among the perovskite structures tends to be large between structure 3 (space group R � 3c) and other perovskites.Perovskites other than structure 3 are orthorhombic, tetragonal, or cubic with α = β = γ = 90° in the conventional cell, while α = β = γ ≠ 90° in structure 3.This difference in interaxial angles is reflected in the difference in δ a .The value of δ a is exactly 0 when the pair of supercells of both crystals are orthogonal, which could happen for all crystals according to the symmetry of the crystals.
Values of δ l are very small between perovskites (structures 1-10), with the largest value being 0.002.On the other hand, δ l larger than 0.01 or even 0.1 are found between perovskites and non-perovskites (structures 11-14), reflecting the large difference in geometry.

Approximate CSL determination
This section discusses how to prepare crystals for GB generation using an (approximate) CSL.Li 3x La (2/3)-x TiO 3 (0 < x < 0.16) (LLTO) takes a perovskite structure where A and B sites are occupied by (Li, La) and Ti, respectively.The La-rich and Li-rich layers alternate in the [001] direction.The crystal structure has a tetragonal lattice with experimental lattice parameters a = b = 3.87 and c = 7.79 Å (c/a = 2.013) and computational lattice parameters a = b = 3.84 and c = 7.96 Å (c/a = 2.073).An exact CSL relation is possible when the rotation axis is [100] [11], but Σ2(110), Σ3(110), Σ5(210), Σ3(211), and Σ5(310) grain boundaries are discussed in Ref. [48].A conversion of near-cubic LLTO to a cubic surrogate crystal is necessary to obtain GB models using an exact Table 3. Value of δ a multiplied by 1000 for the lowest (δ a +δ l ) transformation between LaSrO 3 crystals 1 and 2 (the crystal structure numbers are shown in Cr1 and Cr2, respectively).Details for each structure are given in Table 1.Structures 11 and 12 take the hexagonal manganite (HM) structure, 13 takes the ilmenite (IL) structure, and 14 takes the hexagonal perovskite structure, respectively.No alike supercells were found in combinations denoted with a dash.[001], and [010] directions, respectively.GB models may be made using the CSL approach, and atom positions are determined by converting the GB unit cell to the 4-supercell of tetragonal LLTO.This is a close to trivial example that can be processed by hand but generating GB models of LiCoO 2 [7], Li 2 MnO 3 [8], and Li(Ni x Li 1/3-2/3 Mn 2/3-x/3 )O 2 [9], which could be of relevance in battery applications, using cubic surrogate crystals and the CSL approach are not straightforward without the proposed algorithm.

Conclusions
This study proposed an algorithm to find supercells of two arbitrary crystals that are 'alike', or in other words, the lattice parameters are almost the same.The given inputs are the primitive cells of two crystals, crystal 1 and 2, and their supercell sizes, N and N′, respectively, and the output is transformation matrices to (almost) maximally orthogonalized alike supercells.The algorithm was applied to comparison of prototypical sc, bcc, fcc, and hcp supercells, as well as perovskite compounds.The proposed algorithm can be used to identify ORs using the parallel plane and direction description and, in addition, provide relationships on all basis vectors.Further applications of the algorithm includes conversion of basis vectors between closely related crystals with very different choices of basis vectors and would assist GB model generation.

Disclosure statement
No potential conflict of interest was reported by the author(s).

Figure 1 .
Figure 1.(a-f) Alike supercells of fcc (gray) and hcp (blue) supercells.The values of (δ a , δ l ) as well as transformation matrices M and M' are also given.Red, green, and blue arrows indicate [100], [010], and [001] directions of the supercells, respectively.The crystallographic directions based on the conventional cell are additionally shown in (c).

Figure 2 .
Figure 2. (a-d) Alike supercells of bcc (brown) and hcp (blue) supercells.The values of (δ a , δ l ) as well as transformation matrices M and M' are also given.Red, green, and blue arrows indicate [100], [010], and [001] directions of the supercells, respectively.The crystallographic directions and planes based on the conventional cell are additionally shown in (a,c,d).Supercells viewed from the [001] direction of the supercell in (e) fcc supercell in (c), (f) fcc supercell in (d), and (g) hcp supercell in (c) and (d), respectively.Atoms shown in light color with a yellow ⊕ sign are on a different basal plane from other atoms.The solid arrows indicate basis vectors, while the dashed lines in (e,f) represent the < 111> direction used to identify the OR by Burgers.The basis vectors of the supercell with respect to the basis vectors of the conventional cell are denoted in the form [u,v,w] in (e,f).

Figure 3 .
Figure 3. (a-g) Alike supercells of fcc (gray) and bcc (brown) supercells.The values of (δ a , δ l ) as well as transformation matrices M and M' are also given.Red, green, and blue arrows indicate [100], [010], and [001] directions of the supercells, respectively.The crystallographic directions based on the conventional cell are additionally shown in (a) and (b).Directions and planes defining the Bain and Pitsch relations are shown in dark green in (a) and (b), respectively.

Figure 4 .
Figure 4. (a, c-g) Alike supercells of fcc (gray) and bcc (brown) supercells.The values of (δ a , δ l ) as well as transformation matrices M and M' are also given.Red, green, and blue arrows indicate [100], [010], and [001] directions of the supercells, respectively.The crystallographic directions based on the conventional cell are additionally shown in (a) and (g).Directions and planes defining the KS and NW relations are shown in dark green and orange in (a), (b), and (g), respectively.The alike hcp supercell (blue) is additionally shown in (a).The basal planes of supercells in (a) are shown in (b).
CSL.The [001] direction in tetragonal LLTO may correspond to any of [100], [010], and [001] directions in the cubic surrogate crystal.Therefore, an explicit transformation matrix between LLTO and the cubic surrogate crystal is necessary.The conventional cell of LLTO has two perovskite units stacked in the [001] direction, thus a cubic surrogate crystal is a 4-supercell.The transformation matrices calculated using the algorithm are tetragonal [001] direction is the cubic [100],

Table 1 .
The crystal structures of LaScO 3 calculated by Fisher et al.
For all combinations of ðã S ; bS ; cS Þ and

Table 2 .
Rational ORs between fcc and bcc crystals.

Table 4 .
Value of δ l multiplied by 1000 for the lowest (δ a +δ l ) transformation between LaSrO 3 crystals 1 and 2 (the crystal structure numbers are shown in Cr1 and Cr2, respectively).Details for each structure are given in Table1.Structures 11 and 12 take the hexagonal manganite (HM) structure, 13 takes the ilmenite (IL) structure, and 14 takes the hexagonal perovskite structure, respectively.No alike supercells were found in combinations denoted with a dash.