# Calculation error of elastic tensors

Thanks for your reply! So as we agree:

The known the stiffness tensor from MP is
C=[97 -20 -20 0 0 0
-20 97 -20 0 0 0
-20 -20 97 0 0 0
0 0 0 102 0 0
0 0 0 0 102 0
0 0 0 0 0 102]

If we let the first strain tensor be
epsilon_1=[ 0.004999903894075897, 0.0, 0.0 ], [ 0.0, -1.1102230246251565E-16, 0.0 ], [ 0.0, 0.0, -1.1102230246251565E-16 ]
we obtain the first stress tensor
sigma_1=C*epsilon_1=[0.485, 0, 0 ], [ 0, -0.1, 0 ], [ 0, 0, -0.1 ],
which is the same with [ 0.485835569, 0.0, -0.0 ], [ -0.0, -0.100418809, -0.0 ], [ -0.0, -0.0, -0.100418809 ]

But if we let the second strain tensor be
epsilon_2=[ -1.1102230246251565E-16, 0.0, 0.0 ], [ 0.0, -1.1102230246251565E-16, 0.005000051366872475 ], [ 0.0, 0.005000051366872475, -8.041918347911903E-8 ]
we obtain the second stress tensor
sigma_2=C*epsilon_2=[0, 0, 0 ], [ 0, 0, 5.1 ], [ 0, 5.1 , 0 ]
which is different from [ -0.177069249, -0.0, -0.0 ], [ -0.0, -0.166530955, 1.024832653 ], [ -0.0, 1.024832653, -0.18702881500000001 ]

Could you please tell me the reason? Is the stiffness tensor provided by MP not correct OR I made some mistakes during the derivation process?

So it looks like you’re doing the tensor multiplication incorrectly. In voigt notation, you can’t just multiply the matricies because there are unstated extra factors: specifically we don’t include the \sqrt(2)/2 factors, but some voigt representations do, and others use \sqrt(2). It also looks like you’re off by an order of magnitude in your multiplication: 100\times0.005=0.5 not 5.0 I would use ElasticTensor.calculate_stress method in pymatgen as this is pretty rigorously tested.