Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to transform elastic constants after a change of basis with the help of pymatgen? #4139

Closed
hongyi-zhao opened this issue Oct 26, 2024 · 1 comment

Comments

@hongyi-zhao
Copy link
Contributor

hongyi-zhao commented Oct 26, 2024

Hi there,

I have a question about transforming elastic constants when changing the basis/coordinate system. Does pymatgen provide functionality for this kind of transformation?

Specifically, I want to:

  1. Take a 6x6 elastic constant matrix in Voigt notation
  2. Apply a basis transformation
  3. Get the transformed elastic constants in the new basis

Is there a built-in method to do this in pymatgen? If not, what would be the recommended way to implement this?

Thanks in advance!
Zhao

P.S.:

The following things seem to have something to do with this problem:

  1. https://pymatgen.org/pymatgen.core.html#pymatgen.core.operations.SymmOp.transform_tensor

  2. def get_ieee_rotation(

But the documentation link shown here is outdated:

image

@hongyi-zhao
Copy link
Contributor Author

hongyi-zhao commented Oct 28, 2024

Based on the related documentation here and here, I got the following solution based on the method here in order to demonstrate some of the methodology conventions of simulating elasticity calculations adopted by the materials project. The details and parameter settings of the vasp calculations may not necessarily be consistent, so the final results cannot be directly and accurately compared with those in the Materials Project database.

In the following test, we use the cif structure file from the legacy database to prepare the POSCAR, as shown below:

# Steps to do the test, using Si_mp-149_primitive.cif as an example:
# Use your python venv accordingly:
$ pyenv shell datasci 
$ python struct2conv.py -i Si_mp-149_primitive.cif -o Si_mp-149_conventional_standard.vasp
$ mkdir Si_mp-149_conventional_standard && cd Si_mp-149_conventional_standard
$ ln -sfr ../Si_mp-149_conventional_standard.vasp POSCAR
$ (echo 101; echo DC)|vaspkit
$ (echo 102; echo 2; echo 0.03)|vaspkit

# Comment out the `NPAR` tag in INCAR and run the vasp calculation:
$ mpirun -n 16 vasp_std

# Extract the elastic tensor
$ echo 203 |vaspkit

# Convert elastic tensor to IEEE format
$ python ../elastic2ieee.py

All related necessary files and scripts are as follows:

elastic2ieee.zip

See below for the related discussions and tools:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant