Optimization based design of a wideband near zero refractive index metasurface for gain improvement of planar antennas in the terahertz band