## computer programs

*GenOVa*: a computer program to generate orientational variants

^{a}CEA-Grenoble, DRT/LITEN, 17 rue des Martyrs, 38054 Grenoble, France^{*}Correspondence e-mail: cyril.cayron@cea.fr

A computer program called *GenOVa*, written in Python, calculates the orientational variants, the operators (special types of misorientations between variants) and the composition table associated with a structure. The variants can be represented by three-dimensional shapes or by pole figures.

Keywords: variants; orientation; groupoids; pole figures; simulations; computer programs; *GenOVa*.

### 1. Introduction

Steels, nickel alloys, titanium alloys, brass, *etc.* are materials widely used in industry that all share a common point: their key property results from a phase transformation, such as martensitic transformation, order/disorder transition, ferroelectric or precipitation or recrystallization. This transformation produces daughter crystals in an orientation relationship with their parent crystals. Owing to the symmetries, many equivalently oriented daughter crystals can be formed for each parent crystal. These are called orientational variants (or domains). The optimization of the material properties requires advanced characterization tools for a better understanding of the variant formation and more generally for a better knowledge of phase transformation mechanisms. However, there are few computer programs that perform the theoretical calculations of the variants. To the author's knowledge, there is only one program that simulates the diffraction patterns of variants in (TEM) (Akbay *et al.*, 1994). There is no generic theoretical software to help metallurgists, mineralogists and physicists in their research. We present here a computer program called *GenOVa* that generates the variants for any structural calculates the different types of misorientations between them (called `operators') and establishes the composition table of these operators. This program is based on the recent progress realized on the understanding of the algebraic structure of the variants and operators (Cayron, 2006). More generally speaking, this program calculates all the characteristics of the of orientational variants for any structural transformation. It also allows us to draw the crystals in three dimensions and to simulate the pole figures.

### 2. Theoretical basis

The general underlying theory of the *GenOVa* program has been described by Cayron (2006). For simplicity, only the main equations used in the program will be recalled here; these are illustrated with the simple two-dimensional example presented in Fig. 1(*a*).

#### 2.1. Entry parameters

Few entry parameters are required to calculate the variants, the operators and their composition: (i) the point groups of the parent and daughter phases, here denoted **G**^{β} and **G**^{α}, and (ii) the common symmetries between the parent and daughter crystals. In the example of Fig. 1, the parent and daughter point groups are given by sets of matrices **G**^{β} = {*E*, *I*, , , , , , } and **G**^{α} = {*E*, , , , , }, and the symmetries common to the parent crystal and the daughter crystal α_{1} are given by = {*E*, }, which is a of **G**^{β} called the intersection group. *E*, *I*, *m* and *r* are the identity, inversion, mirror and rotation matrices of the point groups. Generally in the literature, the common symmetries are unknown and only the orientation relationship between the parent and daughter crystals is given, in the form of couples of parallel planes or directions. In that case, the metric values of the parent and daughter phases (given by the metric or structure tensors) can be used to calculate a transformation matrix **T**_{>} from a parent basis to a daughter basis and the of common symmetries is then given by **H**^{β} = **G**^{β} ∩ **T**_{>}**G**^{α}**T**_{>}^{−1}.

#### 2.2. Calculation of the variants

