  Media with correlated disorder display unexpected transport properties, but
it is still a challenge to design structures with desired spectral features at
scale. In this work, we introduce an optimal formulation of this inverse
problem by means of the non-uniform fast Fourier transform, thus arriving at an
algorithm capable of generating systems with arbitrary spectral properties,
with a computational cost that scales $O(N \log N)$ with system size. The
method is extended to accommodate arbitrary real-space interactions, such as
short-range repulsion, to simultaneously control short- and long-range
correlations. We thus generate the largest-ever stealthy hyperuniform
configurations in $2d$ ($N = 10^9$) and $3d$ ($N > 10^7$). By an Ewald sphere
construction we link the spectral and optical properties at the
single-scattering level, and show that these structures in $2d$ and $3d$
generically display transmission gaps, providing a concrete example of
fine-tuning of a physical property at will. We also show that large $3d$
power-law hyperuniformity in particle packings leads to single-scattering
properties near-identical to those of simple hard spheres. Finally, we show
that enforcing large spectral power at a small number of peaks with the right
symmetry leads to the non-deterministic generation of quasicrystalline
structures in both $2d$ and $3d$.
