Hi Florian,
I have attached a modified script, which I believe works correctly. Indeed the documentation has not been updated along with changed defaults and it also doesn't reflect the defaults in PiezoElectricTensor calculation.
For calculations involving the Berry phase Polarization (i.e. Polarization, BornEffectiveCharges, and PiezoElectricTensor) it is often necessary to decrease the electronic temperature from the default of 1000 K.
For the PiezoElectricTensor calculation itself, notice that we can calculate either the clamped ion contribution or the full contribution. The former is calculated by setting
while the later is obtained with
Both calculations are performed in the attached script.
Regards,
Troels