Each variant α_{i} is algebraically represented by a α_{i} = **H**^{β}. The variants form a partition of the set **G**^{β}; their set is the quotient set **G**^{β}/**H**^{β} = {**H**^{β}, **H**^{β},…, **H**^{β}}; their number is given by Lagrange's formula *N*^{α} = |**G**^{β}|/|**H**^{β}|. In the example of Fig. 1(*a*), the variants are α_{1} = {E, }, α_{2} = {, }, α_{3} = {*I*, } and α_{4} = {, }. The orientations of the variants are given by the set of transformation matrices α_{i}**T**_{>} = **H**^{β}**T**_{>}. For a global understanding, it is important to realize that the set of variants does not have a group structure in general. It can be considered as a group if and only if **H**^{β} is a of **G**^{β}, which is not the case for most of the structural transformations. This absence of group structure gives an intrinsic complexity to the problems involving variants.

#### 2.3. Calculation of the operators

Once the orientations of the variants have been calculated, the different types of misorientations between them can be deduced. The misorientation from the variant α_{i} to the variant α_{j} is given by the set of matrices (α_{i}**T**_{>})^{−1} α_{j}**T**_{>} = **T**_{>}^{−1}α_{ij}**T**_{>}, with α_{ij} = α_{i}^{−1}α_{j}. By expressing these matrices in a reference basis of the parent crystal with the isomorphism ψ:*g* → T_{>}*g***T**_{>}^{−1}, that set simply becomes α_{ij} = **H**^{β}**H**^{β}, where = ()^{−1}. This is interesting because the sets of type **H**^{β}**H**^{β} are double-cosets, and algebra theory tells that they form a partition of **G**^{β}. Therefore, each misorientation between variants can be identified with a unique `type' of misorientation represented by a double-coset. We call the different types of misorientations `operators' because they can also be imagined as actions operating on the variants. The operators form a partition of **G**^{β}; their set is the double quotient set **H**^{β}\**G**^{β}/**H**^{β}; their number is = |**H**^{β}\**G**^{β}/**H**^{β}|. Since any double-coset can be expressed by a set of simple cosets and since both **G**^{β}/**H**^{β} and **H**^{β}\**G**^{β}/**H**^{β} form a partition of **G**^{β}, one can easily check that the number of operators is always lower than the number of variants. Some general but complex formulae are given by Cayron (2006) to calculate this number. The misorientation α_{ij} from the variants α_{i} to the variant α_{j} may also be viewed as an arrow (α_{i} ▹ α_{j}) where the variants α_{i} and α_{j} are the starting and the target objects, respectively. Each operator can then be also expressed by a set of equivalent arrows. In the example of Fig. 1(*a*), α_{11}, α_{22}, α_{33} and α_{44} are different arrows because they link different objects but they constitute the same operator = {*E*, }. There are also two other operators, = {α_{12}, α_{21}, α_{23}, α_{32}, α_{34}, α_{43}, α_{14}, α_{41}} = {, , , } and = {α_{13}, α_{31}, α_{24}, α_{42}} = {*I*, }.

In order to identify the operators in the experimental data, for instance in electron backscatter diffraction (EBSD), it is useful to express them by using the rotations that have the minimum rotation angle.^{1} In the example of Fig. 1(*a*), the rotations with minimum rotation angle that represent the operators , , are the rotations of 0, 30 and 60°, respectively.

#### 2.4. Calculation of the composition table

The set of variants α_{i} associated with the set of arrows α_{ij} form an algebraic structure called groupoid.^{2} The composition law is simply a composition of pairs α_{ij}α_{jk} = α_{ik}. The interesting point is the possibility to represent algebraically the whole structure of variants, arrows and operators by a simple composition table. Indeed, if the variant α_{1} is arbitrarily taken as the reference variant, the operators can be written as sets of arrows that have α_{1} as starting object. It has been proved that these arrows of type α_{1j} are expressed by the same set of matrices as the variants α_{j} and they can be simply denoted {α_{j}}. In the example of Fig. 1(*a*), = {α_{11}} = {α_{1}}, = {α_{12}, α_{14}} = {α_{2}, α_{4}}, = {α_{13}} = {α_{3}}. Then, two operators and can be composed according to (, ) → ()^{−1} by (i) writing the operators as a set of variants by choosing α_{1} as reference, = {α_{1i}} = {α_{i}} and = {α_{1j}} = {α_{j}}, (ii) forming all the possible arrows of type α_{1i}^{−1}α_{1j} = α_{ij} and (iii) identifying the constituted arrows α_{ij} with some of the operators. The operator composition is in general multivalued, *i.e.* more than one operator results from the composition. This method allows us to establish a compact algebraic representation of the It gives the composition between the operators but also includes the information on the variants. Such a composition table is called a `groupoid composition table' (Cayron, 2006). The table corresponding to Fig. 1(*a*) is given in Fig. 1(*b*).

### 3. Brief description of the computer program

*GenOVa* calculates the variants, the operators and the composition table according to the methods previously described. It is written in Python which is a multi-platform, interpreted and object-oriented language (Martelli, 2006; see also https://www.python.org/ ). The main menu of *GenOVa* is presented in Fig. 2. The crystallographic information on the phases (**G**^{β}, **G**^{α} and metric tensors) is given by files created by the *EMS* software (Stadelmann, 1987; https://cimewww.epfl.ch/people/stadelmann/jemsWebSite/jems.html ), but we will soon introduce the possibility to load that information from other crystallographic programs. Once created, a phase transformation can be saved and further reloaded. So far, only the first-generation variants are calculated. Cycles of phase transformation, *i.e.* variants of variants *etc.*, are more complex and would need more theoretical developments. We have only included one specific case very important in metallurgy for grain boundary engineering, the Σ3^{n} multiple in cubic crystals (Cayron, 2007*a*). The algebraic results are obtained by the `Variants and Operators' button. They are presented in the case of a Burgers transformation in Fig. 3. The composition table and a reduced version of this table giving only the operator composition are also represented. In addition, the program calculates the number of possible parent crystals when only two variants are known and it determines the minimum number of variants required to unambiguously determine the orientation of the parent crystal. All these calculations last a few seconds and can be performed with the direct and/or the inverse phase transformation.

The `Variants in 3D' button allows us to draw the variant crystals in an orientation relationship with their parent crystal in three dimensions. This part was written with Soya 3D, a free object-oriented three-dimensional engine for Python developed by Lamy (2005). Until now, cubic crystals have been represented only by cubes or regular tetrahedra, hexagonal crystals by hexagonal prisms, and crystals with other point groups by their unit cells. Two examples are given in Fig. 4, one for Burgers transition and one for with a Kurdjumov–Sachs (KS) orientation relationship. The size and positions of the variants can be modified, the orientation can be automatically or manually controlled, and the light parameters can be adapted. The `Pole Figure' button allows pole figures of the parent and variant crystals to be drawn in stereographic or equal-area projection modes. Here again, the parent crystal can be oriented manually, or by choosing the normal and horizontal directions, or by choosing its Euler angles. The directions that are projected can be independently chosen for the parent and daughter phases. Two examples are given in Fig. 5 for Burgers transition and for with a KS orientation relationship. The `Electron Diffraction' button will allow the simulation of complex TEM diffraction patterns. This module is under development. A first version working with *EMS* (Stadelmann, 1987; https://cimewww.epfl.ch/people/stadelmann/jemsWebSite/jems.html ) was programmed by Cayron (2000), but that work was based on incomplete theory and some modifications are required to implement links with *JEMS*, the new version of *EMS*.

In summary, *GenOVa* is a generic computer program that calculates the variants, the operators and the composition table for any structural phase transformation. The theoretical results of *GenOVa* can be used for advanced exploitation of experimental data, such as the reconstruction of parent grains from EBSD data (Cayron *et al.*, 2006; Cayron, 2007*b*).

### Footnotes

^{1}The misorientation matrices from α_{i} to α_{j} expressed in the bases of α_{i} are given by the set **T**_{>}^{−1}**H**^{β}**G**_{ij}^{β}**H**^{β}**T**_{>} = **T**_{>}**T**_{>}^{−1} with containing the arrow α_{ij}. A symmetry matrix in this set can then be arbitrarily chosen (for example *m*_{ij} = **T**_{>}**g**_{ij}^{β}**T**_{>}^{−1}). The matrices equivalent to *m*_{ij} are obtained by taking into account all the bases of α_{i} and α_{j}. They are given by the set **G**^{α}*m*_{ij}**G**^{α}. This new and large set generally contains rotations and it is convenient to choose the rotation that has the minimum rotation angle. This rotation is sometimes called `disorientation'.

^{2}We would like to rectify a mistake made by Cayron (2006) and noticed by Litvin (2007). It was stated that, in formula (50) of the Cayron paper, the was based on the set of variants and on the set of operators. Actually, the defined in (50) is based on the set of variants and the set of arrows between the variants. By definition, α_{i}α_{ij} = α_{j}, *i.e.* α_{j} is the image of α_{i} by the arrow α_{ij}. It is possible to define a structure with the set of variants and the set of operators, but in this case, we have only α_{i} ∋ α_{j}, if α_{ij} ∈ , *i.e.* α_{j} is one of the possible images of α_{i} by the operator . We are not sure if the associated structure can still be called groupoid.

### Acknowledgements

The author acknowledges Dr Jouneau and Professors Michéa, Weinstein and Litvin for their constructive discussions.

### References

Akbay, T., Aydinol, K. & Bor, A. Ş. (1994). *J. Appl. Cryst.* **27**, 379–384. CrossRef CAS Web of Science IUCr Journals Google Scholar

Cayron, C. (2000). PhD thesis No. 2246, EPFL, Lausanne, Switzerland. (https://cimewww.epfl.ch/people/cayron/these.html .) Google Scholar

Cayron, C. (2006). *Acta Cryst.* A**62**, 21–40. Web of Science CrossRef CAS IUCr Journals Google Scholar

Cayron, C. (2007*a*). *Acta Cryst.* A**63**, 11–29. Web of Science CrossRef IUCr Journals Google Scholar

Cayron, C. (2007*b*). *J. Appl. Cryst.* **40**, 1183–1188. Web of Science CrossRef CAS IUCr Journals Google Scholar

Cayron, C., Artaud, B. & Briottet, L. (2006). *Mater. Charact.* **57**, 386–401. Web of Science CrossRef CAS Google Scholar

Lamy, J. B. (2005). https://home.gna.org/oomadness/en/soya3d/index.html . Google Scholar

Litvin, D. B. (2007). Private communication. Google Scholar

Martelli, A. (2006). *Python in a Nutshell*, 2nd ed. Cambridge: O'Reilly. Google Scholar

Stadelmann, P. (1987). *Ultramicroscopy*, **21**, 131–145. CrossRef CAS Web of Science Google Scholar

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