A formalism is presented for the real-space implementation of the projector
based nonlocal pseudopotentials in a plane wave density functional theory
calculation. A unified mask function is used to truncate the projector in r
eal space beyond a cutoff radius. About a thousandfold improvement in the a
ccuracy can be achieved by the use of this mask function. Compared to previ
ous methods. the current method does not need prefitting for each individua
l pseudopotential.