Pressure tensor estimator 233
5.7 Derivation of the pressure tensor estimator from the canonical
partition function
Molecular dynamics calculations in isobaric ensembles require explicit microscopic
estimators for the pressure. In Section 4.6.3, we derived an estimator for the isotropic
internal pressure (see eqn. (4.6.57)). In this section, we generalize the derivation and
obtain an estimator for the pressure tensor. For readers wishingto skip over the
mathematical details of this derivation, we present the final result:
P(int)αβ (r,p) =
1
det(h)
∑N
i=1
[
(pi·ˆeα)(pi·ˆeβ)
mi
+ (Fi·ˆeα)(ri·ˆeβ)
]
, (5.7.1)
whereˆeαandˆeβare unit vectors along theαandβspatial directions, respectively.
Thus, (pi·ˆeα) is just theαth component of the momentum vectorpi, withα=x,y,z.
The internal pressure tensorPαβ(int)at fixedhis simply a canonical ensemble average
of the estimator in eqn. (5.7.1).
The derivation of the pressure tensor requires a transformationfrom the primitive
Cartesian variablesr 1 ,...,rN,p 1 ,...,pNto scaled variables, as was done in Section 4.6.3
for the isotropic pressure estimator. In order to make the dependence of the Hamil-
tonian and the partition function on the box matrixhexplicit, we introduce scaled
variabless 1 ,...,sNrelated to the primitive Cartesian positions by
ri=hsi. (5.7.2)
The right side of eqn. (5.7.2) is a matrix-vector product, which, in component form,
appears as
ri·ˆeα=
∑
β
hαβ(si·ˆeβ), (5.7.3)
or in more compact notation,
ri,α=
∑
β
hαβsi,β, (5.7.4)
whereri,α=ri·ˆeαandsi,β=si·ˆeβ.
Not unexpectedly, the corresponding transformation for the momenta requires mul-
tiplication by the inverse box matrixh−^1. However, sincehandh−^1 are not symmetric,
should the matrix be multiplied on the right or on the left. The Lagrangian formula-
tion of classical mechanics of Section 1.4 provides us with a direct route for answering
this question. Recall that the Lagrangian is given by
L(r,r ̇) =
1
2
∑
i
mir ̇^2 i−U(r 1 ,...,rN). (5.7.5)
The Lagrangian can be transformed into the scaled coordinates bysubstituting eqn.
(5.7.4) and the corresponding velocity transformation
r ̇i,α=
∑
β
hαβs ̇i,β (5.7.6)