  A general technique for synthesizing both planar and conformal beamforming
metasurfaces is presented that utilizes full-wave modeling techniques and rapid
optimization methods. The synthesized metasurfaces consist of a patterned
metallic cladding supported by a finite-size grounded dielectric substrate. The
metasurfaces are modeled using integral equations which accurately account for
mutual coupling and the metasurface's finite dimensions. The synthesis
technique consists of three phases: a direct solve phase to obtain an initial
metasurface design with complex-valued impedances satisfying the desired
far-field beam specifications, a subsequent optimization phase that converts
the complex-valued impedances to purely reactive ones, and a final patterning
phase to realize the purely reactive impedances as a patterned metallic
cladding. The optimization phase introduces surface waves which facilitate
passivity. The metasurface is optimized using gradient descent with a
semi-analytic gradient obtained using the adjoint variable method. Three
examples are presented: a low-profile directly-fed metasurface antenna with
near perfect aperture efficiency, a scanned-beam reflectarray design with
controlled sidelobes, and a conformal metasurface reflectarray. The far-field
and near-field performance of the metasurfaces are verified and the bandwidth
and loss tolerance of the metasurfaces are investigated.
