Elastic3rd: A tool for calculating third-order elastic constants from first-principles calculations,☆☆

https://doi.org/10.1016/j.cpc.2020.107777Get rights and content

Abstract

The third-order elastic constants (TOECs) are fundamental to describe crystal’s nonlinear response to stress, and can be applied to explore anharmonic properties of crystals such as Grüneisen parameters, thermal expansion coefficient, and the effect of pressure on second-order elastic constants (SOECs). Here, we report an open-source python package, Elastic3rd, which is able to calculate the SOECs and TOECs using the strain–energy method for crystals with any symmetry from first-principles calculations. An algorithm to generate necessary strain modes and the corresponding coefficients for a given symmetry is proposed. These strain modes are then applied to the fully relaxed structure to generate the deformed structures. The total energies of the strained structures are calculated by a chosen first-principles code, and the SOECs and TOECs are determined by fitting the resulted strain–energy data. The present code has been validated by several case studies of C, Si and Mg, and the case of MnP4 shows the ability for low-symmetry crystals.

Program summary

Program title: Elastic3rd

CPC Library link to program files: https://doi.org/10.17632/n54vr2kwx8.1

Developer’s repository link: https://github.com/hitliaomq/ELASTIC3rd

Licensing provisions: GNU General Public License 3

Programming language: Python 2.7.X and Python 3.X.

External routines/libraries: Numpy [1], Scipy [2], and Matplotlib [3].

Nature of problem: To automatically calculate the third-order elastic constants for crystals with any symmetry from first-principles calculations.

Solution method: Firstly, the deformed patterns and the corresponding coefficients for the second- and third-order elastic constants are automatically generated according to the symmetry. Secondly, the deformed patterns are applied to the initial lattice and the corresponding input files for first-principles calculations are generated. Thirdly, the energies of the deformed structures are calculated by first-principles software such as CASTEP [4] and VASP [5]. Then, the parameters of strain–energy functions are obtained by fitting the strain and energy relationships. Finally, the third-order elastic constants are determined by solving the linear-independent equations, and the second-order elastic constants are calculated by solving the overdetermined equation using the least squares method.

Addition comments including restrictions and unusual features: This code is well modularized. Thus, the energy can be calculated using energy-generated first-principles or other packages only by writing few functions.

[1] S. Van Der Walt, S.C. Colbert, G. Varoquaux, Comput. Sci. Eng. 13(2011):22–30

[2] P. Virtanen, R. Gommers, T.E. Oliphant, et al., ArXiv:1907.10121 (2019).

[3] J.D. Hunter, Comput. Sci. Eng. 9(2007):99–104.

[4] S.J. Clark, M. D. Segall, C.J. Pickard, et al. Z. Kristallogr. 220(2005):567-570.

[5] G. Kresse, J. Furthmüller, Phys. Rev. B 54 (1996) 11169.

Introduction

The third-order elastic constants (TOECs) describe the anharmonic response to an applied stress and hence the most important parameter to depict the nonlinear response of materials such as the long-wavelength acoustic phonon anharmonicities [1], the Grüneisen parameters [2], the development of empirical interatomic potentials [3], the effect of pressure on second-order elastic constants (SOECs) [4], and the ductility [5]. Experimentally, the TOECs can be determined by measuring sound velocities under different loading conditions [6]. However, in comparison with the SOECs, the number of independent components of TOECs increases dramatically, in particular for the low-symmetry crystals, making it difficult and expensive to determine the TOECs from experiments.

The calculations of elastic constants from density function theory (DFT) have been well developed, especially for SOECs [7], [8], [9]. Most packages for DFT-based calculations can predict the SOECs directly, e.g., CASTEP [10] and VASP [11], or determine SOECs from energy calculations, e.g. ElaStic [12] and AELAS [13]. In addition, some DFT-based databases such as Materials Project [14] and MatCloud [15] contain SOECs, and some post-codes were developed to display the anisotropy of SOECs, for example ElAM [16], ELATE [17] and ElasticPOST [18].

However, the calculations of TOECs are less developed. Keating [19], [20] introduced the empirical force-constant models. Cağin et al. [21], [22] proposed the molecular dynamics method. Especially, Srinivasan [23] developed the homogeneous-deformation method, which becomes the most popular method for determining TOECs theoretically. The homogeneous-deformation method has been successfully applied to cubic crystals in combination with first-principles calculations [24]. Zhao [25] generalized this method to arbitrary symmetry, but exemplified only for the cubic and trigonal crystals. The key in this method is to select the proper strain modes and determine the corresponding coefficients in the strain versus energy equations. To the best of our knowledge, the lowest symmetry is orthorhombic by applying the homogeneous-deformation method to calculate TOECs [26]. Moreover, owing to the huge number of independent TOECs, the calculations of TOECs are very time consuming, and until now, there is only one open source code (combined pymatgen [27] and atomate [28]) is available to calculate the TOEC [29].

In this work, we present an algorithm to deduce the necessary strain modes and the corresponding coefficients for calculating TOECs, and introduce the Elastic3rd, which is an open source python package for automatically calculating TOECs with arbitrary symmetry from first-principles calculations. The outline of the paper is as follows. In Section 2, we briefly review the computational method for TOECs. Section 3 gives the algorithm to generate the necessary strain modes for different symmetries. The structure and the main features of the present code are shown in Section 4 and Section 5, respectively. Finally, the reliability and generality of the present code is validated by some cases in Section 6, and we give a future direction of Elastic3rd in Section 7.

