  We introduce a new optimization procedure for Euclidean path integrals which
compute wave functionals in conformal field theories (CFTs). We optimize the
background metric in the space on which the path integration is performed.
Equivalently this is interpreted as a position-dependent UV cutoff. For
two-dimensional CFT vacua, we find the optimized metric is given by that of a
hyperbolic space and we interpret this as a continuous limit of the conjectured
relation between tensor networks and Anti--de Sitter (AdS)/conformal field
theory (CFT) correspondence. We confirm our procedure for excited states, the
thermofield double state, the Sachdev-Ye-Kitaev model and discuss its extension
to higher-dimensional CFTs. We also show that when applied to reduced density
matrices, it reproduces entanglement wedges and holographic entanglement
entropy. We suggest that our optimization prescription is analogous to the
estimation of computational complexity.
