Skip to content

Instantly share code, notes, and snippets.

View matthewkuner's full-sized avatar

Matthew Kuner matthewkuner

View GitHub Profile
@gVallverdu
gVallverdu / read_forces.py
Last active July 5, 2024 06:27
Read forces in an OUTCAR file using pymatgen
# This is an example about how to read forces in an OUTCAR file
#
# The forces acting on each ions are provided in an OUTCAR file.
# you can read the table using the Outcar.read_table_pattern() method
# here are the working regex in order to read the forces.
# At the end you get a multiple list with forces as float.
# With last_one_only=False, the first index of the list is the ionic step,
# the second is the atom index and the last is 0, 1 or 2 for f_x, f_y and f_z
# respectively.
#
@terencezl
terencezl / symmetrizing-the-elastic-tensor-with-crystal-symmetry-operations.md
Created April 12, 2016 22:44
symmetrizing-the-elastic-tensor-with-crystal-symmetry-operations.md

Introduction

Density functional theory (DFT) has proven to be an effective way to obtain the physical properties of material systems. Using the linear stress-strain relationship, one is able to obtain the elastic constants from a set of DFT calculations. One particular challenge is that the elastic tensor thus obtained is usually not numerically symmetric with respect to the crystal symmetry. Neumann's principle, or principle of symmetry, states that [^1]:

If a crystal is invariant with respect to certain symmetry operations, any of its physical properties must also be invariant with respect to the same symmetry operations, or otherwise stated, the symmetry operations of any physical property of a crystal must include the symmetry operations of the point group of the crystal.

Therefore, it is worthwhile working out a routine to symmetrize the elastic tensor using the symmetry operations of the crystal.

Theoretical formulation

A $3\times 3 \times 3\times 3$ elastic tensor ${c_{ijkl}}$ has the in