## computer programs

*PyQCstrc.ico*: a computing package for structural modelling of icosahedral quasicrystals

^{a}Faculty of Science, Department of Applied Physics, Tokyo University of Science, 6-3-1 Niijuku, Katsushika-ku, Tokyo 125-8585, Japan^{*}Correspondence e-mail: tsunetomo.yamada@rs.tus.ac.jp

The atomic structure of quasicrystals (QCs) is described as a section of a higher-dimensional structure that consists of a periodic arrangement of occupation domains (ODs). Determination of the shape of ODs and their partitioning is crucial in the structural analysis of QCs. However, owing to the complicated shape of ODs, building the initial structure model requires a great deal of time and effort. Thus, a computer program for building structure models of QCs is needed. Presented here is a Python3 package for structure modelling of icosahedral QCs.

Keywords: quasicrystals; higher-dimensional crystallography.

### 1. Introduction

Quasicrystals (QCs) are long-range-ordered materials that generate self-similar diffraction patterns related to their scale incompatible with translational symmetry (Shechtman *et al.*, 1984; Levine & Steinhardt, 1984). The atomic structure of QCs can be described as a 3D section of *n*-dimensional (*n*D) periodic structures (*n* > 3). The *n*D structure consists of `occupation domains' (ODs) or atomic surfaces whose geometrical shapes are defined in the (*n* − 3)D complementary space called perpendicular space (), perpendicular to the 3D real space, called parallel space () (see *e.g.* Yamamoto, 1996; Janssen *et al.*, 2007). The ODs form 2D surfaces or 3D solids for dihedral (*n* = 5) or icosahedral (*n* = 6) QCs, respectively.

Structural analysis of QCs can be executed by utilizing the software package *QUASI* developed by Yamamoto (2008). This contains several programs which can be utilized for the direct method (*lodemac*) (Takakura *et al.*, 2001), structure (*qcdiff*), generation of atomic positions in (*qcstrc*), and generation of Fourier and maximum method (MEM) maps (*qcmem*) *etc*. However, a tool for building the initial structure model in the *n*D space has been lacking, which means scientists have to put a great deal of work into building the initial models. To overcome this difficulty, the *PyQCstrc* library for the Python3 programming language was developed, with the aim of providing a tool for building *n*D models. In this article, I present the *PyQCstrc.ico* package in the library, which is dedicated to QCs with an icosahedral symmetry.

This article is organized as follows. In Section 2 I briefly describe the ODs in the 6D models for two 3D quasiperiodic tilings. In Section 3 I describe the Python package *PyQCstrc.ico*, which can be used to build and arrange the ODs in a 6D icosahedral lattice. In Section 4 an example is given, and a summary is provided in Section 5.

### 2. Occupation domains

In the higher-dimensional description of icosahedral quasicrystals (iQCs), the 6D model is described by a 6D icosahedral lattice which is decorated by 3D ODs embedded in . The 6D positional vector can be represented by using the unit vectors of the 6D icosahedral lattice, () (see Appendix *A*). Note that the choice of the unit vectors is arbitrary, and there are several conventions. The most frequently used are the conventions proposed by Cahn *et al.* (1986), Elser (1985) and Yamamoto (1996), and Yamamoto's is used in the package. The atomic positions are obtained from periodically arranged ODs by taking the intersections with . Thus, the shape of ODs and their positions in the 6D space must be derived to build the initial model of the iQCs.

Fig. 1(*a*) shows the OD that generates the vertices of the 3D Amman–Kramer–Neri (AKN) tiling (Kramer & Neri, 1984; Duneau & Katz, 1985; Elser, 1985, 1986; Kalugin *et al.*, 1985). The OD forms a rhombic triacontahedron (RT), which corresponds to the projection of the of the 6D icosahedral lattice onto , and it is centred at either the origin (0,0,0,0,0,0) or the body centre (1,1,1,1,1,1)/2, as shown in Fig. 1(*b*). Since the of these positions is , the RT OD can be generated from its by applying the 120 symmetry elements of . Here, the forms a tetrahedron, and its Cartesian coordinates in and are obtained from 6D vectors (0,0,0,0,0,0), , and by the projection operator (see Appendix *A*). The AKN tiling is composed of two building units, obtuse and acute rhombohedra, shown in Figs. 1(*c*) and 1(*d*), respectively.

To decorate the 3D quasiperiodic tiling with atoms, a new OD must be introduced and arranged in the 6D icosahedral lattice. The shape and position of the OD can be derived by utilizing the basic OD for the 3D quasiperiodic tiling. More details about the atomic decorations can be found in the literature (Yamamoto, 1992, 1996; Quiquandon *et al.*, 2014). For example, the edge centre position of the AKN tiling is generated by the rhombic icosahedron (RI) shown in Fig. 2(*a*), centred at (1,0,0,0,0,0)/2. The RI OD is obtained as a common part of two RT ODs at (0,0,0,0,0,0) and (1,0,0,0,0,0), when they are projected onto (Yamamoto, 1992).

The basic OD that is used for a realistic model becomes more complicated. For example, in the cluster-based model of primitive iQCs, the atomic clusters are arranged at the 12-fold packing sites of the AKN tiling (Yamamoto & Hiraga, 1988; Yamamoto, 1992; Takakura *et al.*, 2007; Quiquandon *et al.*, 2014). The cluster centre positions are generated by the truncated RT OD proposed by Henley (1986), shown in Fig. 2(*b*), centred at either (0,0,0,0,0,0) or (1,1,1,1,1,1)/2, and the relationship between local configurations of the clusters and the partitioning of the OD can be found in the literature (Takakura, 2008; Takakura & Strzałka, 2017). The truncated RT can be generated from its The atomic decoration of the clusters can be obtained by arranging the basic truncated RT OD in the 6D icosahedral lattice. When the ODs projected onto intersect, in many cases the common part forms a concave polyhedron. One of the most difficult parts in building the initial model is related to the calculation of the common part.

### 3. Implementation and availability

In order to use *QUASI* for structural analysis, each OD must be defined as a set of tetrahedra, and the 6D positional vector **x** whose perpendicular components assign each vertex of the constituent tetrahedra must be known. In the *PyQCstrc.ico* package, all vertices of a tetrahedron forming an OD are defined by 6D coordinates ( *x*_{1},*x*_{2},*x*_{3},*x*_{4},*x*_{5},*x*_{6}), and the value of *x*_{j} () is expressed as , where *k*_{1},*k*_{2},*k*_{3} are integers and τ is the golden ratio equal to (1+5 ^{1/2})/2.

The Cartesian coordinates in are given by , where is the lower 3×6 part of the transposed matrix of *Q* [equation (2)] and *X* is a transposed matrix of (*x*_{1},*x*_{2},*x*_{3},*x*_{4},*x*_{5},*x*_{6}). The resulting Cartesian coordinates are represented by a list with integer components when the unit is taken to be . This representation allows one to perform numerical computation free from the influence of rounding error.

The package provides tools commonly used to build the initial structure of iQCs, which include translation and symmetry operations in the 6D space, and intersection operations on ODs in . In addition, export and import of the ODs are supported: the ODs can be exported in *VESTA* format (`.vesta`) and *XYZ* format (`.xyz`), and these can be visualized by utilizing *VESTA* (Momma & Izumi, 2011). The latter can be imported so that users can recall their ODs in Python scripts. Moreover, the package supports the *QUASI* formats (`.pod` and `.atm`) (Yamamoto, 2008), as described in the supporting information.

In realistic models of iQCs, the ODs may be concave polyhedra, and their tetrahedralization is not straightforward. In the package, the intersection operation of such ODs is performed by considering every pair of two tetrahedra included in each OD. Because the intersection of two tetrahedra forms a convex polyhedron, its tetrahedralization can be achieved by 3D Delaunay triangulation. Then, the common part is obtained as the union of the resulting tetrahedra. In the case where the common part forms a convex polyhedron, such as the intersection of two convex polyhedra, the above process can be shortened, and the solution is obtained by 3D Delaunay triangulation.

The package is distributed in the Python Package Index (PyPI) software repository (https://pypi.org/project/pyqcstrc/) and is freely available via `pip install pyqcstrc`. The package requires two libraries, *numpy* (https://numpy.org/) and *scipy* (https://www.scipy.org/), and the Cython programming language (https://cython.org/). Moreover, it is recommended that one uses Python3.7 or greater built with the SSL module, *OpenSSL* (https://www.openssl.org/). The package was developed and tested under macOS (10.14), and it was also tested on other operating systems, including Linux (Ubuntu20.04, Fedora32 and CentOS8) and Windows 10.

### 4. Example

In this section, the basic usage of the *PyQCstrc.ico* package is described by providing a procedure in a Python script to obtain the RI OD [Fig. 1(*b*)]. We start with the of the basic RT OD [Fig. 1(*a*)]. This forms a tetrahedron whose vertices are assigned 6D coordinates as mentioned before. As seen below, the *j*th component of the 6D coordinates (), , is expressed by utilizing a list [ *k*_{1},*k*_{2},*k*_{3}]. The RI OD can be calculated in the following way:

Alternatively, the asymmetric part predefined in a file (`rt_asymmetric.xyz`) provided in the supporting information can be loaded as `od0`:

Here, `'/dir/of/xyz'` indicates a directory where the `rt_asymmetric.xyz` file is located.

(ii) Creating the RT OD from its

by applying the symmetry elements of around the origin:(iii) Creating the RT OD centred at (1,0,0,0,0,0):

(iv) Intersection operation on `od1` and `od2`:

(v) Export the resulting RI OD (`od3`) in *VESTA* and *XYZ* formats:

Here, `'/dir/of/work'` indicates a working directory.

(vi) `od3` can be imported from the `od3.xyz` file:

The calculation takes several minutes. To output the progress on the terminal, users can turn on verbose output by specifying an argument `verbose' set to be 1 (verbose = 1) or larger.

Since the RI OD (`od3`) forms a convex polyhedron, it is tetrahedralizable by 3D Delaunay triangulation. In this case, `ods.intersection_convex()` can be used, instead of (iv), as follows:

Moreover, the calculation cost can be greatly reduced by considering the `od1` inside the of at (1,0,0,0,0,0)/2 is considered, and obtained as below:

Then, the `od3` can be obtained by the following:

In the above expression, the (1,0,0,0,0,0)/2, while the projections of and are orthogonal to the fivefold axis. They are on different mirror planes which make an angle of 36°.

of is defined by three vectors , and . The projection of onto is parallel to a fivefold axis given by the projection of### 5. Summary and perspectives

The *PyQCstrc.ico* package provides tools commonly used to build the initial structure models of iQCs in the Python3 programing language. This is particularly crucial for realistic structure models where the overall shape of ODs is quite complicated. In addition, the package is useful to check the closeness conditions of the ODs and to specify atomic pairs related to phason flips. The latter can be used to compute the short-range-order diffuse scattering, based on the theory proposed by Yamamoto (2010*a*,*b*).

The *PyQCstrc.ico* package is part of the *PyQCstrc* library. Two other packages dedicated to decagonal and dodecagonal QCs are scheduled to be included in the future.

### APPENDIX A