Section snippets

Theoretical background of TOECs

The TOECs can be calculated using the finite deformations approach (or the strain–energy method) according to Zhao et al. [25]. Here, a brief introduction of this method is presented. The energy (E) of the deformed crystal can be written as follows (the Einstein summation notation is assumed in following equations), E=E0+12!V0Cijklηijηkl+13!V0Cijklmnηijηklηmn+where E0 is the energy of undeformed structure of interest, Cijkl and Cijklmn are SOECs and TOECs, respectively, ηij is the Lagrangian

Generation of strain modes for arbitrary symmetry

As described in Section 2, the key to calculate the TOECs is to determine the Lagrangian strain (ηij) and the corresponding coefficients (A2 and A3 in Eq. (5)). In the present code, the algorithm of generating of strain modes and corresponding coefficients can be divided into two parts: the coefficients for a given strain modes and the choice of the combination of strain modes.

The design of the code

The workflow of the present Elastic3rd code is shown in Fig. 3. The procedure is as follows: (1) generating the strain modes according to the symmetry by the algorithm described in Section 3; (2) applying these strain modes to the undeformed structure and generating the deformed structure; (3) calculating the total energy of the deformed structures; (4) fitting the strain–energy data and solving the corresponding equations, where the number of equations is equal to the number of the independent

Installation and running of the code

The simplest way to install the code is using pip, and the user just need to run: pip install elastic3rd

An alternative way to install the code is using the setup.py script. It performs the following operations: (1) Download this code and decompress it; (2) Change current path to the ELASTIC3RD/src folder; and (3) Run the following command: python setup.py install .

After installing the code and preparing the input files, the user can run the code by elastic3rd run or use the runElastic3rd.py (in

Implementation

This section presents some results of TOECs and SOECs obtained by the Elastic3rd code with two cubic (C and Si) and one hexagonal (Mg) crystals which were well studied from experiments and calculations. To show the capability of our code, a triclinic crystal (MnP4) was also investigated. Table 1 shows the computational details of the studied C, Si, Mg and MnP4 in the present work.

Summary and perspective

The present work provides a python-based open-source software, Elastic3rd, for calculating the third-order elastic constants (TOECs) for crystal with any symmetry. Comparing with the previous experiments and calculations of high symmetry crystals (C, Si and Mg) indicates the present code is reliable, and the result of low-symmetry crystal (MnP4) confirms the generality of the present code. Although the success of the present Elastic3rd, we are continuing to develop Elastic3rd code in order to

Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Acknowledgment

This work was supported by the opening funding of National Key Laboratory of Science and Technology on Advanced Composites in Special Environments (Jingchuan Zhu), China . In addition, the China Scholarship Council (Mingqing Liao) and the China Postdoctoral Science Foundation (Fei Zhou) also funded this project.

References (43)

  • LiX.

    Acta Mater.

    (2018)
  • LiaoM. et al.

    Intermetallics

    (2018)
  • GolesorkhtabarR. et al.

    Comput. Phys. Comm.

    (2013)
  • ZhangS.H. et al.

    Comput. Phys. Comm.

    (2017)
  • YangX. et al.

    Comput. Mater. Sci.

    (2018)
  • MarmierA. et al.

    Comput. Phys. Comm.

    (2010)
  • FanJ. et al.

    Comput. Mater. Sci.

    (2019)
  • OngS.P. et al.

    Comput. Mater. Sci.

    (2013)
  • MathewK. et al.

    Comput. Mater. Sci.

    (2017)
  • PfrommerB.G. et al.

    J. Comput. Phys.

    (1997)
  • SaundersG.A. et al.

    Phys. Rev. B

    (1993)
  • ChantasiriwanS. et al.

    Phys. Rev. B

    (1998)
  • MathewV.M. et al.

    J. Mater. Sci.

    (2002)
  • De JongM. et al.

    Phys. Rev. B

    (2017)
  • ThurstonR.N. et al.

    Phys. Rev.

    (1964)
  • ShangS. et al.

    Appl. Phys. Lett.

    (2007)
  • LiaoM. et al.

    Comput. Mater. Sci.

    (2019)
  • ClarkS.J. et al.

    Z. Kristallogr. - Cryst. Mater.

    (2005)
  • KresseG. et al.

    Phys. Rev. B

    (1996)
  • JainA. et al.

    APL Mater.

    (2013)
  • GaillacR. et al.

    J. Phys. Condens. Matter

    (2016)
  • Cited by (29)

    • First-principles calculations to investigate third-order elastic constant, anharmonicity and temperature dependent second elastic constant of thermoelectric materials Cu<inf>3</inf>MSe<inf>4</inf>(M = V and Nb)

      2023, Chemical Physics Letters
      Citation Excerpt :

      The second elastic constants are calculated via a direct stress–strain method. The third elastic constants are calculated using Elastic3rd[42]. The maximum strain parameter is the variation of − 0.06 to 0.06 with a step of 0.01.

    View all citing articles on Scopus

    The review of this paper was arranged by Prof. N.S. Scott.

    ☆☆

    This paper and its associated computer program are available via the Computer Physics Communication homepage on ScienceDirect (http://www.sciencedirect.com/science/journal/00104655)

    View full text