  Photonic systems utilized as components for optical computing promise the
potential of enhanced computational ability over current computer
architectures. Here, an all-dielectric photonic metastructure is investigated
for application as a quantum algorithm emulator (QAE) in the terahertz
frequency regime; specifically, we show implementation of the Deustsh-Josza
algorithm. The design for the QAE consists of a gradient-index (GRIN) lens as
the Fourier transform subblock and silicon as the oracle subblock. First, we
detail optimization of the metastructure through numerical analysis. Then, we
employed inverse design through a machine learning approach to further optimize
the structural geometry. In particular, we improved the lens thickness, in
order to enhance the resulting output signal for both balanced and constant
functions. We show that by optimizing the thickness of the gradient-index lens
through ML, we enhance the interaction of the incident light with the
metamaterial leading to a stronger focus of the outgoing wave resulting in more
accurate implementation of the desired quantum algorithm in the terahertz.