### Coordinate system

The coordinate system used in this study is based on the one described in the literature (Yamamoto, 1996). The unit vectors of the 6D icosahedral lattice, (), are written using unit vectors in 3D , , , , and 3D , , , , as

with

where *a* is the lattice parameter of the icosahedral lattice.

### Supporting information

Further details of the software PyQCstrc.ico. DOI: https://doi.org//10.1107/S1600576721005951/tu5010sup1.pdf

of occupation domain in Fig.1a (rt_asymmeric.xyz). DOI: of occupation domain in Fig.2b (strt_asymmetric.xyz). DOI:### Acknowledgements

The author is grateful to A. Yamamoto for comments on the manuscript and for testing the *PyQCstrc.ico* package, and to H. Takakura for testing the package.

### Funding information

Funding for this research was provided by Japan Society for the Promotion of Science (grant No. JP18K13987; grant No. JP19H05818).

### References

Cahn, J. W., Shechtman, D. & Gratias, D. (1986). *J. Mater. Res.* **1**, 13–26. Web of Science CrossRef CAS Google Scholar

Duneau, M. & Katz, A. (1985). *Phys. Rev. Lett.* **54**, 2688–2691. CrossRef PubMed CAS Web of Science Google Scholar

Elser, V. (1985). *Phys. Rev. B*, **32**, 4892–4898. CrossRef CAS Web of Science Google Scholar

Elser, V. (1986). *Acta Cryst.* A**42**, 36–43. CrossRef CAS Web of Science IUCr Journals Google Scholar

Henley, C. L. (1986). *Phys. Rev. B*, **34**, 797–816. CrossRef CAS Web of Science Google Scholar

Janssen, T., Chapuis, G. & De Boissieu, M. (2007). *Aperiodic Crystals: From Modulated Phases to Quasicrystals.* Oxford University Press. Google Scholar

Kalugin, P., Kitaev, A. & Levitov, L. (1985). *JETP Lett.* **41**, 145–149. Google Scholar

Kramer, P. & Neri, R. (1984). *Acta Cryst.* A**40**, 580–587. CrossRef Web of Science IUCr Journals Google Scholar

Levine, D. & Steinhardt, P. J. (1984). *Phys. Rev. Lett.* **53**, 2477–2480. CrossRef CAS Web of Science Google Scholar

Momma, K. & Izumi, F. (2011). *J. Appl. Cryst.* **44**, 1272–1276. Web of Science CrossRef CAS IUCr Journals Google Scholar

Quiquandon, M., Portier, R. & Gratias, D. (2014). *Acta Cryst.* A**70**, 229–238. Web of Science CrossRef CAS IUCr Journals Google Scholar

Shechtman, D., Blech, I., Gratias, D. & Cahn, J. W. (1984). *Phys. Rev. Lett.* **53**, 1951–1953. CrossRef CAS Web of Science Google Scholar

Takakura, H. (2008). *Philos. Mag.* **88**, 1905–1912. Web of Science CrossRef CAS Google Scholar

Takakura, H., Gómez, C. P., Yamamoto, A., De Boissieu, M. & Tsai, A. P. (2007). *Nat. Mater.* **6**, 58–63. Web of Science CrossRef PubMed CAS Google Scholar

Takakura, H., Shiono, M., Sato, T. J., Yamamoto, A. & Tsai, A. P. (2001). *Phys. Rev. Lett.* **86**, 236–239. Web of Science CrossRef PubMed CAS Google Scholar

Takakura, H. & Strzałka, R. (2017). *J. Phys. Conf. Ser.* **809**, 012002. CrossRef Google Scholar

Yamamoto, A. (1992). *Phys. Rev. B*, **45**, 5217–5227. CrossRef CAS Web of Science Google Scholar

Yamamoto, A. (1996). *Acta Cryst.* A**52**, 509–560. CrossRef CAS Web of Science IUCr Journals Google Scholar

Yamamoto, A. (2008). *Sci. Technol. Adv. Mater.* **9**, 013001. Web of Science CrossRef PubMed Google Scholar

Yamamoto, A. (2010*a*). *Acta Cryst.* A**66**, 384–393. Web of Science CrossRef IUCr Journals Google Scholar

Yamamoto, A. (2010*b*). *Acta Cryst.* A**66**, 372–383. Web of Science CrossRef IUCr Journals Google Scholar

Yamamoto, A. & Hiraga, K. (1988). *Phys. Rev. B*, **37**, 6207–6214. CrossRef CAS Web of Science Google Scholar

This is an open-access article distributed under the terms of the Creative Commons Attribution (CC-BY) Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original authors and source are cited.