Quantum Fourier transform (QFT) is a widely used building block for quantum algorithms, whose scalable implementation is challenging in experiments. Here, we propose a protocol of quadratic quantum Fourier transform (QQFT), considering cold atoms confined in an optical lattice. This QQFT is equivalent to QFT in the single-particle subspace, and produces a different unitary operation in the entire Hilbert space. We show this QQFT protocol can be implemented using programmable laser potential with the digital-micromirror-device techniques recently developed in the experiments. The QQFT protocol enables programmable Hamiltonian engineering, and allows quantum simulations of Hamiltonian models, which are difficult to realize with conventional approaches. The flexibility of our approach is demonstrated by performing quantum simulations of one-dimensional Poincar\'{e} crystal physics and two-dimensional topological flat bands, where the QQFT protocol effectively generates the required long-range tunnelings despite the locality of the cold atom system. We find the discrete Poincar\'{e} symmetry and topological properties in the two examples respectively have robustness against a certain degree of noise that is potentially existent in the experimental realization. We expect this approach would open up wide opportunities for optical lattice based programmable quantum simulations.