  In this work we elaborate on holographic description of the path-integral
optimization in conformal field theories (CFT) using Hartle-Hawking wave
functions in Anti-de Sitter spacetimes. We argue that the maximization of the
Hartle-Hawking wave function is equivalent to the path-integral optimization
procedure in CFT. In particular, we show that metrics that maximize gravity
wave functions computed in particular holographic geometries, precisely match
those derived in the path-integral optimization procedure for their dual CFT
states. The present work is a detailed version of \cite{Boruch:2020wax} and
contains many new results such as analysis of excited states in various
dimensions including JT gravity, and a new way of estimating holographic
path-integral complexity from Hartle-Hawking wave functions. Finally, we
generalize the analysis to Lorentzian Anti-de Sitter and de Sitter geometries
and use it to shed light on path-integral optimization in Lorentzian CFTs.
