Inspired by the nonlocal external potential method by Lany et al., we modify the VASP source code to add a user-defined potential to atomic orbitals in the system. Within the PAW implementation, the physically-relevant all-electron wave function ψn is constructed from computationally-convenient pseudo wave functions ψn. ψn and ψn are expressed in plane waves. The mapping from ψn to ψn is performed using the linear transformation