  In silico materials design is hampered by the computational complexity of
Kohn-Sham DFT, which scales cubically with the system size. Owing to the
development of new-generation kinetic energy density functionals (KEDFs),
orbital-free DFT (OFDFT, a linear-scaling method) can now be successfully
applied to a large class of semiconductors and such finite systems as quantum
dots and metal clusters. In this work, we present DFTpy, an open source
software implementing OFDFT written entirely in Python 3 and outsourcing the
computationally expensive operations to third-party modules, such as NumPy and
SciPy. When fast simulations are in order, DFTpy exploits the fast Fourier
transforms (FFTs) from PyFFTW. New-generation, nonlocal and
density-dependent-kernel KEDFs are made computationally efficient by employing
linear splines and other methods for fast kernel builds. We showcase DFTpy by
solving for the electronic structure of a million-atom system of aluminum metal
which was computed on a single CPU. The Python 3 implementation is
object-oriented, opening the door to easy implementation of new features. As an
example, we present a time-dependent OFDFT implementation (hydrodynamic DFT)
which we use to compute the spectra of small metal cluster recovering
qualitatively the time-dependent Kohn-Sham DFT result. The Python code base
allows for easy implementation of APIs. We showcase the combination of DFTpy
and ASE for molecular dynamics simulations (NVT) of liquid metals. DFTpy is
released under the MIT license.